@feedmepos/mf-connect 0.1.0-beta.67 → 0.1.0-beta.68
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-knY-Fody.js → Analytic-Dr_vBJdV.js} +11 -11
- package/dist/{App-CaSjMnkY.js → App-CaBm2a_b.js} +6 -6
- package/dist/{AuditLogs-DyJ0BWHt.js → AuditLogs-CG8qANHb.js} +8 -8
- package/dist/{Bin-D73Ky2O3.js → Bin-B5JKJTO7.js} +8 -8
- package/dist/{Broadcast-BRMyf2ZA.js → Broadcast-ClG7jfNg.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-0I_Pp2.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-vLDnTuCM.js} +6 -6
- package/dist/{Card-BEgNn8SY.js → Card-B4IvBvWp.js} +15 -15
- package/dist/{Collections-C0KqBg5k.js → Collections-CciZHHgU.js} +5 -5
- package/dist/{Credit-D3Y1U0-i.js → Credit-CzX9eIee.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJ7AzlQk.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-B5mpHQ_A.js} +28 -28
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C9JgRiyA.js → EffectSheet.vue_vue_type_style_index_0_lang-BfKIDLu4.js} +6 -6
- package/dist/{Experience-B0LMRyXY.js → Experience-BwiwVQ5v.js} +9 -9
- package/dist/{Game-Bz0eGUGe.js → Game-BK-04D8X.js} +10 -10
- package/dist/{Index-DV7FO6TN.js → Index-DucrRfw_.js} +10 -10
- package/dist/{Marketing-xdKdn8qo.js → Marketing-CzPjboT3.js} +6 -6
- package/dist/{Member-CGDUgKb7.js → Member-B19Kt5Vh.js} +5 -5
- package/dist/{MemberList-D1OLQAcR.js → MemberList-D5RFMF3q.js} +24 -24
- package/dist/{MemberTransactions-DO59eyLa.js → MemberTransactions-C1c8IqqO.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-bBjpPoOo.js → MessageInput.vue_vue_type_script_setup_true_lang-YrRQIrWo.js} +2 -2
- package/dist/{Mission-CZvAG4ev.js → Mission-CkumSwIo.js} +10 -10
- package/dist/{Overview-DMCKeCar.js → Overview-BtQVmK5W.js} +17 -17
- package/dist/{Point-BMyDzFyO.js → Point-Cc9uYA3T.js} +9 -9
- package/dist/{Promotion-D1nOUTxD.js → Promotion-B5nEZ6zg.js} +10 -10
- package/dist/{Queue-CGl0yzB4.js → Queue-EFdFqhDh.js} +9 -9
- package/dist/{Record-BGmigp0Z.js → Record-HROFl7Rg.js} +7 -7
- package/dist/{Reward-ZYXuU6-e.js → Reward-DcgE8VKA.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C02Mj9a0.js → RewardGroup.vue_vue_type_script_setup_true_lang-DLpLp66V.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DGS3_lis.js → RuleGroup.vue_vue_type_script_setup_true_lang-DpirS0LA.js} +12 -12
- package/dist/{Segment-BXxgrHVs.js → Segment-YAQ0vnGP.js} +14 -14
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CSVXVt5K.js → SelectItems.vue_vue_type_script_setup_true_lang-C4dd7MvR.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-D9dpqYTQ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dp3leeOg.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CM9312dS.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DCxtYNPf.js} +3 -3
- package/dist/{Setting-B3HficZP.js → Setting-ywKDTb-y.js} +10 -10
- package/dist/{Store-CWhmG8qW.js → Store-BpNyTqRG.js} +145 -143
- package/dist/StoreRewards-CB6RbBCG.js +423 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CTUT_564.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DJV5z0-C.js} +18 -18
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B059fdPj.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CafBjyAf.js} +1 -1
- package/dist/{Tier-qm79T_vU.js → Tier-C4rNs_1u.js} +20 -20
- package/dist/{Title-DOWrRYW8.js → Title-WidMRNuK.js} +79 -79
- package/dist/{Transaction-DW7bUI7j.js → Transaction-9mPnN60M.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-38On7ek-.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BSFZ1ANF.js} +6 -6
- package/dist/{Voucher-BJBXjxZV.js → Voucher-COXdXwo1.js} +12 -12
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DzdxjFhD.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Do4KVmge.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CJ_O28uk.js → ZodTextField.vue_vue_type_script_setup_true_lang-j9HnVsJg.js} +1 -1
- package/dist/{app-CHUmGvDF.js → app-De2YU1eG.js} +31 -31
- package/dist/{app-BLFTLZqS.js → app-yErmpAtu.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-Dl7vGxa1.js → business-I_jVdgH6.js} +1 -1
- package/dist/{campaign-XH_j4bGc.js → campaign-BhD3GJTV.js} +2 -2
- package/dist/{campaign-DMIBFpmQ.js → campaign-hBoxnj2N.js} +9 -9
- package/dist/{campaign.enum-UniuuBvU.js → campaign.enum-CGoJFEYE.js} +1 -1
- package/dist/{campaign.fn-CDC2Cia7.js → campaign.fn-oZf4Ap3H.js} +79 -79
- package/dist/{collectible.enum-Dx_pgMB9.js → collectible.enum-Bamr_j9I.js} +1 -1
- package/dist/{collection.fn-D0nutrYu.js → collection.fn-6ghcsG31.js} +2 -2
- package/dist/{dto-BAPti0UX.js → dto-DN59QhLX.js} +4 -4
- package/dist/{effect-By6CZhli.js → effect-DmeT_Vh3.js} +1 -1
- package/dist/{email-addresses-DPBu_l0s.js → email-addresses-03aXc59k.js} +1 -1
- package/dist/{export-C6IKCW8q.js → export-BE6_M8Bb.js} +3 -3
- package/dist/{helper-KCTyvhjf.js → helper-tLN9OiIA.js} +1 -1
- package/dist/{index-DxT_ZaWI.js → index-67Wy_uko.js} +6 -6
- package/dist/{index-DQxldvxq.js → index-B7Z-3d-c.js} +4 -4
- package/dist/{index-BHB9VPNm.js → index-BYG3Y7Jt.js} +1 -1
- package/dist/{index-_Fw2-H-c.js → index-BbgMEUR-.js} +1 -1
- package/dist/{index-e0vKYT8t.js → index-Brsh9MIM.js} +1 -1
- package/dist/{index-VPs9NXB7.js → index-BxS4Erew.js} +3 -3
- package/dist/{index-C-HL3cGP.js → index-C5SOcwav.js} +1 -1
- package/dist/{index-DDCO8cDG.js → index-CMv75vbY.js} +21 -16
- package/dist/{index-BVcdkWyy.js → index-DCP09nR1.js} +3 -3
- package/dist/{index-C9bN_nRJ.js → index-DpLHoUON.js} +1 -1
- package/dist/{index-D8dh7Th8.js → index-eFoCe1dL.js} +1 -1
- package/dist/{index-Sw_FxWmd.js → index-z82uP_8V.js} +1 -1
- package/dist/{index.esm2017-CiHGwLIY.js → index.esm2017-BpADxr6a.js} +1 -1
- package/dist/{loading-CmczlXAc.js → loading-BMjK5kC8.js} +1 -1
- package/dist/{membership-D-uWTsu-.js → membership-WJQZsNeC.js} +3 -3
- package/dist/{money-BhXbOy-4.js → money-BDm68J6p.js} +1 -1
- package/dist/{number-CT16ZbSb.js → number-DKFRrFHN.js} +1 -1
- package/dist/{objectid-BGQHcha_.js → objectid-7pRyCpqX.js} +3 -3
- package/dist/{plugins-uP-mKUTQ.js → plugins-CD1G5oN5.js} +4 -4
- package/dist/{reward-D7tB215Q.js → reward-Bb8XHNQp.js} +1 -1
- package/dist/{rule-LLXbjCSc.js → rule-9q4Y1uDS.js} +3 -3
- package/dist/{rule-builder-yxSBBeW6.js → rule-builder-9ePG52rv.js} +1 -1
- package/dist/{template-BRXG9AbZ.js → template-RVlppNNS.js} +4 -4
- package/dist/{trigger-BQTtyAtM.js → trigger-C0R972eV.js} +4 -4
- package/dist/{user-BzRp43jn.js → user-BLjZlAFz.js} +1 -1
- package/dist/{vue-i18n-7zGNsm-H.js → vue-i18n-CQNusyHK.js} +285 -285
- package/dist/{xlsx-mkBvYNNs.js → xlsx-rNL6x1jc.js} +1 -1
- package/package.json +1 -1
- package/dist/StoreRewards-6Cjh9q4d.js +0 -402
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { defineComponent as G, ref as F, computed as N, onMounted as q, resolveComponent as R, openBlock as d, createBlock as C, unref as e, isRef as Y, withCtx as S, createElementVNode as l, createVNode as c, createElementBlock as P, createTextVNode as z, resolveDynamicComponent as H, toDisplayString as T, Fragment as j, createCommentVNode as U, h } from "vue";
|
|
2
|
+
import { _ as J } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as Q, components as k } from "@feedmepos/ui-library";
|
|
4
|
+
import "./index-BbgMEUR-.js";
|
|
5
|
+
import { u as X } from "./loading-BMjK5kC8.js";
|
|
6
|
+
import { C as Z, u as ee } from "./membership-WJQZsNeC.js";
|
|
7
|
+
import { p as M, f as B } from "./plugins-CD1G5oN5.js";
|
|
8
|
+
import { u as te } from "./vue-i18n-CQNusyHK.js";
|
|
9
|
+
import { F as oe } from "./index-CMv75vbY.js";
|
|
10
|
+
import { c as ae } from "./object-qECH92oz.js";
|
|
11
|
+
import { u as K } from "./app-wDQR6dpb.js";
|
|
12
|
+
import { u as ne } from "./business-I_jVdgH6.js";
|
|
13
|
+
import { useCoreStore as se } from "@feedmepos/mf-common";
|
|
14
|
+
import { Z as b } from "./zod-Bg2FbC-D.js";
|
|
15
|
+
import { _ as re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-j9HnVsJg.js";
|
|
16
|
+
import { _ as ie } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
|
|
17
|
+
import { _ as le } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CafBjyAf.js";
|
|
18
|
+
import { _ as me, a as ce } from "./EffectSheet.vue_vue_type_style_index_0_lang-BfKIDLu4.js";
|
|
19
|
+
import { i as de, t as ue } from "./helper-tLN9OiIA.js";
|
|
20
|
+
import { useRouter as pe } from "vue-router";
|
|
21
|
+
import { m as D } from "./index-C5SOcwav.js";
|
|
22
|
+
import { R as O } from "./app-De2YU1eG.js";
|
|
23
|
+
const fe = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "flex flex-col space-y-16 pr-12"
|
|
26
|
+
}, ye = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, ge = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, we = { class: "flex items-center gap-8" }, ve = /* @__PURE__ */ G({
|
|
27
|
+
__name: "EditRewardSheet",
|
|
28
|
+
emits: ["update"],
|
|
29
|
+
setup(W, { expose: s, emit: $ }) {
|
|
30
|
+
const A = $, y = ne(), I = se(), _ = F(!1), a = F(), g = F(), u = oe, p = N(
|
|
31
|
+
() => {
|
|
32
|
+
var i;
|
|
33
|
+
return Z[((i = a.value) == null ? void 0 : i.type) || "VOUCHER"];
|
|
34
|
+
}
|
|
35
|
+
), w = N(() => {
|
|
36
|
+
const i = u.safeParse(a.value);
|
|
37
|
+
return i.success ? [] : i.error.errors;
|
|
38
|
+
});
|
|
39
|
+
function L() {
|
|
40
|
+
const i = u.safeParse(a.value);
|
|
41
|
+
i.success && A("update", i.data);
|
|
42
|
+
}
|
|
43
|
+
function V(i, n, t = {
|
|
44
|
+
isStoreReward: !1,
|
|
45
|
+
type: "VOUCHER"
|
|
46
|
+
}) {
|
|
47
|
+
_.value = i, i && (g.value = void 0, a.value = n || de(t.type, {
|
|
48
|
+
business: I.currentBusiness.value._id,
|
|
49
|
+
noCampaign: t.isStoreReward == !0
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
return q(async () => {
|
|
53
|
+
await y.readLocations();
|
|
54
|
+
}), s({
|
|
55
|
+
showSheet: V,
|
|
56
|
+
data: a,
|
|
57
|
+
rewardImage: g
|
|
58
|
+
}), (i, n) => {
|
|
59
|
+
const t = R("FmTextarea"), o = R("FmHelperText"), m = R("FmButton"), v = R("FmSideSheet");
|
|
60
|
+
return d(), C(v, {
|
|
61
|
+
"max-width": 560,
|
|
62
|
+
modelValue: e(_),
|
|
63
|
+
"onUpdate:modelValue": n[7] || (n[7] = (f) => Y(_) ? _.value = f : null),
|
|
64
|
+
header: "Store setting"
|
|
65
|
+
}, {
|
|
66
|
+
"side-sheet-footer": S(() => [
|
|
67
|
+
l("div", we, [
|
|
68
|
+
c(m, {
|
|
69
|
+
label: "Submit",
|
|
70
|
+
onClick: L,
|
|
71
|
+
disabled: e(w).length > 0 || e(K)().isLoading,
|
|
72
|
+
loading: e(K)().isLoading
|
|
73
|
+
}, null, 8, ["disabled", "loading"]),
|
|
74
|
+
c(m, {
|
|
75
|
+
label: "Cancel",
|
|
76
|
+
onClick: n[6] || (n[6] = (f) => V(!1)),
|
|
77
|
+
variant: "tertiary"
|
|
78
|
+
})
|
|
79
|
+
])
|
|
80
|
+
]),
|
|
81
|
+
default: S(() => {
|
|
82
|
+
var f, x, E;
|
|
83
|
+
return [
|
|
84
|
+
e(a) ? (d(), P("div", fe, [
|
|
85
|
+
l("div", ye, [
|
|
86
|
+
n[8] || (n[8] = z(" Reward information ")),
|
|
87
|
+
(d(), C(H(e(p).chip())))
|
|
88
|
+
]),
|
|
89
|
+
c(re, {
|
|
90
|
+
modelValue: e(a).name,
|
|
91
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => e(a).name = r),
|
|
92
|
+
label: `${e(p).name} name`,
|
|
93
|
+
schema: e(b).typeAtPath(e(u), "name", [e(a).type])
|
|
94
|
+
}, null, 8, ["modelValue", "label", "schema"]),
|
|
95
|
+
c(t, {
|
|
96
|
+
class: "!mb-[-16px]",
|
|
97
|
+
modelValue: e(a).description,
|
|
98
|
+
"onUpdate:modelValue": n[1] || (n[1] = (r) => e(a).description = r),
|
|
99
|
+
rules: [e(b).ruleAtPath(e(u), "description", [e(a).type])]
|
|
100
|
+
}, {
|
|
101
|
+
label: S(() => [
|
|
102
|
+
(d(), C(H(
|
|
103
|
+
e(b).toInputLabel(
|
|
104
|
+
e(b).typeAtPath(e(u), "description", [e(a).type]),
|
|
105
|
+
`${e(p).name} description`
|
|
106
|
+
)
|
|
107
|
+
)))
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
}, 8, ["modelValue", "rules"]),
|
|
111
|
+
l("div", ge, [
|
|
112
|
+
l("div", null, T(e(p).name) + " description should not exceed 200 characters. ", 1),
|
|
113
|
+
l("div", null, T(((f = e(a).description) == null ? void 0 : f.length) ?? 0) + "/200", 1)
|
|
114
|
+
]),
|
|
115
|
+
c(ie, {
|
|
116
|
+
class: "w-1/2 xs:w-2/3",
|
|
117
|
+
"aspect-ratio": "16/9",
|
|
118
|
+
file: e(g) ?? void 0,
|
|
119
|
+
thumbnail: e(a).image ?? void 0,
|
|
120
|
+
"onUpdate:file": n[2] || (n[2] = async (r) => {
|
|
121
|
+
g.value = r, r || (e(a).image = null);
|
|
122
|
+
})
|
|
123
|
+
}, {
|
|
124
|
+
label: S(() => [
|
|
125
|
+
(d(), C(H(
|
|
126
|
+
e(b).toInputLabel(
|
|
127
|
+
e(b).typeAtPath(e(u), "image", [e(a).type]),
|
|
128
|
+
`${e(p).name} image`
|
|
129
|
+
)
|
|
130
|
+
)))
|
|
131
|
+
]),
|
|
132
|
+
_: 1
|
|
133
|
+
}, 8, ["file", "thumbnail"]),
|
|
134
|
+
e(a).type === "VOUCHER" ? (d(), P(j, { key: 0 }, [
|
|
135
|
+
n[9] || (n[9] = l("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
|
|
136
|
+
c(me, {
|
|
137
|
+
"model-value": e(a).extras.effect,
|
|
138
|
+
"onUpdate:modelValue": n[3] || (n[3] = (r) => {
|
|
139
|
+
e(a).extras.effect = r;
|
|
140
|
+
})
|
|
141
|
+
}, null, 8, ["model-value"]),
|
|
142
|
+
e(a).extras.effect == null ? (d(), C(o, {
|
|
143
|
+
key: 0,
|
|
144
|
+
class: "!mt-8",
|
|
145
|
+
text: "Effect is required",
|
|
146
|
+
state: "error"
|
|
147
|
+
})) : U("", !0),
|
|
148
|
+
n[10] || (n[10] = l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1)),
|
|
149
|
+
c(ce, {
|
|
150
|
+
"model-value": e(a).options,
|
|
151
|
+
"no-campaign": e(a).noCampaign,
|
|
152
|
+
"onUpdate:modelValue": n[4] || (n[4] = (r) => e(a).options = r),
|
|
153
|
+
schema: e(b).typeAtPath(e(u), "options", ["VOUCHER"])
|
|
154
|
+
}, null, 8, ["model-value", "no-campaign", "schema"])
|
|
155
|
+
], 64)) : U("", !0),
|
|
156
|
+
n[11] || (n[11] = l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
|
|
157
|
+
e(a).type === "VOUCHER" ? (d(), C(le, {
|
|
158
|
+
key: 1,
|
|
159
|
+
"model-value": ((E = (x = e(a).extras) == null ? void 0 : x.targetLocation) == null ? void 0 : E.map(String)) ?? null,
|
|
160
|
+
type: "select",
|
|
161
|
+
"onUpdate:modelValue": n[5] || (n[5] = (r) => {
|
|
162
|
+
e(a).extras.targetLocation = r;
|
|
163
|
+
}),
|
|
164
|
+
rules: [
|
|
165
|
+
e(b).ruleAtPath(e(u), "extras.targetLocation", ["VOUCHER"])
|
|
166
|
+
]
|
|
167
|
+
}, null, 8, ["model-value", "rules"])) : U("", !0)
|
|
168
|
+
])) : U("", !0)
|
|
169
|
+
];
|
|
170
|
+
}),
|
|
171
|
+
_: 1
|
|
172
|
+
}, 8, ["modelValue"]);
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}), Re = { class: "px-24 flex flex-col gap-y-16" }, be = { class: "flex items-center justify-between w-full" }, _e = { class: "flex flex-col gap-16 text-center" }, xe = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qe = /* @__PURE__ */ G({
|
|
176
|
+
__name: "StoreRewards",
|
|
177
|
+
setup(W) {
|
|
178
|
+
const { t: s } = te(), $ = Q(), A = {
|
|
179
|
+
label: s("connect.storeRewards.create"),
|
|
180
|
+
value: "create",
|
|
181
|
+
isPrimary: !0,
|
|
182
|
+
prependIcon: "add"
|
|
183
|
+
}, y = ee(), { global: I, minor: _ } = X, a = pe(), g = F({
|
|
184
|
+
searchKey: "",
|
|
185
|
+
columnFilters: []
|
|
186
|
+
}), u = [
|
|
187
|
+
{
|
|
188
|
+
header: s("connect.storeRewards.table.name"),
|
|
189
|
+
accessorFn: (t) => t.name
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "type",
|
|
193
|
+
header: s("connect.storeRewards.table.type"),
|
|
194
|
+
accessorFn: (t) => t.type,
|
|
195
|
+
cell(t) {
|
|
196
|
+
return Z[t.row.original.type].chip();
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
header: s("connect.storeRewards.table.validity"),
|
|
201
|
+
accessorFn: (t) => ue(
|
|
202
|
+
"validityOption" in t.options ? t.options.validityOption || {} : {}
|
|
203
|
+
)
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
header: s("connect.storeRewards.table.used"),
|
|
207
|
+
meta: {
|
|
208
|
+
textAlign: "left"
|
|
209
|
+
},
|
|
210
|
+
accessorFn: (t) => t.currentReceive ?? 0
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
header: s("connect.storeRewards.table.actions"),
|
|
214
|
+
cell(t) {
|
|
215
|
+
return h("div", { class: "flex items-center justify-end gap-4" }, [
|
|
216
|
+
h(
|
|
217
|
+
k.FmMenu,
|
|
218
|
+
{
|
|
219
|
+
placement: "bottom-end",
|
|
220
|
+
onClick: (o) => {
|
|
221
|
+
o.stopPropagation();
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"menu-button": () => h(k.FmButton, {
|
|
226
|
+
icon: "more_vert",
|
|
227
|
+
iconColor: "neutral-gray-400",
|
|
228
|
+
variant: "tertiary"
|
|
229
|
+
}),
|
|
230
|
+
default: () => [
|
|
231
|
+
h(k.FmMenuItem, {
|
|
232
|
+
label: "View collections",
|
|
233
|
+
onClick: async (o) => {
|
|
234
|
+
o.stopPropagation(), L(t.row.original._id);
|
|
235
|
+
}
|
|
236
|
+
}),
|
|
237
|
+
// h(components.FmMenuItem, {
|
|
238
|
+
// label: 'View transactions',
|
|
239
|
+
// onClick: async (event: Event) => {
|
|
240
|
+
// event.stopPropagation();
|
|
241
|
+
// onViewTransactions(props.row.original._id as string);
|
|
242
|
+
// },
|
|
243
|
+
// }),
|
|
244
|
+
h(
|
|
245
|
+
k.FmMenuItem,
|
|
246
|
+
{
|
|
247
|
+
onClick: async (o) => {
|
|
248
|
+
o.stopPropagation(), V(t.row.original);
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
label: h(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
256
|
+
},
|
|
257
|
+
"Remove"
|
|
258
|
+
)
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
]);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
], p = N(
|
|
268
|
+
() => y.bundleRewards.filter((t) => t.type == "VOUCHER")
|
|
269
|
+
), w = F();
|
|
270
|
+
function L(t) {
|
|
271
|
+
a.push({
|
|
272
|
+
name: O["$connect-STORE_REWARD_COLLECTIONS"],
|
|
273
|
+
params: { id: t }
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
async function V(t) {
|
|
277
|
+
if (t.type === "TITLE") {
|
|
278
|
+
await M.confirm(
|
|
279
|
+
s("connect.storeRewards.remove.message"),
|
|
280
|
+
s("connect.storeRewards.remove.title"),
|
|
281
|
+
s("connect.storeRewards.remove.action")
|
|
282
|
+
) && await a.push({ name: O["$connect-PROGRAM_TITLE"] });
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
await M.remove(
|
|
286
|
+
s("connect.storeRewards.delete.confirm"),
|
|
287
|
+
s("connect.storeRewards.delete.title")
|
|
288
|
+
) && await _(
|
|
289
|
+
async () => {
|
|
290
|
+
await D.deleteReward(t._id), await y.readMembership(), await y.readRewards();
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
message: s("connect.storeRewards.delete.message"),
|
|
294
|
+
successMessage: s("connect.storeRewards.delete.success")
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
async function i(t) {
|
|
299
|
+
var m;
|
|
300
|
+
const o = t ? ae(y.bundleRewards.find((v) => v._id === t)) : void 0;
|
|
301
|
+
if ((o == null ? void 0 : o.type) === "TITLE") {
|
|
302
|
+
await M.confirm(
|
|
303
|
+
"You cannot edit a title here, please edit it at the Program > Title section.",
|
|
304
|
+
"Update reward",
|
|
305
|
+
"Go to title section"
|
|
306
|
+
) && await a.push({ name: O["$connect-PROGRAM_TITLE"] });
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
(m = w.value) == null || m.showSheet(!0, o, {
|
|
310
|
+
isStoreReward: !0,
|
|
311
|
+
type: "VOUCHER"
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
async function n(t) {
|
|
315
|
+
let o = !1;
|
|
316
|
+
t._id && t.type === "VOUCHER" && await new Promise((m) => {
|
|
317
|
+
$.open({
|
|
318
|
+
title: "Confirmation",
|
|
319
|
+
message: s("connect.campaign.voucher.updateConfirm"),
|
|
320
|
+
primaryActions: {
|
|
321
|
+
text: s("connect.campaign.voucher.updateConfirm.updateAll"),
|
|
322
|
+
close: !0
|
|
323
|
+
},
|
|
324
|
+
secondaryActions: {
|
|
325
|
+
text: s("connect.campaign.voucher.updateConfirm.updateFuture"),
|
|
326
|
+
close: !0
|
|
327
|
+
}
|
|
328
|
+
}).onPrimary(async () => {
|
|
329
|
+
o = !0, m();
|
|
330
|
+
}).onSecondary(async () => {
|
|
331
|
+
m();
|
|
332
|
+
});
|
|
333
|
+
}), await _(
|
|
334
|
+
async () => {
|
|
335
|
+
var m, v, f, x;
|
|
336
|
+
(m = w.value) != null && m.rewardImage && t.image ? await B.delete(t.image) : (v = w.value) != null && v.rewardImage && (t.image = await B.update(
|
|
337
|
+
t.image || B.collectibleImagePath(
|
|
338
|
+
void 0,
|
|
339
|
+
w.value.rewardImage
|
|
340
|
+
),
|
|
341
|
+
(f = w.value) == null ? void 0 : f.rewardImage
|
|
342
|
+
)), t._id ? await D.updateReward(t._id, {
|
|
343
|
+
...t,
|
|
344
|
+
updateCollection: o
|
|
345
|
+
}) : await D.createReward(t), await y.readRewards(), (x = w.value) == null || x.showSheet(!1);
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
message: "Updating reward",
|
|
349
|
+
successMessage: "Reward updated successfully"
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
return q(async () => {
|
|
354
|
+
await I(async () => {
|
|
355
|
+
await y.readMembership(), await y.readRewards();
|
|
356
|
+
});
|
|
357
|
+
}), (t, o) => {
|
|
358
|
+
const m = R("FmPageHead"), v = R("FmSearch"), f = R("FmTable"), x = R("FmButton"), E = R("FmCard");
|
|
359
|
+
return d(), P(j, null, [
|
|
360
|
+
c(m, {
|
|
361
|
+
title: e(s)("connect.storeRewards.title"),
|
|
362
|
+
description: e(s)("connect.storeRewards.description"),
|
|
363
|
+
actions: [A],
|
|
364
|
+
"back-button": !0,
|
|
365
|
+
"onClick:action": o[0] || (o[0] = () => i()),
|
|
366
|
+
"onClick:back": o[1] || (o[1] = () => e(a).push({ name: e(O)["$connect-STORE"] }))
|
|
367
|
+
}, null, 8, ["title", "description", "actions"]),
|
|
368
|
+
l("div", Re, [
|
|
369
|
+
e(p) && e(p).length > 0 ? (d(), P(j, { key: 0 }, [
|
|
370
|
+
l("div", be, [
|
|
371
|
+
o[6] || (o[6] = l("div", { class: "flex gap-8" }, null, -1)),
|
|
372
|
+
c(v, {
|
|
373
|
+
modelValue: e(g).searchKey,
|
|
374
|
+
"onUpdate:modelValue": o[2] || (o[2] = (r) => e(g).searchKey = r),
|
|
375
|
+
class: "",
|
|
376
|
+
placeholder: "search",
|
|
377
|
+
collapsible: ""
|
|
378
|
+
}, null, 8, ["modelValue"])
|
|
379
|
+
]),
|
|
380
|
+
c(f, {
|
|
381
|
+
"row-data": e(p),
|
|
382
|
+
"column-defs": u,
|
|
383
|
+
"search-value": e(g).searchKey,
|
|
384
|
+
"column-filter": e(g).columnFilters,
|
|
385
|
+
onRowClick: o[3] || (o[3] = (r) => i(r.original._id)),
|
|
386
|
+
"hide-footer": e(p).length < 10
|
|
387
|
+
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
388
|
+
], 64)) : (d(), C(E, {
|
|
389
|
+
key: 1,
|
|
390
|
+
variant: "outlined",
|
|
391
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
392
|
+
}, {
|
|
393
|
+
default: S(() => [
|
|
394
|
+
o[7] || (o[7] = l("img", {
|
|
395
|
+
src: J,
|
|
396
|
+
class: "aspect-square w-[150px]"
|
|
397
|
+
}, null, -1)),
|
|
398
|
+
l("div", _e, [
|
|
399
|
+
l("div", xe, T(e(s)("connect.storeRewards.empty.title")), 1),
|
|
400
|
+
l("div", Ce, T(e(s)("connect.storeRewards.empty.description")), 1)
|
|
401
|
+
]),
|
|
402
|
+
c(x, {
|
|
403
|
+
variant: "primary",
|
|
404
|
+
label: e(s)("connect.storeRewards.empty.action"),
|
|
405
|
+
onClick: o[4] || (o[4] = (r) => i()),
|
|
406
|
+
icon: "add"
|
|
407
|
+
}, null, 8, ["label"])
|
|
408
|
+
]),
|
|
409
|
+
_: 1
|
|
410
|
+
})),
|
|
411
|
+
c(ve, {
|
|
412
|
+
ref_key: "rewardSheetRef",
|
|
413
|
+
ref: w,
|
|
414
|
+
onUpdate: o[5] || (o[5] = (r) => n(r))
|
|
415
|
+
}, null, 512)
|
|
416
|
+
])
|
|
417
|
+
], 64);
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
export {
|
|
422
|
+
qe as default
|
|
423
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { defineComponent as Q, ref as N, computed as W, h as n, resolveComponent as $, openBlock as k, createBlock as ae, unref as l, isRef as ye, withCtx as oe, createElementVNode as h, createVNode as w, createElementBlock as B, Fragment as X, renderList as ne, toDisplayString as H, createTextVNode as he, resolveDynamicComponent as ve, watch as re, onBeforeMount as be, onMounted as _e } from "vue";
|
|
2
2
|
import { components as y, useDialog as Se } from "@feedmepos/ui-library";
|
|
3
|
-
import { q as z } from "./index-
|
|
4
|
-
import { a as Z, c as xe, p as we } from "./plugins-
|
|
3
|
+
import { q as z } from "./index-B7Z-3d-c.js";
|
|
4
|
+
import { a as Z, c as xe, p as we } from "./plugins-CD1G5oN5.js";
|
|
5
5
|
import { s as Te } from "./index-Dbd4WA4r.js";
|
|
6
6
|
import { h as S } from "./moment-BWErdI6_.js";
|
|
7
7
|
import { _ as j } from "./FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js";
|
|
8
8
|
import { _ as se } from "./DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js";
|
|
9
9
|
import { s as G } from "./index-CsaQJMAR.js";
|
|
10
|
-
import { f as J } from "./number-
|
|
11
|
-
import { u as le } from "./business-
|
|
10
|
+
import { f as J } from "./number-DKFRrFHN.js";
|
|
11
|
+
import { u as le } from "./business-I_jVdgH6.js";
|
|
12
12
|
import { u as ie, _ as ce } from "./usePagination-BeF5K3M7.js";
|
|
13
|
-
import { g as ue } from "./user-
|
|
14
|
-
import { B as me, e as de } from "./export-
|
|
15
|
-
import { u as pe } from "./campaign-
|
|
16
|
-
import "./index-
|
|
17
|
-
import "./index-
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import { u as Re } from "./vue-i18n-
|
|
13
|
+
import { g as ue } from "./user-BLjZlAFz.js";
|
|
14
|
+
import { B as me, e as de } from "./export-BE6_M8Bb.js";
|
|
15
|
+
import { u as pe } from "./campaign-BhD3GJTV.js";
|
|
16
|
+
import "./index-BbgMEUR-.js";
|
|
17
|
+
import "./index-67Wy_uko.js";
|
|
18
|
+
import "./index-CMv75vbY.js";
|
|
19
|
+
import "./index-BYG3Y7Jt.js";
|
|
20
|
+
import "./index-DCP09nR1.js";
|
|
21
|
+
import { u as Re } from "./vue-i18n-CQNusyHK.js";
|
|
22
22
|
import { o as U } from "./objectId-dwaoBfJX.js";
|
|
23
|
-
import { u as fe } from "./loading-
|
|
23
|
+
import { u as fe } from "./loading-BMjK5kC8.js";
|
|
24
24
|
import { useRouter as Ce } from "vue-router";
|
|
25
|
-
import { t as Y } from "./index-
|
|
26
|
-
import { R as K } from "./app-
|
|
27
|
-
import { F as q } from "./collectible.enum-
|
|
25
|
+
import { t as Y } from "./index-z82uP_8V.js";
|
|
26
|
+
import { R as K } from "./app-De2YU1eG.js";
|
|
27
|
+
import { F as q } from "./collectible.enum-Bamr_j9I.js";
|
|
28
28
|
import { useCoreStore as Ae } from "@feedmepos/mf-common";
|
|
29
|
-
import { m as Ie } from "./index-
|
|
29
|
+
import { m as Ie } from "./index-C5SOcwav.js";
|
|
30
30
|
function De(m) {
|
|
31
31
|
let p = "";
|
|
32
32
|
switch (m) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as N, ref as C, computed as L, watch as E, resolveComponent as g, openBlock as o, createElementBlock as i, Fragment as y, toDisplayString as I, createCommentVNode as A, createElementVNode as M, createVNode as v, unref as u, renderList as S, createBlock as b, isRef as U, withCtx as F } from "vue";
|
|
2
|
-
import { u as T } from "./business-
|
|
2
|
+
import { u as T } from "./business-I_jVdgH6.js";
|
|
3
3
|
function j(l, s, n) {
|
|
4
4
|
return l.some(
|
|
5
5
|
n instanceof Function ? n : (a) => a === s
|