@feedmepos/mf-inventory-portal 1.5.12 → 1.6.0-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-DBEmTaMX.js → App-BWiKiRD2.js} +4 -4
- package/dist/{ApprovalView-BvzIwH1r.js → ApprovalView-TFet-Rht.js} +7 -7
- package/dist/{BindingsDialog-DnqHoU0Y.js → BindingsDialog-ByO16R7B.js} +2 -2
- package/dist/{BindingsPicker-Bjpj0zdJ.js → BindingsPicker-BzeipJDM.js} +2 -2
- package/dist/{BindingsTable-S5Nqq4Qv.js → BindingsTable-CATRwDGx.js} +3 -3
- package/dist/ClosingDraftView-Bilo3C7N.js +4318 -0
- package/dist/{ClosingHistoryView-B2ccrB2K.js → ClosingHistoryView-DJEhuzBh.js} +5 -5
- package/dist/ClosingTemplateView-DTS__1eO.js +2221 -0
- package/dist/{DefaultView-DQhLe6LE.js → DefaultView-Dpwvllot.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-Cup9mzpO.js → DeliveryOrderPrintPreview-BZ-BDWlS.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DuZFuSbw.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BMJVOiL_.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DoPyc0aE.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-QvgQwP6t.js} +2 -2
- package/dist/{FmMultiselectDialog-Cwazmlw3.js → FmMultiselectDialog-B1rAOXTC.js} +2 -2
- package/dist/{FmMultiselectDialog-DnuUrW7h.js → FmMultiselectDialog-W0_FfMmH.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BMzzUsa4.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DNpKzzVC.js} +5 -5
- package/dist/{ImportView-CXtrdABV.js → ImportView-B_3OeL5b.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Cfp95IvX.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CdNdnCp-.js} +1 -1
- package/dist/{IngredientGroupView-Bm-2yK8J.js → IngredientGroupView-B_v-UNeR.js} +5 -5
- package/dist/{IngredientsView-Bo8w9LSr.js → IngredientsView-DTXevc-8.js} +15 -15
- package/dist/{IntegrationExplorerView-DUqQ64CE.js → IntegrationExplorerView-C6JUipFs.js} +352 -352
- package/dist/IntegrationView-DX4hhKYv.js +5100 -0
- package/dist/{InventoryBindingForm-DWJRCTf8.js → InventoryBindingForm-BpNKhiGF.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DH-xUQ5m.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BWy-YpCv.js} +5 -5
- package/dist/{InventoryBindingSummary-DSwCvTnu.js → InventoryBindingSummary-BL4AkZY3.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-KDWRZCxm.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DURnZteR.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Wuv2teWn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BR0Hc9cL.js} +1 -1
- package/dist/{PublishView-BSahQbqy.js → PublishView-CELngZXP.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-C8umjCEU.js → PurchaseOrderPrintPreview-HCGMQWdo.js} +2 -2
- package/dist/{ReceiveRequestView-Bf5dAcun.js → ReceiveRequestView-DfrpsGeI.js} +26 -26
- package/dist/{RecipeView-wU9u23Zp.js → RecipeView-DCrrdrhp.js} +1104 -1117
- package/dist/{SettingsView-C5Uc6h0A.js → SettingsView-CHoDkUIF.js} +4 -4
- package/dist/{StockView-QF68mXtU.js → StockView-DlP1-pbq.js} +19 -19
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cgw8EDXb.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-NZcNoQ6u.js} +1 -1
- package/dist/{SupplierView-xBONJSsg.js → SupplierView-DqQbgLqh.js} +12 -12
- package/dist/{SurchargeView-BK8aNKZl.js → SurchargeView-CtlXOPJ3.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-tsuedeNl.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-BRrHPAJj.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BXVa7pt5.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bw3UN_Zn.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CVRD5iri.js → TransferDetails.vue_vue_type_script_setup_true_lang-atZZPJBf.js} +20 -20
- package/dist/TransferTemplateView-Dl0k38tD.js +2327 -0
- package/dist/{UnitCostHistoryView-BS0nrbkD.js → UnitCostHistoryView-Dh-yAgvG.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-CeD0qWRC.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-FqnqY9bU.js} +5 -5
- package/dist/{UnitView-DsKX7DM0.js → UnitView-D5Zvz2xm.js} +7 -7
- package/dist/{WarehouseView-DRZaGu80.js → WarehouseView-s5g9AQq5.js} +5 -5
- package/dist/{WastageTemplateView-CtMSWKFj.js → WastageTemplateView-XzJSsB29.js} +14 -14
- package/dist/api/closing-draft.d.ts +6 -0
- package/dist/api/codemax.d.ts +11 -0
- package/dist/api/inventory.d.ts +1 -0
- package/dist/api/netsuite.d.ts +5 -4
- package/dist/api/surcharge.d.ts +1 -0
- package/dist/{app-DYMYQwvV.js → app-D-l9FM2n.js} +15762 -13683
- package/dist/app.d.ts +288 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-Cxsa4j_W.js → closing-template-C56_2aLc.js} +1 -1
- package/dist/{date2-BdXL0GG5.js → date2-CRMgo5NH.js} +1 -1
- package/dist/{dayjs.min-LoBFKjU2.js → dayjs.min-9bo3vPqj.js} +1 -1
- package/dist/{decimal-BFFta-yv.js → decimal-CsE7mms2.js} +2 -2
- package/dist/{defineDeepModel-CCZ3fqXQ.js → defineDeepModel-DDX70CM6.js} +1 -1
- package/dist/{duplicate-template-C2Qho2Ig.js → duplicate-template-BrEOP-1V.js} +1 -1
- package/dist/{feature-Dt5ZFkZR.js → feature-Bl6yUhw_.js} +2 -2
- package/dist/{format-time-from-id-LqoWbcB4.js → format-time-from-id-BuMdYlM9.js} +1 -1
- package/dist/format-unit-display-CMfuvGP6.js +1432 -0
- package/dist/{import-export.helper-DogBd6aS.js → import-export.helper-C9F9d-rh.js} +6 -6
- package/dist/{index-IMHyRNdu.js → index-BcOtIfdU.js} +1 -1
- package/dist/index-BdSVteJV.js +257 -0
- package/dist/{index-D0xsiYLO.js → index-cbmIhZ6F.js} +1 -1
- package/dist/{inventory-core-dart.default-BkcD7c_a.js → inventory-core-dart.default-DewosGoK.js} +1 -1
- package/dist/{lz-string-CgecKowu.js → lz-string-Ye-dLAix.js} +1 -1
- package/dist/modules/print-template/api/print-template.d.ts +1 -0
- package/dist/{netsuite-9qEVrdMv.js → netsuite-Dyw1JtQL.js} +2 -2
- package/dist/{number-DSMFbPf0.js → number-YiCgPFTE.js} +3 -3
- package/dist/{predefined-templates-OZoiOUoA.js → predefined-templates-B0Eto9Jx.js} +1 -1
- package/dist/{purchase-order-template-CUee1L_x.js → purchase-order-template-zHPLRQDQ.js} +1 -1
- package/dist/{recalculationUtils-CPcCUHIm.js → recalculationUtils-DZLZlctO.js} +1 -1
- package/dist/{rules-CMNaUkUU.js → rules-BsVkaxL5.js} +2 -2
- package/dist/{stock-BOaUT0Y3.js → stock-DlQopDTl.js} +1 -1
- package/dist/stores/api.d.ts +1 -0
- package/dist/stores/helper/generate-backend-urls.d.ts +1 -0
- package/dist/stores/integration/codemax.d.ts +432 -0
- package/dist/stores/integration/index.d.ts +4 -1
- package/dist/{supplier-BAbQZL7x.js → supplier-UPX_1aFs.js} +2 -2
- package/dist/{surcharge-C5tQ0vs0.js → surcharge-DO3-kAit.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-CSmRb5Ds.js → uom-rules-DbhFLCUC.js} +1 -1
- package/dist/{use-ingredient-select-dialog-B9XYlxjA.js → use-ingredient-select-dialog-BASkk3-u.js} +16 -16
- package/dist/{use-inventory-binding-dialog-BzIb4yxm.js → use-inventory-binding-dialog-DTc48xUU.js} +2 -2
- package/dist/use-template-enabled-locations-gwYjb6_p.js +132 -0
- package/dist/{use-transfer-locations-Di5ozOgU.js → use-transfer-locations-BJ0xIECi.js} +2 -2
- package/dist/{useHrmPermission-N8GPw9P_.js → useHrmPermission-G4mfvYF8.js} +1 -1
- package/dist/{useNavigationMenu-BLnGMLsm.js → useNavigationMenu-Be-99JmQ.js} +2 -2
- package/dist/{useSseClient-BQtJfryY.js → useSseClient-D1h38l_K.js} +3 -3
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +800 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +40 -0
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupAction.vue.d.ts +21 -0
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupCard.vue.d.ts +20 -0
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +823 -0
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupGrid.vue.d.ts +20 -0
- package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +10 -0
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1400 -133
- package/dist/views/closing-draft/helpers/closing-draft-summary.helper.d.ts +11 -0
- package/dist/views/closing-draft/helpers/closing-group-detail.helper.d.ts +68 -0
- package/dist/views/closing-draft/helpers/closing-group-status.helper.d.ts +6 -0
- package/dist/views/closing-draft/helpers/closing-groups.helper.d.ts +28 -0
- package/dist/views/closing-draft/helpers/merge-closing-draft-items.helper.d.ts +9 -0
- package/dist/views/closing-template/components/closing-template-form/components/ClosingTemplateGroupsEditor.vue.d.ts +31 -0
- package/dist/views/closing-template/components/closing-template-form/components/ClosingTemplateItem.vue.d.ts +164 -7
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +24 -88
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +108 -0
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +108 -0
- package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +3 -3
- package/dist/views/integration/Codemax.vue.d.ts +2 -0
- package/dist/views/integration/components/ApplyProductCodemax.vue.d.ts +341 -0
- package/dist/views/integration/components/ApplyProductDialogCodemax.vue.d.ts +298 -0
- package/dist/views/integration/components/ApplyProductDialogPropsCodemax.d.ts +17 -0
- package/dist/views/integration/components/CodemaxDialog.vue.d.ts +519 -0
- package/dist/views/recipe/composables/use-recipe-bulk-editor.d.ts +3 -3
- package/dist/views/transfer-template/components/template-item-bulk-editor/TemplateItemBulkEditorDialog.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/template-item-bulk-editor/TemplateItemBulkEditorStep1.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/template-item-bulk-editor/TemplateItemBulkEditorStep2.vue.d.ts +8 -0
- package/dist/views/transfer-template/components/template-item-bulk-editor/TemplateItemBulkEditorStep3.vue.d.ts +2 -0
- package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +3225 -0
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +4 -1
- package/dist/views/transfer-template/helpers/template-item-bulk-editor-export.d.ts +9 -0
- package/dist/{vue-i18n-DR8I1LQH.js → vue-i18n-fX3C6wjd.js} +306 -306
- package/dist/{xlsx-D5-Cqx-l.js → xlsx-BsL1DoEA.js} +1 -1
- package/dist/{xlsx.util-DEdsfN6W.js → xlsx.util-D_XTOHMv.js} +3 -3
- package/package.json +4 -4
- package/dist/ClosingDraftView-Y074sSoz.js +0 -3343
- package/dist/ClosingTemplateView-BcvKBWVJ.js +0 -2077
- package/dist/IntegrationView-CtkbKPzC.js +0 -4586
- package/dist/TransferTemplateView-Cm4evaK3.js +0 -1564
- package/dist/format-unit-display-CWqmpVa_.js +0 -1268
- package/dist/index-2DNXazDV.js +0 -164
- package/dist/use-template-enabled-locations-V5iE0ywc.js +0 -146
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as le, ref as W, onMounted as pt, resolveComponent as G, openBlock as
|
|
2
|
-
import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-
|
|
1
|
+
import { defineComponent as le, ref as W, onMounted as pt, resolveComponent as G, openBlock as y, createElementBlock as E, Fragment as X, createElementVNode as v, toDisplayString as U, createVNode as h, createCommentVNode as T, computed as A, watch as ue, unref as n, normalizeClass as Ce, withCtx as J, h as de, createBlock as Y, renderList as me, isRef as De, mergeProps as we, createTextVNode as mt, withModifiers as ft, normalizeStyle as vt, Teleport as yt, normalizeProps as bt, guardReactiveProps as gt } from "vue";
|
|
2
|
+
import { a as ne, c as Oe, S as _t, F as be, u as tt, t as kt, v as ht, i as Je } from "./app-D-l9FM2n.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-CdNdnCp-.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-YiCgPFTE.js";
|
|
11
11
|
import { useI18n as ie, useCoreStore as St } from "@feedmepos/mf-common";
|
|
12
12
|
import { u as Ct, _ as Bt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
|
|
13
|
-
import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-
|
|
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-
|
|
13
|
+
import { b as it, c as qe, I as Ft, A as Ne, U as lt, R as Rt } from "./rules-BsVkaxL5.js";
|
|
14
|
+
import { _ as At } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-BWy-YpCv.js";
|
|
15
|
+
import { a as Pe } from "./FmMultiselectDialog-B1rAOXTC.js";
|
|
16
|
+
import { d as rt } from "./defineDeepModel-DDX70CM6.js";
|
|
17
17
|
import { L as Tt, P as Ut, D as Pt } from "./app-DiX-EfV6.js";
|
|
18
|
-
import { _ as Be, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { u as Gt } from "./FmMultiselectDialog-
|
|
20
|
-
import { u as Nt } from "./vue-i18n-
|
|
21
|
-
import { F as zt } from "./inventory-core-dart.default-
|
|
18
|
+
import { _ as Be, c as Mt, d as Dt, e as ye } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-DNpKzzVC.js";
|
|
19
|
+
import { u as Gt } from "./FmMultiselectDialog-W0_FfMmH.js";
|
|
20
|
+
import { u as Nt } from "./vue-i18n-fX3C6wjd.js";
|
|
21
|
+
import { F as zt } from "./inventory-core-dart.default-DewosGoK.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-Bl6yUhw_.js";
|
|
24
|
+
import { F as he } from "./decimal-CsE7mms2.js";
|
|
25
|
+
import { _ as Fe } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BMJVOiL_.js";
|
|
26
|
+
import { b as at, d as st } from "./xlsx.util-D_XTOHMv.js";
|
|
27
|
+
import { f as dt } from "./date2-CRMgo5NH.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-QvgQwP6t.js";
|
|
30
30
|
const Kt = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
@@ -38,31 +38,31 @@ const Kt = {
|
|
|
38
38
|
message: {},
|
|
39
39
|
bindedItems: {}
|
|
40
40
|
},
|
|
41
|
-
setup(
|
|
42
|
-
const d =
|
|
41
|
+
setup(m) {
|
|
42
|
+
const d = m, l = W(d.bindedItems || []), t = W(!1);
|
|
43
43
|
pt(() => {
|
|
44
44
|
i();
|
|
45
45
|
});
|
|
46
46
|
async function i() {
|
|
47
|
-
var r,
|
|
48
|
-
!t.value && ((r = d.data) != null && r._id) && (t.value = !0, l.value = await ne().getAffectedMenu((
|
|
47
|
+
var r, x;
|
|
48
|
+
!t.value && ((r = d.data) != null && r._id) && (t.value = !0, l.value = await ne().getAffectedMenu((x = d.data) == null ? void 0 : x._id), t.value = !1);
|
|
49
49
|
}
|
|
50
|
-
return (r,
|
|
50
|
+
return (r, x) => {
|
|
51
51
|
const u = G("FmSpacer"), o = G("FmCircularProgress");
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
t.value ? (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
return y(), E(X, null, [
|
|
53
|
+
v("p", null, U(r.message), 1),
|
|
54
|
+
t.value ? (y(), E("div", Kt, [
|
|
55
|
+
h(u),
|
|
56
|
+
v("div", null, [
|
|
57
|
+
h(o, { size: "xl" })
|
|
58
58
|
]),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
])) : (
|
|
62
|
-
|
|
63
|
-
l.value.length > 0 ? (
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
x[0] || (x[0] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
60
|
+
h(u)
|
|
61
|
+
])) : (y(), E("div", qt, [
|
|
62
|
+
x[2] || (x[2] = v("br", null, null, -1)),
|
|
63
|
+
l.value.length > 0 ? (y(), E("div", Wt, [
|
|
64
|
+
x[1] || (x[1] = v("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
|
|
65
|
+
h(nt, {
|
|
66
66
|
name: "Menu",
|
|
67
67
|
bindings: l.value
|
|
68
68
|
}, null, 8, ["bindings"])
|
|
@@ -73,27 +73,27 @@ const Kt = {
|
|
|
73
73
|
}
|
|
74
74
|
}), ze = ot("recipeForm", function() {
|
|
75
75
|
const d = Le(), l = je(), t = ne(), i = W(!1), r = W();
|
|
76
|
-
function
|
|
76
|
+
function x() {
|
|
77
77
|
const a = {
|
|
78
78
|
recipe: {},
|
|
79
79
|
mode: se.CREATE,
|
|
80
80
|
show: !0,
|
|
81
|
-
"onUpdate:show"(
|
|
82
|
-
r.value.show =
|
|
81
|
+
"onUpdate:show"(p) {
|
|
82
|
+
r.value.show = p;
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
r.value = a;
|
|
86
86
|
}
|
|
87
87
|
async function u(a) {
|
|
88
|
-
const
|
|
88
|
+
const p = {
|
|
89
89
|
recipe: Oe(a),
|
|
90
90
|
mode: se.UPDATE,
|
|
91
91
|
show: !0,
|
|
92
|
-
"onUpdate:show"(
|
|
93
|
-
r.value.show =
|
|
92
|
+
"onUpdate:show"($) {
|
|
93
|
+
r.value.show = $;
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
r.value =
|
|
96
|
+
r.value = p;
|
|
97
97
|
}
|
|
98
98
|
async function o(a) {
|
|
99
99
|
i.value = !0;
|
|
@@ -103,20 +103,20 @@ const Kt = {
|
|
|
103
103
|
message: `Deleted ${a.name}`,
|
|
104
104
|
type: "success"
|
|
105
105
|
});
|
|
106
|
-
} catch (
|
|
107
|
-
if (
|
|
106
|
+
} catch (p) {
|
|
107
|
+
if (p instanceof _t && $t(p)) {
|
|
108
108
|
d.open({
|
|
109
109
|
title: "Cannot delete recipe",
|
|
110
110
|
contentComponent: It,
|
|
111
111
|
contentComponentProps: {
|
|
112
112
|
subject: (a == null ? void 0 : a.name) ?? "",
|
|
113
|
-
items:
|
|
113
|
+
items: p.errorResponse.errors.map(($) => {
|
|
114
114
|
var C;
|
|
115
115
|
return {
|
|
116
116
|
chain: [
|
|
117
117
|
{
|
|
118
|
-
itemName:
|
|
119
|
-
moduleKey: (C =
|
|
118
|
+
itemName: $.name,
|
|
119
|
+
moduleKey: (C = $.message) != null && C.startsWith("modules.") ? wt($.message) : $.module
|
|
120
120
|
}
|
|
121
121
|
]
|
|
122
122
|
};
|
|
@@ -133,7 +133,7 @@ const Kt = {
|
|
|
133
133
|
title: `Cannot delete ${a == null ? void 0 : a.name}`,
|
|
134
134
|
message: "Please try again.",
|
|
135
135
|
type: "error"
|
|
136
|
-
}), console.error("failed to delete recipe",
|
|
136
|
+
}), console.error("failed to delete recipe", p);
|
|
137
137
|
} finally {
|
|
138
138
|
i.value = !1;
|
|
139
139
|
}
|
|
@@ -160,7 +160,7 @@ const Kt = {
|
|
|
160
160
|
}).onPrimary(() => o(a));
|
|
161
161
|
}
|
|
162
162
|
return {
|
|
163
|
-
createRecipe:
|
|
163
|
+
createRecipe: x,
|
|
164
164
|
updateRecipe: u,
|
|
165
165
|
deleteRecipe: s,
|
|
166
166
|
recipeDialogProps: r,
|
|
@@ -168,11 +168,11 @@ const Kt = {
|
|
|
168
168
|
};
|
|
169
169
|
});
|
|
170
170
|
function Jt() {
|
|
171
|
-
const { updateRecipe:
|
|
171
|
+
const { updateRecipe: m, deleteRecipe: d } = ze(), l = ne(), { t } = ie();
|
|
172
172
|
async function i(o, s) {
|
|
173
173
|
const a = Oe(s);
|
|
174
174
|
if (o === Ve.Edit) {
|
|
175
|
-
await
|
|
175
|
+
await m(a);
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
if (o === Ve.Delete) {
|
|
@@ -181,18 +181,18 @@ function Jt() {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
function r(o, s) {
|
|
184
|
-
const a = o.filter((C) => C.type === be.enum.SKU),
|
|
184
|
+
const a = o.filter((C) => C.type === be.enum.SKU), p = o.filter(
|
|
185
185
|
(C) => C.type === be.enum.SKU_GROUP
|
|
186
|
-
),
|
|
186
|
+
), $ = o.filter((C) => C.type === be.enum.RECIPE);
|
|
187
187
|
return [
|
|
188
188
|
...a.map((C) => ({ ...C, recipeIds: [...s] })),
|
|
189
|
-
...
|
|
190
|
-
|
|
189
|
+
...p.map((C) => ({ ...C, isGroup: !0, recipeIds: [...s] })),
|
|
190
|
+
...$.filter((C) => l.recipeById[C.id] && !s.has(C.id)).flatMap(
|
|
191
191
|
(C) => r(l.recipeById[C.id].contains, /* @__PURE__ */ new Set([...s, C.id]))
|
|
192
192
|
)
|
|
193
193
|
];
|
|
194
194
|
}
|
|
195
|
-
const
|
|
195
|
+
const x = [
|
|
196
196
|
{
|
|
197
197
|
accessorKey: "recipe",
|
|
198
198
|
header: () => t("inventory.recipe.name"),
|
|
@@ -226,41 +226,41 @@ function Jt() {
|
|
|
226
226
|
const s = ne();
|
|
227
227
|
return o.map((a) => ({
|
|
228
228
|
recipe: a.name,
|
|
229
|
-
ingredients: r(a.contains, /* @__PURE__ */ new Set([a._id])).map((
|
|
230
|
-
var C, I,
|
|
231
|
-
if (
|
|
232
|
-
const e = s.skuGroupById[
|
|
233
|
-
return
|
|
229
|
+
ingredients: r(a.contains, /* @__PURE__ */ new Set([a._id])).map((p) => {
|
|
230
|
+
var C, I, f, k, S, b;
|
|
231
|
+
if (p.isGroup) {
|
|
232
|
+
const e = s.skuGroupById[p.id];
|
|
233
|
+
return p.recipeIds.slice(1).length ? `(${(C = s.recipeById[p.recipeIds.at(-1) ?? ""]) == null ? void 0 : C.name}) ${e.name} (x ${Q(p.amount)})` : `${e.name} (x${Q(p.amount)})`;
|
|
234
234
|
}
|
|
235
|
-
const
|
|
236
|
-
return
|
|
237
|
-
}).filter((
|
|
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) ?? ((b = $ == null ? void 0 : $.unit) == null ? void 0 : b.abbrev)})` : null;
|
|
237
|
+
}).filter((p) => p).join(", "),
|
|
238
238
|
original: a
|
|
239
239
|
}));
|
|
240
240
|
}
|
|
241
|
-
return { columnDefs:
|
|
241
|
+
return { columnDefs: x, formatRowData: u };
|
|
242
242
|
}
|
|
243
243
|
function Ht() {
|
|
244
|
-
const
|
|
245
|
-
async function l(r,
|
|
246
|
-
var I,
|
|
247
|
-
const s = r.filter((
|
|
244
|
+
const m = ne(), d = Le();
|
|
245
|
+
async function l(r, x, u, o = []) {
|
|
246
|
+
var I, f;
|
|
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
|
-
for (const
|
|
250
|
-
!o.some((
|
|
251
|
-
const
|
|
252
|
-
label:
|
|
253
|
-
sublabel: `${
|
|
254
|
-
value:
|
|
255
|
-
disabled:
|
|
256
|
-
})), C =
|
|
257
|
-
(
|
|
258
|
-
).map((
|
|
249
|
+
for (const k of m.skus)
|
|
250
|
+
!o.some((b) => b === k._id) && k._id !== u && !((f = (I = k.convert) == null ? void 0 : I.inventoryBindings) != null && f.some((b) => b.id === u)) || p.add(k._id);
|
|
251
|
+
const $ = m.skus.map((k) => ({
|
|
252
|
+
label: k.name,
|
|
253
|
+
sublabel: `${k.code}${p.has(k._id) ? " (Cannot bind, will cause recursive binding)" : ""}`,
|
|
254
|
+
value: k,
|
|
255
|
+
disabled: p.has(k._id)
|
|
256
|
+
})), C = $.filter(
|
|
257
|
+
(k) => s.find((S) => S.id === k.value._id) && !p.has(k.value._id)
|
|
258
|
+
).map((k) => k.value);
|
|
259
259
|
d.open({
|
|
260
260
|
title: "Select ingredients",
|
|
261
261
|
contentComponent: Pe,
|
|
262
262
|
contentComponentProps: {
|
|
263
|
-
items:
|
|
263
|
+
items: $,
|
|
264
264
|
modelValue: C,
|
|
265
265
|
virtualScroll: !0
|
|
266
266
|
},
|
|
@@ -273,48 +273,48 @@ function Ht() {
|
|
|
273
273
|
close: !0,
|
|
274
274
|
variant: "tertiary"
|
|
275
275
|
}
|
|
276
|
-
}).onPrimary((
|
|
277
|
-
const
|
|
276
|
+
}).onPrimary((k) => {
|
|
277
|
+
const S = [
|
|
278
278
|
...a,
|
|
279
|
-
...r.filter((
|
|
280
|
-
...
|
|
279
|
+
...r.filter((b) => k.find((e) => e._id === b.id)),
|
|
280
|
+
...k.filter((b) => !r.find((e) => e.id === b._id)).map((b) => ({
|
|
281
281
|
type: "SKU",
|
|
282
|
-
id:
|
|
282
|
+
id: b._id,
|
|
283
283
|
amount: {
|
|
284
284
|
amount: 1,
|
|
285
285
|
precision: 0
|
|
286
286
|
}
|
|
287
287
|
}))
|
|
288
288
|
];
|
|
289
|
-
|
|
289
|
+
x(S);
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
-
async function t(r,
|
|
292
|
+
async function t(r, x, u = []) {
|
|
293
293
|
var C;
|
|
294
294
|
const o = r.filter((I) => I.type === "RECIPE"), s = r.filter((I) => I.type !== "RECIPE"), a = /* @__PURE__ */ new Set();
|
|
295
295
|
if (u.length)
|
|
296
|
-
for (const I of
|
|
297
|
-
const
|
|
298
|
-
(e) => e.bindingPaths.some((
|
|
299
|
-
),
|
|
296
|
+
for (const I of m.recipes) {
|
|
297
|
+
const f = ((C = m.recipeBindingFlattenCache[I._id]) == null ? void 0 : C.inventoryBindings) ?? [], k = f.some(
|
|
298
|
+
(e) => e.bindingPaths.some((V) => u.some((c) => c === V.id))
|
|
299
|
+
), S = f.some(
|
|
300
300
|
(e) => "success" in e && u.includes(e.ingredient._id)
|
|
301
301
|
);
|
|
302
|
-
(u.some((e) => e === I._id) ||
|
|
302
|
+
(u.some((e) => e === I._id) || k || S) && a.add(I._id);
|
|
303
303
|
}
|
|
304
|
-
const
|
|
304
|
+
const p = m.recipes.filter((I) => !u.includes(I._id)).map((I) => ({
|
|
305
305
|
label: I.name,
|
|
306
306
|
sublabel: a.has(I._id) ? "(Cannot bind, will cause recursive binding)" : `${I.contains.length} inventory bindings`,
|
|
307
307
|
value: I,
|
|
308
308
|
disabled: a.has(I._id)
|
|
309
|
-
})),
|
|
310
|
-
(I) => o.find((
|
|
309
|
+
})), $ = p.filter(
|
|
310
|
+
(I) => o.find((f) => f.id === I.value._id) && !a.has(I.value._id)
|
|
311
311
|
).map((I) => I.value);
|
|
312
312
|
d.open({
|
|
313
313
|
title: "Select recipes",
|
|
314
314
|
contentComponent: Pe,
|
|
315
315
|
contentComponentProps: {
|
|
316
|
-
items:
|
|
317
|
-
modelValue:
|
|
316
|
+
items: p,
|
|
317
|
+
modelValue: $,
|
|
318
318
|
virtualScroll: !0
|
|
319
319
|
},
|
|
320
320
|
primaryActions: {
|
|
@@ -327,11 +327,11 @@ function Ht() {
|
|
|
327
327
|
variant: "tertiary"
|
|
328
328
|
}
|
|
329
329
|
}).onPrimary((I) => {
|
|
330
|
-
const
|
|
331
|
-
...r.filter((
|
|
332
|
-
...I.filter((
|
|
330
|
+
const f = [
|
|
331
|
+
...r.filter((k) => I.find((S) => S._id === k.id)),
|
|
332
|
+
...I.filter((k) => !r.find((S) => S.id === k._id)).map((k) => ({
|
|
333
333
|
type: "RECIPE",
|
|
334
|
-
id:
|
|
334
|
+
id: k._id,
|
|
335
335
|
amount: {
|
|
336
336
|
amount: 1,
|
|
337
337
|
precision: 0
|
|
@@ -339,20 +339,20 @@ function Ht() {
|
|
|
339
339
|
})),
|
|
340
340
|
...s
|
|
341
341
|
];
|
|
342
|
-
|
|
342
|
+
x(f);
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
|
-
async function i(r,
|
|
346
|
-
const o = r.filter((
|
|
347
|
-
label:
|
|
348
|
-
value:
|
|
349
|
-
})),
|
|
345
|
+
async function i(r, x, u = []) {
|
|
346
|
+
const o = r.filter(($) => $.type === "SKU_GROUP"), s = r.filter(($) => $.type !== "SKU_GROUP"), a = m.skuGroups.filter(($) => !u.includes($._id)).map(($) => ({
|
|
347
|
+
label: $.name,
|
|
348
|
+
value: $
|
|
349
|
+
})), p = a.filter(($) => o.find((C) => C.id === $.value._id)).map(($) => $.value);
|
|
350
350
|
d.open({
|
|
351
351
|
title: "Select ingredient group",
|
|
352
352
|
contentComponent: Pe,
|
|
353
353
|
contentComponentProps: {
|
|
354
354
|
items: a,
|
|
355
|
-
modelValue:
|
|
355
|
+
modelValue: p,
|
|
356
356
|
virtualScroll: !0
|
|
357
357
|
},
|
|
358
358
|
primaryActions: {
|
|
@@ -364,10 +364,10 @@ function Ht() {
|
|
|
364
364
|
close: !0,
|
|
365
365
|
variant: "tertiary"
|
|
366
366
|
}
|
|
367
|
-
}).onPrimary((
|
|
367
|
+
}).onPrimary(($) => {
|
|
368
368
|
const C = [
|
|
369
|
-
...r.filter((I) =>
|
|
370
|
-
|
|
369
|
+
...r.filter((I) => $.find((f) => f._id === I.id)),
|
|
370
|
+
...$.filter((I) => !r.find((f) => f.id === I._id)).map((I) => ({
|
|
371
371
|
type: "SKU_GROUP",
|
|
372
372
|
id: I._id,
|
|
373
373
|
amount: {
|
|
@@ -377,7 +377,7 @@ function Ht() {
|
|
|
377
377
|
})),
|
|
378
378
|
...s
|
|
379
379
|
];
|
|
380
|
-
|
|
380
|
+
x(C);
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
383
|
return {
|
|
@@ -395,78 +395,65 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
395
395
|
maxCount: {}
|
|
396
396
|
},
|
|
397
397
|
emits: ["update:modelValue"],
|
|
398
|
-
setup(
|
|
399
|
-
const l =
|
|
400
|
-
var
|
|
401
|
-
const
|
|
402
|
-
for (const
|
|
403
|
-
for (const [
|
|
404
|
-
|
|
405
|
-
return
|
|
406
|
-
}), o =
|
|
407
|
-
|
|
408
|
-
var C;
|
|
409
|
-
return (C = h.profile) == null ? void 0 : C.code;
|
|
410
|
-
}).map((h) => ({ value: h.profile.code, label: `${h.profile.name} (${h.profile.code})` }))
|
|
411
|
-
), s = R(() => [
|
|
412
|
-
...[...u.value.entries()].map(([C, I]) => ({
|
|
398
|
+
setup(m, { emit: d }) {
|
|
399
|
+
const l = m, t = d, { t: i } = ie(), r = St(), x = tt(), u = A(() => {
|
|
400
|
+
var C;
|
|
401
|
+
const p = /* @__PURE__ */ new Map(), $ = r.restaurants.value.map((I) => I.customAttributes ?? {});
|
|
402
|
+
for (const I of $)
|
|
403
|
+
for (const [f, k] of Object.entries(I))
|
|
404
|
+
p.has(f) || p.set(f, /* @__PURE__ */ new Set()), k && ((C = p.get(f)) == null || C.add(k));
|
|
405
|
+
return p;
|
|
406
|
+
}), o = A(() => [
|
|
407
|
+
...[...u.value.entries()].map(([$, C]) => ({
|
|
413
408
|
type: "string",
|
|
414
|
-
key:
|
|
409
|
+
key: $,
|
|
415
410
|
entity: "restaurant",
|
|
416
|
-
values: [...
|
|
411
|
+
values: [...C]
|
|
417
412
|
})),
|
|
418
413
|
{
|
|
419
414
|
type: "string",
|
|
420
415
|
key: "state",
|
|
421
416
|
entity: "restaurant",
|
|
422
|
-
values: [
|
|
423
|
-
|
|
424
|
-
]
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
type: "string",
|
|
429
|
-
key: "outlet",
|
|
430
|
-
entity: "restaurant",
|
|
431
|
-
options: o.value
|
|
432
|
-
}
|
|
433
|
-
] : []
|
|
434
|
-
]), a = W(null);
|
|
435
|
-
let g = null;
|
|
417
|
+
values: [...new Set(
|
|
418
|
+
x.locations.map(($) => $.doc.profile.address.state).filter(Boolean)
|
|
419
|
+
)]
|
|
420
|
+
}
|
|
421
|
+
]), s = W(null);
|
|
422
|
+
let a = null;
|
|
436
423
|
return ue(
|
|
437
424
|
() => l.modelValue,
|
|
438
|
-
(
|
|
439
|
-
JSON.stringify(
|
|
425
|
+
(p) => {
|
|
426
|
+
JSON.stringify(p) !== JSON.stringify(a) && (s.value = p ? Tt.build(p) : null);
|
|
440
427
|
},
|
|
441
428
|
{ immediate: !0 }
|
|
442
429
|
), ue(
|
|
443
|
-
|
|
444
|
-
(
|
|
445
|
-
|
|
430
|
+
s,
|
|
431
|
+
(p) => {
|
|
432
|
+
a = p ? Ut.build(p) : null, t("update:modelValue", a);
|
|
446
433
|
},
|
|
447
434
|
{ deep: !0 }
|
|
448
|
-
), (
|
|
449
|
-
const
|
|
450
|
-
return
|
|
451
|
-
|
|
452
|
-
|
|
435
|
+
), (p, $) => {
|
|
436
|
+
const C = G("FmLabel"), I = G("FmFormGroup");
|
|
437
|
+
return y(), E("div", Qt, [
|
|
438
|
+
v("div", Xt, [
|
|
439
|
+
h(C, {
|
|
453
440
|
label: n(i)("inventory.ingredientGroup.form.rules.title"),
|
|
454
|
-
required:
|
|
441
|
+
required: p.minCount != null && p.minCount > 0
|
|
455
442
|
}, null, 8, ["label", "required"]),
|
|
456
|
-
|
|
457
|
-
modelValue:
|
|
458
|
-
"onUpdate:modelValue":
|
|
459
|
-
attributes:
|
|
443
|
+
h(n(Pt), {
|
|
444
|
+
modelValue: s.value,
|
|
445
|
+
"onUpdate:modelValue": $[0] || ($[0] = (f) => s.value = f),
|
|
446
|
+
attributes: o.value
|
|
460
447
|
}, null, 8, ["modelValue", "attributes"])
|
|
461
448
|
]),
|
|
462
|
-
|
|
463
|
-
"model-value":
|
|
449
|
+
h(I, {
|
|
450
|
+
"model-value": s.value,
|
|
464
451
|
rules: [
|
|
465
|
-
(
|
|
466
|
-
const
|
|
467
|
-
return l.minCount !== void 0 &&
|
|
452
|
+
(f) => {
|
|
453
|
+
const k = f ? 1 : 0;
|
|
454
|
+
return l.minCount !== void 0 && k < l.minCount ? n(i)("inventory.ingredientGroup.form.rules.validation.minCount", {
|
|
468
455
|
count: l.minCount
|
|
469
|
-
}) : l.maxCount !== void 0 &&
|
|
456
|
+
}) : l.maxCount !== void 0 && k > l.maxCount ? n(i)("inventory.ingredientGroup.form.rules.validation.maxCount", {
|
|
470
457
|
count: l.maxCount
|
|
471
458
|
}) : !0;
|
|
472
459
|
}
|
|
@@ -494,8 +481,8 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
494
481
|
showError: { type: Boolean }
|
|
495
482
|
},
|
|
496
483
|
emits: ["update:modelValue", "delete", "settings"],
|
|
497
|
-
setup(
|
|
498
|
-
const l = d, { t } = ie(), i = rt("modelValue"), r = W(""),
|
|
484
|
+
setup(m, { emit: d }) {
|
|
485
|
+
const l = d, { t } = ie(), i = rt("modelValue"), r = W(""), x = A(() => +Q(i.amount));
|
|
499
486
|
ue(
|
|
500
487
|
() => i.amount,
|
|
501
488
|
(s) => {
|
|
@@ -512,43 +499,43 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
512
499
|
}, 300);
|
|
513
500
|
}
|
|
514
501
|
return (s, a) => {
|
|
515
|
-
const
|
|
516
|
-
return
|
|
517
|
-
|
|
502
|
+
const p = G("FmTooltip"), $ = G("FmTextField"), C = G("FmButton"), I = G("FmIcon"), f = G("FmFormGroup");
|
|
503
|
+
return y(), E("div", Zt, [
|
|
504
|
+
h(f, {
|
|
518
505
|
class: Ce(["mb-2"]),
|
|
519
506
|
disabled: s.disabled,
|
|
520
|
-
modelValue:
|
|
507
|
+
modelValue: x.value,
|
|
521
508
|
rules: [n(it)(0), n(qe)(-1)]
|
|
522
509
|
}, {
|
|
523
|
-
default: J(({ invalid:
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
510
|
+
default: J(({ invalid: k }) => [
|
|
511
|
+
v("div", en, [
|
|
512
|
+
v("div", tn, [
|
|
513
|
+
v("div", nn, [
|
|
514
|
+
v("div", on, [
|
|
515
|
+
h(p, {
|
|
529
516
|
zIndex: 51,
|
|
530
517
|
variant: "plain",
|
|
531
518
|
placement: "top",
|
|
532
519
|
content: s.displayName
|
|
533
520
|
}, {
|
|
534
521
|
default: J(() => [
|
|
535
|
-
|
|
522
|
+
v("span", ln, U(s.displayName), 1)
|
|
536
523
|
]),
|
|
537
524
|
_: 1
|
|
538
525
|
}, 8, ["content"])
|
|
539
526
|
])
|
|
540
527
|
]),
|
|
541
|
-
|
|
542
|
-
|
|
528
|
+
v("div", rn, [
|
|
529
|
+
h($, {
|
|
543
530
|
class: "w-full",
|
|
544
531
|
disabled: s.disabled,
|
|
545
532
|
modelValue: r.value,
|
|
546
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
547
|
-
invalid:
|
|
533
|
+
"onUpdate:modelValue": a[0] || (a[0] = (S) => o(S)),
|
|
534
|
+
invalid: k
|
|
548
535
|
}, null, 8, ["disabled", "modelValue", "invalid"])
|
|
549
536
|
]),
|
|
550
|
-
s.readonly ? T("", !0) : (
|
|
551
|
-
|
|
537
|
+
s.readonly ? T("", !0) : (y(), E("div", an, [
|
|
538
|
+
h(C, {
|
|
552
539
|
disabled: s.disabled,
|
|
553
540
|
type: "button",
|
|
554
541
|
variant: "plain",
|
|
@@ -558,22 +545,22 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
558
545
|
}, null, 8, ["disabled"])
|
|
559
546
|
]))
|
|
560
547
|
]),
|
|
561
|
-
s.showError ? (
|
|
562
|
-
|
|
548
|
+
s.showError ? (y(), E("div", sn, [
|
|
549
|
+
h(I, {
|
|
563
550
|
name: "error",
|
|
564
551
|
color: "system-error-300",
|
|
565
552
|
size: "sm"
|
|
566
553
|
}),
|
|
567
|
-
|
|
554
|
+
v("div", null, U(n(t)("inventory.inventoryBindings.circularError")), 1)
|
|
568
555
|
])) : T("", !0)
|
|
569
556
|
])
|
|
570
557
|
]),
|
|
571
558
|
_: 1
|
|
572
559
|
}, 8, ["disabled", "modelValue", "rules"]),
|
|
573
|
-
|
|
574
|
-
|
|
560
|
+
v("div", dn, [
|
|
561
|
+
h(Re, {
|
|
575
562
|
modelValue: n(i).rules,
|
|
576
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
563
|
+
"onUpdate:modelValue": a[2] || (a[2] = (k) => n(i).rules = k),
|
|
577
564
|
disabled: s.disabled
|
|
578
565
|
}, null, 8, ["modelValue", "disabled"])
|
|
579
566
|
])
|
|
@@ -581,8 +568,8 @@ const Qt = { class: "flex flex-col" }, Xt = { class: "flex flex-col gap-4" }, Re
|
|
|
581
568
|
};
|
|
582
569
|
}
|
|
583
570
|
});
|
|
584
|
-
function cn(
|
|
585
|
-
const d = Gt(), { t: l } = Nt(), t = ne(), i =
|
|
571
|
+
function cn(m) {
|
|
572
|
+
const d = Gt(), { t: l } = Nt(), t = ne(), i = A(() => [
|
|
586
573
|
{
|
|
587
574
|
id: "delete",
|
|
588
575
|
header: "",
|
|
@@ -598,9 +585,9 @@ function cn(p) {
|
|
|
598
585
|
icon: "delete",
|
|
599
586
|
variant: "tertiary",
|
|
600
587
|
size: "md",
|
|
601
|
-
disabled:
|
|
588
|
+
disabled: m.disabled ?? !1,
|
|
602
589
|
onClick: () => {
|
|
603
|
-
|
|
590
|
+
m.bindingAlternatives = m.bindingAlternatives.filter(
|
|
604
591
|
(s) => s._id !== o._id
|
|
605
592
|
);
|
|
606
593
|
}
|
|
@@ -674,9 +661,9 @@ function cn(p) {
|
|
|
674
661
|
return de(_e.FmSelect, {
|
|
675
662
|
modelValue: u.row.original.trackingMeasurement ?? null,
|
|
676
663
|
items: s,
|
|
677
|
-
disabled:
|
|
664
|
+
disabled: m.disabled ?? !1,
|
|
678
665
|
"onUpdate:modelValue": (a) => {
|
|
679
|
-
|
|
666
|
+
m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, trackingMeasurement: a } : p);
|
|
680
667
|
}
|
|
681
668
|
});
|
|
682
669
|
},
|
|
@@ -695,7 +682,7 @@ function cn(p) {
|
|
|
695
682
|
Ft(),
|
|
696
683
|
Ne(1),
|
|
697
684
|
lt(
|
|
698
|
-
|
|
685
|
+
m.bindingAlternatives.filter((s) => s._id !== o._id).map((s) => {
|
|
699
686
|
const a = t.skuById[s._id];
|
|
700
687
|
return {
|
|
701
688
|
label: a == null ? void 0 : a.name,
|
|
@@ -706,7 +693,7 @@ function cn(p) {
|
|
|
706
693
|
],
|
|
707
694
|
"onUpdate:modelValue": (s) => {
|
|
708
695
|
const a = Number(s);
|
|
709
|
-
isNaN(a) || (
|
|
696
|
+
isNaN(a) || (m.bindingAlternatives = m.bindingAlternatives.map((p) => p._id === u.row.original._id ? { ...p, priority: a } : p));
|
|
710
697
|
}
|
|
711
698
|
});
|
|
712
699
|
}
|
|
@@ -720,9 +707,9 @@ function cn(p) {
|
|
|
720
707
|
return o ? de(_e.FmCheckbox, {
|
|
721
708
|
modelValue: u.row.original.default ?? !1,
|
|
722
709
|
value: o._id,
|
|
723
|
-
disabled:
|
|
710
|
+
disabled: m.disabled ?? !1,
|
|
724
711
|
"onUpdate:modelValue": () => {
|
|
725
|
-
|
|
712
|
+
m.bindingAlternatives = m.bindingAlternatives.map((s) => s._id === u.row.original._id ? { ...s, default: !0 } : { ...s, default: !1 });
|
|
726
713
|
}
|
|
727
714
|
}) : null;
|
|
728
715
|
},
|
|
@@ -745,14 +732,14 @@ function cn(p) {
|
|
|
745
732
|
icon: "keyboard_arrow_up",
|
|
746
733
|
variant: "tertiary",
|
|
747
734
|
size: "md",
|
|
748
|
-
disabled:
|
|
735
|
+
disabled: m.disabled ?? !1,
|
|
749
736
|
onClick: () => {
|
|
750
|
-
const s = [...
|
|
737
|
+
const s = [...m.bindingAlternatives], a = s.findIndex((p) => p._id === o._id);
|
|
751
738
|
if (a > 0) {
|
|
752
|
-
const
|
|
753
|
-
s[a - 1] = o, s[a] =
|
|
739
|
+
const p = s[a - 1];
|
|
740
|
+
s[a - 1] = o, s[a] = p;
|
|
754
741
|
}
|
|
755
|
-
|
|
742
|
+
m.bindingAlternatives = [...s];
|
|
756
743
|
}
|
|
757
744
|
}),
|
|
758
745
|
de(_e.FmButton, {
|
|
@@ -761,14 +748,14 @@ function cn(p) {
|
|
|
761
748
|
icon: "keyboard_arrow_down",
|
|
762
749
|
variant: "tertiary",
|
|
763
750
|
size: "md",
|
|
764
|
-
disabled:
|
|
751
|
+
disabled: m.disabled ?? !1,
|
|
765
752
|
onClick: () => {
|
|
766
|
-
const s = [...
|
|
753
|
+
const s = [...m.bindingAlternatives], a = s.findIndex((p) => p._id === o._id);
|
|
767
754
|
if (a < s.length - 1) {
|
|
768
|
-
const
|
|
769
|
-
s[a + 1] = o, s[a] =
|
|
755
|
+
const p = s[a + 1];
|
|
756
|
+
s[a + 1] = o, s[a] = p;
|
|
770
757
|
}
|
|
771
|
-
|
|
758
|
+
m.bindingAlternatives = [...s];
|
|
772
759
|
}
|
|
773
760
|
})
|
|
774
761
|
]);
|
|
@@ -785,26 +772,26 @@ function cn(p) {
|
|
|
785
772
|
get columnDefs() {
|
|
786
773
|
return i.value;
|
|
787
774
|
},
|
|
788
|
-
promptAddIngredient: async (
|
|
775
|
+
promptAddIngredient: async (x) => {
|
|
789
776
|
const u = [];
|
|
790
777
|
for (const a of t.skus)
|
|
791
|
-
|
|
778
|
+
x.includes(a._id) || u.push({
|
|
792
779
|
label: a.name,
|
|
793
780
|
sublabel: a.code,
|
|
794
781
|
value: a._id,
|
|
795
|
-
disabled:
|
|
782
|
+
disabled: x.includes(a._id)
|
|
796
783
|
});
|
|
797
|
-
const o = (
|
|
798
|
-
var
|
|
799
|
-
const
|
|
784
|
+
const o = (m.bindingAlternatives ?? []).map((a) => a._id), s = await d.multiSelect(u, o, (a) => {
|
|
785
|
+
var $, C, I, f, k, S;
|
|
786
|
+
const p = ($ = m.bindingAlternatives) == null ? void 0 : $.findIndex((b) => b._id === a);
|
|
800
787
|
return {
|
|
801
788
|
_id: a,
|
|
802
|
-
trackingMeasurement: typeof
|
|
803
|
-
priority: ((
|
|
789
|
+
trackingMeasurement: typeof p != "number" || p == -1 ? (C = t.skuById[a]) == null ? void 0 : C.trackingMeasurement : (f = (I = m.bindingAlternatives) == null ? void 0 : I[p]) == null ? void 0 : f.trackingMeasurement,
|
|
790
|
+
priority: ((S = (k = m.bindingAlternatives) == null ? void 0 : k[p]) == null ? void 0 : S.priority) ?? m.bindingAlternatives.length,
|
|
804
791
|
default: !1
|
|
805
792
|
};
|
|
806
793
|
});
|
|
807
|
-
|
|
794
|
+
m.bindingAlternatives = s ?? m.bindingAlternatives;
|
|
808
795
|
},
|
|
809
796
|
columnVisibility: {
|
|
810
797
|
delete: !0,
|
|
@@ -826,8 +813,8 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
826
813
|
filterIngredientIds: {}
|
|
827
814
|
},
|
|
828
815
|
emits: ["update:modelValue"],
|
|
829
|
-
setup(
|
|
830
|
-
const l =
|
|
816
|
+
setup(m, { emit: d }) {
|
|
817
|
+
const l = m, t = d, { t: i } = ie(), r = cn({
|
|
831
818
|
get disabled() {
|
|
832
819
|
return l.disabled ?? !1;
|
|
833
820
|
},
|
|
@@ -837,31 +824,31 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
837
824
|
set bindingAlternatives(o) {
|
|
838
825
|
t("update:modelValue", o);
|
|
839
826
|
}
|
|
840
|
-
}),
|
|
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;
|
|
841
828
|
return (o, s) => {
|
|
842
829
|
var I;
|
|
843
|
-
const a = G("FmLabel"),
|
|
844
|
-
return
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
830
|
+
const a = G("FmLabel"), p = G("FmButton"), $ = G("FmFormGroup"), C = G("FmTable");
|
|
831
|
+
return y(), E("div", pn, [
|
|
832
|
+
v("div", mn, [
|
|
833
|
+
v("div", fn, [
|
|
834
|
+
h(a, {
|
|
848
835
|
label: n(i)("inventory.alternatives")
|
|
849
836
|
}, null, 8, ["label"]),
|
|
850
|
-
|
|
837
|
+
h(p, {
|
|
851
838
|
disabled: o.disabled,
|
|
852
839
|
"prepend-icon": "link",
|
|
853
840
|
variant: "primary",
|
|
854
841
|
class: "border-1 rounded-lg border-fm-color-primary",
|
|
855
|
-
onClick: s[0] || (s[0] = (
|
|
842
|
+
onClick: s[0] || (s[0] = (f) => n(r).promptAddIngredient(o.filterIngredientIds)),
|
|
856
843
|
size: "md"
|
|
857
844
|
}, null, 8, ["disabled"])
|
|
858
845
|
]),
|
|
859
|
-
|
|
846
|
+
h($, {
|
|
860
847
|
"model-value": o.modelValue,
|
|
861
|
-
rules: [
|
|
848
|
+
rules: [x, u]
|
|
862
849
|
}, null, 8, ["model-value", "rules"])
|
|
863
850
|
]),
|
|
864
|
-
|
|
851
|
+
h(C, {
|
|
865
852
|
"row-data": o.modelValue ?? [],
|
|
866
853
|
"column-defs": n(r).columnDefs,
|
|
867
854
|
"page-size": ((I = o.modelValue) == null ? void 0 : I.length) || 0,
|
|
@@ -891,12 +878,12 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
891
878
|
ableToApplyRules: { type: Boolean }
|
|
892
879
|
},
|
|
893
880
|
emits: ["update:modelValue", "delete", "settings"],
|
|
894
|
-
setup(
|
|
881
|
+
setup(m, { emit: d }) {
|
|
895
882
|
const l = d, { t } = ie(), i = rt("modelValue");
|
|
896
883
|
function r(u) {
|
|
897
884
|
u && (i.amount = u.amount, i.measurement = u.measurement);
|
|
898
885
|
}
|
|
899
|
-
function
|
|
886
|
+
function x() {
|
|
900
887
|
return {
|
|
901
888
|
modelValue: {
|
|
902
889
|
amount: i.amount,
|
|
@@ -908,25 +895,25 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
908
895
|
};
|
|
909
896
|
}
|
|
910
897
|
return (u, o) => {
|
|
911
|
-
const s = G("FmTooltip"), a = G("FmButton"),
|
|
912
|
-
return
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
898
|
+
const s = G("FmTooltip"), a = G("FmButton"), p = G("FmFormGroup");
|
|
899
|
+
return y(), E("div", vn, [
|
|
900
|
+
v("div", yn, [
|
|
901
|
+
v("div", bn, [
|
|
902
|
+
v("div", gn, [
|
|
903
|
+
h(s, {
|
|
917
904
|
zIndex: 51,
|
|
918
905
|
variant: "plain",
|
|
919
906
|
placement: "top",
|
|
920
907
|
content: u.displayName
|
|
921
908
|
}, {
|
|
922
909
|
default: J(() => [
|
|
923
|
-
|
|
910
|
+
v("span", _n, U(u.displayName), 1)
|
|
924
911
|
]),
|
|
925
912
|
_: 1
|
|
926
913
|
}, 8, ["content"])
|
|
927
914
|
]),
|
|
928
|
-
|
|
929
|
-
|
|
915
|
+
v("div", kn, [
|
|
916
|
+
h(Be, {
|
|
930
917
|
"model-value": { amount: n(i).amount, measurement: n(i).measurement },
|
|
931
918
|
"onUpdate:modelValue": r,
|
|
932
919
|
unit: u.unit,
|
|
@@ -935,8 +922,8 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
935
922
|
disabled: u.readonly
|
|
936
923
|
}, null, 8, ["model-value", "unit", "disabled"])
|
|
937
924
|
]),
|
|
938
|
-
u.readonly ? T("", !0) : (
|
|
939
|
-
|
|
925
|
+
u.readonly ? T("", !0) : (y(), E("div", hn, [
|
|
926
|
+
h(a, {
|
|
940
927
|
disabled: u.disabled,
|
|
941
928
|
type: "button",
|
|
942
929
|
variant: "tertiary",
|
|
@@ -945,13 +932,13 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
945
932
|
}, null, 8, ["disabled"])
|
|
946
933
|
]))
|
|
947
934
|
]),
|
|
948
|
-
|
|
949
|
-
|
|
935
|
+
v("div", xn, [
|
|
936
|
+
h(p, {
|
|
950
937
|
modelValue: n(i).amount,
|
|
951
938
|
rules: [n(qe)(0)]
|
|
952
939
|
}, null, 8, ["modelValue", "rules"]),
|
|
953
|
-
|
|
954
|
-
modelValue:
|
|
940
|
+
h(p, {
|
|
941
|
+
modelValue: x(),
|
|
955
942
|
rules: [
|
|
956
943
|
n(Mt)(),
|
|
957
944
|
n(Dt)(u.unit),
|
|
@@ -959,16 +946,16 @@ const pn = { class: "flex flex-col gap-16" }, mn = { class: "flex flex-col" }, f
|
|
|
959
946
|
]
|
|
960
947
|
}, null, 8, ["modelValue", "rules"])
|
|
961
948
|
]),
|
|
962
|
-
u.ableToApplyRules ? (
|
|
949
|
+
u.ableToApplyRules ? (y(), Y(Re, {
|
|
963
950
|
key: 0,
|
|
964
951
|
modelValue: n(i).rules,
|
|
965
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
952
|
+
"onUpdate:modelValue": o[1] || (o[1] = ($) => n(i).rules = $),
|
|
966
953
|
disabled: u.disabled
|
|
967
954
|
}, null, 8, ["modelValue", "disabled"])) : T("", !0),
|
|
968
|
-
u.ableToConfigureAlternative ? (
|
|
955
|
+
u.ableToConfigureAlternative ? (y(), Y(Se, {
|
|
969
956
|
key: 1,
|
|
970
957
|
modelValue: n(i).alternatives,
|
|
971
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
958
|
+
"onUpdate:modelValue": o[2] || (o[2] = ($) => n(i).alternatives = $),
|
|
972
959
|
disabled: u.disabled,
|
|
973
960
|
filterIngredientIds: [n(i).id]
|
|
974
961
|
}, null, 8, ["modelValue", "disabled", "filterIngredientIds"])) : T("", !0)
|
|
@@ -1030,8 +1017,8 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1030
1017
|
enableIngredientGroup: { type: Boolean }
|
|
1031
1018
|
},
|
|
1032
1019
|
emits: ["update:modelValue", "click:pick-inventory-bindings"],
|
|
1033
|
-
setup(
|
|
1034
|
-
const { t: l } = ie(), t = ne(), i =
|
|
1020
|
+
setup(m, { emit: d }) {
|
|
1021
|
+
const { t: l } = ie(), t = ne(), i = A(() => t.recipeById), r = A(() => t.skuById), x = A(() => t.skuGroupById), u = m, o = d, s = A(() => kt({
|
|
1035
1022
|
parentId: u.id,
|
|
1036
1023
|
bindings: u.modelValue,
|
|
1037
1024
|
recipes: t.recipes.map((F) => F._id === u.id ? {
|
|
@@ -1045,178 +1032,178 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1045
1032
|
}
|
|
1046
1033
|
} : F),
|
|
1047
1034
|
skuGroups: t.skuGroups
|
|
1048
|
-
}).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), a =
|
|
1049
|
-
() => new Set(s.value.map((
|
|
1035
|
+
}).inventoryBindings.filter((F) => "error" in F && F.error).map((F) => F).filter((F) => F.reason === ht.enum.circularDependency)), a = A(
|
|
1036
|
+
() => new Set(s.value.map((g) => {
|
|
1050
1037
|
var B;
|
|
1051
|
-
return (B =
|
|
1038
|
+
return (B = g.bindingPaths[0]) == null ? void 0 : B.id;
|
|
1052
1039
|
}))
|
|
1053
|
-
),
|
|
1054
|
-
async function
|
|
1040
|
+
), p = A(() => u.modelValue.filter((g) => g.type === "RECIPE")), { promptIngredientsBinding: $, promptRecipesBinding: C, promptIngredientGroupsBinding: I } = Ht();
|
|
1041
|
+
async function f() {
|
|
1055
1042
|
if (u.iframeMode) {
|
|
1056
1043
|
o("click:pick-inventory-bindings", "RECIPE");
|
|
1057
1044
|
return;
|
|
1058
1045
|
}
|
|
1059
1046
|
C(
|
|
1060
1047
|
u.modelValue,
|
|
1061
|
-
(
|
|
1048
|
+
(g) => o("update:modelValue", g),
|
|
1062
1049
|
u.id ? [u.id] : []
|
|
1063
1050
|
);
|
|
1064
1051
|
}
|
|
1065
|
-
const
|
|
1066
|
-
async function
|
|
1052
|
+
const k = A(() => u.modelValue.filter((g) => g.type === "SKU_GROUP"));
|
|
1053
|
+
async function S() {
|
|
1067
1054
|
I(
|
|
1068
1055
|
u.modelValue,
|
|
1069
|
-
(
|
|
1056
|
+
(g) => o("update:modelValue", g),
|
|
1070
1057
|
u.id ? [u.id] : []
|
|
1071
1058
|
);
|
|
1072
1059
|
}
|
|
1073
|
-
function
|
|
1074
|
-
const
|
|
1060
|
+
function b(g, B, F) {
|
|
1061
|
+
const R = +B;
|
|
1075
1062
|
let P = F;
|
|
1076
|
-
B.length > 0 && isFinite(
|
|
1063
|
+
B.length > 0 && isFinite(R) ? P = F.map((K) => (K.id !== g || (K.amount = Ke(R)), K)) : P = F.map((K) => (K.id !== g || (K.amount = { amount: 0, precision: 0 }), K)), o("update:modelValue", P);
|
|
1077
1064
|
}
|
|
1078
|
-
const e =
|
|
1079
|
-
async function
|
|
1065
|
+
const e = A(() => u.modelValue.filter((g) => g.type === "SKU") ?? []);
|
|
1066
|
+
async function V() {
|
|
1080
1067
|
if (u.iframeMode) {
|
|
1081
1068
|
o("click:pick-inventory-bindings", "SKU");
|
|
1082
1069
|
return;
|
|
1083
1070
|
}
|
|
1084
|
-
|
|
1071
|
+
$(
|
|
1085
1072
|
u.modelValue,
|
|
1086
|
-
(
|
|
1073
|
+
(g) => o("update:modelValue", g),
|
|
1087
1074
|
u.excludeBindingId,
|
|
1088
1075
|
u.id ? [u.id] : []
|
|
1089
1076
|
);
|
|
1090
1077
|
}
|
|
1091
|
-
function c(
|
|
1092
|
-
const B = u.modelValue.map((F) => F.id ===
|
|
1078
|
+
function c(g) {
|
|
1079
|
+
const B = u.modelValue.map((F) => F.id === g.id ? g : F);
|
|
1093
1080
|
o("update:modelValue", B);
|
|
1094
1081
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const B = u.modelValue.filter((F) => F.id !==
|
|
1082
|
+
function _(g) {
|
|
1083
|
+
const B = u.modelValue.filter((F) => F.id !== g);
|
|
1097
1084
|
o("update:modelValue", B);
|
|
1098
1085
|
}
|
|
1099
|
-
function N(
|
|
1100
|
-
var F,
|
|
1101
|
-
if (
|
|
1086
|
+
function N(g) {
|
|
1087
|
+
var F, R;
|
|
1088
|
+
if (g.type !== be.enum.SKU)
|
|
1102
1089
|
throw new Error("Non-SKU binding does not have unit");
|
|
1103
|
-
if (!((F = r.value[
|
|
1104
|
-
throw new Error(`Cannot find ingredient: ${
|
|
1105
|
-
return (
|
|
1090
|
+
if (!((F = r.value[g.id]) == null ? void 0 : F.unit))
|
|
1091
|
+
throw new Error(`Cannot find ingredient: ${g.id}`);
|
|
1092
|
+
return (R = r.value[g.id]) == null ? void 0 : R.unit;
|
|
1106
1093
|
}
|
|
1107
|
-
function z(
|
|
1108
|
-
return !r.value[
|
|
1094
|
+
function z(g) {
|
|
1095
|
+
return !r.value[g.id];
|
|
1109
1096
|
}
|
|
1110
|
-
return (
|
|
1097
|
+
return (g, B) => {
|
|
1111
1098
|
var H, ee, O;
|
|
1112
|
-
const F = G("FmFormGroup"),
|
|
1113
|
-
return
|
|
1114
|
-
|
|
1115
|
-
disabled:
|
|
1116
|
-
"model-value":
|
|
1099
|
+
const F = G("FmFormGroup"), R = G("FmButton"), P = G("FmIcon"), K = G("FmTextField");
|
|
1100
|
+
return y(), E("div", In, [
|
|
1101
|
+
h(F, {
|
|
1102
|
+
disabled: g.disabled,
|
|
1103
|
+
"model-value": g.modelValue,
|
|
1117
1104
|
rules: [
|
|
1118
|
-
...
|
|
1105
|
+
...g.rules,
|
|
1119
1106
|
() => s.value.length ? "There is a binding error in your configuration" : !0
|
|
1120
1107
|
]
|
|
1121
1108
|
}, {
|
|
1122
1109
|
label: J(() => B[4] || (B[4] = [
|
|
1123
|
-
|
|
1110
|
+
v("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
|
|
1124
1111
|
])),
|
|
1125
1112
|
_: 1
|
|
1126
1113
|
}, 8, ["disabled", "model-value", "rules"]),
|
|
1127
|
-
((H =
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1114
|
+
((H = g.recipeBindingConfig) == null ? void 0 : H.enabled) !== !1 ? (y(), E("div", wn, [
|
|
1115
|
+
v("div", En, [
|
|
1116
|
+
v("div", Vn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
|
|
1117
|
+
g.readonly ? T("", !0) : (y(), Y(R, {
|
|
1131
1118
|
key: 0,
|
|
1132
1119
|
variant: "secondary",
|
|
1133
1120
|
"text-color": "primary",
|
|
1134
1121
|
"border-color": "primary",
|
|
1135
1122
|
label: n(l)("inventory.inventoryBindings.linkRecipe"),
|
|
1136
1123
|
"prepend-icon": "link",
|
|
1137
|
-
onClick:
|
|
1124
|
+
onClick: f
|
|
1138
1125
|
}, null, 8, ["label"]))
|
|
1139
1126
|
]),
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
B[5] || (B[5] =
|
|
1144
|
-
|
|
1145
|
-
|
|
1127
|
+
v("div", Sn, [
|
|
1128
|
+
v("div", Cn, [
|
|
1129
|
+
v("div", Bn, U(n(l)("inventory.inventoryBindings.recipe")), 1),
|
|
1130
|
+
B[5] || (B[5] = v("div", { class: "w-[200px]" }, null, -1)),
|
|
1131
|
+
g.recipeBindingConfig.ableToApplyRules ? (y(), E("div", Fn)) : T("", !0),
|
|
1132
|
+
g.readonly ? T("", !0) : (y(), E("div", Rn))
|
|
1146
1133
|
]),
|
|
1147
|
-
(
|
|
1134
|
+
(y(!0), E(X, null, me(p.value, (M) => {
|
|
1148
1135
|
var L;
|
|
1149
|
-
return
|
|
1136
|
+
return y(), Y(un, {
|
|
1150
1137
|
key: M.id,
|
|
1151
1138
|
"model-value": M,
|
|
1152
1139
|
"display-name": (L = i.value[M.id]) == null ? void 0 : L.name,
|
|
1153
1140
|
"show-error": a.value.has(M.id),
|
|
1154
|
-
readonly:
|
|
1155
|
-
disabled:
|
|
1141
|
+
readonly: g.readonly,
|
|
1142
|
+
disabled: g.disabled,
|
|
1156
1143
|
"onUpdate:modelValue": B[0] || (B[0] = (q) => c(q)),
|
|
1157
|
-
onDelete: B[1] || (B[1] = (q) =>
|
|
1144
|
+
onDelete: B[1] || (B[1] = (q) => _(q))
|
|
1158
1145
|
}, null, 8, ["model-value", "display-name", "show-error", "readonly", "disabled"]);
|
|
1159
1146
|
}), 128))
|
|
1160
1147
|
])
|
|
1161
1148
|
])) : T("", !0),
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1149
|
+
g.enableIngredientGroup ? (y(), E("div", An, [
|
|
1150
|
+
v("div", Tn, [
|
|
1151
|
+
v("div", Un, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
|
|
1152
|
+
g.readonly ? T("", !0) : (y(), Y(R, {
|
|
1166
1153
|
key: 0,
|
|
1167
1154
|
variant: "secondary",
|
|
1168
1155
|
"text-color": "primary",
|
|
1169
1156
|
"border-color": "primary",
|
|
1170
1157
|
label: n(l)("inventory.inventoryBindings.linkIngredientGroup"),
|
|
1171
1158
|
"prepend-icon": "link",
|
|
1172
|
-
onClick:
|
|
1159
|
+
onClick: S
|
|
1173
1160
|
}, null, 8, ["label"]))
|
|
1174
1161
|
]),
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
B[6] || (B[6] =
|
|
1179
|
-
B[7] || (B[7] =
|
|
1162
|
+
v("div", Pn, [
|
|
1163
|
+
v("div", Mn, [
|
|
1164
|
+
v("div", Dn, U(n(l)("inventory.inventoryBindings.ingredientGroup")), 1),
|
|
1165
|
+
B[6] || (B[6] = v("div", { class: "w-[200px]" }, null, -1)),
|
|
1166
|
+
B[7] || (B[7] = v("div", { class: "w-[52px]" }, null, -1))
|
|
1180
1167
|
]),
|
|
1181
|
-
(
|
|
1168
|
+
(y(!0), E(X, null, me(k.value, (M) => (y(), Y(F, {
|
|
1182
1169
|
key: M.id,
|
|
1183
|
-
disabled:
|
|
1170
|
+
disabled: g.disabled,
|
|
1184
1171
|
modelValue: +n(Q)(M.amount ?? { amount: 1, precision: 0 }),
|
|
1185
1172
|
rules: [n(it)(0), n(qe)(0)]
|
|
1186
1173
|
}, {
|
|
1187
1174
|
default: J(({ invalid: L }) => {
|
|
1188
1175
|
var q;
|
|
1189
1176
|
return [
|
|
1190
|
-
|
|
1191
|
-
a.value.has(M.id) ? (
|
|
1192
|
-
|
|
1177
|
+
v("div", Gn, [
|
|
1178
|
+
a.value.has(M.id) ? (y(), E("div", Nn, [
|
|
1179
|
+
h(P, {
|
|
1193
1180
|
name: "error",
|
|
1194
1181
|
color: "system-error-300",
|
|
1195
1182
|
size: "sm"
|
|
1196
1183
|
}),
|
|
1197
|
-
|
|
1184
|
+
v("div", null, U(n(l)("inventory.inventoryBindings.circularError")), 1)
|
|
1198
1185
|
])) : T("", !0),
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1186
|
+
v("div", zn, [
|
|
1187
|
+
v("div", On, [
|
|
1188
|
+
v("div", Ln, U((q = x.value[M.id]) == null ? void 0 : q.name), 1)
|
|
1202
1189
|
]),
|
|
1203
|
-
|
|
1204
|
-
|
|
1190
|
+
v("div", jn, [
|
|
1191
|
+
h(K, {
|
|
1205
1192
|
class: "w-full",
|
|
1206
|
-
disabled:
|
|
1193
|
+
disabled: g.disabled,
|
|
1207
1194
|
modelValue: +n(Q)(M.amount ?? { amount: 1, precision: 0 }),
|
|
1208
|
-
"onUpdate:modelValue": (oe) =>
|
|
1195
|
+
"onUpdate:modelValue": (oe) => b(M.id, oe, g.modelValue),
|
|
1209
1196
|
invalid: L
|
|
1210
1197
|
}, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
|
|
1211
1198
|
]),
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
disabled:
|
|
1199
|
+
g.readonly ? T("", !0) : (y(), E("div", Kn, [
|
|
1200
|
+
h(R, {
|
|
1201
|
+
disabled: g.disabled,
|
|
1215
1202
|
type: "button",
|
|
1216
1203
|
variant: "plain",
|
|
1217
1204
|
icon: "delete",
|
|
1218
1205
|
"icon-color": "#000000",
|
|
1219
|
-
onClick: (oe) =>
|
|
1206
|
+
onClick: (oe) => _(M.id)
|
|
1220
1207
|
}, null, 8, ["disabled", "onClick"])
|
|
1221
1208
|
]))
|
|
1222
1209
|
])
|
|
@@ -1227,64 +1214,64 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1227
1214
|
}, 1032, ["disabled", "modelValue", "rules"]))), 128))
|
|
1228
1215
|
])
|
|
1229
1216
|
])) : T("", !0),
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1217
|
+
v("div", qn, [
|
|
1218
|
+
v("div", Wn, [
|
|
1219
|
+
v("div", Yn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
|
|
1220
|
+
g.readonly ? T("", !0) : (y(), Y(R, {
|
|
1234
1221
|
key: 0,
|
|
1235
1222
|
variant: "secondary",
|
|
1236
1223
|
"text-color": "primary",
|
|
1237
1224
|
"border-color": "primary",
|
|
1238
1225
|
label: n(l)("inventory.inventoryBindings.linkIngredient"),
|
|
1239
1226
|
"prepend-icon": "link",
|
|
1240
|
-
onClick:
|
|
1227
|
+
onClick: V
|
|
1241
1228
|
}, null, 8, ["label"]))
|
|
1242
1229
|
]),
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
B[8] || (B[8] =
|
|
1248
|
-
(ee =
|
|
1230
|
+
v("div", Jn, [
|
|
1231
|
+
v("div", Hn, [
|
|
1232
|
+
v("div", Qn, U(n(l)("inventory.inventoryBindings.ingredient")), 1),
|
|
1233
|
+
v("div", Xn, U(n(l)("inventory.inventoryBindings.amount")), 1),
|
|
1234
|
+
B[8] || (B[8] = v("div", { class: "w-[52px]" }, null, -1)),
|
|
1235
|
+
(ee = g.skuBindingConfig) != null && ee.ableToApplyRules || (O = g.skuBindingConfig) != null && O.ableToConfigureAlternative ? (y(), E("div", Zn)) : T("", !0)
|
|
1249
1236
|
]),
|
|
1250
|
-
(
|
|
1237
|
+
(y(!0), E(X, null, me(e.value, (M) => {
|
|
1251
1238
|
var L, q, oe;
|
|
1252
|
-
return
|
|
1239
|
+
return y(), E(X, {
|
|
1253
1240
|
key: M.id
|
|
1254
1241
|
}, [
|
|
1255
|
-
z(M) ? (
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
disabled:
|
|
1242
|
+
z(M) ? (y(), E("div", eo, [
|
|
1243
|
+
v("div", to, [
|
|
1244
|
+
v("div", no, U(M.id), 1),
|
|
1245
|
+
g.readonly ? T("", !0) : (y(), E("div", oo, [
|
|
1246
|
+
h(R, {
|
|
1247
|
+
disabled: g.disabled,
|
|
1261
1248
|
type: "button",
|
|
1262
1249
|
variant: "tertiary",
|
|
1263
1250
|
icon: "delete",
|
|
1264
|
-
onClick: () =>
|
|
1251
|
+
onClick: () => _(M.id)
|
|
1265
1252
|
}, null, 8, ["disabled", "onClick"])
|
|
1266
1253
|
]))
|
|
1267
1254
|
]),
|
|
1268
|
-
|
|
1269
|
-
|
|
1255
|
+
v("div", io, [
|
|
1256
|
+
h(P, {
|
|
1270
1257
|
name: "error",
|
|
1271
1258
|
color: "system-error-300",
|
|
1272
1259
|
size: "sm"
|
|
1273
1260
|
}),
|
|
1274
|
-
|
|
1261
|
+
v("div", null, U(n(l)("inventory.inventoryBindings.missingIngredient")), 1)
|
|
1275
1262
|
])
|
|
1276
|
-
])) : (
|
|
1263
|
+
])) : (y(), Y($n, {
|
|
1277
1264
|
key: 1,
|
|
1278
1265
|
"model-value": M,
|
|
1279
1266
|
"display-name": (L = r.value[M.id]) == null ? void 0 : L.name,
|
|
1280
1267
|
unit: N(M),
|
|
1281
1268
|
"show-error": a.value.has(M.id),
|
|
1282
|
-
"able-to-apply-rules": ((q =
|
|
1283
|
-
"able-to-configure-alternative": ((oe =
|
|
1284
|
-
readonly:
|
|
1285
|
-
disabled:
|
|
1269
|
+
"able-to-apply-rules": ((q = g.skuBindingConfig) == null ? void 0 : q.ableToApplyRules) === !0,
|
|
1270
|
+
"able-to-configure-alternative": ((oe = g.skuBindingConfig) == null ? void 0 : oe.ableToConfigureAlternative) === !0,
|
|
1271
|
+
readonly: g.readonly,
|
|
1272
|
+
disabled: g.disabled,
|
|
1286
1273
|
"onUpdate:modelValue": B[2] || (B[2] = (Z) => c(Z)),
|
|
1287
|
-
onDelete: B[3] || (B[3] = (Z) =>
|
|
1274
|
+
onDelete: B[3] || (B[3] = (Z) => _(Z))
|
|
1288
1275
|
}, null, 8, ["model-value", "display-name", "unit", "show-error", "able-to-apply-rules", "able-to-configure-alternative", "readonly", "disabled"]))
|
|
1289
1276
|
], 64);
|
|
1290
1277
|
}), 128))
|
|
@@ -1310,46 +1297,46 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1310
1297
|
disabled: { type: Boolean }
|
|
1311
1298
|
},
|
|
1312
1299
|
emits: ["update:modelValue", "click:submit"],
|
|
1313
|
-
setup(
|
|
1314
|
-
const t =
|
|
1300
|
+
setup(m, { expose: d, emit: l }) {
|
|
1301
|
+
const t = m, i = l, r = We(), { t: x } = ie(), u = A({
|
|
1315
1302
|
get() {
|
|
1316
1303
|
var c;
|
|
1317
1304
|
return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
|
|
1318
1305
|
},
|
|
1319
1306
|
set(c) {
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1307
|
+
const _ = t.modelValue ?? {};
|
|
1308
|
+
_.name = c, i("update:modelValue", _);
|
|
1322
1309
|
}
|
|
1323
|
-
}), o =
|
|
1310
|
+
}), o = A({
|
|
1324
1311
|
get() {
|
|
1325
1312
|
var c;
|
|
1326
1313
|
return ((c = t.modelValue) == null ? void 0 : c.contains) ?? [];
|
|
1327
1314
|
},
|
|
1328
1315
|
set(c) {
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1316
|
+
const _ = t.modelValue ?? {};
|
|
1317
|
+
_.contains = c, i("update:modelValue", _);
|
|
1331
1318
|
}
|
|
1332
|
-
}), s =
|
|
1319
|
+
}), s = A({
|
|
1333
1320
|
get() {
|
|
1334
1321
|
var c;
|
|
1335
1322
|
return ((c = t.modelValue) == null ? void 0 : c.customAttributes) ?? {};
|
|
1336
1323
|
},
|
|
1337
1324
|
set(c) {
|
|
1338
|
-
const
|
|
1325
|
+
const _ = t.modelValue ? {
|
|
1339
1326
|
...t.modelValue
|
|
1340
1327
|
} : {};
|
|
1341
|
-
|
|
1328
|
+
_.customAttributes = c, i("update:modelValue", _);
|
|
1342
1329
|
}
|
|
1343
|
-
}), a =
|
|
1330
|
+
}), a = A({
|
|
1344
1331
|
get() {
|
|
1345
1332
|
var c;
|
|
1346
1333
|
return ((c = t.modelValue) == null ? void 0 : c.version) ?? null;
|
|
1347
1334
|
},
|
|
1348
1335
|
set(c) {
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1336
|
+
const _ = t.modelValue ? { ...t.modelValue } : {};
|
|
1337
|
+
_.version = c, i("update:modelValue", _);
|
|
1351
1338
|
}
|
|
1352
|
-
}),
|
|
1339
|
+
}), p = A({
|
|
1353
1340
|
get() {
|
|
1354
1341
|
return a.value === "v2";
|
|
1355
1342
|
},
|
|
@@ -1357,94 +1344,94 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1357
1344
|
a.value = c ? "v2" : null;
|
|
1358
1345
|
}
|
|
1359
1346
|
});
|
|
1360
|
-
function
|
|
1347
|
+
function $() {
|
|
1361
1348
|
i("click:submit");
|
|
1362
1349
|
}
|
|
1363
1350
|
const C = W();
|
|
1364
1351
|
d({
|
|
1365
1352
|
validateInputs: () => {
|
|
1366
|
-
var c,
|
|
1367
|
-
(
|
|
1353
|
+
var c, _;
|
|
1354
|
+
(_ = (c = C.value) == null ? void 0 : c.validateInputs) == null || _.call(c);
|
|
1368
1355
|
},
|
|
1369
1356
|
resetInputsValidation: () => {
|
|
1370
|
-
var c,
|
|
1371
|
-
(
|
|
1357
|
+
var c, _;
|
|
1358
|
+
(_ = (c = C.value) == null ? void 0 : c.resetInputsValidation) == null || _.call(c);
|
|
1372
1359
|
},
|
|
1373
1360
|
resetInputs: () => {
|
|
1374
|
-
var c,
|
|
1375
|
-
(
|
|
1361
|
+
var c, _;
|
|
1362
|
+
(_ = (c = C.value) == null ? void 0 : c.resetInputs) == null || _.call(c);
|
|
1376
1363
|
}
|
|
1377
1364
|
});
|
|
1378
|
-
const I = ne(),
|
|
1379
|
-
ue(
|
|
1380
|
-
|
|
1365
|
+
const I = ne(), f = W([]), k = W(!1), S = W(!1);
|
|
1366
|
+
ue(k, async (c) => {
|
|
1367
|
+
b(c);
|
|
1381
1368
|
});
|
|
1382
|
-
async function
|
|
1383
|
-
var
|
|
1384
|
-
c && !
|
|
1369
|
+
async function b(c) {
|
|
1370
|
+
var _, N;
|
|
1371
|
+
c && !S.value && ((_ = t.modelValue) != null && _._id) && (S.value = !0, f.value = await I.getAffectedMenu((N = t.modelValue) == null ? void 0 : N._id).delayed(500), S.value = !1);
|
|
1385
1372
|
}
|
|
1386
|
-
const e =
|
|
1373
|
+
const e = A(
|
|
1387
1374
|
() => I.recipes.map((c) => ({ label: c.name, value: c.name }))
|
|
1388
|
-
),
|
|
1375
|
+
), V = A(() => {
|
|
1389
1376
|
var c;
|
|
1390
1377
|
return ((c = t.modelValue) == null ? void 0 : c.name) ?? "";
|
|
1391
1378
|
});
|
|
1392
|
-
return (c,
|
|
1393
|
-
const N = G("FmTextField"), z = G("FmSwitch"),
|
|
1394
|
-
return
|
|
1379
|
+
return (c, _) => {
|
|
1380
|
+
const N = G("FmTextField"), z = G("FmSwitch"), g = G("FmCard"), B = G("FmSpacer"), F = G("FmCircularProgress"), R = G("FmForm");
|
|
1381
|
+
return y(), Y(R, {
|
|
1395
1382
|
ref_key: "formRef",
|
|
1396
1383
|
ref: C,
|
|
1397
|
-
onValidationSuccess:
|
|
1384
|
+
onValidationSuccess: $
|
|
1398
1385
|
}, {
|
|
1399
1386
|
default: J(() => [
|
|
1400
|
-
|
|
1401
|
-
|
|
1387
|
+
v("div", ro, [
|
|
1388
|
+
h(N, {
|
|
1402
1389
|
disabled: c.disabled,
|
|
1403
|
-
label: n(
|
|
1390
|
+
label: n(x)("inventory.recipe.name"),
|
|
1404
1391
|
"model-value": u.value,
|
|
1405
|
-
"onUpdate:modelValue":
|
|
1392
|
+
"onUpdate:modelValue": _[0] || (_[0] = (P) => u.value = P),
|
|
1406
1393
|
rules: [
|
|
1407
1394
|
n(Rt)(),
|
|
1408
|
-
n(lt)(e.value,
|
|
1395
|
+
n(lt)(e.value, V.value, (P) => `[${P.value}] already exists`)
|
|
1409
1396
|
],
|
|
1410
1397
|
"label-mark": "required"
|
|
1411
1398
|
}, null, 8, ["disabled", "label", "model-value", "rules"]),
|
|
1412
|
-
n(r).enableRecipeV2 ? (
|
|
1413
|
-
|
|
1414
|
-
modelValue:
|
|
1415
|
-
"onUpdate:modelValue":
|
|
1399
|
+
n(r).enableRecipeV2 ? (y(), E("div", ao, [
|
|
1400
|
+
h(z, {
|
|
1401
|
+
modelValue: p.value,
|
|
1402
|
+
"onUpdate:modelValue": _[1] || (_[1] = (P) => p.value = P),
|
|
1416
1403
|
value: !0,
|
|
1417
|
-
label: n(
|
|
1404
|
+
label: n(x)("inventory.recipe.enableRecipeV2"),
|
|
1418
1405
|
"label-placement": "right",
|
|
1419
1406
|
disabled: c.disabled,
|
|
1420
|
-
sublabel: n(
|
|
1407
|
+
sublabel: n(x)("inventory.recipe.recipeV2Warning")
|
|
1421
1408
|
}, null, 8, ["modelValue", "label", "disabled", "sublabel"])
|
|
1422
1409
|
])) : T("", !0),
|
|
1423
|
-
|
|
1410
|
+
h(g, {
|
|
1424
1411
|
variant: "outlined",
|
|
1425
1412
|
class: "p-16"
|
|
1426
1413
|
}, {
|
|
1427
1414
|
default: J(() => {
|
|
1428
1415
|
var P, K;
|
|
1429
1416
|
return [
|
|
1430
|
-
n(r).enableRecipeV2 ? (
|
|
1417
|
+
n(r).enableRecipeV2 ? (y(), Y(lo, {
|
|
1431
1418
|
key: 0,
|
|
1432
1419
|
id: (P = c.modelValue) == null ? void 0 : P._id,
|
|
1433
1420
|
disabled: c.disabled,
|
|
1434
1421
|
"model-value": o.value,
|
|
1435
|
-
"onUpdate:modelValue":
|
|
1422
|
+
"onUpdate:modelValue": _[2] || (_[2] = (H) => o.value = H),
|
|
1436
1423
|
rules: [n(Ne)(1)],
|
|
1437
1424
|
"enable-ingredient-group": n(r).enableIngredientGroup,
|
|
1438
|
-
"recipe-binding-config": { enabled: !
|
|
1425
|
+
"recipe-binding-config": { enabled: !p.value, ableToApplyRules: p.value },
|
|
1439
1426
|
"sku-binding-config": {
|
|
1440
|
-
ableToConfigureAlternative:
|
|
1427
|
+
ableToConfigureAlternative: p.value
|
|
1441
1428
|
}
|
|
1442
|
-
}, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (
|
|
1429
|
+
}, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group", "recipe-binding-config", "sku-binding-config"])) : (y(), Y(At, {
|
|
1443
1430
|
key: 1,
|
|
1444
1431
|
id: (K = c.modelValue) == null ? void 0 : K._id,
|
|
1445
1432
|
disabled: c.disabled,
|
|
1446
1433
|
"model-value": o.value,
|
|
1447
|
-
"onUpdate:modelValue":
|
|
1434
|
+
"onUpdate:modelValue": _[3] || (_[3] = (H) => o.value = H),
|
|
1448
1435
|
rules: [n(Ne)(1)],
|
|
1449
1436
|
"enable-ingredient-group": n(r).enableIngredientGroup
|
|
1450
1437
|
}, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group"]))
|
|
@@ -1453,33 +1440,33 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1453
1440
|
_: 1
|
|
1454
1441
|
})
|
|
1455
1442
|
]),
|
|
1456
|
-
c.mode !== n(se).CREATE ? (
|
|
1457
|
-
|
|
1443
|
+
c.mode !== n(se).CREATE ? (y(), E("div", so, [
|
|
1444
|
+
h(z, {
|
|
1458
1445
|
label: "Show binded items",
|
|
1459
|
-
modelValue:
|
|
1460
|
-
"onUpdate:modelValue":
|
|
1446
|
+
modelValue: k.value,
|
|
1447
|
+
"onUpdate:modelValue": _[4] || (_[4] = (P) => k.value = P),
|
|
1461
1448
|
"label-placement": "right",
|
|
1462
|
-
disabled:
|
|
1449
|
+
disabled: S.value
|
|
1463
1450
|
}, null, 8, ["modelValue", "disabled"]),
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1451
|
+
S.value ? (y(), E("div", uo, [
|
|
1452
|
+
h(B),
|
|
1453
|
+
v("div", null, [
|
|
1454
|
+
h(F, { size: "xl" })
|
|
1468
1455
|
]),
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
])) :
|
|
1472
|
-
|
|
1456
|
+
_[6] || (_[6] = v("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
1457
|
+
h(B)
|
|
1458
|
+
])) : k.value && f.value.length ? (y(), E("div", co, [
|
|
1459
|
+
h(nt, {
|
|
1473
1460
|
name: "Menu",
|
|
1474
|
-
bindings:
|
|
1461
|
+
bindings: f.value
|
|
1475
1462
|
}, null, 8, ["bindings"])
|
|
1476
1463
|
])) : T("", !0)
|
|
1477
1464
|
])) : T("", !0),
|
|
1478
|
-
|
|
1479
|
-
|
|
1465
|
+
v("div", po, [
|
|
1466
|
+
h(Ot, {
|
|
1480
1467
|
entity: "inventoryRecipe",
|
|
1481
1468
|
modelValue: s.value,
|
|
1482
|
-
"onUpdate:modelValue":
|
|
1469
|
+
"onUpdate:modelValue": _[5] || (_[5] = (P) => s.value = P)
|
|
1483
1470
|
}, null, 8, ["modelValue"])
|
|
1484
1471
|
])
|
|
1485
1472
|
]),
|
|
@@ -1495,8 +1482,8 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1495
1482
|
mode: { default: se.READ }
|
|
1496
1483
|
},
|
|
1497
1484
|
emits: ["update:show"],
|
|
1498
|
-
setup(
|
|
1499
|
-
const d =
|
|
1485
|
+
setup(m) {
|
|
1486
|
+
const d = m, l = ne(), t = je(), { t: i } = ie(), r = Ge(d, "show"), x = Ge(d, "recipe"), u = A(() => {
|
|
1500
1487
|
switch (d.mode) {
|
|
1501
1488
|
case se.READ:
|
|
1502
1489
|
return "";
|
|
@@ -1506,7 +1493,7 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1506
1493
|
return i("inventory.recipe.create.title");
|
|
1507
1494
|
}
|
|
1508
1495
|
return "";
|
|
1509
|
-
}), o =
|
|
1496
|
+
}), o = A(() => {
|
|
1510
1497
|
switch (d.mode) {
|
|
1511
1498
|
case se.READ:
|
|
1512
1499
|
return "";
|
|
@@ -1517,17 +1504,17 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1517
1504
|
}
|
|
1518
1505
|
return "";
|
|
1519
1506
|
}), s = W(), a = W(!1);
|
|
1520
|
-
async function
|
|
1507
|
+
async function p() {
|
|
1521
1508
|
a.value = !0;
|
|
1522
1509
|
try {
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1510
|
+
const f = Oe(x.value);
|
|
1511
|
+
f.precision ?? (f.precision = 0), f.measurements ?? (f.measurements = []), await l.createRecipe(f), r.value = !1, t.open({
|
|
1525
1512
|
title: i("inventory.common.success"),
|
|
1526
|
-
message: i("inventory.recipe.create.success", { name:
|
|
1513
|
+
message: i("inventory.recipe.create.success", { name: x.value.name }),
|
|
1527
1514
|
type: "success"
|
|
1528
1515
|
});
|
|
1529
|
-
} catch (
|
|
1530
|
-
|
|
1516
|
+
} catch (f) {
|
|
1517
|
+
f instanceof Je || t.open({
|
|
1531
1518
|
title: i("inventory.recipe.create.error.title"),
|
|
1532
1519
|
message: i("inventory.recipe.create.error.message"),
|
|
1533
1520
|
type: "error"
|
|
@@ -1536,16 +1523,16 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1536
1523
|
a.value = !1;
|
|
1537
1524
|
}
|
|
1538
1525
|
}
|
|
1539
|
-
async function
|
|
1526
|
+
async function $() {
|
|
1540
1527
|
a.value = !0;
|
|
1541
1528
|
try {
|
|
1542
|
-
await l.updateRecipe(
|
|
1529
|
+
await l.updateRecipe(x.value), r.value = !1, t.open({
|
|
1543
1530
|
title: i("inventory.common.success"),
|
|
1544
|
-
message: i("inventory.recipe.update.success", { name:
|
|
1531
|
+
message: i("inventory.recipe.update.success", { name: x.value.name }),
|
|
1545
1532
|
type: "success"
|
|
1546
1533
|
});
|
|
1547
|
-
} catch (
|
|
1548
|
-
|
|
1534
|
+
} catch (f) {
|
|
1535
|
+
f instanceof Je || t.open({
|
|
1549
1536
|
title: i("inventory.recipe.update.error.title"),
|
|
1550
1537
|
message: i("inventory.recipe.update.error.message"),
|
|
1551
1538
|
type: "error"
|
|
@@ -1555,54 +1542,54 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1555
1542
|
}
|
|
1556
1543
|
}
|
|
1557
1544
|
function C() {
|
|
1558
|
-
var
|
|
1559
|
-
(
|
|
1545
|
+
var f, k;
|
|
1546
|
+
(k = (f = s.value) == null ? void 0 : f.validateInputs) == null || k.call(f);
|
|
1560
1547
|
}
|
|
1561
1548
|
function I() {
|
|
1562
1549
|
switch (d.mode) {
|
|
1563
1550
|
case se.READ:
|
|
1564
1551
|
return;
|
|
1565
1552
|
case se.UPDATE:
|
|
1566
|
-
return
|
|
1553
|
+
return $();
|
|
1567
1554
|
case se.CREATE:
|
|
1568
|
-
return
|
|
1555
|
+
return p();
|
|
1569
1556
|
}
|
|
1570
1557
|
}
|
|
1571
|
-
return (
|
|
1572
|
-
const
|
|
1573
|
-
return
|
|
1558
|
+
return (f, k) => {
|
|
1559
|
+
const S = G("FmButton"), b = G("FmSideSheet");
|
|
1560
|
+
return y(), Y(b, {
|
|
1574
1561
|
"model-value": n(r),
|
|
1575
|
-
"onUpdate:modelValue":
|
|
1562
|
+
"onUpdate:modelValue": k[3] || (k[3] = (e) => De(r) ? r.value = e : null),
|
|
1576
1563
|
header: u.value,
|
|
1577
1564
|
"close-button": "",
|
|
1578
1565
|
"dismiss-away": "",
|
|
1579
1566
|
"max-width": 800
|
|
1580
1567
|
}, {
|
|
1581
1568
|
"side-sheet-footer": J(() => [
|
|
1582
|
-
|
|
1583
|
-
|
|
1569
|
+
v("div", fo, [
|
|
1570
|
+
h(S, {
|
|
1584
1571
|
loading: a.value,
|
|
1585
1572
|
label: o.value,
|
|
1586
1573
|
onClick: C
|
|
1587
1574
|
}, null, 8, ["loading", "label"]),
|
|
1588
|
-
|
|
1575
|
+
h(S, {
|
|
1589
1576
|
disabled: a.value,
|
|
1590
1577
|
label: n(i)("common.close"),
|
|
1591
1578
|
variant: "tertiary",
|
|
1592
|
-
onClick:
|
|
1579
|
+
onClick: k[2] || (k[2] = (e) => r.value = !1)
|
|
1593
1580
|
}, null, 8, ["disabled", "label"])
|
|
1594
1581
|
])
|
|
1595
1582
|
]),
|
|
1596
1583
|
default: J(() => [
|
|
1597
|
-
|
|
1584
|
+
h(mo, {
|
|
1598
1585
|
class: "w-full",
|
|
1599
1586
|
ref_key: "hasValidationExpose",
|
|
1600
1587
|
ref: s,
|
|
1601
|
-
modelValue: n(
|
|
1602
|
-
"onUpdate:modelValue":
|
|
1603
|
-
mode:
|
|
1588
|
+
modelValue: n(x),
|
|
1589
|
+
"onUpdate:modelValue": k[0] || (k[0] = (e) => De(x) ? x.value = e : null),
|
|
1590
|
+
mode: f.mode,
|
|
1604
1591
|
disabled: a.value,
|
|
1605
|
-
"onClick:submit":
|
|
1592
|
+
"onClick:submit": k[1] || (k[1] = (e) => I())
|
|
1606
1593
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
1607
1594
|
]),
|
|
1608
1595
|
_: 1
|
|
@@ -1610,9 +1597,9 @@ const In = { class: "flex flex-col gap-24" }, wn = {
|
|
|
1610
1597
|
};
|
|
1611
1598
|
}
|
|
1612
1599
|
});
|
|
1613
|
-
function ke(
|
|
1600
|
+
function ke(m, d, l) {
|
|
1614
1601
|
const t = [];
|
|
1615
|
-
for (const i of
|
|
1602
|
+
for (const i of m)
|
|
1616
1603
|
if (i.type === be.enum.SKU)
|
|
1617
1604
|
t.push({ ...i, recipeIds: [...d] });
|
|
1618
1605
|
else if (i.type === be.enum.SKU_GROUP)
|
|
@@ -1625,16 +1612,16 @@ function ke(p, d, l) {
|
|
|
1625
1612
|
}
|
|
1626
1613
|
return t;
|
|
1627
1614
|
}
|
|
1628
|
-
function yo(
|
|
1629
|
-
return he.equal(
|
|
1615
|
+
function yo(m, d) {
|
|
1616
|
+
return he.equal(m, d);
|
|
1630
1617
|
}
|
|
1631
|
-
function Ae(
|
|
1632
|
-
if (
|
|
1633
|
-
const d =
|
|
1634
|
-
return Array.isArray(d) && d.length === 0 || Array.isArray(l) && l.length === 0 || Object.keys(
|
|
1618
|
+
function Ae(m) {
|
|
1619
|
+
if (m == null) return null;
|
|
1620
|
+
const d = m.$and, l = m.$or;
|
|
1621
|
+
return Array.isArray(d) && d.length === 0 || Array.isArray(l) && l.length === 0 || Object.keys(m).length === 0 ? null : JSON.stringify(m);
|
|
1635
1622
|
}
|
|
1636
|
-
function Te(
|
|
1637
|
-
const d = (
|
|
1623
|
+
function Te(m) {
|
|
1624
|
+
const d = (m ?? []).map((l) => ({
|
|
1638
1625
|
_id: l._id,
|
|
1639
1626
|
trackingMeasurement: l.trackingMeasurement ?? null,
|
|
1640
1627
|
priority: l.priority ?? null,
|
|
@@ -1642,28 +1629,28 @@ function Te(p) {
|
|
|
1642
1629
|
})).sort((l, t) => l._id.localeCompare(t._id));
|
|
1643
1630
|
return JSON.stringify(d);
|
|
1644
1631
|
}
|
|
1645
|
-
function Xe(
|
|
1646
|
-
return
|
|
1632
|
+
function Xe(m) {
|
|
1633
|
+
return m.measurement ? he.multiplyDecimal(m.amount, m.measurement.conversion) : m.amount;
|
|
1647
1634
|
}
|
|
1648
|
-
function Me(
|
|
1635
|
+
function Me(m, d) {
|
|
1649
1636
|
var i, r;
|
|
1650
|
-
if (
|
|
1651
|
-
const l = ((i =
|
|
1652
|
-
return !(l !== t || Ae(
|
|
1637
|
+
if (m.type !== d.type || m.id !== d.id || !yo(Xe(m), Xe(d))) return !1;
|
|
1638
|
+
const l = ((i = m.measurement) == null ? void 0 : i.id) ?? null, t = ((r = d.measurement) == null ? void 0 : r.id) ?? null;
|
|
1639
|
+
return !(l !== t || Ae(m.rules) !== Ae(d.rules) || Te(m.alternatives) !== Te(d.alternatives));
|
|
1653
1640
|
}
|
|
1654
|
-
function Ze(
|
|
1655
|
-
return
|
|
1641
|
+
function Ze(m, d) {
|
|
1642
|
+
return m.type === d.type && m.id === d.id;
|
|
1656
1643
|
}
|
|
1657
|
-
function bo(
|
|
1644
|
+
function bo(m, d) {
|
|
1658
1645
|
const l = [];
|
|
1659
|
-
let t = [...
|
|
1646
|
+
let t = [...m.contains];
|
|
1660
1647
|
for (const r of d)
|
|
1661
1648
|
switch (r.type) {
|
|
1662
1649
|
case "remove-binding": {
|
|
1663
|
-
const
|
|
1650
|
+
const x = t.findIndex(
|
|
1664
1651
|
(u) => u.type === r.target.type && u.id === r.target.id
|
|
1665
1652
|
);
|
|
1666
|
-
|
|
1653
|
+
x === -1 ? l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" }) : (t = [...t.slice(0, x), ...t.slice(x + 1)], l.push({ change: r, outcome: "applied" }));
|
|
1667
1654
|
break;
|
|
1668
1655
|
}
|
|
1669
1656
|
case "add-binding": {
|
|
@@ -1675,11 +1662,11 @@ function bo(p, d) {
|
|
|
1675
1662
|
l.push({ change: r, outcome: "blocked", reason: "A similar but non-exact binding already exists" });
|
|
1676
1663
|
break;
|
|
1677
1664
|
}
|
|
1678
|
-
if (
|
|
1665
|
+
if (m.version === "v2" && r.binding.type === "RECIPE") {
|
|
1679
1666
|
l.push({ change: r, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
|
|
1680
1667
|
break;
|
|
1681
1668
|
}
|
|
1682
|
-
if (
|
|
1669
|
+
if (m.version !== "v2" && (r.binding.alternatives ?? []).length > 0) {
|
|
1683
1670
|
l.push({ change: r, outcome: "blocked", reason: "Cannot add a binding with alternatives to a non-V2 recipe" });
|
|
1684
1671
|
break;
|
|
1685
1672
|
}
|
|
@@ -1687,18 +1674,18 @@ function bo(p, d) {
|
|
|
1687
1674
|
break;
|
|
1688
1675
|
}
|
|
1689
1676
|
case "replace-binding": {
|
|
1690
|
-
const
|
|
1677
|
+
const x = t.findIndex(
|
|
1691
1678
|
(s) => s.type === r.from.type && s.id === r.from.id
|
|
1692
|
-
), u = t.find((s) => Me(s, r.to)), o = t.find((s, a) => a !==
|
|
1693
|
-
if (
|
|
1679
|
+
), u = t.find((s) => Me(s, r.to)), o = t.find((s, a) => a !== x && Ze(s, r.to) && !Me(s, r.to));
|
|
1680
|
+
if (x === -1) {
|
|
1694
1681
|
u ? l.push({ change: r, outcome: "already-satisfied", reason: "Target already has exact replacement" }) : l.push({ change: r, outcome: "ignored", reason: "Source binding not found in target" });
|
|
1695
1682
|
break;
|
|
1696
1683
|
}
|
|
1697
|
-
if (
|
|
1684
|
+
if (m.version === "v2" && r.to.type === "RECIPE") {
|
|
1698
1685
|
l.push({ change: r, outcome: "blocked", reason: "Cannot add RECIPE binding to a V2 recipe" });
|
|
1699
1686
|
break;
|
|
1700
1687
|
}
|
|
1701
|
-
if (
|
|
1688
|
+
if (m.version !== "v2" && (r.to.alternatives ?? []).length > 0) {
|
|
1702
1689
|
l.push({ change: r, outcome: "blocked", reason: "Cannot apply a binding with alternatives to a non-V2 recipe" });
|
|
1703
1690
|
break;
|
|
1704
1691
|
}
|
|
@@ -1706,92 +1693,92 @@ function bo(p, d) {
|
|
|
1706
1693
|
l.push({ change: r, outcome: "blocked", reason: "A similar but non-exact replacement binding already exists" });
|
|
1707
1694
|
break;
|
|
1708
1695
|
}
|
|
1709
|
-
u ? (t = [...t.slice(0,
|
|
1710
|
-
...t.slice(0,
|
|
1696
|
+
u ? (t = [...t.slice(0, x), ...t.slice(x + 1)], l.push({ change: r, outcome: "applied", reason: "Source removed; replacement already present" })) : (t = [
|
|
1697
|
+
...t.slice(0, x),
|
|
1711
1698
|
r.to,
|
|
1712
|
-
...t.slice(
|
|
1699
|
+
...t.slice(x + 1)
|
|
1713
1700
|
], l.push({ change: r, outcome: "applied" }));
|
|
1714
1701
|
break;
|
|
1715
1702
|
}
|
|
1716
1703
|
case "update-binding-rule": {
|
|
1717
|
-
const
|
|
1704
|
+
const x = t.findIndex(
|
|
1718
1705
|
(a) => a.type === r.target.type && a.id === r.target.id
|
|
1719
1706
|
);
|
|
1720
|
-
if (
|
|
1707
|
+
if (x === -1) {
|
|
1721
1708
|
l.push({ change: r, outcome: "ignored", reason: "Binding not found in target" });
|
|
1722
1709
|
break;
|
|
1723
1710
|
}
|
|
1724
|
-
const u = t[
|
|
1711
|
+
const u = t[x], o = u.rules ?? null, s = r.rule ?? null;
|
|
1725
1712
|
if (Ae(o) === Ae(s)) {
|
|
1726
1713
|
l.push({ change: r, outcome: "already-satisfied", reason: "Rule already matches" });
|
|
1727
1714
|
break;
|
|
1728
1715
|
}
|
|
1729
1716
|
t = [
|
|
1730
|
-
...t.slice(0,
|
|
1717
|
+
...t.slice(0, x),
|
|
1731
1718
|
{ ...u, rules: s },
|
|
1732
|
-
...t.slice(
|
|
1719
|
+
...t.slice(x + 1)
|
|
1733
1720
|
], l.push({ change: r, outcome: "applied" });
|
|
1734
1721
|
break;
|
|
1735
1722
|
}
|
|
1736
1723
|
case "update-alternatives": {
|
|
1737
|
-
if (
|
|
1724
|
+
if (m.version !== "v2") {
|
|
1738
1725
|
l.push({ change: r, outcome: "blocked", reason: "Cannot update alternatives on a non-V2 recipe" });
|
|
1739
1726
|
break;
|
|
1740
1727
|
}
|
|
1741
|
-
const
|
|
1728
|
+
const x = t.findIndex(
|
|
1742
1729
|
(a) => a.type === r.target.type && a.id === r.target.id
|
|
1743
1730
|
);
|
|
1744
|
-
if (
|
|
1731
|
+
if (x === -1) {
|
|
1745
1732
|
l.push({ change: r, outcome: "ignored", reason: "Binding not found in target" });
|
|
1746
1733
|
break;
|
|
1747
1734
|
}
|
|
1748
|
-
const u = t[
|
|
1735
|
+
const u = t[x], o = Te(u.alternatives), s = Te(r.alternatives);
|
|
1749
1736
|
if (o === s) {
|
|
1750
1737
|
l.push({ change: r, outcome: "already-satisfied", reason: "Alternatives already match" });
|
|
1751
1738
|
break;
|
|
1752
1739
|
}
|
|
1753
1740
|
t = [
|
|
1754
|
-
...t.slice(0,
|
|
1741
|
+
...t.slice(0, x),
|
|
1755
1742
|
{ ...u, alternatives: r.alternatives },
|
|
1756
|
-
...t.slice(
|
|
1743
|
+
...t.slice(x + 1)
|
|
1757
1744
|
], l.push({ change: r, outcome: "applied" });
|
|
1758
1745
|
break;
|
|
1759
1746
|
}
|
|
1760
1747
|
}
|
|
1761
|
-
return { projected: { ...
|
|
1748
|
+
return { projected: { ...m, contains: t }, results: l };
|
|
1762
1749
|
}
|
|
1763
|
-
function et(
|
|
1764
|
-
switch (
|
|
1750
|
+
function et(m) {
|
|
1751
|
+
switch (m.type) {
|
|
1765
1752
|
case "add-binding":
|
|
1766
|
-
return
|
|
1753
|
+
return m.binding.id !== "";
|
|
1767
1754
|
case "remove-binding":
|
|
1768
|
-
return
|
|
1755
|
+
return m.target.id !== "";
|
|
1769
1756
|
case "replace-binding":
|
|
1770
|
-
return
|
|
1757
|
+
return m.from.id !== "" && m.to.id !== "";
|
|
1771
1758
|
case "update-binding-rule":
|
|
1772
|
-
return
|
|
1759
|
+
return m.target.id !== "";
|
|
1773
1760
|
case "update-alternatives":
|
|
1774
|
-
return
|
|
1761
|
+
return m.target.id !== "";
|
|
1775
1762
|
}
|
|
1776
1763
|
}
|
|
1777
|
-
function go(
|
|
1778
|
-
if (
|
|
1764
|
+
function go(m) {
|
|
1765
|
+
if (m.length === 0) return "no-applicable-changes";
|
|
1779
1766
|
let d = 0, l = 0, t = 0, i = 0;
|
|
1780
|
-
for (const r of
|
|
1767
|
+
for (const r of m)
|
|
1781
1768
|
r.outcome === "applied" ? d++ : r.outcome === "blocked" ? l++ : r.outcome === "ignored" ? t++ : r.outcome === "already-satisfied" && i++;
|
|
1782
|
-
return l > 0 && d === 0 ? "blocked" : i ===
|
|
1769
|
+
return l > 0 && d === 0 ? "blocked" : i === m.length ? "already-satisfied" : d > 0 && (t > 0 || l > 0) ? "partially-ignored" : d > 0 ? "will-update" : "no-applicable-changes";
|
|
1783
1770
|
}
|
|
1784
1771
|
let _o = 0;
|
|
1785
|
-
function ko(
|
|
1772
|
+
function ko(m = null) {
|
|
1786
1773
|
return {
|
|
1787
1774
|
id: String(++_o),
|
|
1788
|
-
type:
|
|
1775
|
+
type: m,
|
|
1789
1776
|
itemId: null,
|
|
1790
1777
|
amountModel: ye()
|
|
1791
1778
|
};
|
|
1792
1779
|
}
|
|
1793
|
-
function ut(
|
|
1794
|
-
for (const i of
|
|
1780
|
+
function ut(m, d, l, t) {
|
|
1781
|
+
for (const i of m)
|
|
1795
1782
|
if (i.type === "RECIPE") {
|
|
1796
1783
|
if (i.id === d) return !0;
|
|
1797
1784
|
if (!l.has(i.id)) {
|
|
@@ -1803,9 +1790,9 @@ function ut(p, d, l, t) {
|
|
|
1803
1790
|
return !1;
|
|
1804
1791
|
}
|
|
1805
1792
|
const ge = ot("recipeBulkEditor", function() {
|
|
1806
|
-
const d = ne(), l = je(), { t } = ie(), i = W(!1), r = W(1),
|
|
1793
|
+
const d = ne(), l = je(), { t } = ie(), i = W(!1), r = W(1), x = W(null), u = W(/* @__PURE__ */ new Set()), o = W([]), s = W({}), a = W(!1), p = W(/* @__PURE__ */ new Map()), $ = W(""), C = W([]), I = A(() => {
|
|
1807
1794
|
let O = d.recipes;
|
|
1808
|
-
const M =
|
|
1795
|
+
const M = x.value;
|
|
1809
1796
|
if (M != null && M.nameSearch) {
|
|
1810
1797
|
const L = M.nameSearch.trim().toLowerCase();
|
|
1811
1798
|
L && (O = O.filter((q) => q.name.toLowerCase().includes(L)));
|
|
@@ -1841,13 +1828,13 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1841
1828
|
}
|
|
1842
1829
|
}
|
|
1843
1830
|
return O;
|
|
1844
|
-
}),
|
|
1831
|
+
}), f = A(
|
|
1845
1832
|
() => I.value.filter((O) => !u.value.has(O._id))
|
|
1846
|
-
),
|
|
1833
|
+
), k = A(() => f.value.length > 0), S = A(() => {
|
|
1847
1834
|
const O = o.value.filter(et);
|
|
1848
1835
|
if (O.length === 0) {
|
|
1849
1836
|
const L = {};
|
|
1850
|
-
for (const q of
|
|
1837
|
+
for (const q of f.value)
|
|
1851
1838
|
L[q._id] = {
|
|
1852
1839
|
recipeId: q._id,
|
|
1853
1840
|
recipeName: q.name,
|
|
@@ -1860,7 +1847,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1860
1847
|
return L;
|
|
1861
1848
|
}
|
|
1862
1849
|
const M = {};
|
|
1863
|
-
for (const L of
|
|
1850
|
+
for (const L of f.value) {
|
|
1864
1851
|
const q = JSON.parse(JSON.stringify(L)), { projected: oe, results: Z } = bo(q, O), ae = go(Z);
|
|
1865
1852
|
let fe = 0, xe = 0, re = 0, ve = 0;
|
|
1866
1853
|
for (const ce of Z)
|
|
@@ -1876,20 +1863,20 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1876
1863
|
};
|
|
1877
1864
|
}
|
|
1878
1865
|
return M;
|
|
1879
|
-
}),
|
|
1866
|
+
}), b = A(() => o.value.some(et) ? Object.values(S.value).some(
|
|
1880
1867
|
(O) => O.status === "will-update" || O.status === "partially-ignored"
|
|
1881
1868
|
) : !1);
|
|
1882
1869
|
function e() {
|
|
1883
1870
|
c(), i.value = !0;
|
|
1884
1871
|
}
|
|
1885
|
-
function
|
|
1872
|
+
function V() {
|
|
1886
1873
|
i.value = !1;
|
|
1887
1874
|
}
|
|
1888
1875
|
function c() {
|
|
1889
|
-
r.value = 1,
|
|
1876
|
+
r.value = 1, x.value = null, u.value = /* @__PURE__ */ new Set(), o.value = [], s.value = {}, a.value = !1, p.value = /* @__PURE__ */ new Map(), $.value = "", C.value = [];
|
|
1890
1877
|
}
|
|
1891
|
-
function
|
|
1892
|
-
|
|
1878
|
+
function _(O) {
|
|
1879
|
+
x.value = O;
|
|
1893
1880
|
}
|
|
1894
1881
|
function N(O) {
|
|
1895
1882
|
const M = new Set(u.value);
|
|
@@ -1898,7 +1885,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1898
1885
|
function z() {
|
|
1899
1886
|
u.value = /* @__PURE__ */ new Set();
|
|
1900
1887
|
}
|
|
1901
|
-
function
|
|
1888
|
+
function g(O) {
|
|
1902
1889
|
o.value = [...o.value, O];
|
|
1903
1890
|
}
|
|
1904
1891
|
function B(O, M) {
|
|
@@ -1908,12 +1895,12 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1908
1895
|
function F(O) {
|
|
1909
1896
|
o.value = o.value.filter((M, L) => L !== O);
|
|
1910
1897
|
}
|
|
1911
|
-
function
|
|
1898
|
+
function R(O, M) {
|
|
1912
1899
|
const L = [...o.value], [q] = L.splice(O, 1);
|
|
1913
1900
|
L.splice(M, 0, q), o.value = L;
|
|
1914
1901
|
}
|
|
1915
1902
|
function P() {
|
|
1916
|
-
s.value = { ...
|
|
1903
|
+
s.value = { ...S.value }, r.value = 3;
|
|
1917
1904
|
}
|
|
1918
1905
|
function K() {
|
|
1919
1906
|
s.value = {}, r.value = 2;
|
|
@@ -1925,7 +1912,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1925
1912
|
}
|
|
1926
1913
|
async function ee() {
|
|
1927
1914
|
if (!a.value) {
|
|
1928
|
-
a.value = !0,
|
|
1915
|
+
a.value = !0, p.value = /* @__PURE__ */ new Map();
|
|
1929
1916
|
try {
|
|
1930
1917
|
const O = H(), M = await d.importRecipes({
|
|
1931
1918
|
create: [],
|
|
@@ -1937,7 +1924,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1937
1924
|
const ae = typeof Z == "string" ? Z : (Z == null ? void 0 : Z.message) ?? t("inventory.recipe.bulkEditor.step3.unknownError");
|
|
1938
1925
|
q.set(oe._id, ae);
|
|
1939
1926
|
}
|
|
1940
|
-
|
|
1927
|
+
p.value = q, l.open({
|
|
1941
1928
|
title: t("inventory.recipe.bulkEditor.step3.partialErrorTitle"),
|
|
1942
1929
|
message: t("inventory.recipe.bulkEditor.step3.partialErrorMessage", {
|
|
1943
1930
|
count: L.length
|
|
@@ -1967,31 +1954,31 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
1967
1954
|
// state
|
|
1968
1955
|
show: i,
|
|
1969
1956
|
currentStep: r,
|
|
1970
|
-
query:
|
|
1957
|
+
query: x,
|
|
1971
1958
|
excludedRecipeIds: u,
|
|
1972
1959
|
modifications: o,
|
|
1973
1960
|
entries: s,
|
|
1974
1961
|
isSaving: a,
|
|
1975
|
-
applyErrors:
|
|
1976
|
-
nameSearch:
|
|
1962
|
+
applyErrors: p,
|
|
1963
|
+
nameSearch: $,
|
|
1977
1964
|
filterRows: C,
|
|
1978
1965
|
// computed
|
|
1979
1966
|
matchedRecipes: I,
|
|
1980
|
-
selectedRecipes:
|
|
1981
|
-
livePreviewEntries:
|
|
1982
|
-
canGoToStep2:
|
|
1983
|
-
canGoToStep3:
|
|
1967
|
+
selectedRecipes: f,
|
|
1968
|
+
livePreviewEntries: S,
|
|
1969
|
+
canGoToStep2: k,
|
|
1970
|
+
canGoToStep3: b,
|
|
1984
1971
|
// actions
|
|
1985
1972
|
openDialog: e,
|
|
1986
|
-
closeDialog:
|
|
1973
|
+
closeDialog: V,
|
|
1987
1974
|
reset: c,
|
|
1988
|
-
updateQuery:
|
|
1975
|
+
updateQuery: _,
|
|
1989
1976
|
removeRecipe: N,
|
|
1990
1977
|
restoreAllRecipes: z,
|
|
1991
|
-
addModification:
|
|
1978
|
+
addModification: g,
|
|
1992
1979
|
updateModification: B,
|
|
1993
1980
|
removeModification: F,
|
|
1994
|
-
reorderModification:
|
|
1981
|
+
reorderModification: R,
|
|
1995
1982
|
goToStep3: P,
|
|
1996
1983
|
backToStep2: K,
|
|
1997
1984
|
buildPayload: H,
|
|
@@ -2017,192 +2004,192 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2017
2004
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-1 whitespace-normal break-words"
|
|
2018
2005
|
}, zo = { class: "flex items-center gap-4 mt-2" }, Oo = /* @__PURE__ */ le({
|
|
2019
2006
|
__name: "RecipeBulkEditorStep1",
|
|
2020
|
-
setup(
|
|
2021
|
-
const { t: d } = ie(), l = ne(), t = ge(), i =
|
|
2007
|
+
setup(m) {
|
|
2008
|
+
const { t: d } = ie(), l = ne(), t = ge(), i = A({
|
|
2022
2009
|
get: () => t.nameSearch,
|
|
2023
|
-
set: (
|
|
2024
|
-
t.nameSearch =
|
|
2010
|
+
set: (b) => {
|
|
2011
|
+
t.nameSearch = b;
|
|
2025
2012
|
}
|
|
2026
|
-
}), r =
|
|
2027
|
-
function u(
|
|
2028
|
-
return
|
|
2029
|
-
}
|
|
2030
|
-
function o(
|
|
2031
|
-
|
|
2032
|
-
}
|
|
2033
|
-
const s =
|
|
2034
|
-
() => l.skus.map((
|
|
2035
|
-
label:
|
|
2036
|
-
sublabel:
|
|
2037
|
-
value:
|
|
2013
|
+
}), r = A(() => t.filterRows), x = W({});
|
|
2014
|
+
function u(b) {
|
|
2015
|
+
return x.value[b] ?? !1;
|
|
2016
|
+
}
|
|
2017
|
+
function o(b, e) {
|
|
2018
|
+
x.value = { ...x.value, [b]: e };
|
|
2019
|
+
}
|
|
2020
|
+
const s = A(
|
|
2021
|
+
() => l.skus.map((b) => ({
|
|
2022
|
+
label: b.name,
|
|
2023
|
+
sublabel: b.code,
|
|
2024
|
+
value: b._id
|
|
2038
2025
|
}))
|
|
2039
|
-
), a =
|
|
2040
|
-
() => l.recipes.map((
|
|
2041
|
-
label:
|
|
2042
|
-
value:
|
|
2026
|
+
), a = A(
|
|
2027
|
+
() => l.recipes.map((b) => ({
|
|
2028
|
+
label: b.name,
|
|
2029
|
+
value: b._id
|
|
2043
2030
|
}))
|
|
2044
2031
|
);
|
|
2045
|
-
function
|
|
2046
|
-
return
|
|
2032
|
+
function p(b) {
|
|
2033
|
+
return b.type !== "ingredient" || !b.itemId ? null : l.skuById[b.itemId] ?? null;
|
|
2047
2034
|
}
|
|
2048
|
-
function
|
|
2035
|
+
function $(b) {
|
|
2049
2036
|
var e;
|
|
2050
|
-
if (!
|
|
2051
|
-
if (
|
|
2052
|
-
if (!
|
|
2053
|
-
const
|
|
2054
|
-
if (!
|
|
2055
|
-
const { amount: c, measurement:
|
|
2056
|
-
if (!(c != null && c.amount > 0)) return
|
|
2057
|
-
const z = (
|
|
2058
|
-
return `${
|
|
2037
|
+
if (!b.type) return d("inventory.recipe.bulkEditor.step1.filter");
|
|
2038
|
+
if (b.type === "ingredient") {
|
|
2039
|
+
if (!b.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
|
|
2040
|
+
const V = l.skuById[b.itemId];
|
|
2041
|
+
if (!V) return d("inventory.recipe.bulkEditor.step1.filterTypeIngredient");
|
|
2042
|
+
const { amount: c, measurement: _ } = b.amountModel;
|
|
2043
|
+
if (!(c != null && c.amount > 0)) return V.name;
|
|
2044
|
+
const z = (_ == null ? void 0 : _.abbrev) ?? ((e = V.unit) == null ? void 0 : e.abbrev) ?? "", g = Q(c);
|
|
2045
|
+
return `${V.name} (${g}${z})`;
|
|
2059
2046
|
}
|
|
2060
|
-
if (
|
|
2061
|
-
if (!
|
|
2062
|
-
const
|
|
2063
|
-
return
|
|
2047
|
+
if (b.type === "recipe") {
|
|
2048
|
+
if (!b.itemId) return d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
|
|
2049
|
+
const V = l.recipeById[b.itemId];
|
|
2050
|
+
return V ? V.name : d("inventory.recipe.bulkEditor.step1.filterTypeRecipe");
|
|
2064
2051
|
}
|
|
2065
2052
|
return "";
|
|
2066
2053
|
}
|
|
2067
|
-
function C(
|
|
2068
|
-
const e = ko(
|
|
2054
|
+
function C(b) {
|
|
2055
|
+
const e = ko(b);
|
|
2069
2056
|
t.filterRows.push(e), o(e.id, !0);
|
|
2070
2057
|
}
|
|
2071
|
-
function I(
|
|
2072
|
-
t.filterRows = t.filterRows.filter((
|
|
2073
|
-
const e = {
|
|
2074
|
-
delete e[
|
|
2058
|
+
function I(b) {
|
|
2059
|
+
t.filterRows = t.filterRows.filter((V) => V.id !== b);
|
|
2060
|
+
const e = { ...x.value };
|
|
2061
|
+
delete e[b], x.value = e;
|
|
2075
2062
|
}
|
|
2076
|
-
function
|
|
2077
|
-
|
|
2063
|
+
function f(b) {
|
|
2064
|
+
b.amountModel = ye(), o(b.id, !0);
|
|
2078
2065
|
}
|
|
2079
2066
|
ue(
|
|
2080
2067
|
[i, r],
|
|
2081
2068
|
() => {
|
|
2082
|
-
const
|
|
2069
|
+
const b = [];
|
|
2083
2070
|
for (const c of r.value)
|
|
2084
2071
|
if (!(!c.type || !c.itemId))
|
|
2085
2072
|
if (c.type === "ingredient") {
|
|
2086
|
-
const
|
|
2073
|
+
const _ = p(c), { amount: N, measurement: z } = c.amountModel, g = N != null && N.amount > 0;
|
|
2087
2074
|
let B, F;
|
|
2088
|
-
|
|
2075
|
+
_ && g && (B = z ? he.multiplyDecimal(N, z.conversion) : N, F = (z == null ? void 0 : z.id) ?? null), b.push({
|
|
2089
2076
|
id: c.id,
|
|
2090
2077
|
type: "ingredient",
|
|
2091
2078
|
itemId: c.itemId,
|
|
2092
2079
|
amount: B ?? null,
|
|
2093
2080
|
measurementId: F
|
|
2094
2081
|
});
|
|
2095
|
-
} else c.type === "recipe" &&
|
|
2082
|
+
} else c.type === "recipe" && b.push({
|
|
2096
2083
|
id: c.id,
|
|
2097
2084
|
type: "recipe",
|
|
2098
2085
|
itemId: c.itemId
|
|
2099
2086
|
});
|
|
2100
2087
|
t.updateQuery({
|
|
2101
2088
|
nameSearch: i.value,
|
|
2102
|
-
filters:
|
|
2089
|
+
filters: b
|
|
2103
2090
|
});
|
|
2104
|
-
const e = i.value.trim().length > 0,
|
|
2105
|
-
!e && !
|
|
2091
|
+
const e = i.value.trim().length > 0, V = b.length > 0;
|
|
2092
|
+
!e && !V && t.restoreAllRecipes();
|
|
2106
2093
|
},
|
|
2107
2094
|
{ deep: !0, immediate: !0 }
|
|
2108
2095
|
);
|
|
2109
|
-
function
|
|
2110
|
-
var
|
|
2111
|
-
if (
|
|
2112
|
-
const B = l.skuGroupById[
|
|
2096
|
+
function k(b) {
|
|
2097
|
+
var _, N, z, g;
|
|
2098
|
+
if (b.isGroup) {
|
|
2099
|
+
const B = l.skuGroupById[b.id];
|
|
2113
2100
|
if (!B) return null;
|
|
2114
|
-
const F = `x${Q(
|
|
2115
|
-
return
|
|
2101
|
+
const F = `x${Q(b.amount)}`;
|
|
2102
|
+
return b.recipeIds.slice(1).length ? `(${((_ = l.recipeById[b.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? ""}) ${B.name} (${F})` : `${B.name} (${F})`;
|
|
2116
2103
|
}
|
|
2117
|
-
const e = l.skuById[
|
|
2104
|
+
const e = l.skuById[b.id];
|
|
2118
2105
|
if (!e) return null;
|
|
2119
|
-
const
|
|
2120
|
-
return
|
|
2106
|
+
const V = ((N = b.measurement) == null ? void 0 : N.abbrev) ?? ((z = e.unit) == null ? void 0 : z.abbrev) ?? "", c = `${Q(b.amount)}${V}`;
|
|
2107
|
+
return b.recipeIds.slice(1).length ? `(${((g = l.recipeById[b.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? ""}) ${e.name} (${c})` : `${e.name} (${c})`;
|
|
2121
2108
|
}
|
|
2122
|
-
function
|
|
2123
|
-
return ke(
|
|
2109
|
+
function S(b) {
|
|
2110
|
+
return ke(b.contains, /* @__PURE__ */ new Set([b._id]), l.recipeById).map(k).filter((e) => e !== null).join(", ");
|
|
2124
2111
|
}
|
|
2125
|
-
return (
|
|
2126
|
-
const
|
|
2127
|
-
return
|
|
2128
|
-
|
|
2129
|
-
|
|
2112
|
+
return (b, e) => {
|
|
2113
|
+
const V = G("FmButton"), c = G("FmSearch"), _ = G("FmSelect"), N = G("FmPopover"), z = G("FmIcon"), g = G("FmMenuItem"), B = G("FmMenu"), F = G("FmChip");
|
|
2114
|
+
return y(), E("div", ho, [
|
|
2115
|
+
v("div", xo, [
|
|
2116
|
+
v("span", $o, U(n(d)("inventory.recipe.bulkEditor.step1.selectedCount", {
|
|
2130
2117
|
count: n(t).selectedRecipes.length
|
|
2131
2118
|
})), 1),
|
|
2132
|
-
n(t).excludedRecipeIds.size > 0 ? (
|
|
2119
|
+
n(t).excludedRecipeIds.size > 0 ? (y(), Y(V, {
|
|
2133
2120
|
key: 0,
|
|
2134
2121
|
label: n(d)("inventory.recipe.bulkEditor.step1.restoreAll"),
|
|
2135
2122
|
variant: "tertiary",
|
|
2136
2123
|
size: "md",
|
|
2137
|
-
onClick: e[0] || (e[0] = (
|
|
2124
|
+
onClick: e[0] || (e[0] = (R) => n(t).restoreAllRecipes())
|
|
2138
2125
|
}, null, 8, ["label"])) : T("", !0)
|
|
2139
2126
|
]),
|
|
2140
|
-
|
|
2141
|
-
|
|
2127
|
+
v("div", Io, [
|
|
2128
|
+
h(c, {
|
|
2142
2129
|
modelValue: i.value,
|
|
2143
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
2130
|
+
"onUpdate:modelValue": e[1] || (e[1] = (R) => i.value = R),
|
|
2144
2131
|
placeholder: n(d)("inventory.recipe.bulkEditor.query.nameSearchPlaceholder")
|
|
2145
2132
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
2146
|
-
r.value.length > 0 ? (
|
|
2147
|
-
(
|
|
2148
|
-
key:
|
|
2133
|
+
r.value.length > 0 ? (y(), E("div", wo, [
|
|
2134
|
+
(y(!0), E(X, null, me(r.value, (R) => (y(), E("div", {
|
|
2135
|
+
key: R.id,
|
|
2149
2136
|
class: "flex items-center"
|
|
2150
2137
|
}, [
|
|
2151
|
-
|
|
2152
|
-
"show-popover": u(
|
|
2138
|
+
h(N, {
|
|
2139
|
+
"show-popover": u(R.id),
|
|
2153
2140
|
"exclude-el-from-click-outside": ["fm-menu"],
|
|
2154
2141
|
placement: "bottom-start",
|
|
2155
|
-
onPopoverChanged: (P) => o(
|
|
2142
|
+
onPopoverChanged: (P) => o(R.id, P)
|
|
2156
2143
|
}, {
|
|
2157
2144
|
"popover-button": J(() => [
|
|
2158
|
-
|
|
2159
|
-
|
|
2145
|
+
v("button", Eo, [
|
|
2146
|
+
v("span", Vo, U($(R)), 1)
|
|
2160
2147
|
])
|
|
2161
2148
|
]),
|
|
2162
2149
|
default: J(() => [
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
modelValue:
|
|
2168
|
-
"onUpdate:modelValue": [(P) =>
|
|
2150
|
+
v("div", So, [
|
|
2151
|
+
v("p", Co, U(R.type === "ingredient" ? n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient") : n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe")), 1),
|
|
2152
|
+
R.type === "ingredient" ? (y(), E(X, { key: 0 }, [
|
|
2153
|
+
h(_, {
|
|
2154
|
+
modelValue: R.itemId,
|
|
2155
|
+
"onUpdate:modelValue": [(P) => R.itemId = P, (P) => f(R)],
|
|
2169
2156
|
items: s.value,
|
|
2170
2157
|
placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectIngredient"),
|
|
2171
2158
|
clearable: ""
|
|
2172
2159
|
}, {
|
|
2173
2160
|
"menu-wrapper": J((P) => [
|
|
2174
|
-
|
|
2161
|
+
h(Fe, we({ ref_for: !0 }, P, {
|
|
2175
2162
|
items: s.value,
|
|
2176
|
-
"model-value":
|
|
2163
|
+
"model-value": R.itemId
|
|
2177
2164
|
}), null, 16, ["items", "model-value"])
|
|
2178
2165
|
]),
|
|
2179
2166
|
_: 2
|
|
2180
2167
|
}, 1032, ["modelValue", "onUpdate:modelValue", "items", "placeholder"]),
|
|
2181
|
-
|
|
2182
|
-
|
|
2168
|
+
p(R) ? (y(), E("div", Bo, [
|
|
2169
|
+
v("span", Fo, [
|
|
2183
2170
|
mt(U(n(d)("inventory.recipe.bulkEditor.step1.amountLabel")) + " ", 1),
|
|
2184
|
-
|
|
2171
|
+
v("span", Ro, U(n(d)("inventory.recipe.bulkEditor.step1.amountOptional")), 1)
|
|
2185
2172
|
]),
|
|
2186
|
-
|
|
2187
|
-
modelValue:
|
|
2188
|
-
"onUpdate:modelValue": (P) =>
|
|
2189
|
-
unit:
|
|
2173
|
+
h(Be, {
|
|
2174
|
+
modelValue: R.amountModel,
|
|
2175
|
+
"onUpdate:modelValue": (P) => R.amountModel = P,
|
|
2176
|
+
unit: p(R).unit,
|
|
2190
2177
|
placeholder: n(d)("inventory.recipe.bulkEditor.step1.amountPlaceholder"),
|
|
2191
2178
|
"convert-amount-on-change-unit": ""
|
|
2192
2179
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "unit", "placeholder"])
|
|
2193
2180
|
])) : T("", !0)
|
|
2194
|
-
], 64)) :
|
|
2181
|
+
], 64)) : R.type === "recipe" ? (y(), Y(_, {
|
|
2195
2182
|
key: 1,
|
|
2196
|
-
modelValue:
|
|
2197
|
-
"onUpdate:modelValue": [(P) =>
|
|
2183
|
+
modelValue: R.itemId,
|
|
2184
|
+
"onUpdate:modelValue": [(P) => R.itemId = P, (P) => f(R)],
|
|
2198
2185
|
items: a.value,
|
|
2199
2186
|
placeholder: n(d)("inventory.recipe.bulkEditor.step1.selectRecipe"),
|
|
2200
2187
|
clearable: ""
|
|
2201
2188
|
}, {
|
|
2202
2189
|
"menu-wrapper": J((P) => [
|
|
2203
|
-
|
|
2190
|
+
h(Fe, we({ ref_for: !0 }, P, {
|
|
2204
2191
|
items: a.value,
|
|
2205
|
-
"model-value":
|
|
2192
|
+
"model-value": R.itemId
|
|
2206
2193
|
}), null, 16, ["items", "model-value"])
|
|
2207
2194
|
]),
|
|
2208
2195
|
_: 2
|
|
@@ -2211,25 +2198,25 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2211
2198
|
]),
|
|
2212
2199
|
_: 2
|
|
2213
2200
|
}, 1032, ["show-popover", "onPopoverChanged"]),
|
|
2214
|
-
|
|
2201
|
+
v("button", {
|
|
2215
2202
|
type: "button",
|
|
2216
2203
|
class: "inline-flex items-center justify-center h-[30px] w-[26px] rounded-r-md border border-l-0 border-fm-color-border-default bg-fm-color-surface-secondary hover:bg-fm-color-surface-hover text-fm-color-typo-secondary hover:text-fm-color-typo-primary cursor-pointer transition-colors",
|
|
2217
2204
|
title: n(d)("inventory.recipe.bulkEditor.step1.removeFilter"),
|
|
2218
|
-
onClick: (P) => I(
|
|
2205
|
+
onClick: (P) => I(R.id)
|
|
2219
2206
|
}, [
|
|
2220
|
-
|
|
2207
|
+
h(z, {
|
|
2221
2208
|
name: "close",
|
|
2222
2209
|
size: "sm"
|
|
2223
2210
|
})
|
|
2224
2211
|
], 8, Ao)
|
|
2225
2212
|
]))), 128))
|
|
2226
2213
|
])) : T("", !0),
|
|
2227
|
-
|
|
2214
|
+
h(B, {
|
|
2228
2215
|
"close-on-click": !0,
|
|
2229
2216
|
placement: "bottom-start"
|
|
2230
2217
|
}, {
|
|
2231
2218
|
"menu-button": J(() => [
|
|
2232
|
-
|
|
2219
|
+
h(V, {
|
|
2233
2220
|
label: n(d)("inventory.recipe.bulkEditor.step1.filter"),
|
|
2234
2221
|
variant: "secondary",
|
|
2235
2222
|
size: "md",
|
|
@@ -2238,38 +2225,38 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2238
2225
|
}, null, 8, ["label"])
|
|
2239
2226
|
]),
|
|
2240
2227
|
default: J(() => [
|
|
2241
|
-
|
|
2228
|
+
h(g, {
|
|
2242
2229
|
label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeIngredient"),
|
|
2243
2230
|
icon: "inventory_2",
|
|
2244
|
-
onClick: e[2] || (e[2] = (
|
|
2231
|
+
onClick: e[2] || (e[2] = (R) => C("ingredient"))
|
|
2245
2232
|
}, null, 8, ["label"]),
|
|
2246
|
-
|
|
2233
|
+
h(g, {
|
|
2247
2234
|
label: n(d)("inventory.recipe.bulkEditor.step1.filterTypeRecipe"),
|
|
2248
2235
|
icon: "restaurant_menu",
|
|
2249
|
-
onClick: e[3] || (e[3] = (
|
|
2236
|
+
onClick: e[3] || (e[3] = (R) => C("recipe"))
|
|
2250
2237
|
}, null, 8, ["label"])
|
|
2251
2238
|
]),
|
|
2252
2239
|
_: 1
|
|
2253
2240
|
})
|
|
2254
2241
|
]),
|
|
2255
|
-
|
|
2256
|
-
n(t).selectedRecipes.length === 0 ? (
|
|
2257
|
-
|
|
2242
|
+
v("div", To, [
|
|
2243
|
+
n(t).selectedRecipes.length === 0 ? (y(), E("div", Uo, [
|
|
2244
|
+
h(z, {
|
|
2258
2245
|
name: "search_off",
|
|
2259
2246
|
size: "lg",
|
|
2260
2247
|
class: "text-fm-color-typo-placeholder"
|
|
2261
2248
|
}),
|
|
2262
|
-
|
|
2263
|
-
])) : (
|
|
2264
|
-
(
|
|
2265
|
-
key:
|
|
2249
|
+
v("p", Po, U(n(d)("inventory.recipe.bulkEditor.query.noResults")), 1)
|
|
2250
|
+
])) : (y(), E("div", Mo, [
|
|
2251
|
+
(y(!0), E(X, null, me(n(t).selectedRecipes, (R) => (y(), E("div", {
|
|
2252
|
+
key: R._id,
|
|
2266
2253
|
class: "flex items-center gap-12 px-16 py-12 hover:bg-fm-color-surface-hover transition-colors"
|
|
2267
2254
|
}, [
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2255
|
+
v("div", Do, [
|
|
2256
|
+
v("div", Go, U(R.name), 1),
|
|
2257
|
+
R.contains.length > 0 ? (y(), E("div", No, U(S(R)), 1)) : T("", !0),
|
|
2258
|
+
v("div", zo, [
|
|
2259
|
+
R.version === "v2" ? (y(), Y(F, {
|
|
2273
2260
|
key: 0,
|
|
2274
2261
|
size: "sm",
|
|
2275
2262
|
label: "V2",
|
|
@@ -2277,11 +2264,11 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2277
2264
|
})) : T("", !0)
|
|
2278
2265
|
])
|
|
2279
2266
|
]),
|
|
2280
|
-
|
|
2267
|
+
h(V, {
|
|
2281
2268
|
variant: "tertiary",
|
|
2282
2269
|
icon: "do_not_disturb_on",
|
|
2283
2270
|
title: n(d)("inventory.recipe.bulkEditor.step1.removeRecipeTooltip"),
|
|
2284
|
-
onClick: (P) => n(t).removeRecipe(
|
|
2271
|
+
onClick: (P) => n(t).removeRecipe(R._id)
|
|
2285
2272
|
}, null, 8, ["title", "onClick"])
|
|
2286
2273
|
]))), 128))
|
|
2287
2274
|
]))
|
|
@@ -2305,21 +2292,21 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2305
2292
|
livePreviewEntries: {}
|
|
2306
2293
|
},
|
|
2307
2294
|
emits: ["update:modelValue"],
|
|
2308
|
-
setup(
|
|
2309
|
-
const l =
|
|
2310
|
-
function u(
|
|
2311
|
-
const D =
|
|
2295
|
+
setup(m, { emit: d }) {
|
|
2296
|
+
const l = m, t = d, { t: i } = ie(), r = ne(), x = We();
|
|
2297
|
+
function u(w) {
|
|
2298
|
+
const D = w.type === "replace-binding" ? w.from.type : w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives" ? w.target.type : w.type === "add-binding" ? w.binding.type : null;
|
|
2312
2299
|
return D ? D === "RECIPE" ? "recipe" : "ingredient" : null;
|
|
2313
2300
|
}
|
|
2314
|
-
function o(
|
|
2315
|
-
return
|
|
2301
|
+
function o(w) {
|
|
2302
|
+
return w.type === "update-alternatives" ? !0 : w.type === "add-binding" ? (w.binding.alternatives ?? []).length > 0 : w.type === "replace-binding" ? (w.to.alternatives ?? []).length > 0 : !1;
|
|
2316
2303
|
}
|
|
2317
|
-
function s(
|
|
2318
|
-
switch (
|
|
2304
|
+
function s(w) {
|
|
2305
|
+
switch (w.type) {
|
|
2319
2306
|
case "add-binding":
|
|
2320
2307
|
return "link";
|
|
2321
2308
|
case "replace-binding":
|
|
2322
|
-
return
|
|
2309
|
+
return w.from.id === w.to.id ? "update" : null;
|
|
2323
2310
|
case "remove-binding":
|
|
2324
2311
|
return "remove";
|
|
2325
2312
|
case "update-binding-rule":
|
|
@@ -2328,79 +2315,79 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2328
2315
|
return "alts";
|
|
2329
2316
|
}
|
|
2330
2317
|
}
|
|
2331
|
-
function a(
|
|
2332
|
-
return
|
|
2318
|
+
function a(w) {
|
|
2319
|
+
return w.type === "replace-binding" ? w.from.id || null : (w.type === "remove-binding" || w.type === "update-binding-rule" || w.type === "update-alternatives") && w.target.id || null;
|
|
2333
2320
|
}
|
|
2334
|
-
function
|
|
2335
|
-
return
|
|
2321
|
+
function p(w) {
|
|
2322
|
+
return w.type === "add-binding" && w.binding.id || null;
|
|
2336
2323
|
}
|
|
2337
|
-
function
|
|
2338
|
-
const D =
|
|
2324
|
+
function $(w) {
|
|
2325
|
+
const D = w.type === "replace-binding" ? w.to : w.type === "add-binding" ? w.binding : null;
|
|
2339
2326
|
return D ? { amount: D.amount, measurement: D.measurement ?? null } : ye();
|
|
2340
2327
|
}
|
|
2341
|
-
function C(
|
|
2342
|
-
return
|
|
2328
|
+
function C(w) {
|
|
2329
|
+
return w.type === "replace-binding" ? w.to.rules ?? null : w.type === "add-binding" ? w.binding.rules ?? null : null;
|
|
2343
2330
|
}
|
|
2344
|
-
function I(
|
|
2345
|
-
return
|
|
2331
|
+
function I(w) {
|
|
2332
|
+
return w.type === "update-alternatives" ? w.alternatives ?? [] : w.type === "add-binding" ? w.binding.alternatives ?? [] : [];
|
|
2346
2333
|
}
|
|
2347
|
-
const
|
|
2334
|
+
const f = W(u(l.modelValue)), k = W(s(l.modelValue)), S = W(o(l.modelValue)), b = W(a(l.modelValue)), e = W(p(l.modelValue)), V = W($(l.modelValue)), c = W(C(l.modelValue)), _ = W(I(l.modelValue)), N = W(
|
|
2348
2335
|
(() => {
|
|
2349
|
-
const
|
|
2350
|
-
return
|
|
2336
|
+
const w = $(l.modelValue);
|
|
2337
|
+
return w.amount ? Q(w.amount) : "";
|
|
2351
2338
|
})()
|
|
2352
2339
|
);
|
|
2353
2340
|
let z = null;
|
|
2354
|
-
function
|
|
2355
|
-
N.value =
|
|
2356
|
-
const D = +
|
|
2357
|
-
|
|
2358
|
-
amount:
|
|
2341
|
+
function g(w) {
|
|
2342
|
+
N.value = w, z && clearTimeout(z), z = setTimeout(() => {
|
|
2343
|
+
const D = +w;
|
|
2344
|
+
V.value = {
|
|
2345
|
+
amount: w.length > 0 && isFinite(D) ? Ke(D) : { amount: 0, precision: 0 },
|
|
2359
2346
|
measurement: null
|
|
2360
2347
|
};
|
|
2361
2348
|
}, 300);
|
|
2362
2349
|
}
|
|
2363
|
-
ue(
|
|
2364
|
-
|
|
2365
|
-
}), ue(
|
|
2366
|
-
|
|
2367
|
-
}), ue(
|
|
2368
|
-
|
|
2350
|
+
ue(f, () => {
|
|
2351
|
+
k.value = null, S.value = !1, b.value = null, e.value = null, V.value = ye(), c.value = null, _.value = [], N.value = "";
|
|
2352
|
+
}), ue(k, () => {
|
|
2353
|
+
b.value = null, e.value = null, V.value = ye(), c.value = null, _.value = [], N.value = "";
|
|
2354
|
+
}), ue(S, (w) => {
|
|
2355
|
+
w || (_.value = [], k.value === "alts" && (k.value = null));
|
|
2369
2356
|
});
|
|
2370
|
-
const B =
|
|
2357
|
+
const B = A(() => [
|
|
2371
2358
|
{ label: i("inventory.recipe.bulkEditor.step2.fieldIngredient"), value: "ingredient" },
|
|
2372
2359
|
{ label: i("inventory.recipe.bulkEditor.step2.fieldRecipe"), value: "recipe" }
|
|
2373
|
-
]), F =
|
|
2374
|
-
const
|
|
2360
|
+
]), F = A(() => {
|
|
2361
|
+
const w = [
|
|
2375
2362
|
{ label: i("inventory.recipe.bulkEditor.step2.actionLink"), value: "link" },
|
|
2376
2363
|
{ label: i("inventory.recipe.bulkEditor.step2.actionUpdate"), value: "update" },
|
|
2377
2364
|
{ label: i("inventory.recipe.bulkEditor.step2.actionRemove"), value: "remove" }
|
|
2378
2365
|
];
|
|
2379
|
-
return
|
|
2380
|
-
}),
|
|
2381
|
-
() =>
|
|
2382
|
-
), K =
|
|
2383
|
-
() =>
|
|
2384
|
-
), H =
|
|
2385
|
-
() =>
|
|
2386
|
-
), ee =
|
|
2387
|
-
() =>
|
|
2388
|
-
), O =
|
|
2389
|
-
() => r.skus.map((
|
|
2390
|
-
), M =
|
|
2391
|
-
() => r.recipes.map((
|
|
2392
|
-
), L =
|
|
2393
|
-
const
|
|
2394
|
-
return
|
|
2395
|
-
}), fe =
|
|
2396
|
-
(
|
|
2397
|
-
).length : 0), xe =
|
|
2366
|
+
return f.value === "ingredient" && S.value && x.enableRecipeV2 && w.push({ label: i("inventory.recipe.bulkEditor.step2.actionAlts"), value: "alts" }), w;
|
|
2367
|
+
}), R = A(() => f.value !== null && k.value !== null), P = A(
|
|
2368
|
+
() => k.value === "update" || k.value === "remove" || k.value === "alts"
|
|
2369
|
+
), K = A(
|
|
2370
|
+
() => k.value === "link"
|
|
2371
|
+
), H = A(
|
|
2372
|
+
() => k.value === "update" && b.value !== null
|
|
2373
|
+
), ee = A(
|
|
2374
|
+
() => f.value === "ingredient" && S.value && x.enableRecipeV2
|
|
2375
|
+
), O = A(
|
|
2376
|
+
() => r.skus.map((w) => ({ label: w.name, sublabel: w.code, value: w._id }))
|
|
2377
|
+
), M = A(
|
|
2378
|
+
() => r.recipes.map((w) => ({ label: w.name, value: w._id }))
|
|
2379
|
+
), L = A(() => f.value === "recipe" ? M.value : O.value), q = A(() => f.value === "recipe" ? M.value : O.value), oe = A(() => f.value !== "ingredient" || !e.value ? null : r.skuById[e.value] ?? null), Z = A(() => f.value !== "ingredient" || !b.value ? null : r.skuById[b.value] ?? null), ae = A(() => {
|
|
2380
|
+
const w = b.value ?? e.value;
|
|
2381
|
+
return w ? [w] : [];
|
|
2382
|
+
}), fe = A(() => ee.value ? Object.values(l.livePreviewEntries).filter(
|
|
2383
|
+
(w) => w.original.version !== "v2"
|
|
2384
|
+
).length : 0), xe = A(() => Object.values(l.livePreviewEntries).length);
|
|
2398
2385
|
ue(
|
|
2399
|
-
() => [
|
|
2400
|
-
([
|
|
2401
|
-
if (
|
|
2386
|
+
() => [k.value, b.value],
|
|
2387
|
+
([w, D], [te, pe]) => {
|
|
2388
|
+
if (w !== "alts" || D === pe) return;
|
|
2402
2389
|
if (!D) {
|
|
2403
|
-
|
|
2390
|
+
_.value = [];
|
|
2404
2391
|
return;
|
|
2405
2392
|
}
|
|
2406
2393
|
const $e = Object.values(l.livePreviewEntries).find(
|
|
@@ -2408,228 +2395,228 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2408
2395
|
);
|
|
2409
2396
|
if ($e) {
|
|
2410
2397
|
const j = $e.original.contains.find((Ie) => Ie.type === "SKU" && Ie.id === D);
|
|
2411
|
-
|
|
2398
|
+
_.value = j != null && j.alternatives ? [...j.alternatives] : [];
|
|
2412
2399
|
} else
|
|
2413
|
-
|
|
2400
|
+
_.value = [];
|
|
2414
2401
|
}
|
|
2415
2402
|
);
|
|
2416
|
-
const re =
|
|
2417
|
-
(
|
|
2403
|
+
const re = A(() => k.value !== "alts" || !b.value ? 0 : Object.values(l.livePreviewEntries).filter(
|
|
2404
|
+
(w) => w.original.version === "v2" && w.original.contains.some((D) => D.type === "SKU" && D.id === b.value)
|
|
2418
2405
|
).length);
|
|
2419
2406
|
function ve() {
|
|
2420
|
-
return
|
|
2407
|
+
return f.value === "recipe" ? "RECIPE" : "SKU";
|
|
2421
2408
|
}
|
|
2422
2409
|
function ce() {
|
|
2423
|
-
const
|
|
2424
|
-
type:
|
|
2410
|
+
const w = ve(), D = ye().amount, te = {
|
|
2411
|
+
type: w,
|
|
2425
2412
|
id: "",
|
|
2426
2413
|
amount: D,
|
|
2427
2414
|
measurement: null,
|
|
2428
2415
|
rules: null,
|
|
2429
2416
|
alternatives: []
|
|
2430
2417
|
};
|
|
2431
|
-
switch (
|
|
2418
|
+
switch (k.value) {
|
|
2432
2419
|
case "update":
|
|
2433
|
-
return { type: "replace-binding", from: { type:
|
|
2420
|
+
return { type: "replace-binding", from: { type: w, id: "" }, to: te };
|
|
2434
2421
|
case "remove":
|
|
2435
|
-
return { type: "remove-binding", target: { type:
|
|
2422
|
+
return { type: "remove-binding", target: { type: w, id: "" } };
|
|
2436
2423
|
case "alts":
|
|
2437
|
-
return { type: "update-alternatives", target: { type:
|
|
2424
|
+
return { type: "update-alternatives", target: { type: w, id: "" }, alternatives: [] };
|
|
2438
2425
|
case "link":
|
|
2439
2426
|
default:
|
|
2440
2427
|
return { type: "add-binding", binding: te };
|
|
2441
2428
|
}
|
|
2442
2429
|
}
|
|
2443
2430
|
function Ue() {
|
|
2444
|
-
return
|
|
2431
|
+
return b.value ? { type: ve(), id: b.value } : null;
|
|
2445
2432
|
}
|
|
2446
|
-
function Ye(
|
|
2447
|
-
const D =
|
|
2433
|
+
function Ye(w = !1) {
|
|
2434
|
+
const D = w ? b.value : e.value;
|
|
2448
2435
|
if (!D) return null;
|
|
2449
|
-
const { amount: te, measurement: pe } =
|
|
2436
|
+
const { amount: te, measurement: pe } = V.value, Ee = pe ? he.multiplyDecimal(te, pe.conversion) : te;
|
|
2450
2437
|
return {
|
|
2451
2438
|
type: ve(),
|
|
2452
2439
|
id: D,
|
|
2453
2440
|
amount: Ee,
|
|
2454
2441
|
measurement: pe ?? null,
|
|
2455
|
-
rules:
|
|
2456
|
-
alternatives: ee.value ?
|
|
2442
|
+
rules: f.value === "recipe" ? c.value ?? null : null,
|
|
2443
|
+
alternatives: ee.value ? _.value : []
|
|
2457
2444
|
};
|
|
2458
2445
|
}
|
|
2459
2446
|
function ct() {
|
|
2460
|
-
if (!
|
|
2461
|
-
if (!
|
|
2447
|
+
if (!f.value) return;
|
|
2448
|
+
if (!k.value) {
|
|
2462
2449
|
t("update:modelValue", ce());
|
|
2463
2450
|
return;
|
|
2464
2451
|
}
|
|
2465
|
-
const
|
|
2452
|
+
const w = Ue(), D = Ye(!1);
|
|
2466
2453
|
let te = null;
|
|
2467
|
-
switch (
|
|
2454
|
+
switch (k.value) {
|
|
2468
2455
|
case "link":
|
|
2469
2456
|
D && (te = { type: "add-binding", binding: D });
|
|
2470
2457
|
break;
|
|
2471
2458
|
case "update": {
|
|
2472
2459
|
const pe = Ye(!0);
|
|
2473
|
-
|
|
2460
|
+
w && pe && (te = { type: "replace-binding", from: w, to: pe });
|
|
2474
2461
|
break;
|
|
2475
2462
|
}
|
|
2476
2463
|
case "remove":
|
|
2477
|
-
|
|
2464
|
+
w && (te = { type: "remove-binding", target: w });
|
|
2478
2465
|
break;
|
|
2479
2466
|
case "alts":
|
|
2480
|
-
|
|
2467
|
+
w && (te = { type: "update-alternatives", target: w, alternatives: _.value });
|
|
2481
2468
|
break;
|
|
2482
2469
|
}
|
|
2483
2470
|
t("update:modelValue", te ?? ce());
|
|
2484
2471
|
}
|
|
2485
2472
|
return ue(
|
|
2486
|
-
[
|
|
2473
|
+
[f, k, S, b, e, V, c, _],
|
|
2487
2474
|
() => ct(),
|
|
2488
2475
|
{ deep: !0 }
|
|
2489
|
-
), (
|
|
2476
|
+
), (w, D) => {
|
|
2490
2477
|
const te = G("FmSelect"), pe = G("FmSwitch"), Ee = G("FmIcon"), $e = G("FmTextField");
|
|
2491
|
-
return
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
modelValue:
|
|
2496
|
-
"onUpdate:modelValue": D[0] || (D[0] = (j) =>
|
|
2478
|
+
return y(), E("div", Lo, [
|
|
2479
|
+
v("div", jo, [
|
|
2480
|
+
v("div", Ko, [
|
|
2481
|
+
h(te, {
|
|
2482
|
+
modelValue: f.value,
|
|
2483
|
+
"onUpdate:modelValue": D[0] || (D[0] = (j) => f.value = j),
|
|
2497
2484
|
items: B.value,
|
|
2498
2485
|
label: n(i)("inventory.recipe.bulkEditor.step2.sectionField"),
|
|
2499
2486
|
placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionField")
|
|
2500
2487
|
}, null, 8, ["modelValue", "items", "label", "placeholder"])
|
|
2501
2488
|
]),
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
modelValue:
|
|
2505
|
-
"onUpdate:modelValue": D[1] || (D[1] = (j) =>
|
|
2489
|
+
v("div", qo, [
|
|
2490
|
+
h(te, {
|
|
2491
|
+
modelValue: k.value,
|
|
2492
|
+
"onUpdate:modelValue": D[1] || (D[1] = (j) => k.value = j),
|
|
2506
2493
|
items: F.value,
|
|
2507
2494
|
label: n(i)("inventory.recipe.bulkEditor.step2.sectionAction"),
|
|
2508
2495
|
placeholder: n(i)("inventory.recipe.bulkEditor.step2.sectionAction")
|
|
2509
2496
|
}, null, 8, ["modelValue", "items", "label", "placeholder"])
|
|
2510
2497
|
])
|
|
2511
2498
|
]),
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
modelValue:
|
|
2515
|
-
"onUpdate:modelValue": D[2] || (D[2] = (j) =>
|
|
2499
|
+
f.value === "ingredient" && n(x).enableRecipeV2 ? (y(), E("div", Wo, [
|
|
2500
|
+
h(pe, {
|
|
2501
|
+
modelValue: S.value,
|
|
2502
|
+
"onUpdate:modelValue": D[2] || (D[2] = (j) => S.value = j),
|
|
2516
2503
|
label: n(i)("inventory.recipe.bulkEditor.step2.includeAlternativesToggle")
|
|
2517
2504
|
}, null, 8, ["modelValue", "label"])
|
|
2518
2505
|
])) : T("", !0),
|
|
2519
|
-
ee.value && fe.value > 0 ? (
|
|
2520
|
-
|
|
2506
|
+
ee.value && fe.value > 0 ? (y(), E("div", Yo, [
|
|
2507
|
+
h(Ee, {
|
|
2521
2508
|
name: "warning",
|
|
2522
2509
|
size: "sm",
|
|
2523
2510
|
class: "text-fm-color-typo-warning mt-1 shrink-0"
|
|
2524
2511
|
}),
|
|
2525
|
-
|
|
2512
|
+
v("p", Jo, U(n(i)("inventory.recipe.bulkEditor.step2.v1AlternativesWarning", {
|
|
2526
2513
|
v1Count: fe.value,
|
|
2527
2514
|
total: xe.value
|
|
2528
2515
|
})), 1)
|
|
2529
2516
|
])) : T("", !0),
|
|
2530
|
-
|
|
2531
|
-
P.value ? (
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
modelValue:
|
|
2535
|
-
"onUpdate:modelValue": D[3] || (D[3] = (j) =>
|
|
2517
|
+
R.value ? (y(), E("div", Ho, [
|
|
2518
|
+
P.value ? (y(), E(X, { key: 0 }, [
|
|
2519
|
+
v("p", Qo, U(n(i)("inventory.recipe.bulkEditor.addModification.targetLabel")), 1),
|
|
2520
|
+
h(te, {
|
|
2521
|
+
modelValue: b.value,
|
|
2522
|
+
"onUpdate:modelValue": D[3] || (D[3] = (j) => b.value = j),
|
|
2536
2523
|
items: L.value,
|
|
2537
|
-
placeholder:
|
|
2524
|
+
placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
|
|
2538
2525
|
clearable: ""
|
|
2539
2526
|
}, {
|
|
2540
2527
|
"menu-wrapper": J((j) => [
|
|
2541
|
-
|
|
2528
|
+
h(Fe, we(j, {
|
|
2542
2529
|
items: L.value,
|
|
2543
|
-
"model-value":
|
|
2530
|
+
"model-value": b.value
|
|
2544
2531
|
}), null, 16, ["items", "model-value"])
|
|
2545
2532
|
]),
|
|
2546
2533
|
_: 1
|
|
2547
2534
|
}, 8, ["modelValue", "items", "placeholder"]),
|
|
2548
|
-
H.value ? (
|
|
2549
|
-
|
|
2535
|
+
H.value ? (y(), E(X, { key: 0 }, [
|
|
2536
|
+
f.value === "ingredient" && Z.value ? (y(), Y(Be, {
|
|
2550
2537
|
key: 0,
|
|
2551
|
-
modelValue:
|
|
2552
|
-
"onUpdate:modelValue": D[4] || (D[4] = (j) =>
|
|
2538
|
+
modelValue: V.value,
|
|
2539
|
+
"onUpdate:modelValue": D[4] || (D[4] = (j) => V.value = j),
|
|
2553
2540
|
unit: Z.value.unit,
|
|
2554
2541
|
placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
|
|
2555
2542
|
"convert-amount-on-change-unit": ""
|
|
2556
|
-
}, null, 8, ["modelValue", "unit", "placeholder"])) :
|
|
2543
|
+
}, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (y(), Y($e, {
|
|
2557
2544
|
key: 1,
|
|
2558
2545
|
"model-value": N.value,
|
|
2559
2546
|
label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
|
|
2560
2547
|
type: "number",
|
|
2561
|
-
"onUpdate:modelValue": D[5] || (D[5] = (j) =>
|
|
2548
|
+
"onUpdate:modelValue": D[5] || (D[5] = (j) => g(j))
|
|
2562
2549
|
}, null, 8, ["model-value", "label"])) : T("", !0),
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2550
|
+
f.value === "recipe" ? (y(), E(X, { key: 2 }, [
|
|
2551
|
+
v("p", Xo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
|
|
2552
|
+
h(Re, {
|
|
2566
2553
|
modelValue: c.value,
|
|
2567
2554
|
"onUpdate:modelValue": D[6] || (D[6] = (j) => c.value = j)
|
|
2568
2555
|
}, null, 8, ["modelValue"])
|
|
2569
2556
|
], 64)) : T("", !0),
|
|
2570
|
-
ee.value ? (
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
modelValue:
|
|
2574
|
-
"onUpdate:modelValue": D[7] || (D[7] = (j) =>
|
|
2557
|
+
ee.value ? (y(), E(X, { key: 3 }, [
|
|
2558
|
+
v("p", Zo, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
|
|
2559
|
+
h(Se, {
|
|
2560
|
+
modelValue: _.value,
|
|
2561
|
+
"onUpdate:modelValue": D[7] || (D[7] = (j) => _.value = j),
|
|
2575
2562
|
"filter-ingredient-ids": ae.value
|
|
2576
2563
|
}, null, 8, ["modelValue", "filter-ingredient-ids"])
|
|
2577
2564
|
], 64)) : T("", !0)
|
|
2578
2565
|
], 64)) : T("", !0),
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
modelValue:
|
|
2584
|
-
"onUpdate:modelValue": D[8] || (D[8] = (j) =>
|
|
2566
|
+
k.value === "alts" && b.value ? (y(), E(X, { key: 1 }, [
|
|
2567
|
+
v("p", ei, U(re.value > 0 ? n(i)("inventory.recipe.bulkEditor.addModification.altsOverwriteWarning", { count: re.value }) : n(i)("inventory.recipe.bulkEditor.addModification.altsNotFoundWarning")), 1),
|
|
2568
|
+
v("p", ti, U(n(i)("inventory.recipe.bulkEditor.addModification.altsClearNote")), 1),
|
|
2569
|
+
h(Se, {
|
|
2570
|
+
modelValue: _.value,
|
|
2571
|
+
"onUpdate:modelValue": D[8] || (D[8] = (j) => _.value = j),
|
|
2585
2572
|
"filter-ingredient-ids": ae.value
|
|
2586
2573
|
}, null, 8, ["modelValue", "filter-ingredient-ids"])
|
|
2587
2574
|
], 64)) : T("", !0)
|
|
2588
2575
|
], 64)) : T("", !0),
|
|
2589
|
-
K.value ? (
|
|
2590
|
-
|
|
2591
|
-
|
|
2576
|
+
K.value ? (y(), E(X, { key: 1 }, [
|
|
2577
|
+
v("p", ni, U(n(i)("inventory.recipe.bulkEditor.addModification.bindingLabel")), 1),
|
|
2578
|
+
h(te, {
|
|
2592
2579
|
modelValue: e.value,
|
|
2593
2580
|
"onUpdate:modelValue": D[9] || (D[9] = (j) => e.value = j),
|
|
2594
2581
|
items: q.value,
|
|
2595
|
-
placeholder:
|
|
2582
|
+
placeholder: f.value === "recipe" ? n(i)("inventory.recipe.bulkEditor.addModification.recipePlaceholder") : n(i)("inventory.recipe.bulkEditor.addModification.skuPlaceholder"),
|
|
2596
2583
|
clearable: ""
|
|
2597
2584
|
}, {
|
|
2598
2585
|
"menu-wrapper": J((j) => [
|
|
2599
|
-
|
|
2586
|
+
h(Fe, we(j, {
|
|
2600
2587
|
items: q.value,
|
|
2601
2588
|
"model-value": e.value
|
|
2602
2589
|
}), null, 16, ["items", "model-value"])
|
|
2603
2590
|
]),
|
|
2604
2591
|
_: 1
|
|
2605
2592
|
}, 8, ["modelValue", "items", "placeholder"]),
|
|
2606
|
-
e.value ? (
|
|
2607
|
-
|
|
2593
|
+
e.value ? (y(), E(X, { key: 0 }, [
|
|
2594
|
+
f.value === "ingredient" && oe.value ? (y(), Y(Be, {
|
|
2608
2595
|
key: 0,
|
|
2609
|
-
modelValue:
|
|
2610
|
-
"onUpdate:modelValue": D[10] || (D[10] = (j) =>
|
|
2596
|
+
modelValue: V.value,
|
|
2597
|
+
"onUpdate:modelValue": D[10] || (D[10] = (j) => V.value = j),
|
|
2611
2598
|
unit: oe.value.unit,
|
|
2612
2599
|
placeholder: n(i)("inventory.recipe.bulkEditor.query.amountPlaceholder"),
|
|
2613
2600
|
"convert-amount-on-change-unit": ""
|
|
2614
|
-
}, null, 8, ["modelValue", "unit", "placeholder"])) :
|
|
2601
|
+
}, null, 8, ["modelValue", "unit", "placeholder"])) : f.value === "recipe" ? (y(), Y($e, {
|
|
2615
2602
|
key: 1,
|
|
2616
2603
|
"model-value": N.value,
|
|
2617
2604
|
label: n(i)("inventory.recipe.bulkEditor.addModification.amountLabel"),
|
|
2618
2605
|
type: "number",
|
|
2619
|
-
"onUpdate:modelValue": D[11] || (D[11] = (j) =>
|
|
2606
|
+
"onUpdate:modelValue": D[11] || (D[11] = (j) => g(j))
|
|
2620
2607
|
}, null, 8, ["model-value", "label"])) : T("", !0),
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2608
|
+
f.value === "recipe" ? (y(), E(X, { key: 2 }, [
|
|
2609
|
+
v("p", oi, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalRuleLabel")), 1),
|
|
2610
|
+
h(Re, {
|
|
2624
2611
|
modelValue: c.value,
|
|
2625
2612
|
"onUpdate:modelValue": D[12] || (D[12] = (j) => c.value = j)
|
|
2626
2613
|
}, null, 8, ["modelValue"])
|
|
2627
2614
|
], 64)) : T("", !0),
|
|
2628
|
-
ee.value ? (
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
modelValue:
|
|
2632
|
-
"onUpdate:modelValue": D[13] || (D[13] = (j) =>
|
|
2615
|
+
ee.value ? (y(), E(X, { key: 3 }, [
|
|
2616
|
+
v("p", ii, U(n(i)("inventory.recipe.bulkEditor.addModification.optionalAlternativesLabel")), 1),
|
|
2617
|
+
h(Se, {
|
|
2618
|
+
modelValue: _.value,
|
|
2619
|
+
"onUpdate:modelValue": D[13] || (D[13] = (j) => _.value = j),
|
|
2633
2620
|
"filter-ingredient-ids": ae.value
|
|
2634
2621
|
}, null, 8, ["modelValue", "filter-ingredient-ids"])
|
|
2635
2622
|
], 64)) : T("", !0)
|
|
@@ -2659,24 +2646,24 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2659
2646
|
class: "flex flex-col gap-4 pl-8"
|
|
2660
2647
|
}, ki = { class: "flex-1 fm-typo-en-body-xs-400 text-fm-color-typo-secondary font-mono truncate" }, hi = /* @__PURE__ */ le({
|
|
2661
2648
|
__name: "LivePreviewTable",
|
|
2662
|
-
setup(
|
|
2649
|
+
setup(m) {
|
|
2663
2650
|
const { t: d } = ie(), l = ge(), t = ne(), i = {
|
|
2664
2651
|
"will-update": 0,
|
|
2665
2652
|
"partially-ignored": 1,
|
|
2666
2653
|
"already-satisfied": 2,
|
|
2667
2654
|
blocked: 3,
|
|
2668
2655
|
"no-applicable-changes": 4
|
|
2669
|
-
}, r =
|
|
2656
|
+
}, r = A(
|
|
2670
2657
|
() => Object.values(l.livePreviewEntries).sort(
|
|
2671
|
-
(e,
|
|
2658
|
+
(e, V) => i[e.status] - i[V.status]
|
|
2672
2659
|
)
|
|
2673
|
-
),
|
|
2660
|
+
), x = A(
|
|
2674
2661
|
() => r.value.filter((e) => e.status === "will-update").length
|
|
2675
|
-
), u =
|
|
2662
|
+
), u = A(
|
|
2676
2663
|
() => r.value.filter((e) => e.status === "partially-ignored").length
|
|
2677
|
-
), o =
|
|
2664
|
+
), o = A(
|
|
2678
2665
|
() => r.value.filter((e) => e.status === "already-satisfied").length
|
|
2679
|
-
), s =
|
|
2666
|
+
), s = A(
|
|
2680
2667
|
() => r.value.filter((e) => e.status === "blocked").length
|
|
2681
2668
|
);
|
|
2682
2669
|
function a(e) {
|
|
@@ -2695,7 +2682,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2695
2682
|
return "";
|
|
2696
2683
|
}
|
|
2697
2684
|
}
|
|
2698
|
-
function
|
|
2685
|
+
function p(e) {
|
|
2699
2686
|
switch (e) {
|
|
2700
2687
|
case "will-update":
|
|
2701
2688
|
return "success";
|
|
@@ -2711,41 +2698,41 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2711
2698
|
return "neutral";
|
|
2712
2699
|
}
|
|
2713
2700
|
}
|
|
2714
|
-
function
|
|
2715
|
-
var c,
|
|
2716
|
-
return e === "SKU" ? ((c = t.skuById[
|
|
2701
|
+
function $(e, V) {
|
|
2702
|
+
var c, _, N;
|
|
2703
|
+
return e === "SKU" ? ((c = t.skuById[V]) == null ? void 0 : c.name) ?? V : e === "SKU_GROUP" ? ((_ = t.skuGroupById[V]) == null ? void 0 : _.name) ?? V : e === "RECIPE" ? ((N = t.recipeById[V]) == null ? void 0 : N.name) ?? V : V;
|
|
2717
2704
|
}
|
|
2718
2705
|
function C(e) {
|
|
2719
|
-
var c,
|
|
2720
|
-
const
|
|
2706
|
+
var c, _;
|
|
2707
|
+
const V = $(e.type, e.id);
|
|
2721
2708
|
if (e.type === "SKU") {
|
|
2722
|
-
const N = t.skuById[e.id], z = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((
|
|
2723
|
-
return `${
|
|
2709
|
+
const N = t.skuById[e.id], z = ((c = e.measurement) == null ? void 0 : c.abbrev) ?? ((_ = N == null ? void 0 : N.unit) == null ? void 0 : _.abbrev) ?? "";
|
|
2710
|
+
return `${V} (${Q(e.amount)} ${z})`.trim();
|
|
2724
2711
|
}
|
|
2725
|
-
return e.type === "RECIPE" ? `${
|
|
2712
|
+
return e.type === "RECIPE" ? `${V} ×${Q(e.amount)}` : V;
|
|
2726
2713
|
}
|
|
2727
2714
|
function I(e) {
|
|
2728
|
-
return
|
|
2715
|
+
return $(e.type, e.id);
|
|
2729
2716
|
}
|
|
2730
|
-
function
|
|
2731
|
-
const c =
|
|
2717
|
+
function f(e, V) {
|
|
2718
|
+
const c = V.contains.find((_) => _.type === e.type && _.id === e.id);
|
|
2732
2719
|
return c ? C(c) : I(e);
|
|
2733
2720
|
}
|
|
2734
|
-
function
|
|
2721
|
+
function k(e, V) {
|
|
2735
2722
|
switch (e.type) {
|
|
2736
2723
|
case "add-binding":
|
|
2737
2724
|
return `+ ${C(e.binding)}`;
|
|
2738
2725
|
case "remove-binding":
|
|
2739
2726
|
return `− ${I(e.target)}`;
|
|
2740
2727
|
case "replace-binding":
|
|
2741
|
-
return `${
|
|
2728
|
+
return `${f(e.from, V)} → ${C(e.to)}`;
|
|
2742
2729
|
case "update-binding-rule":
|
|
2743
2730
|
return `Rule: ${I(e.target)}`;
|
|
2744
2731
|
case "update-alternatives":
|
|
2745
2732
|
return `Alternatives: ${I(e.target)}`;
|
|
2746
2733
|
}
|
|
2747
2734
|
}
|
|
2748
|
-
function
|
|
2735
|
+
function S(e) {
|
|
2749
2736
|
switch (e) {
|
|
2750
2737
|
case "applied":
|
|
2751
2738
|
return "success";
|
|
@@ -2759,7 +2746,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2759
2746
|
return "neutral";
|
|
2760
2747
|
}
|
|
2761
2748
|
}
|
|
2762
|
-
function
|
|
2749
|
+
function b(e) {
|
|
2763
2750
|
switch (e) {
|
|
2764
2751
|
case "applied":
|
|
2765
2752
|
return d("inventory.recipe.bulkEditor.livePreview.outcomeApplied");
|
|
@@ -2773,59 +2760,59 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2773
2760
|
return e;
|
|
2774
2761
|
}
|
|
2775
2762
|
}
|
|
2776
|
-
return (e,
|
|
2763
|
+
return (e, V) => {
|
|
2777
2764
|
const c = G("FmChip");
|
|
2778
|
-
return
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2765
|
+
return y(), E("div", ri, [
|
|
2766
|
+
v("div", ai, [
|
|
2767
|
+
x.value + u.value > 0 ? (y(), E("div", si, [
|
|
2768
|
+
h(c, {
|
|
2782
2769
|
size: "sm",
|
|
2783
|
-
label: String(
|
|
2770
|
+
label: String(x.value + u.value),
|
|
2784
2771
|
variant: "success"
|
|
2785
2772
|
}, null, 8, ["label"]),
|
|
2786
|
-
|
|
2773
|
+
v("span", di, U(n(d)("inventory.recipe.bulkEditor.livePreview.willUpdate")), 1)
|
|
2787
2774
|
])) : T("", !0),
|
|
2788
|
-
o.value > 0 ? (
|
|
2789
|
-
|
|
2775
|
+
o.value > 0 ? (y(), E("div", ui, [
|
|
2776
|
+
h(c, {
|
|
2790
2777
|
size: "sm",
|
|
2791
2778
|
label: String(o.value),
|
|
2792
2779
|
variant: "info"
|
|
2793
2780
|
}, null, 8, ["label"]),
|
|
2794
|
-
|
|
2781
|
+
v("span", ci, U(n(d)("inventory.recipe.bulkEditor.livePreview.alreadySatisfied")), 1)
|
|
2795
2782
|
])) : T("", !0),
|
|
2796
|
-
s.value > 0 ? (
|
|
2797
|
-
|
|
2783
|
+
s.value > 0 ? (y(), E("div", pi, [
|
|
2784
|
+
h(c, {
|
|
2798
2785
|
size: "sm",
|
|
2799
2786
|
label: String(s.value),
|
|
2800
2787
|
variant: "critical"
|
|
2801
2788
|
}, null, 8, ["label"]),
|
|
2802
|
-
|
|
2789
|
+
v("span", mi, U(n(d)("inventory.recipe.bulkEditor.livePreview.blocked")), 1)
|
|
2803
2790
|
])) : T("", !0)
|
|
2804
2791
|
]),
|
|
2805
|
-
|
|
2806
|
-
r.value.length === 0 ? (
|
|
2807
|
-
(
|
|
2808
|
-
key:
|
|
2792
|
+
v("div", fi, [
|
|
2793
|
+
r.value.length === 0 ? (y(), E("div", vi, U(n(d)("inventory.recipe.bulkEditor.livePreview.noRecipes")), 1)) : (y(), E("div", yi, [
|
|
2794
|
+
(y(!0), E(X, null, me(r.value, (_) => (y(), E("div", {
|
|
2795
|
+
key: _.recipeId,
|
|
2809
2796
|
class: "flex flex-col gap-6 px-16 py-10"
|
|
2810
2797
|
}, [
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2798
|
+
v("div", bi, [
|
|
2799
|
+
v("span", gi, U(_.recipeName), 1),
|
|
2800
|
+
h(c, {
|
|
2814
2801
|
size: "sm",
|
|
2815
|
-
label: a(
|
|
2816
|
-
variant:
|
|
2802
|
+
label: a(_.status),
|
|
2803
|
+
variant: p(_.status)
|
|
2817
2804
|
}, null, 8, ["label", "variant"])
|
|
2818
2805
|
]),
|
|
2819
|
-
|
|
2820
|
-
(
|
|
2806
|
+
_.changes.length > 0 ? (y(), E("div", _i, [
|
|
2807
|
+
(y(!0), E(X, null, me(_.changes, (N, z) => (y(), E("div", {
|
|
2821
2808
|
key: z,
|
|
2822
2809
|
class: "flex items-center gap-8"
|
|
2823
2810
|
}, [
|
|
2824
|
-
|
|
2825
|
-
|
|
2811
|
+
v("span", ki, U(k(N.change, _.original)), 1),
|
|
2812
|
+
h(c, {
|
|
2826
2813
|
size: "sm",
|
|
2827
|
-
label:
|
|
2828
|
-
variant:
|
|
2814
|
+
label: b(N.outcome),
|
|
2815
|
+
variant: S(N.outcome)
|
|
2829
2816
|
}, null, 8, ["label", "variant"])
|
|
2830
2817
|
]))), 128))
|
|
2831
2818
|
])) : T("", !0)
|
|
@@ -2843,7 +2830,7 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2843
2830
|
class: "flex flex-col items-center justify-center py-40 gap-8 text-center rounded-lg border border-dashed border-fm-color-border-default"
|
|
2844
2831
|
}, Si = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ci = { class: "flex-1 overflow-y-auto px-16 py-14 flex flex-col gap-12 min-h-0" }, Bi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary shrink-0" }, Fi = /* @__PURE__ */ le({
|
|
2845
2832
|
__name: "RecipeBulkEditorStep2",
|
|
2846
|
-
setup(
|
|
2833
|
+
setup(m) {
|
|
2847
2834
|
const { t: d } = ie(), l = ge(), t = W(null);
|
|
2848
2835
|
ue(
|
|
2849
2836
|
() => l.modifications.length,
|
|
@@ -2856,13 +2843,13 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2856
2843
|
const a = o.type === "replace-binding" ? o.from.type : o.type === "remove-binding" || o.type === "update-binding-rule" || o.type === "update-alternatives" ? o.target.type : o.type === "add-binding" ? o.binding.type : null;
|
|
2857
2844
|
return a === "RECIPE" ? d("inventory.recipe.bulkEditor.step2.fieldRecipe") : a === "SKU" || a === "SKU_GROUP" ? d("inventory.recipe.bulkEditor.step2.fieldIngredient") : d("inventory.recipe.bulkEditor.step2.tabLabel", { n: s + 1 });
|
|
2858
2845
|
}
|
|
2859
|
-
const r =
|
|
2846
|
+
const r = A(
|
|
2860
2847
|
() => l.modifications.map((o, s) => ({
|
|
2861
2848
|
label: i(o, s),
|
|
2862
2849
|
value: s
|
|
2863
2850
|
}))
|
|
2864
2851
|
);
|
|
2865
|
-
function
|
|
2852
|
+
function x() {
|
|
2866
2853
|
const s = {
|
|
2867
2854
|
type: "add-binding",
|
|
2868
2855
|
binding: {
|
|
@@ -2880,28 +2867,28 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2880
2867
|
l.removeModification(o);
|
|
2881
2868
|
}
|
|
2882
2869
|
return (o, s) => {
|
|
2883
|
-
const a = G("FmButton"),
|
|
2884
|
-
return
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
r.value.length > 0 ? (
|
|
2870
|
+
const a = G("FmButton"), p = G("FmTab"), $ = G("FmTabs"), C = G("FmIcon");
|
|
2871
|
+
return y(), E("div", xi, [
|
|
2872
|
+
v("div", $i, [
|
|
2873
|
+
v("div", Ii, [
|
|
2874
|
+
v("div", wi, [
|
|
2875
|
+
r.value.length > 0 ? (y(), Y($, {
|
|
2889
2876
|
key: 0,
|
|
2890
2877
|
"model-value": t.value,
|
|
2891
2878
|
items: r.value,
|
|
2892
2879
|
"onUpdate:modelValue": s[1] || (s[1] = (I) => t.value = I)
|
|
2893
2880
|
}, {
|
|
2894
2881
|
default: J((I) => [
|
|
2895
|
-
|
|
2882
|
+
h(p, we(I, {
|
|
2896
2883
|
"model-value": t.value,
|
|
2897
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
2884
|
+
"onUpdate:modelValue": s[0] || (s[0] = (f) => t.value = f)
|
|
2898
2885
|
}), {
|
|
2899
2886
|
append: J(() => [
|
|
2900
|
-
|
|
2887
|
+
h(a, {
|
|
2901
2888
|
variant: "tertiary",
|
|
2902
2889
|
icon: "close",
|
|
2903
2890
|
size: "md",
|
|
2904
|
-
onClick: ft((
|
|
2891
|
+
onClick: ft((f) => u(I.value), ["stop"])
|
|
2905
2892
|
}, null, 8, ["onClick"])
|
|
2906
2893
|
]),
|
|
2907
2894
|
_: 2
|
|
@@ -2910,24 +2897,24 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2910
2897
|
_: 1
|
|
2911
2898
|
}, 8, ["model-value", "items"])) : T("", !0)
|
|
2912
2899
|
]),
|
|
2913
|
-
|
|
2900
|
+
h(a, {
|
|
2914
2901
|
label: n(d)("inventory.recipe.bulkEditor.step2.addModification"),
|
|
2915
2902
|
variant: "secondary",
|
|
2916
2903
|
size: "md",
|
|
2917
2904
|
"prepend-icon": "add",
|
|
2918
2905
|
class: "shrink-0",
|
|
2919
|
-
onClick:
|
|
2906
|
+
onClick: x
|
|
2920
2907
|
}, null, 8, ["label"])
|
|
2921
2908
|
]),
|
|
2922
|
-
|
|
2923
|
-
n(l).modifications.length === 0 ? (
|
|
2924
|
-
|
|
2909
|
+
v("div", Ei, [
|
|
2910
|
+
n(l).modifications.length === 0 ? (y(), E("div", Vi, [
|
|
2911
|
+
h(C, {
|
|
2925
2912
|
name: "edit_note",
|
|
2926
2913
|
size: "lg",
|
|
2927
2914
|
class: "text-fm-color-typo-placeholder"
|
|
2928
2915
|
}),
|
|
2929
|
-
|
|
2930
|
-
])) : t.value !== null && n(l).modifications[t.value] ? (
|
|
2916
|
+
v("p", Si, U(n(d)("inventory.recipe.bulkEditor.step2.emptyState")), 1)
|
|
2917
|
+
])) : t.value !== null && n(l).modifications[t.value] ? (y(), Y(li, {
|
|
2931
2918
|
key: t.value,
|
|
2932
2919
|
"model-value": n(l).modifications[t.value],
|
|
2933
2920
|
"live-preview-entries": n(l).livePreviewEntries,
|
|
@@ -2935,67 +2922,67 @@ const ge = ot("recipeBulkEditor", function() {
|
|
|
2935
2922
|
}, null, 8, ["model-value", "live-preview-entries"])) : T("", !0)
|
|
2936
2923
|
])
|
|
2937
2924
|
]),
|
|
2938
|
-
s[3] || (s[3] =
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2925
|
+
s[3] || (s[3] = v("div", { class: "border-t border-fm-color-border-default shrink-0" }, null, -1)),
|
|
2926
|
+
v("div", Ci, [
|
|
2927
|
+
v("span", Bi, U(n(d)("inventory.recipe.bulkEditor.step2.livePreviewTitle")), 1),
|
|
2928
|
+
h(hi)
|
|
2942
2929
|
])
|
|
2943
2930
|
]);
|
|
2944
2931
|
};
|
|
2945
2932
|
}
|
|
2946
2933
|
});
|
|
2947
|
-
function Ri(
|
|
2948
|
-
return !
|
|
2934
|
+
function Ri(m) {
|
|
2935
|
+
return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
|
|
2949
2936
|
}
|
|
2950
2937
|
function Ai() {
|
|
2951
|
-
const
|
|
2938
|
+
const m = ne(), d = ge(), l = m.skuById, t = m.recipeById, i = m.skuGroupById, x = Object.values(d.entries).filter(
|
|
2952
2939
|
(s) => s.status === "will-update" || s.status === "partially-ignored"
|
|
2953
2940
|
).flatMap((s, a) => {
|
|
2954
2941
|
var C;
|
|
2955
|
-
const
|
|
2956
|
-
if ((C =
|
|
2957
|
-
const I =
|
|
2942
|
+
const p = s.projected ?? s.original, $ = Ri(p.customAttributes);
|
|
2943
|
+
if ((C = p.contains) != null && C.length) {
|
|
2944
|
+
const I = p.contains.filter((S) => S.type === "RECIPE"), f = p.contains.filter((S) => S.type === "SKU"), k = p.contains.filter((S) => S.type === "SKU_GROUP");
|
|
2958
2945
|
return [
|
|
2959
2946
|
...a === 0 ? [] : [["", "", "", "", "", "", ""]],
|
|
2960
2947
|
...I.map(
|
|
2961
|
-
(
|
|
2948
|
+
(S, b) => {
|
|
2962
2949
|
var e;
|
|
2963
2950
|
return [
|
|
2964
|
-
|
|
2951
|
+
b === 0 ? p.name : "",
|
|
2965
2952
|
"RECIPE",
|
|
2966
2953
|
"",
|
|
2967
|
-
((e = t[
|
|
2968
|
-
Q(
|
|
2954
|
+
((e = t[S.id]) == null ? void 0 : e.name) ?? S.id,
|
|
2955
|
+
Q(S.amount),
|
|
2969
2956
|
"UNIT",
|
|
2970
|
-
|
|
2957
|
+
b === 0 ? $ : ""
|
|
2971
2958
|
];
|
|
2972
2959
|
}
|
|
2973
2960
|
),
|
|
2974
|
-
...
|
|
2975
|
-
(
|
|
2976
|
-
var e,
|
|
2961
|
+
...f.map(
|
|
2962
|
+
(S, b) => {
|
|
2963
|
+
var e, V, c, _;
|
|
2977
2964
|
return [
|
|
2978
|
-
!I.length &&
|
|
2965
|
+
!I.length && b === 0 ? p.name : "",
|
|
2979
2966
|
"INGREDIENT",
|
|
2980
|
-
((e = l[
|
|
2981
|
-
((
|
|
2982
|
-
Q(
|
|
2983
|
-
|
|
2984
|
-
!I.length &&
|
|
2967
|
+
((e = l[S.id]) == null ? void 0 : e.code) ?? "",
|
|
2968
|
+
((V = l[S.id]) == null ? void 0 : V.name) ?? S.id,
|
|
2969
|
+
Q(S.amount),
|
|
2970
|
+
S.measurement ? S.measurement.abbrev : ((_ = (c = l[S.id]) == null ? void 0 : c.unit) == null ? void 0 : _.abbrev) ?? "",
|
|
2971
|
+
!I.length && b === 0 ? $ : ""
|
|
2985
2972
|
];
|
|
2986
2973
|
}
|
|
2987
2974
|
),
|
|
2988
|
-
...
|
|
2989
|
-
(
|
|
2990
|
-
var e,
|
|
2975
|
+
...k.map(
|
|
2976
|
+
(S, b) => {
|
|
2977
|
+
var e, V;
|
|
2991
2978
|
return [
|
|
2992
|
-
I.length === 0 &&
|
|
2979
|
+
I.length === 0 && f.length === 0 && b === 0 ? p.name : "",
|
|
2993
2980
|
"SKU_GROUP",
|
|
2994
|
-
((e = i[
|
|
2995
|
-
((
|
|
2996
|
-
Q(
|
|
2981
|
+
((e = i[S.id]) == null ? void 0 : e.ref) ?? "",
|
|
2982
|
+
((V = i[S.id]) == null ? void 0 : V.name) ?? S.id,
|
|
2983
|
+
Q(S.amount),
|
|
2997
2984
|
"UNIT",
|
|
2998
|
-
I.length === 0 &&
|
|
2985
|
+
I.length === 0 && f.length === 0 && b === 0 ? $ : ""
|
|
2999
2986
|
];
|
|
3000
2987
|
}
|
|
3001
2988
|
)
|
|
@@ -3003,9 +2990,9 @@ function Ai() {
|
|
|
3003
2990
|
}
|
|
3004
2991
|
return [
|
|
3005
2992
|
...a === 0 ? [] : [["", "", "", "", "", "", ""]],
|
|
3006
|
-
[
|
|
2993
|
+
[p.name, "No bindings", "", "", "", "", $]
|
|
3007
2994
|
];
|
|
3008
|
-
}), o = at(
|
|
2995
|
+
}), o = at(x, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
|
|
3009
2996
|
st(o, `RECIPE_BULK_EDIT_${dt(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
|
|
3010
2997
|
}
|
|
3011
2998
|
const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, Pi = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, Mi = { class: "flex flex-wrap gap-12" }, Di = { class: "flex items-center gap-6" }, Gi = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ni = {
|
|
@@ -3037,90 +3024,90 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
|
|
|
3037
3024
|
class: "text-fm-color-typo-placeholder"
|
|
3038
3025
|
}, rl = /* @__PURE__ */ le({
|
|
3039
3026
|
__name: "RecipeBulkEditorSummaryStep",
|
|
3040
|
-
setup(
|
|
3041
|
-
const { t: d } = ie(), l = ne(), t = ge(), i =
|
|
3027
|
+
setup(m) {
|
|
3028
|
+
const { t: d } = ie(), l = ne(), t = ge(), i = A(() => Object.values(t.entries)), r = A(
|
|
3042
3029
|
() => i.value.filter((e) => e.status === "will-update").length
|
|
3043
|
-
),
|
|
3030
|
+
), x = A(
|
|
3044
3031
|
() => i.value.filter((e) => e.status === "partially-ignored").length
|
|
3045
|
-
), u =
|
|
3032
|
+
), u = A(
|
|
3046
3033
|
() => i.value.filter((e) => e.status === "already-satisfied").length
|
|
3047
|
-
), o =
|
|
3034
|
+
), o = A(
|
|
3048
3035
|
() => i.value.filter((e) => e.status === "blocked").length
|
|
3049
|
-
), s =
|
|
3036
|
+
), s = A(
|
|
3050
3037
|
() => i.value.filter((e) => e.status === "no-applicable-changes").length
|
|
3051
3038
|
), a = W(/* @__PURE__ */ new Set());
|
|
3052
|
-
function
|
|
3039
|
+
function p(e) {
|
|
3053
3040
|
return a.value.has(e);
|
|
3054
3041
|
}
|
|
3055
|
-
function
|
|
3056
|
-
const
|
|
3057
|
-
|
|
3042
|
+
function $(e) {
|
|
3043
|
+
const V = new Set(a.value);
|
|
3044
|
+
V.has(e) ? V.delete(e) : V.add(e), a.value = V;
|
|
3058
3045
|
}
|
|
3059
3046
|
function C(e) {
|
|
3060
|
-
var
|
|
3061
|
-
const
|
|
3062
|
-
for (let
|
|
3063
|
-
const B = c[
|
|
3047
|
+
var _, N, z;
|
|
3048
|
+
const V = [], c = ke(e.contains, /* @__PURE__ */ new Set([e._id]), l.recipeById);
|
|
3049
|
+
for (let g = 0; g < c.length; g++) {
|
|
3050
|
+
const B = c[g], F = B.recipeIds.slice(1).length > 0, R = F ? ((_ = l.recipeById[B.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name) ?? "" : "";
|
|
3064
3051
|
let P;
|
|
3065
3052
|
if (B.isGroup) {
|
|
3066
3053
|
const K = l.skuGroupById[B.id];
|
|
3067
3054
|
if (!K) continue;
|
|
3068
3055
|
const H = `x${Q(B.amount)}`;
|
|
3069
|
-
P = F ? `(${
|
|
3056
|
+
P = F ? `(${R}) ${K.name} (${H})` : `${K.name} (${H})`;
|
|
3070
3057
|
} else {
|
|
3071
3058
|
const K = l.skuById[B.id];
|
|
3072
3059
|
if (!K) continue;
|
|
3073
3060
|
const H = ((N = B.measurement) == null ? void 0 : N.abbrev) ?? ((z = K.unit) == null ? void 0 : z.abbrev) ?? "", ee = `${Q(B.amount)}${H}`;
|
|
3074
|
-
P = F ? `(${
|
|
3061
|
+
P = F ? `(${R}) ${K.name} (${ee})` : `${K.name} (${ee})`;
|
|
3075
3062
|
}
|
|
3076
|
-
|
|
3063
|
+
g > 0 && V.push({ text: ", " }), V.push({ text: P });
|
|
3077
3064
|
}
|
|
3078
|
-
return
|
|
3065
|
+
return V;
|
|
3079
3066
|
}
|
|
3080
3067
|
function I(e) {
|
|
3081
|
-
var
|
|
3068
|
+
var g, B, F, R;
|
|
3082
3069
|
if (e.isGroup) {
|
|
3083
3070
|
const P = l.skuGroupById[e.id];
|
|
3084
3071
|
if (!P) return "";
|
|
3085
|
-
const K = e.recipeIds.slice(1).length > 0, H = K ? ((
|
|
3072
|
+
const K = e.recipeIds.slice(1).length > 0, H = K ? ((g = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : g.name) ?? "" : "", ee = `x${Q(e.amount)}`;
|
|
3086
3073
|
return K ? `(${H}) ${P.name} (${ee})` : `${P.name} (${ee})`;
|
|
3087
3074
|
}
|
|
3088
|
-
const
|
|
3089
|
-
if (!
|
|
3090
|
-
const c = e.recipeIds.slice(1).length > 0,
|
|
3091
|
-
return c ? `(${
|
|
3075
|
+
const V = l.skuById[e.id];
|
|
3076
|
+
if (!V) return "";
|
|
3077
|
+
const c = e.recipeIds.slice(1).length > 0, _ = c ? ((B = l.recipeById[e.recipeIds.at(-1) ?? ""]) == null ? void 0 : B.name) ?? "" : "", N = ((F = e.measurement) == null ? void 0 : F.abbrev) ?? ((R = V.unit) == null ? void 0 : R.abbrev) ?? "", z = `${Q(e.amount)}${N}`;
|
|
3078
|
+
return c ? `(${_}) ${V.name} (${z})` : `${V.name} (${z})`;
|
|
3092
3079
|
}
|
|
3093
|
-
function
|
|
3080
|
+
function f(e) {
|
|
3094
3081
|
if (!e.projected) return [];
|
|
3095
|
-
const
|
|
3096
|
-
for (const F of
|
|
3082
|
+
const V = ke(e.original.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), c = ke(e.projected.contains, /* @__PURE__ */ new Set([e.recipeId]), l.recipeById), _ = /* @__PURE__ */ new Map();
|
|
3083
|
+
for (const F of V) _.set(`${F.type}:${F.id}`, F);
|
|
3097
3084
|
const N = /* @__PURE__ */ new Map();
|
|
3098
3085
|
for (const F of c) N.set(`${F.type}:${F.id}`, F);
|
|
3099
3086
|
const z = [];
|
|
3100
|
-
let
|
|
3101
|
-
function B(F,
|
|
3102
|
-
|
|
3087
|
+
let g = !0;
|
|
3088
|
+
function B(F, R) {
|
|
3089
|
+
R && (g || z.push({ kind: "unchanged", text: ", " }), z.push({ kind: F, text: R }), g = !1);
|
|
3103
3090
|
}
|
|
3104
|
-
for (const [F,
|
|
3091
|
+
for (const [F, R] of _) {
|
|
3105
3092
|
const P = N.get(F);
|
|
3106
3093
|
if (!P)
|
|
3107
|
-
B("removed", I(
|
|
3094
|
+
B("removed", I(R));
|
|
3108
3095
|
else {
|
|
3109
|
-
const K = I(
|
|
3096
|
+
const K = I(R), H = I(P);
|
|
3110
3097
|
K === H ? B("unchanged", K) : (B("removed", K), B("added", H));
|
|
3111
3098
|
}
|
|
3112
3099
|
}
|
|
3113
|
-
for (const [F,
|
|
3114
|
-
|
|
3100
|
+
for (const [F, R] of N)
|
|
3101
|
+
_.has(F) || B("added", I(R));
|
|
3115
3102
|
return z;
|
|
3116
3103
|
}
|
|
3117
|
-
const
|
|
3104
|
+
const k = A(() => {
|
|
3118
3105
|
const e = /* @__PURE__ */ new Map();
|
|
3119
|
-
for (const
|
|
3120
|
-
e.set(
|
|
3106
|
+
for (const V of i.value)
|
|
3107
|
+
e.set(V.recipeId, f(V));
|
|
3121
3108
|
return e;
|
|
3122
3109
|
});
|
|
3123
|
-
function
|
|
3110
|
+
function S(e) {
|
|
3124
3111
|
switch (e) {
|
|
3125
3112
|
case "will-update":
|
|
3126
3113
|
return d("inventory.recipe.bulkEditor.status.willUpdate");
|
|
@@ -3136,7 +3123,7 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
|
|
|
3136
3123
|
return "";
|
|
3137
3124
|
}
|
|
3138
3125
|
}
|
|
3139
|
-
function
|
|
3126
|
+
function b(e) {
|
|
3140
3127
|
switch (e) {
|
|
3141
3128
|
case "will-update":
|
|
3142
3129
|
return "success";
|
|
@@ -3152,121 +3139,121 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
|
|
|
3152
3139
|
return "neutral";
|
|
3153
3140
|
}
|
|
3154
3141
|
}
|
|
3155
|
-
return (e,
|
|
3156
|
-
const c = G("FmChip"),
|
|
3157
|
-
return
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3142
|
+
return (e, V) => {
|
|
3143
|
+
const c = G("FmChip"), _ = G("FmButton"), N = G("FmBanner"), z = G("FmIcon");
|
|
3144
|
+
return y(), E("div", Ti, [
|
|
3145
|
+
v("div", Ui, [
|
|
3146
|
+
v("p", Pi, U(n(d)("inventory.recipe.bulkEditor.summary.title")), 1),
|
|
3147
|
+
v("div", Mi, [
|
|
3148
|
+
v("div", Di, [
|
|
3149
|
+
h(c, {
|
|
3163
3150
|
size: "sm",
|
|
3164
3151
|
label: String(r.value),
|
|
3165
3152
|
variant: "success"
|
|
3166
3153
|
}, null, 8, ["label"]),
|
|
3167
|
-
|
|
3154
|
+
v("span", Gi, U(n(d)("inventory.recipe.bulkEditor.summary.countWillUpdate")), 1)
|
|
3168
3155
|
]),
|
|
3169
|
-
|
|
3170
|
-
|
|
3156
|
+
x.value > 0 ? (y(), E("div", Ni, [
|
|
3157
|
+
h(c, {
|
|
3171
3158
|
size: "sm",
|
|
3172
|
-
label: String(
|
|
3159
|
+
label: String(x.value),
|
|
3173
3160
|
variant: "warning"
|
|
3174
3161
|
}, null, 8, ["label"]),
|
|
3175
|
-
|
|
3162
|
+
v("span", zi, U(n(d)("inventory.recipe.bulkEditor.summary.countPartiallyIgnored")), 1)
|
|
3176
3163
|
])) : T("", !0),
|
|
3177
|
-
u.value > 0 ? (
|
|
3178
|
-
|
|
3164
|
+
u.value > 0 ? (y(), E("div", Oi, [
|
|
3165
|
+
h(c, {
|
|
3179
3166
|
size: "sm",
|
|
3180
3167
|
label: String(u.value),
|
|
3181
3168
|
variant: "info"
|
|
3182
3169
|
}, null, 8, ["label"]),
|
|
3183
|
-
|
|
3170
|
+
v("span", Li, U(n(d)("inventory.recipe.bulkEditor.summary.countAlreadySatisfied")), 1)
|
|
3184
3171
|
])) : T("", !0),
|
|
3185
|
-
o.value > 0 ? (
|
|
3186
|
-
|
|
3172
|
+
o.value > 0 ? (y(), E("div", ji, [
|
|
3173
|
+
h(c, {
|
|
3187
3174
|
size: "sm",
|
|
3188
3175
|
label: String(o.value),
|
|
3189
3176
|
variant: "critical"
|
|
3190
3177
|
}, null, 8, ["label"]),
|
|
3191
|
-
|
|
3178
|
+
v("span", Ki, U(n(d)("inventory.recipe.bulkEditor.summary.countBlocked")), 1)
|
|
3192
3179
|
])) : T("", !0),
|
|
3193
|
-
s.value > 0 ? (
|
|
3194
|
-
|
|
3180
|
+
s.value > 0 ? (y(), E("div", qi, [
|
|
3181
|
+
h(c, {
|
|
3195
3182
|
size: "sm",
|
|
3196
3183
|
label: String(s.value),
|
|
3197
3184
|
variant: "neutral"
|
|
3198
3185
|
}, null, 8, ["label"]),
|
|
3199
|
-
|
|
3186
|
+
v("span", Wi, U(n(d)("inventory.recipe.bulkEditor.summary.countNoChanges")), 1)
|
|
3200
3187
|
])) : T("", !0)
|
|
3201
3188
|
]),
|
|
3202
|
-
|
|
3203
|
-
|
|
3189
|
+
v("div", Yi, [
|
|
3190
|
+
h(_, {
|
|
3204
3191
|
label: n(d)("common.export"),
|
|
3205
3192
|
variant: "secondary",
|
|
3206
3193
|
size: "md",
|
|
3207
3194
|
onClick: n(Ai)
|
|
3208
3195
|
}, null, 8, ["label", "onClick"])
|
|
3209
3196
|
]),
|
|
3210
|
-
r.value === 0 &&
|
|
3197
|
+
r.value === 0 && x.value === 0 ? (y(), Y(N, {
|
|
3211
3198
|
key: 0,
|
|
3212
3199
|
class: "mt-12",
|
|
3213
3200
|
type: "warning",
|
|
3214
3201
|
message: n(d)("inventory.recipe.bulkEditor.summary.nothingToSubmit")
|
|
3215
3202
|
}, null, 8, ["message"])) : T("", !0)
|
|
3216
3203
|
]),
|
|
3217
|
-
(
|
|
3218
|
-
key:
|
|
3204
|
+
(y(!0), E(X, null, me(i.value, (g) => (y(), E("div", {
|
|
3205
|
+
key: g.recipeId,
|
|
3219
3206
|
class: "rounded-lg border border-fm-color-border-default overflow-hidden"
|
|
3220
3207
|
}, [
|
|
3221
|
-
|
|
3208
|
+
v("button", {
|
|
3222
3209
|
type: "button",
|
|
3223
|
-
class: Ce(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !g
|
|
3224
|
-
onClick: (B) =>
|
|
3210
|
+
class: Ce(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary border-b border-fm-color-border-default text-left cursor-pointer", { "border-b-0": !p(g.recipeId) }]),
|
|
3211
|
+
onClick: (B) => $(g.recipeId)
|
|
3225
3212
|
}, [
|
|
3226
|
-
|
|
3227
|
-
name: g
|
|
3213
|
+
h(z, {
|
|
3214
|
+
name: p(g.recipeId) ? "expand_less" : "expand_more",
|
|
3228
3215
|
size: "sm",
|
|
3229
3216
|
class: "text-fm-color-typo-secondary flex-shrink-0"
|
|
3230
3217
|
}, null, 8, ["name"]),
|
|
3231
|
-
|
|
3232
|
-
|
|
3218
|
+
v("span", Hi, U(g.recipeName), 1),
|
|
3219
|
+
g.original.version === "v2" ? (y(), Y(c, {
|
|
3233
3220
|
key: 0,
|
|
3234
3221
|
size: "sm",
|
|
3235
3222
|
label: "V2",
|
|
3236
3223
|
variant: "info"
|
|
3237
3224
|
})) : T("", !0),
|
|
3238
|
-
|
|
3225
|
+
h(c, {
|
|
3239
3226
|
size: "sm",
|
|
3240
|
-
label:
|
|
3241
|
-
variant:
|
|
3227
|
+
label: S(g.status),
|
|
3228
|
+
variant: b(g.status)
|
|
3242
3229
|
}, null, 8, ["label", "variant"])
|
|
3243
3230
|
], 10, Ji),
|
|
3244
|
-
g
|
|
3245
|
-
n(t).applyErrors.has(
|
|
3246
|
-
|
|
3231
|
+
p(g.recipeId) ? (y(), E(X, { key: 0 }, [
|
|
3232
|
+
n(t).applyErrors.has(g.recipeId) ? (y(), E("div", Qi, [
|
|
3233
|
+
h(N, {
|
|
3247
3234
|
type: "error",
|
|
3248
|
-
message: n(t).applyErrors.get(
|
|
3235
|
+
message: n(t).applyErrors.get(g.recipeId)
|
|
3249
3236
|
}, null, 8, ["message"])
|
|
3250
3237
|
])) : T("", !0),
|
|
3251
|
-
|
|
3252
|
-
|
|
3238
|
+
v("div", Xi, [
|
|
3239
|
+
g.projected ? (k.value.get(g.recipeId) ?? []).length > 0 ? (y(!0), E(X, { key: 1 }, me(k.value.get(g.recipeId), (B, F) => (y(), E("span", {
|
|
3253
3240
|
key: F,
|
|
3254
3241
|
class: Ce(["fm-typo-en-body-sm-400", {
|
|
3255
3242
|
"text-fm-color-typo-secondary": B.kind === "unchanged",
|
|
3256
3243
|
"line-through text-fm-color-error font-medium": B.kind === "removed",
|
|
3257
3244
|
"text-fm-color-success font-medium": B.kind === "added"
|
|
3258
3245
|
}])
|
|
3259
|
-
}, U(B.text), 3))), 128)) : (
|
|
3246
|
+
}, U(B.text), 3))), 128)) : (y(), E("span", Zi, U(n(d)("inventory.recipe.bulkEditor.summary.emptyBindings")), 1)) : (y(!0), E(X, { key: 0 }, me(C(g.original), (B, F) => (y(), E("span", {
|
|
3260
3247
|
key: F,
|
|
3261
3248
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-placeholder"
|
|
3262
3249
|
}, U(B.text), 1))), 128))
|
|
3263
3250
|
]),
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3251
|
+
v("div", el, [
|
|
3252
|
+
g.counts.applied > 0 ? (y(), E("span", tl, U(n(d)("inventory.recipe.bulkEditor.summary.footerApplied", { count: g.counts.applied })), 1)) : T("", !0),
|
|
3253
|
+
g.counts.satisfied > 0 ? (y(), E("span", nl, U(n(d)("inventory.recipe.bulkEditor.summary.footerSatisfied", { count: g.counts.satisfied })), 1)) : T("", !0),
|
|
3254
|
+
g.counts.ignored > 0 ? (y(), E("span", ol, U(n(d)("inventory.recipe.bulkEditor.summary.footerIgnored", { count: g.counts.ignored })), 1)) : T("", !0),
|
|
3255
|
+
g.counts.blocked > 0 ? (y(), E("span", il, U(n(d)("inventory.recipe.bulkEditor.summary.footerBlocked", { count: g.counts.blocked })), 1)) : T("", !0),
|
|
3256
|
+
g.counts.applied === 0 && g.counts.satisfied === 0 && g.counts.ignored === 0 && g.counts.blocked === 0 ? (y(), E("span", ll, U(n(d)("inventory.recipe.bulkEditor.summary.noChangesDetail")), 1)) : T("", !0)
|
|
3270
3257
|
])
|
|
3271
3258
|
], 64)) : T("", !0)
|
|
3272
3259
|
]))), 128))
|
|
@@ -3297,22 +3284,22 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
|
|
|
3297
3284
|
show: { type: Boolean }
|
|
3298
3285
|
},
|
|
3299
3286
|
emits: ["update:show"],
|
|
3300
|
-
setup(
|
|
3301
|
-
const l =
|
|
3287
|
+
setup(m, { emit: d }) {
|
|
3288
|
+
const l = m, { t } = ie(), i = ge(), r = Ge(l, "show"), x = Le(), u = A(() => i.currentStep === 1), o = A(() => i.currentStep === 2), s = A(() => i.currentStep === 3);
|
|
3302
3289
|
function a() {
|
|
3303
3290
|
i.currentStep = 2;
|
|
3304
3291
|
}
|
|
3305
|
-
function
|
|
3292
|
+
function p() {
|
|
3306
3293
|
i.currentStep = 1;
|
|
3307
3294
|
}
|
|
3308
|
-
function
|
|
3295
|
+
function $() {
|
|
3309
3296
|
i.goToStep3();
|
|
3310
3297
|
}
|
|
3311
3298
|
function C() {
|
|
3312
3299
|
i.backToStep2();
|
|
3313
3300
|
}
|
|
3314
3301
|
function I() {
|
|
3315
|
-
|
|
3302
|
+
x.open({
|
|
3316
3303
|
title: t("inventory.recipe.bulkEditor.step3.confirmTitle"),
|
|
3317
3304
|
message: t("inventory.recipe.bulkEditor.step3.confirmMessage"),
|
|
3318
3305
|
primaryActions: {
|
|
@@ -3328,16 +3315,16 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
|
|
|
3328
3315
|
await i.confirmAndApply();
|
|
3329
3316
|
});
|
|
3330
3317
|
}
|
|
3331
|
-
function
|
|
3318
|
+
function f() {
|
|
3332
3319
|
r.value = !1, i.reset();
|
|
3333
3320
|
}
|
|
3334
|
-
return (
|
|
3335
|
-
const
|
|
3336
|
-
return
|
|
3321
|
+
return (k, S) => {
|
|
3322
|
+
const b = G("FmChip"), e = G("FmButton"), V = G("FmDialog");
|
|
3323
|
+
return y(), Y(V, {
|
|
3337
3324
|
modelValue: n(r),
|
|
3338
3325
|
"onUpdate:modelValue": [
|
|
3339
|
-
|
|
3340
|
-
|
|
3326
|
+
S[0] || (S[0] = (c) => De(r) ? r.value = c : null),
|
|
3327
|
+
S[1] || (S[1] = (c) => {
|
|
3341
3328
|
c || n(i).reset();
|
|
3342
3329
|
})
|
|
3343
3330
|
],
|
|
@@ -3347,9 +3334,9 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
|
|
|
3347
3334
|
"max-height": "98vh"
|
|
3348
3335
|
}, {
|
|
3349
3336
|
"dialog-header": J(() => [
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3337
|
+
v("div", al, [
|
|
3338
|
+
v("span", sl, U(n(t)("inventory.recipe.bulkEditor.title")), 1),
|
|
3339
|
+
h(b, {
|
|
3353
3340
|
size: "sm",
|
|
3354
3341
|
label: n(t)("inventory.recipe.bulkEditor.stepIndicator", { step: n(i).currentStep, total: 3 }),
|
|
3355
3342
|
variant: "neutral"
|
|
@@ -3357,61 +3344,61 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
|
|
|
3357
3344
|
])
|
|
3358
3345
|
]),
|
|
3359
3346
|
"dialog-footer": J(() => [
|
|
3360
|
-
u.value ? (
|
|
3361
|
-
|
|
3347
|
+
u.value ? (y(), E("div", pl, [
|
|
3348
|
+
h(e, {
|
|
3362
3349
|
label: n(t)("common.next"),
|
|
3363
3350
|
disabled: !n(i).canGoToStep2,
|
|
3364
3351
|
onClick: a
|
|
3365
3352
|
}, null, 8, ["label", "disabled"]),
|
|
3366
|
-
|
|
3353
|
+
h(e, {
|
|
3367
3354
|
label: n(t)("common.close"),
|
|
3368
3355
|
variant: "tertiary",
|
|
3369
|
-
onClick:
|
|
3356
|
+
onClick: f
|
|
3370
3357
|
}, null, 8, ["label"])
|
|
3371
|
-
])) : o.value ? (
|
|
3372
|
-
|
|
3358
|
+
])) : o.value ? (y(), E("div", ml, [
|
|
3359
|
+
h(e, {
|
|
3373
3360
|
label: n(t)("inventory.recipe.bulkEditor.step2.reviewButton"),
|
|
3374
3361
|
disabled: !n(i).canGoToStep3,
|
|
3375
|
-
onClick:
|
|
3362
|
+
onClick: $
|
|
3376
3363
|
}, null, 8, ["label", "disabled"]),
|
|
3377
|
-
|
|
3364
|
+
h(e, {
|
|
3378
3365
|
label: n(t)("common.back"),
|
|
3379
3366
|
variant: "secondary",
|
|
3380
|
-
onClick:
|
|
3367
|
+
onClick: p
|
|
3381
3368
|
}, null, 8, ["label"]),
|
|
3382
|
-
|
|
3369
|
+
h(e, {
|
|
3383
3370
|
label: n(t)("common.close"),
|
|
3384
3371
|
variant: "tertiary",
|
|
3385
|
-
onClick:
|
|
3372
|
+
onClick: f
|
|
3386
3373
|
}, null, 8, ["label"])
|
|
3387
|
-
])) : s.value ? (
|
|
3388
|
-
|
|
3374
|
+
])) : s.value ? (y(), E("div", fl, [
|
|
3375
|
+
h(e, {
|
|
3389
3376
|
label: n(t)("inventory.recipe.bulkEditor.step3.confirmButton"),
|
|
3390
3377
|
disabled: n(i).isSaving,
|
|
3391
3378
|
loading: n(i).isSaving,
|
|
3392
3379
|
onClick: I
|
|
3393
3380
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
3394
|
-
|
|
3381
|
+
h(e, {
|
|
3395
3382
|
label: n(t)("common.back"),
|
|
3396
3383
|
variant: "secondary",
|
|
3397
3384
|
disabled: n(i).isSaving,
|
|
3398
3385
|
onClick: C
|
|
3399
3386
|
}, null, 8, ["label", "disabled"]),
|
|
3400
|
-
|
|
3387
|
+
h(e, {
|
|
3401
3388
|
label: n(t)("common.close"),
|
|
3402
3389
|
variant: "tertiary",
|
|
3403
3390
|
disabled: n(i).isSaving,
|
|
3404
|
-
onClick:
|
|
3391
|
+
onClick: f
|
|
3405
3392
|
}, null, 8, ["label", "disabled"])
|
|
3406
3393
|
])) : T("", !0)
|
|
3407
3394
|
]),
|
|
3408
3395
|
default: J(() => [
|
|
3409
|
-
u.value ? (
|
|
3410
|
-
|
|
3411
|
-
])) : o.value ? (
|
|
3412
|
-
|
|
3413
|
-
])) : s.value ? (
|
|
3414
|
-
|
|
3396
|
+
u.value ? (y(), E("div", dl, [
|
|
3397
|
+
h(Oo)
|
|
3398
|
+
])) : o.value ? (y(), E("div", ul, [
|
|
3399
|
+
h(Fi)
|
|
3400
|
+
])) : s.value ? (y(), E("div", cl, [
|
|
3401
|
+
h(rl)
|
|
3415
3402
|
])) : T("", !0)
|
|
3416
3403
|
]),
|
|
3417
3404
|
_: 1
|
|
@@ -3419,56 +3406,56 @@ const Ti = { class: "flex flex-col gap-16" }, Ui = { class: "rounded-lg border b
|
|
|
3419
3406
|
};
|
|
3420
3407
|
}
|
|
3421
3408
|
});
|
|
3422
|
-
function yl(
|
|
3423
|
-
return !
|
|
3409
|
+
function yl(m) {
|
|
3410
|
+
return !m || Object.keys(m).length === 0 ? "" : Object.entries(m).map(([d, l]) => `${d}: ${l}`).join(", ");
|
|
3424
3411
|
}
|
|
3425
3412
|
function bl() {
|
|
3426
|
-
const
|
|
3427
|
-
var
|
|
3413
|
+
const m = ne(), d = m.recipes, l = m.recipeById, t = m.skuById, i = m.skuGroupById, r = d.flatMap((o, s) => {
|
|
3414
|
+
var p;
|
|
3428
3415
|
const a = yl(o.customAttributes);
|
|
3429
|
-
if ((
|
|
3430
|
-
const
|
|
3416
|
+
if ((p = o.contains) != null && p.length) {
|
|
3417
|
+
const $ = o.contains.filter((f) => f.type === "RECIPE"), C = o.contains.filter((f) => f.type === "SKU"), I = o.contains.filter((f) => f.type === "SKU_GROUP");
|
|
3431
3418
|
return [
|
|
3432
3419
|
...s === 0 ? [] : [["", "", "", "", "", "", ""]],
|
|
3433
|
-
|
|
3434
|
-
(
|
|
3435
|
-
var
|
|
3420
|
+
...$.map(
|
|
3421
|
+
(f, k) => {
|
|
3422
|
+
var S;
|
|
3436
3423
|
return [
|
|
3437
|
-
|
|
3424
|
+
k === 0 ? o.name : "",
|
|
3438
3425
|
"RECIPE",
|
|
3439
3426
|
"",
|
|
3440
|
-
(
|
|
3441
|
-
Q(
|
|
3427
|
+
(S = l[f.id]) == null ? void 0 : S.name,
|
|
3428
|
+
Q(f.amount),
|
|
3442
3429
|
"UNIT",
|
|
3443
|
-
|
|
3430
|
+
k === 0 ? a : ""
|
|
3444
3431
|
];
|
|
3445
3432
|
}
|
|
3446
3433
|
),
|
|
3447
3434
|
...C.map(
|
|
3448
|
-
(
|
|
3449
|
-
var
|
|
3435
|
+
(f, k) => {
|
|
3436
|
+
var S, b, e, V;
|
|
3450
3437
|
return [
|
|
3451
|
-
|
|
3438
|
+
!$.length && k === 0 ? o.name : "",
|
|
3452
3439
|
"INGREDIENT",
|
|
3453
|
-
(
|
|
3454
|
-
(
|
|
3455
|
-
Q(
|
|
3456
|
-
|
|
3457
|
-
|
|
3440
|
+
(S = t[f.id]) == null ? void 0 : S.code,
|
|
3441
|
+
(b = t[f.id]) == null ? void 0 : b.name,
|
|
3442
|
+
Q(f.amount),
|
|
3443
|
+
f.measurement ? f.measurement.abbrev : (V = (e = t[f.id]) == null ? void 0 : e.unit) == null ? void 0 : V.abbrev,
|
|
3444
|
+
!$.length && k === 0 ? a : ""
|
|
3458
3445
|
];
|
|
3459
3446
|
}
|
|
3460
3447
|
),
|
|
3461
3448
|
...I.map(
|
|
3462
|
-
(
|
|
3463
|
-
var
|
|
3449
|
+
(f, k) => {
|
|
3450
|
+
var S, b;
|
|
3464
3451
|
return [
|
|
3465
|
-
|
|
3452
|
+
$.length === 0 && C.length === 0 && k === 0 ? o.name : "",
|
|
3466
3453
|
"SKU_GROUP",
|
|
3467
|
-
((
|
|
3468
|
-
(
|
|
3469
|
-
Q(
|
|
3454
|
+
((S = i[f.id]) == null ? void 0 : S.ref) || "",
|
|
3455
|
+
(b = i[f.id]) == null ? void 0 : b.name,
|
|
3456
|
+
Q(f.amount),
|
|
3470
3457
|
"UNIT",
|
|
3471
|
-
|
|
3458
|
+
$.length === 0 && C.length === 0 && k === 0 ? a : ""
|
|
3472
3459
|
];
|
|
3473
3460
|
}
|
|
3474
3461
|
)
|
|
@@ -3483,77 +3470,77 @@ function bl() {
|
|
|
3483
3470
|
}
|
|
3484
3471
|
const gl = { class: "flex flex-col py-8" }, _l = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, kl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Hl = /* @__PURE__ */ le({
|
|
3485
3472
|
__name: "RecipeView",
|
|
3486
|
-
setup(
|
|
3487
|
-
const d = ne(), l =
|
|
3473
|
+
setup(m) {
|
|
3474
|
+
const d = ne(), l = A(() => d.recipes), t = tt(), { createRecipe: i, updateRecipe: r } = ze(), { recipeDialogProps: x, recipeViewLoading: u } = Et(ze()), { columnDefs: o, formatRowData: s } = Jt(), a = A(() => s(l.value)), p = ge(), $ = We();
|
|
3488
3475
|
W(!1);
|
|
3489
3476
|
function C(c) {
|
|
3490
3477
|
if (c === "add")
|
|
3491
3478
|
return i();
|
|
3492
3479
|
if (c === "export")
|
|
3493
3480
|
return bl();
|
|
3494
|
-
c === "bulk-edit" &&
|
|
3481
|
+
c === "bulk-edit" && p.openDialog();
|
|
3495
3482
|
}
|
|
3496
|
-
const I = W(""),
|
|
3497
|
-
return (c,
|
|
3483
|
+
const I = W(""), f = A(() => u.value), { breakpoints: k } = xt(), S = A(() => k.value.xs || k.value.sm), b = A(() => S.value ? 10 : 20), e = Ct(), { t: V } = ie();
|
|
3484
|
+
return (c, _) => {
|
|
3498
3485
|
const N = G("FmTable");
|
|
3499
|
-
return
|
|
3500
|
-
title: n(
|
|
3486
|
+
return y(), Y(Bt, {
|
|
3487
|
+
title: n(V)("inventory.recipe.title"),
|
|
3501
3488
|
actions: [
|
|
3502
3489
|
{
|
|
3503
|
-
label: n(
|
|
3490
|
+
label: n(V)("inventory.recipe.create.title"),
|
|
3504
3491
|
value: "add",
|
|
3505
3492
|
isPrimary: !0,
|
|
3506
3493
|
prependIcon: "add"
|
|
3507
3494
|
},
|
|
3508
|
-
...n(
|
|
3509
|
-
{ label: n(
|
|
3495
|
+
...n($).enableBulkEditRecipes ? [{ label: n(V)("inventory.recipe.bulkEditor.title"), value: "bulk-edit", isPrimary: !1 }] : [],
|
|
3496
|
+
{ label: n(V)("common.export"), value: "export", isPrimary: !1 }
|
|
3510
3497
|
],
|
|
3511
3498
|
"onClick:action": C
|
|
3512
3499
|
}, {
|
|
3513
3500
|
default: J(() => [
|
|
3514
|
-
|
|
3501
|
+
v("div", {
|
|
3515
3502
|
class: Ce([
|
|
3516
3503
|
"flex flex-col gap-8 max-h-full",
|
|
3517
3504
|
{
|
|
3518
|
-
"p-0":
|
|
3519
|
-
"px-24 ": !
|
|
3505
|
+
"p-0": S.value,
|
|
3506
|
+
"px-24 ": !S.value
|
|
3520
3507
|
}
|
|
3521
3508
|
])
|
|
3522
3509
|
}, [
|
|
3523
|
-
|
|
3510
|
+
h(jt, {
|
|
3524
3511
|
searchable: "",
|
|
3525
3512
|
search: I.value,
|
|
3526
|
-
"onUpdate:search":
|
|
3513
|
+
"onUpdate:search": _[0] || (_[0] = (z) => I.value = z)
|
|
3527
3514
|
}, null, 8, ["search"]),
|
|
3528
|
-
(
|
|
3515
|
+
(y(), Y(N, {
|
|
3529
3516
|
style: vt(n(e).tableHeight),
|
|
3530
3517
|
"column-defs": n(o),
|
|
3531
3518
|
"row-data": a.value,
|
|
3532
3519
|
"search-value": I.value,
|
|
3533
|
-
loading: !n(t)._currentLocation ||
|
|
3534
|
-
onRowClick:
|
|
3520
|
+
loading: !n(t)._currentLocation || f.value,
|
|
3521
|
+
onRowClick: _[1] || (_[1] = (z) => n(r)(z.original.original)),
|
|
3535
3522
|
key: l.value.length,
|
|
3536
|
-
"page-size":
|
|
3523
|
+
"page-size": b.value
|
|
3537
3524
|
}, {
|
|
3538
3525
|
"list-row": J((z) => [
|
|
3539
|
-
|
|
3526
|
+
h(Lt, {
|
|
3540
3527
|
row: z,
|
|
3541
|
-
onRowClick: (
|
|
3528
|
+
onRowClick: (g) => n(r)(g.original)
|
|
3542
3529
|
}, {
|
|
3543
|
-
default: J((
|
|
3544
|
-
var B, F,
|
|
3530
|
+
default: J((g) => {
|
|
3531
|
+
var B, F, R, P, K, H, ee, O, M, L;
|
|
3545
3532
|
return [
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
render: (
|
|
3550
|
-
props: (K = (P =
|
|
3533
|
+
v("div", gl, [
|
|
3534
|
+
v("div", _l, [
|
|
3535
|
+
h(n(Qe), {
|
|
3536
|
+
render: (R = (F = (B = g.recipe) == null ? void 0 : B.column) == null ? void 0 : F.columnDef) == null ? void 0 : R.cell,
|
|
3537
|
+
props: (K = (P = g.recipe) == null ? void 0 : P.getContext) == null ? void 0 : K.call(P)
|
|
3551
3538
|
}, null, 8, ["render", "props"])
|
|
3552
3539
|
]),
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
render: (O = (ee = (H =
|
|
3556
|
-
props: (L = (M =
|
|
3540
|
+
v("div", kl, [
|
|
3541
|
+
h(n(Qe), {
|
|
3542
|
+
render: (O = (ee = (H = g.ingredients) == null ? void 0 : H.column) == null ? void 0 : ee.columnDef) == null ? void 0 : O.cell,
|
|
3543
|
+
props: (L = (M = g.ingredients) == null ? void 0 : M.getContext) == null ? void 0 : L.call(M)
|
|
3557
3544
|
}, null, 8, ["render", "props"])
|
|
3558
3545
|
])
|
|
3559
3546
|
])
|
|
@@ -3565,12 +3552,12 @@ const gl = { class: "flex flex-col py-8" }, _l = { class: "fm-typo-en-body-lg-60
|
|
|
3565
3552
|
_: 1
|
|
3566
3553
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
3567
3554
|
], 2),
|
|
3568
|
-
(
|
|
3569
|
-
|
|
3570
|
-
n(
|
|
3555
|
+
(y(), Y(yt, { to: "body" }, [
|
|
3556
|
+
h(vo, bt(gt(n(x))), null, 16),
|
|
3557
|
+
n($).enableBulkEditRecipes ? (y(), Y(vl, {
|
|
3571
3558
|
key: 0,
|
|
3572
|
-
show: n(
|
|
3573
|
-
"onUpdate:show":
|
|
3559
|
+
show: n(p).show,
|
|
3560
|
+
"onUpdate:show": _[2] || (_[2] = (z) => n(p).show = z)
|
|
3574
3561
|
}, null, 8, ["show"])) : T("", !0)
|
|
3575
3562
|
]))
|
|
3576
3563
|
]),
|