@feedmepos/mf-connect 0.1.38-beta.25 → 0.1.38-beta.27
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-CnNFr3FF.js → Analytic-Dgpp4zkU.js} +13 -13
- package/dist/{App-Bs4Lgw2l.js → App-DNRzPvQb.js} +7 -7
- package/dist/{AuditLogs-BLoAipFo.js → AuditLogs-BhG5wShL.js} +10 -10
- package/dist/{Bin-CGTdlBny.js → Bin-BSmAVdOX.js} +8 -8
- package/dist/Broadcast-DZ-qedno.js +233 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B2Rodvvf.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BS5HDnfb.js} +6 -6
- package/dist/{Card-CkP5_s5B.js → Card-CLTczC6l.js} +16 -16
- package/dist/{Collections-Czp-eFqo.js → Collections-CZIk5DSy.js} +6 -6
- package/dist/Credit-DGGU3d68.js +228 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CD_HmVtT.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-FxEXBhTK.js} +110 -109
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CeJtGIq8.js → EffectSheet.vue_vue_type_style_index_0_lang-Bx_7FAYn.js} +6 -6
- package/dist/Experience-Dd0Xkp_z.js +229 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/{Game-BU19eUZe.js → Game-N6iQZPqM.js} +103 -97
- package/dist/{Grab-DrgKhQ-n.js → Grab-Dn8pP3Vy.js} +10 -10
- package/dist/{Index-j750egzP.js → Index-Do0nSsYj.js} +10 -10
- package/dist/{Marketing-DxBCWgGW.js → Marketing-BG8L2AVq.js} +6 -6
- package/dist/{Member-BlpnS-gt.js → Member-HQWOfz1g.js} +10 -10
- package/dist/{MemberList-XolPpdeh.js → MemberList-jfgCK6k3.js} +25 -25
- package/dist/{MemberTransactions-mE7RmB-H.js → MemberTransactions-DYOBM90W.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CnIWWNgD.js → MessageInput.vue_vue_type_script_setup_true_lang-DdaqUEEb.js} +7 -7
- package/dist/{Mission-BtavZVDY.js → Mission-CkXM1dNO.js} +112 -106
- package/dist/{Overview-AnvTfXXo.js → Overview-BJWncUrN.js} +18 -18
- package/dist/Point-CfuVogKH.js +232 -0
- package/dist/{Promotion-By1szSrB.js → Promotion-TtgchqMU.js} +11 -11
- package/dist/{Queue-CDNcLHGr.js → Queue-xaCqQVUP.js} +11 -11
- package/dist/{Record-D7CLYo3F.js → Record-D6z_Pywk.js} +8 -8
- package/dist/{Reward-BfCNtJE1.js → Reward-DBzn5tRP.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BIsAuAN2.js → RewardGroup.vue_vue_type_script_setup_true_lang-CRv8xHpU.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DFZsY5Wx.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bd8pXLRT.js} +13 -13
- package/dist/{Segment-Cx4Y8niG.js → Segment-gxBRnKo7.js} +22 -22
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BZ_J5OFJ.js → SelectItems.vue_vue_type_script_setup_true_lang-DbC6xTWH.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BJGAnjDZ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BAraQhKS.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CJ5lkVPN.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CFnFyNya.js} +3 -3
- package/dist/{Setting-CZ-ZoCbx.js → Setting-DX7hLnTQ.js} +11 -11
- package/dist/{Store-BEolF_8B.js → Store-C3GZXKuC.js} +19 -19
- package/dist/{StoreRewards-Dad1Zg2s.js → StoreRewards-CCWDGKLp.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BioIIRWp.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNgDoMR9.js} +21 -21
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DFck5Zap.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DQmZE9_V.js} +1 -1
- package/dist/{Tier-DkMdCg4f.js → Tier-DbWQM6De.js} +20 -20
- package/dist/{Title-CE4vkjCt.js → Title-a2bTIZi0.js} +19 -19
- package/dist/{Transaction-DQOdYA5y.js → Transaction-f8XwfBob.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CLIhaeAY.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DUQ0fU5s.js} +6 -6
- package/dist/{Voucher-BNCkPTeD.js → Voucher-C7Dfsqk6.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BCG4LuXq.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C5fm0K4i.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DZPz72YM.js → ZodTextField.vue_vue_type_script_setup_true_lang-A-h4HUTJ.js} +1 -1
- package/dist/{app-CGyViOA2.js → app-BOG1dC8a.js} +32 -32
- package/dist/{app-DuuQV4iK.js → app-jGPh064M.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CT9f5Mcu.js → business--P6e14wH.js} +11 -8
- package/dist/{campaign-DruWV9_z.js → campaign-CR_hUukZ.js} +9 -9
- package/dist/{campaign-QNfednQV.js → campaign-C_gQlNNb.js} +2 -2
- package/dist/{campaign.enum-BfqWuf2f.js → campaign.enum-Dj5o3Gnx.js} +1 -1
- package/dist/{campaign.fn-CdyLr0Xa.js → campaign.fn-DQZ0W-EB.js} +63 -63
- package/dist/{collectible.enum-C4SBy9ie.js → collectible.enum-DQgguzyG.js} +1 -1
- package/dist/{collection.fn-DGmard-T.js → collection.fn-1jzRWzrr.js} +2 -2
- package/dist/{dto-AdHaYlrt.js → dto-C3jWvc1e.js} +4 -4
- package/dist/{effect-BxLYXWa0.js → effect-dA2mpaCE.js} +1 -1
- package/dist/{email-addresses-BywpJOyH.js → email-addresses-37_SE2AF.js} +1 -1
- package/dist/{export-CaCjWJbv.js → export-Cn7Elq59.js} +3 -3
- package/dist/{helper-1sDGGcCs.js → helper-1FmJd7OP.js} +1 -1
- package/dist/{index-Ce7luA3z.js → index-B4j34swO.js} +1 -1
- package/dist/{index-DOeqRIlL.js → index-B9iL1w4-.js} +3 -3
- package/dist/{index-xV0yJaxT.js → index-BRALrcjU.js} +1452 -1452
- package/dist/{index-_mZAUf_O.js → index-BcEhSpSd.js} +1 -1
- package/dist/{index-ILVT0cch.js → index-Bv04ElXo.js} +6 -6
- package/dist/{index-DKsWTRyN.js → index-BwBDTG0U.js} +4 -4
- package/dist/{index-BWINkCFC.js → index-C0TBodx0.js} +1 -1
- package/dist/{index-DWRBSads.js → index-C0uZD6Fb.js} +1 -1
- package/dist/{index-J-gYw1zz.js → index-CCzzmRaK.js} +3 -3
- package/dist/{index-AYw2MTFM.js → index-Cq9x3KEB.js} +1 -1
- package/dist/{index-DJZ-kqpE.js → index-DIup5B2H.js} +1 -1
- package/dist/{index-DZ3vwqCm.js → index-Da1osm0C.js} +1 -1
- package/dist/{index-BGWAVguX.js → index-Oly5lYMA.js} +1 -1
- package/dist/{index-Cur9hyPV.js → index-YhB238q9.js} +2 -2
- package/dist/{index.esm2017-Bo-H9Epv.js → index.esm2017-pcImat1a.js} +1 -1
- package/dist/{loading-Bqjqslgf.js → loading-BIAeRmZo.js} +1 -1
- package/dist/{membership-CqhEppfS.js → membership-D74wSltj.js} +3 -3
- package/dist/{money-CooAqk_P.js → money-DQuZChef.js} +1 -1
- package/dist/{number-C6cARyqZ.js → number-DORW-adL.js} +1 -1
- package/dist/objectid-CPqo6DS_.js +145 -0
- package/dist/{plugins-BaVr4Awd.js → plugins-BVLU2dc_.js} +2 -2
- package/dist/{reward-43EpLVnK.js → reward-CsZQy2b1.js} +1 -1
- package/dist/{rule-CECnGrxI.js → rule-CtYg9lgQ.js} +3 -3
- package/dist/{rule-builder-C58mHAaP.js → rule-builder-TwHL3OPZ.js} +1 -1
- package/dist/{template-CMZziR_-.js → template-DlLEQKFu.js} +4 -4
- package/dist/{timezone-DpcMMfGn.js → timezone-DGJqaz8e.js} +1 -1
- package/dist/{trigger-D99PwOLC.js → trigger-B4JMJKDj.js} +4 -4
- package/dist/{user-C1NEGH5J.js → user-ZU2f1nbT.js} +1 -1
- package/dist/{vue-i18n-CzjqSUwt.js → vue-i18n-BtpjMXUM.js} +301 -301
- package/dist/{xlsx-DOkzrP7b.js → xlsx-BiJUMUcX.js} +1 -1
- package/package.json +1 -1
- package/dist/Broadcast-B3W5RzRy.js +0 -227
- package/dist/Credit-BcaIvY_C.js +0 -222
- package/dist/Experience-CqpT4RKC.js +0 -223
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
- package/dist/Point-Bw1G73vZ.js +0 -226
- package/dist/objectid-DiYL018Z.js +0 -145
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { defineComponent as E, ref as S, computed as U, onMounted as j, resolveComponent as m, openBlock as p, createElementBlock as _, Fragment as x, createVNode as i, unref as o, createElementVNode as a, withCtx as h, renderList as M, createBlock as w, resolveDynamicComponent as H, toDisplayString as u, h as q } from "vue";
|
|
2
|
+
import { _ as z } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as G, components as J } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as Q } from "./plugins-BVLU2dc_.js";
|
|
5
|
+
import { u as W } from "./loading-BIAeRmZo.js";
|
|
6
|
+
import { u as X } from "./business--P6e14wH.js";
|
|
7
|
+
import { u as Y } from "./campaign-C_gQlNNb.js";
|
|
8
|
+
import { a as L, b as V, g as Z } from "./campaign-CR_hUukZ.js";
|
|
9
|
+
import { u as ee } from "./vue-i18n-BtpjMXUM.js";
|
|
10
|
+
import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
11
|
+
import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-FxEXBhTK.js";
|
|
12
|
+
import { u as ne } from "./template-DlLEQKFu.js";
|
|
13
|
+
import { c as g } from "./index-C0uZD6Fb.js";
|
|
14
|
+
const ae = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, le = { 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" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ie = /* @__PURE__ */ E({
|
|
15
|
+
__name: "Experience",
|
|
16
|
+
setup(_e) {
|
|
17
|
+
const { t: r } = ee(), P = {
|
|
18
|
+
label: r("connect.program.common.actions.create", {
|
|
19
|
+
type: r("connect.program.experience.title").toLowerCase()
|
|
20
|
+
}),
|
|
21
|
+
value: "create",
|
|
22
|
+
isPrimary: !0,
|
|
23
|
+
prependIcon: "add"
|
|
24
|
+
}, B = ne("POINT", G()), I = X(), d = Y(), { global: T, minor: v } = W, s = S({
|
|
25
|
+
searchKey: "",
|
|
26
|
+
location: []
|
|
27
|
+
});
|
|
28
|
+
function $(e) {
|
|
29
|
+
const t = s.value.location;
|
|
30
|
+
return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
|
|
31
|
+
var c;
|
|
32
|
+
return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
|
|
33
|
+
}) : e.targetLocation.includes(t);
|
|
34
|
+
}
|
|
35
|
+
const f = U(
|
|
36
|
+
() => d.campaigns.experience.filter((e) => $(e))
|
|
37
|
+
), K = [
|
|
38
|
+
{
|
|
39
|
+
header: "Program title",
|
|
40
|
+
accessorFn: (e) => e.name
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
header: "Status",
|
|
44
|
+
accessorFn: (e) => Z(e),
|
|
45
|
+
cell(e) {
|
|
46
|
+
return L(e.row.original);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: "Summary",
|
|
51
|
+
accessorFn: (e) => V(e)
|
|
52
|
+
//v.effect,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
header: "Actions",
|
|
56
|
+
cell(e) {
|
|
57
|
+
return q(J.FmButton, {
|
|
58
|
+
variant: "tertiary",
|
|
59
|
+
icon: "delete",
|
|
60
|
+
iconColor: "neutral-gray-400",
|
|
61
|
+
onClick: (t) => {
|
|
62
|
+
t.stopPropagation(), C(e.row.original);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
], b = S();
|
|
68
|
+
async function C(e) {
|
|
69
|
+
await Q.remove(`Are you sure you want to remove ${e.name}?`) && await v(
|
|
70
|
+
async () => {
|
|
71
|
+
await g.delete(e._id), await d.read("POINT");
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
message: `Removing ${e.name}`,
|
|
75
|
+
successMessage: `Removed ${e.name} successfully`
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
async function y(e) {
|
|
80
|
+
e ? await t() : B.open(async (l) => {
|
|
81
|
+
await t(l);
|
|
82
|
+
});
|
|
83
|
+
async function t(l) {
|
|
84
|
+
var c;
|
|
85
|
+
(c = b.value) == null || c.showSheet(
|
|
86
|
+
!0,
|
|
87
|
+
"POINT",
|
|
88
|
+
e ? await g.readById(e._id) : void 0,
|
|
89
|
+
l
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function N(e) {
|
|
94
|
+
await v(
|
|
95
|
+
async () => {
|
|
96
|
+
e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await d.read("POINT");
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
message: r("connect.program.common.update.updating", {
|
|
100
|
+
type: r("connect.program.experience.title")
|
|
101
|
+
}),
|
|
102
|
+
successMessage: r("connect.program.common.update.success", {
|
|
103
|
+
type: r("connect.program.experience.title"),
|
|
104
|
+
action: e.campaign._id ? "updated" : "created"
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
return j(async () => {
|
|
110
|
+
await T(async () => {
|
|
111
|
+
await d.read("POINT");
|
|
112
|
+
});
|
|
113
|
+
}), (e, t) => {
|
|
114
|
+
const l = m("FmPageHead"), c = m("FmSearch"), R = m("FmTable"), F = m("FmButton"), A = m("FmListItem"), O = m("FmList"), D = m("FmCard");
|
|
115
|
+
return p(), _(x, null, [
|
|
116
|
+
i(l, {
|
|
117
|
+
title: o(r)("connect.program.experience.title"),
|
|
118
|
+
actions: o(f).length > 0 ? [P] : [],
|
|
119
|
+
"onClick:action": t[0] || (t[0] = () => y())
|
|
120
|
+
}, null, 8, ["title", "actions"]),
|
|
121
|
+
a("div", ae, [
|
|
122
|
+
i(c, {
|
|
123
|
+
modelValue: o(s).searchKey,
|
|
124
|
+
"onUpdate:modelValue": t[1] || (t[1] = (n) => o(s).searchKey = n),
|
|
125
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
126
|
+
placeholder: o(r)("connect.program.common.search"),
|
|
127
|
+
collapsible: ""
|
|
128
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
129
|
+
o(d).campaigns.experience && o(d).campaigns.experience.length > 0 ? (p(), _(x, { key: 0 }, [
|
|
130
|
+
a("div", re, [
|
|
131
|
+
a("div", se, [
|
|
132
|
+
i(te, {
|
|
133
|
+
label: `${o(r)("connect.common.location")}: `,
|
|
134
|
+
"right-icon": "keyboard_arrow_down",
|
|
135
|
+
modelValue: o(s).location,
|
|
136
|
+
"onUpdate:modelValue": t[2] || (t[2] = (n) => o(s).location = n),
|
|
137
|
+
icon: "storefront",
|
|
138
|
+
"show-item-label": !0,
|
|
139
|
+
items: o(I).locationOptions
|
|
140
|
+
}, null, 8, ["label", "modelValue", "items"])
|
|
141
|
+
]),
|
|
142
|
+
i(c, {
|
|
143
|
+
modelValue: o(s).searchKey,
|
|
144
|
+
"onUpdate:modelValue": t[3] || (t[3] = (n) => o(s).searchKey = n),
|
|
145
|
+
class: "xs:hidden",
|
|
146
|
+
placeholder: "search",
|
|
147
|
+
collapsible: ""
|
|
148
|
+
}, null, 8, ["modelValue"])
|
|
149
|
+
]),
|
|
150
|
+
i(R, {
|
|
151
|
+
class: "xs:hidden",
|
|
152
|
+
"row-data": o(f),
|
|
153
|
+
"column-defs": K,
|
|
154
|
+
"search-value": o(s).searchKey,
|
|
155
|
+
"column-filter": [],
|
|
156
|
+
onRowClick: t[4] || (t[4] = (n) => y(n.original)),
|
|
157
|
+
"hide-footer": o(f).length < 10
|
|
158
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
159
|
+
i(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
160
|
+
default: h(() => [
|
|
161
|
+
(p(!0), _(x, null, M(o(f).filter(
|
|
162
|
+
(n) => n.name.toLowerCase().includes(o(s).searchKey.toLowerCase())
|
|
163
|
+
), (n) => (p(), w(A, {
|
|
164
|
+
key: n._id.toString(),
|
|
165
|
+
onClick: (k) => y(n),
|
|
166
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
167
|
+
}, {
|
|
168
|
+
default: h(() => [
|
|
169
|
+
a("div", ie, [
|
|
170
|
+
a("div", ce, [
|
|
171
|
+
(p(), w(H(o(L)(n)))),
|
|
172
|
+
a("div", le, u(n.currentReceive ?? 0) + " used ", 1)
|
|
173
|
+
]),
|
|
174
|
+
a("div", me, [
|
|
175
|
+
a("div", de, u(n.name), 1),
|
|
176
|
+
a("div", pe, u(o(V)(n)), 1)
|
|
177
|
+
]),
|
|
178
|
+
a("div", ue, u(o(r)("connect.program.experience.received", {
|
|
179
|
+
count: n.currentReceive ?? 0
|
|
180
|
+
})), 1)
|
|
181
|
+
]),
|
|
182
|
+
i(F, {
|
|
183
|
+
icon: "delete",
|
|
184
|
+
"icon-color": "neutral-gray-400",
|
|
185
|
+
variant: "tertiary",
|
|
186
|
+
onClick: (k) => (k.stopPropagation(), C(n))
|
|
187
|
+
}, null, 8, ["onClick"])
|
|
188
|
+
]),
|
|
189
|
+
_: 2
|
|
190
|
+
}, 1032, ["onClick"]))), 128))
|
|
191
|
+
]),
|
|
192
|
+
_: 1
|
|
193
|
+
})
|
|
194
|
+
], 64)) : (p(), w(D, {
|
|
195
|
+
key: 1,
|
|
196
|
+
variant: "outlined",
|
|
197
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
198
|
+
}, {
|
|
199
|
+
default: h(() => [
|
|
200
|
+
t[6] || (t[6] = a("img", {
|
|
201
|
+
src: z,
|
|
202
|
+
class: "aspect-square w-[150px]"
|
|
203
|
+
}, null, -1)),
|
|
204
|
+
a("div", fe, [
|
|
205
|
+
a("div", ye, u(o(r)("connect.program.experience.empty_state.title")), 1),
|
|
206
|
+
a("div", ge, u(o(r)("connect.program.experience.empty_state.description")), 1)
|
|
207
|
+
]),
|
|
208
|
+
i(F, {
|
|
209
|
+
variant: "primary",
|
|
210
|
+
label: "Create experience program",
|
|
211
|
+
icon: "add",
|
|
212
|
+
onClick: t[5] || (t[5] = (n) => y())
|
|
213
|
+
})
|
|
214
|
+
]),
|
|
215
|
+
_: 1
|
|
216
|
+
})),
|
|
217
|
+
i(oe, {
|
|
218
|
+
ref_key: "sheetRef",
|
|
219
|
+
ref: b,
|
|
220
|
+
"onSubmit:modelValue": N
|
|
221
|
+
}, null, 512)
|
|
222
|
+
])
|
|
223
|
+
], 64);
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
export {
|
|
228
|
+
Ie as default
|
|
229
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { defineComponent as j, ref as i, computed as g, onMounted as B, resolveComponent as r, openBlock as m, createBlock as c, unref as o, withCtx as p, createVNode as v, normalizeClass as f, createCommentVNode as k, createElementVNode as L, toDisplayString as F, isRef as M, createElementBlock as O, Fragment as A, renderList as N } from "vue";
|
|
2
|
+
const z = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, E = /* @__PURE__ */ j({
|
|
3
|
+
__name: "FilterChip",
|
|
4
|
+
props: {
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Array,
|
|
7
|
+
required: !1
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: !1,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
showItemLabel: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
placement: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: !1,
|
|
21
|
+
default: "bottom-end"
|
|
22
|
+
},
|
|
23
|
+
class: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: !1
|
|
26
|
+
},
|
|
27
|
+
disabled: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: !1
|
|
30
|
+
},
|
|
31
|
+
items: {
|
|
32
|
+
type: Array,
|
|
33
|
+
required: !0
|
|
34
|
+
},
|
|
35
|
+
icon: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: !1
|
|
38
|
+
},
|
|
39
|
+
searchable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
required: !1,
|
|
42
|
+
default: !0
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
emits: ["update:model-value"],
|
|
46
|
+
setup(u, { emit: C }) {
|
|
47
|
+
const t = u, b = C, d = i(!1), l = i({}), s = i(""), V = g(() => {
|
|
48
|
+
const e = Object.keys(l.value).length;
|
|
49
|
+
return !l.value || Object.keys(l.value).length == t.items.length || e === 0 ? "All" : `${e > 0 ? e : "None"} selected`;
|
|
50
|
+
});
|
|
51
|
+
function w(e) {
|
|
52
|
+
l.value[e] ? delete l.value[e] : l.value[e] = !0, b("update:model-value", Object.keys(l.value));
|
|
53
|
+
}
|
|
54
|
+
function _() {
|
|
55
|
+
Object.keys(l.value).length > 0 ? l.value = {} : l.value = t.items.reduce((e, n) => (e[n.value] = !0, e), {}), b("update:model-value", Object.keys(l.value));
|
|
56
|
+
}
|
|
57
|
+
const x = g(() => s.value && s.value.length > 0 ? t.items.filter(
|
|
58
|
+
(e) => e.label.toLowerCase().includes(s.value.trim().toLowerCase())
|
|
59
|
+
) : t.items);
|
|
60
|
+
return B(() => {
|
|
61
|
+
l.value = t.modelValue.reduce(
|
|
62
|
+
(e, n) => (e[n] = !0, e),
|
|
63
|
+
{}
|
|
64
|
+
), t.modelValue.length == 0;
|
|
65
|
+
}), (e, n) => {
|
|
66
|
+
const y = r("FmIcon"), q = r("FmChip"), I = r("FmTextField"), h = r("FmMenuItem"), S = r("FmMenu");
|
|
67
|
+
return m(), c(S, {
|
|
68
|
+
placement: u.placement || "bottom-end",
|
|
69
|
+
disabled: u.disabled == !0,
|
|
70
|
+
"model-value": o(d),
|
|
71
|
+
onMenuChanged: n[1] || (n[1] = (a) => d.value = a),
|
|
72
|
+
"close-on-click": !1
|
|
73
|
+
}, {
|
|
74
|
+
"menu-button": p(() => [
|
|
75
|
+
v(q, {
|
|
76
|
+
label: u.label,
|
|
77
|
+
class: f(t.class || "text-fm-color-neutral-gray-400 cursor-pointer")
|
|
78
|
+
}, {
|
|
79
|
+
default: p(() => [
|
|
80
|
+
t.icon ? (m(), c(y, {
|
|
81
|
+
key: 0,
|
|
82
|
+
name: t.icon,
|
|
83
|
+
class: f(t.class),
|
|
84
|
+
outline: "",
|
|
85
|
+
size: "sm"
|
|
86
|
+
}, null, 8, ["name", "class"])) : k("", !0),
|
|
87
|
+
L("div", z, F(t.label) + " " + F(u.showItemLabel ? o(V) : ""), 1),
|
|
88
|
+
v(y, {
|
|
89
|
+
name: o(d) ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
90
|
+
class: f(t.class),
|
|
91
|
+
outline: "",
|
|
92
|
+
size: "sm"
|
|
93
|
+
}, null, 8, ["name", "class"])
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 8, ["label", "class"])
|
|
97
|
+
]),
|
|
98
|
+
default: p(() => [
|
|
99
|
+
u.searchable ? (m(), c(I, {
|
|
100
|
+
key: 0,
|
|
101
|
+
modelValue: o(s),
|
|
102
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => M(s) ? s.value = a : null),
|
|
103
|
+
placeholder: "Search locations",
|
|
104
|
+
class: "my-8"
|
|
105
|
+
}, null, 8, ["modelValue"])) : k("", !0),
|
|
106
|
+
v(h, {
|
|
107
|
+
"model-value": Object.keys(o(l)).length === t.items.length,
|
|
108
|
+
label: "All",
|
|
109
|
+
"has-checkbox": !0,
|
|
110
|
+
indeterminate: !0,
|
|
111
|
+
onClick: _
|
|
112
|
+
}, null, 8, ["model-value"]),
|
|
113
|
+
(m(!0), O(A, null, N(o(x) ?? [], (a) => (m(), c(h, {
|
|
114
|
+
key: a.value,
|
|
115
|
+
value: a.value,
|
|
116
|
+
label: a.label,
|
|
117
|
+
"has-checkbox": !0,
|
|
118
|
+
"model-value": o(l)[a.value],
|
|
119
|
+
"onUpdate:modelValue": (T) => w(a.value)
|
|
120
|
+
}, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
}, 8, ["placement", "disabled", "model-value"]);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
export {
|
|
128
|
+
E as _
|
|
129
|
+
};
|