@feedmepos/mf-connect 0.1.98-beta.14 → 0.1.98-beta.15
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/package.json +1 -1
- package/dist/App-cOhxU_u8.js +0 -4782
- package/dist/AuditLogs-DrF4TZUW.js +0 -2013
- package/dist/Bin-BO-_SFaU.js +0 -166
- package/dist/Broadcast-3KBPqTp-.js +0 -266
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B2k0Ax57.js +0 -120
- package/dist/Card-BBEYrPpW.js +0 -910
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-BZ11k2vT.js +0 -540
- package/dist/Credit-CwO14_-u.js +0 -260
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D4jVrMR2.js +0 -3377
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dp9dROqK.js +0 -351
- package/dist/Experience-DZYYZIVR.js +0 -259
- package/dist/FileSaver.min-DZ6AZLEa.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
- package/dist/Game-DZly0uJ3.js +0 -330
- package/dist/Grab-FFgsd5Wb.js +0 -300
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BmG1PcGa.js +0 -145
- package/dist/Index-Buue0sTx.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D9CPiVRL.js +0 -48
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-DEmnoTR_.js +0 -18737
- package/dist/LoyaltyDashboard-iyOrUQF2.js +0 -1082
- package/dist/MainLayout-DDNR2vj1.js +0 -41
- package/dist/Marketing-BJtm-Vnf.js +0 -235
- package/dist/MarketingMaterialEdit-DGI8fL2j.js +0 -1035
- package/dist/Member-D21klZ6O.js +0 -280
- package/dist/MemberList-UwhfWFfo.js +0 -1601
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-DdhEdQq-.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-FQ_jtN0E.js +0 -60802
- package/dist/Mission-lhpygvb4.js +0 -334
- package/dist/Overview-Bkl8Fv1q.js +0 -1079
- package/dist/Overview-Ou8WJ3B7.js +0 -949
- package/dist/Point-CU9_iH5w.js +0 -262
- package/dist/Promotion-DUfpA-F5.js +0 -397
- package/dist/Queue-5RY1yhKG.js +0 -260
- package/dist/Record-CdmEH4nI.js +0 -342
- package/dist/Review-LtjQYKAk.js +0 -45
- package/dist/ReviewFacebookCallback-DPBmP1K6.js +0 -248
- package/dist/ReviewGoogleCallback-CDFnaibj.js +0 -213
- package/dist/Reward-CbEdbgTn.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BRWaqlw8.js +0 -149
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dd8wepc7.js +0 -1911
- package/dist/Segment-CxTX6TU2.js +0 -1014
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DUFo9F1G.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-YkK4-mO4.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-YDcyEKae.js +0 -226
- package/dist/Setting-DrEWfQ2K.js +0 -2047
- package/dist/SettingAdvertisements-BNzwx5ox.js +0 -264
- package/dist/Settings-D2SXYanx.js +0 -228
- package/dist/Store-DCi2Gebw.js +0 -1996
- package/dist/StoreRewards-CUvV029S.js +0 -540
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B9QdgprC.js +0 -1130
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bl2U2bAx.js +0 -7007
- package/dist/Tier-wxIk82Kp.js +0 -969
- package/dist/Title-Cx5ckWlL.js +0 -566
- package/dist/Transaction-CQCnhmhL.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DdLtspjY.js +0 -130
- package/dist/Voucher-D8DV8q8E.js +0 -421
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Dps0mhrC.js +0 -421
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BdzQYhnJ.js +0 -56
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-BYN7_HL6.js +0 -59945
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -7
- package/dist/business-CNyGQEl3.js +0 -82
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-D5dSLv9k.js +0 -277
- package/dist/campaign-DE4WGerQ.js +0 -219
- package/dist/campaign.enum-COWBdOo2.js +0 -26
- package/dist/campaign.fn-CBKrg_JY.js +0 -776
- package/dist/collectible.enum-BJKh8Szm.js +0 -19
- package/dist/duplicateCampaign-BJGQqxsx.js +0 -51
- package/dist/effect-C3uE-Ub3.js +0 -89
- package/dist/email-addresses-cgmjeyob.js +0 -705
- package/dist/export-DfPkQrIk.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/google-BQK68wbe.js +0 -5
- package/dist/helper-DEZ_jgnw.js +0 -86
- package/dist/index-0aRjP_N-.js +0 -61
- package/dist/index-B4mc4nmM.js +0 -3
- package/dist/index-B9bDzA3j.js +0 -67
- package/dist/index-BVSqfE9E.js +0 -54
- package/dist/index-Bci4maC5.js +0 -28900
- package/dist/index-Bx6C3Aio.js +0 -151
- package/dist/index-CK4B3Egt.js +0 -2819
- package/dist/index-CM0_akRu.js +0 -8910
- package/dist/index-Ckl89tkb.js +0 -3678
- package/dist/index-CuFWuaJc.js +0 -85
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-D5Cv5Klv.js +0 -31
- package/dist/index-DKFmW-C4.js +0 -30289
- package/dist/index-fM_oxcl1.js +0 -1157
- package/dist/index-niKnRyUP.js +0 -32
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-B2vB8CeD.js +0 -3069
- package/dist/loading-CBKQzRKM.js +0 -72
- package/dist/lodash-jJUnjhex.js +0 -3678
- package/dist/membership-DF-HsQ7U.js +0 -255
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-D1M9tVKp.js +0 -15
- package/dist/number-CtwHCTkf.js +0 -12
- package/dist/object-BYyQ0PZp.js +0 -18
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-D9V_xKfE.js +0 -145
- package/dist/plugins-B5hadxaX.js +0 -1788
- package/dist/reward-DKwcSvsL.js +0 -36
- package/dist/rule-_Qadty1-.js +0 -1969
- package/dist/string-Gcy5IM_H.js +0 -32
- package/dist/style.css +0 -4
- package/dist/template-Dd-s9Cy8.js +0 -188
- package/dist/tier-BJDhpH6X.js +0 -4
- 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/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-Bah27aCv.js +0 -213
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/useMarketingMaterialActions-zFOd9J72.js +0 -107
- package/dist/usePagination-C_R_8m7X.js +0 -220
- package/dist/user-Mvfxwgqs.js +0 -55
- package/dist/vue-i18n-Cf94QH_1.js +0 -2365
- package/dist/xlsx-DQIcBS39.js +0 -15491
- package/dist/zod-BLtGmvmH.js +0 -91
|
@@ -1,181 +0,0 @@
|
|
|
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 F, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as x, renderList as S, createCommentVNode as B } from "vue";
|
|
2
|
-
import { F as D } from "./app-BYN7_HL6.js";
|
|
3
|
-
import "./index-DKFmW-C4.js";
|
|
4
|
-
import { c as E } from "./object-BYyQ0PZp.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(j, { expose: O }) {
|
|
26
|
-
const m = j, b = D(), w = f(() => b.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, [g, o]) => (o.name.toLowerCase().includes(n) && (d[g] = 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 b.store.getMenu(), I(m.initialValue);
|
|
90
|
-
});
|
|
91
|
-
function h(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 = h(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"), g = _("fm-list");
|
|
111
|
-
return c(), u("div", M, [
|
|
112
|
-
i(a, {
|
|
113
|
-
tag: "div",
|
|
114
|
-
clickable: !1
|
|
115
|
-
}, {
|
|
116
|
-
default: F(() => [
|
|
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(g, {
|
|
138
|
-
class: A(["grow overflow-y-auto", `max-h-${m.maxHeight ? `[${m.maxHeight}px]` : "full"}`])
|
|
139
|
-
}, {
|
|
140
|
-
default: F(() => [
|
|
141
|
-
(c(!0), u(x, null, S(v.value, (o) => (c(), u(x, {
|
|
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": h(o.id) ?? !1,
|
|
148
|
-
indeterminate: h(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(x, null, S(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
|
-
};
|
|
@@ -1,188 +0,0 @@
|
|
|
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-CBKQzRKM.js";
|
|
3
|
-
import { p as Z } from "./plugins-B5hadxaX.js";
|
|
4
|
-
import { u as q } from "./app-wDQR6dpb.js";
|
|
5
|
-
import { m as z } from "./index-CuFWuaJc.js";
|
|
6
|
-
import "./index-CK4B3Egt.js";
|
|
7
|
-
import { b as G } from "./index-Ckl89tkb.js";
|
|
8
|
-
import "./index-CM0_akRu.js";
|
|
9
|
-
import "./index-DKFmW-C4.js";
|
|
10
|
-
import "./index-BVSqfE9E.js";
|
|
11
|
-
import { Z as d } from "./zod-BLtGmvmH.js";
|
|
12
|
-
import { z as Y } from "./app-BYN7_HL6.js";
|
|
13
|
-
import { u as j } from "./vue-i18n-Cf94QH_1.js";
|
|
14
|
-
import { c as J } from "./campaign-DE4WGerQ.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
|
-
};
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { defineComponent as O, ref as p, computed as g, watch as T, onMounted as q, resolveComponent as x, openBlock as I, createBlock as G, unref as t, isRef as k, withCtx as z, createElementVNode as n, createVNode as s, toDisplayString as f, createElementBlock as H, createCommentVNode as K } from "vue";
|
|
2
|
-
import { J as Q } from "./JsonViewer-v8_C7l5N.js";
|
|
3
|
-
import { _ as F } from "./FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js";
|
|
4
|
-
import { u as W } from "./loading-CBKQzRKM.js";
|
|
5
|
-
import { u as X } from "./app-wDQR6dpb.js";
|
|
6
|
-
import { l as Y } from "./lodash-jJUnjhex.js";
|
|
7
|
-
import { m as Z } from "./index-CuFWuaJc.js";
|
|
8
|
-
import { c as ee } from "./campaign-DE4WGerQ.js";
|
|
9
|
-
const ae = { class: "space-y-16" }, te = { class: "fm-typo-en-body-md-600" }, oe = { class: "flex items-center justify-end" }, le = {
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "basis-72 bg-white flex items-center justify-between px-24 pt-6 border-t border-fm-color-border"
|
|
12
|
-
}, ne = { class: "flex gap-24 items-center justify-between xs:hidden xs:invisible" }, se = { class: "flex gap-8 items-center" }, ie = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, re = { class: "flex gap-8 items-center" }, ue = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, de = { class: "flex gap-8" }, ce = { class: "flex items-center gap-8" }, Se = /* @__PURE__ */ O({
|
|
13
|
-
__name: "SendVoucherSheet",
|
|
14
|
-
emits: ["success"],
|
|
15
|
-
setup(me, { expose: M, emit: R }) {
|
|
16
|
-
const { minor: j } = W, h = p(""), r = p({}), N = R, m = p(!1), i = p([]);
|
|
17
|
-
function P(o) {
|
|
18
|
-
m.value = !0, h.value = o.campaignId, i.value = [];
|
|
19
|
-
}
|
|
20
|
-
function S() {
|
|
21
|
-
m.value = !1;
|
|
22
|
-
}
|
|
23
|
-
const B = [
|
|
24
|
-
{
|
|
25
|
-
header: "Name",
|
|
26
|
-
accessorFn: (o) => o.name || "No Profile"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
header: "Phone",
|
|
30
|
-
accessorFn: (o) => o.phoneNumber || "-"
|
|
31
|
-
}
|
|
32
|
-
], e = p({
|
|
33
|
-
searchValue: "",
|
|
34
|
-
pageSize: 10,
|
|
35
|
-
pageCount: 0,
|
|
36
|
-
pageIndex: 0,
|
|
37
|
-
totalRows: 0,
|
|
38
|
-
isLoading: !1
|
|
39
|
-
}), u = p([]), L = g(() => e.value.pageIndex + 1), _ = g(
|
|
40
|
-
() => e.value.pageIndex * e.value.pageSize
|
|
41
|
-
), U = g(
|
|
42
|
-
() => Math.min(
|
|
43
|
-
_.value + e.value.pageSize,
|
|
44
|
-
e.value.totalRows
|
|
45
|
-
)
|
|
46
|
-
), w = g(() => e.value.pageIndex > 0), C = g(
|
|
47
|
-
() => e.value.pageIndex < e.value.pageCount - 1
|
|
48
|
-
), b = async (o) => {
|
|
49
|
-
e.value.pageSize = o.pageSize, e.value.pageIndex = o.pageIndex, e.value.isLoading = !0, u.value = [];
|
|
50
|
-
try {
|
|
51
|
-
const a = await Z.read({
|
|
52
|
-
limit: o.pageSize,
|
|
53
|
-
skip: o.pageIndex,
|
|
54
|
-
sortBy: "_id",
|
|
55
|
-
search: e.value.searchValue,
|
|
56
|
-
descending: !1
|
|
57
|
-
});
|
|
58
|
-
u.value = a.resources, e.value.totalRows = a.meta.totalResources ?? 0, e.value.pageCount = a.meta.totalPages ?? 0, r.value = {}, i.value.forEach((d) => {
|
|
59
|
-
const y = u.value.findIndex((c) => c._id == d);
|
|
60
|
-
y > -1 && (r.value[y] = !0);
|
|
61
|
-
});
|
|
62
|
-
} finally {
|
|
63
|
-
e.value.isLoading = !1;
|
|
64
|
-
}
|
|
65
|
-
}, $ = Y.debounce(async () => {
|
|
66
|
-
await b({ pageSize: e.value.pageSize, pageIndex: 0 });
|
|
67
|
-
}, 500), v = async (o) => {
|
|
68
|
-
await b({ pageSize: e.value.pageSize, pageIndex: o });
|
|
69
|
-
}, A = async (o) => {
|
|
70
|
-
await b({ pageSize: o, pageIndex: 0 });
|
|
71
|
-
};
|
|
72
|
-
function E() {
|
|
73
|
-
u.value.length > 0 && (i.value = i.value.filter(
|
|
74
|
-
(o) => !u.value.some((a) => a._id === o) || // Keep if not in current page
|
|
75
|
-
Object.entries(r.value).some(
|
|
76
|
-
([a, d]) => d && u.value[a]._id === o
|
|
77
|
-
// Keep if selected in current page
|
|
78
|
-
)
|
|
79
|
-
));
|
|
80
|
-
for (const [o, a] of Object.entries(r.value))
|
|
81
|
-
if (a) {
|
|
82
|
-
const d = u.value[o]._id;
|
|
83
|
-
i.value.includes(d) || i.value.push(d);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
async function D(o) {
|
|
87
|
-
i.value.length < 1 || await j(
|
|
88
|
-
async () => {
|
|
89
|
-
await ee.sendCollection(h.value, {
|
|
90
|
-
memberId: i.value
|
|
91
|
-
}), await N("success"), S();
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
message: "Sending claim(s)",
|
|
95
|
-
successMessage: "Claim(s) created"
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
return T(r, E, { deep: !0 }), M({
|
|
100
|
-
showSheet: P,
|
|
101
|
-
hideSheet: S
|
|
102
|
-
}), q(async () => {
|
|
103
|
-
await b(e.value);
|
|
104
|
-
}), (o, a) => {
|
|
105
|
-
const d = x("FmSearch"), y = x("FmTable"), c = x("FmButton"), J = x("FmSideSheet");
|
|
106
|
-
return I(), G(J, {
|
|
107
|
-
"max-width": 560,
|
|
108
|
-
"dismiss-away": !0,
|
|
109
|
-
header: "Send voucher to",
|
|
110
|
-
modelValue: t(m),
|
|
111
|
-
"onUpdate:modelValue": [
|
|
112
|
-
a[8] || (a[8] = (l) => k(m) ? m.value = l : null),
|
|
113
|
-
a[9] || (a[9] = (l) => m.value = l)
|
|
114
|
-
]
|
|
115
|
-
}, {
|
|
116
|
-
"side-sheet-footer": z(() => [
|
|
117
|
-
n("div", ce, [
|
|
118
|
-
s(c, {
|
|
119
|
-
label: "Send",
|
|
120
|
-
loading: t(X)().isLoading,
|
|
121
|
-
onClick: D
|
|
122
|
-
}, null, 8, ["loading"]),
|
|
123
|
-
s(c, {
|
|
124
|
-
label: "Cancel",
|
|
125
|
-
type: "button",
|
|
126
|
-
variant: "tertiary",
|
|
127
|
-
onClick: a[7] || (a[7] = (l) => m.value = !1)
|
|
128
|
-
})
|
|
129
|
-
])
|
|
130
|
-
]),
|
|
131
|
-
default: z(() => [
|
|
132
|
-
s(Q, { json: t(i) }, null, 8, ["json"]),
|
|
133
|
-
n("div", ae, [
|
|
134
|
-
n("div", te, f(t(i).length) + " members selected ", 1),
|
|
135
|
-
n("div", oe, [
|
|
136
|
-
s(d, {
|
|
137
|
-
class: "mt-4",
|
|
138
|
-
modelValue: t(e).searchValue,
|
|
139
|
-
"onUpdate:modelValue": [
|
|
140
|
-
a[0] || (a[0] = (l) => t(e).searchValue = l),
|
|
141
|
-
t($)
|
|
142
|
-
],
|
|
143
|
-
placeholder: "Search Member",
|
|
144
|
-
collapsible: ""
|
|
145
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
146
|
-
]),
|
|
147
|
-
s(y, {
|
|
148
|
-
modelValue: t(r),
|
|
149
|
-
"onUpdate:modelValue": a[1] || (a[1] = (l) => k(r) ? r.value = l : null),
|
|
150
|
-
selection: "multiple",
|
|
151
|
-
loading: t(e).isLoading,
|
|
152
|
-
"row-data": t(u),
|
|
153
|
-
"column-defs": B,
|
|
154
|
-
"page-size": t(e).pageSize,
|
|
155
|
-
"page-count": t(e).pageCount,
|
|
156
|
-
"fetch-fn": void 0,
|
|
157
|
-
"hide-footer": ""
|
|
158
|
-
}, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count"]),
|
|
159
|
-
t(e).totalRows > t(e).pageSize ? (I(), H("div", le, [
|
|
160
|
-
n("div", ne, [
|
|
161
|
-
n("div", se, [
|
|
162
|
-
a[10] || (a[10] = n("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
|
|
163
|
-
s(F, {
|
|
164
|
-
items: [
|
|
165
|
-
{ label: "10", value: 10 },
|
|
166
|
-
{ label: "20", value: 20 },
|
|
167
|
-
{ label: "50", value: 50 }
|
|
168
|
-
],
|
|
169
|
-
value: t(e).pageSize,
|
|
170
|
-
"onUpdate:modelValue": A
|
|
171
|
-
}, null, 8, ["value"])
|
|
172
|
-
]),
|
|
173
|
-
n("span", ie, f(t(_) + 1) + " - " + f(t(U)) + " of " + f(t(e).totalRows) + " items ", 1)
|
|
174
|
-
]),
|
|
175
|
-
n("div", re, [
|
|
176
|
-
s(F, {
|
|
177
|
-
items: Array.from(Array(t(e).pageCount), (l, V) => ({
|
|
178
|
-
label: (V + 1).toString(),
|
|
179
|
-
value: V + 1
|
|
180
|
-
})),
|
|
181
|
-
value: t(L),
|
|
182
|
-
"onUpdate:modelValue": a[2] || (a[2] = (l) => v(l - 1))
|
|
183
|
-
}, null, 8, ["items", "value"]),
|
|
184
|
-
n("span", ue, " of " + f(t(e).pageCount) + " pages ", 1),
|
|
185
|
-
n("div", de, [
|
|
186
|
-
s(c, {
|
|
187
|
-
disabled: !t(w),
|
|
188
|
-
icon: "first_page",
|
|
189
|
-
"icon-color": "neutral-black",
|
|
190
|
-
variant: "tertiary",
|
|
191
|
-
onClick: a[3] || (a[3] = (l) => v(0))
|
|
192
|
-
}, null, 8, ["disabled"]),
|
|
193
|
-
s(c, {
|
|
194
|
-
disabled: !t(w),
|
|
195
|
-
icon: "chevron_left",
|
|
196
|
-
"icon-color": "neutral-black",
|
|
197
|
-
variant: "tertiary",
|
|
198
|
-
onClick: a[4] || (a[4] = (l) => v(t(e).pageIndex - 1))
|
|
199
|
-
}, null, 8, ["disabled"]),
|
|
200
|
-
s(c, {
|
|
201
|
-
disabled: !t(C),
|
|
202
|
-
icon: "chevron_right",
|
|
203
|
-
"icon-color": "neutral-black",
|
|
204
|
-
variant: "tertiary",
|
|
205
|
-
onClick: a[5] || (a[5] = (l) => v(t(e).pageIndex + 1))
|
|
206
|
-
}, null, 8, ["disabled"]),
|
|
207
|
-
s(c, {
|
|
208
|
-
disabled: !t(C),
|
|
209
|
-
icon: "last_page",
|
|
210
|
-
"icon-color": "neutral-black",
|
|
211
|
-
variant: "tertiary",
|
|
212
|
-
onClick: a[6] || (a[6] = (l) => v(t(e).pageCount - 1))
|
|
213
|
-
}, null, 8, ["disabled"])
|
|
214
|
-
])
|
|
215
|
-
])
|
|
216
|
-
])) : K("", !0)
|
|
217
|
-
])
|
|
218
|
-
]),
|
|
219
|
-
_: 1
|
|
220
|
-
}, 8, ["modelValue"]);
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
export {
|
|
225
|
-
Se as _
|
|
226
|
-
};
|