@feedmepos/mf-menu-portal 1.0.4 → 1.0.5-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.
Files changed (78) hide show
  1. package/dist/{App-CgYpEYgp.js → App-B2xq1U4S.js} +699 -687
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CPh1GBw9.js} +11 -10
  3. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-CWe5_Sm5.js → BindingTable.vue_vue_type_script_setup_true_lang-DCgMQJE-.js} +50 -46
  4. package/dist/Catalog-BEI73S_k.js +433 -0
  5. package/dist/{CatalogBinding-BjTeOA91.js → CatalogBinding-3rhuTWDD.js} +30 -29
  6. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-doB3hsWD.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-CraEwqCY.js} +30 -29
  7. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-BpBR-N_x.js → CatalogEditor.vue_vue_type_script_setup_true_lang-Dc72SNpI.js} +314 -304
  8. package/dist/CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-CMyubLvP.js +127 -0
  9. package/dist/{Category-6-ppsSmZ.js → Category-BVCdkA5K.js} +14 -13
  10. package/dist/{Category-CdsbuUqi.js → Category-P5DYjIeF.js} +2 -2
  11. package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-DlNUOgyu.js → CategoryList.vue_vue_type_script_setup_true_lang-DyhW52Df.js} +274 -262
  12. package/dist/{CookingGuide-CRyRlBeV.js → CookingGuide-Y-c1NLP5.js} +144 -140
  13. package/dist/{Group-DVrUlq4i.js → Group-D6wA3jCF.js} +2 -2
  14. package/dist/{Group-DqyBHSFx.js → Group-qqr5SUIc.js} +17 -15
  15. package/dist/GroupList.vue_vue_type_script_setup_true_lang-DNTVfY2d.js +1996 -0
  16. package/dist/{Ingredient-CGLfhbvN.js → Ingredient-CJHkJZ0y.js} +94 -93
  17. package/dist/{LinkProductSideSheet.vue_vue_type_script_setup_true_lang-C0rc1FRO.js → LinkProductSideSheet.vue_vue_type_script_setup_true_lang-Cb6nO43H.js} +1 -1
  18. package/dist/{MenuSetting-Oct3vbHj.js → MenuSetting-YcEGo51l.js} +462 -446
  19. package/dist/{OrderPacing-BDkzflgE.js → OrderPacing-DwQU7c0Y.js} +207 -204
  20. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-B259anSs.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-2Cdz70u-.js} +1 -2
  21. package/dist/PageLayout.vue_vue_type_script_setup_true_lang-DrhsROXo.js +44 -0
  22. package/dist/PhoneFab.vue_vue_type_script_setup_true_lang-CipbTqbp.js +12 -0
  23. package/dist/{Preview-V9cSpevb.js → Preview-DLeXy5V-.js} +2 -2
  24. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-k5S4mGCN.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-D_OV9Z_4.js} +1 -1
  25. package/dist/{PrintRoute-3UwiMoBU.js → PrintRoute-R38w0-U2.js} +151 -150
  26. package/dist/{Product-LaB-YRTQ.js → Product-sbMCaVhM.js} +8 -7
  27. package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-DoHQeOHy.js +7826 -0
  28. package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D9v88xZs.js +111 -0
  29. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-BBXGnZtc.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-DsIGLKNS.js} +17 -17
  30. package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BUC6qUnG.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-CEliG36Z.js} +726 -726
  31. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CjQRRqBx.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-B3bShTjM.js} +127 -124
  32. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-3yzUcogQ.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-BzctosMW.js} +820 -807
  33. package/dist/{ProductInternalTools-DWCgC825.js → ProductInternalTools-jE3Ovo4l.js} +3 -3
  34. package/dist/{ProductInventoryDialog-D0d5RywR.js → ProductInventoryDialog-EDlrXupB.js} +1 -1
  35. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-CmYKO0ZX.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-LOwSpoiA.js} +1 -1
  36. package/dist/{ProductList.vue_vue_type_script_setup_true_lang-DeX8Exly.js → ProductList.vue_vue_type_script_setup_true_lang-rczFAWVa.js} +1135 -1098
  37. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-BFD6_Sbb.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-C4iK-sAd.js} +1 -1
  38. package/dist/{Products-BLUhwFT-.js → Products-DUE10OyS.js} +51 -49
  39. package/dist/Publish-BlMxKniP.js +1300 -0
  40. package/dist/{Recipe-BGfofjHT.js → Recipe-BhjPAidT.js} +83 -82
  41. package/dist/{Scheduler-BL7t8aS7.js → Scheduler-wKG3_D1f.js} +137 -136
  42. package/dist/{ServingSequence-CDFXMCiN.js → ServingSequence-B26BETQs.js} +63 -61
  43. package/dist/Setting-DBdNl3WL.js +185 -0
  44. package/dist/{Subcategory-CnlrVwCy.js → Subcategory-B06yMcuE.js} +147 -144
  45. package/dist/{Takeaway-D8FzvC2w.js → Takeaway-CFATfy-6.js} +2 -2
  46. package/dist/{Takeaway-BWVzwWnh.js → Takeaway-DFqOtls7.js} +17 -16
  47. package/dist/TakeawayList.vue_vue_type_script_setup_true_lang-CUHB-g9I.js +616 -0
  48. package/dist/TextChip.vue_vue_type_script_setup_true_lang-YkUjMTXo.js +32 -0
  49. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B8nXazx6.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DoS4Btzj.js} +281 -308
  50. package/dist/{Unit-Do7Tt8U8.js → Unit-B5wKBmIT.js} +90 -89
  51. package/dist/{Variant-D1kLupxx.js → Variant-C5ePu0za.js} +167 -174
  52. package/dist/{_id_-DomaBHrh.js → _id_-HRDqt6oD.js} +3 -3
  53. package/dist/{app-C_XNYz8_.js → app-CxJjx2ma.js} +39 -39
  54. package/dist/app.js +1 -1
  55. package/dist/apps/mf-menu/src/app.d.ts +35 -0
  56. package/dist/apps/mf-menu/src/components/GroupList.vue.d.ts +8 -0
  57. package/dist/apps/mf-menu/src/components/Product/OrderFromChip.vue.d.ts +6 -0
  58. package/dist/apps/mf-menu/src/components/Product/ProductThumbnail.vue.d.ts +6 -0
  59. package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +4 -2
  60. package/dist/apps/mf-menu/src/components/PublishList.vue.d.ts +1 -1
  61. package/dist/apps/mf-menu/src/components/layout/MobileXScrollable.vue.d.ts +9 -0
  62. package/dist/apps/mf-menu/src/components/layout/PageLayout.vue.d.ts +7 -0
  63. package/dist/apps/mf-menu/src/components/layout/PhoneFab.vue.d.ts +9 -0
  64. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  65. package/dist/assets/{menu-compute-Did75Kp9.js → menu-compute-CQdeCEBO.js} +19 -19
  66. package/dist/assets/{validate-menu-DVMOLygB.js → validate-menu-BVo4fNWG.js} +14 -14
  67. package/dist/mf-menu-portal.css +1 -1
  68. package/dist/{provide-Bwf3KcOV.js → provide-BGLSDsuJ.js} +99817 -99565
  69. package/dist/{useActionFeedback-CXx7dOVc.js → useActionFeedback-CElXij1W.js} +1 -1
  70. package/package.json +1 -1
  71. package/dist/Catalog-BrHGEI3p.js +0 -374
  72. package/dist/CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-P59vHZEn.js +0 -117
  73. package/dist/GroupList.vue_vue_type_script_setup_true_lang-oGNs8e8f.js +0 -1807
  74. package/dist/PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js +0 -41
  75. package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js +0 -7931
  76. package/dist/Publish-Dkjnls7p.js +0 -1337
  77. package/dist/Setting-gYZoZxQG.js +0 -179
  78. package/dist/TakeawayList.vue_vue_type_script_setup_true_lang-igS-FXq5.js +0 -554
