@feedmepos/mf-inventory-portal 0.0.23-dev.9 → 0.0.24-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 (140) hide show
  1. package/dist/App-D3sNH2MR.js +276 -0
  2. package/dist/{ApprovalView-e85YmdZN.js → ApprovalView-DHnRx0hJ.js} +17 -20
  3. package/dist/{BindingsDialog-giBUD0IH.js → BindingsDialog-oTeg2Dai.js} +6 -6
  4. package/dist/{BindingsPicker-CC4MmPbF.js → BindingsPicker-CWdjmMJ3.js} +8 -9
  5. package/dist/{BindingsTable-WphZdzrA.js → BindingsTable-bKLR1OKX.js} +18 -22
  6. package/dist/ClosingDraftView-CIQVz7lY.js +1225 -0
  7. package/dist/{ClosingTemplateView-1lzoDyet.js → ClosingTemplateView-D5pLzQwU.js} +259 -274
  8. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-ClLDcchC.js +142 -0
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Cv-vvzr5.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B_c6Vn6P.js} +23 -24
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DIFQcrc0.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DhpHOaRH.js} +50 -51
  11. package/dist/{IngredientGroupView-UegBM_JK.js → IngredientGroupView-4C437mso.js} +63 -70
  12. package/dist/IngredientsView-DoiGgjre.js +1706 -0
  13. package/dist/{IntegrationView-FYNNzKia.js → IntegrationView-8ZKE7MAM.js} +123 -126
  14. package/dist/{InventoryBindingForm-DsHv_IHG.js → InventoryBindingForm-CcnfliYQ.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BURSXafS.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B_J-6C9x.js} +116 -108
  16. package/dist/{InventoryBindingSummary-BLb4MRPZ.js → InventoryBindingSummary-CRdHCzNE.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BG78-DHs.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B2-TypU0.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CqID5_7v.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BuQde75S.js} +20 -21
  19. package/dist/PublishView-t5gjGmK_.js +192 -0
  20. package/dist/{PurchaseOrderPrintPreview-BBMU3teq.js → PurchaseOrderPrintPreview-6i53Y-v1.js} +13 -14
  21. package/dist/ReceiveRequestView-uOeSh0Mr.js +1866 -0
  22. package/dist/RecipeView-BTWywckD.js +609 -0
  23. package/dist/StockView-DN2xk8ei.js +1817 -0
  24. package/dist/{SupplierView-B2aObtwK.js → SupplierView-l0XUg3J4.js} +185 -196
  25. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CWMn6fFf.js +1327 -0
  26. package/dist/TransferTemplateView-wDKXpCWZ.js +1263 -0
  27. package/dist/UnitView-CUI-k-tS.js +648 -0
  28. package/dist/{WarehouseView-G8pej6Y2.js → WarehouseView-WsI_eG5r.js} +190 -197
  29. package/dist/api/adjustment-template.d.ts +25 -0
  30. package/dist/api/bill.d.ts +240 -84
  31. package/dist/api/inventory.d.ts +19 -6
  32. package/dist/api/netsuite.d.ts +3 -3
  33. package/dist/app-DntcWR3_.js +85558 -0
  34. package/dist/app.d.ts +85 -0
  35. package/dist/app.js +2 -2
  36. package/dist/components/FmCustomAttribute.vue.d.ts +23 -0
  37. package/dist/components/FmLockableField.vue.d.ts +37 -0
  38. package/dist/components/FmMultiselectDialogProps.d.ts +1 -0
  39. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +3 -1
  40. package/dist/components/shell/inventory/binding-ui.vue.d.ts +3 -1
  41. package/dist/composable/defineDeepModel.d.ts +1 -1
  42. package/dist/{decimal-DC07xoJW.js → decimal-DTCTnMwO.js} +1 -1
  43. package/dist/format-unit-display-Hy48Iw5j.js +1215 -0
  44. package/dist/index-Bv9RYyTZ.js +29202 -0
  45. package/dist/{StockView-C5btudss.js → index-D4yJP9I2.js} +2220 -3863
  46. package/dist/layout/SingleColumnLayout.vue.d.ts +1 -0
  47. package/dist/router/name.d.ts +2 -0
  48. package/dist/stock-BsdmfT-b.js +125 -0
  49. package/dist/stores/feature.d.ts +41 -1
  50. package/dist/stores/integration/netsuite.d.ts +3 -2
  51. package/dist/stores/inventory.d.ts +20 -8
  52. package/dist/stores/location.d.ts +29 -1
  53. package/dist/stores/supplier.d.ts +1 -1
  54. package/dist/style.css +1 -1
  55. package/dist/supplier-CXhkgC4M.js +77 -0
  56. package/dist/tsconfig.app.tsbuildinfo +1 -1
  57. package/dist/{use-inventory-binding-dialog-B0G2XYSw.js → use-inventory-binding-dialog-DPMJmBCr.js} +10 -11
  58. package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +2 -0
  59. package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +18 -0
  60. package/dist/views/adjustment-template/import/export.d.ts +60 -0
  61. package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +2 -0
  62. package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +22 -0
  63. package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +6 -0
  64. package/dist/views/adjustment-template/wastage-template/WastageTemplateReason.vue.d.ts +18 -0
  65. package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +2 -0
  66. package/dist/views/adjustment-template/wastage-template/actions.d.ts +1377 -0
  67. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +16 -0
  68. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +35 -0
  69. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +20 -0
  70. package/dist/views/adjustment-template/wastage-template/props.d.ts +36 -0
  71. package/dist/views/adjustment-template/wastage-template/table.d.ts +1351 -0
  72. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +198 -12
  73. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +7 -4
  74. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1559 -467
  75. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +19 -0
  76. package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +4 -0
  77. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +2 -1
  78. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +72 -12
  79. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +73 -13
  80. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +6 -3
  81. package/dist/views/ingredients/components/convert/ConvertFormProps.d.ts +1 -0
  82. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +4 -2
  83. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +1 -0
  84. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +2 -1
  85. package/dist/views/publish/PublishView.vue.d.ts +2 -0
  86. package/dist/views/receive-request/components/netsuite/NetSuiteInfo.vue.d.ts +12 -0
  87. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +13 -0
  88. package/dist/views/receive-request/components/netsuite/NetSuiteSync.vue.d.ts +12 -0
  89. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +13 -0
  90. package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +1 -1
  91. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +86 -17
  92. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +4 -2
  93. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -1
  94. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +126 -24
  95. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +126 -24
  96. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -0
  97. package/dist/views/stock/components/StockRecordCard.vue.d.ts +120 -42
  98. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +6 -4
  99. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  100. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +4 -0
  101. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +2 -1
  102. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +72 -12
  103. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +72 -12
  104. package/dist/views/transfer-template/helpers/import-export.helper.d.ts +2 -1
  105. package/dist/vue-i18n-ByVzHsI7.js +2365 -0
  106. package/package.json +5 -4
  107. package/dist/App-ByLgARNp.js +0 -259
  108. package/dist/ClosingDraftView-CQM1Sx45.js +0 -755
  109. package/dist/FmDroppableField-8RzKjEdL.js +0 -154
  110. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BvkN-71q.js +0 -436
  111. package/dist/FmMultiselectDialog-DScMA6iG.js +0 -415
  112. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-t4pim_k9.js +0 -51
  113. package/dist/IngredientsView-BfW-jZLM.js +0 -1666
  114. package/dist/ReceiveRequestView-vbANEzne.js +0 -4165
  115. package/dist/RecipeView-DW4DY0C0.js +0 -598
  116. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +0 -135
  117. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-B2LOvVef.js +0 -1229
  118. package/dist/TransferTemplateView-BKumN_p6.js +0 -1262
  119. package/dist/UnitView-CHLucv9s.js +0 -648
  120. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  121. package/dist/app-BXjk74IB.js +0 -33538
  122. package/dist/date2-CWAt9bRf.js +0 -117
  123. package/dist/dayjs.min-D3jPOnu6.js +0 -282
  124. package/dist/defineDeepModel-CiD4GtOw.js +0 -13
  125. package/dist/feature-6tcLMotY.js +0 -92
  126. package/dist/form-mode.enum-BKiNVH6A.js +0 -4
  127. package/dist/format-time-from-id-CYU5Z9Mt.js +0 -15
  128. package/dist/format-unit-display-CY-0bznr.js +0 -1217
  129. package/dist/fuzzy-BMkhNYLR.js +0 -41
  130. package/dist/index-BXwQa14X.js +0 -45
  131. package/dist/index-CRLd5xyg.js +0 -22283
  132. package/dist/index-DqwAtOgI.js +0 -12087
  133. package/dist/netsuite-fYUUk_ss.js +0 -225
  134. package/dist/row-action.enum-7rGLGZ5v.js +0 -55
  135. package/dist/rules-BmRGm3yv.js +0 -203
  136. package/dist/stock-CEX0DP2B.js +0 -111
  137. package/dist/supplier-CdJmZr7w.js +0 -77
  138. package/dist/use-template-enabled-locations-2-xbPJWHCs.js +0 -86
  139. package/dist/xlsx-CTOKp7SQ.js +0 -24004
  140. package/dist/xlsx.util-D5NFSfDg.js +0 -78
