@feedmepos/mf-inventory-portal 1.2.51-dev.1 → 1.2.52

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 (103) hide show
  1. package/dist/{App-bY_YcLwH.js → App--VMK_Bqt.js} +70 -75
  2. package/dist/{ApprovalView-vzIiBqt2.js → ApprovalView-3g89b2Ya.js} +34 -34
  3. package/dist/{BindingsDialog-DCh2ORem.js → BindingsDialog-C_qcIKUI.js} +2 -2
  4. package/dist/{BindingsPicker-DcNG03p-.js → BindingsPicker-CPrS3J1t.js} +2 -2
  5. package/dist/{BindingsTable-B_Yaq-z3.js → BindingsTable-C5PCH5Vf.js} +4 -4
  6. package/dist/{ClosingDraftView-C0T8cWEB.js → ClosingDraftView-CiJV5d7M.js} +399 -413
  7. package/dist/{ClosingHistoryView-DkKAjh7T.js → ClosingHistoryView-CvOfQF2y.js} +27 -27
  8. package/dist/{ClosingTemplateView-DpH1EyW5.js → ClosingTemplateView-BWvaFiHB.js} +524 -512
  9. package/dist/{DeliveryOrderPrintPreview-B2ecLaLu.js → DeliveryOrderPrintPreview-C9ZI8EVy.js} +1 -1
  10. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DVOt7pfR.js +231 -0
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-kVpsL4cx.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DLdaN3XH.js} +12 -12
  12. package/dist/FmMultiselectDialog-CMGvzBur.js +598 -0
  13. package/dist/{FmMultiselectDialog-DGUwruxs.js → FmMultiselectDialog-M5xxjK0u.js} +1 -1
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CRTG3VFo.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CnHJwYtN.js} +3 -3
  15. package/dist/{ImportView-Bk4Z7nGh.js → ImportView-DeW2True.js} +7 -7
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BEJ19Uej.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BYSKI3Qs.js} +1 -1
  17. package/dist/{IngredientGroupView-8GHMMOux.js → IngredientGroupView-BjZqH3dV.js} +107 -108
  18. package/dist/{IngredientsView-DbmODx-v.js → IngredientsView-BU-dONim.js} +125 -126
  19. package/dist/{IntegrationView-DC0O_Lk4.js → IntegrationView-6m61Ipf9.js} +80 -80
  20. package/dist/{InventoryBindingForm-ln0q25n_.js → InventoryBindingForm-C-QzGErT.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CFgk9rSe.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B25u_7kJ.js} +21 -21
  22. package/dist/{InventoryBindingSummary-BlNXhS4v.js → InventoryBindingSummary-CJbJDI2o.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BY_mXqPr.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-RgGlAX33.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BhNjwE3X.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DhsCTTsf.js} +2 -2
  25. package/dist/{PublishView-5GkTzxbi.js → PublishView-BGIPKR3R.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-Dj5lJ5Ou.js → PurchaseOrderPrintPreview-DNYxm9VZ.js} +1 -1
  27. package/dist/ReceiveRequestView-BkwCM2gx.js +2913 -0
  28. package/dist/{RecipeView-OLPRwnVx.js → RecipeView-ImuvouoQ.js} +82 -83
  29. package/dist/{StockView-TcA5zJqr.js → StockView-DX-M79i4.js} +112 -113
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DZ6TDkKR.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BU9OphZT.js} +1 -1
  31. package/dist/{SupplierView-77qI9YCg.js → SupplierView-DwOXRHIm.js} +27 -28
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-_8YeihNH.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CFNAl2zj.js} +2 -2
  33. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js +162 -0
  34. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C-fJgXX4.js +201 -0
  35. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-7BoFD5wV.js → TransferDetails.vue_vue_type_script_setup_true_lang-vKznrul-.js} +659 -658
  36. package/dist/{TransferTemplateView-CI0U36Tr.js → TransferTemplateView-B6Lynxx7.js} +81 -82
  37. package/dist/{UnitView-fNFFUNlb.js → UnitView-CPl1rpkV.js} +19 -20
  38. package/dist/{WarehouseView-BAXgnZnO.js → WarehouseView-705pfGhw.js} +20 -21
  39. package/dist/WastageTemplateView-DAEt9fAW.js +2382 -0
  40. package/dist/api/adjustment-template.d.ts +1 -0
  41. package/dist/api/closing-template.d.ts +1 -0
  42. package/dist/api/netsuite.d.ts +0 -8
  43. package/dist/app-uBuHtW8m.js +8127 -0
  44. package/dist/{app-CddcvygU.js → app-yA2GcbOF.js} +4405 -4505
  45. package/dist/app.d.ts +1 -52
  46. package/dist/app.js +1 -1
  47. package/dist/closing-template-C_fOjY8b.js +125 -0
  48. package/dist/components/FmInventoryTableToolbar.vue.d.ts +0 -8
  49. package/dist/components/FmMultiselectDialogProps.d.ts +0 -5
  50. package/dist/components/TemplatePublishDialog.d.ts +2 -0
  51. package/dist/cypress/component/receive-request/KDI-15-total-price-currency.cy.d.ts +2 -0
  52. package/dist/{date2-CVZy20Q_.js → date2-CGBF6K5g.js} +1 -1
  53. package/dist/{dayjs.min-NrRtjg32.js → dayjs.min-CcXVb3N8.js} +26 -26
  54. package/dist/{decimal-Du3Grkk9.js → decimal-o3WVGEo3.js} +2 -2
  55. package/dist/{defineDeepModel-DgRoiQBp.js → defineDeepModel-DHrbJI5Q.js} +1 -1
  56. package/dist/{duplicate-template-DvnZ4BW6.js → duplicate-template-BpR6oQr0.js} +1 -1
  57. package/dist/{feature-CTA18HlL.js → feature-D8BhYTHO.js} +6178 -8906
  58. package/dist/{format-time-from-id-6kt1RMWs.js → format-time-from-id-0_5FFMRS.js} +1 -1
  59. package/dist/{format-unit-display-mVJ-nuJe.js → format-unit-display-Cgf9ziiC.js} +11 -11
  60. package/dist/{import-export.helper-DWwlJy7N.js → import-export.helper-zE76m0Lr.js} +5 -5
  61. package/dist/{index-BEcj1jGd.js → index-2ApGEdTo.js} +3 -3
  62. package/dist/{index-BfcdagSF.js → index-B23iGYnZ.js} +1 -1
  63. package/dist/{index-By-jyWOP.js → index-CbyU93I-.js} +1 -1
  64. package/dist/{lodash-D0COOw3m.js → lodash-6pJVv_NM.js} +1 -1
  65. package/dist/netsuite-CPg7U65w.js +5131 -0
  66. package/dist/{purchase-order-template-CJCmABzP.js → purchase-order-template-Dx0eXO5h.js} +1 -1
  67. package/dist/router/name.d.ts +0 -1
  68. package/dist/{rules-hQBVd1Mn.js → rules-BDCrcRdu.js} +9 -9
  69. package/dist/{stock-B6QW-S14.js → stock-0PfUUvpN.js} +1 -1
  70. package/dist/{stock-4xGaezEy.js → stock-DBheIzMc.js} +3 -3
  71. package/dist/stores/feature.d.ts +2 -4
  72. package/dist/stores/integration/netsuite.d.ts +0 -5
  73. package/dist/style.css +1 -1
  74. package/dist/{supplier-C-dmFnqw.js → supplier-BJv4rrs8.js} +2 -2
  75. package/dist/tsconfig.app.tsbuildinfo +1 -1
  76. package/dist/{use-ingredient-select-dialog-DgYSZDN8.js → use-ingredient-select-dialog-CubGF9kW.js} +2 -2
  77. package/dist/{use-inventory-binding-dialog-CnYcA_Fo.js → use-inventory-binding-dialog-GiYf-Jn5.js} +2 -2
  78. package/dist/{use-template-enabled-locations-2-B_aZrMUU.js → use-template-enabled-locations-2-1-PoWVif.js} +2 -2
  79. package/dist/views/adjustment-template/wastage-template/actions.d.ts +4 -1
  80. package/dist/views/ingredients/helper/calculate-default-cost.d.ts +9 -0
  81. package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +22 -0
  82. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +0 -714
  83. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -8
  84. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  85. package/dist/{vue-i18n-BCEDBY4T.js → vue-i18n-Cb65g8p9.js} +524 -524
  86. package/dist/{xlsx-CJsXiiEq.js → xlsx-C7pOdYp2.js} +398 -398
  87. package/dist/{xlsx.util-CSudzOii.js → xlsx.util-Boe3rV7g.js} +1 -1
  88. package/package.json +5 -5
  89. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CI4z5XYQ.js +0 -188
  90. package/dist/FmMultiselectDialog-BviFuAM5.js +0 -618
  91. package/dist/ReceiveRequestView-BAYczSpW.js +0 -2913
  92. package/dist/SurchargeView-CxW2ZZ8a.js +0 -460
  93. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js +0 -84
  94. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-ByPIjcED.js +0 -155
  95. package/dist/WastageTemplateView-C5qCXWqZ.js +0 -2328
  96. package/dist/api/surcharge.d.ts +0 -31
  97. package/dist/app-DiX-EfV6.js +0 -8167
  98. package/dist/closing-template-DxdLqlb1.js +0 -117
  99. package/dist/component-DpCUABT3.js +0 -82
  100. package/dist/netsuite-3LgQ5ztL.js +0 -5402
  101. package/dist/stores/surcharge.d.ts +0 -18
  102. package/dist/surcharge-Db4IiSEQ.js +0 -71
  103. package/dist/views/surcharge/SurchargeView.vue.d.ts +0 -2
