@vaadin/upload 22.0.0-beta2 → 22.0.2

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": "22.0.0-beta2",
3
+ "version": "22.0.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,18 +33,18 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@polymer/polymer": "^3.0.0",
36
- "@vaadin/button": "22.0.0-beta2",
37
- "@vaadin/component-base": "22.0.0-beta2",
38
- "@vaadin/progress-bar": "22.0.0-beta2",
39
- "@vaadin/vaadin-lumo-styles": "22.0.0-beta2",
40
- "@vaadin/vaadin-material-styles": "22.0.0-beta2",
41
- "@vaadin/vaadin-themable-mixin": "22.0.0-beta2"
36
+ "@vaadin/button": "^22.0.2",
37
+ "@vaadin/component-base": "^22.0.2",
38
+ "@vaadin/progress-bar": "^22.0.2",
39
+ "@vaadin/vaadin-lumo-styles": "^22.0.2",
40
+ "@vaadin/vaadin-material-styles": "^22.0.2",
41
+ "@vaadin/vaadin-themable-mixin": "^22.0.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@esm-bundle/chai": "^4.3.4",
45
- "@vaadin/form-layout": "22.0.0-beta2",
46
- "@vaadin/testing-helpers": "^0.3.0",
45
+ "@vaadin/form-layout": "^22.0.2",
46
+ "@vaadin/testing-helpers": "^0.3.2",
47
47
  "sinon": "^9.2.0"
48
48
  },
49
- "gitHead": "f13833683e6667f6ca6678452db14aa6b7eac4a4"
49
+ "gitHead": "df21370c4a655a38eac11f79686021ab3b0887ad"
50
50
  }
@@ -68,10 +68,10 @@ class UploadFile extends ThemableMixin(PolymerElement) {
68
68
  }
69
69
  </style>
70
70
 
71
- <li part="row" tabindex="0">
71
+ <div part="row">
72
72
  <div part="info">
73
- <div part="done-icon" hidden$="[[!file.complete]]"></div>
74
- <div part="warning-icon" hidden$="[[!file.error]]"></div>
73
+ <div part="done-icon" hidden$="[[!file.complete]]" aria-hidden="true"></div>
74
+ <div part="warning-icon" hidden$="[[!file.error]]" aria-hidden="true"></div>
75
75
 
76
76
  <div part="meta">
77
77
  <div part="name" id="name">[[file.name]]</div>
@@ -107,7 +107,7 @@ class UploadFile extends ThemableMixin(PolymerElement) {
107
107
  aria-describedby="name"
108
108
  ></button>
109
109
  </div>
110
- </li>
110
+ </div>
111
111
 
112
112
  <vaadin-progress-bar
113
113
  part="progress"
@@ -9,6 +9,7 @@ import './vaadin-upload-icons.js';
9
9
  import './vaadin-upload-file.js';
10
10
  import { resetMouseCanceller } from '@polymer/polymer/lib/utils/gestures.js';
11
11
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
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';
14
15
 
@@ -82,6 +83,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
82
83
  [part='file-list'] {
83
84
  padding: 0;
84
85
  margin: 0;
86
+ list-style-type: none;
85
87
  }
86
88
  </style>
87
89
 
@@ -93,7 +95,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
93
95
  </vaadin-button>
94
96
  </slot>
95
97
  </div>
96
- <div part="drop-label" hidden$="[[nodrop]]" id="dropLabelContainer">
98
+ <div part="drop-label" hidden$="[[nodrop]]" id="dropLabelContainer" aria-hidden="true">
97
99
  <slot name="drop-label-icon">
98
100
  <div part="drop-label-icon"></div>
99
101
  </slot>
@@ -103,7 +105,9 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
103
105
  <slot name="file-list">
104
106
  <ul id="fileList" part="file-list">
105
107
  <template is="dom-repeat" items="[[files]]" as="file">
106
- <vaadin-upload-file file="[[file]]" i18n="[[i18n]]"></vaadin-upload-file>
108
+ <li>
109
+ <vaadin-upload-file tabindex="0" file="[[file]]" i18n="[[i18n]]"></vaadin-upload-file>
110
+ </li>
107
111
  </template>
108
112
  </ul>
109
113
  </slot>
@@ -139,13 +143,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
139
143
  nodrop: {
140
144
  type: Boolean,
141
145
  reflectToAttribute: true,
142
- value: function () {
143
- try {
144
- return !!document.createEvent('TouchEvent');
145
- } catch (e) {
146
- return false;
147
- }
148
- }
146
+ value: isTouch
149
147
  },
150
148
 
151
149
  /**
@@ -825,7 +823,7 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
825
823
  // cancelling the following synthetic click. See also:
826
824
  // https://github.com/Polymer/polymer/issues/5289
827
825
  this.__resetMouseCanceller();
828
- this._onAddFilesClick();
826
+ this._onAddFilesClick(e);
829
827
  }
830
828
 
831
829
  /** @private */
@@ -834,11 +832,12 @@ class Upload extends ElementMixin(ThemableMixin(PolymerElement)) {
834
832
  }
835
833
 
836
834
  /** @private */
837
- _onAddFilesClick() {
835
+ _onAddFilesClick(e) {
838
836
  if (this.maxFilesReached) {
839
837
  return;
840
838
  }
841
839
 
840
+ e.stopPropagation();
842
841
  this.$.fileInput.value = '';
843
842
  this.$.fileInput.click();
844
843
  }
@@ -62,6 +62,10 @@ registerStyles(
62
62
  line-height: 1;
63
63
  vertical-align: -0.25em;
64
64
  }
65
+
66
+ [part='file-list'] > *:not(:first-child) > * {
67
+ border-top: 1px solid var(--lumo-contrast-10pct);
68
+ }
65
69
  `,
66
70
  { moduleId: 'lumo-upload' }
67
71
  );
@@ -71,8 +75,13 @@ const uploadFile = css`
71
75
  padding: var(--lumo-space-s) 0;
72
76
  }
73
77
 
74
- :host(:not(:first-child)) {
75
- border-top: 1px solid var(--lumo-contrast-10pct);
78
+ :host(:focus) {
79
+ outline: none;
80
+ }
81
+
82
+ :host(:focus) [part='row'] {
83
+ border-radius: var(--lumo-border-radius-s);
84
+ box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);
76
85
  }
77
86
 
78
87
  [part='row'] {
@@ -129,7 +138,6 @@ const uploadFile = css`
129
138
  cursor: var(--lumo-clickable-cursor);
130
139
  }
131
140
 
132
- [part='row']:focus,
133
141
  [part$='button']:focus {
134
142
  outline: none;
135
143
  border-radius: var(--lumo-border-radius-s);
@@ -106,8 +106,11 @@ registerStyles(
106
106
  padding: 8px;
107
107
  }
108
108
 
109
- [part='row']:focus {
109
+ :host(:focus) {
110
110
  outline: none;
111
+ }
112
+
113
+ :host(:focus) [part='row'] {
111
114
  background-color: var(--material-divider-color);
112
115
  }
113
116