@feedmepos/mf-inventory-portal 1.8.0-dev.4 → 1.8.0-dev.6

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 (129) hide show
  1. package/dist/{App-FeJnwZme.js → App-B8DzC8Td.js} +609 -558
  2. package/dist/{ApprovalView-Eo-cGWyA.js → ApprovalView-DwHtlnLK.js} +9 -9
  3. package/dist/{BindingsDialog-DkjuXydb.js → BindingsDialog-COSQ6XVU.js} +2 -2
  4. package/dist/{BindingsPicker-DUOQcOlj.js → BindingsPicker-vn2GwOb7.js} +2 -2
  5. package/dist/{BindingsTable-CoDdU5xh.js → BindingsTable-B3-YXiPU.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-BGh8fbEX.js → BulkReceiveRequestView-LUAuL39I.js} +19 -19
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CStISRqy.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Bq2bBCHH.js} +1 -1
  8. package/dist/{ClosingDraftView-Cwnhrv5P.js → ClosingDraftView-BKgjXfss.js} +20 -20
  9. package/dist/{ClosingHistoryView-oHf77Lal.js → ClosingHistoryView-BI_zufKI.js} +5 -5
  10. package/dist/{ClosingTemplateView-1P8J1vAn.js → ClosingTemplateView-CNNgkrX0.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BuEPaqQK.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DGxUjcQc.js} +1 -1
  12. package/dist/{DefaultView-3Z8aVFSU.js → DefaultView-D9ldG5wf.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-uT_e3Suw.js → DeliveryOrderPrintPreview-CnvuZat5.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BCgnXxEi.js → EmailDialog.vue_vue_type_script_setup_true_lang-s0eDfL8g.js} +23 -23
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-2t_ajTtF.js +297 -0
  16. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BlKpGdCx.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Bo4aCSFL.js} +1 -1
  17. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DKkxn1J-.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BhhKFtnX.js} +2 -2
  18. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-dOXDST-E.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Dx8b6nGn.js} +2 -2
  19. package/dist/FmMultiselectDialog-Coxul96n.js +123 -0
  20. package/dist/{FmMultiselectDialog-DRxZAkcu.js → FmMultiselectDialog-zaOH0oB9.js} +2 -2
  21. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DRSzQqVJ.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B0xT-sP9.js} +6 -6
  22. package/dist/ImportView-CuRogJ1u.js +1291 -0
  23. package/dist/{IngredientsView-N9U7tdI_.js → IngredientsView-BnEJ1QAk.js} +34 -35
  24. package/dist/{IntegrationExplorerView-CjmeGQ14.js → IntegrationExplorerView-DB-7hXUE.js} +4 -4
  25. package/dist/{IntegrationView-DAdpmuxx.js → IntegrationView-CBGPi1xL.js} +973 -974
  26. package/dist/{InventoryBindingForm-CAj3MurI.js → InventoryBindingForm-eggGypKW.js} +1 -1
  27. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CvQ82oaY.js +472 -0
  28. package/dist/{InventoryBindingSummary-B-1OBUdw.js → InventoryBindingSummary-DegINJdx.js} +1 -1
  29. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CUYYEuW3.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYq61C5M.js} +1 -1
  30. package/dist/{ProductionRunDetailView-eFvl8-By.js → ProductionRunDetailView-6uJmjwAg.js} +4 -4
  31. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-DaC7e4qS.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-Dcd3sV5C.js} +9 -9
  32. package/dist/{ProductionRunView-C_NJJKLr.js → ProductionRunView-CiypqoQT.js} +3 -3
  33. package/dist/{PublishView-BglAEkzU.js → PublishView-DEyODScT.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-BTF9ikpQ.js → PurchaseOrderPrintPreview-DjsD8HaB.js} +2 -2
  35. package/dist/{ReceiveRequestView-BUvehG10.js → ReceiveRequestView-DGWA-SOC.js} +13 -13
  36. package/dist/RecipeView-CO5kxazA.js +3428 -0
  37. package/dist/{SettingsView-DRR86cHo.js → SettingsView-9uq0QYht.js} +164 -168
  38. package/dist/{StockView-D1oEnbZp.js → StockView-YKfyjTE1.js} +267 -267
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CxU92-io.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C8q3IBMg.js} +1 -1
  40. package/dist/{SupplierView-D68wz0-g.js → SupplierView-D62RB87K.js} +14 -14
  41. package/dist/{SurchargeView-Cw9rTw2h.js → SurchargeView-DY4xuPN0.js} +7 -7
  42. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Az-a1Dsp.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C27rA7Z_.js} +2 -2
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C-sxbacO.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BhhvJtAf.js} +1 -1
  44. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CsHfLaCv.js → TransferDetails.vue_vue_type_script_setup_true_lang-cvgA7DlK.js} +690 -666
  45. package/dist/{TransferTemplateView-CHPJMjYC.js → TransferTemplateView-DZk-6Z-1.js} +20 -20
  46. package/dist/{UnitCostHistoryView-DM8OzWhe.js → UnitCostHistoryView-C-aNhP72.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DpwK5mFH.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-D655ehgk.js} +4 -4
  48. package/dist/{UnitView-90uR-ZzQ.js → UnitView-h2n8XNZr.js} +8 -8
  49. package/dist/{WarehouseView-Bulg6Vac.js → WarehouseView-gPPmrhxB.js} +8 -8
  50. package/dist/{WastageTemplateView-BmAHnnwm.js → WastageTemplateView-7bp-1vTP.js} +15 -15
  51. package/dist/api/feature-flags.d.ts +2 -0
  52. package/dist/api/license.d.ts +0 -2
  53. package/dist/{app-Ccdgbe4f.js → app-_FoXoYBy.js} +1640 -1829
  54. package/dist/app.d.ts +0 -150
  55. package/dist/app.js +1 -1
  56. package/dist/{closing-template-DuBZxoXx.js → closing-template-D8bk-LUW.js} +1 -1
  57. package/dist/{date2-IBrLdtni.js → date2-DE0h0f1Z.js} +1 -1
  58. package/dist/{dayjs.min-DEkq-Hpp.js → dayjs.min-DxnjPhAT.js} +1 -1
  59. package/dist/{decimal-g6jRdlSk.js → decimal-D9ZB4atK.js} +2 -2
  60. package/dist/{defineDeepModel-P5a5Ffpn.js → defineDeepModel-pn4B1f06.js} +1 -1
  61. package/dist/{duplicate-template-Do8s80ei.js → duplicate-template-DS-mr3MQ.js} +1 -1
  62. package/dist/{feature-ChVm5JED.js → feature-D0aaeyga.js} +1999 -3092
  63. package/dist/feature-flags/portal-feature-catalog.d.ts +0 -2
  64. package/dist/{format-time-from-id-BgbBOII7.js → format-time-from-id-CbFUj3BY.js} +1 -1
  65. package/dist/{format-unit-display-hSXy2iu6.js → format-unit-display-DulZiawi.js} +13 -13
  66. package/dist/helper/menu-usage-module.d.ts +1 -1
  67. package/dist/{id-to-date-DlGYysU8.js → id-to-date-CLCvDHvP.js} +1 -1
  68. package/dist/{import-export.helper-LrZhiz2W.js → import-export.helper-Ce1hr39u.js} +6 -6
  69. package/dist/{index-DCiNwlw2.js → index-DDw8ryXI.js} +1 -1
  70. package/dist/{index-DsOmtywr.js → index-DpxJ3TzB.js} +1 -1
  71. package/dist/{index-BTNJ1fk2.js → index-DrkUq9y6.js} +3 -3
  72. package/dist/{lz-string-DRuyjE9G.js → lz-string-BakfyAq0.js} +1 -1
  73. package/dist/{netsuite-B6y8GZCP.js → netsuite-Cn2W-lOV.js} +2 -2
  74. package/dist/{number-Besn-1-5.js → number-B2-Gbof3.js} +3 -3
  75. package/dist/{predefined-templates-D92mN_2S.js → predefined-templates-DmITBHzs.js} +1 -1
  76. package/dist/{purchase-order-template-hvq2pfWx.js → purchase-order-template-BfP6Sy0k.js} +1 -1
  77. package/dist/{recalculationUtils-BlZR5O2G.js → recalculationUtils-BRe2QPvC.js} +1 -1
  78. package/dist/router/name.d.ts +0 -1
  79. package/dist/{row-action.enum-R2bi3eAv.js → row-action.enum-CxzHcy4A.js} +1 -1
  80. package/dist/{rules-DzwoRKUS.js → rules-CjqBvFGt.js} +2 -2
  81. package/dist/{stock-Cq37EARQ.js → stock-BT50AgTx.js} +8 -8
  82. package/dist/{stock-oJqnUrtt.js → stock-CjFjkezq.js} +1 -1
  83. package/dist/stores/feature.d.ts +9 -9
  84. package/dist/stores/inventory.d.ts +0 -47
  85. package/dist/stores/supplier.d.ts +1 -1
  86. package/dist/style.css +1 -1
  87. package/dist/{supplier-DtdwvcPr.js → supplier-wmjWWKaf.js} +2 -2
  88. package/dist/{surcharge-CjdJGIsM.js → surcharge-CQC6Fa7Q.js} +1 -1
  89. package/dist/tsconfig.app.tsbuildinfo +1 -1
  90. package/dist/{uom-rules-BqPn_GoZ.js → uom-rules-CUQleOt4.js} +1 -1
  91. package/dist/{use-ingredient-select-dialog-0hRCj6Fu.js → use-ingredient-select-dialog-7VVHmM7s.js} +2 -2
  92. package/dist/use-inventory-binding-dialog-C8m7iwRG.js +113 -0
  93. package/dist/{use-template-enabled-locations-8ZfTj4YB.js → use-template-enabled-locations-CRgTVDMh.js} +2 -2
  94. package/dist/{use-transfer-locations-BGS1EBEt.js → use-transfer-locations-Bs0PotVA.js} +2 -2
  95. package/dist/{useHrmPermission-BcQ2KPD-.js → useHrmPermission-DcAzZ0CT.js} +1 -1
  96. package/dist/{useNavigationMenu-DImtns81.js → useNavigationMenu-CtihCeyC.js} +65 -74
  97. package/dist/{useSseClient-DPSFFVci.js → useSseClient-CizgYCQI.js} +1 -1
  98. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
  99. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
  100. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
  101. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
  102. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
  103. package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
  104. package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
  105. package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
  106. package/dist/{vue-i18n-DTyGIjTI.js → vue-i18n-DpTQ6ev1.js} +258 -258
  107. package/dist/{xlsx.util-CK9Lnq3Q.js → xlsx.util-CPC0Dkyo.js} +2 -2
  108. package/package.json +2 -2
  109. package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-D_vmtZDZ.js +0 -58
  110. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-D-RzUmqA.js +0 -81
  111. package/dist/FmMultiselectDialog-C8uYx8rr.js +0 -77
  112. package/dist/ImportView-Qigtf3ik.js +0 -1302
  113. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-B8PJeYrP.js +0 -51
  114. package/dist/IngredientGroupView-RNYZLkQu.js +0 -1000
  115. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-3pYuu62C.js +0 -563
  116. package/dist/RecipeView-DO5-jgwh.js +0 -3624
  117. package/dist/feature-flags/premium-flags.spec.d.ts +0 -1
  118. package/dist/random-CSbEbElR.js +0 -10
  119. package/dist/use-inventory-binding-dialog-BLRcIC1u.js +0 -152
  120. package/dist/usePromise-CbVUCxhj.js +0 -29
  121. package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +0 -3
  122. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
  123. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
  124. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
  125. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
  126. package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
  127. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
  128. package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
  129. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
