@feedmepos/mf-payment 0.0.0-beta.38 → 0.0.0-beta.39

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ import { p as z } from "./index-ApzEWD1P.js";
3
3
  import { _ as I, u as S, c as h } from "./index-Cnxt2xmc.js";
4
4
  import { defineStore as _ } from "pinia";
5
5
  import { useCoreStore as $ } from "@feedmepos/mf-common";
6
- import { c as AA, P as j } from "./payout-account-CfYFecy1.js";
6
+ import { c as AA, P as j } from "./payout-account-yu8hGM_j.js";
7
7
  import { useDialogChild as sA, useDialog as eA } from "@feedmepos/ui-library";
8
8
  import { z as f, a as q } from "./validator-D5jtpt9A.js";
9
9
  import { P as K } from "./PDFViewer-CjH_C1uT.js";
@@ -2,10 +2,10 @@ import { defineComponent as b, resolveComponent as m, openBlock as g, createBloc
2
2
  import { u as S } from "./index-BgnU5ezY.js";
3
3
  import { _ as O } from "./index-Cnxt2xmc.js";
4
4
  import { _ as K } from "./AdminLayout.vue_vue_type_script_setup_true_lang-1DSAdvX7.js";
5
- import { P as V } from "./payout-account-CfYFecy1.js";
5
+ import { P as V } from "./payout-account-yu8hGM_j.js";
6
6
  import { p as D } from "./index-ApzEWD1P.js";
7
7
  import "@feedmepos/ui-library";
8
- import { _ as T } from "./index.vue_vue_type_script_setup_true_lang-B8eGz19R.js";
8
+ import { _ as T } from "./index.vue_vue_type_script_setup_true_lang-D2Eefuww.js";
9
9
  import { useRouter as $ } from "vue-router";
10
10
  const G = /* @__PURE__ */ b({
11
11
  __name: "Status",
@@ -2,7 +2,7 @@ import { defineComponent as x, openBlock as f, createElementBlock as B, createTe
2
2
  import "./index-Cnxt2xmc.js";
3
3
  import { h as Y } from "./moment-h96o7c8I.js";
4
4
  import { u as j } from "./index-BgnU5ezY.js";
5
- import { _ as q } from "./index.vue_vue_type_script_setup_true_lang-B8eGz19R.js";
5
+ import { _ as q } from "./index.vue_vue_type_script_setup_true_lang-D2Eefuww.js";
6
6
  import { _ as Q } from "./AdminLayout.vue_vue_type_script_setup_true_lang-1DSAdvX7.js";
7
7
  import { useSnackbar as $, useDialogChild as G, useDialog as H } from "@feedmepos/ui-library";
8
8
  import { t as A } from "./index-CBFVJirn.js";
@@ -1,8 +1,8 @@
1
- import { defineComponent as I, openBlock as y, createElementBlock as w, unref as i, createCommentVNode as V, createElementVNode as h, resolveComponent as g, createBlock as v, normalizeClass as K, withCtx as N, toDisplayString as C, createVNode as p, Fragment as $, renderList as L, ref as P, watch as R, isRef as x, h as A } from "vue";
1
+ import { defineComponent as I, openBlock as y, createElementBlock as h, unref as c, createCommentVNode as V, createElementVNode as w, resolveComponent as g, createBlock as v, normalizeClass as K, withCtx as N, toDisplayString as C, createVNode as p, Fragment as $, renderList as L, ref as P, watch as F, isRef as x, h as A } from "vue";
2
2
  import { e as f } from "./index-Cnxt2xmc.js";
3
- import { h as F } from "./moment-h96o7c8I.js";
3
+ import { h as R } from "./moment-h96o7c8I.js";
4
4
  import { u as B } from "./index-BgnU5ezY.js";
5
- import { _ as G } from "./index.vue_vue_type_script_setup_true_lang-B8eGz19R.js";
5
+ import { _ as G } from "./index.vue_vue_type_script_setup_true_lang-D2Eefuww.js";
6
6
  import { _ as U } from "./AdminLayout.vue_vue_type_script_setup_true_lang-1DSAdvX7.js";
7
7
  import { useSnackbar as Y, useDialog as Q } from "@feedmepos/ui-library";
8
8
  import { g as W } from "./assets-sX1_K-nt.js";
@@ -20,15 +20,15 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
20
20
  data: {}
21
21
  },
22
22
  setup(T) {
23
- return (a, m) => (y(), w("div", ee, [
24
- a.row.original.ecrGateway ? (y(), w("img", {
23
+ return (a, m) => (y(), h("div", ee, [
24
+ a.row.original.ecrGateway ? (y(), h("img", {
25
25
  key: 0,
26
26
  class: "bg-fm-color-overlay-background rounded-md m-auto border-transparent w-[32px] h-[32px]",
27
- src: i(j)
27
+ src: c(j)
28
28
  }, null, 8, te)) : V("", !0),
29
- h("img", {
29
+ w("img", {
30
30
  class: "rounded-md m-auto border-transparent w-[32px] h-[32px]",
31
- src: i(W)(a.row.original.gateway)
31
+ src: c(W)(a.row.original.gateway)
32
32
  }, null, 8, ae)
33
33
  ]));
34
34
  }
@@ -43,14 +43,14 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
43
43
  function m() {
44
44
  return a.data === f.F_TERMINAL_TRANSACTION_ACTION.Enum.process ? "!w-[16px] !h-[16px] bg-yellow-400" : a.data === f.F_TERMINAL_TRANSACTION_ACTION.Enum.failed ? "!w-[16px] !h-[16px] bg-red-400" : a.data === f.F_TERMINAL_TRANSACTION_ACTION.Enum.refunded ? "!w-[16px] !h-[16px] bg-blue-400" : "!w-[16px] !h-[16px] bg-green-400";
45
45
  }
46
- return (r, l) => {
46
+ return (o, l) => {
47
47
  const s = g("FmBadge");
48
48
  return y(), v(s, {
49
49
  inline: "",
50
50
  class: K(m())
51
51
  }, {
52
52
  default: N(() => [
53
- h("div", null, C(r.data.toUpperCase()), 1)
53
+ w("div", null, C(o.data.toUpperCase()), 1)
54
54
  ]),
55
55
  _: 1
56
56
  }, 8, ["class"]);
@@ -64,13 +64,13 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
64
64
  },
65
65
  setup(T) {
66
66
  const a = T, m = X();
67
- function r() {
67
+ function o() {
68
68
  m.push(a.route);
69
69
  }
70
- return (l, s) => (y(), w("div", {
70
+ return (l, s) => (y(), h("div", {
71
71
  class: "fm-typo-en-link-md-600",
72
72
  onClick: s[0] || (s[0] = (u) => {
73
- u.stopPropagation(), r();
73
+ u.stopPropagation(), o();
74
74
  })
75
75
  }, C(l.data), 1));
76
76
  }
@@ -94,11 +94,11 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
94
94
  action: "refund"
95
95
  }
96
96
  ];
97
- return (m, r) => {
97
+ return (m, o) => {
98
98
  const l = g("FmIcon"), s = g("FmMenuItem"), u = g("FmMenu");
99
- return y(), w("div", {
100
- onClick: r[0] || (r[0] = (c) => {
101
- c.stopPropagation();
99
+ return y(), h("div", {
100
+ onClick: o[0] || (o[0] = (i) => {
101
+ i.stopPropagation();
102
102
  })
103
103
  }, [
104
104
  p(u, null, {
@@ -106,13 +106,13 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
106
106
  p(l, { name: "settings" })
107
107
  ]),
108
108
  default: N(() => [
109
- (y(), w($, null, L(a, (c) => p(s, {
109
+ (y(), h($, null, L(a, (i) => p(s, {
110
110
  selectable: !0,
111
- key: c.label,
112
- sublabel: c.sublabel,
113
- label: c.label,
114
- icon: c.icon,
115
- onclick: () => m.onAction(c.action)
111
+ key: i.label,
112
+ sublabel: i.sublabel,
113
+ label: i.label,
114
+ icon: i.icon,
115
+ onclick: () => m.onAction(i.action)
116
116
  }, null, 8, ["sublabel", "label", "icon", "onclick"])), 64))
117
117
  ]),
118
118
  _: 1
@@ -120,34 +120,34 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
120
120
  ]);
121
121
  };
122
122
  }
123
- }), le = { class: "flex justify-between mb-6 items-start" }, ce = { class: "flex space-x-4 items-start" }, ie = { class: "flex space-x-4" }, xe = /* @__PURE__ */ I({
123
+ }), le = { class: "flex justify-between mb-6 items-start" }, ie = { class: "flex space-x-4 items-start" }, ce = { class: "flex space-x-4" }, xe = /* @__PURE__ */ I({
124
124
  __name: "TerminalTransaction",
125
125
  setup(T) {
126
- const a = Y(), m = Q(), r = P(), { dateRange: l, status: s, searchKey: u } = B({
126
+ const a = Y(), m = Q(), o = P(), { dateRange: l, status: s, searchKey: u } = B({
127
127
  searchKey: "",
128
128
  status: [f.F_TERMINAL_TRANSACTION_ACTION.Enum.success],
129
129
  dateRange: {
130
- startDate: F().startOf("day").toISOString(),
131
- endDate: F().endOf("day").toISOString()
130
+ startDate: R().startOf("day").toISOString(),
131
+ endDate: R().endOf("day").toISOString()
132
132
  }
133
133
  });
134
- R([l, s], () => {
134
+ F([l, s], () => {
135
135
  var e;
136
- return (e = r.value) == null ? void 0 : e.reset();
136
+ return (e = o.value) == null ? void 0 : e.reset();
137
137
  });
138
- let c;
139
- R(u, async () => {
140
- c && clearTimeout(c), c = setTimeout(
138
+ let i;
139
+ F(u, async () => {
140
+ i && clearTimeout(i), i = setTimeout(
141
141
  () => {
142
142
  var e;
143
- return (e = r.value) == null ? void 0 : e.reset();
143
+ return (e = o.value) == null ? void 0 : e.reset();
144
144
  },
145
145
  700
146
146
  );
147
147
  });
148
- async function E(e) {
149
- var o, d, _;
150
- const t = (d = (o = r.value) == null ? void 0 : o.pageData()) == null ? void 0 : d.at(e);
148
+ async function k(e) {
149
+ var r, d, _;
150
+ const t = (d = (r = o.value) == null ? void 0 : r.pageData()) == null ? void 0 : d.at(e);
151
151
  if (!t) {
152
152
  a.open({
153
153
  type: "error",
@@ -166,7 +166,7 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
166
166
  }
167
167
  try {
168
168
  const n = await b.queryTransaction(t._id);
169
- (_ = r.value) == null || _.replaceData(e, n), a.open({
169
+ (_ = o.value) == null || _.replaceData(e, n), a.open({
170
170
  type: "success",
171
171
  title: "Transaction queried and updated successfully."
172
172
  });
@@ -178,9 +178,9 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
178
178
  });
179
179
  }
180
180
  }
181
- async function k(e) {
182
- var o, d;
183
- const t = (d = (o = r.value) == null ? void 0 : o.pageData()) == null ? void 0 : d.at(e);
181
+ async function E(e) {
182
+ var r, d;
183
+ const t = (d = (r = o.value) == null ? void 0 : r.pageData()) == null ? void 0 : d.at(e);
184
184
  if (!t) {
185
185
  a.open({
186
186
  type: "error",
@@ -209,7 +209,7 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
209
209
  reason: "portal transaction refund",
210
210
  amount: t.details.amount
211
211
  });
212
- (_ = r.value) == null || _.replaceData(e, n), a.open({
212
+ (_ = o.value) == null || _.replaceData(e, n), a.open({
213
213
  type: "success",
214
214
  title: "Transaction queried and updated successfully."
215
215
  });
@@ -242,17 +242,17 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
242
242
  }
243
243
  ], D = function(e) {
244
244
  const t = e;
245
- let o = "-";
246
- return t.details && t.details.amount && (o = z(t.details.amount).toFormat("$0.00")), {
245
+ let r = "-";
246
+ return t.details && t.details.amount && (r = z(t.details.amount).toFormat("$0.00")), {
247
247
  id: e._id,
248
248
  refId: e.refId,
249
249
  owner: e.owner,
250
250
  terminalId: e.terminalId,
251
- transactionAt: F(e.transactionAt).format("YYYY-MM-DD hh:mm:ss"),
251
+ transactionAt: R(e.transactionAt).format("YYYY-MM-DD hh:mm:ss"),
252
252
  action: e.action,
253
253
  gateway: e.gateway,
254
254
  ecrGateway: e.ecrGateway,
255
- amount: o
255
+ amount: r
256
256
  };
257
257
  }, M = [
258
258
  {
@@ -269,13 +269,13 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
269
269
  meta: {
270
270
  textAlign: "left"
271
271
  },
272
- cell: ({ cell: e }) => {
273
- const t = e.getValue();
272
+ cell: ({ cell: e, row: t }) => {
273
+ const r = e.getValue();
274
274
  return A(oe, {
275
- data: t,
275
+ data: r,
276
276
  route: {
277
277
  name: "mf-payment-admin.terminal-setting",
278
- params: { terminalId: t }
278
+ params: { terminalId: r }
279
279
  }
280
280
  });
281
281
  }
@@ -333,12 +333,12 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
333
333
  if (e.original.gateway === "ScanPay")
334
334
  return A(se, {
335
335
  onAction: (t) => {
336
- const o = e.index;
336
+ const r = e.index;
337
337
  switch (t) {
338
338
  case "query":
339
- return E(o);
339
+ return k(r);
340
340
  case "refund":
341
- return k(o);
341
+ return E(r);
342
342
  }
343
343
  }
344
344
  });
@@ -346,23 +346,23 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
346
346
  }
347
347
  ];
348
348
  return (e, t) => {
349
- const o = g("FmSearch"), d = g("FmSelect"), _ = g("FmDateRangePicker");
349
+ const r = g("FmSearch"), d = g("FmSelect"), _ = g("FmDateRangePicker");
350
350
  return y(), v(U, {
351
351
  title: "Offline Transactions",
352
352
  loading: !1
353
353
  }, {
354
354
  default: N(() => [
355
- h("div", le, [
356
- h("div", ce, [
357
- p(o, {
358
- "model-value": i(u),
355
+ w("div", le, [
356
+ w("div", ie, [
357
+ p(r, {
358
+ "model-value": c(u),
359
359
  "onUpdate:modelValue": t[0] || (t[0] = (n) => x(u) ? u.value = n : null),
360
360
  class: "mr-8",
361
361
  label: "Search",
362
362
  placeholder: "Search Transactions ..."
363
363
  }, null, 8, ["model-value"]),
364
364
  p(d, {
365
- modelValue: i(s),
365
+ modelValue: c(s),
366
366
  "onUpdate:modelValue": t[1] || (t[1] = (n) => x(s) ? s.value = n : null),
367
367
  class: "mr-6 w-[300px]",
368
368
  label: "Status",
@@ -371,38 +371,40 @@ const ee = { class: "flex" }, te = ["src"], ae = ["src"], ne = /* @__PURE__ */ I
371
371
  items: O
372
372
  }, null, 8, ["modelValue"]),
373
373
  p(_, {
374
- modelValue: i(l),
374
+ modelValue: c(l),
375
375
  "onUpdate:modelValue": t[2] || (t[2] = (n) => x(l) ? l.value = n : null),
376
376
  compare: "",
377
377
  "show-predefined-range": ""
378
378
  }, null, 8, ["modelValue"])
379
379
  ]),
380
- h("div", ie, [
380
+ w("div", ce, [
381
381
  p(H, {
382
382
  button: {
383
383
  appendIcon: "file_download",
384
384
  variant: "primary",
385
385
  label: "Export"
386
386
  },
387
- handler: () => {
387
+ handler: async () => {
388
388
  var n;
389
- return i(b).downloadTransactions(((n = r.value) == null ? void 0 : n.data()) ?? []);
389
+ return c(b).downloadTransactions(await ((n = o.value) == null ? void 0 : n.allData()) ?? []);
390
390
  }
391
391
  }, null, 8, ["handler"])
392
392
  ])
393
393
  ]),
394
394
  p(G, {
395
395
  ref_key: "controller",
396
- ref: r,
396
+ ref: o,
397
397
  "column-defs": M,
398
398
  "rows-defs": D,
399
- paginate: (n, q) => i(b).readTransactions({
400
- status: i(s),
401
- searchKey: i(u),
399
+ onRowClick: t[3] || (t[3] = () => {
400
+ }),
401
+ paginate: (n, q) => c(b).readTransactions({
402
+ status: c(s),
403
+ searchKey: c(u),
402
404
  limit: n,
403
405
  cursor: q,
404
- start: i(l).startDate,
405
- end: i(l).endDate
406
+ start: c(l).startDate,
407
+ end: c(l).endDate
406
408
  })
407
409
  }, null, 8, ["paginate"])
408
410
  ]),
@@ -1,17 +1,16 @@
1
- import { defineComponent as N, openBlock as _, createElementBlock as w, Fragment as F, unref as t, createCommentVNode as k, createElementVNode as d, resolveComponent as p, createBlock as R, normalizeClass as D, withCtx as C, toDisplayString as V, ref as K, watch as T, createVNode as i, isRef as g, h } from "vue";
1
+ import { defineComponent as N, openBlock as _, createElementBlock as x, Fragment as F, unref as t, createCommentVNode as k, createElementVNode as d, resolveComponent as p, createBlock as R, normalizeClass as D, withCtx as C, toDisplayString as V, ref as K, watch as T, createVNode as i, isRef as g, h } from "vue";
2
2
  import { e as l } from "./index-Cnxt2xmc.js";
3
3
  import { h as I } from "./moment-h96o7c8I.js";
4
4
  import { u as M } from "./index-BgnU5ezY.js";
5
- import { _ as $ } from "./index.vue_vue_type_script_setup_true_lang-B8eGz19R.js";
5
+ import { _ as $ } from "./index.vue_vue_type_script_setup_true_lang-D2Eefuww.js";
6
6
  import "@feedmepos/ui-library";
7
7
  import { g as L } from "./assets-sX1_K-nt.js";
8
- import { E as B, t as x } from "./index-Dlszue3Y.js";
8
+ import { E as B, t as w } from "./index-Dlszue3Y.js";
9
9
  import { d as G } from "./dinero-CIVmXLL-.js";
10
10
  import { _ as P } from "./RestaurantSelector.vue_vue_type_script_setup_true_lang-CY4ttpKj.js";
11
11
  import { useCoreStore as U } from "@feedmepos/mf-common";
12
12
  import { _ as Y } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
13
13
  import { _ as W } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-GXPXBEf5.js";
14
- import "vue-router";
15
14
  import { _ as j } from "./Layout.vue_vue_type_script_setup_true_lang-C38PTqO5.js";
16
15
  const q = ["src"], z = ["src"], Q = /* @__PURE__ */ N({
17
16
  __name: "Gateway",
@@ -20,8 +19,8 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ N({
20
19
  data: {}
21
20
  },
22
21
  setup(f) {
23
- return (n, s) => (_(), w(F, null, [
24
- n.row.original.ecrGateway ? (_(), w("img", {
22
+ return (n, s) => (_(), x(F, null, [
23
+ n.row.original.ecrGateway ? (_(), x("img", {
25
24
  key: 0,
26
25
  class: "bg-fm-color-overlay-background rounded-md m-auto border-transparent w-[32px] h-[32px]",
27
26
  src: t(B)
@@ -56,7 +55,7 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ N({
56
55
  }, 8, ["class"]);
57
56
  };
58
57
  }
59
- }), J = { class: "flex justify-between mb-6 items-start" }, X = { class: "flex space-x-8 items-start" }, Z = { class: "flex space-x-4" }, fe = /* @__PURE__ */ N({
58
+ }), J = { class: "flex justify-between mb-6 items-start" }, X = { class: "flex space-x-8 items-start" }, Z = { class: "flex space-x-4" }, _e = /* @__PURE__ */ N({
60
59
  __name: "TerminalTransaction",
61
60
  setup(f) {
62
61
  const { currentRestaurant: n } = U(), s = K(), { dateRange: o, status: m, searchKey: c } = M({
@@ -213,7 +212,7 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ N({
213
212
  },
214
213
  handler: () => {
215
214
  var r;
216
- return t(x).downloadTransactions(((r = s.value) == null ? void 0 : r.data()) ?? []);
215
+ return t(w).downloadTransactions(((r = s.value) == null ? void 0 : r.data()) ?? []);
217
216
  }
218
217
  }, null, 8, ["handler"])
219
218
  ])
@@ -223,16 +222,14 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ N({
223
222
  ref: s,
224
223
  "column-defs": O,
225
224
  "rows-defs": E,
226
- paginate: (r, b) => t(x).readRestaurantTransactions({
225
+ paginate: (r, b) => t(w).readRestaurantTransactions({
227
226
  status: t(m),
228
227
  searchKey: t(c),
229
228
  limit: r,
230
229
  cursor: b,
231
230
  start: t(o).startDate,
232
231
  end: t(o).endDate
233
- }),
234
- onRowClick: () => {
235
- }
232
+ })
236
233
  }, null, 8, ["paginate"])
237
234
  ]),
238
235
  _: 1
@@ -241,5 +238,5 @@ const q = ["src"], z = ["src"], Q = /* @__PURE__ */ N({
241
238
  }
242
239
  });
243
240
  export {
244
- fe as default
241
+ _e as default
245
242
  };
package/dist/app.js CHANGED
@@ -9,7 +9,7 @@ const f = [
9
9
  meta: {
10
10
  sidebarDisplay: "Payout Accounts"
11
11
  },
12
- component: () => import("./PayoutAccount-B2RkqaQ9.js")
12
+ component: () => import("./PayoutAccount-Dz-C7b28.js")
13
13
  },
14
14
  {
15
15
  path: "/admin/payout-accounts/:accountId",
@@ -23,7 +23,7 @@ const f = [
23
23
  meta: {
24
24
  sidebarDisplay: "Terminals"
25
25
  },
26
- component: () => import("./Terminal-CP380u7w.js")
26
+ component: () => import("./Terminal-DnLKgEq_.js")
27
27
  },
28
28
  {
29
29
  path: "/admin/terminal/:terminalId",
@@ -37,7 +37,7 @@ const f = [
37
37
  meta: {
38
38
  sidebarDisplay: "Offline Transactions"
39
39
  },
40
- component: () => import("./TerminalTransaction-BC-QZh_F.js")
40
+ component: () => import("./TerminalTransaction-BChyQQlb.js")
41
41
  },
42
42
  {
43
43
  path: "/admin/transaction",
@@ -69,7 +69,7 @@ const f = [
69
69
  {
70
70
  path: "/payout-account",
71
71
  name: "mf-payment-payout-account",
72
- component: () => import("./PayoutAccount-BGbBteeq.js"),
72
+ component: () => import("./PayoutAccount-B4i4fRfF.js"),
73
73
  meta: {
74
74
  sidebarDisplay: "Payout Accounts"
75
75
  }
@@ -80,7 +80,7 @@ const f = [
80
80
  meta: {
81
81
  sidebarDisplay: "Offline Transactions"
82
82
  },
83
- component: () => import("./TerminalTransaction-DCqbXI2q.js")
83
+ component: () => import("./TerminalTransaction-DL5a5BbI.js")
84
84
  },
85
85
  {
86
86
  path: "/transaction",
@@ -5,6 +5,10 @@ export type CursorTableController<T> = {
5
5
  * Reset pagination and all loaded data, and perform load for first page data
6
6
  */
7
7
  reset: () => {};
8
+ /**
9
+ * All data from the server, will be keep on looping cursor until there's no cursor.
10
+ */
11
+ allData: () => Promise<T[]>;
8
12
  /**
9
13
  * All loaded data, before transform
10
14
  */
@@ -0,0 +1,167 @@
1
+ import { defineComponent as U, ref as r, resolveComponent as v, openBlock as w, createBlock as M, withCtx as z, createVNode as m, createElementVNode as u, normalizeStyle as T, createElementBlock as I, Fragment as $, renderList as j, computed as C, watch as L, onMounted as E, unref as P, toDisplayString as D, normalizeClass as O } from "vue";
2
+ import { u as R } from "./index-Cnxt2xmc.js";
3
+ import "@feedmepos/ui-library";
4
+ const G = ["id"], S = /* @__PURE__ */ U({
5
+ __name: "FmTableSelection",
6
+ props: {
7
+ value: {},
8
+ items: {}
9
+ },
10
+ emits: ["update:modelValue"],
11
+ setup(p, { emit: F }) {
12
+ const h = F, f = p, i = r(!1);
13
+ return (g, y) => {
14
+ const k = v("FmButton"), V = v("FmMenuItem"), x = v("FmMenu");
15
+ return w(), M(x, {
16
+ "max-height": 264,
17
+ shift: "",
18
+ onMenuChanged: y[0] || (y[0] = (a) => i.value = a)
19
+ }, {
20
+ "menu-button": z(() => {
21
+ var a;
22
+ return [
23
+ m(k, {
24
+ icon: i.value ? "expand_less" : "expand_more",
25
+ label: (a = g.items.find((o) => o.value === f.value)) == null ? void 0 : a.label,
26
+ "icon-position": "append",
27
+ size: "md",
28
+ variant: "tertiary"
29
+ }, null, 8, ["icon", "label"])
30
+ ];
31
+ }),
32
+ "menu-wrapper": z(({ maxHeight: a }) => [
33
+ u("div", {
34
+ id: `menu-wrapper-${a}`,
35
+ style: T({ maxHeight: `${a}px` }),
36
+ class: "bg-fm-color-neutral-white flex flex-col overflow-y-auto px-4 py-12 rounded-md shadow-light-300 w-[75px]"
37
+ }, [
38
+ (w(!0), I($, null, j(g.items, (o) => (w(), M(V, {
39
+ key: o.value,
40
+ label: o.label,
41
+ value: o.value,
42
+ "model-value": o.value === f.value,
43
+ "onUpdate:modelValue": (n) => h("update:modelValue", o.value)
44
+ }, null, 8, ["label", "value", "model-value", "onUpdate:modelValue"]))), 128))
45
+ ], 12, G)
46
+ ]),
47
+ _: 1
48
+ });
49
+ };
50
+ }
51
+ }), H = { class: "basis-72 bg-white flex items-center justify-between px-24 pt-6" }, J = { class: "flex gap-24 items-center justify-between xs:hidden xs:invisible" }, K = { class: "flex gap-8 items-center" }, Q = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary xs:hidden xs:invisible" }, W = {
52
+ class: /* @__PURE__ */ O(["flex gap-8 items-center"])
53
+ }, X = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, Y = { class: "flex gap-8" }, ae = /* @__PURE__ */ U({
54
+ __name: "index",
55
+ props: {
56
+ columnDefs: {
57
+ type: Array,
58
+ required: !0
59
+ },
60
+ rowsDefs: {
61
+ type: Function,
62
+ required: !0
63
+ },
64
+ paginate: {
65
+ type: Function,
66
+ required: !0
67
+ }
68
+ },
69
+ emits: ["row-click"],
70
+ setup(p, { expose: F, emit: h }) {
71
+ const f = [10, 20, 30, 50, 100].map((t) => ({
72
+ label: t.toString(),
73
+ value: t
74
+ })), i = p, g = h, { isLoading: y, startLoading: k, stopLoading: V } = R(!0), x = r(), a = r(), o = r(""), n = r(10), l = r(1), c = r(0), b = async function(t = !1) {
75
+ k(), t && (a.value = [], o.value = "", l.value = 1, c.value = 0);
76
+ const e = await i.paginate(n.value, o.value);
77
+ a.value = [...a.value ?? [], ...e.data], o.value = e.meta.cursor ?? "", c.value += 1, V();
78
+ }, q = C(() => l.value > 1), A = C(() => l.value < c.value ? !0 : o.value > ""), N = C(() => {
79
+ const t = n.value * (l.value - 1), e = t + n.value;
80
+ return (a.value ?? []).slice(t, e).map(i.rowsDefs);
81
+ });
82
+ return L(n, () => b(!0)), L(l, (t) => {
83
+ t > c.value && b();
84
+ }), E(() => b()), F({
85
+ reset: () => b(!0),
86
+ data: () => a.value ?? [],
87
+ allData: async () => {
88
+ let t = [], e = "";
89
+ do {
90
+ const d = await i.paginate(100, e);
91
+ t = [...t, ...d.data], e = d.meta.cursor ?? "";
92
+ } while (e > "");
93
+ return t;
94
+ },
95
+ pageData: () => {
96
+ const t = n.value * (l.value - 1), e = t + n.value;
97
+ return (a.value ?? []).slice(t, e);
98
+ },
99
+ replaceData: (t, e) => {
100
+ const d = t * l.value;
101
+ a.value && (a.value[d] = e);
102
+ }
103
+ }), (t, e) => {
104
+ const d = v("FmTable"), B = v("FmButton");
105
+ return w(), I($, null, [
106
+ m(d, {
107
+ modelValue: x.value,
108
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => x.value = s),
109
+ loading: P(y),
110
+ "page-size": n.value,
111
+ "row-data": N.value,
112
+ "column-defs": p.columnDefs,
113
+ "hide-footer": !0,
114
+ onRowClick: e[1] || (e[1] = (s) => {
115
+ var _;
116
+ return g("row-click", (_ = a.value) == null ? void 0 : _.at(s.index));
117
+ })
118
+ }, null, 8, ["modelValue", "loading", "page-size", "row-data", "column-defs"]),
119
+ u("div", H, [
120
+ u("div", J, [
121
+ u("div", K, [
122
+ e[6] || (e[6] = u("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
123
+ m(S, {
124
+ items: P(f),
125
+ value: n.value,
126
+ "onUpdate:modelValue": e[2] || (e[2] = (s) => n.value = s)
127
+ }, null, 8, ["items", "value"])
128
+ ]),
129
+ u("span", Q, D((l.value - 1) * n.value) + " - " + D((l.value - 1) * n.value + n.value), 1)
130
+ ]),
131
+ u("div", W, [
132
+ m(S, {
133
+ items: Array.from(Array(c.value), (s, _) => _ + 1).map(
134
+ (s) => ({
135
+ label: s.toString(),
136
+ value: s
137
+ })
138
+ ),
139
+ value: l.value,
140
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => l.value = s)
141
+ }, null, 8, ["items", "value"]),
142
+ u("span", X, " Page " + D(l.value), 1),
143
+ u("div", Y, [
144
+ m(B, {
145
+ disabled: !q.value,
146
+ icon: "chevron_left",
147
+ "icon-color": "neutral-black",
148
+ variant: "tertiary",
149
+ onClick: e[4] || (e[4] = () => l.value -= 1)
150
+ }, null, 8, ["disabled"]),
151
+ m(B, {
152
+ disabled: !A.value,
153
+ icon: "chevron_right",
154
+ "icon-color": "neutral-black",
155
+ variant: "tertiary",
156
+ onClick: e[5] || (e[5] = () => l.value += 1)
157
+ }, null, 8, ["disabled"])
158
+ ])
159
+ ])
160
+ ])
161
+ ], 64);
162
+ };
163
+ }
164
+ });
165
+ export {
166
+ ae as _
167
+ };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "0.0.0-beta.38",
3
+ "version": "0.0.0-beta.39",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"