@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.
Files changed (196) hide show
  1. package/dist/App.vue.d.ts +1 -1
  2. package/dist/{ApprovalView-Bcxk6B7K.js → ApprovalView-CF-RhtHH.js} +5 -5
  3. package/dist/{BindingsDialog-XDkcjW_c.js → BindingsDialog-0_fCmf7t.js} +26 -26
  4. package/dist/{BindingsPicker-CgbiqX72.js → BindingsPicker-CT-56t-W.js} +17 -17
  5. package/dist/BindingsTable-DEftAnTN.js +120 -0
  6. package/dist/Entry.vue.d.ts +1 -1
  7. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-6yg6_JPe.js +308 -0
  8. package/dist/IngredientsView-Au6oRwF2.js +1663 -0
  9. package/dist/{IntegrationView-CErHEVAO.js → IntegrationView-D7hqf0P5.js} +278 -278
  10. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-XXoPyhlc.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-HcOKpAlW.js} +1 -1
  11. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BpyUheXn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BTOE1vFl.js} +1 -1
  12. package/dist/PurchaseOrderPrintPreview-C92PdleC.js +152 -0
  13. package/dist/{ReceiveRequestView-BKbeFDxm.js → ReceiveRequestView-BaxEQWOD.js} +8 -8
  14. package/dist/{RecipeView-Drp4l4gL.js → RecipeView-CDgZpLPk.js} +181 -181
  15. package/dist/Standalone.vue.d.ts +1 -1
  16. package/dist/{StockView-Cj6fErwD.js → StockView-B77CrARl.js} +498 -502
  17. package/dist/SupplierView-DQ3hB7q2.js +819 -0
  18. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-lsyakQIl.js +738 -0
  19. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-DN7NCT72.js +1435 -0
  20. package/dist/TransferTemplateView-Dt04xMCK.js +1290 -0
  21. package/dist/{UnitView-C_tAxIpq.js → UnitView-DlmlVNOx.js} +242 -242
  22. package/dist/{WarehouseView-BAqVtbD6.js → WarehouseView-DXWls5vv.js} +360 -362
  23. package/dist/api/bill.d.ts +238 -84
  24. package/dist/api/inventory.d.ts +3 -3
  25. package/dist/api/purchase-order-template.d.ts +4 -0
  26. package/dist/api/stock.d.ts +0 -8
  27. package/dist/api/supplier.d.ts +2 -0
  28. package/dist/app-P7rGzGsF.js +68600 -0
  29. package/dist/app.d.ts +200 -7
  30. package/dist/app.js +3 -3
  31. package/dist/{array-AvWd53LI.js → array-ClJzD_Lt.js} +3 -3
  32. package/dist/components/ChangeLocationComponent.vue.d.ts +14 -1
  33. package/dist/components/DeferableLoading.vue.d.ts +1 -1
  34. package/dist/components/DeleteDialog.vue.d.ts +1 -1
  35. package/dist/components/FmCoordinateInput.vue.d.ts +3 -3
  36. package/dist/components/FmDroppableField.vue.d.ts +6 -6
  37. package/dist/components/FmFilterableSelect.vue.d.ts +3 -3
  38. package/dist/components/FmInventoryTableToolbar.vue.d.ts +19 -10
  39. package/dist/components/FmMinMaxInput.vue.d.ts +20 -0
  40. package/dist/components/FmMinMaxInputProps.d.ts +16 -0
  41. package/dist/components/FmMinMaxInputRules.d.ts +4 -0
  42. package/dist/components/FmMultiselectDialog.vue.d.ts +5 -5
  43. package/dist/components/FmMultiselectDialogProps.d.ts +14 -1
  44. package/dist/components/FmUnitInputRules.d.ts +1 -0
  45. package/dist/components/MultiSelectDialog.vue.d.ts +1 -1
  46. package/dist/components/NavigationTab.vue.d.ts +1 -1
  47. package/dist/components/NumberPrecisionInput.vue.d.ts +3 -3
  48. package/dist/components/PremiumBadge.vue.d.ts +3 -3
  49. package/dist/components/PreviewBadge.vue.d.ts +3 -3
  50. package/dist/components/StockForecast.vue.d.ts +1 -1
  51. package/dist/components/TableActionableRow.vue.d.ts +4 -4
  52. package/dist/components/UnitDisplayControl.vue.d.ts +1 -1
  53. package/dist/components/icons/IconCommunity.vue.d.ts +1 -1
  54. package/dist/components/icons/IconDocumentation.vue.d.ts +1 -1
  55. package/dist/components/icons/IconEcosystem.vue.d.ts +1 -1
  56. package/dist/components/icons/IconSupport.vue.d.ts +1 -1
  57. package/dist/components/icons/IconTooling.vue.d.ts +1 -1
  58. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +6 -6
  59. package/dist/components/map/CoordinateDialog.vue.d.ts +4 -4
  60. package/dist/components/map/GoogleMap.vue.d.ts +6 -6
  61. package/dist/components/nested-multiselect/FmNestedMultiselectDialog.vue.d.ts +3 -3
  62. package/dist/components/row-action.enum.d.ts +3 -1
  63. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +3 -3
  64. package/dist/components/shell/inventory/binding-ui.vue.d.ts +6 -6
  65. package/dist/components/ui-library/FmDateRangePickerChip.vue.d.ts +5 -5
  66. package/dist/composable/useIframe.d.ts +1 -1
  67. package/dist/composable/useSearch.d.ts +1 -1
  68. package/dist/{decimal-D3KXLC4T.js → decimal-4ONRlhOO.js} +1 -1
  69. package/dist/format-unit-display-DJpElzu_.js +707 -0
  70. package/dist/helper/number.d.ts +2 -0
  71. package/dist/{id-to-date-Cj02m808.js → id-to-date-D8Ey2CVj.js} +1 -1
  72. package/dist/is-linked-ingredient-error-fJ2TJb3z.js +37 -0
  73. package/dist/layout/InventoryLayout.vue.d.ts +1 -1
  74. package/dist/layout/SingleColumnLayout.vue.d.ts +6 -5
  75. package/dist/layout/components/NavigationButton.vue.d.ts +4 -4
  76. package/dist/layout-D-zXtsSp.js +151 -0
  77. package/dist/row-action.enum-PMKMRrZR.js +50 -0
  78. package/dist/stores/feature.d.ts +5 -1
  79. package/dist/stores/inventory.d.ts +4 -4
  80. package/dist/stores/location.d.ts +185 -152
  81. package/dist/stores/supplier.d.ts +666 -12
  82. package/dist/stores/warehouse.d.ts +17 -5
  83. package/dist/supplier-DsUIjl-L.js +69 -0
  84. package/dist/tsconfig.app.tsbuildinfo +1 -1
  85. package/dist/views/InventoryView.vue.d.ts +1 -1
  86. package/dist/views/SelectBussinessDialog.vue.d.ts +1 -1
  87. package/dist/views/approval/ApprovalView.vue.d.ts +1 -1
  88. package/dist/views/dev/ComponentPreview.vue.d.ts +1 -1
  89. package/dist/views/dev/components/CoordinateTest.vue.d.ts +1 -1
  90. package/dist/views/dev/components/DateRange.vue.d.ts +1 -1
  91. package/dist/views/dev/components/FmDecimalInputTest.vue.d.ts +1 -1
  92. package/dist/views/dev/components/FmMultiselectDialogGrouped.vue.d.ts +2 -0
  93. package/dist/views/dev/components/FmSelectTest.vue.d.ts +1 -1
  94. package/dist/views/dev/components/InventoryIframe.vue.d.ts +1 -1
  95. package/dist/views/dev/components/LayoutDev.vue.d.ts +1 -1
  96. package/dist/views/dev/components/MfCommontTest.vue.d.ts +1 -1
  97. package/dist/views/dev/components/NestedSelection.vue.d.ts +1 -1
  98. package/dist/views/dev/components/NumberStepper.vue.d.ts +1 -1
  99. package/dist/views/dev/components/TabStorageTest.vue.d.ts +1 -1
  100. package/dist/views/dev/components/UnitInput.vue.d.ts +1 -1
  101. package/dist/views/dev/helpers/pinia-test.d.ts +1 -1
  102. package/dist/views/home/HomeView.vue.d.ts +1 -1
  103. package/dist/views/iframe/inventory-bindings/bindings-dialog/BindingsDialog.vue.d.ts +1 -1
  104. package/dist/views/iframe/inventory-bindings/bindings-picker/BindingsPicker.vue.d.ts +1 -1
  105. package/dist/views/iframe/inventory-bindings/bindings-table/BindingsTable.vue.d.ts +1 -1
  106. package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -1
  107. package/dist/views/ingredients/components/cannot-delete/CannotDelete.vue.d.ts +4 -4
  108. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +3 -3
  109. package/dist/views/ingredients/components/import-ingredients/ImportIngredientItem.vue.d.ts +1 -1
  110. package/dist/views/ingredients/components/import-ingredients/ImportIngredients.vue.d.ts +1 -1
  111. package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItem.vue.d.ts +1 -1
  112. package/dist/views/ingredients/components/ingredient-dialog/IngredientDialog.vue.d.ts +5 -5
  113. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +6 -6
  114. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +5 -5
  115. package/dist/views/ingredients/components/inventory-binding/InventoryBindingSummary.vue.d.ts +3 -3
  116. package/dist/views/ingredients/composables/use-ingredient-form.d.ts +8 -8
  117. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
  118. package/dist/views/integration/IntegrationView.vue.d.ts +1 -1
  119. package/dist/views/integration/components/ApplyAddon.vue.d.ts +5 -5
  120. package/dist/views/integration/components/ApplyProduct.vue.d.ts +5 -5
  121. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +5 -5
  122. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +5 -5
  123. package/dist/views/receive-request/ReceiveRequestView.vue.d.ts +1 -1
  124. package/dist/views/receive-request/components/select-template-dialog/SelectTemplateDialog.vue.d.ts +8 -0
  125. package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistory.vue.d.ts +1 -1
  126. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +3 -3
  127. package/dist/views/receive-request/components/transfer-dialog/TransferDialog.vue.d.ts +4 -4
  128. package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +1 -1
  129. package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +4 -4
  130. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +34 -32
  131. package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +8 -2
  132. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
  133. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +6 -6
  134. package/dist/views/receive-request/components/transfer-form/components/TransferItem.vue.d.ts +3 -3
  135. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +3 -3
  136. package/dist/views/receive-request/components/transfer-form/composables/use-backdate-po.d.ts +4 -4
  137. package/dist/views/receive-request/components/transfer-form/composables/use-compare-price.d.ts +3 -3
  138. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -9
  139. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1016 -70
  140. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +36 -36
  141. package/dist/views/receive-request/print-preview/PurchaseOrderPrintPreview.vue.d.ts +1 -1
  142. package/dist/views/recipe/RecipeView.vue.d.ts +1 -1
  143. package/dist/views/recipe/components/recipe-dialog/RecipeDialog.vue.d.ts +5 -5
  144. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +4 -4
  145. package/dist/views/recipe/composables/use-recipe-form.d.ts +8 -8
  146. package/dist/views/stock/StockView.vue.d.ts +1 -1
  147. package/dist/views/stock/components/StockHeaderPreview.vue.d.ts +1 -1
  148. package/dist/views/stock/components/StockHistory.vue.d.ts +3 -3
  149. package/dist/views/stock/components/StockRecordCard.vue.d.ts +123 -46
  150. package/dist/views/stock/components/dialog/AdjustSkuDialog.vue.d.ts +4 -4
  151. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +5 -5
  152. package/dist/views/stock/components/dialog/ConvertSkuDialog.vue.d.ts +4 -4
  153. package/dist/views/stock/composables/use-stock-action.d.ts +11 -11
  154. package/dist/views/stock/helper/stock-row-action.d.ts +4 -2
  155. package/dist/views/supplier/SupplierView.vue.d.ts +1 -1
  156. package/dist/views/supplier/components/SupplierDialog.vue.d.ts +4 -4
  157. package/dist/views/supplier/components/SupplierForm.vue.d.ts +10 -10
  158. package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +3 -3
  159. package/dist/views/supplier/composables/use-supplier-table.d.ts +3 -3
  160. package/dist/views/transfer-template/TransferTemplateView.vue.d.ts +1 -1
  161. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +20 -0
  162. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetailsProps.d.ts +9 -0
  163. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +4 -4
  164. package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateForm.vue.d.ts +2 -2
  165. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +3 -3
  166. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +7 -7
  167. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +15 -9
  168. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1428 -43
  169. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +893 -13
  170. package/dist/views/unit/UnitView.vue.d.ts +1 -1
  171. package/dist/views/unit/components/unit-dialog/UnitDialog.vue.d.ts +5 -5
  172. package/dist/views/unit/components/unit-form/UnitForm.vue.d.ts +4 -4
  173. package/dist/views/unit/components/unit-summary/UnitSummary.vue.d.ts +3 -3
  174. package/dist/views/unit/components/unit-used-by/UnitUsedBy.vue.d.ts +1 -1
  175. package/dist/views/unit/composables/use-unit-form.d.ts +8 -8
  176. package/dist/views/warehouse/WarehouseView.vue.d.ts +1 -1
  177. package/dist/views/warehouse/components/WarehouseDialog.vue.d.ts +4 -4
  178. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +38 -14
  179. package/dist/{xlsx-B-2KyDJq.js → xlsx-zfERRe6K.js} +3383 -3383
  180. package/dist/{xlsx.util-D6EzRE71.js → xlsx.util-DnbiJzsk.js} +4 -4
  181. package/package.json +6 -5
  182. package/dist/BindingsTable-xNXNsBAd.js +0 -145
  183. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DFPkUHl-.js +0 -272
  184. package/dist/IngredientsView-DD7ns3mP.js +0 -1751
  185. package/dist/PurchaseOrderPrintPreview-L_iaaURb.js +0 -152
  186. package/dist/SupplierView-EFsHWet-.js +0 -801
  187. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-kM5fyqq6.js +0 -745
  188. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-CyFMCmXw.js +0 -1605
  189. package/dist/TransferTemplateView-Cymhrayh.js +0 -933
  190. package/dist/app-CeUU5Gd8.js +0 -66938
  191. package/dist/is-linked-ingredient-error-C6AghEwR.js +0 -37
  192. package/dist/layout-2zzAZIVO.js +0 -147
  193. package/dist/purchase-order-transaction-type-Dz0YF5qh.js +0 -294
  194. package/dist/row-action.enum-7jVyol1k.js +0 -36
  195. package/dist/supplier-mDVKd7Ge.js +0 -54
  196. package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +0 -9
