@feedmepos/mf-connect 0.1.38-beta.26 → 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.
Files changed (97) hide show
  1. package/dist/{Analytic-GI7aYtUb.js → Analytic-Dgpp4zkU.js} +13 -13
  2. package/dist/{App-BoklLgkw.js → App-DNRzPvQb.js} +7 -7
  3. package/dist/{AuditLogs-DGAmSC_0.js → AuditLogs-BhG5wShL.js} +10 -10
  4. package/dist/{Bin-BiF3wXhU.js → Bin-BSmAVdOX.js} +8 -8
  5. package/dist/Broadcast-DZ-qedno.js +233 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BIGwoDq9.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BS5HDnfb.js} +6 -6
  7. package/dist/{Card-Bzm_iM7j.js → Card-CLTczC6l.js} +16 -16
  8. package/dist/{Collections-CZEDKF0v.js → Collections-CZIk5DSy.js} +6 -6
  9. package/dist/Credit-DGGU3d68.js +228 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cz4ydsOk.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-FxEXBhTK.js} +32 -32
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-d67tWKfX.js → EffectSheet.vue_vue_type_style_index_0_lang-Bx_7FAYn.js} +6 -6
  12. package/dist/Experience-Dd0Xkp_z.js +229 -0
  13. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  14. package/dist/{Game-ooDjLDzG.js → Game-N6iQZPqM.js} +103 -97
  15. package/dist/{Grab-CHmDWK3s.js → Grab-Dn8pP3Vy.js} +10 -10
  16. package/dist/{Index-C9yMbuO8.js → Index-Do0nSsYj.js} +10 -10
  17. package/dist/{Marketing-BvgC-F4p.js → Marketing-BG8L2AVq.js} +6 -6
  18. package/dist/{Member-DP0Cm8yE.js → Member-HQWOfz1g.js} +10 -10
  19. package/dist/{MemberList-BYZ2NfAg.js → MemberList-jfgCK6k3.js} +25 -25
  20. package/dist/{MemberTransactions-DvG4SU0m.js → MemberTransactions-DYOBM90W.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C3-IpjMr.js → MessageInput.vue_vue_type_script_setup_true_lang-DdaqUEEb.js} +7 -7
  22. package/dist/{Mission-CBOIiAhx.js → Mission-CkXM1dNO.js} +112 -106
  23. package/dist/{Overview-BqKRh6LC.js → Overview-BJWncUrN.js} +18 -18
  24. package/dist/Point-CfuVogKH.js +232 -0
  25. package/dist/{Promotion-D4HBy-As.js → Promotion-TtgchqMU.js} +11 -11
  26. package/dist/{Queue-BqzI56Vp.js → Queue-xaCqQVUP.js} +11 -11
  27. package/dist/{Record-WtLmMgjU.js → Record-D6z_Pywk.js} +8 -8
  28. package/dist/{Reward-yfsdyC-T.js → Reward-DBzn5tRP.js} +15 -15
  29. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DaB5piDf.js → RewardGroup.vue_vue_type_script_setup_true_lang-CRv8xHpU.js} +11 -11
  30. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DCKbSowE.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bd8pXLRT.js} +13 -13
  31. package/dist/{Segment-hOxwXwqZ.js → Segment-gxBRnKo7.js} +22 -22
  32. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-IfFZG5uK.js → SelectItems.vue_vue_type_script_setup_true_lang-DbC6xTWH.js} +2 -2
  33. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C9FaS4EF.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BAraQhKS.js} +11 -11
  34. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CNd_-RAr.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CFnFyNya.js} +3 -3
  35. package/dist/{Setting-B7XBouh4.js → Setting-DX7hLnTQ.js} +11 -11
  36. package/dist/{Store-Dbg7gN9h.js → Store-C3GZXKuC.js} +19 -19
  37. package/dist/{StoreRewards-DoBjQyns.js → StoreRewards-CCWDGKLp.js} +13 -13
  38. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C3_usDfP.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNgDoMR9.js} +21 -21
  39. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C5BP2K1C.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DQmZE9_V.js} +1 -1
  40. package/dist/{Tier-Q9hjmprx.js → Tier-DbWQM6De.js} +20 -20
  41. package/dist/{Title-9h42ZNEa.js → Title-a2bTIZi0.js} +19 -19
  42. package/dist/{Transaction-B_NIJcmb.js → Transaction-f8XwfBob.js} +2 -2
  43. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-EZ42L0jN.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DUQ0fU5s.js} +6 -6
  44. package/dist/{Voucher-OjdoUYOe.js → Voucher-C7Dfsqk6.js} +14 -14
  45. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CgUFty-i.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C5fm0K4i.js} +10 -10
  46. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D9V2WsTX.js → ZodTextField.vue_vue_type_script_setup_true_lang-A-h4HUTJ.js} +1 -1
  47. package/dist/{app-A-A8AXY4.js → app-BOG1dC8a.js} +32 -32
  48. package/dist/{app-psmMhnbB.js → app-jGPh064M.js} +1 -1
  49. package/dist/app.js +1 -1
  50. package/dist/{business-BkIoeq-Q.js → business--P6e14wH.js} +11 -8
  51. package/dist/{campaign-C0gfY75c.js → campaign-CR_hUukZ.js} +9 -9
  52. package/dist/{campaign-CERB2jjK.js → campaign-C_gQlNNb.js} +2 -2
  53. package/dist/{campaign.enum-jpIcwh1C.js → campaign.enum-Dj5o3Gnx.js} +1 -1
  54. package/dist/{campaign.fn-C3JAU897.js → campaign.fn-DQZ0W-EB.js} +3 -3
  55. package/dist/{collectible.enum-PLiXkPXk.js → collectible.enum-DQgguzyG.js} +1 -1
  56. package/dist/{collection.fn-BEgw5oag.js → collection.fn-1jzRWzrr.js} +2 -2
  57. package/dist/{dto-CzjctCKL.js → dto-C3jWvc1e.js} +4 -4
  58. package/dist/{effect-BzkBC2cZ.js → effect-dA2mpaCE.js} +1 -1
  59. package/dist/{email-addresses-BWQOZIxj.js → email-addresses-37_SE2AF.js} +1 -1
  60. package/dist/{export-Bqt9zope.js → export-Cn7Elq59.js} +3 -3
  61. package/dist/{helper-CnEOKaJw.js → helper-1FmJd7OP.js} +1 -1
  62. package/dist/{index-BMLcVoj2.js → index-B4j34swO.js} +1 -1
  63. package/dist/{index-DBN0XD-h.js → index-B9iL1w4-.js} +3 -3
  64. package/dist/{index-DFqn9RQx.js → index-BRALrcjU.js} +3 -3
  65. package/dist/{index-66ugkTKw.js → index-BcEhSpSd.js} +1 -1
  66. package/dist/{index-BD7Rc0qN.js → index-Bv04ElXo.js} +6 -6
  67. package/dist/{index-Cs3ZFd92.js → index-BwBDTG0U.js} +4 -4
  68. package/dist/{index-DnJuxEaY.js → index-C0TBodx0.js} +1 -1
  69. package/dist/{index-DfOMpXlE.js → index-C0uZD6Fb.js} +1 -1
  70. package/dist/{index-DEezTfBN.js → index-CCzzmRaK.js} +3 -3
  71. package/dist/{index-CeDl4txs.js → index-Cq9x3KEB.js} +1 -1
  72. package/dist/{index-DZLqscW5.js → index-DIup5B2H.js} +1 -1
  73. package/dist/{index-yOIVmjex.js → index-Da1osm0C.js} +1 -1
  74. package/dist/{index-D5aQKEmO.js → index-Oly5lYMA.js} +1 -1
  75. package/dist/{index-DIN-0kYC.js → index-YhB238q9.js} +2 -2
  76. package/dist/{index.esm2017-7gQUvseu.js → index.esm2017-pcImat1a.js} +1 -1
  77. package/dist/{loading-CJIHUxKM.js → loading-BIAeRmZo.js} +1 -1
  78. package/dist/{membership-DRnWUdOc.js → membership-D74wSltj.js} +3 -3
  79. package/dist/{money-I2p-gwmi.js → money-DQuZChef.js} +1 -1
  80. package/dist/{number-DldVO4aW.js → number-DORW-adL.js} +1 -1
  81. package/dist/{objectid-B_MkqbEB.js → objectid-CPqo6DS_.js} +5 -5
  82. package/dist/{plugins-D17305Np.js → plugins-BVLU2dc_.js} +2 -2
  83. package/dist/{reward-3PHDIRXM.js → reward-CsZQy2b1.js} +1 -1
  84. package/dist/{rule-BgMw4FoF.js → rule-CtYg9lgQ.js} +3 -3
  85. package/dist/{rule-builder-CmqmCe3P.js → rule-builder-TwHL3OPZ.js} +1 -1
  86. package/dist/{template-BR9R6E1B.js → template-DlLEQKFu.js} +4 -4
  87. package/dist/{timezone-CWS-nhUv.js → timezone-DGJqaz8e.js} +1 -1
  88. package/dist/{trigger-DsYBkR3I.js → trigger-B4JMJKDj.js} +4 -4
  89. package/dist/{user-B3SLxQOc.js → user-ZU2f1nbT.js} +1 -1
  90. package/dist/{vue-i18n-CttzNDMl.js → vue-i18n-BtpjMXUM.js} +2 -2
  91. package/dist/{xlsx-cNTfolRW.js → xlsx-BiJUMUcX.js} +1 -1
  92. package/package.json +1 -1
  93. package/dist/Broadcast-D5ypkyn0.js +0 -227
  94. package/dist/Credit-nieDAS9M.js +0 -222
  95. package/dist/Experience-CKeWLWIk.js +0 -223
  96. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  97. package/dist/Point-14thvTNE.js +0 -226
