@feedmepos/mf-menu 0.20.2 → 0.21.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/{ApplyProduct.vue_vue_type_script_setup_true_lang-Ds2qfY_X.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DxlJ6xrN.js} +10 -10
- package/dist/{ApplyProducts.vue_vue_type_script_setup_true_lang-BRepaPR3.js → ApplyProducts.vue_vue_type_script_setup_true_lang-CF-fCyCs.js} +5 -4
- package/dist/{Catalog-S5KDEWzG.js → Catalog-CVmJyr3D.js} +74 -73
- package/dist/{Category-DLaNEtA5.js → Category-CjzACwyb.js} +6 -6
- package/dist/{CookingGuide-DSGZapxz.js → CookingGuide-COZFvS4P.js} +7 -6
- package/dist/{Group-CBMSkmwQ.js → Group-Bun-FrIN.js} +1 -1
- package/dist/{Group-B0VQ-64x.js → Group-xCFTbuXd.js} +7 -7
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DKzrhXtM.js → Group.vue_vue_type_script_setup_true_lang-DSfas9NO.js} +57 -56
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BV-FC8tM.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-kl0WpFCW.js} +24 -24
- package/dist/{Ingredient-CnPQ0kiR.js → Ingredient-w4kVvEml.js} +69 -68
- package/dist/{LinkProductSideSheet-A26Otbdm.js → LinkProductSideSheet-CBHtwxCb.js} +30 -29
- package/dist/{PrintRoute-BlJMdPP0.js → PrintRoute-DXsa638J.js} +30 -29
- package/dist/{Product-BvD813LL.js → Product-BAtB4ebt.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-D_oKtXbh.js → Product.vue_vue_type_script_setup_true_lang-DeJy-daz.js} +276 -279
- package/dist/{Products-B8Ok-bkN.js → Products-BQHiOdhZ.js} +24 -23
- package/dist/{Publish-qBiJUQ4X.js → Publish-DbxeuyRV.js} +68 -67
- package/dist/{Recipe-CJxJJAUV.js → Recipe-T2PlHYY_.js} +84 -83
- package/dist/{Scheduler-DfAMwXCu.js → Scheduler-C-W85pjK.js} +2 -2
- package/dist/{SchedulerSelector.vue_vue_type_script_setup_true_lang-CArE_Hua.js → SchedulerSelector.vue_vue_type_script_setup_true_lang-DQNfBh14.js} +1 -1
- package/dist/ServingSequence-lNzb6f-1.js +4 -0
- package/dist/{Setting-BbgJcWsN.js → Setting-C8gm77EA.js} +1 -1
- package/dist/{Setting.vue_vue_type_script_setup_true_lang-BbVEzNve.js → Setting.vue_vue_type_script_setup_true_lang-BR3_ywqR.js} +13 -12
- package/dist/{Takeaway-wAXsZQN2.js → Takeaway-CCw_DHze.js} +12 -12
- package/dist/{Takeaway-CMDFYeUw.js → Takeaway-DbHgvpIH.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DSphRs_i.js → Takeaway.vue_vue_type_script_setup_true_lang-DsUQ3Dlh.js} +22 -21
- package/dist/{TaxSetting-C1XOTv-9.js → TaxSetting-BQdKVfBi.js} +4 -4
- package/dist/{Unit-BW3iqgp8.js → Unit-M217TP4K.js} +22 -21
- package/dist/{Variant-BJIxp9PJ.js → Variant-Boy7TugQ.js} +10 -10
- package/dist/{_id_-B25OxuPV.js → _id_-DA8Gpcqf.js} +6 -6
- package/dist/{app-BFJlAowN.js → app-rWkFl8Vq.js} +43468 -73420
- package/dist/app.js +4 -4
- package/dist/assets/linked-status-C8QAoUQr.js +24 -0
- package/dist/assets/validate-menu-DuCKFpOM.js +24 -0
- package/dist/{catalog-Do7RfIKm.js → catalog-Bas11mgo.js} +21595 -21593
- package/dist/{catalog-B-Z6lEFK.js → catalog-CfrgLaRX.js} +1 -1
- package/dist/{category-DEWEor3m.js → category-D-4M9HY7.js} +5 -4
- package/dist/currency-BPHwez-E.js +7 -0
- package/dist/index-Cwb_hpVz.js +7393 -0
- package/dist/{index-BEdHzZvu.js → index-v25k4isU.js} +47 -47
- package/dist/{item-BooojPpg.js → item-DTVh14mw.js} +1195 -1194
- package/dist/{lodash-247YxYiQ.js → lodash-BsZHKgKE.js} +439 -439
- package/dist/{menu-DCnWrgH7.js → menu-CUz01P4H.js} +6 -5
- package/dist/{object-B2cP_UeG.js → object-CbSdUbPF.js} +25 -25
- package/dist/{scheduler-0cChIv2I.js → scheduler-BuIczYeS.js} +13 -12
- package/dist/{takeaway-mwqVQ1ij.js → takeaway-DC-YsV2Q.js} +28 -27
- package/dist/{toExcel-Dha8Vf3u.js → toExcel-CaiFM8FE.js} +237 -237
- package/dist/{unit-BgfdgXAu.js → unit-D_VflvJf.js} +6 -5
- package/dist/{vuedraggable-BEszc36M.js → vuedraggable-WU01qJgi.js} +110 -110
- package/package.json +3 -3
- package/dist/ServingSequence-DxDMeto7.js +0 -4
- package/dist/assets/linked-status-4i88AmvK.js +0 -24
- package/dist/assets/validate-menu-CTKwgXfw.js +0 -24
- package/dist/currency-33gUke3q.js +0 -7
- package/dist/index-BXl09ebx.js +0 -21908
|
@@ -1,96 +1,97 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { u as
|
|
3
|
-
import { _ as $e } from "./SchedulerSelector.vue_vue_type_script_setup_true_lang-
|
|
4
|
-
import { useI18n as Ce, useCoreStore as
|
|
5
|
-
import { useSnackbar as
|
|
1
|
+
import { ref as N, computed as g, defineComponent as ce, resolveComponent as q, openBlock as b, createBlock as G, withCtx as O, createVNode as i, createElementVNode as f, toDisplayString as Q, unref as l, createElementBlock as z, Fragment as xe, renderList as Ne, createTextVNode as He, mergeModels as Ze, useModel as Je, renderSlot as he, watch as pe, h as A, withModifiers as Ve, createCommentVNode as ue, resolveDynamicComponent as Qe, normalizeStyle as Xe, normalizeClass as se, nextTick as et, watchEffect as tt } from "vue";
|
|
2
|
+
import { u as ge, a as je, w as ve, F as lt, x as at, i as ie, d as ot, y as Fe, g as De } from "./app-rWkFl8Vq.js";
|
|
3
|
+
import { _ as $e } from "./SchedulerSelector.vue_vue_type_script_setup_true_lang-DQNfBh14.js";
|
|
4
|
+
import { useI18n as Ce, useCoreStore as nt } from "@feedmepos/mf-common";
|
|
5
|
+
import { useSnackbar as Ue, useDialog as Be, components as re, FmButtonVariant as Y, FmButtonColorThemeVariant as R, useBreakpoints as Ae } from "@feedmepos/ui-library";
|
|
6
|
+
import { Country as rt, Dinero as _e } from "@feedmepos/core";
|
|
6
7
|
import "vue-router";
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import "./vuedraggable-
|
|
10
|
-
import {
|
|
11
|
-
import { _ as
|
|
12
|
-
import { f as
|
|
13
|
-
import { l as
|
|
14
|
-
import { u as
|
|
15
|
-
import { w as
|
|
16
|
-
import { F as
|
|
8
|
+
import { u as be } from "./menu-CUz01P4H.js";
|
|
9
|
+
import { u as Ee } from "./category-D-4M9HY7.js";
|
|
10
|
+
import "./vuedraggable-WU01qJgi.js";
|
|
11
|
+
import { _ as st, c as Te, a as ut, u as it } from "./catalog-Bas11mgo.js";
|
|
12
|
+
import { _ as ct } from "./takeaway-DC-YsV2Q.js";
|
|
13
|
+
import { f as dt } from "./currency-BPHwez-E.js";
|
|
14
|
+
import { l as fe } from "./lodash-BsZHKgKE.js";
|
|
15
|
+
import { u as Ke, m as mt } from "./item-DTVh14mw.js";
|
|
16
|
+
import { w as pt } from "./InfoBasic.vue_vue_type_script_setup_true_lang-DxQBDu16.js";
|
|
17
|
+
import { F as vt } from "./object-CbSdUbPF.js";
|
|
17
18
|
import { _ as Ie } from "./TextChip.vue_vue_type_script_setup_true_lang-CNp85hoQ.js";
|
|
18
|
-
import { L as
|
|
19
|
-
function
|
|
20
|
-
const m =
|
|
19
|
+
import { L as Oe } from "./LinkProductSideSheet-CBHtwxCb.js";
|
|
20
|
+
function ft(M, d) {
|
|
21
|
+
const m = N(!0), n = g(() => {
|
|
21
22
|
var p, y;
|
|
22
|
-
return !m.value && (!d.value || ((p = d.value) == null ? void 0 : p.length) === ((y =
|
|
23
|
-
}),
|
|
23
|
+
return !m.value && (!d.value || ((p = d.value) == null ? void 0 : p.length) === ((y = M.value) == null ? void 0 : y.length));
|
|
24
|
+
}), F = g(() => {
|
|
24
25
|
var p, y, $, _;
|
|
25
|
-
return !!((p = d.value) != null && p.length && ((y = d.value) == null ? void 0 : y.length) > 0 && (($ = d.value) == null ? void 0 : $.length) < ((_ =
|
|
26
|
+
return !!((p = d.value) != null && p.length && ((y = d.value) == null ? void 0 : y.length) > 0 && (($ = d.value) == null ? void 0 : $.length) < ((_ = M.value) == null ? void 0 : _.length));
|
|
26
27
|
});
|
|
27
|
-
return { allCleared: m, allSelected:
|
|
28
|
+
return { allCleared: m, allSelected: n, indeterminate: F, toggleAll: () => {
|
|
28
29
|
d.value = void 0, m.value = !m.value;
|
|
29
30
|
}, toggleOption: (p) => {
|
|
30
|
-
var $, _,
|
|
31
|
+
var $, _, W;
|
|
31
32
|
let y;
|
|
32
|
-
d.value === void 0 && m.value ? y = [p] : d.value === void 0 && !m.value ? y = ($ =
|
|
33
|
+
d.value === void 0 && m.value ? y = [p] : d.value === void 0 && !m.value ? y = ($ = M.value.map((T) => T.value)) == null ? void 0 : $.filter((T) => T !== p) : (_ = d.value) != null && _.includes(p) ? y = (W = d.value) == null ? void 0 : W.filter((T) => T !== p) : y = [...d.value || [], p], y.length === 0 ? (d.value = void 0, m.value = !0) : y.length === M.value.length ? (d.value = void 0, m.value = !1) : d.value = y;
|
|
33
34
|
} };
|
|
34
35
|
}
|
|
35
|
-
const
|
|
36
|
+
const bt = { class: "p-4" }, gt = { class: "flex-1 overflow-y-auto min-h-0" }, Me = /* @__PURE__ */ ce({
|
|
36
37
|
__name: "CategorySelector",
|
|
37
|
-
setup(
|
|
38
|
-
const d =
|
|
38
|
+
setup(M) {
|
|
39
|
+
const d = ge(), { categories: m, selectedCategories: n } = be(), F = g(() => d.state.currentCategoryIds), r = g(
|
|
39
40
|
() => m.value.map((k) => ({ label: k.name, value: k.id }))
|
|
40
|
-
),
|
|
41
|
+
), J = g(() => r.value.filter(
|
|
41
42
|
(k) => k.label.toLowerCase().includes($.value.toLowerCase())
|
|
42
43
|
)), { t: p } = Ce(), y = g(() => {
|
|
43
|
-
var k, c,
|
|
44
|
-
return m.value.length === ((k =
|
|
45
|
-
}), $ =
|
|
46
|
-
get: () =>
|
|
44
|
+
var k, c, j;
|
|
45
|
+
return m.value.length === ((k = n.value) == null ? void 0 : k.length) ? p("menu.category.selector.all") : ((c = n.value) == null ? void 0 : c.length) === 1 ? n.value[0].name : `${(j = n.value) == null ? void 0 : j.length}`;
|
|
46
|
+
}), $ = N(""), _ = g({
|
|
47
|
+
get: () => F.value,
|
|
47
48
|
set: (k) => {
|
|
48
49
|
d.selectCategory(k);
|
|
49
50
|
}
|
|
50
|
-
}), { allCleared:
|
|
51
|
+
}), { allCleared: W, allSelected: T, toggleAll: H, toggleOption: Z, indeterminate: E } = ft(r, _);
|
|
51
52
|
return (k, c) => {
|
|
52
|
-
const
|
|
53
|
+
const j = q("FmIcon"), K = q("FmChip"), L = q("FmSearch"), ae = q("FmMenuItem"), X = q("FmMenu");
|
|
53
54
|
return b(), G(X, {
|
|
54
55
|
"close-on-click": !1,
|
|
55
56
|
width: "220px"
|
|
56
57
|
}, {
|
|
57
|
-
"menu-button":
|
|
58
|
+
"menu-button": O(() => [
|
|
58
59
|
i(K, {
|
|
59
60
|
label: y.value,
|
|
60
61
|
class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400"
|
|
61
62
|
}, {
|
|
62
|
-
default:
|
|
63
|
+
default: O(() => [
|
|
63
64
|
f("p", null, Q(l(p)("menu.category.selector.title", { label: y.value })), 1),
|
|
64
|
-
i(
|
|
65
|
+
i(j, { name: "expand_more" })
|
|
65
66
|
]),
|
|
66
67
|
_: 1
|
|
67
68
|
}, 8, ["label"])
|
|
68
69
|
]),
|
|
69
|
-
default:
|
|
70
|
-
f("div",
|
|
70
|
+
default: O(() => [
|
|
71
|
+
f("div", bt, [
|
|
71
72
|
i(L, {
|
|
72
73
|
autofocus: "",
|
|
73
74
|
modelValue: $.value,
|
|
74
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
75
|
+
"onUpdate:modelValue": c[0] || (c[0] = (D) => $.value = D),
|
|
75
76
|
placeholder: l(p)("menu.common.actions.search")
|
|
76
77
|
}, null, 8, ["modelValue", "placeholder"])
|
|
77
78
|
]),
|
|
78
|
-
f("div",
|
|
79
|
+
f("div", gt, [
|
|
79
80
|
i(ae, {
|
|
80
81
|
label: "All",
|
|
81
82
|
"has-checkbox": "",
|
|
82
83
|
"model-value": l(T),
|
|
83
84
|
indeterminate: l(E),
|
|
84
|
-
onClick: l(
|
|
85
|
+
onClick: l(H)
|
|
85
86
|
}, null, 8, ["model-value", "indeterminate", "onClick"]),
|
|
86
|
-
(b(!0), z(xe, null,
|
|
87
|
-
var
|
|
87
|
+
(b(!0), z(xe, null, Ne(J.value, (D) => {
|
|
88
|
+
var S;
|
|
88
89
|
return b(), G(ae, {
|
|
89
|
-
key:
|
|
90
|
-
label:
|
|
90
|
+
key: D.value || "",
|
|
91
|
+
label: D.label,
|
|
91
92
|
"has-checkbox": "",
|
|
92
|
-
"model-value": l(T) || ((
|
|
93
|
-
onClick: (U) => l(
|
|
93
|
+
"model-value": l(T) || ((S = _.value) == null ? void 0 : S.includes(D.value)),
|
|
94
|
+
onClick: (U) => l(Z)(D.value)
|
|
94
95
|
}, null, 8, ["label", "model-value", "onClick"]);
|
|
95
96
|
}), 128))
|
|
96
97
|
])
|
|
@@ -99,103 +100,99 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
99
100
|
});
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
|
-
}), Pe = (
|
|
103
|
+
}), Pe = (M) => i("div", {
|
|
103
104
|
class: "flex flex-1 justify-end"
|
|
104
|
-
}, [i("span", null, [
|
|
105
|
+
}, [i("span", null, [M, He(" ")])]), yt = /* @__PURE__ */ ce({
|
|
105
106
|
__name: "CategorySelectorSingle",
|
|
106
|
-
props: /* @__PURE__ */
|
|
107
|
+
props: /* @__PURE__ */ Ze({
|
|
107
108
|
disabled: { type: Boolean, default: !1 }
|
|
108
109
|
}, {
|
|
109
110
|
modelValue: {},
|
|
110
111
|
modelModifiers: {}
|
|
111
112
|
}),
|
|
112
113
|
emits: ["update:modelValue"],
|
|
113
|
-
setup(
|
|
114
|
-
const d =
|
|
115
|
-
label:
|
|
116
|
-
value:
|
|
114
|
+
setup(M) {
|
|
115
|
+
const d = ge(), m = Je(M, "modelValue"), n = g(() => d.categories.map((F) => ({
|
|
116
|
+
label: F.name,
|
|
117
|
+
value: F._id || null
|
|
117
118
|
})));
|
|
118
|
-
return (
|
|
119
|
-
const
|
|
120
|
-
return b(), G(
|
|
121
|
-
items:
|
|
119
|
+
return (F, r) => {
|
|
120
|
+
const J = q("FmSelect");
|
|
121
|
+
return b(), G(J, {
|
|
122
|
+
items: n.value,
|
|
122
123
|
modelValue: m.value,
|
|
123
|
-
"onUpdate:modelValue":
|
|
124
|
-
disabled:
|
|
124
|
+
"onUpdate:modelValue": r[0] || (r[0] = (p) => m.value = p),
|
|
125
|
+
disabled: F.disabled
|
|
125
126
|
}, null, 8, ["items", "modelValue", "disabled"]);
|
|
126
127
|
};
|
|
127
128
|
}
|
|
128
129
|
}), ze = /* @__PURE__ */ ce({
|
|
129
130
|
__name: "ImportButton",
|
|
130
|
-
setup(
|
|
131
|
-
const d =
|
|
131
|
+
setup(M) {
|
|
132
|
+
const d = N(!1);
|
|
132
133
|
function m() {
|
|
133
134
|
d.value = !d.value;
|
|
134
135
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const S = r.currentCountry.value;
|
|
138
|
-
S && st(S);
|
|
139
|
-
}), (S, n) => (b(), z(xe, null, [
|
|
140
|
-
i(ut, {
|
|
136
|
+
return (n, F) => (b(), z(xe, null, [
|
|
137
|
+
i(st, {
|
|
141
138
|
modelValue: d.value,
|
|
142
|
-
"onUpdate:modelValue":
|
|
139
|
+
"onUpdate:modelValue": F[0] || (F[0] = (r) => d.value = r)
|
|
143
140
|
}, null, 8, ["modelValue"]),
|
|
144
|
-
he(
|
|
141
|
+
he(n.$slots, "default", { trigger: m })
|
|
145
142
|
], 64));
|
|
146
143
|
}
|
|
147
|
-
}),
|
|
144
|
+
}), _t = {
|
|
148
145
|
class: "flex justify-between items-center space-x-8"
|
|
149
|
-
},
|
|
146
|
+
}, ht = {
|
|
150
147
|
class: "flex space-x-8"
|
|
151
|
-
},
|
|
148
|
+
}, xt = {
|
|
152
149
|
class: "w-[320px]"
|
|
153
|
-
},
|
|
150
|
+
}, Ct = {
|
|
154
151
|
key: 0,
|
|
155
152
|
class: /* @__PURE__ */ se(["flex-1 flex flex-col", "divide-y divide-fm-color-neutral-gray-100", "overflow-hidden"])
|
|
156
|
-
},
|
|
153
|
+
}, kt = {
|
|
157
154
|
key: 0,
|
|
158
155
|
class: "flex items-center p-4"
|
|
159
|
-
},
|
|
156
|
+
}, St = {
|
|
160
157
|
class: /* @__PURE__ */ se(["mr-8", "fm-typo-en-body-md-400"])
|
|
161
|
-
},
|
|
158
|
+
}, wt = {
|
|
162
159
|
key: 1,
|
|
163
160
|
class: "px-16 py-4 space-x-8 flex justify-end"
|
|
164
|
-
},
|
|
161
|
+
}, Vt = {
|
|
165
162
|
key: 1
|
|
166
|
-
},
|
|
163
|
+
}, Ft = {
|
|
167
164
|
class: "flex space-x-8"
|
|
168
|
-
},
|
|
165
|
+
}, $t = {
|
|
169
166
|
key: 1,
|
|
170
167
|
class: "pt-8 flex flex-col flex-1 overflow-hidden"
|
|
171
|
-
},
|
|
168
|
+
}, Tt = {
|
|
172
169
|
class: "space-y-8 pb-8"
|
|
173
|
-
},
|
|
170
|
+
}, It = {
|
|
174
171
|
class: "w-full px-8"
|
|
175
172
|
}, Ot = {
|
|
176
173
|
class: "flex space-x-8 px-8"
|
|
177
|
-
},
|
|
174
|
+
}, Mt = {
|
|
178
175
|
key: 0,
|
|
179
176
|
class: /* @__PURE__ */ se(["flex flex-col flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
|
|
180
|
-
},
|
|
177
|
+
}, Pt = ["onClick"], zt = {
|
|
181
178
|
class: "min-w-0 flex flex-1 items-center justify-start space-x-16"
|
|
182
179
|
}, Nt = {
|
|
183
180
|
class: "flex-1 min-w-0"
|
|
184
181
|
}, jt = {
|
|
185
182
|
class: "flex justify-between items-center gap-8 pb-4"
|
|
186
|
-
},
|
|
183
|
+
}, Dt = {
|
|
187
184
|
class: "flex-1 min-w-0 fm-typo-en-body-lg-600 line-clamp-2"
|
|
185
|
+
}, Ut = {
|
|
186
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
188
187
|
}, Bt = {
|
|
189
188
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
190
189
|
}, At = {
|
|
191
190
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
192
191
|
}, Et = {
|
|
193
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
194
|
-
}, Kt = {
|
|
195
192
|
key: 1
|
|
196
|
-
},
|
|
193
|
+
}, Kt = {
|
|
197
194
|
class: "flex space-x-8"
|
|
198
|
-
},
|
|
195
|
+
}, Lt = /* @__PURE__ */ ce({
|
|
199
196
|
__name: "ProductTable",
|
|
200
197
|
props: {
|
|
201
198
|
modelValue: {},
|
|
@@ -205,46 +202,46 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
205
202
|
}
|
|
206
203
|
},
|
|
207
204
|
emits: ["update:model-value", "reset:model-value", "update:editing", "update:search-key"],
|
|
208
|
-
setup(
|
|
205
|
+
setup(M, {
|
|
209
206
|
emit: d
|
|
210
207
|
}) {
|
|
211
|
-
const m =
|
|
212
|
-
t:
|
|
213
|
-
} = Ce(),
|
|
214
|
-
|
|
208
|
+
const m = M, {
|
|
209
|
+
t: n
|
|
210
|
+
} = Ce(), F = nt(), r = ge(), J = Ue(), p = Be(), y = je(J), $ = De(y);
|
|
211
|
+
Ee({
|
|
215
212
|
dialog: p,
|
|
216
213
|
menuLoader: $
|
|
217
214
|
});
|
|
218
|
-
const _ =
|
|
219
|
-
g(() => !
|
|
220
|
-
const
|
|
221
|
-
g(() =>
|
|
215
|
+
const _ = Ke();
|
|
216
|
+
g(() => !r.state.currentSchedulerId);
|
|
217
|
+
const W = F.currentCountry, T = g(() => W.value ? rt.getCountry(W.value) : null), H = g(() => r.rules.item);
|
|
218
|
+
g(() => Z.value.length === 1 && Z.value[0].id === null);
|
|
222
219
|
const {
|
|
223
|
-
selectedCategories:
|
|
224
|
-
} =
|
|
220
|
+
selectedCategories: Z
|
|
221
|
+
} = be(), E = g(() => fe.flatten(Z.value.map((e) => e.items))), k = d, c = N(!1);
|
|
225
222
|
pe(() => c.value, (e) => {
|
|
226
223
|
k("update:editing", e);
|
|
227
224
|
});
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
}, K =
|
|
225
|
+
const j = (e) => {
|
|
226
|
+
ot.isBoolean(e) ? c.value = e : c.value = !c.value;
|
|
227
|
+
}, K = N(""), L = g(() => E.value.filter((e) => {
|
|
231
228
|
var o;
|
|
232
|
-
return !K.value || !K.value.trim() ? !0 : `${e.code} ${e.name} ${ke(e)} ${X(e.category || null)} ${(o =
|
|
229
|
+
return !K.value || !K.value.trim() ? !0 : `${e.code} ${e.name} ${ke(e)} ${X(e.category || null)} ${(o = ve()[e.orderFrom]) == null ? void 0 : o.label}`.toLowerCase().includes(K.value.toLowerCase());
|
|
233
230
|
})), {
|
|
234
231
|
categories: ae
|
|
235
|
-
} =
|
|
232
|
+
} = be(), X = (e) => {
|
|
236
233
|
const t = ae.value.find((o) => o.id === e || e === null && o.id === "");
|
|
237
234
|
return t == null ? void 0 : t.name;
|
|
238
|
-
},
|
|
239
|
-
let a =
|
|
235
|
+
}, D = (e, t, o) => {
|
|
236
|
+
let a = fe.clone(m.modelValue);
|
|
240
237
|
const u = a[e];
|
|
241
238
|
u && (a[e] = {
|
|
242
239
|
...u,
|
|
243
240
|
[t]: o
|
|
244
241
|
}, k("update:model-value", a));
|
|
245
|
-
},
|
|
242
|
+
}, S = fe.debounce(D, 300), U = (e) => (t) => !!t || n("menu.product.table.validation.name_required", {
|
|
246
243
|
field: e
|
|
247
|
-
}),
|
|
244
|
+
}), w = (e) => e >= 0 || n("menu.product.table.validation.price_min"), V = [U("Name")], x = () => [(e) => w(typeof e == "number" ? e : Number(e) ?? 0)], P = ve(), B = N([{
|
|
248
245
|
accessorKey: "thumbnail",
|
|
249
246
|
header: "",
|
|
250
247
|
size: 64,
|
|
@@ -264,36 +261,36 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
264
261
|
enableSorting: !1
|
|
265
262
|
}, {
|
|
266
263
|
accessorKey: "code",
|
|
267
|
-
header: () =>
|
|
264
|
+
header: () => n("menu.product.table.columns.code"),
|
|
268
265
|
enableSorting: !1,
|
|
269
266
|
size: 100,
|
|
270
267
|
cell: (e) => {
|
|
271
268
|
const t = e.row.original, o = e.getValue() || "--";
|
|
272
269
|
if (!c.value) return o;
|
|
273
|
-
const a =
|
|
270
|
+
const a = ye(t._id);
|
|
274
271
|
return A(re.FmTextField, {
|
|
275
|
-
disabled: !
|
|
272
|
+
disabled: !H.value.code,
|
|
276
273
|
modelValue: a == null ? void 0 : a.code,
|
|
277
274
|
placeholder: m.modelValue[t._id].fallbackCode,
|
|
278
275
|
"onUpdate:modelValue": (u) => {
|
|
279
|
-
|
|
276
|
+
S(t._id, "code", u);
|
|
280
277
|
}
|
|
281
278
|
});
|
|
282
279
|
}
|
|
283
280
|
}, {
|
|
284
281
|
accessorKey: "name",
|
|
285
|
-
header: () =>
|
|
282
|
+
header: () => n("menu.product.table.columns.name"),
|
|
286
283
|
enableSorting: !1,
|
|
287
284
|
size: 240,
|
|
288
285
|
cell: (e) => {
|
|
289
286
|
const t = e.row.original, o = e.getValue();
|
|
290
287
|
return c.value ? A(re.FmTextField, {
|
|
291
|
-
disabled: !
|
|
288
|
+
disabled: !H.value.name,
|
|
292
289
|
modelValue: t.name,
|
|
293
290
|
"onUpdate:modelValue": (a) => {
|
|
294
|
-
|
|
291
|
+
S(t._id, "name", a);
|
|
295
292
|
},
|
|
296
|
-
rules:
|
|
293
|
+
rules: V,
|
|
297
294
|
placeholder: t.fallbackName
|
|
298
295
|
}) : o;
|
|
299
296
|
}
|
|
@@ -301,7 +298,7 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
301
298
|
accessorKey: "price",
|
|
302
299
|
header: () => {
|
|
303
300
|
var e;
|
|
304
|
-
return Pe(
|
|
301
|
+
return Pe(n("menu.product.table.columns.price", {
|
|
305
302
|
currency: (e = T.value) == null ? void 0 : e.currency.symbol
|
|
306
303
|
}));
|
|
307
304
|
},
|
|
@@ -313,17 +310,17 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
313
310
|
cell: (e) => {
|
|
314
311
|
var u;
|
|
315
312
|
const t = e.getValue();
|
|
316
|
-
if (!c.value) return
|
|
313
|
+
if (!c.value) return _e.fromFdoDinero(t).toFormat();
|
|
317
314
|
const o = m.modelValue[e.row.original._id], a = o.fallbackPrice;
|
|
318
|
-
return A(
|
|
315
|
+
return A(ct, {
|
|
319
316
|
min: 0,
|
|
320
317
|
disabled: !o.editPrice,
|
|
321
318
|
// @ts-ignore
|
|
322
|
-
placeholder: a ?
|
|
323
|
-
modelValue: (u =
|
|
319
|
+
placeholder: a ? dt(a, !1) : void 0,
|
|
320
|
+
modelValue: (u = ye(o._id)) == null ? void 0 : u.price,
|
|
324
321
|
// @ts-ignore
|
|
325
322
|
"onUpdate:modelValue": (h) => {
|
|
326
|
-
|
|
323
|
+
D(o._id, "price", h);
|
|
327
324
|
},
|
|
328
325
|
rules: x()
|
|
329
326
|
});
|
|
@@ -337,38 +334,38 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
337
334
|
textAlign: "right"
|
|
338
335
|
},
|
|
339
336
|
cell: (e) => {
|
|
340
|
-
const t = e.getValue(), o = e.row.original, a =
|
|
337
|
+
const t = e.getValue(), o = e.row.original, a = r.taxSetting.countryTaxOptions, u = r.getSelectedTax(t, o.fallbackTaxes, r.taxSetting.countryTaxOptions), h = a.find((le) => le.value === u);
|
|
341
338
|
if (!c.value)
|
|
342
|
-
return `${h != null && h.meta.rate ?
|
|
343
|
-
const s =
|
|
339
|
+
return `${h != null && h.meta.rate ? lt(h.meta.rate) : 0}%`;
|
|
340
|
+
const s = r.getSelectedTax(t, o.fallbackTaxes, r.taxSetting.countryTaxOptions);
|
|
344
341
|
return A(re.FmSelect, {
|
|
345
|
-
disabled: !
|
|
346
|
-
items:
|
|
342
|
+
disabled: !H.value.tax,
|
|
343
|
+
items: r.taxSetting.countryTaxOptions,
|
|
347
344
|
modelValue: s,
|
|
348
345
|
"onUpdate:modelValue": async (le) => {
|
|
349
|
-
const me =
|
|
350
|
-
|
|
346
|
+
const me = r.decodeTax(le);
|
|
347
|
+
S(o._id, "taxes", [me]);
|
|
351
348
|
}
|
|
352
349
|
});
|
|
353
350
|
}
|
|
354
351
|
}, {
|
|
355
352
|
accessorKey: "category",
|
|
356
|
-
header: () =>
|
|
353
|
+
header: () => n("menu.product.table.columns.category"),
|
|
357
354
|
enableSorting: !1,
|
|
358
355
|
size: 140,
|
|
359
356
|
cell: (e) => {
|
|
360
357
|
const t = e.row.original;
|
|
361
|
-
return c.value ? A(
|
|
358
|
+
return c.value ? A(yt, {
|
|
362
359
|
"model-value": m.modelValue[t._id].category,
|
|
363
|
-
disabled: !!(
|
|
360
|
+
disabled: !!(r.state.currentCatalogId || r.state.currentSchedulerId),
|
|
364
361
|
"onUpdate:modelValue": async (o) => {
|
|
365
|
-
|
|
362
|
+
S(t._id, "category", o);
|
|
366
363
|
}
|
|
367
364
|
}) : X(t.category || null);
|
|
368
365
|
}
|
|
369
366
|
}, {
|
|
370
367
|
accessorKey: "orderFrom",
|
|
371
|
-
header: () =>
|
|
368
|
+
header: () => n("menu.product.table.columns.order_from"),
|
|
372
369
|
enableSorting: !0,
|
|
373
370
|
sortingFn: (e, t) => {
|
|
374
371
|
const [o, a] = [e, t].map((u) => P[u.original.orderFrom].sortingIndex);
|
|
@@ -377,13 +374,13 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
377
374
|
size: 110,
|
|
378
375
|
cell: (e) => {
|
|
379
376
|
var u, h;
|
|
380
|
-
const t = e.getValue(), o = e.row.original, a =
|
|
377
|
+
const t = e.getValue(), o = e.row.original, a = ve();
|
|
381
378
|
return c.value ? A(re.FmSelect, {
|
|
382
|
-
disabled: !
|
|
383
|
-
items: Object.values(
|
|
379
|
+
disabled: !H.value.orderFrom,
|
|
380
|
+
items: Object.values(ve()),
|
|
384
381
|
modelValue: t,
|
|
385
382
|
"onUpdate:modelValue": async (s) => {
|
|
386
|
-
|
|
383
|
+
D(o._id, "orderFrom", s);
|
|
387
384
|
}
|
|
388
385
|
}) : A(Ie, {
|
|
389
386
|
label: (u = a[t]) == null ? void 0 : u.label,
|
|
@@ -400,12 +397,12 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
400
397
|
},
|
|
401
398
|
header: () => A("div", {
|
|
402
399
|
class: "w-full px-4 flex justify-end"
|
|
403
|
-
}, [
|
|
404
|
-
variant:
|
|
400
|
+
}, [pt(A(re.FmButton, {
|
|
401
|
+
variant: Y.Tertiary,
|
|
405
402
|
textColor: R.NeutralGray400,
|
|
406
403
|
prependIcon: "edit",
|
|
407
404
|
class: "flex justify-end",
|
|
408
|
-
onClick:
|
|
405
|
+
onClick: j,
|
|
409
406
|
type: "button"
|
|
410
407
|
}), "Bulk edit")]),
|
|
411
408
|
cell: (e) => {
|
|
@@ -426,8 +423,8 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
426
423
|
})]);
|
|
427
424
|
}
|
|
428
425
|
}]);
|
|
429
|
-
|
|
430
|
-
const C =
|
|
426
|
+
r.taxSetting.systemCode || B.value.splice(4, 1);
|
|
427
|
+
const C = N({}), v = N([]);
|
|
431
428
|
pe([() => C.value, () => L.value], (e) => {
|
|
432
429
|
let t = [];
|
|
433
430
|
Object.keys(e[0]).forEach((o) => {
|
|
@@ -443,8 +440,8 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
443
440
|
C.value = {};
|
|
444
441
|
};
|
|
445
442
|
async function I() {
|
|
446
|
-
await
|
|
447
|
-
const e = () => !!
|
|
443
|
+
await et();
|
|
444
|
+
const e = () => !!r.currentCatalog || !!r.state.currentSchedulerId, t = (a) => a === "" || a === null ? e() ? "" : null : a, o = Object.values(m.modelValue).filter((a) => {
|
|
448
445
|
const u = Object.values(m.originalValue).find((h) => h._id === a._id);
|
|
449
446
|
return Fe(u, a);
|
|
450
447
|
}).map((a) => ({
|
|
@@ -456,7 +453,7 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
456
453
|
taxes: a.taxes,
|
|
457
454
|
category: t(a.category || null)
|
|
458
455
|
}));
|
|
459
|
-
await _.updateMany(o),
|
|
456
|
+
await _.updateMany(o), j(!1);
|
|
460
457
|
}
|
|
461
458
|
const oe = async () => {
|
|
462
459
|
await _.deleteItem(v.value.map((e) => ({
|
|
@@ -473,106 +470,106 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
473
470
|
primaryActions: {
|
|
474
471
|
text: "Discard",
|
|
475
472
|
close: !0,
|
|
476
|
-
variant:
|
|
473
|
+
variant: Y.Destructive
|
|
477
474
|
},
|
|
478
475
|
secondaryActions: {
|
|
479
476
|
text: "Cancel",
|
|
480
477
|
close: !0
|
|
481
478
|
}
|
|
482
479
|
}).onPrimary(() => {
|
|
483
|
-
te(),
|
|
484
|
-
}) : (
|
|
480
|
+
te(), j(!1);
|
|
481
|
+
}) : (j(!1), te());
|
|
485
482
|
}, de = g(() => ({
|
|
486
483
|
thumbnail: !c.value,
|
|
487
484
|
actions: !c.value
|
|
488
|
-
})),
|
|
485
|
+
})), Le = (e) => {
|
|
489
486
|
_.update(e._id);
|
|
490
487
|
};
|
|
491
|
-
async function
|
|
488
|
+
async function Re(e) {
|
|
492
489
|
await _.update(e.original._id);
|
|
493
490
|
}
|
|
494
491
|
function ke(e) {
|
|
495
492
|
var h;
|
|
496
493
|
const t = e.price ?? // TODO: fix type error
|
|
497
494
|
// @ts-ignore
|
|
498
|
-
e.fallbackPrice ??
|
|
495
|
+
e.fallbackPrice ?? _e.fromNumber({
|
|
499
496
|
number: 0
|
|
500
497
|
}).toObject(), o = e.taxes;
|
|
501
|
-
|
|
502
|
-
const a =
|
|
503
|
-
return
|
|
498
|
+
r.taxSetting.countryTaxOptions;
|
|
499
|
+
const a = _e.fromFdoDinero(t).toFormat(), u = (h = T.value) == null ? void 0 : h.currency.symbol;
|
|
500
|
+
return r.getSelectedTax(
|
|
504
501
|
o,
|
|
505
502
|
// TODO: fix type error
|
|
506
503
|
// @ts-ignore
|
|
507
504
|
e.fallbackTaxes,
|
|
508
|
-
|
|
505
|
+
r.taxSetting.countryTaxOptions
|
|
509
506
|
), `${u == null ? void 0 : u.toUpperCase()}${a}`;
|
|
510
507
|
}
|
|
511
|
-
function
|
|
508
|
+
function ye(e) {
|
|
512
509
|
var a;
|
|
513
|
-
const t =
|
|
510
|
+
const t = r.currentCatalog, o = r.state.currentSchedulerId;
|
|
514
511
|
if (t && o) {
|
|
515
512
|
const u = t.override.scheduler[o] ?? {
|
|
516
513
|
_id: o
|
|
517
514
|
};
|
|
518
515
|
return ((a = u == null ? void 0 : u.items) == null ? void 0 : a.filter((s) => s._id === e))[0];
|
|
519
|
-
} else return t ? t.override.items[e][0] : o ?
|
|
516
|
+
} else return t ? t.override.items[e][0] : o ? r.schedulers.find((s) => s._id === o).items.filter((s) => s._id === e)[0] : E.value.find((u) => u._id === e);
|
|
520
517
|
}
|
|
521
|
-
const
|
|
518
|
+
const Ge = Ae(), qe = g(() => Ge.breakpoints.value.xs), Se = N(null), We = at(Se), Ye = g(() => {
|
|
522
519
|
var t;
|
|
523
520
|
return {
|
|
524
|
-
height: `calc(100vh - ${((t =
|
|
521
|
+
height: `calc(100vh - ${((t = We.value) == null ? void 0 : t.top) + 24}px)`
|
|
525
522
|
};
|
|
526
523
|
});
|
|
527
524
|
return (e, t) => {
|
|
528
525
|
const o = q("fm-search"), a = q("fm-button"), u = q("fm-table"), h = q("fm-form");
|
|
529
|
-
return
|
|
526
|
+
return qe.value ? (b(), z("div", $t, [f("div", Tt, [f("div", It, [i(o, {
|
|
530
527
|
"model-value": K.value,
|
|
531
528
|
"onUpdate:modelValue": t[4] || (t[4] = (s) => K.value = s),
|
|
532
529
|
autofocus: "",
|
|
533
|
-
placeholder: l(
|
|
530
|
+
placeholder: l(n)("menu.product.table.search.placeholder")
|
|
534
531
|
}, null, 8, ["model-value", "placeholder"])]), t[6] || (t[6] = f("div", {
|
|
535
532
|
class: "w-full h-[1px] bg-fm-color-neutral-gray-100"
|
|
536
|
-
}, null, -1)), f("div", Ot, [he(e.$slots, "filter")])]), E.value.length ? (b(), z("div",
|
|
533
|
+
}, null, -1)), f("div", Ot, [he(e.$slots, "filter")])]), E.value.length ? (b(), z("div", Mt, [(b(!0), z(xe, null, Ne(L.value, (s) => {
|
|
537
534
|
var le, me, we;
|
|
538
535
|
return b(), z("div", {
|
|
539
536
|
key: s._id,
|
|
540
537
|
class: "max-w-full py-12 px-16 space-x-16 flex items-center",
|
|
541
|
-
onClick: () =>
|
|
542
|
-
}, [f("div",
|
|
538
|
+
onClick: () => Le(s)
|
|
539
|
+
}, [f("div", zt, [i(Te, {
|
|
543
540
|
alt: s.name,
|
|
544
541
|
size: 72,
|
|
545
542
|
src: s.thumbnail
|
|
546
|
-
}, null, 8, ["alt", "src"]), f("div", Nt, [f("div", jt, [f("p",
|
|
543
|
+
}, null, 8, ["alt", "src"]), f("div", Nt, [f("div", jt, [f("p", Dt, Q(s.name), 1), i(Ie, {
|
|
547
544
|
label: (le = l(P)[s.orderFrom || ""]) == null ? void 0 : le.label,
|
|
548
545
|
variant: (me = l(P)[s.orderFrom || ""]) == null ? void 0 : me.variant
|
|
549
|
-
}, null, 8, ["label", "variant"])]), f("p",
|
|
546
|
+
}, null, 8, ["label", "variant"])]), f("p", Ut, Q(ke(s)), 1), f("p", Bt, Q(l(n)("menu.product.table.columns.code")) + ": " + Q(((we = ye(s._id)) == null ? void 0 : we.code) || "--"), 1), f("p", At, Q(l(n)("menu.product.table.columns.category")) + ": " + Q(X(s.category || null)), 1)])]), i(a, {
|
|
550
547
|
"text-color": l(R).NeutralGray400,
|
|
551
|
-
variant: l(
|
|
548
|
+
variant: l(Y).Tertiary,
|
|
552
549
|
"prepend-icon": "delete",
|
|
553
550
|
onClick: Ve(() => l(_).deleteItem([{
|
|
554
551
|
_id: s._id,
|
|
555
552
|
name: s.name,
|
|
556
553
|
thumbnail: s.thumbnail
|
|
557
554
|
}]), ["stop"])
|
|
558
|
-
}, null, 8, ["text-color", "variant", "onClick"])], 8,
|
|
559
|
-
}), 128))])) : (b(), z("div",
|
|
560
|
-
subtitle: l(
|
|
561
|
-
title: l(
|
|
555
|
+
}, null, 8, ["text-color", "variant", "onClick"])], 8, Pt);
|
|
556
|
+
}), 128))])) : (b(), z("div", Et, [i(ie, {
|
|
557
|
+
subtitle: l(n)("menu.product.table.empty.subtitle"),
|
|
558
|
+
title: l(n)("menu.product.table.empty.title")
|
|
562
559
|
}, {
|
|
563
|
-
action:
|
|
564
|
-
variant: l(
|
|
565
|
-
label: l(
|
|
560
|
+
action: O(() => [f("div", Kt, [i(a, {
|
|
561
|
+
variant: l(Y).Primary,
|
|
562
|
+
label: l(n)("menu.product.table.empty.actions.add"),
|
|
566
563
|
"prepend-icon": "add",
|
|
567
564
|
onClick: t[5] || (t[5] = (s) => l(_).create(null))
|
|
568
565
|
}, null, 8, ["variant", "label"]), i(ze, null, {
|
|
569
|
-
default:
|
|
566
|
+
default: O(({
|
|
570
567
|
trigger: s
|
|
571
568
|
}) => [i(a, {
|
|
572
569
|
"bg-color": l(R).NeutralGray100,
|
|
573
570
|
"text-color": l(R).NeutralGray400,
|
|
574
|
-
variant: l(
|
|
575
|
-
label: l(
|
|
571
|
+
variant: l(Y).Primary,
|
|
572
|
+
label: l(n)("menu.product.table.empty.actions.import"),
|
|
576
573
|
"prepend-icon": "download",
|
|
577
574
|
onClick: s
|
|
578
575
|
}, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
|
|
@@ -585,15 +582,15 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
585
582
|
class: "flex flex-col flex-1 space-y-8 overflow-hidden",
|
|
586
583
|
onValidationSuccess: I
|
|
587
584
|
}, {
|
|
588
|
-
default:
|
|
585
|
+
default: O(() => [f("div", _t, [f("div", ht, [he(e.$slots, "filter")]), f("div", xt, [i(o, {
|
|
589
586
|
"model-value": K.value,
|
|
590
587
|
"onUpdate:modelValue": t[0] || (t[0] = (s) => K.value = s),
|
|
591
588
|
autofocus: "",
|
|
592
|
-
placeholder: l(
|
|
593
|
-
}, null, 8, ["model-value", "placeholder"])])]), E.value.length ? (b(), z("div",
|
|
589
|
+
placeholder: l(n)("menu.product.table.search.placeholder")
|
|
590
|
+
}, null, 8, ["model-value", "placeholder"])])]), E.value.length ? (b(), z("div", Ct, [v.value.length && !c.value ? (b(), z("div", kt, [f("p", St, Q(l(n)("menu.product.table.selection.count", {
|
|
594
591
|
count: v.value.length
|
|
595
592
|
})), 1), i(a, {
|
|
596
|
-
label: l(
|
|
593
|
+
label: l(n)("menu.product.table.selection.actions.deselect_all"),
|
|
597
594
|
type: "button",
|
|
598
595
|
variant: "plain",
|
|
599
596
|
onClick: ee
|
|
@@ -601,46 +598,46 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
601
598
|
"border-color": l(R).SystemError300,
|
|
602
599
|
"text-color": l(R).SystemError300,
|
|
603
600
|
class: "ml-auto",
|
|
604
|
-
label: l(
|
|
601
|
+
label: l(n)("menu.product.table.selection.actions.remove"),
|
|
605
602
|
"prepend-icon": "delete",
|
|
606
603
|
variant: "secondary",
|
|
607
604
|
onClick: oe
|
|
608
|
-
}, null, 8, ["border-color", "text-color", "label"])])) : ue("", !0), c.value ? (b(), z("div",
|
|
609
|
-
variant: l(
|
|
610
|
-
label: l(
|
|
605
|
+
}, null, 8, ["border-color", "text-color", "label"])])) : ue("", !0), c.value ? (b(), z("div", wt, [i(a, {
|
|
606
|
+
variant: l(Y).Tertiary,
|
|
607
|
+
label: l(n)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
611
608
|
onClick: te
|
|
612
609
|
}, null, 8, ["variant", "label"]), i(a, {
|
|
613
|
-
variant: l(
|
|
614
|
-
label: l(
|
|
610
|
+
variant: l(Y).Tertiary,
|
|
611
|
+
label: l(n)("menu.common.actions.cancel"),
|
|
615
612
|
onClick: ne
|
|
616
613
|
}, null, 8, ["variant", "label"]), i(a, {
|
|
617
614
|
borderColor: l(R).ColorPrimary,
|
|
618
615
|
textColor: l(R).ColorPrimary,
|
|
619
|
-
variant: l(
|
|
620
|
-
label: l(
|
|
616
|
+
variant: l(Y).Secondary,
|
|
617
|
+
label: l(n)("menu.product.table.bulk_edit.actions.save"),
|
|
621
618
|
type: "submit"
|
|
622
619
|
}, null, 8, ["borderColor", "textColor", "variant", "label"])])) : ue("", !0), f("div", {
|
|
623
620
|
ref_key: "tableWrapper",
|
|
624
621
|
ref: Se
|
|
625
|
-
}, [(b(), G(
|
|
626
|
-
title: l(
|
|
622
|
+
}, [(b(), G(Qe(c.value ? vt : "div"), {
|
|
623
|
+
title: l(n)("menu.product.table.bulk_edit.title"),
|
|
627
624
|
show: c.value,
|
|
628
625
|
"primary-action": {
|
|
629
|
-
label: l(
|
|
626
|
+
label: l(n)("menu.product.table.bulk_edit.actions.save")
|
|
630
627
|
},
|
|
631
628
|
"secondary-actions": [{
|
|
632
|
-
label: l(
|
|
629
|
+
label: l(n)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
633
630
|
click: te
|
|
634
631
|
}, {
|
|
635
|
-
label: l(
|
|
632
|
+
label: l(n)("menu.common.actions.cancel"),
|
|
636
633
|
click: ne
|
|
637
634
|
}],
|
|
638
635
|
class: "overflow-hidden",
|
|
639
|
-
style:
|
|
636
|
+
style: Xe(Ye.value),
|
|
640
637
|
onOnPrimary: I,
|
|
641
638
|
onOnCancel: ne
|
|
642
639
|
}, {
|
|
643
|
-
default:
|
|
640
|
+
default: O(() => [i(u, {
|
|
644
641
|
class: se({
|
|
645
642
|
"mt-24": c.value
|
|
646
643
|
}),
|
|
@@ -655,26 +652,26 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
655
652
|
"shrink-at": !1,
|
|
656
653
|
"hide-footer": "",
|
|
657
654
|
"pin-header-row": "",
|
|
658
|
-
onRowClick: t[2] || (t[2] = (s) => c.value ? void 0 :
|
|
655
|
+
onRowClick: t[2] || (t[2] = (s) => c.value ? void 0 : Re(s))
|
|
659
656
|
}, null, 8, ["class", "modelValue", "column-defs", "column-visibility", "loading", "page-size", "row-data", "selection"])]),
|
|
660
657
|
_: 1
|
|
661
|
-
}, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (b(), z("div",
|
|
662
|
-
subtitle: l(
|
|
663
|
-
title: l(
|
|
658
|
+
}, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (b(), z("div", Vt, [i(ie, {
|
|
659
|
+
subtitle: l(n)("menu.product.table.empty.subtitle"),
|
|
660
|
+
title: l(n)("menu.product.table.empty.title")
|
|
664
661
|
}, {
|
|
665
|
-
action:
|
|
666
|
-
variant: l(
|
|
667
|
-
label: l(
|
|
662
|
+
action: O(() => [f("div", Ft, [i(a, {
|
|
663
|
+
variant: l(Y).Primary,
|
|
664
|
+
label: l(n)("menu.product.table.empty.actions.add"),
|
|
668
665
|
"prepend-icon": "add",
|
|
669
666
|
onClick: t[3] || (t[3] = (s) => l(_).create(null))
|
|
670
667
|
}, null, 8, ["variant", "label"]), i(ze, null, {
|
|
671
|
-
default:
|
|
668
|
+
default: O(({
|
|
672
669
|
trigger: s
|
|
673
670
|
}) => [i(a, {
|
|
674
671
|
"bg-color": l(R).NeutralGray100,
|
|
675
672
|
"text-color": l(R).NeutralGray400,
|
|
676
|
-
variant: l(
|
|
677
|
-
label: l(
|
|
673
|
+
variant: l(Y).Primary,
|
|
674
|
+
label: l(n)("menu.product.table.empty.actions.import"),
|
|
678
675
|
"prepend-icon": "download",
|
|
679
676
|
onClick: s
|
|
680
677
|
}, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
|
|
@@ -686,44 +683,44 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
686
683
|
}));
|
|
687
684
|
};
|
|
688
685
|
}
|
|
689
|
-
}),
|
|
686
|
+
}), Rt = {
|
|
690
687
|
key: 0,
|
|
691
688
|
class: /* @__PURE__ */ se(["flex flex-col", "flex-1", "overflow-hidden"])
|
|
692
|
-
},
|
|
689
|
+
}, Gt = {
|
|
693
690
|
class: /* @__PURE__ */ se(["pt-16 xs:pt-0", "flex xs:flex-col", "flex-1", "w-full", "overflow-hidden"])
|
|
694
|
-
},
|
|
691
|
+
}, qt = { class: "flex flex-col flex-1 overflow-hidden" }, Wt = {
|
|
695
692
|
key: 1,
|
|
696
693
|
class: "pt-16 xs:pt-8 space-y-24"
|
|
697
|
-
},
|
|
694
|
+
}, Yt = { class: "flex items-center gap-8 px-16" }, vl = /* @__PURE__ */ ce({
|
|
698
695
|
__name: "Product",
|
|
699
|
-
setup(
|
|
700
|
-
const d =
|
|
701
|
-
|
|
696
|
+
setup(M) {
|
|
697
|
+
const d = Be(), m = Ue(), n = je(m), F = De(n);
|
|
698
|
+
Ee({
|
|
702
699
|
dialog: d,
|
|
703
|
-
menuLoader:
|
|
700
|
+
menuLoader: F
|
|
704
701
|
});
|
|
705
|
-
const
|
|
706
|
-
var
|
|
702
|
+
const r = ge(), J = g(() => r.rules.item), p = ut(), y = Ke(), $ = it(), _ = g(() => !r.state.currentCatalogId), W = g(() => r.rules.item), T = g(() => !r.state.currentSchedulerId), H = N(!1), Z = N(!1), E = g(() => {
|
|
703
|
+
var w, V, x, P;
|
|
707
704
|
if (_.value && T.value) return;
|
|
708
705
|
if (T.value) {
|
|
709
|
-
const B = (
|
|
706
|
+
const B = (w = r.currentCatalog) == null ? void 0 : w.override.items;
|
|
710
707
|
return B ? Object.entries(B).reduce((C, [v, ee]) => {
|
|
711
708
|
const I = ee.find((oe) => !oe.combinationKey);
|
|
712
709
|
return I && (C[v] = I), C;
|
|
713
710
|
}, {}) : {};
|
|
714
711
|
}
|
|
715
|
-
return ((_.value ? (
|
|
716
|
-
}), k =
|
|
712
|
+
return ((_.value ? (V = r.currentScheduler) == null ? void 0 : V.items : (P = (x = r.currentCatalog) == null ? void 0 : x.override.scheduler[r.state.currentSchedulerId]) == null ? void 0 : P.items) ?? []).reduce((B, C) => (C.combinationKey || (B[C._id] = C), B), {});
|
|
713
|
+
}), k = N({}), c = N({}), j = async () => {
|
|
717
714
|
var P, B;
|
|
718
|
-
|
|
719
|
-
const U = !!E.value,
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
(P =
|
|
724
|
-
(B =
|
|
715
|
+
Z.value = !0;
|
|
716
|
+
const U = !!E.value, w = fe.flatten(L.value.map((C) => C.items)), V = U && H.value ? await mt(
|
|
717
|
+
r.mergedMenu,
|
|
718
|
+
w,
|
|
719
|
+
r.state.menu,
|
|
720
|
+
(P = r.currentCatalog) == null ? void 0 : P._id,
|
|
721
|
+
(B = r.currentScheduler) == null ? void 0 : B._id,
|
|
725
722
|
!1
|
|
726
|
-
) : void 0, x =
|
|
723
|
+
) : void 0, x = w.reduce((C, v, ee) => {
|
|
727
724
|
var oe, te, ne, de;
|
|
728
725
|
const I = (oe = E.value) == null ? void 0 : oe[v._id];
|
|
729
726
|
return C[v._id] = {
|
|
@@ -731,80 +728,80 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
731
728
|
name: v.name,
|
|
732
729
|
code: U ? I == null ? void 0 : I.code : v == null ? void 0 : v.code,
|
|
733
730
|
category: v.category,
|
|
734
|
-
price: U &&
|
|
731
|
+
price: U && W.value.editPrice ? I == null ? void 0 : I.price : v.price,
|
|
735
732
|
orderFrom: U ? I == null ? void 0 : I.orderFrom : v.orderFrom,
|
|
736
733
|
taxes: U ? null : v.taxes,
|
|
737
734
|
thumbnail: v.thumbnail,
|
|
738
|
-
fallbackPrice: (te =
|
|
735
|
+
fallbackPrice: (te = V == null ? void 0 : V[ee]) == null ? void 0 : te.price,
|
|
739
736
|
fallbackName: U ? v.name : void 0,
|
|
740
|
-
fallbackCode: (ne =
|
|
741
|
-
fallbackOrder: (de =
|
|
737
|
+
fallbackCode: (ne = V == null ? void 0 : V[ee]) == null ? void 0 : ne.code,
|
|
738
|
+
fallbackOrder: (de = V == null ? void 0 : V[ee]) == null ? void 0 : de.orderFrom,
|
|
742
739
|
fallbackTaxes: U ? v.taxes : null
|
|
743
740
|
}, C;
|
|
744
741
|
}, {});
|
|
745
|
-
k.value = x, c.value = { ...x },
|
|
746
|
-
}, { categories: K, selectedCategories: L } =
|
|
747
|
-
|
|
748
|
-
L.value && await
|
|
742
|
+
k.value = x, c.value = { ...x }, Z.value = !1;
|
|
743
|
+
}, { categories: K, selectedCategories: L } = be();
|
|
744
|
+
tt(async () => {
|
|
745
|
+
L.value && await j();
|
|
749
746
|
});
|
|
750
747
|
function ae() {
|
|
751
748
|
y.create(null);
|
|
752
749
|
}
|
|
753
750
|
const X = () => {
|
|
754
|
-
L.value &&
|
|
755
|
-
},
|
|
756
|
-
g(() =>
|
|
757
|
-
const { t:
|
|
758
|
-
return (U,
|
|
759
|
-
const
|
|
760
|
-
return l(K).length ? (b(), z("div",
|
|
761
|
-
f("div",
|
|
762
|
-
f("div",
|
|
763
|
-
l(L) ? (b(), G(
|
|
751
|
+
L.value && j();
|
|
752
|
+
}, D = Ae();
|
|
753
|
+
g(() => D.breakpoints.value.xs);
|
|
754
|
+
const { t: S } = Ce();
|
|
755
|
+
return (U, w) => {
|
|
756
|
+
const V = q("fm-button");
|
|
757
|
+
return l(K).length ? (b(), z("div", Rt, [
|
|
758
|
+
f("div", Gt, [
|
|
759
|
+
f("div", qt, [
|
|
760
|
+
l(L) ? (b(), G(Lt, {
|
|
764
761
|
key: 0,
|
|
765
|
-
"is-calculating":
|
|
762
|
+
"is-calculating": Z.value,
|
|
766
763
|
"model-value": k.value,
|
|
767
764
|
"original-value": c.value,
|
|
768
|
-
"onUpdate:modelValue":
|
|
765
|
+
"onUpdate:modelValue": w[0] || (w[0] = (x) => k.value = x),
|
|
769
766
|
"onReset:modelValue": X,
|
|
770
|
-
"onUpdate:editing":
|
|
767
|
+
"onUpdate:editing": w[1] || (w[1] = (x) => H.value = x)
|
|
771
768
|
}, {
|
|
772
|
-
filter:
|
|
773
|
-
i(
|
|
774
|
-
|
|
769
|
+
filter: O(() => [
|
|
770
|
+
i(Me),
|
|
771
|
+
W.value.multiScheduler ? (b(), G($e, { key: 0 })) : ue("", !0)
|
|
775
772
|
]),
|
|
776
773
|
_: 1
|
|
777
774
|
}, 8, ["is-calculating", "model-value", "original-value"])) : ue("", !0)
|
|
778
775
|
])
|
|
779
776
|
])
|
|
780
|
-
])) : (b(), z("div",
|
|
781
|
-
f("div",
|
|
782
|
-
i(
|
|
783
|
-
|
|
777
|
+
])) : (b(), z("div", Wt, [
|
|
778
|
+
f("div", Yt, [
|
|
779
|
+
i(Me),
|
|
780
|
+
W.value.multiScheduler ? (b(), G($e, { key: 0 })) : ue("", !0)
|
|
784
781
|
]),
|
|
785
|
-
|
|
782
|
+
J.value.create ? (b(), G(ie, {
|
|
786
783
|
key: 0,
|
|
787
784
|
action: {
|
|
788
|
-
text: l(
|
|
785
|
+
text: l(S)("menu.product.empty.with_create.action"),
|
|
789
786
|
callback: ae
|
|
790
787
|
},
|
|
791
|
-
subtitle: l(
|
|
792
|
-
title: l(
|
|
788
|
+
subtitle: l(S)("menu.product.empty.with_create.subtitle"),
|
|
789
|
+
title: l(S)("menu.product.empty.with_create.title")
|
|
793
790
|
}, null, 8, ["action", "subtitle", "title"])) : T.value ? (b(), G(ie, {
|
|
794
791
|
key: 1,
|
|
795
|
-
subtitle: l(
|
|
796
|
-
title: l(
|
|
792
|
+
subtitle: l(S)("menu.product.empty.no_scheduler.subtitle"),
|
|
793
|
+
title: l(S)("menu.product.empty.no_scheduler.title")
|
|
797
794
|
}, {
|
|
798
|
-
action:
|
|
799
|
-
i(
|
|
795
|
+
action: O(() => [
|
|
796
|
+
i(Oe, {
|
|
800
797
|
"categorized-items": l($).linkableItems.value,
|
|
801
798
|
"initial-value": l($).currentItems.value,
|
|
802
799
|
"show-variant": !1,
|
|
803
|
-
onSubmit:
|
|
800
|
+
onSubmit: w[2] || (w[2] = (x) => l($).applyProduct(x.map((P) => P._id)))
|
|
804
801
|
}, {
|
|
805
|
-
default:
|
|
806
|
-
i(
|
|
807
|
-
label: l(
|
|
802
|
+
default: O(({ trigger: x }) => [
|
|
803
|
+
i(V, {
|
|
804
|
+
label: l(S)("menu.common.actions.link_product"),
|
|
808
805
|
"prepend-icon": "link",
|
|
809
806
|
onClick: x
|
|
810
807
|
}, null, 8, ["label", "onClick"])
|
|
@@ -815,19 +812,19 @@ const gt = { class: "p-4" }, yt = { class: "flex-1 overflow-y-auto min-h-0" }, O
|
|
|
815
812
|
_: 1
|
|
816
813
|
}, 8, ["subtitle", "title"])) : (b(), G(ie, {
|
|
817
814
|
key: 2,
|
|
818
|
-
subtitle: l(
|
|
819
|
-
title: l(
|
|
815
|
+
subtitle: l(S)("menu.product.empty.with_scheduler.subtitle"),
|
|
816
|
+
title: l(S)("menu.product.empty.with_scheduler.title")
|
|
820
817
|
}, {
|
|
821
|
-
action:
|
|
822
|
-
i(
|
|
818
|
+
action: O(() => [
|
|
819
|
+
i(Oe, {
|
|
823
820
|
"categorized-items": l(p).linkableItems.value,
|
|
824
821
|
"initial-value": l(p).currentItems.value,
|
|
825
822
|
"show-variant": !1,
|
|
826
|
-
onSubmit:
|
|
823
|
+
onSubmit: w[3] || (w[3] = (x) => l(p).applyProduct(x.map((P) => P._id)))
|
|
827
824
|
}, {
|
|
828
|
-
default:
|
|
829
|
-
i(
|
|
830
|
-
label: l(
|
|
825
|
+
default: O(({ trigger: x }) => [
|
|
826
|
+
i(V, {
|
|
827
|
+
label: l(S)("menu.common.actions.apply_product"),
|
|
831
828
|
onClick: x
|
|
832
829
|
}, null, 8, ["label", "onClick"])
|
|
833
830
|
]),
|