@@ -1,146 +1,146 @@
1
- import { defineComponent as H, computed as h, openBlock as f, createElementBlock as C, Fragment as N, renderList as q, createElementVNode as s, toDisplayString as x, createCommentVNode as O, ref as R, resolveComponent as E, createBlock as T, withCtx as I, createVNode as v, unref as a, isRef as X, normalizeStyle as le, Teleport as ae, normalizeProps as re, guardReactiveProps as ie } from "vue";
2
- import { u as K, S as ue, c as oe, R as z, A as de, a as Y, l as me, m as ce, e as Z, j as pe } from "./app-CeUU5Gd8.js";
3
- import { useDialog as fe, useSnackbar as ne, useProxiedModel as ee, useBreakpoints as ve } from "@feedmepos/ui-library";
4
- import { i as ye, _ as be } from "./is-linked-ingredient-error-C6AghEwR.js";
5
- import { F as U, D as te, R as j } from "./row-action.enum-7jVyol1k.js";
6
- import { defineStore as _e, storeToRefs as ge } from "pinia";
7
- import { c as xe, _ as he, F as Ve, u as Ue } from "./layout-2zzAZIVO.js";
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-DFPkUHl-.js";
10
- import { F as ke } from "./decimal-D3KXLC4T.js";
11
- import { _ as Fe } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-XXoPyhlc.js";
12
- const Se = { class: "flex flex-col gap-8" }, $e = /* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1), Ee = {
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
- }, Ie = /* @__PURE__ */ s("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" }, [
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
- }, Re = {
18
+ }, De = {
25
19
  key: 1,
26
20
  class: "flex flex-col"
27
- }, Me = /* @__PURE__ */ s("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" }, [
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
- }, Be = {
24
+ }, Me = {
37
25
  key: 2,
38
26
  class: "flex flex-col"
39
- }, Le = /* @__PURE__ */ s("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" }, [
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
- }, Ne = /* @__PURE__ */ H({
30
+ }, Be = /* @__PURE__ */ H({
49
31
  __name: "UnitUsedBy",
50
32
  props: {
51
33
  unit: {}
52
34
  },
53
35
  setup(S) {
54
- const p = S, y = K(), i = h(() => y.validateUnitUsage(p.unit)), r = h(() => i.value.filter((c) => c.from === "INGREDIENT")), n = h(() => i.value.filter((c) => c.from === "RECIPE")), m = h(() => i.value.filter((c) => c.from === "MENU"));
55
- return (c, k) => (f(), C("div", Se, [
56
- $e,
57
- r.value.length ? (f(), C("div", Ee, [
58
- Ie,
59
- (f(!0), C(N, null, q(r.value, (l) => {
60
- var o;
61
- return f(), C("div", {
62
- key: l.code,
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
- s("div", De, x(l.code) + " " + x(l.name), 1),
66
- s("div", Ae, x((o = l.bindedIngredient) != null && o.length ? "Convert binding" : "Item unit"), 1)
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
- n.value.length ? (f(), C("div", Re, [
71
- Me,
72
- (f(!0), C(N, null, q(n.value, (l) => {
73
- var o, u, b;
74
- return f(), C("div", {
75
- key: l.code,
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
- s("div", Pe, x(l.code) + " " + x(l.name), 1),
79
- s("div", Te, x((o = l.bindedIngredient) == null ? void 0 : o.slice(0, 3).map((V) => V.code).join(", ")) + " " + x(l.bindedIngredient && ((u = l.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((b = l.bindedIngredient) == null ? void 0 : b.length) - 3} more` : ""), 1)
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 ? (f(), C("div", Be, [
84
- Le,
85
- (f(!0), C(N, null, q(m.value, (l) => {
86
- var o, u, b;
87
- return f(), C("div", {
88
- key: l.code,
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
- s("div", ze, x(l.code) + " " + x(l.name), 1),
92
- s("div", je, x((o = l.bindedIngredient) == null ? void 0 : o.slice(0, 3).map((V) => V.code).join(", ")) + " " + x(l.bindedIngredient && ((u = l.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((b = l.bindedIngredient) == null ? void 0 : b.length) - 3} more` : ""), 1)
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 = _e("unitForm", function() {
99
- const p = fe(), y = ne(), i = K(), r = R(!1), n = R();
98
+ }), J = ge("unitForm", function() {
99
+ const f = fe(), b = oe(), i = K(), r = R(!1), o = R();
100
100
  function m() {
101
- const o = {
101
+ const n = {
102
102
  unit: {},
103
- mode: U.CREATE,
103
+ mode: w.CREATE,
104
104
  show: !0,
105
105
  "onUpdate:show"(u) {
106
- n.value.show = u;
106
+ o.value.show = u;
107
107
  }
108
108
  };
109
- n.value = o;
109
+ o.value = n;
110
110
  }
111
- async function c(o) {
111
+ async function c(n) {
112
112
  const u = {
113
- unit: o,
114
- mode: U.UPDATE,
113
+ unit: n,
114
+ mode: w.UPDATE,
115
115
  show: !0,
116
- "onUpdate:show"(b) {
117
- n.value.show = b;
116
+ "onUpdate:show"(g) {
117
+ o.value.show = g;
118
118
  }
119
119
  };
120
- n.value = u;
120
+ o.value = u;
121
121
  }
122
- async function k(o) {
122
+ async function p(n) {
123
123
  r.value = !0;
124
124
  try {
125
- await i.deleteUnit(o), y.open({
125
+ await i.deleteUnit(n), b.open({
126
126
  title: "Success",
127
- message: `Deleted ${o.name}`,
127
+ message: `Deleted ${n.name}`,
128
128
  type: "success"
129
129
  });
130
130
  } catch (u) {
131
- u instanceof ue && ye(u) ? p.open({
131
+ u instanceof ue && ye(u) ? f.open({
132
132
  title: "Cannot delete unit",
133
133
  contentComponent: be,
134
134
  contentComponentProps: {
135
- subject: (o == null ? void 0 : o.name) ?? "",
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), y.open({
143
- title: `Cannot delete ${o.name}`,
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 l(o) {
152
- if (i.validateUnitUsage(o).length) {
153
- p.open({
154
- title: `Cannot delete ${(o == null ? void 0 : o.name) ?? "unit"}`,
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: Ne,
158
+ contentComponent: Be,
159
159
  contentComponentProps: {
160
- unit: o
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
- p.open({
170
- title: `Delete ${(o == null ? void 0 : o.name) ?? "unit"}?`,
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(() => k(o));
182
+ }).onPrimary(() => p(n));
183
183
  }
184
184
  return {
185
185
  createUnit: m,
186
186
  updateUnit: c,
187
- deleteUnit: l,
188
- unitDialogProps: n,
187
+ deleteUnit: s,
188
+ unitDialogProps: o,
189
189
  unitViewLoading: r
190
190
  };
191
191
  });
192
- function qe() {
193
- const { updateUnit: S, deleteUnit: p } = J(), { t: y } = G();
194
- async function i(n, m) {
195
- const c = oe(m);
196
- if (n === j.Edit) {
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 (n === j.Delete) {
201
- await p(c);
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: y("inventory.unit.table.name"),
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: y("inventory.unit.table.symbol"),
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(n) {
222
- return xe(
221
+ cell(o) {
222
+ return _e(
223
223
  [te[j.Edit], te[j.Delete]],
224
224
  (m) => {
225
- i(m, n.row.original);
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 He = { class: "flex flex-col gap-24" }, Ke = { class: "flex gap-24" }, Ge = { class: "flex-1" }, Oe = { class: "flex-1" }, Ye = { class: "flex" }, Je = { class: "flex items-center" }, Qe = { class: "fm-typo-en-body-lg-600 flex-grow" }, We = { class: "flex flex-col gap-24" }, Xe = { class: "flex gap-24" }, Ze = { class: "flex-1" }, et = { class: "flex-1" }, tt = /* @__PURE__ */ H({
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: p, emit: y }) {
247
- const i = S, r = y, { t: n } = G();
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 = h({
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
- }), k = h({
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
- }), l = h({
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
- }), o = h({
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 b(e) {
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 V = R();
308
- return p({
307
+ const U = R();
308
+ return f({
309
309
  validateInputs: () => {
310
310
  var e, t;
311
- (t = (e = V.value) == null ? void 0 : e.validateInputs) == null || t.call(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 = V.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(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 = V.value) == null ? void 0 : e.resetInputs) == null || t.call(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"), _ = E("FmCard"), B = E("FmForm");
323
- return f(), T(B, {
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: V,
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
- s("div", He, [
333
- s("div", Ke, [
334
- s("div", Ge, [
335
- v(d, {
332
+ l("div", ze, [
333
+ l("div", je, [
334
+ l("div", Ne, [
335
+ y(d, {
336
336
  disabled: e.disabled,
337
- label: a(n)("inventory.unit.name"),
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
- s("div", Oe, [
345
- v(d, {
344
+ l("div", qe, [
345
+ y(d, {
346
346
  disabled: e.disabled,
347
- label: a(n)("inventory.unit.symbol"),
348
- modelValue: k.value,
349
- "onUpdate:modelValue": t[1] || (t[1] = (F) => k.value = 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
- s("div", null, [
356
- v($, {
355
+ l("div", null, [
356
+ y($, {
357
357
  disabled: e.disabled,
358
358
  class: "col-span-3",
359
- label: a(n)("inventory.unit.precision"),
360
- modelValue: l.value,
361
- "onUpdate:modelValue": t[2] || (t[2] = (F) => l.value = 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
- s("div", Ye, [
367
- v(D, {
366
+ l("div", He, [
367
+ y(D, {
368
368
  disabled: e.disabled,
369
369
  type: "button",
370
370
  "prepend-icon": "add",
371
- label: a(n)("inventory.unit.measurement.addMeasurement"),
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
- (f(!0), C(N, null, q((M = e.modelValue) == null ? void 0 : M.measurements, (F, g) => (f(), T(_, {
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
- s("div", Je, [
383
- s("div", Qe, x(a(n)("inventory.unit.measurement.measurementDefault", [g + 1])), 1),
384
- v(D, {
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: (w) => b(g)
388
+ onClick: (C) => g(_)
389
389
  }, null, 8, ["disabled", "onClick"])
390
390
  ]),
391
- s("div", We, [
392
- s("div", Xe, [
393
- s("div", Ze, [
394
- v(d, {
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(n)("inventory.unit.measurement.name"),
398
- modelValue: e.modelValue.measurements[g].name,
399
- "onUpdate:modelValue": (w) => e.modelValue.measurements[g].name = w,
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
- s("div", et, [
405
- v(d, {
404
+ l("div", Qe, [
405
+ y(d, {
406
406
  disabled: e.disabled,
407
- label: a(n)("inventory.unit.measurement.symbol"),
408
- modelValue: e.modelValue.measurements[g].abbrev,
409
- "onUpdate:modelValue": (w) => e.modelValue.measurements[g].abbrev = w,
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
- v(Fe, {
415
+ y(Fe, {
416
416
  disabled: e.disabled,
417
417
  class: "col-span-3",
418
- label: a(n)("inventory.unit.measurement.conversion"),
419
- "model-value": +a(Y)(e.modelValue.measurements[g].conversion),
420
- "onUpdate:modelValue": (w) => o.value = o.value.map(
421
- (P, A) => A === g ? {
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)(w),
425
- l.value
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: l.value }),
431
- "helper-text": a(n)("inventory.unit.measurement.conversionHelper", {
432
- measurementSymbol: e.modelValue.measurements[g].name || " measurement unit",
433
- conversion: +a(Y)(e.modelValue.measurements[g].conversion),
434
- unitSymbol: k.value || "base unit"
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
- }), ot = { class: "flex gap-4" }, nt = /* @__PURE__ */ H({
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: U.READ }
452
+ mode: { default: w.READ }
453
453
  },
454
454
  emits: ["update:show"],
455
455
  setup(S) {
456
- const p = S, y = K(), i = ne(), { t: r } = G(), n = ee(p, "show"), m = ee(p, "unit"), c = h(() => {
457
- switch (p.mode) {
458
- case U.READ:
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 U.UPDATE:
460
+ case w.UPDATE:
461
461
  return r("inventory.unit.update.title");
462
- case U.CREATE:
462
+ case w.CREATE:
463
463
  return r("inventory.unit.create.title");
464
464
  }
465
465
  return "";
466
- }), k = h(() => {
467
- switch (p.mode) {
468
- case U.READ:
466
+ }), p = V(() => {
467
+ switch (f.mode) {
468
+ case w.READ:
469
469
  return "";
470
- case U.UPDATE:
470
+ case w.UPDATE:
471
471
  return r("common.save");
472
- case U.CREATE:
472
+ case w.CREATE:
473
473
  return r("common.add");
474
474
  }
475
475
  return "";
476
- }), l = R(), o = R(!1);
476
+ }), s = R(), n = R(!1);
477
477
  async function u() {
478
- o.value = !0;
478
+ n.value = !0;
479
479
  try {
480
- const t = oe(m.value);
481
- t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await y.createUnit(t), n.value = !1, i.open({
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
- o.value = !1;
493
+ n.value = !1;
494
494
  }
495
495
  }
496
- async function b() {
497
- o.value = !0;
496
+ async function g() {
497
+ n.value = !0;
498
498
  try {
499
- await y.updateUnit(m.value), n.value = !1, i.open({
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
- o.value = !1;
511
+ n.value = !1;
512
512
  }
513
513
  }
514
- function V() {
514
+ function U() {
515
515
  var t, d;
516
- (d = (t = l.value) == null ? void 0 : t.validateInputs) == null || d.call(t);
516
+ (d = (t = s.value) == null ? void 0 : t.validateInputs) == null || d.call(t);
517
517
  }
518
518
  function e() {
519
- switch (p.mode) {
520
- case U.READ:
519
+ switch (f.mode) {
520
+ case w.READ:
521
521
  return;
522
- case U.UPDATE:
523
- return b();
524
- case U.CREATE:
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 f(), T(D, {
531
- "model-value": a(n),
532
- "onUpdate:modelValue": d[3] || (d[3] = (_) => X(n) ? n.value = _ : null),
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
- s("div", ot, [
540
- v($, {
541
- loading: o.value,
542
- label: k.value,
543
- onClick: V
539
+ l("div", Xe, [
540
+ y($, {
541
+ loading: n.value,
542
+ label: p.value,
543
+ onClick: U
544
544
  }, null, 8, ["loading", "label"]),
545
- v($, {
546
- disabled: o.value,
545
+ y($, {
546
+ disabled: n.value,
547
547
  label: a(r)("common.close"),
548
548
  variant: "tertiary",
549
- onClick: d[2] || (d[2] = (_) => n.value = !1)
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
- v(tt, {
554
+ y(We, {
555
555
  class: "w-full",
556
556
  ref_key: "hasValidationExpose",
557
- ref: l,
557
+ ref: s,
558
558
  modelValue: a(m),
559
- "onUpdate:modelValue": d[0] || (d[0] = (_) => X(m) ? m.value = _ : null),
559
+ "onUpdate:modelValue": d[0] || (d[0] = (x) => X(m) ? m.value = x : null),
560
560
  mode: t.mode,
561
- disabled: o.value,
562
- "onClick:submit": d[1] || (d[1] = (_) => e())
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
- }), st = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, lt = { class: "flex flex-col py-8" }, at = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = /* @__PURE__ */ H({
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 p = K(), y = pe(), i = h(() => p.units), { createUnit: r, updateUnit: n } = J(), { unitDialogProps: m, unitViewLoading: c } = ge(J()), { columnDefs: k } = qe();
573
- function l(d) {
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 o = R(""), u = h(() => c.value), { breakpoints: b } = ve(), V = h(() => b.value.xs || b.value.sm ? 10 : 20), e = Ue(), { t } = G();
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 f(), T(we, {
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": l
584
+ "onClick:action": s
585
585
  }, {
586
586
  default: I(() => [
587
- s("div", st, [
588
- v(Ce, {
587
+ l("div", et, [
588
+ y(Ce, {
589
589
  searchable: "",
590
- search: o.value,
591
- "onUpdate:search": $[0] || ($[0] = (_) => o.value = _)
590
+ search: n.value,
591
+ "onUpdate:search": $[0] || ($[0] = (x) => n.value = x)
592
592
  }, null, 8, ["search"]),
593
- v(D, {
594
- style: le(a(e).tableHeight),
595
- "column-defs": a(k),
593
+ y(D, {
594
+ style: se(a(e).tableHeight),
595
+ "column-defs": a(p),
596
596
  "row-data": i.value,
597
- "search-value": o.value,
598
- loading: !a(y)._currentLocation || u.value,
599
- onRowClick: $[1] || ($[1] = (_) => a(n)(_.original)),
600
- "page-size": V.value
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
- v(he, {
604
- row: _,
605
- onRowClick: a(n)
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, g, w, P, A, Q, L, W;
608
+ var M, F, _, C, P, A, Q, L, W;
609
609
  return [
610
- s("div", lt, [
611
- s("div", at, [
612
- v(a(Ve), {
613
- render: (g = (F = (M = B.name) == null ? void 0 : M.column) == null ? void 0 : F.columnDef) == null ? void 0 : g.cell,
614
- props: (P = (w = B.name) == null ? void 0 : w.getContext) == null ? void 0 : P.call(w)
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
- s("div", rt, x((W = (L = (Q = (A = _.original.measurements) == null ? void 0 : A.map) == null ? void 0 : Q.call(A, (se) => se.name)) == null ? void 0 : L.join) == null ? void 0 : W.call(L, ", ")), 1)
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
- (f(), T(ae, { to: "body" }, [
628
- v(nt, re(ie(a(m))), null, 16)
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
- gt as default
637
+ vt as default
638
638
  };