@vaadin/upload 25.1.0-beta1 → 25.1.0-beta2
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/custom-elements.json +11 -168
- package/package.json +11 -11
- package/src/styles/vaadin-upload-file-base-styles.js +72 -50
- package/src/vaadin-upload-button.js +0 -2
- package/src/vaadin-upload-drop-zone.js +0 -2
- package/src/vaadin-upload-file.js +6 -1
- package/src/vaadin-upload-mixin.js +1 -14
- package/web-types.json +99 -35
- package/web-types.lit.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -155,18 +155,6 @@
|
|
|
155
155
|
},
|
|
156
156
|
"description": "True when max files has been reached on the manager.",
|
|
157
157
|
"fieldName": "maxFilesReached"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"name": "tabindex",
|
|
161
|
-
"type": {
|
|
162
|
-
"text": "number"
|
|
163
|
-
},
|
|
164
|
-
"description": "Indicates whether the element can be focused and where it participates in sequential keyboard navigation.",
|
|
165
|
-
"fieldName": "tabindex",
|
|
166
|
-
"inheritedFrom": {
|
|
167
|
-
"name": "TabindexMixin",
|
|
168
|
-
"package": "@vaadin/a11y-base/src/tabindex-mixin.js"
|
|
169
|
-
}
|
|
170
158
|
}
|
|
171
159
|
],
|
|
172
160
|
"mixins": [
|
|
@@ -262,13 +250,6 @@
|
|
|
262
250
|
"description": "Whether the drop zone is disabled.\nReturns true if either explicitly disabled, manager is disabled, or no manager is set.",
|
|
263
251
|
"fieldName": "disabled"
|
|
264
252
|
},
|
|
265
|
-
{
|
|
266
|
-
"name": "dragover",
|
|
267
|
-
"type": {
|
|
268
|
-
"text": "boolean"
|
|
269
|
-
},
|
|
270
|
-
"fieldName": "__dragover"
|
|
271
|
-
},
|
|
272
253
|
{
|
|
273
254
|
"name": "manager",
|
|
274
255
|
"type": {
|
|
@@ -348,19 +329,9 @@
|
|
|
348
329
|
"kind": "field",
|
|
349
330
|
"name": "i18n",
|
|
350
331
|
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nShould be overridden by subclasses to provide a custom JSDoc with the\ndefault I18N properties.",
|
|
351
|
-
"
|
|
352
|
-
"
|
|
353
|
-
"text": "Object"
|
|
354
|
-
}
|
|
332
|
+
"type": {
|
|
333
|
+
"text": "Object"
|
|
355
334
|
},
|
|
356
|
-
"parameters": [
|
|
357
|
-
{
|
|
358
|
-
"name": "value",
|
|
359
|
-
"type": {
|
|
360
|
-
"text": "Object"
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
],
|
|
364
335
|
"inheritedFrom": {
|
|
365
336
|
"name": "I18nMixin",
|
|
366
337
|
"package": "@vaadin/component-base/src/i18n-mixin.js"
|
|
@@ -473,19 +444,9 @@
|
|
|
473
444
|
"kind": "field",
|
|
474
445
|
"name": "i18n",
|
|
475
446
|
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nShould be overridden by subclasses to provide a custom JSDoc with the\ndefault I18N properties.",
|
|
476
|
-
"
|
|
477
|
-
"
|
|
478
|
-
"text": "Object"
|
|
479
|
-
}
|
|
447
|
+
"type": {
|
|
448
|
+
"text": "Object"
|
|
480
449
|
},
|
|
481
|
-
"parameters": [
|
|
482
|
-
{
|
|
483
|
-
"name": "value",
|
|
484
|
-
"type": {
|
|
485
|
-
"text": "Object"
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
],
|
|
489
450
|
"inheritedFrom": {
|
|
490
451
|
"name": "I18nMixin",
|
|
491
452
|
"package": "@vaadin/component-base/src/i18n-mixin.js"
|
|
@@ -787,14 +748,6 @@
|
|
|
787
748
|
"description": "Uploading status.",
|
|
788
749
|
"fieldName": "status"
|
|
789
750
|
},
|
|
790
|
-
{
|
|
791
|
-
"name": "tabindex",
|
|
792
|
-
"type": {
|
|
793
|
-
"text": "number"
|
|
794
|
-
},
|
|
795
|
-
"description": "Indicates whether the element can be focused and where it participates in sequential keyboard navigation.",
|
|
796
|
-
"fieldName": "tabindex"
|
|
797
|
-
},
|
|
798
751
|
{
|
|
799
752
|
"name": "uploading",
|
|
800
753
|
"type": {
|
|
@@ -1113,18 +1066,6 @@
|
|
|
1113
1066
|
"module": "src/vaadin-upload-file-mixin.js"
|
|
1114
1067
|
}
|
|
1115
1068
|
},
|
|
1116
|
-
{
|
|
1117
|
-
"name": "tabindex",
|
|
1118
|
-
"type": {
|
|
1119
|
-
"text": "number"
|
|
1120
|
-
},
|
|
1121
|
-
"description": "Indicates whether the element can be focused and where it participates in sequential keyboard navigation.",
|
|
1122
|
-
"fieldName": "tabindex",
|
|
1123
|
-
"inheritedFrom": {
|
|
1124
|
-
"name": "UploadFileMixin",
|
|
1125
|
-
"module": "src/vaadin-upload-file-mixin.js"
|
|
1126
|
-
}
|
|
1127
|
-
},
|
|
1128
1069
|
{
|
|
1129
1070
|
"name": "uploading",
|
|
1130
1071
|
"type": {
|
|
@@ -1152,86 +1093,6 @@
|
|
|
1152
1093
|
}
|
|
1153
1094
|
]
|
|
1154
1095
|
},
|
|
1155
|
-
{
|
|
1156
|
-
"kind": "javascript-module",
|
|
1157
|
-
"path": "src/vaadin-upload-helpers.js",
|
|
1158
|
-
"declarations": [
|
|
1159
|
-
{
|
|
1160
|
-
"kind": "function",
|
|
1161
|
-
"name": "getFilesFromDropEvent",
|
|
1162
|
-
"parameters": [
|
|
1163
|
-
{
|
|
1164
|
-
"name": "dropEvent",
|
|
1165
|
-
"description": "The drop event",
|
|
1166
|
-
"type": {
|
|
1167
|
-
"text": "DragEvent"
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
],
|
|
1171
|
-
"description": "Get the files from the drop event. The dropped items may contain a\ncombination of files and directories. If a dropped item is a directory,\nit will be recursively traversed to get all files.",
|
|
1172
|
-
"return": {
|
|
1173
|
-
"type": {
|
|
1174
|
-
"text": "Promise<File[]>"
|
|
1175
|
-
}
|
|
1176
|
-
},
|
|
1177
|
-
"privacy": "private"
|
|
1178
|
-
}
|
|
1179
|
-
],
|
|
1180
|
-
"exports": [
|
|
1181
|
-
{
|
|
1182
|
-
"kind": "js",
|
|
1183
|
-
"name": "getFilesFromDropEvent",
|
|
1184
|
-
"declaration": {
|
|
1185
|
-
"name": "getFilesFromDropEvent",
|
|
1186
|
-
"module": "src/vaadin-upload-helpers.js"
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
]
|
|
1190
|
-
},
|
|
1191
|
-
{
|
|
1192
|
-
"kind": "javascript-module",
|
|
1193
|
-
"path": "src/vaadin-upload-icon.js",
|
|
1194
|
-
"declarations": [
|
|
1195
|
-
{
|
|
1196
|
-
"kind": "class",
|
|
1197
|
-
"description": "An element used internally by `<vaadin-upload>`. Not intended to be used separately.",
|
|
1198
|
-
"name": "UploadIcon",
|
|
1199
|
-
"members": [],
|
|
1200
|
-
"mixins": [
|
|
1201
|
-
{
|
|
1202
|
-
"name": "ThemableMixin",
|
|
1203
|
-
"package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
|
|
1204
|
-
},
|
|
1205
|
-
{
|
|
1206
|
-
"name": "LumoInjectionMixin",
|
|
1207
|
-
"package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
|
|
1208
|
-
}
|
|
1209
|
-
],
|
|
1210
|
-
"superclass": {
|
|
1211
|
-
"name": "LitElement",
|
|
1212
|
-
"package": "lit"
|
|
1213
|
-
},
|
|
1214
|
-
"tagName": "vaadin-upload-icon",
|
|
1215
|
-
"customElement": true
|
|
1216
|
-
}
|
|
1217
|
-
],
|
|
1218
|
-
"exports": [
|
|
1219
|
-
{
|
|
1220
|
-
"kind": "js",
|
|
1221
|
-
"name": "UploadIcon",
|
|
1222
|
-
"declaration": {
|
|
1223
|
-
"name": "UploadIcon",
|
|
1224
|
-
"module": "src/vaadin-upload-icon.js"
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
]
|
|
1228
|
-
},
|
|
1229
|
-
{
|
|
1230
|
-
"kind": "javascript-module",
|
|
1231
|
-
"path": "src/vaadin-upload-icons.js",
|
|
1232
|
-
"declarations": [],
|
|
1233
|
-
"exports": []
|
|
1234
|
-
},
|
|
1235
1096
|
{
|
|
1236
1097
|
"kind": "javascript-module",
|
|
1237
1098
|
"path": "src/vaadin-upload-manager.js",
|
|
@@ -1613,19 +1474,9 @@
|
|
|
1613
1474
|
"kind": "field",
|
|
1614
1475
|
"name": "i18n",
|
|
1615
1476
|
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```js\n{\n dropFiles: {\n one: 'Drop file here',\n many: 'Drop files here'\n },\n addFiles: {\n one: 'Upload File...',\n many: 'Upload Files...'\n },\n error: {\n tooManyFiles: 'Too Many Files.',\n fileIsTooBig: 'File is Too Big.',\n incorrectFileType: 'Incorrect File Type.'\n },\n uploading: {\n status: {\n connecting: 'Connecting...',\n stalled: 'Stalled',\n processing: 'Processing File...',\n held: 'Queued'\n },\n remainingTime: {\n prefix: 'remaining time: ',\n unknown: 'unknown remaining time'\n },\n error: {\n serverUnavailable: 'Upload failed, please try again later',\n unexpectedServerError: 'Upload failed due to server error',\n forbidden: 'Upload forbidden'\n }\n },\n file: {\n retry: 'Retry',\n start: 'Start',\n remove: 'Remove'\n },\n units: {\n size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n sizeBase: 1000\n },\n formatSize: function(bytes) {\n // returns the size followed by the best suitable unit\n },\n formatTime: function(seconds, [secs, mins, hours]) {\n // returns a 'HH:MM:SS' string\n }\n}\n```",
|
|
1616
|
-
"
|
|
1617
|
-
"
|
|
1618
|
-
"text": "!UploadI18n"
|
|
1619
|
-
}
|
|
1477
|
+
"type": {
|
|
1478
|
+
"text": "Object"
|
|
1620
1479
|
},
|
|
1621
|
-
"parameters": [
|
|
1622
|
-
{
|
|
1623
|
-
"name": "value",
|
|
1624
|
-
"type": {
|
|
1625
|
-
"text": "Object"
|
|
1626
|
-
}
|
|
1627
|
-
}
|
|
1628
|
-
],
|
|
1629
1480
|
"inheritedFrom": {
|
|
1630
1481
|
"name": "I18nMixin",
|
|
1631
1482
|
"package": "@vaadin/component-base/src/i18n-mixin.js"
|
|
@@ -1669,7 +1520,8 @@
|
|
|
1669
1520
|
"text": "boolean"
|
|
1670
1521
|
},
|
|
1671
1522
|
"description": "Specifies if the maximum number of files have been uploaded",
|
|
1672
|
-
"attribute": "max-files-reached"
|
|
1523
|
+
"attribute": "max-files-reached",
|
|
1524
|
+
"readonly": true
|
|
1673
1525
|
},
|
|
1674
1526
|
{
|
|
1675
1527
|
"kind": "field",
|
|
@@ -2076,19 +1928,9 @@
|
|
|
2076
1928
|
"kind": "field",
|
|
2077
1929
|
"name": "i18n",
|
|
2078
1930
|
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```js\n{\n dropFiles: {\n one: 'Drop file here',\n many: 'Drop files here'\n },\n addFiles: {\n one: 'Upload File...',\n many: 'Upload Files...'\n },\n error: {\n tooManyFiles: 'Too Many Files.',\n fileIsTooBig: 'File is Too Big.',\n incorrectFileType: 'Incorrect File Type.'\n },\n uploading: {\n status: {\n connecting: 'Connecting...',\n stalled: 'Stalled',\n processing: 'Processing File...',\n held: 'Queued'\n },\n remainingTime: {\n prefix: 'remaining time: ',\n unknown: 'unknown remaining time'\n },\n error: {\n serverUnavailable: 'Upload failed, please try again later',\n unexpectedServerError: 'Upload failed due to server error',\n forbidden: 'Upload forbidden'\n }\n },\n file: {\n retry: 'Retry',\n start: 'Start',\n remove: 'Remove'\n },\n units: {\n size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n sizeBase: 1000\n },\n formatSize: function(bytes) {\n // returns the size followed by the best suitable unit\n },\n formatTime: function(seconds, [secs, mins, hours]) {\n // returns a 'HH:MM:SS' string\n }\n}\n```",
|
|
2079
|
-
"
|
|
2080
|
-
"
|
|
2081
|
-
"text": "!UploadI18n"
|
|
2082
|
-
}
|
|
1931
|
+
"type": {
|
|
1932
|
+
"text": "Object"
|
|
2083
1933
|
},
|
|
2084
|
-
"parameters": [
|
|
2085
|
-
{
|
|
2086
|
-
"name": "value",
|
|
2087
|
-
"type": {
|
|
2088
|
-
"text": "Object"
|
|
2089
|
-
}
|
|
2090
|
-
}
|
|
2091
|
-
],
|
|
2092
1934
|
"inheritedFrom": {
|
|
2093
1935
|
"name": "I18nMixin",
|
|
2094
1936
|
"package": "@vaadin/component-base/src/i18n-mixin.js"
|
|
@@ -2145,6 +1987,7 @@
|
|
|
2145
1987
|
},
|
|
2146
1988
|
"description": "Specifies if the maximum number of files have been uploaded",
|
|
2147
1989
|
"attribute": "max-files-reached",
|
|
1990
|
+
"readonly": true,
|
|
2148
1991
|
"inheritedFrom": {
|
|
2149
1992
|
"name": "UploadMixin",
|
|
2150
1993
|
"module": "src/vaadin-upload-mixin.js"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/upload",
|
|
3
|
-
"version": "25.1.0-
|
|
3
|
+
"version": "25.1.0-beta2",
|
|
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.1.0-
|
|
39
|
-
"@vaadin/button": "25.1.0-
|
|
40
|
-
"@vaadin/component-base": "25.1.0-
|
|
41
|
-
"@vaadin/progress-bar": "25.1.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.1.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.1.0-beta2",
|
|
39
|
+
"@vaadin/button": "25.1.0-beta2",
|
|
40
|
+
"@vaadin/component-base": "25.1.0-beta2",
|
|
41
|
+
"@vaadin/progress-bar": "25.1.0-beta2",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "25.1.0-beta2",
|
|
43
43
|
"lit": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@vaadin/aura": "25.1.0-
|
|
47
|
-
"@vaadin/chai-plugins": "25.1.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "25.1.0-
|
|
46
|
+
"@vaadin/aura": "25.1.0-beta2",
|
|
47
|
+
"@vaadin/chai-plugins": "25.1.0-beta2",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.1.0-beta2",
|
|
49
49
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "25.1.0-
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "25.1.0-beta2",
|
|
51
51
|
"sinon": "^21.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": "
|
|
58
|
+
"gitHead": "ffbedbae08a5160d13bcd1c6fcaa328df5103a05"
|
|
59
59
|
}
|
|
@@ -28,23 +28,20 @@ export const uploadFileStyles = [
|
|
|
28
28
|
display: none;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/* Hide thumbnail by default, only show with thumbnails theme */
|
|
32
31
|
[part='thumbnail'],
|
|
33
32
|
[part='loader'] {
|
|
34
33
|
display: none;
|
|
35
34
|
grid-column: 1;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
[part='
|
|
39
|
-
object-fit: cover;
|
|
40
|
-
}
|
|
41
|
-
|
|
37
|
+
:host([uploading]) [part='loader'],
|
|
42
38
|
[part='done-icon']:not([hidden]),
|
|
43
39
|
[part='warning-icon']:not([hidden]) {
|
|
44
40
|
display: flex;
|
|
45
41
|
grid-column: 1;
|
|
46
42
|
}
|
|
47
43
|
|
|
44
|
+
[part='loader']::before,
|
|
48
45
|
[part='done-icon']::before,
|
|
49
46
|
[part='warning-icon']::before {
|
|
50
47
|
content: '\\2003' / '';
|
|
@@ -55,6 +52,10 @@ export const uploadFileStyles = [
|
|
|
55
52
|
width: var(--vaadin-icon-size, 1lh);
|
|
56
53
|
}
|
|
57
54
|
|
|
55
|
+
[part='loader']::before {
|
|
56
|
+
margin: calc(var(--vaadin-spinner-width, 2px) * -1);
|
|
57
|
+
}
|
|
58
|
+
|
|
58
59
|
:is([part$='icon'], [part$='button'])::before {
|
|
59
60
|
mask-size: var(--vaadin-icon-visual-size, 100%);
|
|
60
61
|
mask-position: 50%;
|
|
@@ -163,48 +164,65 @@ export const uploadFileStyles = [
|
|
|
163
164
|
/* THUMBNAILS VARIANT */
|
|
164
165
|
|
|
165
166
|
:host([theme~='thumbnails']) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
grid-template-columns: var(--_prefix-area-size) minmax(0, 1fr) auto;
|
|
169
|
-
grid-auto-columns: auto;
|
|
170
|
-
grid-template-rows: auto;
|
|
171
|
-
position: relative;
|
|
167
|
+
grid-template-columns: max-content 1fr max-content;
|
|
172
168
|
align-items: center;
|
|
173
169
|
background: var(--vaadin-background-container);
|
|
174
|
-
|
|
170
|
+
padding: 0;
|
|
171
|
+
contain: content;
|
|
172
|
+
|
|
173
|
+
& [part] {
|
|
174
|
+
grid-row: 1;
|
|
175
|
+
}
|
|
175
176
|
|
|
176
177
|
& [part='thumbnail'],
|
|
177
|
-
& [part
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
& [part$='icon'] {
|
|
179
|
+
grid-column: 1;
|
|
180
|
+
align-self: stretch;
|
|
181
|
+
display: flex;
|
|
181
182
|
align-items: center;
|
|
182
183
|
justify-content: center;
|
|
183
|
-
|
|
184
|
+
transition: 0.2s opacity linear;
|
|
185
|
+
background: var(--vaadin-background-container-strong);
|
|
186
|
+
padding: var(--vaadin-upload-file-padding, var(--vaadin-padding-s));
|
|
187
|
+
contain: content;
|
|
188
|
+
|
|
189
|
+
&[hidden] {
|
|
190
|
+
opacity: 0;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
& [part='thumbnail'] > img {
|
|
195
|
+
object-fit: cover;
|
|
196
|
+
position: absolute;
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: 100%;
|
|
184
199
|
}
|
|
185
200
|
|
|
186
201
|
& [part='loader']:not([hidden]) {
|
|
202
|
+
place-self: center;
|
|
187
203
|
display: flex;
|
|
188
|
-
align-self: stretch;
|
|
189
|
-
aspect-ratio: 1 / 1;
|
|
190
204
|
}
|
|
191
205
|
|
|
192
|
-
& [part='done-icon'] {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
&::before {
|
|
196
|
-
content: '';
|
|
197
|
-
width: var(--vaadin-icon-size, 1lh);
|
|
198
|
-
height: var(--vaadin-icon-size, 1lh);
|
|
199
|
-
/* TODO: Replace with vaadin file icon, once it exists. */
|
|
200
|
-
mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>');
|
|
201
|
-
mask-size: contain;
|
|
202
|
-
background: currentColor;
|
|
203
|
-
}
|
|
206
|
+
& [part='done-icon']::before {
|
|
207
|
+
background: var(--vaadin-upload-file-done-color, currentColor);
|
|
208
|
+
mask-image: var(--_vaadin-icon-file);
|
|
204
209
|
}
|
|
205
210
|
|
|
206
|
-
& [part='
|
|
207
|
-
|
|
211
|
+
& [part='meta'] {
|
|
212
|
+
padding: var(--vaadin-upload-file-padding, var(--vaadin-padding-s));
|
|
213
|
+
padding-inline: 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
& [part='name'] {
|
|
217
|
+
word-break: break-all;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
& [part='commands'] {
|
|
221
|
+
padding: var(--vaadin-upload-padding, var(--vaadin-padding-s));
|
|
222
|
+
padding-inline-start: 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
& [part='status'] {
|
|
208
226
|
clip-path: inset(50%);
|
|
209
227
|
width: 1px;
|
|
210
228
|
height: 1px;
|
|
@@ -214,30 +232,34 @@ export const uploadFileStyles = [
|
|
|
214
232
|
white-space: nowrap;
|
|
215
233
|
}
|
|
216
234
|
|
|
235
|
+
& [part='error'] {
|
|
236
|
+
font-size: 0.875em;
|
|
237
|
+
line-height: 1.25;
|
|
238
|
+
}
|
|
239
|
+
|
|
217
240
|
& ::slotted([slot='progress']) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
overflow: hidden;
|
|
241
|
+
grid-row: auto;
|
|
242
|
+
grid-column: auto;
|
|
221
243
|
position: absolute;
|
|
244
|
+
inset: 0;
|
|
245
|
+
opacity: 0.3;
|
|
246
|
+
pointer-events: none;
|
|
247
|
+
--vaadin-progress-bar-height: auto;
|
|
248
|
+
--vaadin-progress-bar-border-width: 0px;
|
|
249
|
+
--vaadin-progress-bar-border-radius: 0px;
|
|
250
|
+
--vaadin-progress-bar-background: transparent;
|
|
222
251
|
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
:host([theme~='thumbnails'][complete]) {
|
|
226
|
-
& [part='thumbnail'] {
|
|
227
|
-
&:not([hidden]) {
|
|
228
|
-
display: block;
|
|
229
|
-
|
|
230
|
-
& + [part='done-icon'] {
|
|
231
|
-
display: none;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
252
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
253
|
+
& ::slotted([slot='progress'][indeterminate]) {
|
|
254
|
+
opacity: 0;
|
|
238
255
|
}
|
|
239
256
|
}
|
|
240
257
|
|
|
258
|
+
:host([theme~='thumbnails']:not([complete])) [part='thumbnail'],
|
|
259
|
+
:host([theme~='thumbnails'][complete]) [part='thumbnail']:not([hidden]) + [part='done-icon'] {
|
|
260
|
+
display: none;
|
|
261
|
+
}
|
|
262
|
+
|
|
241
263
|
/* TODO: queued state styles (no attribute makes this difficult to target) */
|
|
242
264
|
|
|
243
265
|
@media (forced-colors: active) {
|
|
@@ -101,7 +101,6 @@ class UploadButton extends ButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(L
|
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* Capture attribute for mobile file input.
|
|
104
|
-
* @type {string}
|
|
105
104
|
*/
|
|
106
105
|
capture: {
|
|
107
106
|
type: String,
|
|
@@ -109,7 +108,6 @@ class UploadButton extends ButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(L
|
|
|
109
108
|
|
|
110
109
|
/**
|
|
111
110
|
* True when max files has been reached on the manager.
|
|
112
|
-
* @type {boolean}
|
|
113
111
|
*/
|
|
114
112
|
maxFilesReached: {
|
|
115
113
|
type: Boolean,
|
|
@@ -81,7 +81,6 @@ class UploadDropZone extends ElementMixin(ThemableMixin(PolylitMixin(LumoInjecti
|
|
|
81
81
|
/**
|
|
82
82
|
* Whether the drop zone is disabled.
|
|
83
83
|
* Returns true if either explicitly disabled, manager is disabled, or no manager is set.
|
|
84
|
-
* @type {boolean}
|
|
85
84
|
*/
|
|
86
85
|
disabled: {
|
|
87
86
|
type: Boolean,
|
|
@@ -90,7 +89,6 @@ class UploadDropZone extends ElementMixin(ThemableMixin(PolylitMixin(LumoInjecti
|
|
|
90
89
|
|
|
91
90
|
/**
|
|
92
91
|
* True when max files has been reached on the manager.
|
|
93
|
-
* @type {boolean}
|
|
94
92
|
* @readonly
|
|
95
93
|
*/
|
|
96
94
|
maxFilesReached: {
|
|
@@ -102,7 +102,12 @@ class UploadFile extends UploadFileMixin(ThemableMixin(PolylitMixin(LumoInjectio
|
|
|
102
102
|
|
|
103
103
|
return html`
|
|
104
104
|
<div part="loader" ?hidden="${!this.uploading}" aria-hidden="true"></div>
|
|
105
|
-
|
|
105
|
+
|
|
106
|
+
${this.__thumbnail
|
|
107
|
+
? html`<div part="thumbnail">
|
|
108
|
+
<img src="${this.__thumbnail}" alt="${this.fileName}" />
|
|
109
|
+
</div>`
|
|
110
|
+
: nothing}
|
|
106
111
|
|
|
107
112
|
<div part="done-icon" ?hidden="${!this.complete}" aria-hidden="true"></div>
|
|
108
113
|
<div part="warning-icon" ?hidden="${!this.errorMessage}" aria-hidden="true"></div>
|
|
@@ -114,7 +114,6 @@ export const UploadMixin = (superClass) =>
|
|
|
114
114
|
return {
|
|
115
115
|
/**
|
|
116
116
|
* If true, the user cannot interact with this element.
|
|
117
|
-
* @type {boolean}
|
|
118
117
|
*/
|
|
119
118
|
disabled: {
|
|
120
119
|
type: Boolean,
|
|
@@ -129,7 +128,6 @@ export const UploadMixin = (superClass) =>
|
|
|
129
128
|
* it false means that drop is enabled even in touch-devices, and true
|
|
130
129
|
* disables drop in all devices.
|
|
131
130
|
*
|
|
132
|
-
* @type {boolean}
|
|
133
131
|
* @default true in touch-devices, false otherwise.
|
|
134
132
|
*/
|
|
135
133
|
nodrop: {
|
|
@@ -141,7 +139,6 @@ export const UploadMixin = (superClass) =>
|
|
|
141
139
|
/**
|
|
142
140
|
* The server URL. The default value is an empty string, which means that
|
|
143
141
|
* _window.location_ will be used.
|
|
144
|
-
* @type {string}
|
|
145
142
|
*/
|
|
146
143
|
target: {
|
|
147
144
|
type: String,
|
|
@@ -173,7 +170,6 @@ export const UploadMixin = (superClass) =>
|
|
|
173
170
|
/**
|
|
174
171
|
* Max time in milliseconds for the entire upload process, if exceeded the
|
|
175
172
|
* request will be aborted. Zero means that there is no timeout.
|
|
176
|
-
* @type {number}
|
|
177
173
|
*/
|
|
178
174
|
timeout: {
|
|
179
175
|
type: Number,
|
|
@@ -221,7 +217,6 @@ export const UploadMixin = (superClass) =>
|
|
|
221
217
|
* Limit of files to upload, by default it is unlimited. If the value is
|
|
222
218
|
* set to one, native file browser will prevent selecting multiple files.
|
|
223
219
|
* @attr {number} max-files
|
|
224
|
-
* @type {number}
|
|
225
220
|
*/
|
|
226
221
|
maxFiles: {
|
|
227
222
|
type: Number,
|
|
@@ -232,7 +227,6 @@ export const UploadMixin = (superClass) =>
|
|
|
232
227
|
/**
|
|
233
228
|
* Specifies if the maximum number of files have been uploaded
|
|
234
229
|
* @attr {boolean} max-files-reached
|
|
235
|
-
* @type {boolean}
|
|
236
230
|
*/
|
|
237
231
|
maxFilesReached: {
|
|
238
232
|
type: Boolean,
|
|
@@ -249,7 +243,6 @@ export const UploadMixin = (superClass) =>
|
|
|
249
243
|
* Notice that MIME types are widely supported, while file extensions
|
|
250
244
|
* are only implemented in certain browsers, so avoid using it.
|
|
251
245
|
* Example: accept="video/*,image/tiff" or accept=".pdf,audio/mp3"
|
|
252
|
-
* @type {string}
|
|
253
246
|
*/
|
|
254
247
|
accept: {
|
|
255
248
|
type: String,
|
|
@@ -262,7 +255,6 @@ export const UploadMixin = (superClass) =>
|
|
|
262
255
|
* sending the request. Obviously you need to do the same validation in
|
|
263
256
|
* the server-side and be sure that they are aligned.
|
|
264
257
|
* @attr {number} max-file-size
|
|
265
|
-
* @type {number}
|
|
266
258
|
*/
|
|
267
259
|
maxFileSize: {
|
|
268
260
|
type: Number,
|
|
@@ -284,7 +276,6 @@ export const UploadMixin = (superClass) =>
|
|
|
284
276
|
* Specifies the 'name' property at Content-Disposition for multipart uploads.
|
|
285
277
|
* This property is ignored when uploadFormat is 'raw'.
|
|
286
278
|
* @attr {string} form-data-name
|
|
287
|
-
* @type {string}
|
|
288
279
|
*/
|
|
289
280
|
formDataName: {
|
|
290
281
|
type: String,
|
|
@@ -295,7 +286,6 @@ export const UploadMixin = (superClass) =>
|
|
|
295
286
|
* Prevents upload(s) from immediately uploading upon adding file(s).
|
|
296
287
|
* When set, you must manually trigger uploads using the `uploadFiles` method
|
|
297
288
|
* @attr {boolean} no-auto
|
|
298
|
-
* @type {boolean}
|
|
299
289
|
*/
|
|
300
290
|
noAuto: {
|
|
301
291
|
type: Boolean,
|
|
@@ -305,7 +295,6 @@ export const UploadMixin = (superClass) =>
|
|
|
305
295
|
/**
|
|
306
296
|
* Set the withCredentials flag on the request.
|
|
307
297
|
* @attr {boolean} with-credentials
|
|
308
|
-
* @type {boolean}
|
|
309
298
|
*/
|
|
310
299
|
withCredentials: {
|
|
311
300
|
type: Boolean,
|
|
@@ -317,7 +306,6 @@ export const UploadMixin = (superClass) =>
|
|
|
317
306
|
* - 'raw': Send file as raw binary data with the file's MIME type as Content-Type (default)
|
|
318
307
|
* - 'multipart': Send file using multipart/form-data encoding
|
|
319
308
|
* @attr {string} upload-format
|
|
320
|
-
* @type {string}
|
|
321
309
|
*/
|
|
322
310
|
uploadFormat: {
|
|
323
311
|
type: String,
|
|
@@ -330,7 +318,6 @@ export const UploadMixin = (superClass) =>
|
|
|
330
318
|
* uploading large numbers of files. Files exceeding this limit will be queued
|
|
331
319
|
* and uploaded as active uploads complete.
|
|
332
320
|
* @attr {number} max-concurrent-uploads
|
|
333
|
-
* @type {number}
|
|
334
321
|
*/
|
|
335
322
|
maxConcurrentUploads: {
|
|
336
323
|
type: Number,
|
|
@@ -443,7 +430,7 @@ export const UploadMixin = (superClass) =>
|
|
|
443
430
|
* }
|
|
444
431
|
* }
|
|
445
432
|
* ```
|
|
446
|
-
* @
|
|
433
|
+
* @type {!UploadI18n}
|
|
447
434
|
*/
|
|
448
435
|
get i18n() {
|
|
449
436
|
return super.i18n;
|
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.1.0-
|
|
4
|
+
"version": "25.1.0-beta2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"description": "Capture attribute for mobile file input.",
|
|
16
16
|
"value": {
|
|
17
17
|
"type": [
|
|
18
|
-
"string"
|
|
18
|
+
"string",
|
|
19
|
+
"null",
|
|
20
|
+
"undefined"
|
|
19
21
|
]
|
|
20
22
|
}
|
|
21
23
|
},
|
|
@@ -35,7 +37,9 @@
|
|
|
35
37
|
"description": "True when max files has been reached on the manager.",
|
|
36
38
|
"value": {
|
|
37
39
|
"type": [
|
|
38
|
-
"boolean"
|
|
40
|
+
"boolean",
|
|
41
|
+
"null",
|
|
42
|
+
"undefined"
|
|
39
43
|
]
|
|
40
44
|
}
|
|
41
45
|
},
|
|
@@ -58,7 +62,9 @@
|
|
|
58
62
|
"description": "Capture attribute for mobile file input.",
|
|
59
63
|
"value": {
|
|
60
64
|
"type": [
|
|
61
|
-
"string"
|
|
65
|
+
"string",
|
|
66
|
+
"null",
|
|
67
|
+
"undefined"
|
|
62
68
|
]
|
|
63
69
|
}
|
|
64
70
|
},
|
|
@@ -86,7 +92,9 @@
|
|
|
86
92
|
"description": "True when max files has been reached on the manager.",
|
|
87
93
|
"value": {
|
|
88
94
|
"type": [
|
|
89
|
-
"boolean"
|
|
95
|
+
"boolean",
|
|
96
|
+
"null",
|
|
97
|
+
"undefined"
|
|
90
98
|
]
|
|
91
99
|
}
|
|
92
100
|
}
|
|
@@ -103,7 +111,9 @@
|
|
|
103
111
|
"description": "Whether the drop zone is disabled.\nReturns true if either explicitly disabled, manager is disabled, or no manager is set.",
|
|
104
112
|
"value": {
|
|
105
113
|
"type": [
|
|
106
|
-
"boolean"
|
|
114
|
+
"boolean",
|
|
115
|
+
"null",
|
|
116
|
+
"undefined"
|
|
107
117
|
]
|
|
108
118
|
}
|
|
109
119
|
},
|
|
@@ -112,7 +122,9 @@
|
|
|
112
122
|
"description": "True when max files has been reached on the manager.",
|
|
113
123
|
"value": {
|
|
114
124
|
"type": [
|
|
115
|
-
"boolean"
|
|
125
|
+
"boolean",
|
|
126
|
+
"null",
|
|
127
|
+
"undefined"
|
|
116
128
|
]
|
|
117
129
|
}
|
|
118
130
|
},
|
|
@@ -135,7 +147,9 @@
|
|
|
135
147
|
"description": "Whether the drop zone is disabled.\nReturns true if either explicitly disabled, manager is disabled, or no manager is set.",
|
|
136
148
|
"value": {
|
|
137
149
|
"type": [
|
|
138
|
-
"boolean"
|
|
150
|
+
"boolean",
|
|
151
|
+
"null",
|
|
152
|
+
"undefined"
|
|
139
153
|
]
|
|
140
154
|
}
|
|
141
155
|
},
|
|
@@ -154,7 +168,9 @@
|
|
|
154
168
|
"description": "True when max files has been reached on the manager.",
|
|
155
169
|
"value": {
|
|
156
170
|
"type": [
|
|
157
|
-
"boolean"
|
|
171
|
+
"boolean",
|
|
172
|
+
"null",
|
|
173
|
+
"undefined"
|
|
158
174
|
]
|
|
159
175
|
}
|
|
160
176
|
}
|
|
@@ -462,7 +478,7 @@
|
|
|
462
478
|
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nShould be overridden by subclasses to provide a custom JSDoc with the\ndefault I18N properties.",
|
|
463
479
|
"value": {
|
|
464
480
|
"type": [
|
|
465
|
-
"
|
|
481
|
+
"?"
|
|
466
482
|
]
|
|
467
483
|
}
|
|
468
484
|
},
|
|
@@ -500,7 +516,9 @@
|
|
|
500
516
|
"description": "Specifies the types of files that the server accepts.\nSyntax: a comma-separated list of MIME type patterns (wildcards are\nallowed) or file extensions.\nNotice that MIME types are widely supported, while file extensions\nare only implemented in certain browsers, so avoid using it.\nExample: accept=\"video/*,image/tiff\" or accept=\".pdf,audio/mp3\"",
|
|
501
517
|
"value": {
|
|
502
518
|
"type": [
|
|
503
|
-
"string"
|
|
519
|
+
"string",
|
|
520
|
+
"null",
|
|
521
|
+
"undefined"
|
|
504
522
|
]
|
|
505
523
|
}
|
|
506
524
|
},
|
|
@@ -520,7 +538,9 @@
|
|
|
520
538
|
"description": "If true, the user cannot interact with this element.",
|
|
521
539
|
"value": {
|
|
522
540
|
"type": [
|
|
523
|
-
"boolean"
|
|
541
|
+
"boolean",
|
|
542
|
+
"null",
|
|
543
|
+
"undefined"
|
|
524
544
|
]
|
|
525
545
|
}
|
|
526
546
|
},
|
|
@@ -529,7 +549,9 @@
|
|
|
529
549
|
"description": "Specifies the 'name' property at Content-Disposition for multipart uploads.\nThis property is ignored when uploadFormat is 'raw'.",
|
|
530
550
|
"value": {
|
|
531
551
|
"type": [
|
|
532
|
-
"string"
|
|
552
|
+
"string",
|
|
553
|
+
"null",
|
|
554
|
+
"undefined"
|
|
533
555
|
]
|
|
534
556
|
}
|
|
535
557
|
},
|
|
@@ -538,7 +560,9 @@
|
|
|
538
560
|
"description": "Specifies the maximum number of files that can be uploaded simultaneously.\nThis helps prevent browser performance degradation and XHR limitations when\nuploading large numbers of files. Files exceeding this limit will be queued\nand uploaded as active uploads complete.",
|
|
539
561
|
"value": {
|
|
540
562
|
"type": [
|
|
541
|
-
"number"
|
|
563
|
+
"number",
|
|
564
|
+
"null",
|
|
565
|
+
"undefined"
|
|
542
566
|
]
|
|
543
567
|
}
|
|
544
568
|
},
|
|
@@ -547,7 +571,9 @@
|
|
|
547
571
|
"description": "Specifies the maximum file size in bytes allowed to upload.\nNotice that it is a client-side constraint, which will be checked before\nsending the request. Obviously you need to do the same validation in\nthe server-side and be sure that they are aligned.",
|
|
548
572
|
"value": {
|
|
549
573
|
"type": [
|
|
550
|
-
"number"
|
|
574
|
+
"number",
|
|
575
|
+
"null",
|
|
576
|
+
"undefined"
|
|
551
577
|
]
|
|
552
578
|
}
|
|
553
579
|
},
|
|
@@ -556,7 +582,9 @@
|
|
|
556
582
|
"description": "Limit of files to upload, by default it is unlimited. If the value is\nset to one, native file browser will prevent selecting multiple files.",
|
|
557
583
|
"value": {
|
|
558
584
|
"type": [
|
|
559
|
-
"number"
|
|
585
|
+
"number",
|
|
586
|
+
"null",
|
|
587
|
+
"undefined"
|
|
560
588
|
]
|
|
561
589
|
}
|
|
562
590
|
},
|
|
@@ -574,7 +602,9 @@
|
|
|
574
602
|
"description": "Prevents upload(s) from immediately uploading upon adding file(s).\nWhen set, you must manually trigger uploads using the `uploadFiles` method",
|
|
575
603
|
"value": {
|
|
576
604
|
"type": [
|
|
577
|
-
"boolean"
|
|
605
|
+
"boolean",
|
|
606
|
+
"null",
|
|
607
|
+
"undefined"
|
|
578
608
|
]
|
|
579
609
|
}
|
|
580
610
|
},
|
|
@@ -583,7 +613,9 @@
|
|
|
583
613
|
"description": "Define whether the element supports dropping files on it for uploading.\nBy default it's enabled in desktop and disabled in touch devices\nbecause mobile devices do not support drag events in general. Setting\nit false means that drop is enabled even in touch-devices, and true\ndisables drop in all devices.",
|
|
584
614
|
"value": {
|
|
585
615
|
"type": [
|
|
586
|
-
"boolean"
|
|
616
|
+
"boolean",
|
|
617
|
+
"null",
|
|
618
|
+
"undefined"
|
|
587
619
|
]
|
|
588
620
|
}
|
|
589
621
|
},
|
|
@@ -592,7 +624,9 @@
|
|
|
592
624
|
"description": "The server URL. The default value is an empty string, which means that\n_window.location_ will be used.",
|
|
593
625
|
"value": {
|
|
594
626
|
"type": [
|
|
595
|
-
"string"
|
|
627
|
+
"string",
|
|
628
|
+
"null",
|
|
629
|
+
"undefined"
|
|
596
630
|
]
|
|
597
631
|
}
|
|
598
632
|
},
|
|
@@ -612,7 +646,9 @@
|
|
|
612
646
|
"description": "Max time in milliseconds for the entire upload process, if exceeded the\nrequest will be aborted. Zero means that there is no timeout.",
|
|
613
647
|
"value": {
|
|
614
648
|
"type": [
|
|
615
|
-
"number"
|
|
649
|
+
"number",
|
|
650
|
+
"null",
|
|
651
|
+
"undefined"
|
|
616
652
|
]
|
|
617
653
|
}
|
|
618
654
|
},
|
|
@@ -621,7 +657,9 @@
|
|
|
621
657
|
"description": "Specifies the upload format to use when sending files to the server.\n- 'raw': Send file as raw binary data with the file's MIME type as Content-Type (default)\n- 'multipart': Send file using multipart/form-data encoding",
|
|
622
658
|
"value": {
|
|
623
659
|
"type": [
|
|
624
|
-
"string"
|
|
660
|
+
"string",
|
|
661
|
+
"null",
|
|
662
|
+
"undefined"
|
|
625
663
|
]
|
|
626
664
|
}
|
|
627
665
|
},
|
|
@@ -630,7 +668,9 @@
|
|
|
630
668
|
"description": "Set the withCredentials flag on the request.",
|
|
631
669
|
"value": {
|
|
632
670
|
"type": [
|
|
633
|
-
"boolean"
|
|
671
|
+
"boolean",
|
|
672
|
+
"null",
|
|
673
|
+
"undefined"
|
|
634
674
|
]
|
|
635
675
|
}
|
|
636
676
|
}
|
|
@@ -642,7 +682,9 @@
|
|
|
642
682
|
"description": "Specifies the types of files that the server accepts.\nSyntax: a comma-separated list of MIME type patterns (wildcards are\nallowed) or file extensions.\nNotice that MIME types are widely supported, while file extensions\nare only implemented in certain browsers, so avoid using it.\nExample: accept=\"video/*,image/tiff\" or accept=\".pdf,audio/mp3\"",
|
|
643
683
|
"value": {
|
|
644
684
|
"type": [
|
|
645
|
-
"string"
|
|
685
|
+
"string",
|
|
686
|
+
"null",
|
|
687
|
+
"undefined"
|
|
646
688
|
]
|
|
647
689
|
}
|
|
648
690
|
},
|
|
@@ -662,7 +704,9 @@
|
|
|
662
704
|
"description": "If true, the user cannot interact with this element.",
|
|
663
705
|
"value": {
|
|
664
706
|
"type": [
|
|
665
|
-
"boolean"
|
|
707
|
+
"boolean",
|
|
708
|
+
"null",
|
|
709
|
+
"undefined"
|
|
666
710
|
]
|
|
667
711
|
}
|
|
668
712
|
},
|
|
@@ -680,7 +724,9 @@
|
|
|
680
724
|
"description": "Specifies the 'name' property at Content-Disposition for multipart uploads.\nThis property is ignored when uploadFormat is 'raw'.",
|
|
681
725
|
"value": {
|
|
682
726
|
"type": [
|
|
683
|
-
"string"
|
|
727
|
+
"string",
|
|
728
|
+
"null",
|
|
729
|
+
"undefined"
|
|
684
730
|
]
|
|
685
731
|
}
|
|
686
732
|
},
|
|
@@ -699,7 +745,7 @@
|
|
|
699
745
|
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```js\n{\n dropFiles: {\n one: 'Drop file here',\n many: 'Drop files here'\n },\n addFiles: {\n one: 'Upload File...',\n many: 'Upload Files...'\n },\n error: {\n tooManyFiles: 'Too Many Files.',\n fileIsTooBig: 'File is Too Big.',\n incorrectFileType: 'Incorrect File Type.'\n },\n uploading: {\n status: {\n connecting: 'Connecting...',\n stalled: 'Stalled',\n processing: 'Processing File...',\n held: 'Queued'\n },\n remainingTime: {\n prefix: 'remaining time: ',\n unknown: 'unknown remaining time'\n },\n error: {\n serverUnavailable: 'Upload failed, please try again later',\n unexpectedServerError: 'Upload failed due to server error',\n forbidden: 'Upload forbidden'\n }\n },\n file: {\n retry: 'Retry',\n start: 'Start',\n remove: 'Remove'\n },\n units: {\n size: ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],\n sizeBase: 1000\n },\n formatSize: function(bytes) {\n // returns the size followed by the best suitable unit\n },\n formatTime: function(seconds, [secs, mins, hours]) {\n // returns a 'HH:MM:SS' string\n }\n}\n```",
|
|
700
746
|
"value": {
|
|
701
747
|
"type": [
|
|
702
|
-
"
|
|
748
|
+
"?"
|
|
703
749
|
]
|
|
704
750
|
}
|
|
705
751
|
},
|
|
@@ -708,7 +754,9 @@
|
|
|
708
754
|
"description": "Specifies the maximum number of files that can be uploaded simultaneously.\nThis helps prevent browser performance degradation and XHR limitations when\nuploading large numbers of files. Files exceeding this limit will be queued\nand uploaded as active uploads complete.",
|
|
709
755
|
"value": {
|
|
710
756
|
"type": [
|
|
711
|
-
"number"
|
|
757
|
+
"number",
|
|
758
|
+
"null",
|
|
759
|
+
"undefined"
|
|
712
760
|
]
|
|
713
761
|
}
|
|
714
762
|
},
|
|
@@ -717,7 +765,9 @@
|
|
|
717
765
|
"description": "Limit of files to upload, by default it is unlimited. If the value is\nset to one, native file browser will prevent selecting multiple files.",
|
|
718
766
|
"value": {
|
|
719
767
|
"type": [
|
|
720
|
-
"number"
|
|
768
|
+
"number",
|
|
769
|
+
"null",
|
|
770
|
+
"undefined"
|
|
721
771
|
]
|
|
722
772
|
}
|
|
723
773
|
},
|
|
@@ -726,7 +776,9 @@
|
|
|
726
776
|
"description": "Specifies the maximum file size in bytes allowed to upload.\nNotice that it is a client-side constraint, which will be checked before\nsending the request. Obviously you need to do the same validation in\nthe server-side and be sure that they are aligned.",
|
|
727
777
|
"value": {
|
|
728
778
|
"type": [
|
|
729
|
-
"number"
|
|
779
|
+
"number",
|
|
780
|
+
"null",
|
|
781
|
+
"undefined"
|
|
730
782
|
]
|
|
731
783
|
}
|
|
732
784
|
},
|
|
@@ -744,7 +796,9 @@
|
|
|
744
796
|
"description": "Prevents upload(s) from immediately uploading upon adding file(s).\nWhen set, you must manually trigger uploads using the `uploadFiles` method",
|
|
745
797
|
"value": {
|
|
746
798
|
"type": [
|
|
747
|
-
"boolean"
|
|
799
|
+
"boolean",
|
|
800
|
+
"null",
|
|
801
|
+
"undefined"
|
|
748
802
|
]
|
|
749
803
|
}
|
|
750
804
|
},
|
|
@@ -753,7 +807,9 @@
|
|
|
753
807
|
"description": "Define whether the element supports dropping files on it for uploading.\nBy default it's enabled in desktop and disabled in touch devices\nbecause mobile devices do not support drag events in general. Setting\nit false means that drop is enabled even in touch-devices, and true\ndisables drop in all devices.",
|
|
754
808
|
"value": {
|
|
755
809
|
"type": [
|
|
756
|
-
"boolean"
|
|
810
|
+
"boolean",
|
|
811
|
+
"null",
|
|
812
|
+
"undefined"
|
|
757
813
|
]
|
|
758
814
|
}
|
|
759
815
|
},
|
|
@@ -762,7 +818,9 @@
|
|
|
762
818
|
"description": "The server URL. The default value is an empty string, which means that\n_window.location_ will be used.",
|
|
763
819
|
"value": {
|
|
764
820
|
"type": [
|
|
765
|
-
"string"
|
|
821
|
+
"string",
|
|
822
|
+
"null",
|
|
823
|
+
"undefined"
|
|
766
824
|
]
|
|
767
825
|
}
|
|
768
826
|
},
|
|
@@ -771,7 +829,9 @@
|
|
|
771
829
|
"description": "Max time in milliseconds for the entire upload process, if exceeded the\nrequest will be aborted. Zero means that there is no timeout.",
|
|
772
830
|
"value": {
|
|
773
831
|
"type": [
|
|
774
|
-
"number"
|
|
832
|
+
"number",
|
|
833
|
+
"null",
|
|
834
|
+
"undefined"
|
|
775
835
|
]
|
|
776
836
|
}
|
|
777
837
|
},
|
|
@@ -780,7 +840,9 @@
|
|
|
780
840
|
"description": "Specifies the upload format to use when sending files to the server.\n- 'raw': Send file as raw binary data with the file's MIME type as Content-Type (default)\n- 'multipart': Send file using multipart/form-data encoding",
|
|
781
841
|
"value": {
|
|
782
842
|
"type": [
|
|
783
|
-
"string"
|
|
843
|
+
"string",
|
|
844
|
+
"null",
|
|
845
|
+
"undefined"
|
|
784
846
|
]
|
|
785
847
|
}
|
|
786
848
|
},
|
|
@@ -789,7 +851,9 @@
|
|
|
789
851
|
"description": "Set the withCredentials flag on the request.",
|
|
790
852
|
"value": {
|
|
791
853
|
"type": [
|
|
792
|
-
"boolean"
|
|
854
|
+
"boolean",
|
|
855
|
+
"null",
|
|
856
|
+
"undefined"
|
|
793
857
|
]
|
|
794
858
|
}
|
|
795
859
|
}
|