@vaadin/upload 23.0.8 → 23.0.11
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.
|
|
3
|
+
"version": "23.0.11",
|
|
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.
|
|
38
|
-
"@vaadin/component-base": "^23.0.
|
|
39
|
-
"@vaadin/progress-bar": "^23.0.
|
|
40
|
-
"@vaadin/vaadin-lumo-styles": "^23.0.
|
|
41
|
-
"@vaadin/vaadin-material-styles": "^23.0.
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "^23.0.
|
|
37
|
+
"@vaadin/button": "^23.0.11",
|
|
38
|
+
"@vaadin/component-base": "^23.0.11",
|
|
39
|
+
"@vaadin/progress-bar": "^23.0.11",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "^23.0.11",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "^23.0.11",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "^23.0.11"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@esm-bundle/chai": "^4.3.4",
|
|
46
|
-
"@vaadin/form-layout": "^23.0.
|
|
46
|
+
"@vaadin/form-layout": "^23.0.11",
|
|
47
47
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
48
48
|
"sinon": "^9.2.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "10838304fe6f5c98b838ec3a90bdcf49cbf4650b"
|
|
51
51
|
}
|
|
@@ -143,8 +143,8 @@ class UploadFile extends FocusMixin(ThemableMixin(PolymerElement)) {
|
|
|
143
143
|
tabindex: {
|
|
144
144
|
type: Number,
|
|
145
145
|
value: 0,
|
|
146
|
-
reflectToAttribute: true
|
|
147
|
-
}
|
|
146
|
+
reflectToAttribute: true,
|
|
147
|
+
},
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -154,7 +154,7 @@ class UploadFile extends FocusMixin(ThemableMixin(PolymerElement)) {
|
|
|
154
154
|
'_toggleHostAttribute(file.error, "error")',
|
|
155
155
|
'_toggleHostAttribute(file.indeterminate, "indeterminate")',
|
|
156
156
|
'_toggleHostAttribute(file.uploading, "uploading")',
|
|
157
|
-
'_toggleHostAttribute(file.complete, "complete")'
|
|
157
|
+
'_toggleHostAttribute(file.complete, "complete")',
|
|
158
158
|
];
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -203,8 +203,8 @@ class UploadFile extends FocusMixin(ThemableMixin(PolymerElement)) {
|
|
|
203
203
|
new CustomEvent('file-remove', {
|
|
204
204
|
detail: { file: this.file },
|
|
205
205
|
bubbles: true,
|
|
206
|
-
composed: true
|
|
207
|
-
})
|
|
206
|
+
composed: true,
|
|
207
|
+
}),
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
|
|
@@ -220,8 +220,8 @@ class UploadFile extends FocusMixin(ThemableMixin(PolymerElement)) {
|
|
|
220
220
|
new CustomEvent(e.target.getAttribute('file-event'), {
|
|
221
221
|
detail: { file: this.file },
|
|
222
222
|
bubbles: true,
|
|
223
|
-
composed: true
|
|
224
|
-
})
|
|
223
|
+
composed: true,
|
|
224
|
+
}),
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
|
package/src/vaadin-upload.d.ts
CHANGED
|
@@ -401,13 +401,13 @@ declare class Upload extends ThemableMixin(ElementMixin(HTMLElement)) {
|
|
|
401
401
|
addEventListener<K extends keyof UploadEventMap>(
|
|
402
402
|
type: K,
|
|
403
403
|
listener: (this: Upload, ev: UploadEventMap[K]) => void,
|
|
404
|
-
options?: boolean | AddEventListenerOptions
|
|
404
|
+
options?: boolean | AddEventListenerOptions,
|
|
405
405
|
): void;
|
|
406
406
|
|
|
407
407
|
removeEventListener<K extends keyof UploadEventMap>(
|
|
408
408
|
type: K,
|
|
409
409
|
listener: (this: Upload, ev: UploadEventMap[K]) => void,
|
|
410
|
-
options?: boolean | EventListenerOptions
|
|
410
|
+
options?: boolean | EventListenerOptions,
|
|
411
411
|
): void;
|
|
412
412
|
}
|
|
413
413
|
|
package/src/vaadin-upload.js
CHANGED
|
@@ -143,7 +143,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
143
143
|
nodrop: {
|
|
144
144
|
type: Boolean,
|
|
145
145
|
reflectToAttribute: true,
|
|
146
|
-
value: isTouch
|
|
146
|
+
value: isTouch,
|
|
147
147
|
},
|
|
148
148
|
|
|
149
149
|
/**
|
|
@@ -153,7 +153,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
153
153
|
*/
|
|
154
154
|
target: {
|
|
155
155
|
type: String,
|
|
156
|
-
value: ''
|
|
156
|
+
value: '',
|
|
157
157
|
},
|
|
158
158
|
|
|
159
159
|
/**
|
|
@@ -162,7 +162,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
162
162
|
*/
|
|
163
163
|
method: {
|
|
164
164
|
type: String,
|
|
165
|
-
value: 'POST'
|
|
165
|
+
value: 'POST',
|
|
166
166
|
},
|
|
167
167
|
|
|
168
168
|
/**
|
|
@@ -175,7 +175,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
175
175
|
*/
|
|
176
176
|
headers: {
|
|
177
177
|
type: Object,
|
|
178
|
-
value: {}
|
|
178
|
+
value: {},
|
|
179
179
|
},
|
|
180
180
|
|
|
181
181
|
/**
|
|
@@ -185,14 +185,14 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
185
185
|
*/
|
|
186
186
|
timeout: {
|
|
187
187
|
type: Number,
|
|
188
|
-
value: 0
|
|
188
|
+
value: 0,
|
|
189
189
|
},
|
|
190
190
|
|
|
191
191
|
/** @private */
|
|
192
192
|
_dragover: {
|
|
193
193
|
type: Boolean,
|
|
194
194
|
value: false,
|
|
195
|
-
observer: '_dragoverChanged'
|
|
195
|
+
observer: '_dragoverChanged',
|
|
196
196
|
},
|
|
197
197
|
|
|
198
198
|
/**
|
|
@@ -223,7 +223,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
223
223
|
notify: true,
|
|
224
224
|
value: function () {
|
|
225
225
|
return [];
|
|
226
|
-
}
|
|
226
|
+
},
|
|
227
227
|
},
|
|
228
228
|
|
|
229
229
|
/**
|
|
@@ -234,7 +234,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
234
234
|
*/
|
|
235
235
|
maxFiles: {
|
|
236
236
|
type: Number,
|
|
237
|
-
value: Infinity
|
|
237
|
+
value: Infinity,
|
|
238
238
|
},
|
|
239
239
|
|
|
240
240
|
/**
|
|
@@ -248,7 +248,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
248
248
|
notify: true,
|
|
249
249
|
readOnly: true,
|
|
250
250
|
reflectToAttribute: true,
|
|
251
|
-
computed: '_maxFilesAdded(maxFiles, files.length)'
|
|
251
|
+
computed: '_maxFilesAdded(maxFiles, files.length)',
|
|
252
252
|
},
|
|
253
253
|
|
|
254
254
|
/**
|
|
@@ -262,7 +262,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
262
262
|
*/
|
|
263
263
|
accept: {
|
|
264
264
|
type: String,
|
|
265
|
-
value: ''
|
|
265
|
+
value: '',
|
|
266
266
|
},
|
|
267
267
|
|
|
268
268
|
/**
|
|
@@ -275,7 +275,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
275
275
|
*/
|
|
276
276
|
maxFileSize: {
|
|
277
277
|
type: Number,
|
|
278
|
-
value: Infinity
|
|
278
|
+
value: Infinity,
|
|
279
279
|
},
|
|
280
280
|
|
|
281
281
|
/**
|
|
@@ -286,7 +286,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
286
286
|
_dragoverValid: {
|
|
287
287
|
type: Boolean,
|
|
288
288
|
value: false,
|
|
289
|
-
observer: '_dragoverValidChanged'
|
|
289
|
+
observer: '_dragoverValidChanged',
|
|
290
290
|
},
|
|
291
291
|
|
|
292
292
|
/**
|
|
@@ -296,7 +296,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
296
296
|
*/
|
|
297
297
|
formDataName: {
|
|
298
298
|
type: String,
|
|
299
|
-
value: 'file'
|
|
299
|
+
value: 'file',
|
|
300
300
|
},
|
|
301
301
|
|
|
302
302
|
/**
|
|
@@ -307,7 +307,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
307
307
|
*/
|
|
308
308
|
noAuto: {
|
|
309
309
|
type: Boolean,
|
|
310
|
-
value: false
|
|
310
|
+
value: false,
|
|
311
311
|
},
|
|
312
312
|
|
|
313
313
|
/**
|
|
@@ -317,7 +317,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
317
317
|
*/
|
|
318
318
|
withCredentials: {
|
|
319
319
|
type: Boolean,
|
|
320
|
-
value: false
|
|
320
|
+
value: false,
|
|
321
321
|
},
|
|
322
322
|
|
|
323
323
|
/**
|
|
@@ -392,45 +392,45 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
392
392
|
return {
|
|
393
393
|
dropFiles: {
|
|
394
394
|
one: 'Drop file here',
|
|
395
|
-
many: 'Drop files here'
|
|
395
|
+
many: 'Drop files here',
|
|
396
396
|
},
|
|
397
397
|
addFiles: {
|
|
398
398
|
one: 'Upload File...',
|
|
399
|
-
many: 'Upload Files...'
|
|
399
|
+
many: 'Upload Files...',
|
|
400
400
|
},
|
|
401
401
|
error: {
|
|
402
402
|
tooManyFiles: 'Too Many Files.',
|
|
403
403
|
fileIsTooBig: 'File is Too Big.',
|
|
404
|
-
incorrectFileType: 'Incorrect File Type.'
|
|
404
|
+
incorrectFileType: 'Incorrect File Type.',
|
|
405
405
|
},
|
|
406
406
|
uploading: {
|
|
407
407
|
status: {
|
|
408
408
|
connecting: 'Connecting...',
|
|
409
409
|
stalled: 'Stalled',
|
|
410
410
|
processing: 'Processing File...',
|
|
411
|
-
held: 'Queued'
|
|
411
|
+
held: 'Queued',
|
|
412
412
|
},
|
|
413
413
|
remainingTime: {
|
|
414
414
|
prefix: 'remaining time: ',
|
|
415
|
-
unknown: 'unknown remaining time'
|
|
415
|
+
unknown: 'unknown remaining time',
|
|
416
416
|
},
|
|
417
417
|
error: {
|
|
418
418
|
serverUnavailable: 'Upload failed, please try again later',
|
|
419
419
|
unexpectedServerError: 'Upload failed due to server error',
|
|
420
|
-
forbidden: 'Upload forbidden'
|
|
421
|
-
}
|
|
420
|
+
forbidden: 'Upload forbidden',
|
|
421
|
+
},
|
|
422
422
|
},
|
|
423
423
|
file: {
|
|
424
424
|
retry: 'Retry',
|
|
425
425
|
start: 'Start',
|
|
426
|
-
remove: 'Remove'
|
|
426
|
+
remove: 'Remove',
|
|
427
427
|
},
|
|
428
428
|
units: {
|
|
429
|
-
size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
430
|
-
}
|
|
429
|
+
size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
|
430
|
+
},
|
|
431
431
|
};
|
|
432
|
-
}
|
|
433
|
-
}
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
436
|
|
|
@@ -648,8 +648,8 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
648
648
|
const evt = this.dispatchEvent(
|
|
649
649
|
new CustomEvent('upload-response', {
|
|
650
650
|
detail: { file, xhr },
|
|
651
|
-
cancelable: true
|
|
652
|
-
})
|
|
651
|
+
cancelable: true,
|
|
652
|
+
}),
|
|
653
653
|
);
|
|
654
654
|
|
|
655
655
|
if (!evt) {
|
|
@@ -666,8 +666,8 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
666
666
|
file.complete = !file.error;
|
|
667
667
|
this.dispatchEvent(
|
|
668
668
|
new CustomEvent(`upload-${file.error ? 'error' : 'success'}`, {
|
|
669
|
-
detail: { file, xhr }
|
|
670
|
-
})
|
|
669
|
+
detail: { file, xhr },
|
|
670
|
+
}),
|
|
671
671
|
);
|
|
672
672
|
this._notifyFileChanges(file);
|
|
673
673
|
}
|
|
@@ -681,8 +681,8 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
681
681
|
const evt = this.dispatchEvent(
|
|
682
682
|
new CustomEvent('upload-before', {
|
|
683
683
|
detail: { file, xhr },
|
|
684
|
-
cancelable: true
|
|
685
|
-
})
|
|
684
|
+
cancelable: true,
|
|
685
|
+
}),
|
|
686
686
|
);
|
|
687
687
|
if (!evt) {
|
|
688
688
|
return;
|
|
@@ -700,8 +700,8 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
700
700
|
xhr.upload.onloadstart = () => {
|
|
701
701
|
this.dispatchEvent(
|
|
702
702
|
new CustomEvent('upload-start', {
|
|
703
|
-
detail: { file, xhr }
|
|
704
|
-
})
|
|
703
|
+
detail: { file, xhr },
|
|
704
|
+
}),
|
|
705
705
|
);
|
|
706
706
|
this._notifyFileChanges(file);
|
|
707
707
|
};
|
|
@@ -711,8 +711,8 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
711
711
|
const uploadEvt = this.dispatchEvent(
|
|
712
712
|
new CustomEvent('upload-request', {
|
|
713
713
|
detail: { file, xhr, formData },
|
|
714
|
-
cancelable: true
|
|
715
|
-
})
|
|
714
|
+
cancelable: true,
|
|
715
|
+
}),
|
|
716
716
|
);
|
|
717
717
|
if (uploadEvt) {
|
|
718
718
|
xhr.send(formData);
|
|
@@ -724,8 +724,8 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
724
724
|
const evt = this.dispatchEvent(
|
|
725
725
|
new CustomEvent('upload-retry', {
|
|
726
726
|
detail: { file, xhr: file.xhr },
|
|
727
|
-
cancelable: true
|
|
728
|
-
})
|
|
727
|
+
cancelable: true,
|
|
728
|
+
}),
|
|
729
729
|
);
|
|
730
730
|
if (evt) {
|
|
731
731
|
this._uploadFile(file);
|
|
@@ -737,8 +737,8 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
737
737
|
const evt = this.dispatchEvent(
|
|
738
738
|
new CustomEvent('upload-abort', {
|
|
739
739
|
detail: { file, xhr: file.xhr },
|
|
740
|
-
cancelable: true
|
|
741
|
-
})
|
|
740
|
+
cancelable: true,
|
|
741
|
+
}),
|
|
742
742
|
);
|
|
743
743
|
if (evt) {
|
|
744
744
|
file.abort = true;
|
|
@@ -775,16 +775,16 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
775
775
|
if (this.maxFilesReached) {
|
|
776
776
|
this.dispatchEvent(
|
|
777
777
|
new CustomEvent('file-reject', {
|
|
778
|
-
detail: { file, error: this.i18n.error.tooManyFiles }
|
|
779
|
-
})
|
|
778
|
+
detail: { file, error: this.i18n.error.tooManyFiles },
|
|
779
|
+
}),
|
|
780
780
|
);
|
|
781
781
|
return;
|
|
782
782
|
}
|
|
783
783
|
if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
|
|
784
784
|
this.dispatchEvent(
|
|
785
785
|
new CustomEvent('file-reject', {
|
|
786
|
-
detail: { file, error: this.i18n.error.fileIsTooBig }
|
|
787
|
-
})
|
|
786
|
+
detail: { file, error: this.i18n.error.fileIsTooBig },
|
|
787
|
+
}),
|
|
788
788
|
);
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
@@ -793,8 +793,8 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
793
793
|
if (this.accept && !(re.test(file.type) || re.test(fileExt))) {
|
|
794
794
|
this.dispatchEvent(
|
|
795
795
|
new CustomEvent('file-reject', {
|
|
796
|
-
detail: { file, error: this.i18n.error.incorrectFileType }
|
|
797
|
-
})
|
|
796
|
+
detail: { file, error: this.i18n.error.incorrectFileType },
|
|
797
|
+
}),
|
|
798
798
|
);
|
|
799
799
|
return;
|
|
800
800
|
}
|
|
@@ -93,7 +93,7 @@ registerStyles(
|
|
|
93
93
|
transition-delay: 0s, 0s;
|
|
94
94
|
}
|
|
95
95
|
`,
|
|
96
|
-
{ moduleId: 'material-upload' }
|
|
96
|
+
{ moduleId: 'material-upload' },
|
|
97
97
|
);
|
|
98
98
|
|
|
99
99
|
registerStyles(
|
|
@@ -247,5 +247,5 @@ registerStyles(
|
|
|
247
247
|
display: none;
|
|
248
248
|
}
|
|
249
249
|
`,
|
|
250
|
-
{ moduleId: 'material-upload-file' }
|
|
250
|
+
{ moduleId: 'material-upload-file' },
|
|
251
251
|
);
|