@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,6 +1,6 @@
1
1
  import { defineComponent as I, computed as x, openBlock as l, createElementBlock as d, createElementVNode as e, normalizeClass as b, toDisplayString as u, unref as p, ref as D, resolveComponent as B, Fragment as $, createVNode as k, createCommentVNode as N, withCtx as C, renderList as E } from "vue";
2
2
  import { useI18n as F, useCoreStore as A } from "@feedmepos/mf-common";
3
- import { u as U } from "./netsuite-3LgQ5ztL.js";
3
+ import { u as U } from "./netsuite-CPg7U65w.js";
4
4
  function ee(o, n = !1) {
5
5
  var c;
6
6
  return o ? [
@@ -1,24 +1,23 @@
1
1
  import { defineComponent as ie, mergeModels as Hd, computed as E, useModel as ed, resolveComponent as D, openBlock as S, createElementBlock as w, createElementVNode as h, createVNode as C, withCtx as U, toDisplayString as A, unref as p, Fragment as oe, renderList as le, ref as k, createBlock as z, createCommentVNode as W, createTextVNode as wd, isRef as dd, normalizeClass as ae, watch as Td, createSlots as jd, normalizeStyle as Kd, Teleport as Wd } from "vue";
2
- import { u as ce } from "./supplier-C-dmFnqw.js";
2
+ import { u as ce } from "./supplier-BJv4rrs8.js";
3
3
  import { D as td, R as ye } from "./row-action.enum-BcW_L_nE.js";
4
- import { c as Yd } from "./component-DpCUABT3.js";
5
- import { c as we, a as ke, h as rd, i as nd, d as Xd, n as Ad, u as Pe } from "./app-CddcvygU.js";
4
+ import { c as Yd, _ as Xd, F as ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
5
+ import { c as we, a as ke, h as rd, i as nd, d as Zd, n as Ad, u as Pe } from "./app-yA2GcbOF.js";
6
6
  import { useI18n as ee, useCoreStore as Ce } from "@feedmepos/mf-common";
7
- import { u as Ve } from "./netsuite-3LgQ5ztL.js";
8
- import { useDialog as Ne, useSnackbar as Se, useProxiedModel as od, useDialogChild as Zd, useBreakpoints as qd } from "@feedmepos/ui-library";
9
- import { u as zd, _ as Jd } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
7
+ import { u as Ve } from "./netsuite-CPg7U65w.js";
8
+ import { useDialog as Ne, useSnackbar as Se, useProxiedModel as od, useDialogChild as qd, useBreakpoints as zd } from "@feedmepos/ui-library";
9
+ import { u as Jd, _ as Qd } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
10
10
  import { F as B } from "./form-mode.enum-BKiNVH6A.js";
11
- import { R as Z, g as Qd } from "./rules-hQBVd1Mn.js";
12
- import { a as et } from "./FmMultiselectDialog-BviFuAM5.js";
13
- import { _ as dt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
14
- import { _ as tt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CRTG3VFo.js";
15
- import { u as xe } from "./feature-CTA18HlL.js";
16
- import { u as rt } from "./purchase-order-template-CJCmABzP.js";
17
- import { _ as nt, F as ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
18
- import { _ as ot } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-kVpsL4cx.js";
11
+ import { R as Z, g as et } from "./rules-BDCrcRdu.js";
12
+ import { a as dt } from "./FmMultiselectDialog-CMGvzBur.js";
13
+ import { _ as tt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
14
+ import { _ as rt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CnHJwYtN.js";
15
+ import { u as xe } from "./feature-D8BhYTHO.js";
16
+ import { u as nt } from "./purchase-order-template-Dx0eXO5h.js";
17
+ import { _ as ot } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DLdaN3XH.js";
19
18
  import { defineStore as at } from "pinia";
20
- import { b as Rd, d as Md, s as it, r as $t } from "./xlsx.util-CSudzOii.js";
21
- import { f as lt } from "./date2-CVZy20Q_.js";
19
+ import { b as Rd, d as Md, s as it, r as $t } from "./xlsx.util-Boe3rV7g.js";
20
+ import { f as lt } from "./date2-CGBF6K5g.js";
22
21
  import { F as st } from "./FmDroppableField-J0xUsOTV.js";
23
22
  function ut(e, d) {
24
23
  const { t } = ee(), r = Ve();
@@ -107,13 +106,13 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
107
106
  })), y = ((N = o.value) == null ? void 0 : N.map((f) => f.skuId)) ?? [], g = E(
108
107
  () => {
109
108
  var f;
110
- return ((f = Xd(d.currentCountry.value)) == null ? void 0 : f.currency) ?? "MYR";
109
+ return ((f = Zd(d.currentCountry.value)) == null ? void 0 : f.currency) ?? "MYR";
111
110
  }
112
111
  );
113
112
  n.open({
114
113
  title: i("inventory.supplier.supplyItems.selectItem"),
115
114
  closeButton: !0,
116
- contentComponent: et,
115
+ contentComponent: dt,
117
116
  contentComponentProps: {
118
117
  modelValue: y,
119
118
  items: c
@@ -184,7 +183,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
184
183
  h("div", pt, [
185
184
  h("div", ft, [
186
185
  h("div", mt, [
187
- C(dt, { "z-index": 50 }, {
186
+ C(tt, { "z-index": 50 }, {
188
187
  default: U(() => [
189
188
  h("div", yt, A(p(i)("inventory.supplier.supplyItems.title")), 1)
190
189
  ]),
@@ -217,7 +216,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
217
216
  ]),
218
217
  h("div", Ct, [
219
218
  h("div", Nt, [
220
- C(tt, {
219
+ C(rt, {
221
220
  "model-value": v(N),
222
221
  unit: u(N),
223
222
  "onUpdate:modelValue": (T) => m(N, T),
@@ -555,7 +554,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
555
554
  },
556
555
  emits: ["update:show", "submitted"],
557
556
  setup(e, { expose: d, emit: t }) {
558
- const r = Ve(), n = e, i = t, o = k(!1), l = Se(), s = Ne(), { t: u } = ee(), v = ce(), m = rt(), c = ke(), y = k(!1), g = E(() => {
557
+ const r = Ve(), n = e, i = t, o = k(!1), l = Se(), s = Ne(), { t: u } = ee(), v = ce(), m = nt(), c = ke(), y = k(!1), g = E(() => {
559
558
  switch (n.mode) {
560
559
  case B.READ:
561
560
  return "";
@@ -711,7 +710,7 @@ const ct = { class: "flex flex-col gap-12" }, pt = { class: "flex flex-col" }, f
711
710
  var $e;
712
711
  const re = {
713
712
  amount: 1,
714
- precision: Qd(K.unit)
713
+ precision: et(K.unit)
715
714
  };
716
715
  return {
717
716
  sku: K,
@@ -2698,7 +2697,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
2698
2697
  }, v1 = { class: "fm-typo-en-body-lg-600" }, g1 = /* @__PURE__ */ ie({
2699
2698
  __name: "SupplierImport",
2700
2699
  setup(e) {
2701
- const d = k(null), t = Zd(), r = Se(), n = k(!1), i = k(!1), o = k(new Array()), l = k([]), s = k([]), u = E(
2700
+ const d = k(null), t = qd(), r = Se(), n = k(!1), i = k(!1), o = k(new Array()), l = k([]), s = k([]), u = E(
2702
2701
  () => !!o.value.length || l.value.some((y) => y.errors.length) || s.value.some((y) => y.errors.length)
2703
2702
  ), v = E(
2704
2703
  () => !!l.value.length || !!s.value.length
@@ -2943,7 +2942,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
2943
2942
  }), b1 = { class: "flex flex-col py-8" }, _1 = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, P1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, C1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, N1 = {
2944
2943
  key: 0,
2945
2944
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2946
- }, S1 = "You are managing business-level supplier list. These suppliers will be made visible to all locations.", X1 = /* @__PURE__ */ ie({
2945
+ }, S1 = "You are managing business-level supplier list. These suppliers will be made visible to all locations.", Y1 = /* @__PURE__ */ ie({
2947
2946
  __name: "SupplierView",
2948
2947
  setup(e) {
2949
2948
  const { importSuppliers: d, exportSuppliers: t } = h1(), r = ce(), n = Pe(), i = xe(), o = Ve(), l = k(!1), s = Ne(), u = Se(), { t: v } = ee();
@@ -3033,7 +3032,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
3033
3032
  if ($ === "refresh")
3034
3033
  return c();
3035
3034
  }
3036
- const V = k(""), { breakpoints: Y } = qd(), X = E(() => Y.value.xs || Y.value.sm), te = E(() => X.value ? 10 : 20), _ = zd(), x = E(() => [
3035
+ const V = k(""), { breakpoints: Y } = zd(), X = E(() => Y.value.xs || Y.value.sm), te = E(() => X.value ? 10 : 20), _ = Jd(), x = E(() => [
3037
3036
  {
3038
3037
  label: v("inventory.supplier.create.title"),
3039
3038
  value: "create",
@@ -3058,7 +3057,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
3058
3057
  ]);
3059
3058
  return ($, a) => {
3060
3059
  const H = D("FmTable");
3061
- return S(), z(Jd, {
3060
+ return S(), z(Qd, {
3062
3061
  title: p(v)("inventory.supplier.title"),
3063
3062
  actions: x.value,
3064
3063
  "onClick:action": T,
@@ -3093,7 +3092,7 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
3093
3092
  "page-size": te.value
3094
3093
  }, {
3095
3094
  "list-row": U((I) => [
3096
- C(nt, {
3095
+ C(Xd, {
3097
3096
  row: I,
3098
3097
  onRowClick: f
3099
3098
  }, {
@@ -3150,5 +3149,5 @@ const t1 = { class: "flex items-center gap-12 pl-8" }, r1 = { class: "flex flex-
3150
3149
  }
3151
3150
  });
3152
3151
  export {
3153
- X1 as default
3152
+ Y1 as default
3154
3153
  };
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as I, ref as m, resolveComponent as p, openBlock as i, createBlock as O, withCtx as u, createVNode as y, createElementBlock as v, toDisplayString as g, createElementVNode as T, h as B } from "vue";
2
2
  import { F as L } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
- import { o as U, u as _ } from "./app-CddcvygU.js";
3
+ import { o as U, u as _ } from "./app-yA2GcbOF.js";
4
4
  import { useCoreStore as A } from "@feedmepos/mf-common";
5
5
  import { useDialog as C, components as V } from "@feedmepos/ui-library";
6
- import { u as F, a as j } from "./closing-template-DxdLqlb1.js";
6
+ import { u as F, a as j } from "./closing-template-C_fOjY8b.js";
7
7
  const q = U((o, t) => {
8
8
  const c = _(), l = A();
9
9
  return {
@@ -0,0 +1,162 @@
1
+ import { useI18n as B } from "@feedmepos/mf-common";
2
+ import { components as F } from "@feedmepos/ui-library";
3
+ import { h as n, defineComponent as R, computed as M, openBlock as c, createBlock as V, resolveDynamicComponent as D, unref as f, normalizeClass as _, withCtx as z, createElementVNode as m, renderSlot as N, normalizeProps as P, guardReactiveProps as E, createElementBlock as p, Fragment as k, renderList as L, createVNode as w, createCommentVNode as y } from "vue";
4
+ const { FmMenu: S, FmButton: $, FmMenuItem: I, FmMenuHeader: j, FmMenuDivider: A } = F;
5
+ function U(r, d, s = []) {
6
+ const { t: e } = B(), l = [
7
+ ...r.map(({ translationKey: i, color: t, value: u }) => {
8
+ const o = e(i);
9
+ return n(
10
+ I,
11
+ {
12
+ onClick() {
13
+ d(u ?? o);
14
+ }
15
+ },
16
+ {
17
+ label: () => n(
18
+ "span",
19
+ {
20
+ class: t
21
+ },
22
+ o
23
+ )
24
+ }
25
+ );
26
+ })
27
+ ];
28
+ return s.length > 0 && l.push(
29
+ n(j, { label: "Admin Only" }),
30
+ n(A),
31
+ ...s.map(({ translationKey: i, color: t, value: u }) => {
32
+ const o = e(i);
33
+ return n(
34
+ I,
35
+ {
36
+ onClick() {
37
+ d(u ?? o);
38
+ },
39
+ icon: "support_agent"
40
+ },
41
+ {
42
+ label: () => n(
43
+ "span",
44
+ {
45
+ class: t
46
+ },
47
+ o
48
+ )
49
+ }
50
+ );
51
+ })
52
+ ), n(
53
+ S,
54
+ {
55
+ trigger: "click",
56
+ stopClickPropagation: !0
57
+ },
58
+ {
59
+ "menu-button": () => n($, {
60
+ type: "button",
61
+ variant: "tertiary",
62
+ icon: "more_vert",
63
+ iconColor: "#000000",
64
+ size: "md"
65
+ }),
66
+ default: () => n(
67
+ "div",
68
+ {
69
+ style: {
70
+ backgroundColor: "white",
71
+ padding: "4px",
72
+ width: "160px"
73
+ }
74
+ },
75
+ l
76
+ )
77
+ }
78
+ );
79
+ }
80
+ /**
81
+ * vue-table
82
+ *
83
+ * Copyright (c) TanStack
84
+ *
85
+ * This source code is licensed under the MIT license found in the
86
+ * LICENSE.md file in the root directory of this source tree.
87
+ *
88
+ * @license MIT
89
+ */
90
+ const h = R({
91
+ props: ["render", "props"],
92
+ setup: (r) => () => typeof r.render == "function" || typeof r.render == "object" ? n(r.render, r.props) : r.render
93
+ }), H = { class: "flex gap-4 w-full" }, O = { class: "flex-1" }, T = { class: "flex flex-col" }, q = { key: 0 }, G = { key: 0 }, W = /* @__PURE__ */ R({
94
+ __name: "TableActionableRow",
95
+ props: {
96
+ row: {},
97
+ onRowClick: {},
98
+ actionColumnId: { default: "action" }
99
+ },
100
+ setup(r) {
101
+ const d = r, s = M(
102
+ () => d.row.getVisibleCells().reduce(
103
+ (e, l) => (e[l.column.id] = l, e),
104
+ {}
105
+ )
106
+ );
107
+ return (e, l) => (c(), V(D(e.onRowClick ? f(F).FmListItem : "div"), {
108
+ class: _([
109
+ "w-full border-b border-fm-color-neutral-gray-100",
110
+ {
111
+ "bg-fm-color-neutral-gray-100": e.row.getIsSelected(),
112
+ "cursor-pointer": typeof e.onRowClick == "function"
113
+ }
114
+ ]),
115
+ onClick: l[0] || (l[0] = (i) => {
116
+ var t;
117
+ return (t = e.onRowClick) == null ? void 0 : t.call(e, e.row.original);
118
+ })
119
+ }, {
120
+ default: z(() => {
121
+ var i, t, u, o, C;
122
+ return [
123
+ m("div", H, [
124
+ m("div", O, [
125
+ N(e.$slots, "default", P(E(s.value)), () => [
126
+ m("div", T, [
127
+ (c(!0), p(k, null, L(d.row.getVisibleCells(), (a) => {
128
+ var g, v, b;
129
+ return c(), p(k, {
130
+ key: a.id
131
+ }, [
132
+ a.column.id !== e.actionColumnId ? (c(), p("div", q, [
133
+ w(f(h), {
134
+ render: (v = (g = a.column) == null ? void 0 : g.columnDef) == null ? void 0 : v.cell,
135
+ props: (b = a.getContext) == null ? void 0 : b.call(a)
136
+ }, null, 8, ["render", "props"])
137
+ ])) : y("", !0)
138
+ ], 64);
139
+ }), 128))
140
+ ])
141
+ ])
142
+ ]),
143
+ s.value[e.actionColumnId ?? ""] ? (c(), p("div", G, [
144
+ m("div", null, [
145
+ w(f(h), {
146
+ render: (u = (t = (i = s.value[e.actionColumnId ?? ""]) == null ? void 0 : i.column) == null ? void 0 : t.columnDef) == null ? void 0 : u.cell,
147
+ props: (C = (o = s.value[e.actionColumnId ?? ""]) == null ? void 0 : o.getContext) == null ? void 0 : C.call(o)
148
+ }, null, 8, ["render", "props"])
149
+ ])
150
+ ])) : y("", !0)
151
+ ])
152
+ ];
153
+ }),
154
+ _: 3
155
+ }, 8, ["class"]));
156
+ }
157
+ });
158
+ export {
159
+ h as F,
160
+ W as _,
161
+ U as c
162
+ };
@@ -0,0 +1,201 @@
1
+ import { defineComponent as P, ref as b, computed as v, resolveComponent as g, openBlock as L, createElementBlock as T, createElementVNode as p, toDisplayString as U, createVNode as h, createBlock as R, createCommentVNode as D, unref as w, h as m } from "vue";
2
+ import { u as S } from "./vue-i18n-Cb65g8p9.js";
3
+ import { components as x } from "@feedmepos/ui-library";
4
+ import { E as j, b as z } from "./app-uBuHtW8m.js";
5
+ const O = {
6
+ class: "flex flex-col gap-24",
7
+ style: { height: "400px" }
8
+ }, I = { class: "flex items-center" }, K = { class: "fm-typo-en-body-lg-600 flex-1" }, M = { class: "flex gap-8" }, q = { class: "flex flex-col gap-4 w-full flex-1 min-h-0" }, W = /* @__PURE__ */ P({
9
+ __name: "TemplatePublishDialog",
10
+ props: {
11
+ title: {},
12
+ doc: {},
13
+ controller: {},
14
+ initialPublishedRev: {},
15
+ locations: {},
16
+ enabledLocations: {}
17
+ },
18
+ setup(N) {
19
+ const o = N, c = b(o.initialPublishedRev ?? {}), t = b(), i = b({}), A = v(() => {
20
+ var e;
21
+ return ((e = o.enabledLocations) != null && e.length ? o.enabledLocations : o.locations).map((s) => {
22
+ var n;
23
+ const a = !!(((n = c.value) == null ? void 0 : n[s.dbName]) ?? []).find((k) => k._id === o.doc._id && k._rev === o.doc._rev);
24
+ return {
25
+ ...s,
26
+ status: a ? "published" : "outdated"
27
+ };
28
+ });
29
+ }), { t: d } = S(), f = b(""), y = b({
30
+ logic: "AND",
31
+ rules: []
32
+ }), V = [
33
+ {
34
+ type: "string",
35
+ key: "status",
36
+ entity: "inventory",
37
+ values: ["published", "outdated"]
38
+ }
39
+ ], u = v(() => {
40
+ const l = f.value.toLowerCase();
41
+ return A.value.filter((e) => j(e, y.value)).filter(({ name: e }) => l ? e.toLowerCase().includes(l) : !0);
42
+ });
43
+ function _() {
44
+ const l = Object.keys(i.value).map(Number).filter((e) => i.value[e]);
45
+ return l.length === 0 ? u.value : l.map((e) => u.value[e]);
46
+ }
47
+ const C = [
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, s = e.status === "published";
60
+ let r;
61
+ return s && o.controller.unpublishAtLocation ? r = m(x.FmButton, {
62
+ class: "tertiary",
63
+ variant: "secondary",
64
+ icon: "block",
65
+ loading: t.value === `unpublish-${e.dbName}`,
66
+ disabled: t.value !== void 0 && t.value !== `unpublish-${e.dbName}`,
67
+ onClick: async () => {
68
+ t.value = `unpublish-${e.dbName}`;
69
+ try {
70
+ const a = await o.controller.unpublishAtLocation(e).delayed(1e3);
71
+ c.value = a;
72
+ } catch (a) {
73
+ console.error("Error unpublishing at location:", a);
74
+ } finally {
75
+ t.value = void 0;
76
+ }
77
+ }
78
+ }) : r = m(x.FmButton, {
79
+ class: "tertiary",
80
+ variant: "secondary",
81
+ icon: "ios_share",
82
+ loading: t.value === `publish-${e.dbName}`,
83
+ disabled: t.value !== void 0 && t.value !== `publish-${e.dbName}`,
84
+ onClick: async () => {
85
+ t.value = `publish-${e.dbName}`;
86
+ try {
87
+ const a = await o.controller.publishAtLocation(e).delayed(1e3);
88
+ c.value = a;
89
+ } catch (a) {
90
+ console.error("Error publishing at location:", a);
91
+ } finally {
92
+ t.value = void 0;
93
+ }
94
+ }
95
+ }), m("div", { class: "flex items-center gap-8" }, [
96
+ m(
97
+ "div",
98
+ {
99
+ class: [
100
+ "fm-status-badge",
101
+ s ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
102
+ ]
103
+ },
104
+ d(s ? "inventory.publish.status.published" : "inventory.publish.status.outdated")
105
+ ),
106
+ r
107
+ ]);
108
+ }
109
+ }
110
+ ];
111
+ async function B() {
112
+ t.value = "all";
113
+ try {
114
+ const l = _(), e = await o.controller.publishAll(l).delayed(1e3);
115
+ c.value = e;
116
+ } catch (l) {
117
+ console.error("Error publishing all:", l);
118
+ } finally {
119
+ t.value = void 0;
120
+ }
121
+ }
122
+ async function F() {
123
+ if (o.controller.unpublishAll) {
124
+ t.value = "unpublish-all";
125
+ try {
126
+ const l = _(), e = await o.controller.unpublishAll(l).delayed(1e3);
127
+ c.value = e;
128
+ } catch (l) {
129
+ console.error("Error unpublishing all:", l);
130
+ } finally {
131
+ t.value = void 0;
132
+ }
133
+ }
134
+ }
135
+ const $ = v(() => {
136
+ const l = Object.keys(i.value).filter(
137
+ (e) => i.value[e]
138
+ ).length;
139
+ return l === 0 || l === u.value.length ? d("inventory.publish.actions.publishAll") : d("inventory.publish.actions.publishSelected", { count: l });
140
+ }), E = v(() => {
141
+ const l = Object.keys(i.value).filter(
142
+ (e) => i.value[e]
143
+ ).length;
144
+ return l === 0 || l === u.value.length ? "Unpublish all" : `Unpublish selected ${l} location${l === 1 ? "" : "s"}`;
145
+ });
146
+ return (l, e) => {
147
+ const s = g("FmButton"), r = g("FmTextField"), a = g("FmTable");
148
+ return L(), T("div", O, [
149
+ p("div", I, [
150
+ p("div", K, U(l.title), 1),
151
+ p("div", M, [
152
+ h(s, {
153
+ label: $.value,
154
+ variant: "secondary",
155
+ onClick: e[0] || (e[0] = (n) => B()),
156
+ loading: t.value === "all",
157
+ disabled: t.value !== "all" && t.value !== void 0
158
+ }, null, 8, ["label", "loading", "disabled"]),
159
+ l.controller.unpublishAll ? (L(), R(s, {
160
+ key: 0,
161
+ label: E.value,
162
+ variant: "tertiary",
163
+ onClick: e[1] || (e[1] = (n) => F()),
164
+ loading: t.value === "unpublish-all",
165
+ disabled: t.value !== "unpublish-all" && t.value !== void 0
166
+ }, null, 8, ["label", "loading", "disabled"])) : D("", !0)
167
+ ])
168
+ ]),
169
+ p("div", q, [
170
+ h(r, {
171
+ modelValue: f.value,
172
+ "onUpdate:modelValue": e[2] || (e[2] = (n) => f.value = n),
173
+ class: "w-full",
174
+ placeholder: w(d)("inventory.publish.search.placeholder"),
175
+ "prepend-icon": "search"
176
+ }, null, 8, ["modelValue", "placeholder"]),
177
+ h(w(z), {
178
+ modelValue: y.value,
179
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => y.value = n),
180
+ attributes: V
181
+ }, null, 8, ["modelValue"]),
182
+ h(a, {
183
+ modelValue: i.value,
184
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => i.value = n),
185
+ "row-data": u.value,
186
+ "column-defs": C,
187
+ "shrink-at": 9999,
188
+ virtual: !0,
189
+ "page-size": u.value.length,
190
+ selection: "multiple",
191
+ class: "flex-1 min-h-0",
192
+ "hide-footer": ""
193
+ }, null, 8, ["modelValue", "row-data", "page-size"])
194
+ ])
195
+ ]);
196
+ };
197
+ }
198
+ });
199
+ export {
200
+ W as _
201
+ };