@feedmepos/mf-inventory-portal 1.7.9-dev.0 → 1.7.9-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.
Files changed (111) hide show
  1. package/dist/App-BYCW0L94.js +1403 -0
  2. package/dist/{ApprovalView-Bc6xo-gg.js → ApprovalView-pmI_SFo7.js} +9 -9
  3. package/dist/{BindingsDialog-BbTkoM05.js → BindingsDialog-D902flPr.js} +2 -2
  4. package/dist/{BindingsPicker-CkK79U9V.js → BindingsPicker-JEKsY59b.js} +2 -2
  5. package/dist/{BindingsTable-CmdCc1mG.js → BindingsTable-DqlzOIxF.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-BOt07CYr.js → BulkReceiveRequestView-Chw7ma2k.js} +19 -19
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-YMRGpkS4.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Cct8Ko19.js} +1 -1
  8. package/dist/{ClosingDraftView-Dec1xuFQ.js → ClosingDraftView-D1ymRsd2.js} +19 -19
  9. package/dist/{ClosingHistoryView-DuX0UpLC.js → ClosingHistoryView-5yr_itIV.js} +5 -5
  10. package/dist/{ClosingTemplateView-DBPGxWt2.js → ClosingTemplateView-MDl5Zq-g.js} +16 -16
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DWfblvtV.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BcG0gWV4.js} +1 -1
  12. package/dist/{DefaultView-D_XfvHrs.js → DefaultView-dOfbL3iF.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-DfAAAfCJ.js → DeliveryOrderPrintPreview-BfVgQOx8.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-CdcBrUHW.js → EmailDialog.vue_vue_type_script_setup_true_lang-DHspOJQW.js} +2250 -2250
  15. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-lge1DZ4v.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B7NLu0us.js} +1 -1
  16. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DjYAwlg9.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C0nunKjx.js} +2 -2
  17. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-vwp2n9KL.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CMst9tkA.js} +2 -2
  18. package/dist/{FmMultiselectDialog-BTVaIESZ.js → FmMultiselectDialog-BjBx94pY.js} +1 -1
  19. package/dist/{FmMultiselectDialog-C-kDJtv_.js → FmMultiselectDialog-Dt54hvqw.js} +2 -2
  20. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Mo-hF_cA.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DtG9Ieo_.js} +6 -6
  21. package/dist/{ImportView-CRAFZVSk.js → ImportView-CdZN8k_Y.js} +6 -6
  22. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CuEDzJ0s.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-iCpYEneM.js} +1 -1
  23. package/dist/{IngredientGroupView-OeeBfJau.js → IngredientGroupView-BBVS1mKn.js} +5 -5
  24. package/dist/{IngredientsView-BHX3xUDm.js → IngredientsView-BGOaAUzR.js} +17 -16
  25. package/dist/{IntegrationExplorerView-BwxSGD2N.js → IntegrationExplorerView-UUBCmqdR.js} +4 -4
  26. package/dist/{IntegrationView-CevJNVqG.js → IntegrationView-B2YowH-i.js} +14 -14
  27. package/dist/{InventoryBindingForm-wE--IP2D.js → InventoryBindingForm-kDx6Mvhn.js} +1 -1
  28. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-C8bktmYH.js +563 -0
  29. package/dist/{InventoryBindingSummary-BQ-U7tHs.js → InventoryBindingSummary-DJrBTa8_.js} +1 -1
  30. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-jnXbX2lS.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DHk9uEAP.js} +1 -1
  31. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BNMCbrIo.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Dx1VktdW.js} +1 -1
  32. package/dist/{ProductionView-CvU9N_mb.js → ProductionView-CxUcsRBP.js} +7 -7
  33. package/dist/{PublishView-BNnxGtEQ.js → PublishView-DtP-Ms7q.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-Bq9kMWdx.js → PurchaseOrderPrintPreview-C_qC2KF5.js} +2 -2
  35. package/dist/{ReceiveRequestView-zUSU0Uvq.js → ReceiveRequestView-Dy3BpqsP.js} +14 -14
  36. package/dist/RecipeView-DeR7pqj8.js +3625 -0
  37. package/dist/{SettingsView-CPgsU8Kr.js → SettingsView-C7ZXmatO.js} +4 -4
  38. package/dist/{StockView-D-TJzHhP.js → StockView-wFLnNSRr.js} +21 -21
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B6ez4H3Z.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Fxh3-Nqi.js} +1 -1
  40. package/dist/{SupplierView-D-rODe-B.js → SupplierView-CeTDNDDK.js} +12 -12
  41. package/dist/{SurchargeView-C88KTCML.js → SurchargeView-BQJnCdPA.js} +6 -6
  42. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CFIK8eEl.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D1zxuH66.js} +2 -2
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BNjjTYtk.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BFkh3Ubb.js} +1 -1
  44. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-E0FeDPFB.js → TransferDetails.vue_vue_type_script_setup_true_lang-CZVDhXNz.js} +20 -20
  45. package/dist/{TransferTemplateView-f9A4-wEL.js → TransferTemplateView-XaI2T5fa.js} +20 -20
  46. package/dist/{UnitCostHistoryView-D26St5yl.js → UnitCostHistoryView-DTNW7-mk.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-D2z5vabu.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-vRsEjVJc.js} +4 -4
  48. package/dist/{UnitView-algS_4rD.js → UnitView-DXnyzkj3.js} +7 -7
  49. package/dist/{WarehouseView-BRM-euG4.js → WarehouseView-iEHFgIqh.js} +5 -5
  50. package/dist/{WastageTemplateView-BWPYvTMC.js → WastageTemplateView-CGDUCPbr.js} +14 -14
  51. package/dist/api/changelog.d.ts +69 -1
  52. package/dist/{app-BI1fLJ8H.js → app-BIXJtvvD.js} +35 -23
  53. package/dist/app.d.ts +26 -8
  54. package/dist/app.js +1 -1
  55. package/dist/{closing-template-DRQ-A04S.js → closing-template-CLY-r6Cf.js} +1 -1
  56. package/dist/{date2-paxg81i_.js → date2-DbYQycSa.js} +1 -1
  57. package/dist/{dayjs.min-CqWwbKI1.js → dayjs.min-Dv7-fEed.js} +1 -1
  58. package/dist/{decimal-tY0JrFld.js → decimal-B8YR17QC.js} +2 -2
  59. package/dist/{defineDeepModel-CaP78Goh.js → defineDeepModel-C5ncgNxj.js} +1 -1
  60. package/dist/{duplicate-template-pTXXQ0VS.js → duplicate-template-CAlG1nzV.js} +1 -1
  61. package/dist/{feature-B2r32qOO.js → feature-BLSNLI5y.js} +2 -2
  62. package/dist/{format-time-from-id-DXMYus4N.js → format-time-from-id-D5DcWpHS.js} +1 -1
  63. package/dist/{format-unit-display-5hlsZBY2.js → format-unit-display-Ch97dVXx.js} +12 -12
  64. package/dist/{import-export.helper-BiC2Ghbl.js → import-export.helper-CvUFSOa1.js} +6 -6
  65. package/dist/{index-rqdAWR69.js → index-Bk8DOv4n.js} +3306 -3232
  66. package/dist/{index-KP2-U9x_.js → index-CXzVUrJS.js} +3 -3
  67. package/dist/{index-B7eouqPa.js → index-rRPErzP4.js} +1 -1
  68. package/dist/{inventory-core-dart.default-ClRRaGtG.js → inventory-core-dart.default-Cj7CxnpK.js} +1 -1
  69. package/dist/{lz-string-CAl-OrXa.js → lz-string-DWkGPESZ.js} +1 -1
  70. package/dist/{netsuite-cH4OybGV.js → netsuite-Cn0y1rH3.js} +2 -2
  71. package/dist/{number-BzmDQm_s.js → number-CxbQxQwj.js} +3 -3
  72. package/dist/{predefined-templates-Baz8GEGx.js → predefined-templates-CrSoG3R9.js} +1 -1
  73. package/dist/{purchase-order-template-0So3c2iS.js → purchase-order-template-BmQQnrEl.js} +1 -1
  74. package/dist/{recalculationUtils-DJlz5mJL.js → recalculationUtils-CSnowXma.js} +1 -1
  75. package/dist/{rules-BKdtla9-.js → rules-CurdOAcA.js} +2 -2
  76. package/dist/{stock-D8M5e53w.js → stock-BdDR_L8p.js} +1 -1
  77. package/dist/{stock-HCSCwSH0.js → stock-BiqEgcgU.js} +3 -3
  78. package/dist/style.css +1 -1
  79. package/dist/{supplier-1mbcQSiQ.js → supplier-CsjbmP_P.js} +2 -2
  80. package/dist/{surcharge-DuxYBaWV.js → surcharge--kBjIIst.js} +1 -1
  81. package/dist/tsconfig.app.tsbuildinfo +1 -1
  82. package/dist/{uom-rules-Dkbgtow8.js → uom-rules-D8UPS06O.js} +1 -1
  83. package/dist/{use-ingredient-select-dialog-BXvBvELI.js → use-ingredient-select-dialog-BZdrpLOE.js} +2 -2
  84. package/dist/{use-inventory-binding-dialog-2lrzHWdQ.js → use-inventory-binding-dialog-CkNxixT2.js} +2 -2
  85. package/dist/{use-template-enabled-locations-CrDuAaCj.js → use-template-enabled-locations-Dkl1_1F-.js} +2 -2
  86. package/dist/{use-transfer-locations-C4oTuW_f.js → use-transfer-locations-Bmj4zTJj.js} +2 -2
  87. package/dist/{useHrmPermission-CxeYlUgA.js → useHrmPermission-DcBe_-Q6.js} +1 -1
  88. package/dist/{useNavigationMenu-BWgwgA4U.js → useNavigationMenu-CsRbtAc7.js} +2 -2
  89. package/dist/{useSseClient-DPA1zg96.js → useSseClient-hl2SQF5b.js} +1 -1
  90. package/dist/views/changelog/components/ChangelogPanel.spec.d.ts +1 -0
  91. package/dist/views/changelog/components/ChangelogPanel.vue.d.ts +2 -0
  92. package/dist/views/changelog/composables/use-changelog.d.ts +54 -2
  93. package/dist/views/changelog/composables/use-inventory-record-commits.d.ts +97 -0
  94. package/dist/views/changelog/composables/use-inventory-record-commits.spec.d.ts +1 -0
  95. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +29 -0
  96. package/dist/views/changelog/composables/use-snapshot-diff.spec.d.ts +1 -0
  97. package/dist/views/changelog/composables/value-tree.d.ts +14 -0
  98. package/dist/views/changelog/composables/value-tree.spec.d.ts +1 -0
  99. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +2 -0
  100. package/dist/views/ingredients/components/inventory-binding/RecipeBindingBreakdown.vue.d.ts +25 -0
  101. package/dist/views/ingredients/components/inventory-binding/composables/recipe-breakdown.d.ts +34 -0
  102. package/dist/views/ingredients/components/inventory-binding/composables/recipe-breakdown.spec.d.ts +1 -0
  103. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +2 -0
  104. package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +4 -0
  105. package/dist/views/recipe/composables/use-recipe-table.d.ts +11 -0
  106. package/dist/{vue-i18n-BSfpVmaF.js → vue-i18n-yL99yI4f.js} +169 -169
  107. package/dist/{xlsx.util-DSA9o0Zu.js → xlsx.util-B8azJxkS.js} +2 -2
  108. package/package.json +2 -2
  109. package/dist/App-DvBMEcuJ.js +0 -1155
  110. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-O5IbSGWu.js +0 -441
  111. package/dist/RecipeView-DkXOK1Iy.js +0 -3584
