@feedmepos/mf-menu 0.32.39-dev.1 → 0.32.40-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/{App-DRncp_Ei.js → App-_MLzeklD.js} +5 -5
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CkxXD8WW.js → ApplyProduct.vue_vue_type_script_setup_true_lang-UstB0HCf.js} +3 -3
  3. package/dist/{Catalog-DUiSF-WF.js → Catalog-CmM9e7VE.js} +6 -6
  4. package/dist/{Category-DE197NW1.js → Category-C72bnp32.js} +5 -5
  5. package/dist/{Category-DVPD4xrP.js → Category-ab7o-IpT.js} +4 -4
  6. package/dist/{CookingGuide-CHoGojcW.js → CookingGuide-CcW7ludO.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-dLiFrsWf.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CfBX_YEE.js} +1 -1
  8. package/dist/{Group-BXV1pM34.js → Group-BSoAjpHp.js} +3 -3
  9. package/dist/{Group-DMegQbpX.js → Group-DD1lzsQY.js} +1 -1
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-C_fcE1nx.js → Group.vue_vue_type_script_setup_true_lang-BUeaIf4N.js} +116 -116
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-wPIx9YCb.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CFeyZvxS.js} +5 -5
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CPMD7DRL.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-C8nNRSHM.js} +1958 -1942
  13. package/dist/{Ingredient-Dfibdd-o.js → Ingredient-824DB4pP.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BN4dh1LS.js → InventoryBinding.vue_vue_type_script_setup_true_lang-NpqmWdGE.js} +2 -2
  15. package/dist/{LinkProductSideSheet-D6Mqf5Hl.js → LinkProductSideSheet-DdyUWMWm.js} +3 -3
  16. package/dist/{MenuSetting-BESOJBlx.js → MenuSetting-DUX-xalJ.js} +5 -5
  17. package/dist/{PrintRoute-TPhGObk9.js → PrintRoute-CdTJK7Pp.js} +4 -4
  18. package/dist/{Product-Dp6HbElI.js → Product-Cbto_NJg.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-PDIUXdAC.js → Product.vue_vue_type_script_setup_true_lang-CP2VvoZ6.js} +13 -13
  20. package/dist/{ProductInternalTools-LWUFfPxo.js → ProductInternalTools-C_314g2l.js} +5 -5
  21. package/dist/{Products-Do5CagOW.js → Products-BEKsOtCj.js} +19 -19
  22. package/dist/{Publish-BD-AclFq.js → Publish-CN9S-t8t.js} +3 -3
  23. package/dist/{Recipe-Hzo2Izmw.js → Recipe-BCSIDC6j.js} +4 -4
  24. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DhSvT1fH.js → RuleView.vue_vue_type_script_setup_true_lang-DlW4Zx5S.js} +2 -2
  25. package/dist/{Scheduler-pTJ_CkJq.js → Scheduler-ZG2xvJvE.js} +3 -3
  26. package/dist/{ServingSequence-CvwLzA7G.js → ServingSequence-D8moUhOq.js} +3 -3
  27. package/dist/{Setting-BiUPxIvh.js → Setting-BKq7u_IL.js} +5 -5
  28. package/dist/Subcategory-BgTadpyj.js +349 -0
  29. package/dist/{Takeaway-CWNo49PD.js → Takeaway-C9bpWn4s.js} +4 -4
  30. package/dist/{Takeaway-C9dqWzrT.js → Takeaway-DyJrzpN-.js} +1 -1
  31. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CpUGSiIF.js → Takeaway.vue_vue_type_script_setup_true_lang-aFnWB49Z.js} +6 -6
  32. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-D8oVVt5f.js → Thumbnail.vue_vue_type_script_setup_true_lang-MKl8NdrG.js} +4 -4
  33. package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-wnFIuSpr.js +194 -0
  34. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Bye20Huu.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B556mEdE.js} +1907 -1899
  35. package/dist/{Unit-DKV2cfnv.js → Unit-CG_GyiVH.js} +2 -2
  36. package/dist/{Variant-CBr8tub8.js → Variant-D_ZlWQ43.js} +4 -4
  37. package/dist/{_id_-Ce6NN5vT.js → _id_-CSInNRCp.js} +9 -9
  38. package/dist/{app-CImDLyt0.js → app-b4ZmiMK2.js} +26 -26
  39. package/dist/{app-B7B_bbMc.js → app-vIXTx6c7.js} +1 -1
  40. package/dist/app.js +1 -1
  41. package/dist/apps/mf-menu/src/components/ProductTranslationDialog.vue.d.ts +4 -0
  42. package/dist/apps/mf-menu/src/components/TranslationFieldSection.vue.d.ts +7 -3
  43. package/dist/apps/mf-menu/src/components/TranslationSideSheet.vue.d.ts +2 -0
  44. package/dist/apps/mf-menu/src/components/feature/ApplyProduct/index.d.ts +6 -0
  45. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierButton.vue.d.ts +6 -0
  46. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierForm.vue.d.ts +6 -0
  47. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/item.d.ts +6 -0
  48. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/scheduler.d.ts +3 -0
  49. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +3 -0
  50. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ItemForm.vue.d.ts +9 -0
  51. package/dist/apps/mf-menu/src/components/feature/TreeEditor/menuUtils.d.ts +3 -0
  52. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +7 -0
  53. package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +6 -0
  54. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +3 -0
  55. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +17 -0
  56. package/dist/apps/mf-menu/src/helper/itemCategories.d.ts +3 -0
  57. package/dist/apps/mf-menu/src/helper/menu.d.ts +3 -0
  58. package/dist/apps/mf-menu/src/helper/menuExport.d.ts +2 -2
  59. package/dist/apps/mf-menu/src/helper/menuImport.d.ts +7 -0
  60. package/dist/apps/mf-menu/src/helper/menuSanitizer.d.ts +7 -0
  61. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +7 -0
  62. package/dist/apps/mf-menu/src/stores/manager/item.d.ts +9 -0
  63. package/dist/apps/mf-menu/src/stores/manager/scheduler.d.ts +3 -0
  64. package/dist/apps/mf-menu/src/stores/menu.d.ts +7 -0
  65. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +6 -0
  66. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  67. package/dist/assets/linked-status-J1LJXkYU.js +13 -0
  68. package/dist/assets/{menu-export-C2ctrNOt.js → menu-export-C4zy8Etx.js} +45 -45
  69. package/dist/assets/override-menu-CwpHJJ36.js +13 -0
  70. package/dist/assets/validate-menu-WYp7xh5-.js +13 -0
  71. package/dist/{catalog-RXap_5ft.js → catalog-Ce7o_N7a.js} +1 -1
  72. package/dist/{catalogSetting-D10sgkdu.js → catalogSetting-CeTOf9lJ.js} +1 -1
  73. package/dist/{currency-CPC6-Naj.js → currency-hq_koFDw.js} +1 -1
  74. package/dist/{dayjs.min-BgxdFykA.js → dayjs.min-UytF3izD.js} +1 -1
  75. package/dist/index-BydcrqXX.js +545 -0
  76. package/dist/{index-D35XBgVx.js → index-DYh6XlbG.js} +1 -1
  77. package/dist/{index-BWlfJ1Hv.js → index-WFUD7oh5.js} +58 -54
  78. package/dist/{index.vue_vue_type_script_setup_true_lang-CbdGF_YP.js → index.vue_vue_type_script_setup_true_lang-DOhr-m71.js} +14226 -14185
  79. package/dist/{item-Chx3oZ7b.js → item-BBqfgtk1.js} +2968 -2926
  80. package/dist/{jszip.min-DH0CoV5k.js → jszip.min-C4UMTEuA.js} +2 -2
  81. package/dist/{menu-DZhJl6lE.js → menu-CGK50Gwb.js} +1 -1
  82. package/dist/{menuV2-B1fegOdA.js → menuV2-DiyUO2p3.js} +50 -50
  83. package/dist/mf-menu.css +1 -1
  84. package/dist/{priceTier-C-ocPg-3.js → priceTier-eEeeQpw0.js} +1 -1
  85. package/dist/rules-BDtO9_2x.js +216 -0
  86. package/dist/{scheduler-J-XrlyVY.js → scheduler-C-UR0pvC.js} +4 -4
  87. package/dist/{toExcel-C9btsoRs.js → toExcel-Dr3CybYc.js} +2 -2
  88. package/dist/translation-Cdap0IVg.js +79 -0
  89. package/dist/{unit-Gtkb_1WB.js → unit-DMQom_GI.js} +2 -2
  90. package/package.json +3 -3
  91. package/dist/Subcategory-BpWPnu4s.js +0 -345
  92. package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-BSfPHkEr.js +0 -185
  93. package/dist/assets/linked-status-uqBsZwlR.js +0 -13
  94. package/dist/assets/override-menu-C-S-pdcA.js +0 -13
  95. package/dist/assets/validate-menu-D4bw2s4G.js +0 -13
  96. package/dist/index-B6yzhB_O.js +0 -539
  97. package/dist/rules-BBgzPaJ8.js +0 -212
  98. package/dist/translation-BeqjfyEb.js +0 -75
@@ -1,345 +0,0 @@
1
- import { defineComponent as I, ref as h, computed as k, watch as ae, resolveComponent as x, createElementBlock as C, openBlock as f, Fragment as j, renderSlot as oe, createVNode as d, unref as n, withCtx as y, createElementVNode as c, renderList as Q, toDisplayString as T, h as M, withModifiers as G, getCurrentInstance as te, createBlock as O, createCommentVNode as ne } from "vue";
2
- import { useI18n as z } from "@feedmepos/mf-common";
3
- import { useSnackbar as R, components as H, useDialog as W, FmButtonVariant as J, useBreakpoints as le, FmButtonColorThemeVariant as se } from "@feedmepos/ui-library";
4
- import { _ as ie } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
- import { G as P, u as Y, Q as K, M as X, A as Z, a4 as re } from "./index.vue_vue_type_script_setup_true_lang-CbdGF_YP.js";
6
- import { _ as ce } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as ue } from "./app-CImDLyt0.js";
8
- import { c as me } from "./createForm-BoUQeZTd.js";
9
- import { u as de } from "./discardConfirm-BHni0LNu.js";
10
- import { c as q } from "./object-DVUNCr7w.js";
11
- import { r as pe, u as ee } from "./rules-BBgzPaJ8.js";
12
- import { _ as _e } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-BSfPHkEr.js";
13
- import { c as fe } from "./check-C9mY6LiX.js";
14
- import { g as A } from "./translation-BeqjfyEb.js";
15
- import { a as ve } from "./menu-DZhJl6lE.js";
16
- const ge = {
17
- class: "fm-typo-en-title-md-600"
18
- }, ye = {
19
- class: "flex flex-col gap-32 h-full min-h-0 py-16"
20
- }, be = {
21
- class: "py-12 px-16 space-y-4"
22
- }, he = {
23
- class: "flex gap-8 items-center justify-start"
24
- }, xe = /* @__PURE__ */ I({
25
- __name: "Form",
26
- props: {
27
- initialValue: {}
28
- },
29
- setup(D, {
30
- expose: V
31
- }) {
32
- const b = D, $ = R(), w = P($), S = K(w), p = Y(), {
33
- t: l
34
- } = z(), F = h(!1), t = h(!1), L = h(!1), u = h(void 0), E = (e) => {
35
- fe.isBoolean(e) ? t.value = e : t.value = !t.value;
36
- }, i = h(q(b.initialValue)), N = k(() => !!i.value.name), U = k(() => {
37
- var o;
38
- const e = [], a = "en-US", m = (o = u.value) == null ? void 0 : o[a];
39
- return i.value.name && !m && e.push({
40
- locale: a,
41
- name: i.value.name,
42
- localeDisplay: A(a)
43
- }), u.value && Object.entries(u.value).filter(([_, v]) => v && v.trim()).sort(([_], [v]) => _.localeCompare(v)).forEach(([_, v]) => {
44
- e.push({
45
- locale: _,
46
- name: v,
47
- localeDisplay: A(_)
48
- });
49
- }), e;
50
- });
51
- function B(e) {
52
- u.value = e;
53
- }
54
- const s = de(() => {
55
- const e = p.subcategories.find((v) => v._id === i.value._id), a = i.value.name !== (e == null ? void 0 : e.name), m = (e == null ? void 0 : e.name_locale) || {}, o = u.value || {}, _ = JSON.stringify(m) !== JSON.stringify(o);
56
- return a || _;
57
- }, () => {
58
- t.value = !1;
59
- });
60
- async function r() {
61
- const e = p.subcategories.find((m) => m._id === i.value._id), {
62
- updateMenu: a
63
- } = S;
64
- await a({
65
- module: Z.F_MENU_MODULE_V4_KEY.enum.subCategory,
66
- operation: X.F_OPERATION_TYPE.update,
67
- // @ts-ignore FIXME: The backend hasn't exported SubcategoryRequest yet. Fix this once it's available.
68
- data: {
69
- ...e,
70
- name: i.value.name ?? (e == null ? void 0 : e.name),
71
- ...u.value && {
72
- name_locale: u.value
73
- }
74
- }
75
- }, i.value.name), E(!1);
76
- }
77
- return ae(() => t.value, () => {
78
- if (!t.value) return;
79
- i.value = q(b.initialValue);
80
- const e = p.subcategories.find((a) => a._id === i.value._id);
81
- u.value = e == null ? void 0 : e.name_locale;
82
- }), V({
83
- trigger: E,
84
- show: t
85
- }), (e, a) => {
86
- const m = x("fm-button"), o = x("FmTooltip"), _ = x("FmTextField"), v = x("fm-side-sheet");
87
- return f(), C(j, null, [oe(e.$slots, "default", {
88
- trigger: E
89
- }), d(v, {
90
- id: "group-form",
91
- modelValue: t.value,
92
- "onUpdate:modelValue": a[3] || (a[3] = (g) => t.value = g),
93
- "is-container": n(H).FmForm,
94
- "is-container-props": {
95
- onValidationSuccess: r,
96
- blameFormChildOnValidationFailed: !0
97
- },
98
- "max-width": 560,
99
- "onOn:clickedAway": n(s)
100
- }, {
101
- "side-sheet-header": y(() => [c("p", ge, T(n(l)("menu.subcategory.title")), 1)]),
102
- "side-sheet-footer": y(() => [c("div", he, [d(m, {
103
- label: n(l)("menu.common.actions.update"),
104
- loading: F.value,
105
- size: "lg",
106
- type: "submit",
107
- variant: "primary",
108
- disabled: !i.value._id
109
- }, null, 8, ["label", "loading", "disabled"]), d(m, {
110
- label: n(l)("menu.common.actions.cancel"),
111
- size: "lg",
112
- variant: "tertiary",
113
- onClick: a[2] || (a[2] = () => t.value = !1)
114
- }, null, 8, ["label"])])]),
115
- default: y(() => [c("div", ye, [d(_, {
116
- label: n(l)("menu.subcategory.name"),
117
- modelValue: i.value.name,
118
- "onUpdate:modelValue": a[1] || (a[1] = (g) => i.value.name = g),
119
- disabled: !i.value._id,
120
- rules: [n(pe)]
121
- }, {
122
- append: y(() => [d(o, {
123
- variant: "plain",
124
- placement: "top",
125
- "z-index": 999
126
- }, {
127
- content: y(() => [c("div", be, [(f(!0), C(j, null, Q(U.value, (g) => (f(), C("div", {
128
- key: g.locale
129
- }, T(g.name) + " (" + T(g.localeDisplay) + ") ", 1))), 128))])]),
130
- default: y(() => [d(m, {
131
- variant: "tertiary",
132
- icon: "g_translate",
133
- onClick: a[0] || (a[0] = (g) => L.value = !0),
134
- disabled: !N.value
135
- }, null, 8, ["disabled"])]),
136
- _: 1
137
- })]),
138
- _: 1
139
- }, 8, ["label", "modelValue", "disabled", "rules"])])]),
140
- _: 1
141
- }, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]), d(_e, {
142
- modelValue: L.value,
143
- "onUpdate:modelValue": a[4] || (a[4] = (g) => L.value = g),
144
- title: n(l)("menu.subcategory.title"),
145
- name: i.value.name,
146
- "name-locale": u.value,
147
- "onUpdate:nameLocale": B
148
- }, null, 8, ["modelValue", "title", "name", "name-locale"])], 64);
149
- };
150
- }
151
- }), Ce = xe, ke = {
152
- key: 0
153
- }, Ve = {
154
- class: "flex justify-end items-center"
155
- }, we = {
156
- class: "w-[320px]"
157
- }, Fe = {
158
- key: 1,
159
- class: "flex-1 flex flex-col min-h-0"
160
- }, Le = {
161
- class: "p-8"
162
- }, $e = {
163
- class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
164
- }, Se = ["onClick"], Ee = {
165
- class: "flex-1 space-y-4"
166
- }, Me = {
167
- class: "fm-typo-en-body-lg-600"
168
- }, Te = /* @__PURE__ */ I({
169
- __name: "SubcategoryTable",
170
- setup(D) {
171
- const V = W(), b = R(), $ = P(b), w = K($), S = ee({
172
- dialog: V,
173
- menuLoader: w
174
- }), p = k(() => Y().subcategories), l = h(""), F = k(() => p.value.filter((s) => s.name.toLowerCase().includes(l.value.toLowerCase()))), {
175
- t
176
- } = z(), L = h([{
177
- accessorKey: "name",
178
- header: () => t("menu.subcategory.columns.title"),
179
- enableSorting: !1,
180
- meta: {
181
- width: "auto"
182
- },
183
- cell: (s) => {
184
- const r = s.row.original, e = s.getValue(), m = Object.keys(r.name_locale ?? {}).map((o) => A(o));
185
- return M("div", {
186
- class: "flex items-center gap-8"
187
- }, [M("span", {
188
- class: "break-all"
189
- }, e), ...m.map((o) => M("div", {
190
- class: "rounded-lg border border-fm-color-primary text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600 px-8"
191
- }, o))]);
192
- }
193
- }, {
194
- id: "actions",
195
- size: 52,
196
- meta: {
197
- cellClass: "pl-16",
198
- headerContentClass: "-mx-16"
199
- },
200
- header: "",
201
- cell: (s) => {
202
- const r = s.row.original;
203
- return M("div", {
204
- class: "flex justify-end"
205
- }, [M(H.FmButton, {
206
- icon: "delete",
207
- disabled: !r._id,
208
- variant: "tertiary",
209
- textColor: "neutral-gray-400",
210
- onClick: G(async () => {
211
- await u(r);
212
- }, ["stop", "prevent"])
213
- })]);
214
- }
215
- }]);
216
- async function u(s) {
217
- if (!s._id) {
218
- b.open({
219
- message: t("menu.subcategory.dialog.remove.error"),
220
- type: "warning"
221
- });
222
- return;
223
- }
224
- V.open({
225
- title: t("menu.subcategory.dialog.remove.title"),
226
- message: t("menu.common.dialog.remove_confirmation", {
227
- name: s.name
228
- }),
229
- primaryActions: {
230
- text: "Remove",
231
- close: !0,
232
- variant: J.Destructive
233
- },
234
- secondaryActions: {
235
- text: "Cancel",
236
- close: !0
237
- }
238
- }).onPrimary(async () => {
239
- await w.updateMenu({
240
- module: Z.F_MENU_MODULE_V4_KEY.enum.subCategory,
241
- operation: X.F_OPERATION_TYPE.delete,
242
- data: s._id
243
- }, s.name, !0);
244
- });
245
- }
246
- async function E(s) {
247
- const r = s.map((e) => e._id).filter((e) => !!e);
248
- await S.rearrange(r);
249
- }
250
- const i = te();
251
- async function N(s) {
252
- me(i, Ce, {
253
- initialValue: s
254
- });
255
- }
256
- const U = le(), B = k(() => U.breakpoints.value.xs);
257
- return (s, r) => {
258
- const e = x("FmSearch"), a = x("FmTable"), m = x("FmButton");
259
- return B.value ? (f(), C("div", Fe, [c("div", Le, [d(e, {
260
- autofocus: "",
261
- modelValue: l.value,
262
- "onUpdate:modelValue": r[2] || (r[2] = (o) => l.value = o),
263
- class: "w-full",
264
- placeholder: n(t)("menu.common.labels.search_placeholder", {
265
- type: "categories"
266
- })
267
- }, null, 8, ["modelValue", "placeholder"])]), c("div", $e, [(f(!0), C(j, null, Q(F.value, (o) => (f(), C("div", {
268
- key: o._id || "",
269
- class: "flex flex-row py-12 px-16",
270
- onClick: (_) => N(o)
271
- }, [c("div", Ee, [c("p", Me, T(o.name), 1)]), d(m, {
272
- "text-color": n(se).NeutralGray400,
273
- variant: n(J).Tertiary,
274
- "prepend-icon": "delete",
275
- disabled: !o._id,
276
- onClick: G((_) => u(o), ["stop"])
277
- }, null, 8, ["text-color", "variant", "disabled", "onClick"])], 8, Se))), 128))])])) : (f(), C("div", ke, [c("div", Ve, [c("div", we, [d(e, {
278
- modelValue: l.value,
279
- "onUpdate:modelValue": r[0] || (r[0] = (o) => l.value = o),
280
- autofocus: "",
281
- class: "mb-8",
282
- placeholder: n(t)("menu.common.labels.search_placeholder", {
283
- type: n(t)("menu.subcategory.title")
284
- })
285
- }, null, 8, ["modelValue", "placeholder"])])]), d(ue, null, {
286
- default: y(() => [d(a, {
287
- "column-defs": L.value,
288
- draggable: !0,
289
- "page-size": p.value.length,
290
- "row-data": p.value,
291
- "search-value": l.value,
292
- "shrink-at": !1,
293
- "hide-footer": "",
294
- "pin-header-row": "",
295
- onDndChanged: E,
296
- onRowClick: r[1] || (r[1] = (o) => N(o.original))
297
- }, null, 8, ["column-defs", "page-size", "row-data", "search-value"])]),
298
- _: 1
299
- })]));
300
- };
301
- }
302
- }), Ne = { class: "flex-1 flex justify-between gap-8 pl-8" }, Oe = { class: "flex items-center" }, De = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ue = { class: "fm-typo-en-body-md-600 font-semibold" }, Xe = /* @__PURE__ */ I({
303
- __name: "Subcategory",
304
- setup(D) {
305
- const V = W(), b = R(), $ = P(b), w = K($), S = ee({ dialog: V, menuLoader: w }), p = k(() => Y().subcategories), { t: l } = z();
306
- function F() {
307
- S.create();
308
- }
309
- const t = k(() => p.value.length);
310
- return ve().resetOnMount(), (L, u) => (f(), O(ce, {
311
- heading: n(l)("menu.subcategory.title")
312
- }, {
313
- default: y(() => [
314
- p.value.length > 0 ? (f(), O(Te, { key: 0 })) : (f(), O(n(re), {
315
- key: 1,
316
- action: {
317
- text: n(l)("menu.subcategory.add"),
318
- callback: F
319
- },
320
- subtitle: n(l)("menu.subcategory.empty.subtitle"),
321
- title: n(l)("menu.subcategory.empty.title")
322
- }, null, 8, ["action", "subtitle", "title"]))
323
- ]),
324
- "append-heading": y(() => [
325
- c("div", Ne, [
326
- c("div", Oe, [
327
- c("div", De, [
328
- c("p", Ue, T(t.value), 1)
329
- ])
330
- ]),
331
- p.value.length > 0 ? (f(), O(ie, {
332
- key: 0,
333
- label: n(l)("menu.subcategory.add"),
334
- "prepend-icon": "add",
335
- onClick: F
336
- }, null, 8, ["label"])) : ne("", !0)
337
- ])
338
- ]),
339
- _: 1
340
- }, 8, ["heading"]));
341
- }
342
- });
343
- export {
344
- Xe as default
345
- };
@@ -1,185 +0,0 @@
1
- import { defineComponent as J, ref as w, watch as G, computed as j, unref as t, resolveComponent as f, createBlock as E, openBlock as d, withCtx as _, createElementVNode as e, toDisplayString as c, createElementBlock as m, createCommentVNode as F, Fragment as g, renderList as b, createVNode as r } from "vue";
2
- import { J as B } from "./index.vue_vue_type_script_setup_true_lang-CbdGF_YP.js";
3
- import { useI18n as H, useLocale as K } from "@feedmepos/mf-common";
4
- import { u as P } from "./discardConfirm-BHni0LNu.js";
5
- import { g as x, a as D, _ as Q, b as R } from "./translation-BeqjfyEb.js";
6
- const W = { class: "fm-typo-en-title-md-600" }, X = { class: "pt-8 space-y-24" }, Y = { class: "flex flex-col gap-8" }, Z = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, ee = { class: "flex items-center gap-8 flex-wrap" }, oe = { class: "w-24 h-24 rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600" }, te = { class: "fm-typo-en-body-md-600" }, le = ["onClick"], ne = { class: "flex items-center gap-8" }, ae = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, se = { class: "fm-typo-en-body-md-400" }, ce = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, de = { class: "flex items-center gap-16" }, ie = { class: "fm-typo-en-body-lg-600" }, re = { class: "flex flex-col gap-32 pl-32" }, me = {
7
- key: 0,
8
- class: "space-y-8"
9
- }, ue = { class: "flex w-[100px] items-center gap-8" }, pe = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, fe = { class: "fm-typo-en-body-md-400" }, _e = { class: "flex-1" }, ve = { class: "flex gap-8 items-center justify-start" }, Ce = /* @__PURE__ */ J({
10
- __name: "TranslationSideSheet",
11
- props: {
12
- modelValue: { type: Boolean },
13
- title: {},
14
- name: {},
15
- nameLocale: {}
16
- },
17
- emits: ["update:modelValue", "update:nameLocale"],
18
- setup(I, { emit: N }) {
19
- const u = I, p = N, { t: i } = H(), { localeList: v } = K(), s = w([]), C = w([]);
20
- function O() {
21
- return !u.nameLocale || Object.keys(u.nameLocale).length === 0 ? [] : Object.entries(u.nameLocale).map(([o, n]) => ({
22
- localeCode: o,
23
- value: n
24
- }));
25
- }
26
- G(
27
- () => [u.modelValue, u.nameLocale],
28
- ([o]) => {
29
- o && (s.value = O(), C.value = B.clone(s.value));
30
- },
31
- { immediate: !0 }
32
- );
33
- const k = j(() => {
34
- const o = new Set(s.value.map((a) => a.localeCode));
35
- return t(v).filter((a) => !o.has(a.code)).map((a) => ({
36
- code: a.code,
37
- name: a.name,
38
- icon: x(a.code)
39
- }));
40
- });
41
- function S(o) {
42
- const n = t(v).find((a) => a.code === o);
43
- n && s.value.push({
44
- localeCode: n.code,
45
- value: ""
46
- });
47
- }
48
- function T(o) {
49
- s.value = s.value.filter((n) => n.localeCode !== o);
50
- }
51
- function $() {
52
- return !B.isEqual(s.value, C.value);
53
- }
54
- function z() {
55
- const o = s.value.filter((n) => n.value.trim());
56
- if (o.length === 0)
57
- p("update:nameLocale", void 0);
58
- else {
59
- const n = {};
60
- o.forEach((a) => {
61
- n[a.localeCode] = a.value.trim();
62
- }), p("update:nameLocale", n);
63
- }
64
- p("update:modelValue", !1);
65
- }
66
- function U() {
67
- p("update:modelValue", !1);
68
- }
69
- const L = P($, U), V = j({
70
- get: () => u.modelValue,
71
- set: (o) => p("update:modelValue", o)
72
- });
73
- return (o, n) => {
74
- const a = f("FmIcon"), y = f("fm-button"), A = f("FmMenu"), M = f("fm-text-field"), q = f("fm-side-sheet");
75
- return d(), E(q, {
76
- modelValue: V.value,
77
- "onUpdate:modelValue": n[0] || (n[0] = (l) => V.value = l),
78
- "max-width": 720,
79
- "onOn:clickedAway": t(L)
80
- }, {
81
- "side-sheet-header": _(() => [
82
- e("p", W, c(o.title) + " " + c(t(i)("menu.common.translation.title_suffix")), 1)
83
- ]),
84
- "side-sheet-footer": _(() => [
85
- e("div", ve, [
86
- r(y, {
87
- label: t(i)("common.save"),
88
- size: "lg",
89
- variant: "primary",
90
- onClick: z
91
- }, null, 8, ["label"]),
92
- r(y, {
93
- label: t(i)("common.cancel"),
94
- size: "lg",
95
- variant: "tertiary",
96
- onClick: t(L)
97
- }, null, 8, ["label", "onClick"])
98
- ])
99
- ]),
100
- default: _(() => [
101
- e("div", X, [
102
- e("div", Y, [
103
- e("p", Z, c(t(i)("menu.common.translation.language")), 1),
104
- e("div", ee, [
105
- (d(!0), m(g, null, b(s.value, (l) => (d(), m("div", {
106
- key: l.localeCode,
107
- class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
108
- }, [
109
- e("div", oe, c(t(x)(l.localeCode)), 1),
110
- e("span", te, c(t(D)(l.localeCode, t(v))), 1),
111
- r(a, {
112
- name: "close",
113
- class: "cursor-pointer",
114
- variant: "secondary",
115
- onClick: (h) => T(l.localeCode)
116
- }, null, 8, ["onClick"])
117
- ]))), 128)),
118
- k.value.length > 0 ? (d(), E(A, { key: 0 }, {
119
- "menu-button": _(() => [
120
- r(y, {
121
- variant: "secondary",
122
- "border-color": "neutral-gray-300",
123
- "text-color": "neutral-gray-400",
124
- icon: "add"
125
- })
126
- ]),
127
- default: _(() => [
128
- (d(!0), m(g, null, b(k.value, (l) => (d(), m("div", {
129
- class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
130
- key: l.code,
131
- onClick: (h) => S(l.code)
132
- }, [
133
- e("div", ne, [
134
- e("div", ae, c(l.icon), 1),
135
- e("span", se, c(l.name), 1)
136
- ])
137
- ], 8, le))), 128))
138
- ]),
139
- _: 1
140
- })) : F("", !0)
141
- ])
142
- ]),
143
- e("div", ce, [
144
- e("div", de, [
145
- r(a, { name: "keyboard_arrow_down" }),
146
- e("p", ie, c(t(i)("menu.common.translation.name_section", { entity: o.title })), 1)
147
- ]),
148
- e("div", re, [
149
- r(Q, {
150
- label: t(i)("menu.common.translation.default"),
151
- "model-value": o.name
152
- }, null, 8, ["label", "model-value"]),
153
- s.value.length > 0 ? (d(), m("div", me, [
154
- r(R, {
155
- label: t(i)("menu.common.translation.translation_label")
156
- }, null, 8, ["label"]),
157
- (d(!0), m(g, null, b(s.value, (l) => (d(), m("div", {
158
- key: l.localeCode,
159
- class: "flex items-center gap-16"
160
- }, [
161
- e("div", ue, [
162
- e("div", pe, c(t(x)(l.localeCode)), 1),
163
- e("span", fe, c(t(D)(l.localeCode, t(v))), 1)
164
- ]),
165
- e("div", _e, [
166
- r(M, {
167
- modelValue: l.value,
168
- "onUpdate:modelValue": (h) => l.value = h,
169
- placeholder: t(i)("menu.group.translation.placeholder")
170
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
171
- ])
172
- ]))), 128))
173
- ])) : F("", !0)
174
- ])
175
- ])
176
- ])
177
- ]),
178
- _: 1
179
- }, 8, ["modelValue", "onOn:clickedAway"]);
180
- };
181
- }
182
- });
183
- export {
184
- Ce as _
185
- };