@entur/fileupload 0.4.13 → 0.4.15-beta.0
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/FileUpload.d.ts +43 -0
- package/dist/index.d.ts +1 -48
- package/dist/index.test.d.ts +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DropzoneOptions, FileRejection, DropEvent } from 'react-dropzone';
|
|
3
|
+
type FileUploadProps = DropzoneOptions & {
|
|
4
|
+
/** Tekst som vises ved fullført opplasting
|
|
5
|
+
* @default "Opplasting fullført"
|
|
6
|
+
*/
|
|
7
|
+
successText?: string;
|
|
8
|
+
/** Tekst som vises om opplasting feilet
|
|
9
|
+
* @default "Feil ved opplasting av fil"
|
|
10
|
+
*/
|
|
11
|
+
errorText?: string;
|
|
12
|
+
/** Tekst som vises før man laster opp noe
|
|
13
|
+
* @default "Dra fil eller klikk for å laste opp"
|
|
14
|
+
*/
|
|
15
|
+
standbyText?: string;
|
|
16
|
+
/** Boolean for hvis opplastingen feiler.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
errorUpload?: boolean;
|
|
20
|
+
/** Callback for når en fil legges til */
|
|
21
|
+
onDrop?<T extends File>(acceptedFiles: T[], fileRejections: FileRejection[], event: DropEvent): void;
|
|
22
|
+
/** Callback for når en fil slettes fra lista */
|
|
23
|
+
onDelete?: (file: File) => void;
|
|
24
|
+
/** Hvilken filtyper som skal aksepteres */
|
|
25
|
+
accept?: string | string[];
|
|
26
|
+
/** Filene som er aktive i komponenten */
|
|
27
|
+
files: File[];
|
|
28
|
+
/** Beskrivende tekst som forklarer feltet */
|
|
29
|
+
label?: string;
|
|
30
|
+
/** Mulighet for å laste opp flere filer */
|
|
31
|
+
multiple?: boolean;
|
|
32
|
+
/**Minste filstørrelse */
|
|
33
|
+
minSize?: number;
|
|
34
|
+
/**Største filstørrelse */
|
|
35
|
+
maxSize?: number;
|
|
36
|
+
/**Tekst som leses opp av skjermleser på søppelbøtte-ikonet
|
|
37
|
+
* @default "Fjern fil"
|
|
38
|
+
*/
|
|
39
|
+
removeFileButtonDescription?: string;
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
};
|
|
42
|
+
export declare const FileUpload: React.FC<FileUploadProps>;
|
|
43
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { DropEvent } from 'react-dropzone';
|
|
3
|
-
import { DropzoneOptions } from 'react-dropzone';
|
|
4
|
-
import { FileRejection } from 'react-dropzone';
|
|
5
|
-
|
|
6
|
-
export declare const FileUpload: default_2.FC<FileUploadProps>;
|
|
7
|
-
|
|
8
|
-
declare type FileUploadProps = DropzoneOptions & {
|
|
9
|
-
/** Tekst som vises ved fullført opplasting
|
|
10
|
-
* @default "Opplasting fullført"
|
|
11
|
-
*/
|
|
12
|
-
successText?: string;
|
|
13
|
-
/** Tekst som vises om opplasting feilet
|
|
14
|
-
* @default "Feil ved opplasting av fil"
|
|
15
|
-
*/
|
|
16
|
-
errorText?: string;
|
|
17
|
-
/** Tekst som vises før man laster opp noe
|
|
18
|
-
* @default "Dra fil eller klikk for å laste opp"
|
|
19
|
-
*/
|
|
20
|
-
standbyText?: string;
|
|
21
|
-
/** Boolean for hvis opplastingen feiler.
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
errorUpload?: boolean;
|
|
25
|
-
/** Callback for når en fil legges til */
|
|
26
|
-
onDrop?<T extends File>(acceptedFiles: T[], fileRejections: FileRejection[], event: DropEvent): void;
|
|
27
|
-
/** Callback for når en fil slettes fra lista */
|
|
28
|
-
onDelete?: (file: File) => void;
|
|
29
|
-
/** Hvilken filtyper som skal aksepteres */
|
|
30
|
-
accept?: string | string[];
|
|
31
|
-
/** Filene som er aktive i komponenten */
|
|
32
|
-
files: File[];
|
|
33
|
-
/** Beskrivende tekst som forklarer feltet */
|
|
34
|
-
label?: string;
|
|
35
|
-
/** Mulighet for å laste opp flere filer */
|
|
36
|
-
multiple?: boolean;
|
|
37
|
-
/**Minste filstørrelse */
|
|
38
|
-
minSize?: number;
|
|
39
|
-
/**Største filstørrelse */
|
|
40
|
-
maxSize?: number;
|
|
41
|
-
/**Tekst som leses opp av skjermleser på søppelbøtte-ikonet
|
|
42
|
-
* @default "Fjern fil"
|
|
43
|
-
*/
|
|
44
|
-
removeFileButtonDescription?: string;
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export { }
|
|
1
|
+
export * from './FileUpload';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/fileupload",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.15-beta.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"main": "dist/fileupload.cjs.js",
|
|
6
6
|
"module": "dist/fileupload.esm.js",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"react-dom": ">=16.8.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@entur/a11y": "^0.2.
|
|
31
|
-
"@entur/button": "
|
|
32
|
-
"@entur/icons": "^8.0.
|
|
33
|
-
"@entur/tokens": "^3.19.
|
|
34
|
-
"@entur/typography": "^1.
|
|
35
|
-
"@entur/utils": "^0.12.
|
|
30
|
+
"@entur/a11y": "^0.2.101",
|
|
31
|
+
"@entur/button": "workspace:^",
|
|
32
|
+
"@entur/icons": "^8.0.2",
|
|
33
|
+
"@entur/tokens": "^3.19.3",
|
|
34
|
+
"@entur/typography": "^1.10.0-beta.0",
|
|
35
|
+
"@entur/utils": "^0.12.5",
|
|
36
36
|
"classnames": "^2.5.1",
|
|
37
37
|
"react-dropzone": "^11.7.1"
|
|
38
38
|
},
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"vite": "^7.1.3",
|
|
50
50
|
"vite-plugin-dts": "^4.5.4"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "1af57733502628c4b59860f42d15c7456b09025e"
|
|
53
53
|
}
|