@@ -1,460 +0,0 @@
1
- import { defineComponent as pe, ref as v, computed as c, watch as R, onMounted as fe, resolveComponent as p, openBlock as j, createElementBlock as ye, Fragment as ge, createVNode as n, unref as s, withCtx as f, createElementVNode as u, normalizeClass as G, normalizeStyle as he, toDisplayString as E, withDirectives as be, vModelText as _e, createBlock as Se, withModifiers as xe, createCommentVNode as Fe } from "vue";
2
- import { u as ke, _ as we } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
- import { a as Ie, u as Ce, s as V, j as Le, w as Ve } from "./app-CddcvygU.js";
4
- import { u as Ae } from "./surcharge-Db4IiSEQ.js";
5
- import { useSnackbar as De, useDialog as Me, useBreakpoints as Oe } from "@feedmepos/ui-library";
6
- import { _ as Pe } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-kVpsL4cx.js";
7
- import { a as Te } from "./FmMultiselectDialog-BviFuAM5.js";
8
- import { useI18n as Be } from "@feedmepos/mf-common";
9
- import { u as ze } from "./supplier-C-dmFnqw.js";
10
- import { u as Ee } from "./feature-CTA18HlL.js";
11
- import { D as Ne, P as $e, L as Ue } from "./app-DiX-EfV6.js";
12
- import { D as H, R as A } from "./row-action.enum-BcW_L_nE.js";
13
- import { c as qe } from "./component-DpCUABT3.js";
14
- const Je = { class: "flex flex-col py-8" }, Re = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, je = { class: "flex flex-col h-full justify-between" }, Ge = { class: "space-y-16" }, He = ["placeholder"], Ke = { class: "flex flex-col gap-16" }, Qe = { class: "flex flex-col gap-8" }, We = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = { class: "flex flex-col gap-12" }, Ye = { class: "flex flex-col gap-4" }, Ze = { class: "flex items-center gap-8" }, pt = /* @__PURE__ */ pe({
15
- __name: "SurchargeView",
16
- setup(et) {
17
- const y = De(), N = Me(), D = Ie(), x = Ae(), F = Ce(), M = ze(), K = Ee(), g = v(!1), Q = c(() => x.surcharges), k = v(""), { breakpoints: $ } = Oe(), O = c(() => $.value.xs || $.value.sm), W = c(() => O.value ? 10 : 20), X = ke(), { t: a } = Be(), Y = c(() => F.businessLevel);
18
- R(Y, T);
19
- const Z = c(() => (F.businessLevel || K.businessSupplierOnly ? M.businessSuppliers : M.locationSuppliers).map((t) => ({ label: t.name, value: t._id }))), ee = c(() => [
20
- {
21
- key: "supplierId",
22
- type: "string",
23
- entity: "supplier",
24
- options: Z.value
25
- },
26
- {
27
- key: "totalCost",
28
- type: "number"
29
- }
30
- ]), te = c(() => D.skus.map((e) => ({
31
- label: `${e.code} - ${e.name}`,
32
- sublabel: e.code,
33
- value: e,
34
- disabled: e.isInactive,
35
- tags: e.isInactive ? ["Inactive"] : ["Active"]
36
- }))), w = c(() => {
37
- var t;
38
- const e = (t = o.value.value) == null ? void 0 : t.skuId;
39
- return e ? D.skus.find((r) => r._id === e) : null;
40
- });
41
- function ae() {
42
- var i;
43
- const e = (i = o.value.value) == null ? void 0 : i.skuId, t = e ? D.skus.find((d) => d._id === e) : null, r = [
44
- {
45
- type: "string",
46
- key: "tags",
47
- entity: "item",
48
- values: ["Inactive", "Active"]
49
- }
50
- ];
51
- N.open({
52
- title: a("inventory.surcharge.form.value.itemPlaceholder"),
53
- closeButton: !0,
54
- contentComponent: Te,
55
- contentComponentProps: {
56
- modelValue: t ? [t] : [],
57
- items: te.value,
58
- virtualScroll: !0,
59
- filterAttributes: r,
60
- maxSelections: 1
61
- },
62
- primaryActions: {
63
- text: a("common.confirm"),
64
- close: !0
65
- },
66
- secondaryActions: {
67
- text: a("common.close"),
68
- close: !0,
69
- variant: "tertiary"
70
- }
71
- }).onPrimary((d) => {
72
- d && d.length > 0 ? z(d[0]._id) : z(null);
73
- });
74
- }
75
- const _ = v(!1), P = v(""), o = v({
76
- _id: "",
77
- name: "",
78
- value: {
79
- amount: {
80
- currency: V(),
81
- amount: 0,
82
- precision: 0
83
- }
84
- },
85
- rule: null,
86
- businessId: "",
87
- applyTo: "purchaseOrder"
88
- }), S = v(), h = v(""), b = v(null), oe = c(() => [
89
- {
90
- label: a("inventory.surcharge.actions.create"),
91
- value: "create",
92
- isPrimary: !0,
93
- prependIcon: "add"
94
- }
95
- ]);
96
- async function T() {
97
- try {
98
- await M.readSuppliers();
99
- } catch {
100
- y.open({ message: a("Failed to fetch suppliers"), type: "error" });
101
- }
102
- }
103
- async function le() {
104
- o.value.rule = b.value ? $e.build(b.value) : null, g.value = !0;
105
- try {
106
- S.value ? (await x.update(o.value._id, o.value), y.open({
107
- title: a("Success"),
108
- message: a("Order surcharge updated successfully"),
109
- type: "success"
110
- })) : (await x.create(o.value), y.open({
111
- title: a("Success"),
112
- message: a("Order surcharge created successfully"),
113
- type: "success"
114
- })), _.value = !1, o.value = {
115
- _id: "",
116
- name: "",
117
- value: { amount: { currency: V(), amount: 0, precision: 0 } },
118
- rule: null,
119
- businessId: "",
120
- applyTo: "purchaseOrder"
121
- }, S.value = void 0;
122
- } catch (e) {
123
- e instanceof Le || y.open({
124
- title: a("Error"),
125
- message: a("Failed to save order surcharge"),
126
- type: "error"
127
- });
128
- } finally {
129
- g.value = !1;
130
- }
131
- }
132
- async function re(e) {
133
- g.value = !0;
134
- try {
135
- await x.delete(e._id), y.open({
136
- title: a("Success"),
137
- message: a("inventory.surcharge.delete.success", { name: e.name }),
138
- type: "success"
139
- }), _.value = !1;
140
- } catch (t) {
141
- y.open({
142
- title: a("inventory.surcharge.delete.error"),
143
- message: a("inventory.surcharge.delete.errorMessage", { name: e.name }),
144
- type: "error"
145
- }), console.error("failed to delete surcharge", t);
146
- } finally {
147
- g.value = !1;
148
- }
149
- }
150
- function ne() {
151
- S.value && N.open({
152
- title: a("inventory.surcharge.delete.title", { name: o.value.name }),
153
- closeButton: !1,
154
- message: a("inventory.surcharge.delete.message"),
155
- primaryActions: {
156
- text: a("common.delete"),
157
- close: !0,
158
- variant: "destructive"
159
- },
160
- secondaryActions: {
161
- text: a("common.cancel"),
162
- close: !0
163
- }
164
- }).onPrimary(() => re(o.value));
165
- }
166
- function se(e, t) {
167
- if (e === A.Edit) {
168
- U(t);
169
- return;
170
- }
171
- if (e === A.Delete) {
172
- o.value = JSON.parse(JSON.stringify(t)), S.value = t, ne();
173
- return;
174
- }
175
- }
176
- function ue(e) {
177
- switch (e) {
178
- case "create": {
179
- if (g.value) {
180
- y.open({
181
- title: "Loading data...",
182
- message: "Please wait.",
183
- type: "info"
184
- });
185
- return;
186
- }
187
- P.value = "inventory.surcharge.actions.create";
188
- const t = V();
189
- o.value = {
190
- _id: "",
191
- name: "",
192
- value: {
193
- amount: {
194
- currency: t,
195
- amount: 0,
196
- precision: 0
197
- }
198
- },
199
- rule: null,
200
- businessId: "",
201
- applyTo: "purchaseOrder"
202
- }, S.value = void 0, b.value = null, h.value = "", _.value = !0;
203
- break;
204
- }
205
- }
206
- }
207
- function U(e) {
208
- P.value = "inventory.surcharge.actions.edit", o.value = JSON.parse(JSON.stringify(e)), S.value = e, b.value = e.rule ? Ue.build(e.rule) : null, h.value = "", _.value = !0;
209
- }
210
- function q() {
211
- var t;
212
- if (h.value !== "")
213
- return h.value;
214
- const e = (t = o.value.value) == null ? void 0 : t.amount;
215
- return e ? Ve.toFormatString({
216
- value: {
217
- amount: e.amount,
218
- precision: e.precision
219
- }
220
- }) : "0";
221
- }
222
- let B = null;
223
- function ie(e) {
224
- h.value = e, B && clearTimeout(B), B = setTimeout(() => {
225
- var I, L;
226
- const t = parseFloat(e) || 0, r = (I = o.value.value) == null ? void 0 : I.amount, i = (r == null ? void 0 : r.precision) ?? 0, d = (r == null ? void 0 : r.currency) ?? V(), C = (L = o.value.value) == null ? void 0 : L.skuId;
227
- o.value.value = {
228
- amount: {
229
- amount: Math.round(t * Math.pow(10, i)),
230
- precision: i,
231
- currency: d
232
- },
233
- ...C && { skuId: C }
234
- }, h.value = "";
235
- }, 500);
236
- }
237
- function z(e) {
238
- const t = o.value.value;
239
- if (e)
240
- o.value.value = {
241
- ...t,
242
- skuId: e
243
- };
244
- else {
245
- const { skuId: r, ...i } = t || {};
246
- o.value.value = i;
247
- }
248
- }
249
- const ce = c(() => [
250
- {
251
- accessorKey: "name",
252
- header: () => a("inventory.surcharge.table.name"),
253
- enableSorting: !0,
254
- size: "auto"
255
- },
256
- {
257
- id: "action",
258
- header: "",
259
- cell(e) {
260
- return qe(
261
- [H[A.Edit], H[A.Delete]],
262
- (t) => {
263
- se(t, e.row.original);
264
- }
265
- );
266
- },
267
- enableSorting: !1,
268
- size: 40
269
- }
270
- ]), me = c(() => {
271
- let e = Q.value;
272
- if (k.value) {
273
- const t = k.value.toLowerCase();
274
- e = e.filter((r) => r.name.toLowerCase().includes(t));
275
- }
276
- return e;
277
- });
278
- return fe(() => {
279
- T(), x.browse();
280
- }), R(
281
- () => F._currentLocation,
282
- () => {
283
- F._currentLocation && T();
284
- }
285
- ), (e, t) => {
286
- const r = p("FmTable"), i = p("FmFormGroup"), d = p("FmLabel"), C = p("FmTextField"), I = p("FmButton"), L = p("FmIcon"), de = p("FmCard"), ve = p("FmSideSheet");
287
- return j(), ye(ge, null, [
288
- n(we, {
289
- title: s(a)("inventory.surcharge.title"),
290
- actions: oe.value,
291
- "onClick:action": ue
292
- }, {
293
- default: f(() => [
294
- u("div", {
295
- class: G([
296
- "flex flex-col gap-8 max-h-full",
297
- {
298
- "p-0": O.value,
299
- "px-24 ": !O.value
300
- }
301
- ])
302
- }, [
303
- n(Pe, {
304
- searchable: "",
305
- search: k.value,
306
- "onUpdate:search": t[0] || (t[0] = (l) => k.value = l)
307
- }, null, 8, ["search"]),
308
- n(r, {
309
- style: he(s(X).tableHeight),
310
- "column-defs": ce.value,
311
- "row-data": me.value,
312
- "search-value": k.value,
313
- loading: g.value || !s(F)._currentLocation,
314
- "page-size": W.value,
315
- onRowClick: t[1] || (t[1] = (l) => U(l.original))
316
- }, {
317
- "list-row": f((l) => [
318
- u("div", Je, [
319
- u("div", Re, E(l.original.name), 1)
320
- ])
321
- ]),
322
- _: 1
323
- }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
324
- ], 2)
325
- ]),
326
- _: 1
327
- }, 8, ["title", "actions"]),
328
- n(ve, {
329
- modelValue: _.value,
330
- "onUpdate:modelValue": t[8] || (t[8] = (l) => _.value = l),
331
- header: s(a)(P.value),
332
- "max-width": 800
333
- }, {
334
- "side-sheet-footer": f(() => [
335
- n(I, {
336
- variant: "primary",
337
- class: "w-full",
338
- onClick: le,
339
- loading: g.value,
340
- label: s(a)("inventory.surcharge.actions.save")
341
- }, null, 8, ["loading", "label"])
342
- ]),
343
- default: f(() => [
344
- u("div", je, [
345
- u("div", Ge, [
346
- n(i, {
347
- modelValue: o.value.name,
348
- "onUpdate:modelValue": t[3] || (t[3] = (l) => o.value.name = l),
349
- label: s(a)("inventory.surcharge.form.name"),
350
- required: !0,
351
- rules: [(l) => !!l.trim().length || s(a)("inventory.surcharge.form.nameRequired")]
352
- }, {
353
- default: f(() => [
354
- be(u("input", {
355
- "onUpdate:modelValue": t[2] || (t[2] = (l) => o.value.name = l),
356
- class: "w-full p-8 border rounded-md outline-none focus:border-blue-500",
357
- placeholder: s(a)("inventory.surcharge.form.namePlaceholder")
358
- }, null, 8, He), [
359
- [_e, o.value.name]
360
- ])
361
- ]),
362
- _: 1
363
- }, 8, ["modelValue", "label", "rules"]),
364
- u("div", Ke, [
365
- u("div", Qe, [
366
- n(d, {
367
- label: s(a)("inventory.surcharge.form.rules.title"),
368
- required: ""
369
- }, null, 8, ["label"]),
370
- u("div", We, E(s(a)("inventory.surcharge.form.rules.description")), 1)
371
- ]),
372
- n(de, {
373
- variant: "outlined",
374
- class: "p-16"
375
- }, {
376
- default: f(() => {
377
- var l;
378
- return [
379
- u("div", Xe, [
380
- u("div", Ye, [
381
- n(i, {
382
- "model-value": parseFloat(q()),
383
- label: s(a)("inventory.surcharge.form.value.amount"),
384
- required: !0,
385
- rules: [(m) => m > 0 || "Amount must be greater than 0"]
386
- }, {
387
- default: f(() => [
388
- n(C, {
389
- "model-value": q(),
390
- "onUpdate:modelValue": t[4] || (t[4] = (m) => ie(m)),
391
- onBlur: t[5] || (t[5] = () => h.value = ""),
392
- type: "number",
393
- step: 0.01
394
- }, null, 8, ["model-value"])
395
- ]),
396
- _: 1
397
- }, 8, ["model-value", "label", "rules"]),
398
- n(i, {
399
- "model-value": (l = o.value.value) == null ? void 0 : l.skuId,
400
- label: s(a)("inventory.surcharge.form.value.item"),
401
- "label-mark": "optional"
402
- }, {
403
- default: f(() => [
404
- u("div", {
405
- class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-300 rounded-md cursor-pointer hover:border-fm-color-neutral-gray-400 transition-colors",
406
- onClick: ae
407
- }, [
408
- u("span", {
409
- class: G([
410
- "line-clamp-1 fm-typo-en-body-lg-400",
411
- w.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"
412
- ])
413
- }, E(w.value ? `${w.value.code} - ${w.value.name}` : s(a)("inventory.surcharge.form.value.itemPlaceholder")), 3),
414
- u("div", Ze, [
415
- w.value ? (j(), Se(I, {
416
- key: 0,
417
- variant: "tertiary",
418
- icon: "close",
419
- onClick: t[6] || (t[6] = xe((m) => z(null), ["stop"]))
420
- })) : Fe("", !0),
421
- n(L, {
422
- name: "arrow_drop_down",
423
- size: "md"
424
- })
425
- ])
426
- ])
427
- ]),
428
- _: 1
429
- }, 8, ["model-value", "label"]),
430
- n(s(Ne), {
431
- modelValue: b.value,
432
- "onUpdate:modelValue": t[7] || (t[7] = (m) => b.value = m),
433
- attributes: ee.value
434
- }, null, 8, ["modelValue", "attributes"]),
435
- n(i, {
436
- "model-value": b.value,
437
- rules: [(m) => {
438
- var J;
439
- return !!((J = m == null ? void 0 : m.rules) != null && J.length) || "At least one rule is required";
440
- }]
441
- }, null, 8, ["model-value", "rules"])
442
- ])
443
- ])
444
- ];
445
- }),
446
- _: 1
447
- })
448
- ])
449
- ])
450
- ])
451
- ]),
452
- _: 1
453
- }, 8, ["modelValue", "header"])
454
- ], 64);
455
- };
456
- }
457
- });
458
- export {
459
- pt as default
460
- };
@@ -1,84 +0,0 @@
1
- import { defineComponent as I, h as R, computed as h, openBlock as l, createBlock as V, resolveDynamicComponent as B, unref as c, normalizeClass as F, withCtx as D, createElementVNode as d, renderSlot as N, normalizeProps as z, guardReactiveProps as E, createElementBlock as u, Fragment as g, renderList as L, createVNode as k, createCommentVNode as y } from "vue";
2
- import { components as P } from "@feedmepos/ui-library";
3
- /**
4
- * vue-table
5
- *
6
- * Copyright (c) TanStack
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE.md file in the root directory of this source tree.
10
- *
11
- * @license MIT
12
- */
13
- const b = I({
14
- props: ["render", "props"],
15
- setup: (o) => () => typeof o.render == "function" || typeof o.render == "object" ? R(o.render, o.props) : o.render
16
- }), S = { class: "flex gap-4 w-full" }, _ = { class: "flex-1" }, $ = { class: "flex flex-col" }, j = { key: 0 }, A = { key: 0 }, G = /* @__PURE__ */ I({
17
- __name: "TableActionableRow",
18
- props: {
19
- row: {},
20
- onRowClick: {},
21
- actionColumnId: { default: "action" }
22
- },
23
- setup(o) {
24
- const m = o, s = h(
25
- () => m.row.getVisibleCells().reduce(
26
- (e, r) => (e[r.column.id] = r, e),
27
- {}
28
- )
29
- );
30
- return (e, r) => (l(), V(B(e.onRowClick ? c(P).FmListItem : "div"), {
31
- class: F([
32
- "w-full border-b border-fm-color-neutral-gray-100",
33
- {
34
- "bg-fm-color-neutral-gray-100": e.row.getIsSelected(),
35
- "cursor-pointer": typeof e.onRowClick == "function"
36
- }
37
- ]),
38
- onClick: r[0] || (r[0] = (a) => {
39
- var t;
40
- return (t = e.onRowClick) == null ? void 0 : t.call(e, e.row.original);
41
- })
42
- }, {
43
- default: D(() => {
44
- var a, t, p, i, f;
45
- return [
46
- d("div", S, [
47
- d("div", _, [
48
- N(e.$slots, "default", z(E(s.value)), () => [
49
- d("div", $, [
50
- (l(!0), u(g, null, L(m.row.getVisibleCells(), (n) => {
51
- var C, v, w;
52
- return l(), u(g, {
53
- key: n.id
54
- }, [
55
- n.column.id !== e.actionColumnId ? (l(), u("div", j, [
56
- k(c(b), {
57
- render: (v = (C = n.column) == null ? void 0 : C.columnDef) == null ? void 0 : v.cell,
58
- props: (w = n.getContext) == null ? void 0 : w.call(n)
59
- }, null, 8, ["render", "props"])
60
- ])) : y("", !0)
61
- ], 64);
62
- }), 128))
63
- ])
64
- ])
65
- ]),
66
- s.value[e.actionColumnId ?? ""] ? (l(), u("div", A, [
67
- d("div", null, [
68
- k(c(b), {
69
- render: (p = (t = (a = s.value[e.actionColumnId ?? ""]) == null ? void 0 : a.column) == null ? void 0 : t.columnDef) == null ? void 0 : p.cell,
70
- props: (f = (i = s.value[e.actionColumnId ?? ""]) == null ? void 0 : i.getContext) == null ? void 0 : f.call(i)
71
- }, null, 8, ["render", "props"])
72
- ])
73
- ])) : y("", !0)
74
- ])
75
- ];
76
- }),
77
- _: 3
78
- }, 8, ["class"]));
79
- }
80
- });
81
- export {
82
- b as F,
83
- G as _
84
- };
@@ -1,155 +0,0 @@
1
- import { defineComponent as C, ref as c, computed as f, resolveComponent as y, openBlock as P, createElementBlock as A, createElementVNode as d, toDisplayString as D, createVNode as v, unref as x, h as g } from "vue";
2
- import { u as T } from "./vue-i18n-BCEDBY4T.js";
3
- import { components as E } from "@feedmepos/ui-library";
4
- import { K as R, D as K } from "./app-DiX-EfV6.js";
5
- const S = {
6
- class: "flex flex-col gap-24",
7
- style: { height: "400px" }
8
- }, z = { class: "flex items-center" }, U = { class: "fm-typo-en-body-lg-600 flex-1" }, j = { class: "flex flex-col gap-4 w-full flex-1 min-h-0" }, q = /* @__PURE__ */ C({
9
- __name: "TemplatePublishDialog",
10
- props: {
11
- title: {},
12
- doc: {},
13
- controller: {},
14
- initialPublishedRev: {},
15
- locations: {},
16
- enabledLocations: {}
17
- },
18
- setup(w) {
19
- const s = w, m = c(s.initialPublishedRev ?? {}), t = c(), i = c({}), L = f(() => {
20
- var e;
21
- return ((e = s.enabledLocations) != null && e.length ? s.enabledLocations : s.locations).map((a) => {
22
- var o;
23
- const h = !!(((o = m.value) == null ? void 0 : o[a.dbName]) ?? []).find((_) => _._id === s.doc._id && _._rev === s.doc._rev);
24
- return {
25
- ...a,
26
- status: h ? "published" : "outdated"
27
- };
28
- });
29
- }), { t: u } = T(), p = c(""), b = c({
30
- logic: "AND",
31
- rules: []
32
- }), V = [
33
- {
34
- type: "string",
35
- key: "status",
36
- entity: "inventory",
37
- values: ["published", "outdated"]
38
- }
39
- ], r = f(() => {
40
- const l = p.value.toLowerCase();
41
- return L.value.filter((e) => R(e, b.value)).filter(({ name: e }) => l ? e.toLowerCase().includes(l) : !0);
42
- });
43
- function F() {
44
- const l = Object.keys(i.value).map(Number).filter((e) => i.value[e]);
45
- return l.length === 0 ? r.value : l.map((e) => r.value[e]);
46
- }
47
- const N = [
48
- {
49
- id: "name",
50
- header: () => "Name",
51
- accessorKey: "name",
52
- size: "auto"
53
- },
54
- {
55
- id: "status",
56
- header: () => "Published",
57
- accessorKey: "status",
58
- cell: (l) => {
59
- const e = l.row.original, a = e.status === "published";
60
- return g("div", { class: "flex items-center gap-8" }, [
61
- g(
62
- "div",
63
- {
64
- class: [
65
- "fm-status-badge",
66
- a ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
67
- ]
68
- },
69
- u(a ? "inventory.publish.status.published" : "inventory.publish.status.outdated")
70
- ),
71
- g(E.FmButton, {
72
- class: "tertiary",
73
- variant: "secondary",
74
- icon: "ios_share",
75
- loading: t.value === e.dbName,
76
- disabled: t.value !== void 0 && t.value !== e.dbName,
77
- onClick: async () => {
78
- t.value = e.dbName;
79
- try {
80
- const n = await s.controller.publishAtLocation(e).delayed(1e3);
81
- m.value = n;
82
- } catch (n) {
83
- console.error("Error publishing at location:", n);
84
- } finally {
85
- t.value = void 0;
86
- }
87
- }
88
- })
89
- ]);
90
- }
91
- }
92
- ];
93
- async function k() {
94
- t.value = "all";
95
- try {
96
- const l = F(), e = await s.controller.publishAll(l).delayed(1e3);
97
- m.value = e;
98
- } catch (l) {
99
- console.error("Error publishing all:", l);
100
- } finally {
101
- t.value = void 0;
102
- }
103
- }
104
- const B = f(() => {
105
- const l = Object.values(i.value).filter(Boolean).length;
106
- return l === 0 || l === r.value.length ? u("inventory.publish.actions.publishAll") : u("inventory.publish.actions.publishSelected", { count: l });
107
- });
108
- return (l, e) => {
109
- const a = y("FmButton"), n = y("FmTextField"), h = y("FmTable");
110
- return P(), A("div", S, [
111
- d("div", z, [
112
- d("div", U, D(l.title), 1),
113
- d("div", null, [
114
- v(a, {
115
- label: B.value,
116
- variant: "secondary",
117
- onClick: e[0] || (e[0] = (o) => k()),
118
- loading: t.value === "all",
119
- disabled: t.value !== "all" && t.value !== void 0
120
- }, null, 8, ["label", "loading", "disabled"])
121
- ])
122
- ]),
123
- d("div", j, [
124
- v(n, {
125
- modelValue: p.value,
126
- "onUpdate:modelValue": e[1] || (e[1] = (o) => p.value = o),
127
- class: "w-full",
128
- placeholder: x(u)("inventory.publish.search.placeholder"),
129
- "prepend-icon": "search"
130
- }, null, 8, ["modelValue", "placeholder"]),
131
- v(x(K), {
132
- modelValue: b.value,
133
- "onUpdate:modelValue": e[2] || (e[2] = (o) => b.value = o),
134
- attributes: V
135
- }, null, 8, ["modelValue"]),
136
- v(h, {
137
- modelValue: i.value,
138
- "onUpdate:modelValue": e[3] || (e[3] = (o) => i.value = o),
139
- "row-data": r.value,
140
- "column-defs": N,
141
- "shrink-at": 9999,
142
- virtual: !0,
143
- "page-size": r.value.length,
144
- selection: "multiple",
145
- class: "flex-1 min-h-0",
146
- "hide-footer": ""
147
- }, null, 8, ["modelValue", "row-data", "page-size"])
148
- ])
149
- ]);
150
- };
151
- }
152
- });
153
- export {
154
- q as _
155
- };