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.
Files changed (61) hide show
  1. package/dist/comand-component-library.css +1 -1
  2. package/dist/comand-component-library.js +9587 -9482
  3. package/dist/styles/demopage-only.css +12 -2
  4. package/package.json +47 -46
  5. package/src/ComponentLibrary.vue +2697 -2688
  6. package/src/assets/data/component-structure.json +1 -1
  7. package/src/assets/data/form-elements.json +224 -224
  8. package/src/assets/data/social-networks-page-by-json.json +43 -43
  9. package/src/assets/styles/component-library-global-styles.scss +296 -295
  10. package/src/componentSettingsDataAndControls.vue +1 -18
  11. package/src/components/CmdAccordion.vue +1 -1
  12. package/src/components/CmdAddressData.vue +6 -1
  13. package/src/components/CmdAddressDataItem.vue +6 -1
  14. package/src/components/CmdBasicForm.vue +2 -2
  15. package/src/components/CmdBox.vue +1103 -1092
  16. package/src/components/CmdBoxWrapper.vue +7 -1
  17. package/src/components/CmdBreadcrumbs.vue +2 -2
  18. package/src/components/CmdCodeOutput.vue +1 -1
  19. package/src/components/CmdCookieDisclaimer.vue +480 -480
  20. package/src/components/CmdFakeSelect.vue +930 -916
  21. package/src/components/CmdFlexibleScrollContainer.vue +42 -42
  22. package/src/components/CmdForm.vue +481 -481
  23. package/src/components/CmdFormElement.vue +1110 -1091
  24. package/src/components/CmdFormFilters.vue +146 -146
  25. package/src/components/CmdGoogleMaps.vue +1 -1
  26. package/src/components/CmdHeadline.vue +21 -4
  27. package/src/components/CmdIcon.vue +8 -2
  28. package/src/components/CmdImage.vue +14 -16
  29. package/src/components/CmdImageZoom.vue +9 -8
  30. package/src/components/CmdInputGroup.vue +436 -435
  31. package/src/components/CmdLink.vue +1 -1
  32. package/src/components/CmdList.vue +1 -1
  33. package/src/components/CmdListOfRequirements.vue +192 -192
  34. package/src/components/CmdLoginForm.vue +618 -618
  35. package/src/components/CmdMailToolFilter.vue +217 -217
  36. package/src/components/CmdMainNavigation.vue +581 -572
  37. package/src/components/CmdMultistepFormProgressBar.vue +9 -9
  38. package/src/components/CmdNewsletterSubscription.vue +199 -199
  39. package/src/components/CmdPagination.vue +4 -2
  40. package/src/components/CmdParagraph.vue +10 -4
  41. package/src/components/CmdProgressBar.vue +72 -72
  42. package/src/components/CmdSiteHeader.vue +382 -389
  43. package/src/components/CmdSiteSearch.vue +420 -420
  44. package/src/components/CmdSiteWrapper.vue +12 -5
  45. package/src/components/CmdSlideshow.vue +519 -519
  46. package/src/components/CmdSmartSearch.vue +291 -291
  47. package/src/components/CmdSystemMessage.vue +3 -2
  48. package/src/components/CmdTable.vue +401 -401
  49. package/src/components/CmdTabs.vue +262 -262
  50. package/src/components/CmdTag.vue +1 -1
  51. package/src/components/CmdTextImageBlock.vue +8 -2
  52. package/src/components/CmdThumbnailScroller.vue +0 -7
  53. package/src/components/CmdToggleDarkMode.vue +13 -11
  54. package/src/components/CmdTooltip.vue +305 -301
  55. package/src/components/CmdUploadForm.vue +1299 -1305
  56. package/src/components/CmdWidthLimitationWrapper.vue +1 -1
  57. package/src/components/EditComponentWrapper.vue +5 -5
  58. package/src/index.js +5 -0
  59. package/src/main.js +4 -3
  60. package/src/utils/template.js +57 -0
  61. package/src/assets/styles/template.css +0 -1
