@feedmepos/mf-connect 0.1.0-beta.4 → 0.1.0-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 (106) hide show
  1. package/dist/Analytic-C7iDpCvx.js +426 -0
  2. package/dist/{App-BnQwjxIr.js → App-rOEspgIk.js} +397 -384
  3. package/dist/{Broadcast-y1kP18mo.js → Broadcast-CI61-FqI.js} +32 -32
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dj0JUMOk.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BL_KxlIX.js} +6 -8
  5. package/dist/Card-CUzEZnUC.js +894 -0
  6. package/dist/{Collections-DPfbZMg1.js → Collections-zYhQfAph.js} +28 -34
  7. package/dist/{Credit-QleM_b6q.js → Credit-D6G2xUEu.js} +14 -14
  8. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CxxmBzPu.js +2209 -0
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-2hRTF1EJ.js → EffectSheet.vue_vue_type_style_index_0_lang-Drd0ZjdQ.js} +8 -8
  11. package/dist/{Experience-DGKj8ChY.js → Experience-Cqn6cpA4.js} +8 -8
  12. package/dist/{Game-BxRdzSma.js → Game-CGrL5xmK.js} +15 -15
  13. package/dist/Index-CCcuCcmL.js +255 -0
  14. package/dist/Marketing-DhZHedDV.js +20070 -0
  15. package/dist/{Member-CteeBDi2.js → Member-CB8o8wLL.js} +4 -4
  16. package/dist/MemberList-D6zRpcwU.js +1554 -0
  17. package/dist/MemberTransactions-HCaDl8dN.js +45 -0
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CZ2M8huU.js → MessageInput.vue_vue_type_script_setup_true_lang-CqlGFgwF.js} +2 -2
  19. package/dist/{Mission-CZgXBa09.js → Mission-CexuwCSV.js} +98 -86
  20. package/dist/Overview-CZk3IHyA.js +1063 -0
  21. package/dist/{Point-C2vzEfRP.js → Point-DJ_sLiid.js} +23 -23
  22. package/dist/{Promotion-337OT0sP.js → Promotion-CWBpjPXQ.js} +53 -47
  23. package/dist/Record-CwT9Pmjn.js +337 -0
  24. package/dist/Reward-DhOIXKAB.js +432 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-UP4KtCK2.js +149 -0
  26. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BNw-CED0.js +1637 -0
  27. package/dist/Segment-BE7Bt2tH.js +566 -0
  28. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CDyT_cSb.js +181 -0
  29. package/dist/{Setting-DVK2594u.js → Setting-D1k2xVYx.js} +609 -586
  30. package/dist/Store-BzoJ_ZBZ.js +1743 -0
  31. package/dist/{StoreRewards-BpEmNueE.js → StoreRewards-OAPmCssF.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BIr5Zzij.js +1099 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DT48bSiH.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C2fU1byp.js} +1 -1
  34. package/dist/{Tier-BwvOhyXR.js → Tier-IHJ7dlTI.js} +325 -317
  35. package/dist/{Title-DRPdKYRO.js → Title-C4KcQWk_.js} +197 -183
  36. package/dist/{Transaction-BnLvacwW.js → Transaction-B7SWRleT.js} +2 -2
  37. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DOXLpM1y.js +130 -0
  38. package/dist/{Voucher-BQL8J_EA.js → Voucher-Dzh-oh1p.js} +40 -40
  39. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DeTWCZF1.js +419 -0
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B316b_ta.js → ZodTextField.vue_vue_type_script_setup_true_lang-rBa59HC1.js} +1 -1
  41. package/dist/{app-BVaQwBvq.js → app-BkSGMADw.js} +1 -1
  42. package/dist/{app-zO552-Dl.js → app-ZePrUEIY.js} +1183 -1154
  43. package/dist/app.js +1 -1
  44. package/dist/{business-BSl6NSdS.js → business-CG7GnAu5.js} +1 -1
  45. package/dist/campaign-BSH9FJHx.js +1810 -0
  46. package/dist/{campaign-CxN6mq_l.js → campaign-DFvmN5Ky.js} +2 -2
  47. package/dist/campaign.enum-CBlGXHp0.js +20 -0
  48. package/dist/campaign.fn-BszsH1EQ.js +758 -0
  49. package/dist/collectible.enum-Sd3QSyrd.js +19 -0
  50. package/dist/{collection.fn-C-2dyWp9.js → collection.fn-CIFllkyx.js} +2 -2
  51. package/dist/dto-DG2Ckvh4.js +214 -0
  52. package/dist/{effect-D8y0J47O.js → effect-CWSFIfZh.js} +9 -9
  53. package/dist/email-addresses-BCNsQNXA.js +705 -0
  54. package/dist/{export-BxTrifKO.js → export-DKe01mG4.js} +3 -3
  55. package/dist/{helper-bEmZlTwA.js → helper-Et1Q6YUA.js} +1 -1
  56. package/dist/{index-DHTYWfTs.js → index-Bk281EIF.js} +207 -195
  57. package/dist/{index-B2qriSSk.js → index-CHAvEqB_.js} +1 -1
  58. package/dist/index-CMEY40F9.js +32 -0
  59. package/dist/index-CsaQJMAR.js +66 -0
  60. package/dist/{index-C_WyKCqN.js → index-D4FT-dGm.js} +1 -1
  61. package/dist/{index-JBp0chol.js → index-D_sLK5cZ.js} +1500 -1479
  62. package/dist/{index-Dnv999nc.js → index-Dkl_Y2Ir.js} +1 -1
  63. package/dist/{index-Ckz-D_AP.js → index-Dlv6dpg5.js} +2188 -931
  64. package/dist/index-DrRQsR1a.js +44 -0
  65. package/dist/{index-DuYb25dY.js → index-DzZDUZ8E.js} +37 -4
  66. package/dist/index-F1sEdtX3.js +54 -0
  67. package/dist/index-RFzgIvoM.js +29000 -0
  68. package/dist/{index-BFWCbVq2.js → index-RhGXDJ8R.js} +1 -1
  69. package/dist/index-vh86FiIQ.js +10 -0
  70. package/dist/{index.esm2017-Tw7KabwI.js → index.esm2017-COLDuQQ-.js} +1 -1
  71. package/dist/{loading-60xYxow_.js → loading-DxppIZmv.js} +1714 -1720
  72. package/dist/{membership-43FU3EmV.js → membership-DIBN0bog.js} +52 -44
  73. package/dist/money-L7YJDctU.js +15 -0
  74. package/dist/number-BAUL1NQ9.js +12 -0
  75. package/dist/objectid-BXKVeU2w.js +145 -0
  76. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  77. package/dist/reward-Qjelc0jm.js +36 -0
  78. package/dist/{rule-DlHrKp8K.js → rule-BAqQRjqc.js} +180 -177
  79. package/dist/{rule-builder-CU8P8b8U.js → rule-builder-D2hQiWL6.js} +1 -1
  80. package/dist/style.css +1 -1
  81. package/dist/{template-9StyN-b7.js → template-NVFsa0l_.js} +5 -5
  82. package/dist/trigger-qeiGHLZs.js +114 -0
  83. package/dist/{xlsx-CrRvm5Vs.js → usePagination-De7j-UtU.js} +3183 -2962
  84. package/dist/user-CKVD-V1i.js +54 -0
  85. package/dist/{vue-i18n-UKlvivrG.js → vue-i18n-CTdcKDi0.js} +2 -2
  86. package/package.json +8 -7
  87. package/dist/Analytic-BtldByrt.js +0 -622
  88. package/dist/Card-kW7k8kOl.js +0 -825
  89. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BtI2rY4y.js +0 -2813
  90. package/dist/Marketing-CG4GQdax.js +0 -316
  91. package/dist/MemberList-CANkPyR0.js +0 -1733
  92. package/dist/MemberTransactions-CcCa21fY.js +0 -38
  93. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dh3naMXv.js +0 -1753
  94. package/dist/Segment-Clstp5D-.js +0 -437
  95. package/dist/Store-PnpBvIoo.js +0 -1511
  96. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CrDhK2dt.js +0 -890
  97. package/dist/dto-B20bsdh6.js +0 -2770
  98. package/dist/index-BUCjM4jq.js +0 -29193
  99. package/dist/index-Ceu2PcnH.js +0 -206
  100. package/dist/index-CuvNtC_M.js +0 -61
  101. package/dist/index-D3DAgTFI.js +0 -762
  102. package/dist/index-Kjelmo0Y.js +0 -298
  103. package/dist/money-CmR3-qMz.js +0 -15
  104. package/dist/number-CZlrO6Sq.js +0 -12
  105. package/dist/usePagination-BeF5K3M7.js +0 -223
  106. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,298 +0,0 @@
1
- import { z as e, F as t, g as f, e as s, d as r, m as a } from "./loading-60xYxow_.js";
2
- import { e as l } from "./index-JBp0chol.js";
3
- import "vue";
4
- const I = e.object({
5
- icon: e.string(),
6
- label: e.string(),
7
- value: e.string()
8
- }), E = e.object({
9
- gatewayKey: e.enum([
10
- "REVENUE_MONSTER",
11
- "FEEDME",
12
- "FEEDME_MEMBER_CREDIT",
13
- "RAZER_MERCHANT_SERVICE"
14
- ]),
15
- checkoutUrl: e.string().optional(),
16
- checkoutId: e.string().optional(),
17
- callbackUrl: e.string().optional(),
18
- vcode: e.string().optional(),
19
- merchantId: e.string().optional(),
20
- amount: e.string().optional(),
21
- currency: e.string().optional(),
22
- returnUrl: e.string().optional(),
23
- notifyUrl: e.string().optional(),
24
- channels: e.array(I).optional(),
25
- transactionId: e.string().optional()
26
- });
27
- e.object({
28
- trx: e.lazy(() => M),
29
- onlineTrx: E.optional(),
30
- url: e.string().optional()
31
- });
32
- const d = e.enum(["POS", "APP"]), u = e.enum(["topupCount"]), F = e.object({
33
- line1: e.string(),
34
- line2: e.string().optional(),
35
- state: e.string(),
36
- city: e.string(),
37
- postcode: e.string(),
38
- country: e.string()
39
- }), m = e.object({
40
- name: e.string(),
41
- regNo: e.string(),
42
- address: F,
43
- phoneNo: e.string(),
44
- sstRegNo: e.string().optional()
45
- }), p = e.object({
46
- systemCode: e.string(),
47
- inclusive: e.boolean()
48
- }), P = e.object({
49
- id: t,
50
- dayToExpire: e.number()
51
- }), T = e.object({
52
- normal: e.coerce.number(),
53
- free: e.object({
54
- day: e.coerce.number(),
55
- amount: e.coerce.number(),
56
- remark: e.string().nullish()
57
- }).nullish()
58
- }), _ = e.object({
59
- systemCode: e.string(),
60
- taxCode: e.string()
61
- }), j = e.object({
62
- name: e.string(),
63
- systemCode: e.string(),
64
- taxCode: e.string(),
65
- rate: f,
66
- total: s
67
- });
68
- e.object({
69
- canPurchase: e.boolean(),
70
- reason: e.string()
71
- });
72
- e.object({
73
- type: u
74
- });
75
- e.object({
76
- type: u,
77
- min: e.number().nullish(),
78
- max: e.number().nullish()
79
- });
80
- const C = e.object({
81
- options: e.object({
82
- maxReceive: e.number().min(0).nullish(),
83
- maxPerUser: e.number().min(0).nullish()
84
- }),
85
- rule: l.nullish()
86
- }), N = (o, i) => {
87
- const n = o;
88
- n.isFeedvibe && r.Dinero.fromFdoDinero(n.price).toUnit() < 0.1 && i.addIssue({
89
- code: "custom",
90
- path: ["price"],
91
- message: "Price must be at least RM10"
92
- });
93
- }, b = e.object({
94
- _id: e.string(),
95
- isFeedvibe: e.boolean().nullish(),
96
- // conditions: z.array(FdoTopupCountCondition),
97
- image: e.string().nullish(),
98
- rule: l.nullish(),
99
- name: e.string(),
100
- price: s,
101
- originalPrice: s.nullish(),
102
- // new field to indicate coinPrice
103
- coinPrice: e.number().nullish(),
104
- titles: e.array(P),
105
- credit: T,
106
- taxes: e.array(_),
107
- taxTotals: e.array(j),
108
- priceWithTaxes: s.nullish(),
109
- vouchers: e.array(t),
110
- _inclusiveTaxes: e.array(p).nullish(),
111
- _taxSystem: e.array(e.string()).nullish(),
112
- stripePriceId: e.string().nullish(),
113
- subscriptionValidity: e.number().min(1, "Must be at least 1 day").max(365, "Maximum is 365").nullish(),
114
- redeemWithCode: e.boolean().nullish(),
115
- internal: e.boolean().optional(),
116
- hideInPos: e.boolean().optional(),
117
- config: C.optional(),
118
- pf_titles: e.array(e.any()).optional(),
119
- pf_vouchers: e.array(e.any()).optional(),
120
- pf_credit: e.number().optional()
121
- }).superRefine((o, i) => {
122
- var n, c;
123
- o.stripePriceId && !o.subscriptionValidity && i.addIssue({
124
- code: "custom",
125
- message: "Validity is required when stripePriceId is provided",
126
- path: ["subscriptionValidity"]
127
- }), o.originalPrice && o.originalPrice.amount && o.originalPrice.amount < o.price.amount && i.addIssue({
128
- code: "custom",
129
- message: "Original price must be greater than price",
130
- path: ["originalPrice"]
131
- }), o.price.amount < 0 && i.addIssue({
132
- code: "custom",
133
- path: ["price"],
134
- message: "Price cannot be less than 0"
135
- }), o.coinPrice && o.coinPrice < 0 && i.addIssue({
136
- code: "custom",
137
- path: ["coinPrice"],
138
- message: "Point price cannot be less than 0"
139
- }), o.credit.normal < 0 && i.addIssue({
140
- code: "custom",
141
- path: ["credit", "normal"],
142
- message: "Normal credit cannot be less than 0"
143
- }), o.credit.free && (o.credit.free.amount < 0 && i.addIssue({
144
- code: "custom",
145
- path: ["credit", "free", "amount"],
146
- message: "Free credit cannot be less than 0"
147
- }), o.credit.free.amount && o.credit.free.day < 0 && i.addIssue({
148
- code: "custom",
149
- path: ["credit", "free", "day"],
150
- message: "Expiry must be at least 0 (expire same day)"
151
- })), o.credit.normal && o.coinPrice && i.addIssue({
152
- code: "custom",
153
- message: "Bundle redeem with point cannot set normal credit.",
154
- path: ["credit", "normal"]
155
- }), o.credit.normal > r.Dinero.fromFdoDinero(o.price).toUnit() && i.addIssue({
156
- code: "custom",
157
- message: `Normal credit cannot be more than price. Max: ${r.Dinero.fromFdoDinero(
158
- o.price
159
- ).toUnit()}`,
160
- path: ["credit", "normal"]
161
- }), o.titles.length > 0 && o.titles.some((y) => y.dayToExpire < 0) && i.addIssue({
162
- code: "custom",
163
- path: ["titles"],
164
- message: "Title expiry must be at least 0 day (expire same day)"
165
- }), (((c = (n = o.config) == null ? void 0 : n.options) == null ? void 0 : c.maxPerUser) || 0) < 0 && i.addIssue({
166
- code: "custom",
167
- path: ["config.options.maxPerUser"],
168
- message: "Max purchase per user cannot be negative"
169
- });
170
- }).superRefine(N), g = e.object({
171
- name: e.string(),
172
- bundles: e.array(b)
173
- });
174
- e.object({
175
- _id: e.string(),
176
- name: e.string(),
177
- expiredAt: e.string()
178
- });
179
- const S = e.object({
180
- apiKey: e.string(),
181
- webhookSecret: e.string()
182
- }), R = e.object({
183
- company: m.nullish(),
184
- inclusiveTaxes: e.array(p).nullish(),
185
- stripe: S.optional()
186
- }), x = {
187
- collectionName: "Stores",
188
- transform: {
189
- _id: "oid",
190
- business: "oid"
191
- }
192
- };
193
- R.extend({
194
- _id: t,
195
- business: t,
196
- categories: e.array(g)
197
- }).describe(a.describe(x));
198
- const D = e.object({
199
- refundedAt: e.coerce.date(),
200
- reason: e.string(),
201
- transactions: e.array(t)
202
- }), h = e.object({
203
- type: e.enum(["ONLINE", "OFFLINE", "COIN", "STRIPE", "CARD", "FEEDVIBE"]),
204
- extra: e.string().nullish()
205
- }), U = {
206
- collectionName: "StoreTransactions",
207
- transform: {
208
- _id: "oid",
209
- business: "oid",
210
- location: "oid",
211
- member: "oid",
212
- transactions: "oid"
213
- },
214
- lookups: {
215
- member: {
216
- fromCollection: "UsersV2",
217
- as: "pf_member"
218
- }
219
- }
220
- }, M = e.object({
221
- _id: t,
222
- source: d,
223
- // can be memberStorePurchase
224
- ref: e.string(),
225
- business: t,
226
- company: m,
227
- location: t.optional(),
228
- member: t,
229
- // createdAt: z.coerce.date(),
230
- bundle: b,
231
- transactions: e.array(t),
232
- // array of transaction id (voucher, credit, title)
233
- status: e.enum([
234
- "PENDING_PAYMENT",
235
- "PENDING_TRANSACTION",
236
- "COMPLETED",
237
- "REFUNDED"
238
- ]),
239
- refund: D.nullish(),
240
- paymentType: h.nullish(),
241
- paymentRef: e.string().nullish(),
242
- webhookUrl: e.string().optional(),
243
- webhookSent: e.boolean().optional(),
244
- pf_transactions: e.array(e.any()).optional(),
245
- pf_member: e.any().optional(),
246
- pf_location: e.any().optional(),
247
- pf_ref: e.any().optional()
248
- }).describe(a.describe(U));
249
- e.object({
250
- bundle: t,
251
- member: e.string(),
252
- ref: e.string(),
253
- paymentType: h.nullish(),
254
- withCoin: e.boolean().optional(),
255
- card: e.string().optional(),
256
- location: t.optional(),
257
- source: d,
258
- webhookUrl: e.string().optional()
259
- });
260
- e.object({
261
- categories: e.array(g)
262
- });
263
- e.object({
264
- id: t,
265
- reason: e.string(),
266
- location: t.optional()
267
- });
268
- e.object({
269
- _id: t,
270
- business: t,
271
- user: t,
272
- bundleId: e.string(),
273
- transaction: e.array(t),
274
- subscriptionId: e.string(),
275
- expiredAt: e.coerce.date()
276
- }).describe(
277
- a.describe({
278
- collectionName: "StoreSubscriptions",
279
- transform: {
280
- _id: "oid",
281
- business: "oid",
282
- user: "oid",
283
- transaction: "oid",
284
- expiredAt: "date"
285
- }
286
- })
287
- );
288
- e.object({
289
- member: e.string(),
290
- subscriptionId: e.string()
291
- });
292
- export {
293
- R as F,
294
- m as a,
295
- F as b,
296
- b as c,
297
- M as d
298
- };
@@ -1,15 +0,0 @@
1
- import { e as r } from "./index-BUCjM4jq.js";
2
- function n(e) {
3
- return r.fromNumber({ number: e });
4
- }
5
- function t() {
6
- return r.zero().toObject();
7
- }
8
- function u() {
9
- return r.zero();
10
- }
11
- export {
12
- u as a,
13
- n as t,
14
- t as z
15
- };
@@ -1,12 +0,0 @@
1
- import { c as n } from "./index-BUCjM4jq.js";
2
- function f(t) {
3
- return n(t).multiply(100).toFormat(!1);
4
- }
5
- function m(t, r = 2, o = !1) {
6
- const e = parseFloat(String(t)).toFixed(r);
7
- return o ? parseFloat(e).toString() : e;
8
- }
9
- export {
10
- f as F,
11
- m as f
12
- };
@@ -1,223 +0,0 @@
1
- import { defineComponent as M, ref as w, resolveComponent as C, openBlock as v, createBlock as F, withCtx as B, createVNode as c, createElementVNode as i, normalizeStyle as N, createElementBlock as S, Fragment as P, renderList as E, computed as h, onMounted as L, watch as R, unref as p, createCommentVNode as V, toDisplayString as x } from "vue";
2
- import { l as A } from "./lodash-B5I3zXaY.js";
3
- const T = ["id"], D = /* @__PURE__ */ M({
4
- __name: "FmTableSelection",
5
- props: {
6
- value: {},
7
- items: {}
8
- },
9
- emits: ["update:modelValue"],
10
- setup(f, { emit: g }) {
11
- const a = g, l = f, r = w(!1);
12
- return (d, u) => {
13
- const y = C("FmButton"), b = C("FmMenuItem"), o = C("FmMenu");
14
- return v(), F(o, {
15
- "max-height": 264,
16
- shift: "",
17
- onMenuChanged: u[0] || (u[0] = (n) => r.value = n)
18
- }, {
19
- "menu-button": B(() => {
20
- var n;
21
- return [
22
- c(y, {
23
- icon: r.value ? "expand_less" : "expand_more",
24
- label: (n = d.items.find((s) => s.value === l.value)) == null ? void 0 : n.label,
25
- "icon-position": "append",
26
- size: "md",
27
- variant: "tertiary"
28
- }, null, 8, ["icon", "label"])
29
- ];
30
- }),
31
- "menu-wrapper": B(({ maxHeight: n }) => [
32
- i("div", {
33
- id: `menu-wrapper-${n}`,
34
- style: N({ maxHeight: `${n}px` }),
35
- class: "bg-fm-color-neutral-white flex flex-col overflow-y-auto px-4 py-12 rounded-md shadow-light-300 w-[75px]"
36
- }, [
37
- (v(!0), S(P, null, E(d.items, (s) => (v(), F(b, {
38
- key: s.value,
39
- label: s.label,
40
- value: s.value,
41
- "model-value": s.value === l.value,
42
- "onUpdate:modelValue": (z) => a("update:modelValue", s.value)
43
- }, null, 8, ["label", "value", "model-value", "onUpdate:modelValue"]))), 128))
44
- ], 12, T)
45
- ]),
46
- _: 1
47
- });
48
- };
49
- }
50
- }), U = { class: "" }, O = {
51
- key: 0,
52
- class: "w-full flex flex-col gap-16 items-center py-16"
53
- }, j = {
54
- key: 1,
55
- class: "basis-72 bg-white flex items-center justify-between px-24 pt-6 border-t border-fm-color-border"
56
- }, W = { class: "flex gap-24 items-center justify-between xs:hidden xs:invisible" }, q = { class: "flex gap-8 items-center" }, G = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, H = { class: "flex gap-8 items-center" }, J = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, K = { class: "flex gap-8" }, Y = /* @__PURE__ */ M({
57
- __name: "BaseTable",
58
- props: {
59
- rowData: {},
60
- columnDefs: {},
61
- loading: { type: Boolean, default: !1 },
62
- rowCount: { default: 0 },
63
- shrinkAt: { type: [Number, Boolean], default: !1 },
64
- pageCount: {},
65
- pageIndex: {},
66
- hideFooter: { type: Boolean, default: !1 },
67
- pageSize: {},
68
- pageSizeOptions: { default: () => [
69
- { label: "10", value: 10 },
70
- { label: "20", value: 20 },
71
- { label: "50", value: 50 }
72
- ] }
73
- },
74
- emits: ["sortChange", "rowClick", "pageChange"],
75
- setup(f, { emit: g }) {
76
- const a = f, l = g, r = h(() => a.pageIndex + 1), d = h(() => a.pageIndex * a.pageSize), u = h(
77
- () => Math.min(d.value + a.pageSize, a.rowCount || 0)
78
- ), y = h(() => a.pageIndex > 0), b = h(() => a.pageIndex < a.pageCount - 1), o = (e) => {
79
- l("sortChange", e);
80
- }, n = (e) => {
81
- l("rowClick", e);
82
- }, s = (e) => {
83
- l("pageChange", { pageIndex: e, pageSize: a.pageSize });
84
- }, z = (e) => {
85
- l("pageChange", { pageIndex: 0, pageSize: e });
86
- }, I = w(!1);
87
- return L(() => {
88
- R(
89
- () => a.loading,
90
- (e, t) => {
91
- t === !0 && e === !1 && (I.value = !0);
92
- }
93
- );
94
- }), (e, t) => {
95
- const $ = C("FmTable"), k = C("FmButton");
96
- return v(), S("div", U, [
97
- c($, {
98
- loading: e.loading,
99
- "row-data": e.rowData,
100
- "row-count": e.rowCount,
101
- "column-defs": e.columnDefs,
102
- "shrink-at": e.shrinkAt,
103
- "page-count": e.pageCount,
104
- "page-size": e.pageSize,
105
- "fetch-fn": void 0,
106
- "hide-footer": "",
107
- onSortChange: o,
108
- onRowClick: n
109
- }, null, 8, ["loading", "row-data", "row-count", "column-defs", "shrink-at", "page-count", "page-size"]),
110
- e.rowData.length == 0 && e.loading == !1 && p(I) ? (v(), S("div", O, t[5] || (t[5] = [
111
- i("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1),
112
- i("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1)
113
- ]))) : V("", !0),
114
- e.hideFooter ? V("", !0) : (v(), S("div", j, [
115
- i("div", W, [
116
- i("div", q, [
117
- t[6] || (t[6] = i("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
118
- c(D, {
119
- items: e.pageSizeOptions,
120
- value: e.pageSize,
121
- "onUpdate:modelValue": z
122
- }, null, 8, ["items", "value"])
123
- ]),
124
- i("span", G, x(p(d) + 1) + " - " + x(p(u)) + " of " + x(e.rowCount) + " items ", 1)
125
- ]),
126
- i("div", H, [
127
- c(D, {
128
- items: Array.from(Array(e.pageCount), (m, _) => ({
129
- label: (_ + 1).toString(),
130
- value: _ + 1
131
- })),
132
- value: p(r),
133
- "onUpdate:modelValue": t[0] || (t[0] = (m) => s(m - 1))
134
- }, null, 8, ["items", "value"]),
135
- i("span", J, " of " + x(e.pageCount) + " pages ", 1),
136
- i("div", K, [
137
- c(k, {
138
- disabled: !p(y),
139
- icon: "first_page",
140
- "icon-color": "neutral-black",
141
- variant: "tertiary",
142
- onClick: t[1] || (t[1] = (m) => s(0))
143
- }, null, 8, ["disabled"]),
144
- c(k, {
145
- disabled: !p(y),
146
- icon: "chevron_left",
147
- "icon-color": "neutral-black",
148
- variant: "tertiary",
149
- onClick: t[2] || (t[2] = (m) => s(e.pageIndex - 1))
150
- }, null, 8, ["disabled"]),
151
- c(k, {
152
- disabled: !p(b),
153
- icon: "chevron_right",
154
- "icon-color": "neutral-black",
155
- variant: "tertiary",
156
- onClick: t[3] || (t[3] = (m) => s(e.pageIndex + 1))
157
- }, null, 8, ["disabled"]),
158
- c(k, {
159
- disabled: !p(b),
160
- icon: "last_page",
161
- "icon-color": "neutral-black",
162
- variant: "tertiary",
163
- onClick: t[4] || (t[4] = (m) => s(e.pageCount - 1))
164
- }, null, 8, ["disabled"])
165
- ])
166
- ])
167
- ]))
168
- ]);
169
- };
170
- }
171
- });
172
- function Z(f, g = { key: "_id", descending: !0 }) {
173
- const a = w({
174
- pageCount: 0,
175
- searchValue: "",
176
- pageIndex: 0,
177
- totalRows: 0,
178
- isLoading: !1,
179
- pageSize: 10
180
- }), l = w(g), r = w([]), d = async (o) => {
181
- a.value.isLoading = !0, r.value = [];
182
- try {
183
- const n = await f({
184
- limit: o.pageSize || a.value.pageSize,
185
- skip: o.pageIndex ?? 0,
186
- sortBy: l.value.key,
187
- descending: l.value.descending,
188
- search: a.value.searchValue
189
- });
190
- r.value = n.resources, a.value.totalRows = n.meta.totalResources ?? 0, a.value.pageCount = n.meta.totalPages ?? 0, a.value.pageIndex = n.meta.skip ?? 0;
191
- } catch (n) {
192
- console.error("Error fetching data:", n);
193
- } finally {
194
- a.value.isLoading = !1;
195
- }
196
- }, u = A.debounce(async (o) => {
197
- a.value.pageSize = (o == null ? void 0 : o.pageSize) || a.value.pageSize, await d({
198
- pageSize: a.value.pageSize,
199
- pageIndex: (o == null ? void 0 : o.pageIndex) || 0
200
- });
201
- }, 200);
202
- return {
203
- tableMeta: a,
204
- rowData: r,
205
- sortBy: l,
206
- fetchData: d,
207
- debouncedFetchData: u,
208
- onSort: async (o) => {
209
- var n;
210
- console.log("sortState", (n = o[0]) == null ? void 0 : n.id), o.length ? (l.value = {
211
- key: o[0].id.startsWith("_") ? o[0].id : o[0].id.replace(new RegExp("_", "g"), "."),
212
- descending: o[0].desc
213
- }, console.log("sortBy", l.value)) : l.value = g, await u();
214
- },
215
- onSearch: () => {
216
- u({ pageIndex: 0, pageSize: a.value.pageSize });
217
- }
218
- };
219
- }
220
- export {
221
- Y as _,
222
- Z as u
223
- };
@@ -1,37 +0,0 @@
1
- import { components as p } from "@feedmepos/ui-library";
2
- import { h as m } from "vue";
3
- function d(n) {
4
- return m(
5
- "div",
6
- {
7
- class: "flex items-center gap-x-8"
8
- },
9
- [
10
- m(p.FmAvatar, {
11
- name: n != null && n.photoUrl ? "-" : n == null ? void 0 : n.name,
12
- src: (n == null ? void 0 : n.photoUrl) ?? void 0,
13
- size: "sm"
14
- }),
15
- m("span", n == null ? void 0 : n.name)
16
- ]
17
- );
18
- }
19
- function g(n, o) {
20
- var l, a;
21
- return ((a = (l = n.collection) == null ? void 0 : l.TITLE) == null ? void 0 : a.map(
22
- (t) => {
23
- var c;
24
- return (c = o == null ? void 0 : o.find((i) => i._id === t.collectible)) == null ? void 0 : c.name;
25
- }
26
- ).join(", ")) || "-";
27
- }
28
- function T(n, o) {
29
- var a, t, c, i;
30
- const l = (((c = (t = (a = n.collection) == null ? void 0 : a.TIER) == null ? void 0 : t[0]) == null ? void 0 : c.balance) || 0) - 1;
31
- return ((i = o[l]) == null ? void 0 : i.name) || "-";
32
- }
33
- export {
34
- T as a,
35
- g as b,
36
- d as g
37
- };