@delightui/components 0.1.150 → 0.1.152
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/cjs/components/organisms/Dropzone/Dropzone.d.ts +2 -2
- package/dist/cjs/components/organisms/Dropzone/Dropzone.presenter.d.ts +5 -4
- package/dist/cjs/components/organisms/Dropzone/Dropzone.types.d.ts +16 -2
- package/dist/cjs/components/organisms/Form/DropzoneFormExample.d.ts +2 -0
- package/dist/cjs/library.js +3 -3
- package/dist/cjs/library.js.map +1 -1
- package/dist/esm/components/organisms/Dropzone/Dropzone.d.ts +2 -2
- package/dist/esm/components/organisms/Dropzone/Dropzone.presenter.d.ts +5 -4
- package/dist/esm/components/organisms/Dropzone/Dropzone.types.d.ts +16 -2
- package/dist/esm/components/organisms/Form/DropzoneFormExample.d.ts +2 -0
- package/dist/esm/library.js +1 -1
- package/dist/esm/library.js.map +1 -1
- package/dist/index.d.ts +17 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2263,7 +2263,7 @@ type DropzoneStatus = 'Empty' | 'Loading' | 'Uploaded';
|
|
|
2263
2263
|
* @param onFilesUpload (file: File) => void - callback when files are selected
|
|
2264
2264
|
* @param onFilesReset () => void - callback when files are reset
|
|
2265
2265
|
*/
|
|
2266
|
-
type DropzoneProps = ControlledFormComponentProps<
|
|
2266
|
+
type DropzoneProps<T extends File | string = File> = ControlledFormComponentProps<T[]> & {
|
|
2267
2267
|
className?: string;
|
|
2268
2268
|
/**
|
|
2269
2269
|
* the view when no file is selected.
|
|
@@ -2304,6 +2304,18 @@ type DropzoneProps = ControlledFormComponentProps<File[]> & {
|
|
|
2304
2304
|
* callback when files are reset
|
|
2305
2305
|
*/
|
|
2306
2306
|
onFilesReset?: () => void;
|
|
2307
|
+
/**
|
|
2308
|
+
* Callback when files are changed for dropzone
|
|
2309
|
+
* @param Files updated selected files by user
|
|
2310
|
+
* @returns {void}
|
|
2311
|
+
*/
|
|
2312
|
+
handleFilesChange?: (Files: File[]) => void;
|
|
2313
|
+
/**
|
|
2314
|
+
* specifies what the component needs to accept as value
|
|
2315
|
+
* sync this with Dropzone generics
|
|
2316
|
+
* @default 'File'
|
|
2317
|
+
*/
|
|
2318
|
+
type?: 'File' | 'URL';
|
|
2307
2319
|
};
|
|
2308
2320
|
/**
|
|
2309
2321
|
* Dropzone context type
|
|
@@ -2312,7 +2324,7 @@ type DropzoneProps = ControlledFormComponentProps<File[]> & {
|
|
|
2312
2324
|
* @param selectFile () => void - The function to call when the file is selected.
|
|
2313
2325
|
* @param resetUpload () => void - The function to call when the file is reset.
|
|
2314
2326
|
*/
|
|
2315
|
-
type DropzoneContextType = {
|
|
2327
|
+
type DropzoneContextType<T extends File | string = File> = {
|
|
2316
2328
|
/**
|
|
2317
2329
|
* The status of the dropzone.
|
|
2318
2330
|
*/
|
|
@@ -2331,6 +2343,7 @@ type DropzoneContextType = {
|
|
|
2331
2343
|
accept: {
|
|
2332
2344
|
[key: string]: readonly string[];
|
|
2333
2345
|
};
|
|
2346
|
+
value?: T[];
|
|
2334
2347
|
/**
|
|
2335
2348
|
* The function to call to open the file dialog.
|
|
2336
2349
|
*/
|
|
@@ -2352,8 +2365,8 @@ type DropzoneFilenameProps = TextProps & {
|
|
|
2352
2365
|
fileIndex?: number;
|
|
2353
2366
|
};
|
|
2354
2367
|
|
|
2355
|
-
declare const Dropzone: (props: DropzoneProps) => react_jsx_runtime.JSX.Element;
|
|
2356
|
-
declare const useDropzoneContext: () => DropzoneContextType
|
|
2368
|
+
declare const Dropzone: <T extends File | string = File>(props: DropzoneProps<T>) => react_jsx_runtime.JSX.Element;
|
|
2369
|
+
declare const useDropzoneContext: <T extends File | string = File>() => DropzoneContextType<T>;
|
|
2357
2370
|
|
|
2358
2371
|
declare const DropzoneClear: (props: DropzoneClearProps) => react_jsx_runtime.JSX.Element;
|
|
2359
2372
|
|