@@ -1,648 +0,0 @@
1
- import { defineComponent as K, computed as _, openBlock as v, createElementBlock as w, createElementVNode as l, Fragment as q, renderList as H, toDisplayString as V, createCommentVNode as Y, ref as M, resolveComponent as I, createBlock as T, withCtx as R, createVNode as y, unref as a, isRef as Z, normalizeClass as ae, normalizeStyle as re, Teleport as ie, normalizeProps as ue, guardReactiveProps as de } from "vue";
2
- import { a as G, S as me, c as ne, h as ee, u as ce } from "./app-BXjk74IB.js";
3
- import { useDialog as pe, useSnackbar as le, useProxiedModel as te, useBreakpoints as fe } from "@feedmepos/ui-library";
4
- import { i as ve, _ as ye } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { F as U } from "./form-mode.enum-BKiNVH6A.js";
6
- import { defineStore as be, storeToRefs as ge } from "pinia";
7
- import { D as oe, R as N } from "./row-action.enum-7rGLGZ5v.js";
8
- import { c as xe, _ as _e, F as he } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
9
- import { useI18n as O } from "@feedmepos/mf-common";
10
- import { u as Ve, _ as Ue, a as we } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BvkN-71q.js";
11
- import { R as j, A as Ce, a as J, c as ke, d as Fe } from "./rules-BmRGm3yv.js";
12
- import { F as Se } from "./decimal-DC07xoJW.js";
13
- import { _ as $e } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BG78-DHs.js";
14
- const Ee = { class: "flex flex-col gap-8" }, Ie = {
15
- key: 0,
16
- class: "flex flex-col"
17
- }, De = { class: "flex-1 py-8 px-16" }, Ae = {
18
- class: "flex-0 py-8 px-16",
19
- style: { "flex-basis": "240px" }
20
- }, Re = {
21
- key: 1,
22
- class: "flex flex-col"
23
- }, Me = { class: "flex-1 py-8 px-16" }, Pe = {
24
- class: "flex-0 py-8 px-16",
25
- style: { "flex-basis": "240px" }
26
- }, Te = {
27
- key: 2,
28
- class: "flex flex-col"
29
- }, Be = { class: "flex-1 py-8 px-16" }, ze = {
30
- class: "flex-0 py-8 px-16",
31
- style: { "flex-basis": "240px" }
32
- }, Le = /* @__PURE__ */ K({
33
- __name: "UnitUsedBy",
34
- props: {
35
- unit: {}
36
- },
37
- setup(k) {
38
- const f = k, b = G(), i = _(() => b.validateUnitUsage(f.unit)), r = _(() => i.value.filter((c) => c.from === "INGREDIENT")), n = _(() => i.value.filter((c) => c.from === "RECIPE")), m = _(() => i.value.filter((c) => c.from === "MENU"));
39
- return (c, p) => (v(), w("div", Ee, [
40
- p[3] || (p[3] = l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1)),
41
- r.value.length ? (v(), w("div", Ie, [
42
- 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" }, [
43
- l("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
44
- l("div", {
45
- class: "flex-0 py-8 px-16",
46
- style: { "flex-basis": "240px" }
47
- }, "Used in")
48
- ], -1)),
49
- (v(!0), w(q, null, H(r.value, (s) => {
50
- var o;
51
- return v(), w("div", {
52
- key: s.code,
53
- class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
54
- }, [
55
- l("div", De, V(s.code) + " " + V(s.name), 1),
56
- l("div", Ae, V((o = s.bindedIngredient) != null && o.length ? "Convert binding" : "Item unit"), 1)
57
- ]);
58
- }), 128))
59
- ])) : Y("", !0),
60
- n.value.length ? (v(), w("div", Re, [
61
- 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" }, [
62
- l("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
63
- l("div", {
64
- class: "flex-0 py-8 px-16",
65
- style: { "flex-basis": "240px" }
66
- }, "Used in")
67
- ], -1)),
68
- (v(!0), w(q, null, H(n.value, (s) => {
69
- var o, u, g;
70
- return v(), w("div", {
71
- key: s.code,
72
- class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
73
- }, [
74
- l("div", Me, V(s.code) + " " + V(s.name), 1),
75
- l("div", Pe, V((o = s.bindedIngredient) == null ? void 0 : o.slice(0, 3).map((x) => x.code).join(", ")) + " " + V(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
76
- ]);
77
- }), 128))
78
- ])) : Y("", !0),
79
- m.value.length ? (v(), w("div", Te, [
80
- 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" }, [
81
- l("div", { class: "flex-1 py-8 px-16" }, "Menu"),
82
- l("div", {
83
- class: "flex-0 py-8 px-16",
84
- style: { "flex-basis": "240px" }
85
- }, "Used in")
86
- ], -1)),
87
- (v(!0), w(q, null, H(m.value, (s) => {
88
- var o, u, g;
89
- return v(), w("div", {
90
- key: s.code,
91
- class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
92
- }, [
93
- l("div", Be, V(s.code) + " " + V(s.name), 1),
94
- l("div", ze, V((o = s.bindedIngredient) == null ? void 0 : o.slice(0, 3).map((x) => x.code).join(", ")) + " " + V(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
95
- ]);
96
- }), 128))
97
- ])) : Y("", !0)
98
- ]));
99
- }
100
- }), Q = be("unitForm", function() {
101
- const f = pe(), b = le(), i = G(), r = M(!1), n = M();
102
- function m() {
103
- const o = {
104
- unit: {},
105
- mode: U.CREATE,
106
- show: !0,
107
- "onUpdate:show"(u) {
108
- n.value.show = u;
109
- }
110
- };
111
- n.value = o;
112
- }
113
- async function c(o) {
114
- const u = {
115
- unit: o,
116
- mode: U.UPDATE,
117
- show: !0,
118
- "onUpdate:show"(g) {
119
- n.value.show = g;
120
- }
121
- };
122
- n.value = u;
123
- }
124
- async function p(o) {
125
- r.value = !0;
126
- try {
127
- await i.deleteUnit(o), b.open({
128
- title: "Success",
129
- message: `Deleted ${o.name}`,
130
- type: "success"
131
- });
132
- } catch (u) {
133
- u instanceof me && ve(u) ? f.open({
134
- title: "Cannot delete unit",
135
- contentComponent: ye,
136
- contentComponentProps: {
137
- subject: (o == null ? void 0 : o.name) ?? "",
138
- items: u.errorResponse.message
139
- },
140
- secondaryActions: {
141
- text: "Close",
142
- close: !0
143
- }
144
- }) : console.log("unable to delete unit", u), b.open({
145
- title: `Cannot delete ${o.name}`,
146
- message: "Please try again.",
147
- type: "error"
148
- }), console.error("failed to delete unit", u);
149
- } finally {
150
- r.value = !1;
151
- }
152
- }
153
- function s(o) {
154
- if (i.validateUnitUsage(o).length) {
155
- f.open({
156
- title: `Cannot delete ${(o == null ? void 0 : o.name) ?? "unit"}`,
157
- overlay: !0,
158
- dismissAway: !0,
159
- closeButton: !0,
160
- contentComponent: Le,
161
- contentComponentProps: {
162
- unit: o
163
- },
164
- primaryActions: {
165
- text: "Confirm",
166
- close: !0
167
- }
168
- });
169
- return;
170
- }
171
- f.open({
172
- title: `Delete ${(o == null ? void 0 : o.name) ?? "unit"}?`,
173
- closeButton: !1,
174
- message: "You may not be able to delete this unit if it is linked in any of the inventory modules.",
175
- primaryActions: {
176
- text: "Delete",
177
- close: !0,
178
- variant: "destructive"
179
- },
180
- secondaryActions: {
181
- text: "Cancel",
182
- close: !0
183
- }
184
- }).onPrimary(() => p(o));
185
- }
186
- return {
187
- createUnit: m,
188
- updateUnit: c,
189
- deleteUnit: s,
190
- unitDialogProps: n,
191
- unitViewLoading: r
192
- };
193
- });
194
- function Ne() {
195
- const { updateUnit: k, deleteUnit: f } = Q(), { t: b } = O();
196
- async function i(n, m) {
197
- const c = ne(m);
198
- if (n === N.Edit) {
199
- await k(c);
200
- return;
201
- }
202
- if (n === N.Delete) {
203
- await f(c);
204
- return;
205
- }
206
- }
207
- return { columnDefs: [
208
- {
209
- accessorKey: "name",
210
- header: b("inventory.unit.table.name"),
211
- enableSorting: !0,
212
- size: 300
213
- },
214
- {
215
- accessorKey: "abbrev",
216
- header: b("inventory.unit.table.symbol"),
217
- enableSorting: !1,
218
- size: "auto"
219
- },
220
- {
221
- id: "action",
222
- header: "",
223
- cell(n) {
224
- return xe(
225
- [oe[N.Edit], oe[N.Delete]],
226
- (m) => {
227
- i(m, n.row.original);
228
- }
229
- );
230
- },
231
- enableSorting: !1,
232
- size: 40,
233
- meta: {
234
- cellClass: "",
235
- headerClass: ""
236
- }
237
- }
238
- ] };
239
- }
240
- const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He = { class: "flex-1" }, Ke = { class: "flex-1" }, Ge = { class: "flex" }, Oe = { class: "flex items-center" }, Ye = { class: "fm-typo-en-body-lg-600 flex-grow" }, Je = { class: "flex flex-col gap-24" }, Qe = { class: "flex gap-24" }, We = { class: "flex-1" }, Xe = { class: "flex-1" }, Ze = /* @__PURE__ */ K({
241
- __name: "UnitForm",
242
- props: {
243
- mode: {},
244
- modelValue: {},
245
- disabled: { type: Boolean }
246
- },
247
- emits: ["update:modelValue", "click:submit"],
248
- setup(k, { expose: f, emit: b }) {
249
- const i = k, r = b, { t: n } = O();
250
- function m() {
251
- r("click:submit");
252
- }
253
- const c = _({
254
- get() {
255
- var e;
256
- return ((e = i.modelValue) == null ? void 0 : e.name) ?? "";
257
- },
258
- set(e) {
259
- const t = i.modelValue ?? {};
260
- t.name = e, r("update:modelValue", t);
261
- }
262
- }), p = _({
263
- get() {
264
- var e;
265
- return ((e = i.modelValue) == null ? void 0 : e.abbrev) ?? "";
266
- },
267
- set(e) {
268
- const t = i.modelValue ?? {};
269
- t.abbrev = e, r("update:modelValue", t);
270
- }
271
- }), s = _({
272
- get() {
273
- var e;
274
- return ((e = i.modelValue) == null ? void 0 : e.precision) ?? 0;
275
- },
276
- set(e) {
277
- const t = i.modelValue ?? {};
278
- t.precision = e, r("update:modelValue", t);
279
- }
280
- }), o = _({
281
- get() {
282
- var e;
283
- return ((e = i.modelValue) == null ? void 0 : e.measurements) ?? [];
284
- },
285
- set(e) {
286
- const t = i.modelValue ?? {};
287
- t.measurements = e, r("update:modelValue", t);
288
- }
289
- });
290
- function u() {
291
- const e = i.modelValue ?? {}, t = e.measurements ?? [];
292
- e.measurements = [
293
- ...t,
294
- {
295
- id: `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
296
- name: "",
297
- abbrev: "",
298
- conversion: {
299
- amount: 1,
300
- precision: 0
301
- }
302
- }
303
- ], r("update:modelValue", e);
304
- }
305
- function g(e) {
306
- const t = i.modelValue ?? {}, d = t.measurements ?? [];
307
- d.splice(e, 1), t.measurements = d, r("update:modelValue", t);
308
- }
309
- const x = M();
310
- return f({
311
- validateInputs: () => {
312
- var e, t;
313
- (t = (e = x.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
314
- },
315
- resetInputsValidation: () => {
316
- var e, t;
317
- (t = (e = x.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
318
- },
319
- resetInputs: () => {
320
- var e, t;
321
- (t = (e = x.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
322
- }
323
- }), (e, t) => {
324
- const d = I("FmTextField"), D = I("FmStepperField"), F = I("FmButton"), S = I("FmCard"), E = I("FmForm");
325
- return v(), T(E, {
326
- ref_key: "formRef",
327
- ref: x,
328
- class: "flex flex-col gap-40",
329
- onValidationSuccess: m
330
- }, {
331
- default: R(() => {
332
- var P;
333
- return [
334
- l("div", je, [
335
- l("div", qe, [
336
- l("div", He, [
337
- y(d, {
338
- disabled: e.disabled,
339
- label: a(n)("inventory.unit.name"),
340
- modelValue: c.value,
341
- "onUpdate:modelValue": t[0] || (t[0] = (C) => c.value = C),
342
- rules: [a(j)()],
343
- "label-mark": "required"
344
- }, null, 8, ["disabled", "label", "modelValue", "rules"])
345
- ]),
346
- l("div", Ke, [
347
- y(d, {
348
- disabled: e.disabled,
349
- label: a(n)("inventory.unit.symbol"),
350
- modelValue: p.value,
351
- "onUpdate:modelValue": t[1] || (t[1] = (C) => p.value = C),
352
- rules: [a(j)()],
353
- "label-mark": "required"
354
- }, null, 8, ["disabled", "label", "modelValue", "rules"])
355
- ])
356
- ]),
357
- l("div", null, [
358
- y(D, {
359
- disabled: e.disabled,
360
- class: "col-span-3",
361
- label: a(n)("inventory.unit.precision"),
362
- modelValue: s.value,
363
- "onUpdate:modelValue": t[2] || (t[2] = (C) => s.value = C),
364
- rules: [a(Ce)(0)]
365
- }, null, 8, ["disabled", "label", "modelValue", "rules"])
366
- ])
367
- ]),
368
- l("div", Ge, [
369
- y(F, {
370
- disabled: e.disabled,
371
- type: "button",
372
- "prepend-icon": "add",
373
- label: a(n)("inventory.unit.measurement.addMeasurement"),
374
- variant: "plain",
375
- onClick: u
376
- }, null, 8, ["disabled", "label"])
377
- ]),
378
- (v(!0), w(q, null, H((P = e.modelValue) == null ? void 0 : P.measurements, (C, h) => (v(), T(S, {
379
- class: "flex flex-col gap-16 p-16",
380
- variant: "outlined",
381
- key: C.id
382
- }, {
383
- default: R(() => [
384
- l("div", Oe, [
385
- l("div", Ye, V(a(n)("inventory.unit.measurement.measurementDefault", [h + 1])), 1),
386
- y(F, {
387
- disabled: e.disabled,
388
- variant: "tertiary",
389
- "prepend-icon": "delete",
390
- onClick: ($) => g(h)
391
- }, null, 8, ["disabled", "onClick"])
392
- ]),
393
- l("div", Je, [
394
- l("div", Qe, [
395
- l("div", We, [
396
- y(d, {
397
- disabled: e.disabled,
398
- class: "col-span-2",
399
- label: a(n)("inventory.unit.measurement.name"),
400
- modelValue: e.modelValue.measurements[h].name,
401
- "onUpdate:modelValue": ($) => e.modelValue.measurements[h].name = $,
402
- rules: [a(j)()],
403
- "label-mark": "required"
404
- }, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
405
- ]),
406
- l("div", Xe, [
407
- y(d, {
408
- disabled: e.disabled,
409
- label: a(n)("inventory.unit.measurement.symbol"),
410
- modelValue: e.modelValue.measurements[h].abbrev,
411
- "onUpdate:modelValue": ($) => e.modelValue.measurements[h].abbrev = $,
412
- rules: [a(j)()],
413
- "label-mark": "required"
414
- }, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
415
- ])
416
- ]),
417
- y($e, {
418
- disabled: e.disabled,
419
- class: "col-span-3",
420
- label: a(n)("inventory.unit.measurement.conversion"),
421
- "model-value": +a(J)(e.modelValue.measurements[h].conversion),
422
- "onUpdate:modelValue": ($) => o.value = o.value.map(
423
- (A, B) => B === h ? {
424
- ...A,
425
- conversion: a(Se).toPrecision(
426
- a(ke)($),
427
- s.value
428
- )
429
- } : A
430
- ),
431
- rules: [a(Fe)(0)],
432
- step: +a(J)({ amount: 1, precision: s.value }),
433
- "helper-text": a(n)("inventory.unit.measurement.conversionHelper", {
434
- measurementSymbol: e.modelValue.measurements[h].name || " measurement unit",
435
- conversion: +a(J)(e.modelValue.measurements[h].conversion),
436
- unitSymbol: p.value || "base unit"
437
- })
438
- }, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue", "rules", "step", "helper-text"])
439
- ])
440
- ]),
441
- _: 2
442
- }, 1024))), 128))
443
- ];
444
- }),
445
- _: 1
446
- }, 512);
447
- };
448
- }
449
- }), et = { class: "flex gap-4" }, tt = /* @__PURE__ */ K({
450
- __name: "UnitDialog",
451
- props: {
452
- show: { type: Boolean },
453
- unit: {},
454
- mode: { default: U.READ }
455
- },
456
- emits: ["update:show"],
457
- setup(k) {
458
- const f = k, b = G(), i = le(), { t: r } = O(), n = te(f, "show"), m = te(f, "unit"), c = _(() => {
459
- switch (f.mode) {
460
- case U.READ:
461
- return "";
462
- case U.UPDATE:
463
- return r("inventory.unit.update.title");
464
- case U.CREATE:
465
- return r("inventory.unit.create.title");
466
- }
467
- return "";
468
- }), p = _(() => {
469
- switch (f.mode) {
470
- case U.READ:
471
- return "";
472
- case U.UPDATE:
473
- return r("common.save");
474
- case U.CREATE:
475
- return r("common.add");
476
- }
477
- return "";
478
- }), s = M(), o = M(!1);
479
- async function u() {
480
- o.value = !0;
481
- try {
482
- const t = ne(m.value);
483
- t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), n.value = !1, i.open({
484
- title: r("inventory.common.success"),
485
- message: r("inventory.unit.create.success", { name: m.value.name }),
486
- type: "success"
487
- });
488
- } catch (t) {
489
- t instanceof ee || i.open({
490
- title: r("inventory.unit.create.error.title"),
491
- message: r("inventory.unit.create.error.message"),
492
- type: "error"
493
- });
494
- } finally {
495
- o.value = !1;
496
- }
497
- }
498
- async function g() {
499
- o.value = !0;
500
- try {
501
- await b.updateUnit(m.value), n.value = !1, i.open({
502
- title: r("inventory.common.success"),
503
- message: r("inventory.unit.update.success", { name: m.value.name }),
504
- type: "success"
505
- });
506
- } catch (t) {
507
- t instanceof ee || i.open({
508
- title: r("inventory.unit.update.error.title"),
509
- message: r("inventory.unit.update.error.message"),
510
- type: "error"
511
- });
512
- } finally {
513
- o.value = !1;
514
- }
515
- }
516
- function x() {
517
- var t, d;
518
- (d = (t = s.value) == null ? void 0 : t.validateInputs) == null || d.call(t);
519
- }
520
- function e() {
521
- switch (f.mode) {
522
- case U.READ:
523
- return;
524
- case U.UPDATE:
525
- return g();
526
- case U.CREATE:
527
- return u();
528
- }
529
- }
530
- return (t, d) => {
531
- const D = I("FmButton"), F = I("FmSideSheet");
532
- return v(), T(F, {
533
- "model-value": a(n),
534
- "onUpdate:modelValue": d[3] || (d[3] = (S) => Z(n) ? n.value = S : null),
535
- header: c.value,
536
- "close-button": "",
537
- "dismiss-away": "",
538
- "max-width": 500
539
- }, {
540
- "side-sheet-footer": R(() => [
541
- l("div", et, [
542
- y(D, {
543
- loading: o.value,
544
- label: p.value,
545
- onClick: x
546
- }, null, 8, ["loading", "label"]),
547
- y(D, {
548
- disabled: o.value,
549
- label: a(r)("common.close"),
550
- variant: "tertiary",
551
- onClick: d[2] || (d[2] = (S) => n.value = !1)
552
- }, null, 8, ["disabled", "label"])
553
- ])
554
- ]),
555
- default: R(() => [
556
- y(Ze, {
557
- class: "w-full",
558
- ref_key: "hasValidationExpose",
559
- ref: s,
560
- modelValue: a(m),
561
- "onUpdate:modelValue": d[0] || (d[0] = (S) => Z(m) ? m.value = S : null),
562
- mode: t.mode,
563
- disabled: o.value,
564
- "onClick:submit": d[1] || (d[1] = (S) => e())
565
- }, null, 8, ["modelValue", "mode", "disabled"])
566
- ]),
567
- _: 1
568
- }, 8, ["model-value", "header"]);
569
- };
570
- }
571
- }), ot = { class: "flex flex-col py-8" }, nt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = /* @__PURE__ */ K({
572
- __name: "UnitView",
573
- setup(k) {
574
- const f = G(), b = ce(), i = _(() => f.units), { createUnit: r, updateUnit: n } = Q(), { unitDialogProps: m, unitViewLoading: c } = ge(Q()), { columnDefs: p } = Ne();
575
- function s(D) {
576
- D === "add" && r();
577
- }
578
- const o = M(""), u = _(() => c.value), { breakpoints: g } = fe(), x = _(() => g.value.xs || g.value.sm), e = _(() => x.value ? 10 : 20), t = Ve(), { t: d } = O();
579
- return (D, F) => {
580
- const S = I("FmTable");
581
- return v(), T(Ue, {
582
- title: a(d)("inventory.unit.title"),
583
- actions: [
584
- { label: a(d)("inventory.unit.create.title"), value: "add", isPrimary: !0, prependIcon: "add" }
585
- ],
586
- "onClick:action": s
587
- }, {
588
- default: R(() => [
589
- l("div", {
590
- class: ae([
591
- "flex flex-col gap-8 max-h-full",
592
- {
593
- "p-0": x.value,
594
- "px-24 ": !x.value
595
- }
596
- ])
597
- }, [
598
- y(we, {
599
- searchable: "",
600
- search: o.value,
601
- "onUpdate:search": F[0] || (F[0] = (E) => o.value = E)
602
- }, null, 8, ["search"]),
603
- y(S, {
604
- style: re(a(t).tableHeight),
605
- "column-defs": a(p),
606
- "row-data": i.value,
607
- "search-value": o.value,
608
- loading: !a(b)._currentLocation || u.value,
609
- onRowClick: F[1] || (F[1] = (E) => a(n)(E.original)),
610
- "page-size": e.value
611
- }, {
612
- "list-row": R((E) => [
613
- y(_e, {
614
- row: E,
615
- onRowClick: a(n)
616
- }, {
617
- default: R((P) => {
618
- var C, h, $, A, B, z, W, L, X;
619
- return [
620
- l("div", ot, [
621
- l("div", nt, [
622
- y(a(he), {
623
- render: ($ = (h = (C = P.name) == null ? void 0 : C.column) == null ? void 0 : h.columnDef) == null ? void 0 : $.cell,
624
- props: (B = (A = P.name) == null ? void 0 : A.getContext) == null ? void 0 : B.call(A)
625
- }, null, 8, ["render", "props"])
626
- ]),
627
- l("div", lt, V((X = (L = (W = (z = E.original.measurements) == null ? void 0 : z.map) == null ? void 0 : W.call(z, (se) => se.name)) == null ? void 0 : L.join) == null ? void 0 : X.call(L, ", ")), 1)
628
- ])
629
- ];
630
- }),
631
- _: 2
632
- }, 1032, ["row", "onRowClick"])
633
- ]),
634
- _: 1
635
- }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
636
- ], 2),
637
- (v(), T(ie, { to: "body" }, [
638
- y(tt, ue(de(a(m))), null, 16)
639
- ]))
640
- ]),
641
- _: 1
642
- }, 8, ["title", "actions"]);
643
- };
644
- }
645
- });
646
- export {
647
- gt as default
648
- };
@@ -1,9 +0,0 @@
1
- const s = (t, r) => {
2
- const o = t.__vccOpts || t;
3
- for (const [c, e] of r)
4
- o[c] = e;
5
- return o;
6
- };
7
- export {
8
- s as _
9
- };