@feedmepos/mf-connect 0.0.8 → 0.0.9
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-BxRuK2P2.js → Analytic-CwaN0mge.js} +68 -69
- package/dist/{Broadcast-BqGojAWW.js → Broadcast-Cjx5xzUC.js} +27 -28
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-VzcVMS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4mO5aik.js} +34 -34
- package/dist/Card-DbY6YaXk.js +827 -0
- package/dist/{Collections-DvdDRozp.js → Collections-DRN2gzwh.js} +158 -168
- package/dist/{Credit-BeHm7_2S.js → Credit-DOcrzykJ.js} +11 -12
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js} +359 -333
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js → EffectSheet.vue_vue_type_style_index_0_lang-EF_rHfwT.js} +5 -5
- package/dist/{Experience-CtDY9u4Y.js → Experience-aQj-3H2Y.js} +11 -12
- package/dist/{Game-DjaYuqcb.js → Game-Cnje-m_M.js} +22 -23
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js → ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js} +8 -8
- package/dist/{MainLayout-B-iAZM2k.js → MainLayout-Cxl9yLPs.js} +1 -1
- package/dist/{Marketing-BJJltAh-.js → Marketing-BYUcbcMU.js} +19 -20
- package/dist/{Member-eJ9Pdi5w.js → Member-D7K9fm_Q.js} +2 -2
- package/dist/MemberList-DbXkxUzF.js +1717 -0
- package/dist/{MemberTransactions-DRET8mSQ.js → MemberTransactions-DED1SYwX.js} +4 -4
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js +203 -0
- package/dist/{Point-DPTOgJbC.js → Point-CQm8whVQ.js} +11 -12
- package/dist/{Promotion-wzkRuNqO.js → Promotion-DzVXy_C9.js} +42 -44
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Z06eB5i5.js → RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js} +12 -12
- package/dist/Segment-D3o0D3Uv.js +407 -0
- package/dist/{Setting-CXuZu0-m.js → Setting-pCzenLoL.js} +17 -18
- package/dist/{Store-4Um9keEp.js → Store-DEwEIFYD.js} +18 -19
- package/dist/{StoreRewards-B-UFeyQM.js → StoreRewards-D7vnZN4f.js} +86 -87
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-ALzQU3th.js +793 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js} +1 -1
- package/dist/{Tier-C6KVsxGO.js → Tier-BJbX5CPB.js} +401 -377
- package/dist/{Title-DuN1ahIM.js → Title-C9xV6rBg.js} +274 -248
- package/dist/Transaction-C8OHlhzR.js +36 -0
- package/dist/Voucher-eZwm7N1D.js +481 -0
- package/dist/{app-CxBTTB31.js → app-DgbDbhL-.js} +34 -34
- package/dist/app.js +1 -1
- package/dist/{campaign-B0aXkadj.js → campaign-BkvrUTEJ.js} +2 -2
- package/dist/{dto-BtdVC-Ab.js → dto-YYVhW73A.js} +52 -53
- package/dist/{effect-BUN6rkQM.js → effect-f7DAPYC8.js} +1 -1
- package/dist/export-BXbCXTfd.js +97 -0
- package/dist/{helper-Cpq3x8K5.js → helper-BhvQ9m6d.js} +1 -1
- package/dist/{index-D2Juhkdw.js → index-BhacKx5B.js} +85 -83
- package/dist/{index-DDSLx7vu.js → index-BsEqtUmY.js} +2 -2
- package/dist/{index-0GYrZr4L.js → index-CdtrQ9tR.js} +5 -5
- package/dist/{index-8clzk3uX.js → index-Cfo2A0Se.js} +1 -1
- package/dist/index-Cz5RZlYh.js +73 -0
- package/dist/{index-BTntbYTS.js → index-DQC_1tRF.js} +1 -1
- package/dist/{index-DysVCkrx.js → index-Dd3hrFcQ.js} +3 -3
- package/dist/{index-CK9yJMj7.js → index-FWp9M1yS.js} +5 -5
- package/dist/{index-C6NgUSl2.js → index-VmFlM704.js} +1 -1
- package/dist/{index-BvnZdJBY.js → index-oQLJE4Uw.js} +2 -2
- package/dist/libs/packages/core/src/collectible/collectible.dto.d.ts +6 -0
- package/dist/{plugins-B_d-WFtN.js → loading-DQaawbHE.js} +8204 -8108
- package/dist/{lodash-DsT1nK-T.js → lodash-DzdmTD20.js} +1 -1
- package/dist/{membership-DtD45RXh.js → membership-Dq2-b-S_.js} +3 -3
- package/dist/{money-CFI1TMCS.js → money-vzwOUBrp.js} +1 -1
- package/dist/{number-BBtf4fYz.js → number-CBzs6rfW.js} +1 -1
- package/dist/packages/connect/src/components/campaign/CampaignSummary.vue.d.ts +13 -0
- package/dist/packages/connect/src/composables/export.d.ts +11 -0
- package/dist/packages/connect/src/export/base.export.d.ts +7 -0
- package/dist/packages/connect/src/export/card.export.d.ts +5 -6
- package/dist/packages/connect/src/export/collection-transaction.export.d.ts +14 -0
- package/dist/packages/connect/src/export/index.d.ts +1 -0
- package/dist/packages/connect/src/export/store-transaction.export.d.ts +14 -0
- package/dist/packages/connect/src/helpers/user.d.ts +6 -0
- package/dist/{rule-CB9Qlcx1.js → rule-BR5rrmUV.js} +2 -2
- package/dist/{rule-builder-BIKcA4Bg.js → rule-builder-7GBNrPXt.js} +1 -1
- package/dist/{template-qlb46PGl.js → template-CETJ6lkf.js} +5 -5
- package/dist/{usePagination-CX66ab1Y.js → usePagination-DdZeE4Tt.js} +57 -56
- package/dist/user-Bm4KttFq.js +37 -0
- package/dist/{xlsx-DMaFso0k.js → xlsx-CDAKxZE_.js} +1 -1
- package/package.json +1 -1
- package/dist/Card-Dlj5jQp4.js +0 -792
- package/dist/MemberList-CrhMqUfJ.js +0 -1664
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D-ttMwn2.js +0 -166
- package/dist/Segment-DnsPrP7Q.js +0 -371
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js +0 -660
- package/dist/Transaction-DdfX7Xfe.js +0 -34
- package/dist/Voucher-DarXrxZr.js +0 -454
- package/dist/index-Dg-PMgXV.js +0 -64
- package/dist/loading-Cxp7sI5p.js +0 -100
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as m, ref as i, resolveComponent as p, openBlock as t, createElementBlock as _, createVNode as d, unref as e, createBlock as r, createCommentVNode as f } from "vue";
|
|
2
|
-
import { _ as v, a as b } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import {
|
|
4
|
-
const x = { class: "flex flex-col gap-y-32 pb-24" },
|
|
2
|
+
import { _ as v, a as b } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-ALzQU3th.js";
|
|
3
|
+
import { R as k } from "./app-DgbDbhL-.js";
|
|
4
|
+
const x = { class: "flex flex-col gap-y-32 pb-24" }, V = /* @__PURE__ */ m({
|
|
5
5
|
__name: "MemberTransactions",
|
|
6
6
|
setup(C) {
|
|
7
7
|
const l = [
|
|
@@ -34,5 +34,5 @@ const x = { class: "flex flex-col gap-y-32 pb-24" }, F = /* @__PURE__ */ m({
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
V as default
|
|
38
38
|
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { defineComponent as M, ref as C, computed as E, onMounted as D, resolveComponent as l, openBlock as p, createElementBlock as v, createElementVNode as m, createVNode as c, unref as u, withCtx as h, createTextVNode as F, toDisplayString as T, Fragment as j, renderList as k, createBlock as U } from "vue";
|
|
2
|
+
import { p as A } from "./loading-DQaawbHE.js";
|
|
3
|
+
import { r as B } from "./index-CdtrQ9tR.js";
|
|
4
|
+
const L = {
|
|
5
|
+
"user.name": {
|
|
6
|
+
name: "User name"
|
|
7
|
+
},
|
|
8
|
+
"user.birthday": {
|
|
9
|
+
name: "Birthday"
|
|
10
|
+
},
|
|
11
|
+
"user.joinAt": {
|
|
12
|
+
name: "Join at"
|
|
13
|
+
},
|
|
14
|
+
"user.expiringVouchers.days7": {
|
|
15
|
+
name: "Expiring vouchers in 7 days"
|
|
16
|
+
},
|
|
17
|
+
"user.expiringVouchers.days30": {
|
|
18
|
+
name: "Expiring vouchers in 30 days"
|
|
19
|
+
},
|
|
20
|
+
"user.expiringVouchers.days90": {
|
|
21
|
+
name: "Expiring vouchers in 90 days"
|
|
22
|
+
},
|
|
23
|
+
"user.tier": {
|
|
24
|
+
name: "User tier"
|
|
25
|
+
},
|
|
26
|
+
"user.point": {
|
|
27
|
+
name: "User experience"
|
|
28
|
+
},
|
|
29
|
+
"transaction.amount": {
|
|
30
|
+
name: "Reward amount"
|
|
31
|
+
},
|
|
32
|
+
"collectible.name": {
|
|
33
|
+
name: "Reward name"
|
|
34
|
+
}
|
|
35
|
+
}, O = { class: "space-y-0" }, $ = { class: "flex items-center gap-8 justify-between" }, I = /* @__PURE__ */ m("div", { class: "fm-typo-en-body-lg-400" }, "Add message", -1), N = { class: "relative" }, P = { class: "absolute bottom-[24px] right-[4px]" }, K = /* @__PURE__ */ M({
|
|
36
|
+
__name: "MessageInput",
|
|
37
|
+
props: {
|
|
38
|
+
modelValue: {
|
|
39
|
+
type: Object
|
|
40
|
+
},
|
|
41
|
+
triggerType: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: () => "SCHEDULE"
|
|
44
|
+
},
|
|
45
|
+
helperText: {
|
|
46
|
+
type: String
|
|
47
|
+
},
|
|
48
|
+
helperState: {
|
|
49
|
+
type: String
|
|
50
|
+
},
|
|
51
|
+
variables: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => [
|
|
54
|
+
"user.name",
|
|
55
|
+
"user.birthday",
|
|
56
|
+
"user.joinAt",
|
|
57
|
+
"user.expiringVouchers.days7",
|
|
58
|
+
"user.expiringVouchers.days30",
|
|
59
|
+
"user.expiringVouchers.days90",
|
|
60
|
+
"user.tier",
|
|
61
|
+
"user.point",
|
|
62
|
+
"transaction.amount",
|
|
63
|
+
"collectible.name"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
placeholder: {
|
|
67
|
+
type: String
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
emits: ["update:model-value"],
|
|
71
|
+
setup(r, { emit: V }) {
|
|
72
|
+
const n = r, g = V;
|
|
73
|
+
function S() {
|
|
74
|
+
var t;
|
|
75
|
+
const a = {
|
|
76
|
+
user: {
|
|
77
|
+
name: "John Doe",
|
|
78
|
+
tier: 1,
|
|
79
|
+
point: 1283,
|
|
80
|
+
birthday: (/* @__PURE__ */ new Date("2000-10-02T16:00:00.000Z")).toLocaleDateString(),
|
|
81
|
+
joinAt: (/* @__PURE__ */ new Date("2024-06-14")).toLocaleDateString(),
|
|
82
|
+
expiringVouchers: { days7: 3, days30: 5, days90: 5 }
|
|
83
|
+
},
|
|
84
|
+
transaction: {
|
|
85
|
+
amount: 3
|
|
86
|
+
},
|
|
87
|
+
collectible: {
|
|
88
|
+
name: "RM10 Voucher"
|
|
89
|
+
}
|
|
90
|
+
}, e = B(
|
|
91
|
+
((t = n.modelValue) == null ? void 0 : t.content) ?? "",
|
|
92
|
+
a
|
|
93
|
+
);
|
|
94
|
+
A.confirm(e, "Preview message", "OK");
|
|
95
|
+
}
|
|
96
|
+
function d(a) {
|
|
97
|
+
g("update:model-value", {
|
|
98
|
+
channel: "SMS",
|
|
99
|
+
content: a,
|
|
100
|
+
language: "en",
|
|
101
|
+
variables: n.variables
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const _ = C(n.helperState || "none"), y = E(() => {
|
|
105
|
+
var t;
|
|
106
|
+
const a = ((t = n.modelValue) == null ? void 0 : t.content.replace(/{{([^}]+)}}/g, (s, o) => {
|
|
107
|
+
switch (o) {
|
|
108
|
+
case "user.name":
|
|
109
|
+
return "1234567890";
|
|
110
|
+
case "user.tier":
|
|
111
|
+
return "1";
|
|
112
|
+
case "user.point":
|
|
113
|
+
return "1000";
|
|
114
|
+
case "user.birthday":
|
|
115
|
+
return "01/01/2024";
|
|
116
|
+
case "user.joinAt":
|
|
117
|
+
return "01/01/2024";
|
|
118
|
+
case "user.expiringVouchers.days7":
|
|
119
|
+
case "user.expiringVouchers.days30":
|
|
120
|
+
case "user.expiringVouchers.days90":
|
|
121
|
+
return "5";
|
|
122
|
+
case "transaction.amount":
|
|
123
|
+
return "100";
|
|
124
|
+
case "collectible.name":
|
|
125
|
+
return "Voucher";
|
|
126
|
+
default:
|
|
127
|
+
return "...";
|
|
128
|
+
}
|
|
129
|
+
})) || "";
|
|
130
|
+
let e = 0;
|
|
131
|
+
for (let s = 0; s < a.length; s++) {
|
|
132
|
+
const o = a.charAt(s);
|
|
133
|
+
/[\u4e00-\u9fff\u3040-\u30ff\u3400-\u4dbf]/.test(o) || /[{}\\~\[\]|\^€]/.test(o) ? e += 2 : e += 1;
|
|
134
|
+
}
|
|
135
|
+
return `Character used: ${e} ≈ ${Math.ceil(e / 160)} SMS (Every 160 characters will be sent as 1 SMS)`;
|
|
136
|
+
});
|
|
137
|
+
return D(() => {
|
|
138
|
+
g("update:model-value", {
|
|
139
|
+
...n.modelValue,
|
|
140
|
+
variables: n.variables
|
|
141
|
+
}), n.modelValue || d("");
|
|
142
|
+
}), (a, e) => {
|
|
143
|
+
var x;
|
|
144
|
+
const t = l("FmButton"), s = l("FmTextarea"), o = l("FmMenuItem"), w = l("FmMenu");
|
|
145
|
+
return p(), v("div", O, [
|
|
146
|
+
m("div", $, [
|
|
147
|
+
I,
|
|
148
|
+
c(t, {
|
|
149
|
+
icon: "visibility",
|
|
150
|
+
label: "Preview message",
|
|
151
|
+
variant: "plain",
|
|
152
|
+
onClick: S
|
|
153
|
+
})
|
|
154
|
+
]),
|
|
155
|
+
m("div", N, [
|
|
156
|
+
c(s, {
|
|
157
|
+
"model-value": (x = r.modelValue) == null ? void 0 : x.content,
|
|
158
|
+
"onUpdate:modelValue": d,
|
|
159
|
+
"show-word-count": !0,
|
|
160
|
+
placeholder: r.placeholder,
|
|
161
|
+
"helper-state": u(_) || "none",
|
|
162
|
+
"helper-text": u(y)
|
|
163
|
+
}, {
|
|
164
|
+
"helper-text": h(() => [
|
|
165
|
+
F(T(u(y)), 1)
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}, 8, ["model-value", "placeholder", "helper-state", "helper-text"]),
|
|
169
|
+
m("div", P, [
|
|
170
|
+
c(w, { placement: "left-end" }, {
|
|
171
|
+
"menu-button": h(() => [
|
|
172
|
+
c(t, {
|
|
173
|
+
icon: "add",
|
|
174
|
+
variant: "tertiary",
|
|
175
|
+
size: "md"
|
|
176
|
+
})
|
|
177
|
+
]),
|
|
178
|
+
default: h(() => [
|
|
179
|
+
(p(!0), v(j, null, k(r.variables.filter(
|
|
180
|
+
(i) => r.triggerType == "SCHEDULE" ? !i.startsWith("transaction.") : !0
|
|
181
|
+
), (i) => {
|
|
182
|
+
var f;
|
|
183
|
+
return p(), U(o, {
|
|
184
|
+
key: i,
|
|
185
|
+
label: ((f = u(L)[i]) == null ? void 0 : f.name) || i,
|
|
186
|
+
onClick: (R) => {
|
|
187
|
+
var b;
|
|
188
|
+
return d(((b = r.modelValue) == null ? void 0 : b.content) + `{{${i}}}`);
|
|
189
|
+
}
|
|
190
|
+
}, null, 8, ["label", "onClick"]);
|
|
191
|
+
}), 128))
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
})
|
|
195
|
+
])
|
|
196
|
+
])
|
|
197
|
+
]);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
export {
|
|
202
|
+
K as _
|
|
203
|
+
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { defineComponent as A, ref as k, computed as D, onMounted as T, resolveComponent as i, openBlock as c, createElementBlock as g, Fragment as _, createVNode as r, unref as a, createElementVNode as n, withCtx as h, renderList as j, createBlock as C, resolveDynamicComponent as E, toDisplayString as f, h as M } from "vue";
|
|
2
2
|
import { _ as H } from "./campaign-CpzFl8Vr.js";
|
|
3
3
|
import { useDialog as q, components as z } from "@feedmepos/ui-library";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { g as S, b as V } from "./dto-BtdVC-Ab.js";
|
|
4
|
+
import { u as G, p as J } from "./loading-DQaawbHE.js";
|
|
5
|
+
import { a as Q } from "./app-DgbDbhL-.js";
|
|
6
|
+
import { u as W } from "./campaign-BkvrUTEJ.js";
|
|
7
|
+
import { g as S, b as V } from "./dto-YYVhW73A.js";
|
|
9
8
|
import { _ as X } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
10
|
-
import { _ as Y } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-
|
|
11
|
-
import { u as Z } from "./template-
|
|
12
|
-
import { c as y } from "./index-
|
|
9
|
+
import { _ as Y } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js";
|
|
10
|
+
import { u as Z } from "./template-CETJ6lkf.js";
|
|
11
|
+
import { c as y } from "./index-DQC_1tRF.js";
|
|
13
12
|
const ee = { class: "px-24 flex flex-col gap-y-16" }, te = { class: "flex items-center justify-between w-full" }, oe = { class: "flex gap-8 overflow-x-auto" }, ae = { class: "space-y-8" }, ne = { class: "flex w-full gap-4 items-center" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, re = { class: "space-y-4" }, ie = { class: "fm-typo-en-body-lg-600" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = /* @__PURE__ */ n("img", {
|
|
14
13
|
src: H,
|
|
15
14
|
class: "aspect-square w-[150px]"
|
|
16
15
|
}, null, -1), de = /* @__PURE__ */ n("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
17
16
|
/* @__PURE__ */ n("div", { class: "fm-typo-en-title-sm-800" }, "Create your point program"),
|
|
18
17
|
/* @__PURE__ */ n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Points are virtual point that customers can earn and use to purchase bundle items. ")
|
|
19
|
-
], -1),
|
|
18
|
+
], -1), Fe = /* @__PURE__ */ A({
|
|
20
19
|
__name: "Point",
|
|
21
20
|
setup(pe) {
|
|
22
21
|
const L = {
|
|
@@ -24,7 +23,7 @@ const ee = { class: "px-24 flex flex-col gap-y-16" }, te = { class: "flex items-
|
|
|
24
23
|
value: "create",
|
|
25
24
|
isPrimary: !0,
|
|
26
25
|
prependIcon: "add"
|
|
27
|
-
}, P = Z("COIN", q()), I = Q(), l = W(), { global: B, minor: w } =
|
|
26
|
+
}, P = Z("COIN", q()), I = Q(), l = W(), { global: B, minor: w } = G, s = k({
|
|
28
27
|
searchKey: "",
|
|
29
28
|
location: null
|
|
30
29
|
}), p = D(
|
|
@@ -62,7 +61,7 @@ const ee = { class: "px-24 flex flex-col gap-y-16" }, te = { class: "flex items-
|
|
|
62
61
|
}
|
|
63
62
|
], x = k();
|
|
64
63
|
async function v(e) {
|
|
65
|
-
await
|
|
64
|
+
await J.remove(`Are you sure you want to remove ${e.name}?`) && await w(
|
|
66
65
|
async () => {
|
|
67
66
|
await y.delete(e._id), await l.read("COIN");
|
|
68
67
|
},
|
|
@@ -208,5 +207,5 @@ const ee = { class: "px-24 flex flex-col gap-y-16" }, te = { class: "flex items-
|
|
|
208
207
|
}
|
|
209
208
|
});
|
|
210
209
|
export {
|
|
211
|
-
|
|
210
|
+
Fe as default
|
|
212
211
|
};
|
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
import { defineComponent as A, ref as
|
|
1
|
+
import { defineComponent as A, ref as k, computed as D, onMounted as j, resolveComponent as i, openBlock as c, createElementBlock as g, Fragment as y, createVNode as s, unref as l, createElementVNode as a, withCtx as _, renderList as E, createBlock as h, resolveDynamicComponent as H, toDisplayString as P, h as q } from "vue";
|
|
2
2
|
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
3
|
import { useDialog as G, components as J } from "@feedmepos/ui-library";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { e as L } from "./effect-BUN6rkQM.js";
|
|
4
|
+
import { c as S, u as Q, p as W } from "./loading-DQaawbHE.js";
|
|
5
|
+
import { a as X } from "./app-DgbDbhL-.js";
|
|
6
|
+
import { u as Y } from "./campaign-BkvrUTEJ.js";
|
|
7
|
+
import { g as O } from "./dto-YYVhW73A.js";
|
|
8
|
+
import { e as L } from "./effect-f7DAPYC8.js";
|
|
10
9
|
import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
11
|
-
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { u as oe } from "./template-
|
|
13
|
-
import { c as f } from "./index-
|
|
14
|
-
const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, ne = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, ie = { class: "
|
|
10
|
+
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js";
|
|
11
|
+
import { u as oe } from "./template-CETJ6lkf.js";
|
|
12
|
+
import { c as f } from "./index-DQC_1tRF.js";
|
|
13
|
+
const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, ne = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, ie = { class: "space-y-4" }, re = { class: "fm-typo-en-body-lg-600" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = /* @__PURE__ */ a("img", {
|
|
15
14
|
src: z,
|
|
16
15
|
class: "aspect-square w-[150px]"
|
|
17
|
-
}, null, -1),
|
|
16
|
+
}, null, -1), de = /* @__PURE__ */ a("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
18
17
|
/* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Create promotion campaign"),
|
|
19
18
|
/* @__PURE__ */ a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Special offers or deals made available for a limited time to encourage user engagement and purchases. Promotions are generally available to all eligible users without the need for a specific code and are applied by merchant during the promotional period. ")
|
|
20
|
-
], -1),
|
|
19
|
+
], -1), ke = /* @__PURE__ */ A({
|
|
21
20
|
__name: "Promotion",
|
|
22
|
-
setup(
|
|
21
|
+
setup(pe) {
|
|
23
22
|
const V = {
|
|
24
23
|
label: "Create campaign",
|
|
25
24
|
value: "create",
|
|
26
25
|
isPrimary: !0,
|
|
27
26
|
prependIcon: "add"
|
|
28
|
-
}, $ = oe("PROMOTION", G()),
|
|
27
|
+
}, $ = oe("PROMOTION", G()), v = X(), p = Y(), { global: T, minor: w } = Q, n = k({
|
|
29
28
|
searchKey: "",
|
|
30
29
|
location: null
|
|
31
30
|
}), r = D(
|
|
32
31
|
() => p.campaigns.promotion.filter(
|
|
33
32
|
(e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
|
|
34
33
|
)
|
|
35
|
-
),
|
|
34
|
+
), I = [
|
|
36
35
|
{
|
|
37
36
|
header: "Promotion title",
|
|
38
37
|
accessorFn: (e) => e.name
|
|
@@ -59,14 +58,14 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
59
58
|
icon: "delete",
|
|
60
59
|
iconColor: "neutral-gray-400",
|
|
61
60
|
onClick: (t) => {
|
|
62
|
-
t.stopPropagation(),
|
|
61
|
+
t.stopPropagation(), x(e.row.original);
|
|
63
62
|
}
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
|
-
],
|
|
68
|
-
async function
|
|
69
|
-
await
|
|
66
|
+
], b = k();
|
|
67
|
+
async function x(e) {
|
|
68
|
+
await W.remove(`Are you sure you want to remove ${e.name}?`) && await w(
|
|
70
69
|
async () => {
|
|
71
70
|
await f.delete(e._id), await p.read("PROMOTION");
|
|
72
71
|
},
|
|
@@ -82,7 +81,7 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
82
81
|
});
|
|
83
82
|
async function t(m) {
|
|
84
83
|
var d;
|
|
85
|
-
(d =
|
|
84
|
+
(d = b.value) == null || d.showSheet(
|
|
86
85
|
!0,
|
|
87
86
|
"PROMOTION",
|
|
88
87
|
e ? await f.readById(e._id) : void 0,
|
|
@@ -90,8 +89,8 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
90
89
|
);
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
|
-
async function
|
|
94
|
-
await
|
|
92
|
+
async function R(e) {
|
|
93
|
+
await w(
|
|
95
94
|
async () => {
|
|
96
95
|
e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("PROMOTION");
|
|
97
96
|
},
|
|
@@ -102,12 +101,12 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
102
101
|
);
|
|
103
102
|
}
|
|
104
103
|
return j(async () => {
|
|
105
|
-
await
|
|
106
|
-
await
|
|
104
|
+
await T(async () => {
|
|
105
|
+
await v.readLocations(), await p.read("PROMOTION");
|
|
107
106
|
});
|
|
108
107
|
}), (e, t) => {
|
|
109
|
-
const m = i("FmPageHead"), d = i("FmSearch"), B = i("FmTable"), M = i("FmChip"),
|
|
110
|
-
return c(), y
|
|
108
|
+
const m = i("FmPageHead"), d = i("FmSearch"), B = i("FmTable"), M = i("FmChip"), C = i("FmButton"), K = i("FmListItem"), N = i("FmList"), U = i("FmCard");
|
|
109
|
+
return c(), g(y, null, [
|
|
111
110
|
s(m, {
|
|
112
111
|
title: "Promotion",
|
|
113
112
|
actions: l(r).length > 0 ? [V] : [],
|
|
@@ -121,7 +120,7 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
121
120
|
placeholder: "search",
|
|
122
121
|
collapsible: ""
|
|
123
122
|
}, null, 8, ["modelValue"]),
|
|
124
|
-
l(r) && l(r).length > 0 ? (c(), y
|
|
123
|
+
l(r) && l(r).length > 0 ? (c(), g(y, { key: 0 }, [
|
|
125
124
|
a("div", ae, [
|
|
126
125
|
a("div", ne, [
|
|
127
126
|
s(Z, {
|
|
@@ -131,7 +130,7 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
131
130
|
"show-item-label": !0,
|
|
132
131
|
icon: "storefront",
|
|
133
132
|
placement: "bottom-start",
|
|
134
|
-
items: l(
|
|
133
|
+
items: l(v).locationItems
|
|
135
134
|
}, null, 8, ["modelValue", "items"])
|
|
136
135
|
]),
|
|
137
136
|
s(d, {
|
|
@@ -145,7 +144,7 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
145
144
|
s(B, {
|
|
146
145
|
class: "xs:hidden",
|
|
147
146
|
"row-data": l(r),
|
|
148
|
-
"column-defs":
|
|
147
|
+
"column-defs": I,
|
|
149
148
|
"search-value": n.value.searchKey,
|
|
150
149
|
"column-filter": [],
|
|
151
150
|
onRowClick: t[4] || (t[4] = (o) => u(o.original)),
|
|
@@ -153,11 +152,11 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
153
152
|
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
154
153
|
s(N, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
155
154
|
default: _(() => [
|
|
156
|
-
(c(!0), y
|
|
155
|
+
(c(!0), g(y, null, E(l(r).filter(
|
|
157
156
|
(o) => o.name.toLowerCase().includes(n.value.searchKey.toLowerCase())
|
|
158
157
|
), (o) => (c(), h(K, {
|
|
159
158
|
key: o._id.toString(),
|
|
160
|
-
onClick: (
|
|
159
|
+
onClick: (F) => u(o),
|
|
161
160
|
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
162
161
|
}, {
|
|
163
162
|
default: _(() => [
|
|
@@ -168,19 +167,18 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
168
167
|
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
169
168
|
compact: !0,
|
|
170
169
|
label: `${l(S).title(o.effect.options.target)} promotion`
|
|
171
|
-
}, null, 8, ["label"])
|
|
172
|
-
a("div", ie, v(o.currentReceive ?? 0) + " used ", 1)
|
|
170
|
+
}, null, 8, ["label"])
|
|
173
171
|
]),
|
|
174
|
-
a("div",
|
|
175
|
-
a("div",
|
|
176
|
-
a("div",
|
|
172
|
+
a("div", ie, [
|
|
173
|
+
a("div", re, P(o.name), 1),
|
|
174
|
+
a("div", ce, P(l(L)(o.effect)), 1)
|
|
177
175
|
])
|
|
178
176
|
]),
|
|
179
|
-
s(
|
|
177
|
+
s(C, {
|
|
180
178
|
icon: "delete",
|
|
181
179
|
"icon-color": "neutral-gray-400",
|
|
182
180
|
variant: "tertiary",
|
|
183
|
-
onClick: (
|
|
181
|
+
onClick: (F) => (F.stopPropagation(), x(o))
|
|
184
182
|
}, null, 8, ["onClick"])
|
|
185
183
|
]),
|
|
186
184
|
_: 2
|
|
@@ -194,9 +192,9 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
194
192
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
195
193
|
}, {
|
|
196
194
|
default: _(() => [
|
|
195
|
+
me,
|
|
197
196
|
de,
|
|
198
|
-
|
|
199
|
-
s(F, {
|
|
197
|
+
s(C, {
|
|
200
198
|
variant: "primary",
|
|
201
199
|
label: "Create promotion campaign",
|
|
202
200
|
icon: "add",
|
|
@@ -208,13 +206,13 @@ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
|
|
|
208
206
|
]),
|
|
209
207
|
s(ee, {
|
|
210
208
|
ref_key: "sheetRef",
|
|
211
|
-
ref:
|
|
212
|
-
"onSubmit:modelValue":
|
|
209
|
+
ref: b,
|
|
210
|
+
"onSubmit:modelValue": R
|
|
213
211
|
}, null, 512)
|
|
214
212
|
], 64);
|
|
215
213
|
};
|
|
216
214
|
}
|
|
217
215
|
});
|
|
218
216
|
export {
|
|
219
|
-
|
|
217
|
+
ke as default
|
|
220
218
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { defineComponent as A, computed as B, resolveComponent as k, openBlock as r, createElementBlock as S, createElementVNode as x, createVNode as y, unref as e, createTextVNode as ee, toDisplayString as j, withCtx as M, onMounted as Z, createBlock as g, createCommentVNode as q, ref as K, Fragment as w, renderList as N, normalizeClass as P, resolveDynamicComponent as oe, onBeforeMount as ne, isRef as ie, createSlots as me } from "vue";
|
|
2
|
-
import { c as de, C as pe, d as ye, e as ce, f as ve } from "./index-
|
|
3
|
-
import { R as h, a as be } from "./rule-builder-
|
|
4
|
-
import { a as fe, R, S as ge, C as $, W as ke, T as ae, O as Ee } from "./rule-
|
|
5
|
-
import { p as Te } from "./
|
|
2
|
+
import { c as de, C as pe, d as ye, e as ce, f as ve } from "./index-BhacKx5B.js";
|
|
3
|
+
import { R as h, a as be } from "./rule-builder-7GBNrPXt.js";
|
|
4
|
+
import { a as fe, R, S as ge, C as $, W as ke, T as ae, O as Ee } from "./rule-BR5rrmUV.js";
|
|
5
|
+
import { p as Te } from "./loading-DQaawbHE.js";
|
|
6
6
|
import { useDialog as te, useDialogChild as ue } from "@feedmepos/ui-library";
|
|
7
7
|
import { h as J } from "./moment-BWErdI6_.js";
|
|
8
|
-
import { z as Se, a as re } from "./app-
|
|
9
|
-
import { u as Q } from "./membership-
|
|
10
|
-
import { _ as O } from "./index-
|
|
8
|
+
import { z as Se, a as re } from "./app-DgbDbhL-.js";
|
|
9
|
+
import { u as Q } from "./membership-Dq2-b-S_.js";
|
|
10
|
+
import { _ as O } from "./index-FWp9M1yS.js";
|
|
11
11
|
import { c as se } from "./object-qECH92oz.js";
|
|
12
12
|
import { Z as z } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
13
|
-
import "./index-
|
|
14
|
-
import "./index-
|
|
15
|
-
import "./index-
|
|
16
|
-
import "./index-
|
|
17
|
-
import "./index-
|
|
13
|
+
import "./index-BsEqtUmY.js";
|
|
14
|
+
import "./index-CdtrQ9tR.js";
|
|
15
|
+
import "./index-Dd3hrFcQ.js";
|
|
16
|
+
import "./index-oQLJE4Uw.js";
|
|
17
|
+
import "./index-Cfo2A0Se.js";
|
|
18
18
|
const Ve = { class: "flex items-center justify-between" }, Fe = { class: "flex items-center gap-8 xs:flex-wrap" }, Ue = /* @__PURE__ */ x("div", { class: "h-[26px] border-l-2 rounded-md border-fm-color-neutral-gray-100" }, null, -1), xe = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, Ce = /* @__PURE__ */ A({
|
|
19
19
|
__name: "RuleEntry",
|
|
20
20
|
props: {
|