@lanaco/lnc-react-ui 4.0.74 → 4.0.75

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.
@@ -1,4 +1,4 @@
1
- import { jsx as t, jsxs as p, Fragment as G } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as u, Fragment as G } from "react/jsx-runtime";
2
2
  import { createElement as ae, useState as P, useEffect as j, forwardRef as V, useRef as Q, useImperativeHandle as ne, Suspense as se, memo as le, useMemo as ce } from "react";
3
3
  import { s as f } from "./emotion-styled.browser.esm-BNN1dTl3.js";
4
4
  import { a as z, l as X, m as ee } from "./utils-DCs-SbIv.js";
@@ -11,7 +11,7 @@ import { u as M } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
11
11
  import { u as re } from "./useDetectMobile-BC6EGaBc.js";
12
12
  import fe from "./FlexBox.js";
13
13
  import { I as Y } from "./index-Dhf4jQmS.js";
14
- import U from "./IconButton.js";
14
+ import L from "./IconButton.js";
15
15
  const me = f.div`
16
16
  cursor: pointer;
17
17
  display: flex;
@@ -238,31 +238,31 @@ const me = f.div`
238
238
  uuid: o,
239
239
  hasPermission: l = !0,
240
240
  isUser: a,
241
- image: u,
241
+ image: w,
242
242
  name: n,
243
- notifications: c = 0,
244
- color: w = "primary",
243
+ notifications: d = 0,
244
+ color: m = "primary",
245
245
  size: b = "large",
246
- style: D,
246
+ style: $,
247
247
  disabled: s,
248
- onSelect: d = () => {
248
+ onSelect: c = () => {
249
249
  },
250
250
  isActive: v,
251
251
  className: x,
252
252
  // new
253
- themeData: m
253
+ themeData: p
254
254
  } = e, C = {
255
255
  theme: M(),
256
- color: w,
256
+ color: m,
257
257
  size: b,
258
- style: D,
258
+ style: $,
259
259
  disabled: s
260
260
  };
