mimir-ui-kit 1.43.11 → 1.43.13
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.
- package/dist/Input-BU_6U1CW.js +227 -0
- package/dist/assets/Accordion.css +1 -1
- package/dist/assets/AccordionItem.css +1 -1
- package/dist/assets/Avatar.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/CheckboxMimir.css +1 -1
- package/dist/assets/Chip.css +1 -1
- package/dist/assets/ClearButton.css +1 -0
- package/dist/assets/Drawer.css +1 -1
- package/dist/assets/GosZnak.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputPassword.css +1 -1
- package/dist/assets/InputRangeSlider.css +1 -1
- package/dist/assets/Link.css +1 -1
- package/dist/assets/ListFiles.css +1 -1
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/assets/MessageShortReply.css +1 -1
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/NotificationBadge.css +1 -1
- package/dist/assets/OtpInput.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/hooks.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +3 -10
- package/dist/components/Accordion/Accordion.js +212 -286
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +3 -3
- package/dist/components/Accordion/constants.d.ts +4 -0
- package/dist/components/Accordion/constants.js +5 -4
- package/dist/components/AnchorLink/Link.js +20 -21
- package/dist/components/Avatar/Avatar.js +26 -26
- package/dist/components/Button/Button.js +87 -110
- package/dist/components/Button/constants.d.ts +2 -8
- package/dist/components/Button/constants.js +5 -6
- package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +0 -2
- package/dist/components/CheckboxMimir/CheckboxMimir.js +35 -37
- package/dist/components/Chip/Chip.js +17 -17
- package/dist/components/DatePicker/DatePicker.d.ts +0 -8
- package/dist/components/DatePicker/DatePicker.js +169 -182
- package/dist/components/DatePicker/DatePickerModal.js +98 -134
- package/dist/components/DatePicker/MonthPickerModal.js +95 -115
- package/dist/components/DatePicker/YearPickerModal.js +89 -109
- package/dist/components/DatePicker/constants.d.ts +1 -1
- package/dist/components/DatePicker/constants.js +7 -6
- package/dist/components/DatePicker/hooks.d.ts +1 -2
- package/dist/components/DatePicker/hooks.js +13 -13
- package/dist/components/Drawer/Drawer.js +138 -172
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/Dropdown/hooks.js +1 -1
- package/dist/components/GosZnak/GosZnak.js +38 -47
- package/dist/components/Input/Input.d.ts +0 -4
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/Input/index.js +1 -1
- package/dist/components/{MiniButton/MiniButton.d.ts → InputClearButton/ClearButton.d.ts} +8 -17
- package/dist/components/InputClearButton/ClearButton.js +41 -0
- package/dist/components/InputClearButton/constants.d.ts +8 -0
- package/dist/components/InputClearButton/constants.js +5 -0
- package/dist/components/InputClearButton/index.d.ts +4 -0
- package/dist/components/InputClearButton/index.js +6 -0
- package/dist/components/InputPassword/InputPassword.js +42 -38
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/InputRangeSlider/InputRangeSlider.js +139 -159
- package/dist/components/InputRangeSlider/constants.d.ts +0 -5
- package/dist/components/InputRangeSlider/constants.js +6 -11
- package/dist/components/ListFiles/ListFiles.js +39 -41
- package/dist/components/ListPhotos/ListPhotos.js +18 -17
- package/dist/components/MessageShortReply/MessageShortReply.js +34 -34
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +152 -153
- package/dist/components/MultiSelectSearch/constants.d.ts +0 -1
- package/dist/components/MultiSelectSearch/constants.js +7 -7
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -1
- package/dist/components/MultiSelectSearch/utils.js +16 -18
- package/dist/components/NotificationBadge/NotificationBadge.js +33 -49
- package/dist/components/NotificationBadge/constants.d.ts +2 -9
- package/dist/components/NotificationBadge/constants.js +2 -3
- package/dist/components/NotificationBadge/types.d.ts +1 -11
- package/dist/components/OtpInput/OtpInput.js +40 -44
- package/dist/components/OtpInput/constants.d.ts +0 -4
- package/dist/components/OtpInput/constants.js +4 -6
- package/dist/components/OtpInput/index.d.ts +0 -1
- package/dist/components/OtpInput/index.js +0 -2
- package/dist/components/Pagination/Pagination.js +23 -23
- package/dist/components/SelectSearch/SelectSearch.js +241 -241
- package/dist/components/SelectSearch/utils.d.ts +1 -1
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/Slider/Slider.d.ts +5 -1
- package/dist/components/Slider/Slider.js +36 -34
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.d.ts +1 -3
- package/dist/components/index.js +51 -55
- package/dist/hooks-HgN6Yauq.js +117 -0
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/64px/AdvancePaymentDiscount64px.js +59 -0
- package/dist/icons/components/64px/AtsVendors64px.js +37 -0
- package/dist/icons/components/64px/ButtonOn64px.js +31 -0
- package/dist/icons/components/64px/BuyoutAuto64px.js +45 -0
- package/dist/icons/components/64px/CarAssistance64px.js +44 -0
- package/dist/icons/components/64px/CarDelivery64px.js +37 -0
- package/dist/icons/components/64px/CarSearchReturn64px.js +45 -0
- package/dist/icons/components/64px/CarService64px.js +37 -0
- package/dist/icons/components/64px/Case64px.js +33 -0
- package/dist/icons/components/64px/CoatOfArms64px.js +149 -0
- package/dist/icons/components/64px/CoffeeCup64px.js +44 -0
- package/dist/icons/components/64px/Cup64px.js +38 -0
- package/dist/icons/components/64px/ExpertAdvice64px.js +40 -0
- package/dist/icons/components/64px/Fines64px.js +88 -0
- package/dist/icons/components/64px/Fuel64px.js +38 -0
- package/dist/icons/components/64px/GazprombankIcon24px.js +21 -0
- package/dist/icons/components/64px/Kasko64px.js +44 -0
- package/dist/icons/components/64px/LegalSupport64px.js +58 -0
- package/dist/icons/components/64px/Microphone64px.js +37 -0
- package/dist/icons/components/64px/Money64px.js +60 -0
- package/dist/icons/components/64px/PaymentSchedule64px.js +39 -0
- package/dist/icons/components/64px/PersonalManager64px.js +100 -0
- package/dist/icons/components/64px/PreApproval64px.js +44 -0
- package/dist/icons/components/64px/Questions64px.js +37 -0
- package/dist/icons/components/64px/SupportGeography64px.js +51 -0
- package/dist/icons/components/64px/Timer64px.js +45 -0
- package/dist/icons/components/64px/Twogis64px.js +51 -0
- package/dist/icons/components/64px/Vehicles64px.js +45 -0
- package/dist/icons/components/64px/Workplace64px.js +38 -0
- package/dist/icons/components/index.js +591 -564
- package/dist/{index-DrVFMaBi.js → index-C2dQUuc9.js} +1346 -1184
- package/dist/index.js +69 -73
- package/dist/styles.module-Cuqm31CO.js +28 -0
- package/package.json +1 -1
- package/dist/Input-CGZoshMl.js +0 -224
- package/dist/assets/CarBodyButton.css +0 -1
- package/dist/assets/MiniButton.css +0 -1
- package/dist/assets/RoundButton.css +0 -1
- package/dist/assets/ScrollWrapper.css +0 -1
- package/dist/components/CarBodyButton/CarBodyButton.d.ts +0 -26
- package/dist/components/CarBodyButton/CarBodyButton.js +0 -40
- package/dist/components/CarBodyButton/index.d.ts +0 -1
- package/dist/components/CarBodyButton/index.js +0 -4
- package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.d.ts +0 -11
- package/dist/components/Drawer/ScrollWrapper/ScrollWrapper.js +0 -27
- package/dist/components/GosZnak/utils.d.ts +0 -6
- package/dist/components/GosZnak/utils.js +0 -15
- package/dist/components/MiniButton/MiniButton.js +0 -44
- package/dist/components/MiniButton/constants.d.ts +0 -9
- package/dist/components/MiniButton/constants.js +0 -5
- package/dist/components/MiniButton/index.d.ts +0 -4
- package/dist/components/MiniButton/index.js +0 -6
- package/dist/components/NotificationBadge/utils.d.ts +0 -8
- package/dist/components/NotificationBadge/utils.js +0 -4
- package/dist/components/RoundButton/RoundButton.d.ts +0 -82
- package/dist/components/RoundButton/RoundButton.js +0 -69
- package/dist/components/RoundButton/constants.d.ts +0 -11
- package/dist/components/RoundButton/constants.js +0 -5
- package/dist/components/RoundButton/index.d.ts +0 -2
- package/dist/components/RoundButton/index.js +0 -7
- package/dist/components/RoundButton/types.d.ts +0 -20
- package/dist/hooks-Cd4Ez6_j.js +0 -117
- package/dist/icons/components/16px/DropdownArrowDown16px.js +0 -23
- package/dist/icons/components/24px/EyeClosed24px.js +0 -65
- package/dist/styles.module-BfkM1-KJ.js +0 -32
@@ -1,43 +1,41 @@
|
|
1
|
-
import { EMultiSelectSearchSize as
|
2
|
-
import "../../Input-
|
1
|
+
import { EMultiSelectSearchSize as i, MOBILE_MENU_HEIGHT as c, DESKTOP_MENU_HEIGHT as a } from "./constants.js";
|
2
|
+
import "../../Input-BU_6U1CW.js";
|
3
3
|
import { EInputSize as u } from "../Input/constants.js";
|
4
4
|
const m = (t) => {
|
5
5
|
switch (t) {
|
6
|
-
case
|
6
|
+
case i.M:
|
7
7
|
return u.M;
|
8
|
-
case
|
8
|
+
case i.L:
|
9
9
|
return u.L;
|
10
|
-
case o.S:
|
11
|
-
return u.S;
|
12
10
|
default:
|
13
11
|
return u.M;
|
14
12
|
}
|
15
|
-
}, E = (t, e) => t ? e ===
|
13
|
+
}, E = (t, e) => t ? e === i.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : e === i.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px", f = (t, e) => t && t.length > 0 ? t.map((r) => r[e]).join(", ") : "", g = (t, e) => t.map((r) => r[e]).join(", "), d = "multiselectOpen", S = (t) => {
|
16
14
|
window.dispatchEvent(new CustomEvent(d, { detail: t }));
|
17
15
|
}, I = (t, e) => {
|
18
16
|
if (!t.current) return !1;
|
19
|
-
const r = t.current.getBoundingClientRect(),
|
20
|
-
return
|
17
|
+
const r = t.current.getBoundingClientRect(), o = window.innerHeight, s = e === i.M ? c : a, p = o - r.bottom, n = r.top;
|
18
|
+
return p >= s ? !1 : n > p;
|
21
19
|
}, M = (t, e, r) => {
|
22
20
|
if (!t.length || !e) return t;
|
23
|
-
const
|
24
|
-
for (const
|
25
|
-
const n = String(
|
26
|
-
|
21
|
+
const o = [], s = /* @__PURE__ */ new Set();
|
22
|
+
for (const p of t) {
|
23
|
+
const n = String(p[e] || "Без группы");
|
24
|
+
s.has(n) || (s.add(n), o.push({
|
27
25
|
id: `group-header-${n}`,
|
28
26
|
name: r(n),
|
29
27
|
isGroupHeader: !0,
|
30
28
|
originalValue: n
|
31
|
-
})),
|
29
|
+
})), o.push(p);
|
32
30
|
}
|
33
|
-
return
|
31
|
+
return o;
|
34
32
|
};
|
35
33
|
export {
|
36
34
|
d as MULTISELECT_OPEN_EVENT,
|
37
|
-
|
35
|
+
S as dispatchMultiselectOpen,
|
38
36
|
E as getDropdownArrowIcon,
|
39
|
-
|
40
|
-
|
37
|
+
f as getInitialInputValue,
|
38
|
+
g as joinSelectedItems,
|
41
39
|
m as mapSizeToInputSize,
|
42
40
|
M as prepareGroupedItems,
|
43
41
|
I as shouldShowMenuOnTop
|
@@ -1,52 +1,36 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { c as
|
3
|
-
import { ENotificationBadgeSize as
|
4
|
-
import
|
5
|
-
|
6
|
-
"notification-badge": "_notification-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
size: c = l.M,
|
23
|
-
variant: n = d.Citrine,
|
24
|
-
disabled: o = !1
|
25
|
-
}) => {
|
26
|
-
const e = g(i), f = typeof e == "string";
|
27
|
-
return /* @__PURE__ */ r(
|
28
|
-
"div",
|
29
|
-
{
|
30
|
-
className: s(
|
31
|
-
a["notification-badge"],
|
32
|
-
{
|
33
|
-
[a["notification-badge-absolute"]]: _,
|
34
|
-
[a["notification-badge-disabled"]]: o,
|
35
|
-
[a["notification-badge-small-font"]]: f
|
36
|
-
},
|
37
|
-
a[c],
|
38
|
-
a[n]
|
39
|
-
),
|
40
|
-
style: {
|
41
|
-
top: t == null ? void 0 : t.top,
|
42
|
-
right: t == null ? void 0 : t.right,
|
43
|
-
bottom: t == null ? void 0 : t.bottom,
|
44
|
-
left: t == null ? void 0 : t.left
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
2
|
+
import { c as l } from "../../index-DIxK0V-G.js";
|
3
|
+
import { ENotificationBadgeSize as m } from "./constants.js";
|
4
|
+
import '../../assets/NotificationBadge.css';const b = "_l_jhn37_18", d = "_m_jhn37_24", g = "_s_jhn37_30", t = {
|
5
|
+
"notification-badge": "_notification-badge_jhn37_2",
|
6
|
+
"notification-badge-absolute": "_notification-badge-absolute_jhn37_14",
|
7
|
+
l: b,
|
8
|
+
m: d,
|
9
|
+
s: g
|
10
|
+
}, n = ({
|
11
|
+
count: e,
|
12
|
+
position: a,
|
13
|
+
absolute: c,
|
14
|
+
size: _ = m.M
|
15
|
+
}) => /* @__PURE__ */ f(
|
16
|
+
"div",
|
17
|
+
{
|
18
|
+
className: l(
|
19
|
+
t["notification-badge"],
|
20
|
+
{
|
21
|
+
[t["notification-badge-absolute"]]: c
|
45
22
|
},
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
23
|
+
t[_]
|
24
|
+
),
|
25
|
+
style: {
|
26
|
+
top: a == null ? void 0 : a.top,
|
27
|
+
right: a == null ? void 0 : a.right,
|
28
|
+
bottom: a == null ? void 0 : a.bottom,
|
29
|
+
left: a == null ? void 0 : a.left
|
30
|
+
},
|
31
|
+
children: e
|
32
|
+
}
|
33
|
+
);
|
50
34
|
export {
|
51
|
-
|
35
|
+
n as NotificationBadge
|
52
36
|
};
|
@@ -1,12 +1,5 @@
|
|
1
1
|
export declare enum ENotificationBadgeSize {
|
2
|
-
XS = "xs",
|
3
2
|
S = "s",
|
4
|
-
M = "m"
|
5
|
-
|
6
|
-
export declare enum ENotificationBadgeVariant {
|
7
|
-
Sapphire = "sapphire",
|
8
|
-
Citrine = "citrine",
|
9
|
-
Asphalt = "asphalt",
|
10
|
-
White = "white",
|
11
|
-
Gray = "gray"
|
3
|
+
M = "m",
|
4
|
+
L = "l"
|
12
5
|
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
var
|
1
|
+
var l = /* @__PURE__ */ ((r) => (r.S = "s", r.M = "m", r.L = "l", r))(l || {});
|
2
2
|
export {
|
3
|
-
|
4
|
-
h as ENotificationBadgeVariant
|
3
|
+
l as ENotificationBadgeSize
|
5
4
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ENotificationBadgeSize
|
1
|
+
import { ENotificationBadgeSize } from './constants';
|
2
2
|
|
3
3
|
export type TNotificationBadgeProps = {
|
4
4
|
/**
|
@@ -20,16 +20,6 @@ export type TNotificationBadgeProps = {
|
|
20
20
|
absolute?: boolean;
|
21
21
|
/**
|
22
22
|
* Размер NotificationBadge.
|
23
|
-
* 'xs' | 's' | 'm'
|
24
23
|
*/
|
25
24
|
size?: `${ENotificationBadgeSize}` | ENotificationBadgeSize;
|
26
|
-
/**
|
27
|
-
* Вариант кнопки загрузки файла.
|
28
|
-
* 'gray' | 'white' | 'sapphire' | 'citrine' | 'asphalt';
|
29
|
-
*/
|
30
|
-
variant?: `${ENotificationBadgeVariant}` | ENotificationBadgeVariant;
|
31
|
-
/**
|
32
|
-
* Выключен ли NotificationBadge или нет
|
33
|
-
*/
|
34
|
-
disabled?: boolean;
|
35
25
|
};
|
@@ -1,66 +1,62 @@
|
|
1
|
-
import { jsx as r, jsxs as
|
2
|
-
import { c as
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
2
|
+
import { c as u } from "../../index-DIxK0V-G.js";
|
3
3
|
import { forwardRef as P, useImperativeHandle as R, Fragment as T } from "react";
|
4
4
|
import { ITEMS_PER_SEPARATOR as v, DEFAULT_VALUE_LENGTH as y } from "./constants.js";
|
5
|
-
import { useOTPInput as
|
6
|
-
import { I as
|
7
|
-
import '../../assets/OtpInput.css';const
|
8
|
-
otp:
|
9
|
-
"input-wrapper": "_input-
|
10
|
-
input:
|
11
|
-
|
12
|
-
|
13
|
-
separator: S
|
14
|
-
}, x = P(
|
5
|
+
import { useOTPInput as z } from "./hooks.js";
|
6
|
+
import { I as A } from "../../Input-BU_6U1CW.js";
|
7
|
+
import '../../assets/OtpInput.css';const C = "_otp_1ncuz_2", F = "_input_1ncuz_13", L = "_separator_1ncuz_27", n = {
|
8
|
+
otp: C,
|
9
|
+
"input-wrapper": "_input-wrapper_1ncuz_13",
|
10
|
+
input: F,
|
11
|
+
separator: L
|
12
|
+
}, O = P(
|
15
13
|
({
|
16
|
-
value:
|
17
|
-
valueLength:
|
18
|
-
needSeparator:
|
14
|
+
value: c = "",
|
15
|
+
valueLength: m = y,
|
16
|
+
needSeparator: l = !0,
|
19
17
|
onChange: i,
|
20
|
-
className:
|
21
|
-
|
22
|
-
|
23
|
-
}, h) => {
|
18
|
+
className: _,
|
19
|
+
...d
|
20
|
+
}, f) => {
|
24
21
|
const {
|
25
|
-
data: { inputRefs:
|
26
|
-
handlers: { handleChange:
|
27
|
-
} =
|
22
|
+
data: { inputRefs: o, valueItems: p },
|
23
|
+
handlers: { handleChange: h, handleFocus: I, handleKeyDown: w, handlePaste: N }
|
24
|
+
} = z({
|
28
25
|
onChange: i,
|
29
|
-
value:
|
30
|
-
valueLength:
|
26
|
+
value: c,
|
27
|
+
valueLength: m
|
31
28
|
});
|
32
|
-
return R(
|
29
|
+
return R(f, () => ({
|
33
30
|
focus: () => {
|
34
|
-
var
|
35
|
-
(
|
31
|
+
var a;
|
32
|
+
(a = o.current[0]) == null || a.focus();
|
36
33
|
}
|
37
|
-
})), /* @__PURE__ */ r("div", { className:
|
38
|
-
const
|
39
|
-
return /* @__PURE__ */
|
34
|
+
})), /* @__PURE__ */ r("div", { className: u(n.otp, _), children: p.map((a, e) => {
|
35
|
+
const s = e + 1, E = l && s % v === 0 && s !== p.length;
|
36
|
+
return /* @__PURE__ */ g(T, { children: [
|
40
37
|
/* @__PURE__ */ r(
|
41
|
-
|
38
|
+
A,
|
42
39
|
{
|
43
|
-
ref: (t) =>
|
40
|
+
ref: (t) => o.current[e] = t,
|
44
41
|
type: "text",
|
45
42
|
inputMode: "numeric",
|
46
43
|
autoComplete: "one-time-code",
|
47
44
|
pattern: "\\d{1}",
|
48
45
|
maxLength: 1,
|
49
|
-
value:
|
50
|
-
className:
|
51
|
-
wrapperClassName:
|
52
|
-
onChange: (t) =>
|
53
|
-
onKeyDown: (t) =>
|
46
|
+
value: a,
|
47
|
+
className: n.input,
|
48
|
+
wrapperClassName: n["input-wrapper"],
|
49
|
+
onChange: (t) => h(t, e),
|
50
|
+
onKeyDown: (t) => w(t, e),
|
54
51
|
onFocus: (t) => I(t, e),
|
55
|
-
onPaste:
|
56
|
-
|
57
|
-
...f
|
52
|
+
onPaste: N,
|
53
|
+
...d
|
58
54
|
}
|
59
55
|
),
|
60
|
-
|
56
|
+
E && /* @__PURE__ */ r(
|
61
57
|
"span",
|
62
58
|
{
|
63
|
-
className:
|
59
|
+
className: u(n.separator),
|
64
60
|
"data-testid": "separator"
|
65
61
|
}
|
66
62
|
)
|
@@ -68,7 +64,7 @@ import '../../assets/OtpInput.css';const F = "_otp_1ljg8_2", L = "_input_1ljg8_8
|
|
68
64
|
}) });
|
69
65
|
}
|
70
66
|
);
|
71
|
-
|
67
|
+
O.displayName = "OtpInput";
|
72
68
|
export {
|
73
|
-
|
69
|
+
O as OtpInput
|
74
70
|
};
|
@@ -1,8 +1,6 @@
|
|
1
|
-
const
|
2
|
-
var R = /* @__PURE__ */ ((E) => (E.L = "l", E.M = "m", E))(R || {});
|
1
|
+
const E = new RegExp(/^\d+$/), R = 6, T = 3;
|
3
2
|
export {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
T as RE_DIGIT
|
3
|
+
R as DEFAULT_VALUE_LENGTH,
|
4
|
+
T as ITEMS_PER_SEPARATOR,
|
5
|
+
E as RE_DIGIT
|
8
6
|
};
|
@@ -4,16 +4,16 @@ import { forwardRef as M, useState as R, useEffect as S } from "react";
|
|
4
4
|
import { FIRST_PAGE_NUMBER as m, DEFAULT_PER_PAGE as j } from "./constants.js";
|
5
5
|
import { useWindowSize as $ } from "../../hooks/useWindowSize/index.js";
|
6
6
|
import { MergedButton as v } from "../MergedButton/MergedButton.js";
|
7
|
-
import '../../assets/Pagination.css';const F = "
|
8
|
-
"pagination-button": "_pagination-
|
9
|
-
"is-active": "_is-
|
7
|
+
import '../../assets/Pagination.css';const F = "_container_uqdck_27", L = "_ellipsis_uqdck_42", G = "_disabled_uqdck_47", C = {
|
8
|
+
"pagination-button": "_pagination-button_uqdck_2",
|
9
|
+
"is-active": "_is-active_uqdck_23",
|
10
10
|
container: F,
|
11
11
|
ellipsis: L,
|
12
12
|
disabled: G
|
13
13
|
}, T = ({
|
14
14
|
currentPageNumber: t,
|
15
15
|
onClick: n,
|
16
|
-
setCurrentPage:
|
16
|
+
setCurrentPage: c,
|
17
17
|
disabled: o
|
18
18
|
}) => /* @__PURE__ */ a(
|
19
19
|
v,
|
@@ -23,7 +23,7 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
23
23
|
isIconButton: !0,
|
24
24
|
variant: "white",
|
25
25
|
onClick: () => {
|
26
|
-
t !== m && (
|
26
|
+
t !== m && (c(t - 1), n(t - 1));
|
27
27
|
},
|
28
28
|
iconName: "ArrowLeft16px",
|
29
29
|
disabled: o || t === m,
|
@@ -34,7 +34,7 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
34
34
|
), U = ({
|
35
35
|
currentPageNumber: t,
|
36
36
|
lastPageNumber: n,
|
37
|
-
onClick:
|
37
|
+
onClick: c,
|
38
38
|
setCurrentPage: o,
|
39
39
|
disabled: r
|
40
40
|
}) => {
|
@@ -47,7 +47,7 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
47
47
|
isIconButton: !0,
|
48
48
|
variant: "white",
|
49
49
|
onClick: () => {
|
50
|
-
s || (o(t + 1),
|
50
|
+
s || (o(t + 1), c(t + 1));
|
51
51
|
},
|
52
52
|
disabled: r || s,
|
53
53
|
iconName: "ArrowRight16px",
|
@@ -70,12 +70,12 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
70
70
|
), N = ({
|
71
71
|
currentPageNumber: t,
|
72
72
|
newPageNumber: n,
|
73
|
-
onClick:
|
73
|
+
onClick: c,
|
74
74
|
setCurrentPage: o,
|
75
75
|
disabled: r
|
76
76
|
}) => {
|
77
77
|
const s = t === n, i = () => {
|
78
|
-
r || (o(n),
|
78
|
+
r || (o(n), c(n));
|
79
79
|
}, e = n < 10 ? `0${n}` : n;
|
80
80
|
return /* @__PURE__ */ a(
|
81
81
|
"button",
|
@@ -93,7 +93,7 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
93
93
|
}, z = ({
|
94
94
|
start: t,
|
95
95
|
end: n,
|
96
|
-
currentPageNumber:
|
96
|
+
currentPageNumber: c,
|
97
97
|
onClick: o,
|
98
98
|
setCurrentPage: r,
|
99
99
|
disabled: s
|
@@ -104,7 +104,7 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
104
104
|
/* @__PURE__ */ a(
|
105
105
|
N,
|
106
106
|
{
|
107
|
-
currentPageNumber:
|
107
|
+
currentPageNumber: c,
|
108
108
|
setCurrentPage: r,
|
109
109
|
newPageNumber: e,
|
110
110
|
onClick: o,
|
@@ -117,7 +117,7 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
117
117
|
}, Q = M(
|
118
118
|
(t, n) => {
|
119
119
|
const {
|
120
|
-
rootClassName:
|
120
|
+
rootClassName: c,
|
121
121
|
total: o,
|
122
122
|
perPage: r = j,
|
123
123
|
currentPageNumber: s = m,
|
@@ -126,22 +126,22 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
126
126
|
hidePrevButton: E = !1,
|
127
127
|
hideNextButton: y = !1,
|
128
128
|
siblingCount: A,
|
129
|
-
boundaryCount:
|
129
|
+
boundaryCount: l = 1
|
130
130
|
} = t, [u, g] = R(s), d = Math.ceil(o / r), { width: q } = $(), w = q <= 650 ? 1 : 2, h = A !== void 0 ? A : w;
|
131
131
|
let b = 0, p = 0;
|
132
132
|
return S(() => {
|
133
133
|
g(s);
|
134
|
-
}, [s]), u <=
|
135
|
-
|
134
|
+
}, [s]), u <= l + h + 1 ? (b = m, p = Math.min(
|
135
|
+
l + h * 2 + 1,
|
136
136
|
d
|
137
|
-
)) : u >= d -
|
138
|
-
d -
|
137
|
+
)) : u >= d - l - h ? (b = Math.max(
|
138
|
+
d - l - h * 2,
|
139
139
|
m
|
140
140
|
), p = d) : (b = u - h, p = u + h), o <= r ? null : /* @__PURE__ */ k(
|
141
141
|
"nav",
|
142
142
|
{
|
143
143
|
"aria-label": "Постраничная навигация",
|
144
|
-
className: P(C.container,
|
144
|
+
className: P(C.container, c, {
|
145
145
|
[C.disabled]: e
|
146
146
|
}),
|
147
147
|
ref: n,
|
@@ -156,7 +156,7 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
156
156
|
}
|
157
157
|
),
|
158
158
|
b > m && /* @__PURE__ */ k(x, { children: [
|
159
|
-
Array.from({ length:
|
159
|
+
Array.from({ length: l }).map((I, _) => {
|
160
160
|
const f = m + _;
|
161
161
|
return f >= b ? null : /* @__PURE__ */ a(
|
162
162
|
N,
|
@@ -170,7 +170,7 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
170
170
|
`boundary-start-${f}`
|
171
171
|
);
|
172
172
|
}),
|
173
|
-
b >
|
173
|
+
b > l + m && /* @__PURE__ */ a(B, {})
|
174
174
|
] }),
|
175
175
|
z({
|
176
176
|
start: b,
|
@@ -181,9 +181,9 @@ import '../../assets/Pagination.css';const F = "_container_iq51m_30", L = "_elli
|
|
181
181
|
disabled: e
|
182
182
|
}),
|
183
183
|
p < d && /* @__PURE__ */ k(x, { children: [
|
184
|
-
p < d -
|
185
|
-
Array.from({ length:
|
186
|
-
const f = d -
|
184
|
+
p < d - l && /* @__PURE__ */ a(B, {}),
|
185
|
+
Array.from({ length: l }).map((I, _) => {
|
186
|
+
const f = d - l + 1 + _;
|
187
187
|
return f <= p ? null : /* @__PURE__ */ a(
|
188
188
|
N,
|
189
189
|
{
|