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

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/package.json +1 -1
  2. package/dist/App-DwjQisFZ.js +0 -4785
  3. package/dist/AuditLogs-DMGqmriL.js +0 -2014
  4. package/dist/Bin-4wvIqogM.js +0 -166
  5. package/dist/Broadcast-DPpuSZ8_.js +0 -269
  6. package/dist/CampaignAnalytic-CXFDo2X_.js +0 -1826
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-SLoy1-Kd.js +0 -122
  8. package/dist/Card-C8SA6un0.js +0 -911
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-BCpSiM_4.js +0 -541
  11. package/dist/Credit-C8RTBpP7.js +0 -286
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-0OI5QzpR.js +0 -3382
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CJTduNh3.js +0 -351
  16. package/dist/Experience-Bg3kFQQE.js +0 -285
  17. package/dist/FileSaver.min-DMUuMi9w.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  20. package/dist/Game-D3DbkRUj.js +0 -356
  21. package/dist/GiftCardSetup-CxlMM4up.js +0 -542
  22. package/dist/Grab-DvEK8ixP.js +0 -301
  23. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBK-UrEe.js +0 -145
  24. package/dist/Index-Do_9DXuY.js +0 -259
  25. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  26. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-BKPGBYiU.js +0 -48
  27. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-D6wJN9Gj.js +0 -18737
  28. package/dist/LoyaltyDashboard-B4WqycGN.js +0 -1345
  29. package/dist/MainLayout-DdxLaufS.js +0 -143
  30. package/dist/Marketing-CcFEMwKB.js +0 -236
  31. package/dist/MarketingMaterialEdit-DoYFaMf7.js +0 -1036
  32. package/dist/Member-BussgBln.js +0 -281
  33. package/dist/MemberList-BXJxSsjo.js +0 -1603
  34. package/dist/MemberOverview-wL_ailso.js +0 -58
  35. package/dist/MemberTransactions-O-XY5nz3.js +0 -45
  36. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DsxrIO0r.js +0 -60957
  37. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +0 -38
  38. package/dist/Mission-CPkM-8Ns.js +0 -360
  39. package/dist/Overview-BJjpYUJN.js +0 -1080
  40. package/dist/Overview-C5KF_Jxj.js +0 -1316
  41. package/dist/Point-FDFwR3Hk.js +0 -288
  42. package/dist/Promotion-qtucKxn0.js +0 -423
  43. package/dist/Queue-d91tocPX.js +0 -261
  44. package/dist/Record-CvkK2iLq.js +0 -342
  45. package/dist/Review-C_zLGtzU.js +0 -45
  46. package/dist/ReviewFacebookCallback-Bidg3P76.js +0 -238
  47. package/dist/ReviewGoogleCallback-DL0lxMBL.js +0 -213
  48. package/dist/Reward-BTsQaI-J.js +0 -442
  49. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BjxA4eMX.js +0 -150
  50. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D4NIDc-C.js +0 -1913
  51. package/dist/Segment-BgFyB3BK.js +0 -1017
  52. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CkhjFNvZ.js +0 -181
  53. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-HYbRyACe.js +0 -189
  54. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-7dv3cAW3.js +0 -226
  55. package/dist/Setting-BxHoCSxw.js +0 -2047
  56. package/dist/SettingAdvertisements-WfvuE4fA.js +0 -264
  57. package/dist/Settings-B42SAvEx.js +0 -179
  58. package/dist/Store-BnvWfCy-.js +0 -2413
  59. package/dist/StoreRewards-BRzAMqR-.js +0 -540
  60. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C3FJr1L5.js +0 -1075
  61. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-UZYzUcif.js +0 -7007
  62. package/dist/Tier-BrzLNat2.js +0 -972
  63. package/dist/Title-EnlaNXld.js +0 -569
  64. package/dist/Transaction-BiXNxUGX.js +0 -39
  65. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Db5_DKQ0.js +0 -130
  66. package/dist/Voucher-C2dyk-jj.js +0 -444
  67. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DPE24a-J.js +0 -421
  68. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CI1HM9HA.js +0 -56
  69. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  70. package/dist/app-Bt8HrAEr.js +0 -60740
  71. package/dist/app-wDQR6dpb.js +0 -39
  72. package/dist/app.js +0 -7
  73. package/dist/business-BwtQpfUr.js +0 -82
  74. package/dist/campaign-B6U9lwKi.js +0 -255
  75. package/dist/campaign-C6Cb9s3C.js +0 -100
  76. package/dist/campaign-CpzFl8Vr.js +0 -4
  77. package/dist/campaign.enum-Dx-Zo68Q.js +0 -26
  78. package/dist/campaign.fn-B0x2EGhw.js +0 -776
  79. package/dist/collectible.enum-Liy2wH3s.js +0 -19
  80. package/dist/collection.fn-DfoA9sJV.js +0 -26
  81. package/dist/duplicateCampaign-Cnq5N-V8.js +0 -51
  82. package/dist/effect-B2REbrv8.js +0 -89
  83. package/dist/email-addresses-BzmOsxLn.js +0 -705
  84. package/dist/export-jHpRhPQu.js +0 -97
  85. package/dist/feedme.ico +0 -0
  86. package/dist/google-C3S8u0mT.js +0 -4
  87. package/dist/helper-DQAHX1kX.js +0 -86
  88. package/dist/index-4GG-yjdN.js +0 -2963
  89. package/dist/index-BWgMbKOB.js +0 -85
  90. package/dist/index-BccUpf0U.js +0 -3
  91. package/dist/index-BkgkJkVs.js +0 -8919
  92. package/dist/index-C0PKVTf9.js +0 -32
  93. package/dist/index-C8cXXcLk.js +0 -45
  94. package/dist/index-CTTGf4TM.js +0 -151
  95. package/dist/index-C_H8jFYf.js +0 -2743
  96. package/dist/index-CuvNtC_M.js +0 -61
  97. package/dist/index-DJN4auwx.js +0 -146
  98. package/dist/index-DMr9ohGV.js +0 -1139
  99. package/dist/index-DQTo_ytu.js +0 -31
  100. package/dist/index-DW7-0rf_.js +0 -53
  101. package/dist/index-Da7J83jM.js +0 -2706
  102. package/dist/index-Di1Z4vLS.js +0 -27550
  103. package/dist/index-FoKZGh7Z.js +0 -67
  104. package/dist/index-N25Px7RQ.js +0 -72
  105. package/dist/index-PgblELTo.js +0 -897
  106. package/dist/index-STBMTK1u.js +0 -28900
  107. package/dist/index-hP3Mgc0u.js +0 -55
  108. package/dist/index-vh86FiIQ.js +0 -10
  109. package/dist/index.esm2017-DV56jzfJ.js +0 -3069
  110. package/dist/loading-D__sDcq1.js +0 -72
  111. package/dist/lodash-DgkDIHoV.js +0 -3678
  112. package/dist/membership-CBjt1MGx.js +0 -255
  113. package/dist/moment-D7p2TMB-.js +0 -2583
  114. package/dist/money-BFUbPKDM.js +0 -15
  115. package/dist/number-CJb8OUa3.js +0 -12
  116. package/dist/object-BYyQ0PZp.js +0 -18
  117. package/dist/objectId-dwaoBfJX.js +0 -7
  118. package/dist/objectid-BMUFNR9T.js +0 -145
  119. package/dist/plugins-D95ZeD-9.js +0 -1788
  120. package/dist/remy-Qz_pNsUS.js +0 -13
  121. package/dist/reward-CSfV_XFK.js +0 -36
  122. package/dist/rule-DIzVHy2z.js +0 -1969
  123. package/dist/rule-builder-DF7fCvec.js +0 -126
  124. package/dist/string-Gcy5IM_H.js +0 -32
  125. package/dist/style.css +0 -4
  126. package/dist/template-r3lAQP1B.js +0 -188
  127. package/dist/tier-BJDhpH6X.js +0 -4
  128. package/dist/tiers/tier=1.png +0 -0
  129. package/dist/tiers/tier=2.png +0 -0
  130. package/dist/tiers/tier=3.png +0 -0
  131. package/dist/tiers/tier=4.png +0 -0
  132. package/dist/timezone-D40qRUoz.js +0 -20
  133. package/dist/titles/type=diamond.png +0 -0
  134. package/dist/titles/type=drinks.png +0 -0
  135. package/dist/titles/type=food.png +0 -0
  136. package/dist/titles/type=heart.png +0 -0
  137. package/dist/titles/type=medal.png +0 -0
  138. package/dist/titles/type=spend.png +0 -0
  139. package/dist/titles/type=thank-you.png +0 -0
  140. package/dist/titles/type=thumbs-up.png +0 -0
  141. package/dist/titles/type=years.png +0 -0
  142. package/dist/transaction.fn-DV-cpfOj.js +0 -64
  143. package/dist/trigger-BEJaSv5R.js +0 -213
  144. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  145. package/dist/type_drinks-D6jnpvwV.js +0 -4
  146. package/dist/useMarketingMaterialActions-Bd5BDfE1.js +0 -96
  147. package/dist/usePagination-DLIo76-X.js +0 -220
  148. package/dist/user-DtEjuhyM.js +0 -55
  149. package/dist/vue-i18n-dQ1XCaUv.js +0 -2365
  150. package/dist/xlsx-BUMZsTov.js +0 -15491
  151. package/dist/zod-B_pVZhsV.js +0 -91
@@ -1,286 +0,0 @@
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-D95ZeD-9.js";
5
- import { u as ee } from "./loading-D__sDcq1.js";
6
- import { u as te } from "./business-BwtQpfUr.js";
7
- import { u as oe } from "./campaign-C6Cb9s3C.js";
8
- import { a as ae, b as V, c as B } from "./campaign-B6U9lwKi.js";
9
- import { c as ne, p as re } from "./duplicateCampaign-Cnq5N-V8.js";
10
- import { u as ie } from "./vue-i18n-dQ1XCaUv.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-0OI5QzpR.js";
13
- import { u as le } from "./template-r3lAQP1B.js";
14
- import "./index-BccUpf0U.js";
15
- import { useRouter as me } from "vue-router";
16
- import { c as f } from "./index-DJN4auwx.js";
17
- import { R as de } from "./app-Bt8HrAEr.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
- };
@@ -1,128 +0,0 @@
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
- };
@@ -1,58 +0,0 @@
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
- };