@feedmepos/mf-menu-portal 1.0.4-dev.3 → 1.0.4-dev.4

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 (80) hide show
  1. package/dist/{App-nS46pByh.js → App-CrpoLCjA.js} +3 -3
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C9OSr8ft.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js} +1 -1
  3. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-DnvN5R5w.js → BindingTable.vue_vue_type_script_setup_true_lang-D3CmOOPY.js} +1 -1
  4. package/dist/{Catalog-B4RS8T29.js → Catalog-VU3HhNro.js} +4 -4
  5. package/dist/{CatalogBinding-6_783kbu.js → CatalogBinding-BNATtZEY.js} +3 -3
  6. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-BawCLY5-.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BmG-xpW4.js} +3 -3
  7. package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-BjP8ZXyb.js → CatalogEditor.vue_vue_type_script_setup_true_lang-BFsRDFpj.js} +7 -7
  8. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Diapahfp.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Bk4FqVmx.js} +14 -14
  9. package/dist/{Category-CqneIGq4.js → Category-DMoXTsfG.js} +5 -5
  10. package/dist/{Category-DNQH1CI7.js → Category-DxjdQ-NN.js} +2 -2
  11. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-B3Ts1O-9.js +847 -0
  12. package/dist/{CookingGuide-DTAiFmEL.js → CookingGuide-DiZZDYD-.js} +5 -5
  13. package/dist/{Group-DeUqUomY.js → Group-DFR8q-tt.js} +5 -5
  14. package/dist/{Group-5xO2j3CL.js → Group-rzfh_o6r.js} +2 -2
  15. package/dist/GroupList.vue_vue_type_script_setup_true_lang-DiN-wQXX.js +1807 -0
  16. package/dist/Ingredient-DpjGIuH9.js +505 -0
  17. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CnI80Ojd.js +782 -0
  18. package/dist/{MenuSetting-DdekHsQy.js → MenuSetting-DR-pDSF_.js} +4 -4
  19. package/dist/OrderPacing-JcTuweqF.js +769 -0
  20. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-C3SqQPSr.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-HwwJ2mGv.js} +2 -2
  21. package/dist/{Preview-DGTw0POk.js → Preview-BZyun5lZ.js} +1 -1
  22. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-DffhFv0Y.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-DquqNbE1.js} +1 -1
  23. package/dist/PrintRoute-CzEx2dCt.js +518 -0
  24. package/dist/{Product-CsbcyIgD.js → Product-CQb0n06E.js} +4 -4
  25. package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js +7931 -0
  26. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang--rBKdKV7.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-CBlDEjqF.js} +9 -9
  27. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-D8NQTCLx.js +2011 -0
  28. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-DtCzHjpN.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-cG47Pu-6.js} +1 -1
  29. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-aDx01-WW.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-0UwUcA2L.js} +630 -587
  30. package/dist/{ProductInternalTools-Ccd4dAmx.js → ProductInternalTools-QrBR1nFp.js} +2 -2
  31. package/dist/{ProductInventoryDialog-DYcKdKHi.js → ProductInventoryDialog-fV38GO1a.js} +1 -1
  32. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-DySFcCJz.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-Bzb3RrMg.js} +1 -1
  33. package/dist/ProductList.vue_vue_type_script_setup_true_lang-BwKQESr3.js +2765 -0
  34. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Dw2xiPYX.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-CDYcHXo1.js} +1 -1
  35. package/dist/{Products-phZwCZhU.js → Products-B8tysOAL.js} +3 -3
  36. package/dist/Publish-DTvOvFNa.js +1337 -0
  37. package/dist/Recipe-Ddx31csF.js +388 -0
  38. package/dist/{Scheduler-C-A5m92O.js → Scheduler-CST5L_cw.js} +314 -254
  39. package/dist/ServingSequence-DYyEZI2S.js +374 -0
  40. package/dist/{Setting-C24V-lps.js → Setting-Ip0pGjks.js} +6 -6
  41. package/dist/Subcategory-BIgjzVta.js +459 -0
  42. package/dist/{Takeaway-DywX5BiX.js → Takeaway-CekhGM-m.js} +2 -2
  43. package/dist/{Takeaway-BFP2ohJn.js → Takeaway-aXsPg4JT.js} +5 -5
  44. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-B3QS7o1v.js → TakeawayList.vue_vue_type_script_setup_true_lang-CaRR4_j3.js} +4 -4
  45. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CshqYpc9.js +1291 -0
  46. package/dist/Unit-BMW8u0Us.js +424 -0
  47. package/dist/{Variant-BBfWhH-s.js → Variant-CZsrYRMU.js} +5 -5
  48. package/dist/{_id_-BooM3FX1.js → _id_-D4swrvNa.js} +3 -3
  49. package/dist/{app-Bmgb8ACe.js → app-BWwwHsWi.js} +312 -312
  50. package/dist/app.js +1 -1
  51. package/dist/apps/mf-menu/src/app.d.ts +60 -0
  52. package/dist/apps/mf-menu/src/components/Product/BulkCategorySelect.vue.d.ts +37 -0
  53. package/dist/apps/mf-menu/src/components/Product/ProductAttributeFilter.vue.d.ts +11 -1
  54. package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +2 -2
  55. package/dist/apps/mf-menu/src/components/feature/NestedGroupManager/NestedGroupOverrideSheets.vue.d.ts +27 -0
  56. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesFilter.vue.d.ts +20 -0
  57. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  58. package/dist/assets/{menu-compute-CG-fX5pi.js → menu-compute-D7TdiHt4.js} +4 -4
  59. package/dist/assets/{validate-menu-BeGMWVns.js → validate-menu-DXppWUVq.js} +2 -2
  60. package/dist/mf-menu-portal.css +1 -1
  61. package/dist/{provide-CfF0FmUz.js → provide-CDmXzkhz.js} +67990 -66891
  62. package/dist/{useActionFeedback-DyUCQl2x.js → useActionFeedback-Dm2HDa_2.js} +1 -1
  63. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js → vuedraggable-CBtQLb_S.js} +140 -139
  64. package/package.json +2 -2
  65. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-Bt_onPrP.js +0 -797
  66. package/dist/GroupList.vue_vue_type_script_setup_true_lang-Dgya_JLB.js +0 -2183
  67. package/dist/Ingredient-BlDW3TfZ.js +0 -463
  68. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-0tCpJlOf.js +0 -709
  69. package/dist/OrderPacing-Bb2n5wmI.js +0 -698
  70. package/dist/PrintRoute-CJB4gIP2.js +0 -473
  71. package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D8DygCBl.js +0 -110
  72. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-J6LpJ5wT.js +0 -1257
  73. package/dist/ProductList.vue_vue_type_script_setup_true_lang-DTLslTpK.js +0 -10353
  74. package/dist/Publish-BeKIXu3z.js +0 -1261
  75. package/dist/Recipe-Fo4tBkBv.js +0 -350
  76. package/dist/ServingSequence-BrCwLSO7.js +0 -336
  77. package/dist/Subcategory-B0oZIKbw.js +0 -412
  78. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D7mhnrXx.js +0 -1213
  79. package/dist/Unit-NhEwH-kr.js +0 -385
  80. package/dist/apps/mf-menu/src/views/MenuManagementEditor/RestaurantAttributesFilter.vue.d.ts +0 -2