@@ -0,0 +1,563 @@
1
+ import { defineComponent as H, ref as ye, computed as w, resolveComponent as E, createElementBlock as u, createCommentVNode as x, openBlock as d, createElementVNode as n, createVNode as p, toDisplayString as c, unref as l, Fragment as G, renderList as T, normalizeStyle as fe, createTextVNode as ve, reactive as Y, withCtx as A, createBlock as S, nextTick as _e } from "vue";
2
+ import { a as J, t as xe, v as be, F as ge } from "./app-BIXJtvvD.js";
3
+ import { t as he, n as ke, f as Be, a as P, c as Ve } from "./number-CxbQxQwj.js";
4
+ import { u as Ie } from "./use-inventory-binding-dialog-CkNxixT2.js";
5
+ import { useI18n as Q } from "@feedmepos/mf-common";
6
+ import { b as q, c as O } from "./rules-CurdOAcA.js";
7
+ import { _ as we, c as Fe, d as Ee } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-DtG9Ieo_.js";
8
+ const N = { amount: 1, precision: 0 };
9
+ function X(_, y) {
10
+ return { amount: _.amount * y.amount, precision: _.precision + y.precision };
11
+ }
12
+ function Ue(_, y) {
13
+ const a = Z(y), m = X(_, a);
14
+ return ke(m.amount / 10 ** m.precision, m.precision);
15
+ }
16
+ function Z(_) {
17
+ if (_.trim().length === 0) return N;
18
+ const y = Number(_);
19
+ return Number.isFinite(y) ? he(y, Be(y)) : N;
20
+ }
21
+ function ee(_, y, a = 0, m = /* @__PURE__ */ new Set(), U = N) {
22
+ if (m.has(_)) return [];
23
+ const k = new Set(m).add(_);
24
+ return y.contentsOf(_).flatMap((b, s) => {
25
+ const r = b.type === "RECIPE", f = X(b.amount ?? N, U), g = {
26
+ key: `${a}-${s}-${b.id}`,
27
+ name: y.bindingName(b),
28
+ amount: f,
29
+ unit: y.bindingUnit(b),
30
+ depth: a,
31
+ isRecipe: r
32
+ };
33
+ return r ? [g, ...ee(b.id, y, a + 1, k, f)] : [g];
34
+ });
35
+ }
36
+ const Re = {
37
+ key: 0,
38
+ class: "flex flex-col pb-8 fm-typo-en-body-sm-400"
39
+ }, Ce = {
40
+ key: 0,
41
+ class: "flex items-center gap-4 px-12 text-fm-color-typo-secondary"
42
+ }, Ae = {
43
+ key: 1,
44
+ class: "flex flex-col text-fm-color-typo-secondary"
45
+ }, Pe = { class: "flex-1 line-clamp-1" }, Ge = {
46
+ key: 0,
47
+ class: "text-fm-color-typo-disabled"
48
+ }, $e = {
49
+ key: 2,
50
+ class: "flex gap-4 px-12 text-fm-color-system-warning-400"
51
+ }, Se = /* @__PURE__ */ H({
52
+ __name: "RecipeBindingBreakdown",
53
+ props: {
54
+ recipeId: {},
55
+ multiplier: {}
56
+ },
57
+ setup(_) {
58
+ const y = _, { t: a } = Q(), m = J(), U = {
59
+ contentsOf: (r) => {
60
+ var f;
61
+ return ((f = m.recipeById[r]) == null ? void 0 : f.contains) ?? [];
62
+ },
63
+ bindingName: (r) => {
64
+ var f, g, R;
65
+ switch (r.type) {
66
+ case "RECIPE":
67
+ return ((f = m.recipeById[r.id]) == null ? void 0 : f.name) ?? r.id;
68
+ case "SKU_GROUP":
69
+ return ((g = m.skuGroupById[r.id]) == null ? void 0 : g.name) ?? r.id;
70
+ default:
71
+ return ((R = m.skuById[r.id]) == null ? void 0 : R.name) ?? r.id;
72
+ }
73
+ },
74
+ // a binding measurement overrides the ingredient's base unit, same as deduction reads it
75
+ bindingUnit: (r) => {
76
+ var f, g;
77
+ return r.type === "RECIPE" ? "" : ((f = r.measurement) == null ? void 0 : f.abbrev) ?? ((g = m.skuById[r.id]) == null ? void 0 : g.unit.abbrev) ?? "";
78
+ }
79
+ }, k = ye(!1), b = w(() => ee(y.recipeId, U)), s = w(() => Z(y.multiplier).precision > 0);
80
+ return (r, f) => {
81
+ const g = E("FmButton"), R = E("FmIcon");
82
+ return b.value.length || s.value ? (d(), u("div", Re, [
83
+ b.value.length ? (d(), u("div", Ce, [
84
+ n("span", null, c(l(a)("inventory.inventoryBindings.itemsLinked", { count: b.value.length }, b.value.length)), 1),
85
+ p(g, {
86
+ type: "button",
87
+ variant: "plain",
88
+ icon: k.value ? "expand_less" : "expand_more",
89
+ onClick: f[0] || (f[0] = (F) => k.value = !k.value)
90
+ }, null, 8, ["icon"])
91
+ ])) : x("", !0),
92
+ k.value ? (d(), u("div", Ae, [
93
+ (d(!0), u(G, null, T(b.value, (F) => (d(), u("div", {
94
+ key: F.key,
95
+ class: "flex gap-8 py-4 px-12",
96
+ style: fe({ paddingLeft: `${12 + F.depth * 16}px` })
97
+ }, [
98
+ n("span", Pe, [
99
+ ve(c(F.name) + " ", 1),
100
+ F.isRecipe ? (d(), u("span", Ge, " (" + c(l(a)("inventory.inventoryBindings.recipe")) + ") ", 1)) : x("", !0)
101
+ ]),
102
+ n("span", null, c(l(Ue)(F.amount, r.multiplier)) + " " + c(F.unit), 1)
103
+ ], 4))), 128))
104
+ ])) : x("", !0),
105
+ s.value ? (d(), u("div", $e, [
106
+ p(R, {
107
+ name: "warning",
108
+ color: "system-warning-300",
109
+ size: "sm"
110
+ }),
111
+ n("div", null, c(l(a)("inventory.inventoryBindings.precisionWarning")), 1)
112
+ ])) : x("", !0)
113
+ ])) : x("", !0);
114
+ };
115
+ }
116
+ }), Te = { class: "flex flex-col gap-24" }, Ne = { class: "flex flex-col gap-16" }, Me = { class: "flex items-center" }, De = { class: "flex-1 fm-typo-en-title-sm-600" }, ze = { class: "flex flex-col" }, Oe = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, Ke = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Le = {
117
+ class: "flex items-center",
118
+ style: { "min-height": "48px" }
119
+ }, je = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, We = { class: "line-clamp-1" }, Ye = { class: "w-[200px]" }, qe = {
120
+ key: 0,
121
+ class: "w-[52px]"
122
+ }, He = {
123
+ key: 0,
124
+ class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400 px-8"
125
+ }, Je = {
126
+ key: 0,
127
+ class: "flex flex-col gap-16"
128
+ }, Qe = { class: "flex items-center" }, Xe = { class: "flex-1 fm-typo-en-title-sm-600" }, Ze = { class: "flex flex-col" }, en = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, nn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, on = { class: "flex flex-col w-full border-b border-fm-color-neutral-gray-100" }, tn = {
129
+ key: 0,
130
+ class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400"
131
+ }, ln = {
132
+ class: "flex items-center",
133
+ style: { "min-height": "48px" }
134
+ }, sn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, rn = { class: "flex flex-col" }, dn = { class: "w-[200px]" }, an = {
135
+ key: 0,
136
+ class: "w-[52px]"
137
+ }, un = { class: "flex flex-col gap-16" }, cn = { class: "flex items-center" }, mn = { class: "flex-1 fm-typo-en-title-sm-600" }, pn = { class: "flex flex-col" }, yn = { class: "flex py-8 px-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-100 h-[44px] items-center" }, fn = { class: "flex-1 fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, vn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary w-[150px] px-16" }, _n = {
138
+ key: 0,
139
+ class: "flex flex-col border-b border-fm-color-neutral-gray-100"
140
+ }, xn = {
141
+ class: "flex items-center w-full",
142
+ style: { "min-height": "48px" }
143
+ }, bn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12 text-fm-color-typo-secondary line-clamp-1" }, gn = {
144
+ key: 0,
145
+ class: "w-[52px]"
146
+ }, hn = { class: "flex gap-4 text-fm-color-system-error-400 fm-typo-en-body-sm-400 px-12 pb-4" }, kn = {
147
+ key: 1,
148
+ class: "flex flex-col border-b border-fm-color-neutral-gray-100"
149
+ }, Bn = {
150
+ class: "flex items-center w-full",
151
+ style: { "min-height": "48px" }
152
+ }, Vn = { class: "flex-1 fm-typo-en-body-md-400 py-8 px-12" }, In = { class: "line-clamp-1 w-full" }, wn = { class: "w-[150px]" }, Fn = {
153
+ key: 0,
154
+ class: "w-[52px]"
155
+ }, En = { class: "flex flex-col px-12 pb-4" }, Sn = /* @__PURE__ */ H({
156
+ __name: "InventoryBindingForm",
157
+ props: {
158
+ id: {},
159
+ modelValue: { default: () => [] },
160
+ excludeBindingId: {},
161
+ rules: { default: () => [] },
162
+ iframeMode: { type: Boolean },
163
+ disabled: { type: Boolean },
164
+ readonly: { type: Boolean },
165
+ enableIngredientGroup: { type: Boolean },
166
+ allowRecipeDecimal: { type: Boolean }
167
+ },
168
+ emits: ["update:modelValue", "click:pick-inventory-bindings"],
169
+ setup(_, { emit: y }) {
170
+ const { t: a } = Q(), m = J(), U = w(() => m.recipeById), k = w(() => m.skuById), b = w(() => m.skuGroupById), s = _, r = y, f = w(() => xe({
171
+ parentId: s.id,
172
+ bindings: s.modelValue,
173
+ recipes: m.recipes.map((i) => i._id === s.id ? {
174
+ ...i,
175
+ contains: s.modelValue
176
+ } : i),
177
+ skus: m.skus.map((i) => i._id === s.id ? {
178
+ ...i,
179
+ convert: {
180
+ inventoryBindings: s.modelValue
181
+ }
182
+ } : i),
183
+ skuGroups: m.skuGroups
184
+ }).inventoryBindings.filter((i) => "error" in i && i.error).map((i) => i).filter((i) => i.reason === be.enum.circularDependency)), g = w(
185
+ () => new Set(f.value.map((e) => {
186
+ var t;
187
+ return (t = e.bindingPaths[0]) == null ? void 0 : t.id;
188
+ }))
189
+ ), R = w(() => s.modelValue.filter((e) => e.type === "RECIPE")), F = { amount: 1, precision: 0 }, M = Y({});
190
+ function D(e) {
191
+ return M[e.id] ?? P(e.amount ?? F);
192
+ }
193
+ function ne(e, t) {
194
+ M[e.id] = t, L(e.id, t, s.modelValue);
195
+ }
196
+ const { promptIngredientsBinding: oe, promptRecipesBinding: te, promptIngredientGroupsBinding: ie } = Ie();
197
+ async function le() {
198
+ if (s.iframeMode) {
199
+ r("click:pick-inventory-bindings", "RECIPE");
200
+ return;
201
+ }
202
+ te(
203
+ s.modelValue,
204
+ (e) => r("update:modelValue", e),
205
+ s.id ? [s.id] : []
206
+ );
207
+ }
208
+ const se = w(() => s.modelValue.filter((e) => e.type === "SKU_GROUP"));
209
+ async function re() {
210
+ ie(
211
+ s.modelValue,
212
+ (e) => r("update:modelValue", e),
213
+ s.id ? [s.id] : []
214
+ );
215
+ }
216
+ const K = w(() => s.modelValue.filter((e) => e.type === "SKU") ?? []);
217
+ async function de() {
218
+ if (s.iframeMode) {
219
+ r("click:pick-inventory-bindings", "SKU");
220
+ return;
221
+ }
222
+ oe(
223
+ s.modelValue,
224
+ (e) => r("update:modelValue", e),
225
+ s.excludeBindingId,
226
+ s.id ? [s.id] : []
227
+ );
228
+ }
229
+ function L(e, t, i) {
230
+ const v = +t;
231
+ let I = i;
232
+ t.length > 0 && isFinite(v) ? I = i.map((B) => (B.id !== e || (B.amount = Ve(v)), B)) : I = i.map((B) => (B.id !== e || (B.amount = { amount: 0, precision: 0 }), B)), r("update:modelValue", I);
233
+ }
234
+ function $(e, t) {
235
+ delete M[e];
236
+ const i = t.filter((v) => v.id !== e);
237
+ r("update:modelValue", i);
238
+ }
239
+ function j(e) {
240
+ var i, v;
241
+ if (e.type !== ge.enum.SKU)
242
+ throw new Error("Non-SKU binding does not have unit");
243
+ if (!((i = k.value[e.id]) == null ? void 0 : i.unit))
244
+ throw new Error(`Cannot find ingredient: ${e.id}`);
245
+ return (v = k.value[e.id]) == null ? void 0 : v.unit;
246
+ }
247
+ function ae(e) {
248
+ return !k.value[e.id];
249
+ }
250
+ function ue(e) {
251
+ return { amount: e.amount, measurement: e.measurement };
252
+ }
253
+ function ce(e, t, i) {
254
+ const v = i.map((I) => I.id !== e ? I : {
255
+ ...I,
256
+ amount: t.amount,
257
+ measurement: t.measurement
258
+ });
259
+ r("update:modelValue", v);
260
+ }
261
+ const W = Y({});
262
+ function me(e) {
263
+ return W[e.id] ?? {
264
+ modelValue: {
265
+ amount: e.amount,
266
+ measurement: e.measurement
267
+ },
268
+ amountAsString: P(e.amount)
269
+ };
270
+ }
271
+ function pe(e, t) {
272
+ _e(() => {
273
+ W[e.id] = {
274
+ modelValue: {
275
+ amount: e.amount,
276
+ measurement: e.measurement
277
+ },
278
+ amountAsString: t
279
+ };
280
+ });
281
+ }
282
+ return (e, t) => {
283
+ const i = E("FmFormGroup"), v = E("FmButton"), I = E("FmTooltip"), B = E("FmTextField"), z = E("FmIcon");
284
+ return d(), u("div", Te, [
285
+ p(i, {
286
+ disabled: e.disabled,
287
+ "model-value": e.modelValue,
288
+ rules: [
289
+ ...e.rules,
290
+ () => f.value.length ? "There is a binding error in your configuration" : !0
291
+ ]
292
+ }, {
293
+ label: A(() => t[0] || (t[0] = [
294
+ n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Define the inventory bindings for this recipe or ingredient. ", -1)
295
+ ])),
296
+ _: 1
297
+ }, 8, ["disabled", "model-value", "rules"]),
298
+ n("div", Ne, [
299
+ n("div", Me, [
300
+ n("div", De, c(l(a)("inventory.inventoryBindings.recipe")), 1),
301
+ e.readonly ? x("", !0) : (d(), S(v, {
302
+ key: 0,
303
+ variant: "secondary",
304
+ "text-color": "primary",
305
+ "border-color": "primary",
306
+ label: l(a)("inventory.inventoryBindings.linkRecipe"),
307
+ "prepend-icon": "link",
308
+ onClick: le
309
+ }, null, 8, ["label"]))
310
+ ]),
311
+ n("div", ze, [
312
+ n("div", Oe, [
313
+ n("div", Ke, c(l(a)("inventory.inventoryBindings.recipe")), 1),
314
+ t[1] || (t[1] = n("div", { class: "w-[200px]" }, null, -1)),
315
+ t[2] || (t[2] = n("div", { class: "w-[52px]" }, null, -1))
316
+ ]),
317
+ (d(!0), u(G, null, T(R.value, (o) => {
318
+ var C;
319
+ return d(), u("div", {
320
+ key: o.id,
321
+ class: "flex flex-col w-full border-b border-fm-color-neutral-gray-100"
322
+ }, [
323
+ n("div", Le, [
324
+ n("div", je, [
325
+ p(I, {
326
+ zIndex: 51,
327
+ variant: "plain",
328
+ placement: "top",
329
+ content: (C = U.value[o.id]) == null ? void 0 : C.name
330
+ }, {
331
+ default: A(() => {
332
+ var V;
333
+ return [
334
+ n("span", We, c((V = U.value[o.id]) == null ? void 0 : V.name), 1)
335
+ ];
336
+ }),
337
+ _: 2
338
+ }, 1032, ["content"])
339
+ ]),
340
+ n("div", Ye, [
341
+ p(i, {
342
+ disabled: e.disabled,
343
+ modelValue: +D(o),
344
+ rules: [l(q)(e.allowRecipeDecimal ? 5 : 0), l(O)(-1)]
345
+ }, {
346
+ default: A(({ invalid: V }) => [
347
+ p(B, {
348
+ class: "w-full",
349
+ disabled: e.disabled,
350
+ modelValue: D(o),
351
+ "onUpdate:modelValue": (h) => ne(o, h),
352
+ invalid: V
353
+ }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
354
+ ]),
355
+ _: 2
356
+ }, 1032, ["disabled", "modelValue", "rules"])
357
+ ]),
358
+ e.readonly ? x("", !0) : (d(), u("div", qe, [
359
+ p(v, {
360
+ disabled: e.disabled,
361
+ type: "button",
362
+ variant: "plain",
363
+ icon: "delete",
364
+ "icon-color": "#000000",
365
+ onClick: (V) => $(o.id, e.modelValue)
366
+ }, null, 8, ["disabled", "onClick"])
367
+ ]))
368
+ ]),
369
+ p(Se, {
370
+ "recipe-id": o.id,
371
+ multiplier: D(o)
372
+ }, null, 8, ["recipe-id", "multiplier"]),
373
+ g.value.has(o.id) ? (d(), u("div", He, [
374
+ p(z, {
375
+ name: "error",
376
+ color: "system-error-300",
377
+ size: "sm"
378
+ }),
379
+ n("div", null, c(l(a)("inventory.inventoryBindings.circularError")), 1)
380
+ ])) : x("", !0)
381
+ ]);
382
+ }), 128))
383
+ ])
384
+ ]),
385
+ e.enableIngredientGroup ? (d(), u("div", Je, [
386
+ n("div", Qe, [
387
+ n("div", Xe, c(l(a)("inventory.inventoryBindings.ingredientGroup")), 1),
388
+ e.readonly ? x("", !0) : (d(), S(v, {
389
+ key: 0,
390
+ variant: "secondary",
391
+ "text-color": "primary",
392
+ "border-color": "primary",
393
+ label: l(a)("inventory.inventoryBindings.linkIngredientGroup"),
394
+ "prepend-icon": "link",
395
+ onClick: re
396
+ }, null, 8, ["label"]))
397
+ ]),
398
+ n("div", Ze, [
399
+ n("div", en, [
400
+ n("div", nn, c(l(a)("inventory.inventoryBindings.ingredientGroup")), 1),
401
+ t[3] || (t[3] = n("div", { class: "w-[200px]" }, null, -1)),
402
+ t[4] || (t[4] = n("div", { class: "w-[52px]" }, null, -1))
403
+ ]),
404
+ (d(!0), u(G, null, T(se.value, (o) => (d(), S(i, {
405
+ key: o.id,
406
+ disabled: e.disabled,
407
+ modelValue: +l(P)(o.amount ?? { amount: 1, precision: 0 }),
408
+ rules: [l(q)(0), l(O)(0)]
409
+ }, {
410
+ default: A(({ invalid: C }) => {
411
+ var V;
412
+ return [
413
+ n("div", on, [
414
+ g.value.has(o.id) ? (d(), u("div", tn, [
415
+ p(z, {
416
+ name: "error",
417
+ color: "system-error-300",
418
+ size: "sm"
419
+ }),
420
+ n("div", null, c(l(a)("inventory.inventoryBindings.circularError")), 1)
421
+ ])) : x("", !0),
422
+ n("div", ln, [
423
+ n("div", sn, [
424
+ n("div", rn, c((V = b.value[o.id]) == null ? void 0 : V.name), 1)
425
+ ]),
426
+ n("div", dn, [
427
+ p(B, {
428
+ class: "w-full",
429
+ disabled: e.disabled,
430
+ modelValue: +l(P)(o.amount ?? { amount: 1, precision: 0 }),
431
+ "onUpdate:modelValue": (h) => L(o.id, h, e.modelValue),
432
+ invalid: C
433
+ }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"])
434
+ ]),
435
+ e.readonly ? x("", !0) : (d(), u("div", an, [
436
+ p(v, {
437
+ disabled: e.disabled,
438
+ type: "button",
439
+ variant: "plain",
440
+ icon: "delete",
441
+ "icon-color": "#000000",
442
+ onClick: (h) => $(o.id, e.modelValue)
443
+ }, null, 8, ["disabled", "onClick"])
444
+ ]))
445
+ ])
446
+ ])
447
+ ];
448
+ }),
449
+ _: 2
450
+ }, 1032, ["disabled", "modelValue", "rules"]))), 128))
451
+ ])
452
+ ])) : x("", !0),
453
+ n("div", un, [
454
+ n("div", cn, [
455
+ n("div", mn, c(l(a)("inventory.inventoryBindings.ingredient")), 1),
456
+ e.readonly ? x("", !0) : (d(), S(v, {
457
+ key: 0,
458
+ variant: "secondary",
459
+ "text-color": "primary",
460
+ "border-color": "primary",
461
+ label: l(a)("inventory.inventoryBindings.linkIngredient"),
462
+ "prepend-icon": "link",
463
+ onClick: de
464
+ }, null, 8, ["label"]))
465
+ ]),
466
+ n("div", pn, [
467
+ n("div", yn, [
468
+ n("div", fn, c(l(a)("inventory.inventoryBindings.ingredient")), 1),
469
+ n("div", vn, c(l(a)("inventory.inventoryBindings.amount")), 1),
470
+ t[5] || (t[5] = n("div", { class: "w-[52px]" }, null, -1))
471
+ ]),
472
+ (d(!0), u(G, null, T(K.value, (o, C) => {
473
+ var V;
474
+ return d(), u(G, {
475
+ key: o.id
476
+ }, [
477
+ ae(o) ? (d(), u("div", _n, [
478
+ n("div", xn, [
479
+ n("div", bn, c(o.id), 1),
480
+ e.readonly ? x("", !0) : (d(), u("div", gn, [
481
+ p(v, {
482
+ disabled: e.disabled,
483
+ type: "button",
484
+ variant: "tertiary",
485
+ icon: "delete",
486
+ onClick: (h) => $(o.id, e.modelValue)
487
+ }, null, 8, ["disabled", "onClick"])
488
+ ]))
489
+ ]),
490
+ n("div", hn, [
491
+ p(z, {
492
+ name: "error",
493
+ color: "system-error-300",
494
+ size: "sm"
495
+ }),
496
+ n("div", null, c(l(a)("inventory.inventoryBindings.missingIngredient")), 1)
497
+ ])
498
+ ])) : (d(), u("div", kn, [
499
+ n("div", Bn, [
500
+ n("div", Vn, [
501
+ p(I, {
502
+ zIndex: 51,
503
+ variant: "plain",
504
+ placement: "top",
505
+ content: (V = k.value[o.id]) == null ? void 0 : V.name
506
+ }, {
507
+ default: A(() => {
508
+ var h;
509
+ return [
510
+ n("span", In, c((h = k.value[o.id]) == null ? void 0 : h.name), 1)
511
+ ];
512
+ }),
513
+ _: 2
514
+ }, 1032, ["content"])
515
+ ]),
516
+ n("div", wn, [
517
+ p(we, {
518
+ "model-value": ue(o),
519
+ "onUpdate:modelValue": (h) => h && ce(o.id, h, e.modelValue),
520
+ "onUpdate:amount": (h) => pe(o, h),
521
+ unit: j(o),
522
+ placement: C === K.value.length - 1 ? "top" : "bottom",
523
+ "convert-amount-on-change-unit": "",
524
+ disabled: e.readonly
525
+ }, null, 8, ["model-value", "onUpdate:modelValue", "onUpdate:amount", "unit", "placement", "disabled"])
526
+ ]),
527
+ e.readonly ? x("", !0) : (d(), u("div", Fn, [
528
+ p(v, {
529
+ disabled: e.disabled,
530
+ type: "button",
531
+ variant: "tertiary",
532
+ icon: "delete",
533
+ onClick: (h) => $(o.id, e.modelValue)
534
+ }, null, 8, ["disabled", "onClick"])
535
+ ]))
536
+ ]),
537
+ n("div", En, [
538
+ p(i, {
539
+ modelValue: +l(P)(o.amount ?? { amount: 1, precision: 0 }),
540
+ rules: [l(O)(0)]
541
+ }, null, 8, ["modelValue", "rules"]),
542
+ p(i, {
543
+ modelValue: me(o),
544
+ rules: [
545
+ l(Fe)(),
546
+ l(Ee)(j(o)),
547
+ () => g.value.has(o.id) ? l(a)("inventory.inventoryBindings.invalidWarning") : !0
548
+ ]
549
+ }, null, 8, ["modelValue", "rules"])
550
+ ])
551
+ ]))
552
+ ], 64);
553
+ }), 128))
554
+ ])
555
+ ])
556
+ ]);
557
+ };
558
+ }
559
+ });
560
+ export {
561
+ Sn as _,
562
+ Se as a
563
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as l, resolveComponent as m, createBlock as c, openBlock as d, h as g } from "vue";
2
2
  import { useI18n as p } from "@feedmepos/mf-common";
3
3
  import { components as u } from "@feedmepos/ui-library";
4
- import { F as r } from "./app-BI1fLJ8H.js";
4
+ import { F as r } from "./app-BIXJtvvD.js";
5
5
  const w = /* @__PURE__ */ l({
6
6
  __name: "InventoryBindingSummary",
7
7
  props: {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as V, computed as w, ref as h, watch as u, resolveComponent as i, createBlock as F, openBlock as g, withCtx as d, createVNode as A, createElementVNode as k, normalizeClass as K } from "vue";
2
- import { c as s } from "./number-BzmDQm_s.js";
2
+ import { c as s } from "./number-CxbQxQwj.js";
3
3
  const _ = ["value", "disabled"], C = /* @__PURE__ */ V({
4
4
  __name: "NumberPrecisionInput",
5
5
  props: {
@@ -1,4 +1,4 @@
1
- import { d as F, u as f } from "./app-BI1fLJ8H.js";
1
+ import { d as F, u as f } from "./app-BIXJtvvD.js";
2
2
  import { useCoreStore as v } from "@feedmepos/mf-common";
3
3
  import { ref as _, defineComponent as h, resolveComponent as l, createElementBlock as y, openBlock as g, renderSlot as k, createVNode as p, withCtx as S } from "vue";
4
4
  const m = F((e, t) => {
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as ce, ref as F, createElementBlock as c, openBlock as r, createElementVNode as t, createBlock as V, createTextVNode as G, toDisplayString as a, normalizeClass as ue, Teleport as Ce, createCommentVNode as P, Fragment as q, normalizeStyle as $e, renderList as U, computed as _, watch as ie, resolveComponent as j, withCtx as K, createVNode as M, onMounted as Se, h as E, reactive as Ie, withDirectives as Fe, vModelText as De, unref as Ne } from "vue";
2
2
  import { _ as Te } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
3
3
  import { useDialog as ve, useSnackbar as ge, components as se } from "@feedmepos/ui-library";
4
- import { d as Be, u as be, a as xe } from "./app-BI1fLJ8H.js";
5
- import { _ as Ee } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-YMRGpkS4.js";
4
+ import { d as Be, u as be, a as xe } from "./app-BIXJtvvD.js";
5
+ import { _ as Ee } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Cct8Ko19.js";
6
6
  import { useI18n as Ae } from "@feedmepos/mf-common";
7
- import { c as ke } from "./inventory-core-dart.default-ClRRaGtG.js";
8
- import { u as Pe } from "./stock-HCSCwSH0.js";
9
- import { a as Re } from "./FmMultiselectDialog-C-kDJtv_.js";
10
- import { e as qe, _ as Me } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-Mo-hF_cA.js";
11
- import { u as Le } from "./stock-D8M5e53w.js";
7
+ import { c as ke } from "./inventory-core-dart.default-Cj7CxnpK.js";
8
+ import { u as Pe } from "./stock-BiqEgcgU.js";
9
+ import { a as Re } from "./FmMultiselectDialog-Dt54hvqw.js";
10
+ import { e as qe, _ as Me } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-DtG9Ieo_.js";
11
+ import { u as Le } from "./stock-BdDR_L8p.js";
12
12
  const he = Be((Q, w) => {
13
13
  const y = be(), u = () => `${Q.inventoryBackendUrl}/${y.currentLocationDBName}/production`;
14
14
  return {
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as D, ref as A, computed as s, watch as H, resolveComponent as c, createBlock as S, openBlock as x, unref as l, createSlots as Y, withCtx as h, createElementVNode as N, normalizeClass as U, createVNode as m, normalizeStyle as $, Teleport as q, h as p } from "vue";
2
- import { u as E, a as K, x as j } from "./app-BI1fLJ8H.js";
2
+ import { u as E, a as K, x as j } from "./app-BIXJtvvD.js";
3
3
  import { u as G, _ as J } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
4
4
  import { useBreakpoints as O, useDialog as Q, useSnackbar as R, components as I } from "@feedmepos/ui-library";
5
- import { u as X } from "./vue-i18n-BSfpVmaF.js";
6
- import { b as k } from "./date2-paxg81i_.js";
5
+ import { u as X } from "./vue-i18n-yL99yI4f.js";
6
+ import { b as k } from "./date2-DbYQycSa.js";
7
7
  const se = /* @__PURE__ */ D({
8
8
  __name: "PublishView",
9
9
  setup(Z) {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as b, computed as x, ref as f, onMounted as g, createElementBlock as n, openBlock as o, createElementVNode as t, toDisplayString as e, normalizeStyle as w, createTextVNode as u, createCommentVNode as v, Fragment as i, renderList as p } from "vue";
2
2
  import { useRoute as k } from "vue-router";
3
- import { T as y } from "./app-BI1fLJ8H.js";
4
- import { L as C } from "./lz-string-CAl-OrXa.js";
3
+ import { T as y } from "./app-BIXJtvvD.js";
4
+ import { L as C } from "./lz-string-DWkGPESZ.js";
5
5
  import { _ as N } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const R = { class: "purchase-box" }, A = { valign: "bottom" }, E = { class: "title" }, P = { class: "text-right" }, D = { class: "header" }, O = { class: "sub-header" }, S = { class: "caption" }, T = { class: "address" }, F = { class: "text-right" }, L = {
7
7
  key: 0,