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