@@ -0,0 +1,505 @@
1
+ import { defineComponent as ue, computed as f, ref as E, shallowRef as ne, h as $e, withModifiers as le, onUnmounted as Ae, resolveComponent as m, openBlock as i, createBlock as C, unref as e, withCtx as y, createElementBlock as r, toDisplayString as _, Fragment as I, createElementVNode as v, createVNode as d, renderList as T, createCommentVNode as M, mergeProps as ae, createTextVNode as Ne } from "vue";
2
+ import { useRouter as De } from "vue-router";
3
+ import { useI18n as Le } from "@feedmepos/mf-common";
4
+ import { useDialog as ze, useBreakpoints as Ee, components as oe, FmButtonVariant as Te } from "@feedmepos/ui-library";
5
+ import { _ as se } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
6
+ import { _ as Re } from "./BindingLinkDialog.vue_vue_type_script_setup_true_lang-BZVQRyRI.js";
7
+ import { _ as ie } from "./BindingTable.vue_vue_type_script_setup_true_lang-D3CmOOPY.js";
8
+ import { _ as qe } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
9
+ import { u as Pe } from "./useActionFeedback-Dm2HDa_2.js";
10
+ import { u as Ke } from "./useEditorValidation-Ctef5Bxt.js";
11
+ import { b as Oe, u as Qe, a as je } from "./provide-CDmXzkhz.js";
12
+ const Ge = {
13
+ key: 0,
14
+ class: "flex-1 flex justify-between gap-8 pl-8"
15
+ }, He = { class: "flex items-center" }, Je = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, We = { class: "fm-typo-en-body-md-600" }, Xe = {
16
+ key: 0,
17
+ role: "alert",
18
+ class: "text-fm-color-typo-secondary"
19
+ }, Ye = {
20
+ key: 1,
21
+ class: "text-fm-color-typo-secondary"
22
+ }, Ze = { class: "flex justify-end items-center" }, et = { class: "w-[320px] xs:w-full xs:px-16 xs:mt-8" }, tt = {
23
+ key: 1,
24
+ class: "flex-1 min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
25
+ }, nt = ["onClick"], lt = { class: "min-w-0 flex-1" }, at = { class: "fm-typo-en-body-lg-600 mb-4 break-words" }, ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary break-words" }, st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary break-words" }, it = {
26
+ key: 2,
27
+ class: "fixed right-16 bottom-[72px] z-[100]"
28
+ }, ut = { class: "fm-typo-en-title-md-600" }, dt = {
29
+ key: 0,
30
+ class: "pt-8 flex flex-col gap-8"
31
+ }, mt = {
32
+ key: 1,
33
+ class: "pt-8 space-y-40"
34
+ }, rt = { class: "flex flex-row gap-16" }, ct = { class: "overflow-x-hidden overflow-y-auto max-h-[300px]" }, vt = {
35
+ key: 0,
36
+ class: "fm-typo-en-body-sm-400 text-fm-color-system-error-500",
37
+ role: "alert"
38
+ }, pt = { class: "flex gap-8 items-center justify-start" }, bt = /* @__PURE__ */ ue({
39
+ __name: "IngredientList",
40
+ props: {
41
+ sdk: {}
42
+ },
43
+ setup(R) {
44
+ const F = R, { t } = Le(), w = Oe(), q = ze(), de = De(), { run: P } = Pe(), x = Qe(F.sdk.sku.list), c = f(
45
+ () => x.value.status === "ready" ? x.value.value : null
46
+ ), me = f(() => {
47
+ var n;
48
+ return ((n = c.value) == null ? void 0 : n.query) ?? "";
49
+ }), { breakpoints: re } = Ee(), A = f(() => re.value.xs), ce = f(() => {
50
+ var n;
51
+ return [...((n = c.value) == null ? void 0 : n.rows) ?? []];
52
+ }), g = E(!1), N = E(!1), V = E("recipe"), s = ne(F.sdk.sku.editor()), S = ne(
53
+ s.value.get()
54
+ );
55
+ let D = s.value.subscribe(
56
+ (n) => {
57
+ S.value = n;
58
+ }
59
+ );
60
+ const a = f(
61
+ () => S.value.status === "ready" ? S.value.value : null
62
+ ), p = Ke(() => s.value), K = f(
63
+ () => a.value ? p.issue(a.value.fieldIssues, "name") ?? a.value.nameIssue : null
64
+ ), O = f(
65
+ () => a.value ? p.issue(a.value.fieldIssues, "code") ?? a.value.codeIssue : null
66
+ ), Q = f(
67
+ () => a.value ? p.issue(a.value.fieldIssues, "convert") ?? a.value.formIssue : null
68
+ );
69
+ function j(n) {
70
+ var k;
71
+ const l = ((k = a.value) == null ? void 0 : k.fieldIssues) ?? {};
72
+ return (n ?? []).map((U) => ({
73
+ ...U,
74
+ amountIssue: p.issue(l, `amount:${U.id}`) ?? U.amountIssue
75
+ }));
76
+ }
77
+ function G(n, l) {
78
+ p.field(
79
+ `amount:${n}`,
80
+ (k) => s.value.setBindingAmount(n, k)
81
+ )["onUpdate:modelValue"](l);
82
+ }
83
+ function H(n) {
84
+ D(), s.value.dispose(), s.value = F.sdk.sku.editor(n), S.value = s.value.get(), D = s.value.subscribe(
85
+ (l) => {
86
+ S.value = l;
87
+ }
88
+ );
89
+ }
90
+ function L() {
91
+ var n;
92
+ ((n = c.value) == null ? void 0 : n.create.state) === "allowed" && (H(), g.value = !0);
93
+ }
94
+ function J(n) {
95
+ H(n.id), g.value = !0;
96
+ }
97
+ async function ve() {
98
+ (await P(
99
+ () => p.submit(() => s.value.submit()),
100
+ {
101
+ // A locally-decided rejection issues no request and legacy showed no
102
+ // spinner for it — the frozen `sku/create/validation-required` and
103
+ // `sku/create/duplicate-code` groups record an inline message and no
104
+ // snackbar at all.
105
+ showLoading: () => {
106
+ var l;
107
+ return ((l = a.value) == null ? void 0 : l.status) === "submitting";
108
+ },
109
+ successMessage: (l) => t("menu.sku.form.saved", { name: l.name })
110
+ }
111
+ )).kind === "success" && (g.value = !1);
112
+ }
113
+ function pe() {
114
+ var n;
115
+ if (!((n = a.value) != null && n.dirty)) {
116
+ g.value = !1;
117
+ return;
118
+ }
119
+ q.open({
120
+ title: t("menu.common.dialog.dismiss.title"),
121
+ message: t("menu.common.dialog.dismiss.message"),
122
+ primaryActions: {
123
+ text: t("menu.common.dialog.dismiss.discard"),
124
+ close: !0
125
+ },
126
+ secondaryActions: {
127
+ text: t("menu.common.actions.cancel"),
128
+ close: !0
129
+ }
130
+ }).onPrimary(() => {
131
+ g.value = !1;
132
+ });
133
+ }
134
+ function W(n) {
135
+ n.remove.state === "allowed" && q.open({
136
+ title: t("menu.common.dialog.remove.ingredient.title"),
137
+ message: t("menu.common.dialog.remove.ingredient.message", {
138
+ name: n.name
139
+ }),
140
+ primaryActions: {
141
+ text: t("menu.common.actions.remove"),
142
+ close: !0,
143
+ variant: Te.Destructive
144
+ },
145
+ secondaryActions: {
146
+ text: t("menu.common.actions.cancel"),
147
+ close: !0
148
+ }
149
+ }).onPrimary(async () => {
150
+ await P(() => F.sdk.sku.remove(n.id), {
151
+ successMessage: t("menu.sku.form.removed", { name: n.name })
152
+ });
153
+ });
154
+ }
155
+ const be = f(() => [
156
+ {
157
+ accessorKey: "code",
158
+ header: () => t("menu.ingredient.table.columns.code"),
159
+ enableSorting: !1
160
+ },
161
+ {
162
+ accessorKey: "name",
163
+ header: () => t("menu.ingredient.table.columns.name"),
164
+ enableSorting: !1
165
+ },
166
+ {
167
+ accessorKey: "unitName",
168
+ header: () => t("menu.ingredient.table.columns.unit"),
169
+ enableSorting: !1,
170
+ // The parenthesised pair is assembled by the i18n layer, never by a
171
+ // template expression (ADR-0003 §3).
172
+ cell: (n) => t("menu.sku.unit_option", {
173
+ name: n.row.original.unitName,
174
+ symbol: n.row.original.unitSymbol
175
+ })
176
+ },
177
+ {
178
+ id: "actions",
179
+ size: 52,
180
+ meta: { cellClass: "pl-16", headerContentClass: "-mx-16" },
181
+ header: "",
182
+ cell: (n) => $e(oe.FmButton, {
183
+ icon: "delete",
184
+ variant: "tertiary",
185
+ textColor: "neutral-gray-400",
186
+ disabled: n.row.original.remove.state !== "allowed",
187
+ "aria-label": t("menu.common.actions.delete"),
188
+ onClick: le(
189
+ () => W(n.row.original),
190
+ ["stop", "prevent"]
191
+ )
192
+ })
193
+ }
194
+ ]), X = f(() => {
195
+ var n;
196
+ return ((n = a.value) == null ? void 0 : n.submit.state) !== "allowed";
197
+ }), fe = f(
198
+ () => {
199
+ var n, l;
200
+ return V.value === "recipe" ? ((n = a.value) == null ? void 0 : n.recipeCandidates) ?? [] : ((l = a.value) == null ? void 0 : l.ingredientCandidates) ?? [];
201
+ }
202
+ ), ye = f(
203
+ () => t("menu.inventory.binding.link.title", {
204
+ type: V.value === "recipe" ? t("menu.inventory.binding.link.recipe") : t("menu.inventory.binding.link.ingredient")
205
+ })
206
+ );
207
+ function ke() {
208
+ g.value = !1, de.push("/unit");
209
+ }
210
+ function Y(n) {
211
+ V.value = n, s.value.setBindingCandidateQuery(""), N.value = !0;
212
+ }
213
+ return Ae(() => {
214
+ D(), s.value.dispose();
215
+ }), (n, l) => {
216
+ const k = m("FmButton"), U = m("FmCircularProgress"), ge = m("FmSearch"), _e = m("FmTable"), Z = m("FmTextField"), xe = m("FmLabel"), Fe = m("FmField"), he = m("FmMenuHeader"), Ce = m("FmMenuDivider"), we = m("FmMenuItem"), Ie = m("FmMenu"), Me = m("FmFormGroup"), Se = m("FmSwitch"), Ue = m("FmSelect"), Be = m("FmCard"), Ve = m("FmSideSheet");
217
+ return i(), C(qe, {
218
+ "data-visual-root": "sku",
219
+ heading: e(t)("menu.ingredient.title")
220
+ }, {
221
+ "append-heading": y(() => [
222
+ e(x).status === "ready" && c.value ? (i(), r("div", Ge, [
223
+ v("div", He, [
224
+ v("div", Je, [
225
+ v("p", We, _(c.value.totalCount), 1)
226
+ ])
227
+ ]),
228
+ c.value.totalCount > 0 && !A.value ? (i(), C(k, {
229
+ key: 0,
230
+ disabled: c.value.create.state !== "allowed",
231
+ label: e(t)("menu.ingredient.actions.add"),
232
+ "prepend-icon": "add",
233
+ onClick: L
234
+ }, null, 8, ["disabled", "label"])) : M("", !0)
235
+ ])) : M("", !0)
236
+ ]),
237
+ default: y(() => {
238
+ var ee;
239
+ return [
240
+ e(x).status === "error" ? (i(), r("p", Xe, _(e(w)(e(x).error.message)), 1)) : e(x).status === "unavailable" ? (i(), r("p", Ye, _(e(w)(e(x).reason)), 1)) : e(x).status === "loading" ? (i(), C(U, { key: 2 })) : c.value && c.value.totalCount === 0 ? (i(), C(e(se), {
241
+ key: 3,
242
+ action: {
243
+ text: e(t)("menu.ingredient.empty.action"),
244
+ callback: L
245
+ },
246
+ title: e(t)("menu.ingredient.empty.title"),
247
+ subtitle: e(t)("menu.ingredient.empty.subtitle")
248
+ }, null, 8, ["action", "title", "subtitle"])) : c.value ? (i(), r(I, { key: 4 }, [
249
+ v("div", Ze, [
250
+ v("div", et, [
251
+ d(ge, {
252
+ autofocus: "",
253
+ class: "mb-8",
254
+ "model-value": me.value,
255
+ placeholder: e(t)("menu.ingredient.table.search.placeholder"),
256
+ "onUpdate:modelValue": F.sdk.sku.search
257
+ }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])
258
+ ])
259
+ ]),
260
+ A.value ? (i(), r("div", tt, [
261
+ (i(!0), r(I, null, T(c.value.rows, (o) => (i(), r("div", {
262
+ key: o.id,
263
+ class: "py-12 px-16 flex space-x-8 items-center",
264
+ onClick: (h) => J(o)
265
+ }, [
266
+ v("div", lt, [
267
+ v("p", at, _(o.name), 1),
268
+ v("p", ot, _(e(t)("menu.ingredient.table.mobile.code", { code: o.code })), 1),
269
+ v("p", st, _(e(t)("menu.ingredient.table.mobile.unit", {
270
+ unit: e(t)("menu.sku.unit_option", {
271
+ name: o.unitName,
272
+ symbol: o.unitSymbol
273
+ })
274
+ })), 1)
275
+ ]),
276
+ d(k, {
277
+ class: "shrink-0",
278
+ "aria-label": e(t)("menu.common.actions.delete"),
279
+ disabled: o.remove.state !== "allowed",
280
+ "prepend-icon": "delete",
281
+ "text-color": "neutral-gray-400",
282
+ variant: "tertiary",
283
+ onClick: le((h) => W(o), ["stop"])
284
+ }, null, 8, ["aria-label", "disabled", "onClick"])
285
+ ], 8, nt))), 128))
286
+ ])) : (i(), C(_e, {
287
+ key: 0,
288
+ "column-defs": be.value,
289
+ "hide-footer": "",
290
+ "page-size": Math.max(c.value.rows.length, 1),
291
+ "pin-header-row": "",
292
+ "row-data": ce.value,
293
+ "shrink-at": !1,
294
+ onRowClick: l[0] || (l[0] = (o) => J(o.original))
295
+ }, null, 8, ["column-defs", "page-size", "row-data"])),
296
+ c.value.totalCount > 0 && A.value ? (i(), r("div", it, [
297
+ d(k, {
298
+ disabled: c.value.create.state !== "allowed",
299
+ label: e(t)("menu.ingredient.actions.add"),
300
+ "prepend-icon": "add",
301
+ variant: "fab",
302
+ onClick: L
303
+ }, null, 8, ["disabled", "label"])
304
+ ])) : M("", !0)
305
+ ], 64)) : M("", !0),
306
+ d(Ve, {
307
+ modelValue: g.value,
308
+ "onUpdate:modelValue": l[10] || (l[10] = (o) => g.value = o),
309
+ "is-container": e(oe).FmForm,
310
+ "is-container-props": { onValidationSuccess: ve },
311
+ "max-width": 560,
312
+ "onOn:clickedAway": pe
313
+ }, {
314
+ "side-sheet-header": y(() => {
315
+ var o;
316
+ return [
317
+ v("p", ut, _(((o = a.value) == null ? void 0 : o.mode) === "update" ? e(t)("menu.sku.update") : e(t)("menu.sku.add")), 1)
318
+ ];
319
+ }),
320
+ "side-sheet-footer": y(() => {
321
+ var o, h;
322
+ return [
323
+ v("div", pt, [
324
+ d(k, {
325
+ disabled: ((o = a.value) == null ? void 0 : o.submit.state) !== "allowed",
326
+ label: ((h = a.value) == null ? void 0 : h.mode) === "update" ? e(t)("menu.common.actions.update") : e(t)("menu.common.actions.add"),
327
+ size: "lg",
328
+ type: "submit",
329
+ variant: "primary"
330
+ }, null, 8, ["disabled", "label"]),
331
+ d(k, {
332
+ label: e(t)("menu.common.actions.cancel"),
333
+ size: "lg",
334
+ variant: "tertiary",
335
+ onClick: l[9] || (l[9] = (z) => g.value = !1)
336
+ }, null, 8, ["label"])
337
+ ])
338
+ ];
339
+ }),
340
+ default: y(() => {
341
+ var o, h, z, te;
342
+ return [
343
+ (o = a.value) != null && o.noUnits ? (i(), r("div", dt, [
344
+ d(e(se), {
345
+ action: { text: e(t)("menu.unit.add"), callback: ke },
346
+ title: e(t)("menu.sku.empty.no_unit"),
347
+ subtitle: e(t)("menu.sku.empty.subtitle")
348
+ }, null, 8, ["action", "title", "subtitle"])
349
+ ])) : (i(), r("div", mt, [
350
+ v("div", rt, [
351
+ d(Z, ae({
352
+ class: "flex-2",
353
+ "error-messages": O.value ? [e(w)(O.value)] : [],
354
+ label: e(t)("menu.sku.columns.code"),
355
+ "model-value": ((h = a.value) == null ? void 0 : h.code) ?? ""
356
+ }, e(p).field("code", s.value.setCode)), null, 16, ["error-messages", "label", "model-value"]),
357
+ d(Z, ae({
358
+ class: "flex-1",
359
+ "error-messages": K.value ? [e(w)(K.value)] : [],
360
+ label: e(t)("menu.sku.columns.name"),
361
+ "model-value": ((z = a.value) == null ? void 0 : z.name) ?? ""
362
+ }, e(p).field("name", s.value.setName)), null, 16, ["error-messages", "label", "model-value"])
363
+ ]),
364
+ d(Me, {
365
+ class: "col-span-2",
366
+ "label-mark": "required",
367
+ "model-value": ((te = a.value) == null ? void 0 : te.selectedUnitName) ?? ""
368
+ }, {
369
+ label: y(() => [
370
+ d(xe, {
371
+ label: e(t)("menu.sku.columns.unit")
372
+ }, null, 8, ["label"])
373
+ ]),
374
+ default: y(({ invalid: $ }) => [
375
+ d(Ie, { "z-index": 101 }, {
376
+ "menu-button": y(() => [
377
+ d(Fe, {
378
+ class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary",
379
+ invalid: $,
380
+ "append-icon": "expand_more"
381
+ }, {
382
+ default: y(() => [
383
+ Ne(_(a.value ? e(t)("menu.sku.unit_option", {
384
+ name: a.value.selectedUnitName,
385
+ symbol: a.value.selectedUnitSymbol
386
+ }) : ""), 1)
387
+ ]),
388
+ _: 2
389
+ }, 1032, ["invalid"])
390
+ ]),
391
+ default: y(() => {
392
+ var B;
393
+ return [
394
+ v("div", ct, [
395
+ (i(!0), r(I, null, T(((B = a.value) == null ? void 0 : B.unitGroups) ?? [], (u) => (i(), r(I, {
396
+ key: u.unitId
397
+ }, [
398
+ d(he, {
399
+ label: u.name
400
+ }, null, 8, ["label"]),
401
+ d(Ce),
402
+ (i(!0), r(I, null, T(u.options, (b) => (i(), C(we, {
403
+ key: `${b.unitId}:${b.measurementId ?? "base"}`,
404
+ label: e(t)("menu.sku.unit_option", {
405
+ name: b.name,
406
+ symbol: b.symbol
407
+ }),
408
+ "model-value": b.selected,
409
+ "x-should-scroll-into": `${b.selected}`,
410
+ onClick: (ft) => s.value.selectUnit(
411
+ b.unitId,
412
+ b.measurementId
413
+ )
414
+ }, null, 8, ["label", "model-value", "x-should-scroll-into", "onClick"]))), 128))
415
+ ], 64))), 128))
416
+ ])
417
+ ];
418
+ }),
419
+ _: 2
420
+ }, 1024)
421
+ ]),
422
+ _: 1
423
+ }, 8, ["model-value"]),
424
+ d(Be, {
425
+ variant: "outlined",
426
+ class: "p-16 flex flex-col gap-16"
427
+ }, {
428
+ default: y(() => {
429
+ var $, B;
430
+ return [
431
+ d(Se, {
432
+ value: "",
433
+ label: e(t)("menu.sku.convertible.label"),
434
+ "model-value": (($ = a.value) == null ? void 0 : $.convertible) ?? !1,
435
+ sublabel: e(t)("menu.sku.convertible.sublabel"),
436
+ "label-placement": "right",
437
+ "onUpdate:modelValue": l[1] || (l[1] = (u) => (e(p).touch("convert"), s.value.setConvertible(u)))
438
+ }, null, 8, ["label", "model-value", "sublabel"]),
439
+ (B = a.value) != null && B.convertible ? (i(), r(I, { key: 0 }, [
440
+ d(Ue, {
441
+ items: a.value.convertOptions.map((u) => ({
442
+ label: e(t)("menu.sku.convert_option", {
443
+ name: u.name,
444
+ symbol: u.symbol
445
+ }),
446
+ value: u.measurementId
447
+ })),
448
+ label: e(t)("menu.sku.convertible.convert_to"),
449
+ "model-value": a.value.convertMeasurementId,
450
+ "onUpdate:modelValue": l[2] || (l[2] = (u) => s.value.selectConvertMeasurement(u))
451
+ }, null, 8, ["items", "label", "model-value"]),
452
+ d(ie, {
453
+ kind: "recipe",
454
+ disabled: X.value,
455
+ rows: j(a.value.recipeBindings),
456
+ onLink: l[3] || (l[3] = (u) => Y("recipe")),
457
+ onRemove: l[4] || (l[4] = (u) => (e(p).touch("convert"), s.value.removeBinding(u))),
458
+ onUpdateAmount: G,
459
+ onUpdateMeasurement: l[5] || (l[5] = (u, b) => s.value.setBindingMeasurement(u, b))
460
+ }, null, 8, ["disabled", "rows"]),
461
+ d(ie, {
462
+ kind: "ingredient",
463
+ disabled: X.value,
464
+ rows: j(a.value.ingredientBindings),
465
+ onLink: l[6] || (l[6] = (u) => Y("ingredient")),
466
+ onRemove: l[7] || (l[7] = (u) => (e(p).touch("convert"), s.value.removeBinding(u))),
467
+ onUpdateAmount: G,
468
+ onUpdateMeasurement: l[8] || (l[8] = (u, b) => s.value.setBindingMeasurement(u, b))
469
+ }, null, 8, ["disabled", "rows"]),
470
+ Q.value ? (i(), r("p", vt, _(e(w)(Q.value)), 1)) : M("", !0)
471
+ ], 64)) : M("", !0)
472
+ ];
473
+ }),
474
+ _: 1
475
+ })
476
+ ]))
477
+ ];
478
+ }),
479
+ _: 1
480
+ }, 8, ["modelValue", "is-container", "is-container-props"]),
481
+ d(Re, {
482
+ modelValue: N.value,
483
+ "onUpdate:modelValue": l[11] || (l[11] = (o) => N.value = o),
484
+ candidates: fe.value,
485
+ query: ((ee = a.value) == null ? void 0 : ee.bindingCandidateQuery) ?? "",
486
+ title: ye.value,
487
+ "onUpdate:query": l[12] || (l[12] = (o) => s.value.setBindingCandidateQuery(o)),
488
+ onSubmit: l[13] || (l[13] = (o) => (e(p).touch("convert"), s.value.linkBindings(V.value, o)))
489
+ }, null, 8, ["modelValue", "candidates", "query", "title"])
490
+ ];
491
+ }),
492
+ _: 1
493
+ }, 8, ["heading"]);
494
+ };
495
+ }
496
+ }), St = /* @__PURE__ */ ue({
497
+ __name: "Ingredient",
498
+ setup(R) {
499
+ const F = je();
500
+ return (t, w) => (i(), C(bt, { sdk: e(F) }, null, 8, ["sdk"]));
501
+ }
502
+ });
503
+ export {
504
+ St as default
505
+ };