@vaadin/upload 23.1.8 → 23.1.9

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.8",
3
+ "version": "23.1.9",
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.8",
38
- "@vaadin/component-base": "~23.1.8",
39
- "@vaadin/progress-bar": "~23.1.8",
40
- "@vaadin/vaadin-lumo-styles": "~23.1.8",
41
- "@vaadin/vaadin-material-styles": "~23.1.8",
42
- "@vaadin/vaadin-themable-mixin": "~23.1.8"
37
+ "@vaadin/button": "~23.1.9",
38
+ "@vaadin/component-base": "~23.1.9",
39
+ "@vaadin/progress-bar": "~23.1.9",
40
+ "@vaadin/vaadin-lumo-styles": "~23.1.9",
41
+ "@vaadin/vaadin-material-styles": "~23.1.9",
42
+ "@vaadin/vaadin-themable-mixin": "~23.1.9"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@esm-bundle/chai": "^4.3.4",
46
- "@vaadin/form-layout": "~23.1.8",
46
+ "@vaadin/form-layout": "~23.1.9",
47
47
  "@vaadin/testing-helpers": "^0.3.2",
48
48
  "sinon": "^13.0.2"
49
49
  },
50
- "gitHead": "297e4e51743751bed97f5400e661529a7d550870"
50
+ "gitHead": "ad8461e09f049c3f04f50278d38d0f5a98604904"
51
51
  }
@@ -99,7 +99,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
99
99
  <slot name="drop-label-icon">
100
100
  <div part="drop-label-icon"></div>
101
101
  </slot>
102
- <slot name="drop-label" id="dropLabel"> [[_i18nPlural(maxFiles, i18n.dropFiles, i18n.dropFiles.*)]] </slot>
102
+ <slot name="drop-label" id="dropLabel"> [[_i18nPlural(maxFiles, i18n.dropFiles, i18n.dropFiles.*)]]</slot>
103
103
  </div>
104
104
  </div>
105
105
  <slot name="file-list">
@@ -783,7 +783,10 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
783
783
  return;
784
784
  }
785
785
  const fileExt = file.name.match(/\.[^.]*$|$/)[0];
786
- const re = new RegExp(`^(${this.accept.replace(/[, ]+/g, '|').replace(/\/\*/g, '/.*')})$`, 'i');
786
+ // Escape regex operators common to mime types
787
+ const escapedAccept = this.accept.replace(/[+.]/g, '\\$&');
788
+ // Create accept regex that can match comma separated patterns, star (*) wildcards
789
+ const re = new RegExp(`^(${escapedAccept.replace(/[, ]+/g, '|').replace(/\/\*/g, '/.*')})$`, 'i');
787
790
  if (this.accept && !(re.test(file.type) || re.test(fileExt))) {
788
791
  this.dispatchEvent(
789
792
  new CustomEvent('file-reject', {