@feedmepos/mf-inventory-portal 0.0.19-dev.9 → 0.0.20-dev.1
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.vue.d.ts +1 -1
- package/dist/{ApprovalView-Bcxk6B7K.js → ApprovalView-CF-RhtHH.js} +5 -5
- package/dist/{BindingsDialog-XDkcjW_c.js → BindingsDialog-0_fCmf7t.js} +26 -26
- package/dist/{BindingsPicker-CgbiqX72.js → BindingsPicker-CT-56t-W.js} +17 -17
- package/dist/BindingsTable-DEftAnTN.js +120 -0
- package/dist/Entry.vue.d.ts +1 -1
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-6yg6_JPe.js +308 -0
- package/dist/IngredientsView-Au6oRwF2.js +1663 -0
- package/dist/{IntegrationView-CErHEVAO.js → IntegrationView-D7hqf0P5.js} +278 -278
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-XXoPyhlc.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-HcOKpAlW.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BpyUheXn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BTOE1vFl.js} +1 -1
- package/dist/PurchaseOrderPrintPreview-C92PdleC.js +152 -0
- package/dist/{ReceiveRequestView-BKbeFDxm.js → ReceiveRequestView-BaxEQWOD.js} +8 -8
- package/dist/{RecipeView-Drp4l4gL.js → RecipeView-CDgZpLPk.js} +181 -181
- package/dist/Standalone.vue.d.ts +1 -1
- package/dist/{StockView-Cj6fErwD.js → StockView-B77CrARl.js} +498 -502
- package/dist/SupplierView-DQ3hB7q2.js +819 -0
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-lsyakQIl.js +738 -0
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-DN7NCT72.js +1435 -0
- package/dist/TransferTemplateView-Dt04xMCK.js +1290 -0
- package/dist/{UnitView-C_tAxIpq.js → UnitView-DlmlVNOx.js} +242 -242
- package/dist/{WarehouseView-BAqVtbD6.js → WarehouseView-DXWls5vv.js} +360 -362
- package/dist/api/bill.d.ts +238 -84
- package/dist/api/inventory.d.ts +3 -3
- package/dist/api/purchase-order-template.d.ts +4 -0
- package/dist/api/stock.d.ts +0 -8
- package/dist/api/supplier.d.ts +2 -0
- package/dist/app-P7rGzGsF.js +68600 -0
- package/dist/app.d.ts +200 -7
- package/dist/app.js +3 -3
- package/dist/{array-AvWd53LI.js → array-ClJzD_Lt.js} +3 -3
- package/dist/components/ChangeLocationComponent.vue.d.ts +14 -1
- package/dist/components/DeferableLoading.vue.d.ts +1 -1
- package/dist/components/DeleteDialog.vue.d.ts +1 -1
- package/dist/components/FmCoordinateInput.vue.d.ts +3 -3
- package/dist/components/FmDroppableField.vue.d.ts +6 -6
- package/dist/components/FmFilterableSelect.vue.d.ts +3 -3
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +19 -10
- package/dist/components/FmMinMaxInput.vue.d.ts +20 -0
- package/dist/components/FmMinMaxInputProps.d.ts +16 -0
- package/dist/components/FmMinMaxInputRules.d.ts +4 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +5 -5
- package/dist/components/FmMultiselectDialogProps.d.ts +14 -1
- package/dist/components/FmUnitInputRules.d.ts +1 -0
- package/dist/components/MultiSelectDialog.vue.d.ts +1 -1
- package/dist/components/NavigationTab.vue.d.ts +1 -1
- package/dist/components/NumberPrecisionInput.vue.d.ts +3 -3
- package/dist/components/PremiumBadge.vue.d.ts +3 -3
- package/dist/components/PreviewBadge.vue.d.ts +3 -3
- package/dist/components/StockForecast.vue.d.ts +1 -1
- package/dist/components/TableActionableRow.vue.d.ts +4 -4
- package/dist/components/UnitDisplayControl.vue.d.ts +1 -1
- package/dist/components/icons/IconCommunity.vue.d.ts +1 -1
- package/dist/components/icons/IconDocumentation.vue.d.ts +1 -1
- package/dist/components/icons/IconEcosystem.vue.d.ts +1 -1
- package/dist/components/icons/IconSupport.vue.d.ts +1 -1
- package/dist/components/icons/IconTooling.vue.d.ts +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +6 -6
- package/dist/components/map/CoordinateDialog.vue.d.ts +4 -4
- package/dist/components/map/GoogleMap.vue.d.ts +6 -6
- package/dist/components/nested-multiselect/FmNestedMultiselectDialog.vue.d.ts +3 -3
- package/dist/components/row-action.enum.d.ts +3 -1
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +3 -3
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +6 -6
- package/dist/components/ui-library/FmDateRangePickerChip.vue.d.ts +5 -5
- package/dist/composable/useIframe.d.ts +1 -1
- package/dist/composable/useSearch.d.ts +1 -1
- package/dist/{decimal-D3KXLC4T.js → decimal-4ONRlhOO.js} +1 -1
- package/dist/format-unit-display-DJpElzu_.js +707 -0
- package/dist/helper/number.d.ts +2 -0
- package/dist/{id-to-date-Cj02m808.js → id-to-date-D8Ey2CVj.js} +1 -1
- package/dist/is-linked-ingredient-error-fJ2TJb3z.js +37 -0
- package/dist/layout/InventoryLayout.vue.d.ts +1 -1
- package/dist/layout/SingleColumnLayout.vue.d.ts +6 -5
- package/dist/layout/components/NavigationButton.vue.d.ts +4 -4
- package/dist/layout-D-zXtsSp.js +151 -0
- package/dist/row-action.enum-PMKMRrZR.js +50 -0
- package/dist/stores/feature.d.ts +5 -1
- package/dist/stores/inventory.d.ts +4 -4
- package/dist/stores/location.d.ts +185 -152
- package/dist/stores/supplier.d.ts +666 -12
- package/dist/stores/warehouse.d.ts +17 -5
- package/dist/supplier-DsUIjl-L.js +69 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/InventoryView.vue.d.ts +1 -1
- package/dist/views/SelectBussinessDialog.vue.d.ts +1 -1
- package/dist/views/approval/ApprovalView.vue.d.ts +1 -1
- package/dist/views/dev/ComponentPreview.vue.d.ts +1 -1
- package/dist/views/dev/components/CoordinateTest.vue.d.ts +1 -1
- package/dist/views/dev/components/DateRange.vue.d.ts +1 -1
- package/dist/views/dev/components/FmDecimalInputTest.vue.d.ts +1 -1
- package/dist/views/dev/components/FmMultiselectDialogGrouped.vue.d.ts +2 -0
- package/dist/views/dev/components/FmSelectTest.vue.d.ts +1 -1
- package/dist/views/dev/components/InventoryIframe.vue.d.ts +1 -1
- package/dist/views/dev/components/LayoutDev.vue.d.ts +1 -1
- package/dist/views/dev/components/MfCommontTest.vue.d.ts +1 -1
- package/dist/views/dev/components/NestedSelection.vue.d.ts +1 -1
- package/dist/views/dev/components/NumberStepper.vue.d.ts +1 -1
- package/dist/views/dev/components/TabStorageTest.vue.d.ts +1 -1
- package/dist/views/dev/components/UnitInput.vue.d.ts +1 -1
- package/dist/views/dev/helpers/pinia-test.d.ts +1 -1
- package/dist/views/home/HomeView.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-dialog/BindingsDialog.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-picker/BindingsPicker.vue.d.ts +1 -1
- package/dist/views/iframe/inventory-bindings/bindings-table/BindingsTable.vue.d.ts +1 -1
- package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -1
- package/dist/views/ingredients/components/cannot-delete/CannotDelete.vue.d.ts +4 -4
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +3 -3
- package/dist/views/ingredients/components/import-ingredients/ImportIngredientItem.vue.d.ts +1 -1
- package/dist/views/ingredients/components/import-ingredients/ImportIngredients.vue.d.ts +1 -1
- package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItem.vue.d.ts +1 -1
- package/dist/views/ingredients/components/ingredient-dialog/IngredientDialog.vue.d.ts +5 -5
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +6 -6
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +5 -5
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingSummary.vue.d.ts +3 -3
- package/dist/views/ingredients/composables/use-ingredient-form.d.ts +8 -8
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
- package/dist/views/integration/IntegrationView.vue.d.ts +1 -1
- package/dist/views/integration/components/ApplyAddon.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProduct.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +5 -5
- package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +5 -5
- package/dist/views/receive-request/ReceiveRequestView.vue.d.ts +1 -1
- package/dist/views/receive-request/components/select-template-dialog/SelectTemplateDialog.vue.d.ts +8 -0
- package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistory.vue.d.ts +1 -1
- package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-dialog/TransferDialog.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +1 -1
- package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +34 -32
- package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +8 -2
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +6 -6
- package/dist/views/receive-request/components/transfer-form/components/TransferItem.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/composables/use-backdate-po.d.ts +4 -4
- package/dist/views/receive-request/components/transfer-form/composables/use-compare-price.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -9
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1016 -70
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +36 -36
- package/dist/views/receive-request/print-preview/PurchaseOrderPrintPreview.vue.d.ts +1 -1
- package/dist/views/recipe/RecipeView.vue.d.ts +1 -1
- package/dist/views/recipe/components/recipe-dialog/RecipeDialog.vue.d.ts +5 -5
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +4 -4
- package/dist/views/recipe/composables/use-recipe-form.d.ts +8 -8
- package/dist/views/stock/StockView.vue.d.ts +1 -1
- package/dist/views/stock/components/StockHeaderPreview.vue.d.ts +1 -1
- package/dist/views/stock/components/StockHistory.vue.d.ts +3 -3
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +123 -46
- package/dist/views/stock/components/dialog/AdjustSkuDialog.vue.d.ts +4 -4
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +5 -5
- package/dist/views/stock/components/dialog/ConvertSkuDialog.vue.d.ts +4 -4
- package/dist/views/stock/composables/use-stock-action.d.ts +11 -11
- package/dist/views/stock/helper/stock-row-action.d.ts +4 -2
- package/dist/views/supplier/SupplierView.vue.d.ts +1 -1
- package/dist/views/supplier/components/SupplierDialog.vue.d.ts +4 -4
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +10 -10
- package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +3 -3
- package/dist/views/supplier/composables/use-supplier-table.d.ts +3 -3
- package/dist/views/transfer-template/TransferTemplateView.vue.d.ts +1 -1
- package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +20 -0
- package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetailsProps.d.ts +9 -0
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +4 -4
- package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateForm.vue.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +3 -3
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +7 -7
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +15 -9
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1428 -43
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +893 -13
- package/dist/views/unit/UnitView.vue.d.ts +1 -1
- package/dist/views/unit/components/unit-dialog/UnitDialog.vue.d.ts +5 -5
- package/dist/views/unit/components/unit-form/UnitForm.vue.d.ts +4 -4
- package/dist/views/unit/components/unit-summary/UnitSummary.vue.d.ts +3 -3
- package/dist/views/unit/components/unit-used-by/UnitUsedBy.vue.d.ts +1 -1
- package/dist/views/unit/composables/use-unit-form.d.ts +8 -8
- package/dist/views/warehouse/WarehouseView.vue.d.ts +1 -1
- package/dist/views/warehouse/components/WarehouseDialog.vue.d.ts +4 -4
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +38 -14
- package/dist/{xlsx-B-2KyDJq.js → xlsx-zfERRe6K.js} +3383 -3383
- package/dist/{xlsx.util-D6EzRE71.js → xlsx.util-DnbiJzsk.js} +4 -4
- package/package.json +6 -5
- package/dist/BindingsTable-xNXNsBAd.js +0 -145
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DFPkUHl-.js +0 -272
- package/dist/IngredientsView-DD7ns3mP.js +0 -1751
- package/dist/PurchaseOrderPrintPreview-L_iaaURb.js +0 -152
- package/dist/SupplierView-EFsHWet-.js +0 -801
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-kM5fyqq6.js +0 -745
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-CyFMCmXw.js +0 -1605
- package/dist/TransferTemplateView-Cymhrayh.js +0 -933
- package/dist/app-CeUU5Gd8.js +0 -66938
- package/dist/is-linked-ingredient-error-C6AghEwR.js +0 -37
- package/dist/layout-2zzAZIVO.js +0 -147
- package/dist/purchase-order-transaction-type-Dz0YF5qh.js +0 -294
- package/dist/row-action.enum-7jVyol1k.js +0 -36
- package/dist/supplier-mDVKd7Ge.js +0 -54
- package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +0 -9
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
import { defineComponent as H, computed as
|
|
2
|
-
import { u as K, S as ue, c as
|
|
3
|
-
import { useDialog as fe, useSnackbar as
|
|
4
|
-
import { i as ye, _ as be } from "./is-linked-ingredient-error-
|
|
5
|
-
import { F as
|
|
6
|
-
import { defineStore as
|
|
7
|
-
import { c as
|
|
1
|
+
import { defineComponent as H, computed as V, openBlock as v, createElementBlock as k, createElementVNode as l, Fragment as N, renderList as q, toDisplayString as h, createCommentVNode as O, ref as R, resolveComponent as E, createBlock as T, withCtx as I, createVNode as y, unref as a, isRef as X, normalizeStyle as se, Teleport as ae, normalizeProps as re, guardReactiveProps as ie } from "vue";
|
|
2
|
+
import { u as K, S as ue, c as ne, R as z, A as de, a as Y, l as me, m as ce, e as Z, j as pe } from "./app-P7rGzGsF.js";
|
|
3
|
+
import { useDialog as fe, useSnackbar as oe, useProxiedModel as ee, useBreakpoints as ve } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as ye, _ as be } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { F as w, D as te, R as j } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { defineStore as ge, storeToRefs as xe } from "pinia";
|
|
7
|
+
import { c as _e, _ as he, F as Ve, u as Ue } from "./layout-D-zXtsSp.js";
|
|
8
8
|
import { useI18n as G } from "@feedmepos/mf-common";
|
|
9
|
-
import { _ as we, a as Ce } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { F as ke } from "./decimal-
|
|
11
|
-
import { _ as Fe } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
const Se = { class: "flex flex-col gap-8" }, $e =
|
|
9
|
+
import { _ as we, a as Ce } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-6yg6_JPe.js";
|
|
10
|
+
import { F as ke } from "./decimal-4ONRlhOO.js";
|
|
11
|
+
import { _ as Fe } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-HcOKpAlW.js";
|
|
12
|
+
const Se = { class: "flex flex-col gap-8" }, $e = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "flex flex-col"
|
|
15
|
-
},
|
|
16
|
-
/* @__PURE__ */ s("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
|
|
17
|
-
/* @__PURE__ */ s("div", {
|
|
18
|
-
class: "flex-0 py-8 px-16",
|
|
19
|
-
style: { "flex-basis": "240px" }
|
|
20
|
-
}, "Used in")
|
|
21
|
-
], -1), De = { class: "flex-1 py-8 px-16" }, Ae = {
|
|
15
|
+
}, Ee = { class: "flex-1 py-8 px-16" }, Ie = {
|
|
22
16
|
class: "flex-0 py-8 px-16",
|
|
23
17
|
style: { "flex-basis": "240px" }
|
|
24
|
-
},
|
|
18
|
+
}, De = {
|
|
25
19
|
key: 1,
|
|
26
20
|
class: "flex flex-col"
|
|
27
|
-
},
|
|
28
|
-
/* @__PURE__ */ s("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
|
|
29
|
-
/* @__PURE__ */ s("div", {
|
|
30
|
-
class: "flex-0 py-8 px-16",
|
|
31
|
-
style: { "flex-basis": "240px" }
|
|
32
|
-
}, "Used in")
|
|
33
|
-
], -1), Pe = { class: "flex-1 py-8 px-16" }, Te = {
|
|
21
|
+
}, Ae = { class: "flex-1 py-8 px-16" }, Re = {
|
|
34
22
|
class: "flex-0 py-8 px-16",
|
|
35
23
|
style: { "flex-basis": "240px" }
|
|
36
|
-
},
|
|
24
|
+
}, Me = {
|
|
37
25
|
key: 2,
|
|
38
26
|
class: "flex flex-col"
|
|
39
|
-
},
|
|
40
|
-
/* @__PURE__ */ s("div", { class: "flex-1 py-8 px-16" }, "Menu"),
|
|
41
|
-
/* @__PURE__ */ s("div", {
|
|
42
|
-
class: "flex-0 py-8 px-16",
|
|
43
|
-
style: { "flex-basis": "240px" }
|
|
44
|
-
}, "Used in")
|
|
45
|
-
], -1), ze = { class: "flex-1 py-8 px-16" }, je = {
|
|
27
|
+
}, Pe = { class: "flex-1 py-8 px-16" }, Te = {
|
|
46
28
|
class: "flex-0 py-8 px-16",
|
|
47
29
|
style: { "flex-basis": "240px" }
|
|
48
|
-
},
|
|
30
|
+
}, Be = /* @__PURE__ */ H({
|
|
49
31
|
__name: "UnitUsedBy",
|
|
50
32
|
props: {
|
|
51
33
|
unit: {}
|
|
52
34
|
},
|
|
53
35
|
setup(S) {
|
|
54
|
-
const
|
|
55
|
-
return (c,
|
|
56
|
-
|
|
57
|
-
r.value.length ? (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
36
|
+
const f = S, b = K(), i = V(() => b.validateUnitUsage(f.unit)), r = V(() => i.value.filter((c) => c.from === "INGREDIENT")), o = V(() => i.value.filter((c) => c.from === "RECIPE")), m = V(() => i.value.filter((c) => c.from === "MENU"));
|
|
37
|
+
return (c, p) => (v(), k("div", Se, [
|
|
38
|
+
p[3] || (p[3] = l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1)),
|
|
39
|
+
r.value.length ? (v(), k("div", $e, [
|
|
40
|
+
p[0] || (p[0] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
|
|
41
|
+
l("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
|
|
42
|
+
l("div", {
|
|
43
|
+
class: "flex-0 py-8 px-16",
|
|
44
|
+
style: { "flex-basis": "240px" }
|
|
45
|
+
}, "Used in")
|
|
46
|
+
], -1)),
|
|
47
|
+
(v(!0), k(N, null, q(r.value, (s) => {
|
|
48
|
+
var n;
|
|
49
|
+
return v(), k("div", {
|
|
50
|
+
key: s.code,
|
|
63
51
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
64
52
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
l("div", Ee, h(s.code) + " " + h(s.name), 1),
|
|
54
|
+
l("div", Ie, h((n = s.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
|
|
67
55
|
]);
|
|
68
56
|
}), 128))
|
|
69
57
|
])) : O("", !0),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
o.value.length ? (v(), k("div", De, [
|
|
59
|
+
p[1] || (p[1] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
|
|
60
|
+
l("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
|
|
61
|
+
l("div", {
|
|
62
|
+
class: "flex-0 py-8 px-16",
|
|
63
|
+
style: { "flex-basis": "240px" }
|
|
64
|
+
}, "Used in")
|
|
65
|
+
], -1)),
|
|
66
|
+
(v(!0), k(N, null, q(o.value, (s) => {
|
|
67
|
+
var n, u, g;
|
|
68
|
+
return v(), k("div", {
|
|
69
|
+
key: s.code,
|
|
76
70
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
77
71
|
}, [
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
l("div", Ae, h(s.code) + " " + h(s.name), 1),
|
|
73
|
+
l("div", Re, h((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((U) => U.code).join(", ")) + " " + h(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
|
|
80
74
|
]);
|
|
81
75
|
}), 128))
|
|
82
76
|
])) : O("", !0),
|
|
83
|
-
m.value.length ? (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
m.value.length ? (v(), k("div", Me, [
|
|
78
|
+
p[2] || (p[2] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
|
|
79
|
+
l("div", { class: "flex-1 py-8 px-16" }, "Menu"),
|
|
80
|
+
l("div", {
|
|
81
|
+
class: "flex-0 py-8 px-16",
|
|
82
|
+
style: { "flex-basis": "240px" }
|
|
83
|
+
}, "Used in")
|
|
84
|
+
], -1)),
|
|
85
|
+
(v(!0), k(N, null, q(m.value, (s) => {
|
|
86
|
+
var n, u, g;
|
|
87
|
+
return v(), k("div", {
|
|
88
|
+
key: s.code,
|
|
89
89
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
90
90
|
}, [
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
l("div", Pe, h(s.code) + " " + h(s.name), 1),
|
|
92
|
+
l("div", Te, h((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((U) => U.code).join(", ")) + " " + h(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
|
|
93
93
|
]);
|
|
94
94
|
}), 128))
|
|
95
95
|
])) : O("", !0)
|
|
96
96
|
]));
|
|
97
97
|
}
|
|
98
|
-
}), J =
|
|
99
|
-
const
|
|
98
|
+
}), J = ge("unitForm", function() {
|
|
99
|
+
const f = fe(), b = oe(), i = K(), r = R(!1), o = R();
|
|
100
100
|
function m() {
|
|
101
|
-
const
|
|
101
|
+
const n = {
|
|
102
102
|
unit: {},
|
|
103
|
-
mode:
|
|
103
|
+
mode: w.CREATE,
|
|
104
104
|
show: !0,
|
|
105
105
|
"onUpdate:show"(u) {
|
|
106
|
-
|
|
106
|
+
o.value.show = u;
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
|
-
|
|
109
|
+
o.value = n;
|
|
110
110
|
}
|
|
111
|
-
async function c(
|
|
111
|
+
async function c(n) {
|
|
112
112
|
const u = {
|
|
113
|
-
unit:
|
|
114
|
-
mode:
|
|
113
|
+
unit: n,
|
|
114
|
+
mode: w.UPDATE,
|
|
115
115
|
show: !0,
|
|
116
|
-
"onUpdate:show"(
|
|
117
|
-
|
|
116
|
+
"onUpdate:show"(g) {
|
|
117
|
+
o.value.show = g;
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
|
|
120
|
+
o.value = u;
|
|
121
121
|
}
|
|
122
|
-
async function
|
|
122
|
+
async function p(n) {
|
|
123
123
|
r.value = !0;
|
|
124
124
|
try {
|
|
125
|
-
await i.deleteUnit(
|
|
125
|
+
await i.deleteUnit(n), b.open({
|
|
126
126
|
title: "Success",
|
|
127
|
-
message: `Deleted ${
|
|
127
|
+
message: `Deleted ${n.name}`,
|
|
128
128
|
type: "success"
|
|
129
129
|
});
|
|
130
130
|
} catch (u) {
|
|
131
|
-
u instanceof ue && ye(u) ?
|
|
131
|
+
u instanceof ue && ye(u) ? f.open({
|
|
132
132
|
title: "Cannot delete unit",
|
|
133
133
|
contentComponent: be,
|
|
134
134
|
contentComponentProps: {
|
|
135
|
-
subject: (
|
|
135
|
+
subject: (n == null ? void 0 : n.name) ?? "",
|
|
136
136
|
items: u.errorResponse.message
|
|
137
137
|
},
|
|
138
138
|
secondaryActions: {
|
|
139
139
|
text: "Close",
|
|
140
140
|
close: !0
|
|
141
141
|
}
|
|
142
|
-
}) : console.log("unable to delete unit", u),
|
|
143
|
-
title: `Cannot delete ${
|
|
142
|
+
}) : console.log("unable to delete unit", u), b.open({
|
|
143
|
+
title: `Cannot delete ${n.name}`,
|
|
144
144
|
message: "Please try again.",
|
|
145
145
|
type: "error"
|
|
146
146
|
}), console.error("failed to delete unit", u);
|
|
@@ -148,16 +148,16 @@ const Se = { class: "flex flex-col gap-8" }, $e = /* @__PURE__ */ s("div", { cla
|
|
|
148
148
|
r.value = !1;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
if (i.validateUnitUsage(
|
|
153
|
-
|
|
154
|
-
title: `Cannot delete ${(
|
|
151
|
+
function s(n) {
|
|
152
|
+
if (i.validateUnitUsage(n).length) {
|
|
153
|
+
f.open({
|
|
154
|
+
title: `Cannot delete ${(n == null ? void 0 : n.name) ?? "unit"}`,
|
|
155
155
|
overlay: !0,
|
|
156
156
|
dismissAway: !0,
|
|
157
157
|
closeButton: !0,
|
|
158
|
-
contentComponent:
|
|
158
|
+
contentComponent: Be,
|
|
159
159
|
contentComponentProps: {
|
|
160
|
-
unit:
|
|
160
|
+
unit: n
|
|
161
161
|
},
|
|
162
162
|
primaryActions: {
|
|
163
163
|
text: "Confirm",
|
|
@@ -166,8 +166,8 @@ const Se = { class: "flex flex-col gap-8" }, $e = /* @__PURE__ */ s("div", { cla
|
|
|
166
166
|
});
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
title: `Delete ${(
|
|
169
|
+
f.open({
|
|
170
|
+
title: `Delete ${(n == null ? void 0 : n.name) ?? "unit"}?`,
|
|
171
171
|
closeButton: !1,
|
|
172
172
|
message: "You may not be able to delete this unit if it is linked in any of the inventory modules.",
|
|
173
173
|
primaryActions: {
|
|
@@ -179,50 +179,50 @@ const Se = { class: "flex flex-col gap-8" }, $e = /* @__PURE__ */ s("div", { cla
|
|
|
179
179
|
text: "Cancel",
|
|
180
180
|
close: !0
|
|
181
181
|
}
|
|
182
|
-
}).onPrimary(() =>
|
|
182
|
+
}).onPrimary(() => p(n));
|
|
183
183
|
}
|
|
184
184
|
return {
|
|
185
185
|
createUnit: m,
|
|
186
186
|
updateUnit: c,
|
|
187
|
-
deleteUnit:
|
|
188
|
-
unitDialogProps:
|
|
187
|
+
deleteUnit: s,
|
|
188
|
+
unitDialogProps: o,
|
|
189
189
|
unitViewLoading: r
|
|
190
190
|
};
|
|
191
191
|
});
|
|
192
|
-
function
|
|
193
|
-
const { updateUnit: S, deleteUnit:
|
|
194
|
-
async function i(
|
|
195
|
-
const c =
|
|
196
|
-
if (
|
|
192
|
+
function Le() {
|
|
193
|
+
const { updateUnit: S, deleteUnit: f } = J(), { t: b } = G();
|
|
194
|
+
async function i(o, m) {
|
|
195
|
+
const c = ne(m);
|
|
196
|
+
if (o === j.Edit) {
|
|
197
197
|
await S(c);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
201
|
-
await
|
|
200
|
+
if (o === j.Delete) {
|
|
201
|
+
await f(c);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
return { columnDefs: [
|
|
206
206
|
{
|
|
207
207
|
accessorKey: "name",
|
|
208
|
-
header:
|
|
208
|
+
header: b("inventory.unit.table.name"),
|
|
209
209
|
enableSorting: !0,
|
|
210
210
|
size: 300
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
accessorKey: "abbrev",
|
|
214
|
-
header:
|
|
214
|
+
header: b("inventory.unit.table.symbol"),
|
|
215
215
|
enableSorting: !1,
|
|
216
216
|
size: "auto"
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
id: "action",
|
|
220
220
|
header: "",
|
|
221
|
-
cell(
|
|
222
|
-
return
|
|
221
|
+
cell(o) {
|
|
222
|
+
return _e(
|
|
223
223
|
[te[j.Edit], te[j.Delete]],
|
|
224
224
|
(m) => {
|
|
225
|
-
i(m,
|
|
225
|
+
i(m, o.row.original);
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
228
|
},
|
|
@@ -235,7 +235,7 @@ function qe() {
|
|
|
235
235
|
}
|
|
236
236
|
] };
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne = { class: "flex-1" }, qe = { class: "flex-1" }, He = { class: "flex" }, Ke = { class: "flex items-center" }, Ge = { class: "fm-typo-en-body-lg-600 flex-grow" }, Oe = { class: "flex flex-col gap-24" }, Ye = { class: "flex gap-24" }, Je = { class: "flex-1" }, Qe = { class: "flex-1" }, We = /* @__PURE__ */ H({
|
|
239
239
|
__name: "UnitForm",
|
|
240
240
|
props: {
|
|
241
241
|
mode: {},
|
|
@@ -243,12 +243,12 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
243
243
|
disabled: { type: Boolean }
|
|
244
244
|
},
|
|
245
245
|
emits: ["update:modelValue", "click:submit"],
|
|
246
|
-
setup(S, { expose:
|
|
247
|
-
const i = S, r =
|
|
246
|
+
setup(S, { expose: f, emit: b }) {
|
|
247
|
+
const i = S, r = b, { t: o } = G();
|
|
248
248
|
function m() {
|
|
249
249
|
r("click:submit");
|
|
250
250
|
}
|
|
251
|
-
const c =
|
|
251
|
+
const c = V({
|
|
252
252
|
get() {
|
|
253
253
|
var e;
|
|
254
254
|
return ((e = i.modelValue) == null ? void 0 : e.name) ?? "";
|
|
@@ -257,7 +257,7 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
257
257
|
const t = i.modelValue ?? {};
|
|
258
258
|
t.name = e, r("update:modelValue", t);
|
|
259
259
|
}
|
|
260
|
-
}),
|
|
260
|
+
}), p = V({
|
|
261
261
|
get() {
|
|
262
262
|
var e;
|
|
263
263
|
return ((e = i.modelValue) == null ? void 0 : e.abbrev) ?? "";
|
|
@@ -266,7 +266,7 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
266
266
|
const t = i.modelValue ?? {};
|
|
267
267
|
t.abbrev = e, r("update:modelValue", t);
|
|
268
268
|
}
|
|
269
|
-
}),
|
|
269
|
+
}), s = V({
|
|
270
270
|
get() {
|
|
271
271
|
var e;
|
|
272
272
|
return ((e = i.modelValue) == null ? void 0 : e.precision) ?? 0;
|
|
@@ -275,7 +275,7 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
275
275
|
const t = i.modelValue ?? {};
|
|
276
276
|
t.precision = e, r("update:modelValue", t);
|
|
277
277
|
}
|
|
278
|
-
}),
|
|
278
|
+
}), n = V({
|
|
279
279
|
get() {
|
|
280
280
|
var e;
|
|
281
281
|
return ((e = i.modelValue) == null ? void 0 : e.measurements) ?? [];
|
|
@@ -300,138 +300,138 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
300
300
|
}
|
|
301
301
|
], r("update:modelValue", e);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function g(e) {
|
|
304
304
|
const t = i.modelValue ?? {}, d = t.measurements ?? [];
|
|
305
305
|
d.splice(e, 1), t.measurements = d, r("update:modelValue", t);
|
|
306
306
|
}
|
|
307
|
-
const
|
|
308
|
-
return
|
|
307
|
+
const U = R();
|
|
308
|
+
return f({
|
|
309
309
|
validateInputs: () => {
|
|
310
310
|
var e, t;
|
|
311
|
-
(t = (e =
|
|
311
|
+
(t = (e = U.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
312
312
|
},
|
|
313
313
|
resetInputsValidation: () => {
|
|
314
314
|
var e, t;
|
|
315
|
-
(t = (e =
|
|
315
|
+
(t = (e = U.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
|
|
316
316
|
},
|
|
317
317
|
resetInputs: () => {
|
|
318
318
|
var e, t;
|
|
319
|
-
(t = (e =
|
|
319
|
+
(t = (e = U.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
320
320
|
}
|
|
321
321
|
}), (e, t) => {
|
|
322
|
-
const d = E("FmTextField"), $ = E("FmStepperField"), D = E("FmButton"),
|
|
323
|
-
return
|
|
322
|
+
const d = E("FmTextField"), $ = E("FmStepperField"), D = E("FmButton"), x = E("FmCard"), B = E("FmForm");
|
|
323
|
+
return v(), T(B, {
|
|
324
324
|
ref_key: "formRef",
|
|
325
|
-
ref:
|
|
325
|
+
ref: U,
|
|
326
326
|
class: "flex flex-col gap-40",
|
|
327
327
|
onValidationSuccess: m
|
|
328
328
|
}, {
|
|
329
329
|
default: I(() => {
|
|
330
330
|
var M;
|
|
331
331
|
return [
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
332
|
+
l("div", ze, [
|
|
333
|
+
l("div", je, [
|
|
334
|
+
l("div", Ne, [
|
|
335
|
+
y(d, {
|
|
336
336
|
disabled: e.disabled,
|
|
337
|
-
label: a(
|
|
337
|
+
label: a(o)("inventory.unit.name"),
|
|
338
338
|
modelValue: c.value,
|
|
339
339
|
"onUpdate:modelValue": t[0] || (t[0] = (F) => c.value = F),
|
|
340
340
|
rules: [a(z)()],
|
|
341
341
|
"label-mark": "required"
|
|
342
342
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
343
343
|
]),
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
l("div", qe, [
|
|
345
|
+
y(d, {
|
|
346
346
|
disabled: e.disabled,
|
|
347
|
-
label: a(
|
|
348
|
-
modelValue:
|
|
349
|
-
"onUpdate:modelValue": t[1] || (t[1] = (F) =>
|
|
347
|
+
label: a(o)("inventory.unit.symbol"),
|
|
348
|
+
modelValue: p.value,
|
|
349
|
+
"onUpdate:modelValue": t[1] || (t[1] = (F) => p.value = F),
|
|
350
350
|
rules: [a(z)()],
|
|
351
351
|
"label-mark": "required"
|
|
352
352
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
353
353
|
])
|
|
354
354
|
]),
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
l("div", null, [
|
|
356
|
+
y($, {
|
|
357
357
|
disabled: e.disabled,
|
|
358
358
|
class: "col-span-3",
|
|
359
|
-
label: a(
|
|
360
|
-
modelValue:
|
|
361
|
-
"onUpdate:modelValue": t[2] || (t[2] = (F) =>
|
|
359
|
+
label: a(o)("inventory.unit.precision"),
|
|
360
|
+
modelValue: s.value,
|
|
361
|
+
"onUpdate:modelValue": t[2] || (t[2] = (F) => s.value = F),
|
|
362
362
|
rules: [a(de)(0)]
|
|
363
363
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
364
364
|
])
|
|
365
365
|
]),
|
|
366
|
-
|
|
367
|
-
|
|
366
|
+
l("div", He, [
|
|
367
|
+
y(D, {
|
|
368
368
|
disabled: e.disabled,
|
|
369
369
|
type: "button",
|
|
370
370
|
"prepend-icon": "add",
|
|
371
|
-
label: a(
|
|
371
|
+
label: a(o)("inventory.unit.measurement.addMeasurement"),
|
|
372
372
|
variant: "plain",
|
|
373
373
|
onClick: u
|
|
374
374
|
}, null, 8, ["disabled", "label"])
|
|
375
375
|
]),
|
|
376
|
-
(
|
|
376
|
+
(v(!0), k(N, null, q((M = e.modelValue) == null ? void 0 : M.measurements, (F, _) => (v(), T(x, {
|
|
377
377
|
class: "flex flex-col gap-16 p-16",
|
|
378
378
|
variant: "outlined",
|
|
379
379
|
key: F.id
|
|
380
380
|
}, {
|
|
381
381
|
default: I(() => [
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
382
|
+
l("div", Ke, [
|
|
383
|
+
l("div", Ge, h(a(o)("inventory.unit.measurement.measurementDefault", [_ + 1])), 1),
|
|
384
|
+
y(D, {
|
|
385
385
|
disabled: e.disabled,
|
|
386
386
|
variant: "tertiary",
|
|
387
387
|
"prepend-icon": "delete",
|
|
388
|
-
onClick: (
|
|
388
|
+
onClick: (C) => g(_)
|
|
389
389
|
}, null, 8, ["disabled", "onClick"])
|
|
390
390
|
]),
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
391
|
+
l("div", Oe, [
|
|
392
|
+
l("div", Ye, [
|
|
393
|
+
l("div", Je, [
|
|
394
|
+
y(d, {
|
|
395
395
|
disabled: e.disabled,
|
|
396
396
|
class: "col-span-2",
|
|
397
|
-
label: a(
|
|
398
|
-
modelValue: e.modelValue.measurements[
|
|
399
|
-
"onUpdate:modelValue": (
|
|
397
|
+
label: a(o)("inventory.unit.measurement.name"),
|
|
398
|
+
modelValue: e.modelValue.measurements[_].name,
|
|
399
|
+
"onUpdate:modelValue": (C) => e.modelValue.measurements[_].name = C,
|
|
400
400
|
rules: [a(z)()],
|
|
401
401
|
"label-mark": "required"
|
|
402
402
|
}, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
403
403
|
]),
|
|
404
|
-
|
|
405
|
-
|
|
404
|
+
l("div", Qe, [
|
|
405
|
+
y(d, {
|
|
406
406
|
disabled: e.disabled,
|
|
407
|
-
label: a(
|
|
408
|
-
modelValue: e.modelValue.measurements[
|
|
409
|
-
"onUpdate:modelValue": (
|
|
407
|
+
label: a(o)("inventory.unit.measurement.symbol"),
|
|
408
|
+
modelValue: e.modelValue.measurements[_].abbrev,
|
|
409
|
+
"onUpdate:modelValue": (C) => e.modelValue.measurements[_].abbrev = C,
|
|
410
410
|
rules: [a(z)()],
|
|
411
411
|
"label-mark": "required"
|
|
412
412
|
}, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
413
413
|
])
|
|
414
414
|
]),
|
|
415
|
-
|
|
415
|
+
y(Fe, {
|
|
416
416
|
disabled: e.disabled,
|
|
417
417
|
class: "col-span-3",
|
|
418
|
-
label: a(
|
|
419
|
-
"model-value": +a(Y)(e.modelValue.measurements[
|
|
420
|
-
"onUpdate:modelValue": (
|
|
421
|
-
(P, A) => A ===
|
|
418
|
+
label: a(o)("inventory.unit.measurement.conversion"),
|
|
419
|
+
"model-value": +a(Y)(e.modelValue.measurements[_].conversion),
|
|
420
|
+
"onUpdate:modelValue": (C) => n.value = n.value.map(
|
|
421
|
+
(P, A) => A === _ ? {
|
|
422
422
|
...P,
|
|
423
423
|
conversion: a(ke).toPrecision(
|
|
424
|
-
a(me)(
|
|
425
|
-
|
|
424
|
+
a(me)(C),
|
|
425
|
+
s.value
|
|
426
426
|
)
|
|
427
427
|
} : P
|
|
428
428
|
),
|
|
429
429
|
rules: [a(ce)(0)],
|
|
430
|
-
step: +a(Y)({ amount: 1, precision:
|
|
431
|
-
"helper-text": a(
|
|
432
|
-
measurementSymbol: e.modelValue.measurements[
|
|
433
|
-
conversion: +a(Y)(e.modelValue.measurements[
|
|
434
|
-
unitSymbol:
|
|
430
|
+
step: +a(Y)({ amount: 1, precision: s.value }),
|
|
431
|
+
"helper-text": a(o)("inventory.unit.measurement.conversionHelper", {
|
|
432
|
+
measurementSymbol: e.modelValue.measurements[_].name || " measurement unit",
|
|
433
|
+
conversion: +a(Y)(e.modelValue.measurements[_].conversion),
|
|
434
|
+
unitSymbol: p.value || "base unit"
|
|
435
435
|
})
|
|
436
436
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue", "rules", "step", "helper-text"])
|
|
437
437
|
])
|
|
@@ -444,41 +444,41 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
444
444
|
}, 512);
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
|
-
}),
|
|
447
|
+
}), Xe = { class: "flex gap-4" }, Ze = /* @__PURE__ */ H({
|
|
448
448
|
__name: "UnitDialog",
|
|
449
449
|
props: {
|
|
450
450
|
show: { type: Boolean },
|
|
451
451
|
unit: {},
|
|
452
|
-
mode: { default:
|
|
452
|
+
mode: { default: w.READ }
|
|
453
453
|
},
|
|
454
454
|
emits: ["update:show"],
|
|
455
455
|
setup(S) {
|
|
456
|
-
const
|
|
457
|
-
switch (
|
|
458
|
-
case
|
|
456
|
+
const f = S, b = K(), i = oe(), { t: r } = G(), o = ee(f, "show"), m = ee(f, "unit"), c = V(() => {
|
|
457
|
+
switch (f.mode) {
|
|
458
|
+
case w.READ:
|
|
459
459
|
return "";
|
|
460
|
-
case
|
|
460
|
+
case w.UPDATE:
|
|
461
461
|
return r("inventory.unit.update.title");
|
|
462
|
-
case
|
|
462
|
+
case w.CREATE:
|
|
463
463
|
return r("inventory.unit.create.title");
|
|
464
464
|
}
|
|
465
465
|
return "";
|
|
466
|
-
}),
|
|
467
|
-
switch (
|
|
468
|
-
case
|
|
466
|
+
}), p = V(() => {
|
|
467
|
+
switch (f.mode) {
|
|
468
|
+
case w.READ:
|
|
469
469
|
return "";
|
|
470
|
-
case
|
|
470
|
+
case w.UPDATE:
|
|
471
471
|
return r("common.save");
|
|
472
|
-
case
|
|
472
|
+
case w.CREATE:
|
|
473
473
|
return r("common.add");
|
|
474
474
|
}
|
|
475
475
|
return "";
|
|
476
|
-
}),
|
|
476
|
+
}), s = R(), n = R(!1);
|
|
477
477
|
async function u() {
|
|
478
|
-
|
|
478
|
+
n.value = !0;
|
|
479
479
|
try {
|
|
480
|
-
const t =
|
|
481
|
-
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await
|
|
480
|
+
const t = ne(m.value);
|
|
481
|
+
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), o.value = !1, i.open({
|
|
482
482
|
title: r("common.success"),
|
|
483
483
|
message: r("inventory.unit.create.success", { name: m.value.name }),
|
|
484
484
|
type: "success"
|
|
@@ -490,13 +490,13 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
490
490
|
type: "error"
|
|
491
491
|
});
|
|
492
492
|
} finally {
|
|
493
|
-
|
|
493
|
+
n.value = !1;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
async function
|
|
497
|
-
|
|
496
|
+
async function g() {
|
|
497
|
+
n.value = !0;
|
|
498
498
|
try {
|
|
499
|
-
await
|
|
499
|
+
await b.updateUnit(m.value), o.value = !1, i.open({
|
|
500
500
|
title: r("common.success"),
|
|
501
501
|
message: r("inventory.unit.update.success", { name: m.value.name }),
|
|
502
502
|
type: "success"
|
|
@@ -508,113 +508,113 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
508
508
|
type: "error"
|
|
509
509
|
});
|
|
510
510
|
} finally {
|
|
511
|
-
|
|
511
|
+
n.value = !1;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function U() {
|
|
515
515
|
var t, d;
|
|
516
|
-
(d = (t =
|
|
516
|
+
(d = (t = s.value) == null ? void 0 : t.validateInputs) == null || d.call(t);
|
|
517
517
|
}
|
|
518
518
|
function e() {
|
|
519
|
-
switch (
|
|
520
|
-
case
|
|
519
|
+
switch (f.mode) {
|
|
520
|
+
case w.READ:
|
|
521
521
|
return;
|
|
522
|
-
case
|
|
523
|
-
return
|
|
524
|
-
case
|
|
522
|
+
case w.UPDATE:
|
|
523
|
+
return g();
|
|
524
|
+
case w.CREATE:
|
|
525
525
|
return u();
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
return (t, d) => {
|
|
529
529
|
const $ = E("FmButton"), D = E("FmSideSheet");
|
|
530
|
-
return
|
|
531
|
-
"model-value": a(
|
|
532
|
-
"onUpdate:modelValue": d[3] || (d[3] = (
|
|
530
|
+
return v(), T(D, {
|
|
531
|
+
"model-value": a(o),
|
|
532
|
+
"onUpdate:modelValue": d[3] || (d[3] = (x) => X(o) ? o.value = x : null),
|
|
533
533
|
header: c.value,
|
|
534
534
|
"close-button": "",
|
|
535
535
|
"dismiss-away": "",
|
|
536
536
|
"max-width": 500
|
|
537
537
|
}, {
|
|
538
538
|
"side-sheet-footer": I(() => [
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
loading:
|
|
542
|
-
label:
|
|
543
|
-
onClick:
|
|
539
|
+
l("div", Xe, [
|
|
540
|
+
y($, {
|
|
541
|
+
loading: n.value,
|
|
542
|
+
label: p.value,
|
|
543
|
+
onClick: U
|
|
544
544
|
}, null, 8, ["loading", "label"]),
|
|
545
|
-
|
|
546
|
-
disabled:
|
|
545
|
+
y($, {
|
|
546
|
+
disabled: n.value,
|
|
547
547
|
label: a(r)("common.close"),
|
|
548
548
|
variant: "tertiary",
|
|
549
|
-
onClick: d[2] || (d[2] = (
|
|
549
|
+
onClick: d[2] || (d[2] = (x) => o.value = !1)
|
|
550
550
|
}, null, 8, ["disabled", "label"])
|
|
551
551
|
])
|
|
552
552
|
]),
|
|
553
553
|
default: I(() => [
|
|
554
|
-
|
|
554
|
+
y(We, {
|
|
555
555
|
class: "w-full",
|
|
556
556
|
ref_key: "hasValidationExpose",
|
|
557
|
-
ref:
|
|
557
|
+
ref: s,
|
|
558
558
|
modelValue: a(m),
|
|
559
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
559
|
+
"onUpdate:modelValue": d[0] || (d[0] = (x) => X(m) ? m.value = x : null),
|
|
560
560
|
mode: t.mode,
|
|
561
|
-
disabled:
|
|
562
|
-
"onClick:submit": d[1] || (d[1] = (
|
|
561
|
+
disabled: n.value,
|
|
562
|
+
"onClick:submit": d[1] || (d[1] = (x) => e())
|
|
563
563
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
564
564
|
]),
|
|
565
565
|
_: 1
|
|
566
566
|
}, 8, ["model-value", "header"]);
|
|
567
567
|
};
|
|
568
568
|
}
|
|
569
|
-
}),
|
|
569
|
+
}), et = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, tt = { class: "flex flex-col py-8" }, nt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ H({
|
|
570
570
|
__name: "UnitView",
|
|
571
571
|
setup(S) {
|
|
572
|
-
const
|
|
573
|
-
function
|
|
572
|
+
const f = K(), b = pe(), i = V(() => f.units), { createUnit: r, updateUnit: o } = J(), { unitDialogProps: m, unitViewLoading: c } = xe(J()), { columnDefs: p } = Le();
|
|
573
|
+
function s(d) {
|
|
574
574
|
d === "add" && r();
|
|
575
575
|
}
|
|
576
|
-
const
|
|
576
|
+
const n = R(""), u = V(() => c.value), { breakpoints: g } = ve(), U = V(() => g.value.xs || g.value.sm ? 10 : 20), e = Ue(), { t } = G();
|
|
577
577
|
return (d, $) => {
|
|
578
578
|
const D = E("FmTable");
|
|
579
|
-
return
|
|
579
|
+
return v(), T(we, {
|
|
580
580
|
title: a(t)("inventory.unit.title"),
|
|
581
581
|
actions: [
|
|
582
582
|
{ label: a(t)("inventory.unit.create.title"), value: "add", isPrimary: !0, prependIcon: "add" }
|
|
583
583
|
],
|
|
584
|
-
"onClick:action":
|
|
584
|
+
"onClick:action": s
|
|
585
585
|
}, {
|
|
586
586
|
default: I(() => [
|
|
587
|
-
|
|
588
|
-
|
|
587
|
+
l("div", et, [
|
|
588
|
+
y(Ce, {
|
|
589
589
|
searchable: "",
|
|
590
|
-
search:
|
|
591
|
-
"onUpdate:search": $[0] || ($[0] = (
|
|
590
|
+
search: n.value,
|
|
591
|
+
"onUpdate:search": $[0] || ($[0] = (x) => n.value = x)
|
|
592
592
|
}, null, 8, ["search"]),
|
|
593
|
-
|
|
594
|
-
style:
|
|
595
|
-
"column-defs": a(
|
|
593
|
+
y(D, {
|
|
594
|
+
style: se(a(e).tableHeight),
|
|
595
|
+
"column-defs": a(p),
|
|
596
596
|
"row-data": i.value,
|
|
597
|
-
"search-value":
|
|
598
|
-
loading: !a(
|
|
599
|
-
onRowClick: $[1] || ($[1] = (
|
|
600
|
-
"page-size":
|
|
597
|
+
"search-value": n.value,
|
|
598
|
+
loading: !a(b)._currentLocation || u.value,
|
|
599
|
+
onRowClick: $[1] || ($[1] = (x) => a(o)(x.original)),
|
|
600
|
+
"page-size": U.value
|
|
601
601
|
}, {
|
|
602
|
-
"list-row": I((
|
|
603
|
-
|
|
604
|
-
row:
|
|
605
|
-
onRowClick: a(
|
|
602
|
+
"list-row": I((x) => [
|
|
603
|
+
y(he, {
|
|
604
|
+
row: x,
|
|
605
|
+
onRowClick: a(o)
|
|
606
606
|
}, {
|
|
607
607
|
default: I((B) => {
|
|
608
|
-
var M, F,
|
|
608
|
+
var M, F, _, C, P, A, Q, L, W;
|
|
609
609
|
return [
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
render: (
|
|
614
|
-
props: (P = (
|
|
610
|
+
l("div", tt, [
|
|
611
|
+
l("div", nt, [
|
|
612
|
+
y(a(Ve), {
|
|
613
|
+
render: (_ = (F = (M = B.name) == null ? void 0 : M.column) == null ? void 0 : F.columnDef) == null ? void 0 : _.cell,
|
|
614
|
+
props: (P = (C = B.name) == null ? void 0 : C.getContext) == null ? void 0 : P.call(C)
|
|
615
615
|
}, null, 8, ["render", "props"])
|
|
616
616
|
]),
|
|
617
|
-
|
|
617
|
+
l("div", ot, h((W = (L = (Q = (A = x.original.measurements) == null ? void 0 : A.map) == null ? void 0 : Q.call(A, (le) => le.name)) == null ? void 0 : L.join) == null ? void 0 : W.call(L, ", ")), 1)
|
|
618
618
|
])
|
|
619
619
|
];
|
|
620
620
|
}),
|
|
@@ -624,8 +624,8 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
624
624
|
_: 1
|
|
625
625
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
|
|
626
626
|
]),
|
|
627
|
-
(
|
|
628
|
-
|
|
627
|
+
(v(), T(ae, { to: "body" }, [
|
|
628
|
+
y(Ze, re(ie(a(m))), null, 16)
|
|
629
629
|
]))
|
|
630
630
|
]),
|
|
631
631
|
_: 1
|
|
@@ -634,5 +634,5 @@ const He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge
|
|
|
634
634
|
}
|
|
635
635
|
});
|
|
636
636
|
export {
|
|
637
|
-
|
|
637
|
+
vt as default
|
|
638
638
|
};
|