@feedmepos/mf-connect 0.1.98-beta.15 → 0.1.98-beta.16
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/App-DNXDhULP.js +4782 -0
- package/dist/AuditLogs-BNS27IJT.js +2013 -0
- package/dist/Bin-Dkjyrbz-.js +166 -0
- package/dist/Broadcast-B-fpjVzY.js +266 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-qBcG-vPM.js +120 -0
- package/dist/Card-BvVHO8kN.js +910 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-BLxPSOJl.js +540 -0
- package/dist/Credit-DU-stilH.js +260 -0
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -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-Bqnb00zk.js +3377 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CTSfEq5N.js +351 -0
- package/dist/Experience-C3tB8hTp.js +259 -0
- package/dist/FileSaver.min-EIworvUf.js +74 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
- package/dist/Game-Dq1ms2fA.js +330 -0
- package/dist/Grab-DnSO2oLx.js +300 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-n1r2bgOE.js +145 -0
- package/dist/Index-BFIHgW9W.js +259 -0
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-Do7CJZuh.js +48 -0
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-vpJmHgKM.js +18737 -0
- package/dist/LoyaltyDashboard-CcBogXzl.js +1082 -0
- package/dist/MainLayout-CPNiL_et.js +41 -0
- package/dist/Marketing-Bzb1VaVA.js +235 -0
- package/dist/MarketingMaterialEdit-8UQNx3mV.js +1035 -0
- package/dist/Member-Drb_NVrb.js +280 -0
- package/dist/MemberList-wa3JxCVr.js +1601 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/MemberTransactions-8qlm-T67.js +45 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BHicaUXs.js +60802 -0
- package/dist/Mission-DmWbQmOv.js +334 -0
- package/dist/Overview-COEFtf12.js +1079 -0
- package/dist/Overview-D7ki-aBA.js +969 -0
- package/dist/Point-B0W-BcPA.js +262 -0
- package/dist/Promotion-CY16SjmK.js +397 -0
- package/dist/Queue-hMur40Xc.js +260 -0
- package/dist/Record-Bj7GQP1r.js +342 -0
- package/dist/Review-Z1XD6bJK.js +45 -0
- package/dist/ReviewFacebookCallback-DirGtKLX.js +248 -0
- package/dist/ReviewGoogleCallback-CVC6741e.js +213 -0
- package/dist/Reward-DDB5Usau.js +442 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B-OnKAbx.js +149 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DDHM8NLi.js +1911 -0
- package/dist/Segment-Bl0k9fvJ.js +1014 -0
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C33DPiN6.js +181 -0
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-YMpQ-IiW.js +188 -0
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang--Rtf3gRa.js +226 -0
- package/dist/Setting-CpD98E2N.js +2047 -0
- package/dist/SettingAdvertisements-BZFQu_HI.js +264 -0
- package/dist/Settings-CRqlKNsc.js +228 -0
- package/dist/Store-CDG2_iqc.js +1996 -0
- package/dist/StoreRewards-DIU5hPXv.js +540 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B82RH_ZC.js +1133 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DKGCmk5y.js +7007 -0
- package/dist/Tier-BXgIdYDa.js +969 -0
- package/dist/Title-DgHxyV8p.js +566 -0
- package/dist/Transaction-iDacnm6Y.js +39 -0
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-RUbR6pdK.js +130 -0
- package/dist/Voucher-C-I8JK4F.js +421 -0
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BUpYZxij.js +421 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-LhG5jJq3.js +56 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-CyNzTZOx.js +59950 -0
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +7 -0
- package/dist/business-o_sAO_33.js +82 -0
- package/dist/campaign--IUcyI8h.js +219 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign-zLKyql03.js +277 -0
- package/dist/campaign.enum-CEbNgaGZ.js +26 -0
- package/dist/campaign.fn-BVT0m6Uy.js +776 -0
- package/dist/collectible.enum-2y8KIQLL.js +19 -0
- package/dist/duplicateCampaign-DIzdQf0e.js +51 -0
- package/dist/effect-B6gKaH4T.js +89 -0
- package/dist/email-addresses-CO9GNnUN.js +705 -0
- package/dist/export-DdDpRFVg.js +97 -0
- package/dist/feedme.ico +0 -0
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/helper-DqypCsTm.js +86 -0
- package/dist/index-BK0OmX3R.js +85 -0
- package/dist/index-Bc7JXl59.js +54 -0
- package/dist/index-BgiIGrLb.js +32 -0
- package/dist/index-C-TiT9bf.js +1157 -0
- package/dist/index-COXmoOd1.js +3678 -0
- package/dist/index-CT6uJJ9y.js +151 -0
- package/dist/index-Ci2gFCfD.js +61 -0
- package/dist/index-CtJ0MQQ1.js +3 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-D41Xq5qY.js +8910 -0
- package/dist/index-DBD_e_yR.js +31 -0
- package/dist/index-DDpz9LmI.js +67 -0
- package/dist/index-Dh2apeby.js +2819 -0
- package/dist/index-DiDmMG_M.js +28900 -0
- package/dist/index-pjXQwa0j.js +30289 -0
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index.esm2017-Cd4FhecE.js +3069 -0
- package/dist/loading-D-RglDMV.js +72 -0
- package/dist/lodash-cggYhL9V.js +3678 -0
- package/dist/membership-DTfMyKwP.js +255 -0
- package/dist/moment-D7p2TMB-.js +2583 -0
- package/dist/money-fGZfbdgV.js +15 -0
- package/dist/number-BOalh3ZH.js +12 -0
- package/dist/object-BYyQ0PZp.js +18 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/objectid-zPJFVngY.js +145 -0
- package/dist/plugins-CbpvMMOJ.js +1788 -0
- package/dist/reward-DkVAHEq2.js +36 -0
- package/dist/rule-EzWg2u8d.js +1969 -0
- package/dist/string-Gcy5IM_H.js +32 -0
- package/dist/style.css +4 -0
- package/dist/template-BfVFq4on.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/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-es-_uiSg.js +213 -0
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/type_drinks-D6jnpvwV.js +4 -0
- package/dist/useMarketingMaterialActions-CpiIKMmG.js +107 -0
- package/dist/usePagination-SYsXgU6x.js +220 -0
- package/dist/user-DUe40u3g.js +55 -0
- package/dist/vue-i18n-Dn9zxRuv.js +2365 -0
- package/dist/xlsx-DugGi7dB.js +15491 -0
- package/dist/zod-Dw8_B6RC.js +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { defineComponent as H, ref as L, computed as q, h as w, onMounted as O, resolveComponent as m, openBlock as d, createElementBlock as _, Fragment as v, createVNode as i, unref as o, createElementVNode as n, withCtx as b, renderList as z, createBlock as x, resolveDynamicComponent as G, toDisplayString as D, createCommentVNode as J } from "vue";
|
|
2
|
+
import { _ as Q } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as W, components as V } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as X } from "./plugins-CbpvMMOJ.js";
|
|
5
|
+
import { u as Y } from "./loading-D-RglDMV.js";
|
|
6
|
+
import { u as Z } from "./business-o_sAO_33.js";
|
|
7
|
+
import { u as ee, c as f } from "./campaign--IUcyI8h.js";
|
|
8
|
+
import { a as te, b as B, c as I } from "./campaign-zLKyql03.js";
|
|
9
|
+
import { c as oe, p as ae } from "./duplicateCampaign-DIzdQf0e.js";
|
|
10
|
+
import { u as ne } from "./vue-i18n-Dn9zxRuv.js";
|
|
11
|
+
import { _ as re } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
12
|
+
import { _ as se } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bqnb00zk.js";
|
|
13
|
+
import { u as ie } from "./template-BfVFq4on.js";
|
|
14
|
+
const ce = { class: "px-24 flex flex-col gap-y-16" }, le = { class: "flex items-center justify-between w-full" }, me = { class: "flex gap-8 overflow-x-auto" }, de = { class: "space-y-8" }, pe = { class: "flex w-full gap-4 items-center" }, ue = { class: "space-y-4" }, fe = { class: "fm-typo-en-body-lg-600" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex items-center gap-8" }, _e = { key: 0 }, Te = /* @__PURE__ */ H({
|
|
15
|
+
__name: "Credit",
|
|
16
|
+
setup(Ce) {
|
|
17
|
+
const { t: r } = ne(), T = {
|
|
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
|
+
}, E = ie("CREDIT", W()), R = Z(), p = ee(), { global: K, minor: k } = Y, c = L({
|
|
25
|
+
searchKey: "",
|
|
26
|
+
location: []
|
|
27
|
+
});
|
|
28
|
+
function P(e) {
|
|
29
|
+
const t = c.value.location;
|
|
30
|
+
return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
|
|
31
|
+
var s;
|
|
32
|
+
return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(l);
|
|
33
|
+
}) : e.targetLocation.includes(t);
|
|
34
|
+
}
|
|
35
|
+
const u = q(
|
|
36
|
+
() => p.campaigns.credit.filter((e) => P(e))
|
|
37
|
+
), $ = [
|
|
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) => te(e),
|
|
45
|
+
cell(e) {
|
|
46
|
+
return B(e.row.original);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: r("connect.program.common.table.summary"),
|
|
51
|
+
accessorFn: (e) => I(e)
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
header: r("connect.program.common.table.actions"),
|
|
55
|
+
cell(e) {
|
|
56
|
+
return w("div", { class: "flex items-center gap-8 justify-end" }, [
|
|
57
|
+
w(V.FmButton, {
|
|
58
|
+
variant: "tertiary",
|
|
59
|
+
icon: "content_copy",
|
|
60
|
+
iconColor: "neutral-gray-400",
|
|
61
|
+
onClick: async (t) => {
|
|
62
|
+
t.stopPropagation(), await S(e.row.original);
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
w(V.FmButton, {
|
|
66
|
+
variant: "tertiary",
|
|
67
|
+
icon: "delete",
|
|
68
|
+
iconColor: "neutral-gray-400",
|
|
69
|
+
onClick: (t) => {
|
|
70
|
+
t.stopPropagation(), F(e.row.original);
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
], C = L();
|
|
77
|
+
async function F(e) {
|
|
78
|
+
await X.remove(
|
|
79
|
+
r("connect.program.common.remove.confirm", { name: e.name })
|
|
80
|
+
) && await k(
|
|
81
|
+
async () => {
|
|
82
|
+
await f.delete(e._id), await p.read("CREDIT");
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
message: r("connect.program.common.remove.removing", { name: e.name }),
|
|
86
|
+
successMessage: r("connect.program.common.remove.removed", {
|
|
87
|
+
name: e.name
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
async function g(e) {
|
|
93
|
+
e ? await t() : E.open(async (l) => {
|
|
94
|
+
await t(l);
|
|
95
|
+
});
|
|
96
|
+
async function t(l) {
|
|
97
|
+
var s;
|
|
98
|
+
(s = C.value) == null || s.showSheet(
|
|
99
|
+
!0,
|
|
100
|
+
"CREDIT",
|
|
101
|
+
e ? await f.readById(e._id) : void 0,
|
|
102
|
+
l
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async function S(e) {
|
|
107
|
+
var s;
|
|
108
|
+
if (!await oe(e.name))
|
|
109
|
+
return;
|
|
110
|
+
const t = await f.readById(e._id), l = ae(t, {
|
|
111
|
+
keepCollectible: !0
|
|
112
|
+
});
|
|
113
|
+
(s = C.value) == null || s.showSheet(
|
|
114
|
+
!0,
|
|
115
|
+
"CREDIT",
|
|
116
|
+
l,
|
|
117
|
+
t.template
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
async function U(e) {
|
|
121
|
+
await k(
|
|
122
|
+
async () => {
|
|
123
|
+
e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("CREDIT");
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
|
|
127
|
+
successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return O(async () => {
|
|
132
|
+
await K(async () => {
|
|
133
|
+
await p.read("CREDIT");
|
|
134
|
+
});
|
|
135
|
+
}), (e, t) => {
|
|
136
|
+
const l = m("FmPageHead"), s = m("FmSearch"), j = m("FmTable"), h = m("FmButton"), A = m("FmListItem"), N = m("FmList"), M = m("FmCard");
|
|
137
|
+
return d(), _(v, null, [
|
|
138
|
+
i(l, {
|
|
139
|
+
title: o(r)("connect.program.credit.title"),
|
|
140
|
+
actions: o(u).length > 0 ? [T] : [],
|
|
141
|
+
"onClick:action": t[0] || (t[0] = () => g())
|
|
142
|
+
}, null, 8, ["title", "actions"]),
|
|
143
|
+
n("div", ce, [
|
|
144
|
+
i(s, {
|
|
145
|
+
modelValue: o(c).searchKey,
|
|
146
|
+
"onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
|
|
147
|
+
class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
148
|
+
placeholder: "search",
|
|
149
|
+
collapsible: ""
|
|
150
|
+
}, null, 8, ["modelValue"]),
|
|
151
|
+
o(p).campaigns.credit && o(p).campaigns.credit.length > 0 ? (d(), _(v, { key: 0 }, [
|
|
152
|
+
n("div", le, [
|
|
153
|
+
n("div", me, [
|
|
154
|
+
i(re, {
|
|
155
|
+
label: `${o(r)("connect.common.location")}: `,
|
|
156
|
+
"right-icon": "keyboard_arrow_down",
|
|
157
|
+
modelValue: o(c).location,
|
|
158
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
|
|
159
|
+
icon: "storefront",
|
|
160
|
+
"show-item-label": !0,
|
|
161
|
+
items: o(R).locationOptions
|
|
162
|
+
}, null, 8, ["label", "modelValue", "items"])
|
|
163
|
+
]),
|
|
164
|
+
i(s, {
|
|
165
|
+
modelValue: o(c).searchKey,
|
|
166
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
|
|
167
|
+
class: "xs:hidden sm:hidden",
|
|
168
|
+
placeholder: "search",
|
|
169
|
+
collapsible: ""
|
|
170
|
+
}, null, 8, ["modelValue"])
|
|
171
|
+
]),
|
|
172
|
+
i(j, {
|
|
173
|
+
class: "xs:hidden sm:hidden",
|
|
174
|
+
"row-data": o(u),
|
|
175
|
+
"column-defs": $,
|
|
176
|
+
"search-value": o(c).searchKey,
|
|
177
|
+
"column-filter": [],
|
|
178
|
+
onRowClick: t[4] || (t[4] = (a) => g(a.original)),
|
|
179
|
+
"hide-footer": o(u).length < 10
|
|
180
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
181
|
+
i(N, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
|
|
182
|
+
default: b(() => [
|
|
183
|
+
(d(!0), _(v, null, z(o(u).filter(
|
|
184
|
+
(a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
|
|
185
|
+
), (a) => (d(), x(A, {
|
|
186
|
+
key: a._id.toString(),
|
|
187
|
+
onClick: (y) => g(a),
|
|
188
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
189
|
+
}, {
|
|
190
|
+
default: b(() => [
|
|
191
|
+
n("div", de, [
|
|
192
|
+
n("div", pe, [
|
|
193
|
+
(d(), x(G(o(B)(a))))
|
|
194
|
+
]),
|
|
195
|
+
n("div", ue, [
|
|
196
|
+
n("div", fe, D(a.name), 1),
|
|
197
|
+
n("div", ge, D(o(I)(a)), 1)
|
|
198
|
+
])
|
|
199
|
+
]),
|
|
200
|
+
n("div", ye, [
|
|
201
|
+
i(h, {
|
|
202
|
+
icon: "content_copy",
|
|
203
|
+
"icon-color": "neutral-gray-400",
|
|
204
|
+
variant: "tertiary",
|
|
205
|
+
onClick: async (y) => {
|
|
206
|
+
y.stopPropagation(), await S(a);
|
|
207
|
+
}
|
|
208
|
+
}, null, 8, ["onClick"]),
|
|
209
|
+
i(h, {
|
|
210
|
+
icon: "delete",
|
|
211
|
+
"icon-color": "neutral-gray-400",
|
|
212
|
+
variant: "tertiary",
|
|
213
|
+
onClick: (y) => (y.stopPropagation(), F(a))
|
|
214
|
+
}, null, 8, ["onClick"])
|
|
215
|
+
])
|
|
216
|
+
]),
|
|
217
|
+
_: 2
|
|
218
|
+
}, 1032, ["onClick"]))), 128))
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
}),
|
|
222
|
+
o(u).length == 0 ? (d(), _("div", _e, [...t[6] || (t[6] = [
|
|
223
|
+
n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
|
|
224
|
+
])])) : J("", !0)
|
|
225
|
+
], 64)) : (d(), x(M, {
|
|
226
|
+
key: 1,
|
|
227
|
+
variant: "outlined",
|
|
228
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
229
|
+
}, {
|
|
230
|
+
default: b(() => [
|
|
231
|
+
t[7] || (t[7] = n("img", {
|
|
232
|
+
src: Q,
|
|
233
|
+
class: "aspect-square w-[150px]"
|
|
234
|
+
}, null, -1)),
|
|
235
|
+
t[8] || (t[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
236
|
+
n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
|
|
237
|
+
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. ")
|
|
238
|
+
], -1)),
|
|
239
|
+
i(h, {
|
|
240
|
+
variant: "primary",
|
|
241
|
+
label: "Create credit program",
|
|
242
|
+
icon: "add",
|
|
243
|
+
onClick: t[5] || (t[5] = (a) => g())
|
|
244
|
+
})
|
|
245
|
+
]),
|
|
246
|
+
_: 1
|
|
247
|
+
})),
|
|
248
|
+
i(se, {
|
|
249
|
+
ref_key: "sheetRef",
|
|
250
|
+
ref: C,
|
|
251
|
+
"onSubmit:modelValue": U
|
|
252
|
+
}, null, 512)
|
|
253
|
+
])
|
|
254
|
+
], 64);
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
export {
|
|
259
|
+
Te as default
|
|
260
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent as f, mergeModels as l, useModel as g, computed as u, onMounted as _, watch as R, resolveComponent as m, openBlock as h, createBlock as V, withCtx as b, createVNode as k, unref as y } from "vue";
|
|
2
|
+
import { h as t } from "./moment-D7p2TMB-.js";
|
|
3
|
+
const a = "YYYY-MM-DD", F = /* @__PURE__ */ f({
|
|
4
|
+
__name: "DateRangeChip",
|
|
5
|
+
props: /* @__PURE__ */ l({
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: !0
|
|
9
|
+
}
|
|
10
|
+
}, {
|
|
11
|
+
dateRange: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: () => ({
|
|
14
|
+
startDate: t().subtract(7, "day").format(a),
|
|
15
|
+
endDate: t().endOf("day").format(a)
|
|
16
|
+
})
|
|
17
|
+
},
|
|
18
|
+
dateRangeModifiers: {}
|
|
19
|
+
}),
|
|
20
|
+
emits: /* @__PURE__ */ l(["update:model-value"], ["update:dateRange"]),
|
|
21
|
+
setup(r, { emit: s }) {
|
|
22
|
+
const o = r, c = s, e = g(r, "dateRange"), i = u(() => e.value ? `${n.value.startDate ?? "Start"} - ${n.value.endDate ?? "End"}` : "No dates selected."), n = u(() => ({
|
|
23
|
+
startDate: e.value.startDate ? t(e.value.startDate).format(a) : void 0,
|
|
24
|
+
endDate: e.value.endDate ? t(e.value.endDate).format(a) : void 0
|
|
25
|
+
}));
|
|
26
|
+
return _(() => {
|
|
27
|
+
e.value = {
|
|
28
|
+
startDate: o.modelValue.startDate ? t(o.modelValue.startDate).format(a) : void 0,
|
|
29
|
+
endDate: o.modelValue.endDate ? t(o.modelValue.endDate).format(a) : void 0
|
|
30
|
+
};
|
|
31
|
+
}), R(
|
|
32
|
+
() => e.value,
|
|
33
|
+
() => {
|
|
34
|
+
c("update:model-value", n.value);
|
|
35
|
+
}
|
|
36
|
+
), (C, d) => {
|
|
37
|
+
const p = m("FmChip"), D = m("FmDateRangePicker");
|
|
38
|
+
return h(), V(D, {
|
|
39
|
+
modelValue: e.value,
|
|
40
|
+
"onUpdate:modelValue": d[0] || (d[0] = (v) => e.value = v),
|
|
41
|
+
"show-predefined-range": ""
|
|
42
|
+
}, {
|
|
43
|
+
"trigger-button": b(() => [
|
|
44
|
+
k(p, {
|
|
45
|
+
label: y(i),
|
|
46
|
+
icon: "calendar_month",
|
|
47
|
+
"right-icon": "keyboard_arrow_down",
|
|
48
|
+
class: "text-fm-color-neutral-gray-400 cursor-pointer"
|
|
49
|
+
}, null, 8, ["label"])
|
|
50
|
+
]),
|
|
51
|
+
_: 1
|
|
52
|
+
}, 8, ["modelValue"]);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
F as _
|
|
58
|
+
};
|