@feedmepos/mf-connect 0.1.58-prod → 0.1.60-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-CB0xAr9Q.js +427 -0
- package/dist/App-fp_3oll7.js +4630 -0
- package/dist/Bin-CPEbn14A.js +166 -0
- package/dist/Broadcast-jKp2iB8c.js +233 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CmJG893h.js +121 -0
- package/dist/Card-BaPJkgd2.js +911 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-Bqsg-ON3.js +458 -0
- package/dist/Credit-C9zIva1h.js +228 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js +2194 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Doyw0pvU.js +348 -0
- package/dist/Experience-CCI_oesa.js +229 -0
- package/dist/FileSaver.min-NlMItPOc.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/Game-CRMVz1JP.js +284 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
- package/dist/Index-szNiSnjR.js +259 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
- package/dist/MainLayout-B1aJoR95.js +41 -0
- package/dist/Marketing-AvEiNiD9.js +319 -0
- package/dist/Member-DIZwt6Hh.js +279 -0
- package/dist/MemberList-dxteIRWn.js +1607 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/MemberTransactions-Q3phmXfI.js +45 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BLk8rX-T.js +60553 -0
- package/dist/Mission-CZjySlcS.js +302 -0
- package/dist/Overview-BXbWEDy3.js +1079 -0
- package/dist/Point-CgjNc_Qn.js +232 -0
- package/dist/Promotion-COYo3qLi.js +289 -0
- package/dist/Queue-BLIStJth.js +260 -0
- package/dist/Record-BWoTvVEE.js +341 -0
- package/dist/Reward-Dq6GxHMP.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CR1feHth.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DuYYfbOH.js +1763 -0
- package/dist/Segment-CUfn6k5R.js +882 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CxycOqNJ.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7jqrfEj.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CMmdbYH4.js +147 -0
- package/dist/Setting-CC5AiQSy.js +1928 -0
- package/dist/SettingAdvertisements-DHQTaMC1.js +262 -0
- package/dist/Store-CEgv5aOD.js +1842 -0
- package/dist/StoreRewards-Dtzk_YG2.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cwt8pmoM.js +995 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BEU2u1-a.js +139 -0
- package/dist/Tier-1xqQvWzc.js +895 -0
- package/dist/Title-Da-G8plz.js +566 -0
- package/dist/Transaction-B0vuVZFZ.js +39 -0
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-e4-wNfrg.js +130 -0
- package/dist/Voucher-DLFjkXLu.js +384 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-5X7dGFD9.js +419 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BPTrvEwa.js +56 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-Do_C3F_N.js +7094 -0
- package/dist/app-o7Kvv5aK.js +57962 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +6 -0
- package/dist/business-BDi-QTa5.js +82 -0
- package/dist/campaign-BHqizYy6.js +1810 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign-DNXI3K9c.js +94 -0
- package/dist/campaign.enum-BXDwYoeA.js +20 -0
- package/dist/campaign.fn-Rws4mJa5.js +758 -0
- package/dist/collectible.enum-cMc4fL1T.js +19 -0
- package/dist/collection.fn-F8FZ7Dnr.js +26 -0
- package/dist/dto-CAtf1jq0.js +216 -0
- package/dist/effect-Dhg1ZIrL.js +78 -0
- package/dist/email-addresses-BZJZwglQ.js +705 -0
- package/dist/export-B6yvRuct.js +97 -0
- package/dist/feedme.ico +0 -0
- package/dist/helper-VoErinsY.js +71 -0
- package/dist/index-B0Pzwzkd.js +31 -0
- package/dist/index-Bq6FwMwW.js +32 -0
- package/dist/index-BvE6Sbog.js +3 -0
- package/dist/index-BysJoGFD.js +146 -0
- package/dist/index-C8m_F_I4.js +121 -0
- package/dist/index-CQZinjc9.js +54 -0
- package/dist/index-Cq7s1Pk2.js +76 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-DOGrOlB8.js +8859 -0
- package/dist/index-Di23nMJ7.js +38 -0
- package/dist/index-Dkyb4P6T.js +30076 -0
- package/dist/index-DvZiQOtl.js +3077 -0
- package/dist/index-Ved5V90A.js +2155 -0
- package/dist/index-d4A3r8kv.js +32269 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index-y7IqG-tl.js +44 -0
- package/dist/index.esm2017-CRTpUsW5.js +3069 -0
- package/dist/loading-CoUrS63J.js +71 -0
- package/dist/lodash-B5I3zXaY.js +3678 -0
- package/dist/membership-BiQwBHAA.js +235 -0
- package/dist/moment-D7p2TMB-.js +2583 -0
- package/dist/money-CA3gpWD3.js +15 -0
- package/dist/number-CgmVpwHm.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/objectid-C80eoTvt.js +145 -0
- package/dist/plugins-BkWtR_R5.js +208 -0
- package/dist/reward-D7SKofYj.js +36 -0
- package/dist/rule-Cpxty5PH.js +1951 -0
- package/dist/rule-builder-d_TMgXEC.js +102 -0
- package/dist/style.css +4 -0
- package/dist/template-BB7bab5R.js +190 -0
- package/dist/tier-BJDhpH6X.js +4 -0
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-Dj3UaenF.js +1151 -0
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-ZVR5eR1H.js +144 -0
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/type_drinks-D6jnpvwV.js +4 -0
- package/dist/usePagination-Ds-cuHop.js +223 -0
- package/dist/user-DjRqnFsC.js +54 -0
- package/dist/vue-i18n-BlCNfIcP.js +2365 -0
- package/dist/xlsx-CtNr_GAa.js +15491 -0
- package/dist/zod-Bg2FbC-D.js +90 -0
- package/package.json +1 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as S, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as b, renderList as j, createCommentVNode as B } from "vue";
|
|
2
|
+
import { C as D } from "./app-o7Kvv5aK.js";
|
|
3
|
+
import "./index-d4A3r8kv.js";
|
|
4
|
+
import { c as E } from "./object-qECH92oz.js";
|
|
5
|
+
const M = { class: "flex flex-col flex-nowrap" }, T = { class: "flex gap-16 items-center w-full" }, $ = { class: "flex grow items-center" }, z = { class: "grow text-fm-color-typo-secondary" }, K = { key: 0 }, J = { class: "px-16" }, X = /* @__PURE__ */ N({
|
|
6
|
+
__name: "SelectItems",
|
|
7
|
+
props: {
|
|
8
|
+
initialValue: {
|
|
9
|
+
type: Array,
|
|
10
|
+
default: () => []
|
|
11
|
+
},
|
|
12
|
+
filterItems: {
|
|
13
|
+
type: Function,
|
|
14
|
+
default: void 0
|
|
15
|
+
},
|
|
16
|
+
onComplete: {
|
|
17
|
+
type: Function,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
maxHeight: {
|
|
21
|
+
type: [String, Number],
|
|
22
|
+
default: 380
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(F, { expose: O }) {
|
|
26
|
+
const m = F, x = D(), w = f(() => x.menu.value || {
|
|
27
|
+
_id: "",
|
|
28
|
+
modules: {
|
|
29
|
+
catalog: [],
|
|
30
|
+
category: [],
|
|
31
|
+
item: [],
|
|
32
|
+
variant: [],
|
|
33
|
+
group: [],
|
|
34
|
+
takeaway: [],
|
|
35
|
+
scheduler: [],
|
|
36
|
+
printDepartment: [],
|
|
37
|
+
recipe: [],
|
|
38
|
+
sku: [],
|
|
39
|
+
unit: [],
|
|
40
|
+
cookingGuide: [],
|
|
41
|
+
serveSequence: []
|
|
42
|
+
}
|
|
43
|
+
}), k = f(() => {
|
|
44
|
+
const n = m.filterItems ?? ((t) => !!t.category);
|
|
45
|
+
return w.value.modules.item.filter(n).reduce((t, l) => {
|
|
46
|
+
const a = {
|
|
47
|
+
id: l._id,
|
|
48
|
+
category: l.category,
|
|
49
|
+
name: (l.name2 || l.name).trim()
|
|
50
|
+
};
|
|
51
|
+
return t = [...t, a], t;
|
|
52
|
+
}, []);
|
|
53
|
+
}), C = f(() => {
|
|
54
|
+
const n = w.value.modules.category.reduce((e, t) => (e[t._id] = {
|
|
55
|
+
id: t._id,
|
|
56
|
+
name: t.name,
|
|
57
|
+
items: {}
|
|
58
|
+
}, e), {});
|
|
59
|
+
return k.value.reduce(
|
|
60
|
+
(e, t) => {
|
|
61
|
+
const l = t.category ?? "";
|
|
62
|
+
return e[l].items = {
|
|
63
|
+
...e[l].items,
|
|
64
|
+
[t.id]: t
|
|
65
|
+
}, e;
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
...n,
|
|
69
|
+
"": {
|
|
70
|
+
id: "",
|
|
71
|
+
name: "Addons",
|
|
72
|
+
items: {}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}), v = f(() => {
|
|
77
|
+
const n = y.value.toLowerCase();
|
|
78
|
+
return n ? Object.entries(C.value).reduce((e, [t, l]) => {
|
|
79
|
+
if (l.name.toLowerCase().includes(n))
|
|
80
|
+
return e[t] = l, e;
|
|
81
|
+
const a = Object.entries(l.items).reduce((d, [h, o]) => (o.name.toLowerCase().includes(n) && (d[h] = o), d), {});
|
|
82
|
+
return Object.keys(a).length > 0 && (e[t] = { ...l, items: a }), e;
|
|
83
|
+
}, {}) : C.value;
|
|
84
|
+
}), s = V({}), y = V(""), G = f(() => Object.values(s.value).filter((n) => !!n).length);
|
|
85
|
+
function I(n) {
|
|
86
|
+
s.value = k.value.reduce((e, t) => (e[t.id] = n.includes(t.id), e), {});
|
|
87
|
+
}
|
|
88
|
+
H(async () => {
|
|
89
|
+
await x.store.getMenu(), I(m.initialValue);
|
|
90
|
+
});
|
|
91
|
+
function g(n) {
|
|
92
|
+
const e = Object.keys(v.value[n].items), t = e.filter((l) => s.value[l]);
|
|
93
|
+
return t.length ? t.length === e.length ? !0 : null : !1;
|
|
94
|
+
}
|
|
95
|
+
function U(n) {
|
|
96
|
+
const e = Object.keys(v.value[n].items), t = g(n), l = E(s.value);
|
|
97
|
+
for (const a of e)
|
|
98
|
+
l[a] = t !== !0;
|
|
99
|
+
s.value = l;
|
|
100
|
+
}
|
|
101
|
+
function L(n) {
|
|
102
|
+
s.value[n] = !s.value[n];
|
|
103
|
+
}
|
|
104
|
+
return O({
|
|
105
|
+
onConfirm: () => {
|
|
106
|
+
const n = Object.entries(s.value).filter(([, e]) => !!e).map(([e]) => e);
|
|
107
|
+
m.onComplete(n);
|
|
108
|
+
}
|
|
109
|
+
}), (n, e) => {
|
|
110
|
+
const t = _("fm-button"), l = _("FmTextField"), a = _("fm-list-item"), d = _("fm-checkbox"), h = _("fm-list");
|
|
111
|
+
return c(), u("div", M, [
|
|
112
|
+
i(a, {
|
|
113
|
+
tag: "div",
|
|
114
|
+
clickable: !1
|
|
115
|
+
}, {
|
|
116
|
+
default: S(() => [
|
|
117
|
+
p("div", T, [
|
|
118
|
+
p("div", $, [
|
|
119
|
+
i(t, {
|
|
120
|
+
icon: "sync",
|
|
121
|
+
variant: "tertiary",
|
|
122
|
+
onClick: e[0] || (e[0] = () => I([]))
|
|
123
|
+
}),
|
|
124
|
+
p("span", z, q(G.value) + " product(s) selected ", 1)
|
|
125
|
+
]),
|
|
126
|
+
i(l, {
|
|
127
|
+
modelValue: y.value,
|
|
128
|
+
"onUpdate:modelValue": e[1] || (e[1] = (o) => y.value = o),
|
|
129
|
+
placeholder: "Search",
|
|
130
|
+
"leading-icon": { name: "search", color: "" },
|
|
131
|
+
style: { width: "200px", "min-width": "200px" }
|
|
132
|
+
}, null, 8, ["modelValue"])
|
|
133
|
+
])
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
}),
|
|
137
|
+
i(h, {
|
|
138
|
+
class: A(["grow overflow-y-auto", `max-h-${m.maxHeight ? `[${m.maxHeight}px]` : "full"}`])
|
|
139
|
+
}, {
|
|
140
|
+
default: S(() => [
|
|
141
|
+
(c(!0), u(b, null, j(v.value, (o) => (c(), u(b, {
|
|
142
|
+
key: o.id
|
|
143
|
+
}, [
|
|
144
|
+
Object.keys(o.items).length > 0 ? (c(), u("div", K, [
|
|
145
|
+
p("div", J, [
|
|
146
|
+
i(d, {
|
|
147
|
+
"model-value": g(o.id) ?? !1,
|
|
148
|
+
indeterminate: g(o.id) === null,
|
|
149
|
+
label: o.name,
|
|
150
|
+
value: "",
|
|
151
|
+
name: "",
|
|
152
|
+
sublabel: "",
|
|
153
|
+
class: "w-full",
|
|
154
|
+
"onUpdate:modelValue": () => U(o.id)
|
|
155
|
+
}, null, 8, ["model-value", "indeterminate", "label", "onUpdate:modelValue"])
|
|
156
|
+
]),
|
|
157
|
+
(c(!0), u(b, null, j(o.items, (r) => (c(), u("div", {
|
|
158
|
+
key: r.id,
|
|
159
|
+
class: "pl-48"
|
|
160
|
+
}, [
|
|
161
|
+
i(d, {
|
|
162
|
+
"model-value": s.value[r.id],
|
|
163
|
+
label: r.name,
|
|
164
|
+
value: r.id,
|
|
165
|
+
name: r.name,
|
|
166
|
+
class: "w-full",
|
|
167
|
+
"onUpdate:modelValue": () => L(r.id)
|
|
168
|
+
}, null, 8, ["model-value", "label", "value", "name", "onUpdate:modelValue"])
|
|
169
|
+
]))), 128))
|
|
170
|
+
])) : B("", !0)
|
|
171
|
+
], 64))), 128))
|
|
172
|
+
]),
|
|
173
|
+
_: 1
|
|
174
|
+
}, 8, ["class"])
|
|
175
|
+
]);
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
export {
|
|
180
|
+
X as _
|
|
181
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { defineComponent as L, ref as p, computed as C, onMounted as P, resolveComponent as i, openBlock as $, createBlock as D, unref as e, isRef as H, withCtx as S, createElementVNode as v, createVNode as c, toDisplayString as w } from "vue";
|
|
2
|
+
import { u as O } from "./loading-CoUrS63J.js";
|
|
3
|
+
import { p as Z } from "./plugins-BkWtR_R5.js";
|
|
4
|
+
import { u as q } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { m as z } from "./index-Cq7s1Pk2.js";
|
|
6
|
+
import { b as G } from "./index-DvZiQOtl.js";
|
|
7
|
+
import "./index-DOGrOlB8.js";
|
|
8
|
+
import "./index-Ved5V90A.js";
|
|
9
|
+
import "./index-Di23nMJ7.js";
|
|
10
|
+
import "./index-CQZinjc9.js";
|
|
11
|
+
import { Z as d } from "./zod-Bg2FbC-D.js";
|
|
12
|
+
import { z as Y } from "./app-Do_C3F_N.js";
|
|
13
|
+
import { u as j } from "./vue-i18n-BlCNfIcP.js";
|
|
14
|
+
import { c as J } from "./index-C8m_F_I4.js";
|
|
15
|
+
const K = { class: "fm-typo-en-body-lg-600" }, Q = { class: "fm-typo-en-body-lg-400" }, W = { class: "flex items-center gap-8" }, fe = /* @__PURE__ */ L({
|
|
16
|
+
__name: "SendCollectionSheet",
|
|
17
|
+
emits: ["success"],
|
|
18
|
+
setup(X, { expose: V, emit: I }) {
|
|
19
|
+
const { t: l } = j(), { minor: k } = O, A = I, n = p({
|
|
20
|
+
memberId: [],
|
|
21
|
+
amount: 1,
|
|
22
|
+
ref: ""
|
|
23
|
+
}), h = p(null), f = p(), b = p([]), r = p(!1), _ = p(), T = G.extend({
|
|
24
|
+
ref: Y.string().max(50, "Reference must be at most 50 characters").optional()
|
|
25
|
+
}), F = C(() => {
|
|
26
|
+
var a;
|
|
27
|
+
switch ((a = h.value) == null ? void 0 : a.type) {
|
|
28
|
+
case "MISSION":
|
|
29
|
+
return l("connect.sendCollectionSheet.stamp");
|
|
30
|
+
case "GAME":
|
|
31
|
+
return l("connect.sendCollectionSheet.game_token");
|
|
32
|
+
default:
|
|
33
|
+
return "Unknown";
|
|
34
|
+
}
|
|
35
|
+
}), u = C(() => {
|
|
36
|
+
const a = T.safeParse(n.value);
|
|
37
|
+
return a.success ? [] : a.error.errors;
|
|
38
|
+
});
|
|
39
|
+
function M(a) {
|
|
40
|
+
r.value = !0, h.value = a.campaign, f.value = null, n.value = {
|
|
41
|
+
memberId: [],
|
|
42
|
+
amount: 1,
|
|
43
|
+
ref: ""
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function g() {
|
|
47
|
+
r.value = !1;
|
|
48
|
+
}
|
|
49
|
+
async function y(a) {
|
|
50
|
+
const t = await z.read({
|
|
51
|
+
limit: 25,
|
|
52
|
+
skip: 0,
|
|
53
|
+
sortBy: "_id",
|
|
54
|
+
search: a,
|
|
55
|
+
descending: !1
|
|
56
|
+
});
|
|
57
|
+
b.value = t.resources.map((s) => ({
|
|
58
|
+
label: `${s.name} (${s.phoneNumber})`,
|
|
59
|
+
value: s._id
|
|
60
|
+
}));
|
|
61
|
+
const m = 100;
|
|
62
|
+
await new Promise((s) => setTimeout(s, m));
|
|
63
|
+
}
|
|
64
|
+
async function U() {
|
|
65
|
+
var t;
|
|
66
|
+
await Z.confirm(
|
|
67
|
+
l("connect.sendCollectionSheet.confirmation_message", {
|
|
68
|
+
amount: n.value.amount,
|
|
69
|
+
type: F.value,
|
|
70
|
+
memberName: f.value ? (t = b.value.find((m) => m.value === f.value)) == null ? void 0 : t.label : "Unknown Member"
|
|
71
|
+
}),
|
|
72
|
+
l("connect.common.confirm"),
|
|
73
|
+
l("connect.common.confirm"),
|
|
74
|
+
l("connect.common.cancel")
|
|
75
|
+
) && await k(
|
|
76
|
+
async () => {
|
|
77
|
+
var m;
|
|
78
|
+
await J.sendStamp((m = h.value) == null ? void 0 : m._id.toString(), {
|
|
79
|
+
memberId: n.value.memberId,
|
|
80
|
+
amount: n.value.amount,
|
|
81
|
+
ref: n.value.ref
|
|
82
|
+
}), await A("success"), g();
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
message: "Sending claim(s)",
|
|
86
|
+
successMessage: "Claim(s) created"
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
return V({
|
|
91
|
+
showSheet: M,
|
|
92
|
+
hideSheet: g
|
|
93
|
+
}), P(async () => {
|
|
94
|
+
await y("");
|
|
95
|
+
}), (a, t) => {
|
|
96
|
+
const m = i("FmCard"), s = i("FmSelect"), B = i("FmStepperField"), N = i("FmTextField"), E = i("FmForm"), x = i("FmButton"), R = i("FmSideSheet");
|
|
97
|
+
return $(), D(R, {
|
|
98
|
+
"max-width": 560,
|
|
99
|
+
"dismiss-away": !0,
|
|
100
|
+
header: e(l)("connect.sendCollectionSheet.title", {
|
|
101
|
+
type: e(F)
|
|
102
|
+
}),
|
|
103
|
+
modelValue: e(r),
|
|
104
|
+
"onUpdate:modelValue": [
|
|
105
|
+
t[5] || (t[5] = (o) => H(r) ? r.value = o : null),
|
|
106
|
+
t[6] || (t[6] = (o) => r.value = o)
|
|
107
|
+
]
|
|
108
|
+
}, {
|
|
109
|
+
"side-sheet-footer": S(() => [
|
|
110
|
+
v("div", W, [
|
|
111
|
+
c(x, {
|
|
112
|
+
label: "Send",
|
|
113
|
+
loading: e(q)().isLoading,
|
|
114
|
+
onClick: t[3] || (t[3] = async () => {
|
|
115
|
+
var o;
|
|
116
|
+
return (o = e(_)) == null ? void 0 : o.validateInputs();
|
|
117
|
+
})
|
|
118
|
+
}, null, 8, ["loading"]),
|
|
119
|
+
c(x, {
|
|
120
|
+
label: "Cancel",
|
|
121
|
+
type: "button",
|
|
122
|
+
variant: "tertiary",
|
|
123
|
+
onClick: t[4] || (t[4] = (o) => r.value = !1)
|
|
124
|
+
})
|
|
125
|
+
])
|
|
126
|
+
]),
|
|
127
|
+
default: S(() => [
|
|
128
|
+
c(E, {
|
|
129
|
+
class: "space-y-16",
|
|
130
|
+
ref_key: "form",
|
|
131
|
+
ref: _,
|
|
132
|
+
onValidationSuccess: U,
|
|
133
|
+
blameFormChildOnValidationFailed: ""
|
|
134
|
+
}, {
|
|
135
|
+
default: S(() => [
|
|
136
|
+
c(m, {
|
|
137
|
+
variant: "outlined",
|
|
138
|
+
class: "p-16"
|
|
139
|
+
}, {
|
|
140
|
+
default: S(() => {
|
|
141
|
+
var o;
|
|
142
|
+
return [
|
|
143
|
+
v("div", K, w(e(l)("connect.campaign.common.campaign")), 1),
|
|
144
|
+
v("div", Q, w((o = e(h)) == null ? void 0 : o.name), 1)
|
|
145
|
+
];
|
|
146
|
+
}),
|
|
147
|
+
_: 1
|
|
148
|
+
}),
|
|
149
|
+
c(s, {
|
|
150
|
+
"model-value": e(f),
|
|
151
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => {
|
|
152
|
+
e(n).memberId = [o], f.value = o;
|
|
153
|
+
}),
|
|
154
|
+
label: "Select member",
|
|
155
|
+
searchable: "",
|
|
156
|
+
items: e(b),
|
|
157
|
+
onSearch: y,
|
|
158
|
+
rules: [(o) => !!o || "Member is required"],
|
|
159
|
+
"helper-text": "Type to search member",
|
|
160
|
+
"helper-state": e(d).helperState(e(u), "memberId"),
|
|
161
|
+
"error-text": e(d).helperText(e(u), "memberId")
|
|
162
|
+
}, null, 8, ["model-value", "items", "rules", "helper-state", "error-text"]),
|
|
163
|
+
c(B, {
|
|
164
|
+
modelValue: e(n).amount,
|
|
165
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => e(n).amount = o),
|
|
166
|
+
label: "Amount",
|
|
167
|
+
"helper-state": e(d).helperState(e(u), "amount"),
|
|
168
|
+
"helper-text": e(d).helperText(e(u), "amount")
|
|
169
|
+
}, null, 8, ["modelValue", "helper-state", "helper-text"]),
|
|
170
|
+
c(N, {
|
|
171
|
+
modelValue: e(n).ref,
|
|
172
|
+
"onUpdate:modelValue": t[2] || (t[2] = (o) => e(n).ref = o),
|
|
173
|
+
label: "Reference (optional)",
|
|
174
|
+
"helper-state": e(d).helperState(e(u), "ref"),
|
|
175
|
+
"helper-text": e(d).helperText(e(u), "ref")
|
|
176
|
+
}, null, 8, ["modelValue", "helper-state", "helper-text"])
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 512)
|
|
180
|
+
]),
|
|
181
|
+
_: 1
|
|
182
|
+
}, 8, ["header", "modelValue"]);
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
export {
|
|
187
|
+
fe as _
|
|
188
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
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-CoUrS63J.js";
|
|
4
|
+
import { u as P } from "./app-wDQR6dpb.js";
|
|
5
|
+
import { l as U } from "./lodash-B5I3zXaY.js";
|
|
6
|
+
import { m as D } from "./index-Cq7s1Pk2.js";
|
|
7
|
+
import { c as J } from "./index-C8m_F_I4.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
|
+
};
|