comand-component-library 4.3.27 → 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 +7568 -7448
- package/dist/styles/demopage-only.css +35 -1
- 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 -1086
- package/src/components/CmdBoxWrapper.vue +11 -1
- package/src/components/CmdBreadcrumbs.vue +2 -2
- package/src/components/CmdCodeOutput.vue +1 -1
- package/src/components/CmdContainer.vue +13 -1
- package/src/components/CmdCookieDisclaimer.vue +480 -480
- package/src/components/CmdFakeSelect.vue +930 -917
- 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 +27 -21
- 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 +3 -3
- 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 +2 -2
- package/src/components/CmdTextImageBlock.vue +8 -2
- package/src/components/CmdThumbnailScroller.vue +0 -7
- package/src/components/CmdToast.vue +1 -1
- 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/dist/styles/templates/casual.css +0 -3
- package/src/assets/styles/template.css +0 -1
|
@@ -1,917 +1,930 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- begin CmdFakeSelect ---------------------------------------------------------------------------------------- -->
|
|
3
|
-
<div
|
|
4
|
-
:class="[
|
|
5
|
-
validationStatus,
|
|
6
|
-
'cmd-fake-select label',
|
|
7
|
-
{
|
|
8
|
-
color: type === 'color',
|
|
9
|
-
'has-state': validationStatus && validationStatus !== 'none',
|
|
10
|
-
disabled: $attrs.disabled
|
|
11
|
-
}
|
|
12
|
-
]"
|
|
13
|
-
:title="$attrs.title"
|
|
14
|
-
role="
|
|
15
|
-
:aria-labelledby="htmlId"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
:
|
|
45
|
-
:
|
|
46
|
-
:
|
|
47
|
-
:
|
|
48
|
-
:
|
|
49
|
-
:
|
|
50
|
-
:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
v-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
:
|
|
72
|
-
:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<!-- begin
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<!-- end
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<!-- begin
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
:
|
|
96
|
-
:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<!-- end
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
<span
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
import
|
|
197
|
-
import
|
|
198
|
-
import
|
|
199
|
-
import
|
|
200
|
-
import
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
],
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
-
return null
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
if (this.type === "
|
|
477
|
-
return this.modelValue || this.selectData?.[0]?.value
|
|
478
|
-
}
|
|
479
|
-
return null
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
if (
|
|
483
|
-
this.
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
this.
|
|
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
|
-
// check if
|
|
521
|
-
|
|
522
|
-
this.
|
|
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
|
-
return this.
|
|
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
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
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
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
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
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<!-- begin CmdFakeSelect ---------------------------------------------------------------------------------------- -->
|
|
3
|
+
<div
|
|
4
|
+
:class="[
|
|
5
|
+
validationStatus,
|
|
6
|
+
'cmd-fake-select label',
|
|
7
|
+
{
|
|
8
|
+
color: type === 'color',
|
|
9
|
+
'has-state': validationStatus && validationStatus !== 'none',
|
|
10
|
+
disabled: $attrs.disabled
|
|
11
|
+
}
|
|
12
|
+
]"
|
|
13
|
+
:title="$attrs.title"
|
|
14
|
+
role="group"
|
|
15
|
+
:aria-labelledby="showLabel ? htmlId : null"
|
|
16
|
+
ref="fakeselect"
|
|
17
|
+
>
|
|
18
|
+
<template v-if="showLabel">
|
|
19
|
+
<!-- begin label -->
|
|
20
|
+
<span class="label-text">
|
|
21
|
+
<span :id="htmlId">{{ labelText }}<sup v-if="$attrs.required !== undefined" aria-hidden="true">*</sup>
|
|
22
|
+
</span>
|
|
23
|
+
|
|
24
|
+
<!-- begin status-icon (linked with tooltip) -->
|
|
25
|
+
<button v-if="($attrs.required || inputRequirements.length) && showStatusIcon"
|
|
26
|
+
type="button"
|
|
27
|
+
class="no-style"
|
|
28
|
+
:title="validationTooltip"
|
|
29
|
+
:aria-errormessage="tooltipId"
|
|
30
|
+
aria-live="assertive"
|
|
31
|
+
:popovertarget="'tooltip-target-' + htmlId"
|
|
32
|
+
:style="'anchor-name: --tooltip-anchor-' + htmlId"
|
|
33
|
+
>
|
|
34
|
+
<!-- begin CmdIcon -->
|
|
35
|
+
<CmdIcon :iconClass="getStatusIconClass" />
|
|
36
|
+
<!-- end CmdIcon -->
|
|
37
|
+
</button>
|
|
38
|
+
<!-- end status-icon (linked with tooltip) -->
|
|
39
|
+
|
|
40
|
+
<!-- begin CmdTooltip -->
|
|
41
|
+
<CmdTooltip
|
|
42
|
+
ref="tooltip"
|
|
43
|
+
class="cmd-tooltip-for-form-elements box"
|
|
44
|
+
:id="'tooltip-target-' + htmlId"
|
|
45
|
+
:scrollContainer="scrollContainerForTooltip"
|
|
46
|
+
:popoverTargetName="'tooltip-target-' + htmlId"
|
|
47
|
+
:validationStatus="validationStatus"
|
|
48
|
+
:role="validationStatus === 'error' ? 'alert' : 'dialog'"
|
|
49
|
+
:toggle-visibility-by-click="true"
|
|
50
|
+
:style="'position-anchor: --tooltip-anchor-' + htmlId"
|
|
51
|
+
>
|
|
52
|
+
|
|
53
|
+
<!-- begin CmdListOfRequirements -->
|
|
54
|
+
<CmdListOfRequirements
|
|
55
|
+
v-if="cmdListOfRequirementsProperties.showRequirements"
|
|
56
|
+
v-bind="cmdListOfRequirementsProperties"
|
|
57
|
+
/>
|
|
58
|
+
<!-- end CmdListOfRequirements -->
|
|
59
|
+
</CmdTooltip>
|
|
60
|
+
<!-- end CmdTooltip -->
|
|
61
|
+
</span>
|
|
62
|
+
<!-- end label -->
|
|
63
|
+
</template>
|
|
64
|
+
<ul :class="{'open': showOptions}" :aria-expanded="showOptions">
|
|
65
|
+
<li>
|
|
66
|
+
<!-- begin default/selected-option -->
|
|
67
|
+
<a href="#" @click.prevent="toggleOptions" @blur="onBlur" :title="optionIcon?.tooltip">
|
|
68
|
+
<!-- begin show flag -->
|
|
69
|
+
<img v-if="type === 'country' && optionCountry"
|
|
70
|
+
:src="pathFlag(optionCountry)"
|
|
71
|
+
:alt="optionCountry"
|
|
72
|
+
:class="['flag', optionCountry]"/>
|
|
73
|
+
<!-- end show flag -->
|
|
74
|
+
|
|
75
|
+
<!-- begin show color-box -->
|
|
76
|
+
<span v-else-if="type === 'color'" :style="'background: ' + optionColor"></span>
|
|
77
|
+
<!-- end show color-box -->
|
|
78
|
+
|
|
79
|
+
<!-- begin optional icon -->
|
|
80
|
+
<!-- begin CmdIcon -->
|
|
81
|
+
<CmdIcon v-if="optionIcon?.iconClass" :type="optionIcon?.iconType"
|
|
82
|
+
:iconClass="optionIcon?.iconClass"/>
|
|
83
|
+
<!-- end CmdIcon -->
|
|
84
|
+
<!-- end optional icon -->
|
|
85
|
+
|
|
86
|
+
<!-- begin text -->
|
|
87
|
+
<span v-if="optionName" class="option-name">{{ optionName }}</span>
|
|
88
|
+
<!-- end text -->
|
|
89
|
+
|
|
90
|
+
<!-- begin custom dropdown-icon -->
|
|
91
|
+
<!-- begin CmdIcon -->
|
|
92
|
+
<CmdIcon
|
|
93
|
+
v-if="iconDropdown"
|
|
94
|
+
:iconClass="iconDropdown.iconClass"
|
|
95
|
+
:type="iconDropdown.iconType"
|
|
96
|
+
:title="iconDropdown.tooltip"
|
|
97
|
+
/>
|
|
98
|
+
<!-- end CmdIcon -->
|
|
99
|
+
<!-- end custom dropdown-icon -->
|
|
100
|
+
</a>
|
|
101
|
+
<!-- end default/selected-option-->
|
|
102
|
+
|
|
103
|
+
<!-- begin default dropdown (incl. optional icon) -->
|
|
104
|
+
<ul v-if="type === 'default' && showOptions" role="listbox" :aria-labelledby="showLabel ? htmlId : null" :aria-required="$attrs.required !== undefined">
|
|
105
|
+
<li v-for="(option, index) in selectData" :key="index" role="option"
|
|
106
|
+
:aria-selected="option.value === modelValue">
|
|
107
|
+
<!-- begin type 'href' -->
|
|
108
|
+
<a v-if="optionLinkType === 'href'"
|
|
109
|
+
href="#" @click.prevent="selectOption(option.value)"
|
|
110
|
+
:class="{'active' : option.value === modelValue}"
|
|
111
|
+
:title="option.tooltip"
|
|
112
|
+
>
|
|
113
|
+
<!-- begin CmdIcon -->
|
|
114
|
+
<CmdIcon v-if="option.iconClass" :iconClass="option.iconClass" :type="option.iconType"/>
|
|
115
|
+
<!-- end CmdIcon -->
|
|
116
|
+
<span v-if="option.text">{{ option.text }}</span>
|
|
117
|
+
</a>
|
|
118
|
+
<!-- end type 'href' -->
|
|
119
|
+
|
|
120
|
+
<!-- begin type 'router' -->
|
|
121
|
+
<router-link v-if="optionLinkType === 'router'" to="#"
|
|
122
|
+
@click.prevent="selectOption(option.value)"
|
|
123
|
+
:class="{'active' : option.value === modelValue}">
|
|
124
|
+
<!-- begin CmdIcon -->
|
|
125
|
+
<CmdIcon v-if="option.iconClass" :iconClass="option.iconClass" :type="option.iconType"/>
|
|
126
|
+
<!-- end CmdIcon -->
|
|
127
|
+
<span>{{ option.text }}</span>
|
|
128
|
+
</router-link>
|
|
129
|
+
<!-- end type 'router' -->
|
|
130
|
+
</li>
|
|
131
|
+
</ul>
|
|
132
|
+
<!-- end default dropdown (incl. optional icon) -->
|
|
133
|
+
|
|
134
|
+
<!-- begin dropdown with checkboxes/countries/colors -->
|
|
135
|
+
<ul v-else-if="type !== 'default' && type !== 'content' && showOptions"
|
|
136
|
+
:class="{'checkbox-options': type === 'checkboxOptions'}" :aria-expanded="showOptions">
|
|
137
|
+
<li v-for="(option, index) in selectData" :key="index">
|
|
138
|
+
<!-- begin checkboxes -->
|
|
139
|
+
<label v-if="type === 'checkboxOptions'" :for="'option-' + (index + 1)"
|
|
140
|
+
:class="{'active' : modelValue.includes(`${option.value}`)}">
|
|
141
|
+
<input type="checkbox" :value="option.value" @change="optionSelect"
|
|
142
|
+
:checked="compareValues(option.value)" :id="'option-' + (index + 1)"/>
|
|
143
|
+
<span>{{ option.text }}</span>
|
|
144
|
+
</label>
|
|
145
|
+
<!-- end checkboxes -->
|
|
146
|
+
|
|
147
|
+
<!-- begin country-flags -->
|
|
148
|
+
<a v-else-if="type === 'country'" href="#"
|
|
149
|
+
@click.prevent="selectOption(option.value)"
|
|
150
|
+
:class="{'active' : option.value === modelValue}">
|
|
151
|
+
<img class="flag" :src="pathFlag(option.value)"
|
|
152
|
+
alt=""/>
|
|
153
|
+
<span>{{ option.text }}</span>
|
|
154
|
+
</a>
|
|
155
|
+
<!-- end country-flags -->
|
|
156
|
+
|
|
157
|
+
<!-- begin color-boxes -->
|
|
158
|
+
<a v-else-if="type === 'color'" href="#" @click.prevent="selectOption(option.value)"
|
|
159
|
+
:class="{'active' : option.value === modelValue}">
|
|
160
|
+
<span class="color" :style="'background: ' + option.value"></span>
|
|
161
|
+
<span>{{ option.text }}</span>
|
|
162
|
+
</a>
|
|
163
|
+
<!-- end color-boxes -->
|
|
164
|
+
</li>
|
|
165
|
+
|
|
166
|
+
<!-- begin (de)select all options -->
|
|
167
|
+
<li v-if="showSelectAllOptions && type === 'checkboxOptions'" class="select-all-options">
|
|
168
|
+
<a href="#" @click.prevent="toggleAllOptions">
|
|
169
|
+
<!-- begin CmdIcon -->
|
|
170
|
+
<CmdIcon v-if="!allOptionsSelected" :iconClass="iconSelectAllOptions.iconClass"
|
|
171
|
+
:type="iconSelectAllOptions.iconType"/>
|
|
172
|
+
<CmdIcon v-else :iconClass="iconDeselectAllOptions.iconClass"
|
|
173
|
+
:type="iconDeselectAllOptions.iconType"/>
|
|
174
|
+
<!-- end CmdIcon -->
|
|
175
|
+
<span>{{ selectAllOptionsText }}</span>
|
|
176
|
+
</a>
|
|
177
|
+
</li>
|
|
178
|
+
<!-- end (de)select all options -->
|
|
179
|
+
</ul>
|
|
180
|
+
<!-- end dropdown with checkboxes/countries/colors -->
|
|
181
|
+
|
|
182
|
+
<!-- begin dropdown with slot -->
|
|
183
|
+
<template v-else-if="type === 'content' && showOptions" :aria-expanded="showOptions">
|
|
184
|
+
<slot></slot>
|
|
185
|
+
</template>
|
|
186
|
+
<!-- end dropdown with slot -->
|
|
187
|
+
</li>
|
|
188
|
+
</ul>
|
|
189
|
+
</div>
|
|
190
|
+
<!-- end CmdFakeSelect ---------------------------------------------------------------------------------------- -->
|
|
191
|
+
</template>
|
|
192
|
+
|
|
193
|
+
<script>
|
|
194
|
+
// import mixins
|
|
195
|
+
import I18n from "../mixins/I18n"
|
|
196
|
+
import DefaultMessageProperties from "../mixins/CmdFakeSelect/DefaultMessageProperties"
|
|
197
|
+
import FieldValidation from "../mixins/FieldValidation"
|
|
198
|
+
import Identifier from "../mixins/Identifier"
|
|
199
|
+
import Tooltip from "../mixins/Tooltip"
|
|
200
|
+
import {createUuid} from "../utils/common.js"
|
|
201
|
+
|
|
202
|
+
export default {
|
|
203
|
+
name: 'CmdFakeSelect',
|
|
204
|
+
inheritAttrs: false,
|
|
205
|
+
mixins: [
|
|
206
|
+
I18n,
|
|
207
|
+
DefaultMessageProperties,
|
|
208
|
+
FieldValidation,
|
|
209
|
+
Identifier,
|
|
210
|
+
Tooltip
|
|
211
|
+
],
|
|
212
|
+
emits: ["validation-status-change", "update:modelValue"],
|
|
213
|
+
mounted() {
|
|
214
|
+
// close options if user clicks outside of the component
|
|
215
|
+
document.addEventListener("click", this.onClickOutside)
|
|
216
|
+
},
|
|
217
|
+
beforeUnmount() {
|
|
218
|
+
document.removeEventListener("click", this.onClickOutside)
|
|
219
|
+
},
|
|
220
|
+
data() {
|
|
221
|
+
return {
|
|
222
|
+
showOptions: false,
|
|
223
|
+
validationStatus: "",
|
|
224
|
+
allOptionsSelected: false
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
props: {
|
|
228
|
+
/**
|
|
229
|
+
* name for popover-target (will be set as id for popover and must correspond popovertarget-value of button that opens the popup)
|
|
230
|
+
*/
|
|
231
|
+
tooltipPopoverTargetName: {
|
|
232
|
+
type: String,
|
|
233
|
+
default: 'tooltip-target-' + createUuid()
|
|
234
|
+
},
|
|
235
|
+
/**
|
|
236
|
+
* specify a scroll-container which scrolling hides the tooltip
|
|
237
|
+
*/
|
|
238
|
+
scrollContainerForTooltip: {
|
|
239
|
+
type: String,
|
|
240
|
+
required: false
|
|
241
|
+
},
|
|
242
|
+
/**
|
|
243
|
+
* set different default selectbox-types for
|
|
244
|
+
*
|
|
245
|
+
* @allowedValues: default, color, country, content, checkboxOptions
|
|
246
|
+
*/
|
|
247
|
+
type: {
|
|
248
|
+
type: String,
|
|
249
|
+
default: "default",
|
|
250
|
+
validator(value) {
|
|
251
|
+
return value === "default" ||
|
|
252
|
+
value === "color" ||
|
|
253
|
+
value === "country" ||
|
|
254
|
+
value === "content" ||
|
|
255
|
+
value === "checkboxOptions"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
/**
|
|
259
|
+
* set type of option-links
|
|
260
|
+
*
|
|
261
|
+
* @allowedValues: href, router
|
|
262
|
+
*/
|
|
263
|
+
optionLinkType: {
|
|
264
|
+
type: String,
|
|
265
|
+
default: "href",
|
|
266
|
+
validator(value) {
|
|
267
|
+
return value === "href" ||
|
|
268
|
+
value === "router"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* set default v-model (must be named modelValue in Vue3)
|
|
273
|
+
*/
|
|
274
|
+
modelValue: {
|
|
275
|
+
type: [String, Number, Array],
|
|
276
|
+
default: ""
|
|
277
|
+
},
|
|
278
|
+
/**
|
|
279
|
+
* list of options to select (incl. displayed names and values)
|
|
280
|
+
*
|
|
281
|
+
* type-property must be set to "checkboxOptions"
|
|
282
|
+
*/
|
|
283
|
+
selectData: {
|
|
284
|
+
type: Array,
|
|
285
|
+
required: false
|
|
286
|
+
},
|
|
287
|
+
/**
|
|
288
|
+
* toggles option to (de)select all options in a checkbox-list
|
|
289
|
+
*
|
|
290
|
+
* type-property must be set to "checkboxOptions"
|
|
291
|
+
*/
|
|
292
|
+
showSelectAllOptions: {
|
|
293
|
+
type: Boolean,
|
|
294
|
+
default: true
|
|
295
|
+
},
|
|
296
|
+
/**
|
|
297
|
+
* status (i.e. for validation)
|
|
298
|
+
*
|
|
299
|
+
* @allowedValues: "" , error, warning, success, info
|
|
300
|
+
* @affectsStyling: true
|
|
301
|
+
*/
|
|
302
|
+
status: {
|
|
303
|
+
type: String,
|
|
304
|
+
required: false,
|
|
305
|
+
validator(value) {
|
|
306
|
+
return value === "" ||
|
|
307
|
+
value === "error" ||
|
|
308
|
+
value === "warning" ||
|
|
309
|
+
value === "success" ||
|
|
310
|
+
value === "info"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
/**
|
|
314
|
+
* icon for dropdown-icon (i.e. an angle/arrow)
|
|
315
|
+
*
|
|
316
|
+
* @requiredForAccessibility: partial
|
|
317
|
+
* @defaultIcon: icon-chevron-one-stripe-down
|
|
318
|
+
*/
|
|
319
|
+
iconDropdown: {
|
|
320
|
+
type: Object,
|
|
321
|
+
default() {
|
|
322
|
+
return {
|
|
323
|
+
iconClass: "icon-chevron-one-stripe-down",
|
|
324
|
+
tooltip: "Toggle dropdown visibility",
|
|
325
|
+
iconType: "auto"
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
/**
|
|
330
|
+
* label-text for fake-select
|
|
331
|
+
*
|
|
332
|
+
* @requiredForAccessibility: true
|
|
333
|
+
*/
|
|
334
|
+
labelText: {
|
|
335
|
+
type: String,
|
|
336
|
+
required: false
|
|
337
|
+
},
|
|
338
|
+
/**
|
|
339
|
+
* toggle label visibility
|
|
340
|
+
*/
|
|
341
|
+
showLabel: {
|
|
342
|
+
type: Boolean,
|
|
343
|
+
default: true
|
|
344
|
+
},
|
|
345
|
+
/**
|
|
346
|
+
* activate if interactive status-icon (to show requirements) should be shown inline with label
|
|
347
|
+
*/
|
|
348
|
+
showStatusIcon: {
|
|
349
|
+
type: Boolean,
|
|
350
|
+
default: false
|
|
351
|
+
},
|
|
352
|
+
/**
|
|
353
|
+
* path to flag-files (will be combined with flag isoCode to load svg)
|
|
354
|
+
*/
|
|
355
|
+
pathFlags: {
|
|
356
|
+
type: String,
|
|
357
|
+
default: "/media/images/flags"
|
|
358
|
+
},
|
|
359
|
+
/**
|
|
360
|
+
* limits drodpwon height of provided value (and lets contentscroll inside)
|
|
361
|
+
*
|
|
362
|
+
* @allowedValues: "none", "an< height in pixels/rem"
|
|
363
|
+
*/
|
|
364
|
+
dropdownMaxHeight: {
|
|
365
|
+
type: String,
|
|
366
|
+
default: "20rem"
|
|
367
|
+
},
|
|
368
|
+
/**
|
|
369
|
+
* default text if no option is selected (and first option is not used)
|
|
370
|
+
*/
|
|
371
|
+
textPleaseSelect: {
|
|
372
|
+
type: String,
|
|
373
|
+
default: "Please select\u2026"
|
|
374
|
+
},
|
|
375
|
+
/**
|
|
376
|
+
* set icon for "select all"-option
|
|
377
|
+
*/
|
|
378
|
+
iconSelectAllOptions: {
|
|
379
|
+
type: Object,
|
|
380
|
+
default() {
|
|
381
|
+
return {
|
|
382
|
+
iconClass: "icon-check",
|
|
383
|
+
iconType: "auto"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
/**
|
|
388
|
+
* set icon for "deselect all"-option
|
|
389
|
+
*/
|
|
390
|
+
iconDeselectAllOptions: {
|
|
391
|
+
type: Object,
|
|
392
|
+
default() {
|
|
393
|
+
return {
|
|
394
|
+
iconClass: "icon-cancel",
|
|
395
|
+
iconType: "auto"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
/**
|
|
400
|
+
* properties for CmdListOfRequirements-component
|
|
401
|
+
*/
|
|
402
|
+
cmdListOfRequirements: {
|
|
403
|
+
type: Object,
|
|
404
|
+
required: false
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
computed: {
|
|
408
|
+
cmdListOfRequirementsProperties() {
|
|
409
|
+
return {
|
|
410
|
+
showRequirements: true,
|
|
411
|
+
validationTooltip: "",
|
|
412
|
+
inputRequirements: [],
|
|
413
|
+
inputAttributes: {},
|
|
414
|
+
showHeadline: true,
|
|
415
|
+
inputModelValue: "",
|
|
416
|
+
helplink: {},
|
|
417
|
+
labelText: "",
|
|
418
|
+
...this.cmdListOfRequirements
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
validationTooltip() {
|
|
422
|
+
if (!this.useCustomTooltip) {
|
|
423
|
+
return this.getValidationMessage
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// set default-tooltip if customTooltip is not set
|
|
427
|
+
if (this.validationStatus === 'error') {
|
|
428
|
+
return this.getMessage("form_element.validation_tooltip.an_error_occurred")
|
|
429
|
+
} else if (this.validationStatus === 'success') {
|
|
430
|
+
return this.getMessage("form_element.validation_tooltip.information_is_filled_correctly")
|
|
431
|
+
}
|
|
432
|
+
return this.getMessage("form_element.validation_tooltip.open_field_requirements")
|
|
433
|
+
},
|
|
434
|
+
// get the displayed option name
|
|
435
|
+
optionName() {
|
|
436
|
+
// fake a native selectbox
|
|
437
|
+
if (this.type !== "checkboxOptions" && this.type !== "content" && this.modelValue) {
|
|
438
|
+
const result = this.selectData.find(option => option.value === this.modelValue)
|
|
439
|
+
|
|
440
|
+
// if find() returns some data, return this data
|
|
441
|
+
if (result) {
|
|
442
|
+
return result.text
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// selectbox with checkbox-options
|
|
447
|
+
else if (this.type === "checkboxOptions") {
|
|
448
|
+
if (this.modelValue.length === 1) {
|
|
449
|
+
return this.selectData.find(option => String(option.value) === String(this.modelValue[0]))?.text
|
|
450
|
+
} else if (this.modelValue.length > 1) {
|
|
451
|
+
return this.getMessage("fake_select.option.options_selected", this.modelValue.length)
|
|
452
|
+
}
|
|
453
|
+
} else if (this.selectData?.length) {
|
|
454
|
+
// return text of first option nothing is selected (and type !== checkboxOptions && type !== content)
|
|
455
|
+
return this.selectData[0].text
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// return default text if nothing is selected (and no modelValue exists) (and type !== checkboxOptions && type !== content)
|
|
459
|
+
return this.textPleaseSelect
|
|
460
|
+
},
|
|
461
|
+
// get the displayed icon (only available for default selectbox)
|
|
462
|
+
optionIcon() {
|
|
463
|
+
if (this.type === "default") {
|
|
464
|
+
const selectedOption = this.selectData.find(option => {
|
|
465
|
+
return option.value === this.modelValue
|
|
466
|
+
})
|
|
467
|
+
|
|
468
|
+
return {
|
|
469
|
+
iconClass: selectedOption?.iconClass,
|
|
470
|
+
tooltip: selectedOption?.tooltip
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
return null
|
|
474
|
+
},
|
|
475
|
+
optionCountry() {
|
|
476
|
+
if (this.type === "country") {
|
|
477
|
+
return this.modelValue || this.selectData?.[0]?.value
|
|
478
|
+
}
|
|
479
|
+
return null
|
|
480
|
+
},
|
|
481
|
+
optionColor() {
|
|
482
|
+
if (this.type === "color") {
|
|
483
|
+
return this.modelValue || this.selectData?.[0]?.value
|
|
484
|
+
}
|
|
485
|
+
return null
|
|
486
|
+
},
|
|
487
|
+
selectAllOptionsText() {
|
|
488
|
+
if (Array.isArray(this.modelValue) && this.modelValue.length === this.selectData.length) {
|
|
489
|
+
this.allOptionsSelected = true
|
|
490
|
+
return this.getMessage("fake_select.linktext.deselect_all_options")
|
|
491
|
+
}
|
|
492
|
+
this.allOptionsSelected = false
|
|
493
|
+
return this.getMessage("fake_select.linktext.select_all_options")
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
methods: {
|
|
497
|
+
toggleAllOptions() {
|
|
498
|
+
this.validationStatus = "success"
|
|
499
|
+
|
|
500
|
+
const checkboxValues = []
|
|
501
|
+
if (this.modelValue.length === this.selectData.length) {
|
|
502
|
+
if (this.$attrs.required) {
|
|
503
|
+
this.validationStatus = "error"
|
|
504
|
+
}
|
|
505
|
+
} else {
|
|
506
|
+
for (let i = 0; i < this.selectData.length; i++) {
|
|
507
|
+
checkboxValues.push(String(this.selectData[i].value))
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
this.$emit("update:modelValue", checkboxValues)
|
|
512
|
+
this.$emit("validation-status-change", this.validationStatus)
|
|
513
|
+
},
|
|
514
|
+
// toggle options/dropdown
|
|
515
|
+
toggleOptions() {
|
|
516
|
+
if (this.$attrs.disabled !== 'disabled') {
|
|
517
|
+
this.showOptions = !this.showOptions
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
// check if array of selected options includes number or string version of value
|
|
521
|
+
compareValues(option) {
|
|
522
|
+
return this.modelValue.some((item) => {
|
|
523
|
+
return item === option || item === String(option)
|
|
524
|
+
})
|
|
525
|
+
},
|
|
526
|
+
// check if an option is selected for default-selectbox
|
|
527
|
+
selectOption(optionValue) {
|
|
528
|
+
this.validationStatus = "success"
|
|
529
|
+
if (this.$attrs.required !== undefined) {
|
|
530
|
+
if (!optionValue) {
|
|
531
|
+
this.validationStatus = "error"
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// hide options after selection
|
|
536
|
+
this.showOptions = false
|
|
537
|
+
|
|
538
|
+
this.$emit("update:modelValue", optionValue)
|
|
539
|
+
this.$emit("validation-status-change", this.validationStatus)
|
|
540
|
+
},
|
|
541
|
+
// check if a checkbox is changed for selectbox with checkboxes
|
|
542
|
+
optionSelect(event) {
|
|
543
|
+
this.validationStatus = "success"
|
|
544
|
+
|
|
545
|
+
let value = [...this.modelValue] // copy array from props
|
|
546
|
+
if (event.target.checked) {
|
|
547
|
+
value.push(event.target.value) // attention: value will be transformed into string!
|
|
548
|
+
} else {
|
|
549
|
+
value = value.filter(item => item !== event.target.value && String(item) !== event.target.value)
|
|
550
|
+
}
|
|
551
|
+
if (this.$attrs.required !== undefined && !value.length) {
|
|
552
|
+
this.validationStatus = "error"
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
this.$emit("update:modelValue", value)
|
|
556
|
+
},
|
|
557
|
+
// hide options (in dropdown)
|
|
558
|
+
closeOptions() {
|
|
559
|
+
this.showOptions = false
|
|
560
|
+
},
|
|
561
|
+
onClickOutside(event) {
|
|
562
|
+
// use the ref (and not $el, which is a comment/text-node if the template starts with a comment), composedPath() is
|
|
563
|
+
// evaluated at dispatch-time (event.target could already be replaced by vue's re-rendering)
|
|
564
|
+
const root = this.$refs.fakeselect
|
|
565
|
+
if (this.showOptions && root && !event.composedPath().includes(root)) {
|
|
566
|
+
this.closeOptions()
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
// set path for flag-icons (type-property must be 'country')
|
|
570
|
+
pathFlag(isoCode) {
|
|
571
|
+
return this.pathFlags + "/flag-" + isoCode + ".svg"
|
|
572
|
+
},
|
|
573
|
+
// validate on blur
|
|
574
|
+
onBlur() {
|
|
575
|
+
this.validationStatus = "success"
|
|
576
|
+
|
|
577
|
+
if (this.$attrs.required !== undefined && (!this.modelValue || this.modelValue.length === 0)) {
|
|
578
|
+
this.validationStatus = "error"
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
this.$emit("validation-status-change", this.validationStatus)
|
|
582
|
+
},
|
|
583
|
+
// overwrite requirement-message form fieldValidation.js
|
|
584
|
+
getRequirementMessage() {
|
|
585
|
+
return this.getMessage("fake_select.headline.an_option_is_selected")
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
watch: {
|
|
589
|
+
status: {
|
|
590
|
+
handler() {
|
|
591
|
+
this.validationStatus = this.status
|
|
592
|
+
},
|
|
593
|
+
immediate: true
|
|
594
|
+
},
|
|
595
|
+
selectData: {
|
|
596
|
+
handler() {
|
|
597
|
+
// check if given value by modelValue exists (else pre-select first option)
|
|
598
|
+
if (this.type === "default" && this.selectData?.length && !this.selectData.some((option) => option.value === this.modelValue)) {
|
|
599
|
+
this.$emit("update:modelValue", this.selectData[0].value)
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
immediate: true,
|
|
603
|
+
deep: true
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
</script>
|
|
608
|
+
|
|
609
|
+
<style>
|
|
610
|
+
/* begin cmd-fake-select ------------------------------------------------------------------------------------------ */
|
|
611
|
+
.cmd-fake-select {
|
|
612
|
+
align-self: flex-end;
|
|
613
|
+
border-radius: var(--form-input-border-radius);
|
|
614
|
+
|
|
615
|
+
> span:first-child {
|
|
616
|
+
a {
|
|
617
|
+
align-self: flex-end;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
a {
|
|
622
|
+
span {
|
|
623
|
+
text-decoration: none !important;
|
|
624
|
+
|
|
625
|
+
&[class*="icon"]:last-child {
|
|
626
|
+
margin-left: auto !important; /* overwrite default settings from frontend-framework */
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
> ul {
|
|
632
|
+
height: var(--form-input-height);
|
|
633
|
+
margin: 0;
|
|
634
|
+
display: block;
|
|
635
|
+
min-width: 0;
|
|
636
|
+
box-shadow: none;
|
|
637
|
+
border-radius: var(--form-input-border-radius);
|
|
638
|
+
|
|
639
|
+
> li {
|
|
640
|
+
height: 100%;
|
|
641
|
+
border-radius: var(--form-input-border-radius);
|
|
642
|
+
|
|
643
|
+
&:first-child {
|
|
644
|
+
> a {
|
|
645
|
+
height: inherit;
|
|
646
|
+
border: var(--form-input-border);
|
|
647
|
+
background: var(--color-scheme-background);
|
|
648
|
+
color: var(--color-scheme-text-color);
|
|
649
|
+
border-radius: var(--default-border-radius);
|
|
650
|
+
box-shadow: var(--form-input-box-shadow);
|
|
651
|
+
|
|
652
|
+
img {
|
|
653
|
+
flex-shrink: 0;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
span, [class*="icon"] {
|
|
657
|
+
color: var(--color-scheme-text-color);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.option-name {
|
|
661
|
+
text-overflow: ellipsis;
|
|
662
|
+
overflow: hidden;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
> [class*="icon-"]:last-child {
|
|
666
|
+
margin-left: auto !important; /* overwrite default settings from frontend-framework */
|
|
667
|
+
font-size: var(--icon-size-small);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
&:hover, &:active, &:focus {
|
|
671
|
+
background: var(--color-scheme-background);
|
|
672
|
+
border-color: var(--hyperlink-color);
|
|
673
|
+
|
|
674
|
+
span, [class*="icon"] {
|
|
675
|
+
color: var(--hyperlink-color);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
ul {
|
|
682
|
+
max-height: v-bind(dropdownMaxHeight);
|
|
683
|
+
overflow-x: hidden;
|
|
684
|
+
overflow-y: auto;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
&.open {
|
|
689
|
+
border-bottom-left-radius: 0;
|
|
690
|
+
border-bottom-right-radius: 0;
|
|
691
|
+
|
|
692
|
+
> li:first-child {
|
|
693
|
+
a {
|
|
694
|
+
border-bottom-left-radius: 0;
|
|
695
|
+
border-bottom-right-radius: 0;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
ul {
|
|
700
|
+
border-bottom-left-radius: var(--border-radius-small);
|
|
701
|
+
border-bottom-right-radius: var(--border-radius-small);
|
|
702
|
+
|
|
703
|
+
> li {
|
|
704
|
+
&:first-child {
|
|
705
|
+
> a {
|
|
706
|
+
border-color: var(--hyperlink-color);
|
|
707
|
+
border-bottom-left-radius: 0;
|
|
708
|
+
border-bottom-right-radius: 0;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
> li:last-child {
|
|
714
|
+
border-bottom-left-radius: inherit;
|
|
715
|
+
border-bottom-right-radius: inherit;
|
|
716
|
+
|
|
717
|
+
> a {
|
|
718
|
+
border-bottom-left-radius: inherit;
|
|
719
|
+
border-bottom-right-radius: inherit;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
li {
|
|
727
|
+
margin-left: 0;
|
|
728
|
+
list-style: none;
|
|
729
|
+
|
|
730
|
+
a, a:visited {
|
|
731
|
+
display: flex;
|
|
732
|
+
align-items: center;
|
|
733
|
+
gap: var(--gap-small);
|
|
734
|
+
width: 100%;
|
|
735
|
+
padding: 1rem;
|
|
736
|
+
outline: none;
|
|
737
|
+
border-bottom: var(--default-border);
|
|
738
|
+
text-decoration: none;
|
|
739
|
+
|
|
740
|
+
&:hover, &:active, &:focus {
|
|
741
|
+
background: var(--hyperlink-color);
|
|
742
|
+
|
|
743
|
+
span, [class*="icon"] {
|
|
744
|
+
color: var(--hyperlink-color-contrast-text);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
span {
|
|
749
|
+
&:first-child, &:nth-child(2) {
|
|
750
|
+
border: 0;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
img {
|
|
755
|
+
box-shadow: none;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
&.active {
|
|
759
|
+
background: var(--color-light-gray);
|
|
760
|
+
|
|
761
|
+
span {
|
|
762
|
+
color: var(--hyperlink-color);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
&:hover, &:active, &:focus {
|
|
766
|
+
background: var(--hyperlink-color);
|
|
767
|
+
|
|
768
|
+
span, [class*="icon"] {
|
|
769
|
+
color: var(--hyperlink-color-contrast-text);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
label {
|
|
776
|
+
display: flex;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
span {
|
|
780
|
+
white-space: nowrap;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
ul {
|
|
784
|
+
position: absolute;
|
|
785
|
+
list-style: none;
|
|
786
|
+
z-index: 10;
|
|
787
|
+
min-width: 100%;
|
|
788
|
+
margin: 0;
|
|
789
|
+
border-bottom-right-radius: var(--default-border-radius);
|
|
790
|
+
border-bottom-left-radius: var(--default-border-radius);
|
|
791
|
+
background: var(--color-scheme-background);
|
|
792
|
+
border: var(--primary-border);
|
|
793
|
+
|
|
794
|
+
li {
|
|
795
|
+
&:last-child {
|
|
796
|
+
a {
|
|
797
|
+
border-bottom: 0;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
&.custom-fake-select-content {
|
|
803
|
+
padding: var(--default-padding);
|
|
804
|
+
|
|
805
|
+
img {
|
|
806
|
+
display: block;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
&.checkbox-options {
|
|
811
|
+
li {
|
|
812
|
+
padding: calc(var(--default-padding) / 2);
|
|
813
|
+
|
|
814
|
+
&.select-all-options {
|
|
815
|
+
border-top: var(--primary-border);
|
|
816
|
+
padding: 0;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/* use additional class in selector to gain high specificity */
|
|
824
|
+
&.has-state.label {
|
|
825
|
+
&.error * {
|
|
826
|
+
--status-color: var(--error-color-text);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
&.success * {
|
|
830
|
+
--status-color: var(--success-color-text);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
.label-text {
|
|
834
|
+
> span, [class*="icon-"] {
|
|
835
|
+
color: var(--status-color);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
> ul {
|
|
840
|
+
> li:first-child {
|
|
841
|
+
> a {
|
|
842
|
+
text-decoration: none !important;
|
|
843
|
+
border-color: var(--status-color);
|
|
844
|
+
padding-top: calc(var(--default-padding) - .06rem);
|
|
845
|
+
padding-right: calc(var(--default-padding) / 2);
|
|
846
|
+
padding-bottom: calc(var(--default-padding) - .06rem);
|
|
847
|
+
|
|
848
|
+
> span, [class*="icon-"] {
|
|
849
|
+
text-decoration: none !important;
|
|
850
|
+
color: var(--status-color);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
&:hover, &:active, &:focus {
|
|
854
|
+
background: var(--color-scheme-background);
|
|
855
|
+
|
|
856
|
+
span {
|
|
857
|
+
color: var(--status-color);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
&.error, &.disabled {
|
|
866
|
+
a {
|
|
867
|
+
&:hover, &:focus, &:active {
|
|
868
|
+
img {
|
|
869
|
+
&.flag {
|
|
870
|
+
border-color: var(--default-border-color);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
&.color {
|
|
878
|
+
li {
|
|
879
|
+
a {
|
|
880
|
+
gap: var(--gap-small);
|
|
881
|
+
|
|
882
|
+
> span:first-child {
|
|
883
|
+
width: 1.5rem;
|
|
884
|
+
aspect-ratio: 1/1;
|
|
885
|
+
border: var(--default-border);
|
|
886
|
+
|
|
887
|
+
&[style=""] {
|
|
888
|
+
display: none;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
</style>
|
|
896
|
+
|
|
897
|
+
<style lang="scss">
|
|
898
|
+
@mixin disabled-styles {
|
|
899
|
+
color: var(--disabled-color);
|
|
900
|
+
border-color: var(--disabled-color);
|
|
901
|
+
background: var(--disabled-background);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
.cmd-fake-select {
|
|
905
|
+
&.disabled {
|
|
906
|
+
> ul {
|
|
907
|
+
> li {
|
|
908
|
+
> a {
|
|
909
|
+
@include disabled-styles;
|
|
910
|
+
|
|
911
|
+
span {
|
|
912
|
+
color: var(--disabled-color);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
&:hover, &:active, &:focus {
|
|
916
|
+
cursor: not-allowed;
|
|
917
|
+
@include disabled-styles;
|
|
918
|
+
|
|
919
|
+
span {
|
|
920
|
+
color: var(--disabled-color);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/* end cmd-fake-select ------------------------------------------------------------------------------------------ */
|
|
930
|
+
</style>
|