mimir-ui-kit 1.43.6 → 1.43.7

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.
@@ -53,7 +53,7 @@ type TProps = {
53
53
  /**
54
54
  * Функция, которая будет вызвана при клике на слайд.
55
55
  */
56
- onSlideClick?: VoidFunction;
56
+ onSlideClick?: (slide: TPromoSlide) => void;
57
57
  };
58
58
  export declare const PromoSlider: ({ slides, onSlideClick, delay, spaceBetween, imageClassName, slideClassName, swiperClassName, contentClassName }: TProps) => import("react/jsx-runtime").JSX.Element;
59
59
  export {};
@@ -1,20 +1,20 @@
1
- import { jsxs as Y, jsx as L, Fragment as F } from "react/jsx-runtime";
2
- import { c as C } from "../../index-DIxK0V-G.js";
1
+ import { jsxs as Y, jsx as k, Fragment as F } from "react/jsx-runtime";
2
+ import { c as H } from "../../index-DIxK0V-G.js";
3
3
  import { useState as j } from "react";
4
- import { g as R, b as G, e as U, c as $, n as B, d as A, S as q, A as Z, a as J } from "../../swiper-react-BvAw14a4.js";
4
+ import { g as R, b as G, e as U, c as $, n as B, d as S, S as q, A as Z, a as J } from "../../swiper-react-BvAw14a4.js";
5
5
  import { Chip as Q } from "../Chip/Chip.js";
6
6
  import { AppImage as ee } from "../Image/Image.js";
