comand-component-library 3.1.73 → 3.1.76

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/dist/comand-component-library.css +1 -1
  2. package/dist/comand-component-library.umd.min.js +1 -1
  3. package/package.json +3 -3
  4. package/src/App.vue +112 -79
  5. package/src/assets/data/cookie-disclaimer.json +7 -6
  6. package/src/assets/data/input-group-radiobuttons.json +23 -0
  7. package/src/assets/data/input-group-replaced-radiobuttons.json +23 -0
  8. package/src/assets/data/input-group-toggle-switch-radiobuttons.json +23 -0
  9. package/src/assets/styles/global-styles.scss +20 -59
  10. package/src/components/CmdAddressData.vue +7 -7
  11. package/src/components/CmdBankAccountData.vue +7 -7
  12. package/src/components/CmdBox.vue +25 -31
  13. package/src/components/CmdBoxSiteSearch.vue +9 -9
  14. package/src/components/CmdCookieDisclaimer.vue +93 -25
  15. package/src/components/CmdFakeSelect.vue +36 -52
  16. package/src/components/CmdFormElement.vue +36 -57
  17. package/src/components/{CmdCustomHeadline.vue → CmdHeadline.vue} +1 -1
  18. package/src/components/CmdInputGroup.vue +156 -24
  19. package/src/components/CmdListOfLinks.vue +8 -8
  20. package/src/components/CmdListOfRequirements.vue +150 -0
  21. package/src/components/CmdLoginForm.vue +17 -17
  22. package/src/components/CmdMainNavigation.vue +2 -2
  23. package/src/components/CmdOpeningHours.vue +5 -5
  24. package/src/components/CmdSiteFooter.vue +76 -0
  25. package/src/components/CmdSiteHeader.vue +2 -1
  26. package/src/components/CmdSlideshow.vue +6 -6
  27. package/src/components/CmdSystemMessage.vue +28 -11
  28. package/src/components/CmdTabs.vue +8 -8
  29. package/src/components/CmdToggleDarkMode.vue +42 -5
  30. package/src/components/CmdTooltip.vue +13 -13
  31. package/src/components/CmdTooltipForInputElements.vue +122 -0
  32. package/src/components/CmdUploadForm.vue +32 -32
  33. package/src/components/CmdWidthLimitationWrapper.vue +0 -17
  34. package/src/documentation/generated/CmdAddressDataPropertyDescriptions.json +2 -2
  35. package/src/documentation/generated/CmdBankAccountDataPropertyDescriptions.json +2 -2
  36. package/src/documentation/generated/CmdBoxPropertyDescriptions.json +2 -2
  37. package/src/documentation/generated/CmdBoxSiteSearchPropertyDescriptions.json +2 -2
  38. package/src/documentation/generated/CmdCookieDisclaimerPropertyDescriptions.json +7 -2
  39. package/src/documentation/generated/CmdFormElementPropertyDescriptions.json +7 -2
  40. package/src/documentation/generated/CmdHeadlinePropertyDescriptions.json +22 -0
  41. package/src/documentation/generated/CmdInputGroupPropertyDescriptions.json +32 -1
  42. package/src/documentation/generated/CmdListOfLinksPropertyDescriptions.json +2 -2
  43. package/src/documentation/generated/CmdListOfRequirementsPropertyDescriptions.json +32 -0
  44. package/src/documentation/generated/CmdLoginFormPropertyDescriptions.json +4 -4
  45. package/src/documentation/generated/CmdOpeningHoursPropertyDescriptions.json +2 -2
  46. package/src/documentation/generated/CmdSiteFooterPropertyDescriptions.json +12 -0
  47. package/src/documentation/generated/CmdSystemMessagePropertyDescriptions.json +5 -0
  48. package/src/documentation/generated/CmdTabsPropertyDescriptions.json +2 -2
  49. package/src/documentation/generated/CmdTooltipForInputElementsPropertyDescriptions.json +42 -0
  50. package/src/documentation/generated/CmdTooltipPropertyDescriptions.json +1 -1
  51. package/src/documentation/generated/CmdUploadFormPropertyDescriptions.json +14 -14
  52. package/src/index.js +2 -1
  53. package/src/mixins/CmdCookieDisclaimer/DefaultMessageProperties.js +10 -0
  54. package/src/mixins/FieldValidation.js +16 -6
  55. package/src/mixins/Tooltip.js +1 -1
@@ -9,6 +9,7 @@
9
9
  disabled: $attrs.disabled
10
10
  }
11
11
  ]"
12
+ :title="$attrs.title"
12
13
  :aria-labelledby="labelId"
13
14
  :aria-required="$attrs.required !== undefined"
14
15
  ref="fakeselect"
@@ -17,6 +18,23 @@
17
18
  <!-- begin label -->
18
19
  <span class="label-text" :id="labelId">
19
20
  <span>{{ labelText }}<sup v-if="$attrs.required !== undefined">*</sup></span>
21
+
22
+ <!-- begin CmdTooltipForInputElements -->
23
+ <CmdTooltipForInputElements
24
+ v-if="useCustomTooltip && (validationStatus === '' || validationStatus === 'error')"
25
+ ref="tooltip"
26
+ :showRequirements="showRequirements"
27
+ :inputRequirements="inputRequirements"
28
+ :validationStatus="validationStatus"
29
+ :validationMessage="getValidationMessage"
30
+ :validationTooltip="validationTooltip"
31
+ :inputAttributes="$attrs"
32
+ :inputModelValue="modelValue"
33
+ :helplink="helplink"
34
+ :relatedId="tooltipId"
35
+ />
36
+ <!-- end CmdTooltipForInputElements -->
37
+
20
38
  <a v-if="$attrs.required || inputRequirements.length"
21
39
  href="#"
22
40
  @click.prevent
@@ -102,51 +120,6 @@
102
120
  </li>
103
121
  </ul>
104
122
  </div>
105
- <!-- begin CmdTooltip -->
106
- <CmdTooltip v-if="useCustomTooltip" class="box" :class="validationStatus" :relatedId="tooltipId" :toggle-visibility-by-click="true">
107
- <!-- begin CmdSystemMessage -->
108
- <CmdSystemMessage
109
- v-if="getValidationMessage"
110
- :message="getValidationMessage"
111
- :validationStatus="validationStatus"
112
- :iconClose="{show: false}"
113
- />
114
- <!-- end CmdSystemMessage -->
115
-
116
- <template v-if="showRequirements && (validationStatus === '' || validationStatus === 'error')">
117
- <!-- begin list of requirements -->
118
- <h6>{{ getMessage("cmdfakeselect.headline.requirements_for_input") }}<br/>"{{ labelText }}"</h6>
119
- <dl class="list-of-requirements">
120
- <template v-for="(requirement, index) in inputRequirements" :key="index">
121
- <dt aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">{{ requirement.message }}:</dt>
122
- <dd :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">
123
- <span aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'icon-check-circle' : 'icon-error-circle'"
124
- :title="requirement.valid(modelValue, $attrs) ? 'success' : 'error'"></span>
125
- </dd>
126
- </template>
127
- </dl>
128
- <!-- end list of requirements -->
129
-
130
- <!-- begin helplink -->
131
- <template v-if="helplink">
132
- <hr v-if="helplink.show"/>
133
- <a v-if="helplink.show && helplink.url"
134
- :href="helplink.url"
135
- :target="helplink.target"
136
- @click.prevent>
137
- <span v-if="helplink.icon?.iconClass"
138
- :class="helplink.icon?.iconClass"
139
- :title="helplink.icon?.tooltip">
140
- </span>
141
- <span v-if="helplink.text">
142
- {{ helplink.text }}
143
- </span>
144
- </a>
145
- </template>
146
- <!-- end helplink -->
147
- </template>
148
- </CmdTooltip>
149
- <!-- end CmdTooltip -->
150
123
  </template>
151
124
 
152
125
  <script>
@@ -155,13 +128,12 @@ import {createUuid} from "../utils/common.js"
155
128
 
