@vaadin/upload 25.3.0-alpha7 → 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.
@@ -166,6 +166,13 @@
166
166
  },
167
167
  "description": "True when max files has been reached on the manager.",
168
168
  "fieldName": "maxFilesReached"
169
+ },
170
+ {
171
+ "type": {
172
+ "text": "string"
173
+ },
174
+ "description": "The theme variants to apply to the component.",
175
+ "name": "theme"
169
176
  }
170
177
  ],
171
178
  "mixins": [
@@ -276,6 +283,13 @@
276
283
  "description": "True when max files has been reached on the manager.",
277
284
  "readonly": true,
278
285
  "fieldName": "maxFilesReached"
286
+ },
287
+ {
288
+ "type": {
289
+ "text": "string"
290
+ },
291
+ "description": "The theme variants to apply to the component.",
292
+ "name": "theme"
279
293
  }
280
294
  ],
281
295
  "mixins": [
@@ -501,26 +515,6 @@
501
515
  }
502
516
  }
503
517
  ],
504
- "mixins": [
505
- {
506
- "name": "UploadFileListMixin",
507
- "module": "src/vaadin-upload-file-list-mixin.js"
508
- },
509
- {
510
- "name": "ThemableMixin",
511
- "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
512
- },
513
- {
514
- "name": "PolylitMixin",
515
- "package": "@vaadin/component-base/src/polylit-mixin.js"
516
- }
517
- ],
518
- "superclass": {
519
- "name": "LitElement",
520
- "package": "lit"
521
- },
522
- "tagName": "vaadin-upload-file-list",
523
- "customElement": true,
524
518
  "attributes": [
525
519
  {
526
520
  "name": "disabled",
@@ -570,8 +564,35 @@
570
564
  "name": "UploadFileListMixin",
571
565
  "module": "src/vaadin-upload-file-list-mixin.js"
572
566
  }
567
+ },
568
+ {
569
+ "type": {
570
+ "text": "string"
571
+ },
572
+ "description": "The theme variants to apply to the component.",
573
+ "name": "theme"
574
+ }
575
+ ],
576
+ "mixins": [
577
+ {
578
+ "name": "UploadFileListMixin",
579
+ "module": "src/vaadin-upload-file-list-mixin.js"
580
+ },
581
+ {
582
+ "name": "ThemableMixin",
583
+ "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
584
+ },
585
+ {
586
+ "name": "PolylitMixin",
587
+ "package": "@vaadin/component-base/src/polylit-mixin.js"
573
588
  }
574
589
  ],
590
+ "superclass": {
591
+ "name": "LitElement",
592
+ "package": "lit"
593
+ },
594
+ "tagName": "vaadin-upload-file-list",
595
+ "customElement": true,
575
596
  "events": []
576
597
  }
577
598
  ],
@@ -992,30 +1013,6 @@
992
1013
  "name": "file-start"
993
1014
  }
994
1015
  ],
995
- "mixins": [
996
- {
997
- "name": "UploadFileMixin",
998
- "module": "src/vaadin-upload-file-mixin.js"
999
- },
1000
- {
1001
- "name": "ThemableMixin",
1002
- "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
1003
- },
1004
- {
1005
- "name": "PolylitMixin",
1006
- "package": "@vaadin/component-base/src/polylit-mixin.js"
1007
- },
1008
- {
1009
- "name": "LumoInjectionMixin",
1010
- "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
1011
- }
1012
- ],
1013
- "superclass": {
1014
- "name": "LitElement",
1015
- "package": "lit"
1016
- },
1017
- "tagName": "vaadin-upload-file",
1018
- "customElement": true,
1019
1016
  "attributes": [
1020
1017
  {
1021
1018
  "name": "complete",
@@ -1113,6 +1110,13 @@
1113
1110
  "module": "src/vaadin-upload-file-mixin.js"
1114
1111
  }
1115
1112
  },
1113
+ {
1114
+ "type": {
1115
+ "text": "string"
1116
+ },
1117
+ "description": "The theme variants to apply to the component.",
1118
+ "name": "theme"
1119
+ },
1116
1120
  {
1117
1121
  "name": "uploading",
1118
1122
  "type": {
@@ -1125,7 +1129,31 @@
1125
1129
  "module": "src/vaadin-upload-file-mixin.js"
1126
1130
  }
1127
1131
  }
