@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
package/dist/Point-C5UtlqkX.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { defineComponent as D, ref as S, computed as T, onMounted as j, resolveComponent as l, openBlock as c, createElementBlock as g, Fragment as h, createVNode as i, unref as o, withCtx as f, createElementVNode as n, renderList as E, createBlock as C, resolveDynamicComponent as M, toDisplayString as y, h as H } from "vue";
|
|
2
|
-
import { _ as q } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as z, components as G } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as J, p as Q } from "./loading-MNCADfHc.js";
|
|
5
|
-
import { u as W } from "./business-DeMUnCNX.js";
|
|
6
|
-
import { u as X } from "./campaign-CBszI6An.js";
|
|
7
|
-
import { g as V, a as L } from "./dto-Dtvg93Bz.js";
|
|
8
|
-
import { _ as Y } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
9
|
-
import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js";
|
|
10
|
-
import { u as ee } from "./template-DteMEC9C.js";
|
|
11
|
-
import { c as _ } from "./index-CTmiZrHu.js";
|
|
12
|
-
const te = { class: "flex items-center" }, oe = /* @__PURE__ */ n("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, "Point", -1), ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ce = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = /* @__PURE__ */ n("img", {
|
|
13
|
-
src: q,
|
|
14
|
-
class: "aspect-square w-[150px]"
|
|
15
|
-
}, null, -1), fe = /* @__PURE__ */ n("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
16
|
-
/* @__PURE__ */ n("div", { class: "fm-typo-en-title-sm-800" }, "Create your point program"),
|
|
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. ")
|
|
18
|
-
], -1), Se = /* @__PURE__ */ D({
|
|
19
|
-
__name: "Point",
|
|
20
|
-
setup(ye) {
|
|
21
|
-
const I = {
|
|
22
|
-
label: "Create campaign",
|
|
23
|
-
value: "create",
|
|
24
|
-
isPrimary: !0,
|
|
25
|
-
prependIcon: "add"
|
|
26
|
-
}, B = ee("COIN", z()), v = W(), r = X(), { global: $, minor: w } = J, s = S({
|
|
27
|
-
searchKey: "",
|
|
28
|
-
location: null
|
|
29
|
-
}), d = T(
|
|
30
|
-
() => r.campaigns.point.filter(
|
|
31
|
-
(e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
|
|
32
|
-
)
|
|
33
|
-
), K = [
|
|
34
|
-
{
|
|
35
|
-
header: "Program title",
|
|
36
|
-
accessorFn: (e) => e.name
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
header: "Status",
|
|
40
|
-
cell(e) {
|
|
41
|
-
return V(e.row.original);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
header: "Summary",
|
|
46
|
-
accessorFn: (e) => L(e)
|
|
47
|
-
//v.effect,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
header: "Actions",
|
|
51
|
-
cell(e) {
|
|
52
|
-
return H(G.FmButton, {
|
|
53
|
-
variant: "tertiary",
|
|
54
|
-
icon: "delete",
|
|
55
|
-
iconColor: "neutral-gray-400",
|
|
56
|
-
onClick: (a) => {
|
|
57
|
-
a.stopPropagation(), b(e.row.original);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
], x = S();
|
|
63
|
-
async function b(e) {
|
|
64
|
-
await Q.remove(`Are you sure you want to remove ${e.name}?`) && await w(
|
|
65
|
-
async () => {
|
|
66
|
-
await _.delete(e._id), await r.read("COIN");
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
message: `Removing ${e.name}`,
|
|
70
|
-
successMessage: `Removed ${e.name} successfully`
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
async function p(e) {
|
|
75
|
-
e ? await a() : B.open(async (m) => {
|
|
76
|
-
await a(m);
|
|
77
|
-
});
|
|
78
|
-
async function a(m) {
|
|
79
|
-
var u;
|
|
80
|
-
(u = x.value) == null || u.showSheet(
|
|
81
|
-
!0,
|
|
82
|
-
"COIN",
|
|
83
|
-
e ? await _.readById(e._id) : void 0,
|
|
84
|
-
m
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
async function N(e) {
|
|
89
|
-
await w(
|
|
90
|
-
async () => {
|
|
91
|
-
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await r.read("COIN");
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
|
|
95
|
-
successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
return j(async () => {
|
|
100
|
-
await $(async () => {
|
|
101
|
-
await r.read("COIN");
|
|
102
|
-
});
|
|
103
|
-
}), (e, a) => {
|
|
104
|
-
const m = l("FmPill"), u = l("FmPageHead"), F = l("FmSearch"), R = l("FmTable"), k = l("FmButton"), O = l("FmListItem"), U = l("FmList"), A = l("FmCard");
|
|
105
|
-
return c(), g(h, null, [
|
|
106
|
-
i(u, {
|
|
107
|
-
title: "Point",
|
|
108
|
-
actions: o(d).length > 0 ? [I] : [],
|
|
109
|
-
"onClick:action": a[0] || (a[0] = () => p())
|
|
110
|
-
}, {
|
|
111
|
-
title: f(() => [
|
|
112
|
-
n("div", te, [
|
|
113
|
-
oe,
|
|
114
|
-
i(m, { variant: "premium" })
|
|
115
|
-
])
|
|
116
|
-
]),
|
|
117
|
-
_: 1
|
|
118
|
-
}, 8, ["actions"]),
|
|
119
|
-
n("div", ae, [
|
|
120
|
-
i(F, {
|
|
121
|
-
modelValue: o(s).searchKey,
|
|
122
|
-
"onUpdate:modelValue": a[1] || (a[1] = (t) => o(s).searchKey = t),
|
|
123
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
124
|
-
placeholder: "search",
|
|
125
|
-
collapsible: ""
|
|
126
|
-
}, null, 8, ["modelValue"]),
|
|
127
|
-
o(r).campaigns.point && o(r).campaigns.point.length > 0 ? (c(), g(h, { key: 0 }, [
|
|
128
|
-
n("div", ne, [
|
|
129
|
-
n("div", se, [
|
|
130
|
-
i(Y, {
|
|
131
|
-
modelValue: o(s).location,
|
|
132
|
-
"onUpdate:modelValue": a[2] || (a[2] = (t) => o(s).location = t),
|
|
133
|
-
label: "Location: ",
|
|
134
|
-
"show-item-label": !0,
|
|
135
|
-
icon: "storefront",
|
|
136
|
-
placement: "bottom-start",
|
|
137
|
-
items: o(v).locationItems
|
|
138
|
-
}, null, 8, ["modelValue", "items"])
|
|
139
|
-
]),
|
|
140
|
-
i(F, {
|
|
141
|
-
modelValue: o(s).searchKey,
|
|
142
|
-
"onUpdate:modelValue": a[3] || (a[3] = (t) => o(s).searchKey = t),
|
|
143
|
-
class: "xs:hidden",
|
|
144
|
-
placeholder: "search",
|
|
145
|
-
collapsible: ""
|
|
146
|
-
}, null, 8, ["modelValue"])
|
|
147
|
-
]),
|
|
148
|
-
i(R, {
|
|
149
|
-
class: "xs:hidden",
|
|
150
|
-
"row-data": o(d),
|
|
151
|
-
"column-defs": K,
|
|
152
|
-
"search-value": o(s).searchKey,
|
|
153
|
-
"column-filter": [],
|
|
154
|
-
onRowClick: a[4] || (a[4] = (t) => p(t.original)),
|
|
155
|
-
"hide-footer": o(d).length < 10
|
|
156
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
157
|
-
i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
158
|
-
default: f(() => [
|
|
159
|
-
(c(!0), g(h, null, E(o(d).filter(
|
|
160
|
-
(t) => t.name.toLowerCase().includes(o(s).searchKey.toLowerCase())
|
|
161
|
-
), (t) => (c(), C(O, {
|
|
162
|
-
key: t._id.toString(),
|
|
163
|
-
onClick: (P) => p(t),
|
|
164
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
165
|
-
}, {
|
|
166
|
-
default: f(() => [
|
|
167
|
-
n("div", ie, [
|
|
168
|
-
n("div", le, [
|
|
169
|
-
(c(), C(M(o(V)(t)))),
|
|
170
|
-
n("div", re, y(t.currentReceive ?? 0) + " used ", 1)
|
|
171
|
-
]),
|
|
172
|
-
n("div", ce, [
|
|
173
|
-
n("div", me, y(t.name), 1),
|
|
174
|
-
n("div", de, y(o(L)(t)), 1)
|
|
175
|
-
]),
|
|
176
|
-
n("div", pe, " Point received: " + y(t.currentReceive ?? 0), 1)
|
|
177
|
-
]),
|
|
178
|
-
i(k, {
|
|
179
|
-
icon: "delete",
|
|
180
|
-
"icon-color": "neutral-gray-400",
|
|
181
|
-
variant: "tertiary",
|
|
182
|
-
onClick: (P) => (P.stopPropagation(), b(t))
|
|
183
|
-
}, null, 8, ["onClick"])
|
|
184
|
-
]),
|
|
185
|
-
_: 2
|
|
186
|
-
}, 1032, ["onClick"]))), 128))
|
|
187
|
-
]),
|
|
188
|
-
_: 1
|
|
189
|
-
})
|
|
190
|
-
], 64)) : (c(), C(A, {
|
|
191
|
-
key: 1,
|
|
192
|
-
variant: "outlined",
|
|
193
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
194
|
-
}, {
|
|
195
|
-
default: f(() => [
|
|
196
|
-
ue,
|
|
197
|
-
fe,
|
|
198
|
-
i(k, {
|
|
199
|
-
variant: "primary",
|
|
200
|
-
label: "Create point program",
|
|
201
|
-
disabled: !o(v).isPremium,
|
|
202
|
-
icon: "add",
|
|
203
|
-
onClick: a[5] || (a[5] = (t) => p())
|
|
204
|
-
}, null, 8, ["disabled"])
|
|
205
|
-
]),
|
|
206
|
-
_: 1
|
|
207
|
-
})),
|
|
208
|
-
i(Z, {
|
|
209
|
-
ref_key: "sheetRef",
|
|
210
|
-
ref: x,
|
|
211
|
-
"onSubmit:modelValue": N
|
|
212
|
-
}, null, 512)
|
|
213
|
-
])
|
|
214
|
-
], 64);
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
export {
|
|
219
|
-
Se as default
|
|
220
|
-
};
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import { defineComponent as E, ref as P, computed as H, onMounted as q, resolveComponent as i, openBlock as c, createElementBlock as g, Fragment as _, createVNode as s, unref as l, createElementVNode as a, withCtx as h, renderList as z, createBlock as w, resolveDynamicComponent as G, toDisplayString as k, h as J } from "vue";
|
|
2
|
-
import { _ as Q } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as W, components as X } from "@feedmepos/ui-library";
|
|
4
|
-
import { c as S, u as Y, p as O } from "./loading-MNCADfHc.js";
|
|
5
|
-
import { u as Z } from "./business-DeMUnCNX.js";
|
|
6
|
-
import { u as ee } from "./campaign-CBszI6An.js";
|
|
7
|
-
import { g as L } from "./dto-Dtvg93Bz.js";
|
|
8
|
-
import { e as V } from "./effect-2p4_SGbQ.js";
|
|
9
|
-
import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
10
|
-
import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DCbvlp5V.js";
|
|
11
|
-
import { u as ae } from "./template-DteMEC9C.js";
|
|
12
|
-
import { c as u } from "./index-CTmiZrHu.js";
|
|
13
|
-
const ne = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, ce = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = /* @__PURE__ */ a("img", {
|
|
14
|
-
src: Q,
|
|
15
|
-
class: "aspect-square w-[150px]"
|
|
16
|
-
}, null, -1), pe = /* @__PURE__ */ a("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
17
|
-
/* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Create promotion campaign"),
|
|
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. ")
|
|
19
|
-
], -1), Se = /* @__PURE__ */ E({
|
|
20
|
-
__name: "Promotion",
|
|
21
|
-
setup(fe) {
|
|
22
|
-
const I = {
|
|
23
|
-
label: "Create campaign",
|
|
24
|
-
value: "create",
|
|
25
|
-
isPrimary: !0,
|
|
26
|
-
prependIcon: "add"
|
|
27
|
-
}, T = {
|
|
28
|
-
label: "Force sync",
|
|
29
|
-
value: "sync",
|
|
30
|
-
isPrimary: !1,
|
|
31
|
-
prependIcon: "refresh"
|
|
32
|
-
}, $ = ae("PROMOTION", W()), v = Z(), p = ee(), { global: R, minor: y } = Y, n = P({
|
|
33
|
-
searchKey: "",
|
|
34
|
-
location: null
|
|
35
|
-
}), r = H(
|
|
36
|
-
() => p.campaigns.promotion.filter(
|
|
37
|
-
(e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
|
|
38
|
-
)
|
|
39
|
-
), B = [
|
|
40
|
-
{
|
|
41
|
-
header: "Promotion title",
|
|
42
|
-
accessorFn: (e) => e.name
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
header: "Status",
|
|
46
|
-
cell(e) {
|
|
47
|
-
return L(e.row.original);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
header: "Type",
|
|
52
|
-
accessorFn: (e) => `${S.title(e.effect.options.target)} promotion`
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
header: "Summary",
|
|
56
|
-
accessorFn: (e) => V(e.effect)
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
header: "Actions",
|
|
60
|
-
cell(e) {
|
|
61
|
-
return J(X.FmButton, {
|
|
62
|
-
variant: "tertiary",
|
|
63
|
-
icon: "delete",
|
|
64
|
-
iconColor: "neutral-gray-400",
|
|
65
|
-
onClick: (t) => {
|
|
66
|
-
t.stopPropagation(), x(e.row.original);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
], b = P();
|
|
72
|
-
async function x(e) {
|
|
73
|
-
await O.remove(`Are you sure you want to remove ${e.name}?`) && await y(
|
|
74
|
-
async () => {
|
|
75
|
-
await u.delete(e._id), await p.read("PROMOTION");
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
message: `Removing ${e.name}`,
|
|
79
|
-
successMessage: `Removed ${e.name} successfully`
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
async function f(e) {
|
|
84
|
-
e ? await t() : $.open(async (m) => {
|
|
85
|
-
await t(m);
|
|
86
|
-
});
|
|
87
|
-
async function t(m) {
|
|
88
|
-
var d;
|
|
89
|
-
(d = b.value) == null || d.showSheet(
|
|
90
|
-
!0,
|
|
91
|
-
"PROMOTION",
|
|
92
|
-
e ? await u.readById(e._id) : void 0,
|
|
93
|
-
m
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
async function M(e) {
|
|
98
|
-
await y(
|
|
99
|
-
async () => {
|
|
100
|
-
e.campaign._id ? await u.update(e.campaign._id, e) : await u.create(e), await p.read("PROMOTION");
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} promotion`,
|
|
104
|
-
successMessage: `Promotion ${e.campaign._id ? "updated" : "created"} successfully`
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
async function A(e) {
|
|
109
|
-
switch (e) {
|
|
110
|
-
case "create":
|
|
111
|
-
f();
|
|
112
|
-
break;
|
|
113
|
-
case "sync":
|
|
114
|
-
await O.confirm(
|
|
115
|
-
"Are you sure you want to synchronize all promotions to POS?",
|
|
116
|
-
"Force sync"
|
|
117
|
-
) && y(
|
|
118
|
-
async () => {
|
|
119
|
-
await u.syncAllPromotion();
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
message: "Syncing promotions...",
|
|
123
|
-
successMessage: "All promotions synced"
|
|
124
|
-
}
|
|
125
|
-
);
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return q(async () => {
|
|
130
|
-
await R(async () => {
|
|
131
|
-
await v.readLocations(), await p.read("PROMOTION");
|
|
132
|
-
});
|
|
133
|
-
}), (e, t) => {
|
|
134
|
-
const m = i("FmPageHead"), d = i("FmSearch"), K = i("FmTable"), N = i("FmChip"), C = i("FmButton"), U = i("FmListItem"), D = i("FmList"), j = i("FmCard");
|
|
135
|
-
return c(), g(_, null, [
|
|
136
|
-
s(m, {
|
|
137
|
-
title: "Promotion",
|
|
138
|
-
actions: l(r).length > 0 ? [I, T] : [],
|
|
139
|
-
"onClick:action": A
|
|
140
|
-
}, null, 8, ["actions"]),
|
|
141
|
-
a("div", ne, [
|
|
142
|
-
s(d, {
|
|
143
|
-
modelValue: n.value.searchKey,
|
|
144
|
-
"onUpdate:modelValue": t[0] || (t[0] = (o) => n.value.searchKey = o),
|
|
145
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
146
|
-
placeholder: "search",
|
|
147
|
-
collapsible: ""
|
|
148
|
-
}, null, 8, ["modelValue"]),
|
|
149
|
-
l(r) && l(r).length > 0 ? (c(), g(_, { key: 0 }, [
|
|
150
|
-
a("div", se, [
|
|
151
|
-
a("div", le, [
|
|
152
|
-
s(oe, {
|
|
153
|
-
modelValue: n.value.location,
|
|
154
|
-
"onUpdate:modelValue": t[1] || (t[1] = (o) => n.value.location = o),
|
|
155
|
-
label: "Location: ",
|
|
156
|
-
"show-item-label": !0,
|
|
157
|
-
icon: "storefront",
|
|
158
|
-
placement: "bottom-start",
|
|
159
|
-
items: l(v).locationItems
|
|
160
|
-
}, null, 8, ["modelValue", "items"])
|
|
161
|
-
]),
|
|
162
|
-
s(d, {
|
|
163
|
-
modelValue: n.value.searchKey,
|
|
164
|
-
"onUpdate:modelValue": t[2] || (t[2] = (o) => n.value.searchKey = o),
|
|
165
|
-
class: "xs:hidden",
|
|
166
|
-
placeholder: "search",
|
|
167
|
-
collapsible: ""
|
|
168
|
-
}, null, 8, ["modelValue"])
|
|
169
|
-
]),
|
|
170
|
-
s(K, {
|
|
171
|
-
class: "xs:hidden",
|
|
172
|
-
"row-data": l(r),
|
|
173
|
-
"column-defs": B,
|
|
174
|
-
"search-value": n.value.searchKey,
|
|
175
|
-
"column-filter": [],
|
|
176
|
-
onRowClick: t[3] || (t[3] = (o) => f(o.original)),
|
|
177
|
-
"hide-footer": l(r).length < 10
|
|
178
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
179
|
-
s(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
180
|
-
default: h(() => [
|
|
181
|
-
(c(!0), g(_, null, z(l(r).filter(
|
|
182
|
-
(o) => o.name.toLowerCase().includes(n.value.searchKey.toLowerCase())
|
|
183
|
-
), (o) => (c(), w(U, {
|
|
184
|
-
key: o._id.toString(),
|
|
185
|
-
onClick: (F) => f(o),
|
|
186
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
187
|
-
}, {
|
|
188
|
-
default: h(() => [
|
|
189
|
-
a("div", ie, [
|
|
190
|
-
a("div", re, [
|
|
191
|
-
(c(), w(G(l(L)(o)))),
|
|
192
|
-
s(N, {
|
|
193
|
-
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
194
|
-
compact: !0,
|
|
195
|
-
label: `${l(S).title(o.effect.options.target)} promotion`
|
|
196
|
-
}, null, 8, ["label"])
|
|
197
|
-
]),
|
|
198
|
-
a("div", ce, [
|
|
199
|
-
a("div", me, k(o.name), 1),
|
|
200
|
-
a("div", de, k(l(V)(o.effect)), 1)
|
|
201
|
-
])
|
|
202
|
-
]),
|
|
203
|
-
s(C, {
|
|
204
|
-
icon: "delete",
|
|
205
|
-
"icon-color": "neutral-gray-400",
|
|
206
|
-
variant: "tertiary",
|
|
207
|
-
onClick: (F) => (F.stopPropagation(), x(o))
|
|
208
|
-
}, null, 8, ["onClick"])
|
|
209
|
-
]),
|
|
210
|
-
_: 2
|
|
211
|
-
}, 1032, ["onClick"]))), 128))
|
|
212
|
-
]),
|
|
213
|
-
_: 1
|
|
214
|
-
})
|
|
215
|
-
], 64)) : (c(), w(j, {
|
|
216
|
-
key: 1,
|
|
217
|
-
variant: "outlined",
|
|
218
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
219
|
-
}, {
|
|
220
|
-
default: h(() => [
|
|
221
|
-
ue,
|
|
222
|
-
pe,
|
|
223
|
-
s(C, {
|
|
224
|
-
variant: "primary",
|
|
225
|
-
label: "Create promotion campaign",
|
|
226
|
-
icon: "add",
|
|
227
|
-
onClick: t[4] || (t[4] = (o) => f())
|
|
228
|
-
})
|
|
229
|
-
]),
|
|
230
|
-
_: 1
|
|
231
|
-
}))
|
|
232
|
-
]),
|
|
233
|
-
s(te, {
|
|
234
|
-
ref_key: "sheetRef",
|
|
235
|
-
ref: b,
|
|
236
|
-
"onSubmit:modelValue": M
|
|
237
|
-
}, null, 512)
|
|
238
|
-
], 64);
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
export {
|
|
243
|
-
Se as default
|
|
244
|
-
};
|