@vaadin/upload 25.3.0-alpha8 → 25.3.0-alpha9

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": "25.3.0-alpha8",
3
+ "version": "25.3.0-alpha9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,19 +35,19 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.3.0-alpha8",
39
- "@vaadin/button": "25.3.0-alpha8",
40
- "@vaadin/component-base": "25.3.0-alpha8",
41
- "@vaadin/progress-bar": "25.3.0-alpha8",
42
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha8",
38
+ "@vaadin/a11y-base": "25.3.0-alpha9",
39
+ "@vaadin/button": "25.3.0-alpha9",
40
+ "@vaadin/component-base": "25.3.0-alpha9",
41
+ "@vaadin/progress-bar": "25.3.0-alpha9",
42
+ "@vaadin/vaadin-themable-mixin": "25.3.0-alpha9",
43
43
  "lit": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@vaadin/aura": "25.3.0-alpha8",
47
- "@vaadin/chai-plugins": "25.3.0-alpha8",
48
- "@vaadin/test-runner-commands": "25.3.0-alpha8",
46
+ "@vaadin/aura": "25.3.0-alpha9",
47
+ "@vaadin/chai-plugins": "25.3.0-alpha9",
48
+ "@vaadin/test-runner-commands": "25.3.0-alpha9",
49
49
  "@vaadin/testing-helpers": "^2.0.0",
50
- "@vaadin/vaadin-lumo-styles": "25.3.0-alpha8",
50
+ "@vaadin/vaadin-lumo-styles": "25.3.0-alpha9",
51
51
  "sinon": "^22.0.0"
52
52
  },
53
53
  "customElements": "custom-elements.json",
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "ccbb4aaffb63c745c6da0426b532d4d05e47af29"
58
+ "gitHead": "cb915ebde095ec5b94a87af93dd4530f51984c52"
59
59
  }
@@ -6,6 +6,7 @@
6
6
  import { html, LitElement } from 'lit';
7
7
  import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
8
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
+ import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
9
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
11
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
12
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
@@ -214,22 +215,14 @@ class UploadButton extends ButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(L
214
215
 
215
216
  // Set accept attribute from manager
216
217
  const accept = this.manager && this.manager.accept;
217
- if (accept) {
218
- fileInput.setAttribute('accept', accept);
219
- } else {
220
- fileInput.removeAttribute('accept');
221
- }
218
+ setOrRemoveAttribute(fileInput, 'accept', accept);
222
219
 
223
220
  // Set multiple attribute based on manager's maxFiles
224
221
  const maxFiles = this.manager && this.manager.maxFiles != null ? this.manager.maxFiles : Infinity;
225
222
  fileInput.multiple = maxFiles !== 1;
226
223
 
227
224
  // Set capture attribute
228
- if (this.capture) {
229
- fileInput.setAttribute('capture', this.capture);
230
- } else {
231
- fileInput.removeAttribute('capture');
232
- }
225
+ setOrRemoveAttribute(fileInput, 'capture', this.capture);
233
226
  }
234
227
 
235
228
  /** @private */
@@ -167,15 +167,6 @@ export const UploadFileMixin = (superClass) =>
167
167
  return event.composedPath()[0] === this;
168
168
  }
169
169
 
170
- /** @private */
171
- __disabledChanged(disabled) {
172
- if (disabled) {
173
- this.removeAttribute('tabindex');
174
- } else {
175
- this.setAttribute('tabindex', this.tabindex);
176
- }
177
- }
178
-
179
170
  /** @private */
180
171
  _errorMessageChanged(errorMessage) {
181
172
  this.toggleAttribute('error', Boolean(errorMessage));
@@ -6,6 +6,7 @@
6
6
  import { announce } from '@vaadin/a11y-base/src/announce.js';
7
7
  import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
8
8
  import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
9
+ import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
9
10
  import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
10
11
  import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
11
12
  import { getFilesFromDropEvent } from './vaadin-upload-helpers.js';
@@ -581,11 +582,7 @@ export const UploadMixin = (superClass) =>
581
582
  list.items = [...files];
582
583
  list.i18n = effectiveI18n;
583
584
  list.disabled = disabled;
584
- if (this._theme) {
585
- list.setAttribute('theme', this._theme);
586
- } else {
587
- list.removeAttribute('theme');
588
- }
585
+ setOrRemoveAttribute(list, 'theme', this._theme);
589
586
  }
590
587
  }
591
588
 
@@ -1053,20 +1050,12 @@ export const UploadMixin = (superClass) =>
1053
1050
 
1054
1051
  /** @private */
1055
1052
  _dragoverChanged(dragover) {
1056
- if (dragover) {
1057
- this.setAttribute('dragover', dragover);
1058
- } else {
1059
- this.removeAttribute('dragover');
1060
- }
1053
+ setOrRemoveAttribute(this, 'dragover', dragover);
1061
1054
  }
1062
1055
 
1063
1056
  /** @private */
1064
1057
  _dragoverValidChanged(dragoverValid) {
1065
- if (dragoverValid) {
1066
- this.setAttribute('dragover-valid', dragoverValid);
1067
- } else {
1068
- this.removeAttribute('dragover-valid');
1069
- }
1058
+ setOrRemoveAttribute(this, 'dragover-valid', dragoverValid);
1070
1059
  }
1071
1060
 
1072
1061
  /** @private */
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/upload",
4
- "version": "25.3.0-alpha8",
4
+ "version": "25.3.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/upload",
4
- "version": "25.3.0-alpha8",
4
+ "version": "25.3.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {