@feedmepos/mf-menu-portal 1.0.4-dev.2 → 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.
- package/dist/{App-DtX4DyDA.js → App-CrpoLCjA.js} +3 -3
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C9OSr8ft.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js} +1 -1
- package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-BJN8ajuD.js → BindingTable.vue_vue_type_script_setup_true_lang-D3CmOOPY.js} +1 -1
- package/dist/{Catalog-Dly_r1yA.js → Catalog-VU3HhNro.js} +4 -4
- package/dist/{CatalogBinding-CNG4YcVq.js → CatalogBinding-BNATtZEY.js} +3 -3
- package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-Cy2culdR.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BmG-xpW4.js} +3 -3
- package/dist/CatalogEditor.vue_vue_type_script_setup_true_lang-BFsRDFpj.js +784 -0
- package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-4EZ4yM_N.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Bk4FqVmx.js} +14 -14
- package/dist/{Category-Dz1yFYyY.js → Category-DMoXTsfG.js} +5 -5
- package/dist/{Category-BS-vFDYy.js → Category-DxjdQ-NN.js} +2 -2
- package/dist/CategoryList.vue_vue_type_script_setup_true_lang-B3Ts1O-9.js +847 -0
- package/dist/{CookingGuide-CmbvWFgp.js → CookingGuide-DiZZDYD-.js} +5 -5
- package/dist/{Group-B7s-vPXb.js → Group-DFR8q-tt.js} +5 -5
- package/dist/{Group-BRmWZnHh.js → Group-rzfh_o6r.js} +2 -2
- package/dist/GroupList.vue_vue_type_script_setup_true_lang-DiN-wQXX.js +1807 -0
- package/dist/Ingredient-DpjGIuH9.js +505 -0
- package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CnI80Ojd.js +782 -0
- package/dist/{MenuSetting-Ci7V_Jxn.js → MenuSetting-DR-pDSF_.js} +4 -4
- package/dist/OrderPacing-JcTuweqF.js +769 -0
- package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-NCH-SrZU.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-HwwJ2mGv.js} +2 -2
- package/dist/{Preview-BBGNaj1F.js → Preview-BZyun5lZ.js} +1 -1
- package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-BXJDpDCm.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-DquqNbE1.js} +1 -1
- package/dist/PrintRoute-CzEx2dCt.js +518 -0
- package/dist/{Product-DqN0NFUU.js → Product-CQb0n06E.js} +4 -4
- package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js +7931 -0
- package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-Fkiw4lZp.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-CBlDEjqF.js} +9 -9
- package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-D8NQTCLx.js +2011 -0
- package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CNWCT1OB.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-cG47Pu-6.js} +1 -1
- package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-BoQ9mVPY.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-0UwUcA2L.js} +800 -749
- package/dist/{ProductInternalTools-CC3SWSlT.js → ProductInternalTools-QrBR1nFp.js} +2 -2
- package/dist/{ProductInventoryDialog-SAhsVekx.js → ProductInventoryDialog-fV38GO1a.js} +1 -1
- package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-BB8UIIsW.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-Bzb3RrMg.js} +1 -1
- package/dist/ProductList.vue_vue_type_script_setup_true_lang-BwKQESr3.js +2765 -0
- package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-BMDSkfcn.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-CDYcHXo1.js} +1 -1
- package/dist/{Products-Cn6j1DOQ.js → Products-B8tysOAL.js} +3 -3
- package/dist/Publish-DTvOvFNa.js +1337 -0
- package/dist/Recipe-Ddx31csF.js +388 -0
- package/dist/{Scheduler-DlaSVACJ.js → Scheduler-CST5L_cw.js} +314 -254
- package/dist/ServingSequence-DYyEZI2S.js +374 -0
- package/dist/{Setting-CyCp2uw4.js → Setting-Ip0pGjks.js} +6 -6
- package/dist/Subcategory-BIgjzVta.js +459 -0
- package/dist/{Takeaway-sVVykWDg.js → Takeaway-CekhGM-m.js} +2 -2
- package/dist/{Takeaway-tYHCAXYU.js → Takeaway-aXsPg4JT.js} +5 -5
- package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-CV24v8Zg.js → TakeawayList.vue_vue_type_script_setup_true_lang-CaRR4_j3.js} +4 -4
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CshqYpc9.js +1291 -0
- package/dist/Unit-BMW8u0Us.js +424 -0
- package/dist/{Variant-BNnR5rLv.js → Variant-CZsrYRMU.js} +5 -5
- package/dist/{_id_-a9ZtdjtT.js → _id_-D4swrvNa.js} +3 -3
- package/dist/{app-CmElp8cO.js → app-BWwwHsWi.js} +337 -337
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +80 -0
- package/dist/apps/mf-menu/src/components/PriceTier/LinkPriceTierSection.vue.d.ts +9 -0
- package/dist/apps/mf-menu/src/components/Product/BulkCategorySelect.vue.d.ts +37 -0
- package/dist/apps/mf-menu/src/components/Product/ProductAttributeFilter.vue.d.ts +11 -1
- package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +2 -2
- package/dist/apps/mf-menu/src/components/feature/NestedGroupManager/NestedGroupOverrideSheets.vue.d.ts +27 -0
- package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesFilter.vue.d.ts +20 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{menu-compute-B_wpWLAj.js → menu-compute-D7TdiHt4.js} +4 -4
- package/dist/assets/{validate-menu-DjxNxUxH.js → validate-menu-DXppWUVq.js} +2 -2
- package/dist/mf-menu-portal.css +1 -1
- package/dist/{provide-BJRbSauL.js → provide-CDmXzkhz.js} +67539 -65978
- package/dist/{useActionFeedback-89GwO41T.js → useActionFeedback-Dm2HDa_2.js} +1 -1
- package/dist/{FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js → vuedraggable-CBtQLb_S.js} +140 -139
- package/package.json +2 -2
- package/dist/CatalogEditor.vue_vue_type_script_setup_true_lang-Byp1db9_.js +0 -484
- package/dist/CategoryList.vue_vue_type_script_setup_true_lang-CrHYjrTn.js +0 -797
- package/dist/GroupList.vue_vue_type_script_setup_true_lang-CWr52_a-.js +0 -2183
- package/dist/Ingredient-BMAlctE4.js +0 -463
- package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CR99740r.js +0 -709
- package/dist/OrderPacing-Bz5kn6DY.js +0 -698
- package/dist/PrintRoute-BnARWdR2.js +0 -473
- package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D8DygCBl.js +0 -110
- package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-DryxrG-x.js +0 -1257
- package/dist/ProductList.vue_vue_type_script_setup_true_lang-BDnTs366.js +0 -10353
- package/dist/Publish-BPJhG39B.js +0 -1261
- package/dist/Recipe-mt1vec5-.js +0 -350
- package/dist/ServingSequence-Cr1REWZP.js +0 -336
- package/dist/Subcategory-kuB7gYvc.js +0 -412
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dz-Chgek.js +0 -1213
- package/dist/Unit-BSOvZxRy.js +0 -385
- package/dist/apps/mf-menu/src/views/MenuManagementEditor/RestaurantAttributesFilter.vue.d.ts +0 -2
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { defineComponent as ae, computed as c, ref as D, shallowRef as X, h as ke, withModifiers as Y, onUnmounted as _e, resolveComponent as y, openBlock as r, createBlock as h, unref as n, withCtx as _, createElementBlock as b, toDisplayString as F, Fragment as Z, createElementVNode as m, withDirectives as he, createVNode as d, renderList as xe, createCommentVNode as V, mergeProps as we } from "vue";
|
|
2
|
+
import { useI18n as Ce } from "@feedmepos/mf-common";
|
|
3
|
+
import { useDialog as Fe, useBreakpoints as Be, components as ee, FmButtonVariant as Se } from "@feedmepos/ui-library";
|
|
4
|
+
import { _ as Ve } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
|
|
5
|
+
import { _ as $e } from "./BindingLinkDialog.vue_vue_type_script_setup_true_lang-BZVQRyRI.js";
|
|
6
|
+
import { _ as te } from "./BindingTable.vue_vue_type_script_setup_true_lang-D3CmOOPY.js";
|
|
7
|
+
import { _ as Ae } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
|
|
8
|
+
import { _ as Ue } from "./ListCountTag.vue_vue_type_script_setup_true_lang-0bjk8Aly.js";
|
|
9
|
+
import { u as Ie } from "./useActionFeedback-Dm2HDa_2.js";
|
|
10
|
+
import { u as Me } from "./useEditorValidation-Ctef5Bxt.js";
|
|
11
|
+
import { b as De, u as Ee, a as Te } from "./provide-CDmXzkhz.js";
|
|
12
|
+
const qe = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "flex-1 flex justify-between gap-8 pl-8"
|
|
15
|
+
}, ze = {
|
|
16
|
+
key: 0,
|
|
17
|
+
role: "alert",
|
|
18
|
+
class: "text-fm-color-typo-secondary"
|
|
19
|
+
}, Le = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "text-fm-color-typo-secondary"
|
|
22
|
+
}, Ne = { class: "flex justify-end items-center" }, Re = { class: "w-[320px] xs:w-full xs:px-16 xs:mt-8" }, je = {
|
|
23
|
+
key: 1,
|
|
24
|
+
class: "flex-1 min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
|
|
25
|
+
}, Pe = ["onClick"], Qe = { class: "min-w-0 flex-1" }, Ke = { class: "fm-typo-en-body-lg-600 mb-4 break-words" }, Oe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary break-words" }, Ge = {
|
|
26
|
+
key: 2,
|
|
27
|
+
class: "fixed right-16 bottom-[72px] z-[100]"
|
|
28
|
+
}, He = { class: "fm-typo-en-title-md-600" }, Je = { class: "pt-8 space-y-40" }, We = { class: "flex flex-row gap-16" }, Xe = { class: "flex gap-8 items-center justify-start" }, Ye = /* @__PURE__ */ ae({
|
|
29
|
+
__name: "RecipeList",
|
|
30
|
+
props: {
|
|
31
|
+
sdk: {}
|
|
32
|
+
},
|
|
33
|
+
setup(E) {
|
|
34
|
+
const f = E, T = {
|
|
35
|
+
mounted: (e, t) => {
|
|
36
|
+
var o;
|
|
37
|
+
return (o = e.querySelector("input")) == null ? void 0 : o.setAttribute("aria-label", t.value);
|
|
38
|
+
},
|
|
39
|
+
updated: (e, t) => {
|
|
40
|
+
var o;
|
|
41
|
+
return (o = e.querySelector("input")) == null ? void 0 : o.setAttribute("aria-label", t.value);
|
|
42
|
+
}
|
|
43
|
+
}, { t: a } = Ce(), B = De(), ne = Fe(), { run: q } = Ie(), p = Ee(f.sdk.recipe.list), u = c(
|
|
44
|
+
() => p.value.status === "ready" ? p.value.value : null
|
|
45
|
+
), ie = c(() => {
|
|
46
|
+
var e;
|
|
47
|
+
return ((e = u.value) == null ? void 0 : e.query) ?? "";
|
|
48
|
+
}), { breakpoints: le } = Be(), $ = c(() => le.value.xs), se = c(() => {
|
|
49
|
+
var e;
|
|
50
|
+
return [...((e = u.value) == null ? void 0 : e.rows) ?? []];
|
|
51
|
+
}), k = D(!1), A = D(!1), S = D("recipe"), s = X(
|
|
52
|
+
f.sdk.recipe.editor()
|
|
53
|
+
), x = X(
|
|
54
|
+
s.value.get()
|
|
55
|
+
);
|
|
56
|
+
let U = s.value.subscribe(
|
|
57
|
+
(e) => {
|
|
58
|
+
x.value = e;
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
const l = c(
|
|
62
|
+
() => x.value.status === "ready" ? x.value.value : null
|
|
63
|
+
), v = Me(() => s.value), z = c(
|
|
64
|
+
() => l.value ? v.issue(l.value.fieldIssues, "name") ?? l.value.nameIssue : null
|
|
65
|
+
), L = c(
|
|
66
|
+
() => l.value ? v.issue(l.value.fieldIssues, "contains") ?? l.value.containsIssue : null
|
|
67
|
+
);
|
|
68
|
+
function N(e) {
|
|
69
|
+
var o;
|
|
70
|
+
const t = ((o = l.value) == null ? void 0 : o.fieldIssues) ?? {};
|
|
71
|
+
return (e ?? []).map((w) => ({
|
|
72
|
+
...w,
|
|
73
|
+
amountIssue: v.issue(t, `amount:${w.id}`) ?? w.amountIssue
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
function R(e, t) {
|
|
77
|
+
v.field(
|
|
78
|
+
`amount:${e}`,
|
|
79
|
+
(o) => s.value.setBindingAmount(e, o)
|
|
80
|
+
)["onUpdate:modelValue"](t);
|
|
81
|
+
}
|
|
82
|
+
function j(e) {
|
|
83
|
+
U(), s.value.dispose(), s.value = f.sdk.recipe.editor(e), x.value = s.value.get(), U = s.value.subscribe(
|
|
84
|
+
(t) => {
|
|
85
|
+
x.value = t;
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function I() {
|
|
90
|
+
var e;
|
|
91
|
+
((e = u.value) == null ? void 0 : e.create.state) === "allowed" && (j(), k.value = !0);
|
|
92
|
+
}
|
|
93
|
+
function P(e) {
|
|
94
|
+
j(e.id), k.value = !0;
|
|
95
|
+
}
|
|
96
|
+
async function oe() {
|
|
97
|
+
(await q(
|
|
98
|
+
() => v.submit(() => s.value.submit()),
|
|
99
|
+
{
|
|
100
|
+
showLoading: () => {
|
|
101
|
+
var t;
|
|
102
|
+
return ((t = l.value) == null ? void 0 : t.status) === "submitting";
|
|
103
|
+
},
|
|
104
|
+
successMessage: (t) => a("menu.recipe.form.saved", { name: t.name })
|
|
105
|
+
}
|
|
106
|
+
)).kind === "success" && (k.value = !1);
|
|
107
|
+
}
|
|
108
|
+
function ue() {
|
|
109
|
+
}
|
|
110
|
+
function Q(e) {
|
|
111
|
+
e.remove.state === "allowed" && ne.open({
|
|
112
|
+
title: a("menu.common.dialog.remove.recipe.title"),
|
|
113
|
+
message: a("menu.common.dialog.remove.recipe.message", {
|
|
114
|
+
name: e.name
|
|
115
|
+
}),
|
|
116
|
+
primaryActions: {
|
|
117
|
+
text: a("menu.common.actions.remove"),
|
|
118
|
+
close: !0,
|
|
119
|
+
variant: Se.Destructive
|
|
120
|
+
},
|
|
121
|
+
secondaryActions: {
|
|
122
|
+
text: a("menu.common.actions.cancel"),
|
|
123
|
+
close: !0
|
|
124
|
+
}
|
|
125
|
+
}).onPrimary(async () => {
|
|
126
|
+
await q(() => f.sdk.recipe.remove(e.id), {
|
|
127
|
+
successMessage: a("menu.recipe.form.removed", { name: e.name })
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function re(e) {
|
|
132
|
+
const t = e.targetName ?? a("menu.recipe.table.ingredient.missing");
|
|
133
|
+
return e.kind === "recipe" ? a("menu.recipe.table.ingredient.recipe", {
|
|
134
|
+
name: t,
|
|
135
|
+
amount: e.amount
|
|
136
|
+
}) : a("menu.recipe.table.ingredient.sku", {
|
|
137
|
+
name: t,
|
|
138
|
+
amount: e.amount,
|
|
139
|
+
unit: e.unitSymbol ?? a("menu.recipe.table.ingredient.missing")
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
function K(e) {
|
|
143
|
+
return e.map(re).join(a("menu.recipe.table.ingredient.separator"));
|
|
144
|
+
}
|
|
145
|
+
const de = c(() => [
|
|
146
|
+
{
|
|
147
|
+
accessorKey: "name",
|
|
148
|
+
header: () => a("menu.recipe.table.columns.name"),
|
|
149
|
+
enableSorting: !1
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
accessorKey: "ingredients",
|
|
153
|
+
header: () => a("menu.recipe.table.columns.ingredients"),
|
|
154
|
+
enableSorting: !1,
|
|
155
|
+
cell: (e) => K(e.row.original.ingredients)
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: "actions",
|
|
159
|
+
size: 52,
|
|
160
|
+
meta: { cellClass: "pl-16", headerContentClass: "-mx-16" },
|
|
161
|
+
header: "",
|
|
162
|
+
cell: (e) => ke(ee.FmButton, {
|
|
163
|
+
icon: "delete",
|
|
164
|
+
variant: "tertiary",
|
|
165
|
+
textColor: "neutral-gray-400",
|
|
166
|
+
disabled: e.row.original.remove.state !== "allowed",
|
|
167
|
+
"aria-label": a("menu.recipe.table.delete.accessibility_label", {
|
|
168
|
+
name: e.row.original.name
|
|
169
|
+
}),
|
|
170
|
+
onClick: Y(
|
|
171
|
+
() => Q(e.row.original),
|
|
172
|
+
["stop", "prevent"]
|
|
173
|
+
)
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
]), O = c(
|
|
177
|
+
() => {
|
|
178
|
+
var e;
|
|
179
|
+
return ((e = l.value) == null ? void 0 : e.submit.state) !== "allowed";
|
|
180
|
+
}
|
|
181
|
+
), ce = c(
|
|
182
|
+
() => {
|
|
183
|
+
var e, t;
|
|
184
|
+
return S.value === "recipe" ? ((e = l.value) == null ? void 0 : e.recipeCandidates) ?? [] : ((t = l.value) == null ? void 0 : t.ingredientCandidates) ?? [];
|
|
185
|
+
}
|
|
186
|
+
), me = c(
|
|
187
|
+
() => a("menu.inventory.binding.link.title", {
|
|
188
|
+
type: S.value === "recipe" ? a("menu.inventory.binding.link.recipe") : a("menu.inventory.binding.link.ingredient")
|
|
189
|
+
})
|
|
190
|
+
);
|
|
191
|
+
function G(e) {
|
|
192
|
+
S.value = e, s.value.setBindingCandidateQuery(""), A.value = !0;
|
|
193
|
+
}
|
|
194
|
+
return _e(() => {
|
|
195
|
+
U(), s.value.dispose();
|
|
196
|
+
}), (e, t) => {
|
|
197
|
+
const o = y("FmButton"), w = y("FmCircularProgress"), pe = y("FmSearch"), ve = y("FmTable"), be = y("FmTextField"), fe = y("FmFormGroup"), ge = y("FmSideSheet");
|
|
198
|
+
return r(), h(Ae, {
|
|
199
|
+
"data-visual-root": "recipe",
|
|
200
|
+
heading: n(a)("menu.recipe.title")
|
|
201
|
+
}, {
|
|
202
|
+
"append-heading": _(() => [
|
|
203
|
+
n(p).status === "ready" && u.value ? (r(), b("div", qe, [
|
|
204
|
+
d(Ue, {
|
|
205
|
+
value: u.value.totalCount
|
|
206
|
+
}, null, 8, ["value"]),
|
|
207
|
+
u.value.totalCount > 0 && !$.value ? (r(), h(o, {
|
|
208
|
+
key: 0,
|
|
209
|
+
disabled: u.value.create.state !== "allowed",
|
|
210
|
+
label: n(a)("menu.recipe.actions.add"),
|
|
211
|
+
"prepend-icon": "add",
|
|
212
|
+
onClick: I
|
|
213
|
+
}, null, 8, ["disabled", "label"])) : V("", !0)
|
|
214
|
+
])) : V("", !0)
|
|
215
|
+
]),
|
|
216
|
+
default: _(() => {
|
|
217
|
+
var H;
|
|
218
|
+
return [
|
|
219
|
+
n(p).status === "error" ? (r(), b("p", ze, F(n(B)(n(p).error.message)), 1)) : n(p).status === "unavailable" ? (r(), b("p", Le, F(n(B)(n(p).reason)), 1)) : n(p).status === "loading" ? (r(), h(w, { key: 2 })) : u.value && u.value.totalCount === 0 ? (r(), h(n(Ve), {
|
|
220
|
+
key: 3,
|
|
221
|
+
action: { text: n(a)("menu.recipe.empty.action"), callback: I },
|
|
222
|
+
title: n(a)("menu.recipe.empty.title"),
|
|
223
|
+
subtitle: n(a)("menu.recipe.empty.subtitle")
|
|
224
|
+
}, null, 8, ["action", "title", "subtitle"])) : u.value ? (r(), b(Z, { key: 4 }, [
|
|
225
|
+
m("div", Ne, [
|
|
226
|
+
m("div", Re, [
|
|
227
|
+
he(d(pe, {
|
|
228
|
+
autofocus: "",
|
|
229
|
+
"aria-label": n(a)("menu.recipe.table.search.accessibility_label"),
|
|
230
|
+
class: "mb-8",
|
|
231
|
+
"model-value": ie.value,
|
|
232
|
+
placeholder: n(a)("menu.recipe.table.search.placeholder"),
|
|
233
|
+
"onUpdate:modelValue": f.sdk.recipe.search
|
|
234
|
+
}, null, 8, ["aria-label", "model-value", "placeholder", "onUpdate:modelValue"]), [
|
|
235
|
+
[T, n(a)("menu.recipe.table.search.accessibility_label")]
|
|
236
|
+
])
|
|
237
|
+
])
|
|
238
|
+
]),
|
|
239
|
+
$.value ? (r(), b("div", je, [
|
|
240
|
+
(r(!0), b(Z, null, xe(u.value.rows, (i) => (r(), b("div", {
|
|
241
|
+
key: i.id,
|
|
242
|
+
class: "py-12 px-16 flex space-x-8 items-center cursor-pointer",
|
|
243
|
+
onClick: (g) => P(i)
|
|
244
|
+
}, [
|
|
245
|
+
m("div", Qe, [
|
|
246
|
+
m("p", Ke, F(i.name), 1),
|
|
247
|
+
m("p", Oe, F(K(i.ingredients)), 1)
|
|
248
|
+
]),
|
|
249
|
+
d(o, {
|
|
250
|
+
class: "shrink-0",
|
|
251
|
+
"aria-label": n(a)("menu.recipe.table.delete.accessibility_label", {
|
|
252
|
+
name: i.name
|
|
253
|
+
}),
|
|
254
|
+
disabled: i.remove.state !== "allowed",
|
|
255
|
+
"prepend-icon": "delete",
|
|
256
|
+
"text-color": "neutral-gray-400",
|
|
257
|
+
variant: "tertiary",
|
|
258
|
+
onClick: Y((g) => Q(i), ["stop"])
|
|
259
|
+
}, null, 8, ["aria-label", "disabled", "onClick"])
|
|
260
|
+
], 8, Pe))), 128))
|
|
261
|
+
])) : (r(), h(ve, {
|
|
262
|
+
key: 0,
|
|
263
|
+
"column-defs": de.value,
|
|
264
|
+
"hide-footer": "",
|
|
265
|
+
"page-size": Math.max(u.value.rows.length, 1),
|
|
266
|
+
"pin-header-row": "",
|
|
267
|
+
"row-data": se.value,
|
|
268
|
+
"shrink-at": !1,
|
|
269
|
+
onRowClick: t[0] || (t[0] = (i) => P(i.original))
|
|
270
|
+
}, null, 8, ["column-defs", "page-size", "row-data"])),
|
|
271
|
+
u.value.totalCount > 0 && $.value ? (r(), b("div", Ge, [
|
|
272
|
+
d(o, {
|
|
273
|
+
disabled: u.value.create.state !== "allowed",
|
|
274
|
+
label: n(a)("menu.recipe.actions.add"),
|
|
275
|
+
"prepend-icon": "add",
|
|
276
|
+
variant: "fab",
|
|
277
|
+
onClick: I
|
|
278
|
+
}, null, 8, ["disabled", "label"])
|
|
279
|
+
])) : V("", !0)
|
|
280
|
+
], 64)) : V("", !0),
|
|
281
|
+
d(ge, {
|
|
282
|
+
modelValue: k.value,
|
|
283
|
+
"onUpdate:modelValue": t[6] || (t[6] = (i) => k.value = i),
|
|
284
|
+
"is-container": n(ee).FmForm,
|
|
285
|
+
"is-container-props": { onValidationSuccess: oe },
|
|
286
|
+
"max-width": 560,
|
|
287
|
+
"onOn:clickedAway": ue
|
|
288
|
+
}, {
|
|
289
|
+
"side-sheet-header": _(() => {
|
|
290
|
+
var i;
|
|
291
|
+
return [
|
|
292
|
+
m("p", He, F(((i = l.value) == null ? void 0 : i.mode) === "update" ? n(a)("menu.recipe.update") : n(a)("menu.recipe.add")), 1)
|
|
293
|
+
];
|
|
294
|
+
}),
|
|
295
|
+
"side-sheet-footer": _(() => {
|
|
296
|
+
var i, g;
|
|
297
|
+
return [
|
|
298
|
+
m("div", Xe, [
|
|
299
|
+
d(o, {
|
|
300
|
+
disabled: ((i = l.value) == null ? void 0 : i.submit.state) !== "allowed",
|
|
301
|
+
label: ((g = l.value) == null ? void 0 : g.mode) === "update" ? n(a)("menu.common.actions.update") : n(a)("menu.common.actions.add"),
|
|
302
|
+
size: "lg",
|
|
303
|
+
type: "submit",
|
|
304
|
+
variant: "primary"
|
|
305
|
+
}, null, 8, ["disabled", "label"]),
|
|
306
|
+
d(o, {
|
|
307
|
+
label: n(a)("menu.common.actions.cancel"),
|
|
308
|
+
size: "lg",
|
|
309
|
+
variant: "tertiary",
|
|
310
|
+
onClick: t[5] || (t[5] = (M) => k.value = !1)
|
|
311
|
+
}, null, 8, ["label"])
|
|
312
|
+
])
|
|
313
|
+
];
|
|
314
|
+
}),
|
|
315
|
+
default: _(() => {
|
|
316
|
+
var i, g, M;
|
|
317
|
+
return [
|
|
318
|
+
m("div", Je, [
|
|
319
|
+
m("div", We, [
|
|
320
|
+
d(be, we({
|
|
321
|
+
autofocus: "",
|
|
322
|
+
class: "flex-2",
|
|
323
|
+
"error-messages": z.value ? [n(B)(z.value)] : [],
|
|
324
|
+
label: n(a)("menu.recipe.columns.name"),
|
|
325
|
+
"model-value": ((i = l.value) == null ? void 0 : i.name) ?? ""
|
|
326
|
+
}, n(v).field("name", s.value.setName)), null, 16, ["error-messages", "label", "model-value"])
|
|
327
|
+
]),
|
|
328
|
+
d(fe, {
|
|
329
|
+
"model-value": [
|
|
330
|
+
...((g = l.value) == null ? void 0 : g.recipeBindings) ?? [],
|
|
331
|
+
...((M = l.value) == null ? void 0 : M.ingredientBindings) ?? []
|
|
332
|
+
],
|
|
333
|
+
"error-messages": L.value ? [n(B)(L.value)] : []
|
|
334
|
+
}, {
|
|
335
|
+
default: _(() => {
|
|
336
|
+
var J, W;
|
|
337
|
+
return [
|
|
338
|
+
d(te, {
|
|
339
|
+
kind: "recipe",
|
|
340
|
+
disabled: O.value,
|
|
341
|
+
rows: N((J = l.value) == null ? void 0 : J.recipeBindings),
|
|
342
|
+
onLink: t[1] || (t[1] = (C) => G("recipe")),
|
|
343
|
+
onUpdateAmount: R
|
|
344
|
+
}, null, 8, ["disabled", "rows"]),
|
|
345
|
+
d(te, {
|
|
346
|
+
kind: "ingredient",
|
|
347
|
+
disabled: O.value,
|
|
348
|
+
rows: N((W = l.value) == null ? void 0 : W.ingredientBindings),
|
|
349
|
+
"show-inert-deduct": "",
|
|
350
|
+
onLink: t[2] || (t[2] = (C) => G("ingredient")),
|
|
351
|
+
onRemove: t[3] || (t[3] = (C) => (n(v).touch("contains"), s.value.removeIngredientBinding(C))),
|
|
352
|
+
onUpdateAmount: R,
|
|
353
|
+
onUpdateMeasurement: t[4] || (t[4] = (C, ye) => s.value.setBindingMeasurement(C, ye))
|
|
354
|
+
}, null, 8, ["disabled", "rows"])
|
|
355
|
+
];
|
|
356
|
+
}),
|
|
357
|
+
_: 1
|
|
358
|
+
}, 8, ["model-value", "error-messages"])
|
|
359
|
+
])
|
|
360
|
+
];
|
|
361
|
+
}),
|
|
362
|
+
_: 1
|
|
363
|
+
}, 8, ["modelValue", "is-container", "is-container-props"]),
|
|
364
|
+
d($e, {
|
|
365
|
+
modelValue: A.value,
|
|
366
|
+
"onUpdate:modelValue": t[7] || (t[7] = (i) => A.value = i),
|
|
367
|
+
candidates: ce.value,
|
|
368
|
+
query: ((H = l.value) == null ? void 0 : H.bindingCandidateQuery) ?? "",
|
|
369
|
+
title: me.value,
|
|
370
|
+
"onUpdate:query": t[8] || (t[8] = (i) => s.value.setBindingCandidateQuery(i)),
|
|
371
|
+
onSubmit: t[9] || (t[9] = (i) => (n(v).touch("contains"), s.value.linkBindings(S.value, i)))
|
|
372
|
+
}, null, 8, ["modelValue", "candidates", "query", "title"])
|
|
373
|
+
];
|
|
374
|
+
}),
|
|
375
|
+
_: 1
|
|
376
|
+
}, 8, ["heading"]);
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
}), dt = /* @__PURE__ */ ae({
|
|
380
|
+
__name: "Recipe",
|
|
381
|
+
setup(E) {
|
|
382
|
+
const f = Te();
|
|
383
|
+
return (T, a) => (r(), h(Ye, { sdk: n(f) }, null, 8, ["sdk"]));
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
export {
|
|
387
|
+
dt as default
|
|
388
|
+
};
|