beca-ui 0.1.6 → 0.1.8

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 (2) hide show
  1. package/dist/beca-ui.js +37 -25
  2. package/package.json +2 -2
package/dist/beca-ui.js CHANGED
@@ -57397,16 +57397,21 @@ function AWe(e) {
57397
57397
  }, r);
57398
57398
  }
57399
57399
  const WA = () => ({ t: IWe().t }), $We = (e) => {
57400
- const { t } = WA(), { applicationsCardData: n, data: r, title: a = t("Notifications") } = e, [i, o] = Yt(
57400
+ const { t } = WA(), {
57401
+ applicationsCardData: n,
57402
+ data: r,
57403
+ title: a = t("Notifications"),
57404
+ onClickNotificationItem: i
57405
+ } = e, [o, l] = Yt(
57401
57406
  []
57402
- ), [l, s] = Yt([]), [u, d] = Yt([]);
57407
+ ), [s, u] = Yt([]), [d, p] = Yt([]);
57403
57408
  mn(() => {
57404
- const v = [], y = [], b = [];
57405
- r.forEach((w) => {
57406
- w.type === "Chat" ? y.push(w) : v.push(w), w.isSeen !== !0 && b.push(w);
57407
- }), o(v), s(y), d(b);
57409
+ const y = [], b = [], w = [];
57410
+ r.forEach((S) => {
57411
+ S.type === "Chat" ? b.push(S) : y.push(S), S.isSeen !== !0 && w.push(S);
57412
+ }), l(y), u(b), p(w);
57408
57413
  }, [r]);
57409
- const p = [
57414
+ const v = [
57410
57415
  {
57411
57416
  key: "all",
57412
57417
  label: t("All"),
@@ -57414,12 +57419,13 @@ const WA = () => ({ t: IWe().t }), $We = (e) => {
57414
57419
  v9,
57415
57420
  {
57416
57421
  itemLayout: "horizontal",
57417
- dataSource: i,
57418
- renderItem: (v) => /* @__PURE__ */ L(
57422
+ dataSource: o,
57423
+ renderItem: (y) => /* @__PURE__ */ L(
57419
57424
  K_,
57420
57425
  {
57421
- item: v,
57422
- applicationsCardData: n
57426
+ item: y,
57427
+ applicationsCardData: n,
57428
+ onClickNotificationItem: i
57423
57429
  }
57424
57430
  )
57425
57431
  }
@@ -57430,18 +57436,19 @@ const WA = () => ({ t: IWe().t }), $We = (e) => {
57430
57436
  label: /* @__PURE__ */ pn("div", { children: [
57431
57437
  t("Unread"),
57432
57438
  " ",
57433
- /* @__PURE__ */ L(a9, { count: u.length })
57439
+ /* @__PURE__ */ L(a9, { count: d.length })
57434
57440
  ] }),
57435
57441
  children: /* @__PURE__ */ L("div", { className: "notification-popup-body", children: /* @__PURE__ */ L(
57436
57442
  v9,
57437
57443
  {
57438
57444
  itemLayout: "horizontal",
57439
- dataSource: u,
57440
- renderItem: (v) => /* @__PURE__ */ L(
57445
+ dataSource: d,
57446
+ renderItem: (y) => /* @__PURE__ */ L(
57441
57447
  K_,
57442
57448
  {
57443
- item: v,
57444
- applicationsCardData: n
57449
+ item: y,
57450
+ applicationsCardData: n,
57451
+ onClickNotificationItem: i
57445
57452
  }
57446
57453
  )
57447
57454
  }
@@ -57454,12 +57461,13 @@ const WA = () => ({ t: IWe().t }), $We = (e) => {
57454
57461
  v9,
57455
57462
  {
57456
57463
  itemLayout: "horizontal",
57457
- dataSource: l,
57458
- renderItem: (v) => /* @__PURE__ */ L(
57464
+ dataSource: s,
57465
+ renderItem: (y) => /* @__PURE__ */ L(
57459
57466
  K_,
57460
57467
  {
57461
- item: v,
57462
- applicationsCardData: n
57468
+ item: y,
57469
+ applicationsCardData: n,
57470
+ onClickNotificationItem: i
57463
57471
  }
57464
57472
  )
57465
57473
  }
@@ -57468,15 +57476,18 @@ const WA = () => ({ t: IWe().t }), $We = (e) => {
57468
57476
  ];
57469
57477
  return /* @__PURE__ */ pn("div", { className: "notification-popup", children: [
57470
57478
  /* @__PURE__ */ L("div", { className: "notification-popup-header", children: /* @__PURE__ */ L("div", { className: "notification-popup-header__title", children: a }) }),
57471
- /* @__PURE__ */ L(vit, { defaultActiveKey: "1", items: p })
57479
+ /* @__PURE__ */ L(vit, { defaultActiveKey: "1", items: v })
57472
57480
  ] });
57473
57481
  }, K_ = (e) => {
57474
- var r, a;
57475
- const { applicationsCardData: t, item: n } = e;
57482
+ var a, i;
57483
+ const { applicationsCardData: t, item: n, onClickNotificationItem: r } = e;
57476
57484
  return /* @__PURE__ */ L(
57477
57485
  v9.Item,
57478
57486
  {
57479
57487
  className: "notification-item" + (n.isSeen ? " is-read" : ""),
57488
+ onClick: () => {
57489
+ r && r(n);
57490
+ },
57480
57491
  children: /* @__PURE__ */ L("a", { href: n.url ?? "#", children: /* @__PURE__ */ L(
57481
57492
  v9.Item.Meta,
57482
57493
  {
@@ -57486,7 +57497,7 @@ const WA = () => ({ t: IWe().t }), $We = (e) => {
57486
57497
  "img",
57487
57498
  {
57488
57499
  className: "notification-item__icon",
57489
- src: (a = (r = t.find((i) => i.appId === n.type)) == null ? void 0 : r.image) == null ? void 0 : a.toString()
57500
+ src: (i = (a = t.find((o) => o.appId === n.type)) == null ? void 0 : a.image) == null ? void 0 : i.toString()
57490
57501
  }
57491
57502
  ),
57492
57503
  n.from
@@ -61322,7 +61333,8 @@ const JK = "https://library.becawork.vn/api/PublicLibrary/ViewFile/gfregdblvwd7l
61322
61333
  const ae = await KK.get(ee.getApi, {
61323
61334
  headers: {
61324
61335
  "Content-Type": "application/json"
61325
- }
61336
+ },
61337
+ params: ee.params
61326
61338
  });
61327
61339
  ae.status === 200 && ae.data && Number(ae.data) === 1 && (B(!0), document.body.classList.add("dark-theme"));
61328
61340
  }, W = async (ee) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beca-ui",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Becawork UI",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -111,4 +111,4 @@
111
111
  "**/*.css"
112
112
  ],
113
113
  "packageManager": "yarn@3.6.4"
114
- }
114
+ }