@@ -1,222 +0,0 @@
1
- import { defineComponent as N, ref as S, computed as j, h as M, onMounted as A, resolveComponent as l, openBlock as c, createElementBlock as y, Fragment as C, createVNode as i, unref as a, createElementVNode as n, withCtx as h, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as g, createCommentVNode as z } from "vue";
2
- import { _ as G } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as J, components as O } from "@feedmepos/ui-library";
4
- import { p as Q } from "./plugins-D17305Np.js";
5
- import { u as W } from "./loading-CJIHUxKM.js";
6
- import { u as X } from "./business-BkIoeq-Q.js";
7
- import { u as Y } from "./campaign-CERB2jjK.js";
8
- import { g as Z, a as V, b as L } from "./campaign-C0gfY75c.js";
9
- import { u as ee } from "./vue-i18n-CttzNDMl.js";
10
- import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cz4ydsOk.js";
12
- import { u as ae } from "./template-BR9R6E1B.js";
13
- import { c as _ } from "./index-DfOMpXlE.js";
14
- const ne = { 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" }, le = { class: "flex w-full gap-4 items-center" }, ce = { 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 = { key: 0 }, Ie = /* @__PURE__ */ N({
15
- __name: "Credit",
16
- setup(ye) {
17
- const { t: r } = ee(), I = {
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
- }, R = ae("CREDIT", J()), B = X(), m = Y(), { global: D, minor: w } = W, s = S({
25
- searchKey: "",
26
- location: null
27
- }), d = j(
28
- () => m.campaigns.credit.filter(
29
- (e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
30
- )
31
- ), T = [
32
- {
33
- header: r("connect.program.common.table.title"),
34
- accessorFn: (e) => e.name
35
- },
36
- {
37
- header: r("connect.program.common.table.status"),
38
- accessorFn: (e) => Z(e),
39
- cell(e) {
40
- return V(e.row.original);
41
- }
42
- },
43
- {
44
- header: r("connect.program.common.table.summary"),
45
- accessorFn: (e) => L(e)
46
- },
47
- {
48
- header: r("connect.program.common.table.actions"),
49
- cell(e) {
50
- return M(O.FmButton, {
51
- variant: "tertiary",
52
- icon: "delete",
53
- iconColor: "neutral-gray-400",
54
- onClick: (o) => {
55
- o.stopPropagation(), x(e.row.original);
56
- }
57
- });
58
- }
59
- }
60
- ], b = S();
61
- async function x(e) {
62
- await Q.remove(
63
- r("connect.program.common.remove.confirm", { name: e.name })
64
- ) && await w(
65
- async () => {
66
- await _.delete(e._id), await m.read("CREDIT");
67
- },
68
- {
69
- message: r("connect.program.common.remove.removing", { name: e.name }),
70
- successMessage: r("connect.program.common.remove.removed", {
71
- name: e.name
72
- })
73
- }
74
- );
75
- }
76
- async function f(e) {
77
- e ? await o() : R.open(async (p) => {
78
- await o(p);
79
- });
80
- async function o(p) {
81
- var u;
82
- (u = b.value) == null || u.showSheet(
83
- !0,
84
- "CREDIT",
85
- e ? await _.readById(e._id) : void 0,
86
- p
87
- );
88
- }
89
- }
90
- async function E(e) {
91
- await w(
92
- async () => {
93
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("CREDIT");
94
- },
95
- {
96
- message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
97
- successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
98
- }
99
- );
100
- }
101
- return A(async () => {
102
- await D(async () => {
103
- await m.read("CREDIT");
104
- });
105
- }), (e, o) => {
106
- const p = l("FmPageHead"), u = l("FmSearch"), K = l("FmTable"), F = l("FmButton"), $ = l("FmListItem"), P = l("FmList"), U = l("FmCard");
107
- return c(), y(C, null, [
108
- i(p, {
109
- title: a(r)("connect.program.credit.title"),
110
- actions: a(d).length > 0 ? [I] : [],
111
- "onClick:action": o[0] || (o[0] = () => f())
112
- }, null, 8, ["title", "actions"]),
113
- n("div", ne, [
114
- i(u, {
115
- modelValue: a(s).searchKey,
116
- "onUpdate:modelValue": o[1] || (o[1] = (t) => a(s).searchKey = t),
117
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
118
- placeholder: "search",
119
- collapsible: ""
120
- }, null, 8, ["modelValue"]),
121
- a(m).campaigns.credit && a(m).campaigns.credit.length > 0 ? (c(), y(C, { key: 0 }, [
122
- n("div", re, [
123
- n("div", se, [
124
- i(oe, {
125
- modelValue: a(s).location,
126
- "onUpdate:modelValue": o[2] || (o[2] = (t) => a(s).location = t),
127
- label: "Location: ",
128
- "show-item-label": !0,
129
- icon: "storefront",
130
- placement: "bottom-start",
131
- items: a(B).locationItems
132
- }, null, 8, ["modelValue", "items"])
133
- ]),
134
- i(u, {
135
- modelValue: a(s).searchKey,
136
- "onUpdate:modelValue": o[3] || (o[3] = (t) => a(s).searchKey = t),
137
- class: "xs:hidden",
138
- placeholder: "search",
139
- collapsible: ""
140
- }, null, 8, ["modelValue"])
141
- ]),
142
- i(K, {
143
- class: "xs:hidden",
144
- "row-data": a(d),
145
- "column-defs": T,
146
- "search-value": a(s).searchKey,
147
- "column-filter": [],
148
- onRowClick: o[4] || (o[4] = (t) => f(t.original)),
149
- "hide-footer": a(d).length < 10
150
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
151
- i(P, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
152
- default: h(() => [
153
- (c(!0), y(C, null, H(a(d).filter(
154
- (t) => t.name.toLowerCase().includes(a(s).searchKey.toLowerCase())
155
- ), (t) => (c(), v($, {
156
- key: t._id.toString(),
157
- onClick: (k) => f(t),
158
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
159
- }, {
160
- default: h(() => [
161
- n("div", ie, [
162
- n("div", le, [
163
- (c(), v(q(a(V)(t)))),
164
- n("div", ce, g(t.currentReceive ?? 0) + " used ", 1)
165
- ]),
166
- n("div", me, [
167
- n("div", de, g(t.name), 1),
168
- n("div", pe, g(a(L)(t)), 1)
169
- ]),
170
- n("div", ue, " Credit received: " + g(t.currentReceive ?? 0), 1)
171
- ]),
172
- i(F, {
173
- icon: "delete",
174
- "icon-color": "neutral-gray-400",
175
- variant: "tertiary",
176
- onClick: (k) => (k.stopPropagation(), x(t))
177
- }, null, 8, ["onClick"])
178
- ]),
179
- _: 2
180
- }, 1032, ["onClick"]))), 128))
181
- ]),
182
- _: 1
183
- }),
184
- a(d).length == 0 ? (c(), y("div", fe, [...o[6] || (o[6] = [
185
- n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
186
- ])])) : z("", !0)
187
- ], 64)) : (c(), v(U, {
188
- key: 1,
189
- variant: "outlined",
190
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
191
- }, {
192
- default: h(() => [
193
- o[7] || (o[7] = n("img", {
194
- src: G,
195
- class: "aspect-square w-[150px]"
196
- }, null, -1)),
197
- o[8] || (o[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
198
- n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
199
- 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. ")
200
- ], -1)),
201
- i(F, {
202
- variant: "primary",
203
- label: "Create credit program",
204
- icon: "add",
205
- onClick: o[5] || (o[5] = (t) => f())
206
- })
207
- ]),
208
- _: 1
209
- })),
210
- i(te, {
211
- ref_key: "sheetRef",
212
- ref: b,
213
- "onSubmit:modelValue": E
214
- }, null, 512)
215
- ])
216
- ], 64);
217
- };
218
- }
219
- });
220
- export {
221
- Ie as default
222
- };
@@ -1,223 +0,0 @@
1
- import { defineComponent as D, ref as S, computed as E, onMounted as U, resolveComponent as i, openBlock as m, createElementBlock as _, Fragment as x, createVNode as c, unref as t, createElementVNode as n, withCtx as h, renderList as j, createBlock as w, resolveDynamicComponent as M, toDisplayString as p, h as H } from "vue";
2
- import { _ as q } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as z, components as G } from "@feedmepos/ui-library";
4
- import { p as J } from "./plugins-D17305Np.js";
5
- import { u as Q } from "./loading-CJIHUxKM.js";
6
- import { u as W } from "./business-BkIoeq-Q.js";
7
- import { u as X } from "./campaign-CERB2jjK.js";
8
- import { a as L, b as V, g as Y } from "./campaign-C0gfY75c.js";
9
- import { u as Z } from "./vue-i18n-CttzNDMl.js";
10
- import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cz4ydsOk.js";
12
- import { u as oe } from "./template-BR9R6E1B.js";
13
- import { c as g } from "./index-DfOMpXlE.js";
14
- const ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, re = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, ie = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, le = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "flex flex-col gap-16 text-center" }, fe = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ D({
15
- __name: "Experience",
16
- setup(ge) {
17
- const { t: s } = Z(), I = {
18
- label: s("connect.program.common.actions.create", {
19
- type: s("connect.program.experience.title").toLowerCase()
20
- }),
21
- value: "create",
22
- isPrimary: !0,
23
- prependIcon: "add"
24
- }, P = oe("POINT", z()), B = W(), l = X(), { global: T, minor: v } = Q, r = S({
25
- searchKey: "",
26
- location: null
27
- }), f = E(
28
- () => l.campaigns.experience.filter(
29
- (e) => !r.value.location || !e.targetLocation || e.targetLocation.includes(r.value.location)
30
- )
31
- ), K = [
32
- {
33
- header: "Program title",
34
- accessorFn: (e) => e.name
35
- },
36
- {
37
- header: "Status",
38
- accessorFn: (e) => Y(e),
39
- cell(e) {
40
- return L(e.row.original);
41
- }
42
- },
43
- {
44
- header: "Summary",
45
- accessorFn: (e) => V(e)
46
- //v.effect,
47
- },
48
- {
49
- header: "Actions",
50
- cell(e) {
51
- return H(G.FmButton, {
52
- variant: "tertiary",
53
- icon: "delete",
54
- iconColor: "neutral-gray-400",
55
- onClick: (o) => {
56
- o.stopPropagation(), C(e.row.original);
57
- }
58
- });
59
- }
60
- }
61
- ], b = S();
62
- async function C(e) {
63
- await J.remove(`Are you sure you want to remove ${e.name}?`) && await v(
64
- async () => {
65
- await g.delete(e._id), await l.read("POINT");
66
- },
67
- {
68
- message: `Removing ${e.name}`,
69
- successMessage: `Removed ${e.name} successfully`
70
- }
71
- );
72
- }
73
- async function y(e) {
74
- e ? await o() : P.open(async (d) => {
75
- await o(d);
76
- });
77
- async function o(d) {
78
- var u;
79
- (u = b.value) == null || u.showSheet(
80
- !0,
81
- "POINT",
82
- e ? await g.readById(e._id) : void 0,
83
- d
84
- );
85
- }
86
- }
87
- async function N(e) {
88
- await v(
89
- async () => {
90
- e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await l.read("POINT");
91
- },
92
- {
93
- message: s("connect.program.common.update.updating", {
94
- type: s("connect.program.experience.title")
95
- }),
96
- successMessage: s("connect.program.common.update.success", {
97
- type: s("connect.program.experience.title"),
98
- action: e.campaign._id ? "updated" : "created"
99
- })
100
- }
101
- );
102
- }
103
- return U(async () => {
104
- await T(async () => {
105
- await l.read("POINT");
106
- });
107
- }), (e, o) => {
108
- const d = i("FmPageHead"), u = i("FmSearch"), R = i("FmTable"), F = i("FmButton"), $ = i("FmListItem"), O = i("FmList"), A = i("FmCard");
109
- return m(), _(x, null, [
110
- c(d, {
111
- title: t(s)("connect.program.experience.title"),
112
- actions: t(f).length > 0 ? [I] : [],
113
- "onClick:action": o[0] || (o[0] = () => y())
114
- }, null, 8, ["title", "actions"]),
115
- n("div", ae, [
116
- c(u, {
117
- modelValue: t(r).searchKey,
118
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(r).searchKey = a),
119
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
120
- placeholder: t(s)("connect.program.common.search"),
121
- collapsible: ""
122
- }, null, 8, ["modelValue", "placeholder"]),
123
- t(l).campaigns.experience && t(l).campaigns.experience.length > 0 ? (m(), _(x, { key: 0 }, [
124
- n("div", ne, [
125
- n("div", se, [
126
- c(ee, {
127
- modelValue: t(r).location,
128
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(r).location = a),
129
- label: "Location: ",
130
- "show-item-label": !0,
131
- icon: "storefront",
132
- placement: "bottom-start",
133
- items: t(B).locationItems
134
- }, null, 8, ["modelValue", "items"])
135
- ]),
136
- c(u, {
137
- modelValue: t(r).searchKey,
138
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(r).searchKey = a),
139
- class: "xs:hidden",
140
- placeholder: "search",
141
- collapsible: ""
142
- }, null, 8, ["modelValue"])
143
- ]),
144
- c(R, {
145
- class: "xs:hidden",
146
- "row-data": t(f),
147
- "column-defs": K,
148
- "search-value": t(r).searchKey,
149
- "column-filter": [],
150
- onRowClick: o[4] || (o[4] = (a) => y(a.original)),
151
- "hide-footer": t(f).length < 10
152
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
153
- c(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
154
- default: h(() => [
155
- (m(!0), _(x, null, j(t(f).filter(
156
- (a) => a.name.toLowerCase().includes(t(r).searchKey.toLowerCase())
157
- ), (a) => (m(), w($, {
158
- key: a._id.toString(),
159
- onClick: (k) => y(a),
160
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
161
- }, {
162
- default: h(() => [
163
- n("div", re, [
164
- n("div", ce, [
165
- (m(), w(M(t(L)(a)))),
166
- n("div", ie, p(a.currentReceive ?? 0) + " used ", 1)
167
- ]),
168
- n("div", le, [
169
- n("div", me, p(a.name), 1),
170
- n("div", pe, p(t(V)(a)), 1)
171
- ]),
172
- n("div", de, p(t(s)("connect.program.experience.received", {
173
- count: a.currentReceive ?? 0
174
- })), 1)
175
- ]),
176
- c(F, {
177
- icon: "delete",
178
- "icon-color": "neutral-gray-400",
179
- variant: "tertiary",
180
- onClick: (k) => (k.stopPropagation(), C(a))
181
- }, null, 8, ["onClick"])
182
- ]),
183
- _: 2
184
- }, 1032, ["onClick"]))), 128))
185
- ]),
186
- _: 1
187
- })
188
- ], 64)) : (m(), w(A, {
189
- key: 1,
190
- variant: "outlined",
191
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
192
- }, {
193
- default: h(() => [
194
- o[6] || (o[6] = n("img", {
195
- src: q,
196
- class: "aspect-square w-[150px]"
197
- }, null, -1)),
198
- n("div", ue, [
199
- n("div", fe, p(t(s)("connect.program.experience.empty_state.title")), 1),
200
- n("div", ye, p(t(s)("connect.program.experience.empty_state.description")), 1)
201
- ]),
202
- c(F, {
203
- variant: "primary",
204
- label: "Create experience program",
205
- icon: "add",
206
- onClick: o[5] || (o[5] = (a) => y())
207
- })
208
- ]),
209
- _: 1
210
- })),
211
- c(te, {
212
- ref_key: "sheetRef",
213
- ref: b,
214
- "onSubmit:modelValue": N
215
- }, null, 512)
216
- ])
217
- ], 64);
218
- };
219
- }
220
- });
221
- export {
222
- Pe as default
223
- };
@@ -1,114 +0,0 @@
1
- import { defineComponent as V, ref as y, computed as q, onMounted as x, resolveComponent as s, openBlock as r, createBlock as m, unref as u, withCtx as d, createVNode as i, normalizeClass as p, createCommentVNode as j, createElementVNode as I, toDisplayString as h, createElementBlock as M, Fragment as O, renderList as S } from "vue";
2
- const A = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, N = /* @__PURE__ */ V({
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
- },
40
- emits: ["update:model-value"],
41
- setup(o, { emit: g }) {
42
- const t = o, v = g, c = y(!1), e = y({}), k = q(() => {
43
- const l = Object.keys(e.value).length;
44
- return !e.value || Object.keys(e.value).length == t.items.length || l === 0 ? "All" : `${l > 0 ? l : "None"} selected`;
45
- });
46
- function _(l) {
47
- e.value[l] ? delete e.value[l] : e.value[l] = !0, v("update:model-value", Object.keys(e.value));
48
- }
49
- function C() {
50
- Object.keys(e.value).length > 0 ? e.value = {} : e.value = t.items.reduce((l, n) => (l[n.value] = !0, l), {}), v("update:model-value", Object.keys(e.value));
51
- }
52
- return x(() => {
53
- e.value = t.modelValue.reduce(
54
- (l, n) => (l[n] = !0, l),
55
- {}
56
- ), t.modelValue.length == 0;
57
- }), (l, n) => {
58
- const b = s("FmIcon"), F = s("FmChip"), f = s("FmMenuItem"), w = s("FmMenu");
59
- return r(), m(w, {
60
- placement: o.placement || "bottom-end",
61
- disabled: o.disabled == !0,
62
- "model-value": u(c),
63
- onMenuChanged: n[0] || (n[0] = (a) => c.value = a),
64
- "close-on-click": !1
65
- }, {
66
- "menu-button": d(() => [
67
- i(F, {
68
- label: o.label,
69
- class: p(t.class || "text-fm-color-neutral-gray-400 cursor-pointer")
70
- }, {
71
- default: d(() => [
72
- t.icon ? (r(), m(b, {
73
- key: 0,
74
- name: t.icon,
75
- class: p(t.class),
76
- outline: "",
77
- size: "sm"
78
- }, null, 8, ["name", "class"])) : j("", !0),
79
- I("div", A, h(t.label) + " " + h(o.showItemLabel ? u(k) : ""), 1),
80
- i(b, {
81
- name: u(c) ? "keyboard_arrow_up" : "keyboard_arrow_down",
82
- class: p(t.class),
83
- outline: "",
84
- size: "sm"
85
- }, null, 8, ["name", "class"])
86
- ]),
87
- _: 1
88
- }, 8, ["label", "class"])
89
- ]),
90
- default: d(() => [
91
- i(f, {
92
- "model-value": Object.keys(u(e)).length === t.items.length,
93
- label: "All",
94
- "has-checkbox": !0,
95
- indeterminate: !0,
96
- onClick: C
97
- }, null, 8, ["model-value"]),
98
- (r(!0), M(O, null, S(t.items ?? [], (a) => (r(), m(f, {
99
- key: a.value,
100
- value: a.value,
101
- label: a.label,
102
- "has-checkbox": !0,
103
- "model-value": u(e)[a.value],
104
- "onUpdate:modelValue": (B) => _(a.value)
105
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
106
- ]),
107
- _: 1
108
- }, 8, ["placement", "disabled", "model-value"]);
109
- };
110
- }
111
- });
112
- export {
113
- N as _
114
- };