mimir-ui-kit 1.38.11 → 1.38.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- ._container_15wir_3{--pagination-active: #e5e5e5;display:flex;gap:var(--mimir-space-2xl);justify-content:center;margin:0 auto}._container_15wir_3:not(:last-child){margin-bottom:0 auto var(--mimir-space-xl)}@media (max-width: 767.9px){._container_15wir_3{gap:var(--mimir-space-xs)}}._container_15wir_3 ._pagination-button_15wir_18{display:flex;align-items:center;justify-content:center;width:40px;height:40px;color:var(--black-100);font-size:var(--mimir-size-text-l);font-family:var(--mimir-font-inter);border-radius:var(--mimir-control-radius);font-feature-settings:"zero"}._container_15wir_3 ._pagination-button_15wir_18:active{background-color:var(--pagination-active)}._container_15wir_3 ._pagination-button_15wir_18:focus-visible,._container_15wir_3 ._pagination-button_15wir_18:hover{color:var(--sapphire-normal);-webkit-text-decoration:none;text-decoration:none}._container_15wir_3 ._pagination-button_15wir_18._is-active_15wir_37{background-color:var(--pagination-active)}._container_15wir_3 ._ellipsis_15wir_40{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}
1
+ ._container_1pfd2_3{--pagination-active: #e5e5e5;display:flex;gap:var(--mimir-space-2xl);justify-content:center;margin:0 auto}._container_1pfd2_3:not(:last-child){margin-bottom:0 auto var(--mimir-space-xl)}@media (max-width: 767.9px){._container_1pfd2_3{gap:var(--mimir-space-xs)}}._container_1pfd2_3 ._pagination-button_1pfd2_18{display:flex;align-items:center;justify-content:center;width:40px;height:40px;color:var(--black-100);font-weight:var(--mimir-font-weight-text-regular);font-size:var(--mimir-size-text-l);font-family:var(--mimir-font-inter);background-color:transparent;border-radius:var(--mimir-control-radius);font-feature-settings:"zero"}._container_1pfd2_3 ._pagination-button_1pfd2_18:active{background-color:var(--pagination-active)}._container_1pfd2_3 ._pagination-button_1pfd2_18:focus-visible,._container_1pfd2_3 ._pagination-button_1pfd2_18:hover{color:var(--sapphire-normal);-webkit-text-decoration:none;text-decoration:none}._container_1pfd2_3 ._pagination-button_1pfd2_18._is-active_1pfd2_39{background-color:var(--pagination-active)}._container_1pfd2_3 ._ellipsis_1pfd2_42{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}
@@ -1,16 +1,16 @@
1
1
  import { jsxs as P, jsx as i } from "react/jsx-runtime";
2
- import { c as k } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as N, useState as w, useEffect as v } from "react";
4
- import { FIRST_PAGE_NUMBER as u, DEFAULT_PER_PAGE as A } from "./constants.js";
5
- import { useWindowSize as E } from "../../hooks/useWindowSize/index.js";
6
- import { MergedButton as _ } from "../MergedButton/MergedButton.js";
7
- import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellipsis_15wir_40", C = {
8
- container: x,
9
- "pagination-button": "_pagination-button_15wir_18",
10
- "is-active": "_is-active_15wir_37",
11
- ellipsis: j
2
+ import { c as _ } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as N, useState as v, useEffect as A } from "react";
4
+ import { FIRST_PAGE_NUMBER as u, DEFAULT_PER_PAGE as E } from "./constants.js";
5
+ import { useWindowSize as x } from "../../hooks/useWindowSize/index.js";
6
+ import { MergedButton as g } from "../MergedButton/MergedButton.js";
7
+ import '../../assets/Pagination.css';const j = "_container_1pfd2_3", w = "_ellipsis_1pfd2_42", C = {
8
+ container: j,
9
+ "pagination-button": "_pagination-button_1pfd2_18",
10
+ "is-active": "_is-active_1pfd2_39",
11
+ ellipsis: w
12
12
  }, B = ({ currentPageNumber: t, onClick: n, setCurrentPage: o }) => /* @__PURE__ */ i(
13
- _,
13
+ g,
14
14
  {
15
15
  buttons: [
16
16
  {
@@ -30,31 +30,31 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
30
30
  onClick: o,
31
31
  setCurrentPage: s
32
32
  }) => {
33
- const r = t >= n;
33
+ const a = t >= n;
34
34
  return /* @__PURE__ */ i(
35
- _,
35
+ g,
36
36
  {
37
37
  buttons: [
38
38
  {
39
39
  isIconButton: !0,
40
40
  variant: "white",
41
41
  onClick: () => {
42
- r || (s(t + 1), o(t + 1));
42
+ a || (s(t + 1), o(t + 1));
43
43
  },
44
- disabled: r,
44
+ disabled: a,
45
45
  iconName: "ArrowRight16px"
46
46
  }
47
47
  ]
48
48
  }
49
49
  );
50
- }, g = () => /* @__PURE__ */ i(
51
- _,
50
+ }, k = () => /* @__PURE__ */ i(
51
+ g,
52
52
  {
53
53
  buttons: [
54
54
  {
55
55
  children: "...",
56
- variant: "gray",
57
- className: C.ellipsis
56
+ variant: "transparent",
57
+ className: _(C["pagination-button"], C.ellipsis)
58
58
  }
59
59
  ]
60
60
  }
@@ -64,16 +64,16 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
64
64
  onClick: o,
65
65
  setCurrentPage: s
66
66
  }) => {
67
- const r = t === n, a = () => {
67
+ const a = t === n, r = () => {
68
68
  s(n), o(n);
69
69
  }, e = n < 10 ? `0${n}` : n;
70
70
  return /* @__PURE__ */ i(
71
71
  "button",
72
72
  {
73
73
  type: "button",
74
- onClick: a,
75
- className: k(C["pagination-button"], {
76
- [C["is-active"]]: r
74
+ onClick: r,
75
+ className: _(C["pagination-button"], {
76
+ [C["is-active"]]: a
77
77
  }),
78
78
  children: e
79
79
  }
@@ -83,43 +83,43 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
83
83
  end: n,
84
84
  currentPageNumber: o,
85
85
  onClick: s,
86
- setCurrentPage: r
86
+ setCurrentPage: a
87
87
  }) => {
88
- const a = [];
88
+ const r = [];
89
89
  for (let e = t; e <= n; e++)
90
- a.push(
90
+ r.push(
91
91
  /* @__PURE__ */ i(
92
92
  h,
93
93
  {
94
94
  currentPageNumber: o,
95
- setCurrentPage: r,
95
+ setCurrentPage: a,
96
96
  newPageNumber: e,
97
97
  onClick: s
98
98
  },
99
99
  e
100
100
  )
101
101
  );
102
- return a;
103
- }, T = N(
102
+ return r;
103
+ }, U = N(
104
104
  (t, n) => {
105
105
  const {
106
106
  rootClassName: o,
107
107
  total: s,
108
- perPage: r = A,
109
- currentPageNumber: a = u,
108
+ perPage: a = E,
109
+ currentPageNumber: r = u,
110
110
  onChange: e
111
- } = t, [c, m] = w(a), l = Math.ceil(s / r), { width: b } = E(), d = b <= 650 ? 2 : 4;
112
- let p = 0, f = 0;
113
- return v(() => {
114
- m(a);
115
- }, [a]), c <= d ? (p = u, f = Math.min(
116
- u + d,
111
+ } = t, [c, d] = v(r), l = Math.ceil(s / a), { width: b } = x(), p = b <= 650 ? 2 : 4;
112
+ let m = 0, f = 0;
113
+ return A(() => {
114
+ d(r);
115
+ }, [r]), c <= p ? (m = u, f = Math.min(
116
+ u + p,
117
117
  l
118
- )) : c > l - d ? (p = l - d, f = l) : (p = c - d / 2, f = c + d / 2), s <= r ? null : /* @__PURE__ */ P(
118
+ )) : c > l - p ? (m = l - p, f = l) : (m = c - p / 2, f = c + p / 2), s <= a ? null : /* @__PURE__ */ P(
119
119
  "nav",
120
120
  {
121
121
  "aria-label": "Постраничная навигация",
122
- className: k(C.container, o),
122
+ className: _(C.container, o),
123
123
  ref: n,
124
124
  children: [
125
125
  /* @__PURE__ */ i(
@@ -127,33 +127,33 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
127
127
  {
128
128
  currentPageNumber: c,
129
129
  onClick: e,
130
- setCurrentPage: m
130
+ setCurrentPage: d
131
131
  }
132
132
  ),
133
- p > u && /* @__PURE__ */ i(
133
+ m > u && /* @__PURE__ */ i(
134
134
  h,
135
135
  {
136
136
  newPageNumber: u,
137
137
  currentPageNumber: c,
138
138
  onClick: e,
139
- setCurrentPage: m
139
+ setCurrentPage: d
140
140
  }
141
141
  ),
142
- p > u + 1 && /* @__PURE__ */ i(g, {}),
142
+ m > u + 1 && /* @__PURE__ */ i(k, {}),
143
143
  R({
144
- start: p,
144
+ start: m,
145
145
  end: f,
146
146
  currentPageNumber: c,
147
- setCurrentPage: m,
147
+ setCurrentPage: d,
148
148
  onClick: e
149
149
  }),
150
- f < l - 1 && /* @__PURE__ */ i(g, {}),
150
+ f < l - 1 && /* @__PURE__ */ i(k, {}),
151
151
  f < l && /* @__PURE__ */ i(
152
152
  h,
153
153
  {
154
154
  newPageNumber: l,
155
155
  currentPageNumber: c,
156
- setCurrentPage: m,
156
+ setCurrentPage: d,
157
157
  onClick: e
158
158
  }
159
159
  ),
@@ -161,7 +161,7 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
161
161
  I,
162
162
  {
163
163
  currentPageNumber: c,
164
- setCurrentPage: m,
164
+ setCurrentPage: d,
165
165
  lastPageNumber: l,
166
166
  onClick: e
167
167
  }
@@ -172,5 +172,5 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
172
172
  }
173
173
  );
174
174
  export {
175
- T as Pagination
175
+ U as Pagination
176
176
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.38.11",
4
+ "version": "1.38.12",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {