@feedmepos/mf-connect 0.1.3-prod → 0.1.5-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-CC5xdRtS.js +423 -0
- package/dist/{App-DvtYt9h5.js → App-CFLVGljI.js} +276 -275
- package/dist/Broadcast-B5OnLTNo.js +223 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DoH4RX_Y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6oleems.js} +8 -8
- package/dist/Card-Cw9Ts0qN.js +824 -0
- package/dist/{Collections-C5-k8WkG.js → Collections-CTEOsTLk.js} +4 -4
- package/dist/Credit-Bt2ntvn6.js +220 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BaOM6fUL.js} +918 -901
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dxyv9AzJ.js +345 -0
- package/dist/Experience-CdiCyjUs.js +221 -0
- package/dist/Game-CD07hjmT.js +255 -0
- package/dist/Marketing-CodbC8LJ.js +316 -0
- package/dist/Member-Cr8ki7-7.js +69 -0
- package/dist/{MemberList-CMefeirT.js → MemberList-_-IwGMer.js} +75 -75
- package/dist/{MemberTransactions-B9oYdzjR.js → MemberTransactions-B3LWcATC.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B0T7ze7r.js → MessageInput.vue_vue_type_script_setup_true_lang-DF-PHN1Z.js} +2 -2
- package/dist/Mission-BqR_oPzu.js +261 -0
- package/dist/Point-wI_0oL5d.js +222 -0
- package/dist/Promotion-Dx6CD3_V.js +253 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BGM1doWM.js → RuleGroup.vue_vue_type_script_setup_true_lang-DiaYx2vk.js} +15 -15
- package/dist/Segment-BzM2a7dM.js +565 -0
- package/dist/Setting-C8me75UN.js +1871 -0
- package/dist/Store-CT-y0pJ4.js +1530 -0
- package/dist/StoreRewards-l5qkiIy-.js +400 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-JumDBZLs.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNyeXIL6.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BtBCggcN.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BYwjePth.js} +1 -1
- package/dist/{Tier-ms8r2E7c.js → Tier-gHTgMsQ3.js} +470 -445
- package/dist/{Title-BBKoBs46.js → Title-DQS7FHaO.js} +298 -282
- package/dist/Transaction-D7nTuNwj.js +39 -0
- package/dist/Voucher-Dr6IxBlt.js +490 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Jh7OW6Wa.js +141 -0
- package/dist/{app-CGgrMOc_.js → app-BCgzIoKj.js} +1 -1
- package/dist/app-CbpXeslU.js +5639 -0
- package/dist/app.js +4 -3
- package/dist/{business-DeMUnCNX.js → business-DDhQna1e.js} +1 -1
- package/dist/{campaign-CBszI6An.js → campaign-CGa533e7.js} +2 -2
- package/dist/{collection.fn-D4Qgx1aW.js → collection.fn-CalTbTcW.js} +2 -2
- package/dist/dto-i36GeVm3.js +2770 -0
- package/dist/{effect-2p4_SGbQ.js → effect-DdEyoxWE.js} +1 -1
- package/dist/{email-addresses-Bc9od2gA.js → email-addresses-DJkhLbVW.js} +1 -1
- package/dist/{export-BK6FgeQO.js → export-g24Ga1Ru.js} +3 -3
- package/dist/{helper-DUkKW7uc.js → helper-BILtwZxJ.js} +1 -1
- package/dist/{index-Cvbyv9Hx.js → index-61n4HR_9.js} +1 -1
- package/dist/{index-AZ8cKg9n.js → index-BOwZO-JV.js} +1 -1
- package/dist/{index-M1SmasnI.js → index-BzskWtcd.js} +3 -3
- package/dist/{index-CTmiZrHu.js → index-CLA_3YPs.js} +1 -1
- package/dist/{index-B9f-K1No.js → index-Ca1erv2G.js} +2 -2
- package/dist/{index-BWWnWRpt.js → index-DgfFUabi.js} +2 -2
- package/dist/{index-Ci8tkzSn.js → index-GQ4JIFWE.js} +1 -1
- package/dist/{index-BFcrfL4W.js → index-ZcMWfKwl.js} +1 -1
- package/dist/{index-g4L04WYz.js → index-bkuptzmD.js} +91 -86
- package/dist/index-hp-LjMMQ.js +3 -0
- package/dist/{index-DRaETKbn.js → index-lYDskqcR.js} +258 -256
- package/dist/{index-D4HYMbSu.js → index-p3dozIB_.js} +3 -3
- package/dist/{index.esm2017-kvuav0Sd.js → index.esm2017-DeO7Sly1.js} +38 -38
- package/dist/{loading-MNCADfHc.js → loading-CqDGv2I6.js} +11 -11
- package/dist/{membership-CsbTF-DX.js → membership-aP_8YmFK.js} +3 -3
- package/dist/{money-Lo7kavmu.js → money-BmmtBTzl.js} +1 -1
- package/dist/{number-BviV2K5O.js → number-By8HkTkQ.js} +1 -1
- package/dist/{rule-DKrUrnrM.js → rule-CI2g3FmQ.js} +3 -3
- package/dist/{rule-builder-DjPniLk6.js → rule-builder-BCBsbe_y.js} +1 -1
- package/dist/{template-DteMEC9C.js → template-CRNz0-Qj.js} +4 -4
- package/dist/{usePagination-BKTq-UbV.js → usePagination-D4IC9efy.js} +1 -1
- package/dist/vue-i18n-0zlAmAlF.js +2365 -0
- package/package.json +7 -4
- package/dist/Analytic-DiPWt78u.js +0 -423
- package/dist/Broadcast-Dv4XcvBh.js +0 -216
- package/dist/Card-DDvwlZF0.js +0 -823
- package/dist/Credit-BDQIr_FJ.js +0 -214
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BQzgcn4V.js +0 -344
- package/dist/Experience-B9H3tOF0.js +0 -211
- package/dist/Game-cy3_ppLO.js +0 -250
- package/dist/Marketing-CWXV2n5F.js +0 -309
- package/dist/Member-DyTX22Zk.js +0 -92
- package/dist/Mission-DxSO3iES.js +0 -248
- package/dist/Point-C5UtlqkX.js +0 -220
- package/dist/Promotion-DhSGTj-R.js +0 -244
- package/dist/Segment-BzI6Ykxp.js +0 -564
- package/dist/Setting-SRUWwF9w.js +0 -1870
- package/dist/Store-CIrn_7Mh.js +0 -1533
- package/dist/StoreRewards-BYc0vgnr.js +0 -429
- package/dist/Transaction-IZL9-6fe.js +0 -36
- package/dist/Voucher-CIWulmcc.js +0 -485
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
- package/dist/app-BQvluJk_.js +0 -2974
- package/dist/dto-Dtvg93Bz.js +0 -1145
- package/dist/index-UR1Lxi0C.js +0 -11
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { defineComponent as j, ref as V, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as h, Fragment as w, createVNode as r, unref as t, withCtx as _, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as b, resolveDynamicComponent as q } from "vue";
|
|
2
|
+
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as G, components as J } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as Q, u as W } from "./loading-CqDGv2I6.js";
|
|
5
|
+
import { u as X } from "./business-DDhQna1e.js";
|
|
6
|
+
import { u as Y } from "./campaign-CGa533e7.js";
|
|
7
|
+
import { g as I, a as P } from "./dto-i36GeVm3.js";
|
|
8
|
+
import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
+
import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BaOM6fUL.js";
|
|
10
|
+
import { u as te } from "./template-CRNz0-Qj.js";
|
|
11
|
+
import { u as oe } from "./vue-i18n-0zlAmAlF.js";
|
|
12
|
+
import { c as g } from "./index-CLA_3YPs.js";
|
|
13
|
+
const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = /* @__PURE__ */ n("img", {
|
|
14
|
+
src: z,
|
|
15
|
+
class: "aspect-square w-[150px]"
|
|
16
|
+
}, null, -1), _e = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $e = /* @__PURE__ */ j({
|
|
17
|
+
__name: "Point",
|
|
18
|
+
setup(we) {
|
|
19
|
+
const { t: s } = oe(), B = {
|
|
20
|
+
label: s("connect.program.common.actions.create", {
|
|
21
|
+
type: s("connect.program.point.title").toLowerCase()
|
|
22
|
+
}),
|
|
23
|
+
value: "create",
|
|
24
|
+
isPrimary: !0,
|
|
25
|
+
prependIcon: "add"
|
|
26
|
+
}, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
|
|
27
|
+
searchKey: "",
|
|
28
|
+
location: null
|
|
29
|
+
}), u = A(
|
|
30
|
+
() => m.campaigns.point.filter(
|
|
31
|
+
(e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
|
|
32
|
+
)
|
|
33
|
+
), N = [
|
|
34
|
+
{
|
|
35
|
+
header: s("connect.program.common.table.title"),
|
|
36
|
+
accessorFn: (e) => e.name
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
header: s("connect.program.common.table.status"),
|
|
40
|
+
cell(e) {
|
|
41
|
+
return I(e.row.original);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
header: s("connect.program.common.table.summary"),
|
|
46
|
+
accessorFn: (e) => P(e)
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
header: s("connect.program.common.table.actions"),
|
|
50
|
+
cell(e) {
|
|
51
|
+
return E(J.FmButton, {
|
|
52
|
+
variant: "tertiary",
|
|
53
|
+
icon: "delete",
|
|
54
|
+
iconColor: "neutral-gray-400",
|
|
55
|
+
onClick: (a) => {
|
|
56
|
+
a.stopPropagation(), F(e.row.original);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
], v = V();
|
|
62
|
+
async function F(e) {
|
|
63
|
+
await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
|
|
64
|
+
async () => {
|
|
65
|
+
await g.delete(e._id), await m.read("COIN");
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
message: `Removing ${e.name}`,
|
|
69
|
+
successMessage: `Removed ${e.name} successfully`
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
async function f(e) {
|
|
74
|
+
e ? await a() : $.open(async (p) => {
|
|
75
|
+
await a(p);
|
|
76
|
+
});
|
|
77
|
+
async function a(p) {
|
|
78
|
+
var y;
|
|
79
|
+
(y = v.value) == null || y.showSheet(
|
|
80
|
+
!0,
|
|
81
|
+
"COIN",
|
|
82
|
+
e ? await g.readById(e._id) : void 0,
|
|
83
|
+
p
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async function R(e) {
|
|
88
|
+
await C(
|
|
89
|
+
async () => {
|
|
90
|
+
e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await m.read("COIN");
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
|
|
94
|
+
successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
return M(async () => {
|
|
99
|
+
await K(async () => {
|
|
100
|
+
await m.read("COIN");
|
|
101
|
+
});
|
|
102
|
+
}), (e, a) => {
|
|
103
|
+
const p = l("FmPill"), y = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
|
|
104
|
+
return d(), h(w, null, [
|
|
105
|
+
r(y, {
|
|
106
|
+
title: t(s)("connect.program.point.title"),
|
|
107
|
+
actions: t(u).length > 0 ? [B] : [],
|
|
108
|
+
"onClick:action": a[0] || (a[0] = () => f())
|
|
109
|
+
}, {
|
|
110
|
+
title: _(() => [
|
|
111
|
+
n("div", ae, [
|
|
112
|
+
n("span", ne, c(t(s)("connect.program.point.title")), 1),
|
|
113
|
+
r(p, { variant: "premium" })
|
|
114
|
+
])
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 8, ["title", "actions"]),
|
|
118
|
+
n("div", se, [
|
|
119
|
+
r(k, {
|
|
120
|
+
modelValue: t(i).searchKey,
|
|
121
|
+
"onUpdate:modelValue": a[1] || (a[1] = (o) => t(i).searchKey = o),
|
|
122
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
123
|
+
placeholder: "search",
|
|
124
|
+
collapsible: ""
|
|
125
|
+
}, null, 8, ["modelValue"]),
|
|
126
|
+
t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(w, { key: 0 }, [
|
|
127
|
+
n("div", ie, [
|
|
128
|
+
n("div", re, [
|
|
129
|
+
r(Z, {
|
|
130
|
+
modelValue: t(i).location,
|
|
131
|
+
"onUpdate:modelValue": a[2] || (a[2] = (o) => t(i).location = o),
|
|
132
|
+
label: "Location: ",
|
|
133
|
+
"show-item-label": !0,
|
|
134
|
+
icon: "storefront",
|
|
135
|
+
placement: "bottom-start",
|
|
136
|
+
items: t(x).locationItems
|
|
137
|
+
}, null, 8, ["modelValue", "items"])
|
|
138
|
+
]),
|
|
139
|
+
r(k, {
|
|
140
|
+
modelValue: t(i).searchKey,
|
|
141
|
+
"onUpdate:modelValue": a[3] || (a[3] = (o) => t(i).searchKey = o),
|
|
142
|
+
class: "xs:hidden",
|
|
143
|
+
placeholder: "search",
|
|
144
|
+
collapsible: ""
|
|
145
|
+
}, null, 8, ["modelValue"])
|
|
146
|
+
]),
|
|
147
|
+
r(O, {
|
|
148
|
+
class: "xs:hidden",
|
|
149
|
+
"row-data": t(u),
|
|
150
|
+
"column-defs": N,
|
|
151
|
+
"search-value": t(i).searchKey,
|
|
152
|
+
"column-filter": [],
|
|
153
|
+
onRowClick: a[4] || (a[4] = (o) => f(o.original)),
|
|
154
|
+
"hide-footer": t(u).length < 10
|
|
155
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
156
|
+
r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
157
|
+
default: _(() => [
|
|
158
|
+
(d(!0), h(w, null, H(t(u).filter(
|
|
159
|
+
(o) => o.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
|
|
160
|
+
), (o) => (d(), b(U, {
|
|
161
|
+
key: o._id.toString(),
|
|
162
|
+
onClick: (L) => f(o),
|
|
163
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
164
|
+
}, {
|
|
165
|
+
default: _(() => [
|
|
166
|
+
n("div", le, [
|
|
167
|
+
n("div", ce, [
|
|
168
|
+
(d(), b(q(t(I)(o)))),
|
|
169
|
+
n("div", me, c(t(s)("program.point.used", { count: o.currentReceive ?? 0 })), 1)
|
|
170
|
+
]),
|
|
171
|
+
n("div", de, [
|
|
172
|
+
n("div", pe, c(o.name), 1),
|
|
173
|
+
n("div", ue, c(t(P)(o)), 1)
|
|
174
|
+
]),
|
|
175
|
+
n("div", fe, " Point received: " + c(o.currentReceive ?? 0), 1)
|
|
176
|
+
]),
|
|
177
|
+
r(S, {
|
|
178
|
+
icon: "delete",
|
|
179
|
+
"icon-color": "neutral-gray-400",
|
|
180
|
+
variant: "tertiary",
|
|
181
|
+
onClick: (L) => (L.stopPropagation(), F(o))
|
|
182
|
+
}, null, 8, ["onClick"])
|
|
183
|
+
]),
|
|
184
|
+
_: 2
|
|
185
|
+
}, 1032, ["onClick"]))), 128))
|
|
186
|
+
]),
|
|
187
|
+
_: 1
|
|
188
|
+
})
|
|
189
|
+
], 64)) : (d(), b(T, {
|
|
190
|
+
key: 1,
|
|
191
|
+
variant: "outlined",
|
|
192
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
193
|
+
}, {
|
|
194
|
+
default: _(() => [
|
|
195
|
+
ye,
|
|
196
|
+
n("div", _e, [
|
|
197
|
+
n("div", ge, c(t(s)("connect.program.point.empty_state.title")), 1),
|
|
198
|
+
n("div", he, c(t(s)("connect.program.point.empty_state.description")), 1)
|
|
199
|
+
]),
|
|
200
|
+
r(S, {
|
|
201
|
+
variant: "primary",
|
|
202
|
+
label: "Create point program",
|
|
203
|
+
disabled: !t(x).isPremium,
|
|
204
|
+
icon: "add",
|
|
205
|
+
onClick: a[5] || (a[5] = (o) => f())
|
|
206
|
+
}, null, 8, ["disabled"])
|
|
207
|
+
]),
|
|
208
|
+
_: 1
|
|
209
|
+
})),
|
|
210
|
+
r(ee, {
|
|
211
|
+
ref_key: "sheetRef",
|
|
212
|
+
ref: v,
|
|
213
|
+
"onSubmit:modelValue": R
|
|
214
|
+
}, null, 512)
|
|
215
|
+
])
|
|
216
|
+
], 64);
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
export {
|
|
221
|
+
$e as default
|
|
222
|
+
};
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as r, openBlock as m, createElementBlock as h, Fragment as w, createVNode as i, unref as n, 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-CqDGv2I6.js";
|
|
5
|
+
import { u as ee } from "./business-DDhQna1e.js";
|
|
6
|
+
import { u as oe } from "./campaign-CGa533e7.js";
|
|
7
|
+
import { u as te } from "./vue-i18n-0zlAmAlF.js";
|
|
8
|
+
import { g as V } from "./dto-i36GeVm3.js";
|
|
9
|
+
import { e as L } from "./effect-DdEyoxWE.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-BaOM6fUL.js";
|
|
12
|
+
import { u as se } from "./template-CRNz0-Qj.js";
|
|
13
|
+
import { c as u } from "./index-CLA_3YPs.js";
|
|
14
|
+
const ce = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { 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 = /* @__PURE__ */ s("img", {
|
|
15
|
+
src: W,
|
|
16
|
+
class: "aspect-square w-[150px]"
|
|
17
|
+
}, null, -1), ye = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = /* @__PURE__ */ H({
|
|
18
|
+
__name: "Promotion",
|
|
19
|
+
setup(he) {
|
|
20
|
+
const { t } = te(), T = {
|
|
21
|
+
label: t("connect.promotion.createCampaign"),
|
|
22
|
+
value: "create",
|
|
23
|
+
isPrimary: !0,
|
|
24
|
+
prependIcon: "add"
|
|
25
|
+
}, B = {
|
|
26
|
+
label: "Force sync",
|
|
27
|
+
value: "sync",
|
|
28
|
+
isPrimary: !1,
|
|
29
|
+
prependIcon: "refresh"
|
|
30
|
+
}, M = se("PROMOTION", X()), x = ee(), f = oe(), { global: R, minor: _ } = Z, c = S({
|
|
31
|
+
searchKey: "",
|
|
32
|
+
location: null
|
|
33
|
+
}), l = q(
|
|
34
|
+
() => f.campaigns.promotion.filter(
|
|
35
|
+
(e) => !c.value.location || !e.targetLocation || e.targetLocation.includes(c.value.location)
|
|
36
|
+
)
|
|
37
|
+
), K = [
|
|
38
|
+
{
|
|
39
|
+
header: t("connect.promotion.promotionTitle"),
|
|
40
|
+
accessorFn: (e) => e.name
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
header: t("connect.promotion.status"),
|
|
44
|
+
cell(e) {
|
|
45
|
+
return V(e.row.original);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
header: t("connect.promotion.type"),
|
|
50
|
+
accessorFn: (e) => `${O.title(e.effect.options.target)} promotion`
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
header: t("connect.promotion.summary"),
|
|
54
|
+
accessorFn: (e) => L(e.effect)
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
header: t("connect.promotion.actions"),
|
|
58
|
+
cell(e) {
|
|
59
|
+
return z(Y.FmButton, {
|
|
60
|
+
variant: "tertiary",
|
|
61
|
+
icon: "delete",
|
|
62
|
+
iconColor: "neutral-gray-400",
|
|
63
|
+
onClick: (a) => {
|
|
64
|
+
a.stopPropagation(), F(e.row.original);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
], C = S();
|
|
70
|
+
async function F(e) {
|
|
71
|
+
await I.remove(
|
|
72
|
+
t("connect.promotion.confirmRemove", { name: e.name })
|
|
73
|
+
) && await _(
|
|
74
|
+
async () => {
|
|
75
|
+
await u.delete(e._id), await f.read("PROMOTION");
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
message: t("connect.promotion.removing", { name: e.name }),
|
|
79
|
+
successMessage: t("connect.promotion.removedSuccessfully", {
|
|
80
|
+
name: e.name
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
async function y(e) {
|
|
86
|
+
e ? await a() : M.open(async (p) => {
|
|
87
|
+
await a(p);
|
|
88
|
+
});
|
|
89
|
+
async function a(p) {
|
|
90
|
+
var d;
|
|
91
|
+
(d = C.value) == null || d.showSheet(
|
|
92
|
+
!0,
|
|
93
|
+
"PROMOTION",
|
|
94
|
+
e ? await u.readById(e._id) : void 0,
|
|
95
|
+
p
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async function N(e) {
|
|
100
|
+
await _(
|
|
101
|
+
async () => {
|
|
102
|
+
e.campaign._id ? await u.update(e.campaign._id, e) : await u.create(e), await f.read("PROMOTION");
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
message: t(
|
|
106
|
+
e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
|
|
107
|
+
),
|
|
108
|
+
successMessage: t(
|
|
109
|
+
e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
async function A(e) {
|
|
115
|
+
switch (e) {
|
|
116
|
+
case "create":
|
|
117
|
+
y();
|
|
118
|
+
break;
|
|
119
|
+
case "sync":
|
|
120
|
+
await I.confirm(
|
|
121
|
+
"Are you sure you want to synchronize all promotions to POS?",
|
|
122
|
+
"Force sync"
|
|
123
|
+
) && _(
|
|
124
|
+
async () => {
|
|
125
|
+
await u.syncAllPromotion();
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
message: "Syncing promotions...",
|
|
129
|
+
successMessage: "All promotions synced"
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return G(async () => {
|
|
136
|
+
await R(async () => {
|
|
137
|
+
await x.readLocations(), await f.read("PROMOTION");
|
|
138
|
+
});
|
|
139
|
+
}), (e, a) => {
|
|
140
|
+
const p = r("FmPageHead"), d = r("FmSearch"), $ = r("FmTable"), D = r("FmChip"), k = r("FmButton"), U = r("FmListItem"), j = r("FmList"), E = r("FmCard");
|
|
141
|
+
return m(), h(w, null, [
|
|
142
|
+
i(p, {
|
|
143
|
+
title: n(t)("connect.promotion.title"),
|
|
144
|
+
actions: n(l).length > 0 ? [T, B] : [],
|
|
145
|
+
"onClick:action": A
|
|
146
|
+
}, null, 8, ["title", "actions"]),
|
|
147
|
+
s("div", ce, [
|
|
148
|
+
i(d, {
|
|
149
|
+
modelValue: c.value.searchKey,
|
|
150
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => c.value.searchKey = o),
|
|
151
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
152
|
+
placeholder: n(t)("connect.promotion.search"),
|
|
153
|
+
collapsible: ""
|
|
154
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
155
|
+
n(l) && n(l).length > 0 ? (m(), h(w, { key: 0 }, [
|
|
156
|
+
s("div", ie, [
|
|
157
|
+
s("div", re, [
|
|
158
|
+
i(ne, {
|
|
159
|
+
modelValue: c.value.location,
|
|
160
|
+
"onUpdate:modelValue": a[1] || (a[1] = (o) => c.value.location = o),
|
|
161
|
+
label: n(t)("connect.promotion.location"),
|
|
162
|
+
"show-item-label": !0,
|
|
163
|
+
icon: "storefront",
|
|
164
|
+
placement: "bottom-start",
|
|
165
|
+
items: n(x).locationItems
|
|
166
|
+
}, null, 8, ["modelValue", "label", "items"])
|
|
167
|
+
]),
|
|
168
|
+
i(d, {
|
|
169
|
+
modelValue: c.value.searchKey,
|
|
170
|
+
"onUpdate:modelValue": a[2] || (a[2] = (o) => c.value.searchKey = o),
|
|
171
|
+
class: "xs:hidden",
|
|
172
|
+
placeholder: "search",
|
|
173
|
+
collapsible: ""
|
|
174
|
+
}, null, 8, ["modelValue"])
|
|
175
|
+
]),
|
|
176
|
+
i($, {
|
|
177
|
+
class: "xs:hidden",
|
|
178
|
+
"row-data": n(l),
|
|
179
|
+
"column-defs": K,
|
|
180
|
+
"search-value": c.value.searchKey,
|
|
181
|
+
"column-filter": [],
|
|
182
|
+
onRowClick: a[3] || (a[3] = (o) => y(o.original)),
|
|
183
|
+
"hide-footer": n(l).length < 10
|
|
184
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
185
|
+
i(j, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
186
|
+
default: v(() => [
|
|
187
|
+
(m(!0), h(w, null, J(n(l).filter(
|
|
188
|
+
(o) => o.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
|
|
189
|
+
), (o) => (m(), b(U, {
|
|
190
|
+
key: o._id.toString(),
|
|
191
|
+
onClick: (P) => y(o),
|
|
192
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
193
|
+
}, {
|
|
194
|
+
default: v(() => [
|
|
195
|
+
s("div", le, [
|
|
196
|
+
s("div", me, [
|
|
197
|
+
(m(), b(Q(n(V)(o)))),
|
|
198
|
+
i(D, {
|
|
199
|
+
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
200
|
+
compact: !0,
|
|
201
|
+
label: `${n(O).title(o.effect.options.target)} promotion`
|
|
202
|
+
}, null, 8, ["label"])
|
|
203
|
+
]),
|
|
204
|
+
s("div", pe, [
|
|
205
|
+
s("div", de, g(o.name), 1),
|
|
206
|
+
s("div", ue, g(n(L)(o.effect)), 1)
|
|
207
|
+
])
|
|
208
|
+
]),
|
|
209
|
+
i(k, {
|
|
210
|
+
icon: "delete",
|
|
211
|
+
"icon-color": "neutral-gray-400",
|
|
212
|
+
variant: "tertiary",
|
|
213
|
+
onClick: (P) => (P.stopPropagation(), F(o))
|
|
214
|
+
}, null, 8, ["onClick"])
|
|
215
|
+
]),
|
|
216
|
+
_: 2
|
|
217
|
+
}, 1032, ["onClick"]))), 128))
|
|
218
|
+
]),
|
|
219
|
+
_: 1
|
|
220
|
+
})
|
|
221
|
+
], 64)) : (m(), b(E, {
|
|
222
|
+
key: 1,
|
|
223
|
+
variant: "outlined",
|
|
224
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
225
|
+
}, {
|
|
226
|
+
default: v(() => [
|
|
227
|
+
fe,
|
|
228
|
+
s("div", ye, [
|
|
229
|
+
s("div", ge, g(n(t)("connect.promotion.createPromotionCampaign")), 1),
|
|
230
|
+
s("div", _e, g(n(t)("connect.promotion.description")), 1)
|
|
231
|
+
]),
|
|
232
|
+
i(k, {
|
|
233
|
+
variant: "primary",
|
|
234
|
+
label: n(t)("connect.promotion.createPromotionCampaign"),
|
|
235
|
+
icon: "add",
|
|
236
|
+
onClick: a[4] || (a[4] = (o) => y())
|
|
237
|
+
}, null, 8, ["label"])
|
|
238
|
+
]),
|
|
239
|
+
_: 1
|
|
240
|
+
}))
|
|
241
|
+
]),
|
|
242
|
+
i(ae, {
|
|
243
|
+
ref_key: "sheetRef",
|
|
244
|
+
ref: C,
|
|
245
|
+
"onSubmit:modelValue": N
|
|
246
|
+
}, null, 512)
|
|
247
|
+
], 64);
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
export {
|
|
252
|
+
Te as default
|
|
253
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { defineComponent as $, computed as _, resolveComponent as g, openBlock as n, createElementBlock as F, createElementVNode as C, createVNode as y, unref as e, createTextVNode as te, toDisplayString as j, withCtx as M, onMounted as K, createBlock as h, createCommentVNode as A, ref as P, Fragment as Y, renderList as N, normalizeClass as L, watch as ie, resolveDynamicComponent as ne, onBeforeMount as ue, isRef as me, createSlots as de } from "vue";
|
|
2
|
-
import { c as pe, C as ce, d as ye, e as ve, f as fe } from "./index-
|
|
3
|
-
import { R as I, a as be } from "./rule-builder-
|
|
4
|
-
import { a as ge, R, S as ke, C as H, W as Ve, T as re, O as Ee } from "./rule-
|
|
5
|
-
import { p as Fe } from "./loading-
|
|
2
|
+
import { c as pe, C as ce, d as ye, e as ve, f as fe } from "./index-61n4HR_9.js";
|
|
3
|
+
import { R as I, a as be } from "./rule-builder-BCBsbe_y.js";
|
|
4
|
+
import { a as ge, R, S as ke, C as H, W as Ve, T as re, O as Ee } from "./rule-CI2g3FmQ.js";
|
|
5
|
+
import { p as Fe } from "./loading-CqDGv2I6.js";
|
|
6
6
|
import { useDialog as le, useDialogChild as se } from "@feedmepos/ui-library";
|
|
7
7
|
import { h as J } from "./moment-BWErdI6_.js";
|
|
8
|
-
import { z as Se } from "./app-
|
|
9
|
-
import { u as z } from "./membership-
|
|
10
|
-
import { u as X } from "./business-
|
|
11
|
-
import { _ as D } from "./index-
|
|
8
|
+
import { z as Se } from "./app-CbpXeslU.js";
|
|
9
|
+
import { u as z } from "./membership-aP_8YmFK.js";
|
|
10
|
+
import { u as X } from "./business-DDhQna1e.js";
|
|
11
|
+
import { _ as D } from "./index-lYDskqcR.js";
|
|
12
12
|
import { c as oe } from "./object-qECH92oz.js";
|
|
13
|
-
import { Z } from "./ZodTextField.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { e as he } from "./app-
|
|
15
|
-
import "./index-
|
|
16
|
-
import "./index-
|
|
17
|
-
import "./index-
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
13
|
+
import { Z } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Jh7OW6Wa.js";
|
|
14
|
+
import { e as he } from "./app-BCgzIoKj.js";
|
|
15
|
+
import "./index-DgfFUabi.js";
|
|
16
|
+
import "./index-bkuptzmD.js";
|
|
17
|
+
import "./index-BzskWtcd.js";
|
|
18
|
+
import "./index-Ca1erv2G.js";
|
|
19
|
+
import "./index-GQ4JIFWE.js";
|
|
20
20
|
const Te = { class: "flex items-center justify-between" }, xe = { class: "flex items-center gap-8 xs:flex-wrap" }, Ce = /* @__PURE__ */ C("div", { class: "h-[26px] border-l-2 rounded-md border-fm-color-neutral-gray-100" }, null, -1), Ue = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, Re = /* @__PURE__ */ $({
|
|
21
21
|
__name: "RuleEntry",
|
|
22
22
|
props: {
|