@feedmepos/mf-menu 0.31.40-prod → 0.31.41-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-aWEH-ZEk.js → App-5Lzy8zHZ.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-jJyinQZl.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BnKXsQH-.js} +3 -3
- package/dist/{Catalog-BoFfFdn8.js → Catalog-s5b8V8nw.js} +8 -9
- package/dist/{Category-CWYbb3Jn.js → Category-BJzScJEY.js} +4 -4
- package/dist/{Category-DZ45uikR.js → Category-DZ-xqIMI.js} +6 -6
- package/dist/{CookingGuide-BU0PRWIQ.js → CookingGuide-Bkd6GPww.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-B8tIjKOW.js} +1 -1
- package/dist/{Group-BMQDeqiS.js → Group-0b2Qiov3.js} +1 -1
- package/dist/{Group-C0T_uknK.js → Group-BOaCcKiI.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DyfmY6F1.js → Group.vue_vue_type_script_setup_true_lang-DUlUfMAs.js} +8 -8
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CouimeC4.js +399 -0
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DOvQmbrZ.js} +13 -14
- package/dist/{Ingredient-3lwDUQx_.js → Ingredient-ChcYUvOg.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-VLrrTkSC.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DE1HkipX.js} +2 -2
- package/dist/LinkProductSideSheet-BdzBGYxG.js +361 -0
- package/dist/MenuSetting-zAAttaoA.js +618 -0
- package/dist/{PrintRoute-DfJ-vUAb.js → PrintRoute-T-vuO5N8.js} +4 -4
- package/dist/{Product-F4PoLm9v.js → Product-B5q291VF.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js → Product.vue_vue_type_script_setup_true_lang-DLRlT10W.js} +468 -465
- package/dist/{ProductInternalTools-DSGU-OqU.js → ProductInternalTools-BOlc0VUR.js} +5 -5
- package/dist/{Products-COzW2Z4g.js → Products-Cd4Mqhm3.js} +88 -85
- package/dist/{Publish-CDXVWCk2.js → Publish-SuRzt-_D.js} +3 -3
- package/dist/{Recipe-BZx4wrcP.js → Recipe-BKrjNs5g.js} +4 -4
- package/dist/{Scheduler-wHCWSeU2.js → Scheduler-DnDgImLC.js} +3 -3
- package/dist/{ServingSequence-BbYEhDYh.js → ServingSequence-D602bVnm.js} +3 -3
- package/dist/{Setting-C9Tlw1Iy.js → Setting-FMT4oBYH.js} +44 -45
- package/dist/{Subcategory-C8AwfrKb.js → Subcategory-CpYmjAvA.js} +4 -4
- package/dist/{Takeaway-t1053wg2.js → Takeaway-BXh3iuME.js} +1 -1
- package/dist/{Takeaway-DaEUn-yM.js → Takeaway-D4hjN5z5.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js → Takeaway.vue_vue_type_script_setup_true_lang-By1f-FCO.js} +5 -5
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-CZUwa5C_.js +440 -0
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ci6iqOry.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DfjtfcCh.js} +604 -600
- package/dist/{Unit-CnqptGCz.js → Unit-CsjHkV-h.js} +2 -2
- package/dist/{Variant-DiOYOwJs.js → Variant-Djra14ZX.js} +3 -3
- package/dist/{_id_-BSfU16VO.js → _id_-BXkqoCzB.js} +78 -75
- package/dist/{app-Ddb81PNo.js → app-CVqWWV4x.js} +278 -278
- package/dist/{LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js → app-CiBqmBzO.js} +2120 -2084
- package/dist/{app-Cou6qPF2.js → app-PhBJNss_.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/menu.d.ts +2 -1
- package/dist/apps/mf-menu/src/app.d.ts +144 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +36 -0
- package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +9 -3
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +294 -4
- package/dist/apps/mf-menu/src/composable/attributes.d.ts +26 -0
- package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +40 -0
- package/dist/apps/mf-menu/src/helper/import-export.d.ts +285 -0
- package/dist/apps/mf-menu/src/helper/menu.d.ts +285 -0
- package/dist/apps/mf-menu/src/manager/menu/item.d.ts +285 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +293 -3
- package/dist/apps/mf-menu/src/utils/array.d.ts +1 -0
- package/dist/apps/mf-menu/src/utils/customAttributes.d.ts +12 -0
- package/dist/apps/mf-menu/src/views/MenuSetting/LinkProductRuleGroups.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/MenuSetting/RuleGroupSideSheet.vue.d.ts +176 -0
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +166 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-WlVAcpRn.js +13 -0
- package/dist/assets/override-menu-__h4D7ac.js +13 -0
- package/dist/assets/validate-menu-DyPuzLRg.js +13 -0
- package/dist/{catalog-DSuJhsUb.js → catalog-C_TuQLxq.js} +1 -1
- package/dist/{catalogSetting-C3gEw9ov.js → catalogSetting-BUlJu6hG.js} +1 -1
- package/dist/{category-CwWq3KCE.js → category-CmVw1Kj-.js} +1 -1
- package/dist/{currency-g45Sh-t6.js → currency-OhOTnAqk.js} +1 -1
- package/dist/customAttributes-fpOfmGnw.js +180 -0
- package/dist/{dayjs.min-g3eN5z-V.js → dayjs.min-CDhP-7L5.js} +1 -1
- package/dist/{index-QsLFbxyG.js → index-BJZEWB5C.js} +4 -4
- package/dist/{index-BLQCYEc6.js → index-DHAYGEPp.js} +7 -8
- package/dist/{index-0yRUi7LL.js → index-DtwHmS38.js} +1 -1
- package/dist/index-N3cGc8ex.js +245 -0
- package/dist/{item-BvvQ9urP.js → item-BELLphR0.js} +16 -16
- package/dist/{jszip.min-DzdUiaR4.js → jszip.min-CZtcGb7A.js} +353 -353
- package/dist/{menu-QrVg2Ph7.js → menu-Csyr6W9A.js} +7 -7
- package/dist/{menu-DFNvhoNQ.js → menu-DS_ERmBf.js} +23355 -23206
- package/dist/{menuV2-Ezf_jW40.js → menuV2-DKzAZ4Ss.js} +151 -146
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-zENsn3P_.js → priceTier-CYWS5lDS.js} +1 -1
- package/dist/{scheduler-BuwGSv6A.js → scheduler-DI5dXC7Y.js} +8 -8
- package/dist/{subcategory-O3L_zCJA.js → subcategory-D_ao-IV9.js} +2 -2
- package/dist/{toExcel-CpRy_4nG.js → toExcel-Cml-rkJQ.js} +2 -2
- package/dist/{unit-Ct_7Hfa2.js → unit-BWDp2LkV.js} +42 -41
- package/package.json +3 -3
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +0 -50
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D6qro5w_.js +0 -367
- package/dist/LinkProductSideSheet-LDZjKX95.js +0 -297
- package/dist/MenuSetting-AhutsCVy.js +0 -185
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js +0 -431
- package/dist/assets/linked-status-B_crHhZH.js +0 -24
- package/dist/assets/override-menu-BmlCEpHH.js +0 -24
- package/dist/assets/validate-menu-CF-psoB-.js +0 -24
- package/dist/index-0Q5T9VZV.js +0 -214
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { u as
|
|
1
|
+
import { ref as V, computed as h, defineComponent as K, resolveComponent as z, createBlock as I, openBlock as m, withCtx as T, createElementVNode as g, createVNode as d, unref as a, createElementBlock as C, Fragment as pe, renderList as we, createCommentVNode as U, normalizeClass as ve, toDisplayString as B, 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 L, isRef as je, normalizeStyle as ft } from "vue";
|
|
2
|
+
import { u as Ve, Q as Ce, B as me, H as Re, I as ge, U as gt, aa as bt, ab as _t, ac as Pe, ad as yt, P as ht, ae as Ee } from "./menu-DS_ERmBf.js";
|
|
3
|
+
import { useI18n as Ie, useCoreStore as Oe, useCustomAttributes as xt } from "@feedmepos/mf-common";
|
|
4
|
+
import { u as Se } from "./menu-Csyr6W9A.js";
|
|
5
5
|
import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
|
|
6
|
-
import { L as
|
|
7
|
-
import { r as Ct, _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { f as wt, o as St, a as Ft, m as Vt } from "./menuV2-
|
|
11
|
-
import { u as
|
|
12
|
-
import { b as
|
|
13
|
-
import { useBreakpoints as
|
|
14
|
-
import { F as Pt } from "./index-
|
|
15
|
-
import { _ as
|
|
16
|
-
import { _ as
|
|
17
|
-
import { _ as Rt } from "./index-
|
|
18
|
-
import { r as Ut, _ as Mt } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { L as Ge } from "./LinkProductSideSheet-BdzBGYxG.js";
|
|
7
|
+
import { r as Ct, _ as Le } from "./index-N3cGc8ex.js";
|
|
8
|
+
import { _ as Ue, a as qe } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-B8tIjKOW.js";
|
|
9
|
+
import { _ as Me, u as kt } from "./Thumbnail.vue_vue_type_script_setup_true_lang-CZUwa5C_.js";
|
|
10
|
+
import { f as wt, o as St, a as Ft, m as Vt } from "./menuV2-DKzAZ4Ss.js";
|
|
11
|
+
import { u as ot, C as It } from "./item-BELLphR0.js";
|
|
12
|
+
import { b as We, H as $t } from "./app-CiBqmBzO.js";
|
|
13
|
+
import { useBreakpoints as rt, components as te, useDialog as Tt, FmButtonColorThemeVariant as q, FmButtonVariant as ee } from "@feedmepos/ui-library";
|
|
14
|
+
import { F as Pt } from "./index-DtwHmS38.js";
|
|
15
|
+
import { _ as ze, a as At } from "./app-CVqWWV4x.js";
|
|
16
|
+
import { _ as ke } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
17
|
+
import { _ as Rt } from "./index-BJZEWB5C.js";
|
|
18
|
+
import { r as Ut, _ as Mt } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-DOvQmbrZ.js";
|
|
19
19
|
import { c as Ot } from "./check-C9mY6LiX.js";
|
|
20
|
-
import { f as zt } from "./currency-
|
|
20
|
+
import { f as zt } from "./currency-OhOTnAqk.js";
|
|
21
21
|
import { w as Dt } from "./tooltip-B5BiPMx9.js";
|
|
22
22
|
function Bt(k, e) {
|
|
23
|
-
const
|
|
23
|
+
const n = V(!0), i = h(() => {
|
|
24
24
|
var s, f;
|
|
25
|
-
return !
|
|
25
|
+
return !n.value && (!e.value || ((s = e.value) == null ? void 0 : s.length) === ((f = k.value) == null ? void 0 : f.length));
|
|
26
26
|
}), l = h(() => {
|
|
27
27
|
var s, f, p, b;
|
|
28
28
|
return !!((s = e.value) != null && s.length && ((f = e.value) == null ? void 0 : f.length) > 0 && ((p = e.value) == null ? void 0 : p.length) < ((b = k.value) == null ? void 0 : b.length));
|
|
29
29
|
});
|
|
30
|
-
return { allCleared:
|
|
31
|
-
e.value = void 0,
|
|
30
|
+
return { allCleared: n, allSelected: i, indeterminate: l, toggleAll: () => {
|
|
31
|
+
e.value = void 0, n.value = !n.value;
|
|
32
32
|
}, toggleOption: (s) => {
|
|
33
33
|
var p, b, y;
|
|
34
34
|
let f;
|
|
35
|
-
e.value === void 0 &&
|
|
35
|
+
e.value === void 0 && n.value ? f = [s] : e.value === void 0 && !n.value ? f = (p = k.value.map((w) => w.value)) == null ? void 0 : p.filter((w) => w !== s) : (b = e.value) != null && b.includes(s) ? f = (y = e.value) == null ? void 0 : y.filter((w) => w !== s) : f = [...e.value || [], s], f.length === 0 ? (e.value = void 0, n.value = !0) : f.length === k.value.length ? (e.value = void 0, n.value = !1) : e.value = f;
|
|
36
36
|
} };
|
|
37
37
|
}
|
|
38
38
|
const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
39
39
|
key: 0,
|
|
40
|
-
class: /* @__PURE__ */
|
|
40
|
+
class: /* @__PURE__ */ ve([
|
|
41
41
|
"fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap",
|
|
42
42
|
"text-fm-color-neutral-gray-400"
|
|
43
43
|
])
|
|
44
|
-
}, jt = { class: "p-4" }, Et = { class: "flex-1 overflow-y-auto min-h-0" },
|
|
44
|
+
}, jt = { class: "p-4" }, Et = { class: "flex-1 overflow-y-auto min-h-0" }, He = /* @__PURE__ */ K({
|
|
45
45
|
__name: "CategorySelector",
|
|
46
46
|
emits: ["toggleAttributeFilter"],
|
|
47
47
|
setup(k, { emit: e }) {
|
|
48
|
-
const
|
|
48
|
+
const n = e, i = Ve(), { categories: l, selectedCategories: u } = Se(), t = h(() => i.state.currentCategoryIds), s = h(
|
|
49
49
|
() => l.value.map((D) => ({ label: D.name, value: D.id }))
|
|
50
50
|
), f = h(() => s.value.filter(
|
|
51
51
|
(D) => D.label.toLowerCase().includes(y.value.toLowerCase())
|
|
52
|
-
)), { t: p } =
|
|
53
|
-
var D, O,
|
|
54
|
-
return l.value.length === ((D = u.value) == null ? void 0 : D.length) ? p("menu.category.selector.all") : ((O = u.value) == null ? void 0 : O.length) === 1 ? u.value[0].name : `${(
|
|
55
|
-
}), y =
|
|
52
|
+
)), { t: p } = Ie(), b = h(() => {
|
|
53
|
+
var D, O, H;
|
|
54
|
+
return l.value.length === ((D = u.value) == null ? void 0 : D.length) ? p("menu.category.selector.all") : ((O = u.value) == null ? void 0 : O.length) === 1 ? u.value[0].name : `${(H = u.value) == null ? void 0 : H.length}`;
|
|
55
|
+
}), y = V(""), w = h({
|
|
56
56
|
get: () => t.value,
|
|
57
57
|
set: (D) => {
|
|
58
58
|
i.selectCategory(D);
|
|
59
59
|
}
|
|
60
|
-
}), { allSelected:
|
|
60
|
+
}), { allSelected: W, toggleAll: Y, toggleOption: S, indeterminate: oe } = Bt(
|
|
61
61
|
s,
|
|
62
62
|
w
|
|
63
|
-
), Z =
|
|
63
|
+
), Z = Oe(), re = h(() => Z.itemAttributeSettings.value.length > 0);
|
|
64
64
|
function E() {
|
|
65
|
-
|
|
65
|
+
n("toggleAttributeFilter");
|
|
66
66
|
}
|
|
67
67
|
return (D, O) => {
|
|
68
|
-
const
|
|
69
|
-
return m(),
|
|
68
|
+
const H = z("FmIcon"), J = z("FmChip"), ne = z("FmSearch"), Q = z("FmMenuItem"), se = z("FmMenu");
|
|
69
|
+
return m(), I(se, {
|
|
70
70
|
"close-on-click": !1,
|
|
71
71
|
width: 220
|
|
72
72
|
}, {
|
|
73
|
-
"menu-button":
|
|
73
|
+
"menu-button": T(() => [
|
|
74
74
|
g("div", Kt, [
|
|
75
75
|
d(J, null, {
|
|
76
|
-
default:
|
|
77
|
-
b.value ? (m(), C("div", Nt, B(a(p)("menu.category.selector.title", { label: b.value })), 1)) :
|
|
78
|
-
d(
|
|
76
|
+
default: T(() => [
|
|
77
|
+
b.value ? (m(), C("div", Nt, B(a(p)("menu.category.selector.title", { label: b.value })), 1)) : U("", !0),
|
|
78
|
+
d(H, {
|
|
79
79
|
color: "neutral-gray-400",
|
|
80
80
|
name: "expand_more",
|
|
81
81
|
size: "sm"
|
|
@@ -83,47 +83,47 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
83
83
|
re.value ? (m(), C("div", {
|
|
84
84
|
key: 1,
|
|
85
85
|
class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
|
|
86
|
-
onClick:
|
|
86
|
+
onClick: fe(E, ["stop"])
|
|
87
87
|
}, [
|
|
88
|
-
d(
|
|
88
|
+
d(H, {
|
|
89
89
|
name: "filter_alt",
|
|
90
90
|
outline: "",
|
|
91
91
|
color: "neutral-gray-400",
|
|
92
92
|
size: "sm",
|
|
93
|
-
onClick: O[0] || (O[0] =
|
|
93
|
+
onClick: O[0] || (O[0] = fe(() => {
|
|
94
94
|
}, ["prevent"]))
|
|
95
95
|
})
|
|
96
|
-
])) :
|
|
96
|
+
])) : U("", !0)
|
|
97
97
|
]),
|
|
98
98
|
_: 1
|
|
99
99
|
})
|
|
100
100
|
])
|
|
101
101
|
]),
|
|
102
|
-
default:
|
|
102
|
+
default: T(() => [
|
|
103
103
|
g("div", jt, [
|
|
104
|
-
d(
|
|
104
|
+
d(ne, {
|
|
105
105
|
autofocus: "",
|
|
106
106
|
modelValue: y.value,
|
|
107
|
-
"onUpdate:modelValue": O[1] || (O[1] = (
|
|
107
|
+
"onUpdate:modelValue": O[1] || (O[1] = (R) => y.value = R),
|
|
108
108
|
placeholder: a(p)("menu.common.actions.search")
|
|
109
109
|
}, null, 8, ["modelValue", "placeholder"])
|
|
110
110
|
]),
|
|
111
111
|
g("div", Et, [
|
|
112
|
-
d(
|
|
112
|
+
d(Q, {
|
|
113
113
|
label: "All",
|
|
114
114
|
"has-checkbox": "",
|
|
115
|
-
"model-value": a(
|
|
116
|
-
indeterminate: a(
|
|
115
|
+
"model-value": a(W),
|
|
116
|
+
indeterminate: a(oe),
|
|
117
117
|
onClick: a(Y)
|
|
118
118
|
}, null, 8, ["model-value", "indeterminate", "onClick"]),
|
|
119
|
-
(m(!0), C(
|
|
120
|
-
var
|
|
121
|
-
return m(),
|
|
122
|
-
key:
|
|
123
|
-
label:
|
|
119
|
+
(m(!0), C(pe, null, we(f.value, (R) => {
|
|
120
|
+
var $;
|
|
121
|
+
return m(), I(Q, {
|
|
122
|
+
key: R.value || "",
|
|
123
|
+
label: R.label,
|
|
124
124
|
"has-checkbox": "",
|
|
125
|
-
"model-value": a(
|
|
126
|
-
onClick: (
|
|
125
|
+
"model-value": a(W) || (($ = w.value) == null ? void 0 : $.includes(R.value)),
|
|
126
|
+
onClick: (P) => a(S)(R.value)
|
|
127
127
|
}, null, 8, ["label", "model-value", "onClick"]);
|
|
128
128
|
}), 128))
|
|
129
129
|
])
|
|
@@ -138,14 +138,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
138
138
|
}, Qt = { key: 0 }, Yt = {
|
|
139
139
|
key: 1,
|
|
140
140
|
class: "inline-block w-8"
|
|
141
|
-
}, Zt = { key: 0 }, Jt = { key: 1 },
|
|
141
|
+
}, Zt = { key: 0 }, Jt = { key: 1 }, Qe = /* @__PURE__ */ K({
|
|
142
142
|
__name: "CategoriesChip",
|
|
143
143
|
props: {
|
|
144
144
|
categories: { default: () => [] },
|
|
145
145
|
ellipsis: { type: Boolean, default: !0 }
|
|
146
146
|
},
|
|
147
147
|
setup(k) {
|
|
148
|
-
const e = k, { t:
|
|
148
|
+
const e = k, { t: n } = Ie(), i = rt(), l = h(() => i.breakpoints.value.xs), u = h(() => e.ellipsis ? l.value ? 1 : 2 : 1 / 0), t = h(() => e.categories.length <= u.value ? e.categories : e.categories.slice(0, u.value)), s = V(!0), f = h(() => {
|
|
149
149
|
if (s.value) {
|
|
150
150
|
const b = t.value.join(", ");
|
|
151
151
|
return b.length > 20 ? b.slice(0, 20) + "..." : b;
|
|
@@ -154,31 +154,31 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
154
154
|
});
|
|
155
155
|
return (p, b) => {
|
|
156
156
|
const y = z("FmTooltip");
|
|
157
|
-
return l.value ? (m(), C(
|
|
157
|
+
return l.value ? (m(), C(pe, { key: 1 }, [
|
|
158
158
|
p.categories.length > 0 ? (m(), C("p", Ht, [
|
|
159
|
-
g("span", null, B(a(
|
|
159
|
+
g("span", null, B(a(n)("menu.product.table.columns.category")) + ": ", 1),
|
|
160
160
|
g("span", null, B(f.value), 1),
|
|
161
161
|
s.value ? (m(), C("span", Yt)) : (m(), C("br", Qt)),
|
|
162
162
|
p.categories.length > u.value ? (m(), C("span", {
|
|
163
163
|
key: 2,
|
|
164
164
|
class: "fm-typo-en-body-md-400 text-fm-color-primary cursor-pointer",
|
|
165
|
-
onClick: b[0] || (b[0] =
|
|
165
|
+
onClick: b[0] || (b[0] = fe((w) => s.value = !s.value, ["stop", "prevent"]))
|
|
166
166
|
}, [
|
|
167
|
-
s.value ? (m(), C("span", Zt, B(a(
|
|
168
|
-
])) :
|
|
169
|
-
])) :
|
|
170
|
-
], 64)) : (m(),
|
|
167
|
+
s.value ? (m(), C("span", Zt, B(a(n)("menu.product.table.category.expand", { count: p.categories.length - u.value })), 1)) : (m(), C("span", Jt, B(a(n)("menu.product.table.category.collapse")), 1))
|
|
168
|
+
])) : U("", !0)
|
|
169
|
+
])) : U("", !0)
|
|
170
|
+
], 64)) : (m(), I(y, {
|
|
171
171
|
key: 0,
|
|
172
172
|
class: "flex",
|
|
173
173
|
variant: "rich",
|
|
174
174
|
placement: "top",
|
|
175
175
|
"z-index": 50
|
|
176
176
|
}, {
|
|
177
|
-
content:
|
|
177
|
+
content: T(() => [
|
|
178
178
|
g("div", Lt, [
|
|
179
|
-
g("p", qt, B(a(
|
|
179
|
+
g("p", qt, B(a(n)("menu.product.table.category.all")), 1),
|
|
180
180
|
g("div", Wt, [
|
|
181
|
-
(m(!0), C(
|
|
181
|
+
(m(!0), C(pe, null, we(e.categories, (w) => (m(), I(ke, {
|
|
182
182
|
key: w,
|
|
183
183
|
label: w,
|
|
184
184
|
variant: "neutral"
|
|
@@ -186,18 +186,18 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
186
186
|
])
|
|
187
187
|
])
|
|
188
188
|
]),
|
|
189
|
-
default:
|
|
189
|
+
default: T(() => [
|
|
190
190
|
g("div", Gt, [
|
|
191
|
-
(m(!0), C(
|
|
191
|
+
(m(!0), C(pe, null, we(t.value, (w) => (m(), I(ke, {
|
|
192
192
|
key: w,
|
|
193
193
|
label: w,
|
|
194
194
|
variant: "neutral"
|
|
195
195
|
}, null, 8, ["label"]))), 128)),
|
|
196
|
-
p.categories.length > u.value ? (m(),
|
|
196
|
+
p.categories.length > u.value ? (m(), I(ke, {
|
|
197
197
|
key: 0,
|
|
198
198
|
label: "...",
|
|
199
199
|
variant: "neutral"
|
|
200
|
-
})) :
|
|
200
|
+
})) : U("", !0)
|
|
201
201
|
])
|
|
202
202
|
]),
|
|
203
203
|
_: 1
|
|
@@ -206,7 +206,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
206
206
|
}
|
|
207
207
|
}), Xt = /* @__PURE__ */ K({
|
|
208
208
|
__name: "ProductSearcher",
|
|
209
|
-
props: /* @__PURE__ */
|
|
209
|
+
props: /* @__PURE__ */ Je({
|
|
210
210
|
label: {},
|
|
211
211
|
helperText: {},
|
|
212
212
|
menu: {}
|
|
@@ -216,15 +216,15 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
216
216
|
}),
|
|
217
217
|
emits: ["update:modelValue"],
|
|
218
218
|
setup(k) {
|
|
219
|
-
const e = k,
|
|
219
|
+
const e = k, n = Xe(k, "modelValue"), i = h(() => e.menu.modules.item.map((l) => ({
|
|
220
220
|
label: l.code ? `${l.code} ${l.name}` : l.name,
|
|
221
221
|
value: l._id
|
|
222
222
|
})));
|
|
223
223
|
return (l, u) => {
|
|
224
224
|
const t = z("FmSelect");
|
|
225
|
-
return m(),
|
|
226
|
-
modelValue:
|
|
227
|
-
"onUpdate:modelValue": u[0] || (u[0] = (s) =>
|
|
225
|
+
return m(), I(t, {
|
|
226
|
+
modelValue: n.value,
|
|
227
|
+
"onUpdate:modelValue": u[0] || (u[0] = (s) => n.value = s),
|
|
228
228
|
items: i.value,
|
|
229
229
|
searchable: !0,
|
|
230
230
|
"search-target": "label",
|
|
@@ -237,9 +237,9 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
237
237
|
}), el = { class: "flex" }, tl = { class: "w-[260px] space-y-16 h-full" }, ll = { class: "flex items-center gap-4 px-8" }, al = { class: "fm-typo-en-title-sm-600" }, ol = {
|
|
238
238
|
key: 0,
|
|
239
239
|
class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4"
|
|
240
|
-
},
|
|
240
|
+
}, rl = { class: "fm-typo-en-body-md-600" }, nl = { class: "flex-1" }, nt = /* @__PURE__ */ K({
|
|
241
241
|
__name: "ViewLayout",
|
|
242
|
-
props: /* @__PURE__ */
|
|
242
|
+
props: /* @__PURE__ */ Je({
|
|
243
243
|
title: {},
|
|
244
244
|
titleBadge: {},
|
|
245
245
|
items: {}
|
|
@@ -249,47 +249,47 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
249
249
|
}),
|
|
250
250
|
emits: ["update:modelValue"],
|
|
251
251
|
setup(k) {
|
|
252
|
-
const e =
|
|
253
|
-
return (
|
|
252
|
+
const e = Xe(k, "modelValue");
|
|
253
|
+
return (n, i) => {
|
|
254
254
|
const l = z("FmCollapsibleTabs");
|
|
255
255
|
return m(), C("div", el, [
|
|
256
256
|
g("div", tl, [
|
|
257
257
|
g("div", ll, [
|
|
258
|
-
g("p", al, B(
|
|
259
|
-
|
|
260
|
-
g("p",
|
|
261
|
-
])) :
|
|
258
|
+
g("p", al, B(n.title), 1),
|
|
259
|
+
n.titleBadge !== void 0 ? (m(), C("div", ol, [
|
|
260
|
+
g("p", rl, B(n.titleBadge), 1)
|
|
261
|
+
])) : U("", !0)
|
|
262
262
|
]),
|
|
263
|
-
d(
|
|
264
|
-
default:
|
|
263
|
+
d(ze, null, {
|
|
264
|
+
default: T(() => [
|
|
265
265
|
d(l, {
|
|
266
266
|
modelValue: e.value,
|
|
267
267
|
"onUpdate:modelValue": i[0] || (i[0] = (u) => e.value = u),
|
|
268
|
-
items:
|
|
268
|
+
items: n.items
|
|
269
269
|
}, null, 8, ["modelValue", "items"])
|
|
270
270
|
]),
|
|
271
271
|
_: 1
|
|
272
272
|
})
|
|
273
273
|
]),
|
|
274
274
|
i[1] || (i[1] = g("div", { class: "w-[1px] min-h-full ml-4 mr-12 bg-fm-color-neutral-gray-100 self-stretch" }, null, -1)),
|
|
275
|
-
g("div",
|
|
276
|
-
_e(
|
|
275
|
+
g("div", nl, [
|
|
276
|
+
_e(n.$slots, "default")
|
|
277
277
|
])
|
|
278
278
|
]);
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
}),
|
|
281
|
+
}), Fe = /* @__PURE__ */ K({
|
|
282
282
|
__name: "OrderFromChip",
|
|
283
283
|
props: {
|
|
284
284
|
orderFrom: {}
|
|
285
285
|
},
|
|
286
286
|
setup(k) {
|
|
287
|
-
const e = k,
|
|
287
|
+
const e = k, n = Ce();
|
|
288
288
|
return (i, l) => {
|
|
289
289
|
var u, t;
|
|
290
|
-
return m(),
|
|
291
|
-
label: ((u = a(
|
|
292
|
-
variant: (t = a(
|
|
290
|
+
return m(), I(ke, {
|
|
291
|
+
label: ((u = a(n)[e.orderFrom]) == null ? void 0 : u.label) || e.orderFrom,
|
|
292
|
+
variant: (t = a(n)[e.orderFrom]) == null ? void 0 : t.variant
|
|
293
293
|
}, null, 8, ["label", "variant"]);
|
|
294
294
|
};
|
|
295
295
|
}
|
|
@@ -299,7 +299,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
299
299
|
data: {}
|
|
300
300
|
},
|
|
301
301
|
setup(k) {
|
|
302
|
-
const e = k,
|
|
302
|
+
const e = k, n = [{
|
|
303
303
|
accessorKey: "code",
|
|
304
304
|
header: () => "Code",
|
|
305
305
|
enableSorting: !1,
|
|
@@ -309,12 +309,12 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
309
309
|
const s = t.original;
|
|
310
310
|
return s.subRows ? d("div", {
|
|
311
311
|
class: "flex items-center gap-2 fm-typo-en-body-md-600 text-fm-color-typo-secondary"
|
|
312
|
-
}, [d(
|
|
312
|
+
}, [d(te.FmButton, {
|
|
313
313
|
icon: "keyboard_arrow_up",
|
|
314
314
|
variant: "tertiary",
|
|
315
315
|
class: ["cursor-pointer", "transition-transform", t.getIsExpanded() ? "transform rotate-180" : ""],
|
|
316
316
|
onClick: t.getToggleExpandedHandler()
|
|
317
|
-
}, null),
|
|
317
|
+
}, null), et("Found in group: "), s.groupName]) : s.code;
|
|
318
318
|
},
|
|
319
319
|
meta: {
|
|
320
320
|
colspan: (t) => t.original.subRows ? 5 : 1
|
|
@@ -346,24 +346,24 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
346
346
|
enableSorting: !1,
|
|
347
347
|
cell: (t) => {
|
|
348
348
|
const s = t.row.original;
|
|
349
|
-
return d(
|
|
349
|
+
return d(Fe, {
|
|
350
350
|
orderFrom: s.orderFrom ?? ""
|
|
351
351
|
}, null);
|
|
352
352
|
},
|
|
353
353
|
meta: {
|
|
354
354
|
colspan: (t) => t.original.subRows ? 0 : 1
|
|
355
355
|
}
|
|
356
|
-
}], i =
|
|
356
|
+
}], i = V({}), l = (t) => t.subRows;
|
|
357
357
|
function u() {
|
|
358
358
|
i.value = Object.fromEntries(e.data.map((t, s) => [s, !0]));
|
|
359
359
|
}
|
|
360
|
-
return
|
|
360
|
+
return de(() => e.data, () => {
|
|
361
361
|
u();
|
|
362
362
|
}), (t, s) => {
|
|
363
363
|
const f = z("FmTable");
|
|
364
|
-
return m(),
|
|
365
|
-
default:
|
|
366
|
-
"column-defs":
|
|
364
|
+
return m(), I(ze, null, {
|
|
365
|
+
default: T(() => [d(f, {
|
|
366
|
+
"column-defs": n,
|
|
367
367
|
"row-data": t.data,
|
|
368
368
|
"hide-footer": !0,
|
|
369
369
|
"page-size": 1e6,
|
|
@@ -383,15 +383,15 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
383
383
|
menu: {}
|
|
384
384
|
},
|
|
385
385
|
setup(k) {
|
|
386
|
-
const e = k,
|
|
387
|
-
const p = l.value.find((y) => y.value ===
|
|
386
|
+
const e = k, n = V(""), i = h(() => l.value.reduce((p, b) => p + (typeof b.badge == "number" ? b.badge ?? 1 : 0), 0)), l = V([]), u = h(() => {
|
|
387
|
+
const p = l.value.find((y) => y.value === n.value);
|
|
388
388
|
return ((p == null ? void 0 : p.itemInGroup) || []).map((y) => ({
|
|
389
389
|
groupName: y.group.name,
|
|
390
390
|
subRows: y.items.map((w) => ({
|
|
391
391
|
// @ts-ignore
|
|
392
392
|
code: w.code || w.fallbackCode,
|
|
393
393
|
productName: w.combinationKey ? "" : w.name ?? "",
|
|
394
|
-
price: w.price ?
|
|
394
|
+
price: w.price ? me.Dinero.fromFdoDinero(w.price).toFormat() : "--",
|
|
395
395
|
orderFrom: w.orderFrom ?? void 0,
|
|
396
396
|
variant: w.combinationKey ? w.name ?? "" : void 0
|
|
397
397
|
}))
|
|
@@ -416,14 +416,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
416
416
|
itemInGroup: []
|
|
417
417
|
}))];
|
|
418
418
|
}
|
|
419
|
-
h(() => l.value.find((p) => p.value ===
|
|
419
|
+
h(() => l.value.find((p) => p.value === n.value));
|
|
420
420
|
async function s(p) {
|
|
421
421
|
const b = l.value.find((y) => y.catalogId === p);
|
|
422
422
|
if (b) {
|
|
423
|
-
b.badge = () => d(
|
|
423
|
+
b.badge = () => d(te.FmCircularProgress, {
|
|
424
424
|
size: "md"
|
|
425
425
|
}, null);
|
|
426
|
-
const y = await wt(
|
|
426
|
+
const y = await wt(Re(e.menu), p, e.itemId);
|
|
427
427
|
b.badge = y.length, b.disabled = y.length <= 0, b.itemInGroup = y;
|
|
428
428
|
}
|
|
429
429
|
}
|
|
@@ -432,18 +432,18 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
432
432
|
s(p.catalogId);
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
|
-
return
|
|
435
|
+
return de([() => e.menu, () => e.itemId], () => {
|
|
436
436
|
e.menu && e.itemId && f();
|
|
437
437
|
}, {
|
|
438
438
|
immediate: !0
|
|
439
|
-
}), (p, b) => (m(),
|
|
440
|
-
modelValue:
|
|
441
|
-
"onUpdate:modelValue": b[0] || (b[0] = (y) =>
|
|
439
|
+
}), (p, b) => (m(), I(nt, {
|
|
440
|
+
modelValue: n.value,
|
|
441
|
+
"onUpdate:modelValue": b[0] || (b[0] = (y) => n.value = y),
|
|
442
442
|
items: l.value,
|
|
443
443
|
title: "Catalog",
|
|
444
444
|
"title-badge": i.value
|
|
445
445
|
}, {
|
|
446
|
-
default:
|
|
446
|
+
default: T(() => [d(sl, {
|
|
447
447
|
data: u.value
|
|
448
448
|
}, null, 8, ["data"])]),
|
|
449
449
|
_: 1
|
|
@@ -460,12 +460,12 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
460
460
|
schedulerIds: {}
|
|
461
461
|
},
|
|
462
462
|
setup(k) {
|
|
463
|
-
const e = k,
|
|
463
|
+
const e = k, n = [{
|
|
464
464
|
accessorKey: "scheduler",
|
|
465
465
|
header: () => "Scheduler",
|
|
466
466
|
enableSorting: !1,
|
|
467
467
|
cell: (u) => {
|
|
468
|
-
const t = u.row.original, s = t.loading ? d(
|
|
468
|
+
const t = u.row.original, s = t.loading ? d(te.FmCircularProgress, {
|
|
469
469
|
size: "md"
|
|
470
470
|
}, null) : null;
|
|
471
471
|
return d("div", {
|
|
@@ -489,12 +489,12 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
489
489
|
header: () => "Order from",
|
|
490
490
|
cell: (u) => {
|
|
491
491
|
const t = u.row.original;
|
|
492
|
-
return d(
|
|
492
|
+
return d(Fe, {
|
|
493
493
|
orderFrom: t.orderFrom
|
|
494
494
|
}, null);
|
|
495
495
|
},
|
|
496
496
|
enableSorting: !1
|
|
497
|
-
}], i =
|
|
497
|
+
}], i = V([]);
|
|
498
498
|
function l(u, t) {
|
|
499
499
|
return {
|
|
500
500
|
loading: !0,
|
|
@@ -506,23 +506,23 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
506
506
|
orderFrom: "--"
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
|
-
return
|
|
509
|
+
return de([() => e.menu, () => e.catalogId, () => e.schedulerIds], async () => {
|
|
510
510
|
i.value = [l(null, "All day"), ...e.schedulerIds.map((u) => {
|
|
511
511
|
var t;
|
|
512
512
|
return l(u, ((t = e.menu.modules.scheduler.find((s) => s._id === u)) == null ? void 0 : t.name) || "Unknown");
|
|
513
513
|
})], i.value.forEach(async (u) => {
|
|
514
|
-
const s = (await St(
|
|
514
|
+
const s = (await St(Re(e.menu), e.catalogId, u.schedulerId)).modules.item.find((p) => p._id === e.itemId), f = i.value.findIndex((p) => p.schedulerId === u.schedulerId);
|
|
515
515
|
if (s) {
|
|
516
|
-
const p =
|
|
517
|
-
p[f].loading = !1, p[f].code = s.code || "--", p[f].productName = s.name || "--", p[f].price =
|
|
516
|
+
const p = Re(i.value);
|
|
517
|
+
p[f].loading = !1, p[f].code = s.code || "--", p[f].productName = s.name || "--", p[f].price = me.Dinero.fromFdoDinero(s.price).toFormat(), p[f].orderFrom = s.orderFrom || "--", i.value = p;
|
|
518
518
|
}
|
|
519
519
|
});
|
|
520
520
|
}), (u, t) => {
|
|
521
521
|
const s = z("FmTable");
|
|
522
|
-
return m(),
|
|
523
|
-
default:
|
|
522
|
+
return m(), I(ze, null, {
|
|
523
|
+
default: T(() => [g("div", il, [d(s, {
|
|
524
524
|
class: "min-w-[800px]",
|
|
525
|
-
"column-defs":
|
|
525
|
+
"column-defs": n,
|
|
526
526
|
"row-data": i.value,
|
|
527
527
|
"hide-footer": !0,
|
|
528
528
|
"page-size": i.value.length,
|
|
@@ -539,23 +539,23 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
539
539
|
menu: {}
|
|
540
540
|
},
|
|
541
541
|
setup(k) {
|
|
542
|
-
const e = k,
|
|
543
|
-
|
|
544
|
-
|
|
542
|
+
const e = k, n = V(null);
|
|
543
|
+
tt(async () => {
|
|
544
|
+
n.value = await Ft(e.menu, e.itemId), await Ae(), i.value = l.value[0].value;
|
|
545
545
|
});
|
|
546
|
-
const i =
|
|
546
|
+
const i = V(""), l = h(() => {
|
|
547
547
|
var f, p;
|
|
548
548
|
const t = {
|
|
549
549
|
label: "Master product",
|
|
550
550
|
value: "",
|
|
551
551
|
catalogId: null,
|
|
552
|
-
badge: (((f =
|
|
553
|
-
schedulerIds: (p =
|
|
552
|
+
badge: (((f = n.value) == null ? void 0 : f.schedulers.length) || 0) + 1,
|
|
553
|
+
schedulerIds: (p = n.value) == null ? void 0 : p.schedulers
|
|
554
554
|
};
|
|
555
|
-
if (!
|
|
555
|
+
if (!n.value)
|
|
556
556
|
return [t];
|
|
557
557
|
const s = e.menu.modules.catalog.map((b) => {
|
|
558
|
-
const y =
|
|
558
|
+
const y = n.value.catalogs[b._id];
|
|
559
559
|
return {
|
|
560
560
|
label: b.name,
|
|
561
561
|
value: b._id,
|
|
@@ -567,14 +567,14 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
567
567
|
});
|
|
568
568
|
return [t, ...s];
|
|
569
569
|
}), u = h(() => l.value.find((t) => t.value === i.value));
|
|
570
|
-
return (t, s) => (m(),
|
|
570
|
+
return (t, s) => (m(), I(nt, {
|
|
571
571
|
modelValue: i.value,
|
|
572
572
|
"onUpdate:modelValue": s[0] || (s[0] = (f) => i.value = f),
|
|
573
573
|
items: l.value,
|
|
574
574
|
title: "Catalog",
|
|
575
575
|
"title-badge": l.value.filter((f) => !f.disabled).length
|
|
576
576
|
}, {
|
|
577
|
-
default:
|
|
577
|
+
default: T(() => {
|
|
578
578
|
var f, p;
|
|
579
579
|
return [
|
|
580
580
|
d(cl, {
|
|
@@ -598,34 +598,34 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
598
598
|
menu: {}
|
|
599
599
|
},
|
|
600
600
|
setup(k) {
|
|
601
|
-
const e = k,
|
|
601
|
+
const e = k, n = h(() => e.menu.modules.item.find((l) => l._id === e.itemId)), i = h(() => {
|
|
602
602
|
var l;
|
|
603
|
-
return
|
|
603
|
+
return me.Dinero.fromFdoDinero((l = n.value) == null ? void 0 : l.price).toFormat(!0);
|
|
604
604
|
});
|
|
605
605
|
return (l, u) => {
|
|
606
606
|
var t, s, f, p, b, y, w;
|
|
607
607
|
return m(), C("div", ml, [
|
|
608
|
-
d(
|
|
609
|
-
alt: ((t =
|
|
608
|
+
d(Me, {
|
|
609
|
+
alt: ((t = n.value) == null ? void 0 : t.name) ?? null,
|
|
610
610
|
size: 72,
|
|
611
|
-
src: (s =
|
|
611
|
+
src: (s = n.value) == null ? void 0 : s.thumbnail,
|
|
612
612
|
crossorigin: !1
|
|
613
613
|
}, null, 8, ["alt", "src"]),
|
|
614
614
|
g("div", pl, [
|
|
615
615
|
g("p", vl, [
|
|
616
|
-
(f =
|
|
617
|
-
g("span", null, B((b =
|
|
616
|
+
(f = n.value) != null && f.code ? (m(), C("span", fl, B((p = n.value) == null ? void 0 : p.code) + ", ", 1)) : U("", !0),
|
|
617
|
+
g("span", null, B((b = n.value) == null ? void 0 : b.name), 1)
|
|
618
618
|
]),
|
|
619
619
|
g("p", gl, "Base price: " + B(i.value), 1),
|
|
620
|
-
(y =
|
|
620
|
+
(y = n.value) != null && y.customAttributes ? (m(), C("div", bl, [
|
|
621
621
|
g("div", _l, [
|
|
622
622
|
u[0] || (u[0] = g("span", null, "Tagging:", -1)),
|
|
623
|
-
d(
|
|
623
|
+
d(Ue, {
|
|
624
624
|
ellipsis: !1,
|
|
625
|
-
"custom-attributes": (w =
|
|
625
|
+
"custom-attributes": (w = n.value) == null ? void 0 : w.customAttributes
|
|
626
626
|
}, null, 8, ["custom-attributes"])
|
|
627
627
|
])
|
|
628
|
-
])) :
|
|
628
|
+
])) : U("", !0)
|
|
629
629
|
])
|
|
630
630
|
]);
|
|
631
631
|
};
|
|
@@ -637,7 +637,7 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
637
637
|
menu: {}
|
|
638
638
|
},
|
|
639
639
|
setup(k) {
|
|
640
|
-
const e =
|
|
640
|
+
const e = V("product"), n = h(() => [
|
|
641
641
|
{
|
|
642
642
|
value: "product",
|
|
643
643
|
label: "Product",
|
|
@@ -661,11 +661,11 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
661
661
|
d(u, {
|
|
662
662
|
modelValue: e.value,
|
|
663
663
|
"onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s),
|
|
664
|
-
items:
|
|
664
|
+
items: n.value
|
|
665
665
|
}, null, 8, ["modelValue", "items"])
|
|
666
666
|
]),
|
|
667
667
|
g("div", null, [
|
|
668
|
-
(m(),
|
|
668
|
+
(m(), I(lt((t = n.value.find((s) => s.value === e.value)) == null ? void 0 : t.component), {
|
|
669
669
|
"item-id": i.itemId,
|
|
670
670
|
menu: i.menu
|
|
671
671
|
}, null, 8, ["item-id", "menu"]))
|
|
@@ -680,8 +680,8 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
680
680
|
showSearch: { type: Boolean, default: !1 }
|
|
681
681
|
},
|
|
682
682
|
setup(k) {
|
|
683
|
-
const e = k,
|
|
684
|
-
return
|
|
683
|
+
const e = k, n = Ve(), i = V(null);
|
|
684
|
+
return at(() => {
|
|
685
685
|
i.value = e.itemId;
|
|
686
686
|
}), (l, u) => (m(), C("div", Cl, [
|
|
687
687
|
l.showSearch ? (m(), C("div", kl, [
|
|
@@ -691,45 +691,45 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
691
691
|
class: "w-1/2",
|
|
692
692
|
label: "Search and compare prices",
|
|
693
693
|
"helper-text": "Quickly find products and view their prices across different catalogs and schedules.",
|
|
694
|
-
menu: a(
|
|
694
|
+
menu: a(n).state.menu
|
|
695
695
|
}, null, 8, ["modelValue", "menu"])
|
|
696
|
-
])) :
|
|
696
|
+
])) : U("", !0),
|
|
697
697
|
g("div", null, [
|
|
698
|
-
i.value ? (m(),
|
|
698
|
+
i.value ? (m(), I(xl, {
|
|
699
699
|
key: 0,
|
|
700
700
|
"item-id": i.value,
|
|
701
|
-
menu: a(
|
|
702
|
-
}, null, 8, ["item-id", "menu"])) :
|
|
701
|
+
menu: a(n).state.menu
|
|
702
|
+
}, null, 8, ["item-id", "menu"])) : U("", !0)
|
|
703
703
|
])
|
|
704
704
|
]));
|
|
705
705
|
}
|
|
706
706
|
}), Sl = /* @__PURE__ */ K({
|
|
707
707
|
__name: "OverviewSheet",
|
|
708
708
|
setup(k) {
|
|
709
|
-
const e =
|
|
709
|
+
const e = V(null), n = V(!1);
|
|
710
710
|
function i(l) {
|
|
711
|
-
|
|
711
|
+
n.value = !n.value, l && (e.value = l);
|
|
712
712
|
}
|
|
713
713
|
return (l, u) => {
|
|
714
714
|
const t = z("FmSideSheet");
|
|
715
|
-
return m(), C(
|
|
715
|
+
return m(), C(pe, null, [
|
|
716
716
|
_e(l.$slots, "default", { trigger: i }),
|
|
717
717
|
d(t, {
|
|
718
718
|
id: "product-overview",
|
|
719
|
-
modelValue:
|
|
720
|
-
"onUpdate:modelValue": u[0] || (u[0] = (s) =>
|
|
719
|
+
modelValue: n.value,
|
|
720
|
+
"onUpdate:modelValue": u[0] || (u[0] = (s) => n.value = s),
|
|
721
721
|
"max-width": 1200,
|
|
722
722
|
"dismiss-away": ""
|
|
723
723
|
}, {
|
|
724
|
-
"side-sheet-header":
|
|
724
|
+
"side-sheet-header": T(() => u[1] || (u[1] = [
|
|
725
725
|
g("p", { class: "fm-typo-en-title-md-600" }, "Product Overview", -1)
|
|
726
726
|
])),
|
|
727
|
-
default:
|
|
727
|
+
default: T(() => [
|
|
728
728
|
g("div", null, [
|
|
729
|
-
|
|
729
|
+
n.value && e.value ? (m(), I(wl, {
|
|
730
730
|
key: 0,
|
|
731
731
|
"item-id": e.value
|
|
732
|
-
}, null, 8, ["item-id"])) :
|
|
732
|
+
}, null, 8, ["item-id"])) : U("", !0)
|
|
733
733
|
])
|
|
734
734
|
]),
|
|
735
735
|
_: 1
|
|
@@ -739,15 +739,15 @@ const Kt = { class: "inline-flex items-center" }, Nt = {
|
|
|
739
739
|
}
|
|
740
740
|
});
|
|
741
741
|
var Fl = Ut();
|
|
742
|
-
const
|
|
742
|
+
const Ye = /* @__PURE__ */ K({
|
|
743
743
|
__name: "ImportButton",
|
|
744
744
|
setup(k) {
|
|
745
|
-
const e =
|
|
746
|
-
function
|
|
745
|
+
const e = V(!1);
|
|
746
|
+
function n() {
|
|
747
747
|
e.value = !e.value;
|
|
748
748
|
}
|
|
749
|
-
const i =
|
|
750
|
-
return
|
|
749
|
+
const i = Oe();
|
|
750
|
+
return at(() => {
|
|
751
751
|
const l = i.currentCountry.value;
|
|
752
752
|
if (l)
|
|
753
753
|
try {
|
|
@@ -755,17 +755,17 @@ const Qe = /* @__PURE__ */ K({
|
|
|
755
755
|
} catch (u) {
|
|
756
756
|
console.log("Unable to set country config", u);
|
|
757
757
|
}
|
|
758
|
-
}), (l, u) => (m(), C(
|
|
758
|
+
}), (l, u) => (m(), C(pe, null, [
|
|
759
759
|
d(Mt, {
|
|
760
760
|
modelValue: e.value,
|
|
761
761
|
"onUpdate:modelValue": u[0] || (u[0] = (t) => e.value = t)
|
|
762
762
|
}, null, 8, ["modelValue"]),
|
|
763
|
-
_e(l.$slots, "default", { trigger:
|
|
763
|
+
_e(l.$slots, "default", { trigger: n })
|
|
764
764
|
], 64));
|
|
765
765
|
}
|
|
766
|
-
}),
|
|
766
|
+
}), Ze = (k) => d("div", {
|
|
767
767
|
class: "flex flex-1 justify-end"
|
|
768
|
-
}, [d("span", null, [k,
|
|
768
|
+
}, [d("span", null, [k, et(" ")])]), Vl = {
|
|
769
769
|
class: "flex justify-between items-center space-x-8"
|
|
770
770
|
}, Il = {
|
|
771
771
|
class: "flex space-x-8 items-center"
|
|
@@ -775,12 +775,12 @@ const Qe = /* @__PURE__ */ K({
|
|
|
775
775
|
key: 0
|
|
776
776
|
}, Pl = {
|
|
777
777
|
key: 1,
|
|
778
|
-
class: /* @__PURE__ */
|
|
778
|
+
class: /* @__PURE__ */ ve(["flex-1 flex flex-col", "divide-y divide-fm-color-neutral-gray-100", "overflow-hidden"])
|
|
779
779
|
}, Al = {
|
|
780
780
|
key: 0,
|
|
781
781
|
class: "flex items-center p-4"
|
|
782
782
|
}, Rl = {
|
|
783
|
-
class: /* @__PURE__ */
|
|
783
|
+
class: /* @__PURE__ */ ve(["mr-8", "fm-typo-en-body-md-400"])
|
|
784
784
|
}, Ul = {
|
|
785
785
|
key: 1,
|
|
786
786
|
class: "px-16 py-4 space-x-8 flex justify-end"
|
|
@@ -802,7 +802,7 @@ const Qe = /* @__PURE__ */ K({
|
|
|
802
802
|
class: "px-8"
|
|
803
803
|
}, jl = {
|
|
804
804
|
key: 0,
|
|
805
|
-
class: /* @__PURE__ */
|
|
805
|
+
class: /* @__PURE__ */ ve(["flex flex-col flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
|
|
806
806
|
}, El = ["onClick"], Gl = {
|
|
807
807
|
class: "min-w-0 flex flex-1 items-center justify-start space-x-16"
|
|
808
808
|
}, Ll = {
|
|
@@ -833,24 +833,24 @@ const Qe = /* @__PURE__ */ K({
|
|
|
833
833
|
emits: ["update:model-value", "reset:model-value", "update:editing", "update:search-key"],
|
|
834
834
|
setup(k, {
|
|
835
835
|
expose: e,
|
|
836
|
-
emit:
|
|
836
|
+
emit: n
|
|
837
837
|
}) {
|
|
838
838
|
const i = k, {
|
|
839
839
|
t: l
|
|
840
|
-
} =
|
|
840
|
+
} = Ie(), u = Oe(), t = Ve(), s = Tt(), f = ot(), p = u.currentCountry, b = h(() => p.value ? me.Country.getCountry(p.value) : null), y = h(() => t.rules.item), {
|
|
841
841
|
selectedCategories: w
|
|
842
|
-
} =
|
|
843
|
-
const o = ge.flatten(w.value.map((
|
|
844
|
-
return ge.uniqBy(o, (
|
|
845
|
-
}), Y =
|
|
846
|
-
|
|
842
|
+
} = Se(), W = h(() => {
|
|
843
|
+
const o = ge.flatten(w.value.map((r) => r.items));
|
|
844
|
+
return ge.uniqBy(o, (r) => r._id);
|
|
845
|
+
}), Y = n, S = V(!1);
|
|
846
|
+
de(() => S.value, (o) => {
|
|
847
847
|
Y("update:editing", o);
|
|
848
848
|
});
|
|
849
|
-
const
|
|
849
|
+
const oe = (o) => {
|
|
850
850
|
Ot.isBoolean(o) ? S.value = o : S.value = !S.value;
|
|
851
|
-
}, Z =
|
|
851
|
+
}, Z = V(!1), re = V(null);
|
|
852
852
|
async function E() {
|
|
853
|
-
Z.value = !Z.value, Z.value && (await
|
|
853
|
+
Z.value = !Z.value, Z.value && (await Ae(), re.value && re.value.toggleProperty(!0));
|
|
854
854
|
}
|
|
855
855
|
e({
|
|
856
856
|
toggleAttributeFilter: E
|
|
@@ -858,37 +858,37 @@ const Qe = /* @__PURE__ */ K({
|
|
|
858
858
|
const {
|
|
859
859
|
attributes: D,
|
|
860
860
|
filterRule: O,
|
|
861
|
-
mongoQuery:
|
|
861
|
+
mongoQuery: H
|
|
862
862
|
} = xt({
|
|
863
|
-
valueSource:
|
|
863
|
+
valueSource: W,
|
|
864
864
|
entity: "item"
|
|
865
|
-
}), J =
|
|
865
|
+
}), J = V(""), ne = Ct(J, 300), Q = h(() => {
|
|
866
866
|
const o = (c) => {
|
|
867
867
|
var x;
|
|
868
|
-
return !
|
|
869
|
-
},
|
|
870
|
-
return
|
|
868
|
+
return !ne.value || !ne.value.trim() ? !0 : [c.code, c.name, Be(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());
|
|
869
|
+
}, r = (c) => H.value ? $t(c.customAttributes, H.value) : !0;
|
|
870
|
+
return W.value.filter((c) => o(c) && r(c));
|
|
871
871
|
}), {
|
|
872
|
-
categories:
|
|
873
|
-
} =
|
|
872
|
+
categories: se
|
|
873
|
+
} = Se(), R = h(() => t.categories.map((o) => ({
|
|
874
874
|
label: o.name,
|
|
875
875
|
value: o._id || null
|
|
876
|
-
}))),
|
|
876
|
+
}))), $ = (o, r, c) => {
|
|
877
877
|
let v = ge.clone(i.modelValue);
|
|
878
878
|
const x = v[o];
|
|
879
|
-
x && (typeof
|
|
879
|
+
x && (typeof r == "object" && r !== null ? v[o] = {
|
|
880
880
|
...x,
|
|
881
|
-
...
|
|
881
|
+
...r
|
|
882
882
|
} : v[o] = {
|
|
883
883
|
...x,
|
|
884
|
-
[
|
|
884
|
+
[r]: c
|
|
885
885
|
}, Y("update:model-value", v));
|
|
886
|
-
},
|
|
886
|
+
}, P = bt(() => i.originalValue, () => i.modelValue), A = ge.debounce($, 300), ue = (o) => (r) => !!r || l("menu.product.table.validation.name_required", {
|
|
887
887
|
field: o
|
|
888
|
-
}),
|
|
888
|
+
}), G = (o) => o >= 0 || l("menu.product.table.validation.price_min"), N = [ue("Name")], M = () => [(o) => G(typeof o == "number" ? o : Number(o) ?? 0)], ie = Ce(), j = h(() => {
|
|
889
889
|
const o = t.isV4;
|
|
890
890
|
return gt.setCoreStore(u).taxSetting(o);
|
|
891
|
-
}),
|
|
891
|
+
}), ce = h(() => [{
|
|
892
892
|
accessorKey: "thumbnail",
|
|
893
893
|
header: "",
|
|
894
894
|
size: 110,
|
|
@@ -897,10 +897,10 @@ const Qe = /* @__PURE__ */ K({
|
|
|
897
897
|
headerContentClass: "px-0"
|
|
898
898
|
},
|
|
899
899
|
cell: (o) => {
|
|
900
|
-
var
|
|
901
|
-
return
|
|
900
|
+
var r, c;
|
|
901
|
+
return L(Me, {
|
|
902
902
|
src: o.getValue(),
|
|
903
|
-
alt: (c = (
|
|
903
|
+
alt: (c = (r = o == null ? void 0 : o.row) == null ? void 0 : r.original) == null ? void 0 : c.name,
|
|
904
904
|
className: "my-8 mx-12",
|
|
905
905
|
size: 72,
|
|
906
906
|
crossorigin: !1
|
|
@@ -913,17 +913,17 @@ const Qe = /* @__PURE__ */ K({
|
|
|
913
913
|
enableSorting: !1,
|
|
914
914
|
size: 100,
|
|
915
915
|
cell: (o) => {
|
|
916
|
-
const
|
|
916
|
+
const r = o.row.original, c = o.getValue() || "--";
|
|
917
917
|
if (!S.value) return d("span", {
|
|
918
918
|
class: "break-all"
|
|
919
919
|
}, [c]);
|
|
920
|
-
const v =
|
|
921
|
-
return
|
|
920
|
+
const v = Te(r._id);
|
|
921
|
+
return L(te.FmTextField, {
|
|
922
922
|
disabled: !y.value.code,
|
|
923
|
-
modelValue:
|
|
924
|
-
placeholder: i.modelValue[
|
|
923
|
+
modelValue: P(r._id, "code") ?? (v == null ? void 0 : v.code),
|
|
924
|
+
placeholder: i.modelValue[r._id].fallbackCode,
|
|
925
925
|
"onUpdate:modelValue": (x) => {
|
|
926
|
-
|
|
926
|
+
A(r._id, "code", x);
|
|
927
927
|
}
|
|
928
928
|
});
|
|
929
929
|
}
|
|
@@ -933,22 +933,22 @@ const Qe = /* @__PURE__ */ K({
|
|
|
933
933
|
enableSorting: !1,
|
|
934
934
|
size: 200,
|
|
935
935
|
cell: (o) => {
|
|
936
|
-
const
|
|
937
|
-
return S.value ?
|
|
936
|
+
const r = o.row.original, c = o.getValue();
|
|
937
|
+
return S.value ? L(te.FmTextField, {
|
|
938
938
|
disabled: !y.value.name,
|
|
939
|
-
modelValue:
|
|
939
|
+
modelValue: P(r._id, "name") ?? r.name,
|
|
940
940
|
"onUpdate:modelValue": (v) => {
|
|
941
|
-
|
|
941
|
+
A(r._id, "name", v);
|
|
942
942
|
},
|
|
943
|
-
rules:
|
|
944
|
-
placeholder:
|
|
943
|
+
rules: N,
|
|
944
|
+
placeholder: r.fallbackName
|
|
945
945
|
}) : c;
|
|
946
946
|
}
|
|
947
947
|
}, {
|
|
948
948
|
accessorKey: "price",
|
|
949
949
|
header: () => {
|
|
950
950
|
var o;
|
|
951
|
-
return
|
|
951
|
+
return Ze(l("menu.product.table.columns.price", {
|
|
952
952
|
currency: (o = b.value) == null ? void 0 : o.currency.symbol
|
|
953
953
|
}));
|
|
954
954
|
},
|
|
@@ -959,42 +959,42 @@ const Qe = /* @__PURE__ */ K({
|
|
|
959
959
|
},
|
|
960
960
|
cell: (o) => {
|
|
961
961
|
var x;
|
|
962
|
-
const
|
|
963
|
-
if (!S.value) return
|
|
962
|
+
const r = o.getValue();
|
|
963
|
+
if (!S.value) return me.Dinero.fromFdoDinero(r).toFormat();
|
|
964
964
|
const c = i.modelValue[o.row.original._id], v = c.fallbackPrice;
|
|
965
|
-
return
|
|
965
|
+
return L(Rt, {
|
|
966
966
|
min: 0,
|
|
967
967
|
disabled: !c.editPrice,
|
|
968
968
|
// @ts-ignore
|
|
969
969
|
placeholder: v ? zt(v, !1) : void 0,
|
|
970
|
-
modelValue:
|
|
970
|
+
modelValue: P(c._id, "price") ?? ((x = Te(c._id)) == null ? void 0 : x.price),
|
|
971
971
|
// @ts-ignore
|
|
972
972
|
"onUpdate:modelValue": (F) => {
|
|
973
|
-
|
|
973
|
+
$(c._id, "price", F);
|
|
974
974
|
},
|
|
975
|
-
rules:
|
|
975
|
+
rules: M()
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
978
|
}, {
|
|
979
979
|
accessorKey: "taxes",
|
|
980
|
-
header: () =>
|
|
980
|
+
header: () => Ze(j.value.systemCode),
|
|
981
981
|
size: S.value ? 120 : 80,
|
|
982
982
|
enableSorting: !1,
|
|
983
983
|
meta: {
|
|
984
984
|
textAlign: "right"
|
|
985
985
|
},
|
|
986
986
|
cell: (o) => {
|
|
987
|
-
const
|
|
987
|
+
const r = o.getValue(), c = o.row.original, v = t.taxSetting.countryTaxOptions, x = t.getSelectedTax(r, c.fallbackTaxes, t.taxSetting.countryTaxOptions), F = v.find((ae) => ae.value === x);
|
|
988
988
|
if (!S.value)
|
|
989
989
|
return `${F != null && F.meta.rate ? _t(F.meta.rate) : 0}%`;
|
|
990
|
-
const _ = t.getSelectedTax(
|
|
991
|
-
return
|
|
990
|
+
const _ = t.getSelectedTax(P(c._id, "taxes") ?? r, c.fallbackTaxes, t.taxSetting.countryTaxOptions);
|
|
991
|
+
return L(te.FmSelect, {
|
|
992
992
|
disabled: !y.value.tax,
|
|
993
993
|
items: t.taxSetting.countryTaxOptions,
|
|
994
994
|
modelValue: _,
|
|
995
|
-
"onUpdate:modelValue": async (
|
|
996
|
-
const
|
|
997
|
-
|
|
995
|
+
"onUpdate:modelValue": async (ae) => {
|
|
996
|
+
const xe = t.decodeTax(ae);
|
|
997
|
+
A(c._id, "taxes", [xe]);
|
|
998
998
|
}
|
|
999
999
|
});
|
|
1000
1000
|
}
|
|
@@ -1004,26 +1004,26 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1004
1004
|
enableSorting: !1,
|
|
1005
1005
|
size: 140,
|
|
1006
1006
|
cell: (o) => {
|
|
1007
|
-
const
|
|
1007
|
+
const r = o.row.original;
|
|
1008
1008
|
if (!S.value)
|
|
1009
|
-
return
|
|
1010
|
-
categories:
|
|
1009
|
+
return L(Qe, {
|
|
1010
|
+
categories: Pe(se.value, r)
|
|
1011
1011
|
});
|
|
1012
|
-
const c = yt(i.originalValue, i.modelValue,
|
|
1013
|
-
return
|
|
1012
|
+
const c = yt(i.originalValue, i.modelValue, r._id) ?? ht(r), v = (c == null ? void 0 : c.map((F) => F._id)) ?? [], x = c == null ? void 0 : c.reduce((F, _) => (F[_._id] = _, F), {});
|
|
1013
|
+
return L(It, {
|
|
1014
1014
|
shouldShowChips: !1,
|
|
1015
1015
|
shouldShowSelectedItemsWithinPlaceholder: !0,
|
|
1016
1016
|
modelValue: v.length > 0 ? v : [null],
|
|
1017
|
-
items:
|
|
1017
|
+
items: R.value,
|
|
1018
1018
|
disabled: !!(t.state.currentCatalogId || t.state.currentSchedulerId),
|
|
1019
1019
|
"onUpdate:modelValue": async (F) => {
|
|
1020
|
-
const [_, ...
|
|
1021
|
-
|
|
1020
|
+
const [_, ...ae] = F;
|
|
1021
|
+
A(r._id, {
|
|
1022
1022
|
category: _,
|
|
1023
|
-
additionalCategories:
|
|
1024
|
-
const
|
|
1025
|
-
return
|
|
1026
|
-
_id:
|
|
1023
|
+
additionalCategories: ae.map((xe) => {
|
|
1024
|
+
const Ne = x == null ? void 0 : x[xe];
|
|
1025
|
+
return Ne || {
|
|
1026
|
+
_id: xe,
|
|
1027
1027
|
position: null
|
|
1028
1028
|
};
|
|
1029
1029
|
})
|
|
@@ -1038,31 +1038,31 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1038
1038
|
enableSorting: !1,
|
|
1039
1039
|
size: 140,
|
|
1040
1040
|
cell: (o) => {
|
|
1041
|
-
const
|
|
1042
|
-
return
|
|
1043
|
-
customAttributes:
|
|
1041
|
+
const r = o.row.original;
|
|
1042
|
+
return L(Ue, {
|
|
1043
|
+
customAttributes: r.customAttributes
|
|
1044
1044
|
});
|
|
1045
1045
|
}
|
|
1046
1046
|
}, {
|
|
1047
1047
|
accessorKey: "orderFrom",
|
|
1048
1048
|
header: () => l("menu.product.table.columns.order_from"),
|
|
1049
1049
|
enableSorting: !0,
|
|
1050
|
-
sortingFn: (o,
|
|
1051
|
-
const [c, v] = [o,
|
|
1050
|
+
sortingFn: (o, r) => {
|
|
1051
|
+
const [c, v] = [o, r].map((x) => ie[x.original.orderFrom].sortingIndex);
|
|
1052
1052
|
return c - v;
|
|
1053
1053
|
},
|
|
1054
1054
|
size: 140,
|
|
1055
1055
|
cell: (o) => {
|
|
1056
|
-
const
|
|
1057
|
-
return S.value ?
|
|
1056
|
+
const r = o.getValue(), c = o.row.original;
|
|
1057
|
+
return S.value ? L(te.FmSelect, {
|
|
1058
1058
|
disabled: !y.value.orderFrom,
|
|
1059
|
-
items: Object.values(
|
|
1060
|
-
modelValue:
|
|
1059
|
+
items: Object.values(Ce()),
|
|
1060
|
+
modelValue: P(c._id, "orderFrom") ?? r,
|
|
1061
1061
|
"onUpdate:modelValue": async (v) => {
|
|
1062
|
-
|
|
1062
|
+
$(c._id, "orderFrom", v);
|
|
1063
1063
|
}
|
|
1064
|
-
}) :
|
|
1065
|
-
orderFrom:
|
|
1064
|
+
}) : L(Fe, {
|
|
1065
|
+
orderFrom: r
|
|
1066
1066
|
});
|
|
1067
1067
|
}
|
|
1068
1068
|
}, {
|
|
@@ -1073,66 +1073,66 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1073
1073
|
headerClass: "py-4",
|
|
1074
1074
|
textAlign: "right"
|
|
1075
1075
|
},
|
|
1076
|
-
header: () =>
|
|
1076
|
+
header: () => L("div", {
|
|
1077
1077
|
class: "w-full px-4 flex justify-end"
|
|
1078
|
-
}, [Dt(
|
|
1079
|
-
variant:
|
|
1080
|
-
textColor:
|
|
1078
|
+
}, [Dt(L(te.FmButton, {
|
|
1079
|
+
variant: ee.Tertiary,
|
|
1080
|
+
textColor: q.NeutralGray400,
|
|
1081
1081
|
prependIcon: "edit",
|
|
1082
1082
|
class: "flex justify-end",
|
|
1083
|
-
onClick:
|
|
1083
|
+
onClick: oe,
|
|
1084
1084
|
type: "button"
|
|
1085
1085
|
}), "Bulk edit")]),
|
|
1086
1086
|
cell: (o) => {
|
|
1087
|
-
const
|
|
1087
|
+
const r = o.row.original;
|
|
1088
1088
|
return d("div", {
|
|
1089
1089
|
class: "px-4 flex justify-end"
|
|
1090
1090
|
}, [d(Sl, null, {
|
|
1091
1091
|
default: ({
|
|
1092
1092
|
trigger: c
|
|
1093
|
-
}) => d(
|
|
1093
|
+
}) => d(te.FmButton, {
|
|
1094
1094
|
icon: "overview",
|
|
1095
1095
|
variant: "tertiary",
|
|
1096
|
-
textColor:
|
|
1097
|
-
onClick:
|
|
1098
|
-
c(
|
|
1096
|
+
textColor: q.NeutralGray400,
|
|
1097
|
+
onClick: fe(() => {
|
|
1098
|
+
c(r._id);
|
|
1099
1099
|
}, ["stop", "prevent"])
|
|
1100
1100
|
}, null)
|
|
1101
|
-
}), d(
|
|
1101
|
+
}), d(te.FmButton, {
|
|
1102
1102
|
icon: "delete",
|
|
1103
1103
|
variant: "tertiary",
|
|
1104
|
-
textColor:
|
|
1105
|
-
onClick:
|
|
1104
|
+
textColor: q.NeutralGray400,
|
|
1105
|
+
onClick: fe(async () => {
|
|
1106
1106
|
await f.deleteItem([{
|
|
1107
|
-
_id:
|
|
1108
|
-
name:
|
|
1109
|
-
thumbnail:
|
|
1107
|
+
_id: r._id,
|
|
1108
|
+
name: r.name,
|
|
1109
|
+
thumbnail: r.thumbnail
|
|
1110
1110
|
}]);
|
|
1111
1111
|
}, ["stop", "prevent"])
|
|
1112
1112
|
}, null)]);
|
|
1113
1113
|
}
|
|
1114
1114
|
}]);
|
|
1115
|
-
t.taxSetting.systemCode ||
|
|
1116
|
-
const
|
|
1117
|
-
|
|
1118
|
-
let
|
|
1115
|
+
t.taxSetting.systemCode || ce.value.splice(4, 1);
|
|
1116
|
+
const le = V({}), X = V([]);
|
|
1117
|
+
de([() => le.value, () => Q.value], (o) => {
|
|
1118
|
+
let r = [];
|
|
1119
1119
|
Object.keys(o[0]).forEach((c) => {
|
|
1120
|
-
const v = o[0][c], x =
|
|
1121
|
-
x && (v ?
|
|
1122
|
-
}),
|
|
1123
|
-
}),
|
|
1124
|
-
|
|
1125
|
-
}),
|
|
1126
|
-
|
|
1120
|
+
const v = o[0][c], x = Q.value[parseInt(c)];
|
|
1121
|
+
x && (v ? r.push(x) : X.value = r.filter((F) => F !== x));
|
|
1122
|
+
}), X.value = r;
|
|
1123
|
+
}), de(() => W.value, () => {
|
|
1124
|
+
le.value = {}, X.value = [];
|
|
1125
|
+
}), de(() => S.value, () => {
|
|
1126
|
+
le.value = {}, X.value = [];
|
|
1127
1127
|
});
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1128
|
+
const ye = () => {
|
|
1129
|
+
le.value = {};
|
|
1130
1130
|
};
|
|
1131
|
-
async function
|
|
1132
|
-
await
|
|
1133
|
-
const o = () => !!t.currentCatalog || !!t.state.currentSchedulerId,
|
|
1131
|
+
async function De() {
|
|
1132
|
+
await Ae();
|
|
1133
|
+
const o = () => !!t.currentCatalog || !!t.state.currentSchedulerId, r = (v) => v === "" || v === null ? o() ? "" : null : v, c = Object.values(i.modelValue).filter((v) => {
|
|
1134
1134
|
const x = Object.values(i.originalValue).find((F) => F._id === v._id);
|
|
1135
|
-
return
|
|
1135
|
+
return Ee(x, v);
|
|
1136
1136
|
}).map((v) => ({
|
|
1137
1137
|
_id: v._id,
|
|
1138
1138
|
name: v.name,
|
|
@@ -1140,41 +1140,41 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1140
1140
|
price: v.price,
|
|
1141
1141
|
orderFrom: v.orderFrom ?? null,
|
|
1142
1142
|
taxes: v.taxes,
|
|
1143
|
-
category:
|
|
1143
|
+
category: r(v.category || null),
|
|
1144
1144
|
additionalCategories: v.additionalCategories
|
|
1145
1145
|
}));
|
|
1146
|
-
await f.updateMany(c),
|
|
1146
|
+
await f.updateMany(c), oe(!1);
|
|
1147
1147
|
}
|
|
1148
1148
|
const st = async () => {
|
|
1149
|
-
await f.deleteItem(
|
|
1149
|
+
await f.deleteItem(X.value.map((o) => ({
|
|
1150
1150
|
_id: o._id,
|
|
1151
1151
|
name: o.name,
|
|
1152
1152
|
thumbnail: o.thumbnail
|
|
1153
1153
|
})));
|
|
1154
|
-
},
|
|
1154
|
+
}, he = () => {
|
|
1155
1155
|
Y("reset:model-value");
|
|
1156
|
-
},
|
|
1157
|
-
Object.entries(i.modelValue).some(([
|
|
1156
|
+
}, $e = () => {
|
|
1157
|
+
Object.entries(i.modelValue).some(([r, c]) => Ee(c, i.originalValue[r])) ? s.open({
|
|
1158
1158
|
title: "You have unsaved changes!",
|
|
1159
1159
|
message: "Are you sure you want to discard? You will lose all the changes if discard edit.",
|
|
1160
1160
|
primaryActions: {
|
|
1161
1161
|
text: "Discard",
|
|
1162
1162
|
close: !0,
|
|
1163
|
-
variant:
|
|
1163
|
+
variant: ee.Destructive
|
|
1164
1164
|
},
|
|
1165
1165
|
secondaryActions: {
|
|
1166
1166
|
text: "Cancel",
|
|
1167
1167
|
close: !0
|
|
1168
1168
|
}
|
|
1169
1169
|
}).onPrimary(() => {
|
|
1170
|
-
|
|
1171
|
-
}) : (
|
|
1170
|
+
he(), oe(!1);
|
|
1171
|
+
}) : (oe(!1), he());
|
|
1172
1172
|
}, ut = h(() => {
|
|
1173
|
-
var o,
|
|
1173
|
+
var o, r;
|
|
1174
1174
|
return {
|
|
1175
1175
|
thumbnail: !S.value,
|
|
1176
1176
|
actions: !S.value,
|
|
1177
|
-
tagging: !S.value && ((
|
|
1177
|
+
tagging: !S.value && ((r = (o = u.itemAttributeSettings) == null ? void 0 : o.value) == null ? void 0 : r.length) > 0
|
|
1178
1178
|
};
|
|
1179
1179
|
}), it = (o) => {
|
|
1180
1180
|
f.update(o._id);
|
|
@@ -1182,13 +1182,13 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1182
1182
|
async function ct(o) {
|
|
1183
1183
|
await f.update(o.original._id);
|
|
1184
1184
|
}
|
|
1185
|
-
function
|
|
1185
|
+
function Be(o) {
|
|
1186
1186
|
var _;
|
|
1187
|
-
const
|
|
1187
|
+
const r = o.price ?? // TODO: fix type error
|
|
1188
1188
|
// @ts-ignore
|
|
1189
|
-
o.fallbackPrice ??
|
|
1189
|
+
o.fallbackPrice ?? me.Dinero.fromNumber({
|
|
1190
1190
|
number: 0
|
|
1191
|
-
}).toObject(), c = o.taxes, v = t.taxSetting.countryTaxOptions, x =
|
|
1191
|
+
}).toObject(), c = o.taxes, v = t.taxSetting.countryTaxOptions, x = me.Dinero.fromFdoDinero(r).toFormat(), F = (_ = b.value) == null ? void 0 : _.currency.symbol;
|
|
1192
1192
|
return t.getSelectedTax(
|
|
1193
1193
|
c,
|
|
1194
1194
|
// TODO: fix type error
|
|
@@ -1197,56 +1197,56 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1197
1197
|
v
|
|
1198
1198
|
), `${F == null ? void 0 : F.toUpperCase()}${x}`;
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function Te(o) {
|
|
1201
1201
|
var v;
|
|
1202
|
-
const
|
|
1203
|
-
if (
|
|
1204
|
-
const x =
|
|
1202
|
+
const r = t.currentCatalog, c = t.state.currentSchedulerId;
|
|
1203
|
+
if (r && c) {
|
|
1204
|
+
const x = r.override.scheduler[c] ?? {}, F = (v = x == null ? void 0 : x.items) == null ? void 0 : v.filter((_) => _._id === o);
|
|
1205
1205
|
return F == null ? void 0 : F[0];
|
|
1206
|
-
} else return
|
|
1206
|
+
} else return r ? r.override.items[o][0] : c ? t.schedulers.find((_) => _._id === c).items.filter((_) => _._id === o)[0] : W.value.find((x) => x._id === o);
|
|
1207
1207
|
}
|
|
1208
|
-
const dt =
|
|
1209
|
-
var
|
|
1208
|
+
const dt = rt(), mt = h(() => dt.breakpoints.value.xs), Ke = V(null), pt = At(Ke, Z), vt = h(() => {
|
|
1209
|
+
var r;
|
|
1210
1210
|
return {
|
|
1211
|
-
height: `calc(100vh - ${((
|
|
1211
|
+
height: `calc(100vh - ${((r = pt.value) == null ? void 0 : r.top) + 24}px)`
|
|
1212
1212
|
};
|
|
1213
1213
|
});
|
|
1214
|
-
return (o,
|
|
1214
|
+
return (o, r) => {
|
|
1215
1215
|
const c = z("fm-search"), v = z("fm-button"), x = z("fm-table"), F = z("fm-form");
|
|
1216
1216
|
return mt.value ? (m(), C("div", zl, [g("div", Dl, [g("div", Bl, [d(c, {
|
|
1217
1217
|
"model-value": J.value,
|
|
1218
|
-
"onUpdate:modelValue":
|
|
1218
|
+
"onUpdate:modelValue": r[5] || (r[5] = (_) => J.value = _),
|
|
1219
1219
|
autofocus: "",
|
|
1220
1220
|
placeholder: a(l)("menu.product.table.search.placeholder")
|
|
1221
|
-
}, null, 8, ["model-value", "placeholder"])]),
|
|
1221
|
+
}, null, 8, ["model-value", "placeholder"])]), r[8] || (r[8] = g("div", {
|
|
1222
1222
|
class: "w-full h-[1px] bg-fm-color-neutral-gray-100"
|
|
1223
|
-
}, null, -1)), g("div", Kl, [_e(o.$slots, "filter")]), Z.value ? (m(), C("div", Nl, [d(a(
|
|
1223
|
+
}, null, -1)), g("div", Kl, [_e(o.$slots, "filter")]), Z.value ? (m(), C("div", Nl, [d(a(We), {
|
|
1224
1224
|
ref_key: "attributeFilterRef",
|
|
1225
1225
|
ref: re,
|
|
1226
1226
|
attributes: a(D),
|
|
1227
1227
|
modelValue: a(O),
|
|
1228
|
-
"onUpdate:modelValue":
|
|
1229
|
-
}, null, 8, ["attributes", "modelValue"])])) :
|
|
1230
|
-
var
|
|
1228
|
+
"onUpdate:modelValue": r[6] || (r[6] = (_) => je(O) ? O.value = _ : null)
|
|
1229
|
+
}, null, 8, ["attributes", "modelValue"])])) : U("", !0)]), W.value.length ? (m(), C("div", jl, [(m(!0), C(pe, null, we(Q.value, (_) => {
|
|
1230
|
+
var ae;
|
|
1231
1231
|
return m(), C("div", {
|
|
1232
1232
|
key: _._id,
|
|
1233
1233
|
class: "max-w-full py-12 px-16 space-x-16 flex items-center",
|
|
1234
1234
|
onClick: () => it(_)
|
|
1235
|
-
}, [g("div", Gl, [d(
|
|
1235
|
+
}, [g("div", Gl, [d(Me, {
|
|
1236
1236
|
alt: _.name,
|
|
1237
1237
|
size: 72,
|
|
1238
1238
|
src: _.thumbnail
|
|
1239
|
-
}, null, 8, ["alt", "src"]), g("div", Ll, [g("div", ql, [g("p", Wl, B(_.name), 1), d(
|
|
1239
|
+
}, null, 8, ["alt", "src"]), g("div", Ll, [g("div", ql, [g("p", Wl, B(_.name), 1), d(Fe, {
|
|
1240
1240
|
"order-from": _.orderFrom
|
|
1241
|
-
}, null, 8, ["order-from"])]), g("p", Hl, B(
|
|
1242
|
-
categories: a(
|
|
1243
|
-
}, null, 8, ["categories"])]), d(
|
|
1241
|
+
}, null, 8, ["order-from"])]), g("p", Hl, B(Be(_)), 1), g("p", Ql, B(a(l)("menu.product.table.columns.code")) + ": " + B(((ae = Te(_._id)) == null ? void 0 : ae.code) || "--"), 1), g("p", Yl, [d(Qe, {
|
|
1242
|
+
categories: a(Pe)(a(se), _)
|
|
1243
|
+
}, null, 8, ["categories"])]), d(Ue, {
|
|
1244
1244
|
"custom-attributes": _.customAttributes
|
|
1245
1245
|
}, null, 8, ["custom-attributes"])])]), d(v, {
|
|
1246
|
-
"text-color": a(
|
|
1247
|
-
variant: a(
|
|
1246
|
+
"text-color": a(q).NeutralGray400,
|
|
1247
|
+
variant: a(ee).Tertiary,
|
|
1248
1248
|
"prepend-icon": "delete",
|
|
1249
|
-
onClick:
|
|
1249
|
+
onClick: fe(() => a(f).deleteItem([{
|
|
1250
1250
|
_id: _._id,
|
|
1251
1251
|
name: _.name,
|
|
1252
1252
|
thumbnail: _.thumbnail
|
|
@@ -1256,18 +1256,18 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1256
1256
|
subtitle: a(l)("menu.product.table.empty.subtitle"),
|
|
1257
1257
|
title: a(l)("menu.product.table.empty.title")
|
|
1258
1258
|
}, {
|
|
1259
|
-
action:
|
|
1260
|
-
variant: a(
|
|
1259
|
+
action: T(() => [g("div", Jl, [d(v, {
|
|
1260
|
+
variant: a(ee).Primary,
|
|
1261
1261
|
label: a(l)("menu.product.table.empty.actions.add"),
|
|
1262
1262
|
"prepend-icon": "add",
|
|
1263
|
-
onClick:
|
|
1264
|
-
}, null, 8, ["variant", "label"]), d(
|
|
1265
|
-
default:
|
|
1263
|
+
onClick: r[7] || (r[7] = (_) => a(f).create(null))
|
|
1264
|
+
}, null, 8, ["variant", "label"]), d(Ye, null, {
|
|
1265
|
+
default: T(({
|
|
1266
1266
|
trigger: _
|
|
1267
1267
|
}) => [d(v, {
|
|
1268
|
-
"bg-color": a(
|
|
1269
|
-
"text-color": a(
|
|
1270
|
-
variant: a(
|
|
1268
|
+
"bg-color": a(q).NeutralGray100,
|
|
1269
|
+
"text-color": a(q).NeutralGray400,
|
|
1270
|
+
variant: a(ee).Primary,
|
|
1271
1271
|
label: a(l)("menu.product.table.empty.actions.import"),
|
|
1272
1272
|
"prepend-icon": "download",
|
|
1273
1273
|
onClick: _
|
|
@@ -1275,56 +1275,56 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1275
1275
|
_: 1
|
|
1276
1276
|
})])]),
|
|
1277
1277
|
_: 1
|
|
1278
|
-
}, 8, ["subtitle", "title"])]))])) : (m(),
|
|
1278
|
+
}, 8, ["subtitle", "title"])]))])) : (m(), I(F, {
|
|
1279
1279
|
key: 0,
|
|
1280
1280
|
"blame-form-child-on-validation-failed": "",
|
|
1281
1281
|
class: "flex flex-col flex-1 space-y-8 overflow-hidden",
|
|
1282
|
-
onValidationSuccess:
|
|
1282
|
+
onValidationSuccess: De
|
|
1283
1283
|
}, {
|
|
1284
|
-
default:
|
|
1284
|
+
default: T(() => [g("div", Vl, [g("div", Il, [_e(o.$slots, "filter")]), g("div", $l, [d(c, {
|
|
1285
1285
|
"model-value": J.value,
|
|
1286
|
-
"onUpdate:modelValue":
|
|
1286
|
+
"onUpdate:modelValue": r[0] || (r[0] = (_) => J.value = _),
|
|
1287
1287
|
autofocus: "",
|
|
1288
1288
|
placeholder: a(l)("menu.product.table.search.placeholder")
|
|
1289
|
-
}, null, 8, ["model-value", "placeholder"])])]), Z.value ? (m(), C("div", Tl, [d(a(
|
|
1289
|
+
}, null, 8, ["model-value", "placeholder"])])]), Z.value ? (m(), C("div", Tl, [d(a(We), {
|
|
1290
1290
|
ref_key: "attributeFilterRef",
|
|
1291
1291
|
ref: re,
|
|
1292
1292
|
attributes: a(D),
|
|
1293
1293
|
modelValue: a(O),
|
|
1294
|
-
"onUpdate:modelValue":
|
|
1295
|
-
}, null, 8, ["attributes", "modelValue"])])) :
|
|
1296
|
-
count:
|
|
1294
|
+
"onUpdate:modelValue": r[1] || (r[1] = (_) => je(O) ? O.value = _ : null)
|
|
1295
|
+
}, null, 8, ["attributes", "modelValue"])])) : U("", !0), W.value.length ? (m(), C("div", Pl, [X.value.length && !S.value ? (m(), C("div", Al, [g("p", Rl, B(a(l)("menu.product.table.selection.count", {
|
|
1296
|
+
count: X.value.length
|
|
1297
1297
|
})), 1), d(v, {
|
|
1298
1298
|
label: a(l)("menu.product.table.selection.actions.deselect_all"),
|
|
1299
1299
|
type: "button",
|
|
1300
1300
|
variant: "plain",
|
|
1301
|
-
onClick:
|
|
1301
|
+
onClick: ye
|
|
1302
1302
|
}, null, 8, ["label"]), d(v, {
|
|
1303
|
-
"border-color": a(
|
|
1304
|
-
"text-color": a(
|
|
1303
|
+
"border-color": a(q).SystemError300,
|
|
1304
|
+
"text-color": a(q).SystemError300,
|
|
1305
1305
|
class: "ml-auto",
|
|
1306
1306
|
label: a(l)("menu.product.table.selection.actions.remove"),
|
|
1307
1307
|
"prepend-icon": "delete",
|
|
1308
1308
|
variant: "secondary",
|
|
1309
1309
|
onClick: st
|
|
1310
|
-
}, null, 8, ["border-color", "text-color", "label"])])) :
|
|
1311
|
-
variant: a(
|
|
1310
|
+
}, null, 8, ["border-color", "text-color", "label"])])) : U("", !0), S.value ? (m(), C("div", Ul, [d(v, {
|
|
1311
|
+
variant: a(ee).Tertiary,
|
|
1312
1312
|
label: a(l)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
1313
|
-
onClick:
|
|
1313
|
+
onClick: he
|
|
1314
1314
|
}, null, 8, ["variant", "label"]), d(v, {
|
|
1315
|
-
variant: a(
|
|
1315
|
+
variant: a(ee).Tertiary,
|
|
1316
1316
|
label: a(l)("menu.common.actions.cancel"),
|
|
1317
|
-
onClick:
|
|
1317
|
+
onClick: $e
|
|
1318
1318
|
}, null, 8, ["variant", "label"]), d(v, {
|
|
1319
|
-
borderColor: a(
|
|
1320
|
-
textColor: a(
|
|
1321
|
-
variant: a(
|
|
1319
|
+
borderColor: a(q).ColorPrimary,
|
|
1320
|
+
textColor: a(q).ColorPrimary,
|
|
1321
|
+
variant: a(ee).Secondary,
|
|
1322
1322
|
label: a(l)("menu.product.table.bulk_edit.actions.save"),
|
|
1323
1323
|
type: "submit"
|
|
1324
|
-
}, null, 8, ["borderColor", "textColor", "variant", "label"])])) :
|
|
1324
|
+
}, null, 8, ["borderColor", "textColor", "variant", "label"])])) : U("", !0), g("div", {
|
|
1325
1325
|
ref_key: "tableWrapper",
|
|
1326
|
-
ref:
|
|
1327
|
-
}, [(m(),
|
|
1326
|
+
ref: Ke
|
|
1327
|
+
}, [(m(), I(lt(S.value ? Pt : "div"), {
|
|
1328
1328
|
ref: "fullWrapper",
|
|
1329
1329
|
title: S.value ? a(l)("menu.product.table.bulk_edit.title") : "",
|
|
1330
1330
|
show: S.value,
|
|
@@ -1333,53 +1333,53 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1333
1333
|
},
|
|
1334
1334
|
"secondary-actions": [{
|
|
1335
1335
|
label: a(l)("menu.product.table.bulk_edit.actions.reset_all"),
|
|
1336
|
-
click:
|
|
1336
|
+
click: he
|
|
1337
1337
|
}, {
|
|
1338
1338
|
label: a(l)("menu.common.actions.cancel"),
|
|
1339
|
-
click:
|
|
1339
|
+
click: $e
|
|
1340
1340
|
}],
|
|
1341
1341
|
class: "overflow-x-scroll",
|
|
1342
1342
|
style: ft(vt.value),
|
|
1343
|
-
onOnPrimary:
|
|
1344
|
-
onOnCancel:
|
|
1343
|
+
onOnPrimary: De,
|
|
1344
|
+
onOnCancel: $e
|
|
1345
1345
|
}, {
|
|
1346
|
-
default:
|
|
1347
|
-
class:
|
|
1346
|
+
default: T(() => [d(x, {
|
|
1347
|
+
class: ve({
|
|
1348
1348
|
"min-w-[1100px]": !0,
|
|
1349
1349
|
"mt-24": S.value
|
|
1350
1350
|
}),
|
|
1351
|
-
modelValue:
|
|
1352
|
-
"onUpdate:modelValue":
|
|
1353
|
-
"column-defs":
|
|
1351
|
+
modelValue: le.value,
|
|
1352
|
+
"onUpdate:modelValue": r[2] || (r[2] = (_) => le.value = _),
|
|
1353
|
+
"column-defs": ce.value,
|
|
1354
1354
|
"column-visibility": ut.value,
|
|
1355
1355
|
loading: o.isCalculating,
|
|
1356
|
-
"page-size":
|
|
1357
|
-
"row-data":
|
|
1356
|
+
"page-size": Q.value.length,
|
|
1357
|
+
"row-data": Q.value,
|
|
1358
1358
|
"shrink-at": !1,
|
|
1359
1359
|
selection: S.value ? void 0 : "multiple",
|
|
1360
1360
|
virtual: !0,
|
|
1361
1361
|
"virtual-row-height": S.value ? 48 : 91,
|
|
1362
1362
|
"hide-footer": "",
|
|
1363
1363
|
"pin-header-row": "",
|
|
1364
|
-
onRowClick:
|
|
1364
|
+
onRowClick: r[3] || (r[3] = (_) => S.value ? void 0 : ct(_))
|
|
1365
1365
|
}, null, 8, ["class", "modelValue", "column-defs", "column-visibility", "loading", "page-size", "row-data", "selection", "virtual-row-height"])]),
|
|
1366
1366
|
_: 1
|
|
1367
1367
|
}, 40, ["title", "show", "primary-action", "secondary-actions", "style"]))], 512)])) : (m(), C("div", Ml, [d(be, {
|
|
1368
1368
|
subtitle: a(l)("menu.product.table.empty.subtitle"),
|
|
1369
1369
|
title: a(l)("menu.product.table.empty.title")
|
|
1370
1370
|
}, {
|
|
1371
|
-
action:
|
|
1372
|
-
variant: a(
|
|
1371
|
+
action: T(() => [g("div", Ol, [d(v, {
|
|
1372
|
+
variant: a(ee).Primary,
|
|
1373
1373
|
label: a(l)("menu.product.table.empty.actions.add"),
|
|
1374
1374
|
"prepend-icon": "add",
|
|
1375
|
-
onClick:
|
|
1376
|
-
}, null, 8, ["variant", "label"]), d(
|
|
1377
|
-
default:
|
|
1375
|
+
onClick: r[4] || (r[4] = (_) => a(f).create(null))
|
|
1376
|
+
}, null, 8, ["variant", "label"]), d(Ye, null, {
|
|
1377
|
+
default: T(({
|
|
1378
1378
|
trigger: _
|
|
1379
1379
|
}) => [d(v, {
|
|
1380
|
-
"bg-color": a(
|
|
1381
|
-
"text-color": a(
|
|
1382
|
-
variant: a(
|
|
1380
|
+
"bg-color": a(q).NeutralGray100,
|
|
1381
|
+
"text-color": a(q).NeutralGray400,
|
|
1382
|
+
variant: a(ee).Primary,
|
|
1383
1383
|
label: a(l)("menu.product.table.empty.actions.import"),
|
|
1384
1384
|
"prepend-icon": "download",
|
|
1385
1385
|
onClick: _
|
|
@@ -1394,62 +1394,62 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1394
1394
|
}
|
|
1395
1395
|
}), ea = {
|
|
1396
1396
|
key: 0,
|
|
1397
|
-
class: /* @__PURE__ */
|
|
1397
|
+
class: /* @__PURE__ */ ve(["flex flex-col", "flex-1", "overflow-hidden"])
|
|
1398
1398
|
}, ta = {
|
|
1399
|
-
class: /* @__PURE__ */
|
|
1399
|
+
class: /* @__PURE__ */ ve(["pt-16 xs:pt-0", "flex xs:flex-col", "flex-1", "w-full", "overflow-hidden"])
|
|
1400
1400
|
}, la = { class: "flex flex-col flex-1 overflow-hidden" }, aa = {
|
|
1401
1401
|
key: 1,
|
|
1402
1402
|
class: "pt-16 xs:pt-8 space-y-24"
|
|
1403
1403
|
}, oa = { class: "flex items-center gap-8 px-16" }, Fa = /* @__PURE__ */ K({
|
|
1404
1404
|
__name: "Product",
|
|
1405
1405
|
setup(k) {
|
|
1406
|
-
const e =
|
|
1407
|
-
var
|
|
1406
|
+
const e = Ve(), n = h(() => e.rules.item), i = ot(), l = h(() => !e.state.currentCatalogId), u = h(() => e.rules.item), t = h(() => !e.state.currentSchedulerId), s = V(!1), f = V(!1), p = h(() => {
|
|
1407
|
+
var $, P, A, ue;
|
|
1408
1408
|
if (l.value && t.value) return;
|
|
1409
1409
|
if (t.value) {
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1412
|
-
const j =
|
|
1413
|
-
return j && (N[
|
|
1410
|
+
const G = ($ = e.currentCatalog) == null ? void 0 : $.override.items;
|
|
1411
|
+
return G ? Object.entries(G).reduce((N, [M, ie]) => {
|
|
1412
|
+
const j = ie.find((ce) => !ce.combinationKey);
|
|
1413
|
+
return j && (N[M] = j), N;
|
|
1414
1414
|
}, {}) : {};
|
|
1415
1415
|
}
|
|
1416
|
-
return ((l.value ? (
|
|
1417
|
-
}), b =
|
|
1418
|
-
var
|
|
1416
|
+
return ((l.value ? (P = e.currentScheduler) == null ? void 0 : P.items : (ue = (A = e.currentCatalog) == null ? void 0 : A.override.scheduler[e.state.currentSchedulerId]) == null ? void 0 : ue.items) ?? []).reduce((G, N) => (N.combinationKey || (G[N._id] = N), G), {});
|
|
1417
|
+
}), b = V({}), y = V({}), w = async () => {
|
|
1418
|
+
var ue, G;
|
|
1419
1419
|
f.value = !0;
|
|
1420
|
-
const
|
|
1420
|
+
const R = !!p.value, $ = ge.flatten(Y.value.map((N) => N.items)), P = R && s.value ? await Vt(
|
|
1421
1421
|
e.mergedMenu,
|
|
1422
|
-
|
|
1422
|
+
$,
|
|
1423
1423
|
e.state.menu,
|
|
1424
|
-
(
|
|
1425
|
-
(
|
|
1424
|
+
(ue = e.currentCatalog) == null ? void 0 : ue._id,
|
|
1425
|
+
(G = e.currentScheduler) == null ? void 0 : G._id,
|
|
1426
1426
|
!1
|
|
1427
|
-
) : void 0,
|
|
1428
|
-
var
|
|
1429
|
-
const j = (
|
|
1430
|
-
return N[
|
|
1431
|
-
_id:
|
|
1432
|
-
name:
|
|
1433
|
-
code:
|
|
1434
|
-
category:
|
|
1435
|
-
additionalCategories:
|
|
1436
|
-
price:
|
|
1437
|
-
orderFrom:
|
|
1438
|
-
taxes:
|
|
1439
|
-
thumbnail:
|
|
1440
|
-
fallbackPrice: (
|
|
1441
|
-
fallbackName:
|
|
1442
|
-
fallbackCode: (
|
|
1443
|
-
fallbackOrder: (
|
|
1444
|
-
fallbackTaxes:
|
|
1427
|
+
) : void 0, A = $.reduce((N, M, ie) => {
|
|
1428
|
+
var ce, le, X, ye;
|
|
1429
|
+
const j = (ce = p.value) == null ? void 0 : ce[M._id];
|
|
1430
|
+
return N[M._id] = {
|
|
1431
|
+
_id: M._id,
|
|
1432
|
+
name: M.name,
|
|
1433
|
+
code: R ? j == null ? void 0 : j.code : M == null ? void 0 : M.code,
|
|
1434
|
+
category: M.category,
|
|
1435
|
+
additionalCategories: M.additionalCategories,
|
|
1436
|
+
price: R && u.value.editPrice ? j == null ? void 0 : j.price : M.price,
|
|
1437
|
+
orderFrom: R ? j == null ? void 0 : j.orderFrom : M.orderFrom,
|
|
1438
|
+
taxes: R ? null : M.taxes,
|
|
1439
|
+
thumbnail: M.thumbnail,
|
|
1440
|
+
fallbackPrice: (le = P == null ? void 0 : P[ie]) == null ? void 0 : le.price,
|
|
1441
|
+
fallbackName: R ? M.name : void 0,
|
|
1442
|
+
fallbackCode: (X = P == null ? void 0 : P[ie]) == null ? void 0 : X.code,
|
|
1443
|
+
fallbackOrder: (ye = P == null ? void 0 : P[ie]) == null ? void 0 : ye.orderFrom,
|
|
1444
|
+
fallbackTaxes: R ? M.taxes : null
|
|
1445
1445
|
}, N;
|
|
1446
1446
|
}, {});
|
|
1447
|
-
b.value =
|
|
1448
|
-
}, { categories:
|
|
1449
|
-
function
|
|
1447
|
+
b.value = A, y.value = { ...A }, f.value = !1;
|
|
1448
|
+
}, { categories: W, selectedCategories: Y } = Se(), S = V(null);
|
|
1449
|
+
function oe() {
|
|
1450
1450
|
S.value && S.value.toggleAttributeFilter();
|
|
1451
1451
|
}
|
|
1452
|
-
|
|
1452
|
+
tt(async () => {
|
|
1453
1453
|
Y.value && await w();
|
|
1454
1454
|
});
|
|
1455
1455
|
function Z() {
|
|
@@ -1457,56 +1457,57 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1457
1457
|
}
|
|
1458
1458
|
const re = () => {
|
|
1459
1459
|
Y.value && w();
|
|
1460
|
-
}, { t: E } =
|
|
1461
|
-
var
|
|
1462
|
-
return (
|
|
1460
|
+
}, { t: E } = Ie(), D = h(() => {
|
|
1461
|
+
var R, $;
|
|
1462
|
+
return ($ = (R = e.currentCatalog) == null ? void 0 : R.linkItemRules) == null ? void 0 : $.length;
|
|
1463
1463
|
}), {
|
|
1464
1464
|
menuItems: O,
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1465
|
+
categories: H,
|
|
1466
|
+
linkItemRules: J,
|
|
1467
|
+
handleSubmit: ne,
|
|
1468
|
+
catalogManager: Q,
|
|
1469
|
+
schedulerManager: se
|
|
1469
1470
|
} = kt(!1);
|
|
1470
|
-
return (
|
|
1471
|
-
const
|
|
1472
|
-
return a(
|
|
1471
|
+
return (R, $) => {
|
|
1472
|
+
const P = z("fm-button");
|
|
1473
|
+
return a(W).length ? (m(), C("div", ea, [
|
|
1473
1474
|
g("div", ta, [
|
|
1474
1475
|
g("div", la, [
|
|
1475
|
-
a(Y) ? (m(),
|
|
1476
|
+
a(Y) ? (m(), I(Xl, {
|
|
1476
1477
|
key: 0,
|
|
1477
1478
|
ref_key: "productTableRef",
|
|
1478
1479
|
ref: S,
|
|
1479
1480
|
"is-calculating": f.value,
|
|
1480
1481
|
"model-value": b.value,
|
|
1481
1482
|
"original-value": y.value,
|
|
1482
|
-
"onUpdate:modelValue":
|
|
1483
|
+
"onUpdate:modelValue": $[1] || ($[1] = (A) => b.value = A),
|
|
1483
1484
|
"onReset:modelValue": re,
|
|
1484
|
-
"onUpdate:editing":
|
|
1485
|
+
"onUpdate:editing": $[2] || ($[2] = (A) => s.value = A)
|
|
1485
1486
|
}, {
|
|
1486
|
-
filter:
|
|
1487
|
-
d(
|
|
1488
|
-
u.value.multiScheduler ? (m(),
|
|
1489
|
-
D.value ? (m(),
|
|
1487
|
+
filter: T(() => [
|
|
1488
|
+
d(He, { onToggleAttributeFilter: oe }),
|
|
1489
|
+
u.value.multiScheduler ? (m(), I(qe, { key: 0 })) : U("", !0),
|
|
1490
|
+
D.value ? (m(), I(Le, {
|
|
1490
1491
|
key: 1,
|
|
1491
|
-
"current-restaurant-
|
|
1492
|
-
onConfirm:
|
|
1493
|
-
}, null, 8, ["current-restaurant-
|
|
1492
|
+
"current-restaurant-attr-params": a(e).state.currentRestaurantAttrParams,
|
|
1493
|
+
onConfirm: $[0] || ($[0] = (A) => a(e).setRestaurantAttrParams(A))
|
|
1494
|
+
}, null, 8, ["current-restaurant-attr-params"])) : U("", !0)
|
|
1494
1495
|
]),
|
|
1495
1496
|
_: 1
|
|
1496
|
-
}, 8, ["is-calculating", "model-value", "original-value"])) :
|
|
1497
|
+
}, 8, ["is-calculating", "model-value", "original-value"])) : U("", !0)
|
|
1497
1498
|
])
|
|
1498
1499
|
])
|
|
1499
1500
|
])) : (m(), C("div", aa, [
|
|
1500
1501
|
g("div", oa, [
|
|
1501
|
-
d(
|
|
1502
|
-
u.value.multiScheduler ? (m(),
|
|
1503
|
-
D.value ? (m(),
|
|
1502
|
+
d(He),
|
|
1503
|
+
u.value.multiScheduler ? (m(), I(qe, { key: 0 })) : U("", !0),
|
|
1504
|
+
D.value ? (m(), I(Le, {
|
|
1504
1505
|
key: 1,
|
|
1505
|
-
"current-restaurant-
|
|
1506
|
-
onConfirm:
|
|
1507
|
-
}, null, 8, ["current-restaurant-
|
|
1506
|
+
"current-restaurant-attr-params": a(e).state.currentRestaurantAttrParams,
|
|
1507
|
+
onConfirm: $[3] || ($[3] = (A) => a(e).setRestaurantAttrParams(A))
|
|
1508
|
+
}, null, 8, ["current-restaurant-attr-params"])) : U("", !0)
|
|
1508
1509
|
]),
|
|
1509
|
-
|
|
1510
|
+
n.value.create ? (m(), I(be, {
|
|
1510
1511
|
key: 0,
|
|
1511
1512
|
action: {
|
|
1512
1513
|
text: a(E)("menu.product.empty.with_create.action"),
|
|
@@ -1514,57 +1515,59 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1514
1515
|
},
|
|
1515
1516
|
subtitle: a(E)("menu.product.empty.with_create.subtitle"),
|
|
1516
1517
|
title: a(E)("menu.product.empty.with_create.title")
|
|
1517
|
-
}, null, 8, ["action", "subtitle", "title"])) : t.value ? (m(),
|
|
1518
|
+
}, null, 8, ["action", "subtitle", "title"])) : t.value ? (m(), I(be, {
|
|
1518
1519
|
key: 1,
|
|
1519
1520
|
subtitle: a(E)("menu.product.empty.no_scheduler.subtitle"),
|
|
1520
1521
|
title: a(E)("menu.product.empty.no_scheduler.title")
|
|
1521
1522
|
}, {
|
|
1522
|
-
action:
|
|
1523
|
-
d(
|
|
1524
|
-
"categorized-items": a(
|
|
1525
|
-
"initial-value": a(
|
|
1523
|
+
action: T(() => [
|
|
1524
|
+
d(Ge, {
|
|
1525
|
+
"categorized-items": a(Q).linkableItems.value,
|
|
1526
|
+
"initial-value": a(Q).currentItems.value,
|
|
1526
1527
|
"show-variant": !1,
|
|
1527
1528
|
"menu-items": a(O),
|
|
1528
|
-
|
|
1529
|
+
categories: a(H),
|
|
1530
|
+
"link-item-rules": a(J),
|
|
1529
1531
|
"no-scheduler": t.value,
|
|
1530
1532
|
"is-local-only": !0,
|
|
1531
|
-
onSubmit: a(
|
|
1533
|
+
onSubmit: a(ne)
|
|
1532
1534
|
}, {
|
|
1533
|
-
default:
|
|
1534
|
-
d(
|
|
1535
|
+
default: T(({ trigger: A }) => [
|
|
1536
|
+
d(P, {
|
|
1535
1537
|
label: a(E)("menu.common.actions.link_product"),
|
|
1536
1538
|
"prepend-icon": "link",
|
|
1537
|
-
onClick:
|
|
1539
|
+
onClick: A
|
|
1538
1540
|
}, null, 8, ["label", "onClick"])
|
|
1539
1541
|
]),
|
|
1540
1542
|
_: 1
|
|
1541
|
-
}, 8, ["categorized-items", "initial-value", "menu-items", "link-item-rules", "no-scheduler", "onSubmit"])
|
|
1543
|
+
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])
|
|
1542
1544
|
]),
|
|
1543
1545
|
_: 1
|
|
1544
|
-
}, 8, ["subtitle", "title"])) : (m(),
|
|
1546
|
+
}, 8, ["subtitle", "title"])) : (m(), I(be, {
|
|
1545
1547
|
key: 2,
|
|
1546
1548
|
subtitle: a(E)("menu.product.empty.with_scheduler.subtitle"),
|
|
1547
1549
|
title: a(E)("menu.product.empty.with_scheduler.title")
|
|
1548
1550
|
}, {
|
|
1549
|
-
action:
|
|
1550
|
-
d(
|
|
1551
|
-
"categorized-items": a(
|
|
1552
|
-
"initial-value": a(
|
|
1551
|
+
action: T(() => [
|
|
1552
|
+
d(Ge, {
|
|
1553
|
+
"categorized-items": a(se).linkableItems.value,
|
|
1554
|
+
"initial-value": a(se).currentItems.value,
|
|
1553
1555
|
"show-variant": !1,
|
|
1554
1556
|
"menu-items": a(O),
|
|
1555
|
-
|
|
1557
|
+
categories: a(H),
|
|
1558
|
+
"link-item-rules": a(J),
|
|
1556
1559
|
"no-scheduler": t.value,
|
|
1557
1560
|
"is-local-only": !0,
|
|
1558
|
-
onSubmit: a(
|
|
1561
|
+
onSubmit: a(ne)
|
|
1559
1562
|
}, {
|
|
1560
|
-
default:
|
|
1561
|
-
d(
|
|
1563
|
+
default: T(({ trigger: A }) => [
|
|
1564
|
+
d(P, {
|
|
1562
1565
|
label: a(E)("menu.common.actions.apply_product"),
|
|
1563
|
-
onClick:
|
|
1566
|
+
onClick: A
|
|
1564
1567
|
}, null, 8, ["label", "onClick"])
|
|
1565
1568
|
]),
|
|
1566
1569
|
_: 1
|
|
1567
|
-
}, 8, ["categorized-items", "initial-value", "menu-items", "link-item-rules", "no-scheduler", "onSubmit"])
|
|
1570
|
+
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])
|
|
1568
1571
|
]),
|
|
1569
1572
|
_: 1
|
|
1570
1573
|
}, 8, ["subtitle", "title"]))
|
|
@@ -1573,6 +1576,6 @@ const Qe = /* @__PURE__ */ K({
|
|
|
1573
1576
|
}
|
|
1574
1577
|
});
|
|
1575
1578
|
export {
|
|
1576
|
-
|
|
1579
|
+
Ye as _,
|
|
1577
1580
|
Fa as a
|
|
1578
1581
|
};
|