@feedmepos/mf-connect 0.1.38-beta.76 → 0.1.38-beta.77
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-BrBxRQue.js → Analytic-CPlnEHSZ.js} +14 -14
- package/dist/{App-CE_19YJc.js → App-Cu4p6gbW.js} +7 -7
- package/dist/{AuditLogs-CQtMmVIp.js → AuditLogs-CcFMAscb.js} +9 -9
- package/dist/{Bin-D9CHhiUb.js → Bin-gtBK8XVY.js} +8 -8
- package/dist/{Broadcast-Dg6eBL_f.js → Broadcast-4xWTsz3e.js} +10 -10
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CSv0R9XX.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DjfHJS4N.js} +6 -6
- package/dist/{Card-BTkf67i1.js → Card-Bpyi1Mqh.js} +18 -18
- package/dist/{Collections-Czq4nsdu.js → Collections-BXJpy-Z6.js} +8 -8
- package/dist/{Credit-B3nX8aJA.js → Credit-CACj5WA5.js} +10 -10
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CNp7zgbE.js} +33 -33
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-5U6cSZGZ.js → EffectSheet.vue_vue_type_style_index_0_lang-Dtu40xSp.js} +6 -6
- package/dist/{Experience-B9Vn3NTH.js → Experience-ERwGbs6_.js} +10 -10
- package/dist/{FileSaver.min-CJaOkSQt.js → FileSaver.min-CCloVqBK.js} +1 -1
- package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
- package/dist/{Game-DTx_EsM3.js → Game-nn5Kroc_.js} +11 -11
- package/dist/{GenerateMaterial-C3J9_YHw.js → GenerateMaterial-uhORX0wE.js} +6 -6
- package/dist/{Grab-B29W7rka.js → Grab-Baqpbxdr.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DyegKNzM.js → ImageInput.vue_vue_type_script_setup_true_lang-Dc2Wxjrq.js} +1 -1
- package/dist/{Index-Fk8EP5dG.js → Index-CYB1KuDA.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-D2XPGgTM.js → LocationPicker.vue_vue_type_script_setup_true_lang-B15IWMTx.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-K8qUYrPk.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BFwur41g.js} +1 -1
- package/dist/{MainLayout-BFmqJkE_.js → MainLayout-DQI5pMKt.js} +1 -1
- package/dist/{Marketing-BRHQHAWD.js → Marketing-BDDNIPbj.js} +4 -4
- package/dist/{MarketingMaterialEdit-7s3WEDyJ.js → MarketingMaterialEdit-CCEojq5A.js} +4 -4
- package/dist/{Member-DwPJNAo9.js → Member-D97fw6Cd.js} +11 -11
- package/dist/{MemberList-mS1W0qHY.js → MemberList-DDRtiYhf.js} +26 -26
- package/dist/{MemberTransactions-BV3xvFYS.js → MemberTransactions-08ct4MMf.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DzKqVp2O.js → MessageInput.vue_vue_type_script_setup_true_lang-Mm-Chxx1.js} +9 -9
- package/dist/{Mission-QmoURSu4.js → Mission-B1sZbVOv.js} +11 -11
- package/dist/{Overview-CaTMLlq-.js → Overview-CihI2Ydx.js} +18 -18
- package/dist/{Point-CjG77Sma.js → Point-jggxL54s.js} +10 -10
- package/dist/{Promotion-C5I-1qPN.js → Promotion-DCFVPRw9.js} +11 -11
- package/dist/{Queue-BaIBCCaX.js → Queue-BCfueANY.js} +10 -10
- package/dist/{Record-DqpGwZIU.js → Record-cFWNJD__.js} +9 -9
- package/dist/{Review-Bq-edSOO.js → Review-BnYNAJHr.js} +4 -4
- package/dist/{ReviewFacebookCallback-yaC4rLki.js → ReviewFacebookCallback-DxuDeLaX.js} +4 -4
- package/dist/{ReviewGoogleCallback-uxrrCQdu.js → ReviewGoogleCallback-CzUOYUhc.js} +4 -4
- package/dist/{Reward-DGP65n5t.js → Reward-C3IQT6Vm.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-bNMoMZOy.js → RewardGroup.vue_vue_type_script_setup_true_lang-BHQbHhGE.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Dgrc6vXF.js → RuleGroup.vue_vue_type_script_setup_true_lang-CL0gWNDv.js} +14 -14
- package/dist/{Segment-CNz0sR3c.js → Segment-Di328H19.js} +24 -24
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DLZEzpve.js → SelectItems.vue_vue_type_script_setup_true_lang-CiEEE545.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CLdIeyef.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DyKJC5rS.js} +12 -12
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-C9PkNlUG.js +226 -0
- package/dist/{Setting-BKDSGYBR.js → Setting-D8it6u-5.js} +14 -14
- package/dist/{SettingAdvertisements-B2GMFfN9.js → SettingAdvertisements-CrLcIibQ.js} +12 -12
- package/dist/{Store-C6uLl_Ue.js → Store-Dr_fUsGl.js} +21 -21
- package/dist/{StoreRewards-D4728UDf.js → StoreRewards-CJjRph_y.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CG09fJTP.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CcG8ez-X.js} +21 -21
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B0_bMK5u.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CQwJ43lC.js} +2 -2
- package/dist/{Tier-BNzTa1_w.js → Tier-CSfFMEO6.js} +24 -24
- package/dist/{Title-DY5knovF.js → Title-BJeyjdmZ.js} +21 -21
- package/dist/{Transaction-Ct4yAJ9n.js → Transaction-CYT59iim.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CHnxi3XZ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bhpfk_pP.js} +6 -6
- package/dist/{Voucher-DFTMRPT0.js → Voucher-B7bbNebL.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DZU7XVlZ.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BWaL1UD_.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BndLHmHB.js → ZodTextField.vue_vue_type_script_setup_true_lang-C75XExhq.js} +2 -2
- package/dist/{app-6lG4w5PT.js → app-DW87VLhM.js} +52 -52
- package/dist/app.js +1 -1
- package/dist/{business-CrfQ56D0.js → business-CKorj1jI.js} +1 -1
- package/dist/{campaign-B9fR7RwT.js → campaign-KUqRHHsx.js} +2 -2
- package/dist/{campaign-B_iIaTKz.js → campaign-v-IDnBOH.js} +8 -8
- package/dist/{campaign.enum-BAHf0dSv.js → campaign.enum-Y2VyD9Rk.js} +1 -1
- package/dist/{campaign.fn-DDEgBzH2.js → campaign.fn-J0h3DHY7.js} +48 -48
- package/dist/{collectible.enum-9os2zr5a.js → collectible.enum-Ct4EH1-M.js} +1 -1
- package/dist/{collection.fn-7qP_m2MW.js → collection.fn-4EwI__Kd.js} +2 -2
- package/dist/{dto-C2hLQKuu.js → dto-CzQ5ZPnM.js} +4 -4
- package/dist/{duplicateCampaign-C6RXfeWE.js → duplicateCampaign-DH4GTkl4.js} +2 -2
- package/dist/{effect-DGVfWyIc.js → effect-CSmAbPw5.js} +1 -1
- package/dist/{email-addresses-BHa_qQBd.js → email-addresses-CDQTaGMc.js} +2 -2
- package/dist/{export-CRPfo4hq.js → export-CWGMDCOS.js} +3 -3
- package/dist/{helper-0_zrz4kj.js → helper-BTMcmkY-.js} +1 -1
- package/dist/{index-CO5kQMIK.js → index-BGP2XsfH.js} +1 -1
- package/dist/{index-CW_ub4cF.js → index-BalocitS.js} +3 -3
- package/dist/{index-4bX0ewBJ.js → index-CHwxbJ-k.js} +1 -1
- package/dist/{index-Bj0TV_D5.js → index-CINZ-bnq.js} +1 -1
- package/dist/{index-D6Te1BQZ.js → index-DNgP9oPe.js} +3 -3
- package/dist/{index-4Vl1VXum.js → index-DQxSSe7u.js} +6 -6
- package/dist/{index-BpdSswT6.js → index-DafBqawi.js} +1 -1
- package/dist/{index-Cp8wkBus.js → index-DbSJ3Kqw.js} +1 -1
- package/dist/{index-Dp1J9Fxa.js → index-DpYrJ9BA.js} +1 -1
- package/dist/{index-DbJGJ2fB.js → index-Ds0iCyTa.js} +1 -1
- package/dist/{index-lwxV5iX0.js → index-DuKr4NrF.js} +4 -4
- package/dist/{index-C8L2jQ_6.js → index-KfVh_1Mq.js} +5 -3
- package/dist/{index-DeaGdUSH.js → index-Th2v5uhF.js} +3 -3
- package/dist/{index-QUvYZydO.js → index-c7bs3-sB.js} +1 -1
- package/dist/{index-By2wenzb.js → index-nxwskabW.js} +1 -1
- package/dist/{index.esm2017-ofRmIpjY.js → index.esm2017-BaIOtNg6.js} +1 -1
- package/dist/{loading-8_73fcXo.js → loading-IPAu72W9.js} +1 -1
- package/dist/{lodash-Bz_vrY3P.js → lodash-8i9BuEpy.js} +1 -1
- package/dist/{membership-CpB39vNW.js → membership-D3C6uxZn.js} +3 -3
- package/dist/{money-DALHjzjF.js → money-DgJ-Eu1j.js} +1 -1
- package/dist/{number-D_GJahxw.js → number-DYvUlYUV.js} +1 -1
- package/dist/{objectid-BZSH63yc.js → objectid-DXtt7nvA.js} +7 -7
- package/dist/{plugins-A4jDcmfS.js → plugins-DOuRSYyI.js} +3 -3
- package/dist/{reward-BqFB2Yn2.js → reward-DnUBE-5Q.js} +1 -1
- package/dist/{rule-DNylZfIG.js → rule-2xz8bsfH.js} +3 -3
- package/dist/{rule-builder-2iT04EOj.js → rule-builder-BUbfKVI2.js} +1 -1
- package/dist/{template-D7rpG7FN.js → template-DIFr5du7.js} +6 -6
- package/dist/{timezone-BW17tvi2.js → timezone-BLOuoWcc.js} +5 -3
- package/dist/{trigger-CbVrS2i6.js → trigger-CTBnJR5J.js} +5 -5
- package/dist/usePagination-6vyp3VrT.js +220 -0
- package/dist/{user-Ck-m3cB3.js → user-oKms24rP.js} +1 -1
- package/dist/{vue-i18n-BvqmcBWZ.js → vue-i18n-C1UXB6UQ.js} +216 -216
- package/dist/{xlsx-CkqDfUNs.js → xlsx-CdtGyyAC.js} +440 -440
- package/dist/{zod-B0YxCfoE.js → zod-C2KjnyQW.js} +1 -1
- package/package.json +1 -1
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-ocCdtbbe.js +0 -147
- package/dist/usePagination-dXSoqxfG.js +0 -266
package/package.json
CHANGED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, ref as c, watch as S, onMounted as R, resolveComponent as f, openBlock as j, createBlock as B, unref as t, isRef as _, withCtx as V, createElementVNode as v, createVNode as m, toDisplayString as N } from "vue";
|
|
2
|
-
import { J as A } from "./JsonViewer-v8_C7l5N.js";
|
|
3
|
-
import { u as E } from "./loading-8_73fcXo.js";
|
|
4
|
-
import { u as P } from "./app-wDQR6dpb.js";
|
|
5
|
-
import { l as U } from "./lodash-Bz_vrY3P.js";
|
|
6
|
-
import { m as D } from "./index-CO5kQMIK.js";
|
|
7
|
-
import { c as J } from "./index-Cp8wkBus.js";
|
|
8
|
-
const O = { class: "space-y-16" }, T = { class: "fm-typo-en-body-md-600" }, $ = { class: "flex items-center justify-end" }, q = { class: "flex items-center gap-8" }, ee = /* @__PURE__ */ L({
|
|
9
|
-
__name: "SendVoucherSheet",
|
|
10
|
-
emits: ["success"],
|
|
11
|
-
setup(G, { expose: w, emit: y }) {
|
|
12
|
-
const { minor: x } = E, h = c(""), l = c({}), C = y, r = c(!1), s = c([]);
|
|
13
|
-
function F(a) {
|
|
14
|
-
r.value = !0, h.value = a.campaignId, s.value = [];
|
|
15
|
-
}
|
|
16
|
-
function b() {
|
|
17
|
-
r.value = !1;
|
|
18
|
-
}
|
|
19
|
-
const I = [
|
|
20
|
-
{
|
|
21
|
-
header: "Name",
|
|
22
|
-
accessorFn: (a) => a.name || "No Profile"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
header: "Phone",
|
|
26
|
-
accessorFn: (a) => a.phoneNumber || "-"
|
|
27
|
-
}
|
|
28
|
-
], o = c({
|
|
29
|
-
searchValue: "",
|
|
30
|
-
pageSize: 10,
|
|
31
|
-
pageCount: 0,
|
|
32
|
-
pageIndex: 0,
|
|
33
|
-
totalRows: 0,
|
|
34
|
-
isLoading: !1
|
|
35
|
-
}), n = c([]), g = async (a) => {
|
|
36
|
-
o.value.isLoading = !0, n.value = [];
|
|
37
|
-
const e = await D.read({
|
|
38
|
-
limit: a.pageSize,
|
|
39
|
-
skip: a.pageIndex,
|
|
40
|
-
sortBy: "_id",
|
|
41
|
-
search: o.value.searchValue,
|
|
42
|
-
descending: !1
|
|
43
|
-
});
|
|
44
|
-
n.value = e.resources, o.value.totalRows = e.meta.totalResources ?? 0, o.value.pageCount = e.meta.totalPages ?? 0, o.value.isLoading = !1, l.value = {}, s.value.forEach((i) => {
|
|
45
|
-
const d = n.value.findIndex((p) => p._id == i);
|
|
46
|
-
d > -1 && (console.log(d, "fetch member index"), l.value[d] = !0);
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
function z() {
|
|
50
|
-
n.value.length > 0 && (s.value = s.value.filter(
|
|
51
|
-
(a) => !n.value.some((e) => e._id === a) || // Keep if not in current page
|
|
52
|
-
Object.entries(l.value).some(
|
|
53
|
-
([e, i]) => i && n.value[e]._id === a
|
|
54
|
-
// Keep if selected in current page
|
|
55
|
-
)
|
|
56
|
-
));
|
|
57
|
-
for (const [a, e] of Object.entries(l.value))
|
|
58
|
-
if (e) {
|
|
59
|
-
const i = n.value[a]._id;
|
|
60
|
-
s.value.includes(i) || s.value.push(i);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
async function M(a) {
|
|
64
|
-
s.value.length < 1 || await x(
|
|
65
|
-
async () => {
|
|
66
|
-
await J.sendCollection(h.value, {
|
|
67
|
-
memberId: s.value
|
|
68
|
-
}), await C("success"), b();
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
message: "Sending claim(s)",
|
|
72
|
-
successMessage: "Claim(s) created"
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
return S(l, z, { deep: !0 }), S(
|
|
77
|
-
() => o.value.searchValue,
|
|
78
|
-
U.debounce(async () => {
|
|
79
|
-
await g({ pageSize: 10, pageIndex: 0 });
|
|
80
|
-
}, 500)
|
|
81
|
-
), w({
|
|
82
|
-
showSheet: F,
|
|
83
|
-
hideSheet: b
|
|
84
|
-
}), R(async () => {
|
|
85
|
-
await g(o.value);
|
|
86
|
-
}), (a, e) => {
|
|
87
|
-
const i = f("FmSearch"), d = f("FmTable"), p = f("FmButton"), k = f("FmSideSheet");
|
|
88
|
-
return j(), B(k, {
|
|
89
|
-
"max-width": 560,
|
|
90
|
-
"dismiss-away": !0,
|
|
91
|
-
header: "Send voucher to",
|
|
92
|
-
modelValue: t(r),
|
|
93
|
-
"onUpdate:modelValue": [
|
|
94
|
-
e[3] || (e[3] = (u) => _(r) ? r.value = u : null),
|
|
95
|
-
e[4] || (e[4] = (u) => r.value = u)
|
|
96
|
-
]
|
|
97
|
-
}, {
|
|
98
|
-
"side-sheet-footer": V(() => [
|
|
99
|
-
v("div", q, [
|
|
100
|
-
m(p, {
|
|
101
|
-
label: "Send",
|
|
102
|
-
loading: t(P)().isLoading,
|
|
103
|
-
onClick: M
|
|
104
|
-
}, null, 8, ["loading"]),
|
|
105
|
-
m(p, {
|
|
106
|
-
label: "Cancel",
|
|
107
|
-
type: "button",
|
|
108
|
-
variant: "tertiary",
|
|
109
|
-
onClick: e[2] || (e[2] = (u) => r.value = !1)
|
|
110
|
-
})
|
|
111
|
-
])
|
|
112
|
-
]),
|
|
113
|
-
default: V(() => [
|
|
114
|
-
m(A, { json: t(s) }, null, 8, ["json"]),
|
|
115
|
-
v("div", O, [
|
|
116
|
-
v("div", T, N(t(s).length) + " members selected ", 1),
|
|
117
|
-
v("div", $, [
|
|
118
|
-
m(i, {
|
|
119
|
-
class: "mt-4",
|
|
120
|
-
modelValue: t(o).searchValue,
|
|
121
|
-
"onUpdate:modelValue": e[0] || (e[0] = (u) => t(o).searchValue = u),
|
|
122
|
-
placeholder: "Search Member",
|
|
123
|
-
collapsible: ""
|
|
124
|
-
}, null, 8, ["modelValue"])
|
|
125
|
-
]),
|
|
126
|
-
m(d, {
|
|
127
|
-
modelValue: t(l),
|
|
128
|
-
"onUpdate:modelValue": e[1] || (e[1] = (u) => _(l) ? l.value = u : null),
|
|
129
|
-
selection: "multiple",
|
|
130
|
-
loading: t(o).isLoading,
|
|
131
|
-
"row-data": t(n),
|
|
132
|
-
"column-defs": I,
|
|
133
|
-
"page-size": t(o).pageSize,
|
|
134
|
-
"page-count": t(o).pageCount,
|
|
135
|
-
"hide-footer": t(o).totalRows <= t(o).pageSize,
|
|
136
|
-
"fetch-fn": g
|
|
137
|
-
}, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
|
|
138
|
-
])
|
|
139
|
-
]),
|
|
140
|
-
_: 1
|
|
141
|
-
}, 8, ["modelValue"]);
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
export {
|
|
146
|
-
ee as _
|
|
147
|
-
};
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { defineComponent as N, ref as S, resolveComponent as z, openBlock as u, createBlock as M, withCtx as $, createVNode as d, createElementVNode as s, normalizeStyle as E, createElementBlock as f, Fragment as L, renderList as R, computed as C, onMounted as U, watch as A, unref as i, createCommentVNode as D, toDisplayString as k } from "vue";
|
|
2
|
-
import { l as O } from "./lodash-Bz_vrY3P.js";
|
|
3
|
-
const T = ["id"], I = /* @__PURE__ */ N({
|
|
4
|
-
__name: "FmTableSelection",
|
|
5
|
-
props: {
|
|
6
|
-
value: {},
|
|
7
|
-
items: {}
|
|
8
|
-
},
|
|
9
|
-
emits: ["update:modelValue"],
|
|
10
|
-
setup(e, { emit: y }) {
|
|
11
|
-
const a = y, l = e, c = S(!1);
|
|
12
|
-
return (x, m) => {
|
|
13
|
-
const b = z("FmButton"), h = z("FmMenuItem"), n = z("FmMenu");
|
|
14
|
-
return u(), M(n, {
|
|
15
|
-
"max-height": 264,
|
|
16
|
-
shift: "",
|
|
17
|
-
onMenuChanged: m[0] || (m[0] = (o) => c.value = o)
|
|
18
|
-
}, {
|
|
19
|
-
"menu-button": $(() => {
|
|
20
|
-
var o;
|
|
21
|
-
return [
|
|
22
|
-
d(b, {
|
|
23
|
-
icon: c.value ? "expand_less" : "expand_more",
|
|
24
|
-
label: (o = e.items.find((g) => g.value === l.value)) == null ? void 0 : o.label,
|
|
25
|
-
"icon-position": "append",
|
|
26
|
-
size: "md",
|
|
27
|
-
variant: "tertiary"
|
|
28
|
-
}, null, 8, ["icon", "label"])
|
|
29
|
-
];
|
|
30
|
-
}),
|
|
31
|
-
"menu-wrapper": $(({ maxHeight: o }) => [
|
|
32
|
-
s("div", {
|
|
33
|
-
id: `menu-wrapper-${o}`,
|
|
34
|
-
style: E({ maxHeight: `${o}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
|
-
(u(!0), f(L, null, R(e.items, (g) => (u(), M(h, {
|
|
38
|
-
key: g.value,
|
|
39
|
-
label: g.label,
|
|
40
|
-
value: g.value,
|
|
41
|
-
"model-value": g.value === l.value,
|
|
42
|
-
"onUpdate:modelValue": (p) => a("update:modelValue", g.value)
|
|
43
|
-
}, null, 8, ["label", "value", "model-value", "onUpdate:modelValue"]))), 128))
|
|
44
|
-
], 12, T)
|
|
45
|
-
]),
|
|
46
|
-
_: 1
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}), j = { class: "" }, W = {
|
|
51
|
-
key: 0,
|
|
52
|
-
class: "w-full flex flex-col gap-16 items-center py-16"
|
|
53
|
-
}, q = {
|
|
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
|
-
}, G = {
|
|
57
|
-
key: 0,
|
|
58
|
-
class: "flex gap-24 items-center justify-between xs:hidden xs:invisible"
|
|
59
|
-
}, H = { class: "flex gap-8 items-center" }, J = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, K = {
|
|
60
|
-
key: 1,
|
|
61
|
-
class: "flex gap-24 items-center justify-between xs:hidden xs:invisible"
|
|
62
|
-
}, Q = { class: "flex gap-8 items-center" }, X = {
|
|
63
|
-
key: 2,
|
|
64
|
-
class: "flex gap-8 items-center"
|
|
65
|
-
}, Y = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, Z = { class: "flex gap-8" }, _ = {
|
|
66
|
-
key: 3,
|
|
67
|
-
class: "flex gap-8 items-center"
|
|
68
|
-
}, ee = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, ae = { class: "flex gap-8" }, oe = /* @__PURE__ */ N({
|
|
69
|
-
__name: "BaseTable",
|
|
70
|
-
props: {
|
|
71
|
-
rowData: {},
|
|
72
|
-
columnDefs: {},
|
|
73
|
-
loading: { type: Boolean, default: !1 },
|
|
74
|
-
rowCount: { default: 0 },
|
|
75
|
-
shrinkAt: { type: [Number, Boolean], default: !1 },
|
|
76
|
-
pageCount: { default: 0 },
|
|
77
|
-
pageIndex: {},
|
|
78
|
-
hideFooter: { type: Boolean, default: !1 },
|
|
79
|
-
pageSize: {},
|
|
80
|
-
pageSizeOptions: { default: () => [
|
|
81
|
-
{ label: "10", value: 10 },
|
|
82
|
-
{ label: "20", value: 20 },
|
|
83
|
-
{ label: "50", value: 50 }
|
|
84
|
-
] },
|
|
85
|
-
paginationMode: { default: "offset" },
|
|
86
|
-
hasNext: { type: Boolean, default: !1 }
|
|
87
|
-
},
|
|
88
|
-
emits: ["sortChange", "rowClick", "pageChange"],
|
|
89
|
-
setup(e, { emit: y }) {
|
|
90
|
-
const a = e, l = y, c = C(() => a.pageIndex + 1), x = C(() => a.pageIndex * a.pageSize), m = C(
|
|
91
|
-
() => Math.min(x.value + a.pageSize, a.rowCount || 0)
|
|
92
|
-
), b = C(() => a.paginationMode === "cursor"), h = C(() => a.pageIndex > 0), n = C(
|
|
93
|
-
() => b.value ? a.hasNext : a.pageIndex < a.pageCount - 1
|
|
94
|
-
), o = (r) => {
|
|
95
|
-
l("sortChange", r);
|
|
96
|
-
}, g = (r) => {
|
|
97
|
-
l("rowClick", r);
|
|
98
|
-
}, p = (r) => {
|
|
99
|
-
l("pageChange", { pageIndex: r, pageSize: a.pageSize });
|
|
100
|
-
}, B = (r) => {
|
|
101
|
-
l("pageChange", { pageIndex: 0, pageSize: r });
|
|
102
|
-
}, F = S(!1);
|
|
103
|
-
return U(() => {
|
|
104
|
-
A(
|
|
105
|
-
() => a.loading,
|
|
106
|
-
(r, t) => {
|
|
107
|
-
t === !0 && r === !1 && (F.value = !0);
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
}), (r, t) => {
|
|
111
|
-
const P = z("FmTable"), w = z("FmButton");
|
|
112
|
-
return u(), f("div", j, [
|
|
113
|
-
d(P, {
|
|
114
|
-
loading: e.loading,
|
|
115
|
-
"row-data": e.rowData,
|
|
116
|
-
"row-count": e.rowCount,
|
|
117
|
-
"column-defs": e.columnDefs,
|
|
118
|
-
"shrink-at": e.shrinkAt,
|
|
119
|
-
"page-count": e.pageCount,
|
|
120
|
-
"page-size": e.pageSize,
|
|
121
|
-
"fetch-fn": void 0,
|
|
122
|
-
"hide-footer": "",
|
|
123
|
-
onSortChange: o,
|
|
124
|
-
onRowClick: g
|
|
125
|
-
}, null, 8, ["loading", "row-data", "row-count", "column-defs", "shrink-at", "page-count", "page-size"]),
|
|
126
|
-
e.rowData.length == 0 && e.loading == !1 && i(F) ? (u(), f("div", W, [...t[7] || (t[7] = [
|
|
127
|
-
s("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1),
|
|
128
|
-
s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1)
|
|
129
|
-
])])) : D("", !0),
|
|
130
|
-
e.hideFooter ? D("", !0) : (u(), f("div", q, [
|
|
131
|
-
i(b) ? (u(), f("div", K, [
|
|
132
|
-
s("div", Q, [
|
|
133
|
-
t[9] || (t[9] = s("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
|
|
134
|
-
d(I, {
|
|
135
|
-
items: e.pageSizeOptions,
|
|
136
|
-
value: e.pageSize,
|
|
137
|
-
"onUpdate:modelValue": B
|
|
138
|
-
}, null, 8, ["items", "value"])
|
|
139
|
-
])
|
|
140
|
-
])) : (u(), f("div", G, [
|
|
141
|
-
s("div", H, [
|
|
142
|
-
t[8] || (t[8] = s("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
|
|
143
|
-
d(I, {
|
|
144
|
-
items: e.pageSizeOptions,
|
|
145
|
-
value: e.pageSize,
|
|
146
|
-
"onUpdate:modelValue": B
|
|
147
|
-
}, null, 8, ["items", "value"])
|
|
148
|
-
]),
|
|
149
|
-
s("span", J, k(i(x) + 1) + " - " + k(i(m)) + " of " + k(e.rowCount) + " items ", 1)
|
|
150
|
-
])),
|
|
151
|
-
i(b) ? (u(), f("div", _, [
|
|
152
|
-
s("span", ee, " Page " + k(i(c)), 1),
|
|
153
|
-
s("div", ae, [
|
|
154
|
-
d(w, {
|
|
155
|
-
disabled: !i(h),
|
|
156
|
-
icon: "chevron_left",
|
|
157
|
-
"icon-color": "neutral-black",
|
|
158
|
-
variant: "tertiary",
|
|
159
|
-
onClick: t[5] || (t[5] = (v) => p(e.pageIndex - 1))
|
|
160
|
-
}, null, 8, ["disabled"]),
|
|
161
|
-
d(w, {
|
|
162
|
-
disabled: !i(n),
|
|
163
|
-
icon: "chevron_right",
|
|
164
|
-
"icon-color": "neutral-black",
|
|
165
|
-
variant: "tertiary",
|
|
166
|
-
onClick: t[6] || (t[6] = (v) => p(e.pageIndex + 1))
|
|
167
|
-
}, null, 8, ["disabled"])
|
|
168
|
-
])
|
|
169
|
-
])) : (u(), f("div", X, [
|
|
170
|
-
d(I, {
|
|
171
|
-
items: Array.from(Array(e.pageCount), (v, V) => ({
|
|
172
|
-
label: (V + 1).toString(),
|
|
173
|
-
value: V + 1
|
|
174
|
-
})),
|
|
175
|
-
value: i(c),
|
|
176
|
-
"onUpdate:modelValue": t[0] || (t[0] = (v) => p(v - 1))
|
|
177
|
-
}, null, 8, ["items", "value"]),
|
|
178
|
-
s("span", Y, " of " + k(e.pageCount) + " pages ", 1),
|
|
179
|
-
s("div", Z, [
|
|
180
|
-
d(w, {
|
|
181
|
-
disabled: !i(h),
|
|
182
|
-
icon: "first_page",
|
|
183
|
-
"icon-color": "neutral-black",
|
|
184
|
-
variant: "tertiary",
|
|
185
|
-
onClick: t[1] || (t[1] = (v) => p(0))
|
|
186
|
-
}, null, 8, ["disabled"]),
|
|
187
|
-
d(w, {
|
|
188
|
-
disabled: !i(h),
|
|
189
|
-
icon: "chevron_left",
|
|
190
|
-
"icon-color": "neutral-black",
|
|
191
|
-
variant: "tertiary",
|
|
192
|
-
onClick: t[2] || (t[2] = (v) => p(e.pageIndex - 1))
|
|
193
|
-
}, null, 8, ["disabled"]),
|
|
194
|
-
d(w, {
|
|
195
|
-
disabled: !i(n),
|
|
196
|
-
icon: "chevron_right",
|
|
197
|
-
"icon-color": "neutral-black",
|
|
198
|
-
variant: "tertiary",
|
|
199
|
-
onClick: t[3] || (t[3] = (v) => p(e.pageIndex + 1))
|
|
200
|
-
}, null, 8, ["disabled"]),
|
|
201
|
-
d(w, {
|
|
202
|
-
disabled: !i(n),
|
|
203
|
-
icon: "last_page",
|
|
204
|
-
"icon-color": "neutral-black",
|
|
205
|
-
variant: "tertiary",
|
|
206
|
-
onClick: t[4] || (t[4] = (v) => p(e.pageCount - 1))
|
|
207
|
-
}, null, 8, ["disabled"])
|
|
208
|
-
])
|
|
209
|
-
]))
|
|
210
|
-
]))
|
|
211
|
-
]);
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
function le(e, y = { key: "_id", descending: !0 }) {
|
|
216
|
-
const a = S({
|
|
217
|
-
pageCount: 0,
|
|
218
|
-
searchValue: "",
|
|
219
|
-
pageIndex: 0,
|
|
220
|
-
totalRows: 0,
|
|
221
|
-
isLoading: !1,
|
|
222
|
-
pageSize: 10
|
|
223
|
-
}), l = S(y), c = S([]), x = async (n) => {
|
|
224
|
-
a.value.isLoading = !0, c.value = [];
|
|
225
|
-
try {
|
|
226
|
-
const o = await e({
|
|
227
|
-
limit: n.pageSize || a.value.pageSize,
|
|
228
|
-
skip: n.pageIndex ?? 0,
|
|
229
|
-
sortBy: l.value.key,
|
|
230
|
-
descending: l.value.descending,
|
|
231
|
-
search: a.value.searchValue
|
|
232
|
-
});
|
|
233
|
-
c.value = o.resources, a.value.totalRows = o.meta.totalResources ?? 0, a.value.pageCount = o.meta.totalPages ?? 0, a.value.pageIndex = o.meta.skip ?? 0;
|
|
234
|
-
} catch (o) {
|
|
235
|
-
console.error("Error fetching data:", o);
|
|
236
|
-
} finally {
|
|
237
|
-
a.value.isLoading = !1;
|
|
238
|
-
}
|
|
239
|
-
}, m = O.debounce(async (n) => {
|
|
240
|
-
a.value.pageSize = (n == null ? void 0 : n.pageSize) || a.value.pageSize, await x({
|
|
241
|
-
pageSize: a.value.pageSize,
|
|
242
|
-
pageIndex: (n == null ? void 0 : n.pageIndex) || 0
|
|
243
|
-
});
|
|
244
|
-
}, 200);
|
|
245
|
-
return {
|
|
246
|
-
tableMeta: a,
|
|
247
|
-
rowData: c,
|
|
248
|
-
sortBy: l,
|
|
249
|
-
fetchData: x,
|
|
250
|
-
debouncedFetchData: m,
|
|
251
|
-
onSort: async (n) => {
|
|
252
|
-
var o;
|
|
253
|
-
console.log("sortState", (o = n[0]) == null ? void 0 : o.id), n.length ? (l.value = {
|
|
254
|
-
key: n[0].id.startsWith("_") ? n[0].id : n[0].id.replace(new RegExp("_", "g"), "."),
|
|
255
|
-
descending: n[0].desc
|
|
256
|
-
}, console.log("sortBy", l.value)) : l.value = y, await m();
|
|
257
|
-
},
|
|
258
|
-
onSearch: () => {
|
|
259
|
-
m({ pageIndex: 0, pageSize: a.value.pageSize });
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
export {
|
|
264
|
-
oe as _,
|
|
265
|
-
le as u
|
|
266
|
-
};
|