261
261
  return /* @__PURE__ */ ae(
262
262
  be,
263
263
  {
264
- onClick: (r) => {
265
- r.stopPropagation(), l === !0 && (d == null || d());
264
+ onClick: (S) => {
265
+ S.stopPropagation(), l === !0 && (c == null || c());
266
266
  },
267
267
  ...C,
268
268
  key: n,
@@ -280,11 +280,11 @@ const me = f.div`
280
280
  opacity: 0
281
281
  },
282
282
  isActive: v,
283
- themeColor: (m == null ? void 0 : m.code) || "transparent"
283
+ themeColor: (p == null ? void 0 : p.code) || "transparent"
284
284
  },
285
- /* @__PURE__ */ t("div", { className: "logo-wrapper", children: u }),
285
+ /* @__PURE__ */ t("div", { className: "logo-wrapper", children: w }),
286
286
  /* @__PURE__ */ t("div", { className: "name", children: n }),
287
- c > 0 && /* @__PURE__ */ t("div", { className: "notifications-number", children: /* @__PURE__ */ t(he, { className: "badge", color: "danger", size: "small", children: c > 99 ? "99+" : c }) })
287
+ d > 0 && /* @__PURE__ */ t("div", { className: "notifications-number", children: /* @__PURE__ */ t(he, { className: "badge", color: "danger", size: "small", children: d > 99 ? "99+" : d }) })
288
288
  );
289
289
  };
290
290
  te.propTypes = {
@@ -317,24 +317,24 @@ const J = (e, o) => {
317
317
  const o = M(), {
318
318
  uuid: l,
319
319
  shopUuid: a,
320
- title: u = "",
320
+ title: w = "",
321
321
  description: n,
322
- badges: c,
323
- coverPhoto: w,
322
+ badges: d,
323
+ coverPhoto: m,
324
324
  onSelect: b,
325
- status: D,
325
+ status: $,
326
326
  startDate: s,
327
- endDate: d,
327
+ endDate: c,
328
328
  salesPackages: v,
329
329
  shopName: x,
330
- shopImage: m,
330
+ shopImage: p,
331
331
  onSelectCard: g = () => {
332
332
  },
333
333
  onSelectShop: C = () => {
334
334
  },
335
- campaignSingleText: r,
336
- salesCampaignTypes: $ = [],
337
- startsInPrefixTextPlural: S,
335
+ campaignSingleText: S,
336
+ salesCampaignTypes: r = [],
337
+ startsInPrefixTextPlural: D,
338
338
  startsinSuffixTextPlural: B,
339
339
  startsInPrefixTextSingular: N,
340
340
  startsinSuffixTextSingular: R,
@@ -342,33 +342,33 @@ const J = (e, o) => {
342
342
  ...W
343
343
  } = e, h = s ? new Date(s) <= /* @__PURE__ */ new Date() : !1;
344
344
  J(
345
- d ? new Date(d) : null,
345
+ c ? new Date(c) : null,
346
346
  s ? new Date(s) : null
347
347
  );
348
348
  const y = J(
349
349
  s ? new Date(s) : null,
350
350
  /* @__PURE__ */ new Date()
351
351
  );
352
- return /* @__PURE__ */ p(
352
+ return /* @__PURE__ */ u(
353
353
  me,
354
354
  {
355
355
  theme: o,
356
356
  onClick: g,
357
357
  ...W,
358
358
  children: [
359
- /* @__PURE__ */ p(pe, { theme: o, onClick: () => b == null ? void 0 : b(), children: [
360
- /* @__PURE__ */ t("img", { src: w }),
359
+ /* @__PURE__ */ u(pe, { theme: o, onClick: () => b == null ? void 0 : b(), children: [
360
+ /* @__PURE__ */ t("img", { src: m }),
361
361
  /* @__PURE__ */ t(xe, { children: v == null ? void 0 : v.map((I, A) => {
362
- var E, L;
362
+ var E, U;
363
363
  return /* @__PURE__ */ t(
364
364
  ye,
365
365
  {
366
- color: (E = $ == null ? void 0 : $.find((_) => _.value === I)) == null ? void 0 : E.color,
366
+ color: (E = r == null ? void 0 : r.find((_) => _.value === I)) == null ? void 0 : E.color,
367
367
  theme: o,
368
368
  children: /* @__PURE__ */ t(
369
369
  ge,
370
370
  {
371
- icon: (L = $ == null ? void 0 : $.find((_) => _.value === I)) == null ? void 0 : L.icon
371
+ icon: (U = r == null ? void 0 : r.find((_) => _.value === I)) == null ? void 0 : U.icon
372
372
  }
373
373
  )
374
374
  },
@@ -376,12 +376,12 @@ const J = (e, o) => {
376
376
  );
377
377
  }) })
378
378
  ] }),
379
- /* @__PURE__ */ p(ue, { theme: o, children: [
380
- /* @__PURE__ */ p("div", { className: "text-block-wrapper", children: [
381
- /* @__PURE__ */ p("div", { className: "title-block-wrapper", children: [
382
- /* @__PURE__ */ t("div", { className: "campaign-title", children: r }),
383
- /* @__PURE__ */ t("div", { className: "campaign-title-text", children: u }),
384
- /* @__PURE__ */ t("div", { className: "timestamp-text", children: h ? "" : y === 1 ? `${N} ${y} ${R}` : `${S} ${y} ${B}` })
379
+ /* @__PURE__ */ u(ue, { theme: o, children: [
380
+ /* @__PURE__ */ u("div", { className: "text-block-wrapper", children: [
381
+ /* @__PURE__ */ u("div", { className: "title-block-wrapper", children: [
382
+ /* @__PURE__ */ t("div", { className: "campaign-title", children: S }),
383
+ /* @__PURE__ */ t("div", { className: "campaign-title-text", children: w }),
384
+ /* @__PURE__ */ t("div", { className: "timestamp-text", children: h ? "" : y === 1 ? `${N} ${y} ${R}` : `${D} ${y} ${B}` })
385
385
  ] }),
386
386
  /* @__PURE__ */ t("div", { children: n })
387
387
  ] }),
@@ -399,8 +399,8 @@ const J = (e, o) => {
399
399
  /* @__PURE__ */ t(
400
400
  "img",
401
401
  {
402
- src: m,
403
- className: `${m ? "" : "no-image"}`
402
+ src: p,
403
+ className: `${p ? "" : "no-image"}`
404
404
  }
405
405
  )
406
406
  ),
@@ -559,34 +559,34 @@ const $e = f.div`
559
559
  const [l, a] = P({
560
560
  trigger: null,
561
561
  direction: null
562
- }), u = (n) => n.touches || n.originalEvent.touches;
562
+ }), w = (n) => n.touches || n.originalEvent.touches;
563
563
  return j(() => {
564
564
  const n = typeof e == "string" || e instanceof String ? document.getElementById(e) : e.current;
565
- let c = null, w = null;
565
+ let d = null, m = null;
566
566
  if (n) {
567
567
  const b = (s) => {
568
- const d = u(s)[0];
569
- c = d.clientX, w = d.clientY;
570
- }, D = (s) => {
571
- if (!c || !w)
568
+ const c = w(s)[0];
569
+ d = c.clientX, m = c.clientY;
570
+ }, $ = (s) => {
571
+ if (!d || !m)
572
572
  return;
573
- const d = s.touches[0].clientX, v = s.touches[0].clientY, x = c - d, m = w - v;
574
- Math.abs(x) > Math.abs(m) ? x > 0 ? a((g) => ({
573
+ const c = s.touches[0].clientX, v = s.touches[0].clientY, x = d - c, p = m - v;
574
+ Math.abs(x) > Math.abs(p) ? x > 0 ? a((g) => ({
575
575
  trigger: !g.trigger,
576
576
  direction: F.LEFT
577
577
  })) : a((g) => ({
578
578
  trigger: !g.trigger,
579
579
  direction: F.RIGHT
580
- })) : m > 0 ? a((g) => ({
580
+ })) : p > 0 ? a((g) => ({
581
581
  trigger: !g.trigger,
582
582
  direction: F.UP
583
583
  })) : a((g) => ({
584
584
  trigger: !g.trigger,
585
585
  direction: F.DOWN
586
- })), c = null, w = null;
586
+ })), d = null, m = null;
587
587
  };
588
- return n.addEventListener("touchstart", b), n.addEventListener("touchmove", D), () => {
589
- n.removeEventListener("touchstart", b), n.addEventListener("touchmove", D);
588
+ return n.addEventListener("touchstart", b), n.addEventListener("touchmove", $), () => {
589
+ n.removeEventListener("touchstart", b), n.addEventListener("touchmove", $);
590
590
  };
591
591
  }
592
592
  }, []), l;
@@ -601,22 +601,22 @@ const $e = f.div`
601
601
  columnGap: o = "2rem",
602
602
  rowGap: l = "1.25rem",
603
603
  scrollBySize: a = 300,
604
- wrapForMobile: u = !1,
604
+ wrapForMobile: w = !1,
605
605
  wrap: n = !1,
606
- children: c,
607
- methodsRef: w,
606
+ children: d,
607
+ methodsRef: m,
608
608
  arrowsVisibleOnHover: b = !0,
609
- rightAlignArrows: D = !1,
609
+ rightAlignArrows: $ = !1,
610
610
  padding: s = "0",
611
- showTimesBtn: d,
611
+ showTimesBtn: c,
612
612
  noArrows: v,
613
613
  onShowEnd: x,
614
- arrowsZIndex: m,
614
+ arrowsZIndex: p,
615
615
  ...g
616
616
  }, C) => {
617
- const r = re(), $ = M(), [S, B] = P(!1), [N, R] = P(!1), [H, W] = P(!0), h = Q(), y = Ce(h);
617
+ const S = re(), r = M(), [D, B] = P(!1), [N, R] = P(!1), [H, W] = P(!0), h = Q(), y = Ce(h);
618
618
  j(() => {
619
- (y == null ? void 0 : y.direction) === F.RIGHT && N !== !0 ? A() : (y == null ? void 0 : y.direction) === F.LEFT && S !== !0 && I();
619
+ (y == null ? void 0 : y.direction) === F.RIGHT && N !== !0 ? A() : (y == null ? void 0 : y.direction) === F.LEFT && D !== !0 && I();
620
620
  }, [y]);
621
621
  const I = () => {
622
622
  var k;
@@ -624,13 +624,13 @@ const $e = f.div`
624
624
  }, A = () => {
625
625
  var k;
626
626
  (k = h.current) == null || k.scrollBy(-a, 0);
627
- }, [E, L] = P(!1);
627
+ }, [E, U] = P(!1);
628
628
  j(() => {
629
629
  var k, Z;
630
- L(
630
+ U(
631
631
  ((k = h == null ? void 0 : h.current) == null ? void 0 : k.scrollWidth) > ((Z = h == null ? void 0 : h.current) == null ? void 0 : Z.clientWidth)
632
632
  );
633
- }, [c]), ne(w, () => ({
633
+ }, [d]), ne(m, () => ({
634
634
  scrollToEnd() {
635
635
  _();
636
636
  },
@@ -644,12 +644,12 @@ const $e = f.div`
644
644
  const _ = () => {
645
645
  h.current.scrollLeft = h.current.scrollWidth;
646
646
  };
647
- return /* @__PURE__ */ p($e, { arrowsZIndex: m, children: [
648
- /* @__PURE__ */ p(De, { children: [
647
+ return /* @__PURE__ */ u($e, { arrowsZIndex: p, children: [
648
+ /* @__PURE__ */ u(De, { children: [
649
649
  /* @__PURE__ */ t("div", { children: e }),
650
- /* @__PURE__ */ p("div", { className: "btns-group", children: [
650
+ /* @__PURE__ */ u("div", { className: "btns-group", children: [
651
651
  /* @__PURE__ */ t(
652
- U,
652
+ L,
653
653
  {
654
654
  borderRadius: "curved",
655
655
  btnType: "tinted",
@@ -661,13 +661,13 @@ const $e = f.div`
661
661
  }
662
662
  ),
663
663
  /* @__PURE__ */ t(
664
- U,
664
+ L,
665
665
  {
666
666
  borderRadius: "curved",
667
667
  btnType: "tinted",
668
668
  className: "scroll-arrow-right",
669
669
  color: "neutral",
670
- disabled: S,
670
+ disabled: D,
671
671
  icon: "angle-right",
672
672
  onClick: I
673
673
  }
@@ -675,7 +675,7 @@ const $e = f.div`
675
675
  ] })
676
676
  ] }),
677
677
  /* @__PURE__ */ t(
678
- U,
678
+ L,
679
679
  {
680
680
  borderRadius: "curved",
681
681
  btnType: "tinted",
@@ -687,13 +687,13 @@ const $e = f.div`
687
687
  }
688
688
  ),
689
689
  /* @__PURE__ */ t(
690
- U,
690
+ L,
691
691
  {
692
692
  borderRadius: "curved",
693
693
  btnType: "tinted",
694
694
  className: "hover-right-arrow scroll-arrow-right",
695
695
  color: "neutral",
696
- disabled: S,
696
+ disabled: D,
697
697
  icon: "angle-right",
698
698
  onClick: I
699
699
  }
@@ -706,18 +706,18 @@ const $e = f.div`
706
706
  hasOverflow: E,
707
707
  noArrows: v,
708
708
  padding: s,
709
- rightAlignArrows: D,
710
- showTimesBtn: d,
711
- theme: $,
709
+ rightAlignArrows: $,
710
+ showTimesBtn: c,
711
+ theme: r,
712
712
  ...g,
713
- children: /* @__PURE__ */ p(
713
+ children: /* @__PURE__ */ u(
714
714
  fe,
715
715
  {
716
716
  ref: h,
717
717
  className: "scrollable-container",
718
718
  columnGap: o,
719
719
  rowGap: l,
720
- wrap: n || u && r ? "Wrap" : "NoWrap",
720
+ wrap: n || w && S ? "Wrap" : "NoWrap",
721
721
  children: [
722
722
  /* @__PURE__ */ t(
723
723
  Y,
@@ -731,16 +731,16 @@ const $e = f.div`
731
731
  }
732
732
  }
733
733
  ),
