kamotive_ui 1.2.19 → 1.2.21
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/IconEmail/IconEmail.d.ts +6 -0
- package/dist/Icons/IconEmail/IconEmail.js +5 -0
- package/dist/Icons/IconEye/IconEye10.d.ts +6 -0
- package/dist/Icons/IconEye/IconEye10.js +5 -0
- package/dist/Icons/IconLocation/IconLocation.d.ts +6 -0
- package/dist/Icons/IconLocation/IconLocation.js +5 -0
- package/dist/Icons/IconPencil/IconPencil.d.ts +6 -0
- package/dist/Icons/IconPencil/IconPencil.js +5 -0
- package/dist/Icons/IconPhone/IconPhone.d.ts +6 -0
- package/dist/Icons/IconPhone/IconPhone.js +5 -0
- package/dist/Icons/index.d.ts +5 -0
- package/dist/Icons/index.js +5 -0
- package/dist/components/DateInput/DateInput.js +11 -7
- package/dist/components/FileAttach/FileAttach.js +2 -2
- package/dist/components/FileLoader/FileLoader.js +17 -3
- package/dist/components/FileLoader/FileLoader.module.css +1 -1
- package/dist/components/Tab/Tab.js +5 -4
- package/dist/components/Tab/Tab.module.css +3 -1
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/Tabs.module.css +3 -1
- package/dist/types/index.d.ts +15 -1
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const IconEmail = ({ color = 'inherit', htmlColor, strokeWidth, }) => {
|
|
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 },
|
|
4
|
+
React.createElement("path", { fill: htmlColor || 'currentColor', stroke: htmlColor || 'currentColor', strokeWidth: strokeWidth || '0', d: "M5,5H18C19.66,5 21,6.34 21,8V17C21,18.66 19.66,20 18,20H5C3.34,20 2,18.66 2,17V8C2,6.34 3.34,5 5,5M5,6C4.5,6 4.06,6.17 3.72,6.47L11.5,11.5L19.28,6.47C18.94,6.17 18.5,6 18,6H5M11.5,12.71L3.13,7.28C3.05,7.5 3,7.75 3,8V17C3,18.1 3.9,19 5,19H18C19.1,19 20,18.1 20,17V8C20,7.75 19.95,7.5 19.87,7.28L11.5,12.71Z" })));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const IconEye10 = ({ color = 'inherit', htmlColor, strokeWidth, }) => {
|
|
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 },
|
|
4
|
+
React.createElement("path", { fill: htmlColor || 'currentColor', stroke: htmlColor || 'currentColor', strokeWidth: strokeWidth || '0', d: "M11.5,18C15.5,18 18.96,15.78 20.74,12.5C18.96,9.22 15.5,7 11.5,7C7.5,7 4.04,9.22 2.26,12.5C4.04,15.78 7.5,18 11.5,18M11.5,6C16.06,6 20,8.65 21.86,12.5C20,16.35 16.06,19 11.5,19C6.94,19 3,16.35 1.14,12.5C3,8.65 6.94,6 11.5,6M11.5,8C14,8 16,10 16,12.5C16,15 14,17 11.5,17C9,17 7,15 7,12.5C7,10 9,8 11.5,8M11.5,9C9.57,9 8,10.57 8,12.5C8,14.43 9.57,16 11.5,16C13.43,16 15,14.43 15,12.5C15,10.57 13.43,9 11.5,9Z" })));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const IconLocation = ({ color = 'inherit', htmlColor, strokeWidth, }) => {
|
|
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 },
|
|
4
|
+
React.createElement("path", { fill: htmlColor || 'currentColor', stroke: htmlColor || 'currentColor', strokeWidth: strokeWidth || '0', d: "M11.5,7C12.88,7 14,8.12 14,9.5C14,10.88 12.88,12 11.5,12C10.12,12 9,10.88 9,9.5C9,8.12 10.12,7 11.5,7M11.5,8C10.67,8 10,8.67 10,9.5C10,10.33 10.67,11 11.5,11C12.33,11 13,10.33 13,9.5C13,8.67 12.33,8 11.5,8M6.8,12.36L11.5,20.09L16.2,12.36V12.36C16.71,11.5 17,10.55 17,9.5C17,6.46 14.54,4 11.5,4C8.46,4 6,6.46 6,9.5C6,10.55 6.29,11.5 6.8,12.36V12.36M17.05,12.88L11.5,22L5.95,12.88V12.88C5.35,11.89 5,10.74 5,9.5C5,5.91 7.91,3 11.5,3C15.09,3 18,5.91 18,9.5C18,10.74 17.65,11.89 17.05,12.88V12.88Z" })));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const IconPencil = ({ color = 'inherit', htmlColor, strokeWidth, }) => {
|
|
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 },
|
|
4
|
+
React.createElement("path", { fill: htmlColor || 'currentColor', stroke: htmlColor || 'currentColor', strokeWidth: strokeWidth || '0', d: "M19.71,8.04L17.37,10.37L13.62,6.62L15.96,4.29C16.35,3.9 17,3.9 17.37,4.29L19.71,6.63C20.1,7 20.1,7.65 19.71,8.04M3,17.25L13.06,7.18L16.81,10.93L6.75,21H3V17.25M16.62,5.04L15.08,6.58L17.42,8.92L18.96,7.38L16.62,5.04M15.36,11L13,8.64L4,17.66V20H6.34L15.36,11Z" })));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const IconPhone = ({ color = 'inherit', htmlColor, strokeWidth, }) => {
|
|
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 },
|
|
4
|
+
React.createElement("path", { fill: htmlColor || 'currentColor', stroke: htmlColor || 'currentColor', strokeWidth: strokeWidth || '0', d: "M19.5,22C20.33,22 21,21.33 21,20.5V17C21,16.17 20.33,15.5 19.5,15.5C18.33,15.5 17.18,15.32 16.08,14.95C15.55,14.78 14.97,14.92 14.56,15.32L13.12,16.76C10.64,15.41 8.57,13.34 7.23,10.87L8.66,9.44C9.07,9.05 9.22,8.47 9.04,7.91C8.68,6.82 8.5,5.67 8.5,4.5C8.5,3.67 7.83,3 7,3H3.5C2.67,3 2,3.67 2,4.5C2,14.15 9.85,22 19.5,22M3.5,4H7C7.28,4 7.5,4.22 7.5,4.5C7.5,5.78 7.7,7.03 8.09,8.22C8.14,8.36 8.13,8.56 7.97,8.72L6,10.68C7.65,13.91 10.07,16.33 13.31,18L15.26,16.03C15.4,15.89 15.59,15.85 15.77,15.9C16.97,16.3 18.22,16.5 19.5,16.5C19.78,16.5 20,16.72 20,17V20.5C20,20.78 19.78,21 19.5,21C10.4,21 3,13.6 3,4.5C3,4.22 3.22,4 3.5,4Z" })));
|
|
5
|
+
};
|
package/dist/Icons/index.d.ts
CHANGED
|
@@ -20,3 +20,8 @@ export { IconFile } from './IconFile/IconFile';
|
|
|
20
20
|
export { IconUpload } from './IconUpload/IconUpload';
|
|
21
21
|
export { IconDownload } from './IconDownload/IconDownload';
|
|
22
22
|
export { IconAdd } from './IconAdd/IconAdd';
|
|
23
|
+
export { IconPhone } from './IconPhone/IconPhone';
|
|
24
|
+
export { IconLocation } from './IconLocation/IconLocation';
|
|
25
|
+
export { IconEmail } from './IconEmail/IconEmail';
|
|
26
|
+
export { IconEye10 } from './IconEye/IconEye10';
|
|
27
|
+
export { IconPencil } from './IconPencil/IconPencil';
|
package/dist/Icons/index.js
CHANGED
|
@@ -20,3 +20,8 @@ export { IconFile } from './IconFile/IconFile';
|
|
|
20
20
|
export { IconUpload } from './IconUpload/IconUpload';
|
|
21
21
|
export { IconDownload } from './IconDownload/IconDownload';
|
|
22
22
|
export { IconAdd } from './IconAdd/IconAdd';
|
|
23
|
+
export { IconPhone } from './IconPhone/IconPhone';
|
|
24
|
+
export { IconLocation } from './IconLocation/IconLocation';
|
|
25
|
+
export { IconEmail } from './IconEmail/IconEmail';
|
|
26
|
+
export { IconEye10 } from './IconEye/IconEye10';
|
|
27
|
+
export { IconPencil } from './IconPencil/IconPencil';
|
|
@@ -11,7 +11,7 @@ import { ChevronRight } from '../../Icons/ChevronRight/ChevronRight';
|
|
|
11
11
|
import { ChevronLeft } from '../../Icons/ChevronLeft/ChevronLeft';
|
|
12
12
|
import { Button } from '../Button/Button';
|
|
13
13
|
registerLocale('ru', ru);
|
|
14
|
-
const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, className }, ref) => {
|
|
14
|
+
const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, className, disabled = false, readOnly = false }, ref) => {
|
|
15
15
|
const inputRef = useRef(null);
|
|
16
16
|
const [selectedPart, setSelectedPart] = useState(null);
|
|
17
17
|
const [tempInput, setTempInput] = useState('');
|
|
@@ -38,7 +38,9 @@ const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, cl
|
|
|
38
38
|
};
|
|
39
39
|
const updateInputValue = (char, position) => {
|
|
40
40
|
setShouldReselect(true);
|
|
41
|
-
|
|
41
|
+
if (!readOnly) {
|
|
42
|
+
setInput(input.substring(0, position) + char + input.substring(position + char.length));
|
|
43
|
+
}
|
|
42
44
|
};
|
|
43
45
|
const handleClick = (e) => {
|
|
44
46
|
e.preventDefault();
|
|
@@ -174,7 +176,9 @@ const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, cl
|
|
|
174
176
|
}
|
|
175
177
|
}, []);
|
|
176
178
|
useEffect(() => {
|
|
177
|
-
|
|
179
|
+
if (!readOnly) {
|
|
180
|
+
setInput(value);
|
|
181
|
+
}
|
|
178
182
|
}, [value]);
|
|
179
183
|
useEffect(() => {
|
|
180
184
|
setTempInput('');
|
|
@@ -185,9 +189,9 @@ const CustomInput = forwardRef(({ value = '', onClick, onDateChange, onClose, cl
|
|
|
185
189
|
useImperativeHandle(ref, () => ({
|
|
186
190
|
removeSelection,
|
|
187
191
|
}), [removeSelection]);
|
|
188
|
-
return (React.createElement("input", { ref: inputRef, value: input, onClick: handleClick, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, readOnly:
|
|
192
|
+
return (React.createElement("input", { ref: inputRef, value: input, onClick: handleClick, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, readOnly: readOnly, disabled: disabled, className: className }));
|
|
189
193
|
});
|
|
190
|
-
export const DateInput = ({ id, label = 'Выберите дату', size = 'lg', value, style, className, disabled = false, readOnly =
|
|
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', }) => {
|
|
191
195
|
const wrapperClassess = classNames(styles['wrapper--input'], className, {
|
|
192
196
|
[styles['wrapper--left']]: isLeftLabel,
|
|
193
197
|
[styles['wrapper--input-label']]: label && !isLeftLabel && !required,
|
|
@@ -322,7 +326,7 @@ export const DateInput = ({ id, label = 'Выберите дату', size = 'lg'
|
|
|
322
326
|
return (React.createElement("div", { className: wrapperClassess, style: style },
|
|
323
327
|
label && (React.createElement(Typography, { variant: "Caption", className: labelClasses }, label)),
|
|
324
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(IconCalendar10, null)),
|
|
325
|
-
React.createElement(DatePicker, Object.assign({ id: id, ref: datePickerRef, selected: selectedDate, onChange: handleDateChange, onBlur: onBlur, dateFormat: dateFormat, locale: "ru", readOnly: readOnly, showPopperArrow: false, calendarClassName: classNames(styles.calendar, calendarClassName), popperClassName: styles.calendarPopper, onCalendarClose: () => setIsMonthPickerOpen(false), minDate: minDate, maxDate: maxDate, inline: false, calendarStartDay: 1, dayClassName: (date) => {
|
|
329
|
+
React.createElement(DatePicker, Object.assign({ id: id, ref: datePickerRef, selected: selectedDate, onChange: handleDateChange, onBlur: onBlur, dateFormat: dateFormat, locale: "ru", 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, dayClassName: (date) => {
|
|
326
330
|
return date.getMonth() === (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.getMonth()) && date.getFullYear() === (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.getFullYear())
|
|
327
331
|
? 'current-month-day'
|
|
328
332
|
: '';
|
|
@@ -331,6 +335,6 @@ export const DateInput = ({ id, label = 'Выберите дату', size = 'lg'
|
|
|
331
335
|
: {
|
|
332
336
|
renderCustomHeader: renderCustomHeader,
|
|
333
337
|
renderDayContents: renderDayContents,
|
|
334
|
-
}), { customInput: React.createElement(CustomInput, { ref: inputRef, className: classNames(inputClassess, inputClassName), onDateChange: handleCustomInputChange, onClose: handleCloseDatePicker }) })),
|
|
338
|
+
}), { customInput: React.createElement(CustomInput, { ref: inputRef, className: classNames(inputClassess, inputClassName), onDateChange: handleCustomInputChange, onClose: handleCloseDatePicker, disabled: disabled, readOnly: readOnly }) })),
|
|
335
339
|
error && helperText && (React.createElement(Typography, { variant: "Caption", className: classNames(styles.helperText, styles[size]) }, helperText))));
|
|
336
340
|
};
|
|
@@ -7,11 +7,11 @@ export const FileAttach = ({ filesList = [], maxFileSize = 2, maxFileCount = 10,
|
|
|
7
7
|
'image/*': ['.png', '.gif', '.jpeg', '.jpg'],
|
|
8
8
|
'application/pdf': ['.pdf'],
|
|
9
9
|
'application/msword': ['.doc', '.docx'],
|
|
10
|
-
}, addedFiles, setAddedFiles, onDownload, onDelete, canAdd = true, canDelete = true, canDownload = true, position = 'bottom', lng = 'ru', className, style, }) => {
|
|
10
|
+
}, addedFiles, setAddedFiles, onDownload, onDelete, canAdd = true, canDelete = true, canDownload = true, position = 'bottom', lng = 'ru', className, style, fileValidator, }) => {
|
|
11
11
|
const fileAttachClasses = classNames(styles['fileAttach'], className, {
|
|
12
12
|
[styles[`fileAttach_position_${position}`]]: position,
|
|
13
13
|
});
|
|
14
14
|
return (React.createElement("div", { className: fileAttachClasses, style: style },
|
|
15
|
-
React.createElement(FileLoader, { maxFileSize: maxFileSize, maxFileCount: maxFileCount, acceptedFormats: acceptedFormats, addedFiles: addedFiles, setAddedFiles: setAddedFiles, canAdd: canAdd, lng: lng }),
|
|
15
|
+
React.createElement(FileLoader, { maxFileSize: maxFileSize, maxFileCount: maxFileCount, acceptedFormats: acceptedFormats, addedFiles: addedFiles, setAddedFiles: setAddedFiles, filesList: filesList, canAdd: canAdd, lng: lng, fileValidator: fileValidator }),
|
|
16
16
|
React.createElement(FileListAttaсhed, { filesList: filesList, onDelete: onDelete, onDownload: onDownload, canDelete: canDelete, canDownload: canDownload, lng: lng })));
|
|
17
17
|
};
|
|
@@ -9,12 +9,12 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
|
|
|
9
9
|
'image/*': ['.png', '.gif', '.jpeg', '.jpg'],
|
|
10
10
|
'application/pdf': ['.pdf'],
|
|
11
11
|
'application/msword': ['.doc', '.docx'],
|
|
12
|
-
}, addedFiles, setAddedFiles, canAdd = true, lng = 'ru', className, style, }) => {
|
|
12
|
+
}, addedFiles, setAddedFiles, filesList = [], canAdd = true, lng = 'ru', className, style, fileValidator }) => {
|
|
13
13
|
const [isLoadingFiles, setIsLoadingFiles] = useState(false);
|
|
14
14
|
const [loadingFilesNames, setLoadingFilesNames] = useState([]);
|
|
15
15
|
const [errorFiles, setErrorFiles] = useState([]);
|
|
16
16
|
const [addedFilesFormated, setAddedFilesFormatted] = useState([]);
|
|
17
|
-
const
|
|
17
|
+
const fileValidatorInner = (file) => {
|
|
18
18
|
if (file.size > maxFileSize * 1024 * 1024 * 1024) {
|
|
19
19
|
return {
|
|
20
20
|
code: 'name-too-large',
|
|
@@ -23,6 +23,14 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
|
|
|
23
23
|
: `Maximum file size ${maxFileSize.toFixed(0)} GB`,
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
+
// Проверка на дубликаты в filesList
|
|
27
|
+
if (filesList.find((existingFile) => existingFile.filename === file.name)) {
|
|
28
|
+
return {
|
|
29
|
+
code: 'repeating-file-name',
|
|
30
|
+
message: lng === 'ru' || lng.includes('ru') ? `Файл уже существует в списке прикрепленных файлов` : `File already exists in the list of attached files`,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Проверка на дубликаты в addedFiles
|
|
26
34
|
if (addedFiles.find((addedFile) => addedFile.name === file.name)) {
|
|
27
35
|
return {
|
|
28
36
|
code: 'repeating-file-name',
|
|
@@ -35,6 +43,12 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
|
|
|
35
43
|
message: lng === 'ru' || lng.includes('ru') ? `Максимальное количество файлов ${maxFileCount}` : `Maximum number of files ${maxFileCount}`,
|
|
36
44
|
};
|
|
37
45
|
}
|
|
46
|
+
if (fileValidator) {
|
|
47
|
+
const customValidationResult = fileValidator(file);
|
|
48
|
+
if (customValidationResult) {
|
|
49
|
+
return customValidationResult;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
38
52
|
return null;
|
|
39
53
|
};
|
|
40
54
|
const { getRootProps, getInputProps } = useDropzone({
|
|
@@ -98,7 +112,7 @@ export const FileLoader = ({ maxFileSize = 2, maxFileCount = 10, acceptedFormats
|
|
|
98
112
|
setErrorFiles([...errorFiles, ...formattedRejections]);
|
|
99
113
|
}
|
|
100
114
|
},
|
|
101
|
-
validator:
|
|
115
|
+
validator: fileValidatorInner,
|
|
102
116
|
accept: acceptedFormats,
|
|
103
117
|
maxFiles: maxFileCount,
|
|
104
118
|
disabled: !canAdd,
|
|
@@ -2,15 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import styles from './Tab.module.css';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Typography } from '../Typography/Typography';
|
|
5
|
-
export const Tab = ({ value, onClick, onMouseEnter, label, selected, disabled = false }) => {
|
|
5
|
+
export const Tab = ({ value, onClick, onMouseEnter, label, selected, disabled = false, style, className }) => {
|
|
6
6
|
const handleClick = (e) => {
|
|
7
7
|
if (onClick && value && !disabled) {
|
|
8
8
|
onClick(value);
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
return (React.createElement("button", { role: "tab", "aria-selected": selected, "aria-disabled": disabled, value: value, className: classNames(styles.tab, {
|
|
12
|
-
[styles
|
|
13
|
-
[styles
|
|
14
|
-
|
|
12
|
+
[styles.selected]: selected,
|
|
13
|
+
[styles.disabled]: disabled,
|
|
14
|
+
[className || '']: className,
|
|
15
|
+
}), onClick: handleClick, onMouseEnter: onMouseEnter, style: style },
|
|
15
16
|
React.createElement(Typography, { variant: selected ? 'Body1-SemiBold' : 'Body1' }, label)));
|
|
16
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
;
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styles from './Tabs.module.css';
|
|
4
|
-
export const Tabs = ({ value, onChange, children }) => {
|
|
4
|
+
export const Tabs = ({ value, onChange, children, style, className }) => {
|
|
5
5
|
var _a;
|
|
6
6
|
const selectedTabContent = (_a = children === null || children === void 0 ? void 0 : children.find((child) => child.props.value === value)) === null || _a === void 0 ? void 0 : _a.props.children;
|
|
7
7
|
const handleTabChange = (newValue) => {
|
|
@@ -10,7 +10,7 @@ export const Tabs = ({ value, onChange, children }) => {
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
return (React.createElement(React.Fragment, null,
|
|
13
|
-
React.createElement("div", { role: "tablist", className: styles.tabs }, children === null || children === void 0 ? void 0 : children.map((child, index) => React.cloneElement(child, {
|
|
13
|
+
React.createElement("div", { role: "tablist", className: styles.tabs + ' ' + (className || ''), style: style }, children === null || children === void 0 ? void 0 : children.map((child, index) => React.cloneElement(child, {
|
|
14
14
|
key: index,
|
|
15
15
|
selected: child.props.value === value,
|
|
16
16
|
disabled: child.props.disabled,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ChangeEventHandler, CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import { ETypographyVariants } from '../components/Typography/enums';
|
|
4
|
-
import { Accept } from 'react-dropzone/.';
|
|
4
|
+
import { Accept, FileError } from 'react-dropzone/.';
|
|
5
5
|
/** @internal */
|
|
6
6
|
export interface BreadcrumbProps {
|
|
7
7
|
/** Обработчик клика */
|
|
@@ -315,6 +315,10 @@ export interface TabProps {
|
|
|
315
315
|
disabled?: boolean;
|
|
316
316
|
/** Табы */
|
|
317
317
|
children?: React.ReactNode;
|
|
318
|
+
/** Стили передаваемые напрямую */
|
|
319
|
+
style?: CSSProperties;
|
|
320
|
+
/** Дополнительный класс */
|
|
321
|
+
className?: string;
|
|
318
322
|
}
|
|
319
323
|
export interface TabsProps {
|
|
320
324
|
/** Табы */
|
|
@@ -323,6 +327,10 @@ export interface TabsProps {
|
|
|
323
327
|
value?: string;
|
|
324
328
|
/** Обработчик изменения значения */
|
|
325
329
|
onChange?: (value: string) => void;
|
|
330
|
+
/** Стили передаваемые напрямую */
|
|
331
|
+
style?: CSSProperties;
|
|
332
|
+
/** Дополнительный класс */
|
|
333
|
+
className?: string;
|
|
326
334
|
}
|
|
327
335
|
export interface ColorPickerProps {
|
|
328
336
|
/** Цвет выбранный пользователем */
|
|
@@ -396,6 +404,8 @@ export interface FileAttachProps {
|
|
|
396
404
|
className?: string;
|
|
397
405
|
/** Стили передаваемые напрямую */
|
|
398
406
|
style?: React.CSSProperties;
|
|
407
|
+
/** Функция валидации файла */
|
|
408
|
+
fileValidator?: (file: File) => FileError | FileError[] | null;
|
|
399
409
|
}
|
|
400
410
|
export interface FileListAttaсhedProps {
|
|
401
411
|
/** Список прикрепленных файлов */
|
|
@@ -452,12 +462,16 @@ export interface FileLoaderProps {
|
|
|
452
462
|
setAddedFiles: (addedFiles: File[]) => void;
|
|
453
463
|
/**Разрешени на добавление файлов*/
|
|
454
464
|
canAdd?: boolean;
|
|
465
|
+
/** Список прикрепленных файлов */
|
|
466
|
+
filesList?: TAttachments[] | [] | undefined;
|
|
455
467
|
/** Язык */
|
|
456
468
|
lng?: string;
|
|
457
469
|
/** Дополнительный класс */
|
|
458
470
|
className?: string;
|
|
459
471
|
/** Стили передаваемые напрямую */
|
|
460
472
|
style?: React.CSSProperties;
|
|
473
|
+
/** Функция валидации файла */
|
|
474
|
+
fileValidator?: (file: File) => FileError | FileError[] | null;
|
|
461
475
|
}
|
|
462
476
|
export interface DialogProps {
|
|
463
477
|
/** Флаг открытия окна */
|