@feedmepos/mf-connect 0.1.13-prod → 0.1.15-prod
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-CBEDTJ94.js → Analytic-C7qqDS5D.js} +18 -17
- package/dist/{App-BcrQs0nE.js → App-DKZYz5r2.js} +68 -64
- package/dist/Bin-U7U1Vaju.js +165 -0
- package/dist/{Broadcast-ClM81ght.js → Broadcast-BzChnp4V.js} +38 -37
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CTwScH9I.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BELIbS3v.js} +6 -7
- package/dist/{Card-B7_nUT03.js → Card-DAfZz7q5.js} +78 -79
- package/dist/Collections-joGRHyag.js +445 -0
- package/dist/{Credit-DC6pzGIR.js → Credit-N1qDB4XC.js} +57 -56
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCwaUg09.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-J95iaF7a.js} +27 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D2qCLBp3.js → EffectSheet.vue_vue_type_style_index_0_lang-DwzQSmst.js} +8 -8
- package/dist/{Experience-ClJWQLEB.js → Experience-D5GrDbft.js} +39 -38
- package/dist/{Game-BznCxZXt.js → Game-DI7BDPO_.js} +46 -45
- package/dist/{Index-D27v-Lqw.js → Index-CbuAJ2dE.js} +9 -9
- package/dist/{Marketing-FvYJ_Lt-.js → Marketing-BSqMfy70.js} +5 -5
- package/dist/{Member-CQYj0FQK.js → Member-CGd5wNHJ.js} +4 -4
- package/dist/MemberList-DnS8KHYF.js +1596 -0
- package/dist/MemberTransactions-GAAX3aSV.js +45 -0
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-_72tx6g3.js → MessageInput.vue_vue_type_script_setup_true_lang-Bc2wcibo.js} +5 -5
- package/dist/{Mission-LwSpobZu.js → Mission-BVM_1IJ8.js} +35 -34
- package/dist/{Overview-PXshmkPD.js → Overview-D2IYZCPn.js} +62 -63
- package/dist/{Point-uaIRQMRW.js → Point-B684quZM.js} +51 -50
- package/dist/{Promotion-qjos6ksl.js → Promotion-DJOoRnxt.js} +34 -33
- package/dist/{Record-qqPaVdrx.js → Record-Bk74XVUj.js} +6 -6
- package/dist/{Reward-BC6GJ4kD.js → Reward-BM0AGGL6.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CF7hNZIU.js → RewardGroup.vue_vue_type_script_setup_true_lang-CuA2D52B.js} +12 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DQ8rQIwv.js → RuleGroup.vue_vue_type_script_setup_true_lang-Cxv3cZ1v.js} +14 -15
- package/dist/{Segment-B5E2FdYc.js → Segment-DqOsH95n.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dqz3uAze.js → SelectItems.vue_vue_type_script_setup_true_lang-ypjkVZkZ.js} +2 -2
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Qo0aOTI9.js +147 -0
- package/dist/{Setting-CA9PQVKp.js → Setting-D6cRTVUl.js} +31 -31
- package/dist/{Store-irRFotGI.js → Store-DqtUurcv.js} +295 -293
- package/dist/{StoreRewards-CcJ8MMvp.js → StoreRewards-DPFMA3p9.js} +12 -12
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CYqo5att.js +1105 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-2i2fDWDC.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DxEV-6_4.js} +1 -1
- package/dist/{Tier-CdxK-QtB.js → Tier-CFd-HaGX.js} +20 -21
- package/dist/{Title-Ci_NXdrD.js → Title-CBktBb5l.js} +20 -21
- package/dist/{Transaction-ChKg7UTd.js → Transaction-Bb8UU_lj.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B3INK4Ue.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DBiUmz3C.js} +6 -6
- package/dist/Voucher-Bukem4U7.js +353 -0
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-D9wqrTVc.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CTbqVMCn.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Di6QPzfu.js → ZodTextField.vue_vue_type_script_setup_true_lang-D8zMv7ks.js} +1 -1
- package/dist/{app-B9MkUjRo.js → app-BL2xIPMp.js} +102 -66
- package/dist/{app-BmT3kZJr.js → app-CO6FVdHg.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-1nKmKs9l.js → business-BMTDDe8v.js} +1 -1
- package/dist/{dto-DP9kIlr_.js → campaign-C5TEfnWg.js} +610 -818
- package/dist/{campaign-xn4PhDSV.js → campaign-CzpECNqa.js} +2 -2
- package/dist/{campaign.enum-KwZQ6yBR.js → campaign.enum-CVF3KbJ2.js} +1 -1
- package/dist/{campaign.fn-CVj38fae.js → campaign.fn-WT1gfEwK.js} +2 -2
- package/dist/{collectible.enum-DojcTb50.js → collectible.enum-BW7-BEa-.js} +3 -3
- package/dist/{collection.fn-Bv2EZuA3.js → collection.fn-BRsC9uPP.js} +2 -2
- package/dist/dto-B1tWHAjt.js +214 -0
- package/dist/{effect-47JS4i8Q.js → effect-4Ov4Jl68.js} +1 -1
- package/dist/{email-addresses-C6Jvh8MK.js → email-addresses-L25192f3.js} +1 -1
- package/dist/{export-BdPv7Hej.js → export-UEJjaL0g.js} +5 -5
- package/dist/{helper-Di0AEV1F.js → helper-BNBSbgdl.js} +1 -1
- package/dist/{index-BPkcvPHp.js → index-BWY2o9U9.js} +1 -1
- package/dist/index-BnWjqXOJ.js +115 -0
- package/dist/{index-D5LMqy6S.js → index-BxwVs3Ot.js} +29 -4
- package/dist/index-Cg64BkVG.js +44 -0
- package/dist/{index-DHb0pIVR.js → index-ChKwu49G.js} +6 -6
- package/dist/{index-Be9fjCVp.js → index-CtY-c-yc.js} +1 -1
- package/dist/{index-CVsuhUpe.js → index-D4iYmdD4.js} +12 -13
- package/dist/{index-YAoPUv6z.js → index-D8Qn3ZjQ.js} +1 -1
- package/dist/{index-gYvuI9Nk.js → index-DpCBCiH_.js} +5 -5
- package/dist/{index-BZg5tj39.js → index-DxjXJh5H.js} +3039 -3036
- package/dist/{index-BUjGxHkM.js → index-fdv6AHmk.js} +2057 -1010
- package/dist/{index-CDmiwLKd.js → index-jf1CG6wc.js} +1 -1
- package/dist/{index.esm2017-C-O-0X0H.js → index.esm2017-D-3LEGru.js} +1 -1
- package/dist/{loading-E0zwe5lq.js → loading-CUp8ZsA0.js} +4 -4
- package/dist/{membership-OECc9rWj.js → membership-DwbiFGd7.js} +6 -6
- package/dist/{money-CVSdH00t.js → money-BLrbHrdQ.js} +1 -1
- package/dist/{number-Iu6cix1k.js → number--bZt83Nn.js} +1 -1
- package/dist/objectid-CCGQh_Y_.js +145 -0
- package/dist/{reward-BH_1xbHQ.js → reward-D99cFWcD.js} +1 -1
- package/dist/{rule-CbkzOdR3.js → rule-UpH1Y1i5.js} +3 -3
- package/dist/{rule-builder-WIEeIoXD.js → rule-builder-ujLy6UTt.js} +1 -1
- package/dist/{template-Dlo0YPQp.js → template-FiuUP37O.js} +4 -4
- package/dist/{trigger-BMknrXKj.js → trigger-BZYtwSky.js} +13 -13
- package/dist/{usePagination-B9K_XXDC.js → usePagination-DDW-s6D3.js} +1 -1
- package/dist/{user-CuX5BIg5.js → user-BA3Sw5dU.js} +1 -1
- package/dist/{vue-i18n-CrVlAF7z.js → vue-i18n-C5t_xZZj.js} +2 -2
- package/package.json +6 -6
- package/dist/Collections-N7LIfZ2D.js +0 -435
- package/dist/MemberList-UIZANV1T.js +0 -1043
- package/dist/MemberTransactions-JKLzrvh6.js +0 -38
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CcNjdcMX.js +0 -1132
- package/dist/Voucher-CDlHku1x.js +0 -490
- package/dist/index-CPjDZrsE.js +0 -99
- package/dist/index-Dd0IgwOF.js +0 -1051
- package/dist/objectid-B16Lk1pC.js +0 -145
|
@@ -1,435 +0,0 @@
|
|
|
1
|
-
var ee = Object.defineProperty;
|
|
2
|
-
var oe = (f, r, d) => r in f ? ee(f, r, { enumerable: !0, configurable: !0, writable: !0, value: d }) : f[r] = d;
|
|
3
|
-
var z = (f, r, d) => oe(f, typeof r != "symbol" ? r + "" : r, d);
|
|
4
|
-
import { defineComponent as G, ref as p, computed as H, watch as O, resolveComponent as u, openBlock as y, createBlock as L, unref as e, isRef as K, withCtx as I, createElementVNode as b, createVNode as s, createElementBlock as R, Fragment as P, renderList as te, createCommentVNode as U, onMounted as ae, h as T } from "vue";
|
|
5
|
-
import { h as j } from "./moment-BWErdI6_.js";
|
|
6
|
-
import { components as le } from "@feedmepos/ui-library";
|
|
7
|
-
import { u as J, a as ne } from "./loading-E0zwe5lq.js";
|
|
8
|
-
import { J as se } from "./JsonViewer-v8_C7l5N.js";
|
|
9
|
-
import { u as re } from "./app-wDQR6dpb.js";
|
|
10
|
-
import { useRoute as Q, useRouter as ie } from "vue-router";
|
|
11
|
-
import { c as N } from "./index-CPjDZrsE.js";
|
|
12
|
-
import { e as m } from "./index-vh86FiIQ.js";
|
|
13
|
-
import { u as Y, a as ue, _ as de, w as ce } from "./usePagination-B9K_XXDC.js";
|
|
14
|
-
import { g as me } from "./user-CuX5BIg5.js";
|
|
15
|
-
import { m as pe } from "./index-D5LMqy6S.js";
|
|
16
|
-
import { o as fe } from "./objectId-dwaoBfJX.js";
|
|
17
|
-
const ge = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1), be = { class: "space-y-16" }, Ce = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1), ve = { class: "gap-16 grid grid-cols-2" }, he = { class: "flex items-center gap-8" }, ye = /* @__PURE__ */ G({
|
|
18
|
-
__name: "CreateCollectionSheet",
|
|
19
|
-
emits: ["success"],
|
|
20
|
-
setup(f, { expose: r, emit: d }) {
|
|
21
|
-
const { minor: w } = J, F = Q(), k = p(), _ = p(!1), E = d, g = p(!1);
|
|
22
|
-
function q(l) {
|
|
23
|
-
g.value = l, l && (a.value = {
|
|
24
|
-
quantity: 1,
|
|
25
|
-
code: "",
|
|
26
|
-
codeConfig: {
|
|
27
|
-
length: 8,
|
|
28
|
-
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
29
|
-
prefix: "",
|
|
30
|
-
suffix: "",
|
|
31
|
-
pattern: "########"
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
const a = p({
|
|
36
|
-
quantity: 1,
|
|
37
|
-
code: "",
|
|
38
|
-
codeConfig: {
|
|
39
|
-
length: 8,
|
|
40
|
-
charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
41
|
-
prefix: "",
|
|
42
|
-
suffix: "",
|
|
43
|
-
pattern: "########"
|
|
44
|
-
}
|
|
45
|
-
}), A = [
|
|
46
|
-
{
|
|
47
|
-
label: "Bulk codes",
|
|
48
|
-
value: "bulk",
|
|
49
|
-
sublabel: "Bulk generate unique codes"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: "Custom code",
|
|
53
|
-
value: "single",
|
|
54
|
-
sublabel: "Enter your own custom codes"
|
|
55
|
-
}
|
|
56
|
-
], B = [
|
|
57
|
-
{
|
|
58
|
-
label: "Alphanumeric",
|
|
59
|
-
value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: "Alphabetic",
|
|
63
|
-
value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
64
|
-
},
|
|
65
|
-
{ label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
|
|
66
|
-
{ label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
|
67
|
-
{ label: "Numbers", value: "0123456789" },
|
|
68
|
-
{ label: "Custom", value: "" }
|
|
69
|
-
], C = p(B[0].value), c = p("bulk"), x = p(!1), D = H(() => F.params.id);
|
|
70
|
-
async function n(l) {
|
|
71
|
-
var o;
|
|
72
|
-
await ((o = k.value) == null ? void 0 : o.validateInputs()), _.value && await w(
|
|
73
|
-
async () => {
|
|
74
|
-
await N.createCollectionByCampaignId(D.value, l), await E("success");
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
message: "Creating claim(s)",
|
|
78
|
-
successMessage: "Claim(s) created"
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
return r({
|
|
83
|
-
showSheet: q
|
|
84
|
-
}), O(
|
|
85
|
-
() => c.value,
|
|
86
|
-
(l, o) => {
|
|
87
|
-
o != l && (a.value.code = "", a.value.codeConfig.length = 8, a.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a.value.codeConfig.prefix = "", a.value.codeConfig.suffix = "", a.value.codeConfig.pattern = "########");
|
|
88
|
-
}
|
|
89
|
-
), O(
|
|
90
|
-
() => a.value.codeConfig.length,
|
|
91
|
-
(l, o) => {
|
|
92
|
-
l != o && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(l))));
|
|
93
|
-
}
|
|
94
|
-
), (l, o) => {
|
|
95
|
-
const v = u("FmRadio"), i = u("FmRadioGroup"), V = u("FmSwitch"), M = u("FmStepperField"), S = u("FmSelect"), h = u("FmTextField"), W = u("FmTextarea"), X = u("FmForm"), $ = u("FmButton"), Z = u("FmSideSheet");
|
|
96
|
-
return y(), L(Z, {
|
|
97
|
-
"max-width": 560,
|
|
98
|
-
"dismiss-away": !0,
|
|
99
|
-
header: "Create collection",
|
|
100
|
-
modelValue: e(g),
|
|
101
|
-
"onUpdate:modelValue": [
|
|
102
|
-
o[14] || (o[14] = (t) => K(g) ? g.value = t : null),
|
|
103
|
-
o[15] || (o[15] = (t) => g.value = t)
|
|
104
|
-
]
|
|
105
|
-
}, {
|
|
106
|
-
"side-sheet-footer": I(() => [
|
|
107
|
-
b("div", he, [
|
|
108
|
-
s($, {
|
|
109
|
-
label: "Save",
|
|
110
|
-
onClick: o[12] || (o[12] = (t) => n(e(a))),
|
|
111
|
-
loading: e(re)().isLoading
|
|
112
|
-
}, null, 8, ["loading"]),
|
|
113
|
-
s($, {
|
|
114
|
-
label: "Cancel",
|
|
115
|
-
type: "button",
|
|
116
|
-
variant: "tertiary",
|
|
117
|
-
onClick: o[13] || (o[13] = (t) => g.value = !1)
|
|
118
|
-
})
|
|
119
|
-
])
|
|
120
|
-
]),
|
|
121
|
-
default: I(() => [
|
|
122
|
-
s(se, { json: e(a) }, null, 8, ["json"]),
|
|
123
|
-
s(X, {
|
|
124
|
-
ref_key: "form",
|
|
125
|
-
ref: k,
|
|
126
|
-
class: "space-y-40",
|
|
127
|
-
onValidationSuccess: o[10] || (o[10] = (t) => _.value = !0),
|
|
128
|
-
onValidationFailed: o[11] || (o[11] = (t) => _.value = !1)
|
|
129
|
-
}, {
|
|
130
|
-
default: I(() => [
|
|
131
|
-
b("div", null, [
|
|
132
|
-
ge,
|
|
133
|
-
s(i, {
|
|
134
|
-
modelValue: e(c),
|
|
135
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) => K(c) ? c.value = t : null),
|
|
136
|
-
inline: !1
|
|
137
|
-
}, {
|
|
138
|
-
default: I(() => [
|
|
139
|
-
(y(), R(P, null, te(A, (t) => s(v, {
|
|
140
|
-
key: t.value,
|
|
141
|
-
value: t.value,
|
|
142
|
-
label: t.label,
|
|
143
|
-
sublabel: t.sublabel
|
|
144
|
-
}, null, 8, ["value", "label", "sublabel"])), 64))
|
|
145
|
-
]),
|
|
146
|
-
_: 1
|
|
147
|
-
}, 8, ["modelValue"])
|
|
148
|
-
]),
|
|
149
|
-
b("div", be, [
|
|
150
|
-
Ce,
|
|
151
|
-
e(c) === "bulk" ? (y(), R(P, { key: 0 }, [
|
|
152
|
-
s(V, {
|
|
153
|
-
"model-value": e(x),
|
|
154
|
-
"label-placement": "right",
|
|
155
|
-
value: "true",
|
|
156
|
-
label: "Advance code setting",
|
|
157
|
-
required: !0,
|
|
158
|
-
"onUpdate:modelValue": o[1] || (o[1] = () => x.value = !e(x))
|
|
159
|
-
}, null, 8, ["model-value"]),
|
|
160
|
-
e(x) ? (y(), R(P, { key: 0 }, [
|
|
161
|
-
s(M, {
|
|
162
|
-
modelValue: e(a).codeConfig.length,
|
|
163
|
-
"onUpdate:modelValue": o[2] || (o[2] = (t) => e(a).codeConfig.length = t),
|
|
164
|
-
label: "Code length",
|
|
165
|
-
max: 16,
|
|
166
|
-
min: 1,
|
|
167
|
-
rules: [
|
|
168
|
-
(t) => Number(t) >= 1 || "Code length must at least 1",
|
|
169
|
-
(t) => Number(t) <= 16 || "Code length must less than 16"
|
|
170
|
-
],
|
|
171
|
-
required: !0
|
|
172
|
-
}, null, 8, ["modelValue", "rules"]),
|
|
173
|
-
s(S, {
|
|
174
|
-
label: "Charset",
|
|
175
|
-
"model-value": e(C),
|
|
176
|
-
items: B,
|
|
177
|
-
"helper-text": e(a).codeConfig.charset.length > 62 ? `${e(a).codeConfig.charset.substring(0, 62)}...` : e(a).codeConfig.charset,
|
|
178
|
-
"onUpdate:modelValue": o[3] || (o[3] = (t) => {
|
|
179
|
-
C.value = t, e(a).codeConfig.charset = t;
|
|
180
|
-
})
|
|
181
|
-
}, null, 8, ["model-value", "helper-text"]),
|
|
182
|
-
e(C) === "" ? (y(), L(h, {
|
|
183
|
-
key: 0,
|
|
184
|
-
modelValue: e(a).codeConfig.charset,
|
|
185
|
-
"onUpdate:modelValue": o[4] || (o[4] = (t) => e(a).codeConfig.charset = t),
|
|
186
|
-
label: "Custom Charset",
|
|
187
|
-
required: ""
|
|
188
|
-
}, null, 8, ["modelValue"])) : U("", !0),
|
|
189
|
-
b("div", ve, [
|
|
190
|
-
s(h, {
|
|
191
|
-
modelValue: e(a).codeConfig.prefix,
|
|
192
|
-
"onUpdate:modelValue": o[5] || (o[5] = (t) => e(a).codeConfig.prefix = t),
|
|
193
|
-
label: "Prefix (Optional)"
|
|
194
|
-
}, null, 8, ["modelValue"]),
|
|
195
|
-
s(h, {
|
|
196
|
-
modelValue: e(a).codeConfig.suffix,
|
|
197
|
-
"onUpdate:modelValue": o[6] || (o[6] = (t) => e(a).codeConfig.suffix = t),
|
|
198
|
-
label: "Suffix (Optional)"
|
|
199
|
-
}, null, 8, ["modelValue"])
|
|
200
|
-
]),
|
|
201
|
-
s(h, {
|
|
202
|
-
modelValue: e(a).codeConfig.pattern,
|
|
203
|
-
"onUpdate:modelValue": o[7] || (o[7] = (t) => e(a).codeConfig.pattern = t),
|
|
204
|
-
label: "Pattern",
|
|
205
|
-
required: !0
|
|
206
|
-
}, null, 8, ["modelValue"])
|
|
207
|
-
], 64)) : U("", !0),
|
|
208
|
-
s(h, {
|
|
209
|
-
modelValue: e(a).quantity,
|
|
210
|
-
"onUpdate:modelValue": o[8] || (o[8] = (t) => e(a).quantity = t),
|
|
211
|
-
label: "Number of code",
|
|
212
|
-
rules: [
|
|
213
|
-
(t) => t >= 1 || "Quantity cannot be less than 1",
|
|
214
|
-
(t) => t <= 1e4 || "Quantity cannot more than 10,000"
|
|
215
|
-
],
|
|
216
|
-
required: !0,
|
|
217
|
-
"helper-text": `${e(a).quantity} claim will be created`
|
|
218
|
-
}, null, 8, ["modelValue", "rules", "helper-text"])
|
|
219
|
-
], 64)) : U("", !0),
|
|
220
|
-
e(c) !== "bulk" ? (y(), L(W, {
|
|
221
|
-
key: 1,
|
|
222
|
-
modelValue: e(a).code,
|
|
223
|
-
"onUpdate:modelValue": o[9] || (o[9] = (t) => e(a).code = t),
|
|
224
|
-
label: "Custom Code",
|
|
225
|
-
rules: [(t) => e(c) != "single" || !!t || "Custom code is required"],
|
|
226
|
-
placeholder: "(For multiple codes, please enter in the new row.)"
|
|
227
|
-
}, null, 8, ["modelValue", "rules"])) : U("", !0)
|
|
228
|
-
])
|
|
229
|
-
]),
|
|
230
|
-
_: 1
|
|
231
|
-
}, 512)
|
|
232
|
-
]),
|
|
233
|
-
_: 1
|
|
234
|
-
}, 8, ["modelValue"]);
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
class xe {
|
|
239
|
-
constructor() {
|
|
240
|
-
z(this, "data", []);
|
|
241
|
-
}
|
|
242
|
-
addRecord(r) {
|
|
243
|
-
this.data.push(r);
|
|
244
|
-
}
|
|
245
|
-
buildExcel() {
|
|
246
|
-
const r = Y.book_new(), d = Y.json_to_sheet(this.data);
|
|
247
|
-
return Y.book_append_sheet(r, d, "Collection"), r;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
const Ve = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Se = { class: "flex items-center justify-end py-4 xs:hidden" }, Me = /* @__PURE__ */ G({
|
|
251
|
-
__name: "Collections",
|
|
252
|
-
setup(f) {
|
|
253
|
-
const r = ie(), d = Q(), w = p(), F = H(() => d.params.id), k = p(!1), { custom: _ } = J, E = [
|
|
254
|
-
{
|
|
255
|
-
header: "ID/Code",
|
|
256
|
-
accessorKey: "_id",
|
|
257
|
-
cell(n) {
|
|
258
|
-
return T("div", { class: "flex items-center" }, [
|
|
259
|
-
T(le.FmIcon, {
|
|
260
|
-
name: "content_copy",
|
|
261
|
-
outline: !0,
|
|
262
|
-
size: "sm",
|
|
263
|
-
class: "cursor-pointer mr-4",
|
|
264
|
-
onClick: (l) => {
|
|
265
|
-
l.preventDefault(), l.stopPropagation(), ne(
|
|
266
|
-
n.row.original.code || n.row.original._id.toString()
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
}),
|
|
270
|
-
T(
|
|
271
|
-
"div",
|
|
272
|
-
{ class: "pr-2 text-ellipsis overflow-hidden" },
|
|
273
|
-
n.row.original.code || n.row.original._id.toString()
|
|
274
|
-
)
|
|
275
|
-
]);
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
header: "User",
|
|
280
|
-
accessorKey: "user",
|
|
281
|
-
enableSorting: !1,
|
|
282
|
-
cell(n) {
|
|
283
|
-
const l = n.row.original.pf_user;
|
|
284
|
-
return me(l);
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
header: "Phone",
|
|
289
|
-
accessorFn: (n) => {
|
|
290
|
-
var l;
|
|
291
|
-
return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
|
|
292
|
-
},
|
|
293
|
-
accessorKey: "pf_user.phoneNumber"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
header: "Balance",
|
|
297
|
-
accessorKey: "balance"
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
header: "Created at",
|
|
301
|
-
accessorKey: "_id",
|
|
302
|
-
accessorFn: (n) => j(fe(n._id.toString())).format("DD MMM YYYY")
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
header: "Nearest expired at",
|
|
306
|
-
accessorKey: "expiryBalance",
|
|
307
|
-
accessorFn: (n) => {
|
|
308
|
-
var l;
|
|
309
|
-
return n.expiryBalance && n.expiryBalance.length ? j((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
], g = {
|
|
313
|
-
"$connect-STORE_REWARD_COLLECTIONS": pe.readCollectionsByRewardId,
|
|
314
|
-
"$connect-CAMPAIGN_VOUCHER_COLLECTIONS": N.readCollectionsByCampaignId
|
|
315
|
-
}, q = (n) => {
|
|
316
|
-
const l = g[d.name];
|
|
317
|
-
return (o) => l(n, o);
|
|
318
|
-
}, { tableMeta: a, rowData: A, onSort: B, debouncedFetchData: C, onSearch: c } = ue(q(F.value));
|
|
319
|
-
async function x() {
|
|
320
|
-
var n;
|
|
321
|
-
await C(), (n = w.value) == null || n.showSheet(!1);
|
|
322
|
-
}
|
|
323
|
-
async function D() {
|
|
324
|
-
k.value || _(
|
|
325
|
-
async () => {
|
|
326
|
-
var v;
|
|
327
|
-
const n = new xe(), l = (await N.readCollectionsByCampaignId(F.value, {
|
|
328
|
-
limit: 1,
|
|
329
|
-
skip: 0,
|
|
330
|
-
sortBy: m.sortBy,
|
|
331
|
-
descending: m.descending
|
|
332
|
-
})).meta.totalResources ?? 0, o = m.rowsPerPage;
|
|
333
|
-
for (let i = 0; i < l; i += o) {
|
|
334
|
-
const V = {
|
|
335
|
-
...m,
|
|
336
|
-
limit: o,
|
|
337
|
-
skip: (m.page - 1) * m.rowsPerPage,
|
|
338
|
-
sortBy: m.sortBy,
|
|
339
|
-
descending: m.descending
|
|
340
|
-
}, M = await N.readCollectionsByCampaignId(
|
|
341
|
-
F.value,
|
|
342
|
-
V
|
|
343
|
-
);
|
|
344
|
-
for await (const S of M.resources) {
|
|
345
|
-
const h = {
|
|
346
|
-
Id: (S == null ? void 0 : S.code) || ((v = S._id) == null ? void 0 : v.toString()) || ""
|
|
347
|
-
};
|
|
348
|
-
n.addRecord(h);
|
|
349
|
-
}
|
|
350
|
-
m.page++;
|
|
351
|
-
}
|
|
352
|
-
await ce(
|
|
353
|
-
n.buildExcel(),
|
|
354
|
-
`members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
355
|
-
{
|
|
356
|
-
bookType: "xlsx",
|
|
357
|
-
bookSST: !1,
|
|
358
|
-
type: "array"
|
|
359
|
-
}
|
|
360
|
-
), m.page = 1;
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
isLoading: k
|
|
364
|
-
}
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
return ae(async () => {
|
|
368
|
-
await C();
|
|
369
|
-
}), (n, l) => {
|
|
370
|
-
const o = u("FmPageHead"), v = u("FmSearch");
|
|
371
|
-
return y(), R(P, null, [
|
|
372
|
-
s(o, {
|
|
373
|
-
title: "Collections",
|
|
374
|
-
"back-button": !0,
|
|
375
|
-
actions: [
|
|
376
|
-
{ label: "Export", value: "export", isPrimary: !1 },
|
|
377
|
-
{
|
|
378
|
-
label: "Create collection",
|
|
379
|
-
value: "create",
|
|
380
|
-
isPrimary: !0
|
|
381
|
-
}
|
|
382
|
-
],
|
|
383
|
-
"onClick:back": l[0] || (l[0] = (i) => e(r).back()),
|
|
384
|
-
"onClick:action": l[1] || (l[1] = (i) => {
|
|
385
|
-
var V;
|
|
386
|
-
i === "create" && ((V = e(w)) == null || V.showSheet(!0)), i === "export" && D();
|
|
387
|
-
})
|
|
388
|
-
}),
|
|
389
|
-
b("div", Ve, [
|
|
390
|
-
s(v, {
|
|
391
|
-
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
392
|
-
modelValue: e(a).searchValue,
|
|
393
|
-
"onUpdate:modelValue": [
|
|
394
|
-
l[2] || (l[2] = (i) => e(a).searchValue = i),
|
|
395
|
-
e(c)
|
|
396
|
-
],
|
|
397
|
-
placeholder: "Search",
|
|
398
|
-
collapsible: ""
|
|
399
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
400
|
-
b("div", Se, [
|
|
401
|
-
s(v, {
|
|
402
|
-
modelValue: e(a).searchValue,
|
|
403
|
-
"onUpdate:modelValue": [
|
|
404
|
-
l[3] || (l[3] = (i) => e(a).searchValue = i),
|
|
405
|
-
e(c)
|
|
406
|
-
],
|
|
407
|
-
placeholder: "Search",
|
|
408
|
-
collapsible: ""
|
|
409
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
410
|
-
]),
|
|
411
|
-
s(de, {
|
|
412
|
-
loading: e(a).isLoading,
|
|
413
|
-
"row-data": e(A),
|
|
414
|
-
"column-defs": E,
|
|
415
|
-
"row-count": e(a).totalRows,
|
|
416
|
-
"page-count": e(a).pageCount,
|
|
417
|
-
"page-index": e(a).pageIndex,
|
|
418
|
-
"page-size": e(a).pageSize,
|
|
419
|
-
"shrink-at": !1,
|
|
420
|
-
onSortChange: e(B),
|
|
421
|
-
onPageChange: l[4] || (l[4] = (i) => e(C)({ pageSize: i.pageSize, pageIndex: i.pageIndex }))
|
|
422
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
423
|
-
s(ye, {
|
|
424
|
-
ref_key: "sheetRef",
|
|
425
|
-
ref: w,
|
|
426
|
-
onSuccess: x
|
|
427
|
-
}, null, 512)
|
|
428
|
-
])
|
|
429
|
-
], 64);
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
export {
|
|
434
|
-
Me as default
|
|
435
|
-
};
|