@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
108 lines (107 loc) • 3.08 kB
TypeScript
/**
* MSKCC DSM 2021, 2023
*/
/// <reference types="react" />
import PropTypes from 'prop-types';
import { ReactAttr } from '../../types/common';
export interface FileUploaderItemProps extends ReactAttr<HTMLSpanElement> {
/**
* Error message body for an invalid file upload
*/
errorBody?: string;
/**
* Error message subject for an invalid file upload
*/
errorSubject?: string;
/**
* Description of status icon (displayed in native tooltip)
*/
iconDescription?: string;
/**
* Specify if the currently uploaded file is invalid
*/
invalid?: boolean;
/**
* Name of the uploaded file
*/
name?: string;
/**
* Event handler that is called after removing a file from the file uploader
* The event handler signature looks like `onDelete(evt, { uuid })`
*/
onDelete?: (event: any, opts: {
uuid: string;
}) => void;
/**
* Specify the size of the FileUploaderButton, from a list of available
* sizes.
*/
size?: 'sm' | 'md' | 'lg';
/**
* Status of the file upload
*/
status?: 'uploading' | 'edit' | 'complete';
/**
* Unique identifier for the file object
*/
uuid?: string;
}
declare function FileUploaderItem({ uuid, name, status, iconDescription, onDelete, invalid, errorSubject, errorBody, size, ...other }: {
[x: string]: any;
uuid: any;
name: any;
status: any;
iconDescription: any;
onDelete: any;
invalid: any;
errorSubject: any;
errorBody: any;
size: any;
}): JSX.Element;
declare namespace FileUploaderItem {
var propTypes: {
/**
* Error message body for an invalid file upload
*/
errorBody: PropTypes.Requireable<string>;
/**
* Error message subject for an invalid file upload
*/
errorSubject: PropTypes.Requireable<string>;
/**
* Description of status icon (displayed in native tooltip)
*/
iconDescription: PropTypes.Requireable<string>;
/**
* Specify if the currently uploaded file is invalid
*/
invalid: PropTypes.Requireable<boolean>;
/**
* Name of the uploaded file
*/
name: PropTypes.Requireable<string>;
/**
* Event handler that is called after removing a file from the file uploader
* The event handler signature looks like `onDelete(evt, { uuid })`
*/
onDelete: PropTypes.Requireable<(...args: any[]) => any>;
/**
* Specify the size of the FileUploaderButton, from a list of available
* sizes.
*/
size: PropTypes.Requireable<string>;
/**
* Status of the file upload
*/
status: PropTypes.Requireable<string>;
/**
* Unique identifier for the file object
*/
uuid: PropTypes.Requireable<string>;
};
var defaultProps: {
status: string;
onDelete: () => void;
};
}
export default FileUploaderItem;