7
7
  import '../../assets/PromoSlider.css';function te(P) {
8
8
  let {
9
9
  swiper: e,
10
- extendParams: k,
10
+ extendParams: L,
11
11
  on: T,
12
12
  emit: x
13
13
  } = P;
14
14
  const p = R(), v = G();
15
15
  e.keyboard = {
16
16
  enabled: !1
17
- }, k({
17
+ }, L({
18
18
  keyboard: {
19
19
  enabled: !1,
20
20
  onlyInViewport: !0,
@@ -28,12 +28,12 @@ import '../../assets/PromoSlider.css';function te(P) {
28
28
  } = e;
29
29
  let o = n;
30
30
  o.originalEvent && (o = o.originalEvent);
31
- const g = o.keyCode || o.charCode, H = e.params.keyboard.pageUpDown, b = H && g === 33, _ = H && g === 34, y = g === 37, M = g === 39, t = g === 38, s = g === 40;
31
+ const g = o.keyCode || o.charCode, C = e.params.keyboard.pageUpDown, b = C && g === 33, _ = C && g === 34, y = g === 37, M = g === 39, t = g === 38, s = g === 40;
32
32
  if (!e.allowSlideNext && (e.isHorizontal() && M || e.isVertical() && s || _) || !e.allowSlidePrev && (e.isHorizontal() && y || e.isVertical() && t || b))
33
33
  return !1;
34
34
  if (!(o.shiftKey || o.altKey || o.ctrlKey || o.metaKey) && !(p.activeElement && p.activeElement.nodeName && (p.activeElement.nodeName.toLowerCase() === "input" || p.activeElement.nodeName.toLowerCase() === "textarea"))) {
35
35
  if (e.params.keyboard.onlyInViewport && (b || _ || y || M || t || s)) {
36
- let N = !1;
36
+ let A = !1;
37
37
  if (U(e.el, `.${e.params.slideClass}, swiper-slide`).length > 0 && U(e.el, `.${e.params.slideActiveClass}`).length === 0)
38
38
  return;
39
39
  const w = e.el, m = w.clientWidth, d = w.clientHeight, a = v.innerWidth, f = v.innerHeight, l = $(w);
@@ -43,10 +43,10 @@ import '../../assets/PromoSlider.css';function te(P) {
43
43
  const c = D[r];
44
44
  if (c[0] >= 0 && c[0] <= a && c[1] >= 0 && c[1] <= f) {
45
45
  if (c[0] === 0 && c[1] === 0) continue;
46
- N = !0;
46
+ A = !0;
47
47
  }
48
48
  }
49
- if (!N) return;
49
+ if (!A) return;
50
50
  }
51
51
  e.isHorizontal() ? ((b || _ || y || M) && (o.preventDefault ? o.preventDefault() : o.returnValue = !1), ((_ || M) && !u || (b || y) && u) && e.slideNext(), ((b || y) && !u || (_ || M) && u) && e.slidePrev()) : ((b || _ || t || s) && (o.preventDefault ? o.preventDefault() : o.returnValue = !1), (_ || s) && e.slideNext(), (b || t) && e.slidePrev()), x("keyPress", g);
52
52
  }
@@ -69,12 +69,12 @@ import '../../assets/PromoSlider.css';function te(P) {
69
69
  function ne(P) {
70
70
  let {
71
71
  swiper: e,
72
- extendParams: k,
72
+ extendParams: L,
73
73
  on: T,
74
74
  emit: x
75
75
  } = P;
76
76
  const p = G();
77
- k({
77
+ L({
78
78
  mousewheel: {
79
79
  enabled: !1,
80
80
  releaseOnEdges: !1,
@@ -89,7 +89,7 @@ function ne(P) {
89
89
  }), e.mousewheel = {
90
90
  enabled: !1
91
91
  };
92
- let v, I = A(), h;
92
+ let v, I = S(), h;
93
93
  const i = [];
94
94
  function n(t) {
95
95
  let m = 0, d = 0, a = 0, f = 0;
@@ -107,9 +107,9 @@ function ne(P) {
107
107
  e.enabled && (e.mouseEntered = !1);
108
108
  }
109
109
  function g(t) {
110
- return e.params.mousewheel.thresholdDelta && t.delta < e.params.mousewheel.thresholdDelta || e.params.mousewheel.thresholdTime && A() - I < e.params.mousewheel.thresholdTime ? !1 : t.delta >= 6 && A() - I < 60 ? !0 : (t.direction < 0 ? (!e.isEnd || e.params.loop) && !e.animating && (e.slideNext(), x("scroll", t.raw)) : (!e.isBeginning || e.params.loop) && !e.animating && (e.slidePrev(), x("scroll", t.raw)), I = new p.Date().getTime(), !1);
110
+ return e.params.mousewheel.thresholdDelta && t.delta < e.params.mousewheel.thresholdDelta || e.params.mousewheel.thresholdTime && S() - I < e.params.mousewheel.thresholdTime ? !1 : t.delta >= 6 && S() - I < 60 ? !0 : (t.direction < 0 ? (!e.isEnd || e.params.loop) && !e.animating && (e.slideNext(), x("scroll", t.raw)) : (!e.isBeginning || e.params.loop) && !e.animating && (e.slidePrev(), x("scroll", t.raw)), I = new p.Date().getTime(), !1);
111
111
  }
112
- function H(t) {
112
+ function C(t) {
113
113
  const s = e.params.mousewheel;
114
114
  if (t.direction < 0) {
115
115
  if (e.isEnd && !e.params.loop && s.releaseOnEdges)
@@ -119,7 +119,7 @@ function ne(P) {
119
119
  return !1;
120
120
  }
121
121
  function b(t) {
122
- let s = t, N = !0;
122
+ let s = t, A = !0;
123
123
  if (!e.enabled || t.target.closest(`.${e.params.mousewheel.noMousewheelClass}`)) return;
124
124
  const w = e.params.mousewheel;
125
125
  e.params.cssMode && s.preventDefault();
@@ -141,28 +141,28 @@ function ne(P) {
141
141
  if (a === 0) return !0;
142
142
  w.invert && (a = -a);
143
143
  let D = e.getTranslate() + a * w.sensitivity;
144
- if (D >= e.minTranslate() && (D = e.minTranslate()), D <= e.maxTranslate() && (D = e.maxTranslate()), N = e.params.loop ? !0 : !(D === e.minTranslate() || D === e.maxTranslate()), N && e.params.nested && s.stopPropagation(), !e.params.freeMode || !e.params.freeMode.enabled) {
144
+ if (D >= e.minTranslate() && (D = e.minTranslate()), D <= e.maxTranslate() && (D = e.maxTranslate()), A = e.params.loop ? !0 : !(D === e.minTranslate() || D === e.maxTranslate()), A && e.params.nested && s.stopPropagation(), !e.params.freeMode || !e.params.freeMode.enabled) {
145
145
  const r = {
146
- time: A(),
146
+ time: S(),
147
147
  delta: Math.abs(a),
148
148
  direction: Math.sign(a),
149
149
  raw: t
150
150
  };
151
151
  i.length >= 2 && i.shift();
152
152
  const c = i.length ? i[i.length - 1] : void 0;
153
- if (i.push(r), c ? (r.direction !== c.direction || r.delta > c.delta || r.time > c.time + 150) && g(r) : g(r), H(r))
153
+ if (i.push(r), c ? (r.direction !== c.direction || r.delta > c.delta || r.time > c.time + 150) && g(r) : g(r), C(r))
154
154
  return !0;
155
155
  } else {
156
156
  const r = {
157
- time: A(),
157
+ time: S(),
158
158
  delta: Math.abs(a),
159
159
  direction: Math.sign(a)
160
160
  }, c = h && r.time < h.time + 500 && r.delta <= h.delta && r.direction === h.direction;
161
161
  if (!c) {
162
162
  h = void 0;
163
- let S = e.getTranslate() + a * w.sensitivity;
163
+ let N = e.getTranslate() + a * w.sensitivity;
164
164
  const W = e.isBeginning, K = e.isEnd;
165
- if (S >= e.minTranslate() && (S = e.minTranslate()), S <= e.maxTranslate() && (S = e.maxTranslate()), e.setTransition(0), e.setTranslate(S), e.updateProgress(), e.updateActiveIndex(), e.updateSlidesClasses(), (!W && e.isBeginning || !K && e.isEnd) && e.updateSlidesClasses(), e.params.loop && e.loopFix({
165
+ if (N >= e.minTranslate() && (N = e.minTranslate()), N <= e.maxTranslate() && (N = e.maxTranslate()), e.setTransition(0), e.setTranslate(N), e.updateProgress(), e.updateActiveIndex(), e.updateSlidesClasses(), (!W && e.isBeginning || !K && e.isEnd) && e.updateSlidesClasses(), e.params.loop && e.loopFix({
166
166
  direction: r.direction < 0 ? "next" : "prev",
167
167
  byMousewheel: !0
168
168
  }), e.params.freeMode.sticky) {
@@ -180,7 +180,7 @@ function ne(P) {
180
180
  h = r, i.splice(0), e.slideToClosest(e.params.speed, !0, void 0, 0.5);
181
181
  }, 500));
182
182
  }
183
- if (c || x("scroll", s), e.params.autoplay && e.params.autoplayDisableOnInteraction && e.autoplay.stop(), w.releaseOnEdges && (S === e.minTranslate() || S === e.maxTranslate()))
183
+ if (c || x("scroll", s), e.params.autoplay && e.params.autoplayDisableOnInteraction && e.autoplay.stop(), w.releaseOnEdges && (N === e.minTranslate() || N === e.maxTranslate()))
184
184
  return !0;
185
185
  }
186
186
  }
@@ -217,12 +217,12 @@ const ae = "_swiper_f3z07_2", se = "_slide_f3z07_7", re = "_image_f3z07_14", ie
217
217
  "bullet-s": "_bullet-s_f3z07_48",
218
218
  "bullet-xs": "_bullet-xs_f3z07_49"
219
219
  }, V = 5, fe = 5e3, ue = 8, de = (P, e) => {
220
- const k = e % V, T = Math.abs(P - k), x = 0, p = 1;
220
+ const L = e % V, T = Math.abs(P - L), x = 0, p = 1;
221
221
  return T === x ? E["bullet-active"] : T === p ? E["bullet-s"] : E["bullet-xs"];
222
222
  }, be = ({
223
223
  slides: P,
224
224
  onSlideClick: e,
225
- delay: k = fe,
225
+ delay: L = fe,
226
226
  spaceBetween: T = ue,
227
227
  imageClassName: x,
228
228
  slideClassName: p,
@@ -243,24 +243,24 @@ const ae = "_swiper_f3z07_2", se = "_slide_f3z07_7", re = "_image_f3z07_14", ie
243
243
  enabled: !0
244
244
  },
245
245
  autoplay: {
246
- delay: k,
246
+ delay: L,
247
247
  disableOnInteraction: !1,
248
248
  pauseOnMouseEnter: !0
249
249
  },
250
- className: C(E.swiper, v),
250
+ className: H(E.swiper, v),
251
251
  children: [
252
252
  P.map((n) => {
253
253
  if (!n) return null;
254
- const u = n != null && n.imageUrl ? /* @__PURE__ */ L(
254
+ const u = n != null && n.imageUrl ? /* @__PURE__ */ k(
255
255
  ee,
256
256
  {
257
- className: C(E.image, x),
257
+ className: H(E.image, x),
258
258
  src: n.imageUrl,
259
259
  desktopImage: n.imageDesktop,
260
260
  mobileImage: n.imageMobile,
261
261
  alt: n.title
262
262
  }
263
- ) : null, o = /* @__PURE__ */ L(
263
+ ) : null, o = /* @__PURE__ */ k(
264
264
  "a",
265
265
  {
266
266
  className: E.link,
@@ -270,35 +270,35 @@ const ae = "_swiper_f3z07_2", se = "_slide_f3z07_7", re = "_image_f3z07_14", ie
270
270
  children: u
271
271
  }
272
272
  ), g = () => n.url ? o : u;
273
- return /* @__PURE__ */ L(
273
+ return /* @__PURE__ */ k(
274
274
  J,
275
275
  {
276
- onClick: e,
277
- className: C(E.slide, p),
276
+ onClick: () => e == null ? void 0 : e(n),
277
+ className: H(E.slide, p),
278
278
  children: /* @__PURE__ */ Y(F, { children: [
279
- n.isPromotion && /* @__PURE__ */ L(
279
+ n.isPromotion && /* @__PURE__ */ k(
280
280
  Q,
281
281
  {
282
282
  ...n.promotionProps,
283
- className: C(
283
+ className: H(
284
284
  n.promotionProps.className,
285
285
  E.chip
286
286
  )
287
287
  }
288
288
  ),
289
289
  g(),
290
- (n == null ? void 0 : n.content) && /* @__PURE__ */ L("div", { className: C(E.content, I), children: n == null ? void 0 : n.content })
290
+ (n == null ? void 0 : n.content) && /* @__PURE__ */ k("div", { className: H(E.content, I), children: n == null ? void 0 : n.content })
291
291
  ] })
292
292
  },
293
293
  n.id
294
294
  );
295
295
  }),
296
- /* @__PURE__ */ L("div", { className: E["custom-pagination"], children: Array.from({ length: V }).map((n, u) => /* @__PURE__ */ L(
296
+ /* @__PURE__ */ k("div", { className: E["custom-pagination"], children: Array.from({ length: V }).map((n, u) => /* @__PURE__ */ k(
297
297
  "button",
298
298
  {
299
299
  tabIndex: u,
300
300
  type: "button",
301
- className: C(E.bullet, de(u, h))
301
+ className: H(E.bullet, de(u, h))
302
302
  },
303
303
  u
304
304
  )) })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.43.6",
4
+ "version": "1.43.7",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {