kamotive_ui 8.12.25 → 9.12.25

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.
@@ -1,3 +1,3 @@
1
- import { FC } from 'react';
2
- import { FileAttachProps } from '../../types';
3
- export declare const FileAttach: FC<FileAttachProps>;
1
+ import React from 'react';
2
+ import { FileAttachProps, FileLoaderHandle } from '../../types';
3
+ export declare const FileAttach: React.ForwardRefExoticComponent<FileAttachProps & React.RefAttributes<FileLoaderHandle>>;
@@ -1,20 +1,20 @@
1
- import React from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import styles from './FileAttach.module.css';
3
3
  import classNames from 'classnames';
4
4
  import { FileLoader } from '../FileLoader/FileLoader';
5
5
  import { FileListAttaсhed } from '../FileListAttached/FileListAttaсhed';
6
- export const FileAttach = ({ filesList = [], maxFileSize = 2, maxFileCount = 10, maxFileName = 0, acceptedFormats = {
6
+ export const FileAttach = forwardRef(({ filesList = [], maxFileSize = 2, maxFileCount = 10, maxFileName = 0, acceptedFormats = {
7
7
  'image/*': ['.png', '.gif', '.jpeg', '.jpg'],
8
8
  'application/pdf': ['.pdf'],
9
9
  'application/msword': ['.doc', '.docx'],
10
10
  'model/gltf-binary': ['.glb'],
11
11
  'application/octet-stream': ['.prt', '.step', '.stp'],
12
12
  'text/plain': ['.syslog'],
13
- }, addedFiles, setAddedFiles, onDownload, onDelete, canAdd = true, canDelete = true, canDownload = true, position = 'bottom', lng = 'ru', className, style, fileValidator, }) => {
13
+ }, addedFiles, setAddedFiles, onDownload, onDelete, canAdd = true, canDelete = true, canDownload = true, position = 'bottom', lng = 'ru', className, style, fileValidator, }, ref) => {
14
14
  const fileAttachClasses = classNames(styles['fileAttach'], className, {
15
15
  [styles[`fileAttach_position_${position}`]]: position,
16
16
  });
17
17
  return (React.createElement("div", { className: fileAttachClasses, style: style },
18
- React.createElement(FileLoader, { maxFileSize: maxFileSize, maxFileCount: maxFileCount, maxFileName: maxFileName, acceptedFormats: acceptedFormats, addedFiles: addedFiles, setAddedFiles: setAddedFiles, filesList: filesList, canAdd: canAdd, lng: lng, fileValidator: fileValidator }),
18
+ React.createElement(FileLoader, { ref: ref, maxFileSize: maxFileSize, maxFileCount: maxFileCount, maxFileName: maxFileName, acceptedFormats: acceptedFormats, addedFiles: addedFiles, setAddedFiles: setAddedFiles, filesList: filesList, canAdd: canAdd, lng: lng, fileValidator: fileValidator }),
19
19
  React.createElement(FileListAttaсhed, { filesList: filesList, onDelete: onDelete, onDownload: onDownload, canDelete: canDelete, canDownload: canDownload, lng: lng })));
20
- };
20
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kamotive_ui",
3
- "version": "8.12.25",
3
+ "version": "9.12.25",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [