@feedmepos/mf-connect 0.0.39-prod → 0.1.0-beta.2
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-DSD9TsKr.js +622 -0
- package/dist/{App-X3fNEBF3.js → App-D8a5eW51.js} +250 -249
- package/dist/Broadcast-C8jgMe6g.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CRYS_tzZ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-pG8WvV4I.js} +20 -20
- package/dist/Card-C1K7ULPo.js +825 -0
- package/dist/Collections-lMrdPUuM.js +453 -0
- package/dist/Credit-CJfU5tP4.js +220 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DoZyevfa.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js} +1042 -1011
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CzEtOmp0.js +345 -0
- package/dist/Experience-Bp2ki8gU.js +221 -0
- package/dist/Game-BpTf6ebE.js +255 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
- package/dist/{MainLayout-DpZC6o3R.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +19 -53
- package/dist/MainLayout-B1aJoR95.js +41 -0
- package/dist/Marketing-BiKE2gxA.js +316 -0
- package/dist/Member-BSWyy32a.js +69 -0
- package/dist/MemberList-CHlGREyR.js +1733 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-DueaXBCy.js → MemberTransactions-BzHiXCnp.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-e-zWg08J.js +432 -0
- package/dist/Mission-8IGT3T2C.js +261 -0
- package/dist/Point-CbbJ6ohd.js +222 -0
- package/dist/Promotion-BYXCJa_S.js +247 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-_RX1J0Br.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js} +557 -557
- package/dist/Segment-DXDNM0yd.js +437 -0
- package/dist/Setting-CLpvvZTv.js +1901 -0
- package/dist/Store-C6-P6bwc.js +1511 -0
- package/dist/StoreRewards-CUM2irXK.js +401 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CLFiuO5k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JaRdmqif.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CoMQBL4P.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DEb4OBcX.js} +1 -1
- package/dist/{Tier-CftEoP_R.js → Tier-DZTDxWBo.js} +481 -453
- package/dist/{Title-BsavXbYh.js → Title-C2Dr5ceK.js} +314 -295
- package/dist/Transaction-BL4mS29d.js +39 -0
- package/dist/Voucher-Cx0r2-df.js +490 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js +56 -0
- package/dist/{app-BNmAx3zq.js → app-B_xuZ5HB.js} +1 -1
- package/dist/app-wE5HTF_Y.js +5762 -0
- package/dist/app.js +5 -3
- package/dist/{business-DGL4Ayx0.js → business-DSv8zM8C.js} +1 -1
- package/dist/{campaign-D94sS1kM.js → campaign-7y5qquHZ.js} +5 -3
- package/dist/{collection.fn-BHJ1ISqO.js → collection.fn-BxVZQAx0.js} +2 -2
- package/dist/dto-Ew1QwLci.js +2778 -0
- package/dist/{effect-CFRICzlM.js → effect-BzPh8fRI.js} +9 -9
- package/dist/{export-w2o9NYcy.js → export-C9tDplkA.js} +3 -3
- package/dist/{helper-CUDWQ8vq.js → helper-Sz7oQ0F4.js} +1 -1
- package/dist/{index-BGuLhEym.js → index-BQm0C3Jm.js} +3 -3
- package/dist/{index-BjwyxNSp.js → index-C-SOz7jt.js} +1 -1
- package/dist/{index-BcWJcD9f.js → index-C0lpADCo.js} +1 -1
- package/dist/{index-DIq2KVis.js → index-C3_4GUiI.js} +1 -1
- package/dist/{index-BPEV5Tzg.js → index-D-2nFLsg.js} +59 -47
- package/dist/{index-CFMBSL24.js → index-DBMaUGYI.js} +2 -2
- package/dist/{index-CpwFQFTV.js → index-DH_1nOJ_.js} +3 -3
- package/dist/index-Dy4pmQpt.js +29193 -0
- package/dist/{index-BQ6isIeo.js → index-_3qBsogG.js} +1 -1
- package/dist/index-gIRszcHf.js +3 -0
- package/dist/{index-VjUw31dN.js → index-tv4t0Pnh.js} +1 -1
- package/dist/{index-tZ1aqhks.js → index-z0IfdrZk.js} +319 -281
- package/dist/{index.esm2017-zciuPty-.js → index.esm2017-BnKJDxUo.js} +55 -55
- package/dist/{loading-GuXe5bYG.js → loading-Ds-yFYhc.js} +469 -460
- package/dist/{membership-BHWJVI3e.js → membership-DaiVw9qF.js} +3 -3
- package/dist/money-BHtBdZoz.js +15 -0
- package/dist/number-CZhcB8ef.js +12 -0
- package/dist/{rule-MgNa_8FF.js → rule-Cd2M6Ri2.js} +2 -2
- package/dist/{rule-builder-BsBCWzq_.js → rule-builder-B6og27Q1.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-D6k3lusq.js → template-DouRWBpv.js} +63 -63
- package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
- package/dist/vue-i18n-BTlOChXs.js +2365 -0
- package/dist/{xlsx-ClrA4KOh.js → xlsx-SahfXQ70.js} +517 -517
- package/dist/zod-Bg2FbC-D.js +90 -0
- package/package.json +7 -4
- package/dist/Analytic-DMFueUju.js +0 -620
- package/dist/Broadcast-YIfWIXeA.js +0 -216
- package/dist/Card-BIxlgQm7.js +0 -824
- package/dist/Collections-M6DaHM2W.js +0 -441
- package/dist/Credit-BtRy-xoY.js +0 -214
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D5DNTBSQ.js +0 -344
- package/dist/Experience-DGm1lnqj.js +0 -211
- package/dist/Game-B8-lG7qq.js +0 -250
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
- package/dist/Marketing-DtG3AIWr.js +0 -309
- package/dist/Member-K443-9Vy.js +0 -92
- package/dist/MemberList-CYXHXFTL.js +0 -1735
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bk2HLVmt.js +0 -203
- package/dist/Mission-CN5umXXA.js +0 -248
- package/dist/Point-XAm6H2p_.js +0 -220
- package/dist/Promotion-DsrA4KiE.js +0 -244
- package/dist/Segment-CZGGHoAu.js +0 -435
- package/dist/Setting-BjfxLKyp.js +0 -1870
- package/dist/Store-D_B-vhh3.js +0 -1513
- package/dist/StoreRewards-BjHffUKj.js +0 -429
- package/dist/Transaction-CdxzoKDG.js +0 -36
- package/dist/Voucher-B_9Nv1Mr.js +0 -485
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
- package/dist/app--1Ks5Hms.js +0 -2974
- package/dist/dto-X0Eeujxx.js +0 -1151
- package/dist/index-BPNG8N-w.js +0 -11
- package/dist/index-DWM9MWGj.js +0 -28058
- package/dist/money-CrttVpCp.js +0 -15
- package/dist/number-CIndGU4O.js +0 -12
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as l, openBlock as m, createElementBlock as h, Fragment as w, createVNode as r, unref as a, createElementVNode as s, withCtx as v, renderList as J, createBlock as b, resolveDynamicComponent as Q, toDisplayString as g } from "vue";
|
|
2
|
+
import { _ as W } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as X, components as Y } from "@feedmepos/ui-library";
|
|
4
|
+
import { c as O, p as I, u as Z } from "./loading-Ds-yFYhc.js";
|
|
5
|
+
import { u as ee } from "./business-DSv8zM8C.js";
|
|
6
|
+
import { u as oe } from "./campaign-7y5qquHZ.js";
|
|
7
|
+
import { u as te } from "./vue-i18n-BTlOChXs.js";
|
|
8
|
+
import { g as V } from "./dto-Ew1QwLci.js";
|
|
9
|
+
import { e as L } from "./effect-BzPh8fRI.js";
|
|
10
|
+
import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
11
|
+
import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js";
|
|
12
|
+
import { u as se } from "./template-DouRWBpv.js";
|
|
13
|
+
import { c as u } from "./index-C-SOz7jt.js";
|
|
14
|
+
const ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, pe = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = /* @__PURE__ */ H({
|
|
15
|
+
__name: "Promotion",
|
|
16
|
+
setup(_e) {
|
|
17
|
+
const { t } = te(), T = {
|
|
18
|
+
label: t("connect.promotion.createCampaign"),
|
|
19
|
+
value: "create",
|
|
20
|
+
isPrimary: !0,
|
|
21
|
+
prependIcon: "add"
|
|
22
|
+
}, B = {
|
|
23
|
+
label: "Force sync",
|
|
24
|
+
value: "sync",
|
|
25
|
+
isPrimary: !1,
|
|
26
|
+
prependIcon: "refresh"
|
|
27
|
+
}, M = se("PROMOTION", X()), x = ee(), f = oe(), { global: R, minor: _ } = Z, i = S({
|
|
28
|
+
searchKey: "",
|
|
29
|
+
location: null
|
|
30
|
+
}), c = q(
|
|
31
|
+
() => f.campaigns.promotion.filter(
|
|
32
|
+
(e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
|
|
33
|
+
)
|
|
34
|
+
), K = [
|
|
35
|
+
{
|
|
36
|
+
header: t("connect.promotion.promotionTitle"),
|
|
37
|
+
accessorFn: (e) => e.name
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
header: t("connect.promotion.status"),
|
|
41
|
+
cell(e) {
|
|
42
|
+
return V(e.row.original);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
header: t("connect.promotion.type"),
|
|
47
|
+
accessorFn: (e) => `${O.title(e.effect.options.target)} promotion`
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: t("connect.promotion.summary"),
|
|
51
|
+
accessorFn: (e) => L(e.effect)
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
header: t("connect.promotion.actions"),
|
|
55
|
+
cell(e) {
|
|
56
|
+
return z(Y.FmButton, {
|
|
57
|
+
variant: "tertiary",
|
|
58
|
+
icon: "delete",
|
|
59
|
+
iconColor: "neutral-gray-400",
|
|
60
|
+
onClick: (n) => {
|
|
61
|
+
n.stopPropagation(), F(e.row.original);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
], C = S();
|
|
67
|
+
async function F(e) {
|
|
68
|
+
await I.remove(t("promotion.confirmRemove", { name: e.name })) && await _(
|
|
69
|
+
async () => {
|
|
70
|
+
await u.delete(e._id), await f.read("PROMOTION");
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
message: t("promotion.removing", { name: e.name }),
|
|
74
|
+
successMessage: t("promotion.removedSuccessfully", { name: e.name })
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
async function y(e) {
|
|
79
|
+
e ? await n() : M.open(async (p) => {
|
|
80
|
+
await n(p);
|
|
81
|
+
});
|
|
82
|
+
async function n(p) {
|
|
83
|
+
var d;
|
|
84
|
+
(d = C.value) == null || d.showSheet(
|
|
85
|
+
!0,
|
|
86
|
+
"PROMOTION",
|
|
87
|
+
e ? await u.readById(e._id) : void 0,
|
|
88
|
+
p
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async function N(e) {
|
|
93
|
+
await _(
|
|
94
|
+
async () => {
|
|
95
|
+
e.campaign._id ? await u.update(e.campaign._id, e) : await u.create(e), await f.read("PROMOTION");
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
message: t(e.campaign._id ? "promotion.updating" : "promotion.creating"),
|
|
99
|
+
successMessage: t(
|
|
100
|
+
e.campaign._id ? "promotion.updatedSuccessfully" : "promotion.createdSuccessfully"
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
async function A(e) {
|
|
106
|
+
switch (e) {
|
|
107
|
+
case "create":
|
|
108
|
+
y();
|
|
109
|
+
break;
|
|
110
|
+
case "sync":
|
|
111
|
+
await I.confirm(
|
|
112
|
+
"Are you sure you want to synchronize all promotions to POS?",
|
|
113
|
+
"Force sync"
|
|
114
|
+
) && _(
|
|
115
|
+
async () => {
|
|
116
|
+
await u.syncAllPromotion();
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
message: "Syncing promotions...",
|
|
120
|
+
successMessage: "All promotions synced"
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return G(async () => {
|
|
127
|
+
await R(async () => {
|
|
128
|
+
await x.readLocations(), await f.read("PROMOTION");
|
|
129
|
+
});
|
|
130
|
+
}), (e, n) => {
|
|
131
|
+
const p = l("FmPageHead"), d = l("FmSearch"), $ = l("FmTable"), D = l("FmChip"), k = l("FmButton"), U = l("FmListItem"), j = l("FmList"), E = l("FmCard");
|
|
132
|
+
return m(), h(w, null, [
|
|
133
|
+
r(p, {
|
|
134
|
+
title: a(t)("connect.promotion.title"),
|
|
135
|
+
actions: a(c).length > 0 ? [T, B] : [],
|
|
136
|
+
"onClick:action": A
|
|
137
|
+
}, null, 8, ["title", "actions"]),
|
|
138
|
+
s("div", ie, [
|
|
139
|
+
r(d, {
|
|
140
|
+
modelValue: i.value.searchKey,
|
|
141
|
+
"onUpdate:modelValue": n[0] || (n[0] = (o) => i.value.searchKey = o),
|
|
142
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
143
|
+
placeholder: a(t)("connect.promotion.search"),
|
|
144
|
+
collapsible: ""
|
|
145
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
146
|
+
a(c) && a(c).length > 0 ? (m(), h(w, { key: 0 }, [
|
|
147
|
+
s("div", re, [
|
|
148
|
+
s("div", le, [
|
|
149
|
+
r(ne, {
|
|
150
|
+
modelValue: i.value.location,
|
|
151
|
+
"onUpdate:modelValue": n[1] || (n[1] = (o) => i.value.location = o),
|
|
152
|
+
label: a(t)("connect.promotion.location"),
|
|
153
|
+
"show-item-label": !0,
|
|
154
|
+
icon: "storefront",
|
|
155
|
+
placement: "bottom-start",
|
|
156
|
+
items: a(x).locationItems
|
|
157
|
+
}, null, 8, ["modelValue", "label", "items"])
|
|
158
|
+
]),
|
|
159
|
+
r(d, {
|
|
160
|
+
modelValue: i.value.searchKey,
|
|
161
|
+
"onUpdate:modelValue": n[2] || (n[2] = (o) => i.value.searchKey = o),
|
|
162
|
+
class: "xs:hidden",
|
|
163
|
+
placeholder: "search",
|
|
164
|
+
collapsible: ""
|
|
165
|
+
}, null, 8, ["modelValue"])
|
|
166
|
+
]),
|
|
167
|
+
r($, {
|
|
168
|
+
class: "xs:hidden",
|
|
169
|
+
"row-data": a(c),
|
|
170
|
+
"column-defs": K,
|
|
171
|
+
"search-value": i.value.searchKey,
|
|
172
|
+
"column-filter": [],
|
|
173
|
+
onRowClick: n[3] || (n[3] = (o) => y(o.original)),
|
|
174
|
+
"hide-footer": a(c).length < 10
|
|
175
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
176
|
+
r(j, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
177
|
+
default: v(() => [
|
|
178
|
+
(m(!0), h(w, null, J(a(c).filter(
|
|
179
|
+
(o) => o.name.toLowerCase().includes(i.value.searchKey.toLowerCase())
|
|
180
|
+
), (o) => (m(), b(U, {
|
|
181
|
+
key: o._id.toString(),
|
|
182
|
+
onClick: (P) => y(o),
|
|
183
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
184
|
+
}, {
|
|
185
|
+
default: v(() => [
|
|
186
|
+
s("div", ce, [
|
|
187
|
+
s("div", me, [
|
|
188
|
+
(m(), b(Q(a(V)(o)))),
|
|
189
|
+
r(D, {
|
|
190
|
+
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
191
|
+
compact: !0,
|
|
192
|
+
label: `${a(O).title(o.effect.options.target)} promotion`
|
|
193
|
+
}, null, 8, ["label"])
|
|
194
|
+
]),
|
|
195
|
+
s("div", pe, [
|
|
196
|
+
s("div", de, g(o.name), 1),
|
|
197
|
+
s("div", ue, g(a(L)(o.effect)), 1)
|
|
198
|
+
])
|
|
199
|
+
]),
|
|
200
|
+
r(k, {
|
|
201
|
+
icon: "delete",
|
|
202
|
+
"icon-color": "neutral-gray-400",
|
|
203
|
+
variant: "tertiary",
|
|
204
|
+
onClick: (P) => (P.stopPropagation(), F(o))
|
|
205
|
+
}, null, 8, ["onClick"])
|
|
206
|
+
]),
|
|
207
|
+
_: 2
|
|
208
|
+
}, 1032, ["onClick"]))), 128))
|
|
209
|
+
]),
|
|
210
|
+
_: 1
|
|
211
|
+
})
|
|
212
|
+
], 64)) : (m(), b(E, {
|
|
213
|
+
key: 1,
|
|
214
|
+
variant: "outlined",
|
|
215
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
216
|
+
}, {
|
|
217
|
+
default: v(() => [
|
|
218
|
+
n[5] || (n[5] = s("img", {
|
|
219
|
+
src: W,
|
|
220
|
+
class: "aspect-square w-[150px]"
|
|
221
|
+
}, null, -1)),
|
|
222
|
+
s("div", fe, [
|
|
223
|
+
s("div", ye, g(a(t)("connect.promotion.createPromotionCampaign")), 1),
|
|
224
|
+
s("div", ge, g(a(t)("connect.promotion.description")), 1)
|
|
225
|
+
]),
|
|
226
|
+
r(k, {
|
|
227
|
+
variant: "primary",
|
|
228
|
+
label: a(t)("connect.promotion.createPromotionCampaign"),
|
|
229
|
+
icon: "add",
|
|
230
|
+
onClick: n[4] || (n[4] = (o) => y())
|
|
231
|
+
}, null, 8, ["label"])
|
|
232
|
+
]),
|
|
233
|
+
_: 1
|
|
234
|
+
}))
|
|
235
|
+
]),
|
|
236
|
+
r(ae, {
|
|
237
|
+
ref_key: "sheetRef",
|
|
238
|
+
ref: C,
|
|
239
|
+
"onSubmit:modelValue": N
|
|
240
|
+
}, null, 512)
|
|
241
|
+
], 64);
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
export {
|
|
246
|
+
Le as default
|
|
247
|
+
};
|