@vaadin/upload 23.0.0-alpha3 → 23.0.0-beta2

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": "@vaadin/upload",
3
- "version": "23.0.0-alpha3",
3
+ "version": "23.0.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "main": "vaadin-upload.js",
20
20
  "module": "vaadin-upload.js",
21
+ "type": "module",
21
22
  "files": [
22
23
  "src",
23
24
  "theme",
@@ -33,18 +34,18 @@
33
34
  ],
34
35
  "dependencies": {
35
36
  "@polymer/polymer": "^3.0.0",
36
- "@vaadin/button": "23.0.0-alpha3",
37
- "@vaadin/component-base": "23.0.0-alpha3",
38
- "@vaadin/progress-bar": "23.0.0-alpha3",
39
- "@vaadin/vaadin-lumo-styles": "23.0.0-alpha3",
40
- "@vaadin/vaadin-material-styles": "23.0.0-alpha3",
41
- "@vaadin/vaadin-themable-mixin": "23.0.0-alpha3"
37
+ "@vaadin/button": "23.0.0-beta2",
38
+ "@vaadin/component-base": "23.0.0-beta2",
39
+ "@vaadin/progress-bar": "23.0.0-beta2",
40
+ "@vaadin/vaadin-lumo-styles": "23.0.0-beta2",
41
+ "@vaadin/vaadin-material-styles": "23.0.0-beta2",
42
+ "@vaadin/vaadin-themable-mixin": "23.0.0-beta2"
42
43
  },
43
44
  "devDependencies": {
44
45
  "@esm-bundle/chai": "^4.3.4",
45
- "@vaadin/form-layout": "23.0.0-alpha3",
46
+ "@vaadin/form-layout": "23.0.0-beta2",
46
47
  "@vaadin/testing-helpers": "^0.3.2",
47
48
  "sinon": "^9.2.0"
48
49
  },
49
- "gitHead": "490037919a9e054cc002c1b3be0c94a1603e1a44"
50
+ "gitHead": "a276f7a0fd00e5459b87267468e0dd0d4fb6f7f3"
50
51
  }
@@ -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');