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