@vaadin/upload 23.1.0-beta1 → 23.1.0-beta4

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.1.0-beta1",
3
+ "version": "23.1.0-beta4",
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.1.0-beta1",
38
- "@vaadin/component-base": "23.1.0-beta1",
39
- "@vaadin/progress-bar": "23.1.0-beta1",
40
- "@vaadin/vaadin-lumo-styles": "23.1.0-beta1",
41
- "@vaadin/vaadin-material-styles": "23.1.0-beta1",
42
- "@vaadin/vaadin-themable-mixin": "23.1.0-beta1"
37
+ "@vaadin/button": "23.1.0-beta4",
38
+ "@vaadin/component-base": "23.1.0-beta4",
39
+ "@vaadin/progress-bar": "23.1.0-beta4",
40
+ "@vaadin/vaadin-lumo-styles": "23.1.0-beta4",
41
+ "@vaadin/vaadin-material-styles": "23.1.0-beta4",
42
+ "@vaadin/vaadin-themable-mixin": "23.1.0-beta4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@esm-bundle/chai": "^4.3.4",
46
- "@vaadin/form-layout": "23.1.0-beta1",
46
+ "@vaadin/form-layout": "23.1.0-beta4",
47
47
  "@vaadin/testing-helpers": "^0.3.2",
48
48
  "sinon": "^13.0.2"
49
49
  },
50
- "gitHead": "8be43cf83102a6b9ccf309687446e590ce0164e8"
50
+ "gitHead": "06e283473964ecb3085aacf3eddb5333d052a045"
51
51
  }
@@ -59,8 +59,8 @@ export interface UploadI18n {
59
59
  size: string[];
60
60
  sizeBase?: number;
61
61
  };
62
- formatSize?: (bytes: number) => string;
63
- formatTime?: (seconds: number, units: number[]) => string;
62
+ formatSize?(bytes: number): string;
63
+ formatTime?(seconds: number, units: number[]): string;
64
64
  }
65
65
 
66
66
  export type UploadMethod = 'POST' | 'PUT';
@@ -221,9 +221,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
221
221
  files: {
222
222
  type: Array,
223
223
  notify: true,
224
- value: function () {
225
- return [];
226
- },
224
+ value: () => [],
227
225
  },
228
226
 
229
227
  /**
@@ -388,7 +386,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
388
386
  */
389
387
  i18n: {
390
388
  type: Object,
391
- value: function () {
389
+ value() {
392
390
  return {
393
391
  dropFiles: {
394
392
  one: 'Drop file here',
@@ -469,7 +467,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
469
467
  const unitSizes = [60, 60, 24, Infinity];
470
468
  const timeValues = [0];
471
469
 
472
- for (var i = 0; i < unitSizes.length && time > 0; i++) {
470
+ for (let i = 0; i < unitSizes.length && time > 0; i++) {
473
471
  timeValues[i] = time % unitSizes[i];
474
472
  time = Math.floor(time / unitSizes[i]);
475
473
  }
@@ -552,7 +550,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
552
550
  this.headers = undefined;
553
551
  }
554
552
  }
555
- for (var key in this.headers) {
553
+ for (const key in this.headers) {
556
554
  xhr.setRequestHeader(key, this.headers[key]);
557
555
  }
558
556
  if (this.timeout) {
@@ -597,7 +595,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
597
595
  const xhr = (file.xhr = this._createXhr());
598
596
 
599
597
  let stalledId, last;
600
- // onprogress is called always after onreadystatechange
598
+ // Onprogress is called always after onreadystatechange
601
599
  xhr.upload.onprogress = (e) => {
602
600
  clearTimeout(stalledId);
603
601
 
@@ -747,7 +745,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
747
745
 
748
746
  /** @private */
749
747
  _notifyFileChanges(file) {
750
- var p = `files.${this.files.indexOf(file)}.`;
748
+ const p = `files.${this.files.indexOf(file)}.`;
751
749
  for (const i in file) {
752
750
  // eslint-disable-next-line no-prototype-builtins
753
751
  if (file.hasOwnProperty(i)) {