@@ -1,436 +1,437 @@
1
- <template>
2
- <!-- begin CmdInputGroup ---------------------------------------------------------------------------------------- -->
3
- <div :class="[
4
- 'cmd-input-group label',
5
- required ? validationStatus : null,
6
- {
7
- 'has-state': validationStatus,
8
- inline: labelInline,
9
- 'multiple-switch': multipleSwitch,
10
- disabled: disableGroup,
11
- 'toggle-switches': toggleSwitches
12
- }
13
- ]"
14
- :aria-labelledby="htmlId">
15
-
16
- <!-- begin label -->
17
- <span v-show="showLabel" class="label-text">
18
- <span :id="htmlId">{{ labelText }}<sup v-if="required" aria-hidden="true">*</sup></span>
19
-
20
- <!-- begin status-icon (linked with tooltip) -->
21
- <button v-if="($attrs.required || inputRequirements.length) && showStatusIcon"
22
- type="button"
23
- class="no-style"
24
- :title="validationTooltip"
25
- :aria-errormessage="tooltipId"
26
- aria-live="assertive"
27
- :popovertarget="'tooltip-target-' + htmlId"
28
- :style="'anchor-name: --tooltip-anchor-' + htmlId"
29
- >
30
- <!-- begin CmdIcon -->
31
- <CmdIcon :iconClass="getStatusIconClass" />
32
- <!-- end CmdIcon -->
33
- </button>
34
- <!-- end status-icon (linked with tooltip) -->
35
-
36
- <!-- begin CmdTooltip -->
37
- <CmdTooltip
38
- ref="tooltip"
39
- :class="['cmd-tooltip-for-form-elements box', validationStatus]"
40
- :id="'tooltip-target-' + htmlId"
41
- :scrollContainer="scrollContainerForTooltip"
42
- :popoverTargetName="'tooltip-target-' + htmlId"
43
- :validationStatus="validationStatus"
44
- :role="validationStatus === 'error' ? 'alert' : 'dialog'"
45
- :toggle-visibility-by-click="true"
46
- :style="'position-anchor: --tooltip-anchor-' + htmlId"
47
- >
48
-
49
- <!-- begin CmdListOfRequirements -->
50
- <CmdListOfRequirements
51
- v-if="cmdListOfRequirementsProperties.showRequirements"
52
- v-bind="cmdListOfRequirementsProperties"
53
- />
54
- <!-- end CmdListOfRequirements -->
55
- </CmdTooltip>
56
- <!-- end CmdTooltip -->
57
- </span>
58
- <!-- end label -->
59
-
60
- <!-- begin view without slot -->
61
- <span v-if="!useSlot" :class="['flex-container', {'vertical': orientation === 'vertical','flex-items-flex-none': !stretchHorizontally, 'no-gap': multipleSwitch}]">
62
- <label v-for="(inputElement, index) in inputElements" :key="index" :for="inputElement.id" :class="{'toggle-switch': toggleSwitches, colored: colored}">
63
- <input
64
- :type="inputTypes"
65
- :id="inputElement.id"
66
- :name="inputElement.name"
67
- :value="inputElement.value"
68
- v-model="inputValue"
69
- :disabled="inputElement.disabled"
70
- :class="[inputElements.htmlClass, {'replace-input-type': replaceInputType}]"
71
- />
72
- <!-- begin CmdIcon -->
73
- <CmdIcon
74
- v-if="multipleSwitch && inputElement.iconClass"
75
- :iconClass="inputElement.iconClass"
76
- :type="inputElement.iconType"
77
- />
78
- <!-- end CmdIcon -->
79
- <span v-if="inputElement.labelText" class="label-text">{{ inputElement.labelText }}</span>
80
- </label>
81
- </span>
82
- <!-- end view without slot -->
83
-
84
- <!-- begin useSlot -->
85
- <div v-else class="flex-container flex-none">
86
- <!-- begin slot -->
87
- <slot></slot>
88
- <!-- end slot -->
89
- </div>
90
- <!-- end useSlot -->
91
- </div>
92
- <!-- end CmdInputGroup ---------------------------------------------------------------------------------------- -->
93
- </template>
94
-
95
- <script>
96
- // import mixins
97
- import FieldValidation from "../mixins/FieldValidation.js"
98
- import Identifier from "../mixins/Identifier"
99
- import Tooltip from "../mixins/Tooltip.js"
100
- import DefaultMessageProperties from "../mixins/CmdFormElement/DefaultMessageProperties"
101
-
102
- export default {
103
- mixins: [
104
- DefaultMessageProperties,
105
- FieldValidation,
106
- Identifier,
107
- Tooltip
108
- ],
109
- emits: ["validation-status-change", "update:modelValue"],
110
- props: {
111
- /**
112
- * set value for v-model (must be named modelValue in vue3 if default v-model should be used)
113
- */
114
- modelValue: {
115
- type: [Array, String],
116
- required: false
117
- },
118
- /**
119
- * specify a scroll-container which scrolling hides the tooltip
120
- */
121
- scrollContainerForTooltip: {
122
- type: String,
123
- required: false
124
- },
125
- /**
126
- * set orientation
127
- *
128
- * @allowedValues = horizontal, vertical
129
- */
130
- orientation: {
131
- type: String,
132
- default: 'horizontal',
133
- validator(value) {
134
- return value === "horizontal" ||
135
- value === "vertical"
136
- }
137
- },
138
- /**
139
- * set if input-group should be required
140
- */
141
- required: {
142
- type: Boolean,
143
- default: false
144
- },
145
- /**
146
- * activate if interactive status-icon (to show requirements) should be shown inline with label
147
- */
148
- showStatusIcon: {
149
- type: Boolean,
150
- default: false
151
- },
152
- /**
153
- * on/off-, yes/no-color-styling
154
- *
155
- * set to true, if checkbox/radio-buttons should have green/checked and red/unchecked color-coding
156
- * toggleSwitch-prop must be set to "true"
157
- * element-prop must be set to "input" and type-attribute must be set to "checkbox" or "radio"
158
- *
159
- * @affectsStyling: true
160
- */
161
- colored: {
162
- type: Boolean,
163
- required: false
164
- },
165
- /**
166
- * list of input-elements inside group
167
- *
168
- * useSlot-property must be set to 'false'
169
- */
170
- inputElements: {
171
- type: Array,
172
- required: false
173
- },
174
- /**
175
- * set type for inputs in group
176
- *
177
- * @allowedValues: checkbox, radio
178
- */
179
- inputTypes: {
180
- type: String,
181
- default: "radio",
182
- validator(value) {
183
- return value === "checkbox" ||
184
- value === "radio"
185
- }
186
- },
187
- /**
188
- * set status for label and inner form-elements
189
- *
190
- * @allowedValues: "", error, warning, success, info
191
- *
192
- * @affectsStyling: true
193
- */
194
- status: {
195
- type: String,
196
- required: false,
197
- validator(value) {
198
- return value === "" ||
199
- value === "error" ||
200
- value === "warning" ||
201
- value === "success" ||
202
- value === "info"
203
- }
204
- },
205
- /**
206
- * for replacing native checkboxes/radio-buttons by custom ones (based on frontend-framework)
207
- *
208
- * toggleSwitches-property must be set to 'false'
209
- *
210
- * @affectsStyling: true
211
- */
212
- replaceInputType: {
213
- type: Boolean,
214
- default: false
215
- },
216
- /**
217
- * for replacing native checkboxes/radio-buttons by toggle-switches (based on frontend-framework)
218
- *
219
- * replaceInputType-property must be set to 'false'
220
- *
221
- * @affectsStyling: true
222
- */
223
- toggleSwitches: {
224
- type: Boolean,
225
- default: false
226
- },
227
- /**
228
- * activate if input-elements should be given by slot
229
- */
230
- useSlot: {
231
- type: Boolean,
232
- default: false
233
- },
234
- /**
235
- * toggle multipleSwitch-styling
236
- *
237
- * @affectsStyling: true
238
- */
239
- multipleSwitch: {
240
- type: Boolean,
241
- default: false
242
- },
243
- /**
244
- * toggle label-text visibility
245
- */
246
- showLabel: {
247
- type: Boolean,
248
- default: true
249
- },
250
- /**
251
- * label-text for input-group
252
- *
253
- * @requiredForAccessibility: true
254
- */
255
- labelText: {
256
- type: String,
257
- required: true
258
- },
259
- /**
260
- * toggle label-position (inline/left of input-elements or above input-elements)
261
- */
262
- labelInline: {
263
- type: Boolean,
264
- default: false
265
- },
266
- /**
267
- * toggle if input-elements will be stretched horizontally
268
- *
269
- * @affectsStyling: true
270
- */
271
- stretchHorizontally: {
272
- type: Boolean,
273
- default: false
274
- },
275
- /**
276
- * define disabled-property to set disabled-style
277
- *
278
- * component cannot handle native disabled-attribute, because it is no native form-element
279
- */
280
- disableGroup: {
281
- type: Boolean,
282
- default: false
283
- },
284
- /**
285
- * properties for CmdListOfRequirements-component
286
- */
287
- cmdListOfRequirements: {
288
- type: Object,
289
- required: false
290
- }
291
- },
292
- methods: {
293
- updateStatus() {
294
- if (this.required) {
295
- if (this.inputValue?.length) {
296
- this.validationStatus = "success"
297
- return
298
- }
299
- this.validationStatus = "error"
300
- return
301
- }
302
- this.validationStatus = this.status
303
-
304
- this.$emit("validation-status-change", this.validationStatus)
305
- }
306
- },
307
- computed: {
308
- cmdListOfRequirementsProperties() {
309
- return {
310
- showRequirements: true,
311
- validationTooltip: "",
312
- inputRequirements: [],
313
- inputAttributes: {},
314
- showHeadline: true,
315
- inputModelValue: "",
316
- helplink: {},
317
- labelText: "",
318
- ...this.cmdListOfRequirements
319
- }
320
- },
321
- validationTooltip() {
322
- if (!this.useCustomTooltip) {
323
- return this.getValidationMessage
324
- }
325
-
326
- // set default-tooltip if customTooltip is not set
327
- if (this.validationStatus === 'error') {
328
- return this.getMessage("form_element.validation_tooltip.an_error_occurred")
329
- } else if (this.validationStatus === 'success') {
330
- return this.getMessage("form_element.validation_tooltip.information_is_filled_correctly")
331
- }
332
- return this.getMessage("form_element.validation_tooltip.open_field_requirements")
333
- },
334
- inputValue: {
335
- // read inputValue
336
- get() {
337
- return this.modelValue
338
- },
339
- // set/write a value to update v-model for this component
340
- set(value) {
341
- this.$emit("validation-status-change", this.validationStatus)
342
- this.$emit("update:modelValue", value)
343
- }
344
- }
345
- },
346
- watch: {
347
- status: {
348
- handler() {
349
- this.updateStatus()
350
- },
351
- immediate: true
352
- },
353
- modelValue: {
354
- handler() {
355
- this.updateStatus()
356
- },
357
- immediate: true
358
- }
359
- }
360
- }
361
- </script>
362
-
363
- <style>
364
- /* begin cmd-input-group ------------------------------------------------------------------------------------------ */
365
- .cmd-input-group {
366
- &.inline {
367
- display: flex;
368
- gap: var(--default-gap);
369
- }
370
-
371
- /* overwrite default behavior from frontend-framework */
372
- &.toggle-switch {
373
- display: block;
374
- }
375
-
376
- /* overwrite default behavior from frontend-framework */
377
- > .label-text {
378
- display: inline-flex;
379
-
380
- .flex-container {
381
- gap: 1rem 1.5rem; /* vertical, horizontal */
382
- }
383
-
384
- > span + a:has([class*="icon-"]) {
385
- margin-left: calc(var(--default-margin) / 2);
386
- }
387
-
388
- &:hover, &:active, &:focus {
389
- & + .flex-container {
390
- input {
391
- border-color: var(--default-border-color);
392
- }
393
- }
394
- }
395
- }
396
-
397
- &.has-state {
398
- input:checked ~ span {
399
- --status-color: var(--hyperlink-color);
400
- }
401
-
402
- .label-text span {
403
- color: var(--status-color);
404
- }
405
-
406
- &.error {
407
- --status-color: var(--error-color);
408
-
409
- /* labels for checkboxes and radiobuttons */
410
-
411
- }
412
-
413
-
414
- &.multiple-switch {
415
- &.error {
416
- --status-color: var(--error-color);
417
-
418
- label {
419
- border-color: var(--error-color);
420
-
421
- > * {
422
- color: var(--error-color);
423
- }
424
-
425
- &:is(:hover, :active, :focus) {
426
- > * {
427
- color: var(--hyperlink-color-highlighted);
428
- }
429
- }
430
- }
431
- }
432
- }
433
- }
434
- }
435
- /* end cmd-input-group ------------------------------------------------------------------------------------------ */
1
+ <template>
2
+ <!-- begin CmdInputGroup ---------------------------------------------------------------------------------------- -->
3
+ <div :class="[
4
+ 'cmd-input-group label',
5
+ {
6
+ 'has-state': validationStatus,
7
+ inline: labelInline,
8
+ 'multiple-switch': multipleSwitch,
9
+ disabled: disableGroup,
10
+ 'toggle-switches': toggleSwitches
11
+ }
12
+ ]" :aria-labelledby="htmlId">
13
+
14
+ <!-- begin label -->
15
+ <span v-show="showLabel" class="label-text">
16
+ <span :id="htmlId">{{ labelText }}<sup v-if="required" aria-hidden="true">*</sup></span>
17
+
18
+ <!-- begin status-icon (linked with tooltip) -->
19
+ <button v-if="($attrs.required || inputRequirements.length) && showStatusIcon" type="button"
20
+ class="no-style" :title="validationTooltip" :aria-errormessage="tooltipId" aria-live="assertive"
21
+ :popovertarget="'tooltip-target-' + htmlId" :style="'anchor-name: --tooltip-anchor-' + htmlId">
22
+ <!-- begin CmdIcon -->
23
+ <CmdIcon :iconClass="getStatusIconClass" />
24
+ <!-- end CmdIcon -->
25
+ </button>
26
+ <!-- end status-icon (linked with tooltip) -->
27
+
28
+ <!-- begin CmdTooltip -->
29
+ <CmdTooltip ref="tooltip" class="cmd-tooltip-for-form-elements box"
30
+ :id="'tooltip-target-' + htmlId" :scrollContainer="scrollContainerForTooltip"
31
+ :popoverTargetName="'tooltip-target-' + htmlId" :validationStatus="validationStatus"
32
+ :role="validationStatus === 'error' ? 'alert' : 'dialog'" :toggle-visibility-by-click="true"
33
+ :style="'position-anchor: --tooltip-anchor-' + htmlId">
34
+
35
+ <!-- begin CmdListOfRequirements -->
36
+ <CmdListOfRequirements v-if="cmdListOfRequirementsProperties.showRequirements"
37
+ v-bind="cmdListOfRequirementsProperties" />
38
+ <!-- end CmdListOfRequirements -->
39
+ </CmdTooltip>
40
+ <!-- end CmdTooltip -->
41
+ </span>
42
+ <!-- end label -->
43
+
44
+ <!-- begin view without slot -->
45
+ <span v-if="!useSlot" :class="['flex-container',
46
+ {
47
+ 'vertical': orientation === 'vertical',
48
+ 'no-gap': multipleSwitch,
49
+ 'switch-wrapper': multipleSwitch
50
+ },
51
+ stretchHorizontally ? 'stretch-horizontally' : 'flex-items-flex-none'
52
+ ]">
53
+ <CmdFormElement v-for="(inputElement, index) in inputElements" :type="inputTypes" :id="inputElement.id"
54
+ :name="inputElement.name" :value="inputElement.value" :disabled="inputElement.disabled"
55
+ :labelText="inputElement.labelText" :toggleSwitch="true" :colored="true" v-model="inputValue"
56
+ :key="index">
57
+ <template #labeltext>
58
+ <CmdIcon v-if="multipleSwitch && inputElement.iconClass" :iconClass="inputElement.iconClass"
59
+ :type="inputElement.iconType" />
60
+ <span v-if="inputElement.labelText" class="label-text">{{ inputElement.labelText }}</span>
61
+ </template>
62
+ </CmdFormElement>
63
+ </span>
64
+ <!-- end view without slot -->
65
+
66
+ <!-- begin useSlot -->
67
+ <div v-else class="flex-container flex-none">
68
+ <!-- begin slot -->
69
+ <slot></slot>
70
+ <!-- end slot -->
71
+ </div>
72
+ <!-- end useSlot -->
73
+ </div>
74
+ <!-- end CmdInputGroup ---------------------------------------------------------------------------------------- -->
75
+ </template>
76
+
77
+ <script>
78
+ // import mixins
79
+ import FieldValidation from "../mixins/FieldValidation.js"
80
+ import Identifier from "../mixins/Identifier"
81
+ import Tooltip from "../mixins/Tooltip.js"
82
+ import DefaultMessageProperties from "../mixins/CmdFormElement/DefaultMessageProperties"
83
+
84
+ export default {
85
+ mixins: [
86
+ DefaultMessageProperties,
87
+ FieldValidation,
88
+ Identifier,
89
+ Tooltip
90
+ ],
91
+ emits: ["validation-status-change", "update:modelValue"],
92
+ props: {
93
+ /**
94
+ * set value for v-model (must be named modelValue in vue3 if default v-model should be used)
95
+ */
96
+ modelValue: {
97
+ type: [Array, String],
98
+ required: false
99
+ },
100
+ /**
101
+ * specify a scroll-container which scrolling hides the tooltip
102
+ */
103
+ scrollContainerForTooltip: {
104
+ type: String,
105
+ required: false
106
+ },
107
+ /**
108
+ * set orientation
109
+ *
110
+ * @allowedValues = horizontal, vertical
111
+ */
112
+ orientation: {
113
+ type: String,
114
+ default: 'horizontal',
115
+ validator(value) {
116
+ return value === "horizontal" ||
117
+ value === "vertical"
118
+ }
119
+ },
120
+ /**
121
+ * set if input-group should be required
122
+ */
123
+ required: {
124
+ type: Boolean,
125
+ default: false
126
+ },
127
+ /**
128
+ * activate if interactive status-icon (to show requirements) should be shown inline with label
129
+ */
130
+ showStatusIcon: {
131
+ type: Boolean,
132
+ default: false
133
+ },
134
+ /**
135
+ * on/off-, yes/no-color-styling
136
+ *
137
+ * set to true, if checkbox/radio-buttons should have green/checked and red/unchecked color-coding
138
+ * toggleSwitch-prop must be set to "true"
139
+ * element-prop must be set to "input" and type-attribute must be set to "checkbox" or "radio"
140
+ *
141
+ * @affectsStyling: true
142
+ */
143
+ colored: {
144
+ type: Boolean,
145
+ required: false
146
+ },
147
+ /**
148
+ * list of input-elements inside group
149
+ *
150
+ * useSlot-property must be set to 'false'
151
+ */
152
+ inputElements: {
153
+ type: Array,
154
+ required: false
155
+ },
156
+ /**
157
+ * set type for inputs in group
158
+ *
159
+ * @allowedValues: checkbox, radio
160
+ */
161
+ inputTypes: {
162
+ type: String,
163
+ default: "radio",
164
+ validator(value) {
165
+ return value === "checkbox" ||
166
+ value === "radio"
167
+ }
168
+ },
169
+ /**
170
+ * set status for label and inner form-elements
171
+ *
172
+ * @allowedValues: "", error, warning, success, info
173
+ *
174
+ * @affectsStyling: true
175
+ */
176
+ status: {
177
+ type: String,
178
+ required: false,
179
+ validator(value) {
180
+ return value === "" ||
181
+ value === "error" ||
182
+ value === "warning" ||
183
+ value === "success" ||
184
+ value === "info"
185
+ }
186
+ },
187
+ /**
188
+ * for replacing native checkboxes/radio-buttons by custom ones (based on frontend-framework)
189
+ *
190
+ * toggleSwitches-property must be set to 'false'
191
+ *
192
+ * @affectsStyling: true
193
+ */
194
+ replaceInputType: {
195
+ type: Boolean,
196
+ default: false
197
+ },
198
+ /**
199
+ * for replacing native checkboxes/radio-buttons by toggle-switches (based on frontend-framework)
200
+ *
201
+ * replaceInputType-property must be set to 'false'
202
+ *
203
+ * @affectsStyling: true
204
+ */
205
+ toggleSwitches: {
206
+ type: Boolean,
207
+ default: false
208
+ },
209
+ /**
210
+ * activate if input-elements should be given by slot
211
+ */
212
+ useSlot: {
213
+ type: Boolean,
214
+ default: false
215
+ },
216
+ /**
217
+ * toggle multipleSwitch-styling
218
+ *
219
+ * @affectsStyling: true
220
+ */
221
+ multipleSwitch: {
222
+ type: Boolean,
223
+ default: false
224
+ },
225
+ /**
226
+ * toggle label-text visibility
227
+ */
228
+ showLabel: {
229
+ type: Boolean,
230
+ default: true
231
+ },
232
+ /**
233
+ * label-text for input-group
234
+ *
235
+ * @requiredForAccessibility: true
236
+ */
237
+ labelText: {
238
+ type: String,
239
+ required: true
240
+ },
241
+ /**
242
+ * toggle label-position (inline/left of input-elements or above input-elements)
243
+ */
244
+ labelInline: {
245
+ type: Boolean,
246
+ default: false
247
+ },
248
+ /**
249
+ * toggle if input-elements will be stretched horizontally
250
+ *
251
+ * @affectsStyling: true
252
+ */
253
+ stretchHorizontally: {
254
+ type: Boolean,
255
+ default: false
256
+ },
257
+ /**
258
+ * define disabled-property to set disabled-style
259
+ *
260
+ * component cannot handle native disabled-attribute, because it is no native form-element
261
+ */
262
+ disableGroup: {
263
+ type: Boolean,
264
+ default: false
265
+ },
266
+ /**
267
+ * properties for CmdListOfRequirements-component
268
+ */
269
+ cmdListOfRequirements: {
270
+ type: Object,
271
+ required: false
272
+ }
273
+ },
274
+ methods: {
275
+ updateStatus() {
276
+ if (this.required) {
277
+ if (this.inputValue?.length) {
278
+ this.validationStatus = "success"
279
+ return
280
+ }
281
+ this.validationStatus = "error"
282
+ return
283
+ }
284
+ this.validationStatus = this.status
285
+
286
+ this.$emit("validation-status-change", this.validationStatus)
287
+ }
288
+ },
289
+ computed: {
290
+ cmdListOfRequirementsProperties() {
291
+ return {
292
+ showRequirements: true,
293
+ validationTooltip: "",
294
+ inputRequirements: [],
295
+ inputAttributes: {},
296
+ showHeadline: true,
297
+ inputModelValue: "",
298
+ helplink: {},
299
+ labelText: "",
300
+ ...this.cmdListOfRequirements
301
+ }
302
+ },
303
+ validationTooltip() {
304
+ if (!this.useCustomTooltip) {
305
+ return this.getValidationMessage
306
+ }
307
+
308
+ // set default-tooltip if customTooltip is not set
309
+ if (this.validationStatus === 'error') {
310
+ return this.getMessage("form_element.validation_tooltip.an_error_occurred")
311
+ } else if (this.validationStatus === 'success') {
312
+ return this.getMessage("form_element.validation_tooltip.information_is_filled_correctly")
313
+ }
314
+ return this.getMessage("form_element.validation_tooltip.open_field_requirements")
315
+ },
316
+ inputValue: {
317
+ // read inputValue
318
+ get() {
319
+ return this.modelValue
320
+ },
321
+ // set/write a value to update v-model for this component
322
+ set(value) {
323
+ this.$emit("validation-status-change", this.validationStatus)
324
+ this.$emit("update:modelValue", value)
325
+ }
326
+ }
327
+ },
328
+ watch: {
329
+ status: {
330
+ handler() {
331
+ this.updateStatus()
332
+ },
333
+ immediate: true
334
+ },
335
+ modelValue: {
336
+ handler() {
337
+ this.updateStatus()
338
+ },
339
+ immediate: true
340
+ }
341
+ }
342
+ }
343
+ </script>
344
+
345
+ <style>
346
+ /* begin cmd-input-group ------------------------------------------------------------------------------------------ */
347
+ .cmd-input-group {
348
+ &.inline {
349
+ display: flex;
350
+ gap: var(--default-gap);
351
+ }
352
+
353
+ .stretch-horizontally {
354
+ align-self: normal;
355
+ }
356
+
357
+ /* overwrite default behavior from frontend-framework */
358
+ .toggle-switch {
359
+ display: block;
360
+
361
+ .label-text {
362
+ text-align: center;
363
+ display: inline-block;
364
+
365
+ [class*="icon-"] {
366
+ background: none;
367
+ }
368
+ }
369
+ }
370
+
371
+ /* overwrite default behavior from frontend-framework */
372
+ >.label-text {
373
+ display: inline-flex;
374
+
375
+ .flex-container {
376
+ gap: 1rem 1.5rem;
377
+ /* vertical, horizontal */
378
+ }
379
+
380
+ >span {
381
+ &+a:has([class*="icon-"]) {
382
+ margin-left: calc(var(--default-margin) / 2);
383
+ }
384
+
385
+ }
386
+
387
+ &:hover,
388
+ &:active,
389
+ &:focus {
390
+ &+.flex-container {
391
+ input {
392
+ border-color: var(--default-border-color);
393
+ }
394
+ }
395
+ }
396
+ }
397
+
398
+ &.has-state {
399
+ input:checked~span {
400
+ --status-color: var(--hyperlink-color);
401
+ }
402
+
403
+ .label-text span {
404
+ color: var(--status-color);
405
+ }
406
+
407
+ &.error {
408
+ --status-color: var(--error-color-text);
409
+
410
+ /* labels for checkboxes and radiobuttons */
411
+
412
+ }
413
+
414
+ &.multiple-switch {
415
+ &.error {
416
+ --status-color: var(--error-color-text);
417
+
418
+ label {
419
+ border-color: var(--error-color-text);
420
+
421
+ >* {
422
+ color: var(--error-color-text);
423
+ }
424
+
425
+ &:is(:hover, :active, :focus) {
426
+ >* {
427
+ color: var(--hyperlink-color-highlighted);
428
+ }
429
+ }
430
+ }
431
+ }
432
+ }
433
+ }
434
+ }
435
+
436
+ /* end cmd-input-group ------------------------------------------------------------------------------------------ */
436
437
  </style>