@feedmepos/mf-connect 0.1.58-prod → 0.1.60-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-CB0xAr9Q.js +427 -0
- package/dist/App-fp_3oll7.js +4630 -0
- package/dist/Bin-CPEbn14A.js +166 -0
- package/dist/Broadcast-jKp2iB8c.js +233 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CmJG893h.js +121 -0
- package/dist/Card-BaPJkgd2.js +911 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-Bqsg-ON3.js +458 -0
- package/dist/Credit-C9zIva1h.js +228 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js +2194 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Doyw0pvU.js +348 -0
- package/dist/Experience-CCI_oesa.js +229 -0
- package/dist/FileSaver.min-NlMItPOc.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/Game-CRMVz1JP.js +284 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
- package/dist/Index-szNiSnjR.js +259 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
- package/dist/MainLayout-B1aJoR95.js +41 -0
- package/dist/Marketing-AvEiNiD9.js +319 -0
- package/dist/Member-DIZwt6Hh.js +279 -0
- package/dist/MemberList-dxteIRWn.js +1607 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/MemberTransactions-Q3phmXfI.js +45 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BLk8rX-T.js +60553 -0
- package/dist/Mission-CZjySlcS.js +302 -0
- package/dist/Overview-BXbWEDy3.js +1079 -0
- package/dist/Point-CgjNc_Qn.js +232 -0
- package/dist/Promotion-COYo3qLi.js +289 -0
- package/dist/Queue-BLIStJth.js +260 -0
- package/dist/Record-BWoTvVEE.js +341 -0
- package/dist/Reward-Dq6GxHMP.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CR1feHth.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DuYYfbOH.js +1763 -0
- package/dist/Segment-CUfn6k5R.js +882 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CxycOqNJ.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7jqrfEj.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CMmdbYH4.js +147 -0
- package/dist/Setting-CC5AiQSy.js +1928 -0
- package/dist/SettingAdvertisements-DHQTaMC1.js +262 -0
- package/dist/Store-CEgv5aOD.js +1842 -0
- package/dist/StoreRewards-Dtzk_YG2.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cwt8pmoM.js +995 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BEU2u1-a.js +139 -0
- package/dist/Tier-1xqQvWzc.js +895 -0
- package/dist/Title-Da-G8plz.js +566 -0
- package/dist/Transaction-B0vuVZFZ.js +39 -0
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-e4-wNfrg.js +130 -0
- package/dist/Voucher-DLFjkXLu.js +384 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-5X7dGFD9.js +419 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BPTrvEwa.js +56 -0
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-Do_C3F_N.js +7094 -0
- package/dist/app-o7Kvv5aK.js +57962 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +6 -0
- package/dist/business-BDi-QTa5.js +82 -0
- package/dist/campaign-BHqizYy6.js +1810 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign-DNXI3K9c.js +94 -0
- package/dist/campaign.enum-BXDwYoeA.js +20 -0
- package/dist/campaign.fn-Rws4mJa5.js +758 -0
- package/dist/collectible.enum-cMc4fL1T.js +19 -0
- package/dist/collection.fn-F8FZ7Dnr.js +26 -0
- package/dist/dto-CAtf1jq0.js +216 -0
- package/dist/effect-Dhg1ZIrL.js +78 -0
- package/dist/email-addresses-BZJZwglQ.js +705 -0
- package/dist/export-B6yvRuct.js +97 -0
- package/dist/feedme.ico +0 -0
- package/dist/helper-VoErinsY.js +71 -0
- package/dist/index-B0Pzwzkd.js +31 -0
- package/dist/index-Bq6FwMwW.js +32 -0
- package/dist/index-BvE6Sbog.js +3 -0
- package/dist/index-BysJoGFD.js +146 -0
- package/dist/index-C8m_F_I4.js +121 -0
- package/dist/index-CQZinjc9.js +54 -0
- package/dist/index-Cq7s1Pk2.js +76 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-DOGrOlB8.js +8859 -0
- package/dist/index-Di23nMJ7.js +38 -0
- package/dist/index-Dkyb4P6T.js +30076 -0
- package/dist/index-DvZiQOtl.js +3077 -0
- package/dist/index-Ved5V90A.js +2155 -0
- package/dist/index-d4A3r8kv.js +32269 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index-y7IqG-tl.js +44 -0
- package/dist/index.esm2017-CRTpUsW5.js +3069 -0
- package/dist/loading-CoUrS63J.js +71 -0
- package/dist/lodash-B5I3zXaY.js +3678 -0
- package/dist/membership-BiQwBHAA.js +235 -0
- package/dist/moment-D7p2TMB-.js +2583 -0
- package/dist/money-CA3gpWD3.js +15 -0
- package/dist/number-CgmVpwHm.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/objectid-C80eoTvt.js +145 -0
- package/dist/plugins-BkWtR_R5.js +208 -0
- package/dist/reward-D7SKofYj.js +36 -0
- package/dist/rule-Cpxty5PH.js +1951 -0
- package/dist/rule-builder-d_TMgXEC.js +102 -0
- package/dist/style.css +4 -0
- package/dist/template-BB7bab5R.js +190 -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-Dj3UaenF.js +1151 -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-ZVR5eR1H.js +144 -0
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/type_drinks-D6jnpvwV.js +4 -0
- package/dist/usePagination-Ds-cuHop.js +223 -0
- package/dist/user-DjRqnFsC.js +54 -0
- package/dist/vue-i18n-BlCNfIcP.js +2365 -0
- package/dist/xlsx-CtNr_GAa.js +15491 -0
- package/dist/zod-Bg2FbC-D.js +90 -0
- package/package.json +1 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { defineComponent as N, ref as L, computed as j, h as M, onMounted as H, resolveComponent as m, openBlock as d, createElementBlock as y, Fragment as h, createVNode as i, unref as t, createElementVNode as n, withCtx as C, renderList as q, createBlock as w, resolveDynamicComponent as O, toDisplayString as g, createCommentVNode as z } from "vue";
|
|
2
|
+
import { _ as G } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as J, components as Q } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as W } from "./plugins-BkWtR_R5.js";
|
|
5
|
+
import { u as X } from "./loading-CoUrS63J.js";
|
|
6
|
+
import { u as Y } from "./business-BDi-QTa5.js";
|
|
7
|
+
import { u as Z } from "./campaign-DNXI3K9c.js";
|
|
8
|
+
import { g as ee, a as S, b as V } from "./campaign-BHqizYy6.js";
|
|
9
|
+
import { u as oe } from "./vue-i18n-BlCNfIcP.js";
|
|
10
|
+
import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
11
|
+
import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js";
|
|
12
|
+
import { u as ne } from "./template-BB7bab5R.js";
|
|
13
|
+
import { c as _ } from "./index-C8m_F_I4.js";
|
|
14
|
+
const re = { 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" }, ce = { class: "space-y-8" }, le = { 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" }, ue = { class: "fm-typo-en-body-lg-600" }, pe = { 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 = { key: 0 }, Ie = /* @__PURE__ */ N({
|
|
15
|
+
__name: "Credit",
|
|
16
|
+
setup(ge) {
|
|
17
|
+
const { t: r } = oe(), B = {
|
|
18
|
+
label: r("connect.program.common.actions.create", {
|
|
19
|
+
type: r("connect.program.credit.title").toLowerCase()
|
|
20
|
+
}),
|
|
21
|
+
value: "create",
|
|
22
|
+
isPrimary: !0,
|
|
23
|
+
prependIcon: "add"
|
|
24
|
+
}, I = ne("CREDIT", J()), R = Y(), u = Z(), { global: D, minor: v } = X, s = L({
|
|
25
|
+
searchKey: "",
|
|
26
|
+
location: []
|
|
27
|
+
});
|
|
28
|
+
function T(e) {
|
|
29
|
+
const o = s.value.location;
|
|
30
|
+
return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((l) => {
|
|
31
|
+
var c;
|
|
32
|
+
return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
|
|
33
|
+
}) : e.targetLocation.includes(o);
|
|
34
|
+
}
|
|
35
|
+
const p = j(
|
|
36
|
+
() => u.campaigns.credit.filter((e) => T(e))
|
|
37
|
+
), E = [
|
|
38
|
+
{
|
|
39
|
+
header: r("connect.program.common.table.title"),
|
|
40
|
+
accessorFn: (e) => e.name
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
header: r("connect.program.common.table.status"),
|
|
44
|
+
accessorFn: (e) => ee(e),
|
|
45
|
+
cell(e) {
|
|
46
|
+
return S(e.row.original);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: r("connect.program.common.table.summary"),
|
|
51
|
+
accessorFn: (e) => V(e)
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
header: r("connect.program.common.table.actions"),
|
|
55
|
+
cell(e) {
|
|
56
|
+
return M(Q.FmButton, {
|
|
57
|
+
variant: "tertiary",
|
|
58
|
+
icon: "delete",
|
|
59
|
+
iconColor: "neutral-gray-400",
|
|
60
|
+
onClick: (o) => {
|
|
61
|
+
o.stopPropagation(), x(e.row.original);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
], b = L();
|
|
67
|
+
async function x(e) {
|
|
68
|
+
await W.remove(
|
|
69
|
+
r("connect.program.common.remove.confirm", { name: e.name })
|
|
70
|
+
) && await v(
|
|
71
|
+
async () => {
|
|
72
|
+
await _.delete(e._id), await u.read("CREDIT");
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
message: r("connect.program.common.remove.removing", { name: e.name }),
|
|
76
|
+
successMessage: r("connect.program.common.remove.removed", {
|
|
77
|
+
name: e.name
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
async function f(e) {
|
|
83
|
+
e ? await o() : I.open(async (l) => {
|
|
84
|
+
await o(l);
|
|
85
|
+
});
|
|
86
|
+
async function o(l) {
|
|
87
|
+
var c;
|
|
88
|
+
(c = b.value) == null || c.showSheet(
|
|
89
|
+
!0,
|
|
90
|
+
"CREDIT",
|
|
91
|
+
e ? await _.readById(e._id) : void 0,
|
|
92
|
+
l
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function K(e) {
|
|
97
|
+
await v(
|
|
98
|
+
async () => {
|
|
99
|
+
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("CREDIT");
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
|
|
103
|
+
successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return H(async () => {
|
|
108
|
+
await D(async () => {
|
|
109
|
+
await u.read("CREDIT");
|
|
110
|
+
});
|
|
111
|
+
}), (e, o) => {
|
|
112
|
+
const l = m("FmPageHead"), c = m("FmSearch"), $ = m("FmTable"), F = m("FmButton"), P = m("FmListItem"), U = m("FmList"), A = m("FmCard");
|
|
113
|
+
return d(), y(h, null, [
|
|
114
|
+
i(l, {
|
|
115
|
+
title: t(r)("connect.program.credit.title"),
|
|
116
|
+
actions: t(p).length > 0 ? [B] : [],
|
|
117
|
+
"onClick:action": o[0] || (o[0] = () => f())
|
|
118
|
+
}, null, 8, ["title", "actions"]),
|
|
119
|
+
n("div", re, [
|
|
120
|
+
i(c, {
|
|
121
|
+
modelValue: t(s).searchKey,
|
|
122
|
+
"onUpdate:modelValue": o[1] || (o[1] = (a) => t(s).searchKey = a),
|
|
123
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
124
|
+
placeholder: "search",
|
|
125
|
+
collapsible: ""
|
|
126
|
+
}, null, 8, ["modelValue"]),
|
|
127
|
+
t(u).campaigns.credit && t(u).campaigns.credit.length > 0 ? (d(), y(h, { key: 0 }, [
|
|
128
|
+
n("div", se, [
|
|
129
|
+
n("div", ie, [
|
|
130
|
+
i(te, {
|
|
131
|
+
label: `${t(r)("connect.common.location")}: `,
|
|
132
|
+
"right-icon": "keyboard_arrow_down",
|
|
133
|
+
modelValue: t(s).location,
|
|
134
|
+
"onUpdate:modelValue": o[2] || (o[2] = (a) => t(s).location = a),
|
|
135
|
+
icon: "storefront",
|
|
136
|
+
"show-item-label": !0,
|
|
137
|
+
items: t(R).locationOptions
|
|
138
|
+
}, null, 8, ["label", "modelValue", "items"])
|
|
139
|
+
]),
|
|
140
|
+
i(c, {
|
|
141
|
+
modelValue: t(s).searchKey,
|
|
142
|
+
"onUpdate:modelValue": o[3] || (o[3] = (a) => t(s).searchKey = a),
|
|
143
|
+
class: "xs:hidden",
|
|
144
|
+
placeholder: "search",
|
|
145
|
+
collapsible: ""
|
|
146
|
+
}, null, 8, ["modelValue"])
|
|
147
|
+
]),
|
|
148
|
+
i($, {
|
|
149
|
+
class: "xs:hidden",
|
|
150
|
+
"row-data": t(p),
|
|
151
|
+
"column-defs": E,
|
|
152
|
+
"search-value": t(s).searchKey,
|
|
153
|
+
"column-filter": [],
|
|
154
|
+
onRowClick: o[4] || (o[4] = (a) => f(a.original)),
|
|
155
|
+
"hide-footer": t(p).length < 10
|
|
156
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
157
|
+
i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
158
|
+
default: C(() => [
|
|
159
|
+
(d(!0), y(h, null, q(t(p).filter(
|
|
160
|
+
(a) => a.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
|
|
161
|
+
), (a) => (d(), w(P, {
|
|
162
|
+
key: a._id.toString(),
|
|
163
|
+
onClick: (k) => f(a),
|
|
164
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
165
|
+
}, {
|
|
166
|
+
default: C(() => [
|
|
167
|
+
n("div", ce, [
|
|
168
|
+
n("div", le, [
|
|
169
|
+
(d(), w(O(t(S)(a)))),
|
|
170
|
+
n("div", me, g(a.currentReceive ?? 0) + " used ", 1)
|
|
171
|
+
]),
|
|
172
|
+
n("div", de, [
|
|
173
|
+
n("div", ue, g(a.name), 1),
|
|
174
|
+
n("div", pe, g(t(V)(a)), 1)
|
|
175
|
+
]),
|
|
176
|
+
n("div", fe, " Credit received: " + g(a.currentReceive ?? 0), 1)
|
|
177
|
+
]),
|
|
178
|
+
i(F, {
|
|
179
|
+
icon: "delete",
|
|
180
|
+
"icon-color": "neutral-gray-400",
|
|
181
|
+
variant: "tertiary",
|
|
182
|
+
onClick: (k) => (k.stopPropagation(), x(a))
|
|
183
|
+
}, null, 8, ["onClick"])
|
|
184
|
+
]),
|
|
185
|
+
_: 2
|
|
186
|
+
}, 1032, ["onClick"]))), 128))
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
}),
|
|
190
|
+
t(p).length == 0 ? (d(), y("div", ye, [...o[6] || (o[6] = [
|
|
191
|
+
n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
|
|
192
|
+
])])) : z("", !0)
|
|
193
|
+
], 64)) : (d(), w(A, {
|
|
194
|
+
key: 1,
|
|
195
|
+
variant: "outlined",
|
|
196
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
197
|
+
}, {
|
|
198
|
+
default: C(() => [
|
|
199
|
+
o[7] || (o[7] = n("img", {
|
|
200
|
+
src: G,
|
|
201
|
+
class: "aspect-square w-[150px]"
|
|
202
|
+
}, null, -1)),
|
|
203
|
+
o[8] || (o[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
204
|
+
n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
|
|
205
|
+
n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
|
|
206
|
+
], -1)),
|
|
207
|
+
i(F, {
|
|
208
|
+
variant: "primary",
|
|
209
|
+
label: "Create credit program",
|
|
210
|
+
icon: "add",
|
|
211
|
+
onClick: o[5] || (o[5] = (a) => f())
|
|
212
|
+
})
|
|
213
|
+
]),
|
|
214
|
+
_: 1
|
|
215
|
+
})),
|
|
216
|
+
i(ae, {
|
|
217
|
+
ref_key: "sheetRef",
|
|
218
|
+
ref: b,
|
|
219
|
+
"onSubmit:modelValue": K
|
|
220
|
+
}, null, 512)
|
|
221
|
+
])
|
|
222
|
+
], 64);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
export {
|
|
227
|
+
Ie as default
|
|
228
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { defineComponent as j, ref as B, computed as N, resolveComponent as i, openBlock as n, createBlock as g, unref as r, withCtx as v, renderSlot as p, createElementBlock as f, toDisplayString as h, createCommentVNode as F, createVNode as C, normalizeClass as V, createElementVNode as q, Fragment as A, renderList as E } from "vue";
|
|
2
|
+
const M = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "fm-typo-en-body-lg-400 mb-4"
|
|
5
|
+
}, O = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "fm-typo-en-body-lg-400"
|
|
8
|
+
}, D = { class: "rounded-md bg-white shadow-md max-h-[300px] overflow-y-scroll pl-4 py-12" }, G = /* @__PURE__ */ j({
|
|
9
|
+
__name: "CustomSelect",
|
|
10
|
+
props: {
|
|
11
|
+
label: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: !1
|
|
14
|
+
},
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: !1
|
|
18
|
+
},
|
|
19
|
+
items: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: !0
|
|
22
|
+
},
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: Object
|
|
25
|
+
},
|
|
26
|
+
zIndex: {
|
|
27
|
+
type: Number
|
|
28
|
+
},
|
|
29
|
+
multiselect: {
|
|
30
|
+
type: Boolean
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:model-value"],
|
|
34
|
+
setup(e, { emit: w }) {
|
|
35
|
+
const u = e, s = w, d = B(!1), b = N(() => !u.multiselect || !u.modelValue ? !1 : u.items.every((m) => u.modelValue.includes(m.value))), I = () => {
|
|
36
|
+
u.multiselect && (b.value ? s("update:model-value", []) : s(
|
|
37
|
+
"update:model-value",
|
|
38
|
+
u.items.map((m) => m.value)
|
|
39
|
+
));
|
|
40
|
+
};
|
|
41
|
+
return (m, c) => {
|
|
42
|
+
const S = i("FmIcon"), z = i("FmField"), k = i("FmMenuItem"), P = i("FmPopover");
|
|
43
|
+
return n(), g(P, {
|
|
44
|
+
"show-popover": r(d),
|
|
45
|
+
onPopoverChanged: c[1] || (c[1] = (l) => d.value = l),
|
|
46
|
+
"z-index": e.zIndex
|
|
47
|
+
}, {
|
|
48
|
+
"popover-button": v(() => [
|
|
49
|
+
p(m.$slots, "popover-button", {}, () => [
|
|
50
|
+
e.label ? (n(), f("div", M, h(e.label), 1)) : F("", !0),
|
|
51
|
+
C(z, null, {
|
|
52
|
+
append: v(() => [
|
|
53
|
+
p(m.$slots, "append"),
|
|
54
|
+
C(S, {
|
|
55
|
+
name: r(d) ? "expand_less" : "expand_more",
|
|
56
|
+
size: "md",
|
|
57
|
+
color: "black"
|
|
58
|
+
}, null, 8, ["name"])
|
|
59
|
+
]),
|
|
60
|
+
default: v(() => {
|
|
61
|
+
var l;
|
|
62
|
+
return [
|
|
63
|
+
e.multiselect ? (n(), f("div", O, h((() => {
|
|
64
|
+
const t = e.items.filter(
|
|
65
|
+
(o) => {
|
|
66
|
+
var a;
|
|
67
|
+
return (a = e.modelValue) == null ? void 0 : a.includes(o.value);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
return t.length <= 5 ? t.map((o) => o.label).join(", ") : t.slice(0, 5).map((o) => o.label).join(", ") + ` +${t.length - 5} selected`;
|
|
71
|
+
})()), 1)) : (n(), f("div", {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: V(["fm-typo-en-body-lg-400", {
|
|
74
|
+
"text-fm-color-typo-secondary": !e.items.find(
|
|
75
|
+
(t) => t.value == e.modelValue
|
|
76
|
+
)
|
|
77
|
+
}])
|
|
78
|
+
}, h(((l = e.items.find((t) => t.value == e.modelValue)) == null ? void 0 : l.label) || e.placeholder), 3))
|
|
79
|
+
];
|
|
80
|
+
}),
|
|
81
|
+
_: 3
|
|
82
|
+
})
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
default: v(() => [
|
|
86
|
+
q("div", D, [
|
|
87
|
+
e.multiselect ? (n(), g(k, {
|
|
88
|
+
key: 0,
|
|
89
|
+
class: V(`${r(b) ? "bg-fm-color-system-warning-100" : ""}`),
|
|
90
|
+
"has-checkbox": !0,
|
|
91
|
+
"model-value": r(b),
|
|
92
|
+
label: "All",
|
|
93
|
+
onClick: c[0] || (c[0] = (l) => {
|
|
94
|
+
l.stopPropagation(), I();
|
|
95
|
+
})
|
|
96
|
+
}, null, 8, ["class", "model-value"])) : F("", !0),
|
|
97
|
+
(n(!0), f(A, null, E(e.items, (l) => {
|
|
98
|
+
var t, o;
|
|
99
|
+
return n(), g(k, {
|
|
100
|
+
class: V(`${e.multiselect ? (t = e.modelValue) != null && t.some((a) => a == l.value) ? "bg-fm-color-system-warning-100" : "" : e.modelValue == l.value}`),
|
|
101
|
+
"has-checkbox": e.multiselect,
|
|
102
|
+
key: l.value,
|
|
103
|
+
"model-value": e.multiselect ? (o = e.modelValue) == null ? void 0 : o.some((a) => a == l.value) : e.modelValue == l.value,
|
|
104
|
+
label: l.label,
|
|
105
|
+
onClick: (a) => {
|
|
106
|
+
var x;
|
|
107
|
+
if (a.stopPropagation(), !e.multiselect)
|
|
108
|
+
d.value = !1, s("update:model-value", l.value);
|
|
109
|
+
else {
|
|
110
|
+
const $ = (x = e.modelValue) == null ? void 0 : x.some((y) => y == l.value);
|
|
111
|
+
s(
|
|
112
|
+
"update:model-value",
|
|
113
|
+
$ ? (e.modelValue ?? []).filter((y) => y !== l.value) : [...e.modelValue ?? [], l.value]
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}, null, 8, ["class", "has-checkbox", "model-value", "label", "onClick"]);
|
|
118
|
+
}), 128))
|
|
119
|
+
])
|
|
120
|
+
]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 8, ["show-popover", "z-index"]);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
export {
|
|
127
|
+
G as _
|
|
128
|
+
};
|