@vaadin/upload 25.1.0-alpha7 → 25.1.0-alpha8
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/custom-elements.json +1 -1
- package/package.json +11 -11
- package/src/vaadin-upload-drop-zone.js +1 -1
- package/src/vaadin-upload-file-list-mixin.js +1 -0
- package/src/vaadin-upload-manager.d.ts +7 -1
- package/src/vaadin-upload-manager.js +2 -0
- package/src/vaadin-upload-mixin.d.ts +1 -0
- package/src/vaadin-upload-mixin.js +3 -0
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -1487,7 +1487,7 @@
|
|
|
1487
1487
|
"type": {
|
|
1488
1488
|
"text": "object"
|
|
1489
1489
|
},
|
|
1490
|
-
"default": "{ dropFiles: { one: 'Drop file here', many: 'Drop files here', }, addFiles: { one: 'Upload File...', many: 'Upload Files...', }, error: { tooManyFiles: 'Too Many Files.', fileIsTooBig: 'File is Too Big.', incorrectFileType: 'Incorrect File Type.', }, uploading: { status: { connecting: 'Connecting...', stalled: 'Stalled', processing: 'Processing File...', held: 'Queued', }, remainingTime: { prefix: 'remaining time: ', unknown: 'unknown remaining time', }, error: { serverUnavailable: 'Upload failed, please try again later', unexpectedServerError: 'Upload failed due to server error', forbidden: 'Upload forbidden', }, }, file: { retry: 'Retry', start: 'Start', remove: 'Remove', }, units: { size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], }, }"
|
|
1490
|
+
"default": "{ dropFiles: { one: 'Drop file here', many: 'Drop files here', }, addFiles: { one: 'Upload File...', many: 'Upload Files...', }, error: { tooManyFiles: 'Too Many Files.', fileIsTooBig: 'File is Too Big.', incorrectFileType: 'Incorrect File Type.', }, uploading: { status: { connecting: 'Connecting...', stalled: 'Stalled', processing: 'Processing File...', held: 'Queued', }, remainingTime: { prefix: 'remaining time: ', unknown: 'unknown remaining time', }, error: { serverUnavailable: 'Upload failed, please try again later', unexpectedServerError: 'Upload failed due to server error', forbidden: 'Upload forbidden', fileTooLarge: 'File is too large', }, }, file: { retry: 'Retry', start: 'Start', remove: 'Remove', }, units: { size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], }, }"
|
|
1491
1491
|
},
|
|
1492
1492
|
{
|
|
1493
1493
|
"kind": "mixin",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/upload",
|
|
3
|
-
"version": "25.1.0-
|
|
3
|
+
"version": "25.1.0-alpha8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.1.0-
|
|
39
|
-
"@vaadin/button": "25.1.0-
|
|
40
|
-
"@vaadin/component-base": "25.1.0-
|
|
41
|
-
"@vaadin/progress-bar": "25.1.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.1.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.1.0-alpha8",
|
|
39
|
+
"@vaadin/button": "25.1.0-alpha8",
|
|
40
|
+
"@vaadin/component-base": "25.1.0-alpha8",
|
|
41
|
+
"@vaadin/progress-bar": "25.1.0-alpha8",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "25.1.0-alpha8",
|
|
43
43
|
"lit": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@vaadin/aura": "25.1.0-
|
|
47
|
-
"@vaadin/chai-plugins": "25.1.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "25.1.0-
|
|
46
|
+
"@vaadin/aura": "25.1.0-alpha8",
|
|
47
|
+
"@vaadin/chai-plugins": "25.1.0-alpha8",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.1.0-alpha8",
|
|
49
49
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "25.1.0-
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "25.1.0-alpha8",
|
|
51
51
|
"sinon": "^21.0.0"
|
|
52
52
|
},
|
|
53
53
|
"customElements": "custom-elements.json",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"web-types.json",
|
|
56
56
|
"web-types.lit.json"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "810590c9c7682a9326c9352df795b5ea4891a71f"
|
|
59
59
|
}
|
|
@@ -193,7 +193,7 @@ class UploadDropZone extends ElementMixin(ThemableMixin(PolylitMixin(LumoInjecti
|
|
|
193
193
|
event.preventDefault();
|
|
194
194
|
// Only remove dragover if we're actually leaving the drop zone
|
|
195
195
|
// (not just entering a child element)
|
|
196
|
-
if (event.
|
|
196
|
+
if (event.target !== this) {
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
199
|
this.__dragover = false;
|
|
@@ -9,7 +9,13 @@ export type UploadFormat = 'raw' | 'multipart';
|
|
|
9
9
|
|
|
10
10
|
export type FileRejectError = 'tooManyFiles' | 'fileIsTooBig' | 'incorrectFileType';
|
|
11
11
|
|
|
12
|
-
export type UploadErrorKey =
|
|
12
|
+
export type UploadErrorKey =
|
|
13
|
+
| 'timeout'
|
|
14
|
+
| 'serverUnavailable'
|
|
15
|
+
| 'unexpectedServerError'
|
|
16
|
+
| 'forbidden'
|
|
17
|
+
| 'sendFailed'
|
|
18
|
+
| 'fileTooLarge';
|
|
13
19
|
|
|
14
20
|
export interface UploadFile extends File {
|
|
15
21
|
uploadTarget: string;
|
|
@@ -544,6 +544,8 @@ export class UploadManager extends EventTarget {
|
|
|
544
544
|
file.errorKey = 'serverUnavailable';
|
|
545
545
|
} else if (xhr.status >= 500) {
|
|
546
546
|
file.errorKey = 'unexpectedServerError';
|
|
547
|
+
} else if (xhr.status === 413) {
|
|
548
|
+
file.errorKey = 'fileTooLarge';
|
|
547
549
|
} else if (xhr.status >= 400) {
|
|
548
550
|
file.errorKey = 'forbidden';
|
|
549
551
|
}
|
|
@@ -39,6 +39,7 @@ export const DEFAULT_I18N = {
|
|
|
39
39
|
serverUnavailable: 'Upload failed, please try again later',
|
|
40
40
|
unexpectedServerError: 'Upload failed due to server error',
|
|
41
41
|
forbidden: 'Upload forbidden',
|
|
42
|
+
fileTooLarge: 'File is too large',
|
|
42
43
|
},
|
|
43
44
|
},
|
|
44
45
|
file: {
|
|
@@ -795,6 +796,8 @@ export const UploadMixin = (superClass) =>
|
|
|
795
796
|
file.error = this.__effectiveI18n.uploading.error.serverUnavailable;
|
|
796
797
|
} else if (xhr.status >= 500) {
|
|
797
798
|
file.error = this.__effectiveI18n.uploading.error.unexpectedServerError;
|
|
799
|
+
} else if (xhr.status === 413) {
|
|
800
|
+
file.error = this.__effectiveI18n.uploading.error.fileTooLarge;
|
|
798
801
|
} else if (xhr.status >= 400) {
|
|
799
802
|
file.error = this.__effectiveI18n.uploading.error.forbidden;
|
|
800
803
|
}
|
package/web-types.json
CHANGED