@feedmepos/mf-menu 0.31.30-beta.1 → 0.31.31-beta.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/{App-CrQBq4gc.js → App-1TX8v7ZA.js} +10 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-D00UOSsK.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CR7QrFUG.js} +12 -12
- package/dist/{Catalog-D4m8x_f2.js → Catalog-DWClc58s.js} +75 -74
- package/dist/{Category-sQll5ITQ.js → Category-BqKFvFam.js} +60 -60
- package/dist/{Category-Ql1kDDH-.js → Category-IYMtMoT-.js} +28 -28
- package/dist/{CookingGuide-CSutufcu.js → CookingGuide-BayJ6zj4.js} +103 -101
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-BqhYFXNG.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Ceq86b3d.js} +1 -1
- package/dist/{Group-CnBE6CiB.js → Group-LqSX7ue6.js} +1 -1
- package/dist/{Group-YqVh5hC0.js → Group-RujTPTns.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-D9TSH4sS.js → Group.vue_vue_type_script_setup_true_lang-Dj9ZmkYe.js} +138 -137
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CqriuXVC.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D5GWkh3G.js} +16 -16
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CaIU0RsG.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-C4IrA3es.js} +4616 -4610
- package/dist/{Ingredient-MhLxJzAU.js → Ingredient-_tc8llr1.js} +65 -64
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CIbExsMI.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DLFDf-VZ.js} +14 -12
- package/dist/{LinkProductSideSheet-D7vYZbFy.js → LinkProductSideSheet-C6rF-G1v.js} +14 -12
- package/dist/{MenuSetting-n0me5wY8.js → MenuSetting-xDHeeROY.js} +27 -26
- package/dist/{PrintRoute-CudZZYbe.js → PrintRoute-B_TFMn5e.js} +17 -15
- package/dist/{Product-DPZQgWET.js → Product-DdEEqrtc.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CdaeZy_o.js → Product.vue_vue_type_script_setup_true_lang-zcistmwh.js} +257 -256
- package/dist/{ProductInternalTools-DgANHliV.js → ProductInternalTools-BcC7BF6W.js} +45 -45
- package/dist/{Products-Ez4R3jKW.js → Products-Cu0cJshV.js} +74 -72
- package/dist/{Publish-B4DEPe1I.js → Publish-Bm3Xiks1.js} +34 -32
- package/dist/{Recipe-Cripr-gY.js → Recipe-DWK-luIZ.js} +65 -63
- package/dist/{Scheduler-C-OV9d7d.js → Scheduler-Cb1TeBhW.js} +19 -19
- package/dist/{ServingSequence-DAumDXP1.js → ServingSequence-evSIET_8.js} +34 -34
- package/dist/{Setting-ByaHpIAN.js → Setting-Cn3kwC9F.js} +54 -53
- package/dist/{Subcategory-ro2aGt2H.js → Subcategory-q4m4qHsU.js} +34 -34
- package/dist/{Takeaway-CJb0ayDC.js → Takeaway-ClepHYGu.js} +14 -14
- package/dist/{Takeaway-AEg_0gKg.js → Takeaway-D-rdUZuh.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-Cjj4bxoL.js → Takeaway.vue_vue_type_script_setup_true_lang-y9Yxstu2.js} +41 -40
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Drf4n4rj.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BSeLfoOA.js} +1108 -1106
- package/dist/{Unit-1wzUBplb.js → Unit-IM8Naj82.js} +12 -12
- package/dist/{Variant-Dnz2v5u0.js → Variant-fzGvwaMo.js} +16 -16
- package/dist/{_id_-C3rBZ6zL.js → _id_-BsKNG9Qv.js} +22 -22
- package/dist/{app-sDPxNF11.js → app-BzQRUMTK.js} +3 -3
- package/dist/{app-CLY6CoaV.js → app-CoVUUCa_.js} +24 -24
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-BZ4FSJ_Z.js → linked-status-eQqjvOq_.js} +2 -2
- package/dist/assets/{override-menu-C-fWJdVd.js → override-menu-C8NTBJgN.js} +2 -2
- package/dist/assets/{validate-menu-BDEM_Odz.js → validate-menu-Dn-OO7Ed.js} +2 -2
- package/dist/{catalog-bkFntZNz.js → catalog-CaXceaA2.js} +1 -1
- package/dist/{catalogSetting-zrKwGJ_C.js → catalogSetting-BGvckFdh.js} +1 -1
- package/dist/{category-BuPYaEsy.js → category-u5eo_Vjd.js} +5 -3
- package/dist/currency-BPHwez-E.js +7 -0
- package/dist/{dayjs.min-CR2NIyKn.js → dayjs.min-Bsr3tJCn.js} +1 -1
- package/dist/{index-BNORpjos.js → index-Bbx4iZ6n.js} +27 -27
- package/dist/{index-Dp_vLFQp.js → index-DSAG0yWh.js} +22 -20
- package/dist/{index-D20u0bCl.js → index-tRQb7RN_.js} +1 -1
- package/dist/{item-D4DcBt7N.js → item-BAqzKh4O.js} +801 -799
- package/dist/{jszip.min-CRJ61J9H.js → jszip.min-BKJtvCjM.js} +353 -353
- package/dist/{menu-Dw-Hpy07.js → menu-CDrsBjmr.js} +11 -9
- package/dist/menu-CsIzrBEr.js +74044 -0
- package/dist/packages/shared/src/permission/posPermission.d.ts +6 -0
- package/dist/{priceTier-EDLTGEjz.js → priceTier-DfbHonGe.js} +4 -4
- package/dist/{scheduler-CpPn2BlK.js → scheduler-DTWaBudB.js} +13 -11
- package/dist/{subcategory-B_W6vbM8.js → subcategory-D-R5r1Tr.js} +86 -84
- package/dist/{toExcel-D02OlDJu.js → toExcel-84VTtSA7.js} +2 -2
- package/dist/{unit-fro9wz1K.js → unit-B4zscxzo.js} +24 -23
- package/package.json +1 -1
- package/dist/currency-BISImIgX.js +0 -7
- package/dist/menu-ibc-yXVt.js +0 -107745
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { ref as V, computed as x, defineComponent as
|
|
2
|
-
import { u as ke,
|
|
1
|
+
import { ref as V, computed as x, defineComponent as G, resolveComponent as B, createBlock as P, openBlock as v, withCtx as A, createElementVNode as g, createVNode as m, unref as n, createElementBlock as C, Fragment as oe, renderList as xe, createCommentVNode as z, normalizeClass as ne, toDisplayString as j, withModifiers as ue, mergeModels as Qe, useModel as He, renderSlot as ve, watch as ae, createTextVNode as Ye, watchEffect as Ze, nextTick as $e, resolveDynamicComponent as Je, onMounted as Xe, h as q, normalizeStyle as vt } from "vue";
|
|
2
|
+
import { u as ke, O as ye, D as Te, G as me, R as ft, a9 as gt, aa as bt, ab as Ie, ac as _t, N as yt, ad as Ke } from "./menu-CsIzrBEr.js";
|
|
3
3
|
import { useI18n as Se, useCoreStore as Oe } from "@feedmepos/mf-common";
|
|
4
|
-
import { u as Ce } from "./menu-
|
|
4
|
+
import { u as Ce } from "./menu-CDrsBjmr.js";
|
|
5
5
|
import { _ as pe } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
|
|
6
|
-
import { L as Be } from "./LinkProductSideSheet-
|
|
7
|
-
import { _ as Pe, h as je, a as ht, b as
|
|
8
|
-
import { f as xt, o as Ct, b as wt, m as kt } from "./subcategory-
|
|
9
|
-
import { r as St, _ as Ft, a as Vt, u as It } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { u as et, C as $t } from "./item-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
6
|
+
import { L as Be } from "./LinkProductSideSheet-C6rF-G1v.js";
|
|
7
|
+
import { _ as Pe, h as je, a as ht, b as Ge } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-Ceq86b3d.js";
|
|
8
|
+
import { f as xt, o as Ct, b as wt, m as kt } from "./subcategory-D-R5r1Tr.js";
|
|
9
|
+
import { r as St, _ as Ft, a as Vt, u as It } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-C4IrA3es.js";
|
|
10
|
+
import { u as et, C as $t } from "./item-BAqzKh4O.js";
|
|
11
|
+
import { Dinero as ie, Country as Tt } from "@feedmepos/core";
|
|
12
|
+
import { useBreakpoints as tt, components as J, useDialog as Pt, FmButtonColorThemeVariant as Q, FmButtonVariant as Z } from "@feedmepos/ui-library";
|
|
13
|
+
import { F as At } from "./index-tRQb7RN_.js";
|
|
14
|
+
import { _ as Me, u as Ot } from "./app-CoVUUCa_.js";
|
|
14
15
|
import { _ as he } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
15
|
-
import { _ as
|
|
16
|
+
import { _ as Mt } from "./index-DSAG0yWh.js";
|
|
16
17
|
import { _ as Ae } from "./Thumbnail.vue_vue_type_script_setup_true_lang-DzQ8_6Bi.js";
|
|
17
18
|
import { c as Ut } from "./check-C9mY6LiX.js";
|
|
18
|
-
import { f as
|
|
19
|
-
import { w as
|
|
20
|
-
import { r as
|
|
21
|
-
function
|
|
19
|
+
import { f as zt } from "./currency-BPHwez-E.js";
|
|
20
|
+
import { w as Nt } from "./tooltip-B5BiPMx9.js";
|
|
21
|
+
import { r as Rt } from "./index-Ce4v8o7D.js";
|
|
22
|
+
function Dt(w, a) {
|
|
22
23
|
const r = V(!0), u = x(() => {
|
|
23
24
|
var s, f;
|
|
24
25
|
return !r.value && (!a.value || ((s = a.value) == null ? void 0 : s.length) === ((f = w.value) == null ? void 0 : f.length));
|
|
@@ -34,47 +35,47 @@ function Nt(w, a) {
|
|
|
34
35
|
a.value === void 0 && r.value ? f = [s] : a.value === void 0 && !r.value ? f = (p = w.value.map((k) => k.value)) == null ? void 0 : p.filter((k) => k !== s) : (b = a.value) != null && b.includes(s) ? f = (y = a.value) == null ? void 0 : y.filter((k) => k !== s) : f = [...a.value || [], s], f.length === 0 ? (a.value = void 0, r.value = !0) : f.length === w.value.length ? (a.value = void 0, r.value = !1) : a.value = f;
|
|
35
36
|
} };
|
|
36
37
|
}
|
|
37
|
-
const Kt = { class: "inline-flex items-center" },
|
|
38
|
+
const Kt = { class: "inline-flex items-center" }, Bt = {
|
|
38
39
|
key: 0,
|
|
39
|
-
class: /* @__PURE__ */
|
|
40
|
+
class: /* @__PURE__ */ ne([
|
|
40
41
|
"fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
|
|
41
42
|
"text-fm-color-neutral-gray-400"
|
|
42
43
|
])
|
|
43
|
-
},
|
|
44
|
+
}, jt = { class: "p-4" }, Gt = { class: "flex-1 overflow-y-auto min-h-0" }, Ee = /* @__PURE__ */ G({
|
|
44
45
|
__name: "CategorySelector",
|
|
45
46
|
emits: ["toggleAttributeFilter"],
|
|
46
47
|
setup(w, { emit: a }) {
|
|
47
48
|
const r = a, u = ke(), { categories: l, selectedCategories: i } = Ce(), o = x(() => u.state.currentCategoryIds), s = x(
|
|
48
|
-
() => l.value.map((
|
|
49
|
+
() => l.value.map((E) => ({ label: E.name, value: E.id }))
|
|
49
50
|
), f = x(() => s.value.filter(
|
|
50
|
-
(
|
|
51
|
+
(E) => E.label.toLowerCase().includes(y.value.toLowerCase())
|
|
51
52
|
)), { t: p } = Se(), b = x(() => {
|
|
52
|
-
var
|
|
53
|
-
return l.value.length === ((
|
|
53
|
+
var E, I, N;
|
|
54
|
+
return l.value.length === ((E = i.value) == null ? void 0 : E.length) ? p("menu.category.selector.all") : ((I = i.value) == null ? void 0 : I.length) === 1 ? i.value[0].name : `${(N = i.value) == null ? void 0 : N.length}`;
|
|
54
55
|
}), y = V(""), k = x({
|
|
55
56
|
get: () => o.value,
|
|
56
|
-
set: (
|
|
57
|
-
u.selectCategory(
|
|
57
|
+
set: (E) => {
|
|
58
|
+
u.selectCategory(E);
|
|
58
59
|
}
|
|
59
|
-
}), { allSelected: L, toggleAll: ee, toggleOption: S, indeterminate: H } =
|
|
60
|
+
}), { allSelected: L, toggleAll: ee, toggleOption: S, indeterminate: H } = Dt(
|
|
60
61
|
s,
|
|
61
62
|
k
|
|
62
63
|
), W = Oe(), te = x(() => W.itemAttributeSettings.value.length > 0);
|
|
63
64
|
function ce() {
|
|
64
65
|
r("toggleAttributeFilter");
|
|
65
66
|
}
|
|
66
|
-
return (
|
|
67
|
-
const
|
|
68
|
-
return v(), P(
|
|
67
|
+
return (E, I) => {
|
|
68
|
+
const N = B("FmIcon"), U = B("FmChip"), T = B("FmSearch"), $ = B("FmMenuItem"), R = B("FmMenu");
|
|
69
|
+
return v(), P(R, {
|
|
69
70
|
"close-on-click": !1,
|
|
70
71
|
width: 220
|
|
71
72
|
}, {
|
|
72
73
|
"menu-button": A(() => [
|
|
73
74
|
g("div", Kt, [
|
|
74
|
-
m(
|
|
75
|
+
m(U, null, {
|
|
75
76
|
default: A(() => [
|
|
76
|
-
b.value ? (v(), C("div",
|
|
77
|
-
m(
|
|
77
|
+
b.value ? (v(), C("div", Bt, j(n(p)("menu.category.selector.title", { label: b.value })), 1)) : z("", !0),
|
|
78
|
+
m(N, {
|
|
78
79
|
color: "neutral-gray-400",
|
|
79
80
|
name: "expand_more",
|
|
80
81
|
size: "sm"
|
|
@@ -82,32 +83,32 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
82
83
|
te.value ? (v(), C("div", {
|
|
83
84
|
key: 1,
|
|
84
85
|
class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
|
|
85
|
-
onClick:
|
|
86
|
+
onClick: ue(ce, ["stop"])
|
|
86
87
|
}, [
|
|
87
|
-
m(
|
|
88
|
+
m(N, {
|
|
88
89
|
name: "filter_alt",
|
|
89
90
|
outline: "",
|
|
90
91
|
color: "neutral-gray-400",
|
|
91
92
|
size: "sm",
|
|
92
|
-
onClick: I[0] || (I[0] =
|
|
93
|
+
onClick: I[0] || (I[0] = ue(() => {
|
|
93
94
|
}, ["prevent"]))
|
|
94
95
|
})
|
|
95
|
-
])) :
|
|
96
|
+
])) : z("", !0)
|
|
96
97
|
]),
|
|
97
98
|
_: 1
|
|
98
99
|
})
|
|
99
100
|
])
|
|
100
101
|
]),
|
|
101
102
|
default: A(() => [
|
|
102
|
-
g("div",
|
|
103
|
+
g("div", jt, [
|
|
103
104
|
m(T, {
|
|
104
105
|
autofocus: "",
|
|
105
106
|
modelValue: y.value,
|
|
106
|
-
"onUpdate:modelValue": I[1] || (I[1] = (
|
|
107
|
+
"onUpdate:modelValue": I[1] || (I[1] = (M) => y.value = M),
|
|
107
108
|
placeholder: n(p)("menu.common.actions.search")
|
|
108
109
|
}, null, 8, ["modelValue", "placeholder"])
|
|
109
110
|
]),
|
|
110
|
-
g("div",
|
|
111
|
+
g("div", Gt, [
|
|
111
112
|
m($, {
|
|
112
113
|
label: "All",
|
|
113
114
|
"has-checkbox": "",
|
|
@@ -115,14 +116,14 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
115
116
|
indeterminate: n(H),
|
|
116
117
|
onClick: n(ee)
|
|
117
118
|
}, null, 8, ["model-value", "indeterminate", "onClick"]),
|
|
118
|
-
(v(!0), C(
|
|
119
|
-
var
|
|
119
|
+
(v(!0), C(oe, null, xe(f.value, (M) => {
|
|
120
|
+
var D;
|
|
120
121
|
return v(), P($, {
|
|
121
|
-
key:
|
|
122
|
-
label:
|
|
122
|
+
key: M.value || "",
|
|
123
|
+
label: M.label,
|
|
123
124
|
"has-checkbox": "",
|
|
124
|
-
"model-value": n(L) || ((
|
|
125
|
-
onClick: (O) => n(S)(
|
|
125
|
+
"model-value": n(L) || ((D = k.value) == null ? void 0 : D.includes(M.value)),
|
|
126
|
+
onClick: (O) => n(S)(M.value)
|
|
126
127
|
}, null, 8, ["label", "model-value", "onClick"]);
|
|
127
128
|
}), 128))
|
|
128
129
|
])
|
|
@@ -131,13 +132,13 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
131
132
|
});
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
|
-
}), Et = { class: "flex flex-wrap gap-8" },
|
|
135
|
+
}), Et = { class: "flex flex-wrap gap-8" }, Lt = { class: "py-12 px-16 space-y-12" }, Wt = { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-600" }, qt = { class: "flex flex-wrap gap-8" }, Qt = {
|
|
135
136
|
key: 0,
|
|
136
137
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
137
|
-
},
|
|
138
|
+
}, Ht = { key: 0 }, Yt = {
|
|
138
139
|
key: 1,
|
|
139
140
|
class: "inline-block w-8"
|
|
140
|
-
},
|
|
141
|
+
}, Zt = { key: 0 }, Jt = { key: 1 }, Le = /* @__PURE__ */ G({
|
|
141
142
|
__name: "CategoriesChip",
|
|
142
143
|
props: {
|
|
143
144
|
categories: { default: () => [] },
|
|
@@ -153,19 +154,19 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
153
154
|
});
|
|
154
155
|
return (p, b) => {
|
|
155
156
|
const y = B("FmTooltip");
|
|
156
|
-
return l.value ? (v(), C(
|
|
157
|
-
p.categories.length > 0 ? (v(), C("p",
|
|
157
|
+
return l.value ? (v(), C(oe, { key: 1 }, [
|
|
158
|
+
p.categories.length > 0 ? (v(), C("p", Qt, [
|
|
158
159
|
g("span", null, j(n(r)("menu.product.table.columns.category")) + ": ", 1),
|
|
159
160
|
g("span", null, j(f.value), 1),
|
|
160
|
-
s.value ? (v(), C("span",
|
|
161
|
+
s.value ? (v(), C("span", Yt)) : (v(), C("br", Ht)),
|
|
161
162
|
p.categories.length > i.value ? (v(), C("span", {
|
|
162
163
|
key: 2,
|
|
163
164
|
class: "fm-typo-en-body-md-400 text-fm-color-primary cursor-pointer",
|
|
164
|
-
onClick: b[0] || (b[0] =
|
|
165
|
+
onClick: b[0] || (b[0] = ue((k) => s.value = !s.value, ["stop", "prevent"]))
|
|
165
166
|
}, [
|
|
166
|
-
s.value ? (v(), C("span",
|
|
167
|
-
])) :
|
|
168
|
-
])) :
|
|
167
|
+
s.value ? (v(), C("span", Zt, j(n(r)("menu.product.table.category.expand", { count: p.categories.length - i.value })), 1)) : (v(), C("span", Jt, j(n(r)("menu.product.table.category.collapse")), 1))
|
|
168
|
+
])) : z("", !0)
|
|
169
|
+
])) : z("", !0)
|
|
169
170
|
], 64)) : (v(), P(y, {
|
|
170
171
|
key: 0,
|
|
171
172
|
class: "flex",
|
|
@@ -174,10 +175,10 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
174
175
|
"z-index": 50
|
|
175
176
|
}, {
|
|
176
177
|
content: A(() => [
|
|
177
|
-
g("div",
|
|
178
|
-
g("p",
|
|
179
|
-
g("div",
|
|
180
|
-
(v(!0), C(
|
|
178
|
+
g("div", Lt, [
|
|
179
|
+
g("p", Wt, j(n(r)("menu.product.table.category.all")), 1),
|
|
180
|
+
g("div", qt, [
|
|
181
|
+
(v(!0), C(oe, null, xe(a.categories, (k) => (v(), P(he, {
|
|
181
182
|
key: k,
|
|
182
183
|
label: k,
|
|
183
184
|
variant: "neutral"
|
|
@@ -187,7 +188,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
187
188
|
]),
|
|
188
189
|
default: A(() => [
|
|
189
190
|
g("div", Et, [
|
|
190
|
-
(v(!0), C(
|
|
191
|
+
(v(!0), C(oe, null, xe(o.value, (k) => (v(), P(he, {
|
|
191
192
|
key: k,
|
|
192
193
|
label: k,
|
|
193
194
|
variant: "neutral"
|
|
@@ -196,14 +197,14 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
196
197
|
key: 0,
|
|
197
198
|
label: "...",
|
|
198
199
|
variant: "neutral"
|
|
199
|
-
})) :
|
|
200
|
+
})) : z("", !0)
|
|
200
201
|
])
|
|
201
202
|
]),
|
|
202
203
|
_: 1
|
|
203
204
|
}));
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
|
-
}),
|
|
207
|
+
}), Xt = /* @__PURE__ */ G({
|
|
207
208
|
__name: "ProductSearcher",
|
|
208
209
|
props: /* @__PURE__ */ Qe({
|
|
209
210
|
label: {},
|
|
@@ -233,10 +234,10 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
233
234
|
}, null, 8, ["modelValue", "items", "label", "helper-text"]);
|
|
234
235
|
};
|
|
235
236
|
}
|
|
236
|
-
}),
|
|
237
|
+
}), el = { class: "flex" }, tl = { class: "w-[260px] space-y-16 h-full" }, ll = { class: "flex items-center gap-4 px-8" }, al = { class: "fm-typo-en-title-sm-600" }, ol = {
|
|
237
238
|
key: 0,
|
|
238
239
|
class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4"
|
|
239
|
-
},
|
|
240
|
+
}, nl = { class: "fm-typo-en-body-md-600" }, rl = { class: "flex-1" }, lt = /* @__PURE__ */ G({
|
|
240
241
|
__name: "ViewLayout",
|
|
241
242
|
props: /* @__PURE__ */ Qe({
|
|
242
243
|
title: {},
|
|
@@ -251,15 +252,15 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
251
252
|
const a = He(w, "modelValue");
|
|
252
253
|
return (r, u) => {
|
|
253
254
|
const l = B("FmCollapsibleTabs");
|
|
254
|
-
return v(), C("div",
|
|
255
|
-
g("div",
|
|
256
|
-
g("div",
|
|
257
|
-
g("p",
|
|
258
|
-
r.titleBadge !== void 0 ? (v(), C("div",
|
|
259
|
-
g("p",
|
|
260
|
-
])) :
|
|
255
|
+
return v(), C("div", el, [
|
|
256
|
+
g("div", tl, [
|
|
257
|
+
g("div", ll, [
|
|
258
|
+
g("p", al, j(r.title), 1),
|
|
259
|
+
r.titleBadge !== void 0 ? (v(), C("div", ol, [
|
|
260
|
+
g("p", nl, j(r.titleBadge), 1)
|
|
261
|
+
])) : z("", !0)
|
|
261
262
|
]),
|
|
262
|
-
m(
|
|
263
|
+
m(Me, null, {
|
|
263
264
|
default: A(() => [
|
|
264
265
|
m(l, {
|
|
265
266
|
modelValue: a.value,
|
|
@@ -271,13 +272,13 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
271
272
|
})
|
|
272
273
|
]),
|
|
273
274
|
u[1] || (u[1] = g("div", { class: "w-[1px] min-h-full ml-4 mr-12 bg-fm-color-neutral-gray-100 self-stretch" }, null, -1)),
|
|
274
|
-
g("div",
|
|
275
|
+
g("div", rl, [
|
|
275
276
|
ve(r.$slots, "default")
|
|
276
277
|
])
|
|
277
278
|
]);
|
|
278
279
|
};
|
|
279
280
|
}
|
|
280
|
-
}), we = /* @__PURE__ */
|
|
281
|
+
}), we = /* @__PURE__ */ G({
|
|
281
282
|
__name: "OrderFromChip",
|
|
282
283
|
props: {
|
|
283
284
|
orderFrom: {}
|
|
@@ -292,7 +293,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
292
293
|
}, null, 8, ["label", "variant"]);
|
|
293
294
|
};
|
|
294
295
|
}
|
|
295
|
-
}),
|
|
296
|
+
}), sl = /* @__PURE__ */ G({
|
|
296
297
|
__name: "GroupViewTable",
|
|
297
298
|
props: {
|
|
298
299
|
data: {}
|
|
@@ -360,7 +361,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
360
361
|
i();
|
|
361
362
|
}), (o, s) => {
|
|
362
363
|
const f = B("FmTable");
|
|
363
|
-
return v(), P(
|
|
364
|
+
return v(), P(Me, null, {
|
|
364
365
|
default: A(() => [m(f, {
|
|
365
366
|
"column-defs": r,
|
|
366
367
|
"row-data": o.data,
|
|
@@ -375,7 +376,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
375
376
|
});
|
|
376
377
|
};
|
|
377
378
|
}
|
|
378
|
-
}),
|
|
379
|
+
}), ul = /* @__PURE__ */ G({
|
|
379
380
|
__name: "GroupView",
|
|
380
381
|
props: {
|
|
381
382
|
itemId: {},
|
|
@@ -390,7 +391,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
390
391
|
// @ts-ignore
|
|
391
392
|
code: k.code || k.fallbackCode,
|
|
392
393
|
productName: k.combinationKey ? "" : k.name ?? "",
|
|
393
|
-
price: k.price ?
|
|
394
|
+
price: k.price ? ie.fromFdoDinero(k.price).toFormat() : "--",
|
|
394
395
|
orderFrom: k.orderFrom ?? void 0,
|
|
395
396
|
variant: k.combinationKey ? k.name ?? "" : void 0
|
|
396
397
|
}))
|
|
@@ -442,15 +443,15 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
442
443
|
title: "Catalog",
|
|
443
444
|
"title-badge": u.value
|
|
444
445
|
}, {
|
|
445
|
-
default: A(() => [m(
|
|
446
|
+
default: A(() => [m(sl, {
|
|
446
447
|
data: i.value
|
|
447
448
|
}, null, 8, ["data"])]),
|
|
448
449
|
_: 1
|
|
449
450
|
}, 8, ["modelValue", "items", "title-badge"]));
|
|
450
451
|
}
|
|
451
|
-
}),
|
|
452
|
+
}), il = {
|
|
452
453
|
class: "scroll-x-auto"
|
|
453
|
-
},
|
|
454
|
+
}, cl = /* @__PURE__ */ G({
|
|
454
455
|
__name: "ProductViewTable",
|
|
455
456
|
props: {
|
|
456
457
|
itemId: {},
|
|
@@ -513,13 +514,13 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
513
514
|
const s = (await Ct(Te(a.menu), a.catalogId, i.schedulerId)).modules.item.find((p) => p._id === a.itemId), f = u.value.findIndex((p) => p.schedulerId === i.schedulerId);
|
|
514
515
|
if (s) {
|
|
515
516
|
const p = Te(u.value);
|
|
516
|
-
p[f].loading = !1, p[f].code = s.code || "--", p[f].productName = s.name || "--", p[f].price =
|
|
517
|
+
p[f].loading = !1, p[f].code = s.code || "--", p[f].productName = s.name || "--", p[f].price = ie.fromFdoDinero(s.price).toFormat(), p[f].orderFrom = s.orderFrom || "--", u.value = p;
|
|
517
518
|
}
|
|
518
519
|
});
|
|
519
520
|
}), (i, o) => {
|
|
520
521
|
const s = B("FmTable");
|
|
521
|
-
return v(), P(
|
|
522
|
-
default: A(() => [g("div",
|
|
522
|
+
return v(), P(Me, null, {
|
|
523
|
+
default: A(() => [g("div", il, [m(s, {
|
|
523
524
|
class: "min-w-[800px]",
|
|
524
525
|
"column-defs": r,
|
|
525
526
|
"row-data": u.value,
|
|
@@ -531,7 +532,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
531
532
|
});
|
|
532
533
|
};
|
|
533
534
|
}
|
|
534
|
-
}),
|
|
535
|
+
}), dl = /* @__PURE__ */ G({
|
|
535
536
|
__name: "ProductView",
|
|
536
537
|
props: {
|
|
537
538
|
itemId: {},
|
|
@@ -576,7 +577,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
576
577
|
default: A(() => {
|
|
577
578
|
var f, p;
|
|
578
579
|
return [
|
|
579
|
-
m(
|
|
580
|
+
m(cl, {
|
|
580
581
|
menu: o.menu,
|
|
581
582
|
"item-id": o.itemId,
|
|
582
583
|
"catalog-id": ((f = i.value) == null ? void 0 : f.catalogId) || null,
|
|
@@ -587,10 +588,10 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
587
588
|
_: 1
|
|
588
589
|
}, 8, ["modelValue", "items", "title-badge"]));
|
|
589
590
|
}
|
|
590
|
-
}),
|
|
591
|
+
}), ml = { class: "flex items-center gap-8" }, pl = { class: "space-y-4" }, vl = { class: "fm-typo-en-title-md-600" }, fl = { key: 0 }, gl = { class: "text-fm-color-typo-secondary" }, bl = {
|
|
591
592
|
key: 0,
|
|
592
593
|
class: "text-fm-color-typo-secondary"
|
|
593
|
-
},
|
|
594
|
+
}, _l = { class: "flex items-center gap-4" }, yl = /* @__PURE__ */ G({
|
|
594
595
|
__name: "ProductBaseInfo",
|
|
595
596
|
props: {
|
|
596
597
|
itemId: {},
|
|
@@ -599,37 +600,37 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
599
600
|
setup(w) {
|
|
600
601
|
const a = w, r = x(() => a.menu.modules.item.find((l) => l._id === a.itemId)), u = x(() => {
|
|
601
602
|
var l;
|
|
602
|
-
return
|
|
603
|
+
return ie.fromFdoDinero((l = r.value) == null ? void 0 : l.price).toFormat(!0);
|
|
603
604
|
});
|
|
604
605
|
return (l, i) => {
|
|
605
606
|
var o, s, f, p, b, y, k;
|
|
606
|
-
return v(), C("div",
|
|
607
|
+
return v(), C("div", ml, [
|
|
607
608
|
m(Ae, {
|
|
608
609
|
alt: ((o = r.value) == null ? void 0 : o.name) ?? null,
|
|
609
610
|
size: 72,
|
|
610
611
|
src: (s = r.value) == null ? void 0 : s.thumbnail,
|
|
611
612
|
crossorigin: !1
|
|
612
613
|
}, null, 8, ["alt", "src"]),
|
|
613
|
-
g("div",
|
|
614
|
-
g("p",
|
|
615
|
-
(f = r.value) != null && f.code ? (v(), C("span",
|
|
614
|
+
g("div", pl, [
|
|
615
|
+
g("p", vl, [
|
|
616
|
+
(f = r.value) != null && f.code ? (v(), C("span", fl, j((p = r.value) == null ? void 0 : p.code) + ", ", 1)) : z("", !0),
|
|
616
617
|
g("span", null, j((b = r.value) == null ? void 0 : b.name), 1)
|
|
617
618
|
]),
|
|
618
|
-
g("p",
|
|
619
|
-
(y = r.value) != null && y.customAttributes ? (v(), C("div",
|
|
620
|
-
g("div",
|
|
619
|
+
g("p", gl, "Base price: " + j(u.value), 1),
|
|
620
|
+
(y = r.value) != null && y.customAttributes ? (v(), C("div", bl, [
|
|
621
|
+
g("div", _l, [
|
|
621
622
|
i[0] || (i[0] = g("span", null, "Tagging:", -1)),
|
|
622
623
|
m(Pe, {
|
|
623
624
|
ellipsis: !1,
|
|
624
625
|
"custom-attributes": (k = r.value) == null ? void 0 : k.customAttributes
|
|
625
626
|
}, null, 8, ["custom-attributes"])
|
|
626
627
|
])
|
|
627
|
-
])) :
|
|
628
|
+
])) : z("", !0)
|
|
628
629
|
])
|
|
629
630
|
]);
|
|
630
631
|
};
|
|
631
632
|
}
|
|
632
|
-
}),
|
|
633
|
+
}), hl = { class: "space-y-16" }, xl = /* @__PURE__ */ G({
|
|
633
634
|
__name: "ProductViewer",
|
|
634
635
|
props: {
|
|
635
636
|
itemId: {},
|
|
@@ -640,19 +641,19 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
640
641
|
{
|
|
641
642
|
value: "product",
|
|
642
643
|
label: "Product",
|
|
643
|
-
component:
|
|
644
|
+
component: dl
|
|
644
645
|
},
|
|
645
646
|
{
|
|
646
647
|
value: "group",
|
|
647
648
|
label: "Group",
|
|
648
|
-
component:
|
|
649
|
+
component: ul
|
|
649
650
|
}
|
|
650
651
|
]);
|
|
651
652
|
return (u, l) => {
|
|
652
653
|
var o;
|
|
653
654
|
const i = B("FmTabs");
|
|
654
|
-
return v(), C("div",
|
|
655
|
-
m(
|
|
655
|
+
return v(), C("div", hl, [
|
|
656
|
+
m(yl, {
|
|
656
657
|
"item-id": u.itemId,
|
|
657
658
|
menu: u.menu
|
|
658
659
|
}, null, 8, ["item-id", "menu"]),
|
|
@@ -672,7 +673,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
672
673
|
]);
|
|
673
674
|
};
|
|
674
675
|
}
|
|
675
|
-
}),
|
|
676
|
+
}), Cl = { class: "space-y-24" }, wl = { key: 0 }, kl = /* @__PURE__ */ G({
|
|
676
677
|
__name: "ProductOverview",
|
|
677
678
|
props: {
|
|
678
679
|
itemId: {},
|
|
@@ -682,9 +683,9 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
682
683
|
const a = w, r = ke(), u = V(null);
|
|
683
684
|
return Xe(() => {
|
|
684
685
|
u.value = a.itemId;
|
|
685
|
-
}), (l, i) => (v(), C("div",
|
|
686
|
-
l.showSearch ? (v(), C("div",
|
|
687
|
-
m(
|
|
686
|
+
}), (l, i) => (v(), C("div", Cl, [
|
|
687
|
+
l.showSearch ? (v(), C("div", wl, [
|
|
688
|
+
m(Xt, {
|
|
688
689
|
modelValue: u.value,
|
|
689
690
|
"onUpdate:modelValue": i[0] || (i[0] = (o) => u.value = o),
|
|
690
691
|
class: "w-1/2",
|
|
@@ -692,17 +693,17 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
692
693
|
"helper-text": "Quickly find products and view their prices across different catalogs and schedules.",
|
|
693
694
|
menu: n(r).state.menu
|
|
694
695
|
}, null, 8, ["modelValue", "menu"])
|
|
695
|
-
])) :
|
|
696
|
+
])) : z("", !0),
|
|
696
697
|
g("div", null, [
|
|
697
|
-
u.value ? (v(), P(
|
|
698
|
+
u.value ? (v(), P(xl, {
|
|
698
699
|
key: 0,
|
|
699
700
|
"item-id": u.value,
|
|
700
701
|
menu: n(r).state.menu
|
|
701
|
-
}, null, 8, ["item-id", "menu"])) :
|
|
702
|
+
}, null, 8, ["item-id", "menu"])) : z("", !0)
|
|
702
703
|
])
|
|
703
704
|
]));
|
|
704
705
|
}
|
|
705
|
-
}),
|
|
706
|
+
}), Sl = /* @__PURE__ */ G({
|
|
706
707
|
__name: "OverviewSheet",
|
|
707
708
|
setup(w) {
|
|
708
709
|
const a = V(null), r = V(!1);
|
|
@@ -711,7 +712,7 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
711
712
|
}
|
|
712
713
|
return (l, i) => {
|
|
713
714
|
const o = B("FmSideSheet");
|
|
714
|
-
return v(), C(
|
|
715
|
+
return v(), C(oe, null, [
|
|
715
716
|
ve(l.$slots, "default", { trigger: u }),
|
|
716
717
|
m(o, {
|
|
717
718
|
id: "product-overview",
|
|
@@ -725,10 +726,10 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
725
726
|
])),
|
|
726
727
|
default: A(() => [
|
|
727
728
|
g("div", null, [
|
|
728
|
-
r.value && a.value ? (v(), P(
|
|
729
|
+
r.value && a.value ? (v(), P(kl, {
|
|
729
730
|
key: 0,
|
|
730
731
|
"item-id": a.value
|
|
731
|
-
}, null, 8, ["item-id"])) :
|
|
732
|
+
}, null, 8, ["item-id"])) : z("", !0)
|
|
732
733
|
])
|
|
733
734
|
]),
|
|
734
735
|
_: 1
|
|
@@ -737,8 +738,8 @@ const Kt = { class: "inline-flex items-center" }, Rt = {
|
|
|
737
738
|
};
|
|
738
739
|
}
|
|
739
740
|
});
|
|
740
|
-
var
|
|
741
|
-
const We = /* @__PURE__ */
|
|
741
|
+
var Fl = St();
|
|
742
|
+
const We = /* @__PURE__ */ G({
|
|
742
743
|
__name: "ImportButton",
|
|
743
744
|
setup(w) {
|
|
744
745
|
const a = V(!1);
|
|
@@ -750,11 +751,11 @@ const We = /* @__PURE__ */ E({
|
|
|
750
751
|
const l = u.currentCountry.value;
|
|
751
752
|
if (l)
|
|
752
753
|
try {
|
|
753
|
-
|
|
754
|
+
Fl.setCountryConfig(l);
|
|
754
755
|
} catch (i) {
|
|
755
756
|
console.log("Unable to set country config", i);
|
|
756
757
|
}
|
|
757
|
-
}), (l, i) => (v(), C(
|
|
758
|
+
}), (l, i) => (v(), C(oe, null, [
|
|
758
759
|
m(Ft, {
|
|
759
760
|
modelValue: a.value,
|
|
760
761
|
"onUpdate:modelValue": i[0] || (i[0] = (o) => a.value = o)
|
|
@@ -764,63 +765,63 @@ const We = /* @__PURE__ */ E({
|
|
|
764
765
|
}
|
|
765
766
|
}), qe = (w) => m("div", {
|
|
766
767
|
class: "flex flex-1 justify-end"
|
|
767
|
-
}, [m("span", null, [w, Ye(" ")])]),
|
|
768
|
+
}, [m("span", null, [w, Ye(" ")])]), Vl = {
|
|
768
769
|
class: "flex justify-between items-center space-x-8"
|
|
769
|
-
}, Vl = {
|
|
770
|
-
class: "flex space-x-8"
|
|
771
770
|
}, Il = {
|
|
772
|
-
class: "
|
|
771
|
+
class: "flex space-x-8"
|
|
773
772
|
}, $l = {
|
|
774
|
-
|
|
773
|
+
class: "w-[320px]"
|
|
775
774
|
}, Tl = {
|
|
776
|
-
key:
|
|
777
|
-
class: /* @__PURE__ */ re(["flex-1 flex flex-col", "divide-y divide-fm-color-neutral-gray-100", "overflow-hidden"])
|
|
775
|
+
key: 0
|
|
778
776
|
}, Pl = {
|
|
777
|
+
key: 1,
|
|
778
|
+
class: /* @__PURE__ */ ne(["flex-1 flex flex-col", "divide-y divide-fm-color-neutral-gray-100", "overflow-hidden"])
|
|
779
|
+
}, Al = {
|
|
779
780
|
key: 0,
|
|
780
781
|
class: "flex items-center p-4"
|
|
781
|
-
}, Al = {
|
|
782
|
-
class: /* @__PURE__ */ re(["mr-8", "fm-typo-en-body-md-400"])
|
|
783
782
|
}, Ol = {
|
|
783
|
+
class: /* @__PURE__ */ ne(["mr-8", "fm-typo-en-body-md-400"])
|
|
784
|
+
}, Ml = {
|
|
784
785
|
key: 1,
|
|
785
786
|
class: "px-16 py-4 space-x-8 flex justify-end"
|
|
786
787
|
}, Ul = {
|
|
787
788
|
key: 2
|
|
788
|
-
},
|
|
789
|
+
}, zl = {
|
|
789
790
|
class: "flex space-x-8"
|
|
790
|
-
},
|
|
791
|
+
}, Nl = {
|
|
791
792
|
key: 1,
|
|
792
793
|
class: "pt-8 flex flex-col flex-1 overflow-hidden"
|
|
793
|
-
},
|
|
794
|
+
}, Rl = {
|
|
794
795
|
class: "space-y-8 pb-8"
|
|
795
|
-
},
|
|
796
|
+
}, Dl = {
|
|
796
797
|
class: "w-full px-8"
|
|
797
798
|
}, Kl = {
|
|
798
799
|
class: "flex space-x-8 px-8"
|
|
799
|
-
},
|
|
800
|
+
}, Bl = {
|
|
800
801
|
key: 0,
|
|
801
802
|
class: "px-8"
|
|
802
|
-
},
|
|
803
|
+
}, jl = {
|
|
803
804
|
key: 0,
|
|
804
|
-
class: /* @__PURE__ */
|
|
805
|
-
},
|
|
805
|
+
class: /* @__PURE__ */ ne(["flex flex-col flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
|
|
806
|
+
}, Gl = ["onClick"], El = {
|
|
806
807
|
class: "min-w-0 flex flex-1 items-center justify-start space-x-16"
|
|
807
|
-
}, Gl = {
|
|
808
|
-
class: "flex-1 min-w-0"
|
|
809
808
|
}, Ll = {
|
|
810
|
-
class: "flex
|
|
809
|
+
class: "flex-1 min-w-0"
|
|
811
810
|
}, Wl = {
|
|
812
|
-
class: "flex-
|
|
811
|
+
class: "flex justify-between items-center gap-8 pb-4"
|
|
813
812
|
}, ql = {
|
|
814
|
-
class: "fm-typo-en-body-
|
|
813
|
+
class: "flex-1 min-w-0 fm-typo-en-body-lg-600 line-clamp-2"
|
|
815
814
|
}, Ql = {
|
|
816
815
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
817
816
|
}, Hl = {
|
|
818
817
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
819
818
|
}, Yl = {
|
|
820
|
-
|
|
819
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
821
820
|
}, Zl = {
|
|
821
|
+
key: 1
|
|
822
|
+
}, Jl = {
|
|
822
823
|
class: "flex space-x-8"
|
|
823
|
-
},
|
|
824
|
+
}, Xl = /* @__PURE__ */ G({
|
|
824
825
|
__name: "ProductTable",
|
|
825
826
|
props: {
|
|
826
827
|
modelValue: {},
|
|
@@ -836,7 +837,7 @@ const We = /* @__PURE__ */ E({
|
|
|
836
837
|
}) {
|
|
837
838
|
const u = w, {
|
|
838
839
|
t: l
|
|
839
|
-
} = Se(), i = Oe(), o = ke(), s =
|
|
840
|
+
} = Se(), i = Oe(), o = ke(), s = Pt(), f = et(), p = i.currentCountry, b = x(() => p.value ? Tt.getCountry(p.value) : null), y = x(() => o.rules.item), {
|
|
840
841
|
selectedCategories: k
|
|
841
842
|
} = Ce(), L = x(() => {
|
|
842
843
|
const e = me.flatten(k.value.map((t) => t.items));
|
|
@@ -858,28 +859,28 @@ const We = /* @__PURE__ */ E({
|
|
|
858
859
|
logic: "AND",
|
|
859
860
|
rules: []
|
|
860
861
|
});
|
|
861
|
-
function
|
|
862
|
+
function N(e) {
|
|
862
863
|
const t = L.value.map((d) => {
|
|
863
864
|
var h;
|
|
864
865
|
return (h = d.customAttributes) == null ? void 0 : h[e];
|
|
865
866
|
}).filter((d) => typeof d == "string" && !!d);
|
|
866
867
|
return [...new Set(t)];
|
|
867
868
|
}
|
|
868
|
-
const
|
|
869
|
-
const t =
|
|
869
|
+
const U = x(() => i.itemAttributeSettings.value.map((e) => {
|
|
870
|
+
const t = N(e.key);
|
|
870
871
|
return {
|
|
871
872
|
...e,
|
|
872
873
|
values: t
|
|
873
874
|
};
|
|
874
|
-
})), T = V(""), $ =
|
|
875
|
+
})), T = V(""), $ = Rt(T, 300), R = x(() => {
|
|
875
876
|
const e = (c) => {
|
|
876
877
|
var h;
|
|
877
|
-
return !$.value || !$.value.trim() ? !0 : [c.code, c.name,
|
|
878
|
+
return !$.value || !$.value.trim() ? !0 : [c.code, c.name, Ne(c), ...Ie(M.value, c), (h = ye()[c.orderFrom]) == null ? void 0 : h.label, Object.values(c.customAttributes ?? {}).join(" ")].join(" ").toLowerCase().includes($.value.toLowerCase());
|
|
878
879
|
}, t = (c) => !c.customAttributes && !I.value.rules.length ? !0 : ht(c.customAttributes ?? {}, I.value);
|
|
879
880
|
return L.value.filter((c) => e(c) && t(c));
|
|
880
881
|
}), {
|
|
881
|
-
categories:
|
|
882
|
-
} = Ce(),
|
|
882
|
+
categories: M
|
|
883
|
+
} = Ce(), D = x(() => o.categories.map((e) => ({
|
|
883
884
|
label: e.name,
|
|
884
885
|
value: e._id || null
|
|
885
886
|
}))), O = (e, t, c) => {
|
|
@@ -892,12 +893,12 @@ const We = /* @__PURE__ */ E({
|
|
|
892
893
|
...h,
|
|
893
894
|
[t]: c
|
|
894
895
|
}, ee("update:model-value", d));
|
|
895
|
-
}, Y = gt(() => u.originalValue, () => u.modelValue),
|
|
896
|
+
}, Y = gt(() => u.originalValue, () => u.modelValue), K = me.debounce(O, 300), re = (e) => (t) => !!t || l("menu.product.table.validation.name_required", {
|
|
896
897
|
field: e
|
|
897
|
-
}), de = (e) => e >= 0 || l("menu.product.table.validation.price_min"), fe = [
|
|
898
|
+
}), de = (e) => e >= 0 || l("menu.product.table.validation.price_min"), fe = [re("Name")], ge = () => [(e) => de(typeof e == "number" ? e : Number(e) ?? 0)], at = ye(), ot = x(() => {
|
|
898
899
|
const e = o.isV4;
|
|
899
900
|
return ft.setCoreStore(i).taxSetting(e);
|
|
900
|
-
}),
|
|
901
|
+
}), Ue = x(() => [{
|
|
901
902
|
accessorKey: "thumbnail",
|
|
902
903
|
header: "",
|
|
903
904
|
size: 110,
|
|
@@ -932,7 +933,7 @@ const We = /* @__PURE__ */ E({
|
|
|
932
933
|
modelValue: Y(t._id, "code") ?? (d == null ? void 0 : d.code),
|
|
933
934
|
placeholder: u.modelValue[t._id].fallbackCode,
|
|
934
935
|
"onUpdate:modelValue": (h) => {
|
|
935
|
-
|
|
936
|
+
K(t._id, "code", h);
|
|
936
937
|
}
|
|
937
938
|
});
|
|
938
939
|
}
|
|
@@ -947,7 +948,7 @@ const We = /* @__PURE__ */ E({
|
|
|
947
948
|
disabled: !y.value.name,
|
|
948
949
|
modelValue: Y(t._id, "name") ?? t.name,
|
|
949
950
|
"onUpdate:modelValue": (d) => {
|
|
950
|
-
|
|
951
|
+
K(t._id, "name", d);
|
|
951
952
|
},
|
|
952
953
|
rules: fe,
|
|
953
954
|
placeholder: t.fallbackName
|
|
@@ -969,13 +970,13 @@ const We = /* @__PURE__ */ E({
|
|
|
969
970
|
cell: (e) => {
|
|
970
971
|
var h;
|
|
971
972
|
const t = e.getValue();
|
|
972
|
-
if (!S.value) return
|
|
973
|
+
if (!S.value) return ie.fromFdoDinero(t).toFormat();
|
|
973
974
|
const c = u.modelValue[e.row.original._id], d = c.fallbackPrice;
|
|
974
|
-
return q(
|
|
975
|
+
return q(Mt, {
|
|
975
976
|
min: 0,
|
|
976
977
|
disabled: !c.editPrice,
|
|
977
978
|
// @ts-ignore
|
|
978
|
-
placeholder: d ?
|
|
979
|
+
placeholder: d ? zt(d, !1) : void 0,
|
|
979
980
|
modelValue: Y(c._id, "price") ?? ((h = Ve(c._id)) == null ? void 0 : h.price),
|
|
980
981
|
// @ts-ignore
|
|
981
982
|
"onUpdate:modelValue": (F) => {
|
|
@@ -1003,7 +1004,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1003
1004
|
modelValue: _,
|
|
1004
1005
|
"onUpdate:modelValue": async (X) => {
|
|
1005
1006
|
const _e = o.decodeTax(X);
|
|
1006
|
-
|
|
1007
|
+
K(c._id, "taxes", [_e]);
|
|
1007
1008
|
}
|
|
1008
1009
|
});
|
|
1009
1010
|
}
|
|
@@ -1016,22 +1017,22 @@ const We = /* @__PURE__ */ E({
|
|
|
1016
1017
|
const t = e.row.original;
|
|
1017
1018
|
if (!S.value)
|
|
1018
1019
|
return q(Le, {
|
|
1019
|
-
categories: Ie(
|
|
1020
|
+
categories: Ie(M.value, t)
|
|
1020
1021
|
});
|
|
1021
1022
|
const c = _t(u.originalValue, u.modelValue, t._id) ?? yt(t), d = (c == null ? void 0 : c.map((F) => F._id)) ?? [], h = c == null ? void 0 : c.reduce((F, _) => (F[_._id] = _, F), {});
|
|
1022
1023
|
return q($t, {
|
|
1023
1024
|
shouldShowChips: !1,
|
|
1024
1025
|
shouldShowSelectedItemsWithinPlaceholder: !0,
|
|
1025
1026
|
modelValue: d.length > 0 ? d : [null],
|
|
1026
|
-
items:
|
|
1027
|
+
items: D.value,
|
|
1027
1028
|
disabled: !!(o.state.currentCatalogId || o.state.currentSchedulerId),
|
|
1028
1029
|
"onUpdate:modelValue": async (F) => {
|
|
1029
1030
|
const [_, ...X] = F;
|
|
1030
|
-
|
|
1031
|
+
K(t._id, {
|
|
1031
1032
|
category: _,
|
|
1032
1033
|
additionalCategories: X.map((_e) => {
|
|
1033
|
-
const
|
|
1034
|
-
return
|
|
1034
|
+
const De = h == null ? void 0 : h[_e];
|
|
1035
|
+
return De || {
|
|
1035
1036
|
_id: _e,
|
|
1036
1037
|
position: null
|
|
1037
1038
|
};
|
|
@@ -1084,7 +1085,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1084
1085
|
},
|
|
1085
1086
|
header: () => q("div", {
|
|
1086
1087
|
class: "w-full px-4 flex justify-end"
|
|
1087
|
-
}, [
|
|
1088
|
+
}, [Nt(q(J.FmButton, {
|
|
1088
1089
|
variant: Z.Tertiary,
|
|
1089
1090
|
textColor: Q.NeutralGray400,
|
|
1090
1091
|
prependIcon: "edit",
|
|
@@ -1096,14 +1097,14 @@ const We = /* @__PURE__ */ E({
|
|
|
1096
1097
|
const t = e.row.original;
|
|
1097
1098
|
return m("div", {
|
|
1098
1099
|
class: "px-4 flex justify-end"
|
|
1099
|
-
}, [m(
|
|
1100
|
+
}, [m(Sl, null, {
|
|
1100
1101
|
default: ({
|
|
1101
1102
|
trigger: c
|
|
1102
1103
|
}) => m(J.FmButton, {
|
|
1103
1104
|
icon: "overview",
|
|
1104
1105
|
variant: "tertiary",
|
|
1105
1106
|
textColor: Q.NeutralGray400,
|
|
1106
|
-
onClick:
|
|
1107
|
+
onClick: ue(() => {
|
|
1107
1108
|
c(t._id);
|
|
1108
1109
|
}, ["stop", "prevent"])
|
|
1109
1110
|
}, null)
|
|
@@ -1111,7 +1112,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1111
1112
|
icon: "delete",
|
|
1112
1113
|
variant: "tertiary",
|
|
1113
1114
|
textColor: Q.NeutralGray400,
|
|
1114
|
-
onClick:
|
|
1115
|
+
onClick: ue(async () => {
|
|
1115
1116
|
await f.deleteItem([{
|
|
1116
1117
|
_id: t._id,
|
|
1117
1118
|
name: t.name,
|
|
@@ -1121,27 +1122,27 @@ const We = /* @__PURE__ */ E({
|
|
|
1121
1122
|
}, null)]);
|
|
1122
1123
|
}
|
|
1123
1124
|
}]);
|
|
1124
|
-
o.taxSetting.systemCode ||
|
|
1125
|
-
const
|
|
1126
|
-
ae([() =>
|
|
1125
|
+
o.taxSetting.systemCode || Ue.value.splice(4, 1);
|
|
1126
|
+
const se = V({}), le = V([]);
|
|
1127
|
+
ae([() => se.value, () => R.value], (e) => {
|
|
1127
1128
|
let t = [];
|
|
1128
1129
|
Object.keys(e[0]).forEach((c) => {
|
|
1129
|
-
const d = e[0][c], h =
|
|
1130
|
+
const d = e[0][c], h = R.value[parseInt(c)];
|
|
1130
1131
|
h && (d ? t.push(h) : le.value = t.filter((F) => F !== h));
|
|
1131
1132
|
}), le.value = t;
|
|
1132
1133
|
}), ae(() => L.value, () => {
|
|
1133
|
-
|
|
1134
|
+
se.value = {}, le.value = [];
|
|
1134
1135
|
}), ae(() => S.value, () => {
|
|
1135
|
-
|
|
1136
|
+
se.value = {}, le.value = [];
|
|
1136
1137
|
});
|
|
1137
1138
|
const nt = () => {
|
|
1138
|
-
|
|
1139
|
+
se.value = {};
|
|
1139
1140
|
};
|
|
1140
|
-
async function
|
|
1141
|
+
async function ze() {
|
|
1141
1142
|
await $e();
|
|
1142
1143
|
const e = () => !!o.currentCatalog || !!o.state.currentSchedulerId, t = (d) => d === "" || d === null ? e() ? "" : null : d, c = Object.values(u.modelValue).filter((d) => {
|
|
1143
1144
|
const h = Object.values(u.originalValue).find((F) => F._id === d._id);
|
|
1144
|
-
return
|
|
1145
|
+
return Ke(h, d);
|
|
1145
1146
|
}).map((d) => ({
|
|
1146
1147
|
_id: d._id,
|
|
1147
1148
|
name: d.name,
|
|
@@ -1163,7 +1164,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1163
1164
|
}, be = () => {
|
|
1164
1165
|
ee("reset:model-value");
|
|
1165
1166
|
}, Fe = () => {
|
|
1166
|
-
Object.entries(u.modelValue).some(([t, c]) =>
|
|
1167
|
+
Object.entries(u.modelValue).some(([t, c]) => Ke(c, u.originalValue[t])) ? s.open({
|
|
1167
1168
|
title: "You have unsaved changes!",
|
|
1168
1169
|
message: "Are you sure you want to discard? You will lose all the changes if discard edit.",
|
|
1169
1170
|
primaryActions: {
|
|
@@ -1191,13 +1192,13 @@ const We = /* @__PURE__ */ E({
|
|
|
1191
1192
|
async function it(e) {
|
|
1192
1193
|
await f.update(e.original._id);
|
|
1193
1194
|
}
|
|
1194
|
-
function
|
|
1195
|
+
function Ne(e) {
|
|
1195
1196
|
var _;
|
|
1196
1197
|
const t = e.price ?? // TODO: fix type error
|
|
1197
1198
|
// @ts-ignore
|
|
1198
|
-
e.fallbackPrice ??
|
|
1199
|
+
e.fallbackPrice ?? ie.fromNumber({
|
|
1199
1200
|
number: 0
|
|
1200
|
-
}).toObject(), c = e.taxes, d = o.taxSetting.countryTaxOptions, h =
|
|
1201
|
+
}).toObject(), c = e.taxes, d = o.taxSetting.countryTaxOptions, h = ie.fromFdoDinero(t).toFormat(), F = (_ = b.value) == null ? void 0 : _.currency.symbol;
|
|
1201
1202
|
return o.getSelectedTax(
|
|
1202
1203
|
c,
|
|
1203
1204
|
// TODO: fix type error
|
|
@@ -1214,7 +1215,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1214
1215
|
return F == null ? void 0 : F[0];
|
|
1215
1216
|
} else return t ? t.override.items[e][0] : c ? o.schedulers.find((_) => _._id === c).items.filter((_) => _._id === e)[0] : L.value.find((h) => h._id === e);
|
|
1216
1217
|
}
|
|
1217
|
-
const ct = tt(), dt = x(() => ct.breakpoints.value.xs),
|
|
1218
|
+
const ct = tt(), dt = x(() => ct.breakpoints.value.xs), Re = V(null), mt = Ot(Re, W), pt = x(() => {
|
|
1218
1219
|
var t;
|
|
1219
1220
|
return {
|
|
1220
1221
|
height: `calc(100vh - ${((t = mt.value) == null ? void 0 : t.top) + 24}px)`
|
|
@@ -1222,20 +1223,20 @@ const We = /* @__PURE__ */ E({
|
|
|
1222
1223
|
});
|
|
1223
1224
|
return (e, t) => {
|
|
1224
1225
|
const c = B("fm-search"), d = B("fm-button"), h = B("fm-table"), F = B("fm-form");
|
|
1225
|
-
return dt.value ? (v(), C("div",
|
|
1226
|
+
return dt.value ? (v(), C("div", Nl, [g("div", Rl, [g("div", Dl, [m(c, {
|
|
1226
1227
|
"model-value": T.value,
|
|
1227
1228
|
"onUpdate:modelValue": t[5] || (t[5] = (_) => T.value = _),
|
|
1228
1229
|
autofocus: "",
|
|
1229
1230
|
placeholder: n(l)("menu.product.table.search.placeholder")
|
|
1230
1231
|
}, null, 8, ["model-value", "placeholder"])]), t[8] || (t[8] = g("div", {
|
|
1231
1232
|
class: "w-full h-[1px] bg-fm-color-neutral-gray-100"
|
|
1232
|
-
}, null, -1)), g("div", Kl, [ve(e.$slots, "filter")]), W.value ? (v(), C("div",
|
|
1233
|
+
}, null, -1)), g("div", Kl, [ve(e.$slots, "filter")]), W.value ? (v(), C("div", Bl, [m(n(je), {
|
|
1233
1234
|
ref_key: "attributeFilterRef",
|
|
1234
1235
|
ref: te,
|
|
1235
|
-
attributes:
|
|
1236
|
+
attributes: U.value,
|
|
1236
1237
|
modelValue: I.value,
|
|
1237
1238
|
"onUpdate:modelValue": t[6] || (t[6] = (_) => I.value = _)
|
|
1238
|
-
}, null, 8, ["attributes", "modelValue"])])) :
|
|
1239
|
+
}, null, 8, ["attributes", "modelValue"])])) : z("", !0)]), L.value.length ? (v(), C("div", jl, [(v(!0), C(oe, null, xe(R.value, (_) => {
|
|
1239
1240
|
var X;
|
|
1240
1241
|
return v(), C("div", {
|
|
1241
1242
|
key: _._id,
|
|
@@ -1245,27 +1246,27 @@ const We = /* @__PURE__ */ E({
|
|
|
1245
1246
|
alt: _.name,
|
|
1246
1247
|
size: 72,
|
|
1247
1248
|
src: _.thumbnail
|
|
1248
|
-
}, null, 8, ["alt", "src"]), g("div",
|
|
1249
|
+
}, null, 8, ["alt", "src"]), g("div", Ll, [g("div", Wl, [g("p", ql, j(_.name), 1), m(we, {
|
|
1249
1250
|
"order-from": _.orderFrom
|
|
1250
|
-
}, null, 8, ["order-from"])]), g("p",
|
|
1251
|
-
categories: n(Ie)(n(
|
|
1251
|
+
}, null, 8, ["order-from"])]), g("p", Ql, j(Ne(_)), 1), g("p", Hl, j(n(l)("menu.product.table.columns.code")) + ": " + j(((X = Ve(_._id)) == null ? void 0 : X.code) || "--"), 1), g("p", Yl, [m(Le, {
|
|
1252
|
+
categories: n(Ie)(n(M), _)
|
|
1252
1253
|
}, null, 8, ["categories"])]), m(Pe, {
|
|
1253
1254
|
"custom-attributes": _.customAttributes
|
|
1254
1255
|
}, null, 8, ["custom-attributes"])])]), m(d, {
|
|
1255
1256
|
"text-color": n(Q).NeutralGray400,
|
|
1256
1257
|
variant: n(Z).Tertiary,
|
|
1257
1258
|
"prepend-icon": "delete",
|
|
1258
|
-
onClick:
|
|
1259
|
+
onClick: ue(() => n(f).deleteItem([{
|
|
1259
1260
|
_id: _._id,
|
|
1260
1261
|
name: _.name,
|
|
1261
1262
|
thumbnail: _.thumbnail
|
|
1262
1263
|
}]), ["stop"])
|
|
1263
|
-
}, null, 8, ["text-color", "variant", "onClick"])], 8,
|
|
1264
|
-
}), 128))])) : (v(), C("div",
|
|
1264
|
+
}, null, 8, ["text-color", "variant", "onClick"])], 8, Gl);
|
|
1265
|
+
}), 128))])) : (v(), C("div", Zl, [m(pe, {
|
|
1265
1266
|
subtitle: n(l)("menu.product.table.empty.subtitle"),
|
|
1266
1267
|
title: n(l)("menu.product.table.empty.title")
|
|
1267
1268
|
}, {
|
|
1268
|
-
action: A(() => [g("div",
|
|
1269
|
+
action: A(() => [g("div", Jl, [m(d, {
|
|
1269
1270
|
variant: n(Z).Primary,
|
|
1270
1271
|
label: n(l)("menu.product.table.empty.actions.add"),
|
|
1271
1272
|
"prepend-icon": "add",
|
|
@@ -1288,20 +1289,20 @@ const We = /* @__PURE__ */ E({
|
|
|
1288
1289
|
key: 0,
|
|
1289
1290
|
"blame-form-child-on-validation-failed": "",
|
|
1290
1291
|
class: "flex flex-col flex-1 space-y-8 overflow-hidden",
|
|
1291
|
-
onValidationSuccess:
|
|
1292
|
+
onValidationSuccess: ze
|
|
1292
1293
|
}, {
|
|
1293
|
-
default: A(() => [g("div",
|
|
1294
|
+
default: A(() => [g("div", Vl, [g("div", Il, [ve(e.$slots, "filter")]), g("div", $l, [m(c, {
|
|
1294
1295
|
"model-value": T.value,
|
|
1295
1296
|
"onUpdate:modelValue": t[0] || (t[0] = (_) => T.value = _),
|
|
1296
1297
|
autofocus: "",
|
|
1297
1298
|
placeholder: n(l)("menu.product.table.search.placeholder")
|
|
1298
|
-
}, null, 8, ["model-value", "placeholder"])])]), W.value ? (v(), C("div",
|
|
1299
|
+
}, null, 8, ["model-value", "placeholder"])])]), W.value ? (v(), C("div", Tl, [m(n(je), {
|
|
1299
1300
|
ref_key: "attributeFilterRef",
|
|
1300
1301
|
ref: te,
|
|
1301
|
-
attributes:
|
|
1302
|
+
attributes: U.value,
|
|
1302
1303
|
modelValue: I.value,
|
|
1303
1304
|
"onUpdate:modelValue": t[1] || (t[1] = (_) => I.value = _)
|
|
1304
|
-
}, null, 8, ["attributes", "modelValue"])])) :
|
|
1305
|
+
}, null, 8, ["attributes", "modelValue"])])) : z("", !0), L.value.length ? (v(), C("div", Pl, [le.value.length && !S.value ? (v(), C("div", Al, [g("p", Ol, j(n(l)("menu.product.table.selection.count", {
|
|
1305
1306
|
count: le.value.length
|
|
1306
1307
|
})), 1), m(d, {
|
|
1307
1308
|
label: n(l)("menu.product.table.selection.actions.deselect_all"),
|
|
@@ -1316,7 +1317,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1316
1317
|
"prepend-icon": "delete",
|
|
1317
1318
|
variant: "secondary",
|
|
1318
1319
|
onClick: rt
|
|
1319
|
-
}, null, 8, ["border-color", "text-color", "label"])])) :
|
|
1320
|
+
}, null, 8, ["border-color", "text-color", "label"])])) : z("", !0), S.value ? (v(), C("div", Ml, [m(d, {
|
|
1320
1321
|
variant: n(Z).Tertiary,
|
|
1321
1322
|
label: n(l)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
1322
1323
|
onClick: be
|
|
@@ -1330,10 +1331,10 @@ const We = /* @__PURE__ */ E({
|
|
|
1330
1331
|
variant: n(Z).Secondary,
|
|
1331
1332
|
label: n(l)("menu.product.table.bulk_edit.actions.save"),
|
|
1332
1333
|
type: "submit"
|
|
1333
|
-
}, null, 8, ["borderColor", "textColor", "variant", "label"])])) :
|
|
1334
|
+
}, null, 8, ["borderColor", "textColor", "variant", "label"])])) : z("", !0), g("div", {
|
|
1334
1335
|
ref_key: "tableWrapper",
|
|
1335
|
-
ref:
|
|
1336
|
-
}, [(v(), P(Je(S.value ?
|
|
1336
|
+
ref: Re
|
|
1337
|
+
}, [(v(), P(Je(S.value ? At : "div"), {
|
|
1337
1338
|
ref: "fullWrapper",
|
|
1338
1339
|
title: S.value ? n(l)("menu.product.table.bulk_edit.title") : "",
|
|
1339
1340
|
show: S.value,
|
|
@@ -1349,21 +1350,21 @@ const We = /* @__PURE__ */ E({
|
|
|
1349
1350
|
}],
|
|
1350
1351
|
class: "overflow-x-scroll",
|
|
1351
1352
|
style: vt(pt.value),
|
|
1352
|
-
onOnPrimary:
|
|
1353
|
+
onOnPrimary: ze,
|
|
1353
1354
|
onOnCancel: Fe
|
|
1354
1355
|
}, {
|
|
1355
1356
|
default: A(() => [m(h, {
|
|
1356
|
-
class:
|
|
1357
|
+
class: ne({
|
|
1357
1358
|
"min-w-[1100px]": !0,
|
|
1358
1359
|
"mt-24": S.value
|
|
1359
1360
|
}),
|
|
1360
|
-
modelValue:
|
|
1361
|
-
"onUpdate:modelValue": t[2] || (t[2] = (_) =>
|
|
1362
|
-
"column-defs":
|
|
1361
|
+
modelValue: se.value,
|
|
1362
|
+
"onUpdate:modelValue": t[2] || (t[2] = (_) => se.value = _),
|
|
1363
|
+
"column-defs": Ue.value,
|
|
1363
1364
|
"column-visibility": st.value,
|
|
1364
1365
|
loading: e.isCalculating,
|
|
1365
|
-
"page-size":
|
|
1366
|
-
"row-data":
|
|
1366
|
+
"page-size": R.value.length,
|
|
1367
|
+
"row-data": R.value,
|
|
1367
1368
|
"shrink-at": !1,
|
|
1368
1369
|
selection: S.value ? void 0 : "multiple",
|
|
1369
1370
|
virtual: !0,
|
|
@@ -1377,7 +1378,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1377
1378
|
subtitle: n(l)("menu.product.table.empty.subtitle"),
|
|
1378
1379
|
title: n(l)("menu.product.table.empty.title")
|
|
1379
1380
|
}, {
|
|
1380
|
-
action: A(() => [g("div",
|
|
1381
|
+
action: A(() => [g("div", zl, [m(d, {
|
|
1381
1382
|
variant: n(Z).Primary,
|
|
1382
1383
|
label: n(l)("menu.product.table.empty.actions.add"),
|
|
1383
1384
|
"prepend-icon": "add",
|
|
@@ -1401,57 +1402,57 @@ const We = /* @__PURE__ */ E({
|
|
|
1401
1402
|
}));
|
|
1402
1403
|
};
|
|
1403
1404
|
}
|
|
1404
|
-
}),
|
|
1405
|
+
}), ea = {
|
|
1405
1406
|
key: 0,
|
|
1406
|
-
class: /* @__PURE__ */
|
|
1407
|
-
},
|
|
1408
|
-
class: /* @__PURE__ */
|
|
1409
|
-
},
|
|
1407
|
+
class: /* @__PURE__ */ ne(["flex flex-col", "flex-1", "overflow-hidden"])
|
|
1408
|
+
}, ta = {
|
|
1409
|
+
class: /* @__PURE__ */ ne(["pt-16 xs:pt-0", "flex xs:flex-col", "flex-1", "w-full", "overflow-hidden"])
|
|
1410
|
+
}, la = { class: "flex flex-col flex-1 overflow-hidden" }, aa = {
|
|
1410
1411
|
key: 1,
|
|
1411
1412
|
class: "pt-16 xs:pt-8 space-y-24"
|
|
1412
|
-
},
|
|
1413
|
+
}, oa = { class: "flex items-center gap-8 px-16" }, Fa = /* @__PURE__ */ G({
|
|
1413
1414
|
__name: "Product",
|
|
1414
1415
|
setup(w) {
|
|
1415
1416
|
const a = ke(), r = x(() => a.rules.item), u = Vt(), l = et(), i = It(), o = x(() => !a.state.currentCatalogId), s = x(() => a.rules.item), f = x(() => !a.state.currentSchedulerId), p = V(!1), b = V(!1), y = x(() => {
|
|
1416
|
-
var
|
|
1417
|
+
var U, T, $, R;
|
|
1417
1418
|
if (o.value && f.value) return;
|
|
1418
1419
|
if (f.value) {
|
|
1419
|
-
const
|
|
1420
|
-
return
|
|
1421
|
-
const
|
|
1422
|
-
return
|
|
1420
|
+
const M = (U = a.currentCatalog) == null ? void 0 : U.override.items;
|
|
1421
|
+
return M ? Object.entries(M).reduce((D, [O, Y]) => {
|
|
1422
|
+
const K = Y.find((re) => !re.combinationKey);
|
|
1423
|
+
return K && (D[O] = K), D;
|
|
1423
1424
|
}, {}) : {};
|
|
1424
1425
|
}
|
|
1425
|
-
return ((o.value ? (T = a.currentScheduler) == null ? void 0 : T.items : (
|
|
1426
|
+
return ((o.value ? (T = a.currentScheduler) == null ? void 0 : T.items : (R = ($ = a.currentCatalog) == null ? void 0 : $.override.scheduler[a.state.currentSchedulerId]) == null ? void 0 : R.items) ?? []).reduce((M, D) => (D.combinationKey || (M[D._id] = D), M), {});
|
|
1426
1427
|
}), k = V({}), L = V({}), ee = async () => {
|
|
1427
|
-
var
|
|
1428
|
+
var R, M;
|
|
1428
1429
|
b.value = !0;
|
|
1429
|
-
const
|
|
1430
|
+
const N = !!y.value, U = me.flatten(H.value.map((D) => D.items)), T = N && p.value ? await kt(
|
|
1430
1431
|
a.mergedMenu,
|
|
1431
|
-
|
|
1432
|
+
U,
|
|
1432
1433
|
a.state.menu,
|
|
1433
|
-
(
|
|
1434
|
-
(
|
|
1434
|
+
(R = a.currentCatalog) == null ? void 0 : R._id,
|
|
1435
|
+
(M = a.currentScheduler) == null ? void 0 : M._id,
|
|
1435
1436
|
!1
|
|
1436
|
-
) : void 0, $ =
|
|
1437
|
-
var
|
|
1438
|
-
const
|
|
1439
|
-
return
|
|
1437
|
+
) : void 0, $ = U.reduce((D, O, Y) => {
|
|
1438
|
+
var re, de, fe, ge;
|
|
1439
|
+
const K = (re = y.value) == null ? void 0 : re[O._id];
|
|
1440
|
+
return D[O._id] = {
|
|
1440
1441
|
_id: O._id,
|
|
1441
1442
|
name: O.name,
|
|
1442
|
-
code:
|
|
1443
|
+
code: N ? K == null ? void 0 : K.code : O == null ? void 0 : O.code,
|
|
1443
1444
|
category: O.category,
|
|
1444
1445
|
additionalCategories: O.additionalCategories,
|
|
1445
|
-
price:
|
|
1446
|
-
orderFrom:
|
|
1447
|
-
taxes:
|
|
1446
|
+
price: N && s.value.editPrice ? K == null ? void 0 : K.price : O.price,
|
|
1447
|
+
orderFrom: N ? K == null ? void 0 : K.orderFrom : O.orderFrom,
|
|
1448
|
+
taxes: N ? null : O.taxes,
|
|
1448
1449
|
thumbnail: O.thumbnail,
|
|
1449
1450
|
fallbackPrice: (de = T == null ? void 0 : T[Y]) == null ? void 0 : de.price,
|
|
1450
|
-
fallbackName:
|
|
1451
|
+
fallbackName: N ? O.name : void 0,
|
|
1451
1452
|
fallbackCode: (fe = T == null ? void 0 : T[Y]) == null ? void 0 : fe.code,
|
|
1452
1453
|
fallbackOrder: (ge = T == null ? void 0 : T[Y]) == null ? void 0 : ge.orderFrom,
|
|
1453
|
-
fallbackTaxes:
|
|
1454
|
-
},
|
|
1454
|
+
fallbackTaxes: N ? O.taxes : null
|
|
1455
|
+
}, D;
|
|
1455
1456
|
}, {});
|
|
1456
1457
|
k.value = $, L.value = { ...$ }, b.value = !1;
|
|
1457
1458
|
}, { categories: S, selectedCategories: H } = Ce(), W = V(null);
|
|
@@ -1464,37 +1465,37 @@ const We = /* @__PURE__ */ E({
|
|
|
1464
1465
|
function ce() {
|
|
1465
1466
|
l.create(null);
|
|
1466
1467
|
}
|
|
1467
|
-
const
|
|
1468
|
+
const E = () => {
|
|
1468
1469
|
H.value && ee();
|
|
1469
1470
|
}, { t: I } = Se();
|
|
1470
|
-
return (
|
|
1471
|
+
return (N, U) => {
|
|
1471
1472
|
const T = B("fm-button");
|
|
1472
|
-
return n(S).length ? (v(), C("div",
|
|
1473
|
-
g("div",
|
|
1474
|
-
g("div",
|
|
1475
|
-
n(H) ? (v(), P(
|
|
1473
|
+
return n(S).length ? (v(), C("div", ea, [
|
|
1474
|
+
g("div", ta, [
|
|
1475
|
+
g("div", la, [
|
|
1476
|
+
n(H) ? (v(), P(Xl, {
|
|
1476
1477
|
key: 0,
|
|
1477
1478
|
ref_key: "productTableRef",
|
|
1478
1479
|
ref: W,
|
|
1479
1480
|
"is-calculating": b.value,
|
|
1480
1481
|
"model-value": k.value,
|
|
1481
1482
|
"original-value": L.value,
|
|
1482
|
-
"onUpdate:modelValue":
|
|
1483
|
-
"onReset:modelValue":
|
|
1484
|
-
"onUpdate:editing":
|
|
1483
|
+
"onUpdate:modelValue": U[0] || (U[0] = ($) => k.value = $),
|
|
1484
|
+
"onReset:modelValue": E,
|
|
1485
|
+
"onUpdate:editing": U[1] || (U[1] = ($) => p.value = $)
|
|
1485
1486
|
}, {
|
|
1486
1487
|
filter: A(() => [
|
|
1487
|
-
m(
|
|
1488
|
-
s.value.multiScheduler ? (v(), P(
|
|
1488
|
+
m(Ee, { onToggleAttributeFilter: te }),
|
|
1489
|
+
s.value.multiScheduler ? (v(), P(Ge, { key: 0 })) : z("", !0)
|
|
1489
1490
|
]),
|
|
1490
1491
|
_: 1
|
|
1491
|
-
}, 8, ["is-calculating", "model-value", "original-value"])) :
|
|
1492
|
+
}, 8, ["is-calculating", "model-value", "original-value"])) : z("", !0)
|
|
1492
1493
|
])
|
|
1493
1494
|
])
|
|
1494
|
-
])) : (v(), C("div",
|
|
1495
|
-
g("div",
|
|
1496
|
-
m(
|
|
1497
|
-
s.value.multiScheduler ? (v(), P(
|
|
1495
|
+
])) : (v(), C("div", aa, [
|
|
1496
|
+
g("div", oa, [
|
|
1497
|
+
m(Ee),
|
|
1498
|
+
s.value.multiScheduler ? (v(), P(Ge, { key: 0 })) : z("", !0)
|
|
1498
1499
|
]),
|
|
1499
1500
|
r.value.create ? (v(), P(pe, {
|
|
1500
1501
|
key: 0,
|
|
@@ -1514,7 +1515,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1514
1515
|
"categorized-items": n(i).linkableItems.value,
|
|
1515
1516
|
"initial-value": n(i).currentItems.value,
|
|
1516
1517
|
"show-variant": !1,
|
|
1517
|
-
onSubmit:
|
|
1518
|
+
onSubmit: U[2] || (U[2] = ($) => n(i).applyProduct($.map((R) => R._id)))
|
|
1518
1519
|
}, {
|
|
1519
1520
|
default: A(({ trigger: $ }) => [
|
|
1520
1521
|
m(T, {
|
|
@@ -1537,7 +1538,7 @@ const We = /* @__PURE__ */ E({
|
|
|
1537
1538
|
"categorized-items": n(u).linkableItems.value,
|
|
1538
1539
|
"initial-value": n(u).currentItems.value,
|
|
1539
1540
|
"show-variant": !1,
|
|
1540
|
-
onSubmit:
|
|
1541
|
+
onSubmit: U[3] || (U[3] = ($) => n(u).applyProduct($.map((R) => R._id)))
|
|
1541
1542
|
}, {
|
|
1542
1543
|
default: A(({ trigger: $ }) => [
|
|
1543
1544
|
m(T, {
|
|
@@ -1556,5 +1557,5 @@ const We = /* @__PURE__ */ E({
|
|
|
1556
1557
|
});
|
|
1557
1558
|
export {
|
|
1558
1559
|
We as _,
|
|
1559
|
-
|
|
1560
|
+
Fa as a
|
|
1560
1561
|
};
|