mimir-ui-kit 1.38.11 → 1.38.13
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
._container_grwbf_3{--pagination-active: #e5e5e5;display:flex;gap:var(--mimir-space-2xl);justify-content:center;margin:0 auto}._container_grwbf_3:not(:last-child){margin-bottom:0 auto var(--mimir-space-xl)}@media (max-width: 767.9px){._container_grwbf_3{gap:var(--mimir-space-xs)}}._container_grwbf_3 ._pagination-button_grwbf_18{display:flex;align-items:center;justify-content:center;width:40px;height:40px;color:var(--black-100);font-weight:var(--mimir-font-weight-text-medium);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_grwbf_3 ._pagination-button_grwbf_18:active{background-color:var(--pagination-active)}._container_grwbf_3 ._pagination-button_grwbf_18:focus-visible,._container_grwbf_3 ._pagination-button_grwbf_18:hover{color:var(--sapphire-normal);-webkit-text-decoration:none;text-decoration:none}._container_grwbf_3 ._pagination-button_grwbf_18._is-active_grwbf_39{background-color:var(--pagination-active)}._container_grwbf_3 ._ellipsis_grwbf_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
|
2
|
+
import { c as C } from "../../index-DIxK0V-G.js";
|
3
3
|
import { forwardRef as N, useState as w, useEffect as v } from "react";
|
4
4
|
import { FIRST_PAGE_NUMBER as u, DEFAULT_PER_PAGE as A } from "./constants.js";
|
5
5
|
import { useWindowSize as E } from "../../hooks/useWindowSize/index.js";
|
6
|
-
import { MergedButton as
|
7
|
-
import '../../assets/Pagination.css';const x = "
|
6
|
+
import { MergedButton as h } from "../MergedButton/MergedButton.js";
|
7
|
+
import '../../assets/Pagination.css';const x = "_container_grwbf_3", j = "_ellipsis_grwbf_42", g = {
|
8
8
|
container: x,
|
9
|
-
"pagination-button": "_pagination-
|
10
|
-
"is-active": "_is-
|
9
|
+
"pagination-button": "_pagination-button_grwbf_18",
|
10
|
+
"is-active": "_is-active_grwbf_39",
|
11
11
|
ellipsis: j
|
12
12
|
}, B = ({ currentPageNumber: t, onClick: n, setCurrentPage: o }) => /* @__PURE__ */ i(
|
13
|
-
|
13
|
+
h,
|
14
14
|
{
|
15
15
|
buttons: [
|
16
16
|
{
|
@@ -30,50 +30,50 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
|
|
30
30
|
onClick: o,
|
31
31
|
setCurrentPage: s
|
32
32
|
}) => {
|
33
|
-
const
|
33
|
+
const a = t >= n;
|
34
34
|
return /* @__PURE__ */ i(
|
35
|
-
|
35
|
+
h,
|
36
36
|
{
|
37
37
|
buttons: [
|
38
38
|
{
|
39
39
|
isIconButton: !0,
|
40
40
|
variant: "white",
|
41
41
|
onClick: () => {
|
42
|
-
|
42
|
+
a || (s(t + 1), o(t + 1));
|
43
43
|
},
|
44
|
-
disabled:
|
44
|
+
disabled: a,
|
45
45
|
iconName: "ArrowRight16px"
|
46
46
|
}
|
47
47
|
]
|
48
48
|
}
|
49
49
|
);
|
50
|
-
},
|
51
|
-
|
50
|
+
}, _ = () => /* @__PURE__ */ i(
|
51
|
+
h,
|
52
52
|
{
|
53
53
|
buttons: [
|
54
54
|
{
|
55
55
|
children: "...",
|
56
|
-
variant: "
|
57
|
-
className: C.ellipsis
|
56
|
+
variant: "transparent",
|
57
|
+
className: C(g["pagination-button"], g.ellipsis)
|
58
58
|
}
|
59
59
|
]
|
60
60
|
}
|
61
|
-
),
|
61
|
+
), b = ({
|
62
62
|
currentPageNumber: t,
|
63
63
|
newPageNumber: n,
|
64
64
|
onClick: o,
|
65
65
|
setCurrentPage: s
|
66
66
|
}) => {
|
67
|
-
const
|
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:
|
75
|
-
className:
|
76
|
-
[
|
74
|
+
onClick: r,
|
75
|
+
className: C(g["pagination-button"], {
|
76
|
+
[g["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:
|
86
|
+
setCurrentPage: a
|
87
87
|
}) => {
|
88
|
-
const
|
88
|
+
const r = [];
|
89
89
|
for (let e = t; e <= n; e++)
|
90
|
-
|
90
|
+
r.push(
|
91
91
|
/* @__PURE__ */ i(
|
92
|
-
|
92
|
+
b,
|
93
93
|
{
|
94
94
|
currentPageNumber: o,
|
95
|
-
setCurrentPage:
|
95
|
+
setCurrentPage: a,
|
96
96
|
newPageNumber: e,
|
97
97
|
onClick: s
|
98
98
|
},
|
99
99
|
e
|
100
100
|
)
|
101
101
|
);
|
102
|
-
return
|
103
|
-
},
|
102
|
+
return r;
|
103
|
+
}, U = N(
|
104
104
|
(t, n) => {
|
105
105
|
const {
|
106
106
|
rootClassName: o,
|
107
107
|
total: s,
|
108
|
-
perPage:
|
109
|
-
currentPageNumber:
|
108
|
+
perPage: a = A,
|
109
|
+
currentPageNumber: r = u,
|
110
110
|
onChange: e
|
111
|
-
} = t, [c, m] = w(
|
112
|
-
let
|
111
|
+
} = t, [c, m] = w(r), l = Math.ceil(s / a), { width: k } = E(), f = k <= 650 ? 2 : 4;
|
112
|
+
let d = 0, p = 0;
|
113
113
|
return v(() => {
|
114
|
-
m(
|
115
|
-
}, [
|
116
|
-
u +
|
114
|
+
m(r);
|
115
|
+
}, [r]), c <= f ? (d = u, p = Math.min(
|
116
|
+
u + f,
|
117
117
|
l
|
118
|
-
)) : c > l -
|
118
|
+
)) : c > l - f ? (d = l - f, p = l) : (d = c - f / 2, p = c + f / 2), s <= a ? null : /* @__PURE__ */ P(
|
119
119
|
"nav",
|
120
120
|
{
|
121
121
|
"aria-label": "Постраничная навигация",
|
122
|
-
className:
|
122
|
+
className: C(g.container, o),
|
123
123
|
ref: n,
|
124
124
|
children: [
|
125
125
|
/* @__PURE__ */ i(
|
@@ -130,8 +130,8 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
|
|
130
130
|
setCurrentPage: m
|
131
131
|
}
|
132
132
|
),
|
133
|
-
|
134
|
-
|
133
|
+
d > u && /* @__PURE__ */ i(
|
134
|
+
b,
|
135
135
|
{
|
136
136
|
newPageNumber: u,
|
137
137
|
currentPageNumber: c,
|
@@ -139,17 +139,17 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
|
|
139
139
|
setCurrentPage: m
|
140
140
|
}
|
141
141
|
),
|
142
|
-
|
142
|
+
d > u + 1 && /* @__PURE__ */ i(_, {}),
|
143
143
|
R({
|
144
|
-
start:
|
145
|
-
end:
|
144
|
+
start: d,
|
145
|
+
end: p,
|
146
146
|
currentPageNumber: c,
|
147
147
|
setCurrentPage: m,
|
148
148
|
onClick: e
|
149
149
|
}),
|
150
|
-
|
151
|
-
|
152
|
-
|
150
|
+
p < l - 1 && /* @__PURE__ */ i(_, {}),
|
151
|
+
p < l && /* @__PURE__ */ i(
|
152
|
+
b,
|
153
153
|
{
|
154
154
|
newPageNumber: l,
|
155
155
|
currentPageNumber: c,
|
@@ -172,5 +172,5 @@ import '../../assets/Pagination.css';const x = "_container_15wir_3", j = "_ellip
|
|
172
172
|
}
|
173
173
|
);
|
174
174
|
export {
|
175
|
-
|
175
|
+
U as Pagination
|
176
176
|
};
|