@feedmepos/mf-connect 0.1.98-beta.40 → 0.1.98-beta.41

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.
Files changed (151) hide show
  1. package/dist/App-C6JJ9uQ8.js +4785 -0
  2. package/dist/AuditLogs-CAlgtDgx.js +2014 -0
  3. package/dist/Bin-D8jwhwER.js +166 -0
  4. package/dist/Broadcast-CP8DRfkT.js +269 -0
  5. package/dist/CampaignAnalytic-MVjYBFvu.js +1826 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DeLURz87.js +122 -0
  7. package/dist/Card-QribXJwZ.js +911 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-X9xbt43V.js +541 -0
  10. package/dist/Credit-QmbsW1eb.js +286 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js +3382 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CrGHTNhg.js +351 -0
  15. package/dist/Experience-CPGMg847.js +285 -0
  16. package/dist/FileSaver.min-CK67LsPG.js +74 -0
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-BrkiEFCS.js +356 -0
  20. package/dist/GiftCardSetup-DXNBHF1A.js +542 -0
  21. package/dist/Grab-BgtDzK1B.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js +145 -0
  23. package/dist/Index-KJgzalOd.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Dj74lJ7b.js +18737 -0
  27. package/dist/LoyaltyDashboard-B2JpbC01.js +1345 -0
  28. package/dist/MainLayout-DlfTKHQ-.js +143 -0
  29. package/dist/Marketing-Crx_JQpi.js +236 -0
  30. package/dist/MarketingMaterialEdit-BfsdcMXJ.js +1036 -0
  31. package/dist/Member-C50Nrsko.js +281 -0
  32. package/dist/MemberList-C9uUKw1o.js +1603 -0
  33. package/dist/MemberOverview-wL_ailso.js +58 -0
  34. package/dist/MemberTransactions-DZ7zPOHX.js +45 -0
  35. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Du_ZGsbX.js +60957 -0
  36. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  37. package/dist/Mission-D_km8zi6.js +360 -0
  38. package/dist/Overview-BBieK6qQ.js +1080 -0
  39. package/dist/Overview-B_kmLOcc.js +1316 -0
  40. package/dist/Point-D0q9N7f9.js +288 -0
  41. package/dist/Promotion-DoFTy-NK.js +423 -0
  42. package/dist/Queue-Dh5sDRHW.js +261 -0
  43. package/dist/Record-0owEBKqN.js +342 -0
  44. package/dist/Review-DV2fnpOH.js +45 -0
  45. package/dist/ReviewFacebookCallback-D8mnAPzR.js +238 -0
  46. package/dist/ReviewGoogleCallback-CLzt_ox2.js +213 -0
  47. package/dist/Reward-Co20Xrss.js +442 -0
  48. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-0qU49c47.js +150 -0
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js +1913 -0
  50. package/dist/Segment-7dQKeHWK.js +1017 -0
  51. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BUVrUifO.js +181 -0
  52. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDsV9TD9.js +189 -0
  53. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js +226 -0
  54. package/dist/Setting-Bvahxs-y.js +2047 -0
  55. package/dist/SettingAdvertisements-fbXLRwfb.js +264 -0
  56. package/dist/Settings-C_HWDFN8.js +179 -0
  57. package/dist/Store-8yBKDR1b.js +2413 -0
  58. package/dist/StoreRewards-DKaJvoJs.js +540 -0
  59. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js +1075 -0
  60. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js +7007 -0
  61. package/dist/Tier-CD-CjXC3.js +972 -0
  62. package/dist/Title-C_lcgye8.js +569 -0
  63. package/dist/Transaction-BvUYm-rT.js +39 -0
  64. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-C3Yacz7K.js +130 -0
  65. package/dist/Voucher-CYaG0GLU.js +444 -0
  66. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DF2JqzRe.js +421 -0
  67. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B4UPqSNc.js +56 -0
  68. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  69. package/dist/app-CE5hQ4Uq.js +60740 -0
  70. package/dist/app-wDQR6dpb.js +39 -0
  71. package/dist/app.js +7 -0
  72. package/dist/business-CE_4siXc.js +82 -0
  73. package/dist/campaign-BP6rvSpg.js +255 -0
  74. package/dist/campaign-CXQtKpeb.js +100 -0
  75. package/dist/campaign-CpzFl8Vr.js +4 -0
  76. package/dist/campaign.enum-Dx-Zo68Q.js +26 -0
  77. package/dist/campaign.fn-DKnBpE1N.js +776 -0
  78. package/dist/collectible.enum-Liy2wH3s.js +19 -0
  79. package/dist/collection.fn-Cg16QZSp.js +26 -0
  80. package/dist/duplicateCampaign-DbtVAGsT.js +51 -0
  81. package/dist/effect-CLI8NI4O.js +89 -0
  82. package/dist/email-addresses-DlLiZ1io.js +705 -0
  83. package/dist/export-6Hr34dBU.js +97 -0
  84. package/dist/feedme.ico +0 -0
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/helper-vkjFqj70.js +86 -0
  87. package/dist/index-BIyKgw4m.js +72 -0
  88. package/dist/index-BLQJ-rv3.js +31 -0
  89. package/dist/index-BbTIqReL.js +67 -0
  90. package/dist/index-BuMfQxMf.js +897 -0
  91. package/dist/index-C8cXXcLk.js +45 -0
  92. package/dist/index-CSVhIZSY.js +8919 -0
  93. package/dist/index-CVHacTbc.js +151 -0
  94. package/dist/index-C_H8jFYf.js +2743 -0
  95. package/dist/index-CmNsGhDf.js +2706 -0
  96. package/dist/index-CnTeeRyJ.js +53 -0
  97. package/dist/index-CuvNtC_M.js +61 -0
  98. package/dist/index-CzbNobLv.js +1139 -0
  99. package/dist/index-D06n1h1b.js +146 -0
  100. package/dist/index-D4SDAfbP.js +27550 -0
  101. package/dist/index-DVnYQ3Hs.js +85 -0
  102. package/dist/index-DcjnS5Sv.js +28900 -0
  103. package/dist/index-Dx9h0FNH.js +3 -0
  104. package/dist/index-YgP4ihQL.js +32 -0
  105. package/dist/index-kedErkLZ.js +2963 -0
  106. package/dist/index-lnQT4P3d.js +55 -0
  107. package/dist/index-vh86FiIQ.js +10 -0
  108. package/dist/index.esm2017-Jhv2lkrq.js +3069 -0
  109. package/dist/loading-NY-FPxVY.js +72 -0
  110. package/dist/lodash-BC_P6kLg.js +3678 -0
  111. package/dist/membership-BWaK-9FY.js +255 -0
  112. package/dist/moment-D7p2TMB-.js +2583 -0
  113. package/dist/money-COoh4GXK.js +15 -0
  114. package/dist/number-BX5OEXgq.js +12 -0
  115. package/dist/object-BYyQ0PZp.js +18 -0
  116. package/dist/objectId-dwaoBfJX.js +7 -0
  117. package/dist/objectid-1SUSRtmY.js +145 -0
  118. package/dist/plugins-ur-FAoye.js +1788 -0
  119. package/dist/remy-Qz_pNsUS.js +13 -0
  120. package/dist/reward-DSsylZ22.js +36 -0
  121. package/dist/rule-BM9GUd1C.js +1969 -0
  122. package/dist/rule-builder-gC9LH2AC.js +126 -0
  123. package/dist/string-Gcy5IM_H.js +32 -0
  124. package/dist/style.css +4 -0
  125. package/dist/template-CUV3AMFI.js +188 -0
  126. package/dist/tier-BJDhpH6X.js +4 -0
  127. package/dist/tiers/tier=1.png +0 -0
  128. package/dist/tiers/tier=2.png +0 -0
  129. package/dist/tiers/tier=3.png +0 -0
  130. package/dist/tiers/tier=4.png +0 -0
  131. package/dist/timezone-BFZhekOU.js +20 -0
  132. package/dist/titles/type=diamond.png +0 -0
  133. package/dist/titles/type=drinks.png +0 -0
  134. package/dist/titles/type=food.png +0 -0
  135. package/dist/titles/type=heart.png +0 -0
  136. package/dist/titles/type=medal.png +0 -0
  137. package/dist/titles/type=spend.png +0 -0
  138. package/dist/titles/type=thank-you.png +0 -0
  139. package/dist/titles/type=thumbs-up.png +0 -0
  140. package/dist/titles/type=years.png +0 -0
  141. package/dist/transaction.fn-C5MlkEIC.js +64 -0
  142. package/dist/trigger-CbjiuoSo.js +213 -0
  143. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  144. package/dist/type_drinks-D6jnpvwV.js +4 -0
  145. package/dist/useMarketingMaterialActions-BLisTieA.js +96 -0
  146. package/dist/usePagination-Caah4sJr.js +220 -0
  147. package/dist/user-BZC4P_jL.js +55 -0
  148. package/dist/vue-i18n-BYz7XAr_.js +2365 -0
  149. package/dist/xlsx-Bn7BqUFA.js +15491 -0
  150. package/dist/zod-DHH42rXG.js +91 -0
  151. package/package.json +1 -1
@@ -0,0 +1,286 @@
1
+ import { defineComponent as q, ref as I, computed as G, h as C, onMounted as Y, resolveComponent as m, openBlock as d, createElementBlock as h, Fragment as b, createVNode as s, unref as o, createElementVNode as n, withCtx as x, renderList as z, createBlock as k, resolveDynamicComponent as J, toDisplayString as w, createCommentVNode as Q } from "vue";
2
+ import { _ as W } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as X, components as F } from "@feedmepos/ui-library";
4
+ import { p as Z } from "./plugins-ur-FAoye.js";
5
+ import { u as ee } from "./loading-NY-FPxVY.js";
6
+ import { u as te } from "./business-CE_4siXc.js";
7
+ import { u as oe } from "./campaign-CXQtKpeb.js";
8
+ import { a as ae, b as V, c as B } from "./campaign-BP6rvSpg.js";
9
+ import { c as ne, p as re } from "./duplicateCampaign-DbtVAGsT.js";
10
+ import { u as ie } from "./vue-i18n-BYz7XAr_.js";
11
+ import { _ as se } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
12
+ import { _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js";
13
+ import { u as le } from "./template-CUV3AMFI.js";
14
+ import "./index-Dx9h0FNH.js";
15
+ import { useRouter as me } from "vue-router";
16
+ import { c as f } from "./index-D06n1h1b.js";
17
+ import { R as de } from "./app-CE5hQ4Uq.js";
18
+ const pe = { class: "px-24 flex flex-col gap-y-16" }, ue = { class: "flex items-center justify-between w-full" }, ge = { class: "flex gap-8 overflow-x-auto" }, fe = { class: "space-y-8" }, ye = { class: "flex w-full gap-4 items-center" }, _e = { class: "space-y-4" }, Ce = { class: "fm-typo-en-body-lg-600" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, we = { class: "flex items-center gap-8" }, ve = { key: 0 }, be = { class: "flex flex-col gap-16 text-center" }, xe = { class: "fm-typo-en-title-sm-800" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oe = /* @__PURE__ */ q({
19
+ __name: "Credit",
20
+ setup(Fe) {
21
+ const { t: r } = ie(), T = me(), E = {
22
+ label: r("connect.program.common.actions.create", {
23
+ type: r("connect.program.credit.title").toLowerCase()
24
+ }),
25
+ value: "create",
26
+ isPrimary: !0,
27
+ prependIcon: "add"
28
+ }, P = le("CREDIT", X()), A = te(), p = oe(), { global: $, minor: L } = ee, c = I({
29
+ searchKey: "",
30
+ location: []
31
+ });
32
+ function K(e) {
33
+ const t = c.value.location;
34
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
35
+ var i;
36
+ return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(l);
37
+ }) : e.targetLocation.includes(t);
38
+ }
39
+ const g = G(
40
+ () => p.campaigns.credit.filter((e) => K(e))
41
+ ), N = [
42
+ {
43
+ header: r("connect.program.common.table.title"),
44
+ accessorFn: (e) => e.name
45
+ },
46
+ {
47
+ header: r("connect.program.common.table.status"),
48
+ accessorFn: (e) => ae(e),
49
+ cell(e) {
50
+ return V(e.row.original);
51
+ }
52
+ },
53
+ {
54
+ header: r("connect.program.common.table.summary"),
55
+ accessorFn: (e) => B(e)
56
+ },
57
+ {
58
+ header: r("connect.program.common.table.actions"),
59
+ cell(e) {
60
+ return C("div", { class: "flex items-center gap-8 justify-end" }, [
61
+ C(F.FmButton, {
62
+ variant: "tertiary",
63
+ icon: "insights",
64
+ iconColor: "neutral-gray-400",
65
+ onClick: async (t) => {
66
+ t.stopPropagation(), await S(e.row.original);
67
+ }
68
+ }),
69
+ C(F.FmButton, {
70
+ variant: "tertiary",
71
+ icon: "content_copy",
72
+ iconColor: "neutral-gray-400",
73
+ onClick: async (t) => {
74
+ t.stopPropagation(), await D(e.row.original);
75
+ }
76
+ }),
77
+ C(F.FmButton, {
78
+ variant: "tertiary",
79
+ icon: "delete",
80
+ iconColor: "neutral-gray-400",
81
+ onClick: (t) => {
82
+ t.stopPropagation(), R(e.row.original);
83
+ }
84
+ })
85
+ ]);
86
+ }
87
+ }
88
+ ], v = I();
89
+ async function R(e) {
90
+ await Z.remove(
91
+ r("connect.program.common.remove.confirm", { name: e.name })
92
+ ) && await L(
93
+ async () => {
94
+ await f.delete(e._id), await p.read("CREDIT");
95
+ },
96
+ {
97
+ message: r("connect.program.common.remove.removing", { name: e.name }),
98
+ successMessage: r("connect.program.common.remove.removed", {
99
+ name: e.name
100
+ })
101
+ }
102
+ );
103
+ }
104
+ async function y(e) {
105
+ e ? await t() : P.open(async (l) => {
106
+ await t(l);
107
+ });
108
+ async function t(l) {
109
+ var i;
110
+ (i = v.value) == null || i.showSheet(
111
+ !0,
112
+ "CREDIT",
113
+ e ? await f.readById(e._id) : void 0,
114
+ l
115
+ );
116
+ }
117
+ }
118
+ async function S(e) {
119
+ await T.push({
120
+ name: de["$connect-PROGRAM_CREDIT_ANALYTIC"],
121
+ params: { id: e._id }
122
+ });
123
+ }
124
+ async function D(e) {
125
+ var i;
126
+ if (!await ne(e.name))
127
+ return;
128
+ const t = await f.readById(e._id), l = re(t, {
129
+ keepCollectible: !0
130
+ });
131
+ (i = v.value) == null || i.showSheet(
132
+ !0,
133
+ "CREDIT",
134
+ l,
135
+ t.template
136
+ );
137
+ }
138
+ async function U(e) {
139
+ await L(
140
+ async () => {
141
+ e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("CREDIT");
142
+ },
143
+ {
144
+ message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
145
+ successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
146
+ }
147
+ );
148
+ }
149
+ return Y(async () => {
150
+ await $(async () => {
151
+ await p.read("CREDIT");
152
+ });
153
+ }), (e, t) => {
154
+ const l = m("FmPageHead"), i = m("FmSearch"), M = m("FmTable"), _ = m("FmButton"), j = m("FmListItem"), O = m("FmList"), H = m("FmCard");
155
+ return d(), h(b, null, [
156
+ s(l, {
157
+ title: o(r)("connect.program.credit.title"),
158
+ actions: o(g).length > 0 ? [E] : [],
159
+ "onClick:action": t[0] || (t[0] = () => y())
160
+ }, null, 8, ["title", "actions"]),
161
+ n("div", pe, [
162
+ s(i, {
163
+ modelValue: o(c).searchKey,
164
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
165
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
166
+ placeholder: "search",
167
+ collapsible: ""
168
+ }, null, 8, ["modelValue"]),
169
+ o(p).campaigns.credit && o(p).campaigns.credit.length > 0 ? (d(), h(b, { key: 0 }, [
170
+ n("div", ue, [
171
+ n("div", ge, [
172
+ s(se, {
173
+ label: `${o(r)("connect.common.location")}: `,
174
+ "right-icon": "keyboard_arrow_down",
175
+ modelValue: o(c).location,
176
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
177
+ icon: "storefront",
178
+ "show-item-label": !0,
179
+ items: o(A).locationOptions
180
+ }, null, 8, ["label", "modelValue", "items"])
181
+ ]),
182
+ s(i, {
183
+ modelValue: o(c).searchKey,
184
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
185
+ class: "xs:hidden sm:hidden",
186
+ placeholder: "search",
187
+ collapsible: ""
188
+ }, null, 8, ["modelValue"])
189
+ ]),
190
+ s(M, {
191
+ class: "xs:hidden sm:hidden",
192
+ "row-data": o(g),
193
+ "column-defs": N,
194
+ "search-value": o(c).searchKey,
195
+ "column-filter": [],
196
+ onRowClick: t[4] || (t[4] = (a) => y(a.original)),
197
+ "hide-footer": o(g).length < 10
198
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
199
+ s(O, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
200
+ default: x(() => [
201
+ (d(!0), h(b, null, z(o(g).filter(
202
+ (a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
203
+ ), (a) => (d(), k(j, {
204
+ key: a._id.toString(),
205
+ onClick: (u) => y(a),
206
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
207
+ }, {
208
+ default: x(() => [
209
+ n("div", fe, [
210
+ n("div", ye, [
211
+ (d(), k(J(o(V)(a))))
212
+ ]),
213
+ n("div", _e, [
214
+ n("div", Ce, w(a.name), 1),
215
+ n("div", he, w(o(B)(a)), 1)
216
+ ])
217
+ ]),
218
+ n("div", we, [
219
+ s(_, {
220
+ icon: "insights",
221
+ "icon-color": "neutral-gray-400",
222
+ variant: "tertiary",
223
+ onClick: async (u) => {
224
+ u.stopPropagation(), await S(a);
225
+ }
226
+ }, null, 8, ["onClick"]),
227
+ s(_, {
228
+ icon: "content_copy",
229
+ "icon-color": "neutral-gray-400",
230
+ variant: "tertiary",
231
+ onClick: async (u) => {
232
+ u.stopPropagation(), await D(a);
233
+ }
234
+ }, null, 8, ["onClick"]),
235
+ s(_, {
236
+ icon: "delete",
237
+ "icon-color": "neutral-gray-400",
238
+ variant: "tertiary",
239
+ onClick: (u) => (u.stopPropagation(), R(a))
240
+ }, null, 8, ["onClick"])
241
+ ])
242
+ ]),
243
+ _: 2
244
+ }, 1032, ["onClick"]))), 128))
245
+ ]),
246
+ _: 1
247
+ }),
248
+ o(g).length == 0 ? (d(), h("div", ve, [...t[6] || (t[6] = [
249
+ n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
250
+ ])])) : Q("", !0)
251
+ ], 64)) : (d(), k(H, {
252
+ key: 1,
253
+ variant: "outlined",
254
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
255
+ }, {
256
+ default: x(() => [
257
+ t[7] || (t[7] = n("img", {
258
+ src: W,
259
+ class: "aspect-square w-[150px]"
260
+ }, null, -1)),
261
+ n("div", be, [
262
+ n("div", xe, w(o(r)("connect.program.credit.empty_state.title")), 1),
263
+ n("div", ke, w(o(r)("connect.program.credit.empty_state.description")), 1)
264
+ ]),
265
+ s(_, {
266
+ variant: "primary",
267
+ label: "Create credit program",
268
+ icon: "add",
269
+ onClick: t[5] || (t[5] = (a) => y())
270
+ })
271
+ ]),
272
+ _: 1
273
+ })),
274
+ s(ce, {
275
+ ref_key: "sheetRef",
276
+ ref: v,
277
+ "onSubmit:modelValue": U
278
+ }, null, 512)
279
+ ])
280
+ ], 64);
281
+ };
282
+ }
283
+ });
284
+ export {
285
+ Oe as default
286
+ };
@@ -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
+ };