@feedmepos/mf-connect 0.1.0-beta.36 → 0.1.0-beta.37
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.
- package/dist/{Analytic-BQQMo8gn.js → Analytic-BfWknG6l.js} +10 -10
- package/dist/{App-XbDR-3id.js → App-BG_061Wg.js} +6 -6
- package/dist/{Broadcast-BV0fALHZ.js → Broadcast-DdpNtoOo.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cmq6EQxz.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-od-JjpnA.js} +6 -6
- package/dist/{Card-ni0g9f0W.js → Card-Bnng5ta4.js} +21 -22
- package/dist/{Collections-CzqFRaQq.js → Collections-DnD4xZ5L.js} +28 -34
- package/dist/{Credit-BhaiYIIH.js → Credit-DwblaWn4.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-ByIKDwhp.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-COETiGQ4.js} +27 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CCPGbV9-.js → EffectSheet.vue_vue_type_style_index_0_lang-CtEk6tOC.js} +6 -6
- package/dist/{Experience-l24HNuYa.js → Experience-Bkn57rfJ.js} +8 -8
- package/dist/{Game-CYR3nNcT.js → Game-D0s7bZc-.js} +8 -8
- package/dist/{Index-BYC9ThLe.js → Index-D7Zj0U5i.js} +9 -9
- package/dist/{Marketing-C_oZtbqT.js → Marketing-CLwzvII4.js} +5 -5
- package/dist/{Member-DxAoZFfz.js → Member-D-JxENNb.js} +4 -4
- package/dist/{MemberList-CyHaxFqq.js → MemberList-CMTSjTu-.js} +31 -32
- package/dist/{MemberTransactions-Ce1N88OQ.js → MemberTransactions-BNcHZfcd.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CwF3Vok8.js → MessageInput.vue_vue_type_script_setup_true_lang-B8x9NfzT.js} +2 -2
- package/dist/{Mission-DdgpqYWl.js → Mission-B-JhXdXX.js} +8 -8
- package/dist/{Overview-DVcotUZ5.js → Overview-BZrK3ETv.js} +18 -18
- package/dist/{Point-B56BrM7H.js → Point-Njw7VSo9.js} +8 -8
- package/dist/{Promotion-4yL1H9g5.js → Promotion-DjRs0X1X.js} +9 -9
- package/dist/Record-BnZXhR7W.js +337 -0
- package/dist/{Reward-DX5V3RGG.js → Reward-pD5qUCNJ.js} +14 -14
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D9UFAixa.js → RewardGroup.vue_vue_type_script_setup_true_lang-u8IT5N_z.js} +10 -10
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-4tF-6JVC.js → RuleGroup.vue_vue_type_script_setup_true_lang-t7vrHFiH.js} +12 -12
- package/dist/{Segment-DKpM-dlV.js → Segment-XKjH6MDU.js} +72 -73
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-4Co06qsp.js → SelectItems.vue_vue_type_script_setup_true_lang-CqIHHNJg.js} +2 -2
- package/dist/{Setting-CbV6piRR.js → Setting-CjKbl-Em.js} +8 -8
- package/dist/{Store-BIMMzBEA.js → Store-BXKK7Ys3.js} +17 -17
- package/dist/{StoreRewards-Tr8TXAWt.js → StoreRewards-C8iQ2BTP.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-wPxHMj1_.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JdPqalST.js} +17 -17
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CaRE8E-o.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CwfgY4Ft.js} +1 -1
- package/dist/{Tier-BN3HKQpg.js → Tier-N95LJoLO.js} +18 -18
- package/dist/{Title-DhDuDHSD.js → Title-CpnvvVAV.js} +18 -18
- package/dist/{Transaction-Tz3ewMZm.js → Transaction-BEN_EeUx.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-w5Cq6L8_.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-B3NgCEdV.js} +6 -6
- package/dist/{Voucher-CdEDGQkq.js → Voucher-DgxD3oco.js} +11 -11
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CajIUE-r.js → VoucherEditor.vue_vue_type_script_setup_true_lang-D3c0M6ga.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CFCVdVWx.js → ZodTextField.vue_vue_type_script_setup_true_lang-BOJwFLp-.js} +1 -1
- package/dist/{app-Cx8AYCg_.js → app-D5HD8YMV.js} +1 -1
- package/dist/{app-oW33KZ3o.js → app-DGplfyjK.js} +30 -29
- package/dist/app.js +1 -1
- package/dist/{business-DjK1cD6M.js → business-CO2AZHIm.js} +1 -1
- package/dist/{campaign-D4CDaSod.js → campaign-C6_Zmo0L.js} +9 -9
- package/dist/{campaign-DBISpYyM.js → campaign-DoM_vfA0.js} +2 -2
- package/dist/{campaign.enum-BB6zKvqL.js → campaign.enum-Bkgm7Eui.js} +1 -1
- package/dist/{campaign.fn-BBuN-vxE.js → campaign.fn-P4ZkJWZ1.js} +2 -2
- package/dist/{collectible.enum-BkzPmWP5.js → collectible.enum-BP3FWmgp.js} +1 -1
- package/dist/{collection.fn--9IoH5C8.js → collection.fn-B5hTEOhD.js} +2 -2
- package/dist/{dto-Cf4bZ2Ha.js → dto-ao87-Ydo.js} +4 -4
- package/dist/{effect-BpSxSe0d.js → effect-BDo1bV-w.js} +1 -1
- package/dist/{email-addresses-wHQnOKcN.js → email-addresses-B-oXjMbu.js} +1 -1
- package/dist/{export-pg40fbOp.js → export-BJ93wKMJ.js} +3 -3
- package/dist/{helper-vuZmD3vd.js → helper-DIBaFgT8.js} +1 -1
- package/dist/{index-t-NFK-AQ.js → index-BBW2oNKe.js} +1 -1
- package/dist/{index-K7WU4vc1.js → index-BLNNEMcq.js} +1 -1
- package/dist/{index-VjvyNKmR.js → index-BX4S_sse.js} +2 -2
- package/dist/{index-Bl60bODV.js → index-BY9zfO2Y.js} +3 -3
- package/dist/{index-CCRD2tgv.js → index-BxpCMeMY.js} +75 -69
- package/dist/{index-D8CIHJ0z.js → index-C6RWHkGF.js} +1 -1
- package/dist/{index-D6knHtFJ.js → index-CFg7ea6S.js} +1 -1
- package/dist/{index-DInxnKvr.js → index-CcIjFlvm.js} +1 -1
- package/dist/{index-BbhmmxBp.js → index-DDoUQHWH.js} +4 -4
- package/dist/{index-UNh4BJAd.js → index-H_VNJAQv.js} +1 -1
- package/dist/index-KkaBP7vA.js +32 -0
- package/dist/{index-BjcUav4X.js → index-sx63iBdE.js} +3 -3
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-Djt10vTu.js → index.esm2017-NXs90PMj.js} +1 -1
- package/dist/{loading-CVE2HNjb.js → loading-Bnuw5L3Y.js} +4 -4
- package/dist/{membership-BLkSVFx9.js → membership-CZ_y58_j.js} +3 -3
- package/dist/{money-DqUkifCn.js → money-AY6EDrgr.js} +1 -1
- package/dist/{number-BPlOwScu.js → number-BbJ6Kbwi.js} +1 -1
- package/dist/{objectid-J3u1WeUz.js → objectid-DUKoXb-Y.js} +5 -5
- package/dist/{reward-B9WzNBWQ.js → reward-CXtVKCBn.js} +1 -1
- package/dist/{rule-FtBYuezP.js → rule-BMKyg1g0.js} +3 -3
- package/dist/{rule-builder-caiYx8mw.js → rule-builder-DqRZOJfw.js} +1 -1
- package/dist/{template-C1Iii37r.js → template-DJpPUC9p.js} +4 -4
- package/dist/{trigger-DEH6eTbm.js → trigger-Jo5dHemf.js} +4 -4
- package/dist/{xlsx-DNspY5sG.js → usePagination-BJSz3wZu.js} +3183 -2962
- package/dist/{user-DqSmwkKW.js → user-3cRqdGEW.js} +1 -1
- package/dist/{vue-i18n-4lC91qO3.js → vue-i18n-DjADG98J.js} +154 -154
- package/package.json +1 -1
- package/dist/Record-DZ2SbNCg.js +0 -209
- package/dist/index-tWez6zPm.js +0 -38
- package/dist/usePagination-BeF5K3M7.js +0 -223
package/package.json
CHANGED
package/dist/Record-DZ2SbNCg.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { defineComponent as b, ref as w, resolveComponent as y, openBlock as R, createBlock as z, unref as o, isRef as A, withCtx as I, createElementVNode as F, createVNode as C, h as c, onMounted as M, createElementBlock as N, Fragment as V } from "vue";
|
|
2
|
-
import { u as $, _ as U } from "./usePagination-BeF5K3M7.js";
|
|
3
|
-
import { g as v } from "./user-DqSmwkKW.js";
|
|
4
|
-
import { components as g } from "@feedmepos/ui-library";
|
|
5
|
-
import { u as B, a as E, c as L } from "./loading-CVE2HNjb.js";
|
|
6
|
-
import { u as T } from "./vue-i18n-4lC91qO3.js";
|
|
7
|
-
import { useCoreStore as O } from "@feedmepos/mf-common";
|
|
8
|
-
import { r as P } from "./index-tWez6zPm.js";
|
|
9
|
-
import { c as K, a as W } from "./object-qECH92oz.js";
|
|
10
|
-
import { u as j } from "./membership-BLkSVFx9.js";
|
|
11
|
-
const q = { class: "flex flex-col space-y-16 pr-12" }, G = /* @__PURE__ */ b({
|
|
12
|
-
__name: "UpdateCriteriaProgressSheet",
|
|
13
|
-
emits: ["refresh"],
|
|
14
|
-
setup(k, { expose: p, emit: h }) {
|
|
15
|
-
const u = h;
|
|
16
|
-
T();
|
|
17
|
-
const { minor: _ } = B, n = w(!1), a = w({}), S = O(), e = [
|
|
18
|
-
{
|
|
19
|
-
header: "Criteria title",
|
|
20
|
-
accessorFn: (i) => i.name
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
header: "Status",
|
|
24
|
-
cell(i) {
|
|
25
|
-
var x;
|
|
26
|
-
const t = i.row.original, l = (x = a.value.criteria_progress) == null ? void 0 : x.find(
|
|
27
|
-
(D) => D.criteria === t._id
|
|
28
|
-
), d = l ? "Completed" : "Pending", m = l ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100";
|
|
29
|
-
return [
|
|
30
|
-
c(g.FmChip, {
|
|
31
|
-
label: d,
|
|
32
|
-
compact: !0,
|
|
33
|
-
class: m
|
|
34
|
-
})
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: "actions",
|
|
40
|
-
cell(i) {
|
|
41
|
-
var d;
|
|
42
|
-
const t = i.row.original;
|
|
43
|
-
return [
|
|
44
|
-
!((d = a.value.criteria_progress) == null ? void 0 : d.some(
|
|
45
|
-
(m) => m.criteria === t._id
|
|
46
|
-
)) && t.type == "MANUAL" ? c(g.FmButton, {
|
|
47
|
-
variant: "secondary",
|
|
48
|
-
label: "Mark as completed",
|
|
49
|
-
size: "md",
|
|
50
|
-
onClick: (m) => {
|
|
51
|
-
m.stopPropagation(), r(t._id.toString());
|
|
52
|
-
}
|
|
53
|
-
}) : null
|
|
54
|
-
];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
];
|
|
58
|
-
async function r(i) {
|
|
59
|
-
var l;
|
|
60
|
-
const t = K(W(a.value));
|
|
61
|
-
t.criteria_progress = [
|
|
62
|
-
{
|
|
63
|
-
criteria: i,
|
|
64
|
-
ref: `ADMIN:${(l = S.user) == null ? void 0 : l.id}:${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
65
|
-
completedAt: /* @__PURE__ */ new Date()
|
|
66
|
-
}
|
|
67
|
-
], _(
|
|
68
|
-
async () => {
|
|
69
|
-
await P.updateCriteriaProgress(
|
|
70
|
-
a.value._id,
|
|
71
|
-
t
|
|
72
|
-
), n.value = !1, u("refresh");
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
message: "Updating criteria progress",
|
|
76
|
-
successMessage: "Criteria progress updated successfully"
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
function s(i, t) {
|
|
81
|
-
n.value = i, a.value = t;
|
|
82
|
-
}
|
|
83
|
-
function f() {
|
|
84
|
-
n.value = !1;
|
|
85
|
-
}
|
|
86
|
-
return p({
|
|
87
|
-
showSheet: s,
|
|
88
|
-
hideSheet: f,
|
|
89
|
-
data: a
|
|
90
|
-
}), (i, t) => {
|
|
91
|
-
const l = y("FmTable"), d = y("FmSideSheet");
|
|
92
|
-
return R(), z(d, {
|
|
93
|
-
"max-width": 768,
|
|
94
|
-
modelValue: o(n),
|
|
95
|
-
"onUpdate:modelValue": t[0] || (t[0] = (m) => A(n) ? n.value = m : null),
|
|
96
|
-
header: "Referee Criteria"
|
|
97
|
-
}, {
|
|
98
|
-
default: I(() => [
|
|
99
|
-
F("div", q, [
|
|
100
|
-
C(l, {
|
|
101
|
-
"row-data": o(a).criteria,
|
|
102
|
-
"hide-footer": !0,
|
|
103
|
-
"page-size": 100,
|
|
104
|
-
"column-defs": e
|
|
105
|
-
}, null, 8, ["row-data"])
|
|
106
|
-
])
|
|
107
|
-
]),
|
|
108
|
-
_: 1
|
|
109
|
-
}, 8, ["modelValue"]);
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
}), ae = /* @__PURE__ */ b({
|
|
113
|
-
__name: "Record",
|
|
114
|
-
setup(k) {
|
|
115
|
-
j();
|
|
116
|
-
const p = w(null), h = [
|
|
117
|
-
{
|
|
118
|
-
header: "ID",
|
|
119
|
-
meta: {
|
|
120
|
-
maxWidth: "100px"
|
|
121
|
-
},
|
|
122
|
-
cell(e) {
|
|
123
|
-
return c("div", { class: "flex items-center" }, [
|
|
124
|
-
c(g.FmIcon, {
|
|
125
|
-
name: "content_copy",
|
|
126
|
-
outline: !0,
|
|
127
|
-
size: "sm",
|
|
128
|
-
class: "cursor-pointer mr-4",
|
|
129
|
-
onClick: (r) => {
|
|
130
|
-
r.preventDefault(), r.stopPropagation(), E(e.row.original._id.toString());
|
|
131
|
-
}
|
|
132
|
-
}),
|
|
133
|
-
c(
|
|
134
|
-
"div",
|
|
135
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
136
|
-
e.row.original._id.toString()
|
|
137
|
-
)
|
|
138
|
-
]);
|
|
139
|
-
},
|
|
140
|
-
enableSorting: !1
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
header: "Referer info",
|
|
144
|
-
enableSorting: !0,
|
|
145
|
-
cell(e) {
|
|
146
|
-
return e.row.original.pf_referer ? v(e.row.original.pf_referer, !0) : "N/A";
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
header: "Referee info",
|
|
151
|
-
enableSorting: !0,
|
|
152
|
-
cell(e) {
|
|
153
|
-
return e.row.original.pf_referee ? v(e.row.original.pf_referee, !0) : "N/A";
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
header: "Referee criteria",
|
|
158
|
-
accessorKey: "criteria",
|
|
159
|
-
id: "criteria",
|
|
160
|
-
cell(e) {
|
|
161
|
-
const r = e.row.original.criteria_progress.length, s = e.row.original.criteria.length;
|
|
162
|
-
return s === 0 ? c("div", "No criteria") : c("div", `${r}/${s} completed criteria`);
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
header: "Status",
|
|
167
|
-
id: "status",
|
|
168
|
-
cell(e) {
|
|
169
|
-
const r = e.row.original.status;
|
|
170
|
-
return c(g.FmChip, {
|
|
171
|
-
label: L.title(r),
|
|
172
|
-
compact: !0,
|
|
173
|
-
class: r == "COMPLETED" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-primary bg-fm-color-system-primary-100"
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
], { tableMeta: u, rowData: _, onSort: n, debouncedFetchData: a, onSearch: S } = $(P.readRecords);
|
|
178
|
-
return M(async () => {
|
|
179
|
-
await a();
|
|
180
|
-
}), (e, r) => (R(), N(V, null, [
|
|
181
|
-
F("div", null, [
|
|
182
|
-
C(U, {
|
|
183
|
-
loading: o(u).isLoading,
|
|
184
|
-
"row-data": o(_),
|
|
185
|
-
"row-count": o(u).totalRows,
|
|
186
|
-
"column-defs": h,
|
|
187
|
-
"shrink-at": !1,
|
|
188
|
-
"page-count": o(u).pageCount,
|
|
189
|
-
"page-index": o(u).pageIndex,
|
|
190
|
-
"page-size": o(u).pageSize,
|
|
191
|
-
onSortChange: o(n),
|
|
192
|
-
onPageChange: r[0] || (r[0] = (s) => o(a)({ pageSize: s.pageSize, pageIndex: s.pageIndex })),
|
|
193
|
-
onRowClick: r[1] || (r[1] = (s) => {
|
|
194
|
-
var f;
|
|
195
|
-
return (f = o(p)) == null ? void 0 : f.showSheet(!0, s.original);
|
|
196
|
-
})
|
|
197
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
|
|
198
|
-
]),
|
|
199
|
-
C(G, {
|
|
200
|
-
ref_key: "updateCriteriaProgressSheetRef",
|
|
201
|
-
ref: p,
|
|
202
|
-
onRefresh: o(a)
|
|
203
|
-
}, null, 8, ["onRefresh"])
|
|
204
|
-
], 64));
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
export {
|
|
208
|
-
ae as default
|
|
209
|
-
};
|
package/dist/index-tWez6zPm.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { g as s, S as c, b as o } from "./index-BjcUav4X.js";
|
|
2
|
-
const a = () => {
|
|
3
|
-
const e = c.getBusinessId();
|
|
4
|
-
if (!e) throw new Error("Invalid business ID");
|
|
5
|
-
return o(`businesses/${e}/referral`, {
|
|
6
|
-
noIdRequired: !0
|
|
7
|
-
});
|
|
8
|
-
}, i = {
|
|
9
|
-
async read() {
|
|
10
|
-
return s(await a().get(""));
|
|
11
|
-
},
|
|
12
|
-
async update(e) {
|
|
13
|
-
return s(await a().put("", e));
|
|
14
|
-
},
|
|
15
|
-
async readReward() {
|
|
16
|
-
},
|
|
17
|
-
async updateReward() {
|
|
18
|
-
},
|
|
19
|
-
async deleteReward() {
|
|
20
|
-
},
|
|
21
|
-
async readRecords(e) {
|
|
22
|
-
const r = s(
|
|
23
|
-
await a().get("records", { params: e })
|
|
24
|
-
), t = r.resources.map((n) => ({
|
|
25
|
-
...n
|
|
26
|
-
}));
|
|
27
|
-
return {
|
|
28
|
-
meta: r.meta,
|
|
29
|
-
resources: t
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
async updateCriteriaProgress(e, r) {
|
|
33
|
-
return s(await a().post(`/records/${e}/progress`, r));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
i as r
|
|
38
|
-
};
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { defineComponent as M, ref as w, resolveComponent as C, openBlock as v, createBlock as F, withCtx as B, createVNode as c, createElementVNode as i, normalizeStyle as N, createElementBlock as S, Fragment as P, renderList as E, computed as h, onMounted as L, watch as R, unref as p, createCommentVNode as V, toDisplayString as x } from "vue";
|
|
2
|
-
import { l as A } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
const T = ["id"], D = /* @__PURE__ */ M({
|
|
4
|
-
__name: "FmTableSelection",
|
|
5
|
-
props: {
|
|
6
|
-
value: {},
|
|
7
|
-
items: {}
|
|
8
|
-
},
|
|
9
|
-
emits: ["update:modelValue"],
|
|
10
|
-
setup(f, { emit: g }) {
|
|
11
|
-
const a = g, l = f, r = w(!1);
|
|
12
|
-
return (d, u) => {
|
|
13
|
-
const y = C("FmButton"), b = C("FmMenuItem"), o = C("FmMenu");
|
|
14
|
-
return v(), F(o, {
|
|
15
|
-
"max-height": 264,
|
|
16
|
-
shift: "",
|
|
17
|
-
onMenuChanged: u[0] || (u[0] = (n) => r.value = n)
|
|
18
|
-
}, {
|
|
19
|
-
"menu-button": B(() => {
|
|
20
|
-
var n;
|
|
21
|
-
return [
|
|
22
|
-
c(y, {
|
|
23
|
-
icon: r.value ? "expand_less" : "expand_more",
|
|
24
|
-
label: (n = d.items.find((s) => s.value === l.value)) == null ? void 0 : n.label,
|
|
25
|
-
"icon-position": "append",
|
|
26
|
-
size: "md",
|
|
27
|
-
variant: "tertiary"
|
|
28
|
-
}, null, 8, ["icon", "label"])
|
|
29
|
-
];
|
|
30
|
-
}),
|
|
31
|
-
"menu-wrapper": B(({ maxHeight: n }) => [
|
|
32
|
-
i("div", {
|
|
33
|
-
id: `menu-wrapper-${n}`,
|
|
34
|
-
style: N({ maxHeight: `${n}px` }),
|
|
35
|
-
class: "bg-fm-color-neutral-white flex flex-col overflow-y-auto px-4 py-12 rounded-md shadow-light-300 w-[75px]"
|
|
36
|
-
}, [
|
|
37
|
-
(v(!0), S(P, null, E(d.items, (s) => (v(), F(b, {
|
|
38
|
-
key: s.value,
|
|
39
|
-
label: s.label,
|
|
40
|
-
value: s.value,
|
|
41
|
-
"model-value": s.value === l.value,
|
|
42
|
-
"onUpdate:modelValue": (z) => a("update:modelValue", s.value)
|
|
43
|
-
}, null, 8, ["label", "value", "model-value", "onUpdate:modelValue"]))), 128))
|
|
44
|
-
], 12, T)
|
|
45
|
-
]),
|
|
46
|
-
_: 1
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}), U = { class: "" }, O = {
|
|
51
|
-
key: 0,
|
|
52
|
-
class: "w-full flex flex-col gap-16 items-center py-16"
|
|
53
|
-
}, j = {
|
|
54
|
-
key: 1,
|
|
55
|
-
class: "basis-72 bg-white flex items-center justify-between px-24 pt-6 border-t border-fm-color-border"
|
|
56
|
-
}, W = { class: "flex gap-24 items-center justify-between xs:hidden xs:invisible" }, q = { class: "flex gap-8 items-center" }, G = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, H = { class: "flex gap-8 items-center" }, J = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, K = { class: "flex gap-8" }, Y = /* @__PURE__ */ M({
|
|
57
|
-
__name: "BaseTable",
|
|
58
|
-
props: {
|
|
59
|
-
rowData: {},
|
|
60
|
-
columnDefs: {},
|
|
61
|
-
loading: { type: Boolean, default: !1 },
|
|
62
|
-
rowCount: { default: 0 },
|
|
63
|
-
shrinkAt: { type: [Number, Boolean], default: !1 },
|
|
64
|
-
pageCount: {},
|
|
65
|
-
pageIndex: {},
|
|
66
|
-
hideFooter: { type: Boolean, default: !1 },
|
|
67
|
-
pageSize: {},
|
|
68
|
-
pageSizeOptions: { default: () => [
|
|
69
|
-
{ label: "10", value: 10 },
|
|
70
|
-
{ label: "20", value: 20 },
|
|
71
|
-
{ label: "50", value: 50 }
|
|
72
|
-
] }
|
|
73
|
-
},
|
|
74
|
-
emits: ["sortChange", "rowClick", "pageChange"],
|
|
75
|
-
setup(f, { emit: g }) {
|
|
76
|
-
const a = f, l = g, r = h(() => a.pageIndex + 1), d = h(() => a.pageIndex * a.pageSize), u = h(
|
|
77
|
-
() => Math.min(d.value + a.pageSize, a.rowCount || 0)
|
|
78
|
-
), y = h(() => a.pageIndex > 0), b = h(() => a.pageIndex < a.pageCount - 1), o = (e) => {
|
|
79
|
-
l("sortChange", e);
|
|
80
|
-
}, n = (e) => {
|
|
81
|
-
l("rowClick", e);
|
|
82
|
-
}, s = (e) => {
|
|
83
|
-
l("pageChange", { pageIndex: e, pageSize: a.pageSize });
|
|
84
|
-
}, z = (e) => {
|
|
85
|
-
l("pageChange", { pageIndex: 0, pageSize: e });
|
|
86
|
-
}, I = w(!1);
|
|
87
|
-
return L(() => {
|
|
88
|
-
R(
|
|
89
|
-
() => a.loading,
|
|
90
|
-
(e, t) => {
|
|
91
|
-
t === !0 && e === !1 && (I.value = !0);
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
}), (e, t) => {
|
|
95
|
-
const $ = C("FmTable"), k = C("FmButton");
|
|
96
|
-
return v(), S("div", U, [
|
|
97
|
-
c($, {
|
|
98
|
-
loading: e.loading,
|
|
99
|
-
"row-data": e.rowData,
|
|
100
|
-
"row-count": e.rowCount,
|
|
101
|
-
"column-defs": e.columnDefs,
|
|
102
|
-
"shrink-at": e.shrinkAt,
|
|
103
|
-
"page-count": e.pageCount,
|
|
104
|
-
"page-size": e.pageSize,
|
|
105
|
-
"fetch-fn": void 0,
|
|
106
|
-
"hide-footer": "",
|
|
107
|
-
onSortChange: o,
|
|
108
|
-
onRowClick: n
|
|
109
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "shrink-at", "page-count", "page-size"]),
|
|
110
|
-
e.rowData.length == 0 && e.loading == !1 && p(I) ? (v(), S("div", O, t[5] || (t[5] = [
|
|
111
|
-
i("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1),
|
|
112
|
-
i("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1)
|
|
113
|
-
]))) : V("", !0),
|
|
114
|
-
e.hideFooter ? V("", !0) : (v(), S("div", j, [
|
|
115
|
-
i("div", W, [
|
|
116
|
-
i("div", q, [
|
|
117
|
-
t[6] || (t[6] = i("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
|
|
118
|
-
c(D, {
|
|
119
|
-
items: e.pageSizeOptions,
|
|
120
|
-
value: e.pageSize,
|
|
121
|
-
"onUpdate:modelValue": z
|
|
122
|
-
}, null, 8, ["items", "value"])
|
|
123
|
-
]),
|
|
124
|
-
i("span", G, x(p(d) + 1) + " - " + x(p(u)) + " of " + x(e.rowCount) + " items ", 1)
|
|
125
|
-
]),
|
|
126
|
-
i("div", H, [
|
|
127
|
-
c(D, {
|
|
128
|
-
items: Array.from(Array(e.pageCount), (m, _) => ({
|
|
129
|
-
label: (_ + 1).toString(),
|
|
130
|
-
value: _ + 1
|
|
131
|
-
})),
|
|
132
|
-
value: p(r),
|
|
133
|
-
"onUpdate:modelValue": t[0] || (t[0] = (m) => s(m - 1))
|
|
134
|
-
}, null, 8, ["items", "value"]),
|
|
135
|
-
i("span", J, " of " + x(e.pageCount) + " pages ", 1),
|
|
136
|
-
i("div", K, [
|
|
137
|
-
c(k, {
|
|
138
|
-
disabled: !p(y),
|
|
139
|
-
icon: "first_page",
|
|
140
|
-
"icon-color": "neutral-black",
|
|
141
|
-
variant: "tertiary",
|
|
142
|
-
onClick: t[1] || (t[1] = (m) => s(0))
|
|
143
|
-
}, null, 8, ["disabled"]),
|
|
144
|
-
c(k, {
|
|
145
|
-
disabled: !p(y),
|
|
146
|
-
icon: "chevron_left",
|
|
147
|
-
"icon-color": "neutral-black",
|
|
148
|
-
variant: "tertiary",
|
|
149
|
-
onClick: t[2] || (t[2] = (m) => s(e.pageIndex - 1))
|
|
150
|
-
}, null, 8, ["disabled"]),
|
|
151
|
-
c(k, {
|
|
152
|
-
disabled: !p(b),
|
|
153
|
-
icon: "chevron_right",
|
|
154
|
-
"icon-color": "neutral-black",
|
|
155
|
-
variant: "tertiary",
|
|
156
|
-
onClick: t[3] || (t[3] = (m) => s(e.pageIndex + 1))
|
|
157
|
-
}, null, 8, ["disabled"]),
|
|
158
|
-
c(k, {
|
|
159
|
-
disabled: !p(b),
|
|
160
|
-
icon: "last_page",
|
|
161
|
-
"icon-color": "neutral-black",
|
|
162
|
-
variant: "tertiary",
|
|
163
|
-
onClick: t[4] || (t[4] = (m) => s(e.pageCount - 1))
|
|
164
|
-
}, null, 8, ["disabled"])
|
|
165
|
-
])
|
|
166
|
-
])
|
|
167
|
-
]))
|
|
168
|
-
]);
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
function Z(f, g = { key: "_id", descending: !0 }) {
|
|
173
|
-
const a = w({
|
|
174
|
-
pageCount: 0,
|
|
175
|
-
searchValue: "",
|
|
176
|
-
pageIndex: 0,
|
|
177
|
-
totalRows: 0,
|
|
178
|
-
isLoading: !1,
|
|
179
|
-
pageSize: 10
|
|
180
|
-
}), l = w(g), r = w([]), d = async (o) => {
|
|
181
|
-
a.value.isLoading = !0, r.value = [];
|
|
182
|
-
try {
|
|
183
|
-
const n = await f({
|
|
184
|
-
limit: o.pageSize || a.value.pageSize,
|
|
185
|
-
skip: o.pageIndex ?? 0,
|
|
186
|
-
sortBy: l.value.key,
|
|
187
|
-
descending: l.value.descending,
|
|
188
|
-
search: a.value.searchValue
|
|
189
|
-
});
|
|
190
|
-
r.value = n.resources, a.value.totalRows = n.meta.totalResources ?? 0, a.value.pageCount = n.meta.totalPages ?? 0, a.value.pageIndex = n.meta.skip ?? 0;
|
|
191
|
-
} catch (n) {
|
|
192
|
-
console.error("Error fetching data:", n);
|
|
193
|
-
} finally {
|
|
194
|
-
a.value.isLoading = !1;
|
|
195
|
-
}
|
|
196
|
-
}, u = A.debounce(async (o) => {
|
|
197
|
-
a.value.pageSize = (o == null ? void 0 : o.pageSize) || a.value.pageSize, await d({
|
|
198
|
-
pageSize: a.value.pageSize,
|
|
199
|
-
pageIndex: (o == null ? void 0 : o.pageIndex) || 0
|
|
200
|
-
});
|
|
201
|
-
}, 200);
|
|
202
|
-
return {
|
|
203
|
-
tableMeta: a,
|
|
204
|
-
rowData: r,
|
|
205
|
-
sortBy: l,
|
|
206
|
-
fetchData: d,
|
|
207
|
-
debouncedFetchData: u,
|
|
208
|
-
onSort: async (o) => {
|
|
209
|
-
var n;
|
|
210
|
-
console.log("sortState", (n = o[0]) == null ? void 0 : n.id), o.length ? (l.value = {
|
|
211
|
-
key: o[0].id.startsWith("_") ? o[0].id : o[0].id.replace(new RegExp("_", "g"), "."),
|
|
212
|
-
descending: o[0].desc
|
|
213
|
-
}, console.log("sortBy", l.value)) : l.value = g, await u();
|
|
214
|
-
},
|
|
215
|
-
onSearch: () => {
|
|
216
|
-
u({ pageIndex: 0, pageSize: a.value.pageSize });
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
export {
|
|
221
|
-
Y as _,
|
|
222
|
-
Z as u
|
|
223
|
-
};
|