156
129
  // import mixins
157
130
  import I18n from "../mixins/I18n"
158
- import DefaultMessageProperties from "../mixins/CmdBox/DefaultMessageProperties"
131
+ import DefaultMessageProperties from "../mixins/CmdFakeSelect/DefaultMessageProperties"
159
132
  import FieldValidation from "../mixins/FieldValidation.js"
160
133
  import Tooltip from "../mixins/Tooltip.js"
161
134
 
162
135
  // import components
163
- import CmdSystemMessage from "./CmdSystemMessage"
164
- import CmdTooltip from "./CmdTooltip"
136
+ import CmdTooltipForInputElements from "./CmdTooltipForInputElements"
165
137
 
166
138
  export default {
167
139
  name: 'CmdFakeSelect',
@@ -173,8 +145,7 @@ export default {
173
145
  Tooltip
174
146
  ],
175
147
  components: {
176
- CmdSystemMessage,
177
- CmdTooltip
148
+ CmdTooltipForInputElements
178
149
  },
179
150
  data() {
180
151
  return {
@@ -277,6 +248,19 @@ export default {
277
248
  }
278
249
  },
279
250
  computed: {
251
+ validationTooltip() {
252
+ if (!this.useCustomTooltip) {
253
+ return this.getValidationMessage
254
+ }
255
+
256
+ // set default-tooltip if customTooltip is not set
257
+ if (this.validationStatus === 'error') {
258
+ return this.getMessage("cmdformelement.validationTooltip.an_error_occurred")
259
+ } else if (this.validationStatus === 'success') {
260
+ return this.getMessage("cmdformelement.validationTooltip.information_is_filled_correctly")
261
+ }
262
+ return this.getMessage("cmdformelement.validationTooltip.open_field_requirements")
263
+ },
280
264
  // get the displayed option name
281
265
  optionName() {
282
266
  // fake a native selectbox
@@ -334,7 +318,7 @@ export default {
334
318
  },
335
319
  // get ID for accessibility
336
320
  labelId() {
337
- if(this.$attrs.id !== undefined) {
321
+ if (this.$attrs.id !== undefined) {
338
322
  return this.$attrs.id
339
323
  }
340
324
  return "label-" + createUuid()
@@ -577,7 +561,7 @@ export default {
577
561
  margin: 0;
578
562
  border-bottom-right-radius: var(--border-radius);
579
563
  border-bottom-left-radius: var(--border-radius);
580
- background: var(--pure-white);
564
+ background: var(--color-scheme-background-color);
581
565
  border: var(--primary-border);
582
566
 
583
567
  li {
@@ -13,8 +13,10 @@
13
13
  on: colored && isChecked,
14
14
  off: colored && !isChecked,
15
15
  'has-state': validationStatus
16
- }]"
16
+ }
17
+ ]"
17
18
  :for="labelId"
19
+ :title="$attrs.title"
18
20
  ref="label">
19
21
 
20
22
  <!-- begin label-text (+ required asterisk) -->
@@ -22,44 +24,21 @@
22
24
  :class="['label-text', !showLabel ? 'hidden' : undefined]">
23
25
  <span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
24
26
 
25
- <!-- begin CmdTooltip -->
26
- <CmdTooltip v-if="useCustomTooltip" class="box" :class="validationStatus" :relatedId="tooltipId" :toggle-visibility-by-click="true">
27
- <!-- begin CmdSystemMessage -->
28
- <CmdSystemMessage
29
- v-if="getValidationMessage"
30
- :message="getValidationMessage"
31
- :validation-status="validationStatus"
32
- :iconClose="{show: false}"
33
- />
34
- <!-- end CmdSystemMessage -->
35
-
36
- <template v-if="showRequirements && (validationStatus === '' || validationStatus === 'error')">
37
- <!-- begin list of requirements -->
38
- <h6>
39
- {{ getMessage("cmdformelement.headline.requirements_for_input") }}<br/>
40
- "{{ labelText }}"
41
- </h6>
42
- <dl class="list-of-requirements">
43
- <template v-for="(requirement, index) in inputRequirements" :key="index">
44
- <dt aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">{{ requirement.message }}:</dt>
45
- <dd :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">
46
- <span aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? iconHasStateSuccess.iconClass : iconHasStateError.iconClass"
47
- :title="requirement.valid(modelValue, $attrs) ? iconHasStateSuccess.tooltip : iconHasStateError.tooltip"></span>
48
- </dd>
49
- </template>
50
- </dl>
51
- <!-- end list of requirements -->
52
-
53
- <!-- begin helplink -->
54
- <hr v-if="helplink?.show"/>
55
- <a v-if="helplink?.show && helplink?.url" :href="helplink.url" :target="helplink.target" @click.prevent>
56
- <span v-if="helplink.icon?.iconClass" :class="helplink.icon?.iconClass" :title="helplink.icon?.tooltip"></span>
57
- <span v-if="helplink.text">{{ helplink.text }}</span>
58
- </a>
59
- <!-- end helplink -->
60
- </template>
61
- </CmdTooltip>
62
- <!-- end CmdTooltip -->
27
+ <!-- begin CmdTooltipForInputElements -->
28
+ <CmdTooltipForInputElements
29
+ v-if="useCustomTooltip && (validationStatus === '' || validationStatus === 'error')"
30
+ ref="tooltip"
31
+ :showRequirements="showRequirements"
32
+ :inputRequirements="inputRequirements"
33
+ :validationStatus="validationStatus"
34
+ :validationMessage="getValidationMessage"
35
+ :validationTooltip="validationTooltip"
36
+ :inputAttributes="$attrs"
37
+ :inputModelValue="modelValue"
38
+ :helplink="helplink"
39
+ :relatedId="tooltipId"
40
+ />
41
+ <!-- end CmdTooltipForInputElements -->
63
42
 
64
43
  <a v-if="$attrs.required || inputRequirements.length"
65
44
  href="#"
@@ -226,15 +205,13 @@ import FieldValidation from "../mixins/FieldValidation.js"
226
205
  import Tooltip from "../mixins/Tooltip.js"
227
206
 
228
207
  // import components
229
- import CmdSystemMessage from "./CmdSystemMessage"
230
- import CmdTooltip from "./CmdTooltip"
208
+ import CmdTooltipForInputElements from "./CmdTooltipForInputElements"
231
209
 
232
210
  export default {
233
211
  inheritAttrs: false,
234
212
  name: "FormElement",
235
213
  components: {
236
- CmdSystemMessage,
237
- CmdTooltip
214
+ CmdTooltipForInputElements
238
215
  },
239
216
  mixins: [
240
217
  I18n,
@@ -281,6 +258,8 @@ export default {
281
258
  },
282
259
  /**
283
260
  * text for label
261
+ *
262
+ * @requiredForAccessibility: true
284
263
  */
285
264
  labelText: {
286
265
  type: String,
@@ -425,7 +404,7 @@ export default {
425
404
  /**
426
405
  * set status for label and form-element
427
406
  *
428
- * @allowedValues: error, success
407
+ * @allowedValues: error, warning, success, info
429
408
  *
430
409
  * @affectsStyling: true
431
410
  */
@@ -715,12 +694,11 @@ export default {
715
694
  }
716
695
  return null
717
696
  },
718
- onBlur(event) {
697
+ validateInput(event) {
719
698
  // check if surrounding form with data-use-validation exists
720
699
  const useValidation = event.target.closest("form")?.dataset.useValidation === "true"
721
700
 
722
701
  if (useValidation) {
723
- this.tooltip = false
724
702
  this.validationStatus = ""
725
703
 
726
704
  // if input is filled, set status to success (expect for checkboxes and radiobuttons)
@@ -745,6 +723,14 @@ export default {
745
723
  }
746
724
  }
747
725
  },
726
+ onBlur(event) {
727
+ this.validateInput(event)
728
+ this.closeTooltipOnBlur()
729
+ },
730
+ onInput(event) {
731
+ this.validateInput(event)
732
+ this.$emit('update:modelValue', event.target.value)
733
+ },
748
734
  onChange(event) {
749
735
  if (typeof this.modelValue === "boolean") {
750
736
  this.$emit("update:modelValue", event.target.checked)
@@ -766,9 +752,6 @@ export default {
766
752
  this.$refs.label.focus()
767
753
  }
768
754
  },
769
- onInput(event) {
770
- this.$emit('update:modelValue', event.target.value)
771
- },
772
755
  showPassword() {
773
756
  // get password-field
774
757
  const passwordField = this.$refs.input
@@ -789,6 +772,10 @@ export default {
789
772
  },
790
773
  executeSearch() {
791
774
  this.$emit("search", this.value)
775
+ },
776
+ closeTooltipOnBlur() {
777
+ // close tooltip by calling function from CmdTooltipForInputElements using $refs
778
+ this.$refs.tooltip.hideTooltip()
792
779
  }
793
780
  },
794
781
  watch: {
@@ -810,14 +797,6 @@ export default {
810
797
  right: .5rem
811
798
  }
812
799
 
813
- .cmd-tooltip {
814
- position: absolute;
815
- right: 0;
816
- transform: translateY(calc(-100% - calc(var(--default-margin) / 2)));
817
- left: auto !important;
818
- top: 0 !important;
819
- }
820
-
821
800
  &.has-state, & + .cmd-tooltip {
822
801
  ::placeholder {
823
802
  color: var(--status-color);
@@ -15,7 +15,7 @@
15
15
 
16
16
  <script>
17
17
  export default {
18
- name: "CmdCustomHeadline",
18
+ name: "CmdHeadline",
19
19
  props: {
20
20
  /**
21
21
  * text for headline
@@ -1,18 +1,54 @@
1
1
  <template>
2
- <div :class="['cmd-input-group label', {inline: labelInline, 'multiple-switch': multipleSwitch, disabled: disabled}]">
2
+ <div :class="[
3
+ 'cmd-input-group label',
4
+ validationStatus,
5
+ {inline: labelInline,
6
+ 'multiple-switch': multipleSwitch,
7
+ disabled: disabled,
8
+ 'toggle-switch': toggleSwitch,
9
+ 'has-state': validationStatus
10
+ }
11
+ ]">
3
12
  <span :class="['label-text', { hidden: !showLabel}]" :id="labelId" :aria-labelledby="labelId">
4
- <span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
13
+ <span>{{ labelText }}<sup v-if="required">*</sup></span>
14
+
15
+ <!-- begin CmdTooltipForInputElements -->
16
+ <CmdTooltipForInputElements
17
+ v-if="useCustomTooltip && (validationStatus === '' || validationStatus === 'error')"
18
+ ref="tooltip"
19
+ :showRequirements="showRequirements"
20
+ :inputRequirements="inputRequirements"
21
+ :validationStatus="validationStatus"
22
+ :validationMessage="getValidationMessage"
23
+ :validationTooltip="validationTooltip"
24
+ :inputAttributes="$attrs"
25
+ :inputModelValue="modelValue"
26
+ :helplink="helplink"
27
+ :relatedId="tooltipId"
28
+ />
29
+ <!-- end CmdTooltipForInputElements -->
30
+
31
+ <a v-if="required || inputRequirements.length"
32
+ href="#"
33
+ @click.prevent
34
+ :class="getStatusIconClass"
35
+ :title="validationTooltip"
36
+ :aria-errormessage="getValidationMessage"
37
+ aria-live="assertive"
38
+ :id="tooltipId"
39
+ :role="validationStatus === 'error' ? 'alert' : 'dialog'">
40
+ </a>
5
41
  </span>
6
42
  <span v-if="!useSlot" :class="['flex-container', {'no-flex': !stretchHorizontally, 'no-gap': multipleSwitch}]">
7
43
  <label v-for="(inputElement, index) in inputElements" :key="index" :for="inputElement.id">
8
44
  <input
9
45
  :type="inputTypes"
10
- :id="inputElement.id"
11
- :name="inputElement.name"
12
- :value="inputElement.value"
13
- v-model="inputValue"
14
- :disabled="disabled"
15
- :class="{'replace-input-type': replaceInputType}"
46
+ :id="inputElement.id"
47
+ :name="inputElement.name"
48
+ :value="inputElement.value"
49
+ v-model="inputValue"
50
+ :disabled="disabled"
51
+ :class="{'replace-input-type': replaceInputType, 'toggle-switch': toggleSwitch}"
16
52
  />
17
53
  <span v-if="multipleSwitch && inputElement.iconClass" :class="inputElement.iconClass"></span>
18
54
  <span v-if="inputElement.labelText">{{ inputElement.labelText }}</span>
@@ -32,7 +68,21 @@
32
68
  <script>
33
69
  import {createUuid} from "../utils/common"
34
70
 
71
+ // import mixins
72
+ import FieldValidation from "../mixins/FieldValidation.js"
73
+ import Tooltip from "../mixins/Tooltip.js"
74
+
75
+ // import components
76
+ import CmdTooltipForInputElements from "./CmdTooltipForInputElements"
77
+
35
78
  export default {
79
+ components: {
80
+ CmdTooltipForInputElements
81
+ },
82
+ mixins: [
83
+ FieldValidation,
84
+ Tooltip
85
+ ],
36
86
  data() {
37
87
  return {
38
88
  value: ""
@@ -46,14 +96,21 @@ export default {
46
96
  type: [Array, String],
47
97
  required: false
48
98
  },
99
+ /**
100
+ * set if input-group should be required
101
+ */
102
+ required: {
103
+ type: Boolean,
104
+ default: false
105
+ },
49
106
  /**
50
107
  * list of input-elements inside group
51
108
  *
52
109
  * useSlot-property must be set to 'false'
53
110
  */
54
111
  inputElements: {
55
- type: Array,
56
- required: false
112
+ type: Array,
113
+ required: false
57
114
  },
58
115
  /**
59
116
  * set type for inputs in group
@@ -64,15 +121,39 @@ export default {
64
121
  type: String,
65
122
  default: "radio"
66
123
  },
124
+ /**
125
+ * set status for label and inner form-elements
126
+ *
127
+ * @allowedValues: error, warning, success, info
128
+ *
129
+ * @affectsStyling: true
130
+ */
131
+ status: {
132
+ type: String,
133
+ required: false
134
+ },
67
135
  /**
68
136
  * for replacing native checkboxes/radio-buttons by custom ones (based on frontend-framework)
69
137
  *
138
+ * toggleSwitch-property must be set to 'false'
139
+ *
70
140
  * @affectsStyling: true
71
141
  */
72
142
  replaceInputType: {
73
143
  type: Boolean,
74
144
  default: false
75
145
  },
146
+ /**
147
+ * for replacing native checkboxes/radio-buttons by toggle-switches (based on frontend-framework)
148
+ *
149
+ * replaceInputType-property must be set to 'false'
150
+ *
151
+ * @affectsStyling: true
152
+ */
153
+ toggleSwitch: {
154
+ type: Boolean,
155
+ default: false
156
+ },
76
157
  /**
77
158
  * activate if input-elements should be given by slot
78
159
  */
@@ -131,10 +212,36 @@ export default {
131
212
  default: false
132
213
  }
133
214
  },
215
+ methods: {
216
+ updateStatus() {
217
+ if (this.required) {
218
+ if(this.inputValue?.length) {
219
+ this.validationStatus = ""
220
+ return
221
+ }
222
+ this.validationStatus = "error"
223
+ return
224
+ }
225
+ this.validationStatus = this.status
226
+ }
227
+ },
134
228
  computed: {
229
+ validationTooltip() {
230
+ if (!this.useCustomTooltip) {
231
+ return this.getValidationMessage
232
+ }
233
+
234
+ // set default-tooltip if customTooltip is not set
235
+ if (this.validationStatus === 'error') {
236
+ return this.getMessage("cmdformelement.validationTooltip.an_error_occurred")
237
+ } else if (this.validationStatus === 'success') {
238
+ return this.getMessage("cmdformelement.validationTooltip.information_is_filled_correctly")
239
+ }
240
+ return this.getMessage("cmdformelement.validationTooltip.open_field_requirements")
241
+ },
135
242
  // get ID for accessibility
136
243
  labelId() {
137
- if(this.$attrs.id !== undefined) {
244
+ if (this.$attrs.id !== undefined) {
138
245
  return this.$attrs.id
139
246
  }
140
247
  return "label-" + createUuid()
@@ -150,19 +257,18 @@ export default {
150
257
  }
151
258
  }
152
259
  },
153
- methods: {
154
- onChange(e) {
155
- if (typeof this.value === "string") {
156
- this.$emit("update:value", e.target.value)
157
- } else if (this.value !== undefined) {
158
- let values = [...this.value]
159
- if (e.target.checked) {
160
- values.push(e.target.value)
161
- } else {
162
- values = values.filter(value => value !== e.target.value)
163
- }
164
- this.$emit("update:modelValue", values)
165
- }
260
+ watch: {
261
+ status: {
262
+ handler() {
263
+ this.updateStatus()
264
+ },
265
+ immediate: true
266
+ },
267
+ modelValue: {
268
+ handler() {
269
+ this.updateStatus()
270
+ },
271
+ immediate: true
166
272
  }
167
273
  }
168
274
  }
@@ -174,5 +280,31 @@ export default {
174
280
  display: flex;
175
281
  gap: var(--default-gap);
176
282
  }
283
+
284
+ /* overwrite default behavior from frontend-framework */
285
+ &.toggle-switch {
286
+ display: block;
287
+ }
288
+
289
+ /* overwrite default behavior from frontend-framework */
290
+ .label-text {
291
+ display: inline-flex;
292
+
293
+ > a[class*="icon"] {
294
+ margin-left: calc(var(--default-margin) / 2);
295
+ }
296
+ }
297
+
298
+ &.has-state {
299
+ label {
300
+ color: var(--status-color);
301
+ }
302
+
303
+ &.multiple-switch {
304
+ label {
305
+ border-color: var(--status-color);
306
+ }
307
+ }
308
+ }
177
309
  }
178
310
  </style>
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div :class="['cmd-list-of-links', 'align-' + align, {box: styleAsBox, horizontal: orientation === 'horizontal', 'section-anchors': sectionAnchors}]">
3
- <!-- begin CmdCustomHeadline -->
4
- <CmdCustomHeadline v-if="cmdCustomHeadline"
5
- v-bind="cmdCustomHeadline" />
6
- <!-- end CmdCustomHeadline -->
3
+ <!-- begin CmdHeadline -->
4
+ <CmdHeadline v-if="CmdHeadline"
5
+ v-bind="CmdHeadline" />
6
+ <!-- end CmdHeadline -->
7
7
 
8
8
  <!-- begin list of links -->
9
9
  <ul :class="['flex-container', {'no-gap': !useGap}]">
@@ -39,12 +39,12 @@ import {getRoute} from "../utilities.js"
39
39
  import {openFancyBox} from "./CmdFancyBox.vue"
40
40
 
41
41
  // import components
42
- import CmdCustomHeadline from "./CmdCustomHeadline"
42
+ import CmdHeadline from "./CmdHeadline"
43
43
 
44
44
  export default {
45
45
  name: "CmdListOfLinks",
46
46
  components: {
47
- CmdCustomHeadline
47
+ CmdHeadline
48
48
  },
49
49
  props: {
50
50
  /**
@@ -75,9 +75,9 @@ export default {
75
75
  default: "left"
76
76
  },
77
77
  /**
78
- * properties for cmdCustomHeadline-component
78
+ * properties for CmdHeadline-component
79
79
  */
80
- cmdCustomHeadline: {
80
+ CmdHeadline: {
81
81
  type: Object,
82
82
  required: false
83
83
  },