@@ -1,1000 +0,0 @@
1
- import { ref as C, computed as F, h as V, defineComponent as W, watch as ce, resolveComponent as R, createElementBlock as z, openBlock as G, createVNode as b, createElementVNode as c, unref as l, toDisplayString as E, createBlock as U, withCtx as M, Fragment as _e, renderList as be, createTextVNode as ke, createCommentVNode as le, isRef as xe, normalizeClass as he, normalizeStyle as we, createSlots as Re, Teleport as Ie, normalizeProps as Se, guardReactiveProps as Ge } from "vue";
2
- import { a as O, c as N, j as ie, u as Fe } from "./app-Ccdgbe4f.js";
3
- import { useDialog as Ve, useSnackbar as Q, components as L, useProxiedModel as Ce, useBreakpoints as De } from "@feedmepos/ui-library";
4
- import { F as S } from "./form-mode.enum-BKiNVH6A.js";
5
- import { useI18n as q, useCoreStore as Ae } from "@feedmepos/mf-common";
6
- import { defineStore as me, storeToRefs as re } from "pinia";
7
- import { D as ue, R as H } from "./row-action.enum-R2bi3eAv.js";
8
- import { c as $e } from "./component-BmLAdDiY.js";
9
- import { u as Te, _ as Ee } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
10
- import { _ as Me, F as de } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
11
- import { _ as Pe } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-dOXDST-E.js";
12
- import { d as fe } from "./defineDeepModel-P5a5Ffpn.js";
13
- import { I as Ue, A as Be, U as Le, R as pe } from "./rules-DzwoRKUS.js";
14
- import { L as ze, P as Ne, D as Oe } from "./app-C39bYJmq.js";
15
- import { u as qe } from "./FmMultiselectDialog-C8uYx8rr.js";
16
- import { r as ve } from "./random-CSbEbElR.js";
17
- import { u as Ke, R as je } from "./usePromise-CbVUCxhj.js";
18
- import { _ as He } from "./DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-D_vmtZDZ.js";
19
- const J = me(
20
- "ingredientGroupactions",
21
- function() {
22
- const _ = Ve(), p = Q(), k = O(), { t: i } = q(), v = C();
23
- function e() {
24
- const u = {
25
- modelValue: {},
26
- mode: S.CREATE,
27
- show: !0,
28
- "onUpdate:show"(m) {
29
- v.value.show = m;
30
- }
31
- };
32
- v.value = u;
33
- }
34
- async function a(u) {
35
- const m = {
36
- modelValue: N(u),
37
- mode: S.UPDATE,
38
- show: !0,
39
- "onUpdate:show"(r) {
40
- v.value.show = r;
41
- }
42
- };
43
- v.value = m;
44
- }
45
- async function t(u, m, r) {
46
- m.value = !0;
47
- try {
48
- await k.deleteSkuGroup(u), p.open({
49
- title: "Success",
50
- message: `Deleted ${u.name}`,
51
- type: "success"
52
- });
53
- } catch (g) {
54
- p.open({
55
- title: `Cannot delete ${u.name}`,
56
- message: "Please try again.",
57
- type: "error"
58
- }), console.error("failed to delete ingredient", g);
59
- } finally {
60
- m.value = !1, r();
61
- }
62
- }
63
- function n(u, m, r) {
64
- _.open({
65
- title: i("inventory.ingredient.delete.title", [(u == null ? void 0 : u.name) ?? ""]),
66
- closeButton: !1,
67
- message: i("inventory.ingredient.delete.message"),
68
- primaryActions: {
69
- text: i("common.delete"),
70
- close: !0,
71
- variant: "destructive"
72
- },
73
- secondaryActions: {
74
- text: i("common.cancel"),
75
- close: !0
76
- }
77
- }).onPrimary(() => t(u, m, r));
78
- }
79
- function o() {
80
- }
81
- function y() {
82
- }
83
- return {
84
- createIngredientGroup: e,
85
- updateIngredientGroup: a,
86
- deleteIngredientGroup: n,
87
- importIngredientGroups: o,
88
- exportIngredientGroups: y,
89
- ingredientGroupDialogProps: v
90
- };
91
- }
92
- ), We = me(
93
- "ingredientGroupTable",
94
- function() {
95
- const _ = C(!1), p = Q(), k = O(), i = J();
96
- async function v() {
97
- _.value = !0;
98
- try {
99
- await k.readInventory();
100
- } catch (t) {
101
- console.error("error on reading inventory", t), p.open({
102
- title: "Error",
103
- message: "Something went wrong, please try again.",
104
- type: "error"
105
- });
106
- } finally {
107
- _.value = !1;
108
- }
109
- }
110
- function e(t, n) {
111
- switch (n = N(n), t) {
112
- case H.Edit:
113
- return i.updateIngredientGroup(n);
114
- case H.Delete:
115
- return i.deleteIngredientGroup(
116
- n,
117
- _,
118
- () => v()
119
- );
120
- }
121
- }
122
- const a = F(() => [
123
- {
124
- accessorKey: "name",
125
- header: () => "Name"
126
- },
127
- {
128
- accessorKey: "skuRefs.length",
129
- header: () => "No. of items"
130
- },
131
- {
132
- accessorKey: "ref",
133
- header: () => "Reference"
134
- },
135
- {
136
- id: "action",
137
- header: "",
138
- cell(t) {
139
- return $e(
140
- [ue[H.Edit], ue[H.Delete]],
141
- (n) => {
142
- e(n, t.row.original);
143
- }
144
- );
145
- },
146
- enableSorting: !1,
147
- size: 40,
148
- meta: {
149
- cellClass: "",
150
- headerClass: ""
151
- }
152
- }
153
- ]);
154
- return {
155
- fetchIngredientGroups: v,
156
- loading: _,
157
- columnDefs: a
158
- };
159
- }
160
- );
161
- function Ye(s) {
162
- return {
163
- addItem: () => {
164
- const i = s.create();
165
- s.items = [...s.items, i];
166
- },
167
- updateItem: (i) => {
168
- i && (s.items = s.items.map(
169
- (v) => s.id(v) === s.id(i) ? i : v
170
- ));
171
- },
172
- removeItem: (i) => {
173
- s.items = s.items.filter((v) => s.id(v) !== s.id(i));
174
- }
175
- };
176
- }
177
- function ge(s) {
178
- const _ = qe(), p = O(), k = F(() => [
179
- {
180
- id: "delete",
181
- header: "",
182
- cell(e) {
183
- const a = e.row.original;
184
- return V(
185
- "div",
186
- { class: "w-full flex justify-end" },
187
- V(L.FmButton, {
188
- class: "delete-button",
189
- key: a._id,
190
- type: "button",
191
- icon: "delete",
192
- variant: "tertiary",
193
- size: "md",
194
- disabled: s.disabled ?? !1,
195
- onClick: () => {
196
- s.skuRefs = s.skuRefs.filter((t) => t._id !== a._id);
197
- }
198
- })
199
- );
200
- },
201
- enableSorting: !1,
202
- size: 40,
203
- meta: {
204
- cellClass: "",
205
- headerClass: ""
206
- }
207
- },
208
- {
209
- id: "skuRef",
210
- header: () => "Ingredient",
211
- accessorFn: (e) => {
212
- var a, t;
213
- return `${((a = p.skuById[e._id]) == null ? void 0 : a.name) ?? ""} (${((t = p.skuById[e._id]) == null ? void 0 : t.code) ?? ""})`;
214
- },
215
- cell: ({ row: e }) => {
216
- const a = p.skuById[e.original._id];
217
- return V(
218
- "div",
219
- {
220
- class: "w-full flex flex-col"
221
- },
222
- [
223
- V("div", { class: "fm-typo-en-body-lg-400 line-clamp-1" }, a.name),
224
- V(
225
- "div",
226
- { class: "fm-typo-en-body-md-400 line-clamp-1 text-fm-color-typo-secondary" },
227
- a.code
228
- )
229
- ]
230
- );
231
- },
232
- size: "auto",
233
- enableSorting: !1
234
- },
235
- {
236
- id: "unit",
237
- header: () => "Unit",
238
- accessorFn: (e) => {
239
- const a = p.skuById[e._id];
240
- return a.unit.measurements.computeFirst(
241
- (t) => t.id === e.trackingMeasurement ? t.name : null
242
- ) ?? a.unit.name;
243
- },
244
- enableSorting: !1
245
- },
246
- {
247
- id: "unitOption",
248
- header: () => "Unit",
249
- accessorKey: "trackingMeasurement",
250
- cell(e) {
251
- const a = p.skuById[e.row.original._id];
252
- if (!a) return null;
253
- const t = [
254
- {
255
- label: a.unit.name,
256
- sublabel: a.unit.abbrev,
257
- value: null
258
- },
259
- ...a.unit.measurements.map((n) => ({
260
- label: n.name,
261
- sublabel: n.abbrev,
262
- value: n.id
263
- }))
264
- ].filter((n) => !n.label.toLowerCase().includes("inactive"));
265
- return V(L.FmSelect, {
266
- modelValue: e.row.original.trackingMeasurement ?? null,
267
- items: t,
268
- disabled: s.disabled ?? !1,
269
- "onUpdate:modelValue": (n) => {
270
- s.skuRefs = s.skuRefs.map((o) => o._id === e.row.original._id ? { ...o, trackingMeasurement: n } : o);
271
- }
272
- });
273
- },
274
- enableSorting: !1
275
- },
276
- {
277
- id: "priority",
278
- header: () => "Priority",
279
- accessorKey: "priority",
280
- enableSorting: !0,
281
- cell(e) {
282
- const a = e.row.original;
283
- return V(L.FmTextField, {
284
- modelValue: a.priority ?? e.row.index + 1,
285
- rules: [
286
- Ue(),
287
- Be(1),
288
- Le(
289
- s.skuRefs.filter((t) => t._id !== a._id).map((t) => {
290
- const n = p.skuById[t._id];
291
- return {
292
- label: n == null ? void 0 : n.name,
293
- value: t.priority
294
- };
295
- })
296
- )
297
- ],
298
- "onUpdate:modelValue": (t) => {
299
- const n = Number(t);
300
- isNaN(n) || (s.skuRefs = s.skuRefs.map((o) => o._id === e.row.original._id ? { ...o, priority: n } : o));
301
- }
302
- });
303
- }
304
- },
305
- {
306
- id: "default",
307
- header: () => "",
308
- accessorKey: "default",
309
- cell(e) {
310
- const a = p.skuById[e.row.original._id];
311
- return a ? V(L.FmCheckbox, {
312
- modelValue: e.row.original.default ?? !1,
313
- value: a._id,
314
- disabled: s.disabled ?? !1,
315
- "onUpdate:modelValue": () => {
316
- s.skuRefs = s.skuRefs.map((t) => t._id === e.row.original._id ? { ...t, default: !0 } : { ...t, default: !1 });
317
- }
318
- }) : null;
319
- },
320
- enableSorting: !1,
321
- size: 40,
322
- meta: {
323
- cellClass: "",
324
- headerClass: ""
325
- }
326
- },
327
- {
328
- id: "move",
329
- header: "",
330
- cell(e) {
331
- const a = e.row.original;
332
- return V("div", { class: "w-full flex justify-end" }, [
333
- V(L.FmButton, {
334
- key: a._id,
335
- type: "button",
336
- icon: "keyboard_arrow_up",
337
- variant: "tertiary",
338
- size: "md",
339
- disabled: s.disabled ?? !1,
340
- onClick: () => {
341
- const t = [...s.skuRefs], n = t.findIndex((o) => o._id === a._id);
342
- if (n > 0) {
343
- const o = t[n - 1];
344
- t[n - 1] = a, t[n] = o;
345
- }
346
- s.skuRefs = [...t];
347
- }
348
- }),
349
- V(L.FmButton, {
350
- key: a._id,
351
- type: "button",
352
- icon: "keyboard_arrow_down",
353
- variant: "tertiary",
354
- size: "md",
355
- disabled: s.disabled ?? !1,
356
- onClick: () => {
357
- const t = [...s.skuRefs], n = t.findIndex((o) => o._id === a._id);
358
- if (n < t.length - 1) {
359
- const o = t[n + 1];
360
- t[n + 1] = a, t[n] = o;
361
- }
362
- s.skuRefs = [...t];
363
- }
364
- })
365
- ]);
366
- },
367
- enableSorting: !1,
368
- size: 40,
369
- meta: {
370
- cellClass: "",
371
- headerClass: ""
372
- }
373
- }
374
- ]);
375
- return {
376
- get columnDefs() {
377
- return k.value;
378
- },
379
- promptAddIngredient: async () => {
380
- if (!s.isDefaultList && !s.allowOverride)
381
- return _.alert("Not allowed", "You cannot add ingredients to this list.");
382
- const v = p.skus.map((t) => ({
383
- label: t.name,
384
- sublabel: t.code,
385
- value: t._id
386
- })), e = (s.skuRefs ?? []).map((t) => t._id), a = await _.multiSelect(v, e, (t) => {
387
- var o, y, u, m, r, g;
388
- const n = (o = s.skuRefs) == null ? void 0 : o.findIndex((I) => I._id === t);
389
- return {
390
- _id: t,
391
- trackingMeasurement: typeof n != "number" || n == -1 ? (y = p.skuById[t]) == null ? void 0 : y.trackingMeasurement : (m = (u = s.skuRefs) == null ? void 0 : u[n]) == null ? void 0 : m.trackingMeasurement,
392
- priority: ((g = (r = s.skuRefs) == null ? void 0 : r[n]) == null ? void 0 : g.priority) ?? s.skuRefs.length,
393
- default: !1
394
- };
395
- });
396
- s.skuRefs = a ?? s.skuRefs;
397
- },
398
- columnVisibility: {
399
- delete: s.isDefaultList || !!s.allowOverride,
400
- unit: !s.isDefaultList && !s.allowOverride,
401
- unitOption: s.isDefaultList || !!s.allowOverride,
402
- // previous demo: sort priority by moving sku element in the array,
403
- // new demo: sort priority using priority field.
404
- // can reenable if this use case is requested to be restored
405
- move: !1
406
- }
407
- };
408
- }
409
- const Je = { class: "flex flex-col gap-16" }, Qe = { class: "flex flex-col" }, Xe = { class: "flex flex-col gap-4" }, Ze = { class: "flex flex-col gap-16" }, et = { class: "flex flex-col" }, tt = { class: "flex flex-col gap-4" }, nt = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ot = /* @__PURE__ */ W({
410
- __name: "IngredientGroupRuleField",
411
- props: {
412
- disabled: { type: Boolean },
413
- modelValue: {}
414
- },
415
- setup(s) {
416
- const _ = s, { t: p } = q(), k = Ae(), i = F(() => {
417
- var y;
418
- const n = /* @__PURE__ */ new Map(), o = k.restaurants.value.map((u) => u.customAttributes ?? {});
419
- for (const u of o)
420
- for (const [m, r] of Object.entries(u))
421
- n.has(m) || n.set(m, /* @__PURE__ */ new Set()), r && ((y = n.get(m)) == null || y.add(r));
422
- return n;
423
- }), v = F(() => [
424
- ...[...i.value.entries()].map(([o, y]) => ({
425
- type: "string",
426
- key: o,
427
- entity: "restaurant",
428
- values: [...y]
429
- }))
430
- ]), e = fe("modelValue", {
431
- get default() {
432
- return {
433
- _id: `skuGroupRule_${(/* @__PURE__ */ new Date()).toISOString()}_${ve(4)}`,
434
- name: "",
435
- rule: null,
436
- skuRefs: []
437
- };
438
- },
439
- watchProps: !0
440
- }), a = C(e.rule ? ze.build(e.rule) : null);
441
- ce(
442
- a,
443
- (n) => {
444
- e.rule = n ? Ne.build(n) : null;
445
- },
446
- { deep: !0, immediate: !0 }
447
- );
448
- const t = ge({
449
- get disabled() {
450
- return _.disabled ?? !1;
451
- },
452
- get skuRefs() {
453
- return e.skuRefs ?? [];
454
- },
455
- set skuRefs(n) {
456
- e.skuRefs = n;
457
- },
458
- isDefaultList: !1,
459
- allowOverride: !1
460
- });
461
- return (n, o) => {
462
- const y = R("FmTextField"), u = R("FmLabel"), m = R("FmFormGroup"), r = R("FmTable");
463
- return G(), z("div", Je, [
464
- b(y, {
465
- modelValue: l(e).name,
466
- "onUpdate:modelValue": o[0] || (o[0] = (g) => l(e).name = g),
467
- label: l(p)("inventory.ingredientGroup.form.rules.name"),
468
- "label-mark": "required",
469
- rules: [l(pe)()]
470
- }, null, 8, ["modelValue", "label", "rules"]),
471
- c("div", Qe, [
472
- c("div", Xe, [
473
- b(u, {
474
- label: l(p)("inventory.ingredientGroup.form.rules.title"),
475
- required: ""
476
- }, null, 8, ["label"]),
477
- b(l(Oe), {
478
- modelValue: a.value,
479
- "onUpdate:modelValue": o[1] || (o[1] = (g) => a.value = g),
480
- attributes: v.value
481
- }, null, 8, ["modelValue", "attributes"])
482
- ]),
483
- b(m, {
484
- "model-value": a.value,
485
- rules: [
486
- (g) => {
487
- var I;
488
- return !!((I = g == null ? void 0 : g.rules) != null && I.length) || "At least one rule is required";
489
- }
490
- ]
491
- }, null, 8, ["model-value", "rules"])
492
- ]),
493
- c("div", Ze, [
494
- c("div", et, [
495
- c("div", tt, [
496
- c("div", null, [
497
- b(u, {
498
- label: l(p)("inventory.ingredientGroup.form.rules.ingredients"),
499
- required: ""
500
- }, null, 8, ["label"])
501
- ])
502
- ]),
503
- b(m, {
504
- "model-value": l(e).skuRefs,
505
- rules: [
506
- (g) => !!(g != null && g.length) || "At least one ingredient is required"
507
- ]
508
- }, null, 8, ["model-value", "rules"])
509
- ]),
510
- b(r, {
511
- "row-data": l(e).skuRefs,
512
- "column-defs": l(t).columnDefs,
513
- "page-size": l(e).skuRefs.length,
514
- "shrink-at": 9999,
515
- "column-visibility": l(t).columnVisibility,
516
- "hide-footer": ""
517
- }, null, 8, ["row-data", "column-defs", "page-size", "column-visibility"])
518
- ]),
519
- c("div", nt, E(l(p)("inventory.ingredientGroup.form.defaultRule.defaultCheckbox")), 1)
520
- ]);
521
- };
522
- }
523
- }), st = { class: "flex flex-col gap-16" }, at = { class: "flex flex-col gap-16" }, lt = { class: "flex flex-col" }, it = { class: "flex items-center" }, rt = { class: "flex-1" }, ut = { class: "flex flex-col gap-8" }, dt = { class: "flex-1 fm-typo-en-title-sm-600" }, ct = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary px-4" }, mt = { class: "flex flex-col gap-16" }, ft = { class: "flex flex-col gap-8" }, pt = { class: "flex-1 fm-typo-en-title-sm-600" }, vt = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = { class: "flex flex-col gap-12" }, yt = { class: "flex items-center" }, _t = { class: "flex-1 fm-typo-en-body-lg-600 line-clamp-1" }, bt = { key: 0 }, kt = {
524
- key: 1,
525
- class: "fm-typo-en-body-lg-400"
526
- }, xt = /* @__PURE__ */ W({
527
- __name: "IngredientGroupForm",
528
- props: {
529
- mode: {},
530
- disabled: { type: Boolean },
531
- modelValue: {},
532
- menu: {}
533
- },
534
- emits: ["validation-success"],
535
- setup(s, { expose: _, emit: p }) {
536
- const k = s, i = fe("modelValue", {
537
- watchProps: !0
538
- }), v = p, { t: e } = q(), a = Ye({
539
- get items() {
540
- return i.rules ?? [];
541
- },
542
- set items(o) {
543
- i.rules = o;
544
- },
545
- create: function() {
546
- var o;
547
- return {
548
- _id: `skuGroupRule_${(/* @__PURE__ */ new Date()).toISOString()}_${ve(4)}`,
549
- name: "",
550
- rule: null,
551
- skuRefs: ((o = k.modelValue) == null ? void 0 : o.defaultSkuRefs) ?? []
552
- };
553
- },
554
- id: function(o) {
555
- return o._id;
556
- }
557
- }), t = ge({
558
- get disabled() {
559
- return k.disabled;
560
- },
561
- get skuRefs() {
562
- return i.defaultSkuRefs ?? [];
563
- },
564
- set skuRefs(o) {
565
- i.defaultSkuRefs = o;
566
- const y = o.map((r) => r._id), u = i.rules;
567
- if (!u) return;
568
- const m = o.groupBy(
569
- (r) => r._id,
570
- (r) => r.trackingMeasurement
571
- );
572
- for (const r of u) {
573
- const g = r.skuRefs.filter((x) => y.includes(x._id)), I = o.filter(
574
- (x) => !g.some((w) => w._id === x._id)
575
- );
576
- r.skuRefs = [...g, ...I].map((x) => {
577
- var w;
578
- return {
579
- ...x,
580
- trackingMeasurement: ((w = m.get(x._id)) == null ? void 0 : w[0]) ?? null
581
- };
582
- });
583
- }
584
- i.rules = [...u];
585
- },
586
- isDefaultList: !0
587
- }), n = C();
588
- return _({
589
- validateInputs: () => {
590
- var o;
591
- return (o = n.value) == null ? void 0 : o.validateInputs();
592
- },
593
- resetInputsValidation: () => {
594
- var o;
595
- return (o = n.value) == null ? void 0 : o.resetInputsValidation();
596
- },
597
- resetInputs: () => {
598
- var o;
599
- return (o = n.value) == null ? void 0 : o.resetInputs();
600
- }
601
- }), (o, y) => {
602
- const u = R("FmTextField"), m = R("FmButton"), r = R("FmFormGroup"), g = R("FmTable"), I = R("FmCard"), x = R("FmForm");
603
- return G(), U(x, {
604
- onValidationSuccess: y[2] || (y[2] = (w) => v("validation-success")),
605
- ref_key: "formRef",
606
- ref: n,
607
- class: "flex flex-col gap-64"
608
- }, {
609
- default: M(() => {
610
- var w;
611
- return [
612
- c("div", st, [
613
- b(u, {
614
- label: l(e)("inventory.ingredientGroup.form.name"),
615
- "label-mark": "required",
616
- rules: [l(pe)()],
617
- modelValue: l(i).name,
618
- "onUpdate:modelValue": y[0] || (y[0] = (d) => l(i).name = d)
619
- }, null, 8, ["label", "rules", "modelValue"]),
620
- b(u, {
621
- label: l(e)("inventory.ingredientGroup.form.ref"),
622
- "label-mark": "optional",
623
- modelValue: l(i).ref,
624
- "onUpdate:modelValue": y[1] || (y[1] = (d) => l(i).ref = d)
625
- }, null, 8, ["label", "modelValue"])
626
- ]),
627
- c("div", at, [
628
- c("div", lt, [
629
- c("div", it, [
630
- c("div", rt, [
631
- c("div", ut, [
632
- c("div", dt, E(l(e)("inventory.ingredientGroup.form.defaultRule.title")), 1)
633
- ])
634
- ]),
635
- c("div", null, [
636
- b(m, {
637
- disabled: o.disabled,
638
- label: "Add ingredient",
639
- "prepend-icon": "link",
640
- variant: "plain",
641
- class: "border-1 rounded-lg border-fm-color-primary",
642
- onClick: l(t).promptAddIngredient,
643
- size: "md"
644
- }, null, 8, ["disabled", "onClick"])
645
- ])
646
- ]),
647
- b(r, {
648
- "model-value": l(i).defaultSkuRefs,
649
- rules: [
650
- (d) => !!(d != null && d.length) || "At least one ingredient is required"
651
- ]
652
- }, null, 8, ["model-value", "rules"])
653
- ]),
654
- c("div", null, [
655
- b(g, {
656
- "row-data": l(i).defaultSkuRefs ?? [],
657
- "column-defs": l(t).columnDefs,
658
- "column-visibility": l(t).columnVisibility,
659
- "page-size": (w = l(i).defaultSkuRefs) == null ? void 0 : w.length,
660
- "shrink-at": 9999,
661
- "hide-footer": ""
662
- }, null, 8, ["row-data", "column-defs", "column-visibility", "page-size"])
663
- ]),
664
- c("div", ct, E(l(e)("inventory.ingredientGroup.form.defaultRule.defaultCheckbox")), 1)
665
- ]),
666
- c("div", mt, [
667
- c("div", ft, [
668
- c("div", pt, E(l(e)("inventory.ingredientGroup.form.rules.title")), 1),
669
- c("div", vt, E(l(e)("inventory.ingredientGroup.form.rules.description")), 1)
670
- ]),
671
- (G(!0), z(_e, null, be(l(i).rules, (d, f) => (G(), U(I, {
672
- key: d.id,
673
- variant: "outlined",
674
- class: "p-16"
675
- }, {
676
- default: M(() => [
677
- c("div", gt, [
678
- c("div", yt, [
679
- c("div", _t, [
680
- ke(E(l(e)("inventory.ingredientGroup.form.rules.rule_N", [f + 1])), 1),
681
- d.name ? (G(), z("span", bt, ": ")) : le("", !0),
682
- d.name ? (G(), z("span", kt, E(d.name), 1)) : le("", !0)
683
- ]),
684
- b(m, {
685
- variant: "tertiary",
686
- icon: "delete",
687
- onClick: (h) => l(a).removeItem(d)
688
- }, null, 8, ["onClick"])
689
- ]),
690
- c("div", null, [
691
- (G(), U(ot, {
692
- key: d._id,
693
- "model-value": d,
694
- "onUpdate:modelValue": l(a).updateItem,
695
- disabled: o.disabled,
696
- menu: o.menu
697
- }, null, 8, ["model-value", "onUpdate:modelValue", "disabled", "menu"]))
698
- ])
699
- ])
700
- ]),
701
- _: 2
702
- }, 1024))), 128)),
703
- c("div", null, [
704
- b(m, {
705
- variant: "plain",
706
- icon: "add",
707
- label: l(e)("inventory.ingredientGroup.form.rules.addRule"),
708
- onClick: l(a).addItem
709
- }, null, 8, ["label", "onClick"])
710
- ])
711
- ])
712
- ];
713
- }),
714
- _: 1
715
- }, 512);
716
- };
717
- }
718
- }), ht = {
719
- key: 0,
720
- class: "text-fm-color-typo-primary fm-typo-en-body-lg-400"
721
- }, wt = { class: "flex gap-4" }, Rt = /* @__PURE__ */ W({
722
- __name: "IngredientGroupDialog",
723
- props: {
724
- show: { type: Boolean },
725
- mode: { default: S.READ },
726
- modelValue: {}
727
- },
728
- emits: ["update:show"],
729
- setup(s) {
730
- const _ = s, p = O(), k = Ke(() => p.readCachedMenu()), i = F(
731
- () => k.result.value.state === je.success ? k.result.value.data : void 0
732
- ), v = Q(), { t: e } = q(), a = Ce(_, "show");
733
- function t() {
734
- return {
735
- _id: "",
736
- name: "",
737
- rules: []
738
- };
739
- }
740
- const n = C(t()), o = C(`${Math.random()}`);
741
- ce(
742
- () => _.show,
743
- (d) => {
744
- if (!d) return;
745
- let f = N(_.modelValue ?? t());
746
- f.defaultSkuRefs && (f.defaultSkuRefs = f.defaultSkuRefs.map((h, $) => ({
747
- ...h,
748
- priority: h.priority ?? $ + 1
749
- })));
750
- for (let h = 0; f.rules && h < f.rules.length; h++) {
751
- const $ = f.rules[h];
752
- $.skuRefs = $.skuRefs.map((D, Y) => ({
753
- ...D,
754
- priority: D.priority ?? Y + 1
755
- }));
756
- }
757
- n.value = f, o.value = f._id || `${Math.random()}`;
758
- }
759
- );
760
- const y = F(() => {
761
- switch (_.mode) {
762
- case S.READ:
763
- return "";
764
- case S.UPDATE:
765
- return e("inventory.ingredientGroup.update.title");
766
- case S.CREATE:
767
- return e("inventory.ingredientGroup.create.title");
768
- }
769
- return "";
770
- }), u = F(() => {
771
- switch (_.mode) {
772
- case S.READ:
773
- return "";
774
- case S.UPDATE:
775
- return e("common.save");
776
- case S.CREATE:
777
- return e("common.add");
778
- }
779
- return "";
780
- }), m = C(), r = C(!1);
781
- async function g() {
782
- r.value = !0;
783
- const d = N(n.value);
784
- try {
785
- await p.createSkuGroup(d), a.value = !1, v.open({
786
- title: e("inventory.common.success"),
787
- message: e("inventory.ingredientGroup.create.success", { name: d.name }),
788
- type: "success"
789
- });
790
- } catch (f) {
791
- f instanceof ie || v.open({
792
- title: e("inventory.ingredientGroup.create.error.title"),
793
- message: e("inventory.ingredientGroup.create.error.message"),
794
- type: "error"
795
- });
796
- } finally {
797
- r.value = !1;
798
- }
799
- }
800
- async function I() {
801
- r.value = !0;
802
- const d = N(n.value);
803
- try {
804
- await p.updateSkuGroup(d), r.value = !1, a.value = !1, v.open({
805
- title: e("inventory.common.success"),
806
- message: e("inventory.ingredientGroup.update.success", { name: d.name }),
807
- type: "success"
808
- });
809
- } catch (f) {
810
- f instanceof ie || v.open({
811
- title: e("inventory.ingredientGroup.update.error.title"),
812
- message: e("inventory.ingredientGroup.update.error.message"),
813
- type: "error"
814
- });
815
- } finally {
816
- r.value = !1;
817
- }
818
- }
819
- function x() {
820
- var d, f;
821
- (f = (d = m.value) == null ? void 0 : d.validateInputs) == null || f.call(d);
822
- }
823
- function w() {
824
- switch (_.mode) {
825
- case S.READ:
826
- return;
827
- case S.UPDATE:
828
- return I();
829
- case S.CREATE:
830
- return g();
831
- }
832
- }
833
- return (d, f) => {
834
- const h = R("FmButton"), $ = R("FmSideSheet");
835
- return G(), U($, {
836
- "model-value": l(a),
837
- "onUpdate:modelValue": f[3] || (f[3] = (D) => xe(a) ? a.value = D : null),
838
- header: y.value,
839
- "close-button": "",
840
- "dismiss-away": "",
841
- "max-width": 800
842
- }, {
843
- "side-sheet-footer": M(() => [
844
- c("div", wt, [
845
- b(h, {
846
- loading: r.value,
847
- label: u.value,
848
- onClick: x
849
- }, null, 8, ["loading", "label"]),
850
- b(h, {
851
- disabled: r.value,
852
- label: l(e)("common.close"),
853
- variant: "tertiary",
854
- onClick: f[2] || (f[2] = (D) => a.value = !1)
855
- }, null, 8, ["disabled", "label"])
856
- ])
857
- ]),
858
- default: M(() => [
859
- i.value ? (G(), U(xt, {
860
- menu: i.value,
861
- class: "w-full",
862
- ref_key: "hasValidationExpose",
863
- ref: m,
864
- key: o.value,
865
- "model-value": n.value,
866
- "onUpdate:modelValue": f[0] || (f[0] = (D) => n.value = D),
867
- mode: d.mode,
868
- disabled: r.value,
869
- onValidationSuccess: f[1] || (f[1] = (D) => w())
870
- }, null, 8, ["menu", "model-value", "mode", "disabled"])) : (G(), z("div", ht, "Loading.."))
871
- ]),
872
- _: 1
873
- }, 8, ["model-value", "header"]);
874
- };
875
- }
876
- }), It = { class: "flex flex-col py-8" }, St = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Gt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, jt = /* @__PURE__ */ W({
877
- __name: "IngredientGroupView",
878
- setup(s) {
879
- const _ = O(), p = F(() => _.skuGroups), k = Fe(), { t: i } = q(), {
880
- createIngredientGroup: v,
881
- updateIngredientGroup: e,
882
- importIngredientGroups: a,
883
- exportIngredientGroups: t
884
- } = J(), { columnDefs: n, loading: o } = re(We()), { ingredientGroupDialogProps: y } = re(J()), u = C(!1);
885
- let m;
886
- function r(A) {
887
- m = A, u.value = !0;
888
- }
889
- function g() {
890
- const A = m;
891
- m = void 0, A == null || A();
892
- }
893
- function I(A) {
894
- switch (A) {
895
- case "add":
896
- return r(() => v());
897
- case "import":
898
- return r(() => a());
899
- case "export":
900
- return r(() => t());
901
- }
902
- }
903
- const x = C(""), w = C(!1), d = F(() => w.value || o.value), { breakpoints: f } = De(), h = F(() => f.value.xs || f.value.sm), $ = F(() => h.value ? 10 : 20), D = Te(), Y = F(() => [
904
- {
905
- label: i("inventory.ingredient.create.title"),
906
- value: "add",
907
- isPrimary: !0,
908
- prependIcon: "add"
909
- },
910
- { label: i("common.import"), value: "import" },
911
- { label: i("common.export"), value: "export" }
912
- ]);
913
- return (A, T) => {
914
- const ye = R("FmTable");
915
- return G(), U(Ee, {
916
- title: l(i)("inventory.ingredientGroup.title"),
917
- actions: Y.value,
918
- "onClick:action": I
919
- }, {
920
- default: M(() => [
921
- c("div", {
922
- class: he([
923
- "flex flex-col gap-8 max-h-full",
924
- {
925
- "p-0": h.value,
926
- "px-24 ": !h.value
927
- }
928
- ])
929
- }, [
930
- b(Pe, {
931
- searchable: "",
932
- search: x.value,
933
- "onUpdate:search": T[0] || (T[0] = (P) => x.value = P)
934
- }, null, 8, ["search"]),
935
- b(ye, {
936
- style: we(l(D).tableHeight),
937
- "column-defs": l(n),
938
- "row-data": p.value,
939
- "search-value": x.value,
940
- loading: !l(k)._currentLocation || d.value,
941
- "loading-text": l(i)("inventory.common.loading"),
942
- onRowClick: T[2] || (T[2] = (P) => r(() => l(e)(P.original))),
943
- "page-size": $.value
944
- }, {
945
- "list-row": M((P) => [
946
- b(Me, {
947
- row: P,
948
- onRowClick: T[1] || (T[1] = (B) => r(() => l(e)(B)))
949
- }, Re({
950
- default: M((B) => {
951
- var X, Z, ee, K, te, ne, oe, se, j, ae;
952
- return [
953
- c("div", It, [
954
- c("div", St, [
955
- b(l(de), {
956
- render: (ee = (Z = (X = B.code) == null ? void 0 : X.column) == null ? void 0 : Z.columnDef) == null ? void 0 : ee.cell,
957
- props: (te = (K = B.code) == null ? void 0 : K.getContext) == null ? void 0 : te.call(K)
958
- }, null, 8, ["render", "props"])
959
- ]),
960
- c("div", Gt, [
961
- b(l(de), {
962
- render: (se = (oe = (ne = B.name) == null ? void 0 : ne.column) == null ? void 0 : oe.columnDef) == null ? void 0 : se.cell,
963
- props: (ae = (j = B.name) == null ? void 0 : j.getContext) == null ? void 0 : ae.call(j)
964
- }, null, 8, ["render", "props"])
965
- ])
966
- ])
967
- ];
968
- }),
969
- _: 2
970
- }, [
971
- w.value ? {
972
- name: "loading-text",
973
- fn: M(() => [
974
- c("div", null, E(l(i)("inventory.ingredient.table.importing")), 1)
975
- ]),
976
- key: "0"
977
- } : void 0
978
- ]), 1032, ["row"])
979
- ]),
980
- _: 1
981
- }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "loading-text", "page-size"])
982
- ], 2),
983
- (G(), U(Ie, { to: "body" }, [
984
- b(Rt, Se(Ge(l(y))), null, 16),
985
- b(He, {
986
- modelValue: u.value,
987
- "onUpdate:modelValue": T[3] || (T[3] = (P) => u.value = P),
988
- "feature-name": "Ingredient Group",
989
- onProceed: g
990
- }, null, 8, ["modelValue"])
991
- ]))
992
- ]),
993
- _: 1
994
- }, 8, ["title", "actions"]);
995
- };
996
- }
997
- });
998
- export {
999
- jt as default
1000
- };