@feedmepos/mf-connect 0.0.20-prod → 0.0.21-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-DuwMJh8c.js → Analytic-C6F4G25g.js} +8 -8
- package/dist/{Broadcast-BUgjgqv9.js → Broadcast-DO2VP__g.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BDU9wbxY.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0aQTASM.js} +8 -8
- package/dist/{Card-CwohdmAQ.js → Card-DZyOKMh6.js} +54 -54
- package/dist/{Collections-D-JKj4iC.js → Collections-DLyCIlvd.js} +6 -6
- package/dist/{Credit-BdKekl3X.js → Credit-DRdsjXky.js} +7 -7
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DA-7-Qi9.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-733A3xAJ.js} +321 -328
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-lDNh6GmQ.js → EffectSheet.vue_vue_type_style_index_0_lang-CvtX7ULa.js} +5 -5
- package/dist/{Experience-KoC4x_ae.js → Experience-D33O1vby.js} +7 -7
- package/dist/{Game-CTkr8R18.js → Game-BrYvnjMK.js} +7 -7
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CDeQRYDy.js → ImageInput.vue_vue_type_script_setup_true_lang-Dby96cpu.js} +1 -1
- package/dist/{MainLayout-Du7UHyf3.js → MainLayout-Cex8qsGf.js} +1 -1
- package/dist/{Marketing-CTl2LqXi.js → Marketing-6ATQUGoF.js} +4 -4
- package/dist/{Member-hHIz1gGT.js → Member-CCIVIzDM.js} +2 -2
- package/dist/{MemberList-Fs95BxUo.js → MemberList-Cs0LD8gi.js} +11 -11
- package/dist/{MemberTransactions-nmURocbA.js → MemberTransactions-CLE7hYWY.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Zk21rkMZ.js → MessageInput.vue_vue_type_script_setup_true_lang-DcKMh_2f.js} +2 -2
- package/dist/{Mission-B5YwPU71.js → Mission-BHI8zTMK.js} +7 -7
- package/dist/{Point-BiOgpyye.js → Point-CHxmW_O8.js} +7 -7
- package/dist/{Promotion-Bpvuwixe.js → Promotion-C8CqdNGj.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DZlxkB8D.js → RuleGroup.vue_vue_type_script_setup_true_lang-C9C8o4ON.js} +13 -13
- package/dist/{Segment-DrEpmY4N.js → Segment-CvNLrjIH.js} +9 -9
- package/dist/{Setting-D48p2snU.js → Setting-oXiZZAub.js} +8 -8
- package/dist/{Store-CT1XE_Sn.js → Store-WLcxJNzp.js} +11 -11
- package/dist/{StoreRewards-DsjyanOO.js → StoreRewards-CMrnEHsB.js} +138 -145
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DboIoW51.js → StoreTransactions.vue_vue_type_script_setup_true_lang-bgEBVCXH.js} +6 -6
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CtSi80Oy.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-B6gZzsja.js} +1 -1
- package/dist/{Tier-BzZX_Dki.js → Tier-BwXb3Pk1.js} +16 -16
- package/dist/{Title-C2Ji-YGQ.js → Title-BOyT9mEy.js} +15 -15
- package/dist/{Transaction-BJGKndk-.js → Transaction-wwnoXk9w.js} +1 -1
- package/dist/{Voucher-D2dpFJSA.js → Voucher-BbpSPfL0.js} +9 -9
- package/dist/{app-D5_9RvMw.js → app-Bw4vX2Xq.js} +1 -1
- package/dist/{app-BAgeAm1l.js → app-CzpQo8NQ.js} +33 -33
- package/dist/app.js +1 -1
- package/dist/{campaign-BK6-HrgE.js → campaign-BAxYqkWK.js} +2 -2
- package/dist/{dto-E-AuMyEO.js → dto-CwGNrCVP.js} +41 -41
- package/dist/{effect-DOWJayPu.js → effect-OIGvEMnu.js} +1 -1
- package/dist/{export-DMZdMVnb.js → export-pnyF_Nqa.js} +3 -3
- package/dist/{helper-CmlX0eR1.js → helper-1r9zsTyt.js} +1 -1
- package/dist/{index-BNy1wU-V.js → index-6xeKaiuc.js} +1 -1
- package/dist/{index-BZbJpBo2.js → index-AeZIrHi3.js} +2 -2
- package/dist/{index-Cj1rTpPK.js → index-BULhetR6.js} +1 -1
- package/dist/{index-BkHtyaBf.js → index-C33oGCbQ.js} +5 -5
- package/dist/{index-RcFvF7Y_.js → index-C9XT87dh.js} +5 -5
- package/dist/{index-DKCHICCa.js → index-CFW6MW-j.js} +2 -2
- package/dist/{index-gOVUv83Y.js → index-COXwd1ca.js} +3 -3
- package/dist/{index-zAvZNHx0.js → index-DdgrIdtX.js} +2 -2
- package/dist/{index-QeG7EuE3.js → index-Shw3boHM.js} +1 -1
- package/dist/{index-BhHZOSyO.js → index-s63kYMDU.js} +1 -1
- package/dist/{loading-BIURYgSR.js → loading-D7uTV0-9.js} +4 -4
- package/dist/{lodash-CxofWkz4.js → lodash-O836mjN1.js} +1 -1
- package/dist/{membership-DVEV926P.js → membership-BRlmOhUi.js} +3 -3
- package/dist/{money-99JilzxX.js → money-BdNZ4vMR.js} +1 -1
- package/dist/{number-BKGHLuLf.js → number-CNiMHNNi.js} +1 -1
- package/dist/{rule-Chwh9Y4B.js → rule-2GUvtk01.js} +2 -2
- package/dist/{rule-builder-JEF7ltcg.js → rule-builder-B3FwMkHG.js} +1 -1
- package/dist/{template-B6lZdtyo.js → template-COZoDCgl.js} +5 -5
- package/dist/{usePagination-4epNDLvW.js → usePagination-CwZ7gv3m.js} +1 -1
- package/dist/{xlsx-DKkkHUS_.js → xlsx-B2_kvHAq.js} +1 -1
- package/package.json +1 -1
|
@@ -1,172 +1,165 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { defineComponent as q, ref as V, computed as N, onMounted as Y, resolveComponent as p, openBlock as u, createBlock as b, unref as e, isRef as W, withCtx as x, createElementVNode as l, createVNode as s, createElementBlock as O, createTextVNode as z, resolveDynamicComponent as H, toDisplayString as G, Fragment as j, createCommentVNode as U, h as R } from "vue";
|
|
2
|
+
import { _ as J } from "./campaign-CpzFl8Vr.js";
|
|
3
3
|
import { components as $ } from "@feedmepos/ui-library";
|
|
4
|
-
import { b as
|
|
5
|
-
import { u as
|
|
6
|
-
import { C
|
|
7
|
-
import { F as
|
|
8
|
-
import { c as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { useCoreStore as
|
|
11
|
-
import { _ as se, Z as
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { _ as
|
|
15
|
-
import { i as
|
|
16
|
-
import { useRouter as
|
|
17
|
-
import { m as D } from "./index-
|
|
18
|
-
const
|
|
4
|
+
import { b as Q, u as K, d as k } from "./app-CzpQo8NQ.js";
|
|
5
|
+
import { u as X, p as M, f as B } from "./loading-D7uTV0-9.js";
|
|
6
|
+
import { C, u as ee } from "./membership-BRlmOhUi.js";
|
|
7
|
+
import { F as te } from "./index-DdgrIdtX.js";
|
|
8
|
+
import { c as ae } from "./object-qECH92oz.js";
|
|
9
|
+
import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
10
|
+
import { useCoreStore as ne } from "@feedmepos/mf-common";
|
|
11
|
+
import { _ as se, Z as g } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
12
|
+
import { _ as le } from "./ImageInput.vue_vue_type_script_setup_true_lang-Dby96cpu.js";
|
|
13
|
+
import { _ as ie } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-B6gZzsja.js";
|
|
14
|
+
import { _ as re, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-CvtX7ULa.js";
|
|
15
|
+
import { i as de, t as ce } from "./helper-1r9zsTyt.js";
|
|
16
|
+
import { useRouter as ue } from "vue-router";
|
|
17
|
+
import { m as D } from "./index-BULhetR6.js";
|
|
18
|
+
const pe = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "flex flex-col space-y-16 pr-12"
|
|
21
|
-
},
|
|
21
|
+
}, fe = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, ye = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, ge = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), we = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1), ve = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _e = { class: "flex items-center gap-8" }, be = /* @__PURE__ */ q({
|
|
22
22
|
__name: "EditRewardSheet",
|
|
23
23
|
emits: ["update"],
|
|
24
|
-
setup(
|
|
25
|
-
const A = f, S =
|
|
24
|
+
setup(Z, { expose: I, emit: f }) {
|
|
25
|
+
const A = f, S = Q(), h = ne(), i = V(!1), o = V(), y = V(), n = te, w = N(
|
|
26
26
|
() => {
|
|
27
27
|
var a;
|
|
28
|
-
return
|
|
28
|
+
return C[((a = o.value) == null ? void 0 : a.type) || "VOUCHER"];
|
|
29
29
|
}
|
|
30
30
|
), P = N(() => {
|
|
31
|
-
const a =
|
|
31
|
+
const a = n.safeParse(o.value);
|
|
32
32
|
return a.success ? [] : a.error.errors;
|
|
33
33
|
});
|
|
34
34
|
function F() {
|
|
35
|
-
const a =
|
|
35
|
+
const a = n.safeParse(o.value);
|
|
36
36
|
a.success && A("update", a.data);
|
|
37
37
|
}
|
|
38
|
-
function E(a, t,
|
|
38
|
+
function E(a, t, r = {
|
|
39
39
|
isStoreReward: !1,
|
|
40
40
|
type: "VOUCHER"
|
|
41
41
|
}) {
|
|
42
|
-
i.value = a, a && (y.value = void 0, o.value = t ||
|
|
42
|
+
i.value = a, a && (y.value = void 0, o.value = t || de(r.type, {
|
|
43
43
|
business: h.currentBusiness.value._id,
|
|
44
|
-
noCampaign:
|
|
44
|
+
noCampaign: r.isStoreReward == !0
|
|
45
45
|
}));
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return Y(async () => {
|
|
48
48
|
await S.readLocations();
|
|
49
|
-
}),
|
|
49
|
+
}), I({
|
|
50
50
|
showSheet: E,
|
|
51
51
|
data: o,
|
|
52
52
|
rewardImage: y
|
|
53
53
|
}), (a, t) => {
|
|
54
|
-
const
|
|
55
|
-
return u(),
|
|
54
|
+
const r = p("FmTextarea"), c = p("FmHelperText"), v = p("FmButton"), L = p("FmSideSheet");
|
|
55
|
+
return u(), b(L, {
|
|
56
56
|
"max-width": 560,
|
|
57
57
|
modelValue: e(i),
|
|
58
|
-
"onUpdate:modelValue": t[
|
|
58
|
+
"onUpdate:modelValue": t[7] || (t[7] = (_) => W(i) ? i.value = _ : null),
|
|
59
59
|
header: "Store setting"
|
|
60
60
|
}, {
|
|
61
61
|
"side-sheet-footer": x(() => [
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
l("div", _e, [
|
|
63
|
+
s(v, {
|
|
64
64
|
label: "Submit",
|
|
65
65
|
onClick: F,
|
|
66
|
-
disabled: e(P).length > 0 || e(
|
|
67
|
-
loading: e(
|
|
66
|
+
disabled: e(P).length > 0 || e(K)().isLoading,
|
|
67
|
+
loading: e(K)().isLoading
|
|
68
68
|
}, null, 8, ["disabled", "loading"]),
|
|
69
|
-
|
|
69
|
+
s(v, {
|
|
70
70
|
label: "Cancel",
|
|
71
|
-
onClick: t[
|
|
71
|
+
onClick: t[6] || (t[6] = (_) => E(!1)),
|
|
72
72
|
variant: "tertiary"
|
|
73
73
|
})
|
|
74
74
|
])
|
|
75
75
|
]),
|
|
76
76
|
default: x(() => {
|
|
77
|
-
var
|
|
77
|
+
var _, T, m;
|
|
78
78
|
return [
|
|
79
|
-
e(o) ? (u(),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
(u(),
|
|
79
|
+
e(o) ? (u(), O("div", pe, [
|
|
80
|
+
l("div", fe, [
|
|
81
|
+
z(" Reward information "),
|
|
82
|
+
(u(), b(H(e(w).chip())))
|
|
83
83
|
]),
|
|
84
|
-
|
|
84
|
+
s(se, {
|
|
85
85
|
modelValue: e(o).name,
|
|
86
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
87
|
-
label: `${e(
|
|
88
|
-
schema: e(
|
|
86
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => e(o).name = d),
|
|
87
|
+
label: `${e(w).name} name`,
|
|
88
|
+
schema: e(g).typeAtPath(e(n), "name", [e(o).type])
|
|
89
89
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
90
|
-
|
|
90
|
+
s(r, {
|
|
91
91
|
class: "!mb-[-16px]",
|
|
92
92
|
modelValue: e(o).description,
|
|
93
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
94
|
-
rules: [e(
|
|
93
|
+
"onUpdate:modelValue": t[1] || (t[1] = (d) => e(o).description = d),
|
|
94
|
+
rules: [e(g).ruleAtPath(e(n), "description", [e(o).type])]
|
|
95
95
|
}, {
|
|
96
96
|
label: x(() => [
|
|
97
|
-
(u(),
|
|
98
|
-
e(
|
|
99
|
-
e(
|
|
100
|
-
`${e(
|
|
97
|
+
(u(), b(H(
|
|
98
|
+
e(g).toInputLabel(
|
|
99
|
+
e(g).typeAtPath(e(n), "description", [e(o).type]),
|
|
100
|
+
`${e(w).name} description`
|
|
101
101
|
)
|
|
102
102
|
)))
|
|
103
103
|
]),
|
|
104
104
|
_: 1
|
|
105
105
|
}, 8, ["modelValue", "rules"]),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
l("div", ye, [
|
|
107
|
+
l("div", null, G(e(w).name) + " description should not exceed 200 characters. ", 1),
|
|
108
|
+
l("div", null, G(((_ = e(o).description) == null ? void 0 : _.length) ?? 0) + "/200", 1)
|
|
109
109
|
]),
|
|
110
|
-
|
|
110
|
+
s(le, {
|
|
111
111
|
class: "w-1/2 xs:w-2/3",
|
|
112
112
|
"aspect-ratio": "16/9",
|
|
113
113
|
file: e(y) ?? void 0,
|
|
114
114
|
thumbnail: e(o).image ?? void 0,
|
|
115
|
-
"onUpdate:file": t[2] || (t[2] = async (
|
|
116
|
-
y.value =
|
|
115
|
+
"onUpdate:file": t[2] || (t[2] = async (d) => {
|
|
116
|
+
y.value = d, d || (e(o).image = null);
|
|
117
117
|
})
|
|
118
118
|
}, {
|
|
119
119
|
label: x(() => [
|
|
120
|
-
(u(),
|
|
121
|
-
e(
|
|
122
|
-
e(
|
|
123
|
-
`${e(
|
|
120
|
+
(u(), b(H(
|
|
121
|
+
e(g).toInputLabel(
|
|
122
|
+
e(g).typeAtPath(e(n), "image", [e(o).type]),
|
|
123
|
+
`${e(w).name} image`
|
|
124
124
|
)
|
|
125
125
|
)))
|
|
126
126
|
]),
|
|
127
127
|
_: 1
|
|
128
128
|
}, 8, ["file", "thumbnail"]),
|
|
129
|
-
e(o).type === "VOUCHER" ? (u(),
|
|
129
|
+
e(o).type === "VOUCHER" ? (u(), O(j, { key: 0 }, [
|
|
130
130
|
ge,
|
|
131
|
-
|
|
131
|
+
s(re, {
|
|
132
132
|
"model-value": e(o).extras.effect,
|
|
133
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
134
|
-
e(o).extras.effect =
|
|
133
|
+
"onUpdate:modelValue": t[3] || (t[3] = (d) => {
|
|
134
|
+
e(o).extras.effect = d;
|
|
135
135
|
})
|
|
136
136
|
}, null, 8, ["model-value"]),
|
|
137
|
-
e(o).extras.effect == null ? (u(),
|
|
137
|
+
e(o).extras.effect == null ? (u(), b(c, {
|
|
138
138
|
key: 0,
|
|
139
139
|
class: "!mt-8",
|
|
140
140
|
text: "Effect is required",
|
|
141
141
|
state: "error"
|
|
142
142
|
})) : U("", !0),
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
we,
|
|
144
|
+
s(me, {
|
|
145
145
|
"model-value": e(o).options,
|
|
146
146
|
"no-campaign": e(o).noCampaign,
|
|
147
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
148
|
-
schema: e(
|
|
147
|
+
"onUpdate:modelValue": t[4] || (t[4] = (d) => e(o).options = d),
|
|
148
|
+
schema: e(g).typeAtPath(e(n), "options", ["VOUCHER"])
|
|
149
149
|
}, null, 8, ["model-value", "no-campaign", "schema"])
|
|
150
150
|
], 64)) : U("", !0),
|
|
151
151
|
ve,
|
|
152
|
-
e(o).type === "VOUCHER" ? (u(),
|
|
152
|
+
e(o).type === "VOUCHER" ? (u(), b(ie, {
|
|
153
153
|
key: 1,
|
|
154
|
-
"model-value": ((
|
|
154
|
+
"model-value": ((m = (T = e(o).extras) == null ? void 0 : T.targetLocation) == null ? void 0 : m.map(String)) ?? null,
|
|
155
155
|
type: "select",
|
|
156
|
-
"onUpdate:modelValue": t[5] || (t[5] = (
|
|
157
|
-
e(o).extras.targetLocation =
|
|
156
|
+
"onUpdate:modelValue": t[5] || (t[5] = (d) => {
|
|
157
|
+
e(o).extras.targetLocation = d;
|
|
158
158
|
}),
|
|
159
159
|
rules: [
|
|
160
|
-
e(
|
|
160
|
+
e(g).ruleAtPath(e(n), "extras.targetLocation", ["VOUCHER"])
|
|
161
161
|
]
|
|
162
|
-
}, null, 8, ["model-value", "rules"])) : U("", !0)
|
|
163
|
-
n(R, {
|
|
164
|
-
modelValue: e(o).internal,
|
|
165
|
-
"onUpdate:modelValue": t[6] || (t[6] = (r) => e(o).internal = r),
|
|
166
|
-
"label-placement": "right",
|
|
167
|
-
label: "Internal only",
|
|
168
|
-
sublabel: `${e(_)[e(o).type].name} will not be shown to customer`
|
|
169
|
-
}, null, 8, ["modelValue", "sublabel"])
|
|
162
|
+
}, null, 8, ["model-value", "rules"])) : U("", !0)
|
|
170
163
|
])) : U("", !0)
|
|
171
164
|
];
|
|
172
165
|
}),
|
|
@@ -174,21 +167,21 @@ const fe = {
|
|
|
174
167
|
}, 8, ["modelValue"]);
|
|
175
168
|
};
|
|
176
169
|
}
|
|
177
|
-
}),
|
|
178
|
-
src:
|
|
170
|
+
}), he = { class: "px-24 flex flex-col gap-y-16" }, Re = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8" }, xe = /* @__PURE__ */ l("img", {
|
|
171
|
+
src: J,
|
|
179
172
|
class: "aspect-square w-[150px]"
|
|
180
|
-
}, null, -1),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
], -1),
|
|
173
|
+
}, null, -1), Fe = /* @__PURE__ */ l("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
174
|
+
/* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Create rewards"),
|
|
175
|
+
/* @__PURE__ */ l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Create rewards for your customers to redeem inside their bundle. ")
|
|
176
|
+
], -1), je = /* @__PURE__ */ q({
|
|
184
177
|
__name: "StoreRewards",
|
|
185
|
-
setup(
|
|
186
|
-
const
|
|
178
|
+
setup(Z) {
|
|
179
|
+
const I = {
|
|
187
180
|
label: "Create reward",
|
|
188
181
|
value: "create",
|
|
189
182
|
isPrimary: !0,
|
|
190
183
|
prependIcon: "add"
|
|
191
|
-
}, f =
|
|
184
|
+
}, f = ee(), { global: A, minor: S } = X, h = ue(), i = V({
|
|
192
185
|
searchKey: "",
|
|
193
186
|
columnFilters: []
|
|
194
187
|
}), o = [
|
|
@@ -201,12 +194,12 @@ const fe = {
|
|
|
201
194
|
header: "Reward type",
|
|
202
195
|
accessorFn: (a) => a.type,
|
|
203
196
|
cell(a) {
|
|
204
|
-
return
|
|
197
|
+
return C[a.row.original.type].chip();
|
|
205
198
|
}
|
|
206
199
|
},
|
|
207
200
|
{
|
|
208
201
|
header: "Validity",
|
|
209
|
-
accessorFn: (a) =>
|
|
202
|
+
accessorFn: (a) => ce(
|
|
210
203
|
"validityOption" in a.options ? a.options.validityOption || {} : {}
|
|
211
204
|
)
|
|
212
205
|
},
|
|
@@ -220,8 +213,8 @@ const fe = {
|
|
|
220
213
|
{
|
|
221
214
|
header: "Actions",
|
|
222
215
|
cell(a) {
|
|
223
|
-
return
|
|
224
|
-
|
|
216
|
+
return R("div", { class: "flex items-center justify-end gap-4" }, [
|
|
217
|
+
R(
|
|
225
218
|
$.FmMenu,
|
|
226
219
|
{
|
|
227
220
|
placement: "bottom-end",
|
|
@@ -230,16 +223,16 @@ const fe = {
|
|
|
230
223
|
}
|
|
231
224
|
},
|
|
232
225
|
{
|
|
233
|
-
"menu-button": () =>
|
|
226
|
+
"menu-button": () => R($.FmButton, {
|
|
234
227
|
icon: "more_vert",
|
|
235
228
|
iconColor: "neutral-gray-400",
|
|
236
229
|
variant: "tertiary"
|
|
237
230
|
}),
|
|
238
231
|
default: () => [
|
|
239
|
-
|
|
232
|
+
R($.FmMenuItem, {
|
|
240
233
|
label: "View collections",
|
|
241
234
|
onClick: async (t) => {
|
|
242
|
-
t.stopPropagation(),
|
|
235
|
+
t.stopPropagation(), w(a.row.original._id);
|
|
243
236
|
}
|
|
244
237
|
}),
|
|
245
238
|
// h(components.FmMenuItem, {
|
|
@@ -249,7 +242,7 @@ const fe = {
|
|
|
249
242
|
// onViewTransactions(props.row.original._id as string);
|
|
250
243
|
// },
|
|
251
244
|
// }),
|
|
252
|
-
|
|
245
|
+
R(
|
|
253
246
|
$.FmMenuItem,
|
|
254
247
|
{
|
|
255
248
|
onClick: async (t) => {
|
|
@@ -257,7 +250,7 @@ const fe = {
|
|
|
257
250
|
}
|
|
258
251
|
},
|
|
259
252
|
{
|
|
260
|
-
label:
|
|
253
|
+
label: R(
|
|
261
254
|
"div",
|
|
262
255
|
{
|
|
263
256
|
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
@@ -274,8 +267,8 @@ const fe = {
|
|
|
274
267
|
}
|
|
275
268
|
], y = N(
|
|
276
269
|
() => f.bundleRewards.filter((a) => a.type == "VOUCHER")
|
|
277
|
-
),
|
|
278
|
-
function
|
|
270
|
+
), n = V();
|
|
271
|
+
function w(a) {
|
|
279
272
|
h.push({
|
|
280
273
|
name: k["$connect-STORE_REWARD_COLLECTIONS"],
|
|
281
274
|
params: { id: a }
|
|
@@ -301,8 +294,8 @@ const fe = {
|
|
|
301
294
|
);
|
|
302
295
|
}
|
|
303
296
|
async function F(a) {
|
|
304
|
-
var
|
|
305
|
-
const t = a ?
|
|
297
|
+
var r;
|
|
298
|
+
const t = a ? ae(f.bundleRewards.find((c) => c._id === a)) : void 0;
|
|
306
299
|
if ((t == null ? void 0 : t.type) === "TITLE") {
|
|
307
300
|
await M.confirm(
|
|
308
301
|
"You cannot edit a title here, please edit it at the Program > Title section.",
|
|
@@ -311,7 +304,7 @@ const fe = {
|
|
|
311
304
|
) && await h.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
312
305
|
return;
|
|
313
306
|
}
|
|
314
|
-
(
|
|
307
|
+
(r = n.value) == null || r.showSheet(!0, t, {
|
|
315
308
|
isStoreReward: !0,
|
|
316
309
|
type: "VOUCHER"
|
|
317
310
|
});
|
|
@@ -319,14 +312,14 @@ const fe = {
|
|
|
319
312
|
async function E(a) {
|
|
320
313
|
await S(
|
|
321
314
|
async () => {
|
|
322
|
-
var t,
|
|
323
|
-
(t =
|
|
315
|
+
var t, r, c, v;
|
|
316
|
+
(t = n.value) != null && t.rewardImage && a.image ? await B.delete(a.image) : (r = n.value) != null && r.rewardImage && (a.image = await B.update(
|
|
324
317
|
a.image || B.collectibleImagePath(
|
|
325
318
|
void 0,
|
|
326
|
-
|
|
319
|
+
n.value.rewardImage
|
|
327
320
|
),
|
|
328
|
-
(c =
|
|
329
|
-
)), a._id ? await D.updateReward(a._id, a) : await D.createReward(a), await f.readRewards(), (
|
|
321
|
+
(c = n.value) == null ? void 0 : c.rewardImage
|
|
322
|
+
)), a._id ? await D.updateReward(a._id, a) : await D.createReward(a), await f.readRewards(), (v = n.value) == null || v.showSheet(!1);
|
|
330
323
|
},
|
|
331
324
|
{
|
|
332
325
|
message: "Updating reward",
|
|
@@ -334,94 +327,94 @@ const fe = {
|
|
|
334
327
|
}
|
|
335
328
|
);
|
|
336
329
|
}
|
|
337
|
-
return
|
|
330
|
+
return Y(async () => {
|
|
338
331
|
await A(async () => {
|
|
339
332
|
await f.readMembership(), await f.readRewards();
|
|
340
333
|
});
|
|
341
334
|
}), (a, t) => {
|
|
342
|
-
const
|
|
343
|
-
return u(),
|
|
344
|
-
|
|
335
|
+
const r = p("FmPageHead"), c = p("FmMenuItem"), v = p("FmSearch"), L = p("FmTable"), _ = p("FmButton"), T = p("FmCard");
|
|
336
|
+
return u(), O(j, null, [
|
|
337
|
+
s(r, {
|
|
345
338
|
title: "Rewards",
|
|
346
339
|
description: "Create and manage rewards for your customers.",
|
|
347
|
-
actions: [
|
|
340
|
+
actions: [I],
|
|
348
341
|
"back-button": !0,
|
|
349
342
|
"onClick:action": t[0] || (t[0] = () => F()),
|
|
350
343
|
"onClick:back": t[1] || (t[1] = () => e(h).push({ name: e(k)["$connect-STORE"] }))
|
|
351
344
|
}, null, 8, ["actions"]),
|
|
352
|
-
|
|
353
|
-
e(y) && e(y).length > 0 ? (u(),
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
345
|
+
l("div", he, [
|
|
346
|
+
e(y) && e(y).length > 0 ? (u(), O(j, { key: 0 }, [
|
|
347
|
+
l("div", Re, [
|
|
348
|
+
l("div", Ce, [
|
|
349
|
+
s(oe, {
|
|
357
350
|
label: `Reward type: ${e(i).columnFilters.length == 0 ? "All" : e(i).columnFilters[0].name}`
|
|
358
351
|
}, {
|
|
359
352
|
default: x(() => [
|
|
360
|
-
|
|
361
|
-
onClick: t[2] || (t[2] = (
|
|
353
|
+
s(c, {
|
|
354
|
+
onClick: t[2] || (t[2] = (m) => e(i).columnFilters = []),
|
|
362
355
|
label: "All"
|
|
363
356
|
}),
|
|
364
|
-
|
|
365
|
-
onClick: t[3] || (t[3] = (
|
|
357
|
+
s(c, {
|
|
358
|
+
onClick: t[3] || (t[3] = (m) => e(i).columnFilters = [
|
|
366
359
|
{
|
|
367
360
|
id: "type",
|
|
368
361
|
value: "VOUCHER",
|
|
369
|
-
name: e(
|
|
362
|
+
name: e(C).VOUCHER.name
|
|
370
363
|
}
|
|
371
364
|
]),
|
|
372
|
-
label: e(
|
|
365
|
+
label: e(C).VOUCHER.name
|
|
373
366
|
}, null, 8, ["label"]),
|
|
374
|
-
|
|
375
|
-
onClick: t[4] || (t[4] = (
|
|
367
|
+
s(c, {
|
|
368
|
+
onClick: t[4] || (t[4] = (m) => e(i).columnFilters = [
|
|
376
369
|
{
|
|
377
370
|
id: "type",
|
|
378
371
|
value: "TITLE",
|
|
379
|
-
name: e(
|
|
372
|
+
name: e(C).TITLE.name
|
|
380
373
|
}
|
|
381
374
|
]),
|
|
382
|
-
label: e(
|
|
375
|
+
label: e(C).TITLE.name
|
|
383
376
|
}, null, 8, ["label"])
|
|
384
377
|
]),
|
|
385
378
|
_: 1
|
|
386
379
|
}, 8, ["label"])
|
|
387
380
|
]),
|
|
388
|
-
|
|
381
|
+
s(v, {
|
|
389
382
|
modelValue: e(i).searchKey,
|
|
390
|
-
"onUpdate:modelValue": t[5] || (t[5] = (
|
|
383
|
+
"onUpdate:modelValue": t[5] || (t[5] = (m) => e(i).searchKey = m),
|
|
391
384
|
class: "",
|
|
392
385
|
placeholder: "search",
|
|
393
386
|
collapsible: ""
|
|
394
387
|
}, null, 8, ["modelValue"])
|
|
395
388
|
]),
|
|
396
|
-
|
|
389
|
+
s(L, {
|
|
397
390
|
"row-data": e(y),
|
|
398
391
|
"column-defs": o,
|
|
399
392
|
"search-value": e(i).searchKey,
|
|
400
393
|
"column-filter": e(i).columnFilters,
|
|
401
|
-
onRowClick: t[6] || (t[6] = (
|
|
394
|
+
onRowClick: t[6] || (t[6] = (m) => F(m.original._id)),
|
|
402
395
|
"hide-footer": e(y).length < 10
|
|
403
396
|
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
404
|
-
], 64)) : (u(),
|
|
397
|
+
], 64)) : (u(), b(T, {
|
|
405
398
|
key: 1,
|
|
406
399
|
variant: "outlined",
|
|
407
400
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
408
401
|
}, {
|
|
409
402
|
default: x(() => [
|
|
403
|
+
xe,
|
|
410
404
|
Fe,
|
|
411
|
-
|
|
412
|
-
n(L, {
|
|
405
|
+
s(_, {
|
|
413
406
|
variant: "primary",
|
|
414
407
|
label: "Create reward",
|
|
415
|
-
onClick: t[7] || (t[7] = (
|
|
408
|
+
onClick: t[7] || (t[7] = (m) => F()),
|
|
416
409
|
icon: "add"
|
|
417
410
|
})
|
|
418
411
|
]),
|
|
419
412
|
_: 1
|
|
420
413
|
})),
|
|
421
|
-
|
|
414
|
+
s(be, {
|
|
422
415
|
ref_key: "rewardSheetRef",
|
|
423
|
-
ref:
|
|
424
|
-
onUpdate: t[8] || (t[8] = (
|
|
416
|
+
ref: n,
|
|
417
|
+
onUpdate: t[8] || (t[8] = (m) => E(m))
|
|
425
418
|
}, null, 512)
|
|
426
419
|
])
|
|
427
420
|
], 64);
|
|
@@ -429,5 +422,5 @@ const fe = {
|
|
|
429
422
|
}
|
|
430
423
|
});
|
|
431
424
|
export {
|
|
432
|
-
|
|
425
|
+
je as default
|
|
433
426
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as P, ref as k, computed as $, onMounted as z, resolveComponent as x, openBlock as R, createBlock as O, unref as n, withCtx as N, createVNode as g, normalizeClass as U, createCommentVNode as oe, createElementVNode as C, toDisplayString as q, createElementBlock as L, Fragment as le, renderList as se, mergeModels as K, useModel as ie, watch as j, onBeforeMount as ce, h as c } from "vue";
|
|
2
2
|
import { components as S } from "@feedmepos/ui-library";
|
|
3
|
-
import { d as ue } from "./index-
|
|
4
|
-
import { a as X } from "./loading-
|
|
3
|
+
import { d as ue } from "./index-AeZIrHi3.js";
|
|
4
|
+
import { a as X } from "./loading-D7uTV0-9.js";
|
|
5
5
|
import { s as de } from "./index-Dbd4WA4r.js";
|
|
6
6
|
import { h as b } from "./moment-BWErdI6_.js";
|
|
7
7
|
import { s as Y } from "./index-CuvNtC_M.js";
|
|
8
|
-
import { f as H } from "./number-
|
|
9
|
-
import { e as G, j as me, S as pe, h as fe, b as ge } from "./app-
|
|
10
|
-
import { u as J, _ as Q } from "./usePagination-
|
|
8
|
+
import { f as H } from "./number-CNiMHNNi.js";
|
|
9
|
+
import { e as G, j as me, S as pe, h as fe, b as ge } from "./app-CzpQo8NQ.js";
|
|
10
|
+
import { u as J, _ as Q } from "./usePagination-CwZ7gv3m.js";
|
|
11
11
|
import { g as Z } from "./user-Bm4KttFq.js";
|
|
12
|
-
import { B as ee, a as te } from "./export-
|
|
12
|
+
import { B as ee, a as te } from "./export-pnyF_Nqa.js";
|
|
13
13
|
import { o as A } from "./objectId-dwaoBfJX.js";
|
|
14
14
|
function ye(o) {
|
|
15
15
|
let s = "";
|
|
@@ -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 b, createBlock as S, isRef as U, withCtx as F } from "vue";
|
|
2
|
-
import { b as T } from "./app-
|
|
2
|
+
import { b as T } from "./app-CzpQo8NQ.js";
|
|
3
3
|
function j(l, s, n) {
|
|
4
4
|
return l.some(
|
|
5
5
|
n instanceof Function ? n : (a) => a === s
|