@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
package/dist/Game-B8-lG7qq.js
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { defineComponent as j, ref as L, computed as D, onMounted as H, resolveComponent as l, openBlock as c, createElementBlock as w, Fragment as x, createVNode as i, unref as a, withCtx as y, createElementVNode as n, renderList as N, createBlock as b, resolveDynamicComponent as q, toDisplayString as _, h as m } from "vue";
|
|
2
|
-
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as J, components as v } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as O, a as Q, p as W } from "./loading-GuXe5bYG.js";
|
|
5
|
-
import { u as X } from "./business-DGL4Ayx0.js";
|
|
6
|
-
import { u as Y } from "./campaign-D94sS1kM.js";
|
|
7
|
-
import { g as A, b as B } from "./dto-X0Eeujxx.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-DoZyevfa.js";
|
|
10
|
-
import { u as te } from "./template-D6k3lusq.js";
|
|
11
|
-
import { c as h } from "./index-BjwyxNSp.js";
|
|
12
|
-
const oe = { class: "flex items-center" }, ae = /* @__PURE__ */ n("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, "Game", -1), ne = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { 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" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = /* @__PURE__ */ n("img", {
|
|
13
|
-
src: z,
|
|
14
|
-
class: "aspect-square w-[150px]"
|
|
15
|
-
}, null, -1), ge = /* @__PURE__ */ n("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
16
|
-
/* @__PURE__ */ n("div", { class: "fm-typo-en-title-sm-800" }, "Create your game program"),
|
|
17
|
-
/* @__PURE__ */ n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " The game feature adds a fun element to shopping, encouraging customers to engage more. ")
|
|
18
|
-
], -1), Ve = /* @__PURE__ */ j({
|
|
19
|
-
__name: "Game",
|
|
20
|
-
setup(ye) {
|
|
21
|
-
const $ = {
|
|
22
|
-
label: "Create campaign",
|
|
23
|
-
value: "create",
|
|
24
|
-
isPrimary: !0,
|
|
25
|
-
prependIcon: "add"
|
|
26
|
-
}, E = te("GAME", J()), u = X(), r = Y(), { global: G, minor: C } = O, s = L({
|
|
27
|
-
searchKey: "",
|
|
28
|
-
location: null
|
|
29
|
-
}), p = D(
|
|
30
|
-
() => r.campaigns.token.filter(
|
|
31
|
-
(e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
|
|
32
|
-
)
|
|
33
|
-
), K = [
|
|
34
|
-
{
|
|
35
|
-
header: "Program title",
|
|
36
|
-
accessorKey: "name",
|
|
37
|
-
// accessorFn: (v) => v.name,
|
|
38
|
-
cell(e) {
|
|
39
|
-
return m("div", { class: "flex items-center justify-between gap-4" }, [
|
|
40
|
-
m("div", { class: "flex items-center" }, [
|
|
41
|
-
m(
|
|
42
|
-
v.FmTooltip,
|
|
43
|
-
{
|
|
44
|
-
content: e.row.original._id,
|
|
45
|
-
onClick: (t) => {
|
|
46
|
-
t.stopPropagation(), Q(e.row.original._id);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
[
|
|
50
|
-
m(v.FmIcon, {
|
|
51
|
-
name: "info",
|
|
52
|
-
outline: !0,
|
|
53
|
-
size: "sm"
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
)
|
|
57
|
-
]),
|
|
58
|
-
m("div", { class: "flex-1" }, e.row.original.name)
|
|
59
|
-
]);
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
header: "Status",
|
|
64
|
-
cell(e) {
|
|
65
|
-
return A(e.row.original);
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
header: "Summary",
|
|
70
|
-
accessorFn: (e) => B(e)
|
|
71
|
-
//v.effect,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
header: "Token received",
|
|
75
|
-
accessorFn: (e) => {
|
|
76
|
-
var t;
|
|
77
|
-
return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
header: "Actions",
|
|
82
|
-
cell(e) {
|
|
83
|
-
return m(v.FmButton, {
|
|
84
|
-
variant: "tertiary",
|
|
85
|
-
icon: "delete",
|
|
86
|
-
iconColor: "neutral-gray-400",
|
|
87
|
-
onClick: (t) => {
|
|
88
|
-
t.stopPropagation(), F(e.row.original);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
], k = L();
|
|
94
|
-
async function F(e) {
|
|
95
|
-
await W.remove(`Are you sure you want to remove ${e.name}?`) && await C(
|
|
96
|
-
async () => {
|
|
97
|
-
await h.delete(e._id), await r.read("GAME");
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
message: `Removing ${e.name}`,
|
|
101
|
-
successMessage: `Removed ${e.name} successfully`
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
async function f(e) {
|
|
106
|
-
e ? await t() : E.open(async (d) => {
|
|
107
|
-
await t(d);
|
|
108
|
-
});
|
|
109
|
-
async function t(d) {
|
|
110
|
-
var g;
|
|
111
|
-
(g = k.value) == null || g.showSheet(
|
|
112
|
-
!0,
|
|
113
|
-
"GAME",
|
|
114
|
-
e ? await h.readById(e._id) : void 0,
|
|
115
|
-
d
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
async function M(e) {
|
|
120
|
-
await C(
|
|
121
|
-
async () => {
|
|
122
|
-
e.campaign._id ? await h.update(e.campaign._id, e) : await h.create(e), await r.read("GAME");
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
|
|
126
|
-
successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
return H(async () => {
|
|
131
|
-
await G(async () => {
|
|
132
|
-
await r.read("GAME"), await u.readPremium();
|
|
133
|
-
});
|
|
134
|
-
}), (e, t) => {
|
|
135
|
-
const d = l("FmPill"), g = l("FmPageHead"), S = l("FmSearch"), R = l("FmTable"), P = l("FmButton"), T = l("FmListItem"), I = l("FmList"), U = l("FmCard");
|
|
136
|
-
return c(), w(x, null, [
|
|
137
|
-
i(g, {
|
|
138
|
-
actions: a(p).length > 0 && a(u).isPremium ? [$] : [],
|
|
139
|
-
"onClick:action": t[0] || (t[0] = () => f())
|
|
140
|
-
}, {
|
|
141
|
-
title: y(() => [
|
|
142
|
-
n("div", oe, [
|
|
143
|
-
ae,
|
|
144
|
-
i(d, { variant: "premium" })
|
|
145
|
-
])
|
|
146
|
-
]),
|
|
147
|
-
_: 1
|
|
148
|
-
}, 8, ["actions"]),
|
|
149
|
-
n("div", ne, [
|
|
150
|
-
i(S, {
|
|
151
|
-
modelValue: a(s).searchKey,
|
|
152
|
-
"onUpdate:modelValue": t[1] || (t[1] = (o) => a(s).searchKey = o),
|
|
153
|
-
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
154
|
-
placeholder: "search",
|
|
155
|
-
collapsible: ""
|
|
156
|
-
}, null, 8, ["modelValue"]),
|
|
157
|
-
a(r).campaigns.token && a(r).campaigns.token.length > 0 ? (c(), w(x, { key: 0 }, [
|
|
158
|
-
n("div", se, [
|
|
159
|
-
n("div", ie, [
|
|
160
|
-
i(Z, {
|
|
161
|
-
modelValue: a(s).location,
|
|
162
|
-
"onUpdate:modelValue": t[2] || (t[2] = (o) => a(s).location = o),
|
|
163
|
-
label: "Location: ",
|
|
164
|
-
"show-item-label": !0,
|
|
165
|
-
icon: "storefront",
|
|
166
|
-
placement: "bottom-start",
|
|
167
|
-
items: a(u).locationItems
|
|
168
|
-
}, null, 8, ["modelValue", "items"])
|
|
169
|
-
]),
|
|
170
|
-
i(S, {
|
|
171
|
-
modelValue: a(s).searchKey,
|
|
172
|
-
"onUpdate:modelValue": t[3] || (t[3] = (o) => a(s).searchKey = o),
|
|
173
|
-
class: "xs:hidden",
|
|
174
|
-
placeholder: "search",
|
|
175
|
-
collapsible: ""
|
|
176
|
-
}, null, 8, ["modelValue"])
|
|
177
|
-
]),
|
|
178
|
-
i(R, {
|
|
179
|
-
class: "xs:hidden",
|
|
180
|
-
"row-data": a(p),
|
|
181
|
-
"column-defs": K,
|
|
182
|
-
"search-value": a(s).searchKey,
|
|
183
|
-
"column-filter": [],
|
|
184
|
-
onRowClick: t[4] || (t[4] = (o) => f(o.original)),
|
|
185
|
-
"hide-footer": a(p).length < 10
|
|
186
|
-
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
187
|
-
i(I, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
188
|
-
default: y(() => [
|
|
189
|
-
(c(!0), w(x, null, N(a(p).filter(
|
|
190
|
-
(o) => o.name.toLowerCase().includes(a(s).searchKey.toLowerCase())
|
|
191
|
-
), (o) => (c(), b(T, {
|
|
192
|
-
key: o._id.toString(),
|
|
193
|
-
onClick: (V) => f(o),
|
|
194
|
-
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
195
|
-
}, {
|
|
196
|
-
default: y(() => [
|
|
197
|
-
n("div", le, [
|
|
198
|
-
n("div", re, [
|
|
199
|
-
(c(), b(q(a(A)(o)))),
|
|
200
|
-
n("div", ce, _(o.currentReceive ?? 0) + " used ", 1)
|
|
201
|
-
]),
|
|
202
|
-
n("div", me, [
|
|
203
|
-
n("div", de, _(o.name), 1),
|
|
204
|
-
n("div", ue, _(a(B)(o)), 1)
|
|
205
|
-
]),
|
|
206
|
-
n("div", pe, " Token received: " + _(o.currentReceive ?? 0), 1)
|
|
207
|
-
]),
|
|
208
|
-
i(P, {
|
|
209
|
-
icon: "delete",
|
|
210
|
-
"icon-color": "neutral-gray-400",
|
|
211
|
-
variant: "tertiary",
|
|
212
|
-
onClick: (V) => (V.stopPropagation(), F(o))
|
|
213
|
-
}, null, 8, ["onClick"])
|
|
214
|
-
]),
|
|
215
|
-
_: 2
|
|
216
|
-
}, 1032, ["onClick"]))), 128))
|
|
217
|
-
]),
|
|
218
|
-
_: 1
|
|
219
|
-
})
|
|
220
|
-
], 64)) : (c(), b(U, {
|
|
221
|
-
key: 1,
|
|
222
|
-
variant: "outlined",
|
|
223
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
224
|
-
}, {
|
|
225
|
-
default: y(() => [
|
|
226
|
-
fe,
|
|
227
|
-
ge,
|
|
228
|
-
i(P, {
|
|
229
|
-
variant: "primary",
|
|
230
|
-
label: "Create game program",
|
|
231
|
-
icon: "add",
|
|
232
|
-
disabled: !a(u).isPremium,
|
|
233
|
-
onClick: t[5] || (t[5] = (o) => f())
|
|
234
|
-
}, null, 8, ["disabled"])
|
|
235
|
-
]),
|
|
236
|
-
_: 1
|
|
237
|
-
})),
|
|
238
|
-
i(ee, {
|
|
239
|
-
ref_key: "sheetRef",
|
|
240
|
-
ref: k,
|
|
241
|
-
"onSubmit:modelValue": M
|
|
242
|
-
}, null, 512)
|
|
243
|
-
])
|
|
244
|
-
], 64);
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
export {
|
|
249
|
-
Ve as default
|
|
250
|
-
};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { openBlock as l, createElementBlock as o, createElementVNode as n, defineComponent as $, ref as h, onMounted as j, resolveComponent as m, renderSlot as v, toDisplayString as i, createCommentVNode as b, normalizeStyle as C, unref as s, Fragment as x, createVNode as w, withCtx as f, createTextVNode as g, normalizeClass as R, createBlock as F } from "vue";
|
|
2
|
-
import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
-
const z = {}, H = { class: "animate-pulse flex space-x-4 bg-gray-300 dark:bg-gray-700 items-center justify-center rounded w-full h-full" }, N = /* @__PURE__ */ n("svg", {
|
|
4
|
-
class: "dark:text-gray-600 h-10 text-gray-200 w-10",
|
|
5
|
-
"aria-hidden": "true",
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
fill: "currentColor",
|
|
8
|
-
viewBox: "0 0 20 18"
|
|
9
|
-
}, [
|
|
10
|
-
/* @__PURE__ */ n("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" })
|
|
11
|
-
], -1), A = [
|
|
12
|
-
N
|
|
13
|
-
];
|
|
14
|
-
function D(e, p) {
|
|
15
|
-
return l(), o("div", H, A);
|
|
16
|
-
}
|
|
17
|
-
const I = /* @__PURE__ */ V(z, [["render", D]]), L = { class: "max-w-full max-h-[400px] space-y-4" }, T = { key: 0 }, U = { class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400" }, Z = {
|
|
18
|
-
key: 1,
|
|
19
|
-
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"
|
|
20
|
-
}, E = ["src"], M = ["src"], q = { class: "absolute right-0 top-0" }, G = /* @__PURE__ */ $({
|
|
21
|
-
__name: "ImageInput",
|
|
22
|
-
props: {
|
|
23
|
-
required: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: () => !1
|
|
26
|
-
},
|
|
27
|
-
disabled: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: () => !1
|
|
30
|
-
},
|
|
31
|
-
thumbnail: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: () => {
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
file: {
|
|
37
|
-
type: File,
|
|
38
|
-
default: () => {
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
label: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: () => {
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
aspectRatio: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: "2/3"
|
|
49
|
-
},
|
|
50
|
-
imageFit: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: "contain"
|
|
53
|
-
},
|
|
54
|
-
accept: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: ".png, .jpg, .jpeg, .webm"
|
|
57
|
-
},
|
|
58
|
-
recommendedSize: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: "Recommended: 950px x 600px"
|
|
61
|
-
},
|
|
62
|
-
deleteButton: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: !0
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
emits: ["update:file"],
|
|
68
|
-
setup(e, { emit: p }) {
|
|
69
|
-
const r = e, a = h({
|
|
70
|
-
loading: !1,
|
|
71
|
-
imgsrc: r.thumbnail
|
|
72
|
-
}), u = h(!1), y = p;
|
|
73
|
-
async function d(t) {
|
|
74
|
-
return t == null ? (a.value.imgsrc = void 0, y("update:file", null)) : (u.value = !!t.type.startsWith("video/"), a.value.loading = !0, a.value.imgsrc = URL.createObjectURL(t), a.value.loading = !1, y("update:file", t));
|
|
75
|
-
}
|
|
76
|
-
return j(() => {
|
|
77
|
-
var t;
|
|
78
|
-
r.file && d(r.file), (t = r.thumbnail) != null && t.includes("mp4") && (u.value = !0);
|
|
79
|
-
}), (t, c) => {
|
|
80
|
-
const k = m("FmDropField"), S = m("FmHelperText"), _ = m("FmButton");
|
|
81
|
-
return l(), o("div", L, [
|
|
82
|
-
v(t.$slots, "label", {}, () => [
|
|
83
|
-
e.label ? (l(), o("div", T, i(e.label), 1)) : b("", !0)
|
|
84
|
-
]),
|
|
85
|
-
n("div", {
|
|
86
|
-
style: C({ "aspect-ratio": e.aspectRatio }),
|
|
87
|
-
class: "flex flex-col max-h-full max-w-full"
|
|
88
|
-
}, [
|
|
89
|
-
s(a).loading ? (l(), F(I, { key: 1 })) : (l(), o(x, { key: 0 }, [
|
|
90
|
-
s(a).imgsrc ? (l(), o("div", Z, [
|
|
91
|
-
s(u) ? (l(), o("video", {
|
|
92
|
-
key: 1,
|
|
93
|
-
src: s(a).imgsrc || e.thumbnail,
|
|
94
|
-
class: "w-full h-full",
|
|
95
|
-
controls: ""
|
|
96
|
-
}, null, 8, M)) : (l(), o("img", {
|
|
97
|
-
key: 0,
|
|
98
|
-
class: R([`object-${e.imageFit}`, "w-full h-full"]),
|
|
99
|
-
src: s(a).imgsrc || e.thumbnail
|
|
100
|
-
}, null, 10, E)),
|
|
101
|
-
n("div", q, [
|
|
102
|
-
v(t.$slots, "delete-button"),
|
|
103
|
-
e.deleteButton ? (l(), F(_, {
|
|
104
|
-
key: 0,
|
|
105
|
-
class: "!text-neutral-50 !bg-neutral-700",
|
|
106
|
-
icon: "delete",
|
|
107
|
-
variant: "tertiary",
|
|
108
|
-
disabled: e.disabled,
|
|
109
|
-
onClick: c[1] || (c[1] = (B) => d(null))
|
|
110
|
-
}, null, 8, ["disabled"])) : b("", !0)
|
|
111
|
-
])
|
|
112
|
-
])) : (l(), o(x, { key: 0 }, [
|
|
113
|
-
w(k, {
|
|
114
|
-
class: "flex-1 hihiha",
|
|
115
|
-
accept: e.accept,
|
|
116
|
-
disabled: e.disabled,
|
|
117
|
-
onFileUpload: d,
|
|
118
|
-
onFileRejected: c[0] || (c[0] = (B) => d(null))
|
|
119
|
-
}, {
|
|
120
|
-
label: f(() => [
|
|
121
|
-
g(i(void 0))
|
|
122
|
-
]),
|
|
123
|
-
"helper-text": f(() => [
|
|
124
|
-
g(i(void 0))
|
|
125
|
-
]),
|
|
126
|
-
"accept-text": f(() => [
|
|
127
|
-
n("div", U, [
|
|
128
|
-
n("div", null, "(" + i(e.recommendedSize) + ")", 1),
|
|
129
|
-
g(" Accepts " + i(e.accept), 1)
|
|
130
|
-
])
|
|
131
|
-
]),
|
|
132
|
-
_: 1
|
|
133
|
-
}, 8, ["accept", "disabled"]),
|
|
134
|
-
w(S, { text: "" })
|
|
135
|
-
], 64))
|
|
136
|
-
], 64))
|
|
137
|
-
], 4)
|
|
138
|
-
]);
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
export {
|
|
143
|
-
G as _
|
|
144
|
-
};
|