@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.
package/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"
@@ -1,159 +0,0 @@
1
- import { defineComponent as U, ref as r, resolveComponent as v, openBlock as _, createBlock as M, withCtx as z, createVNode as i, createElementVNode as s, 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 B, 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(c, { emit: w }) {
12
- const F = w, p = c, m = r(!1);
13
- return (f, g) => {
14
- const k = v("FmButton"), V = v("FmMenuItem"), y = v("FmMenu");
15
- return _(), M(y, {
16
- "max-height": 264,
17
- shift: "",
18
- onMenuChanged: g[0] || (g[0] = (t) => m.value = t)
19
- }, {
20
- "menu-button": z(() => {
21
- var t;
22
- return [
23
- i(k, {
24
- icon: m.value ? "expand_less" : "expand_more",
25
- label: (t = f.items.find((o) => o.value === p.value)) == null ? void 0 : t.label,
26
- "icon-position": "append",
27
- size: "md",
28
- variant: "tertiary"
29
- }, null, 8, ["icon", "label"])
30
- ];
31
- }),
32
- "menu-wrapper": z(({ maxHeight: t }) => [
33
- s("div", {
34
- id: `menu-wrapper-${t}`,
35
- style: T({ maxHeight: `${t}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
- (_(!0), I($, null, j(f.items, (o) => (_(), M(V, {
39
- key: o.value,
40
- label: o.label,
41
- value: o.value,
42
- "model-value": o.value === p.value,
43
- "onUpdate:modelValue": (n) => F("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" }, le = /* @__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(c, { expose: w, emit: F }) {
71
- const p = [10, 20, 30, 50, 100].map((l) => ({
72
- label: l.toString(),
73
- value: l
74
- })), m = c, f = F, { isLoading: g, startLoading: k, stopLoading: V } = R(!0), y = r(), t = r(), o = r(""), n = r(10), a = r(1), d = r(0), b = async function(l = !1) {
75
- k(), l && (t.value = [], o.value = "", a.value = 1, d.value = 0);
76
- const e = await m.paginate(n.value, o.value);
77
- t.value = [...t.value ?? [], ...e.data], o.value = e.meta.cursor ?? "", d.value += 1, V();
78
- }, q = C(() => a.value > 1), A = C(() => a.value < d.value ? !0 : o.value > ""), N = C(() => {
79
- const l = n.value * (a.value - 1), e = l + n.value;
80
- return (t.value ?? []).slice(l, e).map(m.rowsDefs);
81
- });
82
- return L(n, () => b(!0)), L(a, (l) => {
83
- l > d.value && b();
84
- }), E(() => b()), w({
85
- reset: () => b(!0),
86
- data: () => t.value ?? [],
87
- pageData: () => {
88
- const l = n.value * (a.value - 1), e = l + n.value;
89
- return (t.value ?? []).slice(l, e);
90
- },
91
- replaceData: (l, e) => {
92
- const h = l * a.value;
93
- t.value && (t.value[h] = e);
94
- }
95
- }), (l, e) => {
96
- const h = v("FmTable"), D = v("FmButton");
97
- return _(), I($, null, [
98
- i(h, {
99
- modelValue: y.value,
100
- "onUpdate:modelValue": e[0] || (e[0] = (u) => y.value = u),
101
- loading: P(g),
102
- "page-size": n.value,
103
- "row-data": N.value,
104
- "column-defs": c.columnDefs,
105
- "hide-footer": !0,
106
- onRowClick: e[1] || (e[1] = (u) => {
107
- var x;
108
- return f("row-click", (x = t.value) == null ? void 0 : x.at(u.index));
109
- })
110
- }, null, 8, ["modelValue", "loading", "page-size", "row-data", "column-defs"]),
111
- s("div", H, [
112
- s("div", J, [
113
- s("div", K, [
114
- e[6] || (e[6] = s("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
115
- i(S, {
116
- items: P(p),
117
- value: n.value,
118
- "onUpdate:modelValue": e[2] || (e[2] = (u) => n.value = u)
119
- }, null, 8, ["items", "value"])
120
- ]),
121
- s("span", Q, B((a.value - 1) * n.value) + " - " + B((a.value - 1) * n.value + n.value), 1)
122
- ]),
123
- s("div", W, [
124
- i(S, {
125
- items: Array.from(Array(d.value), (u, x) => x + 1).map(
126
- (u) => ({
127
- label: u.toString(),
128
- value: u
129
- })
130
- ),
131
- value: a.value,
132
- "onUpdate:modelValue": e[3] || (e[3] = (u) => a.value = u)
133
- }, null, 8, ["items", "value"]),
134
- s("span", X, " Page " + B(a.value), 1),
135
- s("div", Y, [
136
- i(D, {
137
- disabled: !q.value,
138
- icon: "chevron_left",
139
- "icon-color": "neutral-black",
140
- variant: "tertiary",
141
- onClick: e[4] || (e[4] = () => a.value -= 1)
142
- }, null, 8, ["disabled"]),
143
- i(D, {
144
- disabled: !A.value,
145
- icon: "chevron_right",
146
- "icon-color": "neutral-black",
147
- variant: "tertiary",
148
- onClick: e[5] || (e[5] = () => a.value += 1)
149
- }, null, 8, ["disabled"])
150
- ])
151
- ])
152
- ])
153
- ], 64);
154
- };
155
- }
156
- });
157
- export {
158
- le as _
159
- };