@vaadin/vaadin-upload 4.4.3 → 4.4.4
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/README.md +1 -1
- package/package.json +8 -7
- package/src/vaadin-upload.js +5 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# <vaadin-upload>
|
|
2
2
|
|
|
3
|
-
> ⚠️ Starting from Vaadin 20, the source code and issues for this component are migrated to the [`vaadin/web-components`](https://github.com/vaadin/web-components/tree/
|
|
3
|
+
> ⚠️ Starting from Vaadin 20, the source code and issues for this component are migrated to the [`vaadin/web-components`](https://github.com/vaadin/web-components/tree/main/packages/upload) monorepository.
|
|
4
4
|
> This repository contains the source code and releases of `<vaadin-upload>` for the Vaadin versions 10 to 19.
|
|
5
5
|
|
|
6
6
|
[<vaadin-upload>](https://vaadin.com/components/vaadin-upload) is a Web Component for uploading files, part of the [Vaadin components](https://vaadin.com/components).
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"repository": "vaadin/vaadin-upload",
|
|
11
11
|
"homepage": "https://vaadin.com/components",
|
|
12
12
|
"name": "@vaadin/vaadin-upload",
|
|
13
|
-
"version": "4.4.
|
|
13
|
+
"version": "4.4.4",
|
|
14
14
|
"main": "vaadin-upload.js",
|
|
15
15
|
"author": "Vaadin Ltd",
|
|
16
16
|
"license": "Apache-2.0",
|
|
@@ -25,8 +25,6 @@
|
|
|
25
25
|
"theme"
|
|
26
26
|
],
|
|
27
27
|
"resolutions": {
|
|
28
|
-
"es-abstract": "1.17.6",
|
|
29
|
-
"@types/doctrine": "0.0.3",
|
|
30
28
|
"inherits": "2.0.3",
|
|
31
29
|
"samsam": "1.1.3",
|
|
32
30
|
"supports-color": "3.1.2",
|
|
@@ -41,10 +39,9 @@
|
|
|
41
39
|
"@vaadin/vaadin-material-styles": "^1.1.0",
|
|
42
40
|
"@vaadin/vaadin-element-mixin": "^2.4.1"
|
|
43
41
|
},
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"devDependencies": {
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@web-padawan/gen-typescript-declarations": "^1.6.2",
|
|
44
|
+
"web-component-tester": "6.9.2",
|
|
48
45
|
"@polymer/iron-component-page": "^4.0.0",
|
|
49
46
|
"@polymer/iron-test-helpers": "^3.0.0",
|
|
50
47
|
"mock-http-request": "git://github.com/abuinitski/MockHttpRequest#npm_fix",
|
|
@@ -52,5 +49,9 @@
|
|
|
52
49
|
"wct-browser-legacy": "^1.0.1",
|
|
53
50
|
"@vaadin/vaadin-demo-helpers": "^3.1.0",
|
|
54
51
|
"@polymer/iron-icons": "^3.0.0"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"generate-typings": "gen-typescript-declarations --outDir . --verify",
|
|
55
|
+
"test": "wct --npm"
|
|
55
56
|
}
|
|
56
57
|
}
|
package/src/vaadin-upload.js
CHANGED
|
@@ -103,7 +103,7 @@ class UploadElement extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
static get version() {
|
|
106
|
-
return '4.4.
|
|
106
|
+
return '4.4.4';
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
static get properties() {
|
|
@@ -753,7 +753,10 @@ class UploadElement extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
753
753
|
return;
|
|
754
754
|
}
|
|
755
755
|
const fileExt = file.name.match(/\.[^\.]*$|$/)[0];
|
|
756
|
-
|
|
756
|
+
// Escape regex operators common to mime types
|
|
757
|
+
const escapedAccept = this.accept.replace(/[+.]/g, '\\$&');
|
|
758
|
+
// Create accept regex that can match comma separated patterns, star (*) wildcards
|
|
759
|
+
const re = new RegExp(`^(${escapedAccept.replace(/[, ]+/g, '|').replace(/\/\*/g, '/.*')})$`, 'i');
|
|
757
760
|
if (this.accept && !(re.test(file.type) || re.test(fileExt))) {
|
|
758
761
|
this.dispatchEvent(
|
|
759
762
|
new CustomEvent('file-reject', {
|