1128
- ]
1132
+ ],
1133
+ "mixins": [
1134
+ {
1135
+ "name": "UploadFileMixin",
1136
+ "module": "src/vaadin-upload-file-mixin.js"
1137
+ },
1138
+ {
1139
+ "name": "ThemableMixin",
1140
+ "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
1141
+ },
1142
+ {
1143
+ "name": "PolylitMixin",
1144
+ "package": "@vaadin/component-base/src/polylit-mixin.js"
1145
+ },
1146
+ {
1147
+ "name": "LumoInjectionMixin",
1148
+ "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
1149
+ }
1150
+ ],
1151
+ "superclass": {
1152
+ "name": "LitElement",
1153
+ "package": "lit"
1154
+ },
1155
+ "tagName": "vaadin-upload-file",
1156
+ "customElement": true
1129
1157
  }
1130
1158
  ],
1131
1159
  "exports": [
@@ -2299,34 +2327,6 @@
2299
2327
  "name": "upload-success"
2300
2328
  }
2301
2329
  ],
2302
- "mixins": [
2303
- {
2304
- "name": "UploadMixin",
2305
- "module": "src/vaadin-upload-mixin.js"
2306
- },
2307
- {
2308
- "name": "ElementMixin",
2309
- "package": "@vaadin/component-base/src/element-mixin.js"
2310
- },
2311
- {
2312
- "name": "ThemableMixin",
2313
- "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
2314
- },
2315
- {
2316
- "name": "PolylitMixin",
2317
- "package": "@vaadin/component-base/src/polylit-mixin.js"
2318
- },
2319
- {
2320
- "name": "LumoInjectionMixin",
2321
- "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
2322
- }
2323
- ],
2324
- "superclass": {
2325
- "name": "LitElement",
2326
- "package": "lit"
2327
- },
2328
- "tagName": "vaadin-upload",
2329
- "customElement": true,
2330
2330
  "attributes": [
2331
2331
  {
2332
2332
  "name": "accept",
@@ -2485,6 +2485,13 @@
2485
2485
  "module": "src/vaadin-upload-mixin.js"
2486
2486
  }
2487
2487
  },
2488
+ {
2489
+ "type": {
2490
+ "text": "string"
2491
+ },
2492
+ "description": "The theme variants to apply to the component.",
2493
+ "name": "theme"
2494
+ },
2488
2495
  {
2489
2496
  "name": "timeout",
2490
2497
  "type": {
@@ -2521,7 +2528,35 @@
2521
2528
  "module": "src/vaadin-upload-mixin.js"
2522
2529
  }
2523
2530
  }
2524
- ]
2531
+ ],
2532
+ "mixins": [
2533
+ {
2534
+ "name": "UploadMixin",
2535
+ "module": "src/vaadin-upload-mixin.js"
2536
+ },
2537
+ {
2538
+ "name": "ElementMixin",
2539
+ "package": "@vaadin/component-base/src/element-mixin.js"
2540
+ },
2541
+ {
2542
+ "name": "ThemableMixin",
2543
+ "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
2544
+ },
2545
+ {
2546
+ "name": "PolylitMixin",
2547
+ "package": "@vaadin/component-base/src/polylit-mixin.js"
2548
+ },
2549
+ {
2550
+ "name": "LumoInjectionMixin",
2551
+ "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
2552
+ }
2553
+ ],
2554
+ "superclass": {
2555
+ "name": "LitElement",
2556
+ "package": "lit"
2557
+ },
2558
+ "tagName": "vaadin-upload",
2559
+ "customElement": true
2525
2560
  }
2526
2561
  ],
2527
2562
  "exports": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/upload",
3
- "version": "25.3.0-alpha7",
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-alpha7",
39
- "@vaadin/button": "25.3.0-alpha7",
40
- "@vaadin/component-base": "25.3.0-alpha7",
41
- "@vaadin/progress-bar": "25.3.0-alpha7",
42
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha7",
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-alpha7",
47
- "@vaadin/chai-plugins": "25.3.0-alpha7",
48
- "@vaadin/test-runner-commands": "25.3.0-alpha7",
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-alpha7",
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": "ae7b9823df5598faebd7a482993029ee489c35ae"
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';
@@ -70,6 +71,7 @@ import { UploadManager } from './vaadin-upload-manager.js';
70
71
  *
71
72
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
72
73
  *
74
+ * @attr {string} theme - The theme variants to apply to the component.
73
75
  * @customElement vaadin-upload-button
74
76
  * @extends HTMLElement
75
77
  */
@@ -213,22 +215,14 @@ class UploadButton extends ButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(L
213
215
 
214
216
  // Set accept attribute from manager
215
217
  const accept = this.manager && this.manager.accept;
216
- if (accept) {
217
- fileInput.setAttribute('accept', accept);
218
- } else {
219
- fileInput.removeAttribute('accept');
220
- }
218
+ setOrRemoveAttribute(fileInput, 'accept', accept);
221
219
 
222
220
  // Set multiple attribute based on manager's maxFiles
223
221
  const maxFiles = this.manager && this.manager.maxFiles != null ? this.manager.maxFiles : Infinity;
224
222
  fileInput.multiple = maxFiles !== 1;
225
223
 
226
224
  // Set capture attribute
227
- if (this.capture) {
228
- fileInput.setAttribute('capture', this.capture);
229
- } else {
230
- fileInput.removeAttribute('capture');
231
- }
225
+ setOrRemoveAttribute(fileInput, 'capture', this.capture);
232
226
  }
233
227
 
234
228
  /** @private */
@@ -47,6 +47,7 @@ import { UploadManager } from './vaadin-upload-manager.js';
47
47
  *
48
48
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
49
49
  *
50
+ * @attr {string} theme - The theme variants to apply to the component.
50
51
  * @customElement vaadin-upload-drop-zone
51
52
  * @extends HTMLElement
52
53
  */
@@ -75,6 +75,7 @@ import { UploadFileListMixin } from './vaadin-upload-file-list-mixin.js';
75
75
  *
76
76
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
77
77
  *
78
+ * @attr {string} theme - The theme variants to apply to the component.
78
79
  * @customElement vaadin-upload-file-list
79
80
  * @extends HTMLElement
80
81
  */
@@ -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));
@@ -81,6 +81,7 @@ import { UploadFileMixin } from './vaadin-upload-file-mixin.js';
81
81
  * @fires {CustomEvent} file-retry - Fired when the retry button is pressed to request retrying the upload of this file.
82
82
  * @fires {CustomEvent} file-start - Fired when the start button is pressed to request starting the upload of this file.
83
83
  *
84
+ * @attr {string} theme - The theme variants to apply to the component.
84
85
  * @customElement vaadin-upload-file
85
86
  * @extends HTMLElement
86
87
  */
@@ -12,6 +12,7 @@ import { uploadIconStyles } from './styles/vaadin-upload-icon-base-styles.js';
12
12
  /**
13
13
  * An element used internally by `<vaadin-upload>`. Not intended to be used separately.
14
14
  *
15
+ * @attr {string} theme - The theme variants to apply to the component.
15
16
  * @customElement vaadin-upload-icon
16
17
  * @extends HTMLElement
17
18
  * @private
@@ -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 */
@@ -102,6 +102,7 @@ import { UploadMixin } from './vaadin-upload-mixin.js';
102
102
  * @fires {CustomEvent} upload-retry - Fired when retry upload is requested. If the default is prevented, the retry is not performed.
103
103
  * @fires {CustomEvent} upload-abort - Fired when upload abort is requested. If the default is prevented, the upload is not aborted.
104
104
  *
105
+ * @attr {string} theme - The theme variants to apply to the component.
105
106
  * @customElement vaadin-upload
106
107
  * @extends HTMLElement
107
108
  */
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-alpha7",
4
+ "version": "25.3.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -42,9 +42,7 @@
42
42
  "description": "The theme variants to apply to the component.",
43
43
  "value": {
44
44
  "type": [
45
- "string",
46
- "null",
47
- "undefined"
45
+ "string"
48
46
  ]
49
47
  }
50
48
  }
@@ -110,9 +108,7 @@
110
108
  "description": "The theme variants to apply to the component.",
111
109
  "value": {
112
110
  "type": [
113
- "string",
114
- "null",
115
- "undefined"
111
+ "string"
116
112
  ]
117
113
  }
118
114
  }
@@ -160,9 +156,7 @@
160
156
  "description": "The theme variants to apply to the component.",
161
157
  "value": {
162
158
  "type": [
163
- "string",
164
- "null",
165
- "undefined"
159
+ "string"
166
160
  ]
167
161
  }
168
162
  }
@@ -282,9 +276,7 @@
282
276
  "description": "The theme variants to apply to the component.",
283
277
  "value": {
284
278
  "type": [
285
- "string",
286
- "null",
287
- "undefined"
279
+ "string"
288
280
  ]
289
281
  }
290
282
  },
@@ -524,9 +516,7 @@
524
516
  "description": "The theme variants to apply to the component.",
525
517
  "value": {
526
518
  "type": [
527
- "string",
528
- "null",
529
- "undefined"
519
+ "string"
530
520
  ]
531
521
  }
532
522
  },
@@ -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-alpha7",
4
+ "version": "25.3.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {