@feedmepos/mf-connect 0.1.0-beta.7 → 0.1.0-beta.71
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-CnF_WeRZ.js +427 -0
- package/dist/{App-DalxIjTu.js → App-DJwSTuRa.js} +445 -420
- package/dist/AuditLogs-RarW2PHL.js +1886 -0
- package/dist/Bin-BaixTvHW.js +166 -0
- package/dist/{Broadcast-uMAvsC--.js → Broadcast-8DEAMhyM.js} +56 -54
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-JxbENan8.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DPXoOupI.js} +6 -8
- package/dist/Card-DRwLZ-Mn.js +896 -0
- package/dist/Collections-WsPM9v03.js +459 -0
- package/dist/{Credit-QlnatflM.js → Credit-DMxRdTzt.js} +36 -34
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bcj6o4Xi.js +2181 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BE07lc4M.js → EffectSheet.vue_vue_type_style_index_0_lang-CuJ8curT.js} +49 -49
- package/dist/{Experience-Czy41ifp.js → Experience-B0BV4Tc_.js} +32 -30
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
- package/dist/Game-Bu6kJJHx.js +278 -0
- package/dist/Index-CX-aPFQt.js +259 -0
- package/dist/Marketing-CiVFwl6S.js +20071 -0
- package/dist/Member-DZfTtt13.js +333 -0
- package/dist/MemberList-CscwsZnv.js +1598 -0
- package/dist/MemberTransactions-BWNs6bUm.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CtM73bcN.js → MessageInput.vue_vue_type_script_setup_true_lang-BrbRudIU.js} +134 -122
- package/dist/Mission-CyJ-9Qfl.js +296 -0
- package/dist/Overview-DLyt6VId.js +1078 -0
- package/dist/{Point-By6ogYy_.js → Point-Cc_0-RKm.js} +55 -53
- package/dist/Promotion-KqA8nev2.js +289 -0
- package/dist/Queue-i8--zps9.js +249 -0
- package/dist/Record-CLUO1JVc.js +340 -0
- package/dist/Reward-BEdUKQ3M.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B9vnSbWj.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B8zw1TmO.js +1727 -0
- package/dist/Segment-B8sYajZG.js +568 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CmmI5Vwl.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CIcXjbJG.js +186 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DY3FMuIf.js +147 -0
- package/dist/Setting-DT8dRb2A.js +1931 -0
- package/dist/Store-BhsPWRkR.js +1841 -0
- package/dist/StoreRewards-Cx2WDZ3p.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Byb7GOoh.js +1028 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-nEdCD6la.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Cb-FGTO9.js} +1 -1
- package/dist/{Tier-DvAs0-yx.js → Tier-kQy1vGwo.js} +327 -318
- package/dist/{Title-B_Trr39o.js → Title-DKv8FqpX.js} +224 -209
- package/dist/{Transaction-DCJw-b3H.js → Transaction-CSLllOgl.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CvpBdNBn.js +130 -0
- package/dist/Voucher-BP6fmSwu.js +354 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CxQEg_HW.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXkhu8e9.js → ZodTextField.vue_vue_type_script_setup_true_lang-aurdXO2X.js} +1 -1
- package/dist/app-B3qgrQOd.js +7079 -0
- package/dist/app-s3iL79De.js +33357 -0
- package/dist/app.js +1 -1
- package/dist/business-DG2w8U-i.js +79 -0
- package/dist/campaign-BP6Rz-AH.js +1810 -0
- package/dist/{campaign--0_yMbMV.js → campaign-WPRZ4BRF.js} +2 -2
- package/dist/campaign.enum-CoqrWNTZ.js +20 -0
- package/dist/campaign.fn-BRPigTOA.js +758 -0
- package/dist/collectible.enum-Dy4sxF43.js +19 -0
- package/dist/{collection.fn-3TwPe7aF.js → collection.fn-DGnLyYgV.js} +2 -2
- package/dist/dto-xZ9I6-Jr.js +214 -0
- package/dist/{effect-BeR0LK61.js → effect-C0XoYTus.js} +33 -16
- package/dist/email-addresses-CJ87c7W1.js +705 -0
- package/dist/{export-xeLLhqvh.js → export-qlV-AbEl.js} +5 -5
- package/dist/{helper-B5iqfKh8.js → helper-DzYe8aNx.js} +1 -1
- package/dist/{index-BOdtpNkP.js → index-4vdSri7m.js} +266 -173
- package/dist/{index-CU_d8jjU.js → index-BfSj7cUl.js} +1 -1
- package/dist/index-Bj0ULpXi.js +29556 -0
- package/dist/index-BnZ4yaMH.js +115 -0
- package/dist/index-Bo5DJXxs.js +54 -0
- package/dist/{index-Ct_wR519.js → index-BuvJH6SU.js} +24 -21
- package/dist/index-C2GEs8di.js +32 -0
- package/dist/{index-CyKZ-SsN.js → index-CJuOTcCE.js} +1 -1
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-DP-dGMJC.js → index-DReysUPw.js} +2230 -871
- package/dist/{index-CAn5heDe.js → index-DgCjRb3o.js} +48 -4
- package/dist/index-IwITtvVu.js +56 -0
- package/dist/{index-Bh-uaaBG.js → index-n3wiQlbk.js} +1506 -1480
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/{index.esm2017-5jeDA5Zo.js → index.esm2017-CkJhTmme.js} +154 -154
- package/dist/loading-DwJdwl4G.js +71 -0
- package/dist/{membership-D0nqqWNZ.js → membership-DvPK3h8f.js} +54 -46
- package/dist/money-C_WIbr_x.js +15 -0
- package/dist/number-ZeVoGhzP.js +12 -0
- package/dist/objectid-8lkX6otO.js +145 -0
- package/dist/{loading-C-JDVajU.js → plugins-D20keyDW.js} +2990 -3062
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/reward-CqnMEq_w.js +36 -0
- package/dist/{rule-Dn_GgBCe.js → rule-D7htGgWz.js} +185 -178
- package/dist/{rule-builder-BXt29Es4.js → rule-builder-BbJpYQ0n.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-D2Oi3dxP.js → template-BWQCVHm7.js} +5 -5
- package/dist/trigger-DMuv0_O7.js +144 -0
- package/dist/user-C_v2C0qN.js +54 -0
- package/dist/vue-i18n-N8_TEEd0.js +2365 -0
- package/dist/{xlsx-CCRCidY2.js → xlsx-CsPDNSTo.js} +1 -1
- package/package.json +11 -7
- package/dist/Analytic-BMpS6jWb.js +0 -622
- package/dist/Card-DV8-g69L.js +0 -825
- package/dist/Collections-DRafEHT1.js +0 -453
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js +0 -2813
- package/dist/Game-CD3zSitz.js +0 -255
- package/dist/Marketing-NNes8z6Q.js +0 -316
- package/dist/Member-CTqBgYuV.js +0 -69
- package/dist/MemberList-B99tS5ce.js +0 -1733
- package/dist/MemberTransactions-D1YCXPOg.js +0 -38
- package/dist/Mission-XbBVKBiE.js +0 -261
- package/dist/Promotion-DKcBr-RI.js +0 -247
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1ESqEFO.js +0 -1753
- package/dist/Segment-B8cszL-F.js +0 -437
- package/dist/Setting-aZYABlMW.js +0 -1901
- package/dist/Store-Bx2tyJwe.js +0 -1511
- package/dist/StoreRewards-DTp9G6gw.js +0 -401
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2W7ly5Z.js +0 -890
- package/dist/Voucher-jqv3ji90.js +0 -490
- package/dist/app-WlcUVbFb.js +0 -5764
- package/dist/app-_w0hjM7u.js +0 -53428
- package/dist/business-BC4-i1cU.js +0 -78
- package/dist/dto-Ns2dLn1B.js +0 -2770
- package/dist/index-BWb9vRCi.js +0 -29193
- package/dist/index-CpU9aqyW.js +0 -206
- package/dist/index-CqO_ZvtD.js +0 -99
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DsNsA2uX.js +0 -298
- package/dist/index-WAMr3npT.js +0 -762
- package/dist/money-hdbrblud.js +0 -15
- package/dist/number-CRWGOZaW.js +0 -12
- package/dist/user-Bm4KttFq.js +0 -37
- package/dist/vue-i18n-Dud8fvmw.js +0 -2365
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
var oe = Object.defineProperty;
|
|
2
|
-
var te = (f, r, u) => r in f ? oe(f, r, { enumerable: !0, configurable: !0, writable: !0, value: u }) : f[r] = u;
|
|
3
|
-
var $ = (f, r, u) => te(f, typeof r != "symbol" ? r + "" : r, u);
|
|
4
|
-
import { defineComponent as H, ref as p, computed as J, watch as O, resolveComponent as d, openBlock as y, createBlock as T, unref as o, isRef as K, withCtx as I, createElementVNode as b, createVNode as s, createElementBlock as R, Fragment as N, renderList as ae, createCommentVNode as P, onMounted as le, h as S } from "vue";
|
|
5
|
-
import { h as j } from "./moment-BWErdI6_.js";
|
|
6
|
-
import { components as G } from "@feedmepos/ui-library";
|
|
7
|
-
import { u as Q, a as ne } from "./loading-C-JDVajU.js";
|
|
8
|
-
import { J as se } from "./JsonViewer-v8_C7l5N.js";
|
|
9
|
-
import { u as re } from "./app-wDQR6dpb.js";
|
|
10
|
-
import { useRoute as W, useRouter as ie } from "vue-router";
|
|
11
|
-
import { c as A } from "./index-CqO_ZvtD.js";
|
|
12
|
-
import { u as z, w as de } from "./xlsx-CCRCidY2.js";
|
|
13
|
-
import { u as ue, _ as ce } from "./usePagination-BeF5K3M7.js";
|
|
14
|
-
import { m as me } from "./index-CAn5heDe.js";
|
|
15
|
-
import { o as pe } from "./objectId-dwaoBfJX.js";
|
|
16
|
-
const fe = { class: "space-y-16" }, ge = { class: "gap-16 grid grid-cols-2" }, be = { class: "flex items-center gap-8" }, Ce = /* @__PURE__ */ H({
|
|
17
|
-
__name: "CreateCollectionSheet",
|
|
18
|
-
emits: ["success"],
|
|
19
|
-
setup(f, { expose: r, emit: u }) {
|
|
20
|
-
const { minor: F } = Q, k = W(), _ = p(), B = p(!1), E = u, g = p(!1);
|
|
21
|
-
function q(t) {
|
|
22
|
-
g.value = t, t && (l.value = {
|
|
23
|
-
quantity: 1,
|
|
24
|
-
code: "",
|
|
25
|
-
codeConfig: {
|
|
26
|
-
length: 8,
|
|
27
|
-
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
28
|
-
prefix: "",
|
|
29
|
-
suffix: "",
|
|
30
|
-
pattern: "########"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const l = p({
|
|
35
|
-
quantity: 1,
|
|
36
|
-
code: "",
|
|
37
|
-
codeConfig: {
|
|
38
|
-
length: 8,
|
|
39
|
-
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
40
|
-
prefix: "",
|
|
41
|
-
suffix: "",
|
|
42
|
-
pattern: "########"
|
|
43
|
-
}
|
|
44
|
-
}), D = [
|
|
45
|
-
{
|
|
46
|
-
label: "Bulk codes",
|
|
47
|
-
value: "bulk",
|
|
48
|
-
sublabel: "Bulk generate unique codes"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: "Custom code",
|
|
52
|
-
value: "single",
|
|
53
|
-
sublabel: "Enter your own custom codes"
|
|
54
|
-
}
|
|
55
|
-
], U = [
|
|
56
|
-
{
|
|
57
|
-
label: "Alphanumeric",
|
|
58
|
-
value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
label: "Alphabetic",
|
|
62
|
-
value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
63
|
-
},
|
|
64
|
-
{ label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
|
|
65
|
-
{ label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
|
66
|
-
{ label: "Numbers", value: "0123456789" },
|
|
67
|
-
{ label: "Custom", value: "" }
|
|
68
|
-
], C = p(U[0].value), c = p("bulk"), h = p(!1), M = J(() => k.params.id);
|
|
69
|
-
async function n(t) {
|
|
70
|
-
var e;
|
|
71
|
-
await ((e = _.value) == null ? void 0 : e.validateInputs()), B.value && await F(
|
|
72
|
-
async () => {
|
|
73
|
-
await A.createCollectionByCampaignId(M.value, t), await E("success");
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
message: "Creating claim(s)",
|
|
77
|
-
successMessage: "Claim(s) created"
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
return r({
|
|
82
|
-
showSheet: q
|
|
83
|
-
}), O(
|
|
84
|
-
() => c.value,
|
|
85
|
-
(t, e) => {
|
|
86
|
-
e != t && (l.value.code = "", l.value.codeConfig.length = 8, l.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", l.value.codeConfig.prefix = "", l.value.codeConfig.suffix = "", l.value.codeConfig.pattern = "########");
|
|
87
|
-
}
|
|
88
|
-
), O(
|
|
89
|
-
() => l.value.codeConfig.length,
|
|
90
|
-
(t, e) => {
|
|
91
|
-
t != e && (l.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(t))));
|
|
92
|
-
}
|
|
93
|
-
), (t, e) => {
|
|
94
|
-
const v = d("FmRadio"), i = d("FmRadioGroup"), V = d("FmSwitch"), L = d("FmStepperField"), w = d("FmSelect"), x = d("FmTextField"), X = d("FmTextarea"), Z = d("FmForm"), Y = d("FmButton"), ee = d("FmSideSheet");
|
|
95
|
-
return y(), T(ee, {
|
|
96
|
-
"max-width": 560,
|
|
97
|
-
"dismiss-away": !0,
|
|
98
|
-
header: "Create collection",
|
|
99
|
-
modelValue: o(g),
|
|
100
|
-
"onUpdate:modelValue": [
|
|
101
|
-
e[14] || (e[14] = (a) => K(g) ? g.value = a : null),
|
|
102
|
-
e[15] || (e[15] = (a) => g.value = a)
|
|
103
|
-
]
|
|
104
|
-
}, {
|
|
105
|
-
"side-sheet-footer": I(() => [
|
|
106
|
-
b("div", be, [
|
|
107
|
-
s(Y, {
|
|
108
|
-
label: "Save",
|
|
109
|
-
onClick: e[12] || (e[12] = (a) => n(o(l))),
|
|
110
|
-
loading: o(re)().isLoading
|
|
111
|
-
}, null, 8, ["loading"]),
|
|
112
|
-
s(Y, {
|
|
113
|
-
label: "Cancel",
|
|
114
|
-
type: "button",
|
|
115
|
-
variant: "tertiary",
|
|
116
|
-
onClick: e[13] || (e[13] = (a) => g.value = !1)
|
|
117
|
-
})
|
|
118
|
-
])
|
|
119
|
-
]),
|
|
120
|
-
default: I(() => [
|
|
121
|
-
s(se, { json: o(l) }, null, 8, ["json"]),
|
|
122
|
-
s(Z, {
|
|
123
|
-
ref_key: "form",
|
|
124
|
-
ref: _,
|
|
125
|
-
class: "space-y-40",
|
|
126
|
-
onValidationSuccess: e[10] || (e[10] = (a) => B.value = !0),
|
|
127
|
-
onValidationFailed: e[11] || (e[11] = (a) => B.value = !1)
|
|
128
|
-
}, {
|
|
129
|
-
default: I(() => [
|
|
130
|
-
b("div", null, [
|
|
131
|
-
e[16] || (e[16] = b("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
|
|
132
|
-
s(i, {
|
|
133
|
-
modelValue: o(c),
|
|
134
|
-
"onUpdate:modelValue": e[0] || (e[0] = (a) => K(c) ? c.value = a : null),
|
|
135
|
-
inline: !1
|
|
136
|
-
}, {
|
|
137
|
-
default: I(() => [
|
|
138
|
-
(y(), R(N, null, ae(D, (a) => s(v, {
|
|
139
|
-
key: a.value,
|
|
140
|
-
value: a.value,
|
|
141
|
-
label: a.label,
|
|
142
|
-
sublabel: a.sublabel
|
|
143
|
-
}, null, 8, ["value", "label", "sublabel"])), 64))
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
}, 8, ["modelValue"])
|
|
147
|
-
]),
|
|
148
|
-
b("div", fe, [
|
|
149
|
-
e[17] || (e[17] = b("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
|
|
150
|
-
o(c) === "bulk" ? (y(), R(N, { key: 0 }, [
|
|
151
|
-
s(V, {
|
|
152
|
-
"model-value": o(h),
|
|
153
|
-
"label-placement": "right",
|
|
154
|
-
value: "true",
|
|
155
|
-
label: "Advance code setting",
|
|
156
|
-
required: !0,
|
|
157
|
-
"onUpdate:modelValue": e[1] || (e[1] = () => h.value = !o(h))
|
|
158
|
-
}, null, 8, ["model-value"]),
|
|
159
|
-
o(h) ? (y(), R(N, { key: 0 }, [
|
|
160
|
-
s(L, {
|
|
161
|
-
modelValue: o(l).codeConfig.length,
|
|
162
|
-
"onUpdate:modelValue": e[2] || (e[2] = (a) => o(l).codeConfig.length = a),
|
|
163
|
-
label: "Code length",
|
|
164
|
-
max: 16,
|
|
165
|
-
min: 1,
|
|
166
|
-
rules: [
|
|
167
|
-
(a) => Number(a) >= 1 || "Code length must at least 1",
|
|
168
|
-
(a) => Number(a) <= 16 || "Code length must less than 16"
|
|
169
|
-
],
|
|
170
|
-
required: !0
|
|
171
|
-
}, null, 8, ["modelValue", "rules"]),
|
|
172
|
-
s(w, {
|
|
173
|
-
label: "Charset",
|
|
174
|
-
"model-value": o(C),
|
|
175
|
-
items: U,
|
|
176
|
-
"helper-text": o(l).codeConfig.charset.length > 62 ? `${o(l).codeConfig.charset.substring(0, 62)}...` : o(l).codeConfig.charset,
|
|
177
|
-
"onUpdate:modelValue": e[3] || (e[3] = (a) => {
|
|
178
|
-
C.value = a, o(l).codeConfig.charset = a;
|
|
179
|
-
})
|
|
180
|
-
}, null, 8, ["model-value", "helper-text"]),
|
|
181
|
-
o(C) === "" ? (y(), T(x, {
|
|
182
|
-
key: 0,
|
|
183
|
-
modelValue: o(l).codeConfig.charset,
|
|
184
|
-
"onUpdate:modelValue": e[4] || (e[4] = (a) => o(l).codeConfig.charset = a),
|
|
185
|
-
label: "Custom Charset",
|
|
186
|
-
required: ""
|
|
187
|
-
}, null, 8, ["modelValue"])) : P("", !0),
|
|
188
|
-
b("div", ge, [
|
|
189
|
-
s(x, {
|
|
190
|
-
modelValue: o(l).codeConfig.prefix,
|
|
191
|
-
"onUpdate:modelValue": e[5] || (e[5] = (a) => o(l).codeConfig.prefix = a),
|
|
192
|
-
label: "Prefix (Optional)"
|
|
193
|
-
}, null, 8, ["modelValue"]),
|
|
194
|
-
s(x, {
|
|
195
|
-
modelValue: o(l).codeConfig.suffix,
|
|
196
|
-
"onUpdate:modelValue": e[6] || (e[6] = (a) => o(l).codeConfig.suffix = a),
|
|
197
|
-
label: "Suffix (Optional)"
|
|
198
|
-
}, null, 8, ["modelValue"])
|
|
199
|
-
]),
|
|
200
|
-
s(x, {
|
|
201
|
-
modelValue: o(l).codeConfig.pattern,
|
|
202
|
-
"onUpdate:modelValue": e[7] || (e[7] = (a) => o(l).codeConfig.pattern = a),
|
|
203
|
-
label: "Pattern",
|
|
204
|
-
required: !0
|
|
205
|
-
}, null, 8, ["modelValue"])
|
|
206
|
-
], 64)) : P("", !0),
|
|
207
|
-
s(x, {
|
|
208
|
-
modelValue: o(l).quantity,
|
|
209
|
-
"onUpdate:modelValue": e[8] || (e[8] = (a) => o(l).quantity = a),
|
|
210
|
-
label: "Number of code",
|
|
211
|
-
rules: [
|
|
212
|
-
(a) => a >= 1 || "Quantity cannot be less than 1",
|
|
213
|
-
(a) => a <= 1e4 || "Quantity cannot more than 10,000"
|
|
214
|
-
],
|
|
215
|
-
required: !0,
|
|
216
|
-
"helper-text": `${o(l).quantity} claim will be created`
|
|
217
|
-
}, null, 8, ["modelValue", "rules", "helper-text"])
|
|
218
|
-
], 64)) : P("", !0),
|
|
219
|
-
o(c) !== "bulk" ? (y(), T(X, {
|
|
220
|
-
key: 1,
|
|
221
|
-
modelValue: o(l).code,
|
|
222
|
-
"onUpdate:modelValue": e[9] || (e[9] = (a) => o(l).code = a),
|
|
223
|
-
label: "Custom Code",
|
|
224
|
-
rules: [(a) => o(c) != "single" || !!a || "Custom code is required"],
|
|
225
|
-
placeholder: "(For multiple codes, please enter in the new row.)"
|
|
226
|
-
}, null, 8, ["modelValue", "rules"])) : P("", !0)
|
|
227
|
-
])
|
|
228
|
-
]),
|
|
229
|
-
_: 1
|
|
230
|
-
}, 512)
|
|
231
|
-
]),
|
|
232
|
-
_: 1
|
|
233
|
-
}, 8, ["modelValue"]);
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
class ve {
|
|
238
|
-
constructor() {
|
|
239
|
-
$(this, "data", []);
|
|
240
|
-
}
|
|
241
|
-
addRecord(r) {
|
|
242
|
-
this.data.push(r);
|
|
243
|
-
}
|
|
244
|
-
buildExcel() {
|
|
245
|
-
const r = z.book_new(), u = z.json_to_sheet(this.data);
|
|
246
|
-
return z.book_append_sheet(r, u, "Collection"), r;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
const m = {
|
|
250
|
-
sortBy: "_id",
|
|
251
|
-
descending: !1,
|
|
252
|
-
rowsPerPage: 1e3,
|
|
253
|
-
page: 1,
|
|
254
|
-
rowsNumber: 0
|
|
255
|
-
}, xe = { class: "px-24 flex flex-col gap-y-32 pb-24" }, ye = { class: "flex items-center justify-end py-4 xs:hidden" }, Ae = /* @__PURE__ */ H({
|
|
256
|
-
__name: "Collections",
|
|
257
|
-
setup(f) {
|
|
258
|
-
const r = ie(), u = W(), F = p(), k = J(() => u.params.id), _ = p(!1), { custom: B } = Q, E = [
|
|
259
|
-
{
|
|
260
|
-
header: "ID/Code",
|
|
261
|
-
accessorKey: "_id",
|
|
262
|
-
cell(n) {
|
|
263
|
-
return S("div", { class: "flex items-center" }, [
|
|
264
|
-
S(G.FmIcon, {
|
|
265
|
-
name: "content_copy",
|
|
266
|
-
outline: !0,
|
|
267
|
-
size: "sm",
|
|
268
|
-
class: "cursor-pointer mr-4",
|
|
269
|
-
onClick: (t) => {
|
|
270
|
-
t.preventDefault(), t.stopPropagation(), ne(
|
|
271
|
-
n.row.original.code || n.row.original._id.toString()
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
}),
|
|
275
|
-
S(
|
|
276
|
-
"div",
|
|
277
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
278
|
-
n.row.original.code || n.row.original._id.toString()
|
|
279
|
-
)
|
|
280
|
-
]);
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
header: "User",
|
|
285
|
-
accessorKey: "user",
|
|
286
|
-
enableSorting: !1,
|
|
287
|
-
cell(n) {
|
|
288
|
-
const t = n.row.original.pf_user;
|
|
289
|
-
return S(
|
|
290
|
-
"div",
|
|
291
|
-
{
|
|
292
|
-
class: "flex items-center gap-x-8"
|
|
293
|
-
},
|
|
294
|
-
[
|
|
295
|
-
S(G.FmAvatar, {
|
|
296
|
-
name: t != null && t.photoUrl || t == null ? void 0 : t.name,
|
|
297
|
-
src: (t == null ? void 0 : t.photoUrl) ?? void 0,
|
|
298
|
-
size: "sm"
|
|
299
|
-
}),
|
|
300
|
-
S("span", t == null ? void 0 : t.name)
|
|
301
|
-
]
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
header: "Phone",
|
|
307
|
-
accessorFn: (n) => {
|
|
308
|
-
var t;
|
|
309
|
-
return ((t = n.pf_user) == null ? void 0 : t.phoneNumber) || "-";
|
|
310
|
-
},
|
|
311
|
-
accessorKey: "pf_user.phoneNumber"
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
header: "Balance",
|
|
315
|
-
accessorKey: "balance"
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
header: "Created at",
|
|
319
|
-
accessorKey: "_id",
|
|
320
|
-
accessorFn: (n) => j(pe(n._id.toString())).format("DD MMM YYYY")
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
header: "Nearest expired at",
|
|
324
|
-
accessorKey: "expiryBalance",
|
|
325
|
-
accessorFn: (n) => {
|
|
326
|
-
var t;
|
|
327
|
-
return n.expiryBalance && n.expiryBalance.length ? j((t = n.expiryBalance) == null ? void 0 : t[0].expiredAt).format("DD MMM YYYY") : "Never expires";
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
], g = {
|
|
331
|
-
"$connect-STORE_REWARD_COLLECTIONS": me.readCollectionsByRewardId,
|
|
332
|
-
"$connect-CAMPAIGN_VOUCHER_COLLECTIONS": A.readCollectionsByCampaignId
|
|
333
|
-
}, q = (n) => {
|
|
334
|
-
const t = g[u.name];
|
|
335
|
-
return (e) => t(n, e);
|
|
336
|
-
}, { tableMeta: l, rowData: D, onSort: U, debouncedFetchData: C, onSearch: c } = ue(q(k.value));
|
|
337
|
-
async function h() {
|
|
338
|
-
var n;
|
|
339
|
-
await C(), (n = F.value) == null || n.showSheet(!1);
|
|
340
|
-
}
|
|
341
|
-
async function M() {
|
|
342
|
-
_.value || B(
|
|
343
|
-
async () => {
|
|
344
|
-
var v;
|
|
345
|
-
const n = new ve(), t = (await A.readCollectionsByCampaignId(k.value, {
|
|
346
|
-
limit: 1,
|
|
347
|
-
skip: 0,
|
|
348
|
-
sortBy: m.sortBy,
|
|
349
|
-
descending: m.descending
|
|
350
|
-
})).meta.totalResources ?? 0, e = m.rowsPerPage;
|
|
351
|
-
for (let i = 0; i < t; i += e) {
|
|
352
|
-
const V = {
|
|
353
|
-
...m,
|
|
354
|
-
limit: e,
|
|
355
|
-
skip: (m.page - 1) * m.rowsPerPage,
|
|
356
|
-
sortBy: m.sortBy,
|
|
357
|
-
descending: m.descending
|
|
358
|
-
}, L = await A.readCollectionsByCampaignId(
|
|
359
|
-
k.value,
|
|
360
|
-
V
|
|
361
|
-
);
|
|
362
|
-
for await (const w of L.resources) {
|
|
363
|
-
const x = {
|
|
364
|
-
Id: (w == null ? void 0 : w.code) || ((v = w._id) == null ? void 0 : v.toString()) || ""
|
|
365
|
-
};
|
|
366
|
-
n.addRecord(x);
|
|
367
|
-
}
|
|
368
|
-
m.page++;
|
|
369
|
-
}
|
|
370
|
-
await de(
|
|
371
|
-
n.buildExcel(),
|
|
372
|
-
`members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
373
|
-
{
|
|
374
|
-
bookType: "xlsx",
|
|
375
|
-
bookSST: !1,
|
|
376
|
-
type: "array"
|
|
377
|
-
}
|
|
378
|
-
), m.page = 1;
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
isLoading: _
|
|
382
|
-
}
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
return le(async () => {
|
|
386
|
-
await C();
|
|
387
|
-
}), (n, t) => {
|
|
388
|
-
const e = d("FmPageHead"), v = d("FmSearch");
|
|
389
|
-
return y(), R(N, null, [
|
|
390
|
-
s(e, {
|
|
391
|
-
title: "Collections",
|
|
392
|
-
"back-button": !0,
|
|
393
|
-
actions: [
|
|
394
|
-
{ label: "Export", value: "export", isPrimary: !1 },
|
|
395
|
-
{
|
|
396
|
-
label: "Create collection",
|
|
397
|
-
value: "create",
|
|
398
|
-
isPrimary: !0
|
|
399
|
-
}
|
|
400
|
-
],
|
|
401
|
-
"onClick:back": t[0] || (t[0] = (i) => o(r).back()),
|
|
402
|
-
"onClick:action": t[1] || (t[1] = (i) => {
|
|
403
|
-
var V;
|
|
404
|
-
i === "create" && ((V = o(F)) == null || V.showSheet(!0)), i === "export" && M();
|
|
405
|
-
})
|
|
406
|
-
}),
|
|
407
|
-
b("div", xe, [
|
|
408
|
-
s(v, {
|
|
409
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
410
|
-
modelValue: o(l).searchValue,
|
|
411
|
-
"onUpdate:modelValue": [
|
|
412
|
-
t[2] || (t[2] = (i) => o(l).searchValue = i),
|
|
413
|
-
o(c)
|
|
414
|
-
],
|
|
415
|
-
placeholder: "Search",
|
|
416
|
-
collapsible: ""
|
|
417
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
418
|
-
b("div", ye, [
|
|
419
|
-
s(v, {
|
|
420
|
-
modelValue: o(l).searchValue,
|
|
421
|
-
"onUpdate:modelValue": [
|
|
422
|
-
t[3] || (t[3] = (i) => o(l).searchValue = i),
|
|
423
|
-
o(c)
|
|
424
|
-
],
|
|
425
|
-
placeholder: "Search",
|
|
426
|
-
collapsible: ""
|
|
427
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
428
|
-
]),
|
|
429
|
-
s(ce, {
|
|
430
|
-
loading: o(l).isLoading,
|
|
431
|
-
"row-data": o(D),
|
|
432
|
-
"column-defs": E,
|
|
433
|
-
"row-count": o(l).totalRows,
|
|
434
|
-
"page-count": o(l).pageCount,
|
|
435
|
-
"page-index": o(l).pageIndex,
|
|
436
|
-
"page-size": o(l).pageSize,
|
|
437
|
-
"shrink-at": !1,
|
|
438
|
-
onSortChange: o(U),
|
|
439
|
-
onPageChange: t[4] || (t[4] = (i) => o(C)({ pageSize: i.pageSize, pageIndex: i.pageIndex }))
|
|
440
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
441
|
-
s(Ce, {
|
|
442
|
-
ref_key: "sheetRef",
|
|
443
|
-
ref: F,
|
|
444
|
-
onSuccess: h
|
|
445
|
-
}, null, 512)
|
|
446
|
-
])
|
|
447
|
-
], 64);
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
|
-
export {
|
|
452
|
-
Ae as default
|
|
453
|
-
};
|