@digital-ai/dot-components 2.24.3 → 2.25.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-ai/dot-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE.md>",
|
|
6
6
|
"contributors": [
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
|
+
"index.esm.mjs",
|
|
25
26
|
"**/*.styles.{js,jsx,ts,tsx}",
|
|
26
27
|
"**/*.{js,jsx,ts,tsx,svg,woff}",
|
|
27
28
|
"!**/testing-utils/**",
|
|
@@ -18,6 +18,8 @@ export interface FileUploadProps extends CommonProps {
|
|
|
18
18
|
buttonOnly?: boolean;
|
|
19
19
|
/** the file upload button props, not all button props are available */
|
|
20
20
|
buttonProps?: FileUploadButtonProps;
|
|
21
|
+
/** An array of strings describing errors with the contents of the file at that index, or null if there are no errors */
|
|
22
|
+
contentErrors?: Array<string>;
|
|
21
23
|
/** If true, the upload zone will be disabled */
|
|
22
24
|
disabled?: boolean;
|
|
23
25
|
/** If true, upload file list won't be displayed. Used when consumer wants to render his own list. */
|
|
@@ -33,5 +35,5 @@ export interface FileUploadProps extends CommonProps {
|
|
|
33
35
|
/** Optional callback which gets triggered when the file (from the list) is clicked. */
|
|
34
36
|
onFileClick?: (file: ListItemFile) => void;
|
|
35
37
|
}
|
|
36
|
-
export declare const DotFileUpload: ({ accept, ariaLabel, ariaRole, buttonProps, buttonOnly, className, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, hideFilesList, maxFiles, maxSize, onChange, onDragEnter, onFileClick, }: FileUploadProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const DotFileUpload: ({ accept, ariaLabel, ariaRole, buttonProps, buttonOnly, className, contentErrors, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, hideFilesList, maxFiles, maxSize, onChange, onDragEnter, onFileClick, }: FileUploadProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
39
|
export {};
|
|
@@ -8,10 +8,10 @@ export declare const renderSelectFilesButton: (buttonProps: FileUploadButtonProp
|
|
|
8
8
|
export declare const renderActiveDragArea: () => ReactNode;
|
|
9
9
|
export declare const renderDragAndDropArea: (buttonProps: FileUploadButtonProps, isUploadDisabled: boolean, onSelectButtonClick: () => void) => ReactNode;
|
|
10
10
|
export declare const renderDropzoneContent: ({ buttonOnly, buttonProps, isDragActive, isUploadDisabled, open, }: DropzoneContentArgs) => React.ReactNode;
|
|
11
|
-
export declare const getUploadedFilesList: ({ maxSize, onFileClick, onFileDelete, uploadedFiles, }: UploadedFilesListArgs) => {
|
|
11
|
+
export declare const getUploadedFilesList: ({ contentErrors, maxSize, onFileClick, onFileDelete, uploadedFiles, }: UploadedFilesListArgs) => {
|
|
12
12
|
child: import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
}[];
|
|
14
|
-
export declare const parseListItem: ({
|
|
14
|
+
export declare const parseListItem: ({ contentError, fileToBeParsed, index, maxSize, onFileDelete, onFileClick, }: ParseListItemArgs) => {
|
|
15
15
|
child: import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
};
|
|
17
17
|
export declare const mapAcceptedFiles: (files: File[]) => {
|
|
@@ -21,12 +21,14 @@ export interface DropzoneContentArgs {
|
|
|
21
21
|
open: () => void;
|
|
22
22
|
}
|
|
23
23
|
export interface UploadedFilesListArgs {
|
|
24
|
+
contentErrors?: string[];
|
|
24
25
|
maxSize: number;
|
|
25
26
|
onFileClick?: (file: ListItemFile) => void;
|
|
26
27
|
onFileDelete: (fileIndexToBeRemoved: number) => void;
|
|
27
28
|
uploadedFiles: MappedFile[];
|
|
28
29
|
}
|
|
29
30
|
export interface ParseListItemArgs {
|
|
31
|
+
contentError?: string;
|
|
30
32
|
fileToBeParsed: MappedFile;
|
|
31
33
|
index: number;
|
|
32
34
|
maxSize: number;
|