734
- c,
734
+ d,
735
735
  /* @__PURE__ */ t(
736
736
  Y,
737
737
  {
738
738
  isHorizontal: !0,
739
739
  onIsNotVisible: () => {
740
- S === !0 && B(!1), W(!0);
740
+ D === !0 && B(!1), W(!0);
741
741
  },
742
742
  onIsVisible: () => {
743
- S === !1 && B(!0), W(!1), x == null || x();
743
+ D === !1 && B(!0), W(!1), x == null || x();
744
744
  }
745
745
  }
746
746
  ),
@@ -847,7 +847,7 @@ const Se = f.div`
847
847
  }
848
848
  `, Te = V(({}, e) => {
849
849
  const o = M();
850
- return /* @__PURE__ */ p(Ie, { ref: e, theme: o, children: [
850
+ return /* @__PURE__ */ u(Ie, { ref: e, theme: o, children: [
851
851
  /* @__PURE__ */ t("div", { className: "campaign__left-section", children: /* @__PURE__ */ t(
852
852
  K,
853
853
  {
@@ -857,13 +857,13 @@ const Se = f.div`
857
857
  borderRadius: "edged"
858
858
  }
859
859
  ) }),
860
- /* @__PURE__ */ p("div", { className: "campaign__right-section", children: [
861
- /* @__PURE__ */ p(Ne, { theme: o, children: [
860
+ /* @__PURE__ */ u("div", { className: "campaign__right-section", children: [
861
+ /* @__PURE__ */ u(Ne, { theme: o, children: [
862
862
  /* @__PURE__ */ t(O, { heightCoeff: 0.75, theme: o, width: "35%" }),
863
863
  /* @__PURE__ */ t(O, { heightCoeff: 1.25, theme: o }),
864
864
  /* @__PURE__ */ t(O, { heightCoeff: 3, theme: o })
865
865
  ] }),
866
- /* @__PURE__ */ p("div", { className: "campaign__user", children: [
866
+ /* @__PURE__ */ u("div", { className: "campaign__user", children: [
867
867
  /* @__PURE__ */ t(
868
868
  K,
869
869
  {
@@ -886,31 +886,33 @@ const Se = f.div`
886
886
  fallbackComponent: o = /* @__PURE__ */ t(G, {}),
887
887
  isLoading: l = !1,
888
888
  itemsCount: a = 5,
889
- keyPrefix: u
890
- }) => /* @__PURE__ */ t(se, { fallback: o, children: l === !0 ? /* @__PURE__ */ t(Ae, { itemsCount: a, keyPrefix: u }) : e }), Ee = le(oe), Ze = V(
889
+ keyPrefix: w
890
+ }) => /* @__PURE__ */ t(se, { fallback: o, children: l === !0 ? /* @__PURE__ */ t(Ae, { itemsCount: a, keyPrefix: w }) : e }), Ee = le(oe), Ze = V(
891
891
  ({
892
892
  sellerType: e = "Shop",
893
893
  items: o = [],
894
894
  title: l,
895
895
  isLoading: a,
896
- onSelectCard: u = () => {
896
+ onSelectCard: w = () => {
897
897
  },
898
898
  onSelectShop: n = () => {
899
899
  },
900
+ getImage: d = () => {
901
+ },
900
902
  // new
901
- customScrollSize: c,
902
- campaignSingleText: w,
903
- salesCampaignTypes: b = [],
904
- startsInPrefixTextPlural: D,
905
- startsinSuffixTextPlural: s,
906
- startsInPrefixTextSingular: d,
907
- startsinSuffixTextSingular: v
908
- }, x) => {
909
- const m = Q(), g = re(), C = ce(() => o == null ? void 0 : o.map((r, $) => /* @__PURE__ */ t(
903
+ customScrollSize: m,
904
+ campaignSingleText: b,
905
+ salesCampaignTypes: $ = [],
906
+ startsInPrefixTextPlural: s,
907
+ startsinSuffixTextPlural: c,
908
+ startsInPrefixTextSingular: v,
909
+ startsinSuffixTextSingular: x
910
+ }, p) => {
911
+ const g = Q(), C = re(), S = ce(() => o == null ? void 0 : o.map((r, D) => /* @__PURE__ */ t(
910
912
  Ee,
911
913
  {
912
914
  className: "campaign-item",
913
- coverPhoto: r == null ? void 0 : r.coverPhoto,
915
+ coverPhoto: () => d(r == null ? void 0 : r.coverPhoto, (r == null ? void 0 : r.uuid) || (r == null ? void 0 : r.campaignUuid)),
914
916
  description: r == null ? void 0 : r.description,
915
917
  endDate: r == null ? void 0 : r.endDate,
916
918
  salesPackages: r == null ? void 0 : r.salesPackages,
@@ -921,29 +923,29 @@ const Se = f.div`
921
923
  startDate: r == null ? void 0 : r.startDate,
922
924
  title: r == null ? void 0 : r.name,
923
925
  uuid: r == null ? void 0 : r.campaignUuid,
924
- onSelectCard: () => u(r == null ? void 0 : r.campaignUuid, r == null ? void 0 : r.shopUuid),
926
+ onSelectCard: () => w(r == null ? void 0 : r.campaignUuid, r == null ? void 0 : r.shopUuid),
925
927
  onSelectShop: () => n(r == null ? void 0 : r.shopUuid),
926
- campaignSingleText: w,
927
- salesCampaignTypes: b,
928
- startsInPrefixTextPlural: D,
929
- startsinSuffixTextPlural: s,
930
- startsInPrefixTextSingular: d,
931
- startsinSuffixTextSingular: v,
928
+ campaignSingleText: b,
929
+ salesCampaignTypes: $,
930
+ startsInPrefixTextPlural: s,
931
+ startsinSuffixTextPlural: c,
932
+ startsInPrefixTextSingular: v,
933
+ startsinSuffixTextSingular: x,
932
934
  themeData: r == null ? void 0 : r.themeData
933
935
  },
934
- `campaign__item__${$}__${r == null ? void 0 : r.startDate}___${r == null ? void 0 : r.endDate}`
936
+ `campaign__item__${D}__${r == null ? void 0 : r.startDate}___${r == null ? void 0 : r.endDate}`
935
937
  )), [o]);
936
- return /* @__PURE__ */ t(G, { children: (o == null ? void 0 : o.length) > 0 && /* @__PURE__ */ t(Se, { ref: x, className: "row-section-scroll", children: /* @__PURE__ */ t(
938
+ return /* @__PURE__ */ t(G, { children: (o == null ? void 0 : o.length) > 0 && /* @__PURE__ */ t(Se, { ref: p, className: "row-section-scroll", children: /* @__PURE__ */ t(
937
939
  ie,
938
940
  {
939
941
  arrowsVisibleOnHover: !1,
940
942
  columnGap: "0",
941
- methodsRef: m,
943
+ methodsRef: g,
942
944
  mobileHoverScrollButtons: !0,
943
945
  noArrows: !0,
944
946
  padding: "0.25rem 0",
945
947
  rightAlignArrows: !0,
946
- scrollBySize: g ? window.innerWidth : c > 0 ? c : window.innerWidth,
948
+ scrollBySize: C ? window.innerWidth : m > 0 ? m : window.innerWidth,
947
949
  showTimesBtn: !1,
948
950
  title: l,
949
951
  onShowEnd: () => {
@@ -955,7 +957,7 @@ const Se = f.div`
955
957
  isLoading: a,
956
958
  itemsCount: 2,
957
959
  keyPrefix: "sales-camp",
958
- children: C
960
+ children: S
959
961
  }
960
962
  )
961
963
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.74",
3
+ "version": "4.0.75",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [