@feedmepos/mf-connect 0.0.18-prod → 0.0.19-prod

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 (64) hide show
  1. package/dist/Analytic-Ch5vd0M4.js +759 -0
  2. package/dist/{Broadcast-SK3ik91V.js → Broadcast-3I89gcxD.js} +7 -7
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BGzuAEwI.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CXjLvOFM.js} +8 -8
  4. package/dist/{Card-0-hxxpiV.js → Card-BEJ03OCX.js} +96 -96
  5. package/dist/{Collections-pnUS2NUo.js → Collections-DOvO-cyf.js} +6 -6
  6. package/dist/{Credit-UcSstIA6.js → Credit-CS_f8MWQ.js} +7 -7
  7. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ck-cXc7h.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-4EqJZVlT.js} +20 -20
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dfw0Eph1.js → EffectSheet.vue_vue_type_style_index_0_lang-CEf5oXj2.js} +5 -5
  9. package/dist/{Experience-D7682kjb.js → Experience-BMRDA9az.js} +7 -7
  10. package/dist/{Game-ugwJfw5Z.js → Game-jajGoiRD.js} +7 -7
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CQ1J_8U7.js → ImageInput.vue_vue_type_script_setup_true_lang-D1HZobOu.js} +1 -1
  12. package/dist/{MainLayout-B_mALJzY.js → MainLayout-B2So6_3h.js} +1 -1
  13. package/dist/{Marketing-C0H14x8-.js → Marketing-B7ep8HRJ.js} +14 -14
  14. package/dist/{Member-CxVXoNzi.js → Member-dh5AwXCY.js} +2 -2
  15. package/dist/{MemberList-3XALU8N1.js → MemberList-BG8RU-_z.js} +11 -11
  16. package/dist/{MemberTransactions-Va--4_bi.js → MemberTransactions-CQVgmcp5.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DpK7c7Zu.js → MessageInput.vue_vue_type_script_setup_true_lang-CEdItTM7.js} +2 -2
  18. package/dist/{Mission-D9ASjTM_.js → Mission-BRHhSI6-.js} +14 -14
  19. package/dist/{Point-DXllJyrF.js → Point-Ckemk8sq.js} +7 -7
  20. package/dist/{Promotion-ByujYVZV.js → Promotion-BZLQARR5.js} +8 -8
  21. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D9uygHXu.js → RuleGroup.vue_vue_type_script_setup_true_lang-D0qw6tOD.js} +13 -13
  22. package/dist/{Segment-DzYLWnEx.js → Segment-DNuB8-_e.js} +9 -9
  23. package/dist/{Setting-3JrqJeay.js → Setting-CSHcFTQc.js} +126 -126
  24. package/dist/Store-BOqFpaYd.js +1502 -0
  25. package/dist/{StoreRewards-BIyTKYQ7.js → StoreRewards-BNxVa94v.js} +9 -9
  26. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Cd9ReYzL.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CKZJmSBk.js} +82 -79
  27. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DTfuVmSz.js +139 -0
  28. package/dist/{Tier-DSOYEDpP.js → Tier-pYkfcAIL.js} +16 -16
  29. package/dist/{Title-Bwgpdw5W.js → Title-L7b7bGBO.js} +15 -15
  30. package/dist/{Transaction-BA1wqoKh.js → Transaction-BYb73ORt.js} +1 -1
  31. package/dist/{Voucher-ZMryMClH.js → Voucher-DjGB0Ajs.js} +20 -20
  32. package/dist/{app--QGN757T.js → app-CYp3yPPw.js} +1 -1
  33. package/dist/{app-gMUoPAtF.js → app-vzsH1VQf.js} +38 -38
  34. package/dist/app.js +1 -1
  35. package/dist/{campaign-DWA08UtZ.js → campaign-Byj6dpxX.js} +2 -2
  36. package/dist/{dto-EdZglrpA.js → dto-CVEezNuM.js} +8 -8
  37. package/dist/{effect-BGQxHIBT.js → effect-ueqMoqiZ.js} +1 -1
  38. package/dist/{export-CvoZ48Rq.js → export-B1vfJQ_D.js} +3 -3
  39. package/dist/{helper-BTpTsE8-.js → helper-DeFgiHSS.js} +1 -1
  40. package/dist/{index-BFJS-YmL.js → index-B-FWvOVj.js} +1 -1
  41. package/dist/{index-0t3kF_Tg.js → index-B5m-noV5.js} +1 -1
  42. package/dist/{index-BVqa77Ch.js → index-BehSlDVX.js} +1 -1
  43. package/dist/index-BqH31bb7.js +291 -0
  44. package/dist/{index-BxMkJPP_.js → index-BrA2zACe.js} +2 -2
  45. package/dist/{index-CY0A-Rfl.js → index-C-RRKtNp.js} +5 -5
  46. package/dist/{index-HPSSJKsc.js → index-Cwmk_EmE.js} +6 -5
  47. package/dist/{index-Blh8vWHb.js → index-D4MN0F2_.js} +1 -1
  48. package/dist/{index-D4KUQKKJ.js → index-DdEBZ4p_.js} +3 -3
  49. package/dist/{index-D_vvblAz.js → index-m6PFUpwd.js} +2 -2
  50. package/dist/{loading-Cgp9wWK3.js → loading-C7UDAIcq.js} +4 -4
  51. package/dist/{lodash-m4OgMZ4R.js → lodash-Cc-nE72h.js} +1 -1
  52. package/dist/{membership-VeQiYdQd.js → membership-D-jW62pj.js} +63 -58
  53. package/dist/{money-DUtWOAkL.js → money-gDtjN552.js} +1 -1
  54. package/dist/{number-D-YjTFfa.js → number-Cg9DyGBY.js} +2 -2
  55. package/dist/{rule-b2srzDD8.js → rule-BVqVI-WL.js} +2 -2
  56. package/dist/{rule-builder-CsFDa4FH.js → rule-builder-o8Axr-t4.js} +1 -1
  57. package/dist/{template-B8msjWjA.js → template-ARPGA10Y.js} +5 -5
  58. package/dist/{usePagination-D1R6ZAK_.js → usePagination-DTsDtrYI.js} +1 -1
  59. package/dist/{xlsx-DlpKgn7I.js → xlsx-DHfAWgSM.js} +1 -1
  60. package/package.json +1 -1
  61. package/dist/Analytic-uwlRSM7O.js +0 -612
  62. package/dist/Store-2dsgXsLe.js +0 -1442
  63. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BafQ0glH.js +0 -124
  64. package/dist/index-BTYqlJ9v.js +0 -244
@@ -1,20 +1,20 @@
1
1
  import { defineComponent as Y, ref as V, computed as N, onMounted as Z, resolveComponent as p, openBlock as u, createBlock as v, unref as e, isRef as z, withCtx as x, createElementVNode as s, createVNode as n, createElementBlock as I, createTextVNode as J, resolveDynamicComponent as H, toDisplayString as K, Fragment as j, createCommentVNode as U, h as C } from "vue";
2
2
  import { _ as Q } from "./campaign-CpzFl8Vr.js";
3
3
  import { components as $ } from "@feedmepos/ui-library";
4
- import { a as X, u as q, b as k } from "./app-gMUoPAtF.js";
5
- import { u as ee, p as M, f as B } from "./loading-Cgp9wWK3.js";
6
- import { C as _, u as te } from "./membership-VeQiYdQd.js";
7
- import { F as ae } from "./index-BxMkJPP_.js";
4
+ import { b as X, u as q, d as k } from "./app-vzsH1VQf.js";
5
+ import { u as ee, p as M, f as B } from "./loading-C7UDAIcq.js";
6
+ import { C as _, u as te } from "./membership-D-jW62pj.js";
7
+ import { F as ae } from "./index-BrA2zACe.js";
8
8
  import { c as oe } from "./object-qECH92oz.js";
9
9
  import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
10
  import { useCoreStore as le } from "@feedmepos/mf-common";
11
11
  import { _ as se, Z as w } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
12
- import { _ as ie } from "./ImageInput.vue_vue_type_script_setup_true_lang-CQ1J_8U7.js";
13
- import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BafQ0glH.js";
14
- import { _ as me, a as de } from "./EffectSheet.vue_vue_type_style_index_0_lang-Dfw0Eph1.js";
15
- import { i as ce, t as ue } from "./helper-BTpTsE8-.js";
12
+ import { _ as ie } from "./ImageInput.vue_vue_type_script_setup_true_lang-D1HZobOu.js";
13
+ import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DTfuVmSz.js";
14
+ import { _ as me, a as de } from "./EffectSheet.vue_vue_type_style_index_0_lang-CEf5oXj2.js";
15
+ import { i as ce, t as ue } from "./helper-DeFgiHSS.js";
16
16
  import { useRouter as pe } from "vue-router";
17
- import { m as D } from "./index-BVqa77Ch.js";
17
+ import { m as D } from "./index-BehSlDVX.js";
18
18
  const fe = {
19
19
  key: 0,
20
20
  class: "flex flex-col space-y-16 pr-12"
@@ -1,15 +1,15 @@
1
- import { defineComponent as P, ref as k, computed as $, onMounted as z, resolveComponent as x, openBlock as R, createBlock as O, unref as a, withCtx as N, createVNode as g, normalizeClass as U, createCommentVNode as oe, createElementVNode as C, toDisplayString as q, createElementBlock as L, Fragment as le, renderList as se, mergeModels as K, useModel as ie, watch as j, onBeforeMount as ce, h as c } from "vue";
1
+ import { defineComponent as P, ref as k, computed as $, onMounted as z, resolveComponent as x, openBlock as R, createBlock as O, unref as n, withCtx as N, createVNode as g, normalizeClass as U, createCommentVNode as oe, createElementVNode as C, toDisplayString as q, createElementBlock as L, Fragment as le, renderList as se, mergeModels as K, useModel as ie, watch as j, onBeforeMount as ce, h as c } from "vue";
2
2
  import { components as S } from "@feedmepos/ui-library";
3
- import { d as ue } from "./index-D_vvblAz.js";
4
- import { a as X } from "./loading-Cgp9wWK3.js";
3
+ import { d as ue } from "./index-m6PFUpwd.js";
4
+ import { a as X } from "./loading-C7UDAIcq.js";
5
5
  import { s as de } from "./index-Dbd4WA4r.js";
6
6
  import { h as b } from "./moment-BWErdI6_.js";
7
7
  import { s as Y } from "./index-CuvNtC_M.js";
8
- import { f as H } from "./number-D-YjTFfa.js";
9
- import { e as G, j as me, S as pe, h as fe, a as ge } from "./app-gMUoPAtF.js";
10
- import { u as J, _ as Q } from "./usePagination-D1R6ZAK_.js";
8
+ import { f as H } from "./number-Cg9DyGBY.js";
9
+ import { e as G, j as me, S as pe, h as fe, b as ge } from "./app-vzsH1VQf.js";
10
+ import { u as J, _ as Q } from "./usePagination-DTsDtrYI.js";
11
11
  import { g as Z } from "./user-Bm4KttFq.js";
12
- import { B as ee, a as te } from "./export-CvoZ48Rq.js";
12
+ import { B as ee, a as te } from "./export-B1vfJQ_D.js";
13
13
  import { o as A } from "./objectId-dwaoBfJX.js";
14
14
  function ye(o) {
15
15
  let s = "";
@@ -137,7 +137,7 @@ const T = {
137
137
  return R(), O(f, {
138
138
  placement: o.placement || "bottom-end",
139
139
  disabled: o.disabled == !0,
140
- "model-value": a(d),
140
+ "model-value": n(d),
141
141
  onMenuChanged: t[0] || (t[0] = (e) => d.value = e),
142
142
  "close-on-click": !1
143
143
  }, {
@@ -154,9 +154,9 @@ const T = {
154
154
  outline: "",
155
155
  size: "sm"
156
156
  }, null, 8, ["name", "class"])) : oe("", !0),
157
- C("div", ve, q(l.label) + " " + q(o.showItemLabel ? a(y) : ""), 1),
157
+ C("div", ve, q(l.label) + " " + q(o.showItemLabel ? n(y) : ""), 1),
158
158
  g(u, {
159
- name: a(d) ? "keyboard_arrow_up" : "keyboard_arrow_down",
159
+ name: n(d) ? "keyboard_arrow_up" : "keyboard_arrow_down",
160
160
  class: U(l.class),
161
161
  outline: "",
162
162
  size: "sm"
@@ -167,7 +167,7 @@ const T = {
167
167
  ]),
168
168
  default: N(() => [
169
169
  g(w, {
170
- "model-value": Object.keys(a(r)).length === l.items.length,
170
+ "model-value": Object.keys(n(r)).length === l.items.length,
171
171
  label: "All",
172
172
  "has-checkbox": !0,
173
173
  indeterminate: !0,
@@ -178,8 +178,8 @@ const T = {
178
178
  value: e.value,
179
179
  label: e.label,
180
180
  "has-checkbox": !0,
181
- "model-value": a(r)[e.value],
182
- "onUpdate:modelValue": (n) => D(e.value)
181
+ "model-value": n(r)[e.value],
182
+ "onUpdate:modelValue": (a) => D(e.value)
183
183
  }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
184
184
  ]),
185
185
  _: 1
@@ -225,7 +225,7 @@ const T = {
225
225
  }, {
226
226
  "trigger-button": N(() => [
227
227
  g(m, {
228
- label: a(r),
228
+ label: n(r),
229
229
  icon: "calendar_month",
230
230
  "right-icon": "keyboard_arrow_down",
231
231
  class: "text-fm-color-neutral-gray-400 cursor-pointer"
@@ -292,8 +292,8 @@ const W = () => {
292
292
  outline: !0,
293
293
  size: "sm",
294
294
  class: "cursor-pointer mr-4",
295
- onClick: (n) => {
296
- n.preventDefault(), n.stopPropagation(), X(e.row.original._id.toString());
295
+ onClick: (a) => {
296
+ a.preventDefault(), a.stopPropagation(), X(e.row.original._id.toString());
297
297
  }
298
298
  }),
299
299
  c(
@@ -317,7 +317,7 @@ const W = () => {
317
317
  enableSorting: !1,
318
318
  cell(e) {
319
319
  var v, i, F, E;
320
- const n = H(
320
+ const a = H(
321
321
  e.row.original.expiryAmount.reduce(
322
322
  (ne, re) => ne + re.amount,
323
323
  e.row.original.amount ?? 0
@@ -332,10 +332,10 @@ const W = () => {
332
332
  {
333
333
  class: [
334
334
  "pr-2",
335
- +n > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
335
+ +a > 0 ? "text-fm-color-system-success-300" : "text-fm-color-system-error-300"
336
336
  ]
337
337
  },
338
- n
338
+ a
339
339
  ),
340
340
  c("div", { class: "flex items-center" }, [
341
341
  e.row.original.expiryAmount.length > 0 ? c(
@@ -363,13 +363,13 @@ const W = () => {
363
363
  maxWidth: "200px"
364
364
  },
365
365
  cell(e) {
366
- const n = T.formattedType(e.row.original);
366
+ const a = T.formattedType(e.row.original);
367
367
  return c("div", { class: "flex items-center" }, [
368
- c("div", { class: "truncate text-ellipsis" }, n),
369
- n.length > 20 ? c(
368
+ c("div", { class: "truncate text-ellipsis" }, a),
369
+ a.length > 20 ? c(
370
370
  S.FmTooltip,
371
371
  {
372
- content: n
372
+ content: a
373
373
  },
374
374
  [
375
375
  c(S.FmIcon, {
@@ -397,17 +397,20 @@ const W = () => {
397
397
  {
398
398
  header: "Phone No.",
399
399
  accessorKey: "pf_user.phoneNumber",
400
- accessorFn: (e) => e.pf_user.phoneNumber
400
+ accessorFn: (e) => {
401
+ var a;
402
+ return ((a = e == null ? void 0 : e.pf_user) == null ? void 0 : a.phoneNumber) || "";
403
+ }
401
404
  },
402
405
  {
403
406
  accessorFn: (e) => e.ref,
404
407
  header: "References",
405
408
  accessorKey: "ref",
406
409
  cell(e) {
407
- var n, h;
410
+ var a, h;
408
411
  return c("div", { class: "flex items-center justify-between gap-4" }, [
409
412
  c("div", { class: "flex items-center" }, [
410
- (n = e.row.original.metadata) != null && n.remark ? c(
413
+ (a = e.row.original.metadata) != null && a.remark ? c(
411
414
  S.FmTooltip,
412
415
  {
413
416
  content: (h = e.row.original.metadata) == null ? void 0 : h.remark
@@ -435,14 +438,14 @@ const W = () => {
435
438
  },
436
439
  source: []
437
440
  }), { tableMeta: y, rowData: D, onSort: I, debouncedFetchData: m, onSearch: t } = J(async (e) => {
438
- const n = {
441
+ const a = {
439
442
  ...r.value,
440
443
  user: l.user,
441
444
  dateRange: {
442
445
  start: new Date(r.value.dateRange.startDate).toISOString(),
443
446
  end: new Date(r.value.dateRange.endDate).toISOString()
444
447
  }
445
- }, h = await M.readAll(e, n);
448
+ }, h = await M.readAll(e, a);
446
449
  return {
447
450
  resources: h.resources.map((v) => {
448
451
  const i = u.value.find((F) => F._id === v.ref);
@@ -471,27 +474,27 @@ const W = () => {
471
474
  };
472
475
  await te({
473
476
  exporter: new _e(),
474
- readFunction: (n) => M.readAll(n, e),
475
- transformRecord: (n) => {
477
+ readFunction: (a) => M.readAll(a, e),
478
+ transformRecord: (a) => {
476
479
  var h, v, i;
477
480
  return {
478
- TransactionID: n._id,
479
- CreatedAt: b(A(n._id.toString())).format(
481
+ TransactionID: a._id,
482
+ CreatedAt: b(A(a._id.toString())).format(
480
483
  "D MMM YYYY, hh:mmA"
481
484
  ),
482
485
  Amount: H(
483
- n.expiryAmount.reduce(
486
+ a.expiryAmount.reduce(
484
487
  (F, E) => F + E.amount,
485
- n.amount ?? 0
488
+ a.amount ?? 0
486
489
  ),
487
490
  2
488
491
  ),
489
- Type: T.formattedType(n),
490
- Source: Y(T.getReason(n.source)),
491
- User: ((h = n.pf_user) == null ? void 0 : h.name) || "",
492
- "Phone No.": ((v = n.pf_user) == null ? void 0 : v.phoneNumber) || "",
493
- References: n.ref,
494
- Remark: ((i = n.metadata) == null ? void 0 : i.remark) || ""
492
+ Type: T.formattedType(a),
493
+ Source: Y(T.getReason(a.source)),
494
+ User: ((h = a.pf_user) == null ? void 0 : h.name) || "",
495
+ "Phone No.": ((v = a.pf_user) == null ? void 0 : v.phoneNumber) || "",
496
+ References: a.ref,
497
+ Remark: ((i = a.metadata) == null ? void 0 : i.remark) || ""
495
498
  };
496
499
  },
497
500
  filename: "transactions"
@@ -504,14 +507,14 @@ const W = () => {
504
507
  }
505
508
  return ce(async () => {
506
509
  await s.readLocations(), await m();
507
- }), (e, n) => {
510
+ }), (e, a) => {
508
511
  const h = x("FmSearch"), v = x("FmButton");
509
512
  return R(), L("div", null, [
510
513
  C("div", Se, [
511
514
  g(h, {
512
515
  class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
513
- modelValue: a(r).search,
514
- "onUpdate:modelValue": n[0] || (n[0] = (i) => a(r).search = i),
516
+ modelValue: n(r).search,
517
+ "onUpdate:modelValue": a[0] || (a[0] = (i) => n(r).search = i),
515
518
  placeholder: "Search",
516
519
  collapsible: ""
517
520
  }, null, 8, ["modelValue"]),
@@ -526,17 +529,17 @@ const W = () => {
526
529
  g(B, {
527
530
  class: "cursor-pointer text-fm-color-neutral-gray-400",
528
531
  "right-icon": "keyboard_arrow_down",
529
- modelValue: a(r)["metadata.location"],
530
- "onUpdate:modelValue": n[1] || (n[1] = (i) => a(r)["metadata.location"] = i),
532
+ modelValue: n(r)["metadata.location"],
533
+ "onUpdate:modelValue": a[1] || (a[1] = (i) => n(r)["metadata.location"] = i),
531
534
  icon: "storefront",
532
535
  "show-item-label": !0,
533
- items: a(w)
536
+ items: n(w)
534
537
  }, null, 8, ["modelValue", "items"]),
535
538
  g(B, {
536
539
  class: "cursor-pointer text-fm-color-neutral-gray-400",
537
540
  "right-icon": "keyboard_arrow_down",
538
- modelValue: a(r)["pf_collectible.type"],
539
- "onUpdate:modelValue": n[2] || (n[2] = (i) => a(r)["pf_collectible.type"] = i),
541
+ modelValue: n(r)["pf_collectible.type"],
542
+ "onUpdate:modelValue": a[2] || (a[2] = (i) => n(r)["pf_collectible.type"] = i),
540
543
  label: "Type: ",
541
544
  "show-item-label": !0,
542
545
  items: [
@@ -553,27 +556,27 @@ const W = () => {
553
556
  g(B, {
554
557
  class: "cursor-pointer text-fm-color-neutral-gray-400",
555
558
  "right-icon": "keyboard_arrow_down",
556
- modelValue: a(r).source,
557
- "onUpdate:modelValue": n[3] || (n[3] = (i) => a(r).source = i),
559
+ modelValue: n(r).source,
560
+ "onUpdate:modelValue": a[3] || (a[3] = (i) => n(r).source = i),
558
561
  label: "Source: ",
559
562
  "show-item-label": !0,
560
- items: a(_)
563
+ items: n(_)
561
564
  }, null, 8, ["modelValue", "items"]),
562
565
  g(ae, {
563
566
  "model-value": {
564
- startDate: a(r).dateRange.startDate,
565
- endDate: a(r).dateRange.endDate
567
+ startDate: n(r).dateRange.startDate,
568
+ endDate: n(r).dateRange.endDate
566
569
  },
567
- "onUpdate:modelValue": n[4] || (n[4] = (i) => a(r).dateRange = {
568
- startDate: a(b)(i.startDate).startOf("d").toISOString(),
569
- endDate: a(b)(i.endDate).endOf("d").toISOString()
570
+ "onUpdate:modelValue": a[4] || (a[4] = (i) => n(r).dateRange = {
571
+ startDate: n(b)(i.startDate).startOf("d").toISOString(),
572
+ endDate: n(b)(i.endDate).endOf("d").toISOString()
570
573
  })
571
574
  }, null, 8, ["model-value"])
572
575
  ]),
573
576
  g(h, {
574
577
  class: "xs:hidden",
575
- modelValue: a(r).search,
576
- "onUpdate:modelValue": n[5] || (n[5] = (i) => a(r).search = i),
578
+ modelValue: n(r).search,
579
+ "onUpdate:modelValue": a[5] || (a[5] = (i) => n(r).search = i),
577
580
  placeholder: "Search",
578
581
  collapsible: ""
579
582
  }, null, 8, ["modelValue"]),
@@ -586,18 +589,18 @@ const W = () => {
586
589
  ])
587
590
  ]),
588
591
  g(Q, {
589
- loading: a(y).isLoading,
590
- "row-data": a(D),
591
- "row-count": a(y).totalRows,
592
+ loading: n(y).isLoading,
593
+ "row-data": n(D),
594
+ "row-count": n(y).totalRows,
592
595
  "column-defs": d.filter(
593
596
  (i) => !l.user || i.header !== "User" && i.header !== "Phone No."
594
597
  ),
595
- "page-count": a(y).pageCount,
596
- "page-index": a(y).pageIndex,
597
- "page-size": a(y).pageSize,
598
+ "page-count": n(y).pageCount,
599
+ "page-index": n(y).pageIndex,
600
+ "page-size": n(y).pageSize,
598
601
  "shrink-at": !1,
599
- onSortChange: a(I),
600
- onPageChange: n[6] || (n[6] = (i) => a(m)({
602
+ onSortChange: n(I),
603
+ onPageChange: a[6] || (a[6] = (i) => n(m)({
601
604
  pageSize: i.pageSize,
602
605
  pageIndex: i.pageIndex
603
606
  }))
@@ -746,16 +749,16 @@ const Ce = { class: "flex items-center justify-between" }, Re = { class: "flex g
746
749
  C("div", Ce, [
747
750
  C("div", Re, [
748
751
  g(ae, {
749
- modelValue: a(p).dateRange,
750
- "onUpdate:modelValue": u[0] || (u[0] = (f) => a(p).dateRange = f)
752
+ modelValue: n(p).dateRange,
753
+ "onUpdate:modelValue": u[0] || (u[0] = (f) => n(p).dateRange = f)
751
754
  }, null, 8, ["modelValue"])
752
755
  ]),
753
756
  C("div", Fe, [
754
757
  g(_, {
755
- modelValue: a(d).searchValue,
758
+ modelValue: n(d).searchValue,
756
759
  "onUpdate:modelValue": [
757
- u[1] || (u[1] = (f) => a(d).searchValue = f),
758
- a(I)
760
+ u[1] || (u[1] = (f) => n(d).searchValue = f),
761
+ n(I)
759
762
  ],
760
763
  placeholder: "Search",
761
764
  collapsible: ""
@@ -768,18 +771,18 @@ const Ce = { class: "flex items-center justify-between" }, Re = { class: "flex g
768
771
  ])
769
772
  ]),
770
773
  g(Q, {
771
- loading: a(d).isLoading,
772
- "row-data": a(r),
773
- "row-count": a(d).totalRows,
774
+ loading: n(d).isLoading,
775
+ "row-data": n(r),
776
+ "row-count": n(d).totalRows,
774
777
  "column-defs": l.filter(
775
778
  (f) => !s.user || f.header !== "User" && f.header !== "Phone No."
776
779
  ),
777
- "page-count": a(d).pageCount,
778
- "page-index": a(d).pageIndex,
779
- "page-size": a(d).pageSize,
780
+ "page-count": n(d).pageCount,
781
+ "page-index": n(d).pageIndex,
782
+ "page-size": n(d).pageSize,
780
783
  "shrink-at": !1,
781
- onSortChange: a(y),
782
- onPageChange: u[2] || (u[2] = (f) => a(D)({
784
+ onSortChange: n(y),
785
+ onPageChange: u[2] || (u[2] = (f) => n(D)({
783
786
  pageSize: f.pageSize,
784
787
  pageIndex: f.pageIndex
785
788
  }))
@@ -0,0 +1,139 @@
1
+ import { defineComponent as N, ref as C, computed as L, watch as E, resolveComponent as g, openBlock as o, createElementBlock as i, Fragment as y, toDisplayString as I, createCommentVNode as A, createElementVNode as M, createVNode as v, unref as u, renderList as b, createBlock as S, isRef as U, withCtx as F } from "vue";
2
+ import { b as T } from "./app-vzsH1VQf.js";
3
+ function j(l, s, n) {
4
+ return l.some(
5
+ n instanceof Function ? n : (a) => a === s
6
+ ) || l.push(s), l;
7
+ }
8
+ function q(l, s, n) {
9
+ return l.filter(
10
+ n instanceof Function ? (a) => !n(a) : (a) => a !== s
11
+ );
12
+ }
13
+ const D = {
14
+ key: 0,
15
+ class: "fm-typo-en-body-lg-400"
16
+ }, K = {
17
+ key: 1,
18
+ class: "space-y-4"
19
+ }, O = { key: 0 }, R = { key: 1 }, z = { key: 2 }, J = /* @__PURE__ */ N({
20
+ __name: "TargetLocationInput",
21
+ props: {
22
+ label: {
23
+ type: String
24
+ },
25
+ type: {
26
+ type: String,
27
+ default: "select"
28
+ },
29
+ modelValue: {
30
+ type: Object,
31
+ required: !0
32
+ }
33
+ },
34
+ emits: ["update:model-value"],
35
+ setup(l, { emit: s }) {
36
+ const n = T(), a = l, c = C(""), w = L(() => n.locations.filter(
37
+ (d) => {
38
+ var t;
39
+ return d.name.toLowerCase().includes(c.value.toLowerCase()) || ((t = d == null ? void 0 : d.code) == null ? void 0 : t.toLowerCase().includes(c.value.toLowerCase()));
40
+ }
41
+ )), p = s;
42
+ function k(d, t) {
43
+ const m = d ? j(a.modelValue || [], t.toString()) : q(
44
+ a.modelValue || n.locations.map((V) => V._id.toString()),
45
+ t.toString()
46
+ );
47
+ return p("update:model-value", m);
48
+ }
49
+ const r = C(!1), $ = L(() => {
50
+ var m, V;
51
+ const t = ((m = a.modelValue) == null ? void 0 : m.slice(0, 5).map((h) => {
52
+ var f;
53
+ return ((f = n.locationById(h)) == null ? void 0 : f.name) || h;
54
+ })) || [];
55
+ return a.modelValue && ((V = a.modelValue) == null ? void 0 : V.length) > 5 && t.push(`+${a.modelValue.length - 5} more`), t;
56
+ });
57
+ return E(r, (d) => {
58
+ d && (c.value = "");
59
+ }), (d, t) => {
60
+ const m = g("FmCheckbox"), V = g("FmChip"), h = g("FmField"), f = g("FmTextField"), B = g("FmMenu");
61
+ return o(), i(y, null, [
62
+ l.label ? (o(), i("div", D, I(l.label), 1)) : A("", !0),
63
+ l.type === "checkbox" ? (o(), i("div", K, [
64
+ M("div", null, [
65
+ v(m, {
66
+ value: null,
67
+ indeterminate: l.modelValue != null && l.modelValue.length > 0 && l.modelValue.length < u(n).locations.length,
68
+ label: "All locations",
69
+ "model-value": l.modelValue == null || l.modelValue.length === u(n).locations.length,
70
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => p("update:model-value", e ? null : []))
71
+ }, null, 8, ["indeterminate", "model-value"])
72
+ ]),
73
+ (o(!0), i(y, null, b(u(n).locations, (e) => (o(), i("div", {
74
+ key: e._id.toString()
75
+ }, [
76
+ v(m, {
77
+ value: e._id.toString(),
78
+ label: `${e.code ? `${e.code} - ` : ""} ${e.name}`,
79
+ "model-value": !l.modelValue || l.modelValue.includes(e._id.toString()),
80
+ "onUpdate:modelValue": (x) => k(x, e._id.toString())
81
+ }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"])
82
+ ]))), 128))
83
+ ])) : (o(), S(B, {
84
+ key: 2,
85
+ modelValue: u(r),
86
+ "onUpdate:modelValue": t[3] || (t[3] = (e) => U(r) ? r.value = e : null),
87
+ onMenuChanged: t[4] || (t[4] = (e) => r.value = e),
88
+ placement: "top-end"
89
+ }, {
90
+ "menu-button": F(() => [
91
+ v(h, {
92
+ "append-icon": u(r) ? "expand_more" : "expand_less",
93
+ class: "!h-auto"
94
+ }, {
95
+ default: F(() => [
96
+ !l.modelValue || l.modelValue.length == u(n).locations.length ? (o(), i("div", O, " All Locations ")) : l.modelValue.length ? (o(), i("div", z, [
97
+ (o(!0), i(y, null, b(u($), (e) => (o(), S(V, {
98
+ key: e,
99
+ label: e,
100
+ class: "max-w-[130px] text-ellipsis"
101
+ }, null, 8, ["label"]))), 128))
102
+ ])) : (o(), i("div", R, "No Locations"))
103
+ ]),
104
+ _: 1
105
+ }, 8, ["append-icon"])
106
+ ]),
107
+ default: F(() => [
108
+ v(f, {
109
+ modelValue: u(c),
110
+ "onUpdate:modelValue": t[1] || (t[1] = (e) => U(c) ? c.value = e : null),
111
+ placeholder: "Search locations",
112
+ class: "my-8"
113
+ }, null, 8, ["modelValue"]),
114
+ v(m, {
115
+ class: "my-8",
116
+ value: null,
117
+ indeterminate: l.modelValue != null && l.modelValue.length > 0 && l.modelValue.length < u(n).locations.length,
118
+ label: "All locations",
119
+ "model-value": l.modelValue == null || l.modelValue.length === u(n).locations.length,
120
+ "onUpdate:modelValue": t[2] || (t[2] = (e) => p("update:model-value", e ? null : []))
121
+ }, null, 8, ["indeterminate", "model-value"]),
122
+ (o(!0), i(y, null, b(u(w), (e) => (o(), S(m, {
123
+ class: "my-8",
124
+ key: e._id.toString(),
125
+ value: e._id.toString(),
126
+ label: `${e.code ? `${e.code} - ` : ""} ${e.name}`,
127
+ "model-value": !l.modelValue || l.modelValue.includes(e._id.toString()),
128
+ "onUpdate:modelValue": (x) => k(x, e._id.toString())
129
+ }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
130
+ ]),
131
+ _: 1
132
+ }, 8, ["modelValue"]))
133
+ ], 64);
134
+ };
135
+ }
136
+ });
137
+ export {
138
+ J as _
139
+ };