mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 11:14:05 +00:00
* Allowed HTML Attributes to be passed via props This fix still needs some work, as certain attributes could be passed to Uppy or as an HTML attribute, such as target When this is fixed, this will resolve #2403 * Removed shared attributes I removed the ability to use certain attributes ('width', 'height', and 'target') and pass them down as Props to the div due to that fact that Uppy relies on them * Add typescript types for the HTML attributes * Moved common.js to getHTMLProps.js * Fixed import * Converted `possibleStandardNames` to an Array * Fix import * Fix tests
20 lines
816 B
TypeScript
20 lines
816 B
TypeScript
import { Omit, ToUppyProps } from './CommonTypes'
|
|
import Dashboard = require('@uppy/dashboard')
|
|
|
|
// This type is mapped into `DashboardProps` below so IntelliSense doesn't display this big mess of nested types
|
|
type DashboardPropsInner = Omit<
|
|
ToUppyProps<Dashboard.DashboardOptions>,
|
|
// Remove the modal-only props
|
|
'animateOpenClose' | 'browserBackButtonClose' | 'inline' | 'onRequestCloseModal' | 'trigger'
|
|
> & React.BaseHTMLAttributes<HTMLDivElement>
|
|
|
|
export type DashboardProps = {
|
|
[K in keyof DashboardPropsInner]: DashboardPropsInner[K]
|
|
}
|
|
|
|
/**
|
|
* React Component that renders a Dashboard for an Uppy instance. This component
|
|
* renders the Dashboard inline so you can put it anywhere you want.
|
|
*/
|
|
declare const DashboardComponent: React.ComponentType<DashboardProps>
|
|
export default DashboardComponent
|