@feedmepos/mf-connect 0.1.38-beta.74 → 0.1.38-beta.76
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-BrBxRQue.js +761 -0
- package/dist/App-CE_19YJc.js +4642 -0
- package/dist/AuditLogs-CQtMmVIp.js +1991 -0
- package/dist/Bin-D9CHhiUb.js +166 -0
- package/dist/Broadcast-Dg6eBL_f.js +267 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CSv0R9XX.js +121 -0
- package/dist/Card-BTkf67i1.js +910 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-Czq4nsdu.js +541 -0
- package/dist/Credit-B3nX8aJA.js +261 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js +3120 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-5U6cSZGZ.js +351 -0
- package/dist/Experience-B9Vn3NTH.js +260 -0
- package/dist/FileSaver.min-CJaOkSQt.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/Game-DTx_EsM3.js +331 -0
- package/dist/GenerateMaterial-C3J9_YHw.js +589 -0
- package/dist/Grab-B29W7rka.js +301 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-DyegKNzM.js +145 -0
- package/dist/Index-Fk8EP5dG.js +259 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D2XPGgTM.js +48 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-K8qUYrPk.js +18737 -0
- package/dist/MainLayout-BFmqJkE_.js +41 -0
- package/dist/Marketing-BRHQHAWD.js +145 -0
- package/dist/MarketingMaterialEdit-7s3WEDyJ.js +746 -0
- package/dist/Member-DwPJNAo9.js +280 -0
- package/dist/MemberList-mS1W0qHY.js +1601 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/MemberTransactions-BV3xvFYS.js +45 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DzKqVp2O.js +60799 -0
- package/dist/Mission-QmoURSu4.js +335 -0
- package/dist/Overview-CaTMLlq-.js +1078 -0
- package/dist/Point-CjG77Sma.js +263 -0
- package/dist/Promotion-C5I-1qPN.js +397 -0
- package/dist/Queue-BaIBCCaX.js +259 -0
- package/dist/Record-DqpGwZIU.js +341 -0
- package/dist/Review-Bq-edSOO.js +621 -0
- package/dist/ReviewFacebookCallback-yaC4rLki.js +243 -0
- package/dist/ReviewGoogleCallback-uxrrCQdu.js +213 -0
- package/dist/Reward-DGP65n5t.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-bNMoMZOy.js +149 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dgrc6vXF.js +1912 -0
- package/dist/Segment-CNz0sR3c.js +881 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DLZEzpve.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CLdIeyef.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-ocCdtbbe.js +147 -0
- package/dist/Setting-BKDSGYBR.js +2000 -0
- package/dist/SettingAdvertisements-B2GMFfN9.js +264 -0
- package/dist/Store-C6uLl_Ue.js +1996 -0
- package/dist/StoreRewards-D4728UDf.js +535 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CG09fJTP.js +1129 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-B0_bMK5u.js +7005 -0
- package/dist/Tier-BNzTa1_w.js +970 -0
- package/dist/Title-DY5knovF.js +568 -0
- package/dist/Transaction-Ct4yAJ9n.js +39 -0
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CHnxi3XZ.js +130 -0
- package/dist/Voucher-DFTMRPT0.js +422 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DZU7XVlZ.js +421 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BndLHmHB.js +56 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-6lG4w5PT.js +59396 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +7 -0
- package/dist/business-CrfQ56D0.js +82 -0
- package/dist/campaign-B9fR7RwT.js +100 -0
- package/dist/campaign-B_iIaTKz.js +253 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign.enum-BAHf0dSv.js +26 -0
- package/dist/campaign.fn-DDEgBzH2.js +776 -0
- package/dist/collectible.enum-9os2zr5a.js +19 -0
- package/dist/collection.fn-7qP_m2MW.js +26 -0
- package/dist/dto-C2hLQKuu.js +222 -0
- package/dist/duplicateCampaign-C6RXfeWE.js +51 -0
- package/dist/effect-DGVfWyIc.js +89 -0
- package/dist/email-addresses-BHa_qQBd.js +705 -0
- package/dist/export-CRPfo4hq.js +97 -0
- package/dist/feedme.ico +0 -0
- package/dist/helper-0_zrz4kj.js +86 -0
- package/dist/index-4Vl1VXum.js +2639 -0
- package/dist/index-4bX0ewBJ.js +31 -0
- package/dist/index-Bj0TV_D5.js +36 -0
- package/dist/index-BpdSswT6.js +48 -0
- package/dist/index-By2wenzb.js +32 -0
- package/dist/index-C8L2jQ_6.js +28897 -0
- package/dist/index-CO5kQMIK.js +85 -0
- package/dist/index-CW_ub4cF.js +8912 -0
- package/dist/index-Cp8wkBus.js +124 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-D6Te1BQZ.js +54 -0
- package/dist/index-DbJGJ2fB.js +146 -0
- package/dist/index-DeaGdUSH.js +30289 -0
- package/dist/index-Dp1J9Fxa.js +3 -0
- package/dist/index-QUvYZydO.js +67 -0
- package/dist/index-lwxV5iX0.js +3431 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index.esm2017-ofRmIpjY.js +3069 -0
- package/dist/loading-8_73fcXo.js +71 -0
- package/dist/lodash-Bz_vrY3P.js +3678 -0
- package/dist/membership-CpB39vNW.js +235 -0
- package/dist/moment-D7p2TMB-.js +2583 -0
- package/dist/money-DALHjzjF.js +15 -0
- package/dist/number-D_GJahxw.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/objectid-BZSH63yc.js +145 -0
- package/dist/plugins-A4jDcmfS.js +1817 -0
- package/dist/remy-D_Deb3ue.js +13 -0
- package/dist/reward-BqFB2Yn2.js +36 -0
- package/dist/rule-DNylZfIG.js +1969 -0
- package/dist/rule-builder-2iT04EOj.js +102 -0
- package/dist/style.css +13 -0
- package/dist/template-D7rpG7FN.js +188 -0
- package/dist/tier-BJDhpH6X.js +4 -0
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/timezone-BW17tvi2.js +1154 -0
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-CbVrS2i6.js +213 -0
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/type_drinks-D6jnpvwV.js +4 -0
- package/dist/usePagination-dXSoqxfG.js +266 -0
- package/dist/user-Ck-m3cB3.js +55 -0
- package/dist/vue-i18n-BvqmcBWZ.js +2365 -0
- package/dist/xlsx-CkqDfUNs.js +15491 -0
- package/dist/zod-B0YxCfoE.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { defineComponent as q, ref as L, computed as z, h as J, onMounted as Q, resolveComponent as u, openBlock as f, createElementBlock as k, Fragment as F, createVNode as l, unref as i, withCtx as x, createElementVNode as m, renderList as W, createBlock as O, resolveDynamicComponent as X, toDisplayString as Y } from "vue";
|
|
2
|
+
import { _ as Z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as ee, components as te } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as P } from "./plugins-A4jDcmfS.js";
|
|
5
|
+
import { u as oe } from "./loading-8_73fcXo.js";
|
|
6
|
+
import { u as ne } from "./business-CrfQ56D0.js";
|
|
7
|
+
import { u as ae } from "./campaign-B9fR7RwT.js";
|
|
8
|
+
import { u as re } from "./vue-i18n-BvqmcBWZ.js";
|
|
9
|
+
import { h as d } from "./moment-D7p2TMB-.js";
|
|
10
|
+
import { a as se, b as V } from "./campaign-B_iIaTKz.js";
|
|
11
|
+
import { s as ie, _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D2gTuN97.js";
|
|
12
|
+
import { u as le } from "./template-D7rpG7FN.js";
|
|
13
|
+
import { _ as $ } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
14
|
+
import { c as C } from "./index-Cp8wkBus.js";
|
|
15
|
+
const me = { class: "px-24 flex flex-col gap-y-16" }, ue = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ q({
|
|
16
|
+
__name: "Grab",
|
|
17
|
+
setup(_e) {
|
|
18
|
+
const { t: o } = re(), I = {
|
|
19
|
+
label: o("connect.grab.createCampaign"),
|
|
20
|
+
value: "create",
|
|
21
|
+
isPrimary: !0,
|
|
22
|
+
prependIcon: "add"
|
|
23
|
+
}, A = le("GRAB", ee()), S = ne(), g = ae(), { global: R, minor: T } = oe, K = [
|
|
24
|
+
{
|
|
25
|
+
label: "Bill promotion",
|
|
26
|
+
value: "BILL"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "Item promotion",
|
|
30
|
+
value: "ITEM"
|
|
31
|
+
}
|
|
32
|
+
], c = L({
|
|
33
|
+
searchKey: "",
|
|
34
|
+
location: [],
|
|
35
|
+
effectType: []
|
|
36
|
+
});
|
|
37
|
+
function E(e) {
|
|
38
|
+
const t = c.value.location;
|
|
39
|
+
return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((a) => {
|
|
40
|
+
var s;
|
|
41
|
+
return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(a);
|
|
42
|
+
}) : e.targetLocation.includes(t);
|
|
43
|
+
}
|
|
44
|
+
function j(e) {
|
|
45
|
+
var s, r;
|
|
46
|
+
const t = c.value.effectType;
|
|
47
|
+
if (!t || t.length === 0) return !0;
|
|
48
|
+
const a = (r = (s = e.effect) == null ? void 0 : s.options) == null ? void 0 : r.target;
|
|
49
|
+
return t.includes(a);
|
|
50
|
+
}
|
|
51
|
+
const p = z(
|
|
52
|
+
() => g.campaigns.grab.filter(
|
|
53
|
+
(e) => E(e) && j(e)
|
|
54
|
+
)
|
|
55
|
+
), G = [
|
|
56
|
+
{
|
|
57
|
+
header: o("connect.grab.promotionTitle"),
|
|
58
|
+
accessorFn: (e) => e.name
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
header: o("connect.grab.period"),
|
|
62
|
+
accessorFn: (e) => {
|
|
63
|
+
const t = d(e.timeframeOptions.start).format("DD/MM/YYYY"), a = d(e.timeframeOptions.end).format("DD/MM/YYYY");
|
|
64
|
+
return `${t} - ${a}`;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
header: o("connect.grab.status"),
|
|
69
|
+
accessorFn: (e) => se(e),
|
|
70
|
+
cell(e) {
|
|
71
|
+
return V(e.row.original);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
header: o("connect.grab.summary"),
|
|
76
|
+
cell(e) {
|
|
77
|
+
const t = ie(e.row.original.discount);
|
|
78
|
+
return t ? `${t.type} - ${t.adjustment}` : "-";
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
header: o("connect.grab.actions"),
|
|
83
|
+
cell(e) {
|
|
84
|
+
return J(te.FmButton, {
|
|
85
|
+
variant: "tertiary",
|
|
86
|
+
icon: "delete",
|
|
87
|
+
iconColor: "neutral-gray-400",
|
|
88
|
+
onClick: (t) => {
|
|
89
|
+
t.stopPropagation(), D(e.row.original);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
], B = L();
|
|
95
|
+
async function D(e) {
|
|
96
|
+
await P.remove(o("connect.grab.confirmRemove", { name: e.name })) && await T(
|
|
97
|
+
async () => {
|
|
98
|
+
await C.delete(e._id), await g.read("PROMOTION");
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
message: o("connect.grab.removing", { name: e.name }),
|
|
102
|
+
successMessage: o("connect.grab.removedSuccessfully", {
|
|
103
|
+
name: e.name
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
async function b(e) {
|
|
109
|
+
e ? await t() : A.open(async (a) => {
|
|
110
|
+
await t(a);
|
|
111
|
+
});
|
|
112
|
+
async function t(a) {
|
|
113
|
+
var s;
|
|
114
|
+
(s = B.value) == null || s.showSheet(
|
|
115
|
+
!0,
|
|
116
|
+
"GRAB",
|
|
117
|
+
e ? await C.readById(e._id) : void 0,
|
|
118
|
+
a
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function N(e) {
|
|
123
|
+
var a;
|
|
124
|
+
const t = await U(e.campaign);
|
|
125
|
+
if (t.length > 0) {
|
|
126
|
+
const s = t.map(
|
|
127
|
+
(r) => `"${r.name}" (${d(r.timeframeOptions.start).format("DD/MM/YYYY")} - ${d(r.timeframeOptions.end).format("DD/MM/YYYY")})`
|
|
128
|
+
).join(`
|
|
129
|
+
`);
|
|
130
|
+
return await ((a = P.dialog) == null ? void 0 : a.open({
|
|
131
|
+
title: o("connect.grab.conflictDetected"),
|
|
132
|
+
message: o("connect.grab.conflictMessage", {
|
|
133
|
+
conflicts: s
|
|
134
|
+
}),
|
|
135
|
+
closeButton: !0,
|
|
136
|
+
overlay: !0,
|
|
137
|
+
primaryActions: {
|
|
138
|
+
close: !0,
|
|
139
|
+
text: "OK"
|
|
140
|
+
}
|
|
141
|
+
})), !1;
|
|
142
|
+
}
|
|
143
|
+
await T(
|
|
144
|
+
async () => (e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await g.read("PROMOTION"), !0),
|
|
145
|
+
{
|
|
146
|
+
message: o(
|
|
147
|
+
e.campaign._id ? "connect.grab.updating" : "connect.grab.creating"
|
|
148
|
+
),
|
|
149
|
+
successMessage: o(
|
|
150
|
+
e.campaign._id ? "connect.grab.updatedSuccessfully" : "connect.grab.createdSuccessfully"
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
async function U(e) {
|
|
156
|
+
const t = g.campaigns.grab, a = [], s = !!e._id;
|
|
157
|
+
for (const r of t) {
|
|
158
|
+
if (s && r._id === e._id) continue;
|
|
159
|
+
const _ = d(e.timeframeOptions.start), y = d(e.timeframeOptions.end), h = d(r.timeframeOptions.start), v = d(r.timeframeOptions.end);
|
|
160
|
+
if (_.isBefore(v) && y.isAfter(h) || h.isBefore(y) && v.isAfter(_)) {
|
|
161
|
+
const n = e.discount, w = r.discount;
|
|
162
|
+
n.scope.type === w.scope.type && a.push(r);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return a;
|
|
166
|
+
}
|
|
167
|
+
async function H(e) {
|
|
168
|
+
switch (e) {
|
|
169
|
+
case "create":
|
|
170
|
+
b();
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return Q(async () => {
|
|
175
|
+
await R(async () => {
|
|
176
|
+
await S.readLocations(), await g.read("PROMOTION");
|
|
177
|
+
});
|
|
178
|
+
}), (e, t) => {
|
|
179
|
+
const a = u("FmPill"), s = u("FmPageHead"), r = u("FmSearch"), _ = u("FmTable"), y = u("FmButton"), h = u("FmListItem"), v = u("FmList"), M = u("FmCard");
|
|
180
|
+
return f(), k(F, null, [
|
|
181
|
+
l(s, {
|
|
182
|
+
title: i(o)("connect.grab.title"),
|
|
183
|
+
actions: i(p).length > 0 ? [I] : [],
|
|
184
|
+
"onClick:action": H
|
|
185
|
+
}, {
|
|
186
|
+
prepend: x(() => [
|
|
187
|
+
l(a, { variant: "beta" }),
|
|
188
|
+
l(a, { variant: "premium" })
|
|
189
|
+
]),
|
|
190
|
+
_: 1
|
|
191
|
+
}, 8, ["title", "actions"]),
|
|
192
|
+
m("div", me, [
|
|
193
|
+
l(r, {
|
|
194
|
+
modelValue: c.value.searchKey,
|
|
195
|
+
"onUpdate:modelValue": t[0] || (t[0] = (n) => c.value.searchKey = n),
|
|
196
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
197
|
+
placeholder: i(o)("connect.grab.search"),
|
|
198
|
+
collapsible: ""
|
|
199
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
200
|
+
i(p) && i(p).length > 0 ? (f(), k(F, { key: 0 }, [
|
|
201
|
+
m("div", ue, [
|
|
202
|
+
m("div", de, [
|
|
203
|
+
l($, {
|
|
204
|
+
label: `${i(o)("connect.common.location")}: `,
|
|
205
|
+
"right-icon": "keyboard_arrow_down",
|
|
206
|
+
modelValue: c.value.location,
|
|
207
|
+
"onUpdate:modelValue": t[1] || (t[1] = (n) => c.value.location = n),
|
|
208
|
+
icon: "storefront",
|
|
209
|
+
"show-item-label": !0,
|
|
210
|
+
items: i(S).locationOptions
|
|
211
|
+
}, null, 8, ["label", "modelValue", "items"]),
|
|
212
|
+
l($, {
|
|
213
|
+
label: "Type:",
|
|
214
|
+
"right-icon": "keyboard_arrow_down",
|
|
215
|
+
modelValue: c.value.effectType,
|
|
216
|
+
"onUpdate:modelValue": t[2] || (t[2] = (n) => c.value.effectType = n),
|
|
217
|
+
icon: "filter_list",
|
|
218
|
+
"show-item-label": !0,
|
|
219
|
+
items: K
|
|
220
|
+
}, null, 8, ["modelValue"])
|
|
221
|
+
]),
|
|
222
|
+
l(r, {
|
|
223
|
+
modelValue: c.value.searchKey,
|
|
224
|
+
"onUpdate:modelValue": t[3] || (t[3] = (n) => c.value.searchKey = n),
|
|
225
|
+
class: "xs:hidden",
|
|
226
|
+
placeholder: "search",
|
|
227
|
+
collapsible: ""
|
|
228
|
+
}, null, 8, ["modelValue"])
|
|
229
|
+
]),
|
|
230
|
+
l(_, {
|
|
231
|
+
class: "xs:hidden",
|
|
232
|
+
"row-data": i(p),
|
|
233
|
+
"column-defs": G,
|
|
234
|
+
"search-value": c.value.searchKey,
|
|
235
|
+
"column-filter": [],
|
|
236
|
+
onRowClick: t[4] || (t[4] = (n) => b(n.original)),
|
|
237
|
+
"hide-footer": i(p).length < 10
|
|
238
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
239
|
+
l(v, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
240
|
+
default: x(() => [
|
|
241
|
+
(f(!0), k(F, null, W(i(p).filter(
|
|
242
|
+
(n) => n.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
|
|
243
|
+
), (n) => (f(), O(h, {
|
|
244
|
+
key: n._id.toString(),
|
|
245
|
+
onClick: (w) => b(n),
|
|
246
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
247
|
+
}, {
|
|
248
|
+
default: x(() => [
|
|
249
|
+
m("div", pe, [
|
|
250
|
+
m("div", fe, [
|
|
251
|
+
(f(), O(X(i(V)(n))))
|
|
252
|
+
])
|
|
253
|
+
]),
|
|
254
|
+
l(y, {
|
|
255
|
+
icon: "delete",
|
|
256
|
+
"icon-color": "neutral-gray-400",
|
|
257
|
+
variant: "tertiary",
|
|
258
|
+
onClick: (w) => (w.stopPropagation(), D(n))
|
|
259
|
+
}, null, 8, ["onClick"])
|
|
260
|
+
]),
|
|
261
|
+
_: 2
|
|
262
|
+
}, 1032, ["onClick"]))), 128))
|
|
263
|
+
]),
|
|
264
|
+
_: 1
|
|
265
|
+
})
|
|
266
|
+
], 64)) : (f(), O(M, {
|
|
267
|
+
key: 1,
|
|
268
|
+
variant: "outlined",
|
|
269
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
270
|
+
}, {
|
|
271
|
+
default: x(() => [
|
|
272
|
+
t[6] || (t[6] = m("img", {
|
|
273
|
+
src: Z,
|
|
274
|
+
class: "aspect-square w-[150px]"
|
|
275
|
+
}, null, -1)),
|
|
276
|
+
m("div", ge, [
|
|
277
|
+
m("div", ye, Y(i(o)("connect.grab.createPromotionCampaign")), 1),
|
|
278
|
+
m("div", be, Y(i(o)("connect.grab.description")), 1)
|
|
279
|
+
]),
|
|
280
|
+
l(y, {
|
|
281
|
+
variant: "primary",
|
|
282
|
+
label: i(o)("connect.grab.createPromotionCampaign"),
|
|
283
|
+
icon: "add",
|
|
284
|
+
onClick: t[5] || (t[5] = (n) => b())
|
|
285
|
+
}, null, 8, ["label"])
|
|
286
|
+
]),
|
|
287
|
+
_: 1
|
|
288
|
+
}))
|
|
289
|
+
]),
|
|
290
|
+
l(ce, {
|
|
291
|
+
ref_key: "sheetRef",
|
|
292
|
+
ref: B,
|
|
293
|
+
"onSubmit:modelValue": N
|
|
294
|
+
}, null, 512)
|
|
295
|
+
], 64);
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
export {
|
|
300
|
+
Pe as default
|
|
301
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { openBlock as l, createElementBlock as o, createElementVNode as r, defineComponent as $, ref as b, onMounted as I, resolveComponent as f, renderSlot as x, toDisplayString as s, createCommentVNode as h, normalizeStyle as V, unref as i, Fragment as w, createVNode as F, withCtx as g, createTextVNode as p, normalizeClass as z, createBlock as k } from "vue";
|
|
2
|
+
import { u as R } from "./vue-i18n-BvqmcBWZ.js";
|
|
3
|
+
import { _ as H } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const N = {}, D = { class: "animate-pulse flex space-x-4 bg-gray-300 dark:bg-gray-700 items-center justify-center rounded w-full h-full" };
|
|
5
|
+
function L(e, d) {
|
|
6
|
+
return l(), o("div", D, [...d[0] || (d[0] = [
|
|
7
|
+
r("svg", {
|
|
8
|
+
class: "dark:text-gray-600 h-10 text-gray-200 w-10",
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
viewBox: "0 0 20 18"
|
|
13
|
+
}, [
|
|
14
|
+
r("path", { d: "M18 0H2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2Zm-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm4.376 10.481A1 1 0 0 1 16 15H4a1 1 0 0 1-.895-1.447l3.5-7A1 1 0 0 1 7.468 6a.965.965 0 0 1 .9.5l2.775 4.757 1.546-1.887a1 1 0 0 1 1.618.1l2.541 4a1 1 0 0 1 .028 1.011Z" })
|
|
15
|
+
], -1)
|
|
16
|
+
])]);
|
|
17
|
+
}
|
|
18
|
+
const T = /* @__PURE__ */ H(N, [["render", L]]), U = { class: "max-w-full max-h-[400px] space-y-4" }, Z = { key: 0 }, _ = { class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400" }, A = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "h-full w-full relative bg-fm-color-neutral-white p-12 border-2 border-dashed border-fm-color-neutral-gray-300 rounded-md flex flex-col items-center justify-center gap-8 hover:border-fm-color-neutral-gray-400"
|
|
21
|
+
}, E = ["src"], M = ["src"], q = { class: "absolute right-0 top-0" }, J = /* @__PURE__ */ $({
|
|
22
|
+
__name: "ImageInput",
|
|
23
|
+
props: {
|
|
24
|
+
required: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: () => !1
|
|
27
|
+
},
|
|
28
|
+
disabled: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: () => !1
|
|
31
|
+
},
|
|
32
|
+
thumbnail: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: () => {
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
file: {
|
|
38
|
+
type: File,
|
|
39
|
+
default: () => {
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
label: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: () => {
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
aspectRatio: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "2/3"
|
|
50
|
+
},
|
|
51
|
+
imageFit: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "contain"
|
|
54
|
+
},
|
|
55
|
+
accept: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ".png, .jpg, .jpeg, .webm"
|
|
58
|
+
},
|
|
59
|
+
recommendedSize: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
63
|
+
deleteButton: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !0
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
emits: ["update:file"],
|
|
69
|
+
setup(e, { emit: d }) {
|
|
70
|
+
const { t: y } = R(), c = e, a = b({
|
|
71
|
+
loading: !1,
|
|
72
|
+
imgsrc: c.thumbnail
|
|
73
|
+
}), m = b(!1), v = d;
|
|
74
|
+
async function u(t) {
|
|
75
|
+
return t == null ? (a.value.imgsrc = void 0, v("update:file", null)) : (m.value = !!t.type.startsWith("video/"), a.value.loading = !0, a.value.imgsrc = URL.createObjectURL(t), a.value.loading = !1, v("update:file", t));
|
|
76
|
+
}
|
|
77
|
+
return I(() => {
|
|
78
|
+
var t;
|
|
79
|
+
c.file && u(c.file), (t = c.thumbnail) != null && t.includes("mp4") && (m.value = !0);
|
|
80
|
+
}), (t, n) => {
|
|
81
|
+
const S = f("FmDropField"), B = f("FmHelperText"), j = f("FmButton");
|
|
82
|
+
return l(), o("div", U, [
|
|
83
|
+
x(t.$slots, "label", {}, () => [
|
|
84
|
+
e.label ? (l(), o("div", Z, s(e.label), 1)) : h("", !0)
|
|
85
|
+
]),
|
|
86
|
+
r("div", {
|
|
87
|
+
style: V({ "aspect-ratio": e.aspectRatio }),
|
|
88
|
+
class: "flex flex-col max-h-full max-w-full"
|
|
89
|
+
}, [
|
|
90
|
+
i(a).loading ? (l(), k(T, { key: 1 })) : (l(), o(w, { key: 0 }, [
|
|
91
|
+
i(a).imgsrc ? (l(), o("div", A, [
|
|
92
|
+
i(m) ? (l(), o("video", {
|
|
93
|
+
key: 1,
|
|
94
|
+
src: i(a).imgsrc || e.thumbnail,
|
|
95
|
+
class: "w-full h-full",
|
|
96
|
+
controls: ""
|
|
97
|
+
}, null, 8, M)) : (l(), o("img", {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: z([`object-${e.imageFit}`, "w-full h-full"]),
|
|
100
|
+
src: i(a).imgsrc || e.thumbnail
|
|
101
|
+
}, null, 10, E)),
|
|
102
|
+
r("div", q, [
|
|
103
|
+
x(t.$slots, "delete-button"),
|
|
104
|
+
e.deleteButton ? (l(), k(j, {
|
|
105
|
+
key: 0,
|
|
106
|
+
class: "!text-neutral-50 !bg-neutral-700",
|
|
107
|
+
icon: "delete",
|
|
108
|
+
variant: "tertiary",
|
|
109
|
+
disabled: e.disabled,
|
|
110
|
+
onClick: n[1] || (n[1] = (C) => u(null))
|
|
111
|
+
}, null, 8, ["disabled"])) : h("", !0)
|
|
112
|
+
])
|
|
113
|
+
])) : (l(), o(w, { key: 0 }, [
|
|
114
|
+
F(S, {
|
|
115
|
+
class: "flex-1 hihiha",
|
|
116
|
+
accept: e.accept,
|
|
117
|
+
disabled: e.disabled,
|
|
118
|
+
onFileUpload: u,
|
|
119
|
+
onFileRejected: n[0] || (n[0] = (C) => u(null))
|
|
120
|
+
}, {
|
|
121
|
+
label: g(() => [...n[2] || (n[2] = [
|
|
122
|
+
p(s(void 0), -1)
|
|
123
|
+
])]),
|
|
124
|
+
"helper-text": g(() => [...n[3] || (n[3] = [
|
|
125
|
+
p(s(void 0), -1)
|
|
126
|
+
])]),
|
|
127
|
+
"accept-text": g(() => [
|
|
128
|
+
r("div", _, [
|
|
129
|
+
r("div", null, " (" + s(e.recommendedSize ?? i(y)("connect.common.imageInput.recommendedSize")) + ") ", 1),
|
|
130
|
+
p(" " + s(i(y)("connect.common.imageInput.accepts", { accept: e.accept })), 1)
|
|
131
|
+
])
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
}, 8, ["accept", "disabled"]),
|
|
135
|
+
F(B, { text: "" })
|
|
136
|
+
], 64))
|
|
137
|
+
], 64))
|
|
138
|
+
], 4)
|
|
139
|
+
]);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
export {
|
|
144
|
+
J as _
|
|
145
|
+
};
|