@feedmepos/mf-menu 0.32.37-dev.1 → 0.32.38-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-Bb-3_ZSx.js → App-DGdS9nht.js} +5 -5
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BARmH5Kv.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CBy3XScH.js} +3 -3
- package/dist/{Catalog-yRIPAnDC.js → Catalog-BuI0IVpf.js} +6 -6
- package/dist/{Category-Ca9K5MhL.js → Category-DSTt-Sl6.js} +9 -9
- package/dist/Category-DbL3CS-5.js +224 -0
- package/dist/{CookingGuide-B8BEcGEe.js → CookingGuide-Baw7iMDl.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DIpsCALu.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BDZDojOt.js} +1 -1
- package/dist/{Group-BT99kxFT.js → Group-BnzmEllK.js} +1 -1
- package/dist/{Group-th2sIKMq.js → Group-D158_Fr0.js} +7 -7
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BBucri8m.js → Group.vue_vue_type_script_setup_true_lang-C3H6xvlY.js} +227 -216
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-RBYXZiHI.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D2G40Yc6.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DrPwZuUE.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-D-JOSWUn.js} +6 -6
- package/dist/{Ingredient-BEcfdvoj.js → Ingredient-C-gP75uQ.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CXWw_gWA.js → InventoryBinding.vue_vue_type_script_setup_true_lang-BpuYVaKl.js} +2 -2
- package/dist/{LinkProductSideSheet-5r07FaSs.js → LinkProductSideSheet-DN5fbJVw.js} +3 -3
- package/dist/{MenuSetting-HhVipfSP.js → MenuSetting-CjQ6_Ti_.js} +5 -5
- package/dist/{PrintRoute-xkZf95vB.js → PrintRoute-DK25vS8X.js} +4 -4
- package/dist/{Product-Bn_h8_wa.js → Product-DCEMAuw3.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-3mmMzUVq.js → Product.vue_vue_type_script_setup_true_lang-DCutU0Ny.js} +348 -337
- package/dist/{ProductInternalTools-BRsD97bC.js → ProductInternalTools-CiDa1V3D.js} +22 -22
- package/dist/{Products-CpDyGrq_.js → Products-DUxtMLiy.js} +50 -50
- package/dist/{Publish-Ce67sfIi.js → Publish-Bs5zVwDw.js} +3 -3
- package/dist/{Recipe-6pn-8XJc.js → Recipe-_WCpFOU6.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-o8JUN34b.js → RuleView.vue_vue_type_script_setup_true_lang-3AVOVYpW.js} +2 -2
- package/dist/{Scheduler-DVIqTWNo.js → Scheduler-BqFwfRlm.js} +3 -3
- package/dist/{ServingSequence-yaPOAqwr.js → ServingSequence-ByNsE8ha.js} +3 -3
- package/dist/{Setting-DCpmd6aM.js → Setting-widqJGfT.js} +5 -5
- package/dist/Subcategory-DXaz2g4-.js +345 -0
- package/dist/{Takeaway-B8yW3jnm.js → Takeaway-Ce_y1_UW.js} +1 -1
- package/dist/{Takeaway-fjsxTI9x.js → Takeaway-DVBJn6re.js} +4 -4
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-DK2Cp2Dg.js +316 -0
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-c0N8J2_E.js → Thumbnail.vue_vue_type_script_setup_true_lang-CAiNaQMP.js} +4 -4
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-BPs9D7Pq.js +185 -0
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-nFLEeipN.js +6120 -0
- package/dist/{Unit-CB7huz6v.js → Unit-XJLHLSYf.js} +2 -2
- package/dist/Variant-BA1AQl9-.js +247 -0
- package/dist/{_id_-C6pbjMX7.js → _id_-CA2rV7Eb.js} +9 -9
- package/dist/app-C9zsFCoJ.js +363 -0
- package/dist/{app-C2AxZIV0.js → app-D2Sxejos.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +264 -0
- package/dist/apps/mf-menu/src/components/ProductTranslationDialog.vue.d.ts +41 -0
- package/dist/apps/mf-menu/src/components/TranslationBadge.vue.d.ts +29 -0
- package/dist/apps/mf-menu/src/components/TranslationFieldSection.vue.d.ts +39 -0
- package/dist/apps/mf-menu/src/components/TranslationSideSheet.vue.d.ts +23 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProduct.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProductDialog.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/index.d.ts +54 -0
- package/dist/apps/mf-menu/src/components/feature/CategoryManager/Form.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/feature/Fields/ImageDropField.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/OptionTable.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/ProductOverrideTranslation.vue.d.ts +22 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/UpdateForm.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierButton.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierForm.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/category.d.ts +8 -2
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/item.d.ts +24 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/scheduler.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +10 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/OptionTable.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/UpdateForm.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/index.d.ts +24 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ItemForm.vue.d.ts +30 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/menuUtils.d.ts +10 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +125 -1
- package/dist/apps/mf-menu/src/components/feature/VariantManager/ProductVariantTranslation.vue.d.ts +37 -0
- package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +16 -0
- package/dist/apps/mf-menu/src/helper/item.d.ts +1 -0
- package/dist/apps/mf-menu/src/helper/itemCategories.d.ts +10 -0
- package/dist/apps/mf-menu/src/helper/menu.d.ts +11 -0
- package/dist/apps/mf-menu/src/helper/menuImport.d.ts +125 -1
- package/dist/apps/mf-menu/src/helper/menuSanitizer.d.ts +125 -1
- package/dist/apps/mf-menu/src/manager/menu/category.d.ts +8 -2
- package/dist/apps/mf-menu/src/manager/menu/group.d.ts +1 -0
- package/dist/apps/mf-menu/src/manager/menu/item.d.ts +125 -1
- package/dist/apps/mf-menu/src/manager/menu/subcategory.d.ts +6 -0
- package/dist/apps/mf-menu/src/stores/manager/item.d.ts +31 -1
- package/dist/apps/mf-menu/src/stores/manager/scheduler.d.ts +16 -0
- package/dist/apps/mf-menu/src/stores/manager/takeaway.d.ts +9 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +125 -1
- package/dist/apps/mf-menu/src/utils/translation.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddCategoryDialogContentComponent.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +46 -0
- package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +10 -0
- package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +10 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-BrleJSCp.js +13 -0
- package/dist/assets/menu-export-Da3-wtnw.js +107 -0
- package/dist/assets/override-menu-ChjeVe4O.js +13 -0
- package/dist/assets/validate-menu-YVTxOfeq.js +13 -0
- package/dist/{catalog-CExooVeT.js → catalog-YvUT-JIh.js} +1 -1
- package/dist/{catalogSetting-DdEejp3Q.js → catalogSetting-CXOYJZO3.js} +1 -1
- package/dist/{currency-Prr2X-1u.js → currency-np4zdWW1.js} +1 -1
- package/dist/dayjs.min-CSuLNurY.js +6 -0
- package/dist/{index-D3Vh13iX.js → index-3wQe-6lg.js} +1 -1
- package/dist/index-CFbB7bM3.js +335 -0
- package/dist/index-Cek4Z9eM.js +539 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-BF1UnZ5l.js → index.vue_vue_type_script_setup_true_lang-HZXySVXs.js} +18035 -17833
- package/dist/item-DR9qrNf6.js +8117 -0
- package/dist/{jszip.min-BQ_xBh4o.js → jszip.min-Bz8ZTO2s.js} +2 -2
- package/dist/{menu-B0qJanmj.js → menu-BWsDRctK.js} +1 -1
- package/dist/{menuV2-DdCaRGqL.js → menuV2-CfsbyMis.js} +74 -74
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-B-XJVQDe.js → priceTier-BNCJtFVM.js} +1 -1
- package/dist/rules-DU-MRKWH.js +212 -0
- package/dist/{scheduler-DyVdWsn7.js → scheduler-BizSj8q8.js} +4 -4
- package/dist/{toExcel-D0rRKbjh.js → toExcel-DhRigI9c.js} +2 -2
- package/dist/translation-BeqjfyEb.js +75 -0
- package/dist/{unit-DcHsbLOz.js → unit-CaOym7HP.js} +2 -2
- package/package.json +3 -3
- package/dist/Category-DJriqKNV.js +0 -392
- package/dist/Subcategory-Dsf5NLIa.js +0 -280
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-Bk2edy2M.js +0 -305
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CgF9dq-t.js +0 -6024
- package/dist/Variant-DSOF9uPl.js +0 -230
- package/dist/app-DPNctjt-.js +0 -363
- package/dist/assets/linked-status-DVG3fmWg.js +0 -13
- package/dist/assets/menu-export-CVc1O3S8.js +0 -107
- package/dist/assets/override-menu-ClMYkz3D.js +0 -13
- package/dist/assets/validate-menu-CWDyO0w0.js +0 -13
- package/dist/category-3SQRILcp.js +0 -156
- package/dist/dayjs.min-BOYFHQRS.js +0 -6
- package/dist/index-DBRFZboy.js +0 -273
- package/dist/index-TgR8MNiA.js +0 -239
- package/dist/item-C2wRl41j.js +0 -6950
- package/dist/rules-CIWTZQfh.js +0 -6
- package/dist/subcategory-DMfXewrZ.js +0 -148
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
import { defineComponent as K, ref as F, computed as B, watch as se, resolveComponent as p, createElementBlock as E, openBlock as f, Fragment as Z, renderSlot as re, createVNode as d, unref as e, withCtx as g, createElementVNode as n, toDisplayString as T, h as N, withModifiers as D, getCurrentInstance as ie, renderList as ce, createBlock as L, createCommentVNode as ue } from "vue";
|
|
2
|
-
import { useI18n as j } from "@feedmepos/mf-common";
|
|
3
|
-
import { useSnackbar as Y, components as R, useDialog as ee, FmButtonVariant as H, useBreakpoints as de, FmButtonColorThemeVariant as me } from "@feedmepos/ui-library";
|
|
4
|
-
import { _ as pe } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
|
-
import { G, u as ge, a1 as fe, $ as _e, A, a4 as ye, Q as q, M as te, a5 as ve } from "./index.vue_vue_type_script_setup_true_lang-BF1UnZ5l.js";
|
|
6
|
-
import { _ as he } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
7
|
-
import { _ as be } from "./app-DPNctjt-.js";
|
|
8
|
-
import { c as xe } from "./createForm-BoUQeZTd.js";
|
|
9
|
-
import { _ as J } from "./RuleView.vue_vue_type_script_setup_true_lang-o8JUN34b.js";
|
|
10
|
-
import { u as Ce } from "./discardConfirm-BHni0LNu.js";
|
|
11
|
-
import { c as X } from "./object-DVUNCr7w.js";
|
|
12
|
-
import { r as ke } from "./rules-CIWTZQfh.js";
|
|
13
|
-
import { u as Q, a as we } from "./menu-B0qJanmj.js";
|
|
14
|
-
import { c as Fe } from "./check-C9mY6LiX.js";
|
|
15
|
-
import { u as Ve } from "./item-C2wRl41j.js";
|
|
16
|
-
import { u as ae } from "./category-3SQRILcp.js";
|
|
17
|
-
const $e = {
|
|
18
|
-
class: "fm-typo-en-title-md-600"
|
|
19
|
-
}, Me = {
|
|
20
|
-
class: "flex flex-col gap-32 h-full min-h-0 py-16"
|
|
21
|
-
}, Se = {
|
|
22
|
-
class: "flex gap-24 items-center"
|
|
23
|
-
}, Ee = {
|
|
24
|
-
class: "text-fm-color-typo-secondary"
|
|
25
|
-
}, Be = {
|
|
26
|
-
class: "flex-1"
|
|
27
|
-
}, Te = {
|
|
28
|
-
class: "flex-1 overflow-hidden min-h-[300px]"
|
|
29
|
-
}, Ue = {
|
|
30
|
-
class: "flex gap-8 items-center justify-start"
|
|
31
|
-
}, Le = /* @__PURE__ */ K({
|
|
32
|
-
__name: "Form",
|
|
33
|
-
props: {
|
|
34
|
-
initialValue: {}
|
|
35
|
-
},
|
|
36
|
-
setup(O, {
|
|
37
|
-
expose: h
|
|
38
|
-
}) {
|
|
39
|
-
const _ = O, V = Y(), b = G(V), $ = q(b), m = ge(), r = Ve(), {
|
|
40
|
-
categories: x
|
|
41
|
-
} = Q(), {
|
|
42
|
-
t
|
|
43
|
-
} = j(), U = F(!1), u = F(!1), M = (a) => {
|
|
44
|
-
Fe.isBoolean(a) ? u.value = a : u.value = !u.value;
|
|
45
|
-
}, i = F(X(_.initialValue)), C = F(""), S = B(() => {
|
|
46
|
-
var k;
|
|
47
|
-
const a = ((k = x.value.find((w) => w.id === i.value.id)) == null ? void 0 : k.items) || [], o = fe(i.value.id);
|
|
48
|
-
return _e(a, (w) => w.code || w.name, o);
|
|
49
|
-
}), P = [{
|
|
50
|
-
accessorKey: "name",
|
|
51
|
-
header: () => t("menu.category.products.columns.name"),
|
|
52
|
-
enableSorting: !1
|
|
53
|
-
}, {
|
|
54
|
-
accessorKey: "code",
|
|
55
|
-
header: () => t("menu.category.products.columns.code"),
|
|
56
|
-
enableSorting: !1
|
|
57
|
-
}, {
|
|
58
|
-
id: "actions",
|
|
59
|
-
size: 52,
|
|
60
|
-
meta: {
|
|
61
|
-
cellClass: "pl-16",
|
|
62
|
-
headerContentClass: "-mx-16"
|
|
63
|
-
},
|
|
64
|
-
header: "",
|
|
65
|
-
cell: (a) => {
|
|
66
|
-
const o = a.row.original;
|
|
67
|
-
return N("div", {
|
|
68
|
-
class: "flex justify-end"
|
|
69
|
-
}, [N(R.FmButton, {
|
|
70
|
-
icon: "edit",
|
|
71
|
-
outline: !0,
|
|
72
|
-
variant: "tertiary",
|
|
73
|
-
textColor: "neutral-gray-400",
|
|
74
|
-
onClick: D(async () => {
|
|
75
|
-
await s(o);
|
|
76
|
-
}, ["stop", "prevent"])
|
|
77
|
-
})]);
|
|
78
|
-
}
|
|
79
|
-
}];
|
|
80
|
-
async function l() {
|
|
81
|
-
await r.create(i.value.id);
|
|
82
|
-
}
|
|
83
|
-
async function s(a) {
|
|
84
|
-
await r.update(a._id);
|
|
85
|
-
}
|
|
86
|
-
const y = B(() => m.version === A.F_MENU_VERSION.enum.v4);
|
|
87
|
-
async function I(a) {
|
|
88
|
-
const o = ye(a, i.value.id);
|
|
89
|
-
await r.updateMany(o);
|
|
90
|
-
}
|
|
91
|
-
const z = Ce(() => i.value.name !== _.initialValue.name, () => {
|
|
92
|
-
u.value = !1;
|
|
93
|
-
});
|
|
94
|
-
async function c() {
|
|
95
|
-
const a = m.categories.find((k) => k._id === i.value.id), {
|
|
96
|
-
updateMenu: o
|
|
97
|
-
} = $;
|
|
98
|
-
await o({
|
|
99
|
-
module: A.F_MENU_MODULE_V4_KEY.enum.category,
|
|
100
|
-
operation: te.F_OPERATION_TYPE.update,
|
|
101
|
-
data: {
|
|
102
|
-
...a,
|
|
103
|
-
name: i.value.name ?? (a == null ? void 0 : a.name)
|
|
104
|
-
}
|
|
105
|
-
}, i.value.name), M(!1);
|
|
106
|
-
}
|
|
107
|
-
return se(() => u.value, () => {
|
|
108
|
-
u.value && (i.value = X(_.initialValue));
|
|
109
|
-
}), h({
|
|
110
|
-
trigger: M,
|
|
111
|
-
show: u
|
|
112
|
-
}), (a, o) => {
|
|
113
|
-
const k = p("FmTextField"), w = p("FmButton"), oe = p("FmSearch"), ne = p("FmTable"), W = p("fm-button"), le = p("fm-side-sheet");
|
|
114
|
-
return f(), E(Z, null, [re(a.$slots, "default", {
|
|
115
|
-
trigger: M
|
|
116
|
-
}), d(le, {
|
|
117
|
-
id: "group-form",
|
|
118
|
-
modelValue: u.value,
|
|
119
|
-
"onUpdate:modelValue": o[4] || (o[4] = (v) => u.value = v),
|
|
120
|
-
"is-container": e(R).FmForm,
|
|
121
|
-
"is-container-props": {
|
|
122
|
-
onValidationSuccess: c,
|
|
123
|
-
blameFormChildOnValidationFailed: !0
|
|
124
|
-
},
|
|
125
|
-
"max-width": 560,
|
|
126
|
-
"onOn:clickedAway": e(z)
|
|
127
|
-
}, {
|
|
128
|
-
"side-sheet-header": g(() => [n("p", $e, T(e(t)("menu.category.title")), 1)]),
|
|
129
|
-
"side-sheet-footer": g(() => [n("div", Ue, [d(W, {
|
|
130
|
-
label: e(t)("menu.common.actions.update"),
|
|
131
|
-
loading: U.value,
|
|
132
|
-
size: "lg",
|
|
133
|
-
type: "submit",
|
|
134
|
-
variant: "primary",
|
|
135
|
-
disabled: !i.value.id
|
|
136
|
-
}, null, 8, ["label", "loading", "disabled"]), d(W, {
|
|
137
|
-
label: e(t)("menu.common.actions.cancel"),
|
|
138
|
-
size: "lg",
|
|
139
|
-
variant: "tertiary",
|
|
140
|
-
onClick: o[3] || (o[3] = () => u.value = !1)
|
|
141
|
-
}, null, 8, ["label"])])]),
|
|
142
|
-
default: g(() => [n("div", Me, [d(J, {
|
|
143
|
-
title: e(t)("menu.category.detail")
|
|
144
|
-
}, {
|
|
145
|
-
default: g(() => [d(k, {
|
|
146
|
-
label: e(t)("menu.category.name"),
|
|
147
|
-
modelValue: i.value.name,
|
|
148
|
-
"onUpdate:modelValue": o[0] || (o[0] = (v) => i.value.name = v),
|
|
149
|
-
disabled: !i.value.id,
|
|
150
|
-
rules: [e(ke)]
|
|
151
|
-
}, null, 8, ["label", "modelValue", "disabled", "rules"])]),
|
|
152
|
-
_: 1
|
|
153
|
-
}, 8, ["title"]), d(J, {
|
|
154
|
-
title: e(t)("menu.category.products.title"),
|
|
155
|
-
class: "flex-1 min-h-0",
|
|
156
|
-
shrinkable: !0
|
|
157
|
-
}, {
|
|
158
|
-
"append-title": g(() => [d(w, {
|
|
159
|
-
label: e(t)("menu.category.products.add"),
|
|
160
|
-
variant: "secondary",
|
|
161
|
-
"prepend-icon": "add",
|
|
162
|
-
"text-color": "primary",
|
|
163
|
-
"border-color": "primary",
|
|
164
|
-
onClick: l
|
|
165
|
-
}, null, 8, ["label"])]),
|
|
166
|
-
default: g(() => [n("div", Se, [n("div", Ee, T(e(t)("menu.category.products.linked_count", {
|
|
167
|
-
count: S.value.length
|
|
168
|
-
})), 1), n("div", Be, [d(oe, {
|
|
169
|
-
placeholder: e(t)("menu.common.actions.search"),
|
|
170
|
-
modelValue: C.value,
|
|
171
|
-
"onUpdate:modelValue": o[1] || (o[1] = (v) => C.value = v)
|
|
172
|
-
}, null, 8, ["placeholder", "modelValue"])])]), n("div", Te, [d(ne, {
|
|
173
|
-
"column-defs": P,
|
|
174
|
-
draggable: y.value,
|
|
175
|
-
"page-size": S.value.length,
|
|
176
|
-
"row-data": S.value,
|
|
177
|
-
"search-value": C.value,
|
|
178
|
-
"shrink-at": !1,
|
|
179
|
-
"hide-footer": "",
|
|
180
|
-
"pin-header-row": "",
|
|
181
|
-
onDndChanged: I,
|
|
182
|
-
onRowClick: o[2] || (o[2] = (v) => s(v.original))
|
|
183
|
-
}, null, 8, ["draggable", "page-size", "row-data", "search-value"])])]),
|
|
184
|
-
_: 1
|
|
185
|
-
}, 8, ["title"])])]),
|
|
186
|
-
_: 1
|
|
187
|
-
}, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"])], 64);
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
}), Ne = Le, Oe = {
|
|
191
|
-
key: 0
|
|
192
|
-
}, Pe = {
|
|
193
|
-
class: "flex justify-end items-center"
|
|
194
|
-
}, Ie = {
|
|
195
|
-
class: "w-[320px]"
|
|
196
|
-
}, ze = {
|
|
197
|
-
key: 1,
|
|
198
|
-
class: "flex-1 flex flex-col min-h-0"
|
|
199
|
-
}, De = {
|
|
200
|
-
class: "p-8"
|
|
201
|
-
}, Re = {
|
|
202
|
-
class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
|
|
203
|
-
}, Ae = ["onClick"], Ke = {
|
|
204
|
-
class: "flex-1 space-y-4"
|
|
205
|
-
}, je = {
|
|
206
|
-
class: "fm-typo-en-body-lg-600"
|
|
207
|
-
}, Ye = {
|
|
208
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
209
|
-
}, Ge = /* @__PURE__ */ K({
|
|
210
|
-
__name: "CategoryTable",
|
|
211
|
-
setup(O) {
|
|
212
|
-
const h = ee(), _ = Y(), V = G(_), b = q(V), $ = ae({
|
|
213
|
-
dialog: h,
|
|
214
|
-
menuLoader: b
|
|
215
|
-
}), {
|
|
216
|
-
categories: m
|
|
217
|
-
} = Q(), r = F(""), x = B(() => m.value.filter((l) => l.name.toLowerCase().includes(r.value.toLowerCase()))), {
|
|
218
|
-
t
|
|
219
|
-
} = j(), U = F([{
|
|
220
|
-
accessorKey: "name",
|
|
221
|
-
header: () => t("menu.category.columns.title"),
|
|
222
|
-
enableSorting: !1,
|
|
223
|
-
meta: {
|
|
224
|
-
width: "auto"
|
|
225
|
-
}
|
|
226
|
-
}, {
|
|
227
|
-
accessorKey: "items",
|
|
228
|
-
header: () => t("menu.category.columns.products"),
|
|
229
|
-
enableSorting: !1,
|
|
230
|
-
size: 200,
|
|
231
|
-
cell: (l) => {
|
|
232
|
-
const s = l.row.original;
|
|
233
|
-
return t(s.items.length > 1 ? "menu.common.labels.product_linked_plural" : "menu.common.labels.product_linked_singular", {
|
|
234
|
-
count: s.items.length
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
}, {
|
|
238
|
-
id: "actions",
|
|
239
|
-
size: 52,
|
|
240
|
-
meta: {
|
|
241
|
-
cellClass: "pl-16",
|
|
242
|
-
headerContentClass: "-mx-16"
|
|
243
|
-
},
|
|
244
|
-
header: "",
|
|
245
|
-
cell: (l) => {
|
|
246
|
-
const s = l.row.original;
|
|
247
|
-
return N("div", {
|
|
248
|
-
class: "flex justify-end"
|
|
249
|
-
}, [N(R.FmButton, {
|
|
250
|
-
icon: "delete",
|
|
251
|
-
disabled: !s.id,
|
|
252
|
-
variant: "tertiary",
|
|
253
|
-
textColor: "neutral-gray-400",
|
|
254
|
-
onClick: D(async () => {
|
|
255
|
-
await u(s);
|
|
256
|
-
}, ["stop", "prevent"])
|
|
257
|
-
})]);
|
|
258
|
-
}
|
|
259
|
-
}]);
|
|
260
|
-
async function u(l) {
|
|
261
|
-
if (!l.id) {
|
|
262
|
-
_.open({
|
|
263
|
-
message: t("menu.category.dialog.remove.error"),
|
|
264
|
-
type: "warning"
|
|
265
|
-
});
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
h.open({
|
|
269
|
-
title: t("menu.category.dialog.remove.title"),
|
|
270
|
-
message: t("menu.common.dialog.remove_confirmation", {
|
|
271
|
-
name: l.name
|
|
272
|
-
}),
|
|
273
|
-
primaryActions: {
|
|
274
|
-
text: "Remove",
|
|
275
|
-
close: !0,
|
|
276
|
-
variant: H.Destructive
|
|
277
|
-
},
|
|
278
|
-
secondaryActions: {
|
|
279
|
-
text: "Cancel",
|
|
280
|
-
close: !0
|
|
281
|
-
}
|
|
282
|
-
}).onPrimary(async () => {
|
|
283
|
-
await b.updateMenu({
|
|
284
|
-
module: A.F_MENU_MODULE_V4_KEY.enum.category,
|
|
285
|
-
operation: te.F_OPERATION_TYPE.delete,
|
|
286
|
-
// `category.id` is guaranteed to be defined due to the earlier check in `deleteCategory`.
|
|
287
|
-
data: l.id
|
|
288
|
-
}, l.name, !0);
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
async function M(l) {
|
|
292
|
-
const s = l.map((y) => y.id).filter((y) => !!y);
|
|
293
|
-
await $.rearrange(s);
|
|
294
|
-
}
|
|
295
|
-
const i = ie();
|
|
296
|
-
async function C(l) {
|
|
297
|
-
xe(i, Ne, {
|
|
298
|
-
initialValue: l
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
const S = de(), P = B(() => S.breakpoints.value.xs);
|
|
302
|
-
return (l, s) => {
|
|
303
|
-
const y = p("FmSearch"), I = p("FmTable"), z = p("FmButton");
|
|
304
|
-
return P.value ? (f(), E("div", ze, [n("div", De, [d(y, {
|
|
305
|
-
autofocus: "",
|
|
306
|
-
modelValue: r.value,
|
|
307
|
-
"onUpdate:modelValue": s[2] || (s[2] = (c) => r.value = c),
|
|
308
|
-
class: "w-full",
|
|
309
|
-
placeholder: e(t)("menu.common.labels.search_placeholder", {
|
|
310
|
-
type: "categories"
|
|
311
|
-
})
|
|
312
|
-
}, null, 8, ["modelValue", "placeholder"])]), n("div", Re, [(f(!0), E(Z, null, ce(x.value, (c) => (f(), E("div", {
|
|
313
|
-
key: c.id || "",
|
|
314
|
-
class: "flex flex-row py-12 px-16",
|
|
315
|
-
onClick: (a) => C(c)
|
|
316
|
-
}, [n("div", Ke, [n("p", je, T(c.name), 1), n("p", Ye, T(e(t)(c.items.length > 1 ? "menu.common.labels.product_linked_plural" : "menu.common.labels.product_linked_singular", {
|
|
317
|
-
count: c.items.length
|
|
318
|
-
})), 1)]), d(z, {
|
|
319
|
-
"text-color": e(me).NeutralGray400,
|
|
320
|
-
variant: e(H).Tertiary,
|
|
321
|
-
"prepend-icon": "delete",
|
|
322
|
-
disabled: !c.id,
|
|
323
|
-
onClick: D((a) => u(c), ["stop"])
|
|
324
|
-
}, null, 8, ["text-color", "variant", "disabled", "onClick"])], 8, Ae))), 128))])])) : (f(), E("div", Oe, [n("div", Pe, [n("div", Ie, [d(y, {
|
|
325
|
-
modelValue: r.value,
|
|
326
|
-
"onUpdate:modelValue": s[0] || (s[0] = (c) => r.value = c),
|
|
327
|
-
autofocus: "",
|
|
328
|
-
class: "mb-8",
|
|
329
|
-
placeholder: e(t)("menu.common.labels.search_placeholder", {
|
|
330
|
-
type: e(t)("menu.category.title")
|
|
331
|
-
})
|
|
332
|
-
}, null, 8, ["modelValue", "placeholder"])])]), d(be, null, {
|
|
333
|
-
default: g(() => [d(I, {
|
|
334
|
-
"column-defs": U.value,
|
|
335
|
-
draggable: !0,
|
|
336
|
-
"page-size": e(m).length,
|
|
337
|
-
"row-data": e(m),
|
|
338
|
-
"search-value": r.value,
|
|
339
|
-
"shrink-at": !1,
|
|
340
|
-
"hide-footer": "",
|
|
341
|
-
"pin-header-row": "",
|
|
342
|
-
onDndChanged: M,
|
|
343
|
-
onRowClick: s[1] || (s[1] = (c) => C(c.original))
|
|
344
|
-
}, null, 8, ["column-defs", "page-size", "row-data", "search-value"])]),
|
|
345
|
-
_: 1
|
|
346
|
-
})]));
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
}), qe = { class: "flex-1 flex justify-between gap-8 pl-8" }, Qe = { class: "flex items-center" }, We = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, He = { class: "fm-typo-en-body-md-600 font-semibold" }, pt = /* @__PURE__ */ K({
|
|
350
|
-
__name: "Category",
|
|
351
|
-
setup(O) {
|
|
352
|
-
const h = ee(), _ = Y(), V = G(_), b = q(V), $ = ae({ dialog: h, menuLoader: b }), { categories: m } = Q(), { t: r } = j();
|
|
353
|
-
function x() {
|
|
354
|
-
$.create();
|
|
355
|
-
}
|
|
356
|
-
const t = B(() => m.value.length);
|
|
357
|
-
return we().resetOnMount(), (U, u) => (f(), L(he, {
|
|
358
|
-
heading: e(r)("menu.category.title")
|
|
359
|
-
}, {
|
|
360
|
-
default: g(() => [
|
|
361
|
-
e(m).length > 0 ? (f(), L(Ge, { key: 0 })) : (f(), L(e(ve), {
|
|
362
|
-
key: 1,
|
|
363
|
-
action: {
|
|
364
|
-
text: e(r)("menu.category.add"),
|
|
365
|
-
callback: x
|
|
366
|
-
},
|
|
367
|
-
subtitle: e(r)("menu.category.empty.subtitle"),
|
|
368
|
-
title: e(r)("menu.category.empty.title")
|
|
369
|
-
}, null, 8, ["action", "subtitle", "title"]))
|
|
370
|
-
]),
|
|
371
|
-
"append-heading": g(() => [
|
|
372
|
-
n("div", qe, [
|
|
373
|
-
n("div", Qe, [
|
|
374
|
-
n("div", We, [
|
|
375
|
-
n("p", He, T(t.value), 1)
|
|
376
|
-
])
|
|
377
|
-
]),
|
|
378
|
-
e(m).length > 0 ? (f(), L(pe, {
|
|
379
|
-
key: 0,
|
|
380
|
-
label: e(r)("menu.category.add"),
|
|
381
|
-
"prepend-icon": "add",
|
|
382
|
-
onClick: x
|
|
383
|
-
}, null, 8, ["label"])) : ue("", !0)
|
|
384
|
-
])
|
|
385
|
-
]),
|
|
386
|
-
_: 1
|
|
387
|
-
}, 8, ["heading"]));
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
export {
|
|
391
|
-
pt as default
|
|
392
|
-
};
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, ref as w, watch as W, resolveComponent as y, createElementBlock as V, openBlock as p, Fragment as P, renderSlot as X, createVNode as m, unref as t, withCtx as h, createElementVNode as s, toDisplayString as T, computed as F, h as U, withModifiers as R, getCurrentInstance as Z, renderList as ee, createBlock as M, createCommentVNode as te } from "vue";
|
|
2
|
-
import { useI18n as B } from "@feedmepos/mf-common";
|
|
3
|
-
import { useSnackbar as O, components as j, useDialog as Y, FmButtonVariant as z, useBreakpoints as ae, FmButtonColorThemeVariant as oe } from "@feedmepos/ui-library";
|
|
4
|
-
import { _ as ne } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
|
-
import { G as D, u as N, Q as A, M as K, A as G, a5 as le } from "./index.vue_vue_type_script_setup_true_lang-BF1UnZ5l.js";
|
|
6
|
-
import { _ as se } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
7
|
-
import { _ as re } from "./app-DPNctjt-.js";
|
|
8
|
-
import { c as ie } from "./createForm-BoUQeZTd.js";
|
|
9
|
-
import { u as ce } from "./discardConfirm-BHni0LNu.js";
|
|
10
|
-
import { c as I } from "./object-DVUNCr7w.js";
|
|
11
|
-
import { r as ue } from "./rules-CIWTZQfh.js";
|
|
12
|
-
import { c as de } from "./check-C9mY6LiX.js";
|
|
13
|
-
import { u as q } from "./subcategory-DMfXewrZ.js";
|
|
14
|
-
import { a as me } from "./menu-B0qJanmj.js";
|
|
15
|
-
const pe = {
|
|
16
|
-
class: "fm-typo-en-title-md-600"
|
|
17
|
-
}, _e = {
|
|
18
|
-
class: "flex flex-col gap-32 h-full min-h-0 py-16"
|
|
19
|
-
}, fe = {
|
|
20
|
-
class: "flex gap-8 items-center justify-start"
|
|
21
|
-
}, ge = /* @__PURE__ */ L({
|
|
22
|
-
__name: "Form",
|
|
23
|
-
props: {
|
|
24
|
-
initialValue: {}
|
|
25
|
-
},
|
|
26
|
-
setup(S, {
|
|
27
|
-
expose: f
|
|
28
|
-
}) {
|
|
29
|
-
const _ = S, x = O(), g = D(x), k = A(g), d = N(), {
|
|
30
|
-
t: a
|
|
31
|
-
} = B(), v = w(!1), e = w(!1), b = (r) => {
|
|
32
|
-
de.isBoolean(r) ? e.value = r : e.value = !e.value;
|
|
33
|
-
}, n = w(I(_.initialValue)), $ = ce(() => n.value.name !== _.initialValue.name, () => {
|
|
34
|
-
e.value = !1;
|
|
35
|
-
});
|
|
36
|
-
async function E() {
|
|
37
|
-
const r = d.subcategories.find((C) => C._id === n.value._id), {
|
|
38
|
-
updateMenu: c
|
|
39
|
-
} = k;
|
|
40
|
-
await c({
|
|
41
|
-
module: G.F_MENU_MODULE_V4_KEY.enum.subCategory,
|
|
42
|
-
operation: K.F_OPERATION_TYPE.update,
|
|
43
|
-
// @ts-ignore FIXME: The backend hasn't exported SubcategoryRequest yet. Fix this once it's available.
|
|
44
|
-
data: {
|
|
45
|
-
...r,
|
|
46
|
-
name: n.value.name ?? (r == null ? void 0 : r.name)
|
|
47
|
-
}
|
|
48
|
-
}, n.value.name), b(!1);
|
|
49
|
-
}
|
|
50
|
-
return W(() => e.value, () => {
|
|
51
|
-
e.value && (n.value = I(_.initialValue));
|
|
52
|
-
}), f({
|
|
53
|
-
trigger: b,
|
|
54
|
-
show: e
|
|
55
|
-
}), (r, c) => {
|
|
56
|
-
const C = y("FmTextField"), o = y("fm-button"), l = y("fm-side-sheet");
|
|
57
|
-
return p(), V(P, null, [X(r.$slots, "default", {
|
|
58
|
-
trigger: b
|
|
59
|
-
}), m(l, {
|
|
60
|
-
id: "group-form",
|
|
61
|
-
modelValue: e.value,
|
|
62
|
-
"onUpdate:modelValue": c[2] || (c[2] = (u) => e.value = u),
|
|
63
|
-
"is-container": t(j).FmForm,
|
|
64
|
-
"is-container-props": {
|
|
65
|
-
onValidationSuccess: E,
|
|
66
|
-
blameFormChildOnValidationFailed: !0
|
|
67
|
-
},
|
|
68
|
-
"max-width": 560,
|
|
69
|
-
"onOn:clickedAway": t($)
|
|
70
|
-
}, {
|
|
71
|
-
"side-sheet-header": h(() => [s("p", pe, T(t(a)("menu.subcategory.title")), 1)]),
|
|
72
|
-
"side-sheet-footer": h(() => [s("div", fe, [m(o, {
|
|
73
|
-
label: t(a)("menu.common.actions.update"),
|
|
74
|
-
loading: v.value,
|
|
75
|
-
size: "lg",
|
|
76
|
-
type: "submit",
|
|
77
|
-
variant: "primary",
|
|
78
|
-
disabled: !n.value._id
|
|
79
|
-
}, null, 8, ["label", "loading", "disabled"]), m(o, {
|
|
80
|
-
label: t(a)("menu.common.actions.cancel"),
|
|
81
|
-
size: "lg",
|
|
82
|
-
variant: "tertiary",
|
|
83
|
-
onClick: c[1] || (c[1] = () => e.value = !1)
|
|
84
|
-
}, null, 8, ["label"])])]),
|
|
85
|
-
default: h(() => [s("div", _e, [m(C, {
|
|
86
|
-
label: t(a)("menu.subcategory.name"),
|
|
87
|
-
modelValue: n.value.name,
|
|
88
|
-
"onUpdate:modelValue": c[0] || (c[0] = (u) => n.value.name = u),
|
|
89
|
-
disabled: !n.value._id,
|
|
90
|
-
rules: [t(ue)]
|
|
91
|
-
}, null, 8, ["label", "modelValue", "disabled", "rules"])])]),
|
|
92
|
-
_: 1
|
|
93
|
-
}, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"])], 64);
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
}), ve = ge, be = {
|
|
97
|
-
key: 0
|
|
98
|
-
}, ye = {
|
|
99
|
-
class: "flex justify-end items-center"
|
|
100
|
-
}, he = {
|
|
101
|
-
class: "w-[320px]"
|
|
102
|
-
}, xe = {
|
|
103
|
-
key: 1,
|
|
104
|
-
class: "flex-1 flex flex-col min-h-0"
|
|
105
|
-
}, ke = {
|
|
106
|
-
class: "p-8"
|
|
107
|
-
}, Ce = {
|
|
108
|
-
class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
|
|
109
|
-
}, Ve = ["onClick"], we = {
|
|
110
|
-
class: "flex-1 space-y-4"
|
|
111
|
-
}, Fe = {
|
|
112
|
-
class: "fm-typo-en-body-lg-600"
|
|
113
|
-
}, Me = /* @__PURE__ */ L({
|
|
114
|
-
__name: "SubcategoryTable",
|
|
115
|
-
setup(S) {
|
|
116
|
-
const f = Y(), _ = O(), x = D(_), g = A(x), k = q({
|
|
117
|
-
dialog: f,
|
|
118
|
-
menuLoader: g
|
|
119
|
-
}), d = F(() => N().subcategories), a = w(""), v = F(() => d.value.filter((o) => o.name.toLowerCase().includes(a.value.toLowerCase()))), {
|
|
120
|
-
t: e
|
|
121
|
-
} = B(), b = w([{
|
|
122
|
-
accessorKey: "name",
|
|
123
|
-
header: () => e("menu.subcategory.columns.title"),
|
|
124
|
-
enableSorting: !1,
|
|
125
|
-
meta: {
|
|
126
|
-
width: "auto"
|
|
127
|
-
}
|
|
128
|
-
}, {
|
|
129
|
-
id: "actions",
|
|
130
|
-
size: 52,
|
|
131
|
-
meta: {
|
|
132
|
-
cellClass: "pl-16",
|
|
133
|
-
headerContentClass: "-mx-16"
|
|
134
|
-
},
|
|
135
|
-
header: "",
|
|
136
|
-
cell: (o) => {
|
|
137
|
-
const l = o.row.original;
|
|
138
|
-
return U("div", {
|
|
139
|
-
class: "flex justify-end"
|
|
140
|
-
}, [U(j.FmButton, {
|
|
141
|
-
icon: "delete",
|
|
142
|
-
disabled: !l._id,
|
|
143
|
-
variant: "tertiary",
|
|
144
|
-
textColor: "neutral-gray-400",
|
|
145
|
-
onClick: R(async () => {
|
|
146
|
-
await n(l);
|
|
147
|
-
}, ["stop", "prevent"])
|
|
148
|
-
})]);
|
|
149
|
-
}
|
|
150
|
-
}]);
|
|
151
|
-
async function n(o) {
|
|
152
|
-
if (!o._id) {
|
|
153
|
-
_.open({
|
|
154
|
-
message: e("menu.subcategory.dialog.remove.error"),
|
|
155
|
-
type: "warning"
|
|
156
|
-
});
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
f.open({
|
|
160
|
-
title: e("menu.subcategory.dialog.remove.title"),
|
|
161
|
-
message: e("menu.common.dialog.remove_confirmation", {
|
|
162
|
-
name: o.name
|
|
163
|
-
}),
|
|
164
|
-
primaryActions: {
|
|
165
|
-
text: "Remove",
|
|
166
|
-
close: !0,
|
|
167
|
-
variant: z.Destructive
|
|
168
|
-
},
|
|
169
|
-
secondaryActions: {
|
|
170
|
-
text: "Cancel",
|
|
171
|
-
close: !0
|
|
172
|
-
}
|
|
173
|
-
}).onPrimary(async () => {
|
|
174
|
-
await g.updateMenu({
|
|
175
|
-
module: G.F_MENU_MODULE_V4_KEY.enum.subCategory,
|
|
176
|
-
operation: K.F_OPERATION_TYPE.delete,
|
|
177
|
-
data: o._id
|
|
178
|
-
}, o.name, !0);
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
async function $(o) {
|
|
182
|
-
const l = o.map((u) => u._id).filter((u) => !!u);
|
|
183
|
-
await k.rearrange(l);
|
|
184
|
-
}
|
|
185
|
-
const E = Z();
|
|
186
|
-
async function r(o) {
|
|
187
|
-
ie(E, ve, {
|
|
188
|
-
initialValue: o
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
const c = ae(), C = F(() => c.breakpoints.value.xs);
|
|
192
|
-
return (o, l) => {
|
|
193
|
-
const u = y("FmSearch"), Q = y("FmTable"), H = y("FmButton");
|
|
194
|
-
return C.value ? (p(), V("div", xe, [s("div", ke, [m(u, {
|
|
195
|
-
autofocus: "",
|
|
196
|
-
modelValue: a.value,
|
|
197
|
-
"onUpdate:modelValue": l[2] || (l[2] = (i) => a.value = i),
|
|
198
|
-
class: "w-full",
|
|
199
|
-
placeholder: t(e)("menu.common.labels.search_placeholder", {
|
|
200
|
-
type: "categories"
|
|
201
|
-
})
|
|
202
|
-
}, null, 8, ["modelValue", "placeholder"])]), s("div", Ce, [(p(!0), V(P, null, ee(v.value, (i) => (p(), V("div", {
|
|
203
|
-
key: i._id || "",
|
|
204
|
-
class: "flex flex-row py-12 px-16",
|
|
205
|
-
onClick: (J) => r(i)
|
|
206
|
-
}, [s("div", we, [s("p", Fe, T(i.name), 1)]), m(H, {
|
|
207
|
-
"text-color": t(oe).NeutralGray400,
|
|
208
|
-
variant: t(z).Tertiary,
|
|
209
|
-
"prepend-icon": "delete",
|
|
210
|
-
disabled: !i._id,
|
|
211
|
-
onClick: R((J) => n(i), ["stop"])
|
|
212
|
-
}, null, 8, ["text-color", "variant", "disabled", "onClick"])], 8, Ve))), 128))])])) : (p(), V("div", be, [s("div", ye, [s("div", he, [m(u, {
|
|
213
|
-
modelValue: a.value,
|
|
214
|
-
"onUpdate:modelValue": l[0] || (l[0] = (i) => a.value = i),
|
|
215
|
-
autofocus: "",
|
|
216
|
-
class: "mb-8",
|
|
217
|
-
placeholder: t(e)("menu.common.labels.search_placeholder", {
|
|
218
|
-
type: t(e)("menu.subcategory.title")
|
|
219
|
-
})
|
|
220
|
-
}, null, 8, ["modelValue", "placeholder"])])]), m(re, null, {
|
|
221
|
-
default: h(() => [m(Q, {
|
|
222
|
-
"column-defs": b.value,
|
|
223
|
-
draggable: !0,
|
|
224
|
-
"page-size": d.value.length,
|
|
225
|
-
"row-data": d.value,
|
|
226
|
-
"search-value": a.value,
|
|
227
|
-
"shrink-at": !1,
|
|
228
|
-
"hide-footer": "",
|
|
229
|
-
"pin-header-row": "",
|
|
230
|
-
onDndChanged: $,
|
|
231
|
-
onRowClick: l[1] || (l[1] = (i) => r(i.original))
|
|
232
|
-
}, null, 8, ["column-defs", "page-size", "row-data", "search-value"])]),
|
|
233
|
-
_: 1
|
|
234
|
-
})]));
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
}), Se = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "flex items-center" }, Ee = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Le = { class: "fm-typo-en-body-md-600 font-semibold" }, Ge = /* @__PURE__ */ L({
|
|
238
|
-
__name: "Subcategory",
|
|
239
|
-
setup(S) {
|
|
240
|
-
const f = Y(), _ = O(), x = D(_), g = A(x), k = q({ dialog: f, menuLoader: g }), d = F(() => N().subcategories), { t: a } = B();
|
|
241
|
-
function v() {
|
|
242
|
-
k.create();
|
|
243
|
-
}
|
|
244
|
-
const e = F(() => d.value.length);
|
|
245
|
-
return me().resetOnMount(), (b, n) => (p(), M(se, {
|
|
246
|
-
heading: t(a)("menu.subcategory.title")
|
|
247
|
-
}, {
|
|
248
|
-
default: h(() => [
|
|
249
|
-
d.value.length > 0 ? (p(), M(Me, { key: 0 })) : (p(), M(t(le), {
|
|
250
|
-
key: 1,
|
|
251
|
-
action: {
|
|
252
|
-
text: t(a)("menu.subcategory.add"),
|
|
253
|
-
callback: v
|
|
254
|
-
},
|
|
255
|
-
subtitle: t(a)("menu.subcategory.empty.subtitle"),
|
|
256
|
-
title: t(a)("menu.subcategory.empty.title")
|
|
257
|
-
}, null, 8, ["action", "subtitle", "title"]))
|
|
258
|
-
]),
|
|
259
|
-
"append-heading": h(() => [
|
|
260
|
-
s("div", Se, [
|
|
261
|
-
s("div", $e, [
|
|
262
|
-
s("div", Ee, [
|
|
263
|
-
s("p", Le, T(e.value), 1)
|
|
264
|
-
])
|
|
265
|
-
]),
|
|
266
|
-
d.value.length > 0 ? (p(), M(ne, {
|
|
267
|
-
key: 0,
|
|
268
|
-
label: t(a)("menu.subcategory.add"),
|
|
269
|
-
"prepend-icon": "add",
|
|
270
|
-
onClick: v
|
|
271
|
-
}, null, 8, ["label"])) : te("", !0)
|
|
272
|
-
])
|
|
273
|
-
]),
|
|
274
|
-
_: 1
|
|
275
|
-
}, 8, ["heading"]));
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
export {
|
|
279
|
-
Ge as default
|
|
280
|
-
};
|