@feedmepos/mf-inventory-portal 0.0.23-dev.38 → 0.0.23-dev.40

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 (42) hide show
  1. package/dist/{App-DQgtWkQj.js → App-D8DXxTIq.js} +2 -2
  2. package/dist/{ApprovalView-CvSK9fGA.js → ApprovalView-BWGXkHV6.js} +2 -2
  3. package/dist/{BindingsDialog-BAC0_xCP.js → BindingsDialog-D7WypDot.js} +2 -2
  4. package/dist/{BindingsPicker-ecWMwsNp.js → BindingsPicker-DUlGwkwM.js} +1 -1
  5. package/dist/{BindingsTable-D5kQydOU.js → BindingsTable-BjeZYCaJ.js} +1 -1
  6. package/dist/{ClosingDraftView-CnHQ59rX.js → ClosingDraftView-o2LEUfo8.js} +2 -2
  7. package/dist/{ClosingTemplateView-vRTsVZ0c.js → ClosingTemplateView-Dt983Cg4.js} +1 -1
  8. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dc_7IyBG.js +142 -0
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CpIzIvkU.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-wocPyZls.js} +3 -3
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CNzEHF-R.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DzoEp-Pg.js} +1 -1
  11. package/dist/{IngredientGroupView-BLsABZ3h.js → IngredientGroupView-CIPpIpv1.js} +1 -1
  12. package/dist/IngredientsView-CFV3kX7Q.js +1707 -0
  13. package/dist/{IntegrationView-BqAqngtM.js → IntegrationView-DkW32m-t.js} +1 -1
  14. package/dist/{InventoryBindingForm-D54V_qZQ.js → InventoryBindingForm-B4CBet9W.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-KIW9J7Xn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DpdDVf6O.js} +3 -3
  16. package/dist/{InventoryBindingSummary-htT7GNto.js → InventoryBindingSummary-75ImZtqK.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BlEgALMj.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DfpG3Fy8.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DHbxXDGy.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B4d0c3nk.js} +1 -1
  19. package/dist/{PurchaseOrderPrintPreview-hmzxKuIa.js → PurchaseOrderPrintPreview-BYO0JcQW.js} +1 -1
  20. package/dist/{ReceiveRequestView-_YioyWqU.js → ReceiveRequestView-cFLNExw9.js} +182 -182
  21. package/dist/RecipeView-CjfpaHaT.js +609 -0
  22. package/dist/{StockView-R4cnEbHQ.js → StockView-HMtD9qar.js} +8 -8
  23. package/dist/{SupplierView-CevGG507.js → SupplierView-Cidfe-Xm.js} +4 -4
  24. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CeWP9msS.js → TransferDetails.vue_vue_type_script_setup_true_lang-CdU3HPBC.js} +4 -4
  25. package/dist/{TransferTemplateView-QDniAq8o.js → TransferTemplateView-Doxr1fXP.js} +6 -6
  26. package/dist/{UnitView-SjwJ3lZ0.js → UnitView-C1af71aM.js} +228 -223
  27. package/dist/{WarehouseView-55LiPQXG.js → WarehouseView-CviOLXfX.js} +1 -1
  28. package/dist/{app-UTiudUUR.js → app-BE8SgDqI.js} +92 -93
  29. package/dist/app.js +1 -1
  30. package/dist/{decimal-tyBgHJ47.js → decimal-xj3kVOP6.js} +1 -1
  31. package/dist/{feature-z7inw9y6.js → feature-CWpNYcWJ.js} +1 -1
  32. package/dist/{format-unit-display-DN0KtCh2.js → format-unit-display-CZ835oaL.js} +2 -2
  33. package/dist/{index-Dj2Ccgp1.js → index-B8IWDKYv.js} +3 -3
  34. package/dist/{index-DlhdTaa8.js → index-C6SzYqK7.js} +1 -1
  35. package/dist/{stock-CxRxidDu.js → stock-C2xyYnS7.js} +1 -1
  36. package/dist/{supplier-BhyiTwSJ.js → supplier-B-7o9hg1.js} +1 -1
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{use-inventory-binding-dialog-DwSvUvRl.js → use-inventory-binding-dialog-Dm8Ky1MH.js} +1 -1
  39. package/package.json +3 -3
  40. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBhBaRrd.js +0 -51
  41. package/dist/IngredientsView-Cs4TIf6V.js +0 -1794
  42. package/dist/RecipeView-88KJ0nvU.js +0 -591
@@ -1,591 +0,0 @@
1
- import { defineComponent as Y, ref as C, onMounted as re, resolveComponent as F, openBlock as E, createElementBlock as A, Fragment as ie, createElementVNode as w, toDisplayString as ce, createVNode as g, createCommentVNode as K, computed as V, watch as ue, createBlock as T, withCtx as P, unref as y, isRef as Z, normalizeClass as de, normalizeStyle as me, Teleport as pe, normalizeProps as fe, guardReactiveProps as ve } from "vue";
2
- import { a as I, d as x, e as G, S as ye, f as ge, D as ee, h as z, i as L, F as te, l as be, U as _e, A as we, o as ne, p as Re, r as he, q as xe, u as Ee, y as Ce, z as Se, B as Fe, E as Ve, G as oe } from "./app-UTiudUUR.js";
3
- import { useDialog as ke, useSnackbar as se, useProxiedModel as ae, useBreakpoints as De } from "@feedmepos/ui-library";
4
- import { i as Ie, _ as $e } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { _ as le } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBhBaRrd.js";
6
- import { defineStore as Ae, storeToRefs as Pe } from "pinia";
7
- import { useI18n as q } from "@feedmepos/mf-common";
8
- import { _ as Be } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-KIW9J7Xn.js";
9
- const Te = {
10
- key: 0,
11
- class: "flex flex-col items-center w-full h-full gap-24"
12
- }, Me = { key: 1 }, Ue = { key: 0 }, Ne = /* @__PURE__ */ Y({
13
- __name: "DeleteDialog",
14
- props: {
15
- type: {},
16
- data: {},
17
- message: {},
18
- bindedItems: {}
19
- },
20
- setup(R) {
21
- const p = R, v = C(p.bindedItems || []), r = C(!1);
22
- re(() => {
23
- l();
24
- });
25
- async function l() {
26
- var c, i;
27
- !r.value && ((c = p.data) != null && c._id) && (r.value = !0, v.value = await I().getAffectedMenu((i = p.data) == null ? void 0 : i._id), r.value = !1);
28
- }
29
- return (c, i) => {
30
- const f = F("FmSpacer"), d = F("FmCircularProgress");
31
- return E(), A(ie, null, [
32
- w("p", null, ce(c.message), 1),
33
- r.value ? (E(), A("div", Te, [
34
- g(f),
35
- w("div", null, [
36
- g(d, { size: "xl" })
37
- ]),
38
- i[0] || (i[0] = w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
39
- g(f)
40
- ])) : (E(), A("div", Me, [
41
- i[2] || (i[2] = w("br", null, null, -1)),
42
- v.value.length > 0 ? (E(), A("div", Ue, [
43
- i[1] || (i[1] = w("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
44
- g(le, {
45
- name: "Menu",
46
- bindings: v.value
47
- }, null, 8, ["bindings"])
48
- ])) : K("", !0)
49
- ]))
50
- ], 64);
51
- };
52
- }
53
- }), j = Ae("recipeForm", function() {
54
- const p = ke(), v = se(), r = I(), l = C(!1), c = C();
55
- function i() {
56
- const t = {
57
- recipe: {},
58
- mode: x.CREATE,
59
- show: !0,
60
- "onUpdate:show"(a) {
61
- c.value.show = a;
62
- }
63
- };
64
- c.value = t;
65
- }
66
- async function f(t) {
67
- const a = {
68
- recipe: G(t),
69
- mode: x.UPDATE,
70
- show: !0,
71
- "onUpdate:show"(e) {
72
- c.value.show = e;
73
- }
74
- };
75
- c.value = a;
76
- }
77
- async function d(t) {
78
- l.value = !0;
79
- try {
80
- await r.deleteRecipe(t), v.open({
81
- title: "Success",
82
- message: `Deleted ${t.name}`,
83
- type: "success"
84
- });
85
- } catch (a) {
86
- a instanceof ye && Ie(a) ? p.open({
87
- title: "Cannot delete recipe",
88
- contentComponent: $e,
89
- contentComponentProps: {
90
- subject: (t == null ? void 0 : t.name) ?? "",
91
- items: a.errorResponse.message
92
- },
93
- secondaryActions: {
94
- text: "Close",
95
- close: !0
96
- }
97
- }) : console.log("unable to delete recipe", a), v.open({
98
- title: `Cannot delete ${t == null ? void 0 : t.name}`,
99
- message: "Please try again.",
100
- type: "error"
101
- }), console.error("failed to delete recipe", a);
102
- } finally {
103
- l.value = !1;
104
- }
105
- }
106
- function u(t) {
107
- p.open({
108
- title: `Delete ${(t == null ? void 0 : t.name) ?? "recipe"}?`,
109
- closeButton: !1,
110
- primaryActions: {
111
- text: "Delete",
112
- close: !0,
113
- variant: "destructive"
114
- },
115
- secondaryActions: {
116
- text: "Cancel",
117
- close: !0
118
- },
119
- contentComponent: Ne,
120
- contentComponentProps: {
121
- type: "menu",
122
- data: t,
123
- message: "You may not be able to delete this recipe if it is linked in any of the inventory modules."
124
- }
125
- }).onPrimary(() => d(t));
126
- }
127
- return {
128
- createRecipe: i,
129
- updateRecipe: f,
130
- deleteRecipe: u,
131
- recipeDialogProps: c,
132
- recipeViewLoading: l
133
- };
134
- });
135
- function ze() {
136
- const { updateRecipe: R, deleteRecipe: p } = j(), v = I(), { t: r } = q();
137
- async function l(d, u) {
138
- const t = G(u);
139
- if (d === z.Edit) {
140
- await R(t);
141
- return;
142
- }
143
- if (d === z.Delete) {
144
- await p(t);
145
- return;
146
- }
147
- }
148
- function c(d, u) {
149
- const t = d.filter((e) => e.type === te.enum.SKU), a = d.filter((e) => e.type === te.enum.RECIPE);
150
- return [
151
- ...t.map((e) => ({ ...e, recipeIds: [...u] })),
152
- ...a.filter((e) => v.recipeById[e.id] && !u.has(e.id)).flatMap(
153
- (e) => c(v.recipeById[e.id].contains, /* @__PURE__ */ new Set([...u, e.id]))
154
- )
155
- ];
156
- }
157
- const i = [
158
- {
159
- accessorKey: "recipe",
160
- header: () => r("inventory.recipe.name"),
161
- size: 400
162
- },
163
- {
164
- accessorKey: "ingredients",
165
- header: () => r("inventory.recipe.ingredients"),
166
- size: "auto"
167
- },
168
- {
169
- id: "action",
170
- header: "",
171
- cell(d) {
172
- return ge(
173
- [ee[z.Edit], ee[z.Delete]],
174
- (u) => {
175
- l(u, d.row.original.original);
176
- }
177
- );
178
- },
179
- enableSorting: !1,
180
- size: 40,
181
- meta: {
182
- cellClass: "",
183
- headerClass: ""
184
- }
185
- }
186
- ];
187
- function f(d) {
188
- const u = I();
189
- return d.map((t) => ({
190
- recipe: t.name,
191
- ingredients: c(t.contains, /* @__PURE__ */ new Set([t._id])).map((a) => {
192
- var b, _, s, m, h;
193
- const e = u.skuById[a.id];
194
- return e ? a.recipeIds.slice(1).length ? `(linked recipe ${(b = u.recipeById[a.recipeIds.at(-1) ?? ""]) == null ? void 0 : b.name}) ${e.name} (${L(a.amount)}${((_ = a.measurement) == null ? void 0 : _.abbrev) ?? ((s = e == null ? void 0 : e.unit) == null ? void 0 : s.abbrev)})` : `${e.name} (${L(a.amount)}${((m = a.measurement) == null ? void 0 : m.abbrev) ?? ((h = e == null ? void 0 : e.unit) == null ? void 0 : h.abbrev)})` : null;
195
- }).filter((a) => a).join(", "),
196
- original: t
197
- }));
198
- }
199
- return { columnDefs: i, formatRowData: f };
200
- }
201
- const Le = { class: "flex flex-col gap-40" }, Ye = {
202
- key: 0,
203
- class: "col-span-2 mt-16 border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
204
- }, qe = {
205
- key: 0,
206
- class: "flex flex-col items-center w-full h-full gap-24"
207
- }, He = { key: 1 }, Ke = /* @__PURE__ */ Y({
208
- __name: "RecipeForm",
209
- props: {
210
- mode: {},
211
- modelValue: {},
212
- disabled: { type: Boolean }
213
- },
214
- emits: ["update:modelValue", "click:submit"],
215
- setup(R, { expose: p, emit: v }) {
216
- var h;
217
- const r = R, l = v, { t: c } = q(), i = V({
218
- get() {
219
- var n;
220
- return ((n = r.modelValue) == null ? void 0 : n.name) ?? "";
221
- },
222
- set(n) {
223
- const o = r.modelValue ?? {};
224
- o.name = n, l("update:modelValue", o);
225
- }
226
- }), f = V({
227
- get() {
228
- var n;
229
- return ((n = r.modelValue) == null ? void 0 : n.contains) ?? [];
230
- },
231
- set(n) {
232
- const o = r.modelValue ?? {};
233
- o.contains = n, l("update:modelValue", o);
234
- }
235
- });
236
- function d() {
237
- l("click:submit");
238
- }
239
- const u = C();
240
- p({
241
- validateInputs: () => {
242
- var n, o;
243
- (o = (n = u.value) == null ? void 0 : n.validateInputs) == null || o.call(n);
244
- },
245
- resetInputsValidation: () => {
246
- var n, o;
247
- (o = (n = u.value) == null ? void 0 : n.resetInputsValidation) == null || o.call(n);
248
- },
249
- resetInputs: () => {
250
- var n, o;
251
- (o = (n = u.value) == null ? void 0 : n.resetInputs) == null || o.call(n);
252
- }
253
- });
254
- const t = I(), a = C([]), e = C(!1), b = C(!1);
255
- ue(e, async (n) => {
256
- _(n);
257
- });
258
- async function _(n) {
259
- var o, k;
260
- n && !b.value && ((o = r.modelValue) != null && o._id) && (b.value = !0, a.value = await t.getAffectedMenu((k = r.modelValue) == null ? void 0 : k._id), b.value = !1);
261
- }
262
- const s = V(
263
- () => t.recipes.map((n) => ({ label: n.name, value: n.name }))
264
- ), m = C((h = r.modelValue) == null ? void 0 : h.name);
265
- return (n, o) => {
266
- const k = F("FmTextField"), H = F("FmCard"), $ = F("FmSwitch"), D = F("FmSpacer"), M = F("FmCircularProgress"), U = F("FmForm");
267
- return E(), T(U, {
268
- ref_key: "formRef",
269
- ref: u,
270
- onValidationSuccess: d
271
- }, {
272
- default: P(() => [
273
- w("div", Le, [
274
- g(k, {
275
- disabled: n.disabled,
276
- label: y(c)("inventory.recipe.name"),
277
- "model-value": i.value,
278
- "onUpdate:modelValue": o[0] || (o[0] = (S) => i.value = S),
279
- rules: [
280
- y(be)(),
281
- y(_e)(s.value, m.value, (S) => `[${S.value}] already exists`)
282
- ],
283
- "label-mark": "required"
284
- }, null, 8, ["disabled", "label", "model-value", "rules"]),
285
- g(H, {
286
- variant: "outlined",
287
- class: "p-16"
288
- }, {
289
- default: P(() => {
290
- var S;
291
- return [
292
- g(Be, {
293
- id: (S = n.modelValue) == null ? void 0 : S._id,
294
- disabled: n.disabled,
295
- "model-value": f.value,
296
- "onUpdate:modelValue": o[1] || (o[1] = (B) => f.value = B),
297
- rules: [y(we)(1)]
298
- }, null, 8, ["id", "disabled", "model-value", "rules"])
299
- ];
300
- }),
301
- _: 1
302
- })
303
- ]),
304
- n.mode !== y(x).CREATE ? (E(), A("div", Ye, [
305
- w("div", null, [
306
- g($, {
307
- label: "Show binded items",
308
- modelValue: e.value,
309
- "onUpdate:modelValue": o[2] || (o[2] = (S) => e.value = S),
310
- "label-placement": "right",
311
- disabled: b.value
312
- }, null, 8, ["modelValue", "disabled"])
313
- ]),
314
- b.value ? (E(), A("div", qe, [
315
- g(D),
316
- w("div", null, [
317
- g(M, { size: "xl" })
318
- ]),
319
- o[3] || (o[3] = w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
320
- g(D)
321
- ])) : (E(), A("div", He, [
322
- e.value && a.value.length ? (E(), T(le, {
323
- key: 0,
324
- name: "Menu",
325
- bindings: a.value
326
- }, null, 8, ["bindings"])) : K("", !0)
327
- ]))
328
- ])) : K("", !0)
329
- ]),
330
- _: 1
331
- }, 512);
332
- };
333
- }
334
- }), je = { class: "flex gap-4" }, Ge = /* @__PURE__ */ Y({
335
- __name: "RecipeDialog",
336
- props: {
337
- show: { type: Boolean },
338
- recipe: {},
339
- mode: { default: x.READ }
340
- },
341
- emits: ["update:show"],
342
- setup(R) {
343
- const p = R, v = I(), r = se(), { t: l } = q(), c = ae(p, "show"), i = ae(p, "recipe"), f = V(() => {
344
- switch (p.mode) {
345
- case x.READ:
346
- return "";
347
- case x.UPDATE:
348
- return l("inventory.recipe.update.title");
349
- case x.CREATE:
350
- return l("inventory.recipe.create.title");
351
- }
352
- return "";
353
- }), d = V(() => {
354
- switch (p.mode) {
355
- case x.READ:
356
- return "";
357
- case x.UPDATE:
358
- return l("common.save");
359
- case x.CREATE:
360
- return l("common.add");
361
- }
362
- return "";
363
- }), u = C(), t = C(!1);
364
- async function a() {
365
- t.value = !0;
366
- try {
367
- const s = G(i.value);
368
- s.precision ?? (s.precision = 0), s.measurements ?? (s.measurements = []), await v.createRecipe(s), c.value = !1, r.open({
369
- title: l("inventory.common.success"),
370
- message: l("inventory.recipe.create.success", { name: i.value.name }),
371
- type: "success"
372
- });
373
- } catch (s) {
374
- s instanceof ne || r.open({
375
- title: l("inventory.recipe.create.error.title"),
376
- message: l("inventory.recipe.create.error.message"),
377
- type: "error"
378
- });
379
- } finally {
380
- t.value = !1;
381
- }
382
- }
383
- async function e() {
384
- t.value = !0;
385
- try {
386
- await v.updateRecipe(i.value), c.value = !1, r.open({
387
- title: l("inventory.common.success"),
388
- message: l("inventory.recipe.update.success", { name: i.value.name }),
389
- type: "success"
390
- });
391
- } catch (s) {
392
- s instanceof ne || r.open({
393
- title: l("inventory.recipe.update.error.title"),
394
- message: l("inventory.recipe.update.error.message"),
395
- type: "error"
396
- });
397
- } finally {
398
- t.value = !1;
399
- }
400
- }
401
- function b() {
402
- var s, m;
403
- (m = (s = u.value) == null ? void 0 : s.validateInputs) == null || m.call(s);
404
- }
405
- function _() {
406
- switch (p.mode) {
407
- case x.READ:
408
- return;
409
- case x.UPDATE:
410
- return e();
411
- case x.CREATE:
412
- return a();
413
- }
414
- }
415
- return (s, m) => {
416
- const h = F("FmButton"), n = F("FmSideSheet");
417
- return E(), T(n, {
418
- "model-value": y(c),
419
- "onUpdate:modelValue": m[3] || (m[3] = (o) => Z(c) ? c.value = o : null),
420
- header: f.value,
421
- "close-button": "",
422
- "dismiss-away": "",
423
- "max-width": 500
424
- }, {
425
- "side-sheet-footer": P(() => [
426
- w("div", je, [
427
- g(h, {
428
- loading: t.value,
429
- label: d.value,
430
- onClick: b
431
- }, null, 8, ["loading", "label"]),
432
- g(h, {
433
- disabled: t.value,
434
- label: y(l)("common.close"),
435
- variant: "tertiary",
436
- onClick: m[2] || (m[2] = (o) => c.value = !1)
437
- }, null, 8, ["disabled", "label"])
438
- ])
439
- ]),
440
- default: P(() => [
441
- g(Ke, {
442
- class: "w-full",
443
- ref_key: "hasValidationExpose",
444
- ref: u,
445
- modelValue: y(i),
446
- "onUpdate:modelValue": m[0] || (m[0] = (o) => Z(i) ? i.value = o : null),
447
- mode: s.mode,
448
- disabled: t.value,
449
- "onClick:submit": m[1] || (m[1] = (o) => _())
450
- }, null, 8, ["modelValue", "mode", "disabled"])
451
- ]),
452
- _: 1
453
- }, 8, ["model-value", "header"]);
454
- };
455
- }
456
- });
457
- function Oe() {
458
- const R = I(), p = R.recipes, v = R.recipeById, r = R.skuById, l = p.flatMap((f, d) => {
459
- var u;
460
- if ((u = f.contains) != null && u.length) {
461
- const t = f.contains.filter((e) => e.type === "RECIPE"), a = f.contains.filter((e) => e.type === "SKU");
462
- return [
463
- ...d === 0 ? [] : [["", "", "", "", "", ""]],
464
- ...t.map(
465
- (e, b) => {
466
- var _;
467
- return [
468
- b === 0 ? f.name : "",
469
- "RECIPE",
470
- "",
471
- (_ = v[e.id]) == null ? void 0 : _.name,
472
- L(e.amount),
473
- "UNIT"
474
- ];
475
- }
476
- ),
477
- ...a.map(
478
- (e, b) => {
479
- var _, s, m, h;
480
- return [
481
- !t.length && b === 0 ? f.name : "",
482
- "INGREDIENT",
483
- (_ = r[e.id]) == null ? void 0 : _.code,
484
- (s = r[e.id]) == null ? void 0 : s.name,
485
- L(e.amount),
486
- e.measurement ? e.measurement.abbrev : (h = (m = r[e.id]) == null ? void 0 : m.unit) == null ? void 0 : h.abbrev
487
- ];
488
- }
489
- )
490
- ];
491
- }
492
- return [
493
- ...d === 0 ? [] : [["", "", "", "", "", ""]],
494
- [f.name, "No bindings", "", "", "", ""]
495
- ];
496
- }), i = Re(l, ["Name", "Type", "Code", "Item", "Amount", "Unit"]);
497
- he(i, `RECIPE_${xe(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
498
- }
499
- const Je = { class: "flex flex-col py-8" }, Qe = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, We = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt = /* @__PURE__ */ Y({
500
- __name: "RecipeView",
501
- setup(R) {
502
- const p = I(), v = V(() => p.recipes), r = Ee(), { createRecipe: l, updateRecipe: c } = j(), { recipeDialogProps: i, recipeViewLoading: f } = Pe(j()), { columnDefs: d, formatRowData: u } = ze(), t = V(() => u(v.value));
503
- function a(o) {
504
- if (o === "add")
505
- return l();
506
- if (o === "export")
507
- return Oe();
508
- }
509
- const e = C(""), b = V(() => f.value), { breakpoints: _ } = De(), s = V(() => _.value.xs || _.value.sm), m = V(() => s.value ? 10 : 20), h = Ce(), { t: n } = q();
510
- return (o, k) => {
511
- const H = F("FmTable");
512
- return E(), T(Se, {
513
- title: y(n)("inventory.recipe.title"),
514
- actions: [
515
- {
516
- label: y(n)("inventory.recipe.create.title"),
517
- value: "add",
518
- isPrimary: !0,
519
- prependIcon: "add"
520
- },
521
- { label: y(n)("common.export"), value: "export", isPrimary: !1 }
522
- ],
523
- "onClick:action": a
524
- }, {
525
- default: P(() => [
526
- w("div", {
527
- class: de([
528
- "flex flex-col gap-8 max-h-full",
529
- {
530
- "p-0": s.value,
531
- "px-24 ": !s.value
532
- }
533
- ])
534
- }, [
535
- g(Fe, {
536
- searchable: "",
537
- search: e.value,
538
- "onUpdate:search": k[0] || (k[0] = ($) => e.value = $)
539
- }, null, 8, ["search"]),
540
- (E(), T(H, {
541
- style: me(y(h).tableHeight),
542
- "column-defs": y(d),
543
- "row-data": t.value,
544
- "search-value": e.value,
545
- loading: !y(r)._currentLocation || b.value,
546
- onRowClick: k[1] || (k[1] = ($) => y(c)($.original.original)),
547
- key: v.value.length,
548
- "page-size": m.value
549
- }, {
550
- "list-row": P(($) => [
551
- g(Ve, {
552
- row: $,
553
- onRowClick: (D) => y(c)(D.original)
554
- }, {
555
- default: P((D) => {
556
- var M, U, S, B, O, J, Q, W, N, X;
557
- return [
558
- w("div", Je, [
559
- w("div", Qe, [
560
- g(y(oe), {
561
- render: (S = (U = (M = D.recipe) == null ? void 0 : M.column) == null ? void 0 : U.columnDef) == null ? void 0 : S.cell,
562
- props: (O = (B = D.recipe) == null ? void 0 : B.getContext) == null ? void 0 : O.call(B)
563
- }, null, 8, ["render", "props"])
564
- ]),
565
- w("div", We, [
566
- g(y(oe), {
567
- render: (W = (Q = (J = D.ingredients) == null ? void 0 : J.column) == null ? void 0 : Q.columnDef) == null ? void 0 : W.cell,
568
- props: (X = (N = D.ingredients) == null ? void 0 : N.getContext) == null ? void 0 : X.call(N)
569
- }, null, 8, ["render", "props"])
570
- ])
571
- ])
572
- ];
573
- }),
574
- _: 2
575
- }, 1032, ["row", "onRowClick"])
576
- ]),
577
- _: 1
578
- }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
579
- ], 2),
580
- (E(), T(pe, { to: "body" }, [
581
- g(Ge, fe(ve(y(i))), null, 16)
582
- ]))
583
- ]),
584
- _: 1
585
- }, 8, ["title", "actions"]);
586
- };
587
- }
588
- });
589
- export {
590
- lt as default
591
- };