kamotive_ui 1.2.21 → 1.2.23
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/Icons/ChevronDown/ChevronDown.d.ts +8 -0
- package/dist/Icons/ChevronDown/ChevronDown.js +6 -0
- package/dist/Icons/ChevronLeft/ChevronLeft.d.ts +2 -1
- package/dist/Icons/ChevronLeft/ChevronLeft.js +4 -3
- package/dist/Icons/ChevronRight/ChevronRight.d.ts +2 -1
- package/dist/Icons/ChevronRight/ChevronRight.js +4 -3
- package/dist/Icons/ChevronUp/ChevronUp.d.ts +7 -0
- package/dist/Icons/ChevronUp/ChevronUp.js +5 -0
- package/dist/Icons/IconAccount/IconAccount.d.ts +7 -0
- package/dist/Icons/IconAccount/IconAccount.js +5 -0
- package/dist/Icons/IconAdd/IconAdd.d.ts +2 -1
- package/dist/Icons/IconAdd/IconAdd.js +3 -3
- package/dist/Icons/IconAddress/IconAddress.d.ts +7 -0
- package/dist/Icons/IconAddress/IconAddress.js +5 -0
- package/dist/Icons/IconAlarm/IconAlarm.d.ts +7 -0
- package/dist/Icons/IconAlarm/IconAlarm.js +5 -0
- package/dist/Icons/IconBell/IconBell.d.ts +7 -0
- package/dist/Icons/IconBell/IconBell.js +5 -0
- package/dist/Icons/IconBriefcase/IconBriefcase.d.ts +7 -0
- package/dist/Icons/IconBriefcase/IconBriefcase.js +5 -0
- package/dist/Icons/IconCalendar/IconCalendar.d.ts +7 -0
- package/dist/Icons/IconCalendar/IconCalendar.js +5 -0
- package/dist/Icons/IconCheck/IconCheck.d.ts +7 -0
- package/dist/Icons/IconCheck/IconCheck.js +5 -0
- package/dist/Icons/IconClose/IconClose.d.ts +8 -0
- package/dist/Icons/IconClose/IconClose.js +7 -0
- package/dist/Icons/IconColorPicker/IconColorPicker.d.ts +8 -0
- package/dist/Icons/IconColorPicker/IconColorPicker.js +5 -0
- package/dist/Icons/IconDelete/IconDelete.d.ts +8 -0
- package/dist/Icons/IconDelete/IconDelete.js +5 -0
- package/dist/Icons/IconDownload/IconDownload.d.ts +11 -1
- package/dist/Icons/IconDownload/IconDownload.js +12 -3
- package/dist/Icons/IconDublicate/IconDublicate.d.ts +8 -0
- package/dist/Icons/IconDublicate/IconDublicate.js +5 -0
- package/dist/Icons/IconEmail/IconEmail.d.ts +2 -1
- package/dist/Icons/IconEmail/IconEmail.js +3 -3
- package/dist/Icons/IconError/IconError.d.ts +7 -0
- package/dist/Icons/IconError/IconError.js +6 -0
- package/dist/Icons/IconEye/{IconEye10.d.ts → IconEye.d.ts} +1 -1
- package/dist/Icons/IconEye/{IconEye10.js → IconEye.js} +1 -1
- package/dist/Icons/IconEyeOff/IconEyeOff.d.ts +7 -0
- package/dist/Icons/IconEyeOff/IconEyeOff.js +5 -0
- package/dist/Icons/IconFile/IconFile.d.ts +2 -1
- package/dist/Icons/IconFile/IconFile.js +3 -3
- package/dist/Icons/{IconClose/IconClose10.d.ts → IconGoTo/IconGoTo.d.ts} +3 -2
- package/dist/Icons/IconGoTo/IconGoTo.js +5 -0
- package/dist/Icons/IconHome/IconHome.d.ts +8 -0
- package/dist/Icons/IconHome/IconHome.js +5 -0
- package/dist/Icons/IconInfo/IconInfo.d.ts +7 -0
- package/dist/Icons/IconInfo/IconInfo.js +5 -0
- package/dist/Icons/IconPencil/IconPencil.d.ts +2 -1
- package/dist/Icons/IconPencil/IconPencil.js +3 -3
- package/dist/Icons/IconPhone/IconPhone.d.ts +2 -1
- package/dist/Icons/IconPhone/IconPhone.js +3 -3
- package/dist/Icons/IconSpaceChange/IconSpaceChange.d.ts +8 -0
- package/dist/Icons/IconSpaceChange/IconSpaceChange.js +5 -0
- package/dist/Icons/IconSuccess/IconSuccess.d.ts +7 -0
- package/dist/Icons/IconSuccess/IconSuccess.js +6 -0
- package/dist/Icons/IconUpload/IconUpload.d.ts +4 -1
- package/dist/Icons/IconUpload/IconUpload.js +5 -3
- package/dist/Icons/IconWarning/IconWarning.d.ts +7 -0
- package/dist/Icons/IconWarning/IconWarning.js +5 -0
- package/dist/Icons/index.d.ts +22 -17
- package/dist/Icons/index.js +22 -17
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/ColorPicker/ColorPicker.js +2 -2
- package/dist/components/ColorPicker/ColorPicker.module.css +6 -1
- package/dist/components/DateInput/DateInput.js +51 -27
- package/dist/components/Dropdown/Dropdown.js +64 -30
- package/dist/components/Dropdown/Dropdown.module.css +23 -7
- package/dist/components/FileItem/FileItem.js +3 -3
- package/dist/components/FileItem/FileItem.module.css +2 -2
- package/dist/components/FileLoader/FileLoader.js +1 -1
- package/dist/components/IconButton/IconButton.module.css +6 -6
- package/dist/components/Input/Input.module.css +0 -1
- package/dist/components/List/List.js +2 -2
- package/dist/components/Snackbar/Snackbar.js +6 -6
- package/dist/components/Snackbar/Snackbar.module.css +2 -0
- package/dist/components/Tooltip/Tooltip.module.css +1 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/Icons/ChevronDown/ChevronDown10.d.ts +0 -7
- package/dist/Icons/ChevronDown/ChevronDown10.js +0 -6
- package/dist/Icons/ChevronUp/ChevronUp10.d.ts +0 -6
- package/dist/Icons/ChevronUp/ChevronUp10.js +0 -5
- package/dist/Icons/IconAccount/IconAccount10.d.ts +0 -6
- package/dist/Icons/IconAccount/IconAccount10.js +0 -5
- package/dist/Icons/IconAlarm/IconAlarm10.d.ts +0 -6
- package/dist/Icons/IconAlarm/IconAlarm10.js +0 -5
- package/dist/Icons/IconBank/IconBank10.d.ts +0 -6
- package/dist/Icons/IconBank/IconBank10.js +0 -5
- package/dist/Icons/IconBell/IconBell10.d.ts +0 -6
- package/dist/Icons/IconBell/IconBell10.js +0 -5
- package/dist/Icons/IconBriefcase/IconBriefcase10.d.ts +0 -6
- package/dist/Icons/IconBriefcase/IconBriefcase10.js +0 -5
- package/dist/Icons/IconCalendar/IconCalendar10.d.ts +0 -6
- package/dist/Icons/IconCalendar/IconCalendar10.js +0 -5
- package/dist/Icons/IconCheck/IconCheck10.d.ts +0 -6
- package/dist/Icons/IconCheck/IconCheck10.js +0 -5
- package/dist/Icons/IconClose/IconClose10.js +0 -5
- package/dist/Icons/IconColorPicker/IconColorPicker10.d.ts +0 -7
- package/dist/Icons/IconColorPicker/IconColorPicker10.js +0 -5
- package/dist/Icons/IconError/IconError10.d.ts +0 -6
- package/dist/Icons/IconError/IconError10.js +0 -5
- package/dist/Icons/IconEyeOff/IconEyeOff10.d.ts +0 -6
- package/dist/Icons/IconEyeOff/IconEyeOff10.js +0 -5
- package/dist/Icons/IconInfo/IconInfo10.d.ts +0 -6
- package/dist/Icons/IconInfo/IconInfo10.js +0 -5
- package/dist/Icons/IconSuccess/IconSuccess10.d.ts +0 -6
- package/dist/Icons/IconSuccess/IconSuccess10.js +0 -5
- package/dist/Icons/IconWarning/IconWarning10.d.ts +0 -6
- package/dist/Icons/IconWarning/IconWarning10.js +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const IconWarning = ({ color = 'inherit', htmlColor, strokeWidth = '0.3', style }) => {
|
|
3
|
+
return (React.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: color, style: style },
|
|
4
|
+
React.createElement("path", { fill: htmlColor || 'currentColor', stroke: htmlColor || 'currentColor', style: { strokeWidth: strokeWidth }, strokeLinejoin: "round", d: "M1,21L11.5,2.81L22,21H1M20.27,20L11.5,4.81L2.73,20H20.27M11,14V10H12V14H11M11,16H12V18H11V16Z" })));
|
|
5
|
+
};
|
package/dist/Icons/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ChevronDown } from './ChevronDown/ChevronDown';
|
|
2
2
|
export { ChevronRight } from './ChevronRight/ChevronRight';
|
|
3
3
|
export { ChevronLeft } from './ChevronLeft/ChevronLeft';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
4
|
+
export { ChevronUp } from './ChevronUp/ChevronUp';
|
|
5
|
+
export { IconAlarm } from './IconAlarm/IconAlarm';
|
|
6
|
+
export { IconAccount } from './IconAccount/IconAccount';
|
|
7
|
+
export { IconAddress } from './IconAddress/IconAddress';
|
|
8
|
+
export { IconBell } from './IconBell/IconBell';
|
|
9
|
+
export { IconBriefcase } from './IconBriefcase/IconBriefcase';
|
|
10
|
+
export { IconCalendar } from './IconCalendar/IconCalendar';
|
|
11
|
+
export { IconCheck } from './IconCheck/IconCheck';
|
|
12
|
+
export { IconEyeOff } from './IconEyeOff/IconEyeOff';
|
|
13
|
+
export { IconSuccess } from './IconSuccess/IconSuccess';
|
|
14
|
+
export { IconInfo } from './IconInfo/IconInfo';
|
|
15
|
+
export { IconWarning } from './IconWarning/IconWarning';
|
|
16
|
+
export { IconError } from './IconError/IconError';
|
|
17
|
+
export { IconClose } from './IconClose/IconClose';
|
|
18
|
+
export { IconColorPicker } from './IconColorPicker/IconColorPicker';
|
|
19
19
|
export { IconFile } from './IconFile/IconFile';
|
|
20
20
|
export { IconUpload } from './IconUpload/IconUpload';
|
|
21
21
|
export { IconDownload } from './IconDownload/IconDownload';
|
|
@@ -23,5 +23,10 @@ export { IconAdd } from './IconAdd/IconAdd';
|
|
|
23
23
|
export { IconPhone } from './IconPhone/IconPhone';
|
|
24
24
|
export { IconLocation } from './IconLocation/IconLocation';
|
|
25
25
|
export { IconEmail } from './IconEmail/IconEmail';
|
|
26
|
-
export {
|
|
26
|
+
export { IconEye } from './IconEye/IconEye';
|
|
27
27
|
export { IconPencil } from './IconPencil/IconPencil';
|
|
28
|
+
export { IconDelete } from './IconDelete/IconDelete';
|
|
29
|
+
export { IconDublicate } from './IconDublicate/IconDublicate';
|
|
30
|
+
export { IconSpaceChange } from './IconSpaceChange/IconSpaceChange';
|
|
31
|
+
export { IconGoTo } from './IconGoTo/IconGoTo';
|
|
32
|
+
export { IconHome } from './IconHome/IconHome';
|
package/dist/Icons/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ChevronDown } from './ChevronDown/ChevronDown';
|
|
2
2
|
export { ChevronRight } from './ChevronRight/ChevronRight';
|
|
3
3
|
export { ChevronLeft } from './ChevronLeft/ChevronLeft';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
4
|
+
export { ChevronUp } from './ChevronUp/ChevronUp';
|
|
5
|
+
export { IconAlarm } from './IconAlarm/IconAlarm';
|
|
6
|
+
export { IconAccount } from './IconAccount/IconAccount';
|
|
7
|
+
export { IconAddress } from './IconAddress/IconAddress';
|
|
8
|
+
export { IconBell } from './IconBell/IconBell';
|
|
9
|
+
export { IconBriefcase } from './IconBriefcase/IconBriefcase';
|
|
10
|
+
export { IconCalendar } from './IconCalendar/IconCalendar';
|
|
11
|
+
export { IconCheck } from './IconCheck/IconCheck';
|
|
12
|
+
export { IconEyeOff } from './IconEyeOff/IconEyeOff';
|
|
13
|
+
export { IconSuccess } from './IconSuccess/IconSuccess';
|
|
14
|
+
export { IconInfo } from './IconInfo/IconInfo';
|
|
15
|
+
export { IconWarning } from './IconWarning/IconWarning';
|
|
16
|
+
export { IconError } from './IconError/IconError';
|
|
17
|
+
export { IconClose } from './IconClose/IconClose';
|
|
18
|
+
export { IconColorPicker } from './IconColorPicker/IconColorPicker';
|
|
19
19
|
export { IconFile } from './IconFile/IconFile';
|
|
20
20
|
export { IconUpload } from './IconUpload/IconUpload';
|
|
21
21
|
export { IconDownload } from './IconDownload/IconDownload';
|
|
@@ -23,5 +23,10 @@ export { IconAdd } from './IconAdd/IconAdd';
|
|
|
23
23
|
export { IconPhone } from './IconPhone/IconPhone';
|
|
24
24
|
export { IconLocation } from './IconLocation/IconLocation';
|
|
25
25
|
export { IconEmail } from './IconEmail/IconEmail';
|
|
26
|
-
export {
|
|
26
|
+
export { IconEye } from './IconEye/IconEye';
|
|
27
27
|
export { IconPencil } from './IconPencil/IconPencil';
|
|
28
|
+
export { IconDelete } from './IconDelete/IconDelete';
|
|
29
|
+
export { IconDublicate } from './IconDublicate/IconDublicate';
|
|
30
|
+
export { IconSpaceChange } from './IconSpaceChange/IconSpaceChange';
|
|
31
|
+
export { IconGoTo } from './IconGoTo/IconGoTo';
|
|
32
|
+
export { IconHome } from './IconHome/IconHome';
|
|
@@ -13,5 +13,5 @@ export const Breadcrumb = ({ onClick, active, label, icon, children }) => {
|
|
|
13
13
|
const iconClassNames = classNames(childrenClassNames, styles.icon);
|
|
14
14
|
return (React.createElement("button", { className: classNames(styles.breadcrumb), onClick: handleClick },
|
|
15
15
|
icon && React.createElement("span", { className: iconClassNames }, icon),
|
|
16
|
-
React.createElement(Typography, { variant: "
|
|
16
|
+
React.createElement(Typography, { variant: "Body1-Medium", className: childrenClassNames }, label || children)));
|
|
17
17
|
};
|
|
@@ -4,7 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
import { Chrome } from '@uiw/react-color';
|
|
5
5
|
import EditableInput from '@uiw/react-color-editable-input';
|
|
6
6
|
import { GithubPlacement } from '@uiw/react-color-github';
|
|
7
|
-
import {
|
|
7
|
+
import { IconColorPicker } from '../../Icons';
|
|
8
8
|
;
|
|
9
9
|
// Функция для преобразования HEXA в HEX
|
|
10
10
|
const hexaToHex = (hexa = 'fff') => {
|
|
@@ -149,7 +149,7 @@ export const ColorPicker = ({ color = '#ffffff', mainColor, recentColors, setIsH
|
|
|
149
149
|
height: `${height}px`,
|
|
150
150
|
} }),
|
|
151
151
|
isOpen && (React.createElement("div", { ref: popoverRef, className: popoverClassess },
|
|
152
|
-
isOpen && React.createElement(
|
|
152
|
+
isOpen && React.createElement(IconColorPicker, { className: styles.colorPickerIcon, htmlColor: 'var(--white)' }),
|
|
153
153
|
React.createElement(Chrome, { color: selectedColor, placement: GithubPlacement.Right, onChange: colorChangeHandler, className: styles.customChrome, showEyeDropper: false }),
|
|
154
154
|
React.createElement("div", { className: styles.hex, style: { padding: '0 10px 0 20px' } },
|
|
155
155
|
React.createElement(EditableInput, { value: hexaToHex(selectedColor), style: { width: 68, alignItems: 'flex-start' }, onChange: (e, color) => {
|
|
@@ -3,21 +3,24 @@ import styles from './DateInput.module.css';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Typography } from '../Typography/Typography';
|
|
5
5
|
import DatePicker from 'react-datepicker';
|
|
6
|
-
import {
|
|
6
|
+
import { IconCalendar } from '../../Icons/IconCalendar/IconCalendar';
|
|
7
7
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
8
8
|
import { registerLocale } from 'react-datepicker';
|
|
9
9
|
import { ru } from 'date-fns/locale/ru';
|
|
10
|
+
import { enUS } from 'date-fns/locale/en-US';
|
|
10
11
|
import { ChevronRight } from '../../Icons/ChevronRight/ChevronRight';
|
|
11
12
|
import { ChevronLeft } from '../../Icons/ChevronLeft/ChevronLeft';
|
|
12
13
|
import { Button } from '../Button/Button';
|
|
13
14
|
registerLocale('ru', ru);
|
|
14
|
-
|
|
15
|
+
registerLocale('en', enUS);
|
|
16
|
+
const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, className, disabled = false, readOnly = false, dateFormat = 'dd.MM.yyyy' }, ref) => {
|
|
15
17
|
const inputRef = useRef(null);
|
|
16
18
|
const [selectedPart, setSelectedPart] = useState(null);
|
|
17
19
|
const [tempInput, setTempInput] = useState('');
|
|
18
20
|
const [hasFocus, setHasFocus] = useState(false);
|
|
19
21
|
const [shouldReselect, setShouldReselect] = useState(false);
|
|
20
22
|
const [input, setInput] = useState(value);
|
|
23
|
+
const separator = dateFormat.includes('.') ? '.' : dateFormat.includes('-') ? '-' : '/';
|
|
21
24
|
const positions = {
|
|
22
25
|
day: { start: 0, end: 2 },
|
|
23
26
|
month: { start: 3, end: 5 },
|
|
@@ -74,7 +77,7 @@ const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, cl
|
|
|
74
77
|
selectDatePart('month');
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
|
-
else if (e.key === 'ArrowRight' || e.key ===
|
|
80
|
+
else if (e.key === 'ArrowRight' || e.key === separator) {
|
|
78
81
|
e.preventDefault();
|
|
79
82
|
if (selectedPart === 'day') {
|
|
80
83
|
selectDatePart('month');
|
|
@@ -85,12 +88,13 @@ const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, cl
|
|
|
85
88
|
}
|
|
86
89
|
else if (/^\d$/.test(e.key)) {
|
|
87
90
|
e.preventDefault();
|
|
88
|
-
|
|
91
|
+
const dateRegex = new RegExp(`^\\d{2}\\${separator}\\d{2}\\${separator}\\d{4}$`);
|
|
92
|
+
if (!dateRegex.test(input)) {
|
|
89
93
|
const today = new Date();
|
|
90
94
|
handleDateUpdate(today, e.key);
|
|
91
95
|
return;
|
|
92
96
|
}
|
|
93
|
-
const [day, month, year] = input.split(
|
|
97
|
+
const [day, month, year] = input.split(separator).map((part) => parseInt(part, 10));
|
|
94
98
|
const currentDate = new Date(year, month - 1, day);
|
|
95
99
|
handleDateUpdate(currentDate, e.key);
|
|
96
100
|
}
|
|
@@ -141,7 +145,7 @@ const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, cl
|
|
|
141
145
|
updateInputValue(key, positions.month.start);
|
|
142
146
|
return;
|
|
143
147
|
}
|
|
144
|
-
updateInputValue(key, positions.
|
|
148
|
+
updateInputValue(key, positions.month.start + 1);
|
|
145
149
|
let newMonth = parseInt(newTempInput, 10);
|
|
146
150
|
newDate.setMonth(newMonth - 1);
|
|
147
151
|
onDateChange(newDate);
|
|
@@ -189,9 +193,9 @@ const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, cl
|
|
|
189
193
|
useImperativeHandle(ref, () => ({
|
|
190
194
|
removeSelection,
|
|
191
195
|
}), [removeSelection]);
|
|
192
|
-
return (React.createElement("input", { ref: inputRef, value: input, onClick: handleClick, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, readOnly: readOnly, disabled: disabled, className: className }));
|
|
196
|
+
return (React.createElement("input", { ref: inputRef, value: input, onClick: handleClick, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, onChange: () => { }, readOnly: readOnly, disabled: disabled, className: className }));
|
|
193
197
|
});
|
|
194
|
-
export const DateInput = ({ id, label = 'Выберите дату', size = 'lg', value, style, className, disabled = false, readOnly = false, isLeftLabel = false, icon, error = false, helperText, onChange, onBlur, required = false, minDate = new Date('1975-12-31'), maxDate = new Date('2074-12-31'), inputClassName, calendarClassName, dateFormat = 'dd.MM.yyyy', }) => {
|
|
198
|
+
export const DateInput = ({ id, label = 'Выберите дату', size = 'lg', value, style, className, disabled = false, readOnly = false, isLeftLabel = false, icon, error = false, helperText, onChange, onBlur, required = false, lng = 'ru', minDate = new Date('1975-12-31'), maxDate = new Date('2074-12-31'), inputClassName, calendarClassName, dateFormat = 'dd.MM.yyyy', }) => {
|
|
195
199
|
const wrapperClassess = classNames(styles['wrapper--input'], className, {
|
|
196
200
|
[styles['wrapper--left']]: isLeftLabel,
|
|
197
201
|
[styles['wrapper--input-label']]: label && !isLeftLabel && !required,
|
|
@@ -212,20 +216,36 @@ export const DateInput = ({ id, label = 'Выберите дату', size = 'lg'
|
|
|
212
216
|
const [isMonthPickerOpen, setIsMonthPickerOpen] = useState(false);
|
|
213
217
|
const datePickerRef = useRef(null);
|
|
214
218
|
const inputRef = useRef(null);
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
219
|
+
const weekDays = lng === 'ru' ? ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'] : ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];
|
|
220
|
+
const months = lng === 'ru'
|
|
221
|
+
? [
|
|
222
|
+
'Январь',
|
|
223
|
+
'Февраль',
|
|
224
|
+
'Март',
|
|
225
|
+
'Апрель',
|
|
226
|
+
'Май',
|
|
227
|
+
'Июнь',
|
|
228
|
+
'Июль',
|
|
229
|
+
'Август',
|
|
230
|
+
'Сентябрь',
|
|
231
|
+
'Октябрь',
|
|
232
|
+
'Ноябрь',
|
|
233
|
+
'Декабрь',
|
|
234
|
+
]
|
|
235
|
+
: [
|
|
236
|
+
'January',
|
|
237
|
+
'February',
|
|
238
|
+
'March',
|
|
239
|
+
'April',
|
|
240
|
+
'May',
|
|
241
|
+
'June',
|
|
242
|
+
'July',
|
|
243
|
+
'August',
|
|
244
|
+
'September',
|
|
245
|
+
'October',
|
|
246
|
+
'November',
|
|
247
|
+
'December',
|
|
248
|
+
];
|
|
229
249
|
const years = Array.from({ length: maxDate.getFullYear() - minDate.getFullYear() }, (_, i) => minDate.getFullYear() + i);
|
|
230
250
|
const handleDateChange = (date) => {
|
|
231
251
|
if (date) {
|
|
@@ -297,12 +317,12 @@ export const DateInput = ({ id, label = 'Выберите дату', size = 'lg'
|
|
|
297
317
|
React.createElement("div", { className: styles.buttonContainer },
|
|
298
318
|
React.createElement(Button, { condition: "info", onClick: () => {
|
|
299
319
|
setIsMonthPickerOpen(false);
|
|
300
|
-
} }, "
|
|
320
|
+
} }, lng === 'ru' ? "Отмена" : "Cancel"),
|
|
301
321
|
React.createElement(Button, { onClick: () => {
|
|
302
322
|
date.setMonth(currentMonth);
|
|
303
323
|
date.setFullYear(currentYear);
|
|
304
324
|
setIsMonthPickerOpen(false);
|
|
305
|
-
} }, "
|
|
325
|
+
} }, lng === 'ru' ? "Применить" : "Apply"))));
|
|
306
326
|
};
|
|
307
327
|
const getMonthPickerWithDate = (date) => {
|
|
308
328
|
return () => React.createElement(MonthPicker, { date: date });
|
|
@@ -325,8 +345,12 @@ export const DateInput = ({ id, label = 'Выберите дату', size = 'lg'
|
|
|
325
345
|
};
|
|
326
346
|
return (React.createElement("div", { className: wrapperClassess, style: style },
|
|
327
347
|
label && (React.createElement(Typography, { variant: "Caption", className: labelClasses }, label)),
|
|
328
|
-
React.createElement("div", { className: styles.icon, onClick: () => { var _a; return (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(true); } }, icon || React.createElement(
|
|
329
|
-
React.createElement(DatePicker, Object.assign({ id: id, ref: datePickerRef, selected: selectedDate, onChange: handleDateChange, onBlur: onBlur, dateFormat: dateFormat, locale:
|
|
348
|
+
React.createElement("div", { className: styles.icon, onClick: () => { var _a; return (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(true); } }, icon || React.createElement(IconCalendar, null)),
|
|
349
|
+
React.createElement(DatePicker, Object.assign({ id: id, ref: datePickerRef, selected: selectedDate, onChange: handleDateChange, onBlur: onBlur, dateFormat: dateFormat, locale: lng === 'ru' ? 'ru' : 'en', readOnly: readOnly, disabled: disabled, showPopperArrow: false, calendarClassName: classNames(styles.calendar, calendarClassName), popperClassName: styles.calendarPopper, onCalendarClose: () => setIsMonthPickerOpen(false), minDate: minDate, maxDate: maxDate, inline: false, calendarStartDay: 1, formatWeekDay: (dayName) => {
|
|
350
|
+
const dayIndex = ['понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота', 'воскресенье']
|
|
351
|
+
.findIndex(day => day === dayName);
|
|
352
|
+
return weekDays[dayIndex];
|
|
353
|
+
}, dayClassName: (date) => {
|
|
330
354
|
return date.getMonth() === (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.getMonth()) && date.getFullYear() === (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.getFullYear())
|
|
331
355
|
? 'current-month-day'
|
|
332
356
|
: '';
|
|
@@ -335,6 +359,6 @@ export const DateInput = ({ id, label = 'Выберите дату', size = 'lg'
|
|
|
335
359
|
: {
|
|
336
360
|
renderCustomHeader: renderCustomHeader,
|
|
337
361
|
renderDayContents: renderDayContents,
|
|
338
|
-
}), { customInput: React.createElement(CustomInput, { ref: inputRef, className: classNames(inputClassess, inputClassName), onDateChange: handleCustomInputChange, onClose: handleCloseDatePicker, disabled: disabled, readOnly: readOnly }) })),
|
|
362
|
+
}), { customInput: React.createElement(CustomInput, { ref: inputRef, className: classNames(inputClassess, inputClassName), onDateChange: handleCustomInputChange, onClose: handleCloseDatePicker, disabled: disabled, readOnly: readOnly, dateFormat: dateFormat }) })),
|
|
339
363
|
error && helperText && (React.createElement(Typography, { variant: "Caption", className: classNames(styles.helperText, styles[size]) }, helperText))));
|
|
340
364
|
};
|
|
@@ -1,46 +1,52 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import styles from './Dropdown.module.css';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
;
|
|
4
|
+
import { ChevronDown } from '../../Icons/ChevronDown/ChevronDown';
|
|
5
|
+
import { ChevronUp } from '../../Icons/ChevronUp/ChevronUp';
|
|
6
|
+
import { IconClose } from '../../Icons/IconClose/IconClose';
|
|
7
|
+
import { IconCheck } from '../../Icons/IconCheck/IconCheck';
|
|
9
8
|
import { Typography } from '../Typography/Typography';
|
|
9
|
+
import { Tooltip } from '../Tooltip/Tooltip';
|
|
10
|
+
const isTextOverflowing = (element) => {
|
|
11
|
+
if (!element)
|
|
12
|
+
return false;
|
|
13
|
+
return element.scrollWidth > element.clientWidth;
|
|
14
|
+
};
|
|
10
15
|
function checkItem(item, getOptionLabel, disabled, isDivider) {
|
|
11
16
|
if (typeof item === 'object' && item !== null) {
|
|
17
|
+
const itemCopy = Object.assign({}, item);
|
|
12
18
|
//проверка на вложенные объекты с таким же типом
|
|
13
|
-
Object.keys(
|
|
14
|
-
const value =
|
|
19
|
+
Object.keys(itemCopy).forEach((key) => {
|
|
20
|
+
const value = itemCopy[key];
|
|
15
21
|
if (typeof value === 'object' && value !== null && !React.isValidElement(value)) {
|
|
16
22
|
const nestedItem = checkItem(value, getOptionLabel, disabled, isDivider);
|
|
17
23
|
if (nestedItem) {
|
|
18
|
-
if (!
|
|
19
|
-
|
|
24
|
+
if (!itemCopy.children) {
|
|
25
|
+
itemCopy.children = [];
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
delete
|
|
27
|
+
itemCopy.children.push(nestedItem);
|
|
28
|
+
delete itemCopy[key];
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
});
|
|
26
32
|
// проверка на наличие пользовательского поля для вывода(передаваемой функции getOptionLabel)
|
|
27
33
|
if (getOptionLabel) {
|
|
28
|
-
return Object.assign(Object.assign({},
|
|
34
|
+
return Object.assign(Object.assign({}, itemCopy), { value: getOptionLabel(itemCopy), disabled: disabled !== null && disabled !== void 0 ? disabled : false, isDivider: isDivider !== null && isDivider !== void 0 ? isDivider : false });
|
|
29
35
|
}
|
|
30
|
-
if ('value' in
|
|
31
|
-
return Object.assign(Object.assign({},
|
|
36
|
+
if ('value' in itemCopy) {
|
|
37
|
+
return Object.assign(Object.assign({}, itemCopy), { disabled: disabled !== null && disabled !== void 0 ? disabled : false, isDivider: isDivider !== null && isDivider !== void 0 ? isDivider : false });
|
|
32
38
|
}
|
|
33
|
-
else if ('name' in
|
|
34
|
-
return Object.assign(Object.assign({},
|
|
39
|
+
else if ('name' in itemCopy && !('value' in itemCopy)) {
|
|
40
|
+
return Object.assign(Object.assign({}, itemCopy), { value: itemCopy.name, disabled: disabled !== null && disabled !== void 0 ? disabled : false, isDivider: isDivider !== null && isDivider !== void 0 ? isDivider : false });
|
|
35
41
|
}
|
|
36
|
-
else if ('description' in
|
|
37
|
-
return Object.assign(Object.assign({},
|
|
42
|
+
else if ('description' in itemCopy && !('value' in itemCopy)) {
|
|
43
|
+
return Object.assign(Object.assign({}, itemCopy), { value: itemCopy.description, disabled: disabled !== null && disabled !== void 0 ? disabled : false, isDivider: isDivider !== null && isDivider !== void 0 ? isDivider : false });
|
|
38
44
|
}
|
|
39
45
|
else {
|
|
40
|
-
const keys = Object.keys(
|
|
46
|
+
const keys = Object.keys(itemCopy);
|
|
41
47
|
if (keys.length) {
|
|
42
|
-
const firstValue =
|
|
43
|
-
return Object.assign(Object.assign({},
|
|
48
|
+
const firstValue = itemCopy[keys[0]];
|
|
49
|
+
return Object.assign(Object.assign({}, itemCopy), { value: firstValue, disabled: disabled !== null && disabled !== void 0 ? disabled : false, isDivider: isDivider !== null && isDivider !== void 0 ? isDivider : false });
|
|
44
50
|
}
|
|
45
51
|
}
|
|
46
52
|
}
|
|
@@ -52,7 +58,19 @@ function checkItem(item, getOptionLabel, disabled, isDivider) {
|
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
60
|
export const DropdownListItem = ({ item, getOptionLabel, size = 'md', selectedItem, variant, onChange, isActive, activeIndex, index, }) => {
|
|
55
|
-
var _a;
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const itemRef = useRef(null);
|
|
63
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const checkOverflow = () => {
|
|
66
|
+
setShowTooltip(isTextOverflowing(itemRef.current));
|
|
67
|
+
};
|
|
68
|
+
checkOverflow();
|
|
69
|
+
window.addEventListener('resize', checkOverflow);
|
|
70
|
+
return () => {
|
|
71
|
+
window.removeEventListener('resize', checkOverflow);
|
|
72
|
+
};
|
|
73
|
+
}, [item === null || item === void 0 ? void 0 : item.value]);
|
|
56
74
|
const handleItemClick = useCallback((event) => {
|
|
57
75
|
event.preventDefault();
|
|
58
76
|
event.stopPropagation();
|
|
@@ -66,7 +84,7 @@ export const DropdownListItem = ({ item, getOptionLabel, size = 'md', selectedIt
|
|
|
66
84
|
[styles['item-block--active']]: isActive,
|
|
67
85
|
});
|
|
68
86
|
const itemBlock = classNames(styles[`item-block`], styles[`item-block-${variant}`], { [styles[`item-block-${variant}--selected`]]: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === (item === null || item === void 0 ? void 0 : item.value) }, { [styles['item-block--disabled']]: item === null || item === void 0 ? void 0 : item.disabled });
|
|
69
|
-
|
|
87
|
+
const itemContent = (React.createElement("div", { className: itemContainerClasses, onClick: handleItemClick },
|
|
70
88
|
React.createElement("div", { className: itemClassess },
|
|
71
89
|
React.createElement("div", { className: itemBlock },
|
|
72
90
|
variant === 'icons' &&
|
|
@@ -74,14 +92,15 @@ export const DropdownListItem = ({ item, getOptionLabel, size = 'md', selectedIt
|
|
|
74
92
|
React.cloneElement(item.icon, {
|
|
75
93
|
strokeWidth: size === 'lg' ? '0.5' : size === 'md' ? '0.3' : '0.0',
|
|
76
94
|
}),
|
|
77
|
-
React.createElement("div", { className: styles.item },
|
|
95
|
+
React.createElement("div", { className: styles.item, ref: itemRef },
|
|
78
96
|
React.createElement("span", null, item === null || item === void 0 ? void 0 : item.value)),
|
|
79
|
-
(selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === (item === null || item === void 0 ? void 0 : item.value) && (React.createElement(
|
|
97
|
+
(selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === (item === null || item === void 0 ? void 0 : item.value) && (React.createElement(IconCheck, { strokeWidth: size === 'lg' ? '0.5' : size === 'md' ? '0.3' : '0.0', htmlColor: "#0D99FF" }))),
|
|
80
98
|
(item === null || item === void 0 ? void 0 : item.isDivider) && React.createElement("div", { className: styles.divider })),
|
|
81
99
|
(item === null || item === void 0 ? void 0 : item.children) && (React.createElement("div", { className: styles.nestedMenu }, (_a = item.children) === null || _a === void 0 ? void 0 : _a.map((child, childIndex) => {
|
|
82
100
|
var _a;
|
|
83
101
|
return (React.createElement(DropdownListItem, { key: (_a = child === null || child === void 0 ? void 0 : child.key) !== null && _a !== void 0 ? _a : childIndex, item: child, getOptionLabel: getOptionLabel, size: size, selectedItem: selectedItem, onChange: onChange, isActive: activeIndex === index, activeIndex: activeIndex, index: childIndex }));
|
|
84
102
|
})))));
|
|
103
|
+
return showTooltip ? (React.createElement(Tooltip, { label: ((_b = item === null || item === void 0 ? void 0 : item.value) === null || _b === void 0 ? void 0 : _b.toString()) || '', position: "bottom-left" }, itemContent)) : (itemContent);
|
|
85
104
|
};
|
|
86
105
|
export const Dropdown = ({ options, id, label, placeholder, required = false, value, defaultValue, onChange, getOptionLabel, variant = 'text', size = 'lg', style, className, isLeftLabel = false, isDivider = false, disabled = false, readOnly = false, isOpened = false, error = false, helperText, onClick, onBlur, onFocus, onClose, clearable = true, enableAutocomplete = false, noOptionsText = 'Нет вариантов для выбора', }) => {
|
|
87
106
|
const [isOpen, setIsOpen] = useState(isOpened);
|
|
@@ -243,9 +262,21 @@ export const Dropdown = ({ options, id, label, placeholder, required = false, va
|
|
|
243
262
|
setErrorInputHelperText(helperText !== null && helperText !== void 0 ? helperText : 'Поле обязательно для заполнения');
|
|
244
263
|
}
|
|
245
264
|
};
|
|
265
|
+
const [showSelectedTooltip, setShowSelectedTooltip] = useState(false);
|
|
266
|
+
const selectedItemRef = useRef(null);
|
|
267
|
+
useEffect(() => {
|
|
268
|
+
const checkOverflow = () => {
|
|
269
|
+
setShowSelectedTooltip(isTextOverflowing(selectedItemRef.current));
|
|
270
|
+
};
|
|
271
|
+
checkOverflow();
|
|
272
|
+
window.addEventListener('resize', checkOverflow);
|
|
273
|
+
return () => {
|
|
274
|
+
window.removeEventListener('resize', checkOverflow);
|
|
275
|
+
};
|
|
276
|
+
}, [selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value]);
|
|
246
277
|
const getTextField = () => {
|
|
247
|
-
var _a;
|
|
248
|
-
|
|
278
|
+
var _a, _b;
|
|
279
|
+
const textFieldContent = (React.createElement("div", { className: selectedItemClassess, ref: selectedItemRef },
|
|
249
280
|
variant === 'icons' &&
|
|
250
281
|
(selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.icon) &&
|
|
251
282
|
React.cloneElement(selectedItem.icon, {
|
|
@@ -265,6 +296,8 @@ export const Dropdown = ({ options, id, label, placeholder, required = false, va
|
|
|
265
296
|
e.stopPropagation();
|
|
266
297
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
267
298
|
}, onKeyDown: handleKeyDown, autoFocus: true })) : selectedItem ? (selectedItem.value) : (searchValue || ((_a = placeholder !== null && placeholder !== void 0 ? placeholder : label) !== null && _a !== void 0 ? _a : 'Выберите значение'))));
|
|
299
|
+
return showSelectedTooltip ? (React.createElement("div", { className: styles.textField },
|
|
300
|
+
React.createElement(Tooltip, { label: ((_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === null || _b === void 0 ? void 0 : _b.toString()) || '', position: "bottom-left", style: { width: '100% !important' } }, textFieldContent))) : (textFieldContent);
|
|
268
301
|
};
|
|
269
302
|
const getDropdownMenu = () => {
|
|
270
303
|
const optionsToRender = enableAutocomplete && searchValue
|
|
@@ -339,9 +372,10 @@ export const Dropdown = ({ options, id, label, placeholder, required = false, va
|
|
|
339
372
|
label && (React.createElement(Typography, { variant: "Caption", className: labelClasses }, label)),
|
|
340
373
|
React.createElement("button", { className: buttonClassess, onClick: readOnly ? undefined : handleToggle, disabled: disabled, tabIndex: 0, onKeyDown: handleKeyDown },
|
|
341
374
|
getTextField(),
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
375
|
+
React.createElement("div", { className: styles.actionButtons },
|
|
376
|
+
clearable && !readOnly && !disabled && (selectedItem || enableAutocomplete && searchValue) && (React.createElement("div", { className: styles.resetButton },
|
|
377
|
+
React.createElement(IconClose, { strokeWidth: "0.2", htmlColor: "var(--text-light)", onClick: handleReset }))),
|
|
378
|
+
React.createElement("div", { className: styles.dropdownIcon }, !isOpen ? (React.createElement(ChevronDown, { strokeWidth: size === 'lg' ? '0.5' : '0.3' })) : (React.createElement(ChevronUp, { strokeWidth: size === 'lg' ? '0.5' : '0.3' })))),
|
|
345
379
|
getDropdownMenu()),
|
|
346
380
|
errorInput && errorInputHelperText && (React.createElement(Typography, { variant: "Caption", className: classNames(styles.helperText, styles[size]) }, helperText !== null && helperText !== void 0 ? helperText : errorInputHelperText))));
|
|
347
381
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
.dropdown--container {
|
|
2
2
|
position: relative;
|
|
3
3
|
width: 100%;
|
|
4
|
-
max-width: 260px;
|
|
5
4
|
}
|
|
6
5
|
.dropdown--container-left {
|
|
7
6
|
display: flex;
|
|
@@ -35,17 +34,15 @@
|
|
|
35
34
|
line-height: 16.5px;
|
|
36
35
|
border-radius: 10px;
|
|
37
36
|
cursor: pointer;
|
|
38
|
-
padding:
|
|
37
|
+
padding: 6px 12px;
|
|
39
38
|
transition: all 0.3s ease;
|
|
40
39
|
background-color: transparent;
|
|
41
40
|
color: var(--text-dark);
|
|
42
41
|
border: 1px solid var(--grey-mediumLight);
|
|
43
|
-
/* mix-blend-mode: multiply; */
|
|
44
42
|
display: flex;
|
|
45
43
|
align-items: center;
|
|
46
44
|
gap: 20px;
|
|
47
45
|
justify-content: space-between;
|
|
48
|
-
/* min-width: fit-content; */
|
|
49
46
|
position: relative;
|
|
50
47
|
width: 100%;
|
|
51
48
|
}
|
|
@@ -100,10 +97,15 @@
|
|
|
100
97
|
.button:focus-visible {
|
|
101
98
|
outline: none;
|
|
102
99
|
}
|
|
103
|
-
|
|
100
|
+
.actionButtons {
|
|
101
|
+
display: flex;
|
|
102
|
+
gap: 0px;
|
|
103
|
+
align-items: center;
|
|
104
|
+
margin-right: -6px;
|
|
105
|
+
}
|
|
104
106
|
.resetButton,
|
|
105
107
|
.dropdownIcon {
|
|
106
|
-
position: absolute;
|
|
108
|
+
/* position: absolute; */
|
|
107
109
|
background: none;
|
|
108
110
|
border: none;
|
|
109
111
|
cursor: pointer;
|
|
@@ -143,6 +145,20 @@
|
|
|
143
145
|
overflow-x: hidden;
|
|
144
146
|
}
|
|
145
147
|
|
|
148
|
+
.textField{
|
|
149
|
+
width: 100%;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.textField > :first-child {
|
|
154
|
+
width: 100%;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
text-overflow: ellipsis;
|
|
157
|
+
white-space: nowrap;
|
|
158
|
+
min-width: 0;
|
|
159
|
+
display: block;
|
|
160
|
+
}
|
|
161
|
+
|
|
146
162
|
.inlineSearchInput {
|
|
147
163
|
border: none;
|
|
148
164
|
outline: none;
|
|
@@ -255,13 +271,13 @@
|
|
|
255
271
|
|
|
256
272
|
.item-selected {
|
|
257
273
|
color: var(--text-dark);
|
|
258
|
-
width: 80%;
|
|
259
274
|
overflow: hidden;
|
|
260
275
|
text-overflow: ellipsis;
|
|
261
276
|
white-space: nowrap;
|
|
262
277
|
min-width: 0;
|
|
263
278
|
text-align: left;
|
|
264
279
|
position: relative;
|
|
280
|
+
flex: 1;
|
|
265
281
|
}
|
|
266
282
|
|
|
267
283
|
.item-selected .inlineSearchInput {
|
|
@@ -3,7 +3,7 @@ import styles from './FileItem.module.css';
|
|
|
3
3
|
import { Typography } from '../Typography/Typography';
|
|
4
4
|
import { ProgressBar } from '../ProgressBar/ProgressBar';
|
|
5
5
|
import { IconButton } from '../IconButton/IconButton';
|
|
6
|
-
import {
|
|
6
|
+
import { IconClose, IconDownload, IconFile } from '../../Icons';
|
|
7
7
|
import { Tooltip } from '../Tooltip/Tooltip';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
export const FileItem = ({ file, loading = false, error = '', onDownload, onDelete, canDelete = true, canDownload = true, style, isAddedFile, isRejectedFile, }) => {
|
|
@@ -104,8 +104,8 @@ export const FileItem = ({ file, loading = false, error = '', onDownload, onDele
|
|
|
104
104
|
React.createElement(Typography, { variant: "Body1", color: "var(--text-dark)" }, croppedName(file.filename)))) : (React.createElement(Typography, { variant: "Body1", color: "var(--text-dark)" }, croppedName(file.filename))),
|
|
105
105
|
file.size !== 0 && (React.createElement(Typography, { variant: "Caption", color: "var(--grey-medium)" }, `${file.size ? (file.size / 1024).toFixed(1) : 0} кБ`)))),
|
|
106
106
|
React.createElement("div", { className: styles['fileItemActions'] },
|
|
107
|
-
!(isAddedFile || isRejectedFile) && canDownload && (React.createElement(IconButton, { icon: React.createElement(IconDownload, null), onClick: (e) => handleDownloadClick(e, file), color: "var(--icons-grey)" })),
|
|
108
|
-
canDelete && (React.createElement(IconButton, { icon: React.createElement(
|
|
107
|
+
!(isAddedFile || isRejectedFile) && canDownload && (React.createElement(IconButton, { className: styles.fileIcon, icon: React.createElement(IconDownload, null), onClick: (e) => handleDownloadClick(e, file), color: "var(--icons-grey)", size: "sm" })),
|
|
108
|
+
canDelete && (React.createElement(IconButton, { className: styles.fileIcon, icon: React.createElement(IconClose, null), onClick: (e) => handleDeleteClick(e, file.id || ''), color: "var(--icons-grey)", size: "sm" })))),
|
|
109
109
|
loading && !isLoadingFinished && (React.createElement(ProgressBar, { animated: true, size: "sm", value: 100, setIsLoadingFinished: setIsLoadingFinished, animationDuration: animationDuration })),
|
|
110
110
|
error && (React.createElement(Typography, { variant: "Caption", color: "var(--error-main)" }, error))));
|
|
111
111
|
};
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
flex-direction: row;
|
|
22
22
|
gap: 5px;
|
|
23
23
|
flex-grow: 1;
|
|
24
|
-
align-items:
|
|
24
|
+
align-items: center;
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.fileIcon svg path {
|
|
41
|
-
stroke-width: 0.
|
|
41
|
+
stroke-width: 0.5 !important;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.fileItem_attached {
|
|
@@ -154,7 +154,7 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
|
|
|
154
154
|
return (React.createElement("section", { className: classNames(styles['fileLoader'], className), style: style },
|
|
155
155
|
React.createElement("div", Object.assign({}, getRootProps({ className: `${styles['dropzone']} ${!canAdd ? styles['disabled'] : ''}` })),
|
|
156
156
|
React.createElement("input", Object.assign({}, getInputProps())),
|
|
157
|
-
React.createElement(IconUpload, { htmlColor: !canAdd ? 'var(--grey-medium)' : 'var(--icons-grey)' }),
|
|
157
|
+
React.createElement(IconUpload, { htmlColor: !canAdd ? 'var(--grey-medium)' : 'var(--icons-grey)', width: '34', height: '34' }),
|
|
158
158
|
React.createElement(Typography, { variant: "Body1", color: !canAdd ? 'var(--grey-medium)' : 'var(--icons-grey)', style: { textAlign: 'center' } }, lng === 'ru' || lng.includes('ru') ? (React.createElement(React.Fragment, null,
|
|
159
159
|
React.createElement("span", { style: { textDecoration: 'underline' } }, "\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u043D\u0430 \u043E\u0431\u043B\u0430\u0441\u0442\u044C"),
|
|
160
160
|
" ",
|