@feedmepos/mf-inventory-portal 1.5.11-dev.2 → 1.5.11-dev.3
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-CquCiNsy.js → App-t6gPmao7.js} +4 -4
- package/dist/{ApprovalView-CU-k06kj.js → ApprovalView-D4Wqhsua.js} +7 -7
- package/dist/{BindingsDialog-BPBKfeS6.js → BindingsDialog-BgJ1tEto.js} +2 -2
- package/dist/{BindingsPicker-DkBI7_0Y.js → BindingsPicker-Dc2IFjLi.js} +2 -2
- package/dist/{BindingsTable-C22g1gV7.js → BindingsTable-CfYp1p03.js} +3 -3
- package/dist/{ClosingDraftView-DgHvcVne.js → ClosingDraftView-Sc2BxLZ5.js} +15 -15
- package/dist/{ClosingHistoryView-Cjm39o7e.js → ClosingHistoryView-D8l29kr9.js} +5 -5
- package/dist/{ClosingTemplateView-BfO_HZS-.js → ClosingTemplateView-DrzWU7be.js} +14 -14
- package/dist/{DefaultView-Jl_IdT_Z.js → DefaultView-Do4Gc3-x.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-CaWTHT6h.js → DeliveryOrderPrintPreview-Cp0TLV28.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BXmbD4jZ.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BJA5wTiE.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DWm36ZgX.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_1_ijOK.js} +2 -2
- package/dist/{FmMultiselectDialog-CEsqNTCq.js → FmMultiselectDialog-BOSgMmVe.js} +2 -2
- package/dist/{FmMultiselectDialog-D4gqa0tb.js → FmMultiselectDialog-DPvFk4GL.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-4NtlySGX.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Ex8cHZaI.js} +5 -5
- package/dist/{ImportView-GTiAyijj.js → ImportView-DWK0W15d.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BHRq2v-2.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BFu71gqD.js} +1 -1
- package/dist/{IngredientGroupView-Kk002hXi.js → IngredientGroupView-Cn6gzOBy.js} +5 -5
- package/dist/{IngredientsView-8Dojrj1e.js → IngredientsView-D32kZ7d3.js} +15 -15
- package/dist/{IntegrationExplorerView-BVBqUc3k.js → IntegrationExplorerView-D2qnrmy6.js} +5 -5
- package/dist/{IntegrationView-eS-LnDeu.js → IntegrationView-C28JHFG3.js} +13 -13
- package/dist/{InventoryBindingForm-DitsFH4v.js → InventoryBindingForm-DoxN1NxS.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DncMbF6J.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BvdmF6fv.js} +145 -133
- package/dist/{InventoryBindingSummary-DIKZ_7lC.js → InventoryBindingSummary-Cdx5Jab9.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DJV_hhgt.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-3nIQi_k-.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Pjde4sd6.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DaRgO7fj.js} +1 -1
- package/dist/{PublishView-CTwkJWJj.js → PublishView-DzI-UU85.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-BuP85XCw.js → PurchaseOrderPrintPreview-CwNlIMsu.js} +2 -2
- package/dist/{ReceiveRequestView-CfWhi-qh.js → ReceiveRequestView-D6tSWtrn.js} +26 -26
- package/dist/{RecipeView-CaNmJwqf.js → RecipeView-BDgAMk-z.js} +676 -664
- package/dist/{SettingsView-DiMxunWj.js → SettingsView-Hf60Y0J0.js} +4 -4
- package/dist/{StockView-CWDb29Cp.js → StockView-1B-2Vf1V.js} +19 -19
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-0MNUfMmq.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ba_wQ5Ju.js} +1 -1
- package/dist/{SupplierView-CLB-ASht.js → SupplierView-fHcYDGFM.js} +12 -12
- package/dist/{SurchargeView-C2clhhAW.js → SurchargeView-DkL78h98.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DF-LJ-3w.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C6YVS0bk.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Ga9lkrf8.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-gO_Wtu02.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-R1t4S-6H.js → TransferDetails.vue_vue_type_script_setup_true_lang-BHKrq-iQ.js} +20 -20
- package/dist/{TransferTemplateView-7lXzFWv2.js → TransferTemplateView-BhGR0SDH.js} +18 -18
- package/dist/{UnitCostHistoryView-CZg_dxvk.js → UnitCostHistoryView-CPIJwYgP.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BB3dV6Gh.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DzseV5bD.js} +5 -5
- package/dist/{UnitView-BnZ_3MwD.js → UnitView-D8CvRusr.js} +7 -7
- package/dist/{WarehouseView-D7j9qMqP.js → WarehouseView-CGOjzNX2.js} +5 -5
- package/dist/{WastageTemplateView-Cl_9lPqx.js → WastageTemplateView-wJFwncFJ.js} +14 -14
- package/dist/{app-DMMqtQts.js → app-BW79dfel.js} +15 -15
- package/dist/app.js +1 -1
- package/dist/{closing-template-CiSNSKyE.js → closing-template-BrVS-MpK.js} +1 -1
- package/dist/{date2-Db-IPmri.js → date2-ClhppfDY.js} +1 -1
- package/dist/{dayjs.min-DD2BO69F.js → dayjs.min-DTgFIQkI.js} +1 -1
- package/dist/{decimal-Ds6h3ukt.js → decimal-ClPxw7qT.js} +2 -2
- package/dist/{defineDeepModel-BgonxmUi.js → defineDeepModel-Dmr5ASnP.js} +1 -1
- package/dist/{duplicate-template-L6x61phF.js → duplicate-template-BnJAqy44.js} +1 -1
- package/dist/{feature-C0UUWbkT.js → feature-BAZ0m6J0.js} +2 -2
- package/dist/{format-time-from-id-lrFC2RMu.js → format-time-from-id-CKgj656W.js} +1 -1
- package/dist/{format-unit-display-CpwFmpcL.js → format-unit-display-Lbm7q5cC.js} +11 -11
- package/dist/{import-export.helper-BtXLvHMF.js → import-export.helper-BRHo1Hi8.js} +6 -6
- package/dist/{index-mtJ1GhRU.js → index-B5QDO_WU.js} +1 -1
- package/dist/{index-Cej2xM-2.js → index-C4Qke4jw.js} +1 -1
- package/dist/{index-CxALGEZr.js → index-C8iWZSA_.js} +3 -3
- package/dist/{inventory-core-dart.default-CroeeGeI.js → inventory-core-dart.default-D7w9ZZFQ.js} +1 -1
- package/dist/{lz-string-TL3mT9nT.js → lz-string-DLIa3ELl.js} +1 -1
- package/dist/{netsuite-DOpNemik.js → netsuite-DC4pocTl.js} +2 -2
- package/dist/{number-DlYhqTV5.js → number-T0uPxOq3.js} +3 -3
- package/dist/{predefined-templates-DDpVS07Q.js → predefined-templates-Dkk6anWi.js} +1 -1
- package/dist/{purchase-order-template-K6HvK5h0.js → purchase-order-template-DWf8ItXq.js} +1 -1
- package/dist/{recalculationUtils-BHomSQPu.js → recalculationUtils-BAYpPYM2.js} +1 -1
- package/dist/{rules-r7ubhhR0.js → rules-wxLo26xP.js} +2 -2
- package/dist/{stock-BcLy5Ilr.js → stock-Ck-zidTo.js} +1 -1
- package/dist/{supplier-rNHLA7rt.js → supplier-jOv7SNpw.js} +2 -2
- package/dist/{surcharge-B5N4UzQl.js → surcharge-ujbP636S.js} +1 -1
- package/dist/{uom-rules-B51fYVj3.js → uom-rules-mz2HXBL-.js} +1 -1
- package/dist/{use-ingredient-select-dialog-C7NY9Kj6.js → use-ingredient-select-dialog-BusXVXZW.js} +2 -2
- package/dist/{use-inventory-binding-dialog-Ca4VaXkz.js → use-inventory-binding-dialog-DCRvIaOC.js} +2 -2
- package/dist/{use-template-enabled-locations-RiR-qhSs.js → use-template-enabled-locations-DEzvQah6.js} +2 -2
- package/dist/{use-transfer-locations-csQ1Ar0m.js → use-transfer-locations-ku-9ZBUn.js} +2 -2
- package/dist/{useHrmPermission-DHcinOeI.js → useHrmPermission-CEtD6BoY.js} +1 -1
- package/dist/{useNavigationMenu-u8V59Vtc.js → useNavigationMenu-BTYlf6zF.js} +2 -2
- package/dist/{useSseClient-UQLgDoDc.js → useSseClient-UFc2h6Hw.js} +3 -3
- package/dist/{vue-i18n-CD-rDdDv.js → vue-i18n-B4kzuMPA.js} +206 -206
- package/dist/{xlsx-BRq0kYfc.js → xlsx-lV47NWo8.js} +398 -398
- package/dist/{xlsx.util-ylgVcZid.js → xlsx.util-KjOwaQ_K.js} +3 -3
- package/package.json +4 -4
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as le, ref as W, onMounted as pt, resolveComponent as G, openBlock as
|
|
2
|
-
import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-
|
|
1
|
+
import { defineComponent as le, ref as W, onMounted as pt, resolveComponent as G, openBlock as y, createElementBlock as E, Fragment as X, createElementVNode as v, toDisplayString as U, createVNode as h, createCommentVNode as T, computed as A, watch as ue, unref as n, normalizeClass as Ce, withCtx as J, h as de, createBlock as Y, renderList as me, isRef as De, mergeProps as we, createTextVNode as mt, withModifiers as ft, normalizeStyle as vt, Teleport as yt, normalizeProps as bt, guardReactiveProps as gt } from "vue";
|
|
2
|
+
import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-BW79dfel.js";
|
|
3
3
|
import { useDialog as Le, useSnackbar as je, components as _e, useProxiedModel as Ge, useBreakpoints as xt } from "@feedmepos/ui-library";
|
|
4
4
|
import { i as $t, _ as It, m as wt } from "./menu-usage-module-D7cxkbEk.js";
|
|
5
5
|
import { F as se } from "./form-mode.enum-BKiNVH6A.js";
|
|
6
|
-
import { _ as nt } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { _ as nt } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-BFu71gqD.js";
|
|
7
7
|
import { defineStore as ot, storeToRefs as Et } from "pinia";
|
|
8
8
|
import { D as He, R as Ve } from "./row-action.enum-DQ9bJ_uv.js";
|
|
9
9
|
import { c as Vt } from "./component-kqxARxvM.js";
|
|
10
|
-
import { a as Q, c as Ke } from "./number-
|
|
10
|
+
import { a as Q, c as Ke } from "./number-T0uPxOq3.js";
|
|
11
11
|
import { useI18n as ie, useCoreStore as St } from "@feedmepos/mf-common";
|
|
12
|
-
import { u as
|
|
13
|
-
import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-
|
|
14
|
-
import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-
|
|
15
|
-
import { a as Pe } from "./FmMultiselectDialog-
|
|
16
|
-
import { d as rt } from "./defineDeepModel-
|
|
12
|
+
import { u as Ct, _ as Bt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
|
|
13
|
+
import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-wxLo26xP.js";
|
|
14
|
+
import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-BvdmF6fv.js";
|
|
15
|
+
import { a as Pe } from "./FmMultiselectDialog-BOSgMmVe.js";
|
|
16
|
+
import { d as rt } from "./defineDeepModel-Dmr5ASnP.js";
|
|
17
17
|
import { L as Tt, P as Ut, D as Pt } from "./app-DiX-EfV6.js";
|
|
18
|
-
import { _ as
|
|
19
|
-
import { u as Gt } from "./FmMultiselectDialog-
|
|
20
|
-
import { u as Nt } from "./vue-i18n-
|
|
21
|
-
import { F as zt } from "./inventory-core-dart.default-
|
|
18
|
+
import { _ as Be, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-Ex8cHZaI.js";
|
|
19
|
+
import { u as Gt } from "./FmMultiselectDialog-DPvFk4GL.js";
|
|
20
|
+
import { u as Nt } from "./vue-i18n-B4kzuMPA.js";
|
|
21
|
+
import { F as zt } from "./inventory-core-dart.default-D7w9ZZFQ.js";
|
|
22
22
|
import { _ as Ot } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
|
|
23
|
-
import { u as We } from "./feature-
|
|
24
|
-
import { F as he } from "./decimal-
|
|
25
|
-
import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-
|
|
26
|
-
import { b as at, d as st } from "./xlsx.util-
|
|
27
|
-
import { f as dt } from "./date2-
|
|
23
|
+
import { u as We } from "./feature-BAZ0m6J0.js";
|
|
24
|
+
import { F as he } from "./decimal-ClPxw7qT.js";
|
|
25
|
+
import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BJA5wTiE.js";
|
|
26
|
+
import { b as at, d as st } from "./xlsx.util-KjOwaQ_K.js";
|
|
27
|
+
import { f as dt } from "./date2-ClhppfDY.js";
|
|
28
28
|
import { _ as Lt, F as Qe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
|
|
29
|
-
import { _ as jt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
29
|
+
import { _ as jt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_1_ijOK.js";
|
|
30
30
|
const Kt = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
@@ -49,18 +49,18 @@ const Kt = {
|
|
|
49
49
|
}
|
|
50
50
|
return (r, x) => {
|
|
51
51
|
const u = G("FmSpacer"), o = G("FmCircularProgress");
|
|
52
|
-
return
|
|
52
|
+
return y(), E(X, null, [
|
|
53
53
|
v("p", null, U(r.message), 1),
|
|
54
|
-
t.value ? (
|
|
54
|
+
t.value ? (y(), E("div", Kt, [
|
|
55
55
|
h(u),
|
|
56
56
|
v("div", null, [
|
|
57
57
|
h(o, { size: "xl" })
|
|
58
58
|
]),
|
|
59
59
|
x[0] || (x[0] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
60
60
|
h(u)
|
|
61
|
-
])) : (
|
|
61
|
+
])) : (y(), E("div", qt, [
|
|
62
62
|
x[2] || (x[2] = v("br", null, null, -1)),
|
|
63
|
-
l.value.length > 0 ? (
|
|
63
|
+
l.value.length > 0 ? (y(), E("div", Wt, [
|
|
64
64
|
x[1] || (x[1] = v("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
|
|
65
65
|
h(nt, {
|
|
66
66
|
name: "Menu",
|
|
@@ -111,12 +111,12 @@ const Kt = {
|
|
|
111
111
|
contentComponentProps: {
|
|
112
112
|
subject: (a == null ? void 0 : a.name) ?? "",
|
|
113
113
|
items: p.errorResponse.errors.map(($) => {
|
|
114
|
-
var
|
|
114
|
+
var C;
|
|
115
115
|
return {
|
|
116
116
|
chain: [
|
|
117
117
|
{
|
|
118
118
|
itemName: $.name,
|
|
119
|
-
moduleKey: (
|
|
119
|
+
moduleKey: (C = $.message) != null && C.startsWith("modules.") ? wt($.message) : $.module
|
|
120
120
|
}
|
|
121
121
|
]
|
|
122
122
|
};
|
|
@@ -181,14 +181,14 @@ function Jt() {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
function r(o, s) {
|
|
184
|
-
const a = o.filter((
|
|
185
|
-
(
|
|
186
|
-
), $ = o.filter((
|
|
184
|
+
const a = o.filter((C) => C.type === be.enum.SKU), p = o.filter(
|
|
185
|
+
(C) => C.type === be.enum.SKU_GROUP
|
|
186
|
+
), $ = o.filter((C) => C.type === be.enum.RECIPE);
|
|
187
187
|
return [
|
|
188
|
-
...a.map((
|
|
189
|
-
...p.map((
|
|
190
|
-
...$.filter((
|
|
191
|
-
(
|
|
188
|
+
...a.map((C) => ({ ...C, recipeIds: [...s] })),
|
|
189
|
+
...p.map((C) => ({ ...C, isGroup: !0, recipeIds: [...s] })),
|
|
190
|
+
...$.filter((C) => l.recipeById[C.id] && !s.has(C.id)).flatMap(
|
|
191
|
+
(C) => r(l.recipeById[C.id].contains, /* @__PURE__ */ new Set([...s, C.id]))
|
|
192
192
|
)
|
|
193
193
|
];
|
|
194
194
|
}
|
|
@@ -227,13 +227,13 @@ function Jt() {
|
|
|
227
227
|
return o.map((a) => ({
|
|
228
228
|
recipe: a.name,
|
|
229
229
|
ingredients: r(a.contains, /* @__PURE__ */ new Set([a._id])).map((p) => {
|
|
230
|
-
var
|
|
230
|
+
var C, I, f, k, S, b;
|
|
231
231
|
if (p.isGroup) {
|
|
232
232
|
const e = s.skuGroupById[p.id];
|
|
233
|
-
return p.recipeIds.slice(1).length ? `(${(
|
|
233
|
+
return p.recipeIds.slice(1).length ? `(${(C = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : C.name}) ${e.name} (x ${Q(p.amount)})` : `${e.name} (x${Q(p.amount)})`;
|
|
234
234
|
}
|
|
235
235
|
const $ = s.skuById[p.id];
|
|
236
|
-
return $ ? p.recipeIds.slice(1).length ? `(${(I = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : I.name}) ${$.name} (${Q(p.amount)}${((f = p.measurement) == null ? void 0 : f.abbrev) ?? ((k = $ == null ? void 0 : $.unit) == null ? void 0 : k.abbrev)})` : `${$.name} (${Q(p.amount)}${((S = p.measurement) == null ? void 0 : S.abbrev) ?? ((
|
|
236
|
+
return $ ? p.recipeIds.slice(1).length ? `(${(I = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : I.name}) ${$.name} (${Q(p.amount)}${((f = p.measurement) == null ? void 0 : f.abbrev) ?? ((k = $ == null ? void 0 : $.unit) == null ? void 0 : k.abbrev)})` : `${$.name} (${Q(p.amount)}${((S = p.measurement) == null ? void 0 : S.abbrev) ?? ((b = $ == null ? void 0 : $.unit) == null ? void 0 : b.abbrev)})` : null;
|
|
237
237
|
}).filter((p) => p).join(", "),
|
|
238
238
|
original: a
|
|
239
239
|
}));
|
|
@@ -247,13 +247,13 @@ function Ht() {
|
|
|
247
247
|
const s = r.filter((k) => k.type === "SKU"), a = r.filter((k) => k.type !== "SKU"), p = /* @__PURE__ */ new Set();
|
|
248
248
|
if (u)
|
|
249
249
|
for (const k of m.skus)
|
|
250
|
-
!o.some((
|
|
250
|
+
!o.some((b) => b === k._id) && k._id !== u && !((f = (I = k.convert) == null ? void 0 : I.inventoryBindings) != null && f.some((b) => b.id === u)) || p.add(k._id);
|
|
251
251
|
const $ = m.skus.map((k) => ({
|
|
252
252
|
label: k.name,
|
|
253
253
|
sublabel: `${k.code}${p.has(k._id) ? " (Cannot bind, will cause recursive binding)" : ""}`,
|
|
254
254
|
value: k,
|
|
255
255
|
disabled: p.has(k._id)
|
|
256
|
-
})),
|
|
256
|
+
})), C = $.filter(
|
|
257
257
|
(k) => s.find((S) => S.id === k.value._id) && !p.has(k.value._id)
|
|
258
258
|
).map((k) => k.value);
|
|
259
259
|
d.open({
|
|
@@ -261,7 +261,7 @@ function Ht() {
|
|
|
261
261
|
contentComponent: Pe,
|
|
262
262
|
contentComponentProps: {
|
|
263
263
|
items: $,
|
|
264
|
-
modelValue:
|
|
264
|
+
modelValue: C,
|
|
265
265
|
virtualScroll: !0
|
|
266
266
|
},
|
|
267
267
|
primaryActions: {
|
|
@@ -276,10 +276,10 @@ function Ht() {
|
|
|
276
276
|
}).onPrimary((k) => {
|
|
277
277
|
const S = [
|
|
278
278
|
...a,
|
|
279
|
-
...r.filter((
|
|
280
|
-
...k.filter((
|
|
279
|
+
...r.filter((b) => k.find((e) => e._id === b.id)),
|
|
280
|
+
...k.filter((b) => !r.find((e) => e.id === b._id)).map((b) => ({
|
|
281
281
|
type: "SKU",
|
|
282
|
-
id:
|
|
282
|
+
id: b._id,
|
|
283
283
|
amount: {
|
|
284
284
|
amount: 1,
|
|
285
285
|
precision: 0
|
|
@@ -290,12 +290,12 @@ function Ht() {
|
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
292
|
async function t(r, x, u = []) {
|
|
293
|
-
var
|
|
293
|
+
var C;
|
|
294
294
|
const o = r.filter((I) => I.type === "RECIPE"), s = r.filter((I) => I.type !== "RECIPE"), a = /* @__PURE__ */ new Set();
|
|
295
295
|
if (u.length)
|
|
296
296
|
for (const I of m.recipes) {
|
|
297
|
-
const f = ((
|
|
298
|
-
(e) => e.bindingPaths.some((
|
|
297
|
+
const f = ((C = m.recipeBindingFlattenCache[I._id]) == null ? void 0 : C.inventoryBindings) ?? [], k = f.some(
|
|
298
|
+
(e) => e.bindingPaths.some((V) => u.some((c) => c === V.id))
|
|
299
299
|
), S = f.some(
|
|
300
300
|
(e) => "success" in e && u.includes(e.ingredient._id)
|
|
301
301
|
);
|
|
@@ -346,7 +346,7 @@ function Ht() {
|
|
|
346
346
|
const o = r.filter(($) => $.type === "SKU_GROUP"), s = r.filter(($) => $.type !== "SKU_GROUP"), a = m.skuGroups.filter(($) => !u.includes($._id)).map(($) => ({
|
|
347
347
|
label: $.name,
|
|
348
348
|
value: $
|
|
349
|
-
})), p = a.filter(($) => o.find((
|
|
349
|
+
})), p = a.filter(($) => o.find((C) => C.id === $.value._id)).map(($) => $.value);
|
|
350
350
|
d.open({
|
|
351
351
|
title: "Select ingredient group",
|
|
352
352
|
contentComponent: Pe,
|
|
@@ -365,7 +365,7 @@ function Ht() {
|
|
|
365
365
|
variant: "tertiary"
|
|
366
366
|
}
|
|
367
367
|
}).onPrimary(($) => {
|
|
368
|
-
const
|
|
368
|
+
const C = [
|
|
369
369
|
...r.filter((I) => $.find((f) => f._id === I.id)),
|
|
370
370
|
...$.filter((I) => !r.find((f) => f.id === I._id)).map((I) => ({
|
|
371
371
|
type: "SKU_GROUP",
|
|
@@ -377,7 +377,7 @@ function Ht() {
|
|
|
377
377
|
})),
|
|
378
378
|
...s
|
|
379
379
|
];
|
|
380
|
-
x(
|
|
380
|
+
x(C);
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
383
|
return {
|
|
@@ -396,19 +396,19 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
396
396
|
},
|
|
397
397
|
emits: ["update:modelValue"],
|
|
398
398
|
setup(m, { emit: d }) {
|
|
399
|
-
const l = m, t = d, { t: i } = ie(), r = St(), x = tt(), u =
|
|
400
|
-
var
|
|
399
|
+
const l = m, t = d, { t: i } = ie(), r = St(), x = tt(), u = A(() => {
|
|
400
|
+
var C;
|
|
401
401
|
const p = /* @__PURE__ */ new Map(), $ = r.restaurants.value.map((I) => I.customAttributes ?? {});
|
|
402
402
|
for (const I of $)
|
|
403
403
|
for (const [f, k] of Object.entries(I))
|
|
404
|
-
p.has(f) || p.set(f, /* @__PURE__ */ new Set()), k && ((
|
|
404
|
+
p.has(f) || p.set(f, /* @__PURE__ */ new Set()), k && ((C = p.get(f)) == null || C.add(k));
|
|
405
405
|
return p;
|
|
406
|
-
}), o =
|
|
407
|
-
...[...u.value.entries()].map(([$,
|
|
406
|
+
}), o = A(() => [
|
|
407
|
+
...[...u.value.entries()].map(([$, C]) => ({
|
|
408
408
|
type: "string",
|
|
409
409
|
key: $,
|
|
410
410
|
entity: "restaurant",
|
|
411
|
-
values: [...
|
|
411
|
+
values: [...C]
|
|
412
412
|
})),
|
|
413
413
|
{
|
|
414
414
|
type: "string",
|
|
@@ -433,10 +433,10 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
433
433
|
},
|
|
434
434
|
{ deep: !0 }
|
|
435
435
|
), (p, $) => {
|
|
436
|
-
const
|
|
437
|
-
return
|
|
436
|
+
const C = G("FmLabel"), I = G("FmFormGroup");
|
|
437
|
+
return y(), E("div", Qt, [
|
|
438
438
|
v("div", Xt, [
|
|
439
|
-
h(
|
|
439
|
+
h(C, {
|
|
440
440
|
label: n(i)("inventory.ingredientGroup.form.rules.title"),
|
|
441
441
|
required: p.minCount != null && p.minCount > 0
|
|
442
442
|
}, null, 8, ["label", "required"]),
|
|
@@ -482,7 +482,7 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
482
482
|
},
|
|
483
483
|
emits: ["update:modelValue", "delete", "settings"],
|
|
484
484
|
setup(m, { emit: d }) {
|
|
485
|
-
const l = d, { t } = ie(), i = rt("modelValue"), r = W(""), x =
|
|
485
|
+
const l = d, { t } = ie(), i = rt("modelValue"), r = W(""), x = A(() => +Q(i.amount));
|
|
486
486
|
ue(
|
|
487
487
|
() => i.amount,
|
|
488
488
|
(s) => {
|
|
@@ -499,10 +499,10 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
499
499
|
}, 300);
|
|
500
500
|
}
|
|
501
501
|
return (s, a) => {
|
|
502
|
-
const p = G("FmTooltip"), $ = G("FmTextField"),
|
|
503
|
-
return
|
|
502
|
+
const p = G("FmTooltip"), $ = G("FmTextField"), C = G("FmButton"), I = G("FmIcon"), f = G("FmFormGroup");
|
|
503
|
+
return y(), E("div", Zt, [
|
|
504
504
|
h(f, {
|
|
505
|
-
class:
|
|
505
|
+
class: Ce(["mb-2"]),
|
|
506
506
|
disabled: s.disabled,
|
|
507
507
|
modelValue: x.value,
|
|
508
508
|
rules: [n(it)(0), n(qe)(-1)]
|
|
@@ -534,8 +534,8 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
534
534
|
invalid: k
|
|
535
535
|
}, null, 8, ["disabled", "modelValue", "invalid"])
|
|
536
536
|
]),
|
|
537
|
-
s.readonly ? T("", !0) : (
|
|
538
|
-
h(
|
|
537
|
+
s.readonly ? T("", !0) : (y(), E("div", an, [
|
|
538
|
+
h(C, {
|
|
539
539
|
disabled: s.disabled,
|
|
540
540
|
type: "button",
|
|
541
541
|
variant: "plain",
|
|
@@ -545,7 +545,7 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
545
545
|
}, null, 8, ["disabled"])
|
|
546
546
|
]))
|
|
547
547
|
]),
|
|
548
|
-
s.showError ? (
|
|
548
|
+
s.showError ? (y(), E("div", sn, [
|
|
549
549
|
h(I, {
|
|
550
550
|
name: "error",
|
|
551
551
|
color: "system-error-300",
|
|
@@ -569,7 +569,7 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
569
569
|
}
|
|
570
570
|
});
|
|
571
571
|
function cn(m) {
|
|
572
|
-
const d = Gt(), { t: l } = Nt(), t = ne(), i =
|
|
572
|
+
const d = Gt(), { t: l } = Nt(), t = ne(), i = A(() => [
|
|
573
573
|
{
|
|
574
574
|
id: "delete",
|
|
575
575
|
header: "",
|
|
@@ -782,11 +782,11 @@ function cn(m) {
|
|
|
782
782
|
disabled: x.includes(a._id)
|
|
783
783
|
});
|
|
784
784
|
const o = (m.bindingAlternatives ?? []).map((a) => a._id), s = await d.multiSelect(u, o, (a) => {
|
|
785
|
-
var $,
|
|
786
|
-
const p = ($ = m.bindingAlternatives) == null ? void 0 : $.findIndex((
|
|
785
|
+
var $, C, I, f, k, S;
|
|
786
|
+
const p = ($ = m.bindingAlternatives) == null ? void 0 : $.findIndex((b) => b._id === a);
|
|
787
787
|
return {
|
|
788
788
|
_id: a,
|
|
789
|
-
trackingMeasurement: typeof p != "number" || p == -1 ? (
|
|
789
|
+
trackingMeasurement: typeof p != "number" || p == -1 ? (C = t.skuById[a]) == null ? void 0 : C.trackingMeasurement : (f = (I = m.bindingAlternatives) == null ? void 0 : I[p]) == null ? void 0 : f.trackingMeasurement,
|
|
790
790
|
priority: ((S = (k = m.bindingAlternatives) == null ? void 0 : k[p]) == null ? void 0 : S.priority) ?? m.bindingAlternatives.length,
|
|
791
791
|
default: !1
|
|
792
792
|
};
|
|
@@ -827,8 +827,8 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
827
827
|
}), x = (o) => o && o.some((s) => l.filterIngredientIds.includes(s._id)) ? "Contains invalid ingredient" : !0, u = (o) => o && o.length > 5 ? i("inventory.binding.alternative.maximumExceeded", { max: 5 }) : !0;
|
|
828
828
|
return (o, s) => {
|
|
829
829
|
var I;
|
|
830
|
-
const a = G("FmLabel"), p = G("FmButton"), $ = G("FmFormGroup"),
|
|
831
|
-
return
|
|
830
|
+
const a = G("FmLabel"), p = G("FmButton"), $ = G("FmFormGroup"), C = G("FmTable");
|
|
831
|
+
return y(), E("div", pn, [
|
|
832
832
|
v("div", mn, [
|
|
833
833
|
v("div", fn, [
|
|
834
834
|
h(a, {
|
|
@@ -848,7 +848,7 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
848
848
|
rules: [x, u]
|
|
849
849
|
}, null, 8, ["model-value", "rules"])
|
|
850
850
|
]),
|
|
851
|
-
h(
|
|
851
|
+
h(C, {
|
|
852
852
|
"row-data": o.modelValue ?? [],
|
|
853
853
|
"column-defs": n(r).columnDefs,
|
|
854
854
|
"page-size": ((I = o.modelValue) == null ? void 0 : I.length) || 0,
|
|
@@ -896,7 +896,7 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
896
896
|
}
|
|
897
897
|
return (u, o) => {
|
|
898
898
|
const s = G("FmTooltip"), a = G("FmButton"), p = G("FmFormGroup");
|
|
899
|
-
return
|
|
899
|
+
return y(), E("div", vn, [
|
|
900
900
|
v("div", yn, [
|
|
901
901
|
v("div", bn, [
|
|
902
902
|
v("div", gn, [
|
|
@@ -913,7 +913,7 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
913
913
|
}, 8, ["content"])
|
|
914
914
|
]),
|
|
915
915
|
v("div", kn, [
|
|
916
|
-
h(
|
|
916
|
+
h(Be, {
|
|
917
917
|
"model-value": { amount: n(i).amount, measurement: n(i).measurement },
|
|
918
918
|
"onUpdate:modelValue": r,
|
|
919
919
|
unit: u.unit,
|
|
@@ -922,7 +922,7 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
922
922
|
disabled: u.readonly
|
|
923
923
|
}, null, 8, ["model-value", "unit", "disabled"])
|
|
924
924
|
]),
|
|
925
|
-
u.readonly ? T("", !0) : (
|
|
925
|
+
u.readonly ? T("", !0) : (y(), E("div", hn, [
|
|
926
926
|
h(a, {
|
|
927
927
|
disabled: u.disabled,
|
|
928
928
|
type: "button",
|
|
@@ -946,13 +946,13 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
946
946
|
]
|
|
947
947
|
}, null, 8, ["modelValue", "rules"])
|
|
948
948
|
]),
|
|
949
|
-
u.ableToApplyRules ? (
|
|
949
|
+
u.ableToApplyRules ? (y(), Y(Re, {
|
|
950
950
|
key: 0,
|
|
951
951
|
modelValue: n(i).rules,
|
|
952
952
|
"onUpdate:modelValue": o[1] || (o[1] = ($) => n(i).rules = $),
|
|
953
953
|
disabled: u.disabled
|
|
954
954
|
}, null, 8, ["modelValue", "disabled"])) : T("", !0),
|
|
955
|
-
u.ableToConfigureAlternative ? (
|
|
955
|
+
u.ableToConfigureAlternative ? (y(), Y(Se, {
|
|
956
956
|
key: 1,
|
|
957
957
|
modelValue: n(i).alternatives,
|
|
958
958
|
"onUpdate:modelValue": o[2] || (o[2] = ($) => n(i).alternatives = $),
|
|
@@ -968,7 +968,7 @@ exports.FfCalculator;
|
|
|
968
968
|
const In = { class: "flex flex-col gap-24" }, wn = {
|
|
969
969
|
key: 0,
|
|
970
970
|
class: "flex flex-col gap-16"
|
|
971
|
-
}, En = { class: "flex items-center" }, Vn = { class: "flex-1 fm-typo-en-title-sm-600" }, Sn = { class: "flex flex-col" },
|
|
971
|
+
}, En = { class: "flex items-center" }, Vn = { class: "flex-1 fm-typo-en-title-sm-600" }, Sn = { class: "flex flex-col" }, Cn = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, Bn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Fn = {
|
|
972
972
|
key: 0,
|
|
973
973
|
class: "w-[52px]"
|
|
974
974
|
}, Rn = {
|
|
@@ -995,7 +995,10 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
995
995
|
}, to = {
|
|
996
996
|
class: "flex items-center w-full",
|
|
997
997
|
style: { "min-height": "48px" }
|
|
998
|
-
}, no = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12 text-fm-color-typo-secondary line-clamp-1" }, oo = {
|
|
998
|
+
}, no = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12 text-fm-color-typo-secondary line-clamp-1" }, oo = {
|
|
999
|
+
key: 0,
|
|
1000
|
+
class: "w-[52px]"
|
|
1001
|
+
}, io = { class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400 px-12 pb-4" }, lo = /* @__PURE__ */ le({
|
|
999
1002
|
__name: "InventoryBindingFormV2",
|
|
1000
1003
|
props: {
|
|
1001
1004
|
id: {},
|
|
@@ -1015,7 +1018,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1015
1018
|
},
|
|
1016
1019
|
emits: ["update:modelValue", "click:pick-inventory-bindings"],
|
|
1017
1020
|
setup(m, { emit: d }) {
|
|
1018
|
-
const { t: l } = ie(), t = ne(), i =
|
|
1021
|
+
const { t: l } = ie(), t = ne(), i = A(() => t.recipeById), r = A(() => t.skuById), x = A(() => t.skuGroupById), u = m, o = d, s = A(() => kt({
|
|
1019
1022
|
parentId: u.id,
|
|
1020
1023
|
bindings: u.modelValue,
|
|
1021
1024
|
recipes: t.recipes.map((F) => F._id === u.id ? {
|
|
@@ -1029,24 +1032,24 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1029
1032
|
}
|
|
1030
1033
|
} : F),
|
|
1031
1034
|
skuGroups: t.skuGroups
|
|
1032
|
-
}).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), a =
|
|
1035
|
+
}).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), a = A(
|
|
1033
1036
|
() => new Set(s.value.map((g) => {
|
|
1034
|
-
var
|
|
1035
|
-
return (
|
|
1037
|
+
var B;
|
|
1038
|
+
return (B = g.bindingPaths[0]) == null ? void 0 : B.id;
|
|
1036
1039
|
}))
|
|
1037
|
-
), p =
|
|
1040
|
+
), p = A(() => u.modelValue.filter((g) => g.type === "RECIPE")), { promptIngredientsBinding: $, promptRecipesBinding: C, promptIngredientGroupsBinding: I } = Ht();
|
|
1038
1041
|
async function f() {
|
|
1039
1042
|
if (u.iframeMode) {
|
|
1040
1043
|
o("click:pick-inventory-bindings", "RECIPE");
|
|
1041
1044
|
return;
|
|
1042
1045
|
}
|
|
1043
|
-
|
|
1046
|
+
C(
|
|
1044
1047
|
u.modelValue,
|
|
1045
1048
|
(g) => o("update:modelValue", g),
|
|
1046
1049
|
u.id ? [u.id] : []
|
|
1047
1050
|
);
|
|
1048
1051
|
}
|
|
1049
|
-
const k =
|
|
1052
|
+
const k = A(() => u.modelValue.filter((g) => g.type === "SKU_GROUP"));
|
|
1050
1053
|
async function S() {
|
|
1051
1054
|
I(
|
|
1052
1055
|
u.modelValue,
|
|
@@ -1054,13 +1057,13 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1054
1057
|
u.id ? [u.id] : []
|
|
1055
1058
|
);
|
|
1056
1059
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const
|
|
1060
|
+
function b(g, B, F) {
|
|
1061
|
+
const R = +B;
|
|
1059
1062
|
let P = F;
|
|
1060
|
-
|
|
1063
|
+
B.length > 0 && isFinite(R) ? P = F.map((K) => (K.id !== g || (K.amount = Ke(R)), K)) : P = F.map((K) => (K.id !== g || (K.amount = { amount: 0, precision: 0 }), K)), o("update:modelValue", P);
|
|
1061
1064
|
}
|
|
1062
|
-
const e =
|
|
1063
|
-
async function
|
|
1065
|
+
const e = A(() => u.modelValue.filter((g) => g.type === "SKU") ?? []);
|
|
1066
|
+
async function V() {
|
|
1064
1067
|
if (u.iframeMode) {
|
|
1065
1068
|
o("click:pick-inventory-bindings", "SKU");
|
|
1066
1069
|
return;
|
|
@@ -1073,28 +1076,28 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1073
1076
|
);
|
|
1074
1077
|
}
|
|
1075
1078
|
function c(g) {
|
|
1076
|
-
const
|
|
1077
|
-
o("update:modelValue",
|
|
1079
|
+
const B = u.modelValue.map((F) => F.id === g.id ? g : F);
|
|
1080
|
+
o("update:modelValue", B);
|
|
1078
1081
|
}
|
|
1079
1082
|
function _(g) {
|
|
1080
|
-
const
|
|
1081
|
-
o("update:modelValue",
|
|
1083
|
+
const B = u.modelValue.filter((F) => F.id !== g);
|
|
1084
|
+
o("update:modelValue", B);
|
|
1082
1085
|
}
|
|
1083
1086
|
function N(g) {
|
|
1084
|
-
var F,
|
|
1087
|
+
var F, R;
|
|
1085
1088
|
if (g.type !== be.enum.SKU)
|
|
1086
1089
|
throw new Error("Non-SKU binding does not have unit");
|
|
1087
1090
|
if (!((F = r.value[g.id]) == null ? void 0 : F.unit))
|
|
1088
1091
|
throw new Error(`Cannot find ingredient: ${g.id}`);
|
|
1089
|
-
return (
|
|
1092
|
+
return (R = r.value[g.id]) == null ? void 0 : R.unit;
|
|
1090
1093
|
}
|
|
1091
1094
|
function z(g) {
|
|
1092
1095
|
return !r.value[g.id];
|
|
1093
1096
|
}
|
|
1094
|
-
return (g,
|
|
1097
|
+
return (g, B) => {
|
|
1095
1098
|
var H, ee, O;
|
|
1096
|
-
const F = G("FmFormGroup"),
|
|
1097
|
-
return
|
|
1099
|
+
const F = G("FmFormGroup"), R = G("FmButton"), P = G("FmIcon"), K = G("FmTextField");
|
|
1100
|
+
return y(), E("div", In, [
|
|
1098
1101
|
h(F, {
|
|
1099
1102
|
disabled: g.disabled,
|
|
1100
1103
|
"model-value": g.modelValue,
|
|
@@ -1103,15 +1106,15 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1103
1106
|
() => s.value.length ? "There is a binding error in your configuration" : !0
|
|
1104
1107
|
]
|
|
1105
1108
|
}, {
|
|
1106
|
-
label: J(() =>
|
|
1109
|
+
label: J(() => B[4] || (B[4] = [
|
|
1107
1110
|
v("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
|
|
1108
1111
|
])),
|
|
1109
1112
|
_: 1
|
|
1110
1113
|
}, 8, ["disabled", "model-value", "rules"]),
|
|
1111
|
-
((H = g.recipeBindingConfig) == null ? void 0 : H.enabled) !== !1 ? (
|
|
1114
|
+
((H = g.recipeBindingConfig) == null ? void 0 : H.enabled) !== !1 ? (y(), E("div", wn, [
|
|
1112
1115
|
v("div", En, [
|
|
1113
1116
|
v("div", Vn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
|
|
1114
|
-
g.readonly ? T("", !0) : (
|
|
1117
|
+
g.readonly ? T("", !0) : (y(), Y(R, {
|
|
1115
1118
|
key: 0,
|
|
1116
1119
|
variant: "secondary",
|
|
1117
1120
|
"text-color": "primary",
|
|
@@ -1122,31 +1125,31 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1122
1125
|
}, null, 8, ["label"]))
|
|
1123
1126
|
]),
|
|
1124
1127
|
v("div", Sn, [
|
|
1125
|
-
v("div",
|
|
1126
|
-
v("div",
|
|
1127
|
-
|
|
1128
|
-
g.recipeBindingConfig.ableToApplyRules ? (
|
|
1129
|
-
g.readonly ? T("", !0) : (
|
|
1128
|
+
v("div", Cn, [
|
|
1129
|
+
v("div", Bn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
|
|
1130
|
+
B[5] || (B[5] = v("div", { class: "w-[200px]" }, null, -1)),
|
|
1131
|
+
g.recipeBindingConfig.ableToApplyRules ? (y(), E("div", Fn)) : T("", !0),
|
|
1132
|
+
g.readonly ? T("", !0) : (y(), E("div", Rn))
|
|
1130
1133
|
]),
|
|
1131
|
-
(
|
|
1134
|
+
(y(!0), E(X, null, me(p.value, (M) => {
|
|
1132
1135
|
var L;
|
|
1133
|
-
return
|
|
1134
|
-
key:
|
|
1135
|
-
"model-value":
|
|
1136
|
-
"display-name": (L = i.value[
|
|
1137
|
-
"show-error": a.value.has(
|
|
1136
|
+
return y(), Y(un, {
|
|
1137
|
+
key: M.id,
|
|
1138
|
+
"model-value": M,
|
|
1139
|
+
"display-name": (L = i.value[M.id]) == null ? void 0 : L.name,
|
|
1140
|
+
"show-error": a.value.has(M.id),
|
|
1138
1141
|
readonly: g.readonly,
|
|
1139
1142
|
disabled: g.disabled,
|
|
1140
|
-
"onUpdate:modelValue":
|
|
1141
|
-
onDelete:
|
|
1143
|
+
"onUpdate:modelValue": B[0] || (B[0] = (q) => c(q)),
|
|
1144
|
+
onDelete: B[1] || (B[1] = (q) => _(q))
|
|
1142
1145
|
}, null, 8, ["model-value", "display-name", "show-error", "readonly", "disabled"]);
|
|
1143
1146
|
}), 128))
|
|
1144
1147
|
])
|
|
1145
1148
|
])) : T("", !0),
|
|
1146
|
-
g.enableIngredientGroup ? (
|
|
1149
|
+
g.enableIngredientGroup ? (y(), E("div", An, [
|
|
1147
1150
|
v("div", Tn, [
|
|
1148
1151
|
v("div", Un, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
|
|
1149
|
-
g.readonly ? T("", !0) : (
|
|
1152
|
+
g.readonly ? T("", !0) : (y(), Y(R, {
|
|
1150
1153
|
key: 0,
|
|
1151
1154
|
variant: "secondary",
|
|
1152
1155
|
"text-color": "primary",
|
|
@@ -1159,20 +1162,20 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1159
1162
|
v("div", Pn, [
|
|
1160
1163
|
v("div", Mn, [
|
|
1161
1164
|
v("div", Dn, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
|
|
1162
|
-
|
|
1163
|
-
|
|
1165
|
+
B[6] || (B[6] = v("div", { class: "w-[200px]" }, null, -1)),
|
|
1166
|
+
B[7] || (B[7] = v("div", { class: "w-[52px]" }, null, -1))
|
|
1164
1167
|
]),
|
|
1165
|
-
(
|
|
1166
|
-
key:
|
|
1168
|
+
(y(!0), E(X, null, me(k.value, (M) => (y(), Y(F, {
|
|
1169
|
+
key: M.id,
|
|
1167
1170
|
disabled: g.disabled,
|
|
1168
|
-
modelValue: +n(Q)(
|
|
1171
|
+
modelValue: +n(Q)(M.amount ?? { amount: 1, precision: 0 }),
|
|
1169
1172
|
rules: [n(it)(0), n(qe)(0)]
|
|
1170
1173
|
}, {
|
|
1171
1174
|
default: J(({ invalid: L }) => {
|
|
1172
1175
|
var q;
|
|
1173
1176
|
return [
|
|
1174
1177
|
v("div", Gn, [
|
|
1175
|
-
a.value.has(
|
|
1178
|
+
a.value.has(M.id) ? (y(), E("div", Nn, [
|
|
1176
1179
|
h(P, {
|
|
1177
1180
|
name: "error",
|
|
1178
1181
|
color: "system-error-300",
|
|
@@ -1182,25 +1185,25 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1182
1185
|
])) : T("", !0),
|
|
1183
1186
|
v("div", zn, [
|
|
1184
1187
|
v("div", On, [
|
|
1185
|
-
v("div", Ln, U((q = x.value[
|
|
1188
|
+
v("div", Ln, U((q = x.value[M.id]) == null ? void 0 : q.name), 1)
|
|
1186
1189
|
]),
|
|
1187
1190
|
v("div", jn, [
|
|
1188
1191
|
h(K, {
|
|
1189
1192
|
class: "w-full",
|
|
1190
1193
|
disabled: g.disabled,
|
|
1191
|
-
modelValue: +n(Q)(
|
|
1192
|
-
"onUpdate:modelValue": (oe) =>
|
|
1194
|
+
modelValue: +n(Q)(M.amount ?? { amount: 1, precision: 0 }),
|
|
1195
|
+
"onUpdate:modelValue": (oe) => b(M.id, oe, g.modelValue),
|
|
1193
1196
|
invalid: L
|
|
1194
1197
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
|
|
1195
1198
|
]),
|
|
1196
|
-
g.readonly ? T("", !0) : (
|
|
1197
|
-
h(
|
|
1199
|
+
g.readonly ? T("", !0) : (y(), E("div", Kn, [
|
|
1200
|
+
h(R, {
|
|
1198
1201
|
disabled: g.disabled,
|
|
1199
1202
|
type: "button",
|
|
1200
1203
|
variant: "plain",
|
|
1201
1204
|
icon: "delete",
|
|
1202
1205
|
"icon-color": "#000000",
|
|
1203
|
-
onClick: (oe) => _(
|
|
1206
|
+
onClick: (oe) => _(M.id)
|
|
1204
1207
|
}, null, 8, ["disabled", "onClick"])
|
|
1205
1208
|
]))
|
|
1206
1209
|
])
|
|
@@ -1214,33 +1217,42 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1214
1217
|
v("div", qn, [
|
|
1215
1218
|
v("div", Wn, [
|
|
1216
1219
|
v("div", Yn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
|
|
1217
|
-
g.readonly ? T("", !0) : (
|
|
1220
|
+
g.readonly ? T("", !0) : (y(), Y(R, {
|
|
1218
1221
|
key: 0,
|
|
1219
1222
|
variant: "secondary",
|
|
1220
1223
|
"text-color": "primary",
|
|
1221
1224
|
"border-color": "primary",
|
|
1222
1225
|
label: n(l)("inventory.inventoryBindings.linkIngredient"),
|
|
1223
1226
|
"prepend-icon": "link",
|
|
1224
|
-
onClick:
|
|
1227
|
+
onClick: V
|
|
1225
1228
|
}, null, 8, ["label"]))
|
|
1226
1229
|
]),
|
|
1227
1230
|
v("div", Jn, [
|
|
1228
1231
|
v("div", Hn, [
|
|
1229
1232
|
v("div", Qn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
|
|
1230
1233
|
v("div", Xn, U(n(l)("inventory.inventoryBindings.amount")), 1),
|
|
1231
|
-
|
|
1232
|
-
(ee = g.skuBindingConfig) != null && ee.ableToApplyRules || (O = g.skuBindingConfig) != null && O.ableToConfigureAlternative ? (
|
|
1234
|
+
B[8] || (B[8] = v("div", { class: "w-[52px]" }, null, -1)),
|
|
1235
|
+
(ee = g.skuBindingConfig) != null && ee.ableToApplyRules || (O = g.skuBindingConfig) != null && O.ableToConfigureAlternative ? (y(), E("div", Zn)) : T("", !0)
|
|
1233
1236
|
]),
|
|
1234
|
-
(
|
|
1237
|
+
(y(!0), E(X, null, me(e.value, (M) => {
|
|
1235
1238
|
var L, q, oe;
|
|
1236
|
-
return
|
|
1237
|
-
key:
|
|
1239
|
+
return y(), E(X, {
|
|
1240
|
+
key: M.id
|
|
1238
1241
|
}, [
|
|
1239
|
-
z(
|
|
1242
|
+
z(M) ? (y(), E("div", eo, [
|
|
1240
1243
|
v("div", to, [
|
|
1241
|
-
v("div", no, U(
|
|
1244
|
+
v("div", no, U(M.id), 1),
|
|
1245
|
+
g.readonly ? T("", !0) : (y(), E("div", oo, [
|
|
1246
|
+
h(R, {
|
|
1247
|
+
disabled: g.disabled,
|
|
1248
|
+
type: "button",
|
|
1249
|
+
variant: "tertiary",
|
|
1250
|
+
icon: "delete",
|
|
1251
|
+
onClick: () => _(M.id)
|
|
1252
|
+
}, null, 8, ["disabled", "onClick"])
|
|
1253
|
+
]))
|
|
1242
1254
|
]),
|
|
1243
|
-
v("div",
|
|
1255
|
+
v("div", io, [
|
|
1244
1256
|
h(P, {
|
|
1245
1257
|
name: "error",
|
|
1246
1258
|
color: "system-error-300",
|
|
@@ -1248,18 +1260,18 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1248
1260
|
}),
|
|
1249
1261
|
v("div", null, U(n(l)("inventory.inventoryBindings.missingIngredient")), 1)
|
|
1250
1262
|
])
|
|
1251
|
-
])) : (
|
|
1263
|
+
])) : (y(), Y($n, {
|
|
1252
1264
|
key: 1,
|
|
1253
|
-
"model-value":
|
|
1254
|
-
"display-name": (L = r.value[
|
|
1255
|
-
unit: N(
|
|
1256
|
-
"show-error": a.value.has(
|
|
1265
|
+
"model-value": M,
|
|
1266
|
+
"display-name": (L = r.value[M.id]) == null ? void 0 : L.name,
|
|
1267
|
+
unit: N(M),
|
|
1268
|
+
"show-error": a.value.has(M.id),
|
|
1257
1269
|
"able-to-apply-rules": ((q = g.skuBindingConfig) == null ? void 0 : q.ableToApplyRules) === !0,
|
|
1258
1270
|
"able-to-configure-alternative": ((oe = g.skuBindingConfig) == null ? void 0 : oe.ableToConfigureAlternative) === !0,
|
|
1259
1271
|
readonly: g.readonly,
|
|
1260
1272
|
disabled: g.disabled,
|
|
1261
|
-
"onUpdate:modelValue":
|
|
1262
|
-
onDelete:
|
|
1273
|
+
"onUpdate:modelValue": B[2] || (B[2] = (Z) => c(Z)),
|
|
1274
|
+
onDelete: B[3] || (B[3] = (Z) => _(Z))
|
|
1263
1275
|
}, null, 8, ["model-value", "display-name", "unit", "show-error", "able-to-apply-rules", "able-to-configure-alternative", "readonly", "disabled"]))
|
|
1264
1276
|
], 64);
|
|
1265
1277
|
}), 128))
|
|
@@ -1268,16 +1280,16 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1268
1280
|
]);
|
|
1269
1281
|
};
|
|
1270
1282
|
}
|
|
1271
|
-
}),
|
|
1283
|
+
}), ro = { class: "flex flex-col gap-40" }, ao = {
|
|
1272
1284
|
key: 0,
|
|
1273
1285
|
class: "flex flex-col gap-16"
|
|
1274
|
-
},
|
|
1286
|
+
}, so = {
|
|
1275
1287
|
key: 0,
|
|
1276
1288
|
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"
|
|
1277
|
-
},
|
|
1289
|
+
}, uo = {
|
|
1278
1290
|
key: 0,
|
|
1279
1291
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
1280
|
-
},
|
|
1292
|
+
}, co = { key: 1 }, po = { class: "mt-32" }, mo = /* @__PURE__ */ le({
|
|
1281
1293
|
__name: "RecipeForm",
|
|
1282
1294
|
props: {
|
|
1283
1295
|
mode: {},
|
|
@@ -1286,7 +1298,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1286
1298
|
},
|
|
1287
1299
|
emits: ["update:modelValue", "click:submit"],
|
|
1288
1300
|
setup(m, { expose: d, emit: l }) {
|
|
1289
|
-
const t = m, i = l, r = We(), { t: x } = ie(), u =
|
|
1301
|
+
const t = m, i = l, r = We(), { t: x } = ie(), u = A({
|
|
1290
1302
|
get() {
|
|
1291
1303
|
var c;
|
|
1292
1304
|
return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
|
|
@@ -1295,7 +1307,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1295
1307
|
const _ = t.modelValue ?? {};
|
|
1296
1308
|
_.name = c, i("update:modelValue", _);
|
|
1297
1309
|
}
|
|
1298
|
-
}), o =
|
|
1310
|
+
}), o = A({
|
|
1299
1311
|
get() {
|
|
1300
1312
|
var c;
|
|
1301
1313
|
return ((c = t.modelValue) == null ? void 0 : c.contains) ?? [];
|
|
@@ -1304,7 +1316,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1304
1316
|
const _ = t.modelValue ?? {};
|
|
1305
1317
|
_.contains = c, i("update:modelValue", _);
|
|
1306
1318
|
}
|
|
1307
|
-
}), s =
|
|
1319
|
+
}), s = A({
|
|
1308
1320
|
get() {
|
|
1309
1321
|
var c;
|
|
1310
1322
|
return ((c = t.modelValue) == null ? void 0 : c.customAttributes) ?? {};
|
|
@@ -1315,7 +1327,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1315
1327
|
} : {};
|
|
1316
1328
|
_.customAttributes = c, i("update:modelValue", _);
|
|
1317
1329
|
}
|
|
1318
|
-
}), a =
|
|
1330
|
+
}), a = A({
|
|
1319
1331
|
get() {
|
|
1320
1332
|
var c;
|
|
1321
1333
|
return ((c = t.modelValue) == null ? void 0 : c.version) ?? null;
|
|
@@ -1324,7 +1336,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1324
1336
|
const _ = t.modelValue ? { ...t.modelValue } : {};
|
|
1325
1337
|
_.version = c, i("update:modelValue", _);
|
|
1326
1338
|
}
|
|
1327
|
-
}), p =
|
|
1339
|
+
}), p = A({
|
|
1328
1340
|
get() {
|
|
1329
1341
|
return a.value === "v2";
|
|
1330
1342
|
},
|
|
@@ -1335,44 +1347,44 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1335
1347
|
function $() {
|
|
1336
1348
|
i("click:submit");
|
|
1337
1349
|
}
|
|
1338
|
-
const
|
|
1350
|
+
const C = W();
|
|
1339
1351
|
d({
|
|
1340
1352
|
validateInputs: () => {
|
|
1341
1353
|
var c, _;
|
|
1342
|
-
(_ = (c =
|
|
1354
|
+
(_ = (c = C.value) == null ? void 0 : c.validateInputs) == null || _.call(c);
|
|
1343
1355
|
},
|
|
1344
1356
|
resetInputsValidation: () => {
|
|
1345
1357
|
var c, _;
|
|
1346
|
-
(_ = (c =
|
|
1358
|
+
(_ = (c = C.value) == null ? void 0 : c.resetInputsValidation) == null || _.call(c);
|
|
1347
1359
|
},
|
|
1348
1360
|
resetInputs: () => {
|
|
1349
1361
|
var c, _;
|
|
1350
|
-
(_ = (c =
|
|
1362
|
+
(_ = (c = C.value) == null ? void 0 : c.resetInputs) == null || _.call(c);
|
|
1351
1363
|
}
|
|
1352
1364
|
});
|
|
1353
1365
|
const I = ne(), f = W([]), k = W(!1), S = W(!1);
|
|
1354
1366
|
ue(k, async (c) => {
|
|
1355
|
-
|
|
1367
|
+
b(c);
|
|
1356
1368
|
});
|
|
1357
|
-
async function
|
|
1369
|
+
async function b(c) {
|
|
1358
1370
|
var _, N;
|
|
1359
1371
|
c && !S.value && ((_ = t.modelValue) != null && _._id) && (S.value = !0, f.value = await I.getAffectedMenu((N = t.modelValue) == null ? void 0 : N._id).delayed(500), S.value = !1);
|
|
1360
1372
|
}
|
|
1361
|
-
const e =
|
|
1373
|
+
const e = A(
|
|
1362
1374
|
() => I.recipes.map((c) => ({ label: c.name, value: c.name }))
|
|
1363
|
-
),
|
|
1375
|
+
), V = A(() => {
|
|
1364
1376
|
var c;
|
|
1365
1377
|
return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
|
|
1366
1378
|
});
|
|
1367
1379
|
return (c, _) => {
|
|
1368
|
-
const N = G("FmTextField"), z = G("FmSwitch"), g = G("FmCard"),
|
|
1369
|
-
return
|
|
1380
|
+
const N = G("FmTextField"), z = G("FmSwitch"), g = G("FmCard"), B = G("FmSpacer"), F = G("FmCircularProgress"), R = G("FmForm");
|
|
1381
|
+
return y(), Y(R, {
|
|
1370
1382
|
ref_key: "formRef",
|
|
1371
|
-
ref:
|
|
1383
|
+
ref: C,
|
|
1372
1384
|
onValidationSuccess: $
|
|
1373
1385
|
}, {
|
|
1374
1386
|
default: J(() => [
|
|
1375
|
-
v("div",
|
|
1387
|
+
v("div", ro, [
|
|
1376
1388
|
h(N, {
|
|
1377
1389
|
disabled: c.disabled,
|
|
1378
1390
|
label: n(x)("inventory.recipe.name"),
|
|
@@ -1380,11 +1392,11 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1380
1392
|
"onUpdate:modelValue": _[0] || (_[0] = (P) => u.value = P),
|
|
1381
1393
|
rules: [
|
|
1382
1394
|
n(Rt)(),
|
|
1383
|
-
n(lt)(e.value,
|
|
1395
|
+
n(lt)(e.value, V.value, (P) => `[${P.value}] already exists`)
|
|
1384
1396
|
],
|
|
1385
1397
|
"label-mark": "required"
|
|
1386
1398
|
}, null, 8, ["disabled", "label", "model-value", "rules"]),
|
|
1387
|
-
n(r).enableRecipeV2 ? (
|
|
1399
|
+
n(r).enableRecipeV2 ? (y(), E("div", ao, [
|
|
1388
1400
|
h(z, {
|
|
1389
1401
|
modelValue: p.value,
|
|
1390
1402
|
"onUpdate:modelValue": _[1] || (_[1] = (P) => p.value = P),
|
|
@@ -1402,7 +1414,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1402
1414
|
default: J(() => {
|
|
1403
1415
|
var P, K;
|
|
1404
1416
|
return [
|
|
1405
|
-
n(r).enableRecipeV2 ? (
|
|
1417
|
+
n(r).enableRecipeV2 ? (y(), Y(lo, {
|
|
1406
1418
|
key: 0,
|
|
1407
1419
|
id: (P = c.modelValue) == null ? void 0 : P._id,
|
|
1408
1420
|
disabled: c.disabled,
|
|
@@ -1414,7 +1426,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1414
1426
|
"sku-binding-config": {
|
|
1415
1427
|
ableToConfigureAlternative: p.value
|
|
1416
1428
|
}
|
|
1417
|
-
}, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (
|
|
1429
|
+
}, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (y(), Y(At, {
|
|
1418
1430
|
key: 1,
|
|
1419
1431
|
id: (K = c.modelValue) == null ? void 0 : K._id,
|
|
1420
1432
|
disabled: c.disabled,
|
|
@@ -1428,7 +1440,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1428
1440
|
_: 1
|
|
1429
1441
|
})
|
|
1430
1442
|
]),
|
|
1431
|
-
c.mode !== n(se).CREATE ? (
|
|
1443
|
+
c.mode !== n(se).CREATE ? (y(), E("div", so, [
|
|
1432
1444
|
h(z, {
|
|
1433
1445
|
label: "Show binded items",
|
|
1434
1446
|
modelValue: k.value,
|
|
@@ -1436,21 +1448,21 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1436
1448
|
"label-placement": "right",
|
|
1437
1449
|
disabled: S.value
|
|
1438
1450
|
}, null, 8, ["modelValue", "disabled"]),
|
|
1439
|
-
S.value ? (
|
|
1440
|
-
h(
|
|
1451
|
+
S.value ? (y(), E("div", uo, [
|
|
1452
|
+
h(B),
|
|
1441
1453
|
v("div", null, [
|
|
1442
1454
|
h(F, { size: "xl" })
|
|
1443
1455
|
]),
|
|
1444
1456
|
_[6] || (_[6] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
1445
|
-
h(
|
|
1446
|
-
])) : k.value && f.value.length ? (
|
|
1457
|
+
h(B)
|
|
1458
|
+
])) : k.value && f.value.length ? (y(), E("div", co, [
|
|
1447
1459
|
h(nt, {
|
|
1448
1460
|
name: "Menu",
|
|
1449
1461
|
bindings: f.value
|
|
1450
1462
|
}, null, 8, ["bindings"])
|
|
1451
1463
|
])) : T("", !0)
|
|
1452
1464
|
])) : T("", !0),
|
|
1453
|
-
v("div",
|
|
1465
|
+
v("div", po, [
|
|
1454
1466
|
h(Ot, {
|
|
1455
1467
|
entity: "inventoryRecipe",
|
|
1456
1468
|
modelValue: s.value,
|
|
@@ -1462,7 +1474,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1462
1474
|
}, 512);
|
|
1463
1475
|
};
|
|
1464
1476
|
}
|
|
1465
|
-
}),
|
|
1477
|
+
}), fo = { class: "flex gap-4" }, vo = /* @__PURE__ */ le({
|
|
1466
1478
|
__name: "RecipeDialog",
|
|
1467
1479
|
props: {
|
|
1468
1480
|
show: { type: Boolean },
|
|
@@ -1471,7 +1483,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1471
1483
|
},
|
|
1472
1484
|
emits: ["update:show"],
|
|
1473
1485
|
setup(m) {
|
|
1474
|
-
const d = m, l = ne(), t = je(), { t: i } = ie(), r = Ge(d, "show"), x = Ge(d, "recipe"), u =
|
|
1486
|
+
const d = m, l = ne(), t = je(), { t: i } = ie(), r = Ge(d, "show"), x = Ge(d, "recipe"), u = A(() => {
|
|
1475
1487
|
switch (d.mode) {
|
|
1476
1488
|
case se.READ:
|
|
1477
1489
|
return "";
|
|
@@ -1481,7 +1493,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1481
1493
|
return i("inventory.recipe.create.title");
|
|
1482
1494
|
}
|
|
1483
1495
|
return "";
|
|
1484
|
-
}), o =
|
|
1496
|
+
}), o = A(() => {
|
|
1485
1497
|
switch (d.mode) {
|
|
1486
1498
|
case se.READ:
|
|
1487
1499
|
return "";
|
|
@@ -1529,7 +1541,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1529
1541
|
a.value = !1;
|
|
1530
1542
|
}
|
|
1531
1543
|
}
|
|
1532
|
-
function
|
|
1544
|
+
function C() {
|
|
1533
1545
|
var f, k;
|
|
1534
1546
|
(k = (f = s.value) == null ? void 0 : f.validateInputs) == null || k.call(f);
|
|
1535
1547
|
}
|
|
@@ -1544,8 +1556,8 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1544
1556
|
}
|
|
1545
1557
|
}
|
|
1546
1558
|
return (f, k) => {
|
|
1547
|
-
const S = G("FmButton"),
|
|
1548
|
-
return
|
|
1559
|
+
const S = G("FmButton"), b = G("FmSideSheet");
|
|
1560
|
+
return y(), Y(b, {
|
|
1549
1561
|
"model-value": n(r),
|
|
1550
1562
|
"onUpdate:modelValue": k[3] || (k[3] = (e) => De(r) ? r.value = e : null),
|
|
1551
1563
|
header: u.value,
|
|
@@ -1554,11 +1566,11 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1554
1566
|
"max-width": 800
|
|
1555
1567
|
}, {
|
|
1556
1568
|
"side-sheet-footer": J(() => [
|
|
1557
|
-
v("div",
|
|
1569
|
+
v("div", fo, [
|
|
1558
1570
|
h(S, {
|
|
1559
1571
|
loading: a.value,
|
|
1560
1572
|
label: o.value,
|
|
1561
|
-
onClick:
|
|
1573
|
+
onClick: C
|
|
1562
1574
|
}, null, 8, ["loading", "label"]),
|
|
1563
1575
|
h(S, {
|
|
1564
1576
|
disabled: a.value,
|
|
@@ -1569,7 +1581,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1569
1581
|
])
|
|
1570
1582
|
]),
|
|
1571
1583
|
default: J(() => [
|
|
1572
|
-
h(
|
|
1584
|
+
h(mo, {
|
|
1573
1585
|
class: "w-full",
|
|
1574
1586
|
ref_key: "hasValidationExpose",
|
|
1575
1587
|
ref: s,
|
|
@@ -1600,7 +1612,7 @@ function ke(m, d, l) {
|
|
|
1600
1612
|
}
|
|
1601
1613
|
return t;
|
|
1602
1614
|
}
|
|
1603
|
-
function
|
|
1615
|
+
function yo(m, d) {
|
|
1604
1616
|
return he.equal(m, d);
|
|
1605
1617
|
}
|
|
1606
1618
|
function Ae(m) {
|
|
@@ -1622,14 +1634,14 @@ function Xe(m) {
|
|
|
1622
1634
|
}
|
|
1623
1635
|
function Me(m, d) {
|
|
1624
1636
|
var i, r;
|
|
1625
|
-
if (m.type !== d.type || m.id !== d.id || !
|
|
1637
|
+
if (m.type !== d.type || m.id !== d.id || !yo(Xe(m), Xe(d))) return !1;
|
|
1626
1638
|
const l = ((i = m.measurement) == null ? void 0 : i.id) ?? null, t = ((r = d.measurement) == null ? void 0 : r.id) ?? null;
|
|
1627
1639
|
return !(l !== t || Ae(m.rules) !== Ae(d.rules) || Te(m.alternatives) !== Te(d.alternatives));
|
|
1628
1640
|
}
|
|
1629
1641
|
function Ze(m, d) {
|
|
1630
1642
|
return m.type === d.type && m.id === d.id;
|
|
1631
1643
|
}
|
|
1632
|
-
function
|
|
1644
|
+
function bo(m, d) {
|
|
1633
1645
|
const l = [];
|
|
1634
1646
|
let t = [...m.contains];
|
|
1635
1647
|
for (const r of d)
|
|
@@ -1749,17 +1761,17 @@ function et(m) {
|
|
|
1749
1761
|
return m.target.id !== "";
|
|
1750
1762
|
}
|
|
1751
1763
|
}
|
|
1752
|
-
function
|
|
1764
|
+
function go(m) {
|
|
1753
1765
|
if (m.length === 0) return "no-applicable-changes";
|
|
1754
1766
|
let d = 0, l = 0, t = 0, i = 0;
|
|
1755
1767
|
for (const r of m)
|
|
1756
1768
|
r.outcome === "applied" ? d++ : r.outcome === "blocked" ? l++ : r.outcome === "ignored" ? t++ : r.outcome === "already-satisfied" && i++;
|
|
1757
1769
|
return l > 0 && d === 0 ? "blocked" : i === m.length ? "already-satisfied" : d > 0 && (t > 0 || l > 0) ? "partially-ignored" : d > 0 ? "will-update" : "no-applicable-changes";
|
|
1758
1770
|
}
|
|
1759
|
-
let
|
|
1760
|
-
function
|
|
1771
|
+
let _o = 0;
|
|
1772
|
+
function ko(m = null) {
|
|
1761
1773
|
return {
|
|
1762
|
-
id: String(++
|
|
1774
|
+
id: String(++_o),
|
|
1763
1775
|
type: m,
|
|
1764
1776
|
itemId: null,
|
|
1765
1777
|
amountModel: ye()
|
|
@@ -1778,21 +1790,21 @@ function ut(m, d, l, t) {
|
|
|
1778
1790
|
return !1;
|
|
1779
1791
|
}
|
|
1780
1792
|
const ge = ot("recipeBulkEditor", function() {
|
|
1781
|
-
const d = ne(), l = je(), { t } = ie(), i = W(!1), r = W(1), x = W(null), u = W(/* @__PURE__ */ new Set()), o = W([]), s = W({}), a = W(!1), p = W(/* @__PURE__ */ new Map()), $ = W(""),
|
|
1793
|
+
const d = ne(), l = je(), { t } = ie(), i = W(!1), r = W(1), x = W(null), u = W(/* @__PURE__ */ new Set()), o = W([]), s = W({}), a = W(!1), p = W(/* @__PURE__ */ new Map()), $ = W(""), C = W([]), I = A(() => {
|
|
1782
1794
|
let O = d.recipes;
|
|
1783
|
-
const
|
|
1784
|
-
if (
|
|
1785
|
-
const L =
|
|
1795
|
+
const M = x.value;
|
|
1796
|
+
if (M != null && M.nameSearch) {
|
|
1797
|
+
const L = M.nameSearch.trim().toLowerCase();
|
|
1786
1798
|
L && (O = O.filter((q) => q.name.toLowerCase().includes(L)));
|
|
1787
1799
|
}
|
|
1788
|
-
if (
|
|
1800
|
+
if (M != null && M.filters && M.filters.length > 0) {
|
|
1789
1801
|
const L = /* @__PURE__ */ new Map();
|
|
1790
1802
|
for (const q of O)
|
|
1791
1803
|
L.set(
|
|
1792
1804
|
q._id,
|
|
1793
1805
|
ke(q.contains, /* @__PURE__ */ new Set([q._id]), d.recipeById)
|
|
1794
1806
|
);
|
|
1795
|
-
for (const q of
|
|
1807
|
+
for (const q of M.filters)
|
|
1796
1808
|
if (q.type === "ingredient") {
|
|
1797
1809
|
const { itemId: oe, amount: Z, measurementId: ae } = q;
|
|
1798
1810
|
O = O.filter((fe) => (L.get(fe._id) ?? []).some((re) => {
|
|
@@ -1816,9 +1828,9 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1816
1828
|
}
|
|
1817
1829
|
}
|
|
1818
1830
|
return O;
|
|
1819
|
-
}), f =
|
|
1831
|
+
}), f = A(
|
|
1820
1832
|
() => I.value.filter((O) => !u.value.has(O._id))
|
|
1821
|
-
), k =
|
|
1833
|
+
), k = A(() => f.value.length > 0), S = A(() => {
|
|
1822
1834
|
const O = o.value.filter(et);
|
|
1823
1835
|
if (O.length === 0) {
|
|
1824
1836
|
const L = {};
|
|
@@ -1834,13 +1846,13 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1834
1846
|
};
|
|
1835
1847
|
return L;
|
|
1836
1848
|
}
|
|
1837
|
-
const
|
|
1849
|
+
const M = {};
|
|
1838
1850
|
for (const L of f.value) {
|
|
1839
|
-
const q = JSON.parse(JSON.stringify(L)), { projected: oe, results: Z } =
|
|
1851
|
+
const q = JSON.parse(JSON.stringify(L)), { projected: oe, results: Z } = bo(q, O), ae = go(Z);
|
|
1840
1852
|
let fe = 0, xe = 0, re = 0, ve = 0;
|
|
1841
1853
|
for (const ce of Z)
|
|
1842
1854
|
ce.outcome === "applied" ? fe++ : ce.outcome === "ignored" ? xe++ : ce.outcome === "blocked" ? re++ : ce.outcome === "already-satisfied" && ve++;
|
|
1843
|
-
|
|
1855
|
+
M[L._id] = {
|
|
1844
1856
|
recipeId: L._id,
|
|
1845
1857
|
recipeName: L.name,
|
|
1846
1858
|
original: q,
|
|
@@ -1850,25 +1862,25 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1850
1862
|
counts: { applied: fe, ignored: xe, blocked: re, satisfied: ve }
|
|
1851
1863
|
};
|
|
1852
1864
|
}
|
|
1853
|
-
return
|
|
1854
|
-
}),
|
|
1865
|
+
return M;
|
|
1866
|
+
}), b = A(() => o.value.some(et) ? Object.values(S.value).some(
|
|
1855
1867
|
(O) => O.status === "will-update" || O.status === "partially-ignored"
|
|
1856
1868
|
) : !1);
|
|
1857
1869
|
function e() {
|
|
1858
1870
|
c(), i.value = !0;
|
|
1859
1871
|
}
|
|
1860
|
-
function
|
|
1872
|
+
function V() {
|
|
1861
1873
|
i.value = !1;
|
|
1862
1874
|
}
|
|
1863
1875
|
function c() {
|
|
1864
|
-
r.value = 1, x.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, a.value = !1, p.value = /* @__PURE__ */ new Map(), $.value = "",
|
|
1876
|
+
r.value = 1, x.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, a.value = !1, p.value = /* @__PURE__ */ new Map(), $.value = "", C.value = [];
|
|
1865
1877
|
}
|
|
1866
1878
|
function _(O) {
|
|
1867
1879
|
x.value = O;
|
|
1868
1880
|
}
|
|
1869
1881
|
function N(O) {
|
|
1870
|
-
const
|
|
1871
|
-
|
|
1882
|
+
const M = new Set(u.value);
|
|
1883
|
+
M.add(O), u.value = M;
|
|
1872
1884
|
}
|
|
1873
1885
|
function z() {
|
|
1874
1886
|
u.value = /* @__PURE__ */ new Set();
|
|
@@ -1876,16 +1888,16 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1876
1888
|
function g(O) {
|
|
1877
1889
|
o.value = [...o.value, O];
|
|
1878
1890
|
}
|
|
1879
|
-
function
|
|
1891
|
+
function B(O, M) {
|
|
1880
1892
|
const L = [...o.value];
|
|
1881
|
-
L[O] =
|
|
1893
|
+
L[O] = M, o.value = L;
|
|
1882
1894
|
}
|
|
1883
1895
|
function F(O) {
|
|
1884
|
-
o.value = o.value.filter((
|
|
1896
|
+
o.value = o.value.filter((M, L) => L !== O);
|
|
1885
1897
|
}
|
|
1886
|
-
function
|
|
1898
|
+
function R(O, M) {
|
|
1887
1899
|
const L = [...o.value], [q] = L.splice(O, 1);
|
|
1888
|
-
L.splice(
|
|
1900
|
+
L.splice(M, 0, q), o.value = L;
|
|
1889
1901
|
}
|
|
1890
1902
|
function P() {
|
|
1891
1903
|
s.value = { ...S.value }, r.value = 3;
|
|
@@ -1902,10 +1914,10 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1902
1914
|
if (!a.value) {
|
|
1903
1915
|
a.value = !0, p.value = /* @__PURE__ */ new Map();
|
|
1904
1916
|
try {
|
|
1905
|
-
const O = H(),
|
|
1917
|
+
const O = H(), M = await d.importRecipes({
|
|
1906
1918
|
create: [],
|
|
1907
1919
|
update: O
|
|
1908
|
-
}), L = (
|
|
1920
|
+
}), L = (M == null ? void 0 : M.errors) ?? [];
|
|
1909
1921
|
if (L.length > 0) {
|
|
1910
1922
|
const q = /* @__PURE__ */ new Map();
|
|
1911
1923
|
for (const { data: oe, error: Z } of L) {
|
|
@@ -1949,198 +1961,198 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1949
1961
|
isSaving: a,
|
|
1950
1962
|
applyErrors: p,
|
|
1951
1963
|
nameSearch: $,
|
|
1952
|
-
filterRows:
|
|
1964
|
+
filterRows: C,
|
|
1953
1965
|
// computed
|
|
1954
1966
|
matchedRecipes: I,
|
|
1955
1967
|
selectedRecipes: f,
|
|
1956
1968
|
livePreviewEntries: S,
|
|
1957
1969
|
canGoToStep2: k,
|
|
1958
|
-
canGoToStep3:
|
|
1970
|
+
canGoToStep3: b,
|
|
1959
1971
|
// actions
|
|
1960
1972
|
openDialog: e,
|
|
1961
|
-
closeDialog:
|
|
1973
|
+
closeDialog: V,
|
|
1962
1974
|
reset: c,
|
|
1963
1975
|
updateQuery: _,
|
|
1964
1976
|
removeRecipe: N,
|
|
1965
1977
|
restoreAllRecipes: z,
|
|
1966
1978
|
addModification: g,
|
|
1967
|
-
updateModification:
|
|
1979
|
+
updateModification: B,
|
|
1968
1980
|
removeModification: F,
|
|
1969
|
-
reorderModification:
|
|
1981
|
+
reorderModification: R,
|
|
1970
1982
|
goToStep3: P,
|
|
1971
1983
|
backToStep2: K,
|
|
1972
1984
|
buildPayload: H,
|
|
1973
1985
|
confirmAndApply: ee
|
|
1974
1986
|
};
|
|
1975
|
-
}),
|
|
1987
|
+
}), ho = { class: "flex flex-col h-full" }, xo = { class: "px-16 pt-16 pb-8 shrink-0 flex items-center justify-between" }, $o = { class: "fm-typo-en-heading-sm-700 text-fm-color-typo-primary" }, Io = { class: "px-16 pt-12 pb-16 border-b border-fm-color-border-default bg-fm-color-surface-default flex flex-col gap-12 shrink-0" }, wo = {
|
|
1976
1988
|
key: 0,
|
|
1977
1989
|
class: "flex flex-wrap items-center gap-8"
|
|
1978
|
-
},
|
|
1990
|
+
}, Eo = {
|
|
1979
1991
|
type: "button",
|
|
1980
1992
|
class: "inline-flex items-center gap-4 h-[30px] pl-8 pr-6 rounded-l-md border border-r-0 border-fm-color-border-default bg-fm-color-surface-secondary hover:bg-fm-color-surface-hover cursor-pointer select-none transition-colors"
|
|
1981
|
-
},
|
|
1993
|
+
}, Vo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-primary" }, So = { class: "flex flex-col gap-8 p-12 min-w-[260px]" }, Co = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary" }, Bo = {
|
|
1982
1994
|
key: 0,
|
|
1983
1995
|
class: "flex flex-col gap-4"
|
|
1984
|
-
},
|
|
1996
|
+
}, Fo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ro = { class: "text-fm-color-typo-placeholder ml-4" }, Ao = ["title", "onClick"], To = { class: "flex-1 overflow-y-auto" }, Uo = {
|
|
1985
1997
|
key: 0,
|
|
1986
1998
|
class: "flex flex-col items-center justify-center h-full gap-8 px-24 text-center"
|
|
1987
|
-
},
|
|
1999
|
+
}, Po = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mo = {
|
|
1988
2000
|
key: 1,
|
|
1989
2001
|
class: "divide-y divide-fm-color-border-default"
|
|
1990
|
-
},
|
|
2002
|
+
}, Do = { class: "flex-1 min-w-0" }, Go = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary truncate" }, No = {
|
|
1991
2003
|
key: 0,
|
|
1992
2004
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-1 whitespace-normal break-words"
|
|
1993
|
-
},
|
|
2005
|
+
}, zo = { class: "flex items-center gap-4 mt-2" }, Oo = /* @__PURE__ */ le({
|
|
1994
2006
|
__name: "RecipeBulkEditorStep1",
|
|
1995
2007
|
setup(m) {
|
|
1996
|
-
const { t: d } = ie(), l = ne(), t = ge(), i =
|
|
2008
|
+
const { t: d } = ie(), l = ne(), t = ge(), i = A({
|
|
1997
2009
|
get: () => t.nameSearch,
|
|
1998
|
-
set: (
|
|
1999
|
-
t.nameSearch =
|
|
2010
|
+
set: (b) => {
|
|
2011
|
+
t.nameSearch = b;
|
|
2000
2012
|
}
|
|
2001
|
-
}), r =
|
|
2002
|
-
function u(
|
|
2003
|
-
return x.value[
|
|
2004
|
-
}
|
|
2005
|
-
function o(
|
|
2006
|
-
x.value = { ...x.value, [
|
|
2007
|
-
}
|
|
2008
|
-
const s =
|
|
2009
|
-
() => l.skus.map((
|
|
2010
|
-
label:
|
|
2011
|
-
sublabel:
|
|
2012
|
-
value:
|
|
2013
|
+
}), r = A(() => t.filterRows), x = W({});
|
|
2014
|
+
function u(b) {
|
|
2015
|
+
return x.value[b] ?? !1;
|
|
2016
|
+
}
|
|
2017
|
+
function o(b, e) {
|
|
2018
|
+
x.value = { ...x.value, [b]: e };
|
|
2019
|
+
}
|
|
2020
|
+
const s = A(
|
|
2021
|
+
() => l.skus.map((b) => ({
|
|
2022
|
+
label: b.name,
|
|
2023
|
+
sublabel: b.code,
|
|
2024
|
+
value: b._id
|
|
2013
2025
|
}))
|
|
2014
|
-
), a =
|
|
2015
|
-
() => l.recipes.map((
|
|
2016
|
-
label:
|
|
2017
|
-
value:
|
|
2026
|
+
), a = A(
|
|
2027
|
+
() => l.recipes.map((b) => ({
|
|
2028
|
+
label: b.name,
|
|
2029
|
+
value: b._id
|
|
2018
2030
|
}))
|
|
2019
2031
|
);
|
|
2020
|
-
function p(
|
|
2021
|
-
return
|
|
2032
|
+
function p(b) {
|
|
2033
|
+
return b.type !== "ingredient" || !b.itemId ? null : l.skuById[b.itemId] ?? null;
|
|
2022
2034
|
}
|
|
2023
|
-
function $(
|
|
2035
|
+
function $(b) {
|
|
2024
2036
|
var e;
|
|
2025
|
-
if (!
|
|
2026
|
-
if (
|
|
2027
|
-
if (!
|
|
2028
|
-
const
|
|
2029
|
-
if (!
|
|
2030
|
-
const { amount: c, measurement: _ } =
|
|
2031
|
-
if (!(c != null && c.amount > 0)) return
|
|
2032
|
-
const z = (_ == null ? void 0 : _.abbrev) ?? ((e =
|
|
2033
|
-
return `${
|
|
2037
|
+
if (!b.type) return d("inventory.recipe.bulkEditor.step1.filter");
|
|
2038
|
+
if (b.type === "ingredient") {
|
|
2039
|
+
if (!b.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
|
|
2040
|
+
const V = l.skuById[b.itemId];
|
|
2041
|
+
if (!V) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
|
|
2042
|
+
const { amount: c, measurement: _ } = b.amountModel;
|
|
2043
|
+
if (!(c != null && c.amount > 0)) return V.name;
|
|
2044
|
+
const z = (_ == null ? void 0 : _.abbrev) ?? ((e = V.unit) == null ? void 0 : e.abbrev) ?? "", g = Q(c);
|
|
2045
|
+
return `${V.name} (${g}${z})`;
|
|
2034
2046
|
}
|
|
2035
|
-
if (
|
|
2036
|
-
if (!
|
|
2037
|
-
const
|
|
2038
|
-
return
|
|
2047
|
+
if (b.type === "recipe") {
|
|
2048
|
+
if (!b.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
|
|
2049
|
+
const V = l.recipeById[b.itemId];
|
|
2050
|
+
return V ? V.name : d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
|
|
2039
2051
|
}
|
|
2040
2052
|
return "";
|
|
2041
2053
|
}
|
|
2042
|
-
function
|
|
2043
|
-
const e =
|
|
2054
|
+
function C(b) {
|
|
2055
|
+
const e = ko(b);
|
|
2044
2056
|
t.filterRows.push(e), o(e.id, !0);
|
|
2045
2057
|
}
|
|
2046
|
-
function I(
|
|
2047
|
-
t.filterRows = t.filterRows.filter((
|
|
2058
|
+
function I(b) {
|
|
2059
|
+
t.filterRows = t.filterRows.filter((V) => V.id !== b);
|
|
2048
2060
|
const e = { ...x.value };
|
|
2049
|
-
delete e[
|
|
2061
|
+
delete e[b], x.value = e;
|
|
2050
2062
|
}
|
|
2051
|
-
function f(
|
|
2052
|
-
|
|
2063
|
+
function f(b) {
|
|
2064
|
+
b.amountModel = ye(), o(b.id, !0);
|
|
2053
2065
|
}
|
|
2054
2066
|
ue(
|
|
2055
2067
|
[i, r],
|
|
2056
2068
|
() => {
|
|
2057
|
-
const
|
|
2069
|
+
const b = [];
|
|
2058
2070
|
for (const c of r.value)
|
|
2059
2071
|
if (!(!c.type || !c.itemId))
|
|
2060
2072
|
if (c.type === "ingredient") {
|
|
2061
2073
|
const _ = p(c), { amount: N, measurement: z } = c.amountModel, g = N != null && N.amount > 0;
|
|
2062
|
-
let
|
|
2063
|
-
_ && g && (
|
|
2074
|
+
let B, F;
|
|
2075
|
+
_ && g && (B = z ? he.multiplyDecimal(N, z.conversion) : N, F = (z == null ? void 0 : z.id) ?? null), b.push({
|
|
2064
2076
|
id: c.id,
|
|
2065
2077
|
type: "ingredient",
|
|
2066
2078
|
itemId: c.itemId,
|
|
2067
|
-
amount:
|
|
2079
|
+
amount: B ?? null,
|
|
2068
2080
|
measurementId: F
|
|
2069
2081
|
});
|
|
2070
|
-
} else c.type === "recipe" &&
|
|
2082
|
+
} else c.type === "recipe" && b.push({
|
|
2071
2083
|
id: c.id,
|
|
2072
2084
|
type: "recipe",
|
|
2073
2085
|
itemId: c.itemId
|
|
2074
2086
|
});
|
|
2075
2087
|
t.updateQuery({
|
|
2076
2088
|
nameSearch: i.value,
|
|
2077
|
-
filters:
|
|
2089
|
+
filters: b
|
|
2078
2090
|
});
|
|
2079
|
-
const e = i.value.trim().length > 0,
|
|
2080
|
-
!e && !
|
|
2091
|
+
const e = i.value.trim().length > 0, V = b.length > 0;
|
|
2092
|
+
!e && !V && t.restoreAllRecipes();
|
|
2081
2093
|
},
|
|
2082
2094
|
{ deep: !0, immediate: !0 }
|
|
2083
2095
|
);
|
|
2084
|
-
function k(
|
|
2096
|
+
function k(b) {
|
|
2085
2097
|
var _, N, z, g;
|
|
2086
|
-
if (
|
|
2087
|
-
const
|
|
2088
|
-
if (!
|
|
2089
|
-
const F = `x${Q(
|
|
2090
|
-
return
|
|
2098
|
+
if (b.isGroup) {
|
|
2099
|
+
const B = l.skuGroupById[b.id];
|
|
2100
|
+
if (!B) return null;
|
|
2101
|
+
const F = `x${Q(b.amount)}`;
|
|
2102
|
+
return b.recipeIds.slice(1).length ? `(${((_ = l.recipeById[b.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? ""}) ${B.name} (${F})` : `${B.name} (${F})`;
|
|
2091
2103
|
}
|
|
2092
|
-
const e = l.skuById[
|
|
2104
|
+
const e = l.skuById[b.id];
|
|
2093
2105
|
if (!e) return null;
|
|
2094
|
-
const
|
|
2095
|
-
return
|
|
2106
|
+
const V = ((N = b.measurement) == null ? void 0 : N.abbrev) ?? ((z = e.unit) == null ? void 0 : z.abbrev) ?? "", c = `${Q(b.amount)}${V}`;
|
|
2107
|
+
return b.recipeIds.slice(1).length ? `(${((g = l.recipeById[b.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? ""}) ${e.name} (${c})` : `${e.name} (${c})`;
|
|
2096
2108
|
}
|
|
2097
|
-
function S(
|
|
2098
|
-
return ke(
|
|
2109
|
+
function S(b) {
|
|
2110
|
+
return ke(b.contains, /* @__PURE__ */ new Set([b._id]), l.recipeById).map(k).filter((e) => e !== null).join(", ");
|
|
2099
2111
|
}
|
|
2100
|
-
return (
|
|
2101
|
-
const
|
|
2102
|
-
return
|
|
2103
|
-
v("div",
|
|
2104
|
-
v("span",
|
|
2112
|
+
return (b, e) => {
|
|
2113
|
+
const V = G("FmButton"), c = G("FmSearch"), _ = G("FmSelect"), N = G("FmPopover"), z = G("FmIcon"), g = G("FmMenuItem"), B = G("FmMenu"), F = G("FmChip");
|
|
2114
|
+
return y(), E("div", ho, [
|
|
2115
|
+
v("div", xo, [
|
|
2116
|
+
v("span", $o, U(n(d)("inventory.recipe.bulkEditor.step1.selectedCount", {
|
|
2105
2117
|
count: n(t).selectedRecipes.length
|
|
2106
2118
|
})), 1),
|
|
2107
|
-
n(t).excludedRecipeIds.size > 0 ? (
|
|
2119
|
+
n(t).excludedRecipeIds.size > 0 ? (y(), Y(V, {
|
|
2108
2120
|
key: 0,
|
|
2109
2121
|
label: n(d)("inventory.recipe.bulkEditor.step1.restoreAll"),
|
|
2110
2122
|
variant: "tertiary",
|
|
2111
2123
|
size: "md",
|
|
2112
|
-
onClick: e[0] || (e[0] = (
|
|
2124
|
+
onClick: e[0] || (e[0] = (R) => n(t).restoreAllRecipes())
|
|
2113
2125
|
}, null, 8, ["label"])) : T("", !0)
|
|
2114
2126
|
]),
|
|
2115
|
-
v("div",
|
|
2127
|
+
v("div", Io, [
|
|
2116
2128
|
h(c, {
|
|
2117
2129
|
modelValue: i.value,
|
|
2118
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
2130
|
+
"onUpdate:modelValue": e[1] || (e[1] = (R) => i.value = R),
|
|
2119
2131
|
placeholder: n(d)("inventory.recipe.bulkEditor.query.nameSearchPlaceholder")
|
|
2120
2132
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
2121
|
-
r.value.length > 0 ? (
|
|
2122
|
-
(
|
|
2123
|
-
key:
|
|
2133
|
+
r.value.length > 0 ? (y(), E("div", wo, [
|
|
2134
|
+
(y(!0), E(X, null, me(r.value, (R) => (y(), E("div", {
|
|
2135
|
+
key: R.id,
|
|
2124
2136
|
class: "flex items-center"
|
|
2125
2137
|
}, [
|
|
2126
2138
|
h(N, {
|
|
2127
|
-
"show-popover": u(
|
|
2139
|
+
"show-popover": u(R.id),
|
|
2128
2140
|
"exclude-el-from-click-outside": ["fm-menu"],
|
|
2129
2141
|
placement: "bottom-start",
|
|
2130
|
-
onPopoverChanged: (P) => o(
|
|
2142
|
+
onPopoverChanged: (P) => o(R.id, P)
|
|
2131
2143
|
}, {
|
|
2132
2144
|
"popover-button": J(() => [
|
|
2133
|
-
v("button",
|
|
2134
|
-
v("span",
|
|
2145
|
+
v("button", Eo, [
|
|
2146
|
+
v("span", Vo, U($(R)), 1)
|
|
2135
2147
|
])
|
|
2136
2148
|
]),
|
|
2137
2149
|
default: J(() => [
|
|
2138
|
-
v("div",
|
|
2139
|
-
v("p",
|
|
2140
|
-
|
|
2150
|
+
v("div", So, [
|
|
2151
|
+
v("p", Co, U(R.type === "ingredient" ? n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient") : n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe")), 1),
|
|
2152
|
+
R.type === "ingredient" ? (y(), E(X, { key: 0 }, [
|
|
2141
2153
|
h(_, {
|
|
2142
|
-
modelValue:
|
|
2143
|
-
"onUpdate:modelValue": [(P) =>
|
|
2154
|
+
modelValue: R.itemId,
|
|
2155
|
+
"onUpdate:modelValue": [(P) => R.itemId = P, (P) => f(R)],
|
|
2144
2156
|
items: s.value,
|
|
2145
2157
|
placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectIngredient"),
|
|
2146
2158
|
clearable: ""
|
|
@@ -2148,28 +2160,28 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2148
2160
|
"menu-wrapper": J((P) => [
|
|
2149
2161
|
h(Fe, we({ ref_for: !0 }, P, {
|
|
2150
2162
|
items: s.value,
|
|
2151
|
-
"model-value":
|
|
2163
|
+
"model-value": R.itemId
|
|
2152
2164
|
}), null, 16, ["items", "model-value"])
|
|
2153
2165
|
]),
|
|
2154
2166
|
_: 2
|
|
2155
2167
|
}, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"]),
|
|
2156
|
-
p(
|
|
2157
|
-
v("span",
|
|
2168
|
+
p(R) ? (y(), E("div", Bo, [
|
|
2169
|
+
v("span", Fo, [
|
|
2158
2170
|
mt(U(n(d)("inventory.recipe.bulkEditor.step1.amountLabel")) + " ", 1),
|
|
2159
|
-
v("span",
|
|
2171
|
+
v("span", Ro, U(n(d)("inventory.recipe.bulkEditor.step1.amountOptional")), 1)
|
|
2160
2172
|
]),
|
|
2161
|
-
h(
|
|
2162
|
-
modelValue:
|
|
2163
|
-
"onUpdate:modelValue": (P) =>
|
|
2164
|
-
unit: p(
|
|
2173
|
+
h(Be, {
|
|
2174
|
+
modelValue: R.amountModel,
|
|
2175
|
+
"onUpdate:modelValue": (P) => R.amountModel = P,
|
|
2176
|
+
unit: p(R).unit,
|
|
2165
2177
|
placeholder: n(d)("inventory.recipe.bulkEditor.step1.amountPlaceholder"),
|
|
2166
2178
|
"convert-amount-on-change-unit": ""
|
|
2167
2179
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "unit", "placeholder"])
|
|
2168
2180
|
])) : T("", !0)
|
|
2169
|
-
], 64)) :
|
|
2181
|
+
], 64)) : R.type === "recipe" ? (y(), Y(_, {
|
|
2170
2182
|
key: 1,
|
|
2171
|
-
modelValue:
|
|
2172
|
-
"onUpdate:modelValue": [(P) =>
|
|
2183
|
+
modelValue: R.itemId,
|
|
2184
|
+
"onUpdate:modelValue": [(P) => R.itemId = P, (P) => f(R)],
|
|
2173
2185
|
items: a.value,
|
|
2174
2186
|
placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectRecipe"),
|
|
2175
2187
|
clearable: ""
|
|
@@ -2177,7 +2189,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2177
2189
|
"menu-wrapper": J((P) => [
|
|
2178
2190
|
h(Fe, we({ ref_for: !0 }, P, {
|
|
2179
2191
|
items: a.value,
|
|
2180
|
-
"model-value":
|
|
2192
|
+
"model-value": R.itemId
|
|
2181
2193
|
}), null, 16, ["items", "model-value"])
|
|
2182
2194
|
]),
|
|
2183
2195
|
_: 2
|
|
@@ -2190,21 +2202,21 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2190
2202
|
type: "button",
|
|
2191
2203
|
class: "inline-flex items-center justify-center h-[30px] w-[26px] rounded-r-md border border-l-0 border-fm-color-border-default bg-fm-color-surface-secondary hover:bg-fm-color-surface-hover text-fm-color-typo-secondary hover:text-fm-color-typo-primary cursor-pointer transition-colors",
|
|
2192
2204
|
title: n(d)("inventory.recipe.bulkEditor.step1.removeFilter"),
|
|
2193
|
-
onClick: (P) => I(
|
|
2205
|
+
onClick: (P) => I(R.id)
|
|
2194
2206
|
}, [
|
|
2195
2207
|
h(z, {
|
|
2196
2208
|
name: "close",
|
|
2197
2209
|
size: "sm"
|
|
2198
2210
|
})
|
|
2199
|
-
], 8,
|
|
2211
|
+
], 8, Ao)
|
|
2200
2212
|
]))), 128))
|
|
2201
2213
|
])) : T("", !0),
|
|
2202
|
-
h(
|
|
2214
|
+
h(B, {
|
|
2203
2215
|
"close-on-click": !0,
|
|
2204
2216
|
placement: "bottom-start"
|
|
2205
2217
|
}, {
|
|
2206
2218
|
"menu-button": J(() => [
|
|
2207
|
-
h(
|
|
2219
|
+
h(V, {
|
|
2208
2220
|
label: n(d)("inventory.recipe.bulkEditor.step1.filter"),
|
|
2209
2221
|
variant: "secondary",
|
|
2210
2222
|
size: "md",
|
|
@@ -2216,35 +2228,35 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2216
2228
|
h(g, {
|
|
2217
2229
|
label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient"),
|
|
2218
2230
|
icon: "inventory_2",
|
|
2219
|
-
onClick: e[2] || (e[2] = (
|
|
2231
|
+
onClick: e[2] || (e[2] = (R) => C("ingredient"))
|
|
2220
2232
|
}, null, 8, ["label"]),
|
|
2221
2233
|
h(g, {
|
|
2222
2234
|
label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe"),
|
|
2223
2235
|
icon: "restaurant_menu",
|
|
2224
|
-
onClick: e[3] || (e[3] = (
|
|
2236
|
+
onClick: e[3] || (e[3] = (R) => C("recipe"))
|
|
2225
2237
|
}, null, 8, ["label"])
|
|
2226
2238
|
]),
|
|
2227
2239
|
_: 1
|
|
2228
2240
|
})
|
|
2229
2241
|
]),
|
|
2230
|
-
v("div",
|
|
2231
|
-
n(t).selectedRecipes.length === 0 ? (
|
|
2242
|
+
v("div", To, [
|
|
2243
|
+
n(t).selectedRecipes.length === 0 ? (y(), E("div", Uo, [
|
|
2232
2244
|
h(z, {
|
|
2233
2245
|
name: "search_off",
|
|
2234
2246
|
size: "lg",
|
|
2235
2247
|
class: "text-fm-color-typo-placeholder"
|
|
2236
2248
|
}),
|
|
2237
|
-
v("p",
|
|
2238
|
-
])) : (
|
|
2239
|
-
(
|
|
2240
|
-
key:
|
|
2249
|
+
v("p", Po, U(n(d)("inventory.recipe.bulkEditor.query.noResults")), 1)
|
|
2250
|
+
])) : (y(), E("div", Mo, [
|
|
2251
|
+
(y(!0), E(X, null, me(n(t).selectedRecipes, (R) => (y(), E("div", {
|
|
2252
|
+
key: R._id,
|
|
2241
2253
|
class: "flex items-center gap-12 px-16 py-12 hover:bg-fm-color-surface-hover transition-colors"
|
|
2242
2254
|
}, [
|
|
2243
|
-
v("div",
|
|
2244
|
-
v("div",
|
|
2245
|
-
|
|
2246
|
-
v("div",
|
|
2247
|
-
|
|
2255
|
+
v("div", Do, [
|
|
2256
|
+
v("div", Go, U(R.name), 1),
|
|
2257
|
+
R.contains.length > 0 ? (y(), E("div", No, U(S(R)), 1)) : T("", !0),
|
|
2258
|
+
v("div", zo, [
|
|
2259
|
+
R.version === "v2" ? (y(), Y(F, {
|
|
2248
2260
|
key: 0,
|
|
2249
2261
|
size: "sm",
|
|
2250
2262
|
label: "V2",
|
|
@@ -2252,11 +2264,11 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2252
2264
|
})) : T("", !0)
|
|
2253
2265
|
])
|
|
2254
2266
|
]),
|
|
2255
|
-
h(
|
|
2267
|
+
h(V, {
|
|
2256
2268
|
variant: "tertiary",
|
|
2257
2269
|
icon: "do_not_disturb_on",
|
|
2258
2270
|
title: n(d)("inventory.recipe.bulkEditor.step1.removeRecipeTooltip"),
|
|
2259
|
-
onClick: (P) => n(t).removeRecipe(
|
|
2271
|
+
onClick: (P) => n(t).removeRecipe(R._id)
|
|
2260
2272
|
}, null, 8, ["title", "onClick"])
|
|
2261
2273
|
]))), 128))
|
|
2262
2274
|
]))
|
|
@@ -2264,16 +2276,16 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2264
2276
|
]);
|
|
2265
2277
|
};
|
|
2266
2278
|
}
|
|
2267
|
-
}),
|
|
2279
|
+
}), Lo = { class: "flex flex-col gap-0 rounded-lg border border-fm-color-border-default bg-fm-color-surface-default overflow-hidden" }, jo = { class: "flex items-start gap-12 px-16 py-12" }, Ko = { class: "flex-1" }, qo = { class: "flex-1" }, Wo = {
|
|
2268
2280
|
key: 0,
|
|
2269
2281
|
class: "border-t border-fm-color-border-default px-16 py-10 flex items-center gap-10"
|
|
2270
|
-
},
|
|
2282
|
+
}, Yo = {
|
|
2271
2283
|
key: 1,
|
|
2272
2284
|
class: "border-t border-fm-color-border-default px-16 py-10 flex items-start gap-8 bg-fm-color-surface-warning"
|
|
2273
|
-
},
|
|
2285
|
+
}, Jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, Ho = {
|
|
2274
2286
|
key: 2,
|
|
2275
2287
|
class: "border-t border-fm-color-border-default px-16 py-12 flex flex-col gap-12"
|
|
2276
|
-
},
|
|
2288
|
+
}, Qo = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, Xo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ei = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-warning" }, ti = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary -mt-8" }, ni = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary -mb-4" }, oi = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ii = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, li = /* @__PURE__ */ le({
|
|
2277
2289
|
__name: "ModificationCard",
|
|
2278
2290
|
props: {
|
|
2279
2291
|
modelValue: {},
|
|
@@ -2283,8 +2295,8 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2283
2295
|
setup(m, { emit: d }) {
|
|
2284
2296
|
const l = m, t = d, { t: i } = ie(), r = ne(), x = We();
|
|
2285
2297
|
function u(w) {
|
|
2286
|
-
const
|
|
2287
|
-
return
|
|
2298
|
+
const D = w.type === "replace-binding" ? w.from.type : w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives" ? w.target.type : w.type === "add-binding" ? w.binding.type : null;
|
|
2299
|
+
return D ? D === "RECIPE" ? "recipe" : "ingredient" : null;
|
|
2288
2300
|
}
|
|
2289
2301
|
function o(w) {
|
|
2290
2302
|
return w.type === "update-alternatives" ? !0 : w.type === "add-binding" ? (w.binding.alternatives ?? []).length > 0 : w.type === "replace-binding" ? (w.to.alternatives ?? []).length > 0 : !1;
|
|
@@ -2310,16 +2322,16 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2310
2322
|
return w.type === "add-binding" && w.binding.id || null;
|
|
2311
2323
|
}
|
|
2312
2324
|
function $(w) {
|
|
2313
|
-
const
|
|
2314
|
-
return
|
|
2325
|
+
const D = w.type === "replace-binding" ? w.to : w.type === "add-binding" ? w.binding : null;
|
|
2326
|
+
return D ? { amount: D.amount, measurement: D.measurement ?? null } : ye();
|
|
2315
2327
|
}
|
|
2316
|
-
function
|
|
2328
|
+
function C(w) {
|
|
2317
2329
|
return w.type === "replace-binding" ? w.to.rules ?? null : w.type === "add-binding" ? w.binding.rules ?? null : null;
|
|
2318
2330
|
}
|
|
2319
2331
|
function I(w) {
|
|
2320
2332
|
return w.type === "update-alternatives" ? w.alternatives ?? [] : w.type === "add-binding" ? w.binding.alternatives ?? [] : [];
|
|
2321
2333
|
}
|
|
2322
|
-
const f = W(u(l.modelValue)), k = W(s(l.modelValue)), S = W(o(l.modelValue)),
|
|
2334
|
+
const f = W(u(l.modelValue)), k = W(s(l.modelValue)), S = W(o(l.modelValue)), b = W(a(l.modelValue)), e = W(p(l.modelValue)), V = W($(l.modelValue)), c = W(C(l.modelValue)), _ = W(I(l.modelValue)), N = W(
|
|
2323
2335
|
(() => {
|
|
2324
2336
|
const w = $(l.modelValue);
|
|
2325
2337
|
return w.amount ? Q(w.amount) : "";
|
|
@@ -2328,77 +2340,77 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2328
2340
|
let z = null;
|
|
2329
2341
|
function g(w) {
|
|
2330
2342
|
N.value = w, z && clearTimeout(z), z = setTimeout(() => {
|
|
2331
|
-
const
|
|
2332
|
-
|
|
2333
|
-
amount: w.length > 0 && isFinite(
|
|
2343
|
+
const D = +w;
|
|
2344
|
+
V.value = {
|
|
2345
|
+
amount: w.length > 0 && isFinite(D) ? Ke(D) : { amount: 0, precision: 0 },
|
|
2334
2346
|
measurement: null
|
|
2335
2347
|
};
|
|
2336
2348
|
}, 300);
|
|
2337
2349
|
}
|
|
2338
2350
|
ue(f, () => {
|
|
2339
|
-
k.value = null, S.value = !1,
|
|
2351
|
+
k.value = null, S.value = !1, b.value = null, e.value = null, V.value = ye(), c.value = null, _.value = [], N.value = "";
|
|
2340
2352
|
}), ue(k, () => {
|
|
2341
|
-
|
|
2353
|
+
b.value = null, e.value = null, V.value = ye(), c.value = null, _.value = [], N.value = "";
|
|
2342
2354
|
}), ue(S, (w) => {
|
|
2343
2355
|
w || (_.value = [], k.value === "alts" && (k.value = null));
|
|
2344
2356
|
});
|
|
2345
|
-
const
|
|
2357
|
+
const B = A(() => [
|
|
2346
2358
|
{ label: i("inventory.recipe.bulkEditor.step2.fieldIngredient"), value: "ingredient" },
|
|
2347
2359
|
{ label: i("inventory.recipe.bulkEditor.step2.fieldRecipe"), value: "recipe" }
|
|
2348
|
-
]), F =
|
|
2360
|
+
]), F = A(() => {
|
|
2349
2361
|
const w = [
|
|
2350
2362
|
{ label: i("inventory.recipe.bulkEditor.step2.actionLink"), value: "link" },
|
|
2351
2363
|
{ label: i("inventory.recipe.bulkEditor.step2.actionUpdate"), value: "update" },
|
|
2352
2364
|
{ label: i("inventory.recipe.bulkEditor.step2.actionRemove"), value: "remove" }
|
|
2353
2365
|
];
|
|
2354
2366
|
return f.value === "ingredient" && S.value && x.enableRecipeV2 && w.push({ label: i("inventory.recipe.bulkEditor.step2.actionAlts"), value: "alts" }), w;
|
|
2355
|
-
}),
|
|
2367
|
+
}), R = A(() => f.value !== null && k.value !== null), P = A(
|
|
2356
2368
|
() => k.value === "update" || k.value === "remove" || k.value === "alts"
|
|
2357
|
-
), K =
|
|
2369
|
+
), K = A(
|
|
2358
2370
|
() => k.value === "link"
|
|
2359
|
-
), H =
|
|
2360
|
-
() => k.value === "update" &&
|
|
2361
|
-
), ee =
|
|
2371
|
+
), H = A(
|
|
2372
|
+
() => k.value === "update" && b.value !== null
|
|
2373
|
+
), ee = A(
|
|
2362
2374
|
() => f.value === "ingredient" && S.value && x.enableRecipeV2
|
|
2363
|
-
), O =
|
|
2375
|
+
), O = A(
|
|
2364
2376
|
() => r.skus.map((w) => ({ label: w.name, sublabel: w.code, value: w._id }))
|
|
2365
|
-
),
|
|
2377
|
+
), M = A(
|
|
2366
2378
|
() => r.recipes.map((w) => ({ label: w.name, value: w._id }))
|
|
2367
|
-
), L =
|
|
2368
|
-
const w =
|
|
2379
|
+
), L = A(() => f.value === "recipe" ? M.value : O.value), q = A(() => f.value === "recipe" ? M.value : O.value), oe = A(() => f.value !== "ingredient" || !e.value ? null : r.skuById[e.value] ?? null), Z = A(() => f.value !== "ingredient" || !b.value ? null : r.skuById[b.value] ?? null), ae = A(() => {
|
|
2380
|
+
const w = b.value ?? e.value;
|
|
2369
2381
|
return w ? [w] : [];
|
|
2370
|
-
}), fe =
|
|
2382
|
+
}), fe = A(() => ee.value ? Object.values(l.livePreviewEntries).filter(
|
|
2371
2383
|
(w) => w.original.version !== "v2"
|
|
2372
|
-
).length : 0), xe =
|
|
2384
|
+
).length : 0), xe = A(() => Object.values(l.livePreviewEntries).length);
|
|
2373
2385
|
ue(
|
|
2374
|
-
() => [k.value,
|
|
2375
|
-
([w,
|
|
2376
|
-
if (w !== "alts" ||
|
|
2377
|
-
if (!
|
|
2386
|
+
() => [k.value, b.value],
|
|
2387
|
+
([w, D], [te, pe]) => {
|
|
2388
|
+
if (w !== "alts" || D === pe) return;
|
|
2389
|
+
if (!D) {
|
|
2378
2390
|
_.value = [];
|
|
2379
2391
|
return;
|
|
2380
2392
|
}
|
|
2381
2393
|
const $e = Object.values(l.livePreviewEntries).find(
|
|
2382
|
-
(j) => j.original.version === "v2" && j.original.contains.some((Ie) => Ie.type === "SKU" && Ie.id ===
|
|
2394
|
+
(j) => j.original.version === "v2" && j.original.contains.some((Ie) => Ie.type === "SKU" && Ie.id === D)
|
|
2383
2395
|
);
|
|
2384
2396
|
if ($e) {
|
|
2385
|
-
const j = $e.original.contains.find((Ie) => Ie.type === "SKU" && Ie.id ===
|
|
2397
|
+
const j = $e.original.contains.find((Ie) => Ie.type === "SKU" && Ie.id === D);
|
|
2386
2398
|
_.value = j != null && j.alternatives ? [...j.alternatives] : [];
|
|
2387
2399
|
} else
|
|
2388
2400
|
_.value = [];
|
|
2389
2401
|
}
|
|
2390
2402
|
);
|
|
2391
|
-
const re =
|
|
2392
|
-
(w) => w.original.version === "v2" && w.original.contains.some((
|
|
2403
|
+
const re = A(() => k.value !== "alts" || !b.value ? 0 : Object.values(l.livePreviewEntries).filter(
|
|
2404
|
+
(w) => w.original.version === "v2" && w.original.contains.some((D) => D.type === "SKU" && D.id === b.value)
|
|
2393
2405
|
).length);
|
|
2394
2406
|
function ve() {
|
|
2395
2407
|
return f.value === "recipe" ? "RECIPE" : "SKU";
|
|
2396
2408
|
}
|
|
2397
2409
|
function ce() {
|
|
2398
|
-
const w = ve(),
|
|
2410
|
+
const w = ve(), D = ye().amount, te = {
|
|
2399
2411
|
type: w,
|
|
2400
2412
|
id: "",
|
|
2401
|
-
amount:
|
|
2413
|
+
amount: D,
|
|
2402
2414
|
measurement: null,
|
|
2403
2415
|
rules: null,
|
|
2404
2416
|
alternatives: []
|
|
@@ -2416,15 +2428,15 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2416
2428
|
}
|
|
2417
2429
|
}
|
|
2418
2430
|
function Ue() {
|
|
2419
|
-
return
|
|
2431
|
+
return b.value ? { type: ve(), id: b.value } : null;
|
|
2420
2432
|
}
|
|
2421
2433
|
function Ye(w = !1) {
|
|
2422
|
-
const
|
|
2423
|
-
if (!
|
|
2424
|
-
const { amount: te, measurement: pe } =
|
|
2434
|
+
const D = w ? b.value : e.value;
|
|
2435
|
+
if (!D) return null;
|
|
2436
|
+
const { amount: te, measurement: pe } = V.value, Ee = pe ? he.multiplyDecimal(te, pe.conversion) : te;
|
|
2425
2437
|
return {
|
|
2426
2438
|
type: ve(),
|
|
2427
|
-
id:
|
|
2439
|
+
id: D,
|
|
2428
2440
|
amount: Ee,
|
|
2429
2441
|
measurement: pe ?? null,
|
|
2430
2442
|
rules: f.value === "recipe" ? c.value ?? null : null,
|
|
@@ -2437,11 +2449,11 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2437
2449
|
t("update:modelValue", ce());
|
|
2438
2450
|
return;
|
|
2439
2451
|
}
|
|
2440
|
-
const w = Ue(),
|
|
2452
|
+
const w = Ue(), D = Ye(!1);
|
|
2441
2453
|
let te = null;
|
|
2442
2454
|
switch (k.value) {
|
|
2443
2455
|
case "link":
|
|
2444
|
-
|
|
2456
|
+
D && (te = { type: "add-binding", binding: D });
|
|
2445
2457
|
break;
|
|
2446
2458
|
case "update": {
|
|
2447
2459
|
const pe = Ye(!0);
|
|
@@ -2458,56 +2470,56 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2458
2470
|
t("update:modelValue", te ?? ce());
|
|
2459
2471
|
}
|
|
2460
2472
|
return ue(
|
|
2461
|
-
[f, k, S,
|
|
2473
|
+
[f, k, S, b, e, V, c, _],
|
|
2462
2474
|
() => ct(),
|
|
2463
2475
|
{ deep: !0 }
|
|
2464
|
-
), (w,
|
|
2476
|
+
), (w, D) => {
|
|
2465
2477
|
const te = G("FmSelect"), pe = G("FmSwitch"), Ee = G("FmIcon"), $e = G("FmTextField");
|
|
2466
|
-
return
|
|
2467
|
-
v("div",
|
|
2468
|
-
v("div",
|
|
2478
|
+
return y(), E("div", Lo, [
|
|
2479
|
+
v("div", jo, [
|
|
2480
|
+
v("div", Ko, [
|
|
2469
2481
|
h(te, {
|
|
2470
2482
|
modelValue: f.value,
|
|
2471
|
-
"onUpdate:modelValue":
|
|
2472
|
-
items:
|
|
2483
|
+
"onUpdate:modelValue": D[0] || (D[0] = (j) => f.value = j),
|
|
2484
|
+
items: B.value,
|
|
2473
2485
|
label: n(i)("inventory.recipe.bulkEditor.step2.sectionField"),
|
|
2474
2486
|
placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionField")
|
|
2475
2487
|
}, null, 8, ["modelValue", "items", "label", "placeholder"])
|
|
2476
2488
|
]),
|
|
2477
|
-
v("div",
|
|
2489
|
+
v("div", qo, [
|
|
2478
2490
|
h(te, {
|
|
2479
2491
|
modelValue: k.value,
|
|
2480
|
-
"onUpdate:modelValue":
|
|
2492
|
+
"onUpdate:modelValue": D[1] || (D[1] = (j) => k.value = j),
|
|
2481
2493
|
items: F.value,
|
|
2482
2494
|
label: n(i)("inventory.recipe.bulkEditor.step2.sectionAction"),
|
|
2483
2495
|
placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionAction")
|
|
2484
2496
|
}, null, 8, ["modelValue", "items", "label", "placeholder"])
|
|
2485
2497
|
])
|
|
2486
2498
|
]),
|
|
2487
|
-
f.value === "ingredient" && n(x).enableRecipeV2 ? (
|
|
2499
|
+
f.value === "ingredient" && n(x).enableRecipeV2 ? (y(), E("div", Wo, [
|
|
2488
2500
|
h(pe, {
|
|
2489
2501
|
modelValue: S.value,
|
|
2490
|
-
"onUpdate:modelValue":
|
|
2502
|
+
"onUpdate:modelValue": D[2] || (D[2] = (j) => S.value = j),
|
|
2491
2503
|
label: n(i)("inventory.recipe.bulkEditor.step2.includeAlternativesToggle")
|
|
2492
2504
|
}, null, 8, ["modelValue", "label"])
|
|
2493
2505
|
])) : T("", !0),
|
|
2494
|
-
ee.value && fe.value > 0 ? (
|
|
2506
|
+
ee.value && fe.value > 0 ? (y(), E("div", Yo, [
|
|
2495
2507
|
h(Ee, {
|
|
2496
2508
|
name: "warning",
|
|
2497
2509
|
size: "sm",
|
|
2498
2510
|
class: "text-fm-color-typo-warning mt-1 shrink-0"
|
|
2499
2511
|
}),
|
|
2500
|
-
v("p",
|
|
2512
|
+
v("p", Jo, U(n(i)("inventory.recipe.bulkEditor.step2.v1AlternativesWarning", {
|
|
2501
2513
|
v1Count: fe.value,
|
|
2502
2514
|
total: xe.value
|
|
2503
2515
|
})), 1)
|
|
2504
2516
|
])) : T("", !0),
|
|
2505
|
-
|
|
2506
|
-
P.value ? (
|
|
2507
|
-
v("p",
|
|
2517
|
+
R.value ? (y(), E("div", Ho, [
|
|
2518
|
+
P.value ? (y(), E(X, { key: 0 }, [
|
|
2519
|
+
v("p", Qo, U(n(i)("inventory.recipe.bulkEditor.addModification.targetLabel")), 1),
|
|
2508
2520
|
h(te, {
|
|
2509
|
-
modelValue:
|
|
2510
|
-
"onUpdate:modelValue":
|
|
2521
|
+
modelValue: b.value,
|
|
2522
|
+
"onUpdate:modelValue": D[3] || (D[3] = (j) => b.value = j),
|
|
2511
2523
|
items: L.value,
|
|
2512
2524
|
placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
|
|
2513
2525
|
clearable: ""
|
|
@@ -2515,57 +2527,57 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2515
2527
|
"menu-wrapper": J((j) => [
|
|
2516
2528
|
h(Fe, we(j, {
|
|
2517
2529
|
items: L.value,
|
|
2518
|
-
"model-value":
|
|
2530
|
+
"model-value": b.value
|
|
2519
2531
|
}), null, 16, ["items", "model-value"])
|
|
2520
2532
|
]),
|
|
2521
2533
|
_: 1
|
|
2522
2534
|
}, 8, ["modelValue", "items", "placeholder"]),
|
|
2523
|
-
H.value ? (
|
|
2524
|
-
f.value === "ingredient" && Z.value ? (
|
|
2535
|
+
H.value ? (y(), E(X, { key: 0 }, [
|
|
2536
|
+
f.value === "ingredient" && Z.value ? (y(), Y(Be, {
|
|
2525
2537
|
key: 0,
|
|
2526
|
-
modelValue:
|
|
2527
|
-
"onUpdate:modelValue":
|
|
2538
|
+
modelValue: V.value,
|
|
2539
|
+
"onUpdate:modelValue": D[4] || (D[4] = (j) => V.value = j),
|
|
2528
2540
|
unit: Z.value.unit,
|
|
2529
2541
|
placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
|
|
2530
2542
|
"convert-amount-on-change-unit": ""
|
|
2531
|
-
}, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (
|
|
2543
|
+
}, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (y(), Y($e, {
|
|
2532
2544
|
key: 1,
|
|
2533
2545
|
"model-value": N.value,
|
|
2534
2546
|
label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
|
|
2535
2547
|
type: "number",
|
|
2536
|
-
"onUpdate:modelValue":
|
|
2548
|
+
"onUpdate:modelValue": D[5] || (D[5] = (j) => g(j))
|
|
2537
2549
|
}, null, 8, ["model-value", "label"])) : T("", !0),
|
|
2538
|
-
f.value === "recipe" ? (
|
|
2539
|
-
v("p",
|
|
2550
|
+
f.value === "recipe" ? (y(), E(X, { key: 2 }, [
|
|
2551
|
+
v("p", Xo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
|
|
2540
2552
|
h(Re, {
|
|
2541
2553
|
modelValue: c.value,
|
|
2542
|
-
"onUpdate:modelValue":
|
|
2554
|
+
"onUpdate:modelValue": D[6] || (D[6] = (j) => c.value = j)
|
|
2543
2555
|
}, null, 8, ["modelValue"])
|
|
2544
2556
|
], 64)) : T("", !0),
|
|
2545
|
-
ee.value ? (
|
|
2546
|
-
v("p",
|
|
2557
|
+
ee.value ? (y(), E(X, { key: 3 }, [
|
|
2558
|
+
v("p", Zo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
|
|
2547
2559
|
h(Se, {
|
|
2548
2560
|
modelValue: _.value,
|
|
2549
|
-
"onUpdate:modelValue":
|
|
2561
|
+
"onUpdate:modelValue": D[7] || (D[7] = (j) => _.value = j),
|
|
2550
2562
|
"filter-ingredient-ids": ae.value
|
|
2551
2563
|
}, null, 8, ["modelValue", "filter-ingredient-ids"])
|
|
2552
2564
|
], 64)) : T("", !0)
|
|
2553
2565
|
], 64)) : T("", !0),
|
|
2554
|
-
k.value === "alts" &&
|
|
2555
|
-
v("p",
|
|
2556
|
-
v("p",
|
|
2566
|
+
k.value === "alts" && b.value ? (y(), E(X, { key: 1 }, [
|
|
2567
|
+
v("p", ei, U(re.value > 0 ? n(i)("inventory.recipe.bulkEditor.addModification.altsOverwriteWarning", { count: re.value }) : n(i)("inventory.recipe.bulkEditor.addModification.altsNotFoundWarning")), 1),
|
|
2568
|
+
v("p", ti, U(n(i)("inventory.recipe.bulkEditor.addModification.altsClearNote")), 1),
|
|
2557
2569
|
h(Se, {
|
|
2558
2570
|
modelValue: _.value,
|
|
2559
|
-
"onUpdate:modelValue":
|
|
2571
|
+
"onUpdate:modelValue": D[8] || (D[8] = (j) => _.value = j),
|
|
2560
2572
|
"filter-ingredient-ids": ae.value
|
|
2561
2573
|
}, null, 8, ["modelValue", "filter-ingredient-ids"])
|
|
2562
2574
|
], 64)) : T("", !0)
|
|
2563
2575
|
], 64)) : T("", !0),
|
|
2564
|
-
K.value ? (
|
|
2565
|
-
v("p",
|
|
2576
|
+
K.value ? (y(), E(X, { key: 1 }, [
|
|
2577
|
+
v("p", ni, U(n(i)("inventory.recipe.bulkEditor.addModification.bindingLabel")), 1),
|
|
2566
2578
|
h(te, {
|
|
2567
2579
|
modelValue: e.value,
|
|
2568
|
-
"onUpdate:modelValue":
|
|
2580
|
+
"onUpdate:modelValue": D[9] || (D[9] = (j) => e.value = j),
|
|
2569
2581
|
items: q.value,
|
|
2570
2582
|
placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
|
|
2571
2583
|
clearable: ""
|
|
@@ -2578,33 +2590,33 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2578
2590
|
]),
|
|
2579
2591
|
_: 1
|
|
2580
2592
|
}, 8, ["modelValue", "items", "placeholder"]),
|
|
2581
|
-
e.value ? (
|
|
2582
|
-
f.value === "ingredient" && oe.value ? (
|
|
2593
|
+
e.value ? (y(), E(X, { key: 0 }, [
|
|
2594
|
+
f.value === "ingredient" && oe.value ? (y(), Y(Be, {
|
|
2583
2595
|
key: 0,
|
|
2584
|
-
modelValue:
|
|
2585
|
-
"onUpdate:modelValue":
|
|
2596
|
+
modelValue: V.value,
|
|
2597
|
+
"onUpdate:modelValue": D[10] || (D[10] = (j) => V.value = j),
|
|
2586
2598
|
unit: oe.value.unit,
|
|
2587
2599
|
placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
|
|
2588
2600
|
"convert-amount-on-change-unit": ""
|
|
2589
|
-
}, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (
|
|
2601
|
+
}, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (y(), Y($e, {
|
|
2590
2602
|
key: 1,
|
|
2591
2603
|
"model-value": N.value,
|
|
2592
2604
|
label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
|
|
2593
2605
|
type: "number",
|
|
2594
|
-
"onUpdate:modelValue":
|
|
2606
|
+
"onUpdate:modelValue": D[11] || (D[11] = (j) => g(j))
|
|
2595
2607
|
}, null, 8, ["model-value", "label"])) : T("", !0),
|
|
2596
|
-
f.value === "recipe" ? (
|
|
2597
|
-
v("p",
|
|
2608
|
+
f.value === "recipe" ? (y(), E(X, { key: 2 }, [
|
|
2609
|
+
v("p", oi, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
|
|
2598
2610
|
h(Re, {
|
|
2599
2611
|
modelValue: c.value,
|
|
2600
|
-
"onUpdate:modelValue":
|
|
2612
|
+
"onUpdate:modelValue": D[12] || (D[12] = (j) => c.value = j)
|
|
2601
2613
|
}, null, 8, ["modelValue"])
|
|
2602
2614
|
], 64)) : T("", !0),
|
|
2603
|
-
ee.value ? (
|
|
2604
|
-
v("p",
|
|
2615
|
+
ee.value ? (y(), E(X, { key: 3 }, [
|
|
2616
|
+
v("p", ii, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
|
|
2605
2617
|
h(Se, {
|
|
2606
2618
|
modelValue: _.value,
|
|
2607
|
-
"onUpdate:modelValue":
|
|
2619
|
+
"onUpdate:modelValue": D[13] || (D[13] = (j) => _.value = j),
|
|
2608
2620
|
"filter-ingredient-ids": ae.value
|
|
2609
2621
|
}, null, 8, ["modelValue", "filter-ingredient-ids"])
|
|
2610
2622
|
], 64)) : T("", !0)
|
|
@@ -2614,25 +2626,25 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2614
2626
|
]);
|
|
2615
2627
|
};
|
|
2616
2628
|
}
|
|
2617
|
-
}),
|
|
2629
|
+
}), ri = { class: "flex flex-col gap-8" }, ai = { class: "flex flex-wrap items-center gap-12 px-4" }, si = {
|
|
2618
2630
|
key: 0,
|
|
2619
2631
|
class: "flex items-center gap-6"
|
|
2620
|
-
},
|
|
2632
|
+
}, di = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ui = {
|
|
2621
2633
|
key: 1,
|
|
2622
2634
|
class: "flex items-center gap-6"
|
|
2623
|
-
},
|
|
2635
|
+
}, ci = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, pi = {
|
|
2624
2636
|
key: 2,
|
|
2625
2637
|
class: "flex items-center gap-6"
|
|
2626
|
-
},
|
|
2638
|
+
}, mi = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, fi = { class: "rounded-lg border border-fm-color-border-default overflow-hidden" }, vi = {
|
|
2627
2639
|
key: 0,
|
|
2628
2640
|
class: "px-16 py-12 text-center fm-typo-en-body-sm-400 text-fm-color-typo-placeholder"
|
|
2629
|
-
},
|
|
2641
|
+
}, yi = {
|
|
2630
2642
|
key: 1,
|
|
2631
2643
|
class: "divide-y divide-fm-color-border-default"
|
|
2632
|
-
},
|
|
2644
|
+
}, bi = { class: "flex items-center gap-12" }, gi = { class: "flex-1 fm-typo-en-body-sm-600 text-fm-color-typo-primary truncate" }, _i = {
|
|
2633
2645
|
key: 0,
|
|
2634
2646
|
class: "flex flex-col gap-4 pl-8"
|
|
2635
|
-
},
|
|
2647
|
+
}, ki = { class: "flex-1 fm-typo-en-body-xs-400 text-fm-color-typo-secondary font-mono truncate" }, hi = /* @__PURE__ */ le({
|
|
2636
2648
|
__name: "LivePreviewTable",
|
|
2637
2649
|
setup(m) {
|
|
2638
2650
|
const { t: d } = ie(), l = ge(), t = ne(), i = {
|
|
@@ -2641,17 +2653,17 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2641
2653
|
"already-satisfied": 2,
|
|
2642
2654
|
blocked: 3,
|
|
2643
2655
|
"no-applicable-changes": 4
|
|
2644
|
-
}, r =
|
|
2656
|
+
}, r = A(
|
|
2645
2657
|
() => Object.values(l.livePreviewEntries).sort(
|
|
2646
|
-
(e,
|
|
2658
|
+
(e, V) => i[e.status] - i[V.status]
|
|
2647
2659
|
)
|
|
2648
|
-
), x =
|
|
2660
|
+
), x = A(
|
|
2649
2661
|
() => r.value.filter((e) => e.status === "will-update").length
|
|
2650
|
-
), u =
|
|
2662
|
+
), u = A(
|
|
2651
2663
|
() => r.value.filter((e) => e.status === "partially-ignored").length
|
|
2652
|
-
), o =
|
|
2664
|
+
), o = A(
|
|
2653
2665
|
() => r.value.filter((e) => e.status === "already-satisfied").length
|
|
2654
|
-
), s =
|
|
2666
|
+
), s = A(
|
|
2655
2667
|
() => r.value.filter((e) => e.status === "blocked").length
|
|
2656
2668
|
);
|
|
2657
2669
|
function a(e) {
|
|
@@ -2686,34 +2698,34 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2686
2698
|
return "neutral";
|
|
2687
2699
|
}
|
|
2688
2700
|
}
|
|
2689
|
-
function $(e,
|
|
2701
|
+
function $(e, V) {
|
|
2690
2702
|
var c, _, N;
|
|
2691
|
-
return e === "SKU" ? ((c = t.skuById[
|
|
2703
|
+
return e === "SKU" ? ((c = t.skuById[V]) == null ? void 0 : c.name) ?? V : e === "SKU_GROUP" ? ((_ = t.skuGroupById[V]) == null ? void 0 : _.name) ?? V : e === "RECIPE" ? ((N = t.recipeById[V]) == null ? void 0 : N.name) ?? V : V;
|
|
2692
2704
|
}
|
|
2693
|
-
function
|
|
2705
|
+
function C(e) {
|
|
2694
2706
|
var c, _;
|
|
2695
|
-
const
|
|
2707
|
+
const V = $(e.type, e.id);
|
|
2696
2708
|
if (e.type === "SKU") {
|
|
2697
2709
|
const N = t.skuById[e.id], z = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((_ = N == null ? void 0 : N.unit) == null ? void 0 : _.abbrev) ?? "";
|
|
2698
|
-
return `${
|
|
2710
|
+
return `${V} (${Q(e.amount)} ${z})`.trim();
|
|
2699
2711
|
}
|
|
2700
|
-
return e.type === "RECIPE" ? `${
|
|
2712
|
+
return e.type === "RECIPE" ? `${V} ×${Q(e.amount)}` : V;
|
|
2701
2713
|
}
|
|
2702
2714
|
function I(e) {
|
|
2703
2715
|
return $(e.type, e.id);
|
|
2704
2716
|
}
|
|
2705
|
-
function f(e,
|
|
2706
|
-
const c =
|
|
2707
|
-
return c ?
|
|
2717
|
+
function f(e, V) {
|
|
2718
|
+
const c = V.contains.find((_) => _.type === e.type && _.id === e.id);
|
|
2719
|
+
return c ? C(c) : I(e);
|
|
2708
2720
|
}
|
|
2709
|
-
function k(e,
|
|
2721
|
+
function k(e, V) {
|
|
2710
2722
|
switch (e.type) {
|
|
2711
2723
|
case "add-binding":
|
|
2712
|
-
return `+ ${
|
|
2724
|
+
return `+ ${C(e.binding)}`;
|
|
2713
2725
|
case "remove-binding":
|
|
2714
2726
|
return `− ${I(e.target)}`;
|
|
2715
2727
|
case "replace-binding":
|
|
2716
|
-
return `${f(e.from,
|
|
2728
|
+
return `${f(e.from, V)} → ${C(e.to)}`;
|
|
2717
2729
|
case "update-binding-rule":
|
|
2718
2730
|
return `Rule: ${I(e.target)}`;
|
|
2719
2731
|
case "update-alternatives":
|
|
@@ -2734,7 +2746,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2734
2746
|
return "neutral";
|
|
2735
2747
|
}
|
|
2736
2748
|
}
|
|
2737
|
-
function
|
|
2749
|
+
function b(e) {
|
|
2738
2750
|
switch (e) {
|
|
2739
2751
|
case "applied":
|
|
2740
2752
|
return d("inventory.recipe.bulkEditor.livePreview.outcomeApplied");
|
|
@@ -2748,58 +2760,58 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2748
2760
|
return e;
|
|
2749
2761
|
}
|
|
2750
2762
|
}
|
|
2751
|
-
return (e,
|
|
2763
|
+
return (e, V) => {
|
|
2752
2764
|
const c = G("FmChip");
|
|
2753
|
-
return
|
|
2754
|
-
v("div",
|
|
2755
|
-
x.value + u.value > 0 ? (
|
|
2765
|
+
return y(), E("div", ri, [
|
|
2766
|
+
v("div", ai, [
|
|
2767
|
+
x.value + u.value > 0 ? (y(), E("div", si, [
|
|
2756
2768
|
h(c, {
|
|
2757
2769
|
size: "sm",
|
|
2758
2770
|
label: String(x.value + u.value),
|
|
2759
2771
|
variant: "success"
|
|
2760
2772
|
}, null, 8, ["label"]),
|
|
2761
|
-
v("span",
|
|
2773
|
+
v("span", di, U(n(d)("inventory.recipe.bulkEditor.livePreview.willUpdate")), 1)
|
|
2762
2774
|
])) : T("", !0),
|
|
2763
|
-
o.value > 0 ? (
|
|
2775
|
+
o.value > 0 ? (y(), E("div", ui, [
|
|
2764
2776
|
h(c, {
|
|
2765
2777
|
size: "sm",
|
|
2766
2778
|
label: String(o.value),
|
|
2767
2779
|
variant: "info"
|
|
2768
2780
|
}, null, 8, ["label"]),
|
|
2769
|
-
v("span",
|
|
2781
|
+
v("span", ci, U(n(d)("inventory.recipe.bulkEditor.livePreview.alreadySatisfied")), 1)
|
|
2770
2782
|
])) : T("", !0),
|
|
2771
|
-
s.value > 0 ? (
|
|
2783
|
+
s.value > 0 ? (y(), E("div", pi, [
|
|
2772
2784
|
h(c, {
|
|
2773
2785
|
size: "sm",
|
|
2774
2786
|
label: String(s.value),
|
|
2775
2787
|
variant: "critical"
|
|
2776
2788
|
}, null, 8, ["label"]),
|
|
2777
|
-
v("span",
|
|
2789
|
+
v("span", mi, U(n(d)("inventory.recipe.bulkEditor.livePreview.blocked")), 1)
|
|
2778
2790
|
])) : T("", !0)
|
|
2779
2791
|
]),
|
|
2780
|
-
v("div",
|
|
2781
|
-
r.value.length === 0 ? (
|
|
2782
|
-
(
|
|
2792
|
+
v("div", fi, [
|
|
2793
|
+
r.value.length === 0 ? (y(), E("div", vi, U(n(d)("inventory.recipe.bulkEditor.livePreview.noRecipes")), 1)) : (y(), E("div", yi, [
|
|
2794
|
+
(y(!0), E(X, null, me(r.value, (_) => (y(), E("div", {
|
|
2783
2795
|
key: _.recipeId,
|
|
2784
2796
|
class: "flex flex-col gap-6 px-16 py-10"
|
|
2785
2797
|
}, [
|
|
2786
|
-
v("div",
|
|
2787
|
-
v("span",
|
|
2798
|
+
v("div", bi, [
|
|
2799
|
+
v("span", gi, U(_.recipeName), 1),
|
|
2788
2800
|
h(c, {
|
|
2789
2801
|
size: "sm",
|
|
2790
2802
|
label: a(_.status),
|
|
2791
2803
|
variant: p(_.status)
|
|
2792
2804
|
}, null, 8, ["label", "variant"])
|
|
2793
2805
|
]),
|
|
2794
|
-
_.changes.length > 0 ? (
|
|
2795
|
-
(
|
|
2806
|
+
_.changes.length > 0 ? (y(), E("div", _i, [
|
|
2807
|
+
(y(!0), E(X, null, me(_.changes, (N, z) => (y(), E("div", {
|
|
2796
2808
|
key: z,
|
|
2797
2809
|
class: "flex items-center gap-8"
|
|
2798
2810
|
}, [
|
|
2799
|
-
v("span",
|
|
2811
|
+
v("span", ki, U(k(N.change, _.original)), 1),
|
|
2800
2812
|
h(c, {
|
|
2801
2813
|
size: "sm",
|
|
2802
|
-
label:
|
|
2814
|
+
label: b(N.outcome),
|
|
2803
2815
|
variant: S(N.outcome)
|
|
2804
2816
|
}, null, 8, ["label", "variant"])
|
|
2805
2817
|
]))), 128))
|
|
@@ -2810,13 +2822,13 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2810
2822
|
]);
|
|
2811
2823
|
};
|
|
2812
2824
|
}
|
|
2813
|
-
}),
|
|
2825
|
+
}), xi = { class: "flex flex-col h-full overflow-hidden" }, $i = { class: "flex flex-col min-h-0 shrink-0" }, Ii = { class: "flex items-center gap-8 px-16 pt-12 border-b border-fm-color-border-default" }, wi = { class: "flex-1 overflow-x-auto min-w-0" }, Ei = {
|
|
2814
2826
|
class: "px-16 py-14 overflow-y-auto",
|
|
2815
2827
|
style: { "max-height": "45vh" }
|
|
2816
|
-
},
|
|
2828
|
+
}, Vi = {
|
|
2817
2829
|
key: 0,
|
|
2818
2830
|
class: "flex flex-col items-center justify-center py-40 gap-8 text-center rounded-lg border border-dashed border-fm-color-border-default"
|
|
2819
|
-
},
|
|
2831
|
+
}, Si = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ci = { class: "flex-1 overflow-y-auto px-16 py-14 flex flex-col gap-12 min-h-0" }, Bi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary shrink-0" }, Fi = /* @__PURE__ */ le({
|
|
2820
2832
|
__name: "RecipeBulkEditorStep2",
|
|
2821
2833
|
setup(m) {
|
|
2822
2834
|
const { t: d } = ie(), l = ge(), t = W(null);
|
|
@@ -2831,7 +2843,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2831
2843
|
const a = o.type === "replace-binding" ? o.from.type : o.type === "remove-binding" || o.type === "update-binding-rule" || o.type === "update-alternatives" ? o.target.type : o.type === "add-binding" ? o.binding.type : null;
|
|
2832
2844
|
return a === "RECIPE" ? d("inventory.recipe.bulkEditor.step2.fieldRecipe") : a === "SKU" || a === "SKU_GROUP" ? d("inventory.recipe.bulkEditor.step2.fieldIngredient") : d("inventory.recipe.bulkEditor.step2.tabLabel", { n: s + 1 });
|
|
2833
2845
|
}
|
|
2834
|
-
const r =
|
|
2846
|
+
const r = A(
|
|
2835
2847
|
() => l.modifications.map((o, s) => ({
|
|
2836
2848
|
label: i(o, s),
|
|
2837
2849
|
value: s
|
|
@@ -2855,12 +2867,12 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2855
2867
|
l.removeModification(o);
|
|
2856
2868
|
}
|
|
2857
2869
|
return (o, s) => {
|
|
2858
|
-
const a = G("FmButton"), p = G("FmTab"), $ = G("FmTabs"),
|
|
2859
|
-
return
|
|
2860
|
-
v("div",
|
|
2861
|
-
v("div",
|
|
2862
|
-
v("div",
|
|
2863
|
-
r.value.length > 0 ? (
|
|
2870
|
+
const a = G("FmButton"), p = G("FmTab"), $ = G("FmTabs"), C = G("FmIcon");
|
|
2871
|
+
return y(), E("div", xi, [
|
|
2872
|
+
v("div", $i, [
|
|
2873
|
+
v("div", Ii, [
|
|
2874
|
+
v("div", wi, [
|
|
2875
|
+
r.value.length > 0 ? (y(), Y($, {
|
|
2864
2876
|
key: 0,
|
|
2865
2877
|
"model-value": t.value,
|
|
2866
2878
|
items: r.value,
|
|
@@ -2894,15 +2906,15 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2894
2906
|
onClick: x
|
|
2895
2907
|
}, null, 8, ["label"])
|
|
2896
2908
|
]),
|
|
2897
|
-
v("div",
|
|
2898
|
-
n(l).modifications.length === 0 ? (
|
|
2899
|
-
h(
|
|
2909
|
+
v("div", Ei, [
|
|
2910
|
+
n(l).modifications.length === 0 ? (y(), E("div", Vi, [
|
|
2911
|
+
h(C, {
|
|
2900
2912
|
name: "edit_note",
|
|
2901
2913
|
size: "lg",
|
|
2902
2914
|
class: "text-fm-color-typo-placeholder"
|
|
2903
2915
|
}),
|
|
2904
|
-
v("p",
|
|
2905
|
-
])) : t.value !== null && n(l).modifications[t.value] ? (
|
|
2916
|
+
v("p", Si, U(n(d)("inventory.recipe.bulkEditor.step2.emptyState")), 1)
|
|
2917
|
+
])) : t.value !== null && n(l).modifications[t.value] ? (y(), Y(li, {
|
|
2906
2918
|
key: t.value,
|
|
2907
2919
|
"model-value": n(l).modifications[t.value],
|
|
2908
2920
|
"live-preview-entries": n(l).livePreviewEntries,
|
|
@@ -2911,66 +2923,66 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2911
2923
|
])
|
|
2912
2924
|
]),
|
|
2913
2925
|
s[3] || (s[3] = v("div", { class: "border-t border-fm-color-border-default shrink-0" }, null, -1)),
|
|
2914
|
-
v("div",
|
|
2926
|
+
v("div", Ci, [
|
|
2915
2927
|
v("span", Bi, U(n(d)("inventory.recipe.bulkEditor.step2.livePreviewTitle")), 1),
|
|
2916
|
-
h(
|
|
2928
|
+
h(hi)
|
|
2917
2929
|
])
|
|
2918
2930
|
]);
|
|
2919
2931
|
};
|
|
2920
2932
|
}
|
|
2921
2933
|
});
|
|
2922
|
-
function
|
|
2934
|
+
function Ri(m) {
|
|
2923
2935
|
return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
|
|
2924
2936
|
}
|
|
2925
|
-
function
|
|
2937
|
+
function Ai() {
|
|
2926
2938
|
const m = ne(), d = ge(), l = m.skuById, t = m.recipeById, i = m.skuGroupById, x = Object.values(d.entries).filter(
|
|
2927
2939
|
(s) => s.status === "will-update" || s.status === "partially-ignored"
|
|
2928
2940
|
).flatMap((s, a) => {
|
|
2929
|
-
var
|
|
2930
|
-
const p = s.projected ?? s.original, $ =
|
|
2931
|
-
if ((
|
|
2941
|
+
var C;
|
|
2942
|
+
const p = s.projected ?? s.original, $ = Ri(p.customAttributes);
|
|
2943
|
+
if ((C = p.contains) != null && C.length) {
|
|
2932
2944
|
const I = p.contains.filter((S) => S.type === "RECIPE"), f = p.contains.filter((S) => S.type === "SKU"), k = p.contains.filter((S) => S.type === "SKU_GROUP");
|
|
2933
2945
|
return [
|
|
2934
2946
|
...a === 0 ? [] : [["", "", "", "", "", "", ""]],
|
|
2935
2947
|
...I.map(
|
|
2936
|
-
(S,
|
|
2948
|
+
(S, b) => {
|
|
2937
2949
|
var e;
|
|
2938
2950
|
return [
|
|
2939
|
-
|
|
2951
|
+
b === 0 ? p.name : "",
|
|
2940
2952
|
"RECIPE",
|
|
2941
2953
|
"",
|
|
2942
2954
|
((e = t[S.id]) == null ? void 0 : e.name) ?? S.id,
|
|
2943
2955
|
Q(S.amount),
|
|
2944
2956
|
"UNIT",
|
|
2945
|
-
|
|
2957
|
+
b === 0 ? $ : ""
|
|
2946
2958
|
];
|
|
2947
2959
|
}
|
|
2948
2960
|
),
|
|
2949
2961
|
...f.map(
|
|
2950
|
-
(S,
|
|
2951
|
-
var e,
|
|
2962
|
+
(S, b) => {
|
|
2963
|
+
var e, V, c, _;
|
|
2952
2964
|
return [
|
|
2953
|
-
!I.length &&
|
|
2965
|
+
!I.length && b === 0 ? p.name : "",
|
|
2954
2966
|
"INGREDIENT",
|
|
2955
2967
|
((e = l[S.id]) == null ? void 0 : e.code) ?? "",
|
|
2956
|
-
((
|
|
2968
|
+
((V = l[S.id]) == null ? void 0 : V.name) ?? S.id,
|
|
2957
2969
|
Q(S.amount),
|
|
2958
2970
|
S.measurement ? S.measurement.abbrev : ((_ = (c = l[S.id]) == null ? void 0 : c.unit) == null ? void 0 : _.abbrev) ?? "",
|
|
2959
|
-
!I.length &&
|
|
2971
|
+
!I.length && b === 0 ? $ : ""
|
|
2960
2972
|
];
|
|
2961
2973
|
}
|
|
2962
2974
|
),
|
|
2963
2975
|
...k.map(
|
|
2964
|
-
(S,
|
|
2965
|
-
var e,
|
|
2976
|
+
(S, b) => {
|
|
2977
|
+
var e, V;
|
|
2966
2978
|
return [
|
|
2967
|
-
I.length === 0 && f.length === 0 &&
|
|
2979
|
+
I.length === 0 && f.length === 0 && b === 0 ? p.name : "",
|
|
2968
2980
|
"SKU_GROUP",
|
|
2969
2981
|
((e = i[S.id]) == null ? void 0 : e.ref) ?? "",
|
|
2970
|
-
((
|
|
2982
|
+
((V = i[S.id]) == null ? void 0 : V.name) ?? S.id,
|
|
2971
2983
|
Q(S.amount),
|
|
2972
2984
|
"UNIT",
|
|
2973
|
-
I.length === 0 && f.length === 0 &&
|
|
2985
|
+
I.length === 0 && f.length === 0 && b === 0 ? $ : ""
|
|
2974
2986
|
];
|
|
2975
2987
|
}
|
|
2976
2988
|
)
|
|
@@ -2983,116 +2995,116 @@ function Ri() {
|
|
|
2983
2995
|
}), o = at(x, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
|
|
2984
2996
|
st(o, `RECIPE_BULK_EDIT_${dt(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
|
|
2985
2997
|
}
|
|
2986
|
-
const
|
|
2998
|
+
const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, Pi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, Mi = { class: "flex flex-wrap gap-12" }, Di = { class: "flex items-center gap-6" }, Gi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ni = {
|
|
2987
2999
|
key: 0,
|
|
2988
3000
|
class: "flex items-center gap-6"
|
|
2989
|
-
},
|
|
3001
|
+
}, zi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oi = {
|
|
2990
3002
|
key: 1,
|
|
2991
3003
|
class: "flex items-center gap-6"
|
|
2992
|
-
},
|
|
3004
|
+
}, Li = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ji = {
|
|
2993
3005
|
key: 2,
|
|
2994
3006
|
class: "flex items-center gap-6"
|
|
2995
|
-
},
|
|
3007
|
+
}, Ki = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qi = {
|
|
2996
3008
|
key: 3,
|
|
2997
3009
|
class: "flex items-center gap-6"
|
|
2998
|
-
},
|
|
3010
|
+
}, Wi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yi = { class: "mt-12" }, Ji = ["onClick"], Hi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary flex-1 truncate" }, Qi = {
|
|
2999
3011
|
key: 0,
|
|
3000
3012
|
class: "px-12 py-8 border-b border-fm-color-border-default"
|
|
3001
|
-
},
|
|
3013
|
+
}, Xi = { class: "px-12 py-10 leading-relaxed" }, Zi = {
|
|
3002
3014
|
key: 2,
|
|
3003
3015
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-placeholder italic"
|
|
3004
|
-
},
|
|
3016
|
+
}, el = { class: "flex items-center gap-12 px-12 py-8 border-t border-fm-color-border-default bg-fm-color-surface-secondary text-fm-color-typo-secondary fm-typo-en-body-xs-400" }, tl = { key: 0 }, nl = { key: 1 }, ol = {
|
|
3005
3017
|
key: 2,
|
|
3006
3018
|
class: "text-fm-color-warning"
|
|
3007
|
-
},
|
|
3019
|
+
}, il = {
|
|
3008
3020
|
key: 3,
|
|
3009
3021
|
class: "text-fm-color-error"
|
|
3010
|
-
},
|
|
3022
|
+
}, ll = {
|
|
3011
3023
|
key: 4,
|
|
3012
3024
|
class: "text-fm-color-typo-placeholder"
|
|
3013
|
-
},
|
|
3025
|
+
}, rl = /* @__PURE__ */ le({
|
|
3014
3026
|
__name: "RecipeBulkEditorSummaryStep",
|
|
3015
3027
|
setup(m) {
|
|
3016
|
-
const { t: d } = ie(), l = ne(), t = ge(), i =
|
|
3028
|
+
const { t: d } = ie(), l = ne(), t = ge(), i = A(() => Object.values(t.entries)), r = A(
|
|
3017
3029
|
() => i.value.filter((e) => e.status === "will-update").length
|
|
3018
|
-
), x =
|
|
3030
|
+
), x = A(
|
|
3019
3031
|
() => i.value.filter((e) => e.status === "partially-ignored").length
|
|
3020
|
-
), u =
|
|
3032
|
+
), u = A(
|
|
3021
3033
|
() => i.value.filter((e) => e.status === "already-satisfied").length
|
|
3022
|
-
), o =
|
|
3034
|
+
), o = A(
|
|
3023
3035
|
() => i.value.filter((e) => e.status === "blocked").length
|
|
3024
|
-
), s =
|
|
3036
|
+
), s = A(
|
|
3025
3037
|
() => i.value.filter((e) => e.status === "no-applicable-changes").length
|
|
3026
3038
|
), a = W(/* @__PURE__ */ new Set());
|
|
3027
3039
|
function p(e) {
|
|
3028
3040
|
return a.value.has(e);
|
|
3029
3041
|
}
|
|
3030
3042
|
function $(e) {
|
|
3031
|
-
const
|
|
3032
|
-
|
|
3043
|
+
const V = new Set(a.value);
|
|
3044
|
+
V.has(e) ? V.delete(e) : V.add(e), a.value = V;
|
|
3033
3045
|
}
|
|
3034
|
-
function
|
|
3046
|
+
function C(e) {
|
|
3035
3047
|
var _, N, z;
|
|
3036
|
-
const
|
|
3048
|
+
const V = [], c = ke(e.contains, /* @__PURE__ */ new Set([e._id]), l.recipeById);
|
|
3037
3049
|
for (let g = 0; g < c.length; g++) {
|
|
3038
|
-
const
|
|
3050
|
+
const B = c[g], F = B.recipeIds.slice(1).length > 0, R = F ? ((_ = l.recipeById[B.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? "" : "";
|
|
3039
3051
|
let P;
|
|
3040
|
-
if (
|
|
3041
|
-
const K = l.skuGroupById[
|
|
3052
|
+
if (B.isGroup) {
|
|
3053
|
+
const K = l.skuGroupById[B.id];
|
|
3042
3054
|
if (!K) continue;
|
|
3043
|
-
const H = `x${Q(
|
|
3044
|
-
P = F ? `(${
|
|
3055
|
+
const H = `x${Q(B.amount)}`;
|
|
3056
|
+
P = F ? `(${R}) ${K.name} (${H})` : `${K.name} (${H})`;
|
|
3045
3057
|
} else {
|
|
3046
|
-
const K = l.skuById[
|
|
3058
|
+
const K = l.skuById[B.id];
|
|
3047
3059
|
if (!K) continue;
|
|
3048
|
-
const H = ((N =
|
|
3049
|
-
P = F ? `(${
|
|
3060
|
+
const H = ((N = B.measurement) == null ? void 0 : N.abbrev) ?? ((z = K.unit) == null ? void 0 : z.abbrev) ?? "", ee = `${Q(B.amount)}${H}`;
|
|
3061
|
+
P = F ? `(${R}) ${K.name} (${ee})` : `${K.name} (${ee})`;
|
|
3050
3062
|
}
|
|
3051
|
-
g > 0 &&
|
|
3063
|
+
g > 0 && V.push({ text: ", " }), V.push({ text: P });
|
|
3052
3064
|
}
|
|
3053
|
-
return
|
|
3065
|
+
return V;
|
|
3054
3066
|
}
|
|
3055
3067
|
function I(e) {
|
|
3056
|
-
var g,
|
|
3068
|
+
var g, B, F, R;
|
|
3057
3069
|
if (e.isGroup) {
|
|
3058
3070
|
const P = l.skuGroupById[e.id];
|
|
3059
3071
|
if (!P) return "";
|
|
3060
3072
|
const K = e.recipeIds.slice(1).length > 0, H = K ? ((g = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? "" : "", ee = `x${Q(e.amount)}`;
|
|
3061
3073
|
return K ? `(${H}) ${P.name} (${ee})` : `${P.name} (${ee})`;
|
|
3062
3074
|
}
|
|
3063
|
-
const
|
|
3064
|
-
if (!
|
|
3065
|
-
const c = e.recipeIds.slice(1).length > 0, _ = c ? ((
|
|
3066
|
-
return c ? `(${_}) ${
|
|
3075
|
+
const V = l.skuById[e.id];
|
|
3076
|
+
if (!V) return "";
|
|
3077
|
+
const c = e.recipeIds.slice(1).length > 0, _ = c ? ((B = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : B.name) ?? "" : "", N = ((F = e.measurement) == null ? void 0 : F.abbrev) ?? ((R = V.unit) == null ? void 0 : R.abbrev) ?? "", z = `${Q(e.amount)}${N}`;
|
|
3078
|
+
return c ? `(${_}) ${V.name} (${z})` : `${V.name} (${z})`;
|
|
3067
3079
|
}
|
|
3068
3080
|
function f(e) {
|
|
3069
3081
|
if (!e.projected) return [];
|
|
3070
|
-
const
|
|
3071
|
-
for (const F of
|
|
3082
|
+
const V = ke(e.original.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), c = ke(e.projected.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), _ = /* @__PURE__ */ new Map();
|
|
3083
|
+
for (const F of V) _.set(`${F.type}:${F.id}`, F);
|
|
3072
3084
|
const N = /* @__PURE__ */ new Map();
|
|
3073
3085
|
for (const F of c) N.set(`${F.type}:${F.id}`, F);
|
|
3074
3086
|
const z = [];
|
|
3075
3087
|
let g = !0;
|
|
3076
|
-
function
|
|
3077
|
-
|
|
3088
|
+
function B(F, R) {
|
|
3089
|
+
R && (g || z.push({ kind: "unchanged", text: ", " }), z.push({ kind: F, text: R }), g = !1);
|
|
3078
3090
|
}
|
|
3079
|
-
for (const [F,
|
|
3091
|
+
for (const [F, R] of _) {
|
|
3080
3092
|
const P = N.get(F);
|
|
3081
3093
|
if (!P)
|
|
3082
|
-
|
|
3094
|
+
B("removed", I(R));
|
|
3083
3095
|
else {
|
|
3084
|
-
const K = I(
|
|
3085
|
-
K === H ?
|
|
3096
|
+
const K = I(R), H = I(P);
|
|
3097
|
+
K === H ? B("unchanged", K) : (B("removed", K), B("added", H));
|
|
3086
3098
|
}
|
|
3087
3099
|
}
|
|
3088
|
-
for (const [F,
|
|
3089
|
-
_.has(F) ||
|
|
3100
|
+
for (const [F, R] of N)
|
|
3101
|
+
_.has(F) || B("added", I(R));
|
|
3090
3102
|
return z;
|
|
3091
3103
|
}
|
|
3092
|
-
const k =
|
|
3104
|
+
const k = A(() => {
|
|
3093
3105
|
const e = /* @__PURE__ */ new Map();
|
|
3094
|
-
for (const
|
|
3095
|
-
e.set(
|
|
3106
|
+
for (const V of i.value)
|
|
3107
|
+
e.set(V.recipeId, f(V));
|
|
3096
3108
|
return e;
|
|
3097
3109
|
});
|
|
3098
3110
|
function S(e) {
|
|
@@ -3111,7 +3123,7 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3111
3123
|
return "";
|
|
3112
3124
|
}
|
|
3113
3125
|
}
|
|
3114
|
-
function
|
|
3126
|
+
function b(e) {
|
|
3115
3127
|
switch (e) {
|
|
3116
3128
|
case "will-update":
|
|
3117
3129
|
return "success";
|
|
@@ -3127,84 +3139,84 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3127
3139
|
return "neutral";
|
|
3128
3140
|
}
|
|
3129
3141
|
}
|
|
3130
|
-
return (e,
|
|
3142
|
+
return (e, V) => {
|
|
3131
3143
|
const c = G("FmChip"), _ = G("FmButton"), N = G("FmBanner"), z = G("FmIcon");
|
|
3132
|
-
return
|
|
3133
|
-
v("div",
|
|
3134
|
-
v("p",
|
|
3135
|
-
v("div",
|
|
3136
|
-
v("div",
|
|
3144
|
+
return y(), E("div", Ti, [
|
|
3145
|
+
v("div", Ui, [
|
|
3146
|
+
v("p", Pi, U(n(d)("inventory.recipe.bulkEditor.summary.title")), 1),
|
|
3147
|
+
v("div", Mi, [
|
|
3148
|
+
v("div", Di, [
|
|
3137
3149
|
h(c, {
|
|
3138
3150
|
size: "sm",
|
|
3139
3151
|
label: String(r.value),
|
|
3140
3152
|
variant: "success"
|
|
3141
3153
|
}, null, 8, ["label"]),
|
|
3142
|
-
v("span",
|
|
3154
|
+
v("span", Gi, U(n(d)("inventory.recipe.bulkEditor.summary.countWillUpdate")), 1)
|
|
3143
3155
|
]),
|
|
3144
|
-
x.value > 0 ? (
|
|
3156
|
+
x.value > 0 ? (y(), E("div", Ni, [
|
|
3145
3157
|
h(c, {
|
|
3146
3158
|
size: "sm",
|
|
3147
3159
|
label: String(x.value),
|
|
3148
3160
|
variant: "warning"
|
|
3149
3161
|
}, null, 8, ["label"]),
|
|
3150
|
-
v("span",
|
|
3162
|
+
v("span", zi, U(n(d)("inventory.recipe.bulkEditor.summary.countPartiallyIgnored")), 1)
|
|
3151
3163
|
])) : T("", !0),
|
|
3152
|
-
u.value > 0 ? (
|
|
3164
|
+
u.value > 0 ? (y(), E("div", Oi, [
|
|
3153
3165
|
h(c, {
|
|
3154
3166
|
size: "sm",
|
|
3155
3167
|
label: String(u.value),
|
|
3156
3168
|
variant: "info"
|
|
3157
3169
|
}, null, 8, ["label"]),
|
|
3158
|
-
v("span",
|
|
3170
|
+
v("span", Li, U(n(d)("inventory.recipe.bulkEditor.summary.countAlreadySatisfied")), 1)
|
|
3159
3171
|
])) : T("", !0),
|
|
3160
|
-
o.value > 0 ? (
|
|
3172
|
+
o.value > 0 ? (y(), E("div", ji, [
|
|
3161
3173
|
h(c, {
|
|
3162
3174
|
size: "sm",
|
|
3163
3175
|
label: String(o.value),
|
|
3164
3176
|
variant: "critical"
|
|
3165
3177
|
}, null, 8, ["label"]),
|
|
3166
|
-
v("span",
|
|
3178
|
+
v("span", Ki, U(n(d)("inventory.recipe.bulkEditor.summary.countBlocked")), 1)
|
|
3167
3179
|
])) : T("", !0),
|
|
3168
|
-
s.value > 0 ? (
|
|
3180
|
+
s.value > 0 ? (y(), E("div", qi, [
|
|
3169
3181
|
h(c, {
|
|
3170
3182
|
size: "sm",
|
|
3171
3183
|
label: String(s.value),
|
|
3172
3184
|
variant: "neutral"
|
|
3173
3185
|
}, null, 8, ["label"]),
|
|
3174
|
-
v("span",
|
|
3186
|
+
v("span", Wi, U(n(d)("inventory.recipe.bulkEditor.summary.countNoChanges")), 1)
|
|
3175
3187
|
])) : T("", !0)
|
|
3176
3188
|
]),
|
|
3177
|
-
v("div",
|
|
3189
|
+
v("div", Yi, [
|
|
3178
3190
|
h(_, {
|
|
3179
3191
|
label: n(d)("common.export"),
|
|
3180
3192
|
variant: "secondary",
|
|
3181
3193
|
size: "md",
|
|
3182
|
-
onClick: n(
|
|
3194
|
+
onClick: n(Ai)
|
|
3183
3195
|
}, null, 8, ["label", "onClick"])
|
|
3184
3196
|
]),
|
|
3185
|
-
r.value === 0 && x.value === 0 ? (
|
|
3197
|
+
r.value === 0 && x.value === 0 ? (y(), Y(N, {
|
|
3186
3198
|
key: 0,
|
|
3187
3199
|
class: "mt-12",
|
|
3188
3200
|
type: "warning",
|
|
3189
3201
|
message: n(d)("inventory.recipe.bulkEditor.summary.nothingToSubmit")
|
|
3190
3202
|
}, null, 8, ["message"])) : T("", !0)
|
|
3191
3203
|
]),
|
|
3192
|
-
(
|
|
3204
|
+
(y(!0), E(X, null, me(i.value, (g) => (y(), E("div", {
|
|
3193
3205
|
key: g.recipeId,
|
|
3194
3206
|
class: "rounded-lg border border-fm-color-border-default overflow-hidden"
|
|
3195
3207
|
}, [
|
|
3196
3208
|
v("button", {
|
|
3197
3209
|
type: "button",
|
|
3198
|
-
class:
|
|
3199
|
-
onClick: (
|
|
3210
|
+
class: Ce(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !p(g.recipeId) }]),
|
|
3211
|
+
onClick: (B) => $(g.recipeId)
|
|
3200
3212
|
}, [
|
|
3201
3213
|
h(z, {
|
|
3202
3214
|
name: p(g.recipeId) ? "expand_less" : "expand_more",
|
|
3203
3215
|
size: "sm",
|
|
3204
3216
|
class: "text-fm-color-typo-secondary flex-shrink-0"
|
|
3205
3217
|
}, null, 8, ["name"]),
|
|
3206
|
-
v("span",
|
|
3207
|
-
g.original.version === "v2" ? (
|
|
3218
|
+
v("span", Hi, U(g.recipeName), 1),
|
|
3219
|
+
g.original.version === "v2" ? (y(), Y(c, {
|
|
3208
3220
|
key: 0,
|
|
3209
3221
|
size: "sm",
|
|
3210
3222
|
label: "V2",
|
|
@@ -3213,67 +3225,67 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3213
3225
|
h(c, {
|
|
3214
3226
|
size: "sm",
|
|
3215
3227
|
label: S(g.status),
|
|
3216
|
-
variant:
|
|
3228
|
+
variant: b(g.status)
|
|
3217
3229
|
}, null, 8, ["label", "variant"])
|
|
3218
|
-
], 10,
|
|
3219
|
-
p(g.recipeId) ? (
|
|
3220
|
-
n(t).applyErrors.has(g.recipeId) ? (
|
|
3230
|
+
], 10, Ji),
|
|
3231
|
+
p(g.recipeId) ? (y(), E(X, { key: 0 }, [
|
|
3232
|
+
n(t).applyErrors.has(g.recipeId) ? (y(), E("div", Qi, [
|
|
3221
3233
|
h(N, {
|
|
3222
3234
|
type: "error",
|
|
3223
3235
|
message: n(t).applyErrors.get(g.recipeId)
|
|
3224
3236
|
}, null, 8, ["message"])
|
|
3225
3237
|
])) : T("", !0),
|
|
3226
|
-
v("div",
|
|
3227
|
-
g.projected ? (k.value.get(g.recipeId) ?? []).length > 0 ? (
|
|
3238
|
+
v("div", Xi, [
|
|
3239
|
+
g.projected ? (k.value.get(g.recipeId) ?? []).length > 0 ? (y(!0), E(X, { key: 1 }, me(k.value.get(g.recipeId), (B, F) => (y(), E("span", {
|
|
3228
3240
|
key: F,
|
|
3229
|
-
class:
|
|
3230
|
-
"text-fm-color-typo-secondary":
|
|
3231
|
-
"line-through text-fm-color-error font-medium":
|
|
3232
|
-
"text-fm-color-success font-medium":
|
|
3241
|
+
class: Ce(["fm-typo-en-body-sm-400", {
|
|
3242
|
+
"text-fm-color-typo-secondary": B.kind === "unchanged",
|
|
3243
|
+
"line-through text-fm-color-error font-medium": B.kind === "removed",
|
|
3244
|
+
"text-fm-color-success font-medium": B.kind === "added"
|
|
3233
3245
|
}])
|
|
3234
|
-
}, U(
|
|
3246
|
+
}, U(B.text), 3))), 128)) : (y(), E("span", Zi, U(n(d)("inventory.recipe.bulkEditor.summary.emptyBindings")), 1)) : (y(!0), E(X, { key: 0 }, me(C(g.original), (B, F) => (y(), E("span", {
|
|
3235
3247
|
key: F,
|
|
3236
3248
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-placeholder"
|
|
3237
|
-
}, U(
|
|
3249
|
+
}, U(B.text), 1))), 128))
|
|
3238
3250
|
]),
|
|
3239
|
-
v("div",
|
|
3240
|
-
g.counts.applied > 0 ? (
|
|
3241
|
-
g.counts.satisfied > 0 ? (
|
|
3242
|
-
g.counts.ignored > 0 ? (
|
|
3243
|
-
g.counts.blocked > 0 ? (
|
|
3244
|
-
g.counts.applied === 0 && g.counts.satisfied === 0 && g.counts.ignored === 0 && g.counts.blocked === 0 ? (
|
|
3251
|
+
v("div", el, [
|
|
3252
|
+
g.counts.applied > 0 ? (y(), E("span", tl, U(n(d)("inventory.recipe.bulkEditor.summary.footerApplied", { count: g.counts.applied })), 1)) : T("", !0),
|
|
3253
|
+
g.counts.satisfied > 0 ? (y(), E("span", nl, U(n(d)("inventory.recipe.bulkEditor.summary.footerSatisfied", { count: g.counts.satisfied })), 1)) : T("", !0),
|
|
3254
|
+
g.counts.ignored > 0 ? (y(), E("span", ol, U(n(d)("inventory.recipe.bulkEditor.summary.footerIgnored", { count: g.counts.ignored })), 1)) : T("", !0),
|
|
3255
|
+
g.counts.blocked > 0 ? (y(), E("span", il, U(n(d)("inventory.recipe.bulkEditor.summary.footerBlocked", { count: g.counts.blocked })), 1)) : T("", !0),
|
|
3256
|
+
g.counts.applied === 0 && g.counts.satisfied === 0 && g.counts.ignored === 0 && g.counts.blocked === 0 ? (y(), E("span", ll, U(n(d)("inventory.recipe.bulkEditor.summary.noChangesDetail")), 1)) : T("", !0)
|
|
3245
3257
|
])
|
|
3246
3258
|
], 64)) : T("", !0)
|
|
3247
3259
|
]))), 128))
|
|
3248
3260
|
]);
|
|
3249
3261
|
};
|
|
3250
3262
|
}
|
|
3251
|
-
}),
|
|
3263
|
+
}), al = { class: "flex items-center gap-12" }, sl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, dl = {
|
|
3252
3264
|
key: 0,
|
|
3253
3265
|
class: "h-[calc(98vh-120px)] overflow-hidden flex flex-col"
|
|
3254
|
-
},
|
|
3266
|
+
}, ul = {
|
|
3255
3267
|
key: 1,
|
|
3256
3268
|
class: "h-[calc(98vh-120px)] overflow-hidden flex flex-col"
|
|
3257
|
-
},
|
|
3269
|
+
}, cl = {
|
|
3258
3270
|
key: 2,
|
|
3259
3271
|
class: "h-[calc(98vh-120px)] overflow-y-auto px-24 py-20"
|
|
3260
|
-
},
|
|
3272
|
+
}, pl = {
|
|
3261
3273
|
key: 0,
|
|
3262
3274
|
class: "flex items-center gap-8 px-4"
|
|
3263
|
-
},
|
|
3275
|
+
}, ml = {
|
|
3264
3276
|
key: 1,
|
|
3265
3277
|
class: "flex items-center gap-8 px-4"
|
|
3266
|
-
},
|
|
3278
|
+
}, fl = {
|
|
3267
3279
|
key: 2,
|
|
3268
3280
|
class: "flex items-center gap-8 px-4"
|
|
3269
|
-
},
|
|
3281
|
+
}, vl = /* @__PURE__ */ le({
|
|
3270
3282
|
__name: "RecipeBulkEditorDialog",
|
|
3271
3283
|
props: {
|
|
3272
3284
|
show: { type: Boolean }
|
|
3273
3285
|
},
|
|
3274
3286
|
emits: ["update:show"],
|
|
3275
3287
|
setup(m, { emit: d }) {
|
|
3276
|
-
const l = m, { t } = ie(), i = ge(), r = Ge(l, "show"), x = Le(), u =
|
|
3288
|
+
const l = m, { t } = ie(), i = ge(), r = Ge(l, "show"), x = Le(), u = A(() => i.currentStep === 1), o = A(() => i.currentStep === 2), s = A(() => i.currentStep === 3);
|
|
3277
3289
|
function a() {
|
|
3278
3290
|
i.currentStep = 2;
|
|
3279
3291
|
}
|
|
@@ -3283,7 +3295,7 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3283
3295
|
function $() {
|
|
3284
3296
|
i.goToStep3();
|
|
3285
3297
|
}
|
|
3286
|
-
function
|
|
3298
|
+
function C() {
|
|
3287
3299
|
i.backToStep2();
|
|
3288
3300
|
}
|
|
3289
3301
|
function I() {
|
|
@@ -3307,8 +3319,8 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3307
3319
|
r.value = !1, i.reset();
|
|
3308
3320
|
}
|
|
3309
3321
|
return (k, S) => {
|
|
3310
|
-
const
|
|
3311
|
-
return
|
|
3322
|
+
const b = G("FmChip"), e = G("FmButton"), V = G("FmDialog");
|
|
3323
|
+
return y(), Y(V, {
|
|
3312
3324
|
modelValue: n(r),
|
|
3313
3325
|
"onUpdate:modelValue": [
|
|
3314
3326
|
S[0] || (S[0] = (c) => De(r) ? r.value = c : null),
|
|
@@ -3322,9 +3334,9 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3322
3334
|
"max-height": "98vh"
|
|
3323
3335
|
}, {
|
|
3324
3336
|
"dialog-header": J(() => [
|
|
3325
|
-
v("div",
|
|
3326
|
-
v("span",
|
|
3327
|
-
h(
|
|
3337
|
+
v("div", al, [
|
|
3338
|
+
v("span", sl, U(n(t)("inventory.recipe.bulkEditor.title")), 1),
|
|
3339
|
+
h(b, {
|
|
3328
3340
|
size: "sm",
|
|
3329
3341
|
label: n(t)("inventory.recipe.bulkEditor.stepIndicator", { step: n(i).currentStep, total: 3 }),
|
|
3330
3342
|
variant: "neutral"
|
|
@@ -3332,7 +3344,7 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3332
3344
|
])
|
|
3333
3345
|
]),
|
|
3334
3346
|
"dialog-footer": J(() => [
|
|
3335
|
-
u.value ? (
|
|
3347
|
+
u.value ? (y(), E("div", pl, [
|
|
3336
3348
|
h(e, {
|
|
3337
3349
|
label: n(t)("common.next"),
|
|
3338
3350
|
disabled: !n(i).canGoToStep2,
|
|
@@ -3343,7 +3355,7 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3343
3355
|
variant: "tertiary",
|
|
3344
3356
|
onClick: f
|
|
3345
3357
|
}, null, 8, ["label"])
|
|
3346
|
-
])) : o.value ? (
|
|
3358
|
+
])) : o.value ? (y(), E("div", ml, [
|
|
3347
3359
|
h(e, {
|
|
3348
3360
|
label: n(t)("inventory.recipe.bulkEditor.step2.reviewButton"),
|
|
3349
3361
|
disabled: !n(i).canGoToStep3,
|
|
@@ -3359,7 +3371,7 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3359
3371
|
variant: "tertiary",
|
|
3360
3372
|
onClick: f
|
|
3361
3373
|
}, null, 8, ["label"])
|
|
3362
|
-
])) : s.value ? (
|
|
3374
|
+
])) : s.value ? (y(), E("div", fl, [
|
|
3363
3375
|
h(e, {
|
|
3364
3376
|
label: n(t)("inventory.recipe.bulkEditor.step3.confirmButton"),
|
|
3365
3377
|
disabled: n(i).isSaving,
|
|
@@ -3370,7 +3382,7 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3370
3382
|
label: n(t)("common.back"),
|
|
3371
3383
|
variant: "secondary",
|
|
3372
3384
|
disabled: n(i).isSaving,
|
|
3373
|
-
onClick:
|
|
3385
|
+
onClick: C
|
|
3374
3386
|
}, null, 8, ["label", "disabled"]),
|
|
3375
3387
|
h(e, {
|
|
3376
3388
|
label: n(t)("common.close"),
|
|
@@ -3381,12 +3393,12 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3381
3393
|
])) : T("", !0)
|
|
3382
3394
|
]),
|
|
3383
3395
|
default: J(() => [
|
|
3384
|
-
u.value ? (
|
|
3385
|
-
h(
|
|
3386
|
-
])) : o.value ? (
|
|
3387
|
-
h(
|
|
3388
|
-
])) : s.value ? (
|
|
3389
|
-
h(
|
|
3396
|
+
u.value ? (y(), E("div", dl, [
|
|
3397
|
+
h(Oo)
|
|
3398
|
+
])) : o.value ? (y(), E("div", ul, [
|
|
3399
|
+
h(Fi)
|
|
3400
|
+
])) : s.value ? (y(), E("div", cl, [
|
|
3401
|
+
h(rl)
|
|
3390
3402
|
])) : T("", !0)
|
|
3391
3403
|
]),
|
|
3392
3404
|
_: 1
|
|
@@ -3394,15 +3406,15 @@ const Ai = { class: "flex flex-col gap-16" }, Ti = { class: "rounded-lg border b
|
|
|
3394
3406
|
};
|
|
3395
3407
|
}
|
|
3396
3408
|
});
|
|
3397
|
-
function
|
|
3409
|
+
function yl(m) {
|
|
3398
3410
|
return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
|
|
3399
3411
|
}
|
|
3400
|
-
function
|
|
3412
|
+
function bl() {
|
|
3401
3413
|
const m = ne(), d = m.recipes, l = m.recipeById, t = m.skuById, i = m.skuGroupById, r = d.flatMap((o, s) => {
|
|
3402
3414
|
var p;
|
|
3403
|
-
const a =
|
|
3415
|
+
const a = yl(o.customAttributes);
|
|
3404
3416
|
if ((p = o.contains) != null && p.length) {
|
|
3405
|
-
const $ = o.contains.filter((f) => f.type === "RECIPE"),
|
|
3417
|
+
const $ = o.contains.filter((f) => f.type === "RECIPE"), C = o.contains.filter((f) => f.type === "SKU"), I = o.contains.filter((f) => f.type === "SKU_GROUP");
|
|
3406
3418
|
return [
|
|
3407
3419
|
...s === 0 ? [] : [["", "", "", "", "", "", ""]],
|
|
3408
3420
|
...$.map(
|
|
@@ -3419,31 +3431,31 @@ function yl() {
|
|
|
3419
3431
|
];
|
|
3420
3432
|
}
|
|
3421
3433
|
),
|
|
3422
|
-
...
|
|
3434
|
+
...C.map(
|
|
3423
3435
|
(f, k) => {
|
|
3424
|
-
var S,
|
|
3436
|
+
var S, b, e, V;
|
|
3425
3437
|
return [
|
|
3426
3438
|
!$.length && k === 0 ? o.name : "",
|
|
3427
3439
|
"INGREDIENT",
|
|
3428
3440
|
(S = t[f.id]) == null ? void 0 : S.code,
|
|
3429
|
-
(
|
|
3441
|
+
(b = t[f.id]) == null ? void 0 : b.name,
|
|
3430
3442
|
Q(f.amount),
|
|
3431
|
-
f.measurement ? f.measurement.abbrev : (
|
|
3443
|
+
f.measurement ? f.measurement.abbrev : (V = (e = t[f.id]) == null ? void 0 : e.unit) == null ? void 0 : V.abbrev,
|
|
3432
3444
|
!$.length && k === 0 ? a : ""
|
|
3433
3445
|
];
|
|
3434
3446
|
}
|
|
3435
3447
|
),
|
|
3436
3448
|
...I.map(
|
|
3437
3449
|
(f, k) => {
|
|
3438
|
-
var S,
|
|
3450
|
+
var S, b;
|
|
3439
3451
|
return [
|
|
3440
|
-
$.length === 0 &&
|
|
3452
|
+
$.length === 0 && C.length === 0 && k === 0 ? o.name : "",
|
|
3441
3453
|
"SKU_GROUP",
|
|
3442
3454
|
((S = i[f.id]) == null ? void 0 : S.ref) || "",
|
|
3443
|
-
(
|
|
3455
|
+
(b = i[f.id]) == null ? void 0 : b.name,
|
|
3444
3456
|
Q(f.amount),
|
|
3445
3457
|
"UNIT",
|
|
3446
|
-
$.length === 0 &&
|
|
3458
|
+
$.length === 0 && C.length === 0 && k === 0 ? a : ""
|
|
3447
3459
|
];
|
|
3448
3460
|
}
|
|
3449
3461
|
)
|
|
@@ -3456,38 +3468,38 @@ function yl() {
|
|
|
3456
3468
|
}), u = at(r, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
|
|
3457
3469
|
st(u, `RECIPE_${dt(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
|
|
3458
3470
|
}
|
|
3459
|
-
const
|
|
3471
|
+
const gl = { class: "flex flex-col py-8" }, _l = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, kl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Hl = /* @__PURE__ */ le({
|
|
3460
3472
|
__name: "RecipeView",
|
|
3461
3473
|
setup(m) {
|
|
3462
|
-
const d = ne(), l =
|
|
3474
|
+
const d = ne(), l = A(() => d.recipes), t = tt(), { createRecipe: i, updateRecipe: r } = ze(), { recipeDialogProps: x, recipeViewLoading: u } = Et(ze()), { columnDefs: o, formatRowData: s } = Jt(), a = A(() => s(l.value)), p = ge(), $ = We();
|
|
3463
3475
|
W(!1);
|
|
3464
|
-
function
|
|
3476
|
+
function C(c) {
|
|
3465
3477
|
if (c === "add")
|
|
3466
3478
|
return i();
|
|
3467
3479
|
if (c === "export")
|
|
3468
|
-
return
|
|
3480
|
+
return bl();
|
|
3469
3481
|
c === "bulk-edit" && p.openDialog();
|
|
3470
3482
|
}
|
|
3471
|
-
const I = W(""), f =
|
|
3483
|
+
const I = W(""), f = A(() => u.value), { breakpoints: k } = xt(), S = A(() => k.value.xs || k.value.sm), b = A(() => S.value ? 10 : 20), e = Ct(), { t: V } = ie();
|
|
3472
3484
|
return (c, _) => {
|
|
3473
3485
|
const N = G("FmTable");
|
|
3474
|
-
return
|
|
3475
|
-
title: n(
|
|
3486
|
+
return y(), Y(Bt, {
|
|
3487
|
+
title: n(V)("inventory.recipe.title"),
|
|
3476
3488
|
actions: [
|
|
3477
3489
|
{
|
|
3478
|
-
label: n(
|
|
3490
|
+
label: n(V)("inventory.recipe.create.title"),
|
|
3479
3491
|
value: "add",
|
|
3480
3492
|
isPrimary: !0,
|
|
3481
3493
|
prependIcon: "add"
|
|
3482
3494
|
},
|
|
3483
|
-
...n($).enableBulkEditRecipes ? [{ label: n(
|
|
3484
|
-
{ label: n(
|
|
3495
|
+
...n($).enableBulkEditRecipes ? [{ label: n(V)("inventory.recipe.bulkEditor.title"), value: "bulk-edit", isPrimary: !1 }] : [],
|
|
3496
|
+
{ label: n(V)("common.export"), value: "export", isPrimary: !1 }
|
|
3485
3497
|
],
|
|
3486
|
-
"onClick:action":
|
|
3498
|
+
"onClick:action": C
|
|
3487
3499
|
}, {
|
|
3488
3500
|
default: J(() => [
|
|
3489
3501
|
v("div", {
|
|
3490
|
-
class:
|
|
3502
|
+
class: Ce([
|
|
3491
3503
|
"flex flex-col gap-8 max-h-full",
|
|
3492
3504
|
{
|
|
3493
3505
|
"p-0": S.value,
|
|
@@ -3500,7 +3512,7 @@ const bl = { class: "flex flex-col py-8" }, gl = { class: "fm-typo-en-body-lg-60
|
|
|
3500
3512
|
search: I.value,
|
|
3501
3513
|
"onUpdate:search": _[0] || (_[0] = (z) => I.value = z)
|
|
3502
3514
|
}, null, 8, ["search"]),
|
|
3503
|
-
(
|
|
3515
|
+
(y(), Y(N, {
|
|
3504
3516
|
style: vt(n(e).tableHeight),
|
|
3505
3517
|
"column-defs": n(o),
|
|
3506
3518
|
"row-data": a.value,
|
|
@@ -3508,7 +3520,7 @@ const bl = { class: "flex flex-col py-8" }, gl = { class: "fm-typo-en-body-lg-60
|
|
|
3508
3520
|
loading: !n(t)._currentLocation || f.value,
|
|
3509
3521
|
onRowClick: _[1] || (_[1] = (z) => n(r)(z.original.original)),
|
|
3510
3522
|
key: l.value.length,
|
|
3511
|
-
"page-size":
|
|
3523
|
+
"page-size": b.value
|
|
3512
3524
|
}, {
|
|
3513
3525
|
"list-row": J((z) => [
|
|
3514
3526
|
h(Lt, {
|
|
@@ -3516,19 +3528,19 @@ const bl = { class: "flex flex-col py-8" }, gl = { class: "fm-typo-en-body-lg-60
|
|
|
3516
3528
|
onRowClick: (g) => n(r)(g.original)
|
|
3517
3529
|
}, {
|
|
3518
3530
|
default: J((g) => {
|
|
3519
|
-
var
|
|
3531
|
+
var B, F, R, P, K, H, ee, O, M, L;
|
|
3520
3532
|
return [
|
|
3521
|
-
v("div",
|
|
3522
|
-
v("div",
|
|
3533
|
+
v("div", gl, [
|
|
3534
|
+
v("div", _l, [
|
|
3523
3535
|
h(n(Qe), {
|
|
3524
|
-
render: (
|
|
3536
|
+
render: (R = (F = (B = g.recipe) == null ? void 0 : B.column) == null ? void 0 : F.columnDef) == null ? void 0 : R.cell,
|
|
3525
3537
|
props: (K = (P = g.recipe) == null ? void 0 : P.getContext) == null ? void 0 : K.call(P)
|
|
3526
3538
|
}, null, 8, ["render", "props"])
|
|
3527
3539
|
]),
|
|
3528
|
-
v("div",
|
|
3540
|
+
v("div", kl, [
|
|
3529
3541
|
h(n(Qe), {
|
|
3530
3542
|
render: (O = (ee = (H = g.ingredients) == null ? void 0 : H.column) == null ? void 0 : ee.columnDef) == null ? void 0 : O.cell,
|
|
3531
|
-
props: (L = (
|
|
3543
|
+
props: (L = (M = g.ingredients) == null ? void 0 : M.getContext) == null ? void 0 : L.call(M)
|
|
3532
3544
|
}, null, 8, ["render", "props"])
|
|
3533
3545
|
])
|
|
3534
3546
|
])
|
|
@@ -3540,9 +3552,9 @@ const bl = { class: "flex flex-col py-8" }, gl = { class: "fm-typo-en-body-lg-60
|
|
|
3540
3552
|
_: 1
|
|
3541
3553
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
3542
3554
|
], 2),
|
|
3543
|
-
(
|
|
3544
|
-
h(
|
|
3545
|
-
n($).enableBulkEditRecipes ? (
|
|
3555
|
+
(y(), Y(yt, { to: "body" }, [
|
|
3556
|
+
h(vo, bt(gt(n(x))), null, 16),
|
|
3557
|
+
n($).enableBulkEditRecipes ? (y(), Y(vl, {
|
|
3546
3558
|
key: 0,
|
|
3547
3559
|
show: n(p).show,
|
|
3548
3560
|
"onUpdate:show": _[2] || (_[2] = (z) => n(p).show = z)
|
|
@@ -3555,5 +3567,5 @@ const bl = { class: "flex flex-col py-8" }, gl = { class: "fm-typo-en-body-lg-60
|
|
|
3555
3567
|
}
|
|
3556
3568
|
});
|
|
3557
3569
|
export {
|
|
3558
|
-
|
|
3570
|
+
Hl as default
|
|
3559
3571
|
};
|