comand-component-library 4.3.28 → 5.0.0
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/dist/comand-component-library.css +1 -1
- package/dist/comand-component-library.js +9587 -9482
- package/dist/styles/demopage-only.css +12 -2
- package/package.json +47 -46
- package/src/ComponentLibrary.vue +2697 -2688
- package/src/assets/data/component-structure.json +1 -1
- package/src/assets/data/form-elements.json +224 -224
- package/src/assets/data/social-networks-page-by-json.json +43 -43
- package/src/assets/styles/component-library-global-styles.scss +296 -295
- package/src/componentSettingsDataAndControls.vue +1 -18
- package/src/components/CmdAccordion.vue +1 -1
- package/src/components/CmdAddressData.vue +6 -1
- package/src/components/CmdAddressDataItem.vue +6 -1
- package/src/components/CmdBasicForm.vue +2 -2
- package/src/components/CmdBox.vue +1103 -1092
- package/src/components/CmdBoxWrapper.vue +7 -1
- package/src/components/CmdBreadcrumbs.vue +2 -2
- package/src/components/CmdCodeOutput.vue +1 -1
- package/src/components/CmdCookieDisclaimer.vue +480 -480
- package/src/components/CmdFakeSelect.vue +930 -916
- package/src/components/CmdFlexibleScrollContainer.vue +42 -42
- package/src/components/CmdForm.vue +481 -481
- package/src/components/CmdFormElement.vue +1110 -1091
- package/src/components/CmdFormFilters.vue +146 -146
- package/src/components/CmdGoogleMaps.vue +1 -1
- package/src/components/CmdHeadline.vue +21 -4
- package/src/components/CmdIcon.vue +8 -2
- package/src/components/CmdImage.vue +14 -16
- package/src/components/CmdImageZoom.vue +9 -8
- package/src/components/CmdInputGroup.vue +436 -435
- package/src/components/CmdLink.vue +1 -1
- package/src/components/CmdList.vue +1 -1
- package/src/components/CmdListOfRequirements.vue +192 -192
- package/src/components/CmdLoginForm.vue +618 -618
- package/src/components/CmdMailToolFilter.vue +217 -217
- package/src/components/CmdMainNavigation.vue +581 -572
- package/src/components/CmdMultistepFormProgressBar.vue +9 -9
- package/src/components/CmdNewsletterSubscription.vue +199 -199
- package/src/components/CmdPagination.vue +4 -2
- package/src/components/CmdParagraph.vue +10 -4
- package/src/components/CmdProgressBar.vue +72 -72
- package/src/components/CmdSiteHeader.vue +382 -389
- package/src/components/CmdSiteSearch.vue +420 -420
- package/src/components/CmdSiteWrapper.vue +12 -5
- package/src/components/CmdSlideshow.vue +519 -519
- package/src/components/CmdSmartSearch.vue +291 -291
- package/src/components/CmdSystemMessage.vue +3 -2
- package/src/components/CmdTable.vue +401 -401
- package/src/components/CmdTabs.vue +262 -262
- package/src/components/CmdTag.vue +1 -1
- package/src/components/CmdTextImageBlock.vue +8 -2
- package/src/components/CmdThumbnailScroller.vue +0 -7
- package/src/components/CmdToggleDarkMode.vue +13 -11
- package/src/components/CmdTooltip.vue +305 -301
- package/src/components/CmdUploadForm.vue +1299 -1305
- package/src/components/CmdWidthLimitationWrapper.vue +1 -1
- package/src/components/EditComponentWrapper.vue +5 -5
- package/src/index.js +5 -0
- package/src/main.js +4 -3
- package/src/utils/template.js +57 -0
- package/src/assets/styles/template.css +0 -1
|
@@ -1,1305 +1,1299 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- begin CmdUploadForm ---------------------------------------------------------------------------------------- -->
|
|
3
|
-
<!-- begin advanced mode -->
|
|
4
|
-
<fieldset v-if="advancedMode" :class="['cmd-upload-form flex-container flex-direction-column', { 'upload-initiated': uploadInitiated }]">
|
|
5
|
-
<legend :class="{hidden : !legend.show, 'align-left': legend.align === 'left'}">{{ legend.text }}</legend>
|
|
6
|
-
<CmdHeadline
|
|
7
|
-
v-if="(cmdHeadlineForFieldsetProperties?.show && cmdHeadlineForFieldsetProperties?.headlineText) || editModeContext"
|
|
8
|
-
v-bind="cmdHeadlineForFieldsetProperties"
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
|
-
<!-- begin CmdSystemMessage -->
|
|
12
|
-
<CmdSystemMessage
|
|
13
|
-
v-if="systemMessageStatus && allSystemMessages.length"
|
|
14
|
-
:
|
|
15
|
-
:validationStatus="systemMessageStatus"
|
|
16
|
-
:systemMessage="allSystemMessages.length === 1 ? allSystemMessages[0] : getMessage('upload_form.system_message.the_following_errors_occurred')"
|
|
17
|
-
>
|
|
18
|
-
<ul v-if="allSystemMessages.length > 1">
|
|
19
|
-
<li v-for="(systemMessage, index) in allSystemMessages" :key="index">
|
|
20
|
-
{{ systemMessage }}
|
|
21
|
-
</li>
|
|
22
|
-
</ul>
|
|
23
|
-
</CmdSystemMessage>
|
|
24
|
-
<!-- end CmdSystemMessage -->
|
|
25
|
-
|
|
26
|
-
<div :class="['box flex-container flex-direction-column', { 'drop-area': enableDragAndDrop, 'allow-drop': allowDrop }]"
|
|
27
|
-
v-on="dragAndDropHandler">
|
|
28
|
-
<CmdHeadline v-if="!listOfFiles.length && allowMultipleFileUploads" v-bind="cmdHeadlineNoFilesToUploadProperties" />
|
|
29
|
-
|
|
30
|
-
<!-- begin total-upload information -->
|
|
31
|
-
<div v-else class="flex-container flex-direction-column">
|
|
32
|
-
<div v-if="showTotalUpload && listOfFiles.length > 1"
|
|
33
|
-
class="flex-container flex-direction-column list-files-wrapper">
|
|
34
|
-
<CmdHeadline v-bind="cmdHeadlineSummaryOfAllFilesProperties" />
|
|
35
|
-
|
|
36
|
-
<ul class="list-of-files total-files">
|
|
37
|
-
<li class="flex-container flex-items-flex-none">
|
|
38
|
-
<CmdLink
|
|
39
|
-
v-bind="cmdLinkCancelUploadProperties"
|
|
40
|
-
@click="cancelUpload"
|
|
41
|
-
/>
|
|
42
|
-
<span>
|
|
43
|
-
{{ listOfFiles.length }}
|
|
44
|
-
<template v-if="!allowMultipleFileUploads">
|
|
45
|
-
{{ getMessage("upload_form.labeltext.file_uploading") }}
|
|
46
|
-
</template>
|
|
47
|
-
<template v-else>
|
|
48
|
-
{{ getMessage("upload_form.labeltext.files_uploading") }}
|
|
49
|
-
</template>
|
|
50
|
-
</span>
|
|
51
|
-
<small
|
|
52
|
-
:class="[
|
|
53
|
-
'text-align-right',
|
|
54
|
-
{ error: maxTotalUploadSize > 0 && totalSize > maxTotalUploadSize }
|
|
55
|
-
]">
|
|
56
|
-
({{ formatSize(totalSize) }})
|
|
57
|
-
</small>
|
|
58
|
-
<span class="progressbar" v-if="uploadInitiated">
|
|
59
|
-
<span>{{ getPercentage(totalUploadProgress) }}</span>
|
|
60
|
-
<progress
|
|
61
|
-
max="100"
|
|
62
|
-
:value="totalUploadProgress"
|
|
63
|
-
:title="totalBytesUploaded"
|
|
64
|
-
></progress>
|
|
65
|
-
</span>
|
|
66
|
-
</li>
|
|
67
|
-
</ul>
|
|
68
|
-
<hr/>
|
|
69
|
-
</div>
|
|
70
|
-
<!-- end total-upload information -->
|
|
71
|
-
|
|
72
|
-
<div v-if="listOfFiles.length" class="flex-container flex-direction-column list-files-wrapper">
|
|
73
|
-
<CmdHeadline v-bind="cmdHeadlineListOfSelectedFilesProperties" />
|
|
74
|
-
<!-- begin list of selected files -->
|
|
75
|
-
<ul class="list-of-files">
|
|
76
|
-
<li
|
|
77
|
-
v-for="(uploadFile, index) in listOfFiles"
|
|
78
|
-
:key="index"
|
|
79
|
-
class="flex-container flex-items-flex-none"
|
|
80
|
-
>
|
|
81
|
-
<CmdLink
|
|
82
|
-
v-bind="cmdLinkRemoveFilesFromListProperties"
|
|
83
|
-
:title="getMessage('upload_form.labeltext.remove_file_from_list', uploadFile.file.name)"
|
|
84
|
-
@click="removeFile(index)"
|
|
85
|
-
/>
|
|
86
|
-
|
|
87
|
-
<span
|
|
88
|
-
:class="[
|
|
89
|
-
'text-align-right',
|
|
90
|
-
uploadFile.allowedType ? 'allowed' : 'not-allowed',
|
|
91
|
-
{ error: uploadFile.error }
|
|
92
|
-
]">
|
|
93
|
-
{{ uploadFile.file.name }} <small>({{ formatSize(uploadFile.file.size) }})</small>
|
|
94
|
-
</span>
|
|
95
|
-
|
|
96
|
-
<!-- begin progressbar -->
|
|
97
|
-
<span class="progressbar" v-if="uploadInitiated && !uploadFile.error">
|
|
98
|
-
<span>{{ getPercentage(uploadFile.progress) }}</span>
|
|
99
|
-
<!-- do not place inside progress-tag (will not be displayed then) -->
|
|
100
|
-
<progress
|
|
101
|
-
max="100"
|
|
102
|
-
:value="uploadFile.progress"
|
|
103
|
-
:title="
|
|
104
|
-
formatSize(uploadFile.uploadedBytes) + '/' + formatSize(uploadFile.file.size)
|
|
105
|
-
"
|
|
106
|
-
></progress>
|
|
107
|
-
</span>
|
|
108
|
-
<!-- end progressbar -->
|
|
109
|
-
</li>
|
|
110
|
-
</ul>
|
|
111
|
-
<CmdLink
|
|
112
|
-
v-if="failedUpload"
|
|
113
|
-
v-bind="cmdLinkResetUploadProperties"
|
|
114
|
-
@click="cancel"
|
|
115
|
-
/>
|
|
116
|
-
<hr/>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
<!-- end list of selected files -->
|
|
120
|
-
|
|
121
|
-
<!-- begin upload conditions -->
|
|
122
|
-
<div class="upload-conditions">
|
|
123
|
-
<CmdHeadline
|
|
124
|
-
v-if="listOfFiles.length"
|
|
125
|
-
v-bind="cmdHeadlineSelectFilesProperties"
|
|
126
|
-
/>
|
|
127
|
-
|
|
128
|
-
<dl class="small">
|
|
129
|
-
<template v-if="maxTotalUploadSize > 0">
|
|
130
|
-
<dt :class="{ error: totalSize > maxTotalUploadSize }">
|
|
131
|
-
{{ getMessage("upload_form.max_total_upload_size") }}
|
|
132
|
-
</dt>
|
|
133
|
-
<dd :class="['text-align-right', { error: totalSize > maxTotalUploadSize }]">
|
|
134
|
-
{{ formatSize(maxTotalUploadSize) }}
|
|
135
|
-
</dd>
|
|
136
|
-
</template>
|
|
137
|
-
<dt :class="{ error: errors.fileSize }">
|
|
138
|
-
{{ getMessage("upload_form.max_file_upload_size") }}
|
|
139
|
-
</dt>
|
|
140
|
-
<dd :class="['text-align-right', { error: errors.fileSize }]">
|
|
141
|
-
{{ formatSize(maxFileUploadSize) }}
|
|
142
|
-
</dd>
|
|
143
|
-
<dt :class="{ error: errors.fileType }">
|
|
144
|
-
{{ getMessage("upload_form.allowed_file_types") }}
|
|
145
|
-
</dt>
|
|
146
|
-
<dd>
|
|
147
|
-
<CmdLink
|
|
148
|
-
@click="showListOfFileExtensions = !showListOfFileExtensions"
|
|
149
|
-
v-bind="cmdLinkToggleListOfFileExtensionsProperties"
|
|
150
|
-
/>
|
|
151
|
-
|
|
152
|
-
<!-- begin list of file extensions -->
|
|
153
|
-
<transition :name="transitionListOfFileExtensions">
|
|
154
|
-
<ul v-if="showListOfFileExtensions" class="list-of-file-extensions">
|
|
155
|
-
<li
|
|
156
|
-
v-for="(fileExtension, index) in allowedFileExtensions"
|
|
157
|
-
:key="index"
|
|
158
|
-
:class="{ error: errors.fileType }"
|
|
159
|
-
>
|
|
160
|
-
{{ fileExtension }}
|
|
161
|
-
</li>
|
|
162
|
-
</ul>
|
|
163
|
-
</transition>
|
|
164
|
-
<!-- end list of file extensions -->
|
|
165
|
-
</dd>
|
|
166
|
-
</dl>
|
|
167
|
-
</div>
|
|
168
|
-
<!-- end upload conditions -->
|
|
169
|
-
|
|
170
|
-
<!-- begin upload-button and drag-and-drop-text -->
|
|
171
|
-
<div class="flex-container flex-direction-column no-gap">
|
|
172
|
-
<CmdLink
|
|
173
|
-
|
|
174
|
-
:disabled="uploadInitiated"
|
|
175
|
-
@click="selectFiles()"
|
|
176
|
-
v-bind="cmdLinkSelectFilesProperties"
|
|
177
|
-
/>
|
|
178
|
-
<p v-if="enableDragAndDrop" :class="['text-drag-and-drop', { disabled: uploadInitiated }]">
|
|
179
|
-
<span>{{ getMessage("upload_form.or") }}</span>
|
|
180
|
-
<strong>
|
|
181
|
-
{{ getMessage("upload_form.drag_and_drop") }}
|
|
182
|
-
<template v-if="allowMultipleFileUploads && listOfFiles.length">
|
|
183
|
-
{{ getMessage("upload_form.additional") }}
|
|
184
|
-
</template>
|
|
185
|
-
<template v-if="!allowMultipleFileUploads && listOfFiles.length">
|
|
186
|
-
{{ getMessage("upload_form.new") }}
|
|
187
|
-
</template>
|
|
188
|
-
{{ getMessage("upload_form.files_to_this_area") }}
|
|
189
|
-
</strong>
|
|
190
|
-
</p>
|
|
191
|
-
</div>
|
|
192
|
-
<!-- end upload-button and drag-and-drop-text -->
|
|
193
|
-
</div>
|
|
194
|
-
|
|
195
|
-
<!-- begin CmdFormElement -->
|
|
196
|
-
<CmdFormElement
|
|
197
|
-
v-if="enableComment"
|
|
198
|
-
element="textarea"
|
|
199
|
-
:labelText="getMessage('upload_form.labeltext.comment')"
|
|
200
|
-
v-model="comment"
|
|
201
|
-
:required="commentRequired"
|
|
202
|
-
:validationMessage="commentStatusMessage"
|
|
203
|
-
:placeholder="getMessage('upload_form.placeholder.comment')"
|
|
204
|
-
:status="commentStatusMessage ? 'error' : ''"
|
|
205
|
-
/>
|
|
206
|
-
<!-- end CmdFormElement -->
|
|
207
|
-
|
|
208
|
-
<!-- begin button-wrapper -->
|
|
209
|
-
<div class="button-wrapper stretch-on-small-devices">
|
|
210
|
-
<CmdLink
|
|
211
|
-
:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
v-bind="
|
|
222
|
-
|
|
223
|
-
/>
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
<template v-
|
|
254
|
-
<span>{{ getMessage("upload_form.
|
|
255
|
-
<!-- begin CmdIcon -->
|
|
256
|
-
<CmdIcon v-bind="
|
|
257
|
-
<!-- end CmdIcon -->
|
|
258
|
-
</template>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
</template>
|
|
266
|
-
<
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
headlineLevel:
|
|
614
|
-
...this.
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
headlineText: this.
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
this.
|
|
842
|
-
|
|
843
|
-
//
|
|
844
|
-
this
|
|
845
|
-
},
|
|
846
|
-
|
|
847
|
-
this.
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
)
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
if
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
},
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
this.
|
|
978
|
-
|
|
979
|
-
this.
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
//
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
this.
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
})
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
)
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
}
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
/* end cmd-upload-form ---------------------------------------------------------------------------------------------- */
|
|
1305
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- begin CmdUploadForm ---------------------------------------------------------------------------------------- -->
|
|
3
|
+
<!-- begin advanced mode -->
|
|
4
|
+
<fieldset v-if="advancedMode" :class="['cmd-upload-form flex-container flex-direction-column', { 'upload-initiated': uploadInitiated }]">
|
|
5
|
+
<legend :class="{'visually-hidden' : !legend.show, 'align-left': legend.align === 'left'}">{{ legend.text }}</legend>
|
|
6
|
+
<CmdHeadline
|
|
7
|
+
v-if="(cmdHeadlineForFieldsetProperties?.show && cmdHeadlineForFieldsetProperties?.headlineText) || editModeContext"
|
|
8
|
+
v-bind="cmdHeadlineForFieldsetProperties"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<!-- begin CmdSystemMessage -->
|
|
12
|
+
<CmdSystemMessage
|
|
13
|
+
v-if="systemMessageStatus && allSystemMessages.length"
|
|
14
|
+
:allowUserToCloseMessage="false"
|
|
15
|
+
:validationStatus="systemMessageStatus"
|
|
16
|
+
:systemMessage="allSystemMessages.length === 1 ? allSystemMessages[0] : getMessage('upload_form.system_message.the_following_errors_occurred')"
|
|
17
|
+
>
|
|
18
|
+
<ul v-if="allSystemMessages.length > 1">
|
|
19
|
+
<li v-for="(systemMessage, index) in allSystemMessages" :key="index">
|
|
20
|
+
{{ systemMessage }}
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</CmdSystemMessage>
|
|
24
|
+
<!-- end CmdSystemMessage -->
|
|
25
|
+
|
|
26
|
+
<div :class="['box flex-container flex-direction-column', { 'drop-area': enableDragAndDrop, 'allow-drop': allowDrop }]"
|
|
27
|
+
v-on="dragAndDropHandler">
|
|
28
|
+
<CmdHeadline v-if="!listOfFiles.length && allowMultipleFileUploads" v-bind="cmdHeadlineNoFilesToUploadProperties" />
|
|
29
|
+
|
|
30
|
+
<!-- begin total-upload information -->
|
|
31
|
+
<div v-else class="flex-container flex-direction-column">
|
|
32
|
+
<div v-if="showTotalUpload && listOfFiles.length > 1"
|
|
33
|
+
class="flex-container flex-direction-column list-files-wrapper">
|
|
34
|
+
<CmdHeadline v-bind="cmdHeadlineSummaryOfAllFilesProperties" />
|
|
35
|
+
|
|
36
|
+
<ul class="list-of-files total-files">
|
|
37
|
+
<li class="flex-container flex-items-flex-none">
|
|
38
|
+
<CmdLink
|
|
39
|
+
v-bind="cmdLinkCancelUploadProperties"
|
|
40
|
+
@click="cancelUpload"
|
|
41
|
+
/>
|
|
42
|
+
<span>
|
|
43
|
+
{{ listOfFiles.length }}
|
|
44
|
+
<template v-if="!allowMultipleFileUploads">
|
|
45
|
+
{{ getMessage("upload_form.labeltext.file_uploading") }}
|
|
46
|
+
</template>
|
|
47
|
+
<template v-else>
|
|
48
|
+
{{ getMessage("upload_form.labeltext.files_uploading") }}
|
|
49
|
+
</template>
|
|
50
|
+
</span>
|
|
51
|
+
<small
|
|
52
|
+
:class="[
|
|
53
|
+
'text-align-right',
|
|
54
|
+
{ error: maxTotalUploadSize > 0 && totalSize > maxTotalUploadSize }
|
|
55
|
+
]">
|
|
56
|
+
({{ formatSize(totalSize) }})
|
|
57
|
+
</small>
|
|
58
|
+
<span class="progressbar" v-if="uploadInitiated">
|
|
59
|
+
<span>{{ getPercentage(totalUploadProgress) }}</span>
|
|
60
|
+
<progress
|
|
61
|
+
max="100"
|
|
62
|
+
:value="totalUploadProgress"
|
|
63
|
+
:title="totalBytesUploaded"
|
|
64
|
+
></progress>
|
|
65
|
+
</span>
|
|
66
|
+
</li>
|
|
67
|
+
</ul>
|
|
68
|
+
<hr/>
|
|
69
|
+
</div>
|
|
70
|
+
<!-- end total-upload information -->
|
|
71
|
+
|
|
72
|
+
<div v-if="listOfFiles.length" class="flex-container flex-direction-column list-files-wrapper">
|
|
73
|
+
<CmdHeadline v-bind="cmdHeadlineListOfSelectedFilesProperties" />
|
|
74
|
+
<!-- begin list of selected files -->
|
|
75
|
+
<ul class="list-of-files">
|
|
76
|
+
<li
|
|
77
|
+
v-for="(uploadFile, index) in listOfFiles"
|
|
78
|
+
:key="index"
|
|
79
|
+
class="flex-container flex-items-flex-none"
|
|
80
|
+
>
|
|
81
|
+
<CmdLink
|
|
82
|
+
v-bind="cmdLinkRemoveFilesFromListProperties"
|
|
83
|
+
:title="getMessage('upload_form.labeltext.remove_file_from_list', uploadFile.file.name)"
|
|
84
|
+
@click="removeFile(index)"
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<span
|
|
88
|
+
:class="[
|
|
89
|
+
'text-align-right',
|
|
90
|
+
uploadFile.allowedType ? 'allowed' : 'not-allowed',
|
|
91
|
+
{ error: uploadFile.error }
|
|
92
|
+
]">
|
|
93
|
+
{{ uploadFile.file.name }} <small>({{ formatSize(uploadFile.file.size) }})</small>
|
|
94
|
+
</span>
|
|
95
|
+
|
|
96
|
+
<!-- begin progressbar -->
|
|
97
|
+
<span class="progressbar" v-if="uploadInitiated && !uploadFile.error">
|
|
98
|
+
<span>{{ getPercentage(uploadFile.progress) }}</span>
|
|
99
|
+
<!-- do not place inside progress-tag (will not be displayed then) -->
|
|
100
|
+
<progress
|
|
101
|
+
max="100"
|
|
102
|
+
:value="uploadFile.progress"
|
|
103
|
+
:title="
|
|
104
|
+
formatSize(uploadFile.uploadedBytes) + '/' + formatSize(uploadFile.file.size)
|
|
105
|
+
"
|
|
106
|
+
></progress>
|
|
107
|
+
</span>
|
|
108
|
+
<!-- end progressbar -->
|
|
109
|
+
</li>
|
|
110
|
+
</ul>
|
|
111
|
+
<CmdLink
|
|
112
|
+
v-if="failedUpload"
|
|
113
|
+
v-bind="cmdLinkResetUploadProperties"
|
|
114
|
+
@click="cancel"
|
|
115
|
+
/>
|
|
116
|
+
<hr/>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
<!-- end list of selected files -->
|
|
120
|
+
|
|
121
|
+
<!-- begin upload conditions -->
|
|
122
|
+
<div class="upload-conditions">
|
|
123
|
+
<CmdHeadline
|
|
124
|
+
v-if="listOfFiles.length"
|
|
125
|
+
v-bind="cmdHeadlineSelectFilesProperties"
|
|
126
|
+
/>
|
|
127
|
+
|
|
128
|
+
<dl class="small">
|
|
129
|
+
<template v-if="maxTotalUploadSize > 0">
|
|
130
|
+
<dt :class="{ error: totalSize > maxTotalUploadSize }">
|
|
131
|
+
{{ getMessage("upload_form.max_total_upload_size") }}
|
|
132
|
+
</dt>
|
|
133
|
+
<dd :class="['text-align-right', { error: totalSize > maxTotalUploadSize }]">
|
|
134
|
+
{{ formatSize(maxTotalUploadSize) }}
|
|
135
|
+
</dd>
|
|
136
|
+
</template>
|
|
137
|
+
<dt :class="{ error: errors.fileSize }">
|
|
138
|
+
{{ getMessage("upload_form.max_file_upload_size") }}
|
|
139
|
+
</dt>
|
|
140
|
+
<dd :class="['text-align-right', { error: errors.fileSize }]">
|
|
141
|
+
{{ formatSize(maxFileUploadSize) }}
|
|
142
|
+
</dd>
|
|
143
|
+
<dt :class="{ error: errors.fileType }">
|
|
144
|
+
{{ getMessage("upload_form.allowed_file_types") }}
|
|
145
|
+
</dt>
|
|
146
|
+
<dd>
|
|
147
|
+
<CmdLink
|
|
148
|
+
@click="showListOfFileExtensions = !showListOfFileExtensions"
|
|
149
|
+
v-bind="cmdLinkToggleListOfFileExtensionsProperties"
|
|
150
|
+
/>
|
|
151
|
+
|
|
152
|
+
<!-- begin list of file extensions -->
|
|
153
|
+
<transition :name="transitionListOfFileExtensions">
|
|
154
|
+
<ul v-if="showListOfFileExtensions" class="list-of-file-extensions">
|
|
155
|
+
<li
|
|
156
|
+
v-for="(fileExtension, index) in allowedFileExtensions"
|
|
157
|
+
:key="index"
|
|
158
|
+
:class="{ error: errors.fileType }"
|
|
159
|
+
>
|
|
160
|
+
{{ fileExtension }}
|
|
161
|
+
</li>
|
|
162
|
+
</ul>
|
|
163
|
+
</transition>
|
|
164
|
+
<!-- end list of file extensions -->
|
|
165
|
+
</dd>
|
|
166
|
+
</dl>
|
|
167
|
+
</div>
|
|
168
|
+
<!-- end upload conditions -->
|
|
169
|
+
|
|
170
|
+
<!-- begin upload-button and drag-and-drop-text -->
|
|
171
|
+
<div class="flex-container flex-direction-column no-gap">
|
|
172
|
+
<CmdLink
|
|
173
|
+
class="upload"
|
|
174
|
+
:disabled="uploadInitiated"
|
|
175
|
+
@click="selectFiles()"
|
|
176
|
+
v-bind="cmdLinkSelectFilesProperties"
|
|
177
|
+
/>
|
|
178
|
+
<p v-if="enableDragAndDrop" :class="['text-drag-and-drop', { disabled: uploadInitiated }]">
|
|
179
|
+
<span>{{ getMessage("upload_form.or") }}</span>
|
|
180
|
+
<strong>
|
|
181
|
+
{{ getMessage("upload_form.drag_and_drop") }}
|
|
182
|
+
<template v-if="allowMultipleFileUploads && listOfFiles.length">
|
|
183
|
+
{{ getMessage("upload_form.additional") }}
|
|
184
|
+
</template>
|
|
185
|
+
<template v-if="!allowMultipleFileUploads && listOfFiles.length">
|
|
186
|
+
{{ getMessage("upload_form.new") }}
|
|
187
|
+
</template>
|
|
188
|
+
{{ getMessage("upload_form.files_to_this_area") }}
|
|
189
|
+
</strong>
|
|
190
|
+
</p>
|
|
191
|
+
</div>
|
|
192
|
+
<!-- end upload-button and drag-and-drop-text -->
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<!-- begin CmdFormElement -->
|
|
196
|
+
<CmdFormElement
|
|
197
|
+
v-if="enableComment"
|
|
198
|
+
element="textarea"
|
|
199
|
+
:labelText="getMessage('upload_form.labeltext.comment')"
|
|
200
|
+
v-model="comment"
|
|
201
|
+
:required="commentRequired"
|
|
202
|
+
:validationMessage="commentStatusMessage"
|
|
203
|
+
:placeholder="getMessage('upload_form.placeholder.comment')"
|
|
204
|
+
:status="commentStatusMessage ? 'error' : ''"
|
|
205
|
+
/>
|
|
206
|
+
<!-- end CmdFormElement -->
|
|
207
|
+
|
|
208
|
+
<!-- begin button-wrapper -->
|
|
209
|
+
<div class="button-wrapper stretch-on-small-devices">
|
|
210
|
+
<CmdLink
|
|
211
|
+
:disabled="
|
|
212
|
+
listOfFiles.length === 0 ||
|
|
213
|
+
(maxTotalUploadSize > 0 && totalSize > maxTotalUploadSize) ||
|
|
214
|
+
uploadInitiated"
|
|
215
|
+
v-bind="cmdLinkUploadFilesProperties"
|
|
216
|
+
@click="uploadFiles"
|
|
217
|
+
/>
|
|
218
|
+
|
|
219
|
+
<CmdLink
|
|
220
|
+
@click="cancel"
|
|
221
|
+
v-bind="cmdLinkCancelIconProperties"
|
|
222
|
+
:class="{ disabled: listOfFiles.length === 0 }"
|
|
223
|
+
/>
|
|
224
|
+
</div>
|
|
225
|
+
<!-- end button-wrapper -->
|
|
226
|
+
</fieldset>
|
|
227
|
+
<!-- end advanced mode -->
|
|
228
|
+
|
|
229
|
+
<!-- begin simple mode -->
|
|
230
|
+
<a v-else href="#" @click.prevent="selectFiles"
|
|
231
|
+
:class="['cmd-upload-form box', { 'drop-area': enableDragAndDrop, 'allow-drop': allowDrop }]"
|
|
232
|
+
v-on="dragAndDropHandler">
|
|
233
|
+
<!-- begin progressbar -->
|
|
234
|
+
<span v-if="uploadInitiated" class="progressbar">
|
|
235
|
+
<span>{{ getPercentage(totalUploadProgress) }}</span>
|
|
236
|
+
<progress
|
|
237
|
+
max="100"
|
|
238
|
+
:value="totalUploadProgress"
|
|
239
|
+
:title="totalBytesUploaded">
|
|
240
|
+
</progress>
|
|
241
|
+
</span>
|
|
242
|
+
<!-- end progressbar -->
|
|
243
|
+
|
|
244
|
+
<!-- begin slot-content -->
|
|
245
|
+
<slot>
|
|
246
|
+
<template v-if="!enableDragAndDrop">
|
|
247
|
+
<template v-if="fileTypeImage">
|
|
248
|
+
<span>{{ getMessage("upload_form.select_image") }}</span>
|
|
249
|
+
<!-- begin CmdIcon -->
|
|
250
|
+
<CmdIcon v-bind="cmdIconImage" />
|
|
251
|
+
<!-- end CmdIcon -->
|
|
252
|
+
</template>
|
|
253
|
+
<template v-else>
|
|
254
|
+
<span>{{ getMessage("upload_form.select_file") }}</span>
|
|
255
|
+
<!-- begin CmdIcon -->
|
|
256
|
+
<CmdIcon v-bind="cmdIconFileUpload" />
|
|
257
|
+
<!-- end CmdIcon -->
|
|
258
|
+
</template>
|
|
259
|
+
</template>
|
|
260
|
+
<template v-else>
|
|
261
|
+
<span>{{ getMessage("upload_form.drag_and_drop_file_here") }}</span>
|
|
262
|
+
<!-- begin CmdIcon -->
|
|
263
|
+
<CmdIcon v-bind="cmdIconDragAndDrop" />
|
|
264
|
+
<!-- end CmdIcon -->
|
|
265
|
+
</template>
|
|
266
|
+
<small>{{ getMessage("upload_form.max_upload_size") }} {{ formatSize(maxFileUploadSize) }}</small>
|
|
267
|
+
<small>{{ getMessage("upload_form.allowed_file_types") }} {{ allowedFileExtensions }}</small>
|
|
268
|
+
</slot>
|
|
269
|
+
<!-- end slot-content -->
|
|
270
|
+
</a>
|
|
271
|
+
<!-- end simple mode -->
|
|
272
|
+
|
|
273
|
+
<!-- begin CmdFormElement -->
|
|
274
|
+
<CmdFormElement
|
|
275
|
+
element="input"
|
|
276
|
+
type="file"
|
|
277
|
+
:labelText="getMessage('upload_form.labeltext.select_files')"
|
|
278
|
+
:disabled="uploadInitiated"
|
|
279
|
+
:multiple="allowMultipleFileUploads"
|
|
280
|
+
@change="filesSelected"
|
|
281
|
+
ref="formElement"
|
|
282
|
+
/>
|
|
283
|
+
<!-- end CmdFormElement -->
|
|
284
|
+
<!-- end CmdUploadForm ---------------------------------------------------------------------------------------- -->
|
|
285
|
+
</template>
|
|
286
|
+
|
|
287
|
+
<script>
|
|
288
|
+
// import mixins
|
|
289
|
+
import I18n from "../mixins/I18n"
|
|
290
|
+
import DefaultMessageProperties from "../mixins/CmdUploadForm/DefaultMessageProperties"
|
|
291
|
+
|
|
292
|
+
import {getFileExtension} from "../utils/getFileExtension.js"
|
|
293
|
+
import axios from "axios"
|
|
294
|
+
|
|
295
|
+
export default {
|
|
296
|
+
name: "CmdUploadForm",
|
|
297
|
+
emits: ["click", "error", "upload-complete", "upload-file-success"],
|
|
298
|
+
mixins: [I18n, DefaultMessageProperties],
|
|
299
|
+
inject: {
|
|
300
|
+
editModeContext: {
|
|
301
|
+
default: null
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
data() {
|
|
305
|
+
return {
|
|
306
|
+
comment: "",
|
|
307
|
+
allowDrop: false,
|
|
308
|
+
listOfFiles: [],
|
|
309
|
+
systemMessages: [],
|
|
310
|
+
defaultSystemMessageStatus: "",
|
|
311
|
+
showListOfFileExtensions: false,
|
|
312
|
+
resetForm: {},
|
|
313
|
+
uploadInitiated: false,
|
|
314
|
+
errors: {}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
created() {
|
|
318
|
+
// Set initial data for resetForm.
|
|
319
|
+
this.resetForm.comment = this.presetComment
|
|
320
|
+
this.resetForm.allowDrop = this.allowDrop
|
|
321
|
+
this.resetForm.listOfFiles = JSON.parse(JSON.stringify(this.listOfFiles))
|
|
322
|
+
this.resetForm.systemMessages = this.systemMessages
|
|
323
|
+
this.resetForm.systemMessageStatus = this.systemMessageStatus
|
|
324
|
+
},
|
|
325
|
+
props: {
|
|
326
|
+
/**
|
|
327
|
+
* define the transition when the list of file extensions is toggled
|
|
328
|
+
*
|
|
329
|
+
* @allowedValues: "none", "fade", "scroll"
|
|
330
|
+
*/
|
|
331
|
+
transitionListOfFileExtensions: {
|
|
332
|
+
type: String,
|
|
333
|
+
default: "fade"
|
|
334
|
+
},
|
|
335
|
+
/**
|
|
336
|
+
* activate if transition for hiding list of file extensions
|
|
337
|
+
*/
|
|
338
|
+
useTransition: {
|
|
339
|
+
type: Boolean,
|
|
340
|
+
default: true
|
|
341
|
+
},
|
|
342
|
+
/**
|
|
343
|
+
* toggle visibility of total upload (number of files, total size, total progress
|
|
344
|
+
*/
|
|
345
|
+
showTotalUpload: {
|
|
346
|
+
type: Boolean,
|
|
347
|
+
default: true
|
|
348
|
+
},
|
|
349
|
+
/**
|
|
350
|
+
* toggle if upload is handled by component itself or by outer component
|
|
351
|
+
*/
|
|
352
|
+
componentHandlesUpload: {
|
|
353
|
+
type: Boolean,
|
|
354
|
+
default: true
|
|
355
|
+
},
|
|
356
|
+
/**
|
|
357
|
+
* list of allowed file extensions to upload (all can be selected)
|
|
358
|
+
*/
|
|
359
|
+
allowedFileExtensions: {
|
|
360
|
+
type: Array,
|
|
361
|
+
required: true
|
|
362
|
+
},
|
|
363
|
+
/**
|
|
364
|
+
* activate if the comment given by the user should be mandatory
|
|
365
|
+
*
|
|
366
|
+
* enableComment-property must be set to true
|
|
367
|
+
*/
|
|
368
|
+
commentRequired: {
|
|
369
|
+
type: Boolean,
|
|
370
|
+
default: true
|
|
371
|
+
},
|
|
372
|
+
/**
|
|
373
|
+
* show a message if mandatory comment-textarea is not filled
|
|
374
|
+
*
|
|
375
|
+
* enableComment-property and commentRequired-property must be set to true
|
|
376
|
+
*/
|
|
377
|
+
commentStatusMessage: {
|
|
378
|
+
type: String,
|
|
379
|
+
default: ""
|
|
380
|
+
},
|
|
381
|
+
/**
|
|
382
|
+
* enable if files can also be dragged (and dropped) into upload-area
|
|
383
|
+
*/
|
|
384
|
+
enableDragAndDrop: {
|
|
385
|
+
type: Boolean,
|
|
386
|
+
default: false
|
|
387
|
+
},
|
|
388
|
+
/**
|
|
389
|
+
* enable if a comment should be possible to left by the user
|
|
390
|
+
*/
|
|
391
|
+
enableComment: {
|
|
392
|
+
type: Boolean,
|
|
393
|
+
default: true
|
|
394
|
+
},
|
|
395
|
+
/**
|
|
396
|
+
* preset the comment-textarea
|
|
397
|
+
*
|
|
398
|
+
* enableComment-property must be set to true
|
|
399
|
+
*/
|
|
400
|
+
presetComment: {
|
|
401
|
+
type: String,
|
|
402
|
+
default: ""
|
|
403
|
+
},
|
|
404
|
+
/**
|
|
405
|
+
* set to 0 if no maximum for total upload size should be set
|
|
406
|
+
*/
|
|
407
|
+
maxTotalUploadSize: {
|
|
408
|
+
type: Number,
|
|
409
|
+
default: 5242880
|
|
410
|
+
},
|
|
411
|
+
/**
|
|
412
|
+
* max file size (in bytes) for each single file
|
|
413
|
+
*/
|
|
414
|
+
maxFileUploadSize: {
|
|
415
|
+
type: Number,
|
|
416
|
+
default: 10485760
|
|
417
|
+
},
|
|
418
|
+
/**
|
|
419
|
+
* enable if more than file should be enabled to be selected for upload
|
|
420
|
+
*/
|
|
421
|
+
allowMultipleFileUploads: {
|
|
422
|
+
type: Boolean,
|
|
423
|
+
default: false
|
|
424
|
+
},
|
|
425
|
+
/**
|
|
426
|
+
* defines upload options if component handles upload itself
|
|
427
|
+
*
|
|
428
|
+
* componentHandlesUpload-property must be true
|
|
429
|
+
*/
|
|
430
|
+
uploadOptions: {
|
|
431
|
+
type: Object,
|
|
432
|
+
required: false
|
|
433
|
+
},
|
|
434
|
+
/**
|
|
435
|
+
* activate to use full upload-form-style and -functionality
|
|
436
|
+
*
|
|
437
|
+
* @affectsStyling: true
|
|
438
|
+
*/
|
|
439
|
+
advancedMode: {
|
|
440
|
+
type: Boolean,
|
|
441
|
+
default: true
|
|
442
|
+
},
|
|
443
|
+
/**
|
|
444
|
+
* legend for form
|
|
445
|
+
*
|
|
446
|
+
* useFieldset-property must be activated
|
|
447
|
+
*
|
|
448
|
+
* @requiredForAccessiblity: true
|
|
449
|
+
*/
|
|
450
|
+
legend: {
|
|
451
|
+
type: Object,
|
|
452
|
+
default() {
|
|
453
|
+
return {
|
|
454
|
+
show: true,
|
|
455
|
+
align: "left",
|
|
456
|
+
text: "Legend"
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
/**
|
|
461
|
+
* set icon for invisible-icon
|
|
462
|
+
*/
|
|
463
|
+
iconInvisible: {
|
|
464
|
+
type: Object,
|
|
465
|
+
default() {
|
|
466
|
+
return {
|
|
467
|
+
iconClass: "icon-not-visible"
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
/**
|
|
472
|
+
* set icon class for visible-icon
|
|
473
|
+
*/
|
|
474
|
+
iconVisible: {
|
|
475
|
+
type: Object,
|
|
476
|
+
default() {
|
|
477
|
+
return {
|
|
478
|
+
iconClass: "icon-visible"
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
/**
|
|
483
|
+
* properties for CmdIcon for "drag-and-drop"-icon
|
|
484
|
+
*/
|
|
485
|
+
cmdIconDragAndDrop: {
|
|
486
|
+
type: Object,
|
|
487
|
+
default() {
|
|
488
|
+
return {
|
|
489
|
+
iconClass: "icon-not-visible"
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
/**
|
|
494
|
+
* properties for CmdIcon for "image"-icon
|
|
495
|
+
*/
|
|
496
|
+
cmdIconFileUpload: {
|
|
497
|
+
type: Object,
|
|
498
|
+
default() {
|
|
499
|
+
return {
|
|
500
|
+
iconClass: "icon-file"
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
/**
|
|
505
|
+
* properties for CmdIcon for "image"-icon
|
|
506
|
+
*/
|
|
507
|
+
cmdIconImage: {
|
|
508
|
+
type: Object,
|
|
509
|
+
default() {
|
|
510
|
+
return {
|
|
511
|
+
iconClass: "icon-image"
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
/**
|
|
516
|
+
* properties for CmdLink-component for removing (before added) files from list
|
|
517
|
+
*
|
|
518
|
+
*/
|
|
519
|
+
cmdLinkRemoveFilesFromList: {
|
|
520
|
+
type: Object,
|
|
521
|
+
required: false
|
|
522
|
+
},
|
|
523
|
+
/**
|
|
524
|
+
* properties for CmdLink-component for selecting file(s)
|
|
525
|
+
*/
|
|
526
|
+
cmdLinkSelectFiles: {
|
|
527
|
+
type: Object,
|
|
528
|
+
required: false
|
|
529
|
+
},
|
|
530
|
+
/**
|
|
531
|
+
* properties for CmdLink-component for uploading file(s)
|
|
532
|
+
*/
|
|
533
|
+
cmdLinkUploadFiles: {
|
|
534
|
+
type: Object,
|
|
535
|
+
required: false
|
|
536
|
+
},
|
|
537
|
+
/**
|
|
538
|
+
* properties for CmdLink-component for cancel-icon
|
|
539
|
+
*/
|
|
540
|
+
cmdLinkCancelIcon: {
|
|
541
|
+
type: Object,
|
|
542
|
+
required: false
|
|
543
|
+
},
|
|
544
|
+
/**
|
|
545
|
+
* properties for CmdLink-component to toggle the list of file extensions
|
|
546
|
+
*
|
|
547
|
+
* icon is set by iconVisible- and iconInvisible-properties
|
|
548
|
+
*/
|
|
549
|
+
cmdLinkToggleListOfFileExtensions: {
|
|
550
|
+
type: Object,
|
|
551
|
+
required: false
|
|
552
|
+
},
|
|
553
|
+
/**
|
|
554
|
+
* properties for CmdLink-component to reset upload (if upload failed before)
|
|
555
|
+
*/
|
|
556
|
+
cmdLinkResetUpload: {
|
|
557
|
+
type: Object,
|
|
558
|
+
required: false
|
|
559
|
+
},
|
|
560
|
+
/**
|
|
561
|
+
* properties for CmdHeadline-component at top of the fieldset
|
|
562
|
+
*/
|
|
563
|
+
cmdHeadlineForFieldset: {
|
|
564
|
+
type: Object,
|
|
565
|
+
required: false
|
|
566
|
+
},
|
|
567
|
+
/**
|
|
568
|
+
* properties for CmdHeadline-component shown if no files for upload exist
|
|
569
|
+
*/
|
|
570
|
+
cmdHeadlineNoFilesToUpload: {
|
|
571
|
+
type: Object,
|
|
572
|
+
required: false
|
|
573
|
+
},
|
|
574
|
+
/**
|
|
575
|
+
* properties for CmdHeadline-component shown if no file for upload exist
|
|
576
|
+
*/
|
|
577
|
+
cmdHeadlineNoFileToUpload: {
|
|
578
|
+
type: Object,
|
|
579
|
+
required: false
|
|
580
|
+
},
|
|
581
|
+
/**
|
|
582
|
+
* properties for CmdHeadline-component for 'summary of all files'
|
|
583
|
+
*/
|
|
584
|
+
cmdHeadlineSummaryOfAllFiles: {
|
|
585
|
+
type: Object,
|
|
586
|
+
required: false
|
|
587
|
+
},
|
|
588
|
+
/**
|
|
589
|
+
* properties for CmdHeadline-component for 'list of selected files'
|
|
590
|
+
*/
|
|
591
|
+
cmdHeadlineListOfSelectedFiles: {
|
|
592
|
+
type: Object,
|
|
593
|
+
required: false
|
|
594
|
+
},
|
|
595
|
+
/**
|
|
596
|
+
* properties for CmdHeadline-component for 'select additional/new file(s)'
|
|
597
|
+
*/
|
|
598
|
+
cmdHeadlineSelectFiles: {
|
|
599
|
+
type: Object,
|
|
600
|
+
required: false
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
computed: {
|
|
604
|
+
cmdHeadlineForFieldsetProperties() {
|
|
605
|
+
return {
|
|
606
|
+
show: true,
|
|
607
|
+
headlineLevel: 3,
|
|
608
|
+
...this.cmdHeadlineForFieldset
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
cmdHeadlineNoFilesToUploadProperties() {
|
|
612
|
+
return {
|
|
613
|
+
headlineLevel: 4,
|
|
614
|
+
...this.cmdHeadlineNoFilesToUpload,
|
|
615
|
+
headlineText: this.allowMultipleFileUploads ? this.getMessage("upload_form.no_files_to_upload") : this.getMessage("upload_form.no_file_to_upload")
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
cmdHeadlineListOfSelectedFilesProperties() {
|
|
619
|
+
return {
|
|
620
|
+
headlineLeveL: 4,
|
|
621
|
+
headlineText: this.getMessage("upload_form.headline.list_of_selected_files"),
|
|
622
|
+
...this.cmdHeadlineListOfSelectedFiles
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
cmdHeadlineSummaryOfAllFilesProperties() {
|
|
626
|
+
return {
|
|
627
|
+
headlineLevel: 4,
|
|
628
|
+
headlineText: this.getMessage("upload_form.headline.summary_of_all_files"),
|
|
629
|
+
...this.cmdHeadlineSummaryOfAllFiles
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
cmdHeadlineSelectFilesProperties() {
|
|
633
|
+
return {
|
|
634
|
+
headlineLevel: 4,
|
|
635
|
+
headlineText: this.allowMultipleFileUploads ? this.getMessage("upload_form.headline.select_additional_files") : this.getMessage("upload_form.headline.select_new_file"),
|
|
636
|
+
...this.cmdHeadlineSelectFiles
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
cmdLinkCancelIconProperties() {
|
|
640
|
+
return {
|
|
641
|
+
linkType: "button",
|
|
642
|
+
highlightLevel: null,
|
|
643
|
+
icon: {
|
|
644
|
+
iconClass: "icon-cancel-circle"
|
|
645
|
+
},
|
|
646
|
+
text: this.getMessage("upload_form.buttontext.cancel"),
|
|
647
|
+
...this.cmdLinkCancelIcon
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
cmdLinkSelectFilesProperties() {
|
|
651
|
+
return {
|
|
652
|
+
linkType: "button",
|
|
653
|
+
icon: {
|
|
654
|
+
iconClass: "icon-file-upload"
|
|
655
|
+
},
|
|
656
|
+
text: this.allowMultipleFileUploads ? this.getMessage("upload_form.labeltext.select_files") : this.getMessage("upload_form.labeltext.select_file") ,
|
|
657
|
+
...this.cmdLinkSelectFiles
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
cmdLinkToggleListOfFileExtensionsProperties() {
|
|
661
|
+
return {
|
|
662
|
+
icon: {
|
|
663
|
+
iconClass: this.showListOfFileExtensions ? this.iconInvisible?.iconClass : this.iconVisible?.iconClass,
|
|
664
|
+
type: this.showListOfFileExtensions ? this.iconInvisible?.iconType : this.iconVisible?.iconType,
|
|
665
|
+
tooltip: this.getMessage('upload_form.tooltip.toggle_list_of_allowed_file_types')
|
|
666
|
+
},
|
|
667
|
+
...this.cmdLinkToggleListOfFileExtensions
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
cmdLinkUploadFilesProperties() {
|
|
671
|
+
return {
|
|
672
|
+
linkType: "button",
|
|
673
|
+
icon: {
|
|
674
|
+
iconClass: "icon-upload"
|
|
675
|
+
},
|
|
676
|
+
text: this.listOfFiles.length === 1 || !this.allowMultipleFileUploads ? this.getMessage("upload_form.buttontext.upload_file") : this.getMessage("upload_form.buttontext.upload_files"),
|
|
677
|
+
...this.cmdLinkUploadFiles
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
cmdLinkCancelUploadProperties() {
|
|
681
|
+
return {
|
|
682
|
+
icon: {
|
|
683
|
+
iconClass: "icon-delete",
|
|
684
|
+
tooltip: this.getMessage('upload_form.labeltext.remove_all_files_from_list')
|
|
685
|
+
},
|
|
686
|
+
...this.cmdLinkCancelUpload
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
cmdLinkRemoveFilesFromListProperties() {
|
|
690
|
+
return {
|
|
691
|
+
icon: {
|
|
692
|
+
iconClass: "icon-delete"
|
|
693
|
+
},
|
|
694
|
+
...this.cmdLinkRemoveFilesFromList
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
cmdLinkResetUploadProperties() {
|
|
698
|
+
return {
|
|
699
|
+
icon: {
|
|
700
|
+
iconClass: "icon-loop-left",
|
|
701
|
+
tooltip: this.getMessage('upload_form.all_files_will_be_removed')
|
|
702
|
+
},
|
|
703
|
+
text: this.getMessage("upload_form.reset_upload"),
|
|
704
|
+
...this.cmdLinkResetUpload
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
fileTypeImage() {
|
|
708
|
+
return this.allowedFileExtensions.some(extension => extension.includes('jpg'));
|
|
709
|
+
},
|
|
710
|
+
failedUpload() {
|
|
711
|
+
return this.listOfFiles.some(file => file.error)
|
|
712
|
+
},
|
|
713
|
+
totalBytesUploaded() {
|
|
714
|
+
const bytes = this.listOfFiles
|
|
715
|
+
.map(uploadFile => [
|
|
716
|
+
uploadFile.file.size,
|
|
717
|
+
((uploadFile.progress || 0) * uploadFile.file.size) / 100
|
|
718
|
+
])
|
|
719
|
+
.reduce((a, b) => [a[0] + b[0], a[1] + b[1]])
|
|
720
|
+
return this.formatSize(bytes[1]) + "/" + this.formatSize(bytes[0])
|
|
721
|
+
},
|
|
722
|
+
totalSize() {
|
|
723
|
+
let totalSize = 0
|
|
724
|
+
for (let i = 0; i < this.listOfFiles.length; i++) {
|
|
725
|
+
totalSize = totalSize + this.listOfFiles[i].file.size
|
|
726
|
+
}
|
|
727
|
+
return totalSize
|
|
728
|
+
},
|
|
729
|
+
allSystemMessages() {
|
|
730
|
+
if (this.maxTotalUploadSize > 0 && this.totalSize > this.maxTotalUploadSize) {
|
|
731
|
+
return [
|
|
732
|
+
this.getMessage("upload_form.system_message_total_size_of_files_too_large"),
|
|
733
|
+
...this.systemMessages
|
|
734
|
+
]
|
|
735
|
+
}
|
|
736
|
+
return this.systemMessages
|
|
737
|
+
},
|
|
738
|
+
systemMessageStatus() {
|
|
739
|
+
return this.defaultSystemMessageStatus || (this.allSystemMessages.length ? "error" : "")
|
|
740
|
+
},
|
|
741
|
+
dragAndDropHandler() {
|
|
742
|
+
// register handlers only if drag-and-drop is enabled
|
|
743
|
+
if (this.enableDragAndDrop) {
|
|
744
|
+
return {
|
|
745
|
+
dragenter: this.dragEnter,
|
|
746
|
+
dragover: this.dragOver,
|
|
747
|
+
dragleave: this.dragLeave,
|
|
748
|
+
drop: this.drop
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
return {}
|
|
752
|
+
},
|
|
753
|
+
totalUploadProgress() {
|
|
754
|
+
const progress = this.listOfFiles
|
|
755
|
+
.map(uploadFile => [
|
|
756
|
+
uploadFile.file.size,
|
|
757
|
+
((uploadFile.progress || 0) * uploadFile.file.size) / 100
|
|
758
|
+
])
|
|
759
|
+
.reduce((a, b) => [a[0] + b[0], a[1] + b[1]])
|
|
760
|
+
return (progress[1] / progress[0]) * 100
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
watch: {
|
|
764
|
+
presetComment: {
|
|
765
|
+
handler(newValue) {
|
|
766
|
+
this.comment = newValue
|
|
767
|
+
},
|
|
768
|
+
immediate: true
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
methods: {
|
|
772
|
+
getPercentage(percentage) {
|
|
773
|
+
if (percentage) {
|
|
774
|
+
return percentage.toFixed(2) + "%"
|
|
775
|
+
}
|
|
776
|
+
return "0.00%"
|
|
777
|
+
},
|
|
778
|
+
// use imported function as method (to use in template)
|
|
779
|
+
getFileExtension(filename) {
|
|
780
|
+
return getFileExtension(filename)
|
|
781
|
+
},
|
|
782
|
+
selectFiles() {
|
|
783
|
+
let inputFile = this.$refs.formElement.getDomElement().querySelector("input[type='file']")
|
|
784
|
+
inputFile.click()
|
|
785
|
+
},
|
|
786
|
+
dragEnter(event) {
|
|
787
|
+
this.dragOver(event)
|
|
788
|
+
},
|
|
789
|
+
dragOver(event) {
|
|
790
|
+
if (event.dataTransfer && event.dataTransfer.items && event.dataTransfer.items.length > 0) {
|
|
791
|
+
event.dataTransfer.dropEffect = "none"
|
|
792
|
+
let allowed = true
|
|
793
|
+
for (let i = 0, c = event.dataTransfer.items.length; i < c; ++i) {
|
|
794
|
+
let item = event.dataTransfer.items[i]
|
|
795
|
+
if (item.kind !== "file" /*|| !this._allowedTypes[item.type]*/) {
|
|
796
|
+
allowed = false
|
|
797
|
+
break
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
if (allowed) {
|
|
801
|
+
event.preventDefault()
|
|
802
|
+
event.dataTransfer.dropEffect = "copy"
|
|
803
|
+
this.allowDrop = true
|
|
804
|
+
// this._handle_dragover(event)
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
dragLeave() {
|
|
809
|
+
this.allowDrop = false
|
|
810
|
+
},
|
|
811
|
+
/*
|
|
812
|
+
drag(event) {
|
|
813
|
+
alert("dropped")
|
|
814
|
+
event.dataTransfer.setData("text", event.target.id)
|
|
815
|
+
},
|
|
816
|
+
*/
|
|
817
|
+
drop(event) {
|
|
818
|
+
this.allowDrop = false
|
|
819
|
+
if (event.dataTransfer && event.dataTransfer.files && event.dataTransfer.files.length > 0) {
|
|
820
|
+
event.preventDefault()
|
|
821
|
+
this.checkFiles(event.dataTransfer.files)
|
|
822
|
+
}
|
|
823
|
+
},
|
|
824
|
+
cancelUpload() {
|
|
825
|
+
// cancel upload for each file
|
|
826
|
+
this.listOfFiles.forEach(file => {
|
|
827
|
+
if (file.abortController) {
|
|
828
|
+
file.abortController.abort()
|
|
829
|
+
}
|
|
830
|
+
})
|
|
831
|
+
|
|
832
|
+
// clear list of files, remove error-highlighting and hide all system-messages afterwards
|
|
833
|
+
this.errors = {}
|
|
834
|
+
this.listOfFiles = []
|
|
835
|
+
this.hideAllSystemMessages()
|
|
836
|
+
|
|
837
|
+
// set uploadInitiated to false to enable all disabled buttons
|
|
838
|
+
this.uploadInitiated = false
|
|
839
|
+
},
|
|
840
|
+
cancel() {
|
|
841
|
+
this.cancelUpload()
|
|
842
|
+
|
|
843
|
+
// emit click event with argument "cancel" to react in outer component
|
|
844
|
+
this.$emit("click", "cancel")
|
|
845
|
+
},
|
|
846
|
+
filesSelected(event) {
|
|
847
|
+
this.checkFiles(event.target.files)
|
|
848
|
+
},
|
|
849
|
+
checkFiles(files) {
|
|
850
|
+
if (!files.length) {
|
|
851
|
+
return
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
this.defaultSystemMessageStatus = ""; // hide systemMessage if already is shown
|
|
855
|
+
this.systemMessages = [] // hide systemMessage if already is shown
|
|
856
|
+
this.errors = {}
|
|
857
|
+
|
|
858
|
+
for (let i = 0; i < files.length; i++) {
|
|
859
|
+
// define file-object which will be pushed in listOfFiles
|
|
860
|
+
const uploadFile = {
|
|
861
|
+
file: files[i],
|
|
862
|
+
progress: null,
|
|
863
|
+
uploadedBytes: 0
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// check size for current file
|
|
867
|
+
if (files[i].size > this.maxFileUploadSize) {
|
|
868
|
+
this.errors.fileSize = true
|
|
869
|
+
this.systemMessages.push(
|
|
870
|
+
this.getMessage(
|
|
871
|
+
"upload_form.system_message.file_size_too_large",
|
|
872
|
+
files[i].name,
|
|
873
|
+
files[i].size
|
|
874
|
+
)
|
|
875
|
+
)
|
|
876
|
+
continue
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// check if current file has allowed file-type (else continue with next file)
|
|
880
|
+
if (!this.allowedFileExtensions.includes(getFileExtension(files[i].name))) {
|
|
881
|
+
this.showListOfFileExtensions = true
|
|
882
|
+
this.errors.fileType = true
|
|
883
|
+
this.systemMessages.push(
|
|
884
|
+
this.getMessage(
|
|
885
|
+
"upload_form.system_message.not_allowed_file_type",
|
|
886
|
+
files[i].name,
|
|
887
|
+
getFileExtension(files[i].name)
|
|
888
|
+
)
|
|
889
|
+
)
|
|
890
|
+
continue
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// check (if multiple files can be selected) if current file already exists in listOfFiles
|
|
894
|
+
if (
|
|
895
|
+
this.allowMultipleFileUploads &&
|
|
896
|
+
this.listOfFiles.some(listOfFilesEntry =>
|
|
897
|
+
this.compareFiles(listOfFilesEntry.file, files[i])
|
|
898
|
+
)
|
|
899
|
+
) {
|
|
900
|
+
this.systemMessages.push(
|
|
901
|
+
this.getMessage(
|
|
902
|
+
"upload_form.system_message.duplicate_file",
|
|
903
|
+
files[i].name,
|
|
904
|
+
getFileExtension(files[i].name)
|
|
905
|
+
)
|
|
906
|
+
)
|
|
907
|
+
continue
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
if (this.allowMultipleFileUploads) {
|
|
911
|
+
// push file-object (for each valid file) to listOfFiles-array
|
|
912
|
+
this.listOfFiles.push(uploadFile)
|
|
913
|
+
} else {
|
|
914
|
+
if (files.length > 1) {
|
|
915
|
+
this.systemMessages.push(
|
|
916
|
+
this.getMessage("upload_form.system_message.only_one_file_allowed")
|
|
917
|
+
)
|
|
918
|
+
}
|
|
919
|
+
// assign uploadFile-object (which contains current (and valid) file to listOfFiles-array
|
|
920
|
+
this.listOfFiles = [uploadFile]
|
|
921
|
+
break
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
if (!this.advancedMode) {
|
|
926
|
+
if (this.systemMessages.length) {
|
|
927
|
+
this.$emit("error", {messages: this.systemMessages})
|
|
928
|
+
return
|
|
929
|
+
}
|
|
930
|
+
if (this.listOfFiles.length) {
|
|
931
|
+
this.uploadFiles()
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
},
|
|
935
|
+
compareFiles(file1, file2) {
|
|
936
|
+
return (
|
|
937
|
+
file1.name === file2.name &&
|
|
938
|
+
file1.lastModified === file2.lastModified &&
|
|
939
|
+
file1.size === file2.size
|
|
940
|
+
)
|
|
941
|
+
},
|
|
942
|
+
removeFile(index) {
|
|
943
|
+
/* remove specific file from list */
|
|
944
|
+
this.listOfFiles.splice(index, 1)
|
|
945
|
+
if (!this.listOfFiles.length) {
|
|
946
|
+
this.uploadInitiated = false
|
|
947
|
+
}
|
|
948
|
+
this.hideAllSystemMessages()
|
|
949
|
+
},
|
|
950
|
+
hideAllSystemMessages() {
|
|
951
|
+
// hide all system-messages if all files are removed from list
|
|
952
|
+
if (!this.listOfFiles.length) {
|
|
953
|
+
this.systemMessages = []
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
formatSize(size) {
|
|
957
|
+
if (size < 1024) {
|
|
958
|
+
return size
|
|
959
|
+
} else if (size < 1048576) {
|
|
960
|
+
return (size = Math.round((size / 1024) * 100) / 100 + " KB")
|
|
961
|
+
} else {
|
|
962
|
+
return (size = Math.round((size / 1048576) * 100) / 100 + " MB")
|
|
963
|
+
}
|
|
964
|
+
},
|
|
965
|
+
uploadFiles() {
|
|
966
|
+
this.systemMessages = []
|
|
967
|
+
this.errors = {}
|
|
968
|
+
this.defaultSystemMessageStatus = ""
|
|
969
|
+
|
|
970
|
+
if (
|
|
971
|
+
this.enableComment &&
|
|
972
|
+
!this.comment &&
|
|
973
|
+
this.commentRequired &&
|
|
974
|
+
this.commentStatusMessage
|
|
975
|
+
) {
|
|
976
|
+
this.defaultSystemMessageStatus = "error"
|
|
977
|
+
this.systemMessages.push(this.getMessage("upload_form.system_message.fill_required"))
|
|
978
|
+
} else {
|
|
979
|
+
this.uploadInitiated = true
|
|
980
|
+
|
|
981
|
+
if (this.componentHandlesUpload && this.uploadOptions && this.uploadOptions.url) {
|
|
982
|
+
const url = new URL(this.uploadOptions.url, location.href)
|
|
983
|
+
const formData = new FormData()
|
|
984
|
+
|
|
985
|
+
// // append information about files to formData-object
|
|
986
|
+
// formData.append(
|
|
987
|
+
// this.uploadOptions.filesParam ? this.uploadOptions.filesParam : "files",
|
|
988
|
+
// this.listOfFiles.map(uploadFile => uploadFile.file)
|
|
989
|
+
// )
|
|
990
|
+
|
|
991
|
+
// iterate over additionalParams-object and append to formData-object
|
|
992
|
+
Object.entries(this.uploadOptions.additionalParams || {}).forEach(([key, value]) =>
|
|
993
|
+
formData.append(key, value)
|
|
994
|
+
)
|
|
995
|
+
|
|
996
|
+
// append comment to formData-object
|
|
997
|
+
if (this.enableComment) {
|
|
998
|
+
formData.append("comment", this.comment)
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
const requests = []
|
|
1002
|
+
|
|
1003
|
+
// iterate over list-of-files to send upload request for each file individually
|
|
1004
|
+
this.listOfFiles.forEach(file => {
|
|
1005
|
+
requests.push(this.uploadSingleFile(url, file, formData))
|
|
1006
|
+
})
|
|
1007
|
+
|
|
1008
|
+
// check upload-status for each file individually
|
|
1009
|
+
Promise.allSettled(requests).then(results => {
|
|
1010
|
+
// if status equals "rejected" the upload was not successful and the file will not be deleted from list
|
|
1011
|
+
const rejectedFiles = results.filter(result => result.status === "rejected")
|
|
1012
|
+
this.uploadInitiated = false
|
|
1013
|
+
|
|
1014
|
+
if (rejectedFiles.length) {
|
|
1015
|
+
this.defaultSystemMessageStatus = "error"
|
|
1016
|
+
this.systemMessages.push(
|
|
1017
|
+
this.getMessage(
|
|
1018
|
+
"upload_form.system_message.some_files_are_not_uploaded_successfully"
|
|
1019
|
+
)
|
|
1020
|
+
)
|
|
1021
|
+
} else {
|
|
1022
|
+
this.defaultSystemMessageStatus = "success"
|
|
1023
|
+
this.systemMessages.push(
|
|
1024
|
+
this.getMessage("upload_form.system_message.all_files_are_uploaded_successfully")
|
|
1025
|
+
)
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
this.$emit("upload-complete", {success: !rejectedFiles.length})
|
|
1029
|
+
})
|
|
1030
|
+
} else {
|
|
1031
|
+
let uploadObj = {}
|
|
1032
|
+
uploadObj.listOfFiles = this.listOfFiles
|
|
1033
|
+
uploadObj.type = "upload"
|
|
1034
|
+
uploadObj.comment = this.comment
|
|
1035
|
+
|
|
1036
|
+
// emit uploadObj to handle upload by outer component
|
|
1037
|
+
this.$emit("click", uploadObj, this.showMessage)
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
onUploadProgress(event, uploadFile) {
|
|
1042
|
+
if (event.lengthComputable) {
|
|
1043
|
+
uploadFile.progress = (event.loaded / event.total) * 100
|
|
1044
|
+
uploadFile.uploadedBytes = event.loaded
|
|
1045
|
+
} else {
|
|
1046
|
+
uploadFile.progress = null
|
|
1047
|
+
uploadFile.uploadedBytes = 0
|
|
1048
|
+
}
|
|
1049
|
+
this.$forceUpdate()
|
|
1050
|
+
},
|
|
1051
|
+
uploadSingleFile(url, file, formData) {
|
|
1052
|
+
file.abortController = new AbortController()
|
|
1053
|
+
|
|
1054
|
+
// append information about given file to formData-object
|
|
1055
|
+
formData.set(
|
|
1056
|
+
this.uploadOptions.filesParam ? this.uploadOptions.filesParam : "files",
|
|
1057
|
+
file.file
|
|
1058
|
+
)
|
|
1059
|
+
|
|
1060
|
+
return (
|
|
1061
|
+
axios
|
|
1062
|
+
.post(url, formData, {
|
|
1063
|
+
signal: file.abortController.signal,
|
|
1064
|
+
onUploadProgress: event => this.onUploadProgress(event, file)
|
|
1065
|
+
})
|
|
1066
|
+
// emit information about successful-upload + file
|
|
1067
|
+
.then(response => {
|
|
1068
|
+
this.$emit("upload-file-success", file)
|
|
1069
|
+
return response
|
|
1070
|
+
})
|
|
1071
|
+
// delete uploaded file from list-of-files-array
|
|
1072
|
+
.then(response => {
|
|
1073
|
+
const positionOfFile = this.listOfFiles.indexOf(file)
|
|
1074
|
+
if (positionOfFile !== -1) {
|
|
1075
|
+
this.listOfFiles.splice(positionOfFile, 1)
|
|
1076
|
+
}
|
|
1077
|
+
return response
|
|
1078
|
+
})
|
|
1079
|
+
.catch(error => {
|
|
1080
|
+
this.defaultSystemMessageStatus = "error"
|
|
1081
|
+
this.systemMessages.push(error)
|
|
1082
|
+
file.error = true
|
|
1083
|
+
throw new Error()
|
|
1084
|
+
})
|
|
1085
|
+
)
|
|
1086
|
+
},
|
|
1087
|
+
showMessage(result) {
|
|
1088
|
+
if (result === true) {
|
|
1089
|
+
this.defaultSystemMessageStatus = "success"
|
|
1090
|
+
this.systemMessages.push(this.getMessage("upload_form.system_message.upload_success"))
|
|
1091
|
+
} else if (result === false) {
|
|
1092
|
+
this.defaultSystemMessageStatus = "error"
|
|
1093
|
+
this.systemMessages.push(this.getMessage("upload_form.system_message.upload_failed"))
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
resetFields() {
|
|
1097
|
+
if (typeof this.resetForm === "object") {
|
|
1098
|
+
const resetArr = Object.keys(this.resetForm)
|
|
1099
|
+
for (let key of resetArr) {
|
|
1100
|
+
if (typeof this.resetForm[key] === "object") {
|
|
1101
|
+
this[key] = JSON.parse(JSON.stringify(this.resetForm[key]))
|
|
1102
|
+
} else {
|
|
1103
|
+
this[key] = this.resetForm[key]
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
</script>
|
|
1111
|
+
|
|
1112
|
+
<style>
|
|
1113
|
+
/* begin cmd-upload-form -------------------------------------------------------------------------------------------- */
|
|
1114
|
+
.cmd-upload-form {
|
|
1115
|
+
.cmd-custom-headline {
|
|
1116
|
+
margin: 0;
|
|
1117
|
+
justify-content: center;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/* begin box for simple-mode */
|
|
1121
|
+
&.box {
|
|
1122
|
+
display: inline-flex;
|
|
1123
|
+
flex-direction: column;
|
|
1124
|
+
background: var(--color-scheme-background-subtle);
|
|
1125
|
+
|
|
1126
|
+
text-decoration: none;
|
|
1127
|
+
text-align: center;
|
|
1128
|
+
padding: var(--default-padding);
|
|
1129
|
+
|
|
1130
|
+
span {
|
|
1131
|
+
margin: 0;
|
|
1132
|
+
|
|
1133
|
+
&[class*="icon-"] {
|
|
1134
|
+
font-size: 5rem;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
/* end box for simple-mode */
|
|
1139
|
+
|
|
1140
|
+
.box {
|
|
1141
|
+
box-shadow: none;
|
|
1142
|
+
background: var(--color-scheme-background);
|
|
1143
|
+
border: var(--default-border);
|
|
1144
|
+
align-items: center;
|
|
1145
|
+
|
|
1146
|
+
dl {
|
|
1147
|
+
justify-content: center;
|
|
1148
|
+
text-align: left;
|
|
1149
|
+
|
|
1150
|
+
.list-of-file-extensions {
|
|
1151
|
+
display: table;
|
|
1152
|
+
|
|
1153
|
+
> li:only-child {
|
|
1154
|
+
list-style-type: none;
|
|
1155
|
+
margin: 0;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
.total-files {
|
|
1162
|
+
> * {
|
|
1163
|
+
white-space: nowrap;
|
|
1164
|
+
|
|
1165
|
+
&:not(a) {
|
|
1166
|
+
font-weight: bold;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
[class*="list-of-file"] {
|
|
1172
|
+
max-height: 10rem;
|
|
1173
|
+
overflow-x: hidden;
|
|
1174
|
+
overflow-y: auto;
|
|
1175
|
+
border: var(--default-border);
|
|
1176
|
+
padding: var(--default-padding);
|
|
1177
|
+
margin: 0;
|
|
1178
|
+
|
|
1179
|
+
> li {
|
|
1180
|
+
flex-wrap: nowrap;
|
|
1181
|
+
|
|
1182
|
+
.progressbar {
|
|
1183
|
+
display: table;
|
|
1184
|
+
align-self: center;
|
|
1185
|
+
|
|
1186
|
+
progress {
|
|
1187
|
+
&[value] {
|
|
1188
|
+
background: var(--color-scheme-background);
|
|
1189
|
+
|
|
1190
|
+
&::-moz-progress-bar {
|
|
1191
|
+
border-top-left-radius: var(--default-border-radius);
|
|
1192
|
+
border-bottom-left-radius: var(--default-border-radius);
|
|
1193
|
+
background: var(--primary-color);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
& > span {
|
|
1199
|
+
position: absolute;
|
|
1200
|
+
left: 50%;
|
|
1201
|
+
transform: translateX(-50%);
|
|
1202
|
+
z-index: 1;
|
|
1203
|
+
display: table;
|
|
1204
|
+
top: .2rem;
|
|
1205
|
+
padding: .1rem .2rem;
|
|
1206
|
+
line-height: 100%;
|
|
1207
|
+
background: var(--color-scheme-background);
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
.list-files-wrapper {
|
|
1214
|
+
justify-content: center;
|
|
1215
|
+
align-items: center;
|
|
1216
|
+
|
|
1217
|
+
.list-of-files {
|
|
1218
|
+
display: inline-flex;
|
|
1219
|
+
flex-direction: column;
|
|
1220
|
+
gap: calc(var(--default-gap) / 2);
|
|
1221
|
+
|
|
1222
|
+
li {
|
|
1223
|
+
list-style-type: none;
|
|
1224
|
+
margin-left: 0;
|
|
1225
|
+
gap: calc(var(--default-gap) / 2);
|
|
1226
|
+
|
|
1227
|
+
> a:hover, a:active, a:focus {
|
|
1228
|
+
~ * {
|
|
1229
|
+
color: var(--hyperlink-color-highlighted);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
& + a {
|
|
1235
|
+
display: table;
|
|
1236
|
+
margin: 0 auto;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
hr {
|
|
1241
|
+
width: 100%; /* will be 0 instead (because of align-items: center for parent) */
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.upload-conditions {
|
|
1246
|
+
.cmd-headline > * {
|
|
1247
|
+
text-align: center;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
dl {
|
|
1251
|
+
margin: 0;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
p {
|
|
1256
|
+
&.text-drag-and-drop {
|
|
1257
|
+
&.disabled {
|
|
1258
|
+
background: none !important; /* overwrite default styling for .disabled */
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
.button.upload {
|
|
1264
|
+
align-self: center;
|
|
1265
|
+
|
|
1266
|
+
& ~ p {
|
|
1267
|
+
& > * {
|
|
1268
|
+
display: block;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.error {
|
|
1274
|
+
color: var(--error-color-text);
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
& + .cmd-form-element {
|
|
1278
|
+
display: none;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
.drop-area, &.drop-area {
|
|
1282
|
+
border: var(--default-border);
|
|
1283
|
+
border-style: dashed;
|
|
1284
|
+
background: var(--color-scheme-background);
|
|
1285
|
+
padding: var(--default-padding);
|
|
1286
|
+
text-align: center;
|
|
1287
|
+
|
|
1288
|
+
&.allow-drop {
|
|
1289
|
+
border-style: solid;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
> [class*="icon-"] {
|
|
1293
|
+
font-size: 5rem;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
/* end cmd-upload-form ---------------------------------------------------------------------------------------------- */
|
|
1299
|
+
</style>
|