@feedmepos/mf-menu 0.32.44 → 0.32.45
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-BXkiQoTM.js → App-CczmyQeJ.js} +1471 -1458
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BoSL4dm7.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BscsJpMV.js} +3 -3
- package/dist/{Catalog-CLFVLyor.js → Catalog-RU_6keJm.js} +6 -6
- package/dist/{Category-CNuVHuI3.js → Category-7Fg2kD0h.js} +79 -79
- package/dist/{Category-BdyouDU8.js → Category-CwEXbsDv.js} +4 -4
- package/dist/{CookingGuide-Bed7bUt1.js → CookingGuide-DFu5VStf.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CZDL2xJC.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CeNfLbfq.js} +1 -1
- package/dist/{Group-TUqCPmO3.js → Group-C6vQeBnj.js} +1 -1
- package/dist/{Group-D4UTsIxI.js → Group-l-YpAi6B.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BJPT8flL.js → Group.vue_vue_type_script_setup_true_lang-1UdOBdv-.js} +165 -165
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D83liryu.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C309DrLU.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CRIRinHB.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-C903fhuj.js} +6 -6
- package/dist/{Ingredient-CcxoeuDd.js → Ingredient-CHqDo-GY.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-58tyxdVh.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CXHHlrI0.js} +2 -2
- package/dist/{LinkProductSideSheet-DazOkwkd.js → LinkProductSideSheet-DY32g33Q.js} +3 -3
- package/dist/{MenuSetting-B3oLll4C.js → MenuSetting-DhbxlKuU.js} +5 -5
- package/dist/{PrintRoute-D878qPu8.js → PrintRoute-CToZ0ClG.js} +4 -4
- package/dist/{Product-DOC8y_mW.js → Product-Cpg32wpg.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-tZyBhWYT.js → Product.vue_vue_type_script_setup_true_lang-BC2KG1q4.js} +440 -438
- package/dist/{ProductInternalTools-9TgIc2bR.js → ProductInternalTools-wH9BN1NK.js} +5 -5
- package/dist/Products-CpINHaH6.js +291 -0
- package/dist/{Publish-BktK_PKq.js → Publish-CJS_836k.js} +3 -3
- package/dist/{Recipe-eA0xrGYk.js → Recipe-Cz7hivmM.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-t8M7z09s.js → RuleView.vue_vue_type_script_setup_true_lang-CRLzqgQe.js} +207 -207
- package/dist/{Scheduler-CKSqPZLQ.js → Scheduler-QuWCnEJw.js} +3 -3
- package/dist/{ServingSequence-Ea20baNj.js → ServingSequence-CqK5Sjmq.js} +3 -3
- package/dist/{Setting-u6lX_Dzg.js → Setting-C3tKUfsm.js} +5 -5
- package/dist/{Subcategory-C6s7OMOb.js → Subcategory-DCtTOPUj.js} +99 -100
- package/dist/{Takeaway-lWxS9oWe.js → Takeaway-BnB1OFnK.js} +1 -1
- package/dist/{Takeaway-B9kr-Nf4.js → Takeaway-Fi8SAH2t.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-oA0e9oI5.js → Takeaway.vue_vue_type_script_setup_true_lang-Cbz7Qt_g.js} +91 -91
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-T40ChY7j.js → Thumbnail.vue_vue_type_script_setup_true_lang-CPM_muXB.js} +4 -4
- package/dist/TranslationFieldSection.vue_vue_type_script_setup_true_lang-BpL8UrFY.js +278 -0
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-DtkzQeq4.js +140 -0
- package/dist/TranslationViewChip.vue_vue_type_script_setup_true_lang-CHT7Xozn.js +60 -0
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B1e3d-uX.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DoIgiwHh.js} +13 -13
- package/dist/{Unit-DkQlUg2l.js → Unit-5yE2-y9D.js} +2 -2
- package/dist/Variant-C7lIdRID.js +248 -0
- package/dist/{_id_-_oqk-OhC.js → _id_-08ykp97a.js} +9 -9
- package/dist/{app-CfCYl2pO.js → app-CA4g3v2n.js} +26 -26
- package/dist/{app-DIYHNWEw.js → app-DPovSnb_.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/components/translation/LanguageChip.vue.d.ts +18 -0
- package/dist/apps/mf-menu/src/components/translation/LanguageSelector.vue.d.ts +33 -0
- package/dist/apps/mf-menu/src/components/translation/LocaleIconBadge.vue.d.ts +29 -0
- package/dist/apps/mf-menu/src/components/translation/TranslationFieldRow.vue.d.ts +39 -0
- package/dist/apps/mf-menu/src/components/translation/TranslationViewChip.vue.d.ts +15 -0
- package/dist/apps/mf-menu/src/composable/translationLanguages.d.ts +16 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
- package/dist/apps/mf-menu/src/utils/translation.d.ts +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-AoXjo9FF.js → linked-status-WT6deoPw.js} +2 -2
- package/dist/assets/{menu-export-BHcaWhM3.js → menu-export-DxtFXMED.js} +2 -2
- package/dist/assets/{override-menu-B9xQcjuJ.js → override-menu-BJGRdWWE.js} +2 -2
- package/dist/assets/{validate-menu-D-ezd4W8.js → validate-menu-B_tmkHe7.js} +2 -2
- package/dist/{catalog-CvN9Wu8V.js → catalog-D7Jjqj3-.js} +1 -1
- package/dist/{catalogSetting-qS5Np22q.js → catalogSetting-Bg_zMUrV.js} +1 -1
- package/dist/{currency-Nxod6uwl.js → currency-DDxFMjAI.js} +1 -1
- package/dist/{dayjs.min-B1AjAGva.js → dayjs.min-BVOO8wJG.js} +1 -1
- package/dist/{index-Cq-czJjU.js → index-BlLRjkMF.js} +8 -7
- package/dist/{index-nKlYiotY.js → index-CG7GFWlC.js} +1 -1
- package/dist/index-Cq2MVpMv.js +472 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-YXKayPEp.js → index.vue_vue_type_script_setup_true_lang-C6IVvAua.js} +169 -168
- package/dist/{item-CUZSonzT.js → item-Bq6SCc7D.js} +3250 -3386
- package/dist/{jszip.min-BnkZQ6lD.js → jszip.min-1MrCGuHF.js} +2 -2
- package/dist/{menu-BP_ArXCI.js → menu-CKA9uouu.js} +1 -1
- package/dist/{menuV2-BGEYgQ8-.js → menuV2-DBkrmeha.js} +71 -71
- package/dist/{priceTier-B-Qa0xaO.js → priceTier-Cxr9IcVP.js} +1 -1
- package/dist/{rules-Dchd_ilF.js → rules-DFWR7a3m.js} +4 -4
- package/dist/{scheduler-DN7ZGLk8.js → scheduler-HKff8Ty2.js} +4 -4
- package/dist/{toExcel-jHmkDqcm.js → toExcel-DopYrxBW.js} +2 -2
- package/dist/{unit-DgL56pkI.js → unit-5G600HMJ.js} +2 -2
- package/package.json +1 -1
- package/dist/Products-DfUGnHmD.js +0 -1568
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-CcIGCUwk.js +0 -194
- package/dist/Variant-BF5r2WLL.js +0 -247
- package/dist/index-C0Zw1cSS.js +0 -545
- package/dist/translation-Cdap0IVg.js +0 -79
- /package/dist/apps/mf-menu/src/components/{TranslationBadge.vue.d.ts → translation/TranslationBadge.vue.d.ts} +0 -0
- /package/dist/apps/mf-menu/src/components/{TranslationFieldSection.vue.d.ts → translation/TranslationFieldSection.vue.d.ts} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { ref as F, computed as
|
|
2
|
-
import { u as Fe, T as Ce, B as me, I as Re, J as ge, V as
|
|
3
|
-
import { useI18n as Ie, useCoreStore as
|
|
4
|
-
import { u as Se } from "./menu-
|
|
5
|
-
import { L as Ge } from "./LinkProductSideSheet-
|
|
6
|
-
import { r as
|
|
7
|
-
import { _ as Me, a as qe } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import { _ as Ue, u as kt } from "./Thumbnail.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { f as
|
|
10
|
-
import { u as
|
|
11
|
-
import { b as We, H as
|
|
12
|
-
import { useBreakpoints as
|
|
13
|
-
import { F as
|
|
14
|
-
import { _ as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { _ as
|
|
17
|
-
import { r as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
function Bt(
|
|
23
|
-
const n = F(!0), t =
|
|
1
|
+
import { ref as F, computed as h, defineComponent as j, resolveComponent as N, createBlock as I, openBlock as m, withCtx as T, createElementVNode as g, createVNode as d, unref as o, createElementBlock as w, Fragment as pe, renderList as ke, createCommentVNode as M, normalizeClass as ve, toDisplayString as K, withModifiers as fe, mergeModels as Xe, useModel as et, renderSlot as _e, watch as de, createTextVNode as tt, watchEffect as lt, nextTick as Ae, resolveDynamicComponent as at, onMounted as ot, h as O, isRef as je, normalizeStyle as gt } from "vue";
|
|
2
|
+
import { u as Fe, T as Ce, B as me, I as Re, J as ge, V as bt, ae as _t, af as yt, ag as Pe, ah as ht, R as xt, a4 as be, ai as Ee } from "./index.vue_vue_type_script_setup_true_lang-C6IVvAua.js";
|
|
3
|
+
import { useI18n as Ie, useCoreStore as ze, useCustomAttributes as Ct } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as Se } from "./menu-CKA9uouu.js";
|
|
5
|
+
import { L as Ge } from "./LinkProductSideSheet-DY32g33Q.js";
|
|
6
|
+
import { r as wt, _ as Le } from "./index-CG7GFWlC.js";
|
|
7
|
+
import { _ as Me, a as qe } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-CeNfLbfq.js";
|
|
8
|
+
import { _ as Ue, u as kt } from "./Thumbnail.vue_vue_type_script_setup_true_lang-CPM_muXB.js";
|
|
9
|
+
import { f as St, o as Vt, a as Ft, m as It } from "./menuV2-DBkrmeha.js";
|
|
10
|
+
import { u as rt, C as $t } from "./item-Bq6SCc7D.js";
|
|
11
|
+
import { b as We, H as Tt } from "./app-5fxKLAzS.js";
|
|
12
|
+
import { useBreakpoints as nt, components as te, useDialog as Pt, FmButtonColorThemeVariant as W, FmButtonVariant as ee } from "@feedmepos/ui-library";
|
|
13
|
+
import { F as At } from "./index-CisutoS9.js";
|
|
14
|
+
import { _ as De, a as Rt } from "./app-CA4g3v2n.js";
|
|
15
|
+
import { _ as we } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
16
|
+
import { _ as Mt } from "./index-BlLRjkMF.js";
|
|
17
|
+
import { r as Ut, _ as zt } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-C903fhuj.js";
|
|
18
|
+
import { _ as He } from "./TranslationViewChip.vue_vue_type_script_setup_true_lang-CHT7Xozn.js";
|
|
19
|
+
import { c as Dt } from "./check-C9mY6LiX.js";
|
|
20
|
+
import { f as Ot } from "./currency-DDxFMjAI.js";
|
|
21
|
+
import { w as Nt } from "./tooltip-B5BiPMx9.js";
|
|
22
|
+
function Bt(C, e, i = C) {
|
|
23
|
+
const n = F(!0), t = h(() => {
|
|
24
24
|
if (!n.value && !e.value)
|
|
25
25
|
return !0;
|
|
26
26
|
if (e.value && e.value.length > 0) {
|
|
@@ -28,9 +28,9 @@ function Bt(k, e, i = k) {
|
|
|
28
28
|
return e.value.length === f.length && e.value.every((s) => f.includes(s));
|
|
29
29
|
}
|
|
30
30
|
return !1;
|
|
31
|
-
}), u =
|
|
31
|
+
}), u = h(() => {
|
|
32
32
|
var f, s, b, y;
|
|
33
|
-
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 =
|
|
33
|
+
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));
|
|
34
34
|
});
|
|
35
35
|
return { allCleared: n, allSelected: t, indeterminate: u, toggleAll: () => {
|
|
36
36
|
if (t.value) {
|
|
@@ -38,45 +38,45 @@ function Bt(k, e, i = k) {
|
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
const f = i.value.map((s) => s.value);
|
|
41
|
-
f.length ===
|
|
41
|
+
f.length === C.value.length ? (e.value = void 0, n.value = !1) : (e.value = f, n.value = !1);
|
|
42
42
|
}, toggleOption: (f) => {
|
|
43
|
-
var b, y,
|
|
43
|
+
var b, y, k;
|
|
44
44
|
let s;
|
|
45
|
-
e.value === void 0 && n.value ? s = [f] : e.value === void 0 && !n.value ? s = (b =
|
|
45
|
+
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 = (k = e.value) == null ? void 0 : k.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;
|
|
46
46
|
} };
|
|
47
47
|
}
|
|
48
|
-
const Kt = { class: "inline-flex items-center" },
|
|
48
|
+
const Kt = { class: "inline-flex items-center" }, jt = {
|
|
49
49
|
key: 0,
|
|
50
50
|
class: /* @__PURE__ */ ve([
|
|
51
51
|
"fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
|
|
52
52
|
"text-fm-color-neutral-gray-400"
|
|
53
53
|
])
|
|
54
|
-
}, Et = { class: "p-4" }, Gt = { class: "flex-1 overflow-y-auto min-h-0" },
|
|
54
|
+
}, Et = { class: "p-4" }, Gt = { class: "flex-1 overflow-y-auto min-h-0" }, Qe = /* @__PURE__ */ j({
|
|
55
55
|
__name: "CategorySelector",
|
|
56
56
|
emits: ["toggleAttributeFilter"],
|
|
57
|
-
setup(
|
|
58
|
-
const i = e, n = Fe(), { categories: t, selectedCategories: u } = Se(), l =
|
|
57
|
+
setup(C, { emit: e }) {
|
|
58
|
+
const i = e, n = Fe(), { categories: t, selectedCategories: u } = Se(), l = h(() => n.state.currentCategoryIds), v = h(
|
|
59
59
|
() => t.value.map((B) => ({ label: B.name, value: B.id }))
|
|
60
|
-
), f =
|
|
60
|
+
), f = h(() => v.value.filter(
|
|
61
61
|
(B) => B.label.toLowerCase().includes(y.value.toLowerCase())
|
|
62
|
-
)), { t: s } = Ie(), b =
|
|
63
|
-
var B,
|
|
64
|
-
return t.value.length === ((B = u.value) == null ? void 0 : B.length) ? s("menu.category.selector.all") : ((
|
|
65
|
-
}), y = F(""),
|
|
62
|
+
)), { t: s } = Ie(), b = h(() => {
|
|
63
|
+
var B, D, H;
|
|
64
|
+
return t.value.length === ((B = u.value) == null ? void 0 : B.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}`;
|
|
65
|
+
}), y = F(""), k = h({
|
|
66
66
|
get: () => l.value,
|
|
67
67
|
set: (B) => {
|
|
68
68
|
n.selectCategory(B);
|
|
69
69
|
}
|
|
70
|
-
}), { allSelected:
|
|
70
|
+
}), { allSelected: z, toggleAll: Y, toggleOption: S, indeterminate: oe } = Bt(
|
|
71
71
|
v,
|
|
72
|
-
|
|
72
|
+
k,
|
|
73
73
|
f
|
|
74
|
-
), J =
|
|
74
|
+
), J = ze(), re = h(() => J.itemAttributeSettings.value.length > 0);
|
|
75
75
|
function L() {
|
|
76
76
|
i("toggleAttributeFilter");
|
|
77
77
|
}
|
|
78
|
-
return (B,
|
|
79
|
-
const H =
|
|
78
|
+
return (B, D) => {
|
|
79
|
+
const H = N("FmIcon"), Z = N("FmChip"), ne = N("FmSearch"), Q = N("FmMenuItem"), se = N("FmMenu");
|
|
80
80
|
return m(), I(se, {
|
|
81
81
|
"close-on-click": !1,
|
|
82
82
|
width: 220
|
|
@@ -85,7 +85,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
85
85
|
g("div", Kt, [
|
|
86
86
|
d(Z, null, {
|
|
87
87
|
default: T(() => [
|
|
88
|
-
b.value ? (m(), w("div",
|
|
88
|
+
b.value ? (m(), w("div", jt, K(o(s)("menu.category.selector.title", { label: b.value })), 1)) : M("", !0),
|
|
89
89
|
d(H, {
|
|
90
90
|
color: "neutral-gray-400",
|
|
91
91
|
name: "expand_more",
|
|
@@ -101,7 +101,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
101
101
|
outline: "",
|
|
102
102
|
color: "neutral-gray-400",
|
|
103
103
|
size: "sm",
|
|
104
|
-
onClick:
|
|
104
|
+
onClick: D[0] || (D[0] = fe(() => {
|
|
105
105
|
}, ["prevent"]))
|
|
106
106
|
})
|
|
107
107
|
])) : M("", !0)
|
|
@@ -115,26 +115,26 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
115
115
|
d(ne, {
|
|
116
116
|
autofocus: "",
|
|
117
117
|
modelValue: y.value,
|
|
118
|
-
"onUpdate:modelValue":
|
|
119
|
-
placeholder:
|
|
118
|
+
"onUpdate:modelValue": D[1] || (D[1] = (R) => y.value = R),
|
|
119
|
+
placeholder: o(s)("menu.common.actions.search")
|
|
120
120
|
}, null, 8, ["modelValue", "placeholder"])
|
|
121
121
|
]),
|
|
122
122
|
g("div", Gt, [
|
|
123
123
|
d(Q, {
|
|
124
124
|
label: "All",
|
|
125
125
|
"has-checkbox": "",
|
|
126
|
-
"model-value":
|
|
127
|
-
indeterminate:
|
|
128
|
-
onClick:
|
|
126
|
+
"model-value": o(z),
|
|
127
|
+
indeterminate: o(oe),
|
|
128
|
+
onClick: o(Y)
|
|
129
129
|
}, null, 8, ["model-value", "indeterminate", "onClick"]),
|
|
130
|
-
(m(!0), w(pe, null,
|
|
130
|
+
(m(!0), w(pe, null, ke(f.value, (R) => {
|
|
131
131
|
var $;
|
|
132
132
|
return m(), 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": o(z) || (($ = k.value) == null ? void 0 : $.includes(R.value)),
|
|
137
|
+
onClick: (P) => o(S)(R.value)
|
|
138
138
|
}, null, 8, ["label", "model-value", "onClick"]);
|
|
139
139
|
}), 128))
|
|
140
140
|
])
|
|
@@ -149,14 +149,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
149
149
|
}, Yt = { key: 0 }, Jt = {
|
|
150
150
|
key: 1,
|
|
151
151
|
class: "inline-block w-8"
|
|
152
|
-
}, Zt = { key: 0 }, Xt = { key: 1 },
|
|
152
|
+
}, Zt = { key: 0 }, Xt = { key: 1 }, Ye = /* @__PURE__ */ j({
|
|
153
153
|
__name: "CategoriesChip",
|
|
154
154
|
props: {
|
|
155
155
|
categories: { default: () => [] },
|
|
156
156
|
ellipsis: { type: Boolean, default: !0 }
|
|
157
157
|
},
|
|
158
|
-
setup(
|
|
159
|
-
const e =
|
|
158
|
+
setup(C) {
|
|
159
|
+
const e = C, { t: i } = Ie(), n = nt(), 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(() => {
|
|
160
160
|
if (v.value) {
|
|
161
161
|
const b = l.value.join(", ");
|
|
162
162
|
return b.length > 20 ? b.slice(0, 20) + "..." : b;
|
|
@@ -164,18 +164,18 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
164
164
|
return e.categories.join(", ");
|
|
165
165
|
});
|
|
166
166
|
return (s, b) => {
|
|
167
|
-
const y =
|
|
167
|
+
const y = N("FmTooltip");
|
|
168
168
|
return t.value ? (m(), w(pe, { key: 1 }, [
|
|
169
169
|
s.categories.length > 0 ? (m(), w("p", Qt, [
|
|
170
|
-
g("span", null, K(
|
|
170
|
+
g("span", null, K(o(i)("menu.product.table.columns.category")) + ": ", 1),
|
|
171
171
|
g("span", null, K(f.value), 1),
|
|
172
172
|
v.value ? (m(), w("span", Jt)) : (m(), w("br", Yt)),
|
|
173
173
|
s.categories.length > u.value ? (m(), w("span", {
|
|
174
174
|
key: 2,
|
|
175
175
|
class: "fm-typo-en-body-md-400 text-fm-color-primary cursor-pointer",
|
|
176
|
-
onClick: b[0] || (b[0] = fe((
|
|
176
|
+
onClick: b[0] || (b[0] = fe((k) => v.value = !v.value, ["stop", "prevent"]))
|
|
177
177
|
}, [
|
|
178
|
-
v.value ? (m(), w("span", Zt, K(
|
|
178
|
+
v.value ? (m(), w("span", Zt, K(o(i)("menu.product.table.category.expand", { count: s.categories.length - u.value })), 1)) : (m(), w("span", Xt, K(o(i)("menu.product.table.category.collapse")), 1))
|
|
179
179
|
])) : M("", !0)
|
|
180
180
|
])) : M("", !0)
|
|
181
181
|
], 64)) : (m(), I(y, {
|
|
@@ -187,11 +187,11 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
187
187
|
}, {
|
|
188
188
|
content: T(() => [
|
|
189
189
|
g("div", qt, [
|
|
190
|
-
g("p", Wt, K(
|
|
190
|
+
g("p", Wt, K(o(i)("menu.product.table.category.all")), 1),
|
|
191
191
|
g("div", Ht, [
|
|
192
|
-
(m(!0), w(pe, null,
|
|
193
|
-
key:
|
|
194
|
-
label:
|
|
192
|
+
(m(!0), w(pe, null, ke(e.categories, (k) => (m(), I(we, {
|
|
193
|
+
key: k,
|
|
194
|
+
label: k,
|
|
195
195
|
variant: "neutral"
|
|
196
196
|
}, null, 8, ["label"]))), 128))
|
|
197
197
|
])
|
|
@@ -199,12 +199,12 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
199
199
|
]),
|
|
200
200
|
default: T(() => [
|
|
201
201
|
g("div", Lt, [
|
|
202
|
-
(m(!0), w(pe, null,
|
|
203
|
-
key:
|
|
204
|
-
label:
|
|
202
|
+
(m(!0), w(pe, null, ke(l.value, (k) => (m(), I(we, {
|
|
203
|
+
key: k,
|
|
204
|
+
label: k,
|
|
205
205
|
variant: "neutral"
|
|
206
206
|
}, null, 8, ["label"]))), 128)),
|
|
207
|
-
s.categories.length > u.value ? (m(), I(
|
|
207
|
+
s.categories.length > u.value ? (m(), I(we, {
|
|
208
208
|
key: 0,
|
|
209
209
|
label: "...",
|
|
210
210
|
variant: "neutral"
|
|
@@ -215,9 +215,9 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
215
215
|
}));
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
|
-
}), el = /* @__PURE__ */
|
|
218
|
+
}), el = /* @__PURE__ */ j({
|
|
219
219
|
__name: "ProductSearcher",
|
|
220
|
-
props: /* @__PURE__ */
|
|
220
|
+
props: /* @__PURE__ */ Xe({
|
|
221
221
|
label: {},
|
|
222
222
|
helperText: {},
|
|
223
223
|
menu: {}
|
|
@@ -226,13 +226,13 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
226
226
|
modelModifiers: {}
|
|
227
227
|
}),
|
|
228
228
|
emits: ["update:modelValue"],
|
|
229
|
-
setup(
|
|
230
|
-
const e =
|
|
229
|
+
setup(C) {
|
|
230
|
+
const e = C, i = et(C, "modelValue"), n = h(() => e.menu.modules.item.map((t) => ({
|
|
231
231
|
label: t.code ? `${t.code} ${t.name}` : t.name,
|
|
232
232
|
value: t._id
|
|
233
233
|
})));
|
|
234
234
|
return (t, u) => {
|
|
235
|
-
const l =
|
|
235
|
+
const l = N("FmSelect");
|
|
236
236
|
return m(), I(l, {
|
|
237
237
|
modelValue: i.value,
|
|
238
238
|
"onUpdate:modelValue": u[0] || (u[0] = (v) => i.value = v),
|
|
@@ -248,9 +248,9 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
248
248
|
}), tl = { class: "flex" }, ll = { class: "w-[260px] space-y-16 h-full" }, al = { class: "flex items-center gap-4 px-8" }, ol = { class: "fm-typo-en-title-sm-600" }, rl = {
|
|
249
249
|
key: 0,
|
|
250
250
|
class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4"
|
|
251
|
-
}, nl = { class: "fm-typo-en-body-md-600" }, sl = { class: "flex-1" },
|
|
251
|
+
}, nl = { class: "fm-typo-en-body-md-600" }, sl = { class: "flex-1" }, st = /* @__PURE__ */ j({
|
|
252
252
|
__name: "ViewLayout",
|
|
253
|
-
props: /* @__PURE__ */
|
|
253
|
+
props: /* @__PURE__ */ Xe({
|
|
254
254
|
title: {},
|
|
255
255
|
titleBadge: {},
|
|
256
256
|
items: {}
|
|
@@ -259,10 +259,10 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
259
259
|
modelModifiers: {}
|
|
260
260
|
}),
|
|
261
261
|
emits: ["update:modelValue"],
|
|
262
|
-
setup(
|
|
263
|
-
const e =
|
|
262
|
+
setup(C) {
|
|
263
|
+
const e = et(C, "modelValue");
|
|
264
264
|
return (i, n) => {
|
|
265
|
-
const t =
|
|
265
|
+
const t = N("FmCollapsibleTabs");
|
|
266
266
|
return m(), w("div", tl, [
|
|
267
267
|
g("div", ll, [
|
|
268
268
|
g("div", al, [
|
|
@@ -271,7 +271,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
271
271
|
g("p", nl, K(i.titleBadge), 1)
|
|
272
272
|
])) : M("", !0)
|
|
273
273
|
]),
|
|
274
|
-
d(
|
|
274
|
+
d(De, null, {
|
|
275
275
|
default: T(() => [
|
|
276
276
|
d(t, {
|
|
277
277
|
modelValue: e.value,
|
|
@@ -289,28 +289,28 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
289
289
|
]);
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
|
-
}), Ve = /* @__PURE__ */
|
|
292
|
+
}), Ve = /* @__PURE__ */ j({
|
|
293
293
|
__name: "OrderFromChip",
|
|
294
294
|
props: {
|
|
295
295
|
orderFrom: {}
|
|
296
296
|
},
|
|
297
|
-
setup(
|
|
298
|
-
const e =
|
|
297
|
+
setup(C) {
|
|
298
|
+
const e = C, i = Ce();
|
|
299
299
|
return (n, t) => {
|
|
300
300
|
var u, l;
|
|
301
|
-
return m(), I(
|
|
302
|
-
label: ((u =
|
|
303
|
-
variant: (l =
|
|
301
|
+
return m(), I(we, {
|
|
302
|
+
label: ((u = o(i)[e.orderFrom]) == null ? void 0 : u.label) || e.orderFrom,
|
|
303
|
+
variant: (l = o(i)[e.orderFrom]) == null ? void 0 : l.variant
|
|
304
304
|
}, null, 8, ["label", "variant"]);
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
}), ul = /* @__PURE__ */
|
|
307
|
+
}), ul = /* @__PURE__ */ j({
|
|
308
308
|
__name: "GroupViewTable",
|
|
309
309
|
props: {
|
|
310
310
|
data: {}
|
|
311
311
|
},
|
|
312
|
-
setup(
|
|
313
|
-
const e =
|
|
312
|
+
setup(C) {
|
|
313
|
+
const e = C, i = [{
|
|
314
314
|
accessorKey: "code",
|
|
315
315
|
header: () => "Code",
|
|
316
316
|
enableSorting: !1,
|
|
@@ -325,7 +325,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
325
325
|
variant: "tertiary",
|
|
326
326
|
class: ["cursor-pointer", "transition-transform", l.getIsExpanded() ? "transform rotate-180" : ""],
|
|
327
327
|
onClick: l.getToggleExpandedHandler()
|
|
328
|
-
}, null),
|
|
328
|
+
}, null), tt("Found in group: "), v.groupName]) : v.code;
|
|
329
329
|
},
|
|
330
330
|
meta: {
|
|
331
331
|
colspan: (l) => l.original.subRows ? 5 : 1
|
|
@@ -371,8 +371,8 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
371
371
|
return de(() => e.data, () => {
|
|
372
372
|
u();
|
|
373
373
|
}), (l, v) => {
|
|
374
|
-
const f =
|
|
375
|
-
return m(), I(
|
|
374
|
+
const f = N("FmTable");
|
|
375
|
+
return m(), I(De, null, {
|
|
376
376
|
default: T(() => [d(f, {
|
|
377
377
|
"column-defs": i,
|
|
378
378
|
"row-data": l.data,
|
|
@@ -387,24 +387,24 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
387
387
|
});
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
|
-
}), il = /* @__PURE__ */
|
|
390
|
+
}), il = /* @__PURE__ */ j({
|
|
391
391
|
__name: "GroupView",
|
|
392
392
|
props: {
|
|
393
393
|
itemId: {},
|
|
394
394
|
menu: {}
|
|
395
395
|
},
|
|
396
|
-
setup(
|
|
397
|
-
const e =
|
|
396
|
+
setup(C) {
|
|
397
|
+
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(() => {
|
|
398
398
|
const s = t.value.find((y) => y.value === i.value);
|
|
399
399
|
return ((s == null ? void 0 : s.itemInGroup) || []).map((y) => ({
|
|
400
400
|
groupName: y.group.name,
|
|
401
|
-
subRows: y.items.map((
|
|
401
|
+
subRows: y.items.map((k) => ({
|
|
402
402
|
// @ts-ignore
|
|
403
|
-
code:
|
|
404
|
-
productName:
|
|
405
|
-
price:
|
|
406
|
-
orderFrom:
|
|
407
|
-
variant:
|
|
403
|
+
code: k.code || k.fallbackCode,
|
|
404
|
+
productName: k.combinationKey ? "" : k.name ?? "",
|
|
405
|
+
price: k.price ? me.Dinero.fromFdoDinero(k.price).toFormat() : "--",
|
|
406
|
+
orderFrom: k.orderFrom ?? void 0,
|
|
407
|
+
variant: k.combinationKey ? k.name ?? "" : void 0
|
|
408
408
|
}))
|
|
409
409
|
}));
|
|
410
410
|
});
|
|
@@ -427,14 +427,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
427
427
|
itemInGroup: []
|
|
428
428
|
}))];
|
|
429
429
|
}
|
|
430
|
-
|
|
430
|
+
h(() => t.value.find((s) => s.value === i.value));
|
|
431
431
|
async function v(s) {
|
|
432
432
|
const b = t.value.find((y) => y.catalogId === s);
|
|
433
433
|
if (b) {
|
|
434
434
|
b.badge = () => d(te.FmCircularProgress, {
|
|
435
435
|
size: "md"
|
|
436
436
|
}, null);
|
|
437
|
-
const y = await
|
|
437
|
+
const y = await St(Re(e.menu), s, e.itemId);
|
|
438
438
|
b.badge = y.length, b.disabled = y.length <= 0, b.itemInGroup = y;
|
|
439
439
|
}
|
|
440
440
|
}
|
|
@@ -447,7 +447,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
447
447
|
e.menu && e.itemId && f();
|
|
448
448
|
}, {
|
|
449
449
|
immediate: !0
|
|
450
|
-
}), (s, b) => (m(), I(
|
|
450
|
+
}), (s, b) => (m(), I(st, {
|
|
451
451
|
modelValue: i.value,
|
|
452
452
|
"onUpdate:modelValue": b[0] || (b[0] = (y) => i.value = y),
|
|
453
453
|
items: t.value,
|
|
@@ -462,7 +462,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
462
462
|
}
|
|
463
463
|
}), cl = {
|
|
464
464
|
class: "scroll-x-auto"
|
|
465
|
-
}, dl = /* @__PURE__ */
|
|
465
|
+
}, dl = /* @__PURE__ */ j({
|
|
466
466
|
__name: "ProductViewTable",
|
|
467
467
|
props: {
|
|
468
468
|
itemId: {},
|
|
@@ -470,8 +470,8 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
470
470
|
catalogId: {},
|
|
471
471
|
schedulerIds: {}
|
|
472
472
|
},
|
|
473
|
-
setup(
|
|
474
|
-
const e =
|
|
473
|
+
setup(C) {
|
|
474
|
+
const e = C, i = [{
|
|
475
475
|
accessorKey: "scheduler",
|
|
476
476
|
header: () => "Scheduler",
|
|
477
477
|
enableSorting: !1,
|
|
@@ -522,15 +522,15 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
522
522
|
var l;
|
|
523
523
|
return t(u, ((l = e.menu.modules.scheduler.find((v) => v._id === u)) == null ? void 0 : l.name) || "Unknown");
|
|
524
524
|
})], n.value.forEach(async (u) => {
|
|
525
|
-
const v = (await
|
|
525
|
+
const v = (await Vt(Re(e.menu), e.catalogId, u.schedulerId)).modules.item.find((s) => s._id === e.itemId), f = n.value.findIndex((s) => s.schedulerId === u.schedulerId);
|
|
526
526
|
if (v) {
|
|
527
527
|
const s = Re(n.value);
|
|
528
528
|
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;
|
|
529
529
|
}
|
|
530
530
|
});
|
|
531
531
|
}), (u, l) => {
|
|
532
|
-
const v =
|
|
533
|
-
return m(), I(
|
|
532
|
+
const v = N("FmTable");
|
|
533
|
+
return m(), I(De, null, {
|
|
534
534
|
default: T(() => [g("div", cl, [d(v, {
|
|
535
535
|
class: "min-w-[800px]",
|
|
536
536
|
"column-defs": i,
|
|
@@ -543,18 +543,18 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
543
543
|
});
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
}), ml = /* @__PURE__ */
|
|
546
|
+
}), ml = /* @__PURE__ */ j({
|
|
547
547
|
__name: "ProductView",
|
|
548
548
|
props: {
|
|
549
549
|
itemId: {},
|
|
550
550
|
menu: {}
|
|
551
551
|
},
|
|
552
|
-
setup(
|
|
553
|
-
const e =
|
|
554
|
-
|
|
555
|
-
i.value = await
|
|
552
|
+
setup(C) {
|
|
553
|
+
const e = C, i = F(null);
|
|
554
|
+
lt(async () => {
|
|
555
|
+
i.value = await Ft(e.menu, e.itemId), await Ae(), n.value = t.value[0].value;
|
|
556
556
|
});
|
|
557
|
-
const n = F(""), t =
|
|
557
|
+
const n = F(""), t = h(() => {
|
|
558
558
|
var f, s;
|
|
559
559
|
const l = {
|
|
560
560
|
label: "Master product",
|
|
@@ -577,8 +577,8 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
577
577
|
};
|
|
578
578
|
});
|
|
579
579
|
return [l, ...v];
|
|
580
|
-
}), u =
|
|
581
|
-
return (l, v) => (m(), I(
|
|
580
|
+
}), u = h(() => t.value.find((l) => l.value === n.value));
|
|
581
|
+
return (l, v) => (m(), I(st, {
|
|
582
582
|
modelValue: n.value,
|
|
583
583
|
"onUpdate:modelValue": v[0] || (v[0] = (f) => n.value = f),
|
|
584
584
|
items: t.value,
|
|
@@ -602,19 +602,19 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
602
602
|
}), pl = { class: "flex items-center gap-8" }, vl = { class: "space-y-4" }, fl = { class: "fm-typo-en-title-md-600" }, gl = { key: 0 }, bl = { class: "text-fm-color-typo-secondary" }, _l = {
|
|
603
603
|
key: 0,
|
|
604
604
|
class: "text-fm-color-typo-secondary"
|
|
605
|
-
}, yl = { class: "flex items-center gap-4" }, hl = /* @__PURE__ */
|
|
605
|
+
}, yl = { class: "flex items-center gap-4" }, hl = /* @__PURE__ */ j({
|
|
606
606
|
__name: "ProductBaseInfo",
|
|
607
607
|
props: {
|
|
608
608
|
itemId: {},
|
|
609
609
|
menu: {}
|
|
610
610
|
},
|
|
611
|
-
setup(
|
|
612
|
-
const e =
|
|
611
|
+
setup(C) {
|
|
612
|
+
const e = C, i = h(() => e.menu.modules.item.find((t) => t._id === e.itemId)), n = h(() => {
|
|
613
613
|
var t;
|
|
614
614
|
return me.Dinero.fromFdoDinero((t = i.value) == null ? void 0 : t.price).toFormat(!0);
|
|
615
615
|
});
|
|
616
616
|
return (t, u) => {
|
|
617
|
-
var l, v, f, s, b, y,
|
|
617
|
+
var l, v, f, s, b, y, k;
|
|
618
618
|
return m(), w("div", pl, [
|
|
619
619
|
d(Ue, {
|
|
620
620
|
alt: ((l = i.value) == null ? void 0 : l.name) ?? null,
|
|
@@ -633,7 +633,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
633
633
|
u[0] || (u[0] = g("span", null, "Tagging:", -1)),
|
|
634
634
|
d(Me, {
|
|
635
635
|
ellipsis: !1,
|
|
636
|
-
"custom-attributes": (
|
|
636
|
+
"custom-attributes": (k = i.value) == null ? void 0 : k.customAttributes
|
|
637
637
|
}, null, 8, ["custom-attributes"])
|
|
638
638
|
])
|
|
639
639
|
])) : M("", !0)
|
|
@@ -641,14 +641,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
641
641
|
]);
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
}), xl = { class: "space-y-16" }, Cl = /* @__PURE__ */
|
|
644
|
+
}), xl = { class: "space-y-16" }, Cl = /* @__PURE__ */ j({
|
|
645
645
|
__name: "ProductViewer",
|
|
646
646
|
props: {
|
|
647
647
|
itemId: {},
|
|
648
648
|
menu: {}
|
|
649
649
|
},
|
|
650
|
-
setup(
|
|
651
|
-
const e = F("product"), i =
|
|
650
|
+
setup(C) {
|
|
651
|
+
const e = F("product"), i = h(() => [
|
|
652
652
|
{
|
|
653
653
|
value: "product",
|
|
654
654
|
label: "Product",
|
|
@@ -662,7 +662,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
662
662
|
]);
|
|
663
663
|
return (n, t) => {
|
|
664
664
|
var l;
|
|
665
|
-
const u =
|
|
665
|
+
const u = N("FmTabs");
|
|
666
666
|
return m(), w("div", xl, [
|
|
667
667
|
d(hl, {
|
|
668
668
|
"item-id": n.itemId,
|
|
@@ -676,7 +676,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
676
676
|
}, null, 8, ["modelValue", "items"])
|
|
677
677
|
]),
|
|
678
678
|
g("div", null, [
|
|
679
|
-
(m(), I(
|
|
679
|
+
(m(), I(at((l = i.value.find((v) => v.value === e.value)) == null ? void 0 : l.component), {
|
|
680
680
|
"item-id": n.itemId,
|
|
681
681
|
menu: n.menu
|
|
682
682
|
}, null, 8, ["item-id", "menu"]))
|
|
@@ -684,45 +684,45 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
684
684
|
]);
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
}),
|
|
687
|
+
}), wl = { class: "space-y-24" }, kl = { key: 0 }, Sl = /* @__PURE__ */ j({
|
|
688
688
|
__name: "ProductOverview",
|
|
689
689
|
props: {
|
|
690
690
|
itemId: {},
|
|
691
691
|
showSearch: { type: Boolean, default: !1 }
|
|
692
692
|
},
|
|
693
|
-
setup(
|
|
694
|
-
const e =
|
|
695
|
-
return
|
|
693
|
+
setup(C) {
|
|
694
|
+
const e = C, i = Fe(), n = F(null);
|
|
695
|
+
return ot(() => {
|
|
696
696
|
n.value = e.itemId;
|
|
697
|
-
}), (t, u) => (m(), w("div",
|
|
698
|
-
t.showSearch ? (m(), w("div",
|
|
697
|
+
}), (t, u) => (m(), w("div", wl, [
|
|
698
|
+
t.showSearch ? (m(), w("div", kl, [
|
|
699
699
|
d(el, {
|
|
700
700
|
modelValue: n.value,
|
|
701
701
|
"onUpdate:modelValue": u[0] || (u[0] = (l) => n.value = l),
|
|
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: o(i).state.menu
|
|
706
706
|
}, null, 8, ["modelValue", "menu"])
|
|
707
707
|
])) : M("", !0),
|
|
708
708
|
g("div", null, [
|
|
709
709
|
n.value ? (m(), I(Cl, {
|
|
710
710
|
key: 0,
|
|
711
711
|
"item-id": n.value,
|
|
712
|
-
menu:
|
|
712
|
+
menu: o(i).state.menu
|
|
713
713
|
}, null, 8, ["item-id", "menu"])) : M("", !0)
|
|
714
714
|
])
|
|
715
715
|
]));
|
|
716
716
|
}
|
|
717
|
-
}), Vl = /* @__PURE__ */
|
|
717
|
+
}), Vl = /* @__PURE__ */ j({
|
|
718
718
|
__name: "OverviewSheet",
|
|
719
|
-
setup(
|
|
719
|
+
setup(C) {
|
|
720
720
|
const e = F(null), i = F(!1);
|
|
721
721
|
function n(t) {
|
|
722
722
|
i.value = !i.value, t && (e.value = t);
|
|
723
723
|
}
|
|
724
724
|
return (t, u) => {
|
|
725
|
-
const l =
|
|
725
|
+
const l = N("FmSideSheet");
|
|
726
726
|
return m(), w(pe, null, [
|
|
727
727
|
_e(t.$slots, "default", { trigger: n }),
|
|
728
728
|
d(l, {
|
|
@@ -749,16 +749,16 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
751
|
});
|
|
752
|
-
var Fl =
|
|
753
|
-
const
|
|
752
|
+
var Fl = Ut();
|
|
753
|
+
const Je = /* @__PURE__ */ j({
|
|
754
754
|
__name: "ImportButton",
|
|
755
|
-
setup(
|
|
755
|
+
setup(C) {
|
|
756
756
|
const e = F(!1);
|
|
757
757
|
function i() {
|
|
758
758
|
e.value = !e.value;
|
|
759
759
|
}
|
|
760
|
-
const n =
|
|
761
|
-
return
|
|
760
|
+
const n = ze();
|
|
761
|
+
return ot(() => {
|
|
762
762
|
const t = n.currentCountry.value;
|
|
763
763
|
if (t)
|
|
764
764
|
try {
|
|
@@ -767,16 +767,16 @@ const Ye = /* @__PURE__ */ N({
|
|
|
767
767
|
console.log("Unable to set country config", u);
|
|
768
768
|
}
|
|
769
769
|
}), (t, u) => (m(), w(pe, null, [
|
|
770
|
-
d(
|
|
770
|
+
d(zt, {
|
|
771
771
|
modelValue: e.value,
|
|
772
772
|
"onUpdate:modelValue": u[0] || (u[0] = (l) => e.value = l)
|
|
773
773
|
}, null, 8, ["modelValue"]),
|
|
774
774
|
_e(t.$slots, "default", { trigger: i })
|
|
775
775
|
], 64));
|
|
776
776
|
}
|
|
777
|
-
}),
|
|
777
|
+
}), Ze = (C) => d("div", {
|
|
778
778
|
class: "flex flex-1 justify-end"
|
|
779
|
-
}, [d("span", null, [
|
|
779
|
+
}, [d("span", null, [C, tt(" ")])]), Il = {
|
|
780
780
|
class: "flex justify-between items-center space-x-8"
|
|
781
781
|
}, $l = {
|
|
782
782
|
class: "flex space-x-8 items-center"
|
|
@@ -795,20 +795,20 @@ const Ye = /* @__PURE__ */ N({
|
|
|
795
795
|
}, Ul = {
|
|
796
796
|
key: 1,
|
|
797
797
|
class: "px-16 py-4 space-x-8 flex justify-end"
|
|
798
|
-
}, Ol = {
|
|
799
|
-
key: 2
|
|
800
798
|
}, zl = {
|
|
801
|
-
|
|
799
|
+
key: 2
|
|
802
800
|
}, Dl = {
|
|
801
|
+
class: "flex space-x-8"
|
|
802
|
+
}, Ol = {
|
|
803
803
|
key: 1,
|
|
804
804
|
class: "pt-8 flex flex-col flex-1 overflow-hidden"
|
|
805
|
-
},
|
|
805
|
+
}, Nl = {
|
|
806
806
|
class: "space-y-8 pb-8"
|
|
807
807
|
}, Bl = {
|
|
808
808
|
class: "w-full px-8"
|
|
809
809
|
}, Kl = {
|
|
810
810
|
class: "flex space-x-8 px-8"
|
|
811
|
-
},
|
|
811
|
+
}, jl = {
|
|
812
812
|
key: 0,
|
|
813
813
|
class: "px-8"
|
|
814
814
|
}, El = {
|
|
@@ -832,7 +832,7 @@ const Ye = /* @__PURE__ */ N({
|
|
|
832
832
|
key: 1
|
|
833
833
|
}, Xl = {
|
|
834
834
|
class: "flex space-x-8"
|
|
835
|
-
}, ea = /* @__PURE__ */
|
|
835
|
+
}, ea = /* @__PURE__ */ j({
|
|
836
836
|
__name: "ProductTable",
|
|
837
837
|
props: {
|
|
838
838
|
modelValue: {},
|
|
@@ -842,23 +842,23 @@ const Ye = /* @__PURE__ */ N({
|
|
|
842
842
|
}
|
|
843
843
|
},
|
|
844
844
|
emits: ["update:model-value", "reset:model-value", "update:editing", "update:search-key"],
|
|
845
|
-
setup(
|
|
845
|
+
setup(C, {
|
|
846
846
|
expose: e,
|
|
847
847
|
emit: i
|
|
848
848
|
}) {
|
|
849
|
-
const n =
|
|
849
|
+
const n = C, {
|
|
850
850
|
t
|
|
851
|
-
} = Ie(), u =
|
|
852
|
-
selectedCategories:
|
|
853
|
-
} = Se(),
|
|
854
|
-
const
|
|
855
|
-
return ge.uniqBy(
|
|
856
|
-
}), Y = i,
|
|
857
|
-
de(() =>
|
|
858
|
-
Y("update:editing",
|
|
851
|
+
} = Ie(), u = ze(), l = Fe(), v = Pt(), f = rt(), s = u.currentCountry, b = h(() => s.value ? me.Country.getCountry(s.value) : null), y = h(() => l.rules.item), {
|
|
852
|
+
selectedCategories: k
|
|
853
|
+
} = Se(), z = h(() => {
|
|
854
|
+
const r = ge.flatten(k.value.map((a) => a.items));
|
|
855
|
+
return ge.uniqBy(r, (a) => a._id);
|
|
856
|
+
}), Y = i, S = F(!1);
|
|
857
|
+
de(() => S.value, (r) => {
|
|
858
|
+
Y("update:editing", r);
|
|
859
859
|
});
|
|
860
|
-
const oe = (
|
|
861
|
-
|
|
860
|
+
const oe = (r) => {
|
|
861
|
+
Dt.isBoolean(r) ? S.value = r : S.value = !S.value;
|
|
862
862
|
}, J = F(!1), re = F(null);
|
|
863
863
|
async function L() {
|
|
864
864
|
J.value = !J.value, J.value && (await Ae(), re.value && re.value.toggleProperty(!0));
|
|
@@ -868,38 +868,38 @@ const Ye = /* @__PURE__ */ N({
|
|
|
868
868
|
});
|
|
869
869
|
const {
|
|
870
870
|
attributes: B,
|
|
871
|
-
filterRule:
|
|
871
|
+
filterRule: D,
|
|
872
872
|
mongoQuery: H
|
|
873
|
-
} =
|
|
874
|
-
valueSource:
|
|
873
|
+
} = Ct({
|
|
874
|
+
valueSource: z,
|
|
875
875
|
entity: "item"
|
|
876
|
-
}), Z = F(""), ne =
|
|
877
|
-
const
|
|
878
|
-
var
|
|
879
|
-
return !ne.value || !ne.value.trim() ? !0 : [c.code, c.name,
|
|
880
|
-
},
|
|
881
|
-
return
|
|
876
|
+
}), Z = F(""), ne = wt(Z, 300), Q = h(() => {
|
|
877
|
+
const r = (c) => {
|
|
878
|
+
var x;
|
|
879
|
+
return !ne.value || !ne.value.trim() ? !0 : [c.code, c.name, Ne(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());
|
|
880
|
+
}, a = (c) => H.value ? Tt(c.customAttributes, H.value) : !0;
|
|
881
|
+
return z.value.filter((c) => r(c) && a(c));
|
|
882
882
|
}), {
|
|
883
883
|
categories: se
|
|
884
|
-
} = Se(), R =
|
|
885
|
-
label:
|
|
886
|
-
value:
|
|
887
|
-
}))), $ = (
|
|
884
|
+
} = Se(), R = h(() => l.categories.map((r) => ({
|
|
885
|
+
label: r.name,
|
|
886
|
+
value: r._id || null
|
|
887
|
+
}))), $ = (r, a, c) => {
|
|
888
888
|
let p = ge.clone(n.modelValue);
|
|
889
|
-
const
|
|
890
|
-
|
|
891
|
-
...
|
|
892
|
-
...
|
|
893
|
-
} : p[
|
|
894
|
-
...
|
|
895
|
-
[
|
|
889
|
+
const x = p[r];
|
|
890
|
+
x && (typeof a == "object" && a !== null ? p[r] = {
|
|
891
|
+
...x,
|
|
892
|
+
...a
|
|
893
|
+
} : p[r] = {
|
|
894
|
+
...x,
|
|
895
|
+
[a]: c
|
|
896
896
|
}, Y("update:model-value", p));
|
|
897
|
-
}, P =
|
|
898
|
-
field:
|
|
899
|
-
}), q = (
|
|
900
|
-
const
|
|
901
|
-
return
|
|
902
|
-
}), ce =
|
|
897
|
+
}, P = _t(() => n.originalValue, () => n.modelValue), A = ge.debounce($, 300), ue = (r) => (a) => !!a || t("menu.product.table.validation.name_required", {
|
|
898
|
+
field: r
|
|
899
|
+
}), q = (r) => r >= 0 || t("menu.product.table.validation.price_min"), E = [ue("Name")], U = () => [(r) => q(typeof r == "number" ? r : Number(r) ?? 0)], ie = Ce(), G = h(() => {
|
|
900
|
+
const r = l.isV4;
|
|
901
|
+
return bt.setCoreStore(u).taxSetting(r);
|
|
902
|
+
}), ce = h(() => [{
|
|
903
903
|
accessorKey: "thumbnail",
|
|
904
904
|
header: "",
|
|
905
905
|
size: 110,
|
|
@@ -907,11 +907,11 @@ const Ye = /* @__PURE__ */ N({
|
|
|
907
907
|
cellClass: "px-0",
|
|
908
908
|
headerContentClass: "px-0"
|
|
909
909
|
},
|
|
910
|
-
cell: (
|
|
911
|
-
var
|
|
912
|
-
return
|
|
913
|
-
src:
|
|
914
|
-
alt: (c = (
|
|
910
|
+
cell: (r) => {
|
|
911
|
+
var a, c;
|
|
912
|
+
return O(Ue, {
|
|
913
|
+
src: r.getValue(),
|
|
914
|
+
alt: (c = (a = r == null ? void 0 : r.row) == null ? void 0 : a.original) == null ? void 0 : c.name,
|
|
915
915
|
className: "my-8 mx-12",
|
|
916
916
|
size: 72,
|
|
917
917
|
crossorigin: !1
|
|
@@ -923,18 +923,18 @@ const Ye = /* @__PURE__ */ N({
|
|
|
923
923
|
header: () => t("menu.product.table.columns.code"),
|
|
924
924
|
enableSorting: !1,
|
|
925
925
|
size: 100,
|
|
926
|
-
cell: (
|
|
927
|
-
const
|
|
928
|
-
if (!
|
|
926
|
+
cell: (r) => {
|
|
927
|
+
const a = r.row.original, c = r.getValue() || "--";
|
|
928
|
+
if (!S.value) return d("span", {
|
|
929
929
|
class: "break-all"
|
|
930
930
|
}, [c]);
|
|
931
|
-
const p = Te(
|
|
932
|
-
return
|
|
931
|
+
const p = Te(a._id);
|
|
932
|
+
return O(te.FmTextField, {
|
|
933
933
|
disabled: !y.value.code,
|
|
934
|
-
modelValue: P(
|
|
935
|
-
placeholder: n.modelValue[
|
|
936
|
-
"onUpdate:modelValue": (
|
|
937
|
-
A(
|
|
934
|
+
modelValue: P(a._id, "code") ?? (p == null ? void 0 : p.code),
|
|
935
|
+
placeholder: n.modelValue[a._id].fallbackCode,
|
|
936
|
+
"onUpdate:modelValue": (x) => {
|
|
937
|
+
A(a._id, "code", x);
|
|
938
938
|
}
|
|
939
939
|
});
|
|
940
940
|
}
|
|
@@ -942,35 +942,37 @@ const Ye = /* @__PURE__ */ N({
|
|
|
942
942
|
accessorKey: "name",
|
|
943
943
|
header: () => t("menu.product.table.columns.name"),
|
|
944
944
|
enableSorting: !1,
|
|
945
|
-
size:
|
|
946
|
-
cell: (
|
|
947
|
-
const
|
|
948
|
-
return
|
|
945
|
+
size: 250,
|
|
946
|
+
cell: (r) => {
|
|
947
|
+
const a = r.row.original, c = r.getValue();
|
|
948
|
+
return S.value ? O("div", {
|
|
949
949
|
class: "flex items-center gap-8"
|
|
950
|
-
}, [
|
|
950
|
+
}, [O(te.FmTextField, {
|
|
951
951
|
disabled: !y.value.name,
|
|
952
|
-
modelValue: P(
|
|
953
|
-
"onUpdate:modelValue": (
|
|
954
|
-
A(
|
|
952
|
+
modelValue: P(a._id, "name") ?? a.name,
|
|
953
|
+
"onUpdate:modelValue": (p) => {
|
|
954
|
+
A(a._id, "name", p);
|
|
955
955
|
},
|
|
956
956
|
rules: E,
|
|
957
|
-
placeholder:
|
|
958
|
-
}),
|
|
959
|
-
|
|
960
|
-
|
|
957
|
+
placeholder: a.fallbackName
|
|
958
|
+
}), a.name_locale ? O(He, {
|
|
959
|
+
nameLocale: a.name_locale ?? {},
|
|
960
|
+
showNumber: 1
|
|
961
|
+
}) : null]) : O("div", {
|
|
961
962
|
class: "flex items-center gap-8"
|
|
962
|
-
}, [
|
|
963
|
-
class: "
|
|
964
|
-
}, c),
|
|
965
|
-
|
|
966
|
-
|
|
963
|
+
}, [O("span", {
|
|
964
|
+
class: "text-wrap"
|
|
965
|
+
}, c), a.name_locale ? O(He, {
|
|
966
|
+
nameLocale: a.name_locale ?? {},
|
|
967
|
+
showNumber: 1
|
|
968
|
+
}) : null]);
|
|
967
969
|
}
|
|
968
970
|
}, {
|
|
969
971
|
accessorKey: "price",
|
|
970
972
|
header: () => {
|
|
971
|
-
var
|
|
972
|
-
return
|
|
973
|
-
currency: (
|
|
973
|
+
var r;
|
|
974
|
+
return Ze(t("menu.product.table.columns.price", {
|
|
975
|
+
currency: (r = b.value) == null ? void 0 : r.currency.symbol
|
|
974
976
|
}));
|
|
975
977
|
},
|
|
976
978
|
enableSorting: !1,
|
|
@@ -978,38 +980,38 @@ const Ye = /* @__PURE__ */ N({
|
|
|
978
980
|
meta: {
|
|
979
981
|
textAlign: "right"
|
|
980
982
|
},
|
|
981
|
-
cell: (
|
|
982
|
-
var
|
|
983
|
-
const
|
|
984
|
-
if (!
|
|
985
|
-
const c = n.modelValue[
|
|
986
|
-
return
|
|
983
|
+
cell: (r) => {
|
|
984
|
+
var x;
|
|
985
|
+
const a = r.getValue();
|
|
986
|
+
if (!S.value) return me.Dinero.fromFdoDinero(a).toFormat();
|
|
987
|
+
const c = n.modelValue[r.row.original._id], p = c.fallbackPrice;
|
|
988
|
+
return O(Mt, {
|
|
987
989
|
min: 0,
|
|
988
990
|
disabled: !c.editPrice,
|
|
989
991
|
// @ts-ignore
|
|
990
|
-
placeholder: p ?
|
|
991
|
-
modelValue: P(c._id, "price") ?? ((
|
|
992
|
+
placeholder: p ? Ot(p, !1) : void 0,
|
|
993
|
+
modelValue: P(c._id, "price") ?? ((x = Te(c._id)) == null ? void 0 : x.price),
|
|
992
994
|
// @ts-ignore
|
|
993
|
-
"onUpdate:modelValue": (
|
|
994
|
-
$(c._id, "price",
|
|
995
|
+
"onUpdate:modelValue": (V) => {
|
|
996
|
+
$(c._id, "price", V);
|
|
995
997
|
},
|
|
996
998
|
rules: U()
|
|
997
999
|
});
|
|
998
1000
|
}
|
|
999
1001
|
}, {
|
|
1000
1002
|
accessorKey: "taxes",
|
|
1001
|
-
header: () =>
|
|
1002
|
-
size:
|
|
1003
|
+
header: () => Ze(G.value.systemCode),
|
|
1004
|
+
size: S.value ? 120 : 80,
|
|
1003
1005
|
enableSorting: !1,
|
|
1004
1006
|
meta: {
|
|
1005
1007
|
textAlign: "right"
|
|
1006
1008
|
},
|
|
1007
|
-
cell: (
|
|
1008
|
-
const
|
|
1009
|
-
if (!
|
|
1010
|
-
return `${
|
|
1011
|
-
const _ = l.getSelectedTax(P(c._id, "taxes") ??
|
|
1012
|
-
return
|
|
1009
|
+
cell: (r) => {
|
|
1010
|
+
const a = r.getValue(), c = r.row.original, p = l.taxSetting.countryTaxOptions, x = l.getSelectedTax(a, c.fallbackTaxes, l.taxSetting.countryTaxOptions), V = p.find((ae) => ae.value === x);
|
|
1011
|
+
if (!S.value)
|
|
1012
|
+
return `${V != null && V.meta.rate ? yt(V.meta.rate) : 0}%`;
|
|
1013
|
+
const _ = l.getSelectedTax(P(c._id, "taxes") ?? a, c.fallbackTaxes, l.taxSetting.countryTaxOptions);
|
|
1014
|
+
return O(te.FmSelect, {
|
|
1013
1015
|
disabled: !y.value.tax,
|
|
1014
1016
|
items: l.taxSetting.countryTaxOptions,
|
|
1015
1017
|
modelValue: _,
|
|
@@ -1024,25 +1026,25 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1024
1026
|
header: () => t("menu.product.table.columns.category"),
|
|
1025
1027
|
enableSorting: !1,
|
|
1026
1028
|
size: 140,
|
|
1027
|
-
cell: (
|
|
1028
|
-
const
|
|
1029
|
-
if (!
|
|
1030
|
-
return
|
|
1031
|
-
categories: Pe(se.value,
|
|
1029
|
+
cell: (r) => {
|
|
1030
|
+
const a = r.row.original;
|
|
1031
|
+
if (!S.value)
|
|
1032
|
+
return O(Ye, {
|
|
1033
|
+
categories: Pe(se.value, a)
|
|
1032
1034
|
});
|
|
1033
|
-
const c =
|
|
1034
|
-
return
|
|
1035
|
+
const c = ht(n.originalValue, n.modelValue, a._id) ?? xt(a), p = (c == null ? void 0 : c.map((V) => V._id)) ?? [], x = c == null ? void 0 : c.reduce((V, _) => (V[_._id] = _, V), {});
|
|
1036
|
+
return O($t, {
|
|
1035
1037
|
shouldShowChips: !1,
|
|
1036
1038
|
shouldShowSelectedItemsWithinPlaceholder: !0,
|
|
1037
1039
|
modelValue: p.length > 0 ? p : [null],
|
|
1038
1040
|
items: R.value,
|
|
1039
1041
|
disabled: !!(l.state.currentCatalogId || l.state.currentSchedulerId),
|
|
1040
|
-
"onUpdate:modelValue": async (
|
|
1041
|
-
const [_, ...ae] =
|
|
1042
|
-
A(
|
|
1042
|
+
"onUpdate:modelValue": async (V) => {
|
|
1043
|
+
const [_, ...ae] = V;
|
|
1044
|
+
A(a._id, {
|
|
1043
1045
|
category: _,
|
|
1044
1046
|
additionalCategories: ae.map((xe) => {
|
|
1045
|
-
const Ke =
|
|
1047
|
+
const Ke = x == null ? void 0 : x[xe];
|
|
1046
1048
|
return Ke || {
|
|
1047
1049
|
_id: xe,
|
|
1048
1050
|
position: null
|
|
@@ -1058,32 +1060,32 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1058
1060
|
header: () => t("menu.product.table.columns.tagging"),
|
|
1059
1061
|
enableSorting: !1,
|
|
1060
1062
|
size: 140,
|
|
1061
|
-
cell: (
|
|
1062
|
-
const
|
|
1063
|
-
return
|
|
1064
|
-
customAttributes:
|
|
1063
|
+
cell: (r) => {
|
|
1064
|
+
const a = r.row.original;
|
|
1065
|
+
return O(Me, {
|
|
1066
|
+
customAttributes: a.customAttributes
|
|
1065
1067
|
});
|
|
1066
1068
|
}
|
|
1067
1069
|
}, {
|
|
1068
1070
|
accessorKey: "orderFrom",
|
|
1069
1071
|
header: () => t("menu.product.table.columns.order_from"),
|
|
1070
1072
|
enableSorting: !0,
|
|
1071
|
-
sortingFn: (
|
|
1072
|
-
const [c, p] = [
|
|
1073
|
+
sortingFn: (r, a) => {
|
|
1074
|
+
const [c, p] = [r, a].map((x) => ie[x.original.orderFrom].sortingIndex);
|
|
1073
1075
|
return c - p;
|
|
1074
1076
|
},
|
|
1075
1077
|
size: 140,
|
|
1076
|
-
cell: (
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1078
|
+
cell: (r) => {
|
|
1079
|
+
const a = r.getValue(), c = r.row.original;
|
|
1080
|
+
return S.value ? O(te.FmSelect, {
|
|
1079
1081
|
disabled: !y.value.orderFrom,
|
|
1080
1082
|
items: Object.values(Ce()),
|
|
1081
|
-
modelValue: P(c._id, "orderFrom") ??
|
|
1083
|
+
modelValue: P(c._id, "orderFrom") ?? a,
|
|
1082
1084
|
"onUpdate:modelValue": async (p) => {
|
|
1083
1085
|
$(c._id, "orderFrom", p);
|
|
1084
1086
|
}
|
|
1085
|
-
}) :
|
|
1086
|
-
orderFrom:
|
|
1087
|
+
}) : O(Ve, {
|
|
1088
|
+
orderFrom: a
|
|
1087
1089
|
});
|
|
1088
1090
|
}
|
|
1089
1091
|
}, {
|
|
@@ -1094,9 +1096,9 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1094
1096
|
headerClass: "py-4",
|
|
1095
1097
|
textAlign: "right"
|
|
1096
1098
|
},
|
|
1097
|
-
header: () =>
|
|
1099
|
+
header: () => O("div", {
|
|
1098
1100
|
class: "w-full px-4 flex justify-end"
|
|
1099
|
-
}, [
|
|
1101
|
+
}, [Nt(O(te.FmButton, {
|
|
1100
1102
|
variant: ee.Tertiary,
|
|
1101
1103
|
textColor: W.NeutralGray400,
|
|
1102
1104
|
prependIcon: "edit",
|
|
@@ -1104,8 +1106,8 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1104
1106
|
onClick: oe,
|
|
1105
1107
|
type: "button"
|
|
1106
1108
|
}), "Bulk edit")]),
|
|
1107
|
-
cell: (
|
|
1108
|
-
const
|
|
1109
|
+
cell: (r) => {
|
|
1110
|
+
const a = r.row.original;
|
|
1109
1111
|
return d("div", {
|
|
1110
1112
|
class: "px-4 flex justify-end"
|
|
1111
1113
|
}, [d(Vl, null, {
|
|
@@ -1116,7 +1118,7 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1116
1118
|
variant: "tertiary",
|
|
1117
1119
|
textColor: W.NeutralGray400,
|
|
1118
1120
|
onClick: fe(() => {
|
|
1119
|
-
c(
|
|
1121
|
+
c(a._id);
|
|
1120
1122
|
}, ["stop", "prevent"])
|
|
1121
1123
|
}, null)
|
|
1122
1124
|
}), d(te.FmButton, {
|
|
@@ -1125,9 +1127,9 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1125
1127
|
textColor: W.NeutralGray400,
|
|
1126
1128
|
onClick: fe(async () => {
|
|
1127
1129
|
await f.deleteItem([{
|
|
1128
|
-
_id:
|
|
1129
|
-
name:
|
|
1130
|
-
thumbnail:
|
|
1130
|
+
_id: a._id,
|
|
1131
|
+
name: a.name,
|
|
1132
|
+
thumbnail: a.thumbnail
|
|
1131
1133
|
}]);
|
|
1132
1134
|
}, ["stop", "prevent"])
|
|
1133
1135
|
}, null)]);
|
|
@@ -1135,25 +1137,25 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1135
1137
|
}]);
|
|
1136
1138
|
l.taxSetting.systemCode || ce.value.splice(4, 1);
|
|
1137
1139
|
const le = F({}), X = F([]);
|
|
1138
|
-
de([() => le.value, () => Q.value], (
|
|
1139
|
-
let
|
|
1140
|
-
Object.keys(
|
|
1141
|
-
const p =
|
|
1142
|
-
|
|
1143
|
-
}), X.value =
|
|
1144
|
-
}), de(() =>
|
|
1140
|
+
de([() => le.value, () => Q.value], (r) => {
|
|
1141
|
+
let a = [];
|
|
1142
|
+
Object.keys(r[0]).forEach((c) => {
|
|
1143
|
+
const p = r[0][c], x = Q.value[parseInt(c)];
|
|
1144
|
+
x && (p ? a.push(x) : X.value = a.filter((V) => V !== x));
|
|
1145
|
+
}), X.value = a;
|
|
1146
|
+
}), de(() => z.value, () => {
|
|
1145
1147
|
le.value = {}, X.value = [];
|
|
1146
|
-
}), de(() =>
|
|
1148
|
+
}), de(() => S.value, () => {
|
|
1147
1149
|
le.value = {}, X.value = [];
|
|
1148
1150
|
});
|
|
1149
1151
|
const ye = () => {
|
|
1150
1152
|
le.value = {};
|
|
1151
1153
|
};
|
|
1152
|
-
async function
|
|
1154
|
+
async function Oe() {
|
|
1153
1155
|
await Ae();
|
|
1154
|
-
const
|
|
1155
|
-
const
|
|
1156
|
-
return Ee(
|
|
1156
|
+
const r = () => !!l.currentCatalog || !!l.state.currentSchedulerId, a = (p) => p === "" || p === null ? r() ? "" : null : p, c = Object.values(n.modelValue).filter((p) => {
|
|
1157
|
+
const x = Object.values(n.originalValue).find((V) => V._id === p._id);
|
|
1158
|
+
return Ee(x, p);
|
|
1157
1159
|
}).map((p) => ({
|
|
1158
1160
|
_id: p._id,
|
|
1159
1161
|
name: p.name,
|
|
@@ -1161,21 +1163,21 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1161
1163
|
price: p.price,
|
|
1162
1164
|
orderFrom: p.orderFrom ?? null,
|
|
1163
1165
|
taxes: p.taxes,
|
|
1164
|
-
category:
|
|
1166
|
+
category: a(p.category || null),
|
|
1165
1167
|
additionalCategories: p.additionalCategories
|
|
1166
1168
|
}));
|
|
1167
1169
|
await f.updateMany(c), oe(!1);
|
|
1168
1170
|
}
|
|
1169
|
-
const
|
|
1170
|
-
await f.deleteItem(X.value.map((
|
|
1171
|
-
_id:
|
|
1172
|
-
name:
|
|
1173
|
-
thumbnail:
|
|
1171
|
+
const ut = async () => {
|
|
1172
|
+
await f.deleteItem(X.value.map((r) => ({
|
|
1173
|
+
_id: r._id,
|
|
1174
|
+
name: r.name,
|
|
1175
|
+
thumbnail: r.thumbnail
|
|
1174
1176
|
})));
|
|
1175
1177
|
}, he = () => {
|
|
1176
1178
|
Y("reset:model-value");
|
|
1177
1179
|
}, $e = () => {
|
|
1178
|
-
Object.entries(n.modelValue).some(([
|
|
1180
|
+
Object.entries(n.modelValue).some(([a, c]) => Ee(c, n.originalValue[a])) ? v.open({
|
|
1179
1181
|
title: "You have unsaved changes!",
|
|
1180
1182
|
message: "Are you sure you want to discard? You will lose all the changes if discard edit.",
|
|
1181
1183
|
primaryActions: {
|
|
@@ -1190,218 +1192,218 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1190
1192
|
}).onPrimary(() => {
|
|
1191
1193
|
he(), oe(!1);
|
|
1192
1194
|
}) : (oe(!1), he());
|
|
1193
|
-
},
|
|
1194
|
-
var
|
|
1195
|
+
}, it = h(() => {
|
|
1196
|
+
var r, a;
|
|
1195
1197
|
return {
|
|
1196
|
-
thumbnail: !
|
|
1197
|
-
actions: !
|
|
1198
|
-
tagging: !
|
|
1198
|
+
thumbnail: !S.value,
|
|
1199
|
+
actions: !S.value,
|
|
1200
|
+
tagging: !S.value && ((a = (r = u.itemAttributeSettings) == null ? void 0 : r.value) == null ? void 0 : a.length) > 0
|
|
1199
1201
|
};
|
|
1200
|
-
}),
|
|
1201
|
-
f.update(
|
|
1202
|
+
}), ct = (r) => {
|
|
1203
|
+
f.update(r._id);
|
|
1202
1204
|
};
|
|
1203
|
-
async function
|
|
1204
|
-
await f.update(
|
|
1205
|
+
async function dt(r) {
|
|
1206
|
+
await f.update(r.original._id);
|
|
1205
1207
|
}
|
|
1206
|
-
function
|
|
1208
|
+
function Ne(r) {
|
|
1207
1209
|
var _;
|
|
1208
|
-
const
|
|
1210
|
+
const a = r.price ?? // TODO: fix type error
|
|
1209
1211
|
// @ts-ignore
|
|
1210
|
-
|
|
1212
|
+
r.fallbackPrice ?? me.Dinero.fromNumber({
|
|
1211
1213
|
number: 0
|
|
1212
|
-
}).toObject(), c =
|
|
1214
|
+
}).toObject(), c = r.taxes, p = l.taxSetting.countryTaxOptions, x = me.Dinero.fromFdoDinero(a).toFormat(), V = (_ = b.value) == null ? void 0 : _.currency.symbol;
|
|
1213
1215
|
return l.getSelectedTax(
|
|
1214
1216
|
c,
|
|
1215
1217
|
// TODO: fix type error
|
|
1216
1218
|
// @ts-ignore
|
|
1217
|
-
|
|
1219
|
+
r.fallbackTaxes,
|
|
1218
1220
|
p
|
|
1219
|
-
), `${
|
|
1221
|
+
), `${V == null ? void 0 : V.toUpperCase()}${x}`;
|
|
1220
1222
|
}
|
|
1221
|
-
function Te(
|
|
1223
|
+
function Te(r) {
|
|
1222
1224
|
var p;
|
|
1223
|
-
const
|
|
1224
|
-
if (
|
|
1225
|
-
const
|
|
1226
|
-
return
|
|
1227
|
-
} else return
|
|
1225
|
+
const a = l.currentCatalog, c = l.state.currentSchedulerId;
|
|
1226
|
+
if (a && c) {
|
|
1227
|
+
const x = a.override.scheduler[c] ?? {}, V = (p = x == null ? void 0 : x.items) == null ? void 0 : p.filter((_) => _._id === r);
|
|
1228
|
+
return V == null ? void 0 : V[0];
|
|
1229
|
+
} else return a ? a.override.items[r][0] : c ? l.schedulers.find((_) => _._id === c).items.filter((_) => _._id === r)[0] : z.value.find((x) => x._id === r);
|
|
1228
1230
|
}
|
|
1229
|
-
const
|
|
1230
|
-
var
|
|
1231
|
+
const mt = nt(), pt = h(() => mt.breakpoints.value.xs), Be = F(null), vt = Rt(Be, J), ft = h(() => {
|
|
1232
|
+
var a;
|
|
1231
1233
|
return {
|
|
1232
|
-
height: `calc(100vh - ${((
|
|
1234
|
+
height: `calc(100vh - ${((a = vt.value) == null ? void 0 : a.top) + 24}px)`
|
|
1233
1235
|
};
|
|
1234
1236
|
});
|
|
1235
|
-
return (
|
|
1236
|
-
const c =
|
|
1237
|
-
return
|
|
1237
|
+
return (r, a) => {
|
|
1238
|
+
const c = N("fm-search"), p = N("fm-button"), x = N("fm-table"), V = N("fm-form");
|
|
1239
|
+
return pt.value ? (m(), w("div", Ol, [g("div", Nl, [g("div", Bl, [d(c, {
|
|
1238
1240
|
"model-value": Z.value,
|
|
1239
|
-
"onUpdate:modelValue":
|
|
1241
|
+
"onUpdate:modelValue": a[5] || (a[5] = (_) => Z.value = _),
|
|
1240
1242
|
autofocus: "",
|
|
1241
|
-
placeholder:
|
|
1242
|
-
}, null, 8, ["model-value", "placeholder"])]),
|
|
1243
|
+
placeholder: o(t)("menu.product.table.search.placeholder")
|
|
1244
|
+
}, null, 8, ["model-value", "placeholder"])]), a[8] || (a[8] = g("div", {
|
|
1243
1245
|
class: "w-full h-[1px] bg-fm-color-neutral-gray-100"
|
|
1244
|
-
}, null, -1)), g("div", Kl, [_e(
|
|
1246
|
+
}, null, -1)), g("div", Kl, [_e(r.$slots, "filter")]), J.value ? (m(), w("div", jl, [d(o(We), {
|
|
1245
1247
|
ref_key: "attributeFilterRef",
|
|
1246
1248
|
ref: re,
|
|
1247
|
-
attributes:
|
|
1248
|
-
modelValue:
|
|
1249
|
-
"onUpdate:modelValue":
|
|
1250
|
-
}, null, 8, ["attributes", "modelValue"])])) : M("", !0)]),
|
|
1249
|
+
attributes: o(B),
|
|
1250
|
+
modelValue: o(D),
|
|
1251
|
+
"onUpdate:modelValue": a[6] || (a[6] = (_) => je(D) ? D.value = _ : null)
|
|
1252
|
+
}, null, 8, ["attributes", "modelValue"])])) : M("", !0)]), z.value.length ? (m(), w("div", El, [(m(!0), w(pe, null, ke(Q.value, (_) => {
|
|
1251
1253
|
var ae;
|
|
1252
1254
|
return m(), w("div", {
|
|
1253
1255
|
key: _._id,
|
|
1254
1256
|
class: "max-w-full py-12 px-16 space-x-16 flex items-center",
|
|
1255
|
-
onClick: () =>
|
|
1257
|
+
onClick: () => ct(_)
|
|
1256
1258
|
}, [g("div", Ll, [d(Ue, {
|
|
1257
1259
|
alt: _.name,
|
|
1258
1260
|
size: 72,
|
|
1259
1261
|
src: _.thumbnail
|
|
1260
1262
|
}, null, 8, ["alt", "src"]), g("div", ql, [g("div", Wl, [g("p", Hl, K(_.name), 1), d(Ve, {
|
|
1261
1263
|
"order-from": _.orderFrom
|
|
1262
|
-
}, null, 8, ["order-from"])]), g("p", Ql, K(
|
|
1263
|
-
categories:
|
|
1264
|
+
}, null, 8, ["order-from"])]), g("p", Ql, K(Ne(_)), 1), g("p", Yl, K(o(t)("menu.product.table.columns.code")) + ": " + K(((ae = Te(_._id)) == null ? void 0 : ae.code) || "--"), 1), g("p", Jl, [d(Ye, {
|
|
1265
|
+
categories: o(Pe)(o(se), _)
|
|
1264
1266
|
}, null, 8, ["categories"])]), d(Me, {
|
|
1265
1267
|
"custom-attributes": _.customAttributes
|
|
1266
1268
|
}, null, 8, ["custom-attributes"])])]), d(p, {
|
|
1267
|
-
"text-color":
|
|
1268
|
-
variant:
|
|
1269
|
+
"text-color": o(W).NeutralGray400,
|
|
1270
|
+
variant: o(ee).Tertiary,
|
|
1269
1271
|
"prepend-icon": "delete",
|
|
1270
|
-
onClick: fe(() =>
|
|
1272
|
+
onClick: fe(() => o(f).deleteItem([{
|
|
1271
1273
|
_id: _._id,
|
|
1272
1274
|
name: _.name,
|
|
1273
1275
|
thumbnail: _.thumbnail
|
|
1274
1276
|
}]), ["stop"])
|
|
1275
1277
|
}, null, 8, ["text-color", "variant", "onClick"])], 8, Gl);
|
|
1276
1278
|
}), 128))])) : (m(), w("div", Zl, [d(be, {
|
|
1277
|
-
subtitle:
|
|
1278
|
-
title:
|
|
1279
|
+
subtitle: o(t)("menu.product.table.empty.subtitle"),
|
|
1280
|
+
title: o(t)("menu.product.table.empty.title")
|
|
1279
1281
|
}, {
|
|
1280
1282
|
action: T(() => [g("div", Xl, [d(p, {
|
|
1281
|
-
variant:
|
|
1282
|
-
label:
|
|
1283
|
+
variant: o(ee).Primary,
|
|
1284
|
+
label: o(t)("menu.product.table.empty.actions.add"),
|
|
1283
1285
|
"prepend-icon": "add",
|
|
1284
|
-
onClick:
|
|
1285
|
-
}, null, 8, ["variant", "label"]), d(
|
|
1286
|
+
onClick: a[7] || (a[7] = (_) => o(f).create(null))
|
|
1287
|
+
}, null, 8, ["variant", "label"]), d(Je, null, {
|
|
1286
1288
|
default: T(({
|
|
1287
1289
|
trigger: _
|
|
1288
1290
|
}) => [d(p, {
|
|
1289
|
-
"bg-color":
|
|
1290
|
-
"text-color":
|
|
1291
|
-
variant:
|
|
1292
|
-
label:
|
|
1291
|
+
"bg-color": o(W).NeutralGray100,
|
|
1292
|
+
"text-color": o(W).NeutralGray400,
|
|
1293
|
+
variant: o(ee).Primary,
|
|
1294
|
+
label: o(t)("menu.product.table.empty.actions.import"),
|
|
1293
1295
|
"prepend-icon": "download",
|
|
1294
1296
|
onClick: _
|
|
1295
1297
|
}, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
|
|
1296
1298
|
_: 1
|
|
1297
1299
|
})])]),
|
|
1298
1300
|
_: 1
|
|
1299
|
-
}, 8, ["subtitle", "title"])]))])) : (m(), I(
|
|
1301
|
+
}, 8, ["subtitle", "title"])]))])) : (m(), I(V, {
|
|
1300
1302
|
key: 0,
|
|
1301
1303
|
"blame-form-child-on-validation-failed": "",
|
|
1302
1304
|
class: "flex flex-col flex-1 space-y-8 overflow-hidden",
|
|
1303
|
-
onValidationSuccess:
|
|
1305
|
+
onValidationSuccess: Oe
|
|
1304
1306
|
}, {
|
|
1305
|
-
default: T(() => [g("div", Il, [g("div", $l, [_e(
|
|
1307
|
+
default: T(() => [g("div", Il, [g("div", $l, [_e(r.$slots, "filter")]), g("div", Tl, [d(c, {
|
|
1306
1308
|
"model-value": Z.value,
|
|
1307
|
-
"onUpdate:modelValue":
|
|
1309
|
+
"onUpdate:modelValue": a[0] || (a[0] = (_) => Z.value = _),
|
|
1308
1310
|
autofocus: "",
|
|
1309
|
-
placeholder:
|
|
1310
|
-
}, null, 8, ["model-value", "placeholder"])])]), J.value ? (m(), w("div", Pl, [d(
|
|
1311
|
+
placeholder: o(t)("menu.product.table.search.placeholder")
|
|
1312
|
+
}, null, 8, ["model-value", "placeholder"])])]), J.value ? (m(), w("div", Pl, [d(o(We), {
|
|
1311
1313
|
ref_key: "attributeFilterRef",
|
|
1312
1314
|
ref: re,
|
|
1313
|
-
attributes:
|
|
1314
|
-
modelValue:
|
|
1315
|
-
"onUpdate:modelValue":
|
|
1316
|
-
}, null, 8, ["attributes", "modelValue"])])) : M("", !0),
|
|
1315
|
+
attributes: o(B),
|
|
1316
|
+
modelValue: o(D),
|
|
1317
|
+
"onUpdate:modelValue": a[1] || (a[1] = (_) => je(D) ? D.value = _ : null)
|
|
1318
|
+
}, null, 8, ["attributes", "modelValue"])])) : M("", !0), z.value.length ? (m(), w("div", Al, [X.value.length && !S.value ? (m(), w("div", Rl, [g("p", Ml, K(o(t)("menu.product.table.selection.count", {
|
|
1317
1319
|
count: X.value.length
|
|
1318
1320
|
})), 1), d(p, {
|
|
1319
|
-
label:
|
|
1321
|
+
label: o(t)("menu.product.table.selection.actions.deselect_all"),
|
|
1320
1322
|
type: "button",
|
|
1321
1323
|
variant: "plain",
|
|
1322
1324
|
onClick: ye
|
|
1323
1325
|
}, null, 8, ["label"]), d(p, {
|
|
1324
|
-
"border-color":
|
|
1325
|
-
"text-color":
|
|
1326
|
+
"border-color": o(W).SystemError300,
|
|
1327
|
+
"text-color": o(W).SystemError300,
|
|
1326
1328
|
class: "ml-auto",
|
|
1327
|
-
label:
|
|
1329
|
+
label: o(t)("menu.product.table.selection.actions.remove"),
|
|
1328
1330
|
"prepend-icon": "delete",
|
|
1329
1331
|
variant: "secondary",
|
|
1330
|
-
onClick:
|
|
1331
|
-
}, null, 8, ["border-color", "text-color", "label"])])) : M("", !0),
|
|
1332
|
-
variant:
|
|
1333
|
-
label:
|
|
1332
|
+
onClick: ut
|
|
1333
|
+
}, null, 8, ["border-color", "text-color", "label"])])) : M("", !0), S.value ? (m(), w("div", Ul, [d(p, {
|
|
1334
|
+
variant: o(ee).Tertiary,
|
|
1335
|
+
label: o(t)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
1334
1336
|
onClick: he
|
|
1335
1337
|
}, null, 8, ["variant", "label"]), d(p, {
|
|
1336
|
-
variant:
|
|
1337
|
-
label:
|
|
1338
|
+
variant: o(ee).Tertiary,
|
|
1339
|
+
label: o(t)("menu.common.actions.cancel"),
|
|
1338
1340
|
onClick: $e
|
|
1339
1341
|
}, null, 8, ["variant", "label"]), d(p, {
|
|
1340
|
-
borderColor:
|
|
1341
|
-
textColor:
|
|
1342
|
-
variant:
|
|
1343
|
-
label:
|
|
1342
|
+
borderColor: o(W).ColorPrimary,
|
|
1343
|
+
textColor: o(W).ColorPrimary,
|
|
1344
|
+
variant: o(ee).Secondary,
|
|
1345
|
+
label: o(t)("menu.product.table.bulk_edit.actions.save"),
|
|
1344
1346
|
type: "submit"
|
|
1345
1347
|
}, null, 8, ["borderColor", "textColor", "variant", "label"])])) : M("", !0), g("div", {
|
|
1346
1348
|
ref_key: "tableWrapper",
|
|
1347
1349
|
ref: Be
|
|
1348
|
-
}, [(m(), I(
|
|
1350
|
+
}, [(m(), I(at(S.value ? At : "div"), {
|
|
1349
1351
|
ref: "fullWrapper",
|
|
1350
|
-
title:
|
|
1351
|
-
show:
|
|
1352
|
+
title: S.value ? o(t)("menu.product.table.bulk_edit.title") : "",
|
|
1353
|
+
show: S.value,
|
|
1352
1354
|
"primary-action": {
|
|
1353
|
-
label:
|
|
1355
|
+
label: o(t)("menu.product.table.bulk_edit.actions.save")
|
|
1354
1356
|
},
|
|
1355
1357
|
"secondary-actions": [{
|
|
1356
|
-
label:
|
|
1358
|
+
label: o(t)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
1357
1359
|
click: he
|
|
1358
1360
|
}, {
|
|
1359
|
-
label:
|
|
1361
|
+
label: o(t)("menu.common.actions.cancel"),
|
|
1360
1362
|
click: $e
|
|
1361
1363
|
}],
|
|
1362
1364
|
class: "overflow-x-scroll",
|
|
1363
|
-
style: ft
|
|
1364
|
-
onOnPrimary:
|
|
1365
|
+
style: gt(ft.value),
|
|
1366
|
+
onOnPrimary: Oe,
|
|
1365
1367
|
onOnCancel: $e
|
|
1366
1368
|
}, {
|
|
1367
|
-
default: T(() => [d(
|
|
1369
|
+
default: T(() => [d(x, {
|
|
1368
1370
|
class: ve({
|
|
1369
1371
|
"min-w-[1100px]": !0,
|
|
1370
|
-
"mt-24":
|
|
1372
|
+
"mt-24": S.value
|
|
1371
1373
|
}),
|
|
1372
1374
|
modelValue: le.value,
|
|
1373
|
-
"onUpdate:modelValue":
|
|
1375
|
+
"onUpdate:modelValue": a[2] || (a[2] = (_) => le.value = _),
|
|
1374
1376
|
"column-defs": ce.value,
|
|
1375
|
-
"column-visibility":
|
|
1376
|
-
loading:
|
|
1377
|
+
"column-visibility": it.value,
|
|
1378
|
+
loading: r.isCalculating,
|
|
1377
1379
|
"page-size": Q.value.length,
|
|
1378
1380
|
"row-data": Q.value,
|
|
1379
1381
|
"shrink-at": !1,
|
|
1380
|
-
selection:
|
|
1382
|
+
selection: S.value ? void 0 : "multiple",
|
|
1381
1383
|
virtual: !0,
|
|
1382
|
-
"virtual-row-height":
|
|
1384
|
+
"virtual-row-height": S.value ? 48 : 91,
|
|
1383
1385
|
"hide-footer": "",
|
|
1384
1386
|
"pin-header-row": "",
|
|
1385
|
-
onRowClick:
|
|
1387
|
+
onRowClick: a[3] || (a[3] = (_) => S.value ? void 0 : dt(_))
|
|
1386
1388
|
}, null, 8, ["class", "modelValue", "column-defs", "column-visibility", "loading", "page-size", "row-data", "selection", "virtual-row-height"])]),
|
|
1387
1389
|
_: 1
|
|
1388
|
-
}, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (m(), w("div",
|
|
1389
|
-
subtitle:
|
|
1390
|
-
title:
|
|
1390
|
+
}, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (m(), w("div", zl, [d(be, {
|
|
1391
|
+
subtitle: o(t)("menu.product.table.empty.subtitle"),
|
|
1392
|
+
title: o(t)("menu.product.table.empty.title")
|
|
1391
1393
|
}, {
|
|
1392
|
-
action: T(() => [g("div",
|
|
1393
|
-
variant:
|
|
1394
|
-
label:
|
|
1394
|
+
action: T(() => [g("div", Dl, [d(p, {
|
|
1395
|
+
variant: o(ee).Primary,
|
|
1396
|
+
label: o(t)("menu.product.table.empty.actions.add"),
|
|
1395
1397
|
"prepend-icon": "add",
|
|
1396
|
-
onClick:
|
|
1397
|
-
}, null, 8, ["variant", "label"]), d(
|
|
1398
|
+
onClick: a[4] || (a[4] = (_) => o(f).create(null))
|
|
1399
|
+
}, null, 8, ["variant", "label"]), d(Je, null, {
|
|
1398
1400
|
default: T(({
|
|
1399
1401
|
trigger: _
|
|
1400
1402
|
}) => [d(p, {
|
|
1401
|
-
"bg-color":
|
|
1402
|
-
"text-color":
|
|
1403
|
-
variant:
|
|
1404
|
-
label:
|
|
1403
|
+
"bg-color": o(W).NeutralGray100,
|
|
1404
|
+
"text-color": o(W).NeutralGray400,
|
|
1405
|
+
variant: o(ee).Primary,
|
|
1406
|
+
label: o(t)("menu.product.table.empty.actions.import"),
|
|
1405
1407
|
"prepend-icon": "download",
|
|
1406
1408
|
onClick: _
|
|
1407
1409
|
}, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])]),
|
|
@@ -1421,10 +1423,10 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1421
1423
|
}, aa = { class: "flex flex-col flex-1 overflow-hidden" }, oa = {
|
|
1422
1424
|
key: 1,
|
|
1423
1425
|
class: "pt-16 xs:pt-8 space-y-24"
|
|
1424
|
-
}, ra = { class: "flex items-center gap-8 px-16" }, Fa = /* @__PURE__ */
|
|
1426
|
+
}, ra = { class: "flex items-center gap-8 px-16" }, Fa = /* @__PURE__ */ j({
|
|
1425
1427
|
__name: "Product",
|
|
1426
|
-
setup(
|
|
1427
|
-
const e = Fe(), i =
|
|
1428
|
+
setup(C) {
|
|
1429
|
+
const e = Fe(), i = h(() => e.rules.item), n = rt(), t = h(() => !e.state.currentCatalogId), u = h(() => e.rules.item), l = h(() => !e.state.currentSchedulerId), v = F(!1), f = F(!1), s = h(() => {
|
|
1428
1430
|
var $, P, A, ue;
|
|
1429
1431
|
if (t.value && l.value) return;
|
|
1430
1432
|
if (l.value) {
|
|
@@ -1435,10 +1437,10 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1435
1437
|
}, {}) : {};
|
|
1436
1438
|
}
|
|
1437
1439
|
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((q, E) => (E.combinationKey || (q[E._id] = E), q), {});
|
|
1438
|
-
}), b = F({}), y = F({}),
|
|
1440
|
+
}), b = F({}), y = F({}), k = async () => {
|
|
1439
1441
|
var ue, q;
|
|
1440
1442
|
f.value = !0;
|
|
1441
|
-
const R = !!s.value, $ = ge.flatten(Y.value.map((E) => E.items)), P = R && v.value ? await
|
|
1443
|
+
const R = !!s.value, $ = ge.flatten(Y.value.map((E) => E.items)), P = R && v.value ? await It(
|
|
1442
1444
|
e.mergedMenu,
|
|
1443
1445
|
$,
|
|
1444
1446
|
e.state.menu,
|
|
@@ -1466,23 +1468,23 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1466
1468
|
}, E;
|
|
1467
1469
|
}, {});
|
|
1468
1470
|
b.value = A, y.value = { ...A }, f.value = !1;
|
|
1469
|
-
}, { categories:
|
|
1471
|
+
}, { categories: z, selectedCategories: Y } = Se(), S = F(null);
|
|
1470
1472
|
function oe() {
|
|
1471
|
-
|
|
1473
|
+
S.value && S.value.toggleAttributeFilter();
|
|
1472
1474
|
}
|
|
1473
|
-
|
|
1474
|
-
Y.value && await
|
|
1475
|
+
lt(async () => {
|
|
1476
|
+
Y.value && await k();
|
|
1475
1477
|
});
|
|
1476
1478
|
function J() {
|
|
1477
1479
|
n.create(null);
|
|
1478
1480
|
}
|
|
1479
1481
|
const re = () => {
|
|
1480
|
-
Y.value &&
|
|
1481
|
-
}, { t: L } = Ie(), B =
|
|
1482
|
+
Y.value && k();
|
|
1483
|
+
}, { t: L } = Ie(), B = h(() => {
|
|
1482
1484
|
var R, $;
|
|
1483
1485
|
return ($ = (R = e.currentCatalog) == null ? void 0 : R.linkItemRules) == null ? void 0 : $.length;
|
|
1484
1486
|
}), {
|
|
1485
|
-
menuItems:
|
|
1487
|
+
menuItems: D,
|
|
1486
1488
|
categories: H,
|
|
1487
1489
|
linkItemRules: Z,
|
|
1488
1490
|
handleSubmit: ne,
|
|
@@ -1490,14 +1492,14 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1490
1492
|
schedulerManager: se
|
|
1491
1493
|
} = kt(!1);
|
|
1492
1494
|
return (R, $) => {
|
|
1493
|
-
const P =
|
|
1494
|
-
return
|
|
1495
|
+
const P = N("fm-button");
|
|
1496
|
+
return o(z).length ? (m(), w("div", ta, [
|
|
1495
1497
|
g("div", la, [
|
|
1496
1498
|
g("div", aa, [
|
|
1497
|
-
|
|
1499
|
+
o(Y) ? (m(), I(ea, {
|
|
1498
1500
|
key: 0,
|
|
1499
1501
|
ref_key: "productTableRef",
|
|
1500
|
-
ref:
|
|
1502
|
+
ref: S,
|
|
1501
1503
|
"is-calculating": f.value,
|
|
1502
1504
|
"model-value": b.value,
|
|
1503
1505
|
"original-value": y.value,
|
|
@@ -1506,12 +1508,12 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1506
1508
|
"onUpdate:editing": $[2] || ($[2] = (A) => v.value = A)
|
|
1507
1509
|
}, {
|
|
1508
1510
|
filter: T(() => [
|
|
1509
|
-
d(
|
|
1511
|
+
d(Qe, { onToggleAttributeFilter: oe }),
|
|
1510
1512
|
u.value.multiScheduler ? (m(), I(qe, { key: 0 })) : M("", !0),
|
|
1511
1513
|
B.value ? (m(), I(Le, {
|
|
1512
1514
|
key: 1,
|
|
1513
|
-
"current-restaurant-attr-params":
|
|
1514
|
-
onConfirm: $[0] || ($[0] = (A) =>
|
|
1515
|
+
"current-restaurant-attr-params": o(e).state.currentRestaurantAttrParams,
|
|
1516
|
+
onConfirm: $[0] || ($[0] = (A) => o(e).setRestaurantAttrParams(A))
|
|
1515
1517
|
}, null, 8, ["current-restaurant-attr-params"])) : M("", !0)
|
|
1516
1518
|
]),
|
|
1517
1519
|
_: 1
|
|
@@ -1520,42 +1522,42 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1520
1522
|
])
|
|
1521
1523
|
])) : (m(), w("div", oa, [
|
|
1522
1524
|
g("div", ra, [
|
|
1523
|
-
d(
|
|
1525
|
+
d(Qe),
|
|
1524
1526
|
u.value.multiScheduler ? (m(), I(qe, { key: 0 })) : M("", !0),
|
|
1525
1527
|
B.value ? (m(), I(Le, {
|
|
1526
1528
|
key: 1,
|
|
1527
|
-
"current-restaurant-attr-params":
|
|
1528
|
-
onConfirm: $[3] || ($[3] = (A) =>
|
|
1529
|
+
"current-restaurant-attr-params": o(e).state.currentRestaurantAttrParams,
|
|
1530
|
+
onConfirm: $[3] || ($[3] = (A) => o(e).setRestaurantAttrParams(A))
|
|
1529
1531
|
}, null, 8, ["current-restaurant-attr-params"])) : M("", !0)
|
|
1530
1532
|
]),
|
|
1531
1533
|
i.value.create ? (m(), I(be, {
|
|
1532
1534
|
key: 0,
|
|
1533
1535
|
action: {
|
|
1534
|
-
text:
|
|
1536
|
+
text: o(L)("menu.product.empty.with_create.action"),
|
|
1535
1537
|
callback: J
|
|
1536
1538
|
},
|
|
1537
|
-
subtitle:
|
|
1538
|
-
title:
|
|
1539
|
+
subtitle: o(L)("menu.product.empty.with_create.subtitle"),
|
|
1540
|
+
title: o(L)("menu.product.empty.with_create.title")
|
|
1539
1541
|
}, null, 8, ["action", "subtitle", "title"])) : l.value ? (m(), I(be, {
|
|
1540
1542
|
key: 1,
|
|
1541
|
-
subtitle:
|
|
1542
|
-
title:
|
|
1543
|
+
subtitle: o(L)("menu.product.empty.no_scheduler.subtitle"),
|
|
1544
|
+
title: o(L)("menu.product.empty.no_scheduler.title")
|
|
1543
1545
|
}, {
|
|
1544
1546
|
action: T(() => [
|
|
1545
1547
|
d(Ge, {
|
|
1546
|
-
"categorized-items":
|
|
1547
|
-
"initial-value":
|
|
1548
|
+
"categorized-items": o(Q).linkableItems.value,
|
|
1549
|
+
"initial-value": o(Q).currentItems.value,
|
|
1548
1550
|
"show-variant": !1,
|
|
1549
|
-
"menu-items":
|
|
1550
|
-
categories:
|
|
1551
|
-
"link-item-rules":
|
|
1551
|
+
"menu-items": o(D),
|
|
1552
|
+
categories: o(H),
|
|
1553
|
+
"link-item-rules": o(Z),
|
|
1552
1554
|
"no-scheduler": l.value,
|
|
1553
1555
|
"is-local-only": !0,
|
|
1554
|
-
onSubmit:
|
|
1556
|
+
onSubmit: o(ne)
|
|
1555
1557
|
}, {
|
|
1556
1558
|
default: T(({ trigger: A }) => [
|
|
1557
1559
|
d(P, {
|
|
1558
|
-
label:
|
|
1560
|
+
label: o(L)("menu.common.actions.link_product"),
|
|
1559
1561
|
"prepend-icon": "link",
|
|
1560
1562
|
onClick: A
|
|
1561
1563
|
}, null, 8, ["label", "onClick"])
|
|
@@ -1566,24 +1568,24 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1566
1568
|
_: 1
|
|
1567
1569
|
}, 8, ["subtitle", "title"])) : (m(), I(be, {
|
|
1568
1570
|
key: 2,
|
|
1569
|
-
subtitle:
|
|
1570
|
-
title:
|
|
1571
|
+
subtitle: o(L)("menu.product.empty.with_scheduler.subtitle"),
|
|
1572
|
+
title: o(L)("menu.product.empty.with_scheduler.title")
|
|
1571
1573
|
}, {
|
|
1572
1574
|
action: T(() => [
|
|
1573
1575
|
d(Ge, {
|
|
1574
|
-
"categorized-items":
|
|
1575
|
-
"initial-value":
|
|
1576
|
+
"categorized-items": o(se).linkableItems.value,
|
|
1577
|
+
"initial-value": o(se).currentItems.value,
|
|
1576
1578
|
"show-variant": !1,
|
|
1577
|
-
"menu-items":
|
|
1578
|
-
categories:
|
|
1579
|
-
"link-item-rules":
|
|
1579
|
+
"menu-items": o(D),
|
|
1580
|
+
categories: o(H),
|
|
1581
|
+
"link-item-rules": o(Z),
|
|
1580
1582
|
"no-scheduler": l.value,
|
|
1581
1583
|
"is-local-only": !0,
|
|
1582
|
-
onSubmit:
|
|
1584
|
+
onSubmit: o(ne)
|
|
1583
1585
|
}, {
|
|
1584
1586
|
default: T(({ trigger: A }) => [
|
|
1585
1587
|
d(P, {
|
|
1586
|
-
label:
|
|
1588
|
+
label: o(L)("menu.common.actions.apply_product"),
|
|
1587
1589
|
onClick: A
|
|
1588
1590
|
}, null, 8, ["label", "onClick"])
|
|
1589
1591
|
]),
|
|
@@ -1597,6 +1599,6 @@ const Ye = /* @__PURE__ */ N({
|
|
|
1597
1599
|
}
|
|
1598
1600
|
});
|
|
1599
1601
|
export {
|
|
1600
|
-
|
|
1602
|
+
Je as _,
|
|
1601
1603
|
Fa as a
|
|
1602
1604
|
};
|