mimir-ui-kit 1.34.2 → 1.34.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{Input-ChCIy5oY.js → Input-DspsU5F4.js} +27 -23
- package/dist/{ProgressBar-CwLwhaeM.js → ProgressBar-DWKyrXzd.js} +23 -23
- package/dist/assets/Accordion.css +1 -1
- package/dist/assets/AccordionItem.css +1 -1
- package/dist/assets/Avatar.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/CheckboxMimir.css +1 -1
- package/dist/assets/Chip.css +1 -1
- package/dist/assets/Drawer.css +1 -1
- package/dist/assets/GosZnak.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/InputPassword.css +1 -1
- package/dist/assets/InputRangeSlider.css +1 -0
- package/dist/assets/Link.css +1 -1
- package/dist/assets/ListFiles.css +1 -1
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/assets/MergedButton.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/ProgressBar2.css +1 -1
- package/dist/assets/RadioGroup.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/SkeletonCircle.css +1 -0
- package/dist/assets/SkeletonText.css +1 -0
- package/dist/assets/Slider.css +1 -1
- package/dist/assets/Switcher.css +1 -0
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/Tag.css +1 -1
- package/dist/assets/TextArea.css +1 -1
- package/dist/assets/Timer.css +1 -1
- package/dist/assets/TwinSwitcher.css +1 -0
- package/dist/assets/Uploader.css +1 -1
- package/dist/assets/UploaderPhotos.css +1 -1
- package/dist/assets/Vote.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/variant.css +1 -0
- package/dist/components/Accordion/Accordion.js +24 -16
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +3 -3
- package/dist/components/AnchorLink/Link.js +9 -9
- package/dist/components/Avatar/Avatar.d.ts +3 -0
- package/dist/components/Avatar/Avatar.js +62 -0
- package/dist/components/Avatar/constants.d.ts +5 -0
- package/dist/components/Avatar/constants.js +9 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/Avatar/index.js +6 -0
- package/dist/components/Avatar/types.d.ts +10 -0
- package/dist/components/Button/Button.js +33 -33
- package/dist/components/CheckboxMimir/CheckboxMimir.js +16 -19
- package/dist/components/Chip/Chip.js +12 -12
- package/dist/components/DatePicker/DatePicker.d.ts +36 -18
- package/dist/components/DatePicker/DatePicker.js +46 -6
- package/dist/components/DatePicker/DatePickerModal.js +78 -62
- package/dist/components/DatePicker/MonthPickerModal.js +14 -6
- package/dist/components/DatePicker/YearPickerModal.js +2 -2
- package/dist/components/DatePicker/utils.d.ts +2 -0
- package/dist/components/DatePicker/utils.js +16 -0
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.js +20 -20
- package/dist/components/GosZnak/GosZnak.d.ts +4 -0
- package/dist/components/GosZnak/GosZnak.js +76 -0
- package/dist/components/GosZnak/constants.d.ts +11 -0
- package/dist/components/GosZnak/constants.js +17 -0
- package/dist/components/GosZnak/index.d.ts +3 -0
- package/dist/components/GosZnak/index.js +7 -0
- package/dist/components/GosZnak/types.d.ts +26 -0
- package/dist/components/Input/Input.d.ts +5 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/constants.d.ts +5 -3
- package/dist/components/Input/constants.js +7 -3
- package/dist/components/Input/index.d.ts +2 -2
- package/dist/components/Input/index.js +3 -2
- package/dist/components/Input/types.d.ts +2 -6
- package/dist/components/InputPassword/InputPassword.js +8 -8
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/InputRangeSlider/InputRangeSlider.d.ts +3 -0
- package/dist/components/InputRangeSlider/InputRangeSlider.js +219 -0
- package/dist/components/InputRangeSlider/constants.d.ts +10 -0
- package/dist/components/InputRangeSlider/constants.js +18 -0
- package/dist/components/InputRangeSlider/index.d.ts +3 -0
- package/dist/components/InputRangeSlider/index.js +7 -0
- package/dist/components/InputRangeSlider/types.d.ts +33 -0
- package/dist/components/ListFiles/ListFiles.js +7 -7
- package/dist/components/ListPhotos/ListPhotos.js +4 -4
- package/dist/components/MergedButton/MergedButton.js +6 -6
- package/dist/components/NotificationBadge/NotificationBadge.js +4 -4
- package/dist/components/OtpInput/OtpInput.js +5 -5
- package/dist/components/Pagination/Pagination.d.ts +1 -3
- package/dist/components/Pagination/Pagination.js +7 -11
- package/dist/components/RadioGroup/RadioGroup.js +9 -9
- package/dist/components/SelectSearch/SelectSearch.d.ts +18 -2
- package/dist/components/SelectSearch/SelectSearch.js +47 -31
- package/dist/components/SelectSearch/types.d.ts +2 -4
- package/dist/components/Skeleton/SkeletonBrick/SkeletonBrick.d.ts +12 -0
- package/dist/components/Skeleton/SkeletonBrick/SkeletonBrick.js +34 -0
- package/dist/components/Skeleton/SkeletonCircle/SkeletonCircle.d.ts +9 -0
- package/dist/components/Skeleton/SkeletonCircle/SkeletonCircle.js +31 -0
- package/dist/components/Skeleton/SkeletonText/SkeletonText.d.ts +10 -0
- package/dist/components/Skeleton/SkeletonText/SkeletonText.js +49 -0
- package/dist/components/Skeleton/constants.d.ts +5 -0
- package/dist/components/Skeleton/constants.js +9 -0
- package/dist/components/Skeleton/index.d.ts +4 -0
- package/dist/components/Skeleton/index.js +10 -0
- package/dist/components/Slider/Slider.d.ts +3 -2
- package/dist/components/Slider/Slider.js +12 -10
- package/dist/components/Steps/Steps.d.ts +4 -0
- package/dist/components/Steps/Steps.js +5 -1
- package/dist/components/Switcher/Switcher.d.ts +3 -0
- package/dist/components/Switcher/Switcher.js +118 -0
- package/dist/components/Switcher/constants.d.ts +4 -0
- package/dist/components/Switcher/constants.js +8 -0
- package/dist/components/Switcher/index.d.ts +3 -0
- package/dist/components/Switcher/index.js +6 -0
- package/dist/components/Switcher/types.d.ts +30 -0
- package/dist/components/TabTrail/TabTrail.d.ts +8 -0
- package/dist/components/TabTrail/TabTrail.js +33 -17
- package/dist/components/Tag/Tag.js +6 -6
- package/dist/components/TextArea/TextArea.js +14 -12
- package/dist/components/TextArea/hooks.js +4 -0
- package/dist/components/Timer/Timer.js +1 -1
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.js +1 -1
- package/dist/components/Toasts/ToastList.js +1 -1
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/TwinSwitcher/TwinSwitcher.d.ts +10 -0
- package/dist/components/TwinSwitcher/TwinSwitcher.js +65 -0
- package/dist/components/TwinSwitcher/index.d.ts +1 -0
- package/dist/components/TwinSwitcher/index.js +4 -0
- package/dist/components/UniversalUploader/UniversalUploader.js +21 -35
- package/dist/components/Uploader/Uploader.js +3 -3
- package/dist/components/UploaderFiles/UploaderFiles.js +1 -1
- package/dist/components/UploaderPhotos/UploaderPhotos.js +1 -1
- package/dist/components/Vote/Vote.d.ts +8 -0
- package/dist/components/Vote/Vote.js +6 -4
- package/dist/components/index.d.ts +14 -2
- package/dist/components/index.js +31 -2
- package/dist/field-bS4z9Sdl.js +12 -0
- package/dist/icons/Icon.js +1 -1
- package/dist/index.js +31 -2
- package/dist/{label-BTEGh6O_.js → label-P7Xsi5N7.js} +2 -2
- package/dist/styles.module-B9L4B63y.js +40 -0
- package/dist/variant.module-BinTBzAV.js +15 -0
- package/package.json +1 -1
- package/dist/components/Button/types.js +0 -1
- package/dist/components/Input/types.js +0 -1
- package/dist/components/NotificationBadge/types.js +0 -1
- package/dist/components/Pagination/types.js +0 -1
- package/dist/components/SelectSearch/types.js +0 -1
- package/dist/components/Steps/types.js +0 -1
- package/dist/components/Tag/types.js +0 -1
- package/dist/components/TextArea/types.js +0 -1
- package/dist/components/Toasts/types.js +0 -1
- package/dist/components/UniversalUploader/types.js +0 -1
- package/dist/components/Vote/types.js +0 -1
- package/dist/icons/components/types.js +0 -1
- package/dist/styles.module-Ugsf0AOb.js +0 -38
@@ -3,12 +3,16 @@ import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
3
3
|
import { memo, forwardRef, useState, useEffect } from "react";
|
4
4
|
import { DatePickerModal } from "./DatePickerModal.js";
|
5
5
|
import { MonthPickerModal } from "./MonthPickerModal.js";
|
6
|
-
import { c as cls } from "../../styles.module-
|
6
|
+
import { c as cls } from "../../styles.module-B9L4B63y.js";
|
7
|
+
import { formatDatePart } from "./utils.js";
|
7
8
|
import { YearPickerModal } from "./YearPickerModal.js";
|
8
9
|
import { useClickOutside } from "../../hooks/useClickOutside/useClickOutside.js";
|
9
10
|
import { formating } from "../../utils/index.js";
|
10
|
-
import { I as Input } from "../../Input-
|
11
|
-
import {
|
11
|
+
import { I as Input } from "../../Input-DspsU5F4.js";
|
12
|
+
import { EInputStatus } from "../Input/constants.js";
|
13
|
+
const MAX_DAY = 31;
|
14
|
+
const MAX_MONTH = 12;
|
15
|
+
const DATE_LENGTH = 10;
|
12
16
|
const DatePicker = memo(
|
13
17
|
forwardRef(
|
14
18
|
({
|
@@ -24,6 +28,7 @@ const DatePicker = memo(
|
|
24
28
|
validateImmediately,
|
25
29
|
variant,
|
26
30
|
disabled = false,
|
31
|
+
editable = false,
|
27
32
|
...props
|
28
33
|
}, ref) => {
|
29
34
|
const [isActive, setActive] = useState(false);
|
@@ -32,6 +37,7 @@ const DatePicker = memo(
|
|
32
37
|
value && !isNaN(new Date(value).getTime()) ? new Date(value) : void 0
|
33
38
|
);
|
34
39
|
const [isError, setError] = useState(error);
|
40
|
+
const [inputValue, setInputValue] = useState("");
|
35
41
|
useEffect(() => {
|
36
42
|
setError(error);
|
37
43
|
}, [error]);
|
@@ -40,6 +46,13 @@ const DatePicker = memo(
|
|
40
46
|
value && !isNaN(new Date(value).getTime()) ? new Date(value) : void 0
|
41
47
|
);
|
42
48
|
}, [value]);
|
49
|
+
useEffect(() => {
|
50
|
+
if (date && !(typeof date === "string") && !isNaN(date == null ? void 0 : date.getTime())) {
|
51
|
+
setInputValue(formating.Date(date, "dd/mm/yyyy"));
|
52
|
+
} else {
|
53
|
+
setInputValue("");
|
54
|
+
}
|
55
|
+
}, [date]);
|
43
56
|
const milliseconds = value && new Date(value).getTime;
|
44
57
|
useEffect(() => {
|
45
58
|
if (validateImmediately) {
|
@@ -88,6 +101,28 @@ const DatePicker = memo(
|
|
88
101
|
onChangeValue == null ? void 0 : onChangeValue({ value: sendDate, name });
|
89
102
|
onBlur == null ? void 0 : onBlur(sendDate);
|
90
103
|
};
|
104
|
+
const handleInputChange = (e) => {
|
105
|
+
if (editable) {
|
106
|
+
const newValue = e.target.value.replace(/[^\d]/g, "");
|
107
|
+
const [day, month, year] = [
|
108
|
+
formatDatePart(newValue.substring(0, 2), MAX_DAY),
|
109
|
+
formatDatePart(newValue.substring(2, 4), MAX_MONTH),
|
110
|
+
newValue.substring(4, 8)
|
111
|
+
];
|
112
|
+
const formattedValue = [day, month, year].filter(Boolean).join("/");
|
113
|
+
setInputValue(formattedValue);
|
114
|
+
if (formattedValue.length === DATE_LENGTH) {
|
115
|
+
const fullYear = parseInt(year);
|
116
|
+
const newDate = /* @__PURE__ */ new Date(
|
117
|
+
`${fullYear}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`
|
118
|
+
);
|
119
|
+
if (!isNaN(newDate.getTime())) {
|
120
|
+
setDate(newDate);
|
121
|
+
onChangeValue == null ? void 0 : onChangeValue({ value: newDate, name });
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
};
|
91
126
|
const wrapperClassNames = classNames(cls.wrapper, isActive && cls.active);
|
92
127
|
const InputClassNames = classNames(cls.input, cls.inputBorderControl);
|
93
128
|
return /* @__PURE__ */ jsxs("div", { className: wrapperClassNames, "data-disabled": disabled, children: [
|
@@ -95,7 +130,9 @@ const DatePicker = memo(
|
|
95
130
|
"div",
|
96
131
|
{
|
97
132
|
"data-error": isError,
|
98
|
-
className: cls["date-wrapper"],
|
133
|
+
className: classNames(cls["date-wrapper"], {
|
134
|
+
[cls.editable]: editable
|
135
|
+
}),
|
99
136
|
onClick: onOpen,
|
100
137
|
children: /* @__PURE__ */ jsx(
|
101
138
|
Input,
|
@@ -105,12 +142,15 @@ const DatePicker = memo(
|
|
105
142
|
wrapperClassName: cls["input-wrapper"],
|
106
143
|
size,
|
107
144
|
type: "text",
|
108
|
-
variant
|
109
|
-
|
145
|
+
variant,
|
146
|
+
status: isError ? EInputStatus.Error : void 0,
|
147
|
+
value: inputValue,
|
148
|
+
onChange: handleInputChange,
|
110
149
|
rightAddon: {
|
111
150
|
addonType: "icon",
|
112
151
|
addonContent: isActive ? "DropdownArrowUp24px" : "DropdownArrowDown24px"
|
113
152
|
},
|
153
|
+
"data-error": isError,
|
114
154
|
...props
|
115
155
|
}
|
116
156
|
)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
2
2
|
import { useRef, useState, useEffect } from "react";
|
3
3
|
import { week } from "./constants.js";
|
4
|
-
import { c as cls } from "../../styles.module-
|
4
|
+
import { c as cls } from "../../styles.module-B9L4B63y.js";
|
5
5
|
import { Icon } from "../../icons/Icon.js";
|
6
6
|
import { formating } from "../../utils/index.js";
|
7
7
|
import { Button } from "../Button/Button.js";
|
@@ -37,10 +37,10 @@ function DatePickerModal({
|
|
37
37
|
const windowWidth = window.innerWidth;
|
38
38
|
if (field.current !== null) {
|
39
39
|
const inputWidth = ((_b = (_a2 = field == null ? void 0 : field.current) == null ? void 0 : _a2.parentElement) == null ? void 0 : _b.offsetWidth) || 0;
|
40
|
-
const inputHeight = (_d = (_c = field == null ? void 0 : field.current) == null ? void 0 : _c.parentElement) == null ? void 0 : _d.offsetHeight;
|
40
|
+
const inputHeight = ((_d = (_c = field == null ? void 0 : field.current) == null ? void 0 : _c.parentElement) == null ? void 0 : _d.offsetHeight) || 0;
|
41
41
|
const inputPosition = field.current.getBoundingClientRect();
|
42
42
|
const calendarSize = field.current.offsetHeight;
|
43
|
-
if (windowHeight < inputPosition.y + calendarSize) {
|
43
|
+
if (windowHeight < inputPosition.y + calendarSize + inputHeight) {
|
44
44
|
field.current.style.top = -calendarSize + "px";
|
45
45
|
} else {
|
46
46
|
field.current.style.top = inputHeight + "px";
|
@@ -120,67 +120,83 @@ function DatePickerModal({
|
|
120
120
|
);
|
121
121
|
onExit();
|
122
122
|
};
|
123
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
}
|
134
|
-
),
|
135
|
-
/* @__PURE__ */ jsxs("div", { className: cls["d"], onClick: () => onType == null ? void 0 : onType("months"), children: [
|
136
|
-
(_a = formating.Month(month.m)) == null ? void 0 : _a.name,
|
137
|
-
"’",
|
138
|
-
month.y.toString().slice(-2),
|
139
|
-
/* @__PURE__ */ jsx(Icon, { iconName: "DropdownArrowBottom16px" })
|
140
|
-
] }),
|
141
|
-
/* @__PURE__ */ jsx(
|
142
|
-
Button,
|
143
|
-
{
|
144
|
-
isIconButton: true,
|
145
|
-
iconName: "DropdownArrowRight16px",
|
146
|
-
onClick: next,
|
147
|
-
variant: "secondary-gray",
|
148
|
-
size: "l"
|
149
|
-
}
|
150
|
-
)
|
151
|
-
] }),
|
152
|
-
/* @__PURE__ */ jsxs("div", { className: cls["b"], children: [
|
153
|
-
week.map((i, s) => /* @__PURE__ */ jsx(
|
154
|
-
"div",
|
155
|
-
{
|
156
|
-
className: `${s > countWorkDays ? [cls["m"], cls["orange"]].join(" ") : cls["m"]}`,
|
157
|
-
children: i
|
158
|
-
},
|
159
|
-
`v${s}`
|
160
|
-
)),
|
161
|
-
prevDaysArray.map((el, key) => /* @__PURE__ */ jsx("div", { className: cls["m"], children: el }, key)),
|
162
|
-
days.map((i, s) => /* @__PURE__ */ jsx(
|
163
|
-
"div",
|
164
|
-
{
|
165
|
-
className: isBefore(
|
166
|
-
(/* @__PURE__ */ new Date(
|
167
|
-
`${month.y}-${formating.Number(2, month.m)}-${formating.Number(2, i)}`
|
168
|
-
)).getTime()
|
169
|
-
) ? cls["m"] : cls["a"],
|
170
|
-
children: i !== 0 ? /* @__PURE__ */ jsx(
|
171
|
-
"b",
|
123
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
124
|
+
"div",
|
125
|
+
{
|
126
|
+
className: [cls["calendar-block"]].join(" "),
|
127
|
+
ref: field,
|
128
|
+
"data-testid": "calendar-modal",
|
129
|
+
children: [
|
130
|
+
/* @__PURE__ */ jsxs("div", { className: cls["h"], children: [
|
131
|
+
/* @__PURE__ */ jsx(
|
132
|
+
Button,
|
172
133
|
{
|
173
|
-
|
174
|
-
|
175
|
-
|
134
|
+
isIconButton: true,
|
135
|
+
iconName: "DropdownArrowLeft16px",
|
136
|
+
onClick: prev,
|
137
|
+
variant: "secondary-gray",
|
138
|
+
size: "l"
|
139
|
+
}
|
140
|
+
),
|
141
|
+
/* @__PURE__ */ jsxs(
|
142
|
+
"div",
|
143
|
+
{
|
144
|
+
className: cls["d"],
|
145
|
+
onClick: () => onType == null ? void 0 : onType("months"),
|
146
|
+
"data-testid": "month-year-button",
|
147
|
+
children: [
|
148
|
+
(_a = formating.Month(month.m)) == null ? void 0 : _a.name,
|
149
|
+
"’",
|
150
|
+
month.y.toString().slice(-2),
|
151
|
+
/* @__PURE__ */ jsx(Icon, { iconName: "DropdownArrowBottom16px" })
|
152
|
+
]
|
153
|
+
}
|
154
|
+
),
|
155
|
+
/* @__PURE__ */ jsx(
|
156
|
+
Button,
|
157
|
+
{
|
158
|
+
isIconButton: true,
|
159
|
+
iconName: "DropdownArrowRight16px",
|
160
|
+
onClick: next,
|
161
|
+
variant: "secondary-gray",
|
162
|
+
size: "l"
|
176
163
|
}
|
177
|
-
)
|
178
|
-
},
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
164
|
+
)
|
165
|
+
] }),
|
166
|
+
/* @__PURE__ */ jsxs("div", { className: cls["b"], children: [
|
167
|
+
week.map((i, s) => /* @__PURE__ */ jsx(
|
168
|
+
"div",
|
169
|
+
{
|
170
|
+
className: `${s > countWorkDays ? [cls["m"], cls["orange"]].join(" ") : cls["m"]}`,
|
171
|
+
children: i
|
172
|
+
},
|
173
|
+
`v${s}`
|
174
|
+
)),
|
175
|
+
prevDaysArray.map((el, key) => /* @__PURE__ */ jsx("div", { className: cls["m"], children: el }, key)),
|
176
|
+
days.map((i, s) => /* @__PURE__ */ jsx(
|
177
|
+
"div",
|
178
|
+
{
|
179
|
+
className: isBefore(
|
180
|
+
(/* @__PURE__ */ new Date(
|
181
|
+
`${month.y}-${formating.Number(2, month.m)}-${formating.Number(2, i)}`
|
182
|
+
)).getTime()
|
183
|
+
) ? cls["m"] : cls["a"],
|
184
|
+
children: i !== 0 ? /* @__PURE__ */ jsx(
|
185
|
+
"b",
|
186
|
+
{
|
187
|
+
className: current.y === month.y && current.m === month.m && current.d === i ? cls["current"] : "",
|
188
|
+
onClick: () => send(i),
|
189
|
+
children: i
|
190
|
+
}
|
191
|
+
) : /* @__PURE__ */ jsx("p", {})
|
192
|
+
},
|
193
|
+
s
|
194
|
+
)),
|
195
|
+
nextDaysArray.map((el, key) => /* @__PURE__ */ jsx("div", { className: cls["m"], children: el }, key))
|
196
|
+
] })
|
197
|
+
]
|
198
|
+
}
|
199
|
+
) });
|
184
200
|
}
|
185
201
|
export {
|
186
202
|
DatePickerModal
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
2
2
|
import { useRef, useState, useEffect } from "react";
|
3
3
|
import { months } from "./constants.js";
|
4
|
-
import { c as cls } from "../../styles.module-
|
4
|
+
import { c as cls } from "../../styles.module-B9L4B63y.js";
|
5
5
|
import { Icon } from "../../icons/Icon.js";
|
6
6
|
import { formating } from "../../utils/index.js";
|
7
7
|
import { Button } from "../Button/Button.js";
|
@@ -84,10 +84,18 @@ function MonthPickerModal({
|
|
84
84
|
size: "l"
|
85
85
|
}
|
86
86
|
),
|
87
|
-
/* @__PURE__ */ jsxs(
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
/* @__PURE__ */ jsxs(
|
88
|
+
"div",
|
89
|
+
{
|
90
|
+
onClick: () => onType == null ? void 0 : onType("years"),
|
91
|
+
className: cls["d"],
|
92
|
+
"data-testid": "year-button",
|
93
|
+
children: [
|
94
|
+
year.toString(),
|
95
|
+
/* @__PURE__ */ jsx(Icon, { iconName: "DropdownArrowBottom16px" })
|
96
|
+
]
|
97
|
+
}
|
98
|
+
),
|
91
99
|
/* @__PURE__ */ jsx(
|
92
100
|
Button,
|
93
101
|
{
|
@@ -99,7 +107,7 @@ function MonthPickerModal({
|
|
99
107
|
}
|
100
108
|
)
|
101
109
|
] }),
|
102
|
-
/* @__PURE__ */ jsx("div", { className: cls["monthGrid"], children: months.map((i, s) => /* @__PURE__ */ jsx(
|
110
|
+
/* @__PURE__ */ jsx("div", { className: cls["monthGrid"], "data-testid": "month-picker", children: months.map((i, s) => /* @__PURE__ */ jsx(
|
103
111
|
"div",
|
104
112
|
{
|
105
113
|
className: isBefore(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
2
2
|
import { useRef, useState, useEffect } from "react";
|
3
|
-
import { c as cls } from "../../styles.module-
|
3
|
+
import { c as cls } from "../../styles.module-B9L4B63y.js";
|
4
4
|
import { formating } from "../../utils/index.js";
|
5
5
|
import { Button } from "../Button/Button.js";
|
6
6
|
function YearPickerModal({
|
@@ -96,7 +96,7 @@ function YearPickerModal({
|
|
96
96
|
}
|
97
97
|
)
|
98
98
|
] }),
|
99
|
-
/* @__PURE__ */ jsx("div", { className: cls["monthGrid"], children: years.map((i, s) => /* @__PURE__ */ jsx(
|
99
|
+
/* @__PURE__ */ jsx("div", { className: cls["monthGrid"], "data-testid": "year-picker", children: years.map((i, s) => /* @__PURE__ */ jsx(
|
100
100
|
"div",
|
101
101
|
{
|
102
102
|
className: isBefore(
|
@@ -0,0 +1,16 @@
|
|
1
|
+
const YEAR_OFFSET = 20;
|
2
|
+
const CENTURY = 100;
|
3
|
+
const formatDatePart = (value, max) => {
|
4
|
+
const num = parseInt(value);
|
5
|
+
return num > max ? max.toString() : value;
|
6
|
+
};
|
7
|
+
const getFullYear = (year) => {
|
8
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
9
|
+
const currentCentury = Math.floor(currentYear / CENTURY) * CENTURY;
|
10
|
+
const fullYear = parseInt(year) + currentCentury;
|
11
|
+
return fullYear > currentYear + YEAR_OFFSET ? fullYear - CENTURY : fullYear;
|
12
|
+
};
|
13
|
+
export {
|
14
|
+
formatDatePart,
|
15
|
+
getFullYear
|
16
|
+
};
|
@@ -10,40 +10,40 @@ import { Button } from "../Button/Button.js";
|
|
10
10
|
import { EButtonVariantDefault, EButtonSize } from "../Button/constants.js";
|
11
11
|
import { Loader } from "../Loader/Loader.js";
|
12
12
|
import { Portal } from "../Portal/Portal.js";
|
13
|
-
import '../../assets/Drawer.css';const drawer = "
|
14
|
-
const content = "
|
15
|
-
const header = "
|
16
|
-
const title = "
|
17
|
-
const space = "
|
18
|
-
const inner = "
|
19
|
-
const button = "
|
20
|
-
const footer = "
|
21
|
-
const left = "
|
22
|
-
const right = "
|
23
|
-
const full = "
|
24
|
-
const bottom = "
|
25
|
-
const opened = "
|
26
|
-
const overlay = "
|
27
|
-
const unmount = "
|
13
|
+
import '../../assets/Drawer.css';const drawer = "_drawer_1xs4d_3";
|
14
|
+
const content = "_content_1xs4d_27";
|
15
|
+
const header = "_header_1xs4d_45";
|
16
|
+
const title = "_title_1xs4d_59";
|
17
|
+
const space = "_space_1xs4d_73";
|
18
|
+
const inner = "_inner_1xs4d_84";
|
19
|
+
const button = "_button_1xs4d_87";
|
20
|
+
const footer = "_footer_1xs4d_92";
|
21
|
+
const left = "_left_1xs4d_105";
|
22
|
+
const right = "_right_1xs4d_109";
|
23
|
+
const full = "_full_1xs4d_113";
|
24
|
+
const bottom = "_bottom_1xs4d_123";
|
25
|
+
const opened = "_opened_1xs4d_140";
|
26
|
+
const overlay = "_overlay_1xs4d_196";
|
27
|
+
const unmount = "_unmount_1xs4d_212";
|
28
28
|
const cls = {
|
29
29
|
drawer,
|
30
30
|
content,
|
31
|
-
"is-loading": "_is-
|
31
|
+
"is-loading": "_is-loading_1xs4d_41",
|
32
32
|
header,
|
33
|
-
"sticky-header": "_sticky-
|
33
|
+
"sticky-header": "_sticky-header_1xs4d_53",
|
34
34
|
title,
|
35
35
|
space,
|
36
36
|
inner,
|
37
37
|
button,
|
38
38
|
footer,
|
39
|
-
"footer-button": "_footer-
|
39
|
+
"footer-button": "_footer-button_1xs4d_101",
|
40
40
|
left,
|
41
41
|
right,
|
42
42
|
full,
|
43
43
|
bottom,
|
44
|
-
"full-bottom-height": "_full-bottom-
|
44
|
+
"full-bottom-height": "_full-bottom-height_1xs4d_134",
|
45
45
|
opened,
|
46
|
-
"is-closing": "_is-
|
46
|
+
"is-closing": "_is-closing_1xs4d_159",
|
47
47
|
overlay,
|
48
48
|
unmount
|
49
49
|
};
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
2
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
|
+
import { EGosZnakSize, EGosZnakType } from "./constants.js";
|
4
|
+
import '../../assets/GosZnak.css';const number = "_number_dr109_13";
|
5
|
+
const region = "_region_dr109_32";
|
6
|
+
const country = "_country_dr109_46";
|
7
|
+
const l = "_l_dr109_53";
|
8
|
+
const s = "_s_dr109_62";
|
9
|
+
const normal = "_normal_dr109_71";
|
10
|
+
const traffic = "_traffic_dr109_78";
|
11
|
+
const military = "_military_dr109_85";
|
12
|
+
const police = "_police_dr109_92";
|
13
|
+
const diplomatic = "_diplomatic_dr109_99";
|
14
|
+
const cls = {
|
15
|
+
"gos-znak": "_gos-znak_dr109_2",
|
16
|
+
number,
|
17
|
+
"number-container": "_number-container_dr109_22",
|
18
|
+
region,
|
19
|
+
"region-container": "_region-container_dr109_38",
|
20
|
+
country,
|
21
|
+
l,
|
22
|
+
s,
|
23
|
+
normal,
|
24
|
+
traffic,
|
25
|
+
military,
|
26
|
+
police,
|
27
|
+
diplomatic
|
28
|
+
};
|
29
|
+
const GosZnak = ({
|
30
|
+
number: number2,
|
31
|
+
region: region2,
|
32
|
+
country: country2,
|
33
|
+
size = EGosZnakSize.L,
|
34
|
+
type = EGosZnakType.Normal,
|
35
|
+
className,
|
36
|
+
numberClassName,
|
37
|
+
regionClassName,
|
38
|
+
countryClassName,
|
39
|
+
numberContainerClassName,
|
40
|
+
regionContainerClassName
|
41
|
+
}) => {
|
42
|
+
return /* @__PURE__ */ jsxs(
|
43
|
+
"div",
|
44
|
+
{
|
45
|
+
className: classNames(cls["gos-znak"], cls[size], cls[type], className),
|
46
|
+
children: [
|
47
|
+
/* @__PURE__ */ jsx(
|
48
|
+
"div",
|
49
|
+
{
|
50
|
+
className: classNames(
|
51
|
+
cls["number-container"],
|
52
|
+
numberContainerClassName
|
53
|
+
),
|
54
|
+
children: /* @__PURE__ */ jsx("span", { className: classNames(cls.number, numberClassName), children: number2 })
|
55
|
+
}
|
56
|
+
),
|
57
|
+
/* @__PURE__ */ jsxs(
|
58
|
+
"div",
|
59
|
+
{
|
60
|
+
className: classNames(
|
61
|
+
cls["region-container"],
|
62
|
+
regionContainerClassName
|
63
|
+
),
|
64
|
+
children: [
|
65
|
+
/* @__PURE__ */ jsx("span", { className: classNames(cls.region, regionClassName), children: region2 }),
|
66
|
+
/* @__PURE__ */ jsx("span", { className: classNames(cls.country, countryClassName), children: country2 })
|
67
|
+
]
|
68
|
+
}
|
69
|
+
)
|
70
|
+
]
|
71
|
+
}
|
72
|
+
);
|
73
|
+
};
|
74
|
+
export {
|
75
|
+
GosZnak
|
76
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
var EGosZnakSize = /* @__PURE__ */ ((EGosZnakSize2) => {
|
2
|
+
EGosZnakSize2["S"] = "s";
|
3
|
+
EGosZnakSize2["L"] = "l";
|
4
|
+
return EGosZnakSize2;
|
5
|
+
})(EGosZnakSize || {});
|
6
|
+
var EGosZnakType = /* @__PURE__ */ ((EGosZnakType2) => {
|
7
|
+
EGosZnakType2["Normal"] = "normal";
|
8
|
+
EGosZnakType2["Traffic"] = "traffic";
|
9
|
+
EGosZnakType2["Military"] = "military";
|
10
|
+
EGosZnakType2["Police"] = "police";
|
11
|
+
EGosZnakType2["Diplomatic"] = "diplomatic";
|
12
|
+
return EGosZnakType2;
|
13
|
+
})(EGosZnakType || {});
|
14
|
+
export {
|
15
|
+
EGosZnakSize,
|
16
|
+
EGosZnakType
|
17
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { EGosZnakSize, EGosZnakType } from './constants';
|
2
|
+
|
3
|
+
export type TGosZnakProps = {
|
4
|
+
/** Номер государственного знака */
|
5
|
+
number: string;
|
6
|
+
/** Код региона */
|
7
|
+
region: string;
|
8
|
+
/** Код страны */
|
9
|
+
country: string;
|
10
|
+
/** Размер госзнака. Если не указан, по умолчанию используется большой размер */
|
11
|
+
size?: EGosZnakSize | `${EGosZnakSize}`;
|
12
|
+
/** Тип госзнака. Если не указан, по умолчанию используется обычный тип */
|
13
|
+
type?: EGosZnakType | `${EGosZnakType}`;
|
14
|
+
/** Дополнительный CSS класс для стилизации */
|
15
|
+
className?: string;
|
16
|
+
/** Дополнительный CSS класс для стилизации номера */
|
17
|
+
numberClassName?: string;
|
18
|
+
/** Дополнительный CSS класс для стилизации региона */
|
19
|
+
regionClassName?: string;
|
20
|
+
/** Дополнительный CSS класс для стилизации страны */
|
21
|
+
countryClassName?: string;
|
22
|
+
/** Дополнительный CSS класс для стилизации контейнера номера */
|
23
|
+
numberContainerClassName?: string;
|
24
|
+
/** Дополнительный CSS класс для стилизации контейнера региона */
|
25
|
+
regionContainerClassName?: string;
|
26
|
+
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
-
import { TInputProps, TAddon, TIconAddon, TSize, TVariant } from './types';
|
2
|
+
import { TInputProps, TAddon, TIconAddon, TSize, TVariant, TStatus } from './types';
|
3
3
|
|
4
4
|
export type TAdditionalProps = {
|
5
5
|
/**
|
@@ -10,6 +10,10 @@ export type TAdditionalProps = {
|
|
10
10
|
* `Варианты отображения ввода. Может быть 'alert', 'success', 'default', 'default-gray', 'default-white'.`
|
11
11
|
*/
|
12
12
|
variant?: TVariant;
|
13
|
+
/**
|
14
|
+
* `Статус ввода. Может быть 'alert', 'success', 'error'.`
|
15
|
+
*/
|
16
|
+
status?: TStatus;
|
13
17
|
/**
|
14
18
|
* Дополнительный класс.
|
15
19
|
*/
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
2
2
|
import "../../index-CweZ_OcN.js";
|
3
3
|
import "react";
|
4
4
|
import "./constants.js";
|
5
|
-
import { I } from "../../Input-
|
5
|
+
import { I } from "../../Input-DspsU5F4.js";
|
6
6
|
import "../../hooks/useMergeRefs/useMergeRefs.js";
|
7
7
|
import "../../icons/Icon.js";
|
8
8
|
import "../Button/Button.js";
|
@@ -1,10 +1,12 @@
|
|
1
1
|
export declare enum EInputVariant {
|
2
|
-
Alarm = "alarm",
|
3
|
-
Success = "success",
|
4
|
-
Error = "error",
|
5
2
|
DefaultGray = "default-gray",
|
6
3
|
DefaultWhite = "default-white"
|
7
4
|
}
|
5
|
+
export declare enum EInputStatus {
|
6
|
+
Alarm = "alarm",
|
7
|
+
Success = "success",
|
8
|
+
Error = "error"
|
9
|
+
}
|
8
10
|
export declare enum EInputSize {
|
9
11
|
S = "s",
|
10
12
|
M = "m",
|
@@ -1,11 +1,14 @@
|
|
1
1
|
var EInputVariant = /* @__PURE__ */ ((EInputVariant2) => {
|
2
|
-
EInputVariant2["Alarm"] = "alarm";
|
3
|
-
EInputVariant2["Success"] = "success";
|
4
|
-
EInputVariant2["Error"] = "error";
|
5
2
|
EInputVariant2["DefaultGray"] = "default-gray";
|
6
3
|
EInputVariant2["DefaultWhite"] = "default-white";
|
7
4
|
return EInputVariant2;
|
8
5
|
})(EInputVariant || {});
|
6
|
+
var EInputStatus = /* @__PURE__ */ ((EInputStatus2) => {
|
7
|
+
EInputStatus2["Alarm"] = "alarm";
|
8
|
+
EInputStatus2["Success"] = "success";
|
9
|
+
EInputStatus2["Error"] = "error";
|
10
|
+
return EInputStatus2;
|
11
|
+
})(EInputStatus || {});
|
9
12
|
var EInputSize = /* @__PURE__ */ ((EInputSize2) => {
|
10
13
|
EInputSize2["S"] = "s";
|
11
14
|
EInputSize2["M"] = "m";
|
@@ -14,5 +17,6 @@ var EInputSize = /* @__PURE__ */ ((EInputSize2) => {
|
|
14
17
|
})(EInputSize || {});
|
15
18
|
export {
|
16
19
|
EInputSize,
|
20
|
+
EInputStatus,
|
17
21
|
EInputVariant
|
18
22
|
};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
export { Input, type TProps as TInputProps, type TAdditionalProps } from './Input';
|
2
|
-
export type { TSize, TVariant } from './types';
|
3
|
-
export { EInputSize, EInputVariant } from './constants';
|
2
|
+
export type { TSize, TVariant, TStatus } from './types';
|
3
|
+
export { EInputSize, EInputVariant, EInputStatus } from './constants';
|