@vaadin/upload 23.0.0-beta1 → 23.0.0-beta5
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 +9 -9
- package/src/vaadin-upload.js +25 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/upload",
|
|
3
|
-
"version": "23.0.0-
|
|
3
|
+
"version": "23.0.0-beta5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/button": "23.0.0-
|
|
38
|
-
"@vaadin/component-base": "23.0.0-
|
|
39
|
-
"@vaadin/progress-bar": "23.0.0-
|
|
40
|
-
"@vaadin/vaadin-lumo-styles": "23.0.0-
|
|
41
|
-
"@vaadin/vaadin-material-styles": "23.0.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "23.0.0-
|
|
37
|
+
"@vaadin/button": "23.0.0-beta5",
|
|
38
|
+
"@vaadin/component-base": "23.0.0-beta5",
|
|
39
|
+
"@vaadin/progress-bar": "23.0.0-beta5",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "23.0.0-beta5",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "23.0.0-beta5",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-beta5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@esm-bundle/chai": "^4.3.4",
|
|
46
|
-
"@vaadin/form-layout": "23.0.0-
|
|
46
|
+
"@vaadin/form-layout": "23.0.0-beta5",
|
|
47
47
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
48
48
|
"sinon": "^9.2.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "4c388aeec6623869c70896c909799804fc95d0f9"
|
|
51
51
|
}
|
package/src/vaadin-upload.js
CHANGED
|
@@ -8,6 +8,7 @@ import '@vaadin/button/src/vaadin-button.js';
|
|
|
8
8
|
import './vaadin-upload-icons.js';
|
|
9
9
|
import './vaadin-upload-file.js';
|
|
10
10
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
11
|
+
import { announce } from '@vaadin/component-base/src/a11y-announcer.js';
|
|
11
12
|
import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
|
|
12
13
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
13
14
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
@@ -443,6 +444,10 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
443
444
|
this.addEventListener('file-abort', this._onFileAbort.bind(this));
|
|
444
445
|
this.addEventListener('file-remove', this._onFileRemove.bind(this));
|
|
445
446
|
this.addEventListener('file-start', this._onFileStart.bind(this));
|
|
447
|
+
this.addEventListener('file-reject', this._onFileReject.bind(this));
|
|
448
|
+
this.addEventListener('upload-start', this._onUploadStart.bind(this));
|
|
449
|
+
this.addEventListener('upload-success', this._onUploadSuccess.bind(this));
|
|
450
|
+
this.addEventListener('upload-error', this._onUploadError.bind(this));
|
|
446
451
|
}
|
|
447
452
|
|
|
448
453
|
/** @private */
|
|
@@ -857,6 +862,26 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
857
862
|
this._removeFile(event.detail.file);
|
|
858
863
|
}
|
|
859
864
|
|
|
865
|
+
/** @private */
|
|
866
|
+
_onFileReject(event) {
|
|
867
|
+
announce(`${event.detail.file.name}: ${event.detail.file.error}`, { mode: 'alert' });
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/** @private */
|
|
871
|
+
_onUploadStart(event) {
|
|
872
|
+
announce(`${event.detail.file.name}: 0%`, { mode: 'alert' });
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/** @private */
|
|
876
|
+
_onUploadSuccess(event) {
|
|
877
|
+
announce(`${event.detail.file.name}: 100%`, { mode: 'alert' });
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/** @private */
|
|
881
|
+
_onUploadError(event) {
|
|
882
|
+
announce(`${event.detail.file.name}: ${event.detail.file.error}`, { mode: 'alert' });
|
|
883
|
+
}
|
|
884
|
+
|
|
860
885
|
/** @private */
|
|
861
886
|
_dragoverChanged(dragover) {
|
|
862
887
|
dragover ? this.setAttribute('dragover', dragover) : this.removeAttribute('dragover');
|