@@ -1,6 +1,6 @@
1
1
  import { useI18n as y } from "@feedmepos/mf-common";
2
2
  import { useSnackbar as k, SnackbarPosition as m } from "@feedmepos/ui-library";
3
- import { b as w } from "./provide-Bwf3KcOV.js";
3
+ import { b as w } from "./provide-BGLSDsuJ.js";
4
4
  function h() {
5
5
  const t = k(), { t: l } = y(), i = w();
6
6
  function g(s, e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-menu-portal",
3
- "version": "1.0.4",
3
+ "version": "1.0.5-dev.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,374 +0,0 @@
1
- import { defineComponent as P, computed as h, h as s, resolveComponent as b, openBlock as r, createBlock as v, ref as q, shallowRef as te, withModifiers as U, onUnmounted as oe, unref as l, withCtx as y, createElementBlock as C, toDisplayString as G, createVNode as g, Fragment as I, createElementVNode as V, withDirectives as K, createCommentVNode as A, renderList as le } from "vue";
2
- import { useRouter as se } from "vue-router";
3
- import { useI18n as W } from "@feedmepos/mf-common";
4
- import { components as E, useDialog as ne, FmButtonVariant as $ } from "@feedmepos/ui-library";
5
- import { _ as re } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
6
- import { R as B, _ as ue } from "./app-C_XNYz8_.js";
7
- import { _ as ce } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
8
- import { _ as ie } from "./CatalogEditor.vue_vue_type_script_setup_true_lang-BpBR-N_x.js";
9
- import { b as H, u as de, a as me } from "./provide-Bwf3KcOV.js";
10
- import { u as pe } from "./useActionFeedback-CXx7dOVc.js";
11
- const ge = /* @__PURE__ */ P({
12
- __name: "CatalogUsage",
13
- props: {
14
- catalog: {}
15
- },
16
- setup(x) {
17
- const n = x, { t: u } = W(), m = H(), S = h(
18
- () => n.catalog.restaurants.length ? n.catalog.restaurants : [{ id: "", name: u("menu.catalog.empty_value"), methods: [] }]
19
- ), k = h(() => [...S.value]), L = h(() => [
20
- {
21
- accessorKey: "name",
22
- enableSorting: !1,
23
- meta: { headerClass: "px-16 py-4" },
24
- header: () => s("div", { class: "flex flex-col" }, [
25
- s(
26
- "p",
27
- n.catalog.nameMessage ? m(n.catalog.nameMessage) : n.catalog.name
28
- ),
29
- s(
30
- "p",
31
- { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" },
32
- u("menu.catalog.usage.tax_label", {
33
- mode: m(n.catalog.taxMode)
34
- })
35
- )
36
- ]),
37
- cell: (i) => s("div", { class: "space-y-4" }, [
38
- s("p", i.row.original.name),
39
- s(
40
- "p",
41
- { class: "text-fm-color-typo-secondary" },
42
- i.row.original.id
43
- )
44
- ])
45
- },
46
- {
47
- id: "usage",
48
- enableSorting: !1,
49
- meta: { headerClass: "px-16 py-4" },
50
- header: () => s("div", { class: "w-full flex justify-between" }, [
51
- s("p", u("menu.catalog.usage.usage")),
52
- s(
53
- E.FmChip,
54
- {
55
- class: "px-8 py-4 text-fm-color-typo-info bg-fm-color-system-info-100"
56
- },
57
- () => u("menu.catalog.usage.products", {
58
- count: n.catalog.totalProducts
59
- })
60
- )
61
- ]),
62
- cell: (i) => s(
63
- "p",
64
- { class: "flex py-8" },
65
- i.row.original.methods.map(m).join(u("menu.catalog.list_separator")) || u("menu.catalog.empty_value")
66
- )
67
- }
68
- ]);
69
- return (i, f) => {
70
- const t = b("FmTable");
71
- return r(), v(t, {
72
- "column-defs": L.value,
73
- "row-data": k.value,
74
- "page-size": S.value.length,
75
- virtual: !0,
76
- "hide-footer": !0,
77
- "shrink-at": !1
78
- }, null, 8, ["column-defs", "row-data", "page-size"]);
79
- };
80
- }
81
- }), ve = {
82
- key: 0,
83
- class: "ml-auto flex gap-8"
84
- }, fe = {
85
- key: 0,
86
- role: "status"
87
- }, _e = { class: "flex justify-end items-center" }, ye = { class: "w-[320px]" }, be = { class: "fm-typo-en-title-md-600" }, he = {
88
- key: 0,
89
- class: "space-y-24"
90
- }, ke = /* @__PURE__ */ P({
91
- __name: "CatalogList",
92
- props: {
93
- sdk: {}
94
- },
95
- setup(x) {
96
- const n = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), S = {
97
- mounted: (e, a) => {
98
- u.set(e, a.value);
99
- const c = new MutationObserver(
100
- () => k(e, u.get(e) ?? a.value)
101
- );
102
- c.observe(e, {
103
- attributes: !0,
104
- attributeFilter: ["aria-label"]
105
- }), n.set(e, c), k(e, a.value);
106
- },
107
- updated: (e, a) => {
108
- u.set(e, a.value), k(e, a.value);
109
- },
110
- beforeUnmount: (e) => {
111
- var a;
112
- return (a = n.get(e)) == null ? void 0 : a.disconnect();
113
- }
114
- };
115
- function k(e, a) {
116
- (() => {
117
- var d;
118
- e.removeAttribute("aria-label"), (d = e.querySelector("input")) == null || d.setAttribute("aria-label", a);
119
- })();
120
- }
121
- const L = {
122
- mounted: (e) => {
123
- const a = new MutationObserver(
124
- () => i(e)
125
- );
126
- a.observe(e, { childList: !0, subtree: !0 }), m.set(e, a), i(e);
127
- },
128
- updated: (e) => i(e),
129
- beforeUnmount: (e) => {
130
- var a;
131
- return (a = m.get(e)) == null ? void 0 : a.disconnect();
132
- }
133
- };
134
- function i(e) {
135
- e.querySelectorAll(".virtual-list > div").forEach((a) => {
136
- a.setAttribute("role", "row");
137
- });
138
- }
139
- const f = x, { t } = W(), T = H(), R = se(), J = ne(), { run: D } = pe(), _ = de(f.sdk.catalog.list), o = h(
140
- () => _.value.status === "ready" ? _.value.value : null
141
- ), Q = h(() => {
142
- var e;
143
- return [...((e = o.value) == null ? void 0 : e.rows) ?? []];
144
- }), F = q(!1), z = q(0), w = te(null);
145
- function N() {
146
- var e;
147
- (e = w.value) == null || e.dispose(), w.value = null;
148
- }
149
- function O(e) {
150
- N(), z.value++, w.value = f.sdk.catalog.editor(e);
151
- }
152
- async function j(e) {
153
- const a = await D(async () => f.sdk.catalog.open(e.id), {
154
- showLoading: !1
155
- });
156
- a.kind === "success" && await R.push({
157
- name: B.EDIT_CATALOG_PRODUCT,
158
- params: { id: a.value.id }
159
- });
160
- }
161
- async function X(e) {
162
- const a = await D(
163
- async () => f.sdk.catalog.prepareRemove(e.id),
164
- { showLoading: !1 }
165
- );
166
- a.kind === "success" && J.open({
167
- title: t("menu.catalog.dialogs.remove.title"),
168
- message: t("menu.catalog.dialogs.remove.message", {
169
- name: a.value.name
170
- }),
171
- primaryActions: {
172
- text: t("menu.common.actions.remove"),
173
- close: !0,
174
- variant: $.Destructive
175
- },
176
- secondaryActions: {
177
- text: t("menu.common.actions.cancel"),
178
- close: !0
179
- }
180
- }).onPrimary(async () => {
181
- (await D(() => f.sdk.catalog.remove(e.id), {
182
- showLoading: () => {
183
- var d;
184
- return ((d = o.value) == null ? void 0 : d.busy) === !0;
185
- },
186
- successMessage: (d) => t("menu.catalog.removed", { name: d.name })
187
- })).kind === "success" && await R.push({ name: B.CATALOG });
188
- });
189
- }
190
- const Y = h(() => [
191
- {
192
- accessorKey: "name",
193
- header: () => t("menu.catalog.table.columns.title"),
194
- cell: (e) => s(
195
- "a",
196
- {
197
- href: R.resolve({
198
- name: B.EDIT_CATALOG_PRODUCT,
199
- params: { id: e.row.original.id }
200
- }).href,
201
- class: "text-inherit no-underline",
202
- onClick: U(
203
- () => j(e.row.original),
204
- ["prevent", "stop"]
205
- )
206
- },
207
- e.row.original.name
208
- ),
209
- enableSorting: !1
210
- },
211
- {
212
- id: "taxMode",
213
- header: () => t("menu.catalog.table.columns.tax_calculation"),
214
- cell: (e) => T(e.row.original.taxMode),
215
- enableSorting: !1
216
- },
217
- {
218
- id: "autoLink",
219
- header: () => t("menu.catalog.table.columns.auto_link"),
220
- cell: (e) => T(e.row.original.autoLink),
221
- enableSorting: !1
222
- },
223
- {
224
- id: "actions",
225
- header: "",
226
- size: 52,
227
- meta: { cellClass: "pl-16", headerContentClass: "-mx-16" },
228
- cell: (e) => {
229
- var a, c;
230
- return s("div", { class: "flex justify-end" }, [
231
- s(E.FmButton, {
232
- icon: "file_copy",
233
- variant: $.Tertiary,
234
- textColor: "neutral-gray-400",
235
- disabled: (a = o.value) == null ? void 0 : a.busy,
236
- "aria-label": t("menu.catalog.actions.duplicate"),
237
- onClick: U(
238
- () => O(e.row.original.id),
239
- ["stop", "prevent"]
240
- )
241
- }),
242
- s(E.FmButton, {
243
- icon: "delete",
244
- variant: $.Tertiary,
245
- textColor: "neutral-gray-400",
246
- disabled: (c = o.value) == null ? void 0 : c.busy,
247
- "aria-label": t("menu.catalog.dialogs.remove.title"),
248
- onClick: U(
249
- () => X(e.row.original),
250
- ["stop", "prevent"]
251
- )
252
- })
253
- ]);
254
- }
255
- }
256
- ]);
257
- return oe(N), (e, a) => {
258
- const c = b("FmButton"), d = b("FmLinearProgress"), Z = b("FmSearch"), ee = b("FmTable"), ae = b("FmSideSheet");
259
- return r(), v(re, {
260
- heading: l(t)("menu.catalog.title")
261
- }, {
262
- "append-heading": y(() => [
263
- o.value && o.value.totalCount > 0 ? (r(), C("div", ve, [
264
- g(c, {
265
- label: l(t)("menu.catalog.actions.view_usage"),
266
- variant: "secondary",
267
- onClick: a[0] || (a[0] = (M) => F.value = !0)
268
- }, null, 8, ["label"]),
269
- g(c, {
270
- label: l(t)("menu.catalog.actions.add"),
271
- "prepend-icon": "add",
272
- disabled: o.value ? o.value.create.state !== "allowed" : !1,
273
- onClick: a[1] || (a[1] = (M) => O())
274
- }, null, 8, ["label", "disabled"])
275
- ])) : A("", !0)
276
- ]),
277
- default: y(() => {
278
- var M;
279
- return [
280
- l(_).status === "unavailable" ? (r(), C("p", fe, G(l(T)(l(_).reason)), 1)) : !o.value && l(_).status !== "error" ? (r(), v(d, { key: 1 })) : l(_).status === "error" || ((M = o.value) == null ? void 0 : M.totalCount) === 0 ? (r(), v(l(ce), {
281
- key: 2,
282
- title: l(t)("menu.catalog.empty.title"),
283
- subtitle: l(t)("menu.catalog.empty.subtitle")
284
- }, {
285
- action: y(() => [
286
- g(c, {
287
- label: l(t)("menu.catalog.actions.add"),
288
- "prepend-icon": "add",
289
- disabled: o.value ? o.value.create.state !== "allowed" : !1,
290
- onClick: a[2] || (a[2] = (p) => O())
291
- }, null, 8, ["label", "disabled"])
292
- ]),
293
- _: 1
294
- }, 8, ["title", "subtitle"])) : o.value ? (r(), C(I, { key: 3 }, [
295
- V("div", _e, [
296
- V("div", ye, [
297
- K(g(Z, {
298
- autofocus: "",
299
- class: "mb-8",
300
- "model-value": o.value.query,
301
- placeholder: l(t)("menu.common.labels.search_placeholder", {
302
- type: l(t)("menu.catalog.title")
303
- }),
304
- "onUpdate:modelValue": e.sdk.catalog.search
305
- }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]), [
306
- [
307
- S,
308
- l(t)("menu.common.labels.search_placeholder", {
309
- type: l(t)("menu.catalog.title")
310
- })
311
- ]
312
- ])
313
- ])
314
- ]),
315
- g(ue, null, {
316
- default: y(() => [
317
- K(g(ee, {
318
- "column-defs": Y.value,
319
- "row-data": Q.value,
320
- "page-size": o.value.rows.length,
321
- "hide-footer": !0,
322
- "shrink-at": !1,
323
- virtual: !0,
324
- "search-value": o.value.query,
325
- onRowClick: a[3] || (a[3] = (p) => j(p.original))
326
- }, null, 8, ["column-defs", "row-data", "page-size", "search-value"]), [
327
- [L]
328
- ])
329
- ]),
330
- _: 1
331
- })
332
- ], 64)) : A("", !0),
333
- g(ae, {
334
- modelValue: F.value,
335
- "onUpdate:modelValue": a[4] || (a[4] = (p) => F.value = p),
336
- "max-width": 1e3,
337
- "dismiss-away": ""
338
- }, {
339
- "side-sheet-header": y(() => [
340
- V("p", be, G(l(t)("menu.catalog.usage.title")), 1)
341
- ]),
342
- default: y(() => [
343
- F.value && o.value ? (r(), C("div", he, [
344
- (r(!0), C(I, null, le(o.value.usage, (p) => (r(), v(ge, {
345
- key: p.id,
346
- catalog: p
347
- }, null, 8, ["catalog"]))), 128))
348
- ])) : A("", !0)
349
- ]),
350
- _: 1
351
- }, 8, ["modelValue"]),
352
- w.value ? (r(), v(ie, {
353
- key: z.value,
354
- sdk: e.sdk,
355
- editor: w.value,
356
- picker: e.sdk.linkProduct.catalogue,
357
- onClose: N
358
- }, null, 8, ["sdk", "editor", "picker"])) : A("", !0)
359
- ];
360
- }),
361
- _: 1
362
- }, 8, ["heading"]);
363
- };
364
- }
365
- }), De = /* @__PURE__ */ P({
366
- __name: "Catalog",
367
- setup(x) {
368
- const n = me();
369
- return (u, m) => (r(), v(ke, { sdk: l(n) }, null, 8, ["sdk"]));
370
- }
371
- });
372
- export {
373
- De as default
374
- };
@@ -1,117 +0,0 @@
1
- import { defineComponent as N, shallowRef as m, computed as M, ref as A, watch as E, onUnmounted as U, resolveComponent as z, openBlock as f, createElementBlock as O, Fragment as $, createElementVNode as j, normalizeClass as g, createBlock as R, unref as b, createCommentVNode as q, createVNode as x } from "vue";
2
- import { useI18n as D } from "@feedmepos/mf-common";
3
- import { _ as G } from "./LinkProductSideSheet.vue_vue_type_script_setup_true_lang-C0rc1FRO.js";
4
- import { u as H } from "./useActionFeedback-CXx7dOVc.js";
5
- import { b as J, u as K } from "./provide-Bwf3KcOV.js";
6
- const Z = /* @__PURE__ */ N({
7
- __name: "CatalogLinkProductAction",
8
- props: {
9
- sdk: {},
10
- presentation: {}
11
- },
12
- setup(B) {
13
- const a = B, { t: k } = D(), y = J(), { run: S } = H(), w = K(a.sdk.item.list), o = m({
14
- status: "loading"
15
- });
16
- let u = null;
17
- const l = M(
18
- () => w.value.status === "ready" ? w.value.value : null
19
- ), F = M(
20
- () => o.value.status === "ready" ? o.value.value : null
21
- ), i = A(!1), r = m(null), c = m(
22
- null
23
- ), d = m({
24
- status: "loading"
25
- });
26
- let p = null;
27
- function v() {
28
- var e, t;
29
- u == null || u(), u = null, o.value = { status: "loading" }, p == null || p(), p = null, (e = r.value) == null || e.dispose(), r.value = null, (t = c.value) == null || t.dispose(), c.value = null, d.value = { status: "loading" };
30
- }
31
- function C() {
32
- var s;
33
- v();
34
- const e = a.presentation === "tree" ? a.sdk.linkProduct.documentCatalogue : a.sdk.linkProduct.catalogue;
35
- o.value = e.get(), u = e.subscribe((n) => {
36
- o.value = n;
37
- }), c.value = a.sdk.linkProduct.selection(
38
- ((s = l.value) == null ? void 0 : s.availableItemIds) ?? [],
39
- (n) => a.sdk.item.linkProducts(n)
40
- );
41
- const t = a.sdk.linkProduct.rules();
42
- r.value = t, d.value = t.get(), p = t.subscribe((n) => {
43
- d.value = n;
44
- }), i.value = !0;
45
- }
46
- function P() {
47
- i.value = !1, v();
48
- }
49
- E(i, (e) => {
50
- e || v();
51
- }), U(v);
52
- async function I(e) {
53
- (await S(
54
- () => {
55
- var s;
56
- return ((s = c.value) == null ? void 0 : s.submit()) ?? Promise.resolve({ kind: "cancelled" });
57
- },
58
- {
59
- successMessage: l.value ? y(l.value.linkSaveMessage) : ""
60
- }
61
- )).kind === "success" && P();
62
- }
63
- async function L() {
64
- const e = r.value;
65
- if (!e) return;
66
- (await S(() => e.submit(), {
67
- successMessage: l.value ? y(l.value.linkSaveMessage) : ""
68
- })).kind === "success" && P();
69
- }
70
- return (e, t) => {
71
- var n, h, V;
72
- const s = z("FmButton");
73
- return f(), O($, null, [
74
- j("div", {
75
- class: g(e.presentation === "tree" ? void 0 : "ml-auto")
76
- }, [
77
- ((n = l.value) == null ? void 0 : n.link.state) === "allowed" ? (f(), R(s, {
78
- key: 0,
79
- label: b(k)("menu.products.actions.link"),
80
- "prepend-icon": "link",
81
- class: g(
82
- e.presentation === "tree" ? "!h-32 shrink-0 !gap-4 !px-8 !py-4" : void 0
83
- ),
84
- "text-color": e.presentation === "tree" ? "primary" : void 0,
85
- variant: e.presentation === "tree" ? "plain" : void 0,
86
- onClick: C
87
- }, null, 8, ["label", "class", "text-color", "variant"])) : ((h = l.value) == null ? void 0 : h.applyScheduler.state) === "allowed" ? (f(), R(s, {
88
- key: 1,
89
- label: b(k)("menu.products.actions.apply_scheduler"),
90
- "prepend-icon": e.presentation === "tree" ? "link" : void 0,
91
- class: g(
92
- e.presentation === "tree" ? "!h-32 shrink-0 !gap-4 !px-8 !py-4" : void 0
93
- ),
94
- "text-color": e.presentation === "tree" ? "primary" : void 0,
95
- variant: e.presentation === "tree" ? "plain" : void 0,
96
- onClick: C
97
- }, null, 8, ["label", "prepend-icon", "class", "text-color", "variant"])) : q("", !0)
98
- ], 2),
99
- x(G, {
100
- modelValue: i.value,
101
- "onUpdate:modelValue": t[0] || (t[0] = (_) => i.value = _),
102
- catalogue: F.value,
103
- "selected-product-ids": ((V = l.value) == null ? void 0 : V.availableItemIds) ?? [],
104
- "rules-session": r.value,
105
- "selection-session": c.value,
106
- "rules-view": d.value.status === "ready" ? d.value.value : null,
107
- title: b(k)("menu.link_product.title"),
108
- onSubmit: I,
109
- onSubmitRules: L
110
- }, null, 8, ["modelValue", "catalogue", "selected-product-ids", "rules-session", "selection-session", "rules-view", "title"])
111
- ], 64);
112
- };
113
- }
114
- });
115
- export {
116
- Z as _
117
- };