@feedmepos/mf-menu 0.31.74 → 0.31.75-prod
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-B6Hn5Wwr.js → App-Cw2D3IXT.js} +528 -585
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-CFtcqy58.js +161 -0
- package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-CnCoRLDg.js +74 -0
- package/dist/{Catalog-D-2hDU2I.js → Catalog-B5kAKdVW.js} +9 -9
- package/dist/{Category-hSOIgBkH.js → Category-CAd9BTRX.js} +8 -8
- package/dist/{Category-DjTbuAvE.js → Category-DKjU47aW.js} +5 -5
- package/dist/{CookingGuide-D7ruB7eP.js → CookingGuide-BN739JkB.js} +7 -7
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-mxVSGXAz.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-gii2CTYD.js} +3 -3
- package/dist/{Group-evJZbgZn.js → Group-DmII5Nwf.js} +4 -4
- package/dist/{Group-CjlhbhDV.js → Group-DnpVxZkN.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DiKraPiw.js → Group.vue_vue_type_script_setup_true_lang-BEeCwmKt.js} +163 -163
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BYku8MAc.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DB5B3PLx.js} +90 -90
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DScxctPb.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BEISm7uc.js} +3046 -3046
- package/dist/{Ingredient-jNDx1pUw.js → Ingredient-CpuyDF4n.js} +30 -30
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CuM_k-C3.js → InventoryBinding.vue_vue_type_script_setup_true_lang-GHiwD8VV.js} +1112 -1112
- package/dist/{LinkProductSideSheet-CAPIdf6P.js → LinkProductSideSheet-DrSKOBLg.js} +129 -129
- package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-Bm_hSelC.js +69 -0
- package/dist/{MenuSetting-C2MDgy57.js → MenuSetting-BNuIUnjz.js} +138 -138
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js → PageLayout.vue_vue_type_script_setup_true_lang-vFqWGM6P.js} +8 -8
- package/dist/{PrintRoute-SmWbKr9Y.js → PrintRoute-Dl0oWYju.js} +6 -6
- package/dist/{Product-BCm49V9T.js → Product-IQBP1vvY.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CTOjLqbF.js → Product.vue_vue_type_script_setup_true_lang-Bdss6VRj.js} +607 -607
- package/dist/{ProductInternalTools-DGsvvnIs.js → ProductInternalTools-Dkhbg1WE.js} +11 -11
- package/dist/{Products-D4qeSEfO.js → Products-Dcafs3Lk.js} +59 -59
- package/dist/{Publish-3A3EEQ9x.js → Publish-BTuO4AlR.js} +6 -6
- package/dist/{Recipe-CS7TZGA6.js → Recipe-Dx2ZkHsk.js} +6 -6
- package/dist/{Scheduler-BIwTUJMJ.js → Scheduler-Dh_0J2g9.js} +5 -5
- package/dist/{ServingSequence-C0N8wJfr.js → ServingSequence-DXhx9dcu.js} +5 -5
- package/dist/{Setting-fA6tvQK2.js → Setting-4x_w46t_.js} +5 -5
- package/dist/{Subcategory-BAFAmflQ.js → Subcategory-vztBpQnB.js} +6 -6
- package/dist/{Takeaway-D4aO8zzN.js → Takeaway-CDgIyUrN.js} +5 -5
- package/dist/{Takeaway-CLZouw1j.js → Takeaway-Dz5PxJk_.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-1oN-i9bo.js → Takeaway.vue_vue_type_script_setup_true_lang-BMMXiDFL.js} +6 -6
- package/dist/{TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js → TextChip.vue_vue_type_script_setup_true_lang-BJMcI3U2.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-Dwol_Lkd.js → Thumbnail.vue_vue_type_script_setup_true_lang-DJ8JMV28.js} +74 -74
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-cTzWxjM4.js +5996 -0
- package/dist/{Unit-ByqUb4Po.js → Unit-z7OVmlSq.js} +4 -4
- package/dist/{Variant-BmqrUfen.js → Variant-CFRgvlXf.js} +5 -5
- package/dist/{_id_-RUWzOB0B.js → _id_-B9q3j4_m.js} +11 -11
- package/dist/{app-B1N2F0j8.js → app-CdsS_tMb.js} +1 -1
- package/dist/app-CkCBPor3.js +363 -0
- package/dist/{app-5fxKLAzS.js → app-CzXxFrl1.js} +447 -447
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +0 -1
- package/dist/apps/mf-menu/src/components/feature/CategoryManager/CategoriesSelector.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/feature/MenuSelector.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/feature/SubcategoryManager/SubcategorySelector.vue.d.ts +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-B8qYyYR6.js +13 -0
- package/dist/assets/override-menu-nmSTTTn7.js +13 -0
- package/dist/assets/validate-menu-CF1XZECU.js +13 -0
- package/dist/{catalog-CarmtheV.js → catalog-DBBEUpMo.js} +1 -1
- package/dist/{catalogSetting-BqrTpBP8.js → catalogSetting-DKvBjleU.js} +1 -1
- package/dist/{category-5R83ypNS.js → category-DILExwHL.js} +1 -1
- package/dist/{currency-CUl4r9rT.js → currency-B7Xm1xZJ.js} +1 -1
- package/dist/customAttributes-DrA0YC82.js +180 -0
- package/dist/{index-Ttqt4iFV.js → index-2lrKSO_O.js} +20 -20
- package/dist/{index-DlwLw-BQ.js → index-BoVEGKz7.js} +91 -91
- package/dist/{index-DAWSNP3G.js → index-Bu5LuO1j.js} +4 -4
- package/dist/{index-DUfYYdZ-.js → index-SNNvjtFa.js} +56 -56
- package/dist/{index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js → index.vue_vue_type_script_setup_true_lang-B1_JqsYF.js} +16 -16
- package/dist/{item-B0UPYxsB.js → item-BnOnvN8x.js} +3091 -3174
- package/dist/{iteration-CfmAZiOO.js → iteration-Csz_aSxy.js} +3 -3
- package/dist/{jszip.min-zROpry0S.js → jszip.min-B0T3I-lE.js} +329 -329
- package/dist/{menu-DAac726D.js → menu-3XEn1C9F.js} +6402 -6332
- package/dist/{menu-DpYo8dYR.js → menu-DzbYSPGP.js} +1 -1
- package/dist/{menuV2-DZj_FPqR.js → menuV2-cXg54GYW.js} +93 -93
- package/dist/mf-menu.css +1 -1
- package/dist/packages/shared/src/components/form/SelectFilter.vue.d.ts +1 -1
- package/dist/{priceTier-BvDLl8v2.js → priceTier-DVd27LFd.js} +1 -1
- package/dist/{scheduler-pNUXG6En.js → scheduler-D8IgBrUX.js} +6 -6
- package/dist/{subcategory-DCDCQnAX.js → subcategory-BOpm3s8K.js} +2 -2
- package/dist/{toExcel-DqMa1Hn8.js → toExcel-BJM3fOB2.js} +2 -2
- package/dist/{unit-CuCXoWPG.js → unit-DF9d3piP.js} +151 -151
- package/dist/{vuedraggable-CK8z7qA8.js → vuedraggable-DnBIRDMr.js} +2 -2
- package/package.json +5 -5
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-CqGU3bJQ.js +0 -161
- package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js +0 -74
- package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js +0 -69
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CabQS55D.js +0 -6012
- package/dist/app-CHpw_EM1.js +0 -2101
- package/dist/apps/mf-menu/src/components/feature/RemyButton.vue.d.ts +0 -15
- package/dist/apps/mf-menu/src/components/feature/RemyDialog.vue.d.ts +0 -15
- package/dist/apps/mf-menu/src/helper/remy.d.ts +0 -5
- package/dist/assets/linked-status-CFdi7K3K.js +0 -13
- package/dist/assets/override-menu-CXOY8i3w.js +0 -13
- package/dist/assets/validate-menu-DLlrsx2f.js +0 -13
- package/dist/customAttributes-BkqKM_KW.js +0 -180
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { ref as F, computed as
|
|
2
|
-
import { u as Fe, Q as Ce, A as me, H as Re, I as ge, U as gt,
|
|
1
|
+
import { ref as F, computed as x, defineComponent as B, resolveComponent as O, createBlock as I, openBlock as d, withCtx as T, createElementVNode as b, createVNode as c, unref as t, createElementBlock as k, Fragment as pe, renderList as we, createCommentVNode as U, normalizeClass as ve, toDisplayString as N, withModifiers as fe, mergeModels as Je, useModel as Xe, renderSlot as _e, watch as de, createTextVNode as et, watchEffect as tt, nextTick as Ae, resolveDynamicComponent as lt, onMounted as at, h as q, isRef as je, normalizeStyle as ft } from "vue";
|
|
2
|
+
import { u as Fe, Q as Ce, A as me, H as Re, I as ge, U as gt, ac as bt, ad as _t, ae as Pe, af as yt, P as ht, ag as Ee } from "./menu-3XEn1C9F.js";
|
|
3
3
|
import { useI18n as Ie, useCoreStore as ze, useCustomAttributes as xt } from "@feedmepos/mf-common";
|
|
4
|
-
import { u as Se } from "./menu-
|
|
5
|
-
import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-
|
|
6
|
-
import { L as Ge } from "./LinkProductSideSheet-
|
|
7
|
-
import { r as Ct, _ as Le } from "./index-
|
|
8
|
-
import { _ as Ue, a as qe } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { _ as Me, u as kt } from "./Thumbnail.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { f as wt, o as St, a as Vt, m as Ft } from "./menuV2-
|
|
11
|
-
import { u as ot, C as It } from "./item-
|
|
12
|
-
import { b as We, H as $t } from "./app-
|
|
13
|
-
import { useBreakpoints as
|
|
14
|
-
import { F as Pt } from "./index-
|
|
15
|
-
import { _ as De, a as At } from "./app-
|
|
16
|
-
import { _ as ke } from "./TextChip.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { _ as Rt } from "./index-
|
|
18
|
-
import { r as Ut, _ as Mt } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { u as Se } from "./menu-DzbYSPGP.js";
|
|
5
|
+
import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-B1_JqsYF.js";
|
|
6
|
+
import { L as Ge } from "./LinkProductSideSheet-DrSKOBLg.js";
|
|
7
|
+
import { r as Ct, _ as Le } from "./index-2lrKSO_O.js";
|
|
8
|
+
import { _ as Ue, a as qe } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-gii2CTYD.js";
|
|
9
|
+
import { _ as Me, u as kt } from "./Thumbnail.vue_vue_type_script_setup_true_lang-DJ8JMV28.js";
|
|
10
|
+
import { f as wt, o as St, a as Vt, m as Ft } from "./menuV2-cXg54GYW.js";
|
|
11
|
+
import { u as ot, C as It } from "./item-BnOnvN8x.js";
|
|
12
|
+
import { b as We, H as $t } from "./app-CzXxFrl1.js";
|
|
13
|
+
import { useBreakpoints as nt, components as te, useDialog as Tt, FmButtonColorThemeVariant as W, FmButtonVariant as ee } from "@feedmepos/ui-library";
|
|
14
|
+
import { F as Pt } from "./index-SNNvjtFa.js";
|
|
15
|
+
import { _ as De, a as At } from "./app-CkCBPor3.js";
|
|
16
|
+
import { _ as ke } from "./TextChip.vue_vue_type_script_setup_true_lang-BJMcI3U2.js";
|
|
17
|
+
import { _ as Rt } from "./index-BoVEGKz7.js";
|
|
18
|
+
import { r as Ut, _ as Mt } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-BEISm7uc.js";
|
|
19
19
|
import { c as zt } from "./check-C9mY6LiX.js";
|
|
20
|
-
import { f as Dt } from "./currency-
|
|
20
|
+
import { f as Dt } from "./currency-B7Xm1xZJ.js";
|
|
21
21
|
import { w as Ot } from "./tooltip-CQW9YRO5.js";
|
|
22
|
-
function Kt(
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
22
|
+
function Kt(g, e, m = g) {
|
|
23
|
+
const r = F(!0), l = x(() => {
|
|
24
|
+
if (!r.value && !e.value)
|
|
25
25
|
return !0;
|
|
26
26
|
if (e.value && e.value.length > 0) {
|
|
27
|
-
const f =
|
|
28
|
-
return e.value.length === f.length && e.value.every((
|
|
27
|
+
const f = m.value.map((u) => u.value);
|
|
28
|
+
return e.value.length === f.length && e.value.every((u) => f.includes(u));
|
|
29
29
|
}
|
|
30
30
|
return !1;
|
|
31
|
-
}),
|
|
32
|
-
var f,
|
|
33
|
-
return !!((f = e.value) != null && f.length && ((
|
|
31
|
+
}), s = x(() => {
|
|
32
|
+
var f, u, _, h;
|
|
33
|
+
return !!((f = e.value) != null && f.length && ((u = e.value) == null ? void 0 : u.length) > 0 && ((_ = e.value) == null ? void 0 : _.length) < ((h = g.value) == null ? void 0 : h.length));
|
|
34
34
|
});
|
|
35
|
-
return { allCleared:
|
|
36
|
-
if (
|
|
37
|
-
e.value = void 0,
|
|
35
|
+
return { allCleared: r, allSelected: l, indeterminate: s, toggleAll: () => {
|
|
36
|
+
if (l.value) {
|
|
37
|
+
e.value = void 0, r.value = !0;
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
const f =
|
|
41
|
-
f.length ===
|
|
40
|
+
const f = m.value.map((u) => u.value);
|
|
41
|
+
f.length === g.value.length ? (e.value = void 0, r.value = !1) : (e.value = f, r.value = !1);
|
|
42
42
|
}, toggleOption: (f) => {
|
|
43
|
-
var
|
|
44
|
-
let
|
|
45
|
-
e.value === void 0 &&
|
|
43
|
+
var _, h, w;
|
|
44
|
+
let u;
|
|
45
|
+
e.value === void 0 && r.value ? u = [f] : e.value === void 0 && !r.value ? u = (_ = g.value.map((z) => z.value)) == null ? void 0 : _.filter((z) => z !== f) : (h = e.value) != null && h.includes(f) ? u = (w = e.value) == null ? void 0 : w.filter((z) => z !== f) : u = [...e.value || [], f], u.length === 0 ? (e.value = void 0, r.value = !0) : u.length === g.value.length ? (e.value = void 0, r.value = !1) : e.value = u;
|
|
46
46
|
} };
|
|
47
47
|
}
|
|
48
48
|
const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
@@ -54,49 +54,49 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
54
54
|
}, jt = { class: "p-4" }, Et = { class: "flex-1 overflow-y-auto min-h-0" }, He = /* @__PURE__ */ B({
|
|
55
55
|
__name: "CategorySelector",
|
|
56
56
|
emits: ["toggleAttributeFilter"],
|
|
57
|
-
setup(
|
|
58
|
-
const
|
|
59
|
-
() =>
|
|
60
|
-
), f =
|
|
61
|
-
(K) => K.label.toLowerCase().includes(
|
|
62
|
-
)), { t:
|
|
57
|
+
setup(g, { emit: e }) {
|
|
58
|
+
const m = e, r = Fe(), { categories: l, selectedCategories: s } = Se(), a = x(() => r.state.currentCategoryIds), v = x(
|
|
59
|
+
() => l.value.map((K) => ({ label: K.name, value: K.id }))
|
|
60
|
+
), f = x(() => v.value.filter(
|
|
61
|
+
(K) => K.label.toLowerCase().includes(h.value.toLowerCase())
|
|
62
|
+
)), { t: u } = Ie(), _ = x(() => {
|
|
63
63
|
var K, D, H;
|
|
64
|
-
return
|
|
65
|
-
}),
|
|
66
|
-
get: () =>
|
|
64
|
+
return l.value.length === ((K = s.value) == null ? void 0 : K.length) ? u("menu.category.selector.all") : ((D = s.value) == null ? void 0 : D.length) === 1 ? s.value[0].name : `${(H = s.value) == null ? void 0 : H.length}`;
|
|
65
|
+
}), h = F(""), w = x({
|
|
66
|
+
get: () => a.value,
|
|
67
67
|
set: (K) => {
|
|
68
|
-
|
|
68
|
+
r.selectCategory(K);
|
|
69
69
|
}
|
|
70
70
|
}), { allSelected: z, toggleAll: Y, toggleOption: S, indeterminate: oe } = Kt(
|
|
71
71
|
v,
|
|
72
72
|
w,
|
|
73
73
|
f
|
|
74
|
-
), Z = ze(),
|
|
74
|
+
), Z = ze(), ne = x(() => Z.itemAttributeSettings.value.length > 0);
|
|
75
75
|
function G() {
|
|
76
|
-
|
|
76
|
+
m("toggleAttributeFilter");
|
|
77
77
|
}
|
|
78
78
|
return (K, D) => {
|
|
79
|
-
const H = O("FmIcon"), J = O("FmChip"),
|
|
80
|
-
return
|
|
79
|
+
const H = O("FmIcon"), J = O("FmChip"), re = O("FmSearch"), Q = O("FmMenuItem"), se = O("FmMenu");
|
|
80
|
+
return d(), I(se, {
|
|
81
81
|
"close-on-click": !1,
|
|
82
82
|
width: 220
|
|
83
83
|
}, {
|
|
84
84
|
"menu-button": T(() => [
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
b("div", Nt, [
|
|
86
|
+
c(J, null, {
|
|
87
87
|
default: T(() => [
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
_.value ? (d(), k("div", Bt, N(t(u)("menu.category.selector.title", { label: _.value })), 1)) : U("", !0),
|
|
89
|
+
c(H, {
|
|
90
90
|
color: "neutral-gray-400",
|
|
91
91
|
name: "expand_more",
|
|
92
92
|
size: "sm"
|
|
93
93
|
}),
|
|
94
|
-
|
|
94
|
+
ne.value ? (d(), k("div", {
|
|
95
95
|
key: 1,
|
|
96
96
|
class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
|
|
97
97
|
onClick: fe(G, ["stop"])
|
|
98
98
|
}, [
|
|
99
|
-
|
|
99
|
+
c(H, {
|
|
100
100
|
name: "filter_alt",
|
|
101
101
|
outline: "",
|
|
102
102
|
color: "neutral-gray-400",
|
|
@@ -111,30 +111,30 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
111
111
|
])
|
|
112
112
|
]),
|
|
113
113
|
default: T(() => [
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
b("div", jt, [
|
|
115
|
+
c(re, {
|
|
116
116
|
autofocus: "",
|
|
117
|
-
modelValue:
|
|
118
|
-
"onUpdate:modelValue": D[1] || (D[1] = (R) =>
|
|
119
|
-
placeholder:
|
|
117
|
+
modelValue: h.value,
|
|
118
|
+
"onUpdate:modelValue": D[1] || (D[1] = (R) => h.value = R),
|
|
119
|
+
placeholder: t(u)("menu.common.actions.search")
|
|
120
120
|
}, null, 8, ["modelValue", "placeholder"])
|
|
121
121
|
]),
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
b("div", Et, [
|
|
123
|
+
c(Q, {
|
|
124
124
|
label: "All",
|
|
125
125
|
"has-checkbox": "",
|
|
126
|
-
"model-value":
|
|
127
|
-
indeterminate:
|
|
128
|
-
onClick:
|
|
126
|
+
"model-value": t(z),
|
|
127
|
+
indeterminate: t(oe),
|
|
128
|
+
onClick: t(Y)
|
|
129
129
|
}, null, 8, ["model-value", "indeterminate", "onClick"]),
|
|
130
|
-
(
|
|
130
|
+
(d(!0), k(pe, null, we(f.value, (R) => {
|
|
131
131
|
var $;
|
|
132
|
-
return
|
|
132
|
+
return d(), I(Q, {
|
|
133
133
|
key: R.value || "",
|
|
134
134
|
label: R.label,
|
|
135
135
|
"has-checkbox": "",
|
|
136
|
-
"model-value":
|
|
137
|
-
onClick: (P) =>
|
|
136
|
+
"model-value": t(z) || (($ = w.value) == null ? void 0 : $.includes(R.value)),
|
|
137
|
+
onClick: (P) => t(S)(R.value)
|
|
138
138
|
}, null, 8, ["label", "model-value", "onClick"]);
|
|
139
139
|
}), 128))
|
|
140
140
|
])
|
|
@@ -155,30 +155,30 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
155
155
|
categories: { default: () => [] },
|
|
156
156
|
ellipsis: { type: Boolean, default: !0 }
|
|
157
157
|
},
|
|
158
|
-
setup(
|
|
159
|
-
const e =
|
|
158
|
+
setup(g) {
|
|
159
|
+
const e = g, { t: m } = Ie(), r = nt(), l = x(() => r.breakpoints.value.xs), s = x(() => e.ellipsis ? l.value ? 1 : 2 : 1 / 0), a = x(() => e.categories.length <= s.value ? e.categories : e.categories.slice(0, s.value)), v = F(!0), f = x(() => {
|
|
160
160
|
if (v.value) {
|
|
161
|
-
const
|
|
162
|
-
return
|
|
161
|
+
const _ = a.value.join(", ");
|
|
162
|
+
return _.length > 20 ? _.slice(0, 20) + "..." : _;
|
|
163
163
|
}
|
|
164
164
|
return e.categories.join(", ");
|
|
165
165
|
});
|
|
166
|
-
return (
|
|
167
|
-
const
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
v.value ? (
|
|
173
|
-
|
|
166
|
+
return (u, _) => {
|
|
167
|
+
const h = O("FmTooltip");
|
|
168
|
+
return l.value ? (d(), k(pe, { key: 1 }, [
|
|
169
|
+
g.categories.length > 0 ? (d(), k("p", Ht, [
|
|
170
|
+
b("span", null, N(t(m)("menu.product.table.columns.category")) + ": ", 1),
|
|
171
|
+
b("span", null, N(f.value), 1),
|
|
172
|
+
v.value ? (d(), k("span", Yt)) : (d(), k("br", Qt)),
|
|
173
|
+
g.categories.length > s.value ? (d(), k("span", {
|
|
174
174
|
key: 2,
|
|
175
175
|
class: "fm-typo-en-body-md-400 text-fm-color-primary cursor-pointer",
|
|
176
|
-
onClick:
|
|
176
|
+
onClick: _[0] || (_[0] = fe((w) => v.value = !v.value, ["stop", "prevent"]))
|
|
177
177
|
}, [
|
|
178
|
-
v.value ? (
|
|
178
|
+
v.value ? (d(), k("span", Zt, N(t(m)("menu.product.table.category.expand", { count: g.categories.length - s.value })), 1)) : (d(), k("span", Jt, N(t(m)("menu.product.table.category.collapse")), 1))
|
|
179
179
|
])) : U("", !0)
|
|
180
180
|
])) : U("", !0)
|
|
181
|
-
], 64)) : (
|
|
181
|
+
], 64)) : (d(), I(h, {
|
|
182
182
|
key: 0,
|
|
183
183
|
class: "flex",
|
|
184
184
|
variant: "rich",
|
|
@@ -186,10 +186,10 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
186
186
|
"z-index": 50
|
|
187
187
|
}, {
|
|
188
188
|
content: T(() => [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
(
|
|
189
|
+
b("div", Lt, [
|
|
190
|
+
b("p", qt, N(t(m)("menu.product.table.category.all")), 1),
|
|
191
|
+
b("div", Wt, [
|
|
192
|
+
(d(!0), k(pe, null, we(e.categories, (w) => (d(), I(ke, {
|
|
193
193
|
key: w,
|
|
194
194
|
label: w,
|
|
195
195
|
variant: "neutral"
|
|
@@ -198,13 +198,13 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
198
198
|
])
|
|
199
199
|
]),
|
|
200
200
|
default: T(() => [
|
|
201
|
-
|
|
202
|
-
(
|
|
201
|
+
b("div", Gt, [
|
|
202
|
+
(d(!0), k(pe, null, we(a.value, (w) => (d(), I(ke, {
|
|
203
203
|
key: w,
|
|
204
204
|
label: w,
|
|
205
205
|
variant: "neutral"
|
|
206
206
|
}, null, 8, ["label"]))), 128)),
|
|
207
|
-
|
|
207
|
+
g.categories.length > s.value ? (d(), I(ke, {
|
|
208
208
|
key: 0,
|
|
209
209
|
label: "...",
|
|
210
210
|
variant: "neutral"
|
|
@@ -226,29 +226,29 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
226
226
|
modelModifiers: {}
|
|
227
227
|
}),
|
|
228
228
|
emits: ["update:modelValue"],
|
|
229
|
-
setup(
|
|
230
|
-
const e =
|
|
231
|
-
label:
|
|
232
|
-
value:
|
|
229
|
+
setup(g) {
|
|
230
|
+
const e = g, m = Xe(g, "modelValue"), r = x(() => e.menu.modules.item.map((l) => ({
|
|
231
|
+
label: l.code ? `${l.code} ${l.name}` : l.name,
|
|
232
|
+
value: l._id
|
|
233
233
|
})));
|
|
234
|
-
return (
|
|
235
|
-
const
|
|
236
|
-
return
|
|
237
|
-
modelValue:
|
|
238
|
-
"onUpdate:modelValue":
|
|
239
|
-
items:
|
|
234
|
+
return (l, s) => {
|
|
235
|
+
const a = O("FmSelect");
|
|
236
|
+
return d(), I(a, {
|
|
237
|
+
modelValue: m.value,
|
|
238
|
+
"onUpdate:modelValue": s[0] || (s[0] = (v) => m.value = v),
|
|
239
|
+
items: r.value,
|
|
240
240
|
searchable: !0,
|
|
241
241
|
"search-target": "label",
|
|
242
242
|
placeholder: "Search by product name or code",
|
|
243
|
-
label:
|
|
244
|
-
"helper-text":
|
|
243
|
+
label: g.label,
|
|
244
|
+
"helper-text": g.helperText
|
|
245
245
|
}, null, 8, ["modelValue", "items", "label", "helper-text"]);
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
}), 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 = {
|
|
249
249
|
key: 0,
|
|
250
250
|
class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4"
|
|
251
|
-
},
|
|
251
|
+
}, nl = { class: "fm-typo-en-body-md-600" }, rl = { class: "flex-1" }, rt = /* @__PURE__ */ B({
|
|
252
252
|
__name: "ViewLayout",
|
|
253
253
|
props: /* @__PURE__ */ Je({
|
|
254
254
|
title: {},
|
|
@@ -259,32 +259,32 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
259
259
|
modelModifiers: {}
|
|
260
260
|
}),
|
|
261
261
|
emits: ["update:modelValue"],
|
|
262
|
-
setup(
|
|
263
|
-
const e = Xe(
|
|
264
|
-
return (
|
|
265
|
-
const
|
|
266
|
-
return
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
262
|
+
setup(g) {
|
|
263
|
+
const e = Xe(g, "modelValue");
|
|
264
|
+
return (m, r) => {
|
|
265
|
+
const l = O("FmCollapsibleTabs");
|
|
266
|
+
return d(), k("div", el, [
|
|
267
|
+
b("div", tl, [
|
|
268
|
+
b("div", ll, [
|
|
269
|
+
b("p", al, N(g.title), 1),
|
|
270
|
+
g.titleBadge !== void 0 ? (d(), k("div", ol, [
|
|
271
|
+
b("p", nl, N(g.titleBadge), 1)
|
|
272
272
|
])) : U("", !0)
|
|
273
273
|
]),
|
|
274
|
-
|
|
274
|
+
c(De, null, {
|
|
275
275
|
default: T(() => [
|
|
276
|
-
|
|
276
|
+
c(l, {
|
|
277
277
|
modelValue: e.value,
|
|
278
|
-
"onUpdate:modelValue":
|
|
279
|
-
items:
|
|
278
|
+
"onUpdate:modelValue": r[0] || (r[0] = (s) => e.value = s),
|
|
279
|
+
items: g.items
|
|
280
280
|
}, null, 8, ["modelValue", "items"])
|
|
281
281
|
]),
|
|
282
282
|
_: 1
|
|
283
283
|
})
|
|
284
284
|
]),
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
_e(
|
|
285
|
+
r[1] || (r[1] = b("div", { class: "w-[1px] min-h-full ml-4 mr-12 bg-fm-color-neutral-gray-100 self-stretch" }, null, -1)),
|
|
286
|
+
b("div", rl, [
|
|
287
|
+
_e(m.$slots, "default")
|
|
288
288
|
])
|
|
289
289
|
]);
|
|
290
290
|
};
|
|
@@ -294,13 +294,13 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
294
294
|
props: {
|
|
295
295
|
orderFrom: {}
|
|
296
296
|
},
|
|
297
|
-
setup(
|
|
298
|
-
const e =
|
|
299
|
-
return (
|
|
300
|
-
var
|
|
301
|
-
return
|
|
302
|
-
label: ((
|
|
303
|
-
variant: (
|
|
297
|
+
setup(g) {
|
|
298
|
+
const e = g, m = Ce();
|
|
299
|
+
return (r, l) => {
|
|
300
|
+
var s, a;
|
|
301
|
+
return d(), I(ke, {
|
|
302
|
+
label: ((s = t(m)[e.orderFrom]) == null ? void 0 : s.label) || e.orderFrom,
|
|
303
|
+
variant: (a = t(m)[e.orderFrom]) == null ? void 0 : a.variant
|
|
304
304
|
}, null, 8, ["label", "variant"]);
|
|
305
305
|
};
|
|
306
306
|
}
|
|
@@ -309,79 +309,79 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
309
309
|
props: {
|
|
310
310
|
data: {}
|
|
311
311
|
},
|
|
312
|
-
setup(
|
|
313
|
-
const e =
|
|
312
|
+
setup(g) {
|
|
313
|
+
const e = g, m = [{
|
|
314
314
|
accessorKey: "code",
|
|
315
315
|
header: () => "Code",
|
|
316
316
|
enableSorting: !1,
|
|
317
317
|
cell: ({
|
|
318
|
-
row:
|
|
318
|
+
row: a
|
|
319
319
|
}) => {
|
|
320
|
-
const v =
|
|
321
|
-
return v.subRows ?
|
|
320
|
+
const v = a.original;
|
|
321
|
+
return v.subRows ? c("div", {
|
|
322
322
|
class: "flex items-center gap-2 fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
323
|
-
}, [
|
|
323
|
+
}, [c(te.FmButton, {
|
|
324
324
|
icon: "keyboard_arrow_up",
|
|
325
325
|
variant: "tertiary",
|
|
326
|
-
class: ["cursor-pointer", "transition-transform",
|
|
327
|
-
onClick:
|
|
326
|
+
class: ["cursor-pointer", "transition-transform", a.getIsExpanded() ? "transform rotate-180" : ""],
|
|
327
|
+
onClick: a.getToggleExpandedHandler()
|
|
328
328
|
}, null), et("Found in group: "), v.groupName]) : v.code;
|
|
329
329
|
},
|
|
330
330
|
meta: {
|
|
331
|
-
colspan: (
|
|
331
|
+
colspan: (a) => a.original.subRows ? 5 : 1
|
|
332
332
|
}
|
|
333
333
|
}, {
|
|
334
334
|
accessorKey: "productName",
|
|
335
335
|
header: () => "Product name",
|
|
336
336
|
enableSorting: !1,
|
|
337
337
|
meta: {
|
|
338
|
-
colspan: (
|
|
338
|
+
colspan: (a) => a.original.subRows ? 0 : 1
|
|
339
339
|
}
|
|
340
340
|
}, {
|
|
341
341
|
accessorKey: "variant",
|
|
342
342
|
header: () => "Variant",
|
|
343
343
|
enableSorting: !1,
|
|
344
344
|
meta: {
|
|
345
|
-
colspan: (
|
|
345
|
+
colspan: (a) => a.original.subRows ? 0 : 1
|
|
346
346
|
}
|
|
347
347
|
}, {
|
|
348
348
|
accessorKey: "price",
|
|
349
349
|
header: () => "Price",
|
|
350
350
|
enableSorting: !1,
|
|
351
351
|
meta: {
|
|
352
|
-
colspan: (
|
|
352
|
+
colspan: (a) => a.original.subRows ? 0 : 1
|
|
353
353
|
}
|
|
354
354
|
}, {
|
|
355
355
|
accessorKey: "orderFrom",
|
|
356
356
|
header: () => "Order from",
|
|
357
357
|
enableSorting: !1,
|
|
358
|
-
cell: (
|
|
359
|
-
const v =
|
|
360
|
-
return
|
|
358
|
+
cell: (a) => {
|
|
359
|
+
const v = a.row.original;
|
|
360
|
+
return c(Ve, {
|
|
361
361
|
orderFrom: v.orderFrom ?? ""
|
|
362
362
|
}, null);
|
|
363
363
|
},
|
|
364
364
|
meta: {
|
|
365
|
-
colspan: (
|
|
365
|
+
colspan: (a) => a.original.subRows ? 0 : 1
|
|
366
366
|
}
|
|
367
|
-
}],
|
|
368
|
-
function
|
|
369
|
-
|
|
367
|
+
}], r = F({}), l = (a) => a.subRows;
|
|
368
|
+
function s() {
|
|
369
|
+
r.value = Object.fromEntries(e.data.map((a, v) => [v, !0]));
|
|
370
370
|
}
|
|
371
371
|
return de(() => e.data, () => {
|
|
372
|
-
|
|
373
|
-
}), (
|
|
372
|
+
s();
|
|
373
|
+
}), (a, v) => {
|
|
374
374
|
const f = O("FmTable");
|
|
375
|
-
return
|
|
376
|
-
default: T(() => [
|
|
377
|
-
"column-defs":
|
|
378
|
-
"row-data":
|
|
375
|
+
return d(), I(De, null, {
|
|
376
|
+
default: T(() => [c(f, {
|
|
377
|
+
"column-defs": m,
|
|
378
|
+
"row-data": g.data,
|
|
379
379
|
"hide-footer": !0,
|
|
380
380
|
"page-size": 1e6,
|
|
381
|
-
"get-sub-row":
|
|
382
|
-
"expanded-state":
|
|
381
|
+
"get-sub-row": l,
|
|
382
|
+
"expanded-state": r.value,
|
|
383
383
|
"shrink-at": !1,
|
|
384
|
-
"onUpdate:expandedState": v[0] || (v[0] = (
|
|
384
|
+
"onUpdate:expandedState": v[0] || (v[0] = (u) => r.value = u)
|
|
385
385
|
}, null, 8, ["row-data", "expanded-state"])]),
|
|
386
386
|
_: 1
|
|
387
387
|
});
|
|
@@ -393,12 +393,12 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
393
393
|
itemId: {},
|
|
394
394
|
menu: {}
|
|
395
395
|
},
|
|
396
|
-
setup(
|
|
397
|
-
const e =
|
|
398
|
-
const
|
|
399
|
-
return ((
|
|
400
|
-
groupName:
|
|
401
|
-
subRows:
|
|
396
|
+
setup(g) {
|
|
397
|
+
const e = g, m = F(""), r = x(() => l.value.reduce((u, _) => u + (typeof _.badge == "number" ? _.badge ?? 1 : 0), 0)), l = F([]), s = x(() => {
|
|
398
|
+
const u = l.value.find((h) => h.value === m.value);
|
|
399
|
+
return ((u == null ? void 0 : u.itemInGroup) || []).map((h) => ({
|
|
400
|
+
groupName: h.group.name,
|
|
401
|
+
subRows: h.items.map((w) => ({
|
|
402
402
|
// @ts-ignore
|
|
403
403
|
code: w.code || w.fallbackCode,
|
|
404
404
|
productName: w.combinationKey ? "" : w.name ?? "",
|
|
@@ -408,7 +408,7 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
408
408
|
}))
|
|
409
409
|
}));
|
|
410
410
|
});
|
|
411
|
-
function
|
|
411
|
+
function a() {
|
|
412
412
|
return [{
|
|
413
413
|
label: "Master product",
|
|
414
414
|
value: "",
|
|
@@ -417,45 +417,45 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
417
417
|
disabled: !1,
|
|
418
418
|
badge: void 0,
|
|
419
419
|
itemInGroup: []
|
|
420
|
-
}, ...e.menu.modules.catalog.map((
|
|
421
|
-
label:
|
|
422
|
-
value:
|
|
423
|
-
catalogId:
|
|
420
|
+
}, ...e.menu.modules.catalog.map((_) => ({
|
|
421
|
+
label: _.name,
|
|
422
|
+
value: _._id,
|
|
423
|
+
catalogId: _._id,
|
|
424
424
|
data: [],
|
|
425
425
|
disabled: !1,
|
|
426
426
|
badge: void 0,
|
|
427
427
|
itemInGroup: []
|
|
428
428
|
}))];
|
|
429
429
|
}
|
|
430
|
-
|
|
431
|
-
async function v(
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
434
|
-
|
|
430
|
+
x(() => l.value.find((u) => u.value === m.value));
|
|
431
|
+
async function v(u) {
|
|
432
|
+
const _ = l.value.find((h) => h.catalogId === u);
|
|
433
|
+
if (_) {
|
|
434
|
+
_.badge = () => c(te.FmCircularProgress, {
|
|
435
435
|
size: "md"
|
|
436
436
|
}, null);
|
|
437
|
-
const
|
|
438
|
-
|
|
437
|
+
const h = await wt(Re(e.menu), u, e.itemId);
|
|
438
|
+
_.badge = h.length, _.disabled = h.length <= 0, _.itemInGroup = h;
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
function f() {
|
|
442
|
-
|
|
443
|
-
v(
|
|
442
|
+
l.value = a(), l.value.forEach((u) => {
|
|
443
|
+
v(u.catalogId);
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
return de([() => e.menu, () => e.itemId], () => {
|
|
447
447
|
e.menu && e.itemId && f();
|
|
448
448
|
}, {
|
|
449
449
|
immediate: !0
|
|
450
|
-
}), (
|
|
451
|
-
modelValue:
|
|
452
|
-
"onUpdate:modelValue":
|
|
453
|
-
items:
|
|
450
|
+
}), (u, _) => (d(), I(rt, {
|
|
451
|
+
modelValue: m.value,
|
|
452
|
+
"onUpdate:modelValue": _[0] || (_[0] = (h) => m.value = h),
|
|
453
|
+
items: l.value,
|
|
454
454
|
title: "Catalog",
|
|
455
|
-
"title-badge":
|
|
455
|
+
"title-badge": r.value
|
|
456
456
|
}, {
|
|
457
|
-
default: T(() => [
|
|
458
|
-
data:
|
|
457
|
+
default: T(() => [c(sl, {
|
|
458
|
+
data: s.value
|
|
459
459
|
}, null, 8, ["data"])]),
|
|
460
460
|
_: 1
|
|
461
461
|
}, 8, ["modelValue", "items", "title-badge"]));
|
|
@@ -470,18 +470,18 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
470
470
|
catalogId: {},
|
|
471
471
|
schedulerIds: {}
|
|
472
472
|
},
|
|
473
|
-
setup(
|
|
474
|
-
const e =
|
|
473
|
+
setup(g) {
|
|
474
|
+
const e = g, m = [{
|
|
475
475
|
accessorKey: "scheduler",
|
|
476
476
|
header: () => "Scheduler",
|
|
477
477
|
enableSorting: !1,
|
|
478
|
-
cell: (
|
|
479
|
-
const
|
|
478
|
+
cell: (s) => {
|
|
479
|
+
const a = s.row.original, v = a.loading ? c(te.FmCircularProgress, {
|
|
480
480
|
size: "md"
|
|
481
481
|
}, null) : null;
|
|
482
|
-
return
|
|
482
|
+
return c("div", {
|
|
483
483
|
class: "flex items-center gap-2"
|
|
484
|
-
}, [
|
|
484
|
+
}, [a.scheduler, v]);
|
|
485
485
|
}
|
|
486
486
|
}, {
|
|
487
487
|
accessorKey: "code",
|
|
@@ -498,19 +498,19 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
498
498
|
}, {
|
|
499
499
|
accessorKey: "orderFrom",
|
|
500
500
|
header: () => "Order from",
|
|
501
|
-
cell: (
|
|
502
|
-
const
|
|
503
|
-
return
|
|
504
|
-
orderFrom:
|
|
501
|
+
cell: (s) => {
|
|
502
|
+
const a = s.row.original;
|
|
503
|
+
return c(Ve, {
|
|
504
|
+
orderFrom: a.orderFrom
|
|
505
505
|
}, null);
|
|
506
506
|
},
|
|
507
507
|
enableSorting: !1
|
|
508
|
-
}],
|
|
509
|
-
function
|
|
508
|
+
}], r = F([]);
|
|
509
|
+
function l(s, a) {
|
|
510
510
|
return {
|
|
511
511
|
loading: !0,
|
|
512
|
-
schedulerId:
|
|
513
|
-
scheduler:
|
|
512
|
+
schedulerId: s,
|
|
513
|
+
scheduler: a,
|
|
514
514
|
code: "--",
|
|
515
515
|
productName: "--",
|
|
516
516
|
price: "--",
|
|
@@ -518,25 +518,25 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
518
518
|
};
|
|
519
519
|
}
|
|
520
520
|
return de([() => e.menu, () => e.catalogId, () => e.schedulerIds], async () => {
|
|
521
|
-
|
|
522
|
-
var
|
|
523
|
-
return
|
|
524
|
-
})],
|
|
525
|
-
const v = (await St(Re(e.menu), e.catalogId,
|
|
521
|
+
r.value = [l(null, "All day"), ...e.schedulerIds.map((s) => {
|
|
522
|
+
var a;
|
|
523
|
+
return l(s, ((a = e.menu.modules.scheduler.find((v) => v._id === s)) == null ? void 0 : a.name) || "Unknown");
|
|
524
|
+
})], r.value.forEach(async (s) => {
|
|
525
|
+
const v = (await St(Re(e.menu), e.catalogId, s.schedulerId)).modules.item.find((u) => u._id === e.itemId), f = r.value.findIndex((u) => u.schedulerId === s.schedulerId);
|
|
526
526
|
if (v) {
|
|
527
|
-
const
|
|
528
|
-
|
|
527
|
+
const u = Re(r.value);
|
|
528
|
+
u[f].loading = !1, u[f].code = v.code || "--", u[f].productName = v.name || "--", u[f].price = me.Dinero.fromFdoDinero(v.price).toFormat(), u[f].orderFrom = v.orderFrom || "--", r.value = u;
|
|
529
529
|
}
|
|
530
530
|
});
|
|
531
|
-
}), (
|
|
531
|
+
}), (s, a) => {
|
|
532
532
|
const v = O("FmTable");
|
|
533
|
-
return
|
|
534
|
-
default: T(() => [
|
|
533
|
+
return d(), I(De, null, {
|
|
534
|
+
default: T(() => [b("div", il, [c(v, {
|
|
535
535
|
class: "min-w-[800px]",
|
|
536
|
-
"column-defs":
|
|
537
|
-
"row-data":
|
|
536
|
+
"column-defs": m,
|
|
537
|
+
"row-data": r.value,
|
|
538
538
|
"hide-footer": !0,
|
|
539
|
-
"page-size":
|
|
539
|
+
"page-size": r.value.length,
|
|
540
540
|
"shrink-at": !1
|
|
541
541
|
}, null, 8, ["row-data", "page-size"])])]),
|
|
542
542
|
_: 1
|
|
@@ -549,50 +549,50 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
549
549
|
itemId: {},
|
|
550
550
|
menu: {}
|
|
551
551
|
},
|
|
552
|
-
setup(
|
|
553
|
-
const e =
|
|
552
|
+
setup(g) {
|
|
553
|
+
const e = g, m = F(null);
|
|
554
554
|
tt(async () => {
|
|
555
|
-
|
|
555
|
+
m.value = await Vt(e.menu, e.itemId), await Ae(), r.value = l.value[0].value;
|
|
556
556
|
});
|
|
557
|
-
const
|
|
558
|
-
var f,
|
|
559
|
-
const
|
|
557
|
+
const r = F(""), l = x(() => {
|
|
558
|
+
var f, u;
|
|
559
|
+
const a = {
|
|
560
560
|
label: "Master product",
|
|
561
561
|
value: "",
|
|
562
562
|
catalogId: null,
|
|
563
|
-
badge: (((f =
|
|
564
|
-
schedulerIds: (
|
|
563
|
+
badge: (((f = m.value) == null ? void 0 : f.schedulers.length) || 0) + 1,
|
|
564
|
+
schedulerIds: (u = m.value) == null ? void 0 : u.schedulers
|
|
565
565
|
};
|
|
566
|
-
if (!
|
|
567
|
-
return [
|
|
568
|
-
const v = e.menu.modules.catalog.map((
|
|
569
|
-
const
|
|
566
|
+
if (!m.value)
|
|
567
|
+
return [a];
|
|
568
|
+
const v = e.menu.modules.catalog.map((_) => {
|
|
569
|
+
const h = m.value.catalogs[_._id];
|
|
570
570
|
return {
|
|
571
|
-
label:
|
|
572
|
-
value:
|
|
573
|
-
disabled: !
|
|
574
|
-
catalogId:
|
|
575
|
-
badge:
|
|
576
|
-
schedulerIds:
|
|
571
|
+
label: _.name,
|
|
572
|
+
value: _._id,
|
|
573
|
+
disabled: !h,
|
|
574
|
+
catalogId: _._id,
|
|
575
|
+
badge: h ? ((h == null ? void 0 : h.schedulers.length) || 0) + 1 : 0,
|
|
576
|
+
schedulerIds: h == null ? void 0 : h.schedulers
|
|
577
577
|
};
|
|
578
578
|
});
|
|
579
|
-
return [
|
|
580
|
-
}),
|
|
581
|
-
return (
|
|
582
|
-
modelValue:
|
|
583
|
-
"onUpdate:modelValue": v[0] || (v[0] = (f) =>
|
|
584
|
-
items:
|
|
579
|
+
return [a, ...v];
|
|
580
|
+
}), s = x(() => l.value.find((a) => a.value === r.value));
|
|
581
|
+
return (a, v) => (d(), I(rt, {
|
|
582
|
+
modelValue: r.value,
|
|
583
|
+
"onUpdate:modelValue": v[0] || (v[0] = (f) => r.value = f),
|
|
584
|
+
items: l.value,
|
|
585
585
|
title: "Catalog",
|
|
586
|
-
"title-badge":
|
|
586
|
+
"title-badge": l.value.filter((f) => !f.disabled).length
|
|
587
587
|
}, {
|
|
588
588
|
default: T(() => {
|
|
589
|
-
var f,
|
|
589
|
+
var f, u;
|
|
590
590
|
return [
|
|
591
|
-
|
|
592
|
-
menu:
|
|
593
|
-
"item-id":
|
|
594
|
-
"catalog-id": ((f =
|
|
595
|
-
"scheduler-ids": ((
|
|
591
|
+
c(cl, {
|
|
592
|
+
menu: g.menu,
|
|
593
|
+
"item-id": g.itemId,
|
|
594
|
+
"catalog-id": ((f = s.value) == null ? void 0 : f.catalogId) || null,
|
|
595
|
+
"scheduler-ids": ((u = s.value) == null ? void 0 : u.schedulerIds) || []
|
|
596
596
|
}, null, 8, ["menu", "item-id", "catalog-id", "scheduler-ids"])
|
|
597
597
|
];
|
|
598
598
|
}),
|
|
@@ -608,32 +608,32 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
608
608
|
itemId: {},
|
|
609
609
|
menu: {}
|
|
610
610
|
},
|
|
611
|
-
setup(
|
|
612
|
-
const e =
|
|
613
|
-
var
|
|
614
|
-
return me.Dinero.fromFdoDinero((
|
|
611
|
+
setup(g) {
|
|
612
|
+
const e = g, m = x(() => e.menu.modules.item.find((l) => l._id === e.itemId)), r = x(() => {
|
|
613
|
+
var l;
|
|
614
|
+
return me.Dinero.fromFdoDinero((l = m.value) == null ? void 0 : l.price).toFormat(!0);
|
|
615
615
|
});
|
|
616
|
-
return (
|
|
617
|
-
var
|
|
618
|
-
return
|
|
619
|
-
|
|
620
|
-
alt: ((
|
|
616
|
+
return (l, s) => {
|
|
617
|
+
var a, v, f, u, _, h, w;
|
|
618
|
+
return d(), k("div", ml, [
|
|
619
|
+
c(Me, {
|
|
620
|
+
alt: ((a = m.value) == null ? void 0 : a.name) ?? null,
|
|
621
621
|
size: 72,
|
|
622
|
-
src: (v =
|
|
622
|
+
src: (v = m.value) == null ? void 0 : v.thumbnail,
|
|
623
623
|
crossorigin: !1
|
|
624
624
|
}, null, 8, ["alt", "src"]),
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
(f =
|
|
628
|
-
|
|
625
|
+
b("div", pl, [
|
|
626
|
+
b("p", vl, [
|
|
627
|
+
(f = m.value) != null && f.code ? (d(), k("span", fl, N((u = m.value) == null ? void 0 : u.code) + ", ", 1)) : U("", !0),
|
|
628
|
+
b("span", null, N((_ = m.value) == null ? void 0 : _.name), 1)
|
|
629
629
|
]),
|
|
630
|
-
|
|
631
|
-
(
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
630
|
+
b("p", gl, "Base price: " + N(r.value), 1),
|
|
631
|
+
(h = m.value) != null && h.customAttributes ? (d(), k("div", bl, [
|
|
632
|
+
b("div", _l, [
|
|
633
|
+
s[0] || (s[0] = b("span", null, "Tagging:", -1)),
|
|
634
|
+
c(Ue, {
|
|
635
635
|
ellipsis: !1,
|
|
636
|
-
"custom-attributes": (w =
|
|
636
|
+
"custom-attributes": (w = m.value) == null ? void 0 : w.customAttributes
|
|
637
637
|
}, null, 8, ["custom-attributes"])
|
|
638
638
|
])
|
|
639
639
|
])) : U("", !0)
|
|
@@ -647,8 +647,8 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
647
647
|
itemId: {},
|
|
648
648
|
menu: {}
|
|
649
649
|
},
|
|
650
|
-
setup(
|
|
651
|
-
const e = F("product"),
|
|
650
|
+
setup(g) {
|
|
651
|
+
const e = F("product"), m = x(() => [
|
|
652
652
|
{
|
|
653
653
|
value: "product",
|
|
654
654
|
label: "Product",
|
|
@@ -660,25 +660,25 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
660
660
|
component: ul
|
|
661
661
|
}
|
|
662
662
|
]);
|
|
663
|
-
return (
|
|
664
|
-
var
|
|
665
|
-
const
|
|
666
|
-
return
|
|
667
|
-
|
|
668
|
-
"item-id":
|
|
669
|
-
menu:
|
|
663
|
+
return (r, l) => {
|
|
664
|
+
var a;
|
|
665
|
+
const s = O("FmTabs");
|
|
666
|
+
return d(), k("div", hl, [
|
|
667
|
+
c(yl, {
|
|
668
|
+
"item-id": g.itemId,
|
|
669
|
+
menu: g.menu
|
|
670
670
|
}, null, 8, ["item-id", "menu"]),
|
|
671
|
-
|
|
672
|
-
|
|
671
|
+
b("div", null, [
|
|
672
|
+
c(s, {
|
|
673
673
|
modelValue: e.value,
|
|
674
|
-
"onUpdate:modelValue":
|
|
675
|
-
items:
|
|
674
|
+
"onUpdate:modelValue": l[0] || (l[0] = (v) => e.value = v),
|
|
675
|
+
items: m.value
|
|
676
676
|
}, null, 8, ["modelValue", "items"])
|
|
677
677
|
]),
|
|
678
|
-
|
|
679
|
-
(
|
|
680
|
-
"item-id":
|
|
681
|
-
menu:
|
|
678
|
+
b("div", null, [
|
|
679
|
+
(d(), I(lt((a = m.value.find((v) => v.value === e.value)) == null ? void 0 : a.component), {
|
|
680
|
+
"item-id": g.itemId,
|
|
681
|
+
menu: g.menu
|
|
682
682
|
}, null, 8, ["item-id", "menu"]))
|
|
683
683
|
])
|
|
684
684
|
]);
|
|
@@ -690,54 +690,54 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
690
690
|
itemId: {},
|
|
691
691
|
showSearch: { type: Boolean, default: !1 }
|
|
692
692
|
},
|
|
693
|
-
setup(
|
|
694
|
-
const e =
|
|
693
|
+
setup(g) {
|
|
694
|
+
const e = g, m = Fe(), r = F(null);
|
|
695
695
|
return at(() => {
|
|
696
|
-
|
|
697
|
-
}), (
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
modelValue:
|
|
701
|
-
"onUpdate:modelValue":
|
|
696
|
+
r.value = e.itemId;
|
|
697
|
+
}), (l, s) => (d(), k("div", Cl, [
|
|
698
|
+
g.showSearch ? (d(), k("div", kl, [
|
|
699
|
+
c(Xt, {
|
|
700
|
+
modelValue: r.value,
|
|
701
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => r.value = a),
|
|
702
702
|
class: "w-1/2",
|
|
703
703
|
label: "Search and compare prices",
|
|
704
704
|
"helper-text": "Quickly find products and view their prices across different catalogs and schedules.",
|
|
705
|
-
menu:
|
|
705
|
+
menu: t(m).state.menu
|
|
706
706
|
}, null, 8, ["modelValue", "menu"])
|
|
707
707
|
])) : U("", !0),
|
|
708
|
-
|
|
709
|
-
|
|
708
|
+
b("div", null, [
|
|
709
|
+
r.value ? (d(), I(xl, {
|
|
710
710
|
key: 0,
|
|
711
|
-
"item-id":
|
|
712
|
-
menu:
|
|
711
|
+
"item-id": r.value,
|
|
712
|
+
menu: t(m).state.menu
|
|
713
713
|
}, null, 8, ["item-id", "menu"])) : U("", !0)
|
|
714
714
|
])
|
|
715
715
|
]));
|
|
716
716
|
}
|
|
717
717
|
}), Sl = /* @__PURE__ */ B({
|
|
718
718
|
__name: "OverviewSheet",
|
|
719
|
-
setup(
|
|
720
|
-
const e = F(null),
|
|
721
|
-
function
|
|
722
|
-
|
|
719
|
+
setup(g) {
|
|
720
|
+
const e = F(null), m = F(!1);
|
|
721
|
+
function r(l) {
|
|
722
|
+
m.value = !m.value, l && (e.value = l);
|
|
723
723
|
}
|
|
724
|
-
return (
|
|
725
|
-
const
|
|
726
|
-
return
|
|
727
|
-
_e(
|
|
728
|
-
|
|
724
|
+
return (l, s) => {
|
|
725
|
+
const a = O("FmSideSheet");
|
|
726
|
+
return d(), k(pe, null, [
|
|
727
|
+
_e(l.$slots, "default", { trigger: r }),
|
|
728
|
+
c(a, {
|
|
729
729
|
id: "product-overview",
|
|
730
|
-
modelValue:
|
|
731
|
-
"onUpdate:modelValue":
|
|
730
|
+
modelValue: m.value,
|
|
731
|
+
"onUpdate:modelValue": s[0] || (s[0] = (v) => m.value = v),
|
|
732
732
|
"max-width": 1200,
|
|
733
733
|
"dismiss-away": ""
|
|
734
734
|
}, {
|
|
735
|
-
"side-sheet-header": T(() =>
|
|
736
|
-
|
|
737
|
-
])),
|
|
735
|
+
"side-sheet-header": T(() => [...s[1] || (s[1] = [
|
|
736
|
+
b("p", { class: "fm-typo-en-title-md-600" }, "Product Overview", -1)
|
|
737
|
+
])]),
|
|
738
738
|
default: T(() => [
|
|
739
|
-
|
|
740
|
-
|
|
739
|
+
b("div", null, [
|
|
740
|
+
m.value && e.value ? (d(), I(wl, {
|
|
741
741
|
key: 0,
|
|
742
742
|
"item-id": e.value
|
|
743
743
|
}, null, 8, ["item-id"])) : U("", !0)
|
|
@@ -752,31 +752,31 @@ const Nt = { class: "inline-flex items-center" }, Bt = {
|
|
|
752
752
|
var Vl = Ut();
|
|
753
753
|
const Ye = /* @__PURE__ */ B({
|
|
754
754
|
__name: "ImportButton",
|
|
755
|
-
setup(
|
|
755
|
+
setup(g) {
|
|
756
756
|
const e = F(!1);
|
|
757
|
-
function
|
|
757
|
+
function m() {
|
|
758
758
|
e.value = !e.value;
|
|
759
759
|
}
|
|
760
|
-
const
|
|
760
|
+
const r = ze();
|
|
761
761
|
return at(() => {
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
762
|
+
const l = r.currentCountry.value;
|
|
763
|
+
if (l)
|
|
764
764
|
try {
|
|
765
|
-
Vl.setCountryConfig(
|
|
766
|
-
} catch (
|
|
767
|
-
console.log("Unable to set country config",
|
|
765
|
+
Vl.setCountryConfig(l);
|
|
766
|
+
} catch (s) {
|
|
767
|
+
console.log("Unable to set country config", s);
|
|
768
768
|
}
|
|
769
|
-
}), (
|
|
770
|
-
|
|
769
|
+
}), (l, s) => (d(), k(pe, null, [
|
|
770
|
+
c(Mt, {
|
|
771
771
|
modelValue: e.value,
|
|
772
|
-
"onUpdate:modelValue":
|
|
772
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a)
|
|
773
773
|
}, null, 8, ["modelValue"]),
|
|
774
|
-
_e(
|
|
774
|
+
_e(l.$slots, "default", { trigger: m })
|
|
775
775
|
], 64));
|
|
776
776
|
}
|
|
777
|
-
}), Ze = (
|
|
777
|
+
}), Ze = (g) => c("div", {
|
|
778
778
|
class: "flex flex-1 justify-end"
|
|
779
|
-
}, [
|
|
779
|
+
}, [c("span", null, [g, et(" ")])]), Fl = {
|
|
780
780
|
class: "flex justify-between items-center space-x-8"
|
|
781
781
|
}, Il = {
|
|
782
782
|
class: "flex space-x-8 items-center"
|
|
@@ -842,26 +842,26 @@ const Ye = /* @__PURE__ */ B({
|
|
|
842
842
|
}
|
|
843
843
|
},
|
|
844
844
|
emits: ["update:model-value", "reset:model-value", "update:editing", "update:search-key"],
|
|
845
|
-
setup(
|
|
845
|
+
setup(g, {
|
|
846
846
|
expose: e,
|
|
847
|
-
emit:
|
|
847
|
+
emit: m
|
|
848
848
|
}) {
|
|
849
|
-
const
|
|
850
|
-
t
|
|
851
|
-
} = Ie(),
|
|
849
|
+
const r = g, {
|
|
850
|
+
t: l
|
|
851
|
+
} = Ie(), s = ze(), a = Fe(), v = Tt(), f = ot(), u = s.currentCountry, _ = x(() => u.value ? me.Country.getCountry(u.value) : null), h = x(() => a.rules.item), {
|
|
852
852
|
selectedCategories: w
|
|
853
|
-
} = Se(), z =
|
|
854
|
-
const o = ge.flatten(w.value.map((
|
|
855
|
-
return ge.uniqBy(o, (
|
|
856
|
-
}), Y =
|
|
853
|
+
} = Se(), z = x(() => {
|
|
854
|
+
const o = ge.flatten(w.value.map((n) => n.items));
|
|
855
|
+
return ge.uniqBy(o, (n) => n._id);
|
|
856
|
+
}), Y = m, S = F(!1);
|
|
857
857
|
de(() => S.value, (o) => {
|
|
858
858
|
Y("update:editing", o);
|
|
859
859
|
});
|
|
860
860
|
const oe = (o) => {
|
|
861
861
|
zt.isBoolean(o) ? S.value = o : S.value = !S.value;
|
|
862
|
-
}, Z = F(!1),
|
|
862
|
+
}, Z = F(!1), ne = F(null);
|
|
863
863
|
async function G() {
|
|
864
|
-
Z.value = !Z.value, Z.value && (await Ae(),
|
|
864
|
+
Z.value = !Z.value, Z.value && (await Ae(), ne.value && ne.value.toggleProperty(!0));
|
|
865
865
|
}
|
|
866
866
|
e({
|
|
867
867
|
toggleAttributeFilter: G
|
|
@@ -873,33 +873,33 @@ const Ye = /* @__PURE__ */ B({
|
|
|
873
873
|
} = xt({
|
|
874
874
|
valueSource: z,
|
|
875
875
|
entity: "item"
|
|
876
|
-
}), J = F(""),
|
|
877
|
-
const o = (
|
|
878
|
-
var
|
|
879
|
-
return !
|
|
880
|
-
},
|
|
881
|
-
return z.value.filter((
|
|
876
|
+
}), J = F(""), re = Ct(J, 300), Q = x(() => {
|
|
877
|
+
const o = (i) => {
|
|
878
|
+
var C;
|
|
879
|
+
return !re.value || !re.value.trim() ? !0 : [i.code, i.name, Ke(i), ...Pe(se.value, i), (C = Ce()[i.orderFrom]) == null ? void 0 : C.label, Object.values(i.customAttributes ?? {}).join(" ")].join(" ").toLowerCase().includes(re.value.toLowerCase());
|
|
880
|
+
}, n = (i) => H.value ? $t(i.customAttributes, H.value) : !0;
|
|
881
|
+
return z.value.filter((i) => o(i) && n(i));
|
|
882
882
|
}), {
|
|
883
883
|
categories: se
|
|
884
|
-
} = Se(), R =
|
|
884
|
+
} = Se(), R = x(() => a.categories.map((o) => ({
|
|
885
885
|
label: o.name,
|
|
886
886
|
value: o._id || null
|
|
887
|
-
}))), $ = (o,
|
|
888
|
-
let p = ge.clone(
|
|
889
|
-
const
|
|
890
|
-
|
|
891
|
-
...
|
|
892
|
-
...
|
|
887
|
+
}))), $ = (o, n, i) => {
|
|
888
|
+
let p = ge.clone(r.modelValue);
|
|
889
|
+
const C = p[o];
|
|
890
|
+
C && (typeof n == "object" && n !== null ? p[o] = {
|
|
891
|
+
...C,
|
|
892
|
+
...n
|
|
893
893
|
} : p[o] = {
|
|
894
|
-
...
|
|
895
|
-
[
|
|
894
|
+
...C,
|
|
895
|
+
[n]: i
|
|
896
896
|
}, Y("update:model-value", p));
|
|
897
|
-
}, P = bt(() =>
|
|
897
|
+
}, P = bt(() => r.originalValue, () => r.modelValue), A = ge.debounce($, 300), ue = (o) => (n) => !!n || l("menu.product.table.validation.name_required", {
|
|
898
898
|
field: o
|
|
899
|
-
}), L = (o) => o >= 0 ||
|
|
900
|
-
const o =
|
|
901
|
-
return gt.setCoreStore(
|
|
902
|
-
}), ce =
|
|
899
|
+
}), L = (o) => o >= 0 || l("menu.product.table.validation.price_min"), j = [ue("Name")], M = () => [(o) => L(typeof o == "number" ? o : Number(o) ?? 0)], ie = Ce(), E = x(() => {
|
|
900
|
+
const o = a.isV4;
|
|
901
|
+
return gt.setCoreStore(s).taxSetting(o);
|
|
902
|
+
}), ce = x(() => [{
|
|
903
903
|
accessorKey: "thumbnail",
|
|
904
904
|
header: "",
|
|
905
905
|
size: 110,
|
|
@@ -908,10 +908,10 @@ const Ye = /* @__PURE__ */ B({
|
|
|
908
908
|
headerContentClass: "px-0"
|
|
909
909
|
},
|
|
910
910
|
cell: (o) => {
|
|
911
|
-
var
|
|
911
|
+
var n, i;
|
|
912
912
|
return q(Me, {
|
|
913
913
|
src: o.getValue(),
|
|
914
|
-
alt: (
|
|
914
|
+
alt: (i = (n = o == null ? void 0 : o.row) == null ? void 0 : n.original) == null ? void 0 : i.name,
|
|
915
915
|
className: "my-8 mx-12",
|
|
916
916
|
size: 72,
|
|
917
917
|
crossorigin: !1
|
|
@@ -920,47 +920,47 @@ const Ye = /* @__PURE__ */ B({
|
|
|
920
920
|
enableSorting: !1
|
|
921
921
|
}, {
|
|
922
922
|
accessorKey: "code",
|
|
923
|
-
header: () =>
|
|
923
|
+
header: () => l("menu.product.table.columns.code"),
|
|
924
924
|
enableSorting: !1,
|
|
925
925
|
size: 100,
|
|
926
926
|
cell: (o) => {
|
|
927
|
-
const
|
|
928
|
-
if (!S.value) return
|
|
927
|
+
const n = o.row.original, i = o.getValue() || "--";
|
|
928
|
+
if (!S.value) return c("span", {
|
|
929
929
|
class: "break-all"
|
|
930
|
-
}, [
|
|
931
|
-
const p = Te(
|
|
930
|
+
}, [i]);
|
|
931
|
+
const p = Te(n._id);
|
|
932
932
|
return q(te.FmTextField, {
|
|
933
|
-
disabled: !
|
|
934
|
-
modelValue: P(
|
|
935
|
-
placeholder:
|
|
936
|
-
"onUpdate:modelValue": (
|
|
937
|
-
A(
|
|
933
|
+
disabled: !h.value.code,
|
|
934
|
+
modelValue: P(n._id, "code") ?? (p == null ? void 0 : p.code),
|
|
935
|
+
placeholder: r.modelValue[n._id].fallbackCode,
|
|
936
|
+
"onUpdate:modelValue": (C) => {
|
|
937
|
+
A(n._id, "code", C);
|
|
938
938
|
}
|
|
939
939
|
});
|
|
940
940
|
}
|
|
941
941
|
}, {
|
|
942
942
|
accessorKey: "name",
|
|
943
|
-
header: () =>
|
|
943
|
+
header: () => l("menu.product.table.columns.name"),
|
|
944
944
|
enableSorting: !1,
|
|
945
945
|
size: 200,
|
|
946
946
|
cell: (o) => {
|
|
947
|
-
const
|
|
947
|
+
const n = o.row.original, i = o.getValue();
|
|
948
948
|
return S.value ? q(te.FmTextField, {
|
|
949
|
-
disabled: !
|
|
950
|
-
modelValue: P(
|
|
949
|
+
disabled: !h.value.name,
|
|
950
|
+
modelValue: P(n._id, "name") ?? n.name,
|
|
951
951
|
"onUpdate:modelValue": (p) => {
|
|
952
|
-
A(
|
|
952
|
+
A(n._id, "name", p);
|
|
953
953
|
},
|
|
954
954
|
rules: j,
|
|
955
|
-
placeholder:
|
|
956
|
-
}) :
|
|
955
|
+
placeholder: n.fallbackName
|
|
956
|
+
}) : i;
|
|
957
957
|
}
|
|
958
958
|
}, {
|
|
959
959
|
accessorKey: "price",
|
|
960
960
|
header: () => {
|
|
961
961
|
var o;
|
|
962
|
-
return Ze(
|
|
963
|
-
currency: (o =
|
|
962
|
+
return Ze(l("menu.product.table.columns.price", {
|
|
963
|
+
currency: (o = _.value) == null ? void 0 : o.currency.symbol
|
|
964
964
|
}));
|
|
965
965
|
},
|
|
966
966
|
enableSorting: !1,
|
|
@@ -969,19 +969,19 @@ const Ye = /* @__PURE__ */ B({
|
|
|
969
969
|
textAlign: "right"
|
|
970
970
|
},
|
|
971
971
|
cell: (o) => {
|
|
972
|
-
var
|
|
973
|
-
const
|
|
974
|
-
if (!S.value) return me.Dinero.fromFdoDinero(
|
|
975
|
-
const
|
|
972
|
+
var C;
|
|
973
|
+
const n = o.getValue();
|
|
974
|
+
if (!S.value) return me.Dinero.fromFdoDinero(n).toFormat();
|
|
975
|
+
const i = r.modelValue[o.row.original._id], p = i.fallbackPrice;
|
|
976
976
|
return q(Rt, {
|
|
977
977
|
min: 0,
|
|
978
|
-
disabled: !
|
|
978
|
+
disabled: !i.editPrice,
|
|
979
979
|
// @ts-ignore
|
|
980
980
|
placeholder: p ? Dt(p, !1) : void 0,
|
|
981
|
-
modelValue: P(
|
|
981
|
+
modelValue: P(i._id, "price") ?? ((C = Te(i._id)) == null ? void 0 : C.price),
|
|
982
982
|
// @ts-ignore
|
|
983
983
|
"onUpdate:modelValue": (V) => {
|
|
984
|
-
$(
|
|
984
|
+
$(i._id, "price", V);
|
|
985
985
|
},
|
|
986
986
|
rules: M()
|
|
987
987
|
});
|
|
@@ -995,44 +995,44 @@ const Ye = /* @__PURE__ */ B({
|
|
|
995
995
|
textAlign: "right"
|
|
996
996
|
},
|
|
997
997
|
cell: (o) => {
|
|
998
|
-
const
|
|
998
|
+
const n = o.getValue(), i = o.row.original, p = a.taxSetting.countryTaxOptions, C = a.getSelectedTax(n, i.fallbackTaxes, a.taxSetting.countryTaxOptions), V = p.find((ae) => ae.value === C);
|
|
999
999
|
if (!S.value)
|
|
1000
1000
|
return `${V != null && V.meta.rate ? _t(V.meta.rate) : 0}%`;
|
|
1001
|
-
const
|
|
1001
|
+
const y = a.getSelectedTax(P(i._id, "taxes") ?? n, i.fallbackTaxes, a.taxSetting.countryTaxOptions);
|
|
1002
1002
|
return q(te.FmSelect, {
|
|
1003
|
-
disabled: !
|
|
1004
|
-
items:
|
|
1005
|
-
modelValue:
|
|
1003
|
+
disabled: !h.value.tax,
|
|
1004
|
+
items: a.taxSetting.countryTaxOptions,
|
|
1005
|
+
modelValue: y,
|
|
1006
1006
|
"onUpdate:modelValue": async (ae) => {
|
|
1007
|
-
const xe =
|
|
1008
|
-
A(
|
|
1007
|
+
const xe = a.decodeTax(ae);
|
|
1008
|
+
A(i._id, "taxes", [xe]);
|
|
1009
1009
|
}
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
1012
1012
|
}, {
|
|
1013
1013
|
accessorKey: "category",
|
|
1014
|
-
header: () =>
|
|
1014
|
+
header: () => l("menu.product.table.columns.category"),
|
|
1015
1015
|
enableSorting: !1,
|
|
1016
1016
|
size: 140,
|
|
1017
1017
|
cell: (o) => {
|
|
1018
|
-
const
|
|
1018
|
+
const n = o.row.original;
|
|
1019
1019
|
if (!S.value)
|
|
1020
1020
|
return q(Qe, {
|
|
1021
|
-
categories: Pe(se.value,
|
|
1021
|
+
categories: Pe(se.value, n)
|
|
1022
1022
|
});
|
|
1023
|
-
const
|
|
1023
|
+
const i = yt(r.originalValue, r.modelValue, n._id) ?? ht(n), p = (i == null ? void 0 : i.map((V) => V._id)) ?? [], C = i == null ? void 0 : i.reduce((V, y) => (V[y._id] = y, V), {});
|
|
1024
1024
|
return q(It, {
|
|
1025
1025
|
shouldShowChips: !1,
|
|
1026
1026
|
shouldShowSelectedItemsWithinPlaceholder: !0,
|
|
1027
1027
|
modelValue: p.length > 0 ? p : [null],
|
|
1028
1028
|
items: R.value,
|
|
1029
|
-
disabled: !!(
|
|
1029
|
+
disabled: !!(a.state.currentCatalogId || a.state.currentSchedulerId),
|
|
1030
1030
|
"onUpdate:modelValue": async (V) => {
|
|
1031
|
-
const [
|
|
1032
|
-
A(
|
|
1033
|
-
category:
|
|
1031
|
+
const [y, ...ae] = V;
|
|
1032
|
+
A(n._id, {
|
|
1033
|
+
category: y,
|
|
1034
1034
|
additionalCategories: ae.map((xe) => {
|
|
1035
|
-
const Be =
|
|
1035
|
+
const Be = C == null ? void 0 : C[xe];
|
|
1036
1036
|
return Be || {
|
|
1037
1037
|
_id: xe,
|
|
1038
1038
|
position: null
|
|
@@ -1045,35 +1045,35 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1045
1045
|
}, {
|
|
1046
1046
|
id: "tagging",
|
|
1047
1047
|
accessorKey: "tagging",
|
|
1048
|
-
header: () =>
|
|
1048
|
+
header: () => l("menu.product.table.columns.tagging"),
|
|
1049
1049
|
enableSorting: !1,
|
|
1050
1050
|
size: 140,
|
|
1051
1051
|
cell: (o) => {
|
|
1052
|
-
const
|
|
1052
|
+
const n = o.row.original;
|
|
1053
1053
|
return q(Ue, {
|
|
1054
|
-
customAttributes:
|
|
1054
|
+
customAttributes: n.customAttributes
|
|
1055
1055
|
});
|
|
1056
1056
|
}
|
|
1057
1057
|
}, {
|
|
1058
1058
|
accessorKey: "orderFrom",
|
|
1059
|
-
header: () =>
|
|
1059
|
+
header: () => l("menu.product.table.columns.order_from"),
|
|
1060
1060
|
enableSorting: !0,
|
|
1061
|
-
sortingFn: (o,
|
|
1062
|
-
const [
|
|
1063
|
-
return
|
|
1061
|
+
sortingFn: (o, n) => {
|
|
1062
|
+
const [i, p] = [o, n].map((C) => ie[C.original.orderFrom].sortingIndex);
|
|
1063
|
+
return i - p;
|
|
1064
1064
|
},
|
|
1065
1065
|
size: 140,
|
|
1066
1066
|
cell: (o) => {
|
|
1067
|
-
const
|
|
1067
|
+
const n = o.getValue(), i = o.row.original;
|
|
1068
1068
|
return S.value ? q(te.FmSelect, {
|
|
1069
|
-
disabled: !
|
|
1069
|
+
disabled: !h.value.orderFrom,
|
|
1070
1070
|
items: Object.values(Ce()),
|
|
1071
|
-
modelValue: P(
|
|
1071
|
+
modelValue: P(i._id, "orderFrom") ?? n,
|
|
1072
1072
|
"onUpdate:modelValue": async (p) => {
|
|
1073
|
-
$(
|
|
1073
|
+
$(i._id, "orderFrom", p);
|
|
1074
1074
|
}
|
|
1075
1075
|
}) : q(Ve, {
|
|
1076
|
-
orderFrom:
|
|
1076
|
+
orderFrom: n
|
|
1077
1077
|
});
|
|
1078
1078
|
}
|
|
1079
1079
|
}, {
|
|
@@ -1095,42 +1095,42 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1095
1095
|
type: "button"
|
|
1096
1096
|
}), "Bulk edit")]),
|
|
1097
1097
|
cell: (o) => {
|
|
1098
|
-
const
|
|
1099
|
-
return
|
|
1098
|
+
const n = o.row.original;
|
|
1099
|
+
return c("div", {
|
|
1100
1100
|
class: "px-4 flex justify-end"
|
|
1101
|
-
}, [
|
|
1101
|
+
}, [c(Sl, null, {
|
|
1102
1102
|
default: ({
|
|
1103
|
-
trigger:
|
|
1104
|
-
}) =>
|
|
1103
|
+
trigger: i
|
|
1104
|
+
}) => c(te.FmButton, {
|
|
1105
1105
|
icon: "overview",
|
|
1106
1106
|
variant: "tertiary",
|
|
1107
1107
|
textColor: W.NeutralGray400,
|
|
1108
1108
|
onClick: fe(() => {
|
|
1109
|
-
|
|
1109
|
+
i(n._id);
|
|
1110
1110
|
}, ["stop", "prevent"])
|
|
1111
1111
|
}, null)
|
|
1112
|
-
}),
|
|
1112
|
+
}), c(te.FmButton, {
|
|
1113
1113
|
icon: "delete",
|
|
1114
1114
|
variant: "tertiary",
|
|
1115
1115
|
textColor: W.NeutralGray400,
|
|
1116
1116
|
onClick: fe(async () => {
|
|
1117
1117
|
await f.deleteItem([{
|
|
1118
|
-
_id:
|
|
1119
|
-
name:
|
|
1120
|
-
thumbnail:
|
|
1118
|
+
_id: n._id,
|
|
1119
|
+
name: n.name,
|
|
1120
|
+
thumbnail: n.thumbnail
|
|
1121
1121
|
}]);
|
|
1122
1122
|
}, ["stop", "prevent"])
|
|
1123
1123
|
}, null)]);
|
|
1124
1124
|
}
|
|
1125
1125
|
}]);
|
|
1126
|
-
|
|
1126
|
+
a.taxSetting.systemCode || ce.value.splice(4, 1);
|
|
1127
1127
|
const le = F({}), X = F([]);
|
|
1128
1128
|
de([() => le.value, () => Q.value], (o) => {
|
|
1129
|
-
let
|
|
1130
|
-
Object.keys(o[0]).forEach((
|
|
1131
|
-
const p = o[0][
|
|
1132
|
-
|
|
1133
|
-
}), X.value =
|
|
1129
|
+
let n = [];
|
|
1130
|
+
Object.keys(o[0]).forEach((i) => {
|
|
1131
|
+
const p = o[0][i], C = Q.value[parseInt(i)];
|
|
1132
|
+
C && (p ? n.push(C) : X.value = n.filter((V) => V !== C));
|
|
1133
|
+
}), X.value = n;
|
|
1134
1134
|
}), de(() => z.value, () => {
|
|
1135
1135
|
le.value = {}, X.value = [];
|
|
1136
1136
|
}), de(() => S.value, () => {
|
|
@@ -1141,9 +1141,9 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1141
1141
|
};
|
|
1142
1142
|
async function Oe() {
|
|
1143
1143
|
await Ae();
|
|
1144
|
-
const o = () => !!
|
|
1145
|
-
const
|
|
1146
|
-
return Ee(
|
|
1144
|
+
const o = () => !!a.currentCatalog || !!a.state.currentSchedulerId, n = (p) => p === "" || p === null ? o() ? "" : null : p, i = Object.values(r.modelValue).filter((p) => {
|
|
1145
|
+
const C = Object.values(r.originalValue).find((V) => V._id === p._id);
|
|
1146
|
+
return Ee(C, p);
|
|
1147
1147
|
}).map((p) => ({
|
|
1148
1148
|
_id: p._id,
|
|
1149
1149
|
name: p.name,
|
|
@@ -1151,10 +1151,10 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1151
1151
|
price: p.price,
|
|
1152
1152
|
orderFrom: p.orderFrom ?? null,
|
|
1153
1153
|
taxes: p.taxes,
|
|
1154
|
-
category:
|
|
1154
|
+
category: n(p.category || null),
|
|
1155
1155
|
additionalCategories: p.additionalCategories
|
|
1156
1156
|
}));
|
|
1157
|
-
await f.updateMany(
|
|
1157
|
+
await f.updateMany(i), oe(!1);
|
|
1158
1158
|
}
|
|
1159
1159
|
const st = async () => {
|
|
1160
1160
|
await f.deleteItem(X.value.map((o) => ({
|
|
@@ -1165,7 +1165,7 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1165
1165
|
}, he = () => {
|
|
1166
1166
|
Y("reset:model-value");
|
|
1167
1167
|
}, $e = () => {
|
|
1168
|
-
Object.entries(
|
|
1168
|
+
Object.entries(r.modelValue).some(([n, i]) => Ee(i, r.originalValue[n])) ? v.open({
|
|
1169
1169
|
title: "You have unsaved changes!",
|
|
1170
1170
|
message: "Are you sure you want to discard? You will lose all the changes if discard edit.",
|
|
1171
1171
|
primaryActions: {
|
|
@@ -1180,12 +1180,12 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1180
1180
|
}).onPrimary(() => {
|
|
1181
1181
|
he(), oe(!1);
|
|
1182
1182
|
}) : (oe(!1), he());
|
|
1183
|
-
}, ut =
|
|
1184
|
-
var o,
|
|
1183
|
+
}, ut = x(() => {
|
|
1184
|
+
var o, n;
|
|
1185
1185
|
return {
|
|
1186
1186
|
thumbnail: !S.value,
|
|
1187
1187
|
actions: !S.value,
|
|
1188
|
-
tagging: !S.value && ((
|
|
1188
|
+
tagging: !S.value && ((n = (o = s.itemAttributeSettings) == null ? void 0 : o.value) == null ? void 0 : n.length) > 0
|
|
1189
1189
|
};
|
|
1190
1190
|
}), it = (o) => {
|
|
1191
1191
|
f.update(o._id);
|
|
@@ -1194,159 +1194,159 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1194
1194
|
await f.update(o.original._id);
|
|
1195
1195
|
}
|
|
1196
1196
|
function Ke(o) {
|
|
1197
|
-
var
|
|
1198
|
-
const
|
|
1197
|
+
var y;
|
|
1198
|
+
const n = o.price ?? // TODO: fix type error
|
|
1199
1199
|
// @ts-ignore
|
|
1200
1200
|
o.fallbackPrice ?? me.Dinero.fromNumber({
|
|
1201
1201
|
number: 0
|
|
1202
|
-
}).toObject(),
|
|
1203
|
-
return
|
|
1204
|
-
|
|
1202
|
+
}).toObject(), i = o.taxes, p = a.taxSetting.countryTaxOptions, C = me.Dinero.fromFdoDinero(n).toFormat(), V = (y = _.value) == null ? void 0 : y.currency.symbol;
|
|
1203
|
+
return a.getSelectedTax(
|
|
1204
|
+
i,
|
|
1205
1205
|
// TODO: fix type error
|
|
1206
1206
|
// @ts-ignore
|
|
1207
1207
|
o.fallbackTaxes,
|
|
1208
1208
|
p
|
|
1209
|
-
), `${V == null ? void 0 : V.toUpperCase()}${
|
|
1209
|
+
), `${V == null ? void 0 : V.toUpperCase()}${C}`;
|
|
1210
1210
|
}
|
|
1211
1211
|
function Te(o) {
|
|
1212
1212
|
var p;
|
|
1213
|
-
const
|
|
1214
|
-
if (
|
|
1215
|
-
const
|
|
1213
|
+
const n = a.currentCatalog, i = a.state.currentSchedulerId;
|
|
1214
|
+
if (n && i) {
|
|
1215
|
+
const C = n.override.scheduler[i] ?? {}, V = (p = C == null ? void 0 : C.items) == null ? void 0 : p.filter((y) => y._id === o);
|
|
1216
1216
|
return V == null ? void 0 : V[0];
|
|
1217
|
-
} else return
|
|
1217
|
+
} else return n ? n.override.items[o][0] : i ? a.schedulers.find((y) => y._id === i).items.filter((y) => y._id === o)[0] : z.value.find((C) => C._id === o);
|
|
1218
1218
|
}
|
|
1219
|
-
const dt =
|
|
1220
|
-
var
|
|
1219
|
+
const dt = nt(), mt = x(() => dt.breakpoints.value.xs), Ne = F(null), pt = At(Ne, Z), vt = x(() => {
|
|
1220
|
+
var n;
|
|
1221
1221
|
return {
|
|
1222
|
-
height: `calc(100vh - ${((
|
|
1222
|
+
height: `calc(100vh - ${((n = pt.value) == null ? void 0 : n.top) + 24}px)`
|
|
1223
1223
|
};
|
|
1224
1224
|
});
|
|
1225
|
-
return (o,
|
|
1226
|
-
const
|
|
1227
|
-
return mt.value ? (
|
|
1225
|
+
return (o, n) => {
|
|
1226
|
+
const i = O("fm-search"), p = O("fm-button"), C = O("fm-table"), V = O("fm-form");
|
|
1227
|
+
return mt.value ? (d(), k("div", Dl, [b("div", Ol, [b("div", Kl, [c(i, {
|
|
1228
1228
|
"model-value": J.value,
|
|
1229
|
-
"onUpdate:modelValue":
|
|
1229
|
+
"onUpdate:modelValue": n[5] || (n[5] = (y) => J.value = y),
|
|
1230
1230
|
autofocus: "",
|
|
1231
|
-
placeholder:
|
|
1232
|
-
}, null, 8, ["model-value", "placeholder"])]),
|
|
1231
|
+
placeholder: t(l)("menu.product.table.search.placeholder")
|
|
1232
|
+
}, null, 8, ["model-value", "placeholder"])]), n[8] || (n[8] = b("div", {
|
|
1233
1233
|
class: "w-full h-[1px] bg-fm-color-neutral-gray-100"
|
|
1234
|
-
}, null, -1)),
|
|
1234
|
+
}, null, -1)), b("div", Nl, [_e(o.$slots, "filter")]), Z.value ? (d(), k("div", Bl, [c(t(We), {
|
|
1235
1235
|
ref_key: "attributeFilterRef",
|
|
1236
|
-
ref:
|
|
1237
|
-
attributes:
|
|
1238
|
-
modelValue:
|
|
1239
|
-
"onUpdate:modelValue":
|
|
1240
|
-
}, null, 8, ["attributes", "modelValue"])])) : U("", !0)]), z.value.length ? (
|
|
1236
|
+
ref: ne,
|
|
1237
|
+
attributes: t(K),
|
|
1238
|
+
modelValue: t(D),
|
|
1239
|
+
"onUpdate:modelValue": n[6] || (n[6] = (y) => je(D) ? D.value = y : null)
|
|
1240
|
+
}, null, 8, ["attributes", "modelValue"])])) : U("", !0)]), z.value.length ? (d(), k("div", jl, [(d(!0), k(pe, null, we(Q.value, (y) => {
|
|
1241
1241
|
var ae;
|
|
1242
|
-
return
|
|
1243
|
-
key:
|
|
1242
|
+
return d(), k("div", {
|
|
1243
|
+
key: y._id,
|
|
1244
1244
|
class: "max-w-full py-12 px-16 space-x-16 flex items-center",
|
|
1245
|
-
onClick: () => it(
|
|
1246
|
-
}, [
|
|
1247
|
-
alt:
|
|
1245
|
+
onClick: () => it(y)
|
|
1246
|
+
}, [b("div", Gl, [c(Me, {
|
|
1247
|
+
alt: y.name,
|
|
1248
1248
|
size: 72,
|
|
1249
|
-
src:
|
|
1250
|
-
}, null, 8, ["alt", "src"]),
|
|
1251
|
-
"order-from":
|
|
1252
|
-
}, null, 8, ["order-from"])]),
|
|
1253
|
-
categories:
|
|
1254
|
-
}, null, 8, ["categories"])]),
|
|
1255
|
-
"custom-attributes":
|
|
1256
|
-
}, null, 8, ["custom-attributes"])])]),
|
|
1257
|
-
"text-color":
|
|
1258
|
-
variant:
|
|
1249
|
+
src: y.thumbnail
|
|
1250
|
+
}, null, 8, ["alt", "src"]), b("div", Ll, [b("div", ql, [b("p", Wl, N(y.name), 1), c(Ve, {
|
|
1251
|
+
"order-from": y.orderFrom
|
|
1252
|
+
}, null, 8, ["order-from"])]), b("p", Hl, N(Ke(y)), 1), b("p", Ql, N(t(l)("menu.product.table.columns.code")) + ": " + N(((ae = Te(y._id)) == null ? void 0 : ae.code) || "--"), 1), b("p", Yl, [c(Qe, {
|
|
1253
|
+
categories: t(Pe)(t(se), y)
|
|
1254
|
+
}, null, 8, ["categories"])]), c(Ue, {
|
|
1255
|
+
"custom-attributes": y.customAttributes
|
|
1256
|
+
}, null, 8, ["custom-attributes"])])]), c(p, {
|
|
1257
|
+
"text-color": t(W).NeutralGray400,
|
|
1258
|
+
variant: t(ee).Tertiary,
|
|
1259
1259
|
"prepend-icon": "delete",
|
|
1260
|
-
onClick: fe(() =>
|
|
1261
|
-
_id:
|
|
1262
|
-
name:
|
|
1263
|
-
thumbnail:
|
|
1260
|
+
onClick: fe(() => t(f).deleteItem([{
|
|
1261
|
+
_id: y._id,
|
|
1262
|
+
name: y.name,
|
|
1263
|
+
thumbnail: y.thumbnail
|
|
1264
1264
|
}]), ["stop"])
|
|
1265
1265
|
}, null, 8, ["text-color", "variant", "onClick"])], 8, El);
|
|
1266
|
-
}), 128))])) : (
|
|
1267
|
-
subtitle:
|
|
1268
|
-
title:
|
|
1266
|
+
}), 128))])) : (d(), k("div", Zl, [c(be, {
|
|
1267
|
+
subtitle: t(l)("menu.product.table.empty.subtitle"),
|
|
1268
|
+
title: t(l)("menu.product.table.empty.title")
|
|
1269
1269
|
}, {
|
|
1270
|
-
action: T(() => [
|
|
1271
|
-
variant:
|
|
1272
|
-
label:
|
|
1270
|
+
action: T(() => [b("div", Jl, [c(p, {
|
|
1271
|
+
variant: t(ee).Primary,
|
|
1272
|
+
label: t(l)("menu.product.table.empty.actions.add"),
|
|
1273
1273
|
"prepend-icon": "add",
|
|
1274
|
-
onClick:
|
|
1275
|
-
}, null, 8, ["variant", "label"]),
|
|
1274
|
+
onClick: n[7] || (n[7] = (y) => t(f).create(null))
|
|
1275
|
+
}, null, 8, ["variant", "label"]), c(Ye, null, {
|
|
1276
1276
|
default: T(({
|
|
1277
|
-
trigger:
|
|
1278
|
-
}) => [
|
|
1279
|
-
"bg-color":
|
|
1280
|
-
"text-color":
|
|
1281
|
-
variant:
|
|
1282
|
-
label:
|
|
1277
|
+
trigger: y
|
|
1278
|
+
}) => [c(p, {
|
|
1279
|
+
"bg-color": t(W).NeutralGray100,
|
|
1280
|
+
"text-color": t(W).NeutralGray400,
|
|
1281
|
+
variant: t(ee).Primary,
|
|
1282
|
+
label: t(l)("menu.product.table.empty.actions.import"),
|
|
1283
1283
|
"prepend-icon": "download",
|
|
1284
|
-
onClick:
|
|
1284
|
+
onClick: y
|
|
1285
1285
|
}, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
|
|
1286
1286
|
_: 1
|
|
1287
1287
|
})])]),
|
|
1288
1288
|
_: 1
|
|
1289
|
-
}, 8, ["subtitle", "title"])]))])) : (
|
|
1289
|
+
}, 8, ["subtitle", "title"])]))])) : (d(), I(V, {
|
|
1290
1290
|
key: 0,
|
|
1291
1291
|
"blame-form-child-on-validation-failed": "",
|
|
1292
1292
|
class: "flex flex-col flex-1 space-y-8 overflow-hidden",
|
|
1293
1293
|
onValidationSuccess: Oe
|
|
1294
1294
|
}, {
|
|
1295
|
-
default: T(() => [
|
|
1295
|
+
default: T(() => [b("div", Fl, [b("div", Il, [_e(o.$slots, "filter")]), b("div", $l, [c(i, {
|
|
1296
1296
|
"model-value": J.value,
|
|
1297
|
-
"onUpdate:modelValue":
|
|
1297
|
+
"onUpdate:modelValue": n[0] || (n[0] = (y) => J.value = y),
|
|
1298
1298
|
autofocus: "",
|
|
1299
|
-
placeholder:
|
|
1300
|
-
}, null, 8, ["model-value", "placeholder"])])]), Z.value ? (
|
|
1299
|
+
placeholder: t(l)("menu.product.table.search.placeholder")
|
|
1300
|
+
}, null, 8, ["model-value", "placeholder"])])]), Z.value ? (d(), k("div", Tl, [c(t(We), {
|
|
1301
1301
|
ref_key: "attributeFilterRef",
|
|
1302
|
-
ref:
|
|
1303
|
-
attributes:
|
|
1304
|
-
modelValue:
|
|
1305
|
-
"onUpdate:modelValue":
|
|
1306
|
-
}, null, 8, ["attributes", "modelValue"])])) : U("", !0), z.value.length ? (
|
|
1302
|
+
ref: ne,
|
|
1303
|
+
attributes: t(K),
|
|
1304
|
+
modelValue: t(D),
|
|
1305
|
+
"onUpdate:modelValue": n[1] || (n[1] = (y) => je(D) ? D.value = y : null)
|
|
1306
|
+
}, null, 8, ["attributes", "modelValue"])])) : U("", !0), z.value.length ? (d(), k("div", Pl, [X.value.length && !S.value ? (d(), k("div", Al, [b("p", Rl, N(t(l)("menu.product.table.selection.count", {
|
|
1307
1307
|
count: X.value.length
|
|
1308
|
-
})), 1),
|
|
1309
|
-
label:
|
|
1308
|
+
})), 1), c(p, {
|
|
1309
|
+
label: t(l)("menu.product.table.selection.actions.deselect_all"),
|
|
1310
1310
|
type: "button",
|
|
1311
1311
|
variant: "plain",
|
|
1312
1312
|
onClick: ye
|
|
1313
|
-
}, null, 8, ["label"]),
|
|
1314
|
-
"border-color":
|
|
1315
|
-
"text-color":
|
|
1313
|
+
}, null, 8, ["label"]), c(p, {
|
|
1314
|
+
"border-color": t(W).SystemError300,
|
|
1315
|
+
"text-color": t(W).SystemError300,
|
|
1316
1316
|
class: "ml-auto",
|
|
1317
|
-
label:
|
|
1317
|
+
label: t(l)("menu.product.table.selection.actions.remove"),
|
|
1318
1318
|
"prepend-icon": "delete",
|
|
1319
1319
|
variant: "secondary",
|
|
1320
1320
|
onClick: st
|
|
1321
|
-
}, null, 8, ["border-color", "text-color", "label"])])) : U("", !0), S.value ? (
|
|
1322
|
-
variant:
|
|
1323
|
-
label:
|
|
1321
|
+
}, null, 8, ["border-color", "text-color", "label"])])) : U("", !0), S.value ? (d(), k("div", Ul, [c(p, {
|
|
1322
|
+
variant: t(ee).Tertiary,
|
|
1323
|
+
label: t(l)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
1324
1324
|
onClick: he
|
|
1325
|
-
}, null, 8, ["variant", "label"]),
|
|
1326
|
-
variant:
|
|
1327
|
-
label:
|
|
1325
|
+
}, null, 8, ["variant", "label"]), c(p, {
|
|
1326
|
+
variant: t(ee).Tertiary,
|
|
1327
|
+
label: t(l)("menu.common.actions.cancel"),
|
|
1328
1328
|
onClick: $e
|
|
1329
|
-
}, null, 8, ["variant", "label"]),
|
|
1330
|
-
borderColor:
|
|
1331
|
-
textColor:
|
|
1332
|
-
variant:
|
|
1333
|
-
label:
|
|
1329
|
+
}, null, 8, ["variant", "label"]), c(p, {
|
|
1330
|
+
borderColor: t(W).ColorPrimary,
|
|
1331
|
+
textColor: t(W).ColorPrimary,
|
|
1332
|
+
variant: t(ee).Secondary,
|
|
1333
|
+
label: t(l)("menu.product.table.bulk_edit.actions.save"),
|
|
1334
1334
|
type: "submit"
|
|
1335
|
-
}, null, 8, ["borderColor", "textColor", "variant", "label"])])) : U("", !0),
|
|
1335
|
+
}, null, 8, ["borderColor", "textColor", "variant", "label"])])) : U("", !0), b("div", {
|
|
1336
1336
|
ref_key: "tableWrapper",
|
|
1337
1337
|
ref: Ne
|
|
1338
|
-
}, [(
|
|
1338
|
+
}, [(d(), I(lt(S.value ? Pt : "div"), {
|
|
1339
1339
|
ref: "fullWrapper",
|
|
1340
|
-
title: S.value ?
|
|
1340
|
+
title: S.value ? t(l)("menu.product.table.bulk_edit.title") : "",
|
|
1341
1341
|
show: S.value,
|
|
1342
1342
|
"primary-action": {
|
|
1343
|
-
label:
|
|
1343
|
+
label: t(l)("menu.product.table.bulk_edit.actions.save")
|
|
1344
1344
|
},
|
|
1345
1345
|
"secondary-actions": [{
|
|
1346
|
-
label:
|
|
1346
|
+
label: t(l)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
1347
1347
|
click: he
|
|
1348
1348
|
}, {
|
|
1349
|
-
label:
|
|
1349
|
+
label: t(l)("menu.common.actions.cancel"),
|
|
1350
1350
|
click: $e
|
|
1351
1351
|
}],
|
|
1352
1352
|
class: "overflow-x-scroll",
|
|
@@ -1354,16 +1354,16 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1354
1354
|
onOnPrimary: Oe,
|
|
1355
1355
|
onOnCancel: $e
|
|
1356
1356
|
}, {
|
|
1357
|
-
default: T(() => [
|
|
1357
|
+
default: T(() => [c(C, {
|
|
1358
1358
|
class: ve({
|
|
1359
1359
|
"min-w-[1100px]": !0,
|
|
1360
1360
|
"mt-24": S.value
|
|
1361
1361
|
}),
|
|
1362
1362
|
modelValue: le.value,
|
|
1363
|
-
"onUpdate:modelValue":
|
|
1363
|
+
"onUpdate:modelValue": n[2] || (n[2] = (y) => le.value = y),
|
|
1364
1364
|
"column-defs": ce.value,
|
|
1365
1365
|
"column-visibility": ut.value,
|
|
1366
|
-
loading:
|
|
1366
|
+
loading: g.isCalculating,
|
|
1367
1367
|
"page-size": Q.value.length,
|
|
1368
1368
|
"row-data": Q.value,
|
|
1369
1369
|
"shrink-at": !1,
|
|
@@ -1372,28 +1372,28 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1372
1372
|
"virtual-row-height": S.value ? 48 : 91,
|
|
1373
1373
|
"hide-footer": "",
|
|
1374
1374
|
"pin-header-row": "",
|
|
1375
|
-
onRowClick:
|
|
1375
|
+
onRowClick: n[3] || (n[3] = (y) => S.value ? void 0 : ct(y))
|
|
1376
1376
|
}, null, 8, ["class", "modelValue", "column-defs", "column-visibility", "loading", "page-size", "row-data", "selection", "virtual-row-height"])]),
|
|
1377
1377
|
_: 1
|
|
1378
|
-
}, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (
|
|
1379
|
-
subtitle:
|
|
1380
|
-
title:
|
|
1378
|
+
}, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (d(), k("div", Ml, [c(be, {
|
|
1379
|
+
subtitle: t(l)("menu.product.table.empty.subtitle"),
|
|
1380
|
+
title: t(l)("menu.product.table.empty.title")
|
|
1381
1381
|
}, {
|
|
1382
|
-
action: T(() => [
|
|
1383
|
-
variant:
|
|
1384
|
-
label:
|
|
1382
|
+
action: T(() => [b("div", zl, [c(p, {
|
|
1383
|
+
variant: t(ee).Primary,
|
|
1384
|
+
label: t(l)("menu.product.table.empty.actions.add"),
|
|
1385
1385
|
"prepend-icon": "add",
|
|
1386
|
-
onClick:
|
|
1387
|
-
}, null, 8, ["variant", "label"]),
|
|
1386
|
+
onClick: n[4] || (n[4] = (y) => t(f).create(null))
|
|
1387
|
+
}, null, 8, ["variant", "label"]), c(Ye, null, {
|
|
1388
1388
|
default: T(({
|
|
1389
|
-
trigger:
|
|
1390
|
-
}) => [
|
|
1391
|
-
"bg-color":
|
|
1392
|
-
"text-color":
|
|
1393
|
-
variant:
|
|
1394
|
-
label:
|
|
1389
|
+
trigger: y
|
|
1390
|
+
}) => [c(p, {
|
|
1391
|
+
"bg-color": t(W).NeutralGray100,
|
|
1392
|
+
"text-color": t(W).NeutralGray400,
|
|
1393
|
+
variant: t(ee).Primary,
|
|
1394
|
+
label: t(l)("menu.product.table.empty.actions.import"),
|
|
1395
1395
|
"prepend-icon": "download",
|
|
1396
|
-
onClick:
|
|
1396
|
+
onClick: y
|
|
1397
1397
|
}, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
|
|
1398
1398
|
_: 1
|
|
1399
1399
|
})])]),
|
|
@@ -1413,22 +1413,22 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1413
1413
|
class: "pt-16 xs:pt-8 space-y-24"
|
|
1414
1414
|
}, oa = { class: "flex items-center gap-8 px-16" }, Va = /* @__PURE__ */ B({
|
|
1415
1415
|
__name: "Product",
|
|
1416
|
-
setup(
|
|
1417
|
-
const e = Fe(),
|
|
1416
|
+
setup(g) {
|
|
1417
|
+
const e = Fe(), m = x(() => e.rules.item), r = ot(), l = x(() => !e.state.currentCatalogId), s = x(() => e.rules.item), a = x(() => !e.state.currentSchedulerId), v = F(!1), f = F(!1), u = x(() => {
|
|
1418
1418
|
var $, P, A, ue;
|
|
1419
|
-
if (
|
|
1420
|
-
if (
|
|
1419
|
+
if (l.value && a.value) return;
|
|
1420
|
+
if (a.value) {
|
|
1421
1421
|
const L = ($ = e.currentCatalog) == null ? void 0 : $.override.items;
|
|
1422
1422
|
return L ? Object.entries(L).reduce((j, [M, ie]) => {
|
|
1423
1423
|
const E = ie.find((ce) => !ce.combinationKey);
|
|
1424
1424
|
return E && (j[M] = E), j;
|
|
1425
1425
|
}, {}) : {};
|
|
1426
1426
|
}
|
|
1427
|
-
return ((
|
|
1428
|
-
}),
|
|
1427
|
+
return ((l.value ? (P = e.currentScheduler) == null ? void 0 : P.items : (ue = (A = e.currentCatalog) == null ? void 0 : A.override.scheduler[e.state.currentSchedulerId]) == null ? void 0 : ue.items) ?? []).reduce((L, j) => (j.combinationKey || (L[j._id] = j), L), {});
|
|
1428
|
+
}), _ = F({}), h = F({}), w = async () => {
|
|
1429
1429
|
var ue, L;
|
|
1430
1430
|
f.value = !0;
|
|
1431
|
-
const R = !!
|
|
1431
|
+
const R = !!u.value, $ = ge.flatten(Y.value.map((j) => j.items)), P = R && v.value ? await Ft(
|
|
1432
1432
|
e.mergedMenu,
|
|
1433
1433
|
$,
|
|
1434
1434
|
e.state.menu,
|
|
@@ -1437,14 +1437,14 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1437
1437
|
!1
|
|
1438
1438
|
) : void 0, A = $.reduce((j, M, ie) => {
|
|
1439
1439
|
var ce, le, X, ye;
|
|
1440
|
-
const E = (ce =
|
|
1440
|
+
const E = (ce = u.value) == null ? void 0 : ce[M._id];
|
|
1441
1441
|
return j[M._id] = {
|
|
1442
1442
|
_id: M._id,
|
|
1443
1443
|
name: M.name,
|
|
1444
1444
|
code: R ? E == null ? void 0 : E.code : M == null ? void 0 : M.code,
|
|
1445
1445
|
category: M.category,
|
|
1446
1446
|
additionalCategories: M.additionalCategories,
|
|
1447
|
-
price: R &&
|
|
1447
|
+
price: R && s.value.editPrice ? E == null ? void 0 : E.price : M.price,
|
|
1448
1448
|
orderFrom: R ? E == null ? void 0 : E.orderFrom : M.orderFrom,
|
|
1449
1449
|
taxes: R ? null : M.taxes,
|
|
1450
1450
|
thumbnail: M.thumbnail,
|
|
@@ -1455,7 +1455,7 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1455
1455
|
fallbackTaxes: R ? M.taxes : null
|
|
1456
1456
|
}, j;
|
|
1457
1457
|
}, {});
|
|
1458
|
-
|
|
1458
|
+
_.value = A, h.value = { ...A }, f.value = !1;
|
|
1459
1459
|
}, { categories: z, selectedCategories: Y } = Se(), S = F(null);
|
|
1460
1460
|
function oe() {
|
|
1461
1461
|
S.value && S.value.toggleAttributeFilter();
|
|
@@ -1464,88 +1464,88 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1464
1464
|
Y.value && await w();
|
|
1465
1465
|
});
|
|
1466
1466
|
function Z() {
|
|
1467
|
-
|
|
1467
|
+
r.create(null);
|
|
1468
1468
|
}
|
|
1469
|
-
const
|
|
1469
|
+
const ne = () => {
|
|
1470
1470
|
Y.value && w();
|
|
1471
|
-
}, { t: G } = Ie(), K =
|
|
1471
|
+
}, { t: G } = Ie(), K = x(() => {
|
|
1472
1472
|
var R, $;
|
|
1473
1473
|
return ($ = (R = e.currentCatalog) == null ? void 0 : R.linkItemRules) == null ? void 0 : $.length;
|
|
1474
1474
|
}), {
|
|
1475
1475
|
menuItems: D,
|
|
1476
1476
|
categories: H,
|
|
1477
1477
|
linkItemRules: J,
|
|
1478
|
-
handleSubmit:
|
|
1478
|
+
handleSubmit: re,
|
|
1479
1479
|
catalogManager: Q,
|
|
1480
1480
|
schedulerManager: se
|
|
1481
1481
|
} = kt(!1);
|
|
1482
1482
|
return (R, $) => {
|
|
1483
1483
|
const P = O("fm-button");
|
|
1484
|
-
return
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1484
|
+
return t(z).length ? (d(), k("div", ea, [
|
|
1485
|
+
b("div", ta, [
|
|
1486
|
+
b("div", la, [
|
|
1487
|
+
t(Y) ? (d(), I(Xl, {
|
|
1488
1488
|
key: 0,
|
|
1489
1489
|
ref_key: "productTableRef",
|
|
1490
1490
|
ref: S,
|
|
1491
1491
|
"is-calculating": f.value,
|
|
1492
|
-
"model-value":
|
|
1493
|
-
"original-value":
|
|
1494
|
-
"onUpdate:modelValue": $[1] || ($[1] = (A) =>
|
|
1495
|
-
"onReset:modelValue":
|
|
1492
|
+
"model-value": _.value,
|
|
1493
|
+
"original-value": h.value,
|
|
1494
|
+
"onUpdate:modelValue": $[1] || ($[1] = (A) => _.value = A),
|
|
1495
|
+
"onReset:modelValue": ne,
|
|
1496
1496
|
"onUpdate:editing": $[2] || ($[2] = (A) => v.value = A)
|
|
1497
1497
|
}, {
|
|
1498
1498
|
filter: T(() => [
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
K.value ? (
|
|
1499
|
+
c(He, { onToggleAttributeFilter: oe }),
|
|
1500
|
+
s.value.multiScheduler ? (d(), I(qe, { key: 0 })) : U("", !0),
|
|
1501
|
+
K.value ? (d(), I(Le, {
|
|
1502
1502
|
key: 1,
|
|
1503
|
-
"current-restaurant-attr-params":
|
|
1504
|
-
onConfirm: $[0] || ($[0] = (A) =>
|
|
1503
|
+
"current-restaurant-attr-params": t(e).state.currentRestaurantAttrParams,
|
|
1504
|
+
onConfirm: $[0] || ($[0] = (A) => t(e).setRestaurantAttrParams(A))
|
|
1505
1505
|
}, null, 8, ["current-restaurant-attr-params"])) : U("", !0)
|
|
1506
1506
|
]),
|
|
1507
1507
|
_: 1
|
|
1508
1508
|
}, 8, ["is-calculating", "model-value", "original-value"])) : U("", !0)
|
|
1509
1509
|
])
|
|
1510
1510
|
])
|
|
1511
|
-
])) : (
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
K.value ? (
|
|
1511
|
+
])) : (d(), k("div", aa, [
|
|
1512
|
+
b("div", oa, [
|
|
1513
|
+
c(He),
|
|
1514
|
+
s.value.multiScheduler ? (d(), I(qe, { key: 0 })) : U("", !0),
|
|
1515
|
+
K.value ? (d(), I(Le, {
|
|
1516
1516
|
key: 1,
|
|
1517
|
-
"current-restaurant-attr-params":
|
|
1518
|
-
onConfirm: $[3] || ($[3] = (A) =>
|
|
1517
|
+
"current-restaurant-attr-params": t(e).state.currentRestaurantAttrParams,
|
|
1518
|
+
onConfirm: $[3] || ($[3] = (A) => t(e).setRestaurantAttrParams(A))
|
|
1519
1519
|
}, null, 8, ["current-restaurant-attr-params"])) : U("", !0)
|
|
1520
1520
|
]),
|
|
1521
|
-
|
|
1521
|
+
m.value.create ? (d(), I(be, {
|
|
1522
1522
|
key: 0,
|
|
1523
1523
|
action: {
|
|
1524
|
-
text:
|
|
1524
|
+
text: t(G)("menu.product.empty.with_create.action"),
|
|
1525
1525
|
callback: Z
|
|
1526
1526
|
},
|
|
1527
|
-
subtitle:
|
|
1528
|
-
title:
|
|
1529
|
-
}, null, 8, ["action", "subtitle", "title"])) :
|
|
1527
|
+
subtitle: t(G)("menu.product.empty.with_create.subtitle"),
|
|
1528
|
+
title: t(G)("menu.product.empty.with_create.title")
|
|
1529
|
+
}, null, 8, ["action", "subtitle", "title"])) : a.value ? (d(), I(be, {
|
|
1530
1530
|
key: 1,
|
|
1531
|
-
subtitle:
|
|
1532
|
-
title:
|
|
1531
|
+
subtitle: t(G)("menu.product.empty.no_scheduler.subtitle"),
|
|
1532
|
+
title: t(G)("menu.product.empty.no_scheduler.title")
|
|
1533
1533
|
}, {
|
|
1534
1534
|
action: T(() => [
|
|
1535
|
-
|
|
1536
|
-
"categorized-items":
|
|
1537
|
-
"initial-value":
|
|
1535
|
+
c(Ge, {
|
|
1536
|
+
"categorized-items": t(Q).linkableItems.value,
|
|
1537
|
+
"initial-value": t(Q).currentItems.value,
|
|
1538
1538
|
"show-variant": !1,
|
|
1539
|
-
"menu-items":
|
|
1540
|
-
categories:
|
|
1541
|
-
"link-item-rules":
|
|
1542
|
-
"no-scheduler":
|
|
1539
|
+
"menu-items": t(D),
|
|
1540
|
+
categories: t(H),
|
|
1541
|
+
"link-item-rules": t(J),
|
|
1542
|
+
"no-scheduler": a.value,
|
|
1543
1543
|
"is-local-only": !0,
|
|
1544
|
-
onSubmit:
|
|
1544
|
+
onSubmit: t(re)
|
|
1545
1545
|
}, {
|
|
1546
1546
|
default: T(({ trigger: A }) => [
|
|
1547
|
-
|
|
1548
|
-
label:
|
|
1547
|
+
c(P, {
|
|
1548
|
+
label: t(G)("menu.common.actions.link_product"),
|
|
1549
1549
|
"prepend-icon": "link",
|
|
1550
1550
|
onClick: A
|
|
1551
1551
|
}, null, 8, ["label", "onClick"])
|
|
@@ -1554,26 +1554,26 @@ const Ye = /* @__PURE__ */ B({
|
|
|
1554
1554
|
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])
|
|
1555
1555
|
]),
|
|
1556
1556
|
_: 1
|
|
1557
|
-
}, 8, ["subtitle", "title"])) : (
|
|
1557
|
+
}, 8, ["subtitle", "title"])) : (d(), I(be, {
|
|
1558
1558
|
key: 2,
|
|
1559
|
-
subtitle:
|
|
1560
|
-
title:
|
|
1559
|
+
subtitle: t(G)("menu.product.empty.with_scheduler.subtitle"),
|
|
1560
|
+
title: t(G)("menu.product.empty.with_scheduler.title")
|
|
1561
1561
|
}, {
|
|
1562
1562
|
action: T(() => [
|
|
1563
|
-
|
|
1564
|
-
"categorized-items":
|
|
1565
|
-
"initial-value":
|
|
1563
|
+
c(Ge, {
|
|
1564
|
+
"categorized-items": t(se).linkableItems.value,
|
|
1565
|
+
"initial-value": t(se).currentItems.value,
|
|
1566
1566
|
"show-variant": !1,
|
|
1567
|
-
"menu-items":
|
|
1568
|
-
categories:
|
|
1569
|
-
"link-item-rules":
|
|
1570
|
-
"no-scheduler":
|
|
1567
|
+
"menu-items": t(D),
|
|
1568
|
+
categories: t(H),
|
|
1569
|
+
"link-item-rules": t(J),
|
|
1570
|
+
"no-scheduler": a.value,
|
|
1571
1571
|
"is-local-only": !0,
|
|
1572
|
-
onSubmit:
|
|
1572
|
+
onSubmit: t(re)
|
|
1573
1573
|
}, {
|
|
1574
1574
|
default: T(({ trigger: A }) => [
|
|
1575
|
-
|
|
1576
|
-
label:
|
|
1575
|
+
c(P, {
|
|
1576
|
+
label: t(G)("menu.common.actions.apply_product"),
|
|
1577
1577
|
onClick: A
|
|
1578
1578
|
}, null, 8, ["label", "onClick"])
|
|
1579
1579
|
]),
|