comand-component-library 4.1.5 → 4.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@
10
10
  novalidate="novalidate"
11
11
  v-bind="cmdForm"
12
12
  :legend="legend"
13
- :submitButton="submitButton"
13
+ :submitButton="submitButtonProperties"
14
14
  :formAction="formAction"
15
15
  >
16
16
  <div v-if="configuration.salutation" class="flex-container no-flex order-male-female">
@@ -23,6 +23,7 @@
23
23
  inputValue="m"
24
24
  :replaceInputType="configuration.salutation?.replaceInputType"
25
25
  v-model="formData.salutation.value"
26
+ :i18n="i18n"
26
27
  @validate="onValidate"
27
28
  />
28
29
  <!-- end cmd-form-element -->
@@ -36,6 +37,7 @@
36
37
  inputValue="f"
37
38
  :replaceInputType="configuration.salutation?.replaceInputType"
38
39
  v-model="formData.salutation.value"
40
+ :i18n="i18n"
39
41
  @validate="onValidate"
40
42
  />
41
43
  <!-- end cmd-form-element -->
@@ -58,6 +60,7 @@
58
60
  :placeholder="getMessage('basic_form.placeholder.last_name')"
59
61
  v-model="formData.lastName.value"
60
62
  :status="formData.lastName.error ? 'error' : ''"
63
+ :i18n="i18n"
61
64
  @validate="onValidate"
62
65
  />
63
66
  <!-- end cmd-form-element -->
@@ -74,6 +77,7 @@
74
77
  :name="configuration.firstName?.name || 'first-name'"
75
78
  v-model="formData.firstName.value"
76
79
  :status="formData.firstName.error ? 'error' : ''"
80
+ :i18n="i18n"
77
81
  @validate="onValidate"
78
82
  />
79
83
  <!-- end cmd-form-element -->
@@ -91,6 +95,7 @@
91
95
  :name="configuration.email?.name || 'email'"
92
96
  v-model="formData.email.value"
93
97
  :status="formData.email.error ? 'error' : ''"
98
+ :i18n="i18n"
94
99
  @validate="onValidate"
95
100
  />
96
101
  <!-- end cmd-form-element -->
@@ -107,6 +112,7 @@
107
112
  :required="configuration.phone?.required"
108
113
  :name="configuration.phone?.name || 'phone'"
109
114
  :status="formData.phone.error ? 'error' : ''"
115
+ :i18n="i18n"
110
116
  @validate="onValidate"
111
117
  />
112
118
  <!-- end cmd-form-element -->
@@ -123,6 +129,7 @@
123
129
  :name="configuration.country?.name || 'country'"
124
130
  v-model="formData.country.value"
125
131
  :status="formData.country.error ? 'error' : ''"
132
+ :i18n="i18n"
126
133
  @validate="onValidate"
127
134
  @update:modelValue="onCountrySelect"
128
135
  />
@@ -139,6 +146,7 @@
139
146
  :name="configuration.streetNo?.name || 'street-no'"
140
147
  v-model="formData.streetNo.value"
141
148
  :status="formData.streetNo.error ? 'error' : ''"
149
+ :i18n="i18n"
142
150
  @validate="onValidate"
143
151
  />
144
152
  <!-- end cmd-form-element -->
@@ -154,6 +162,7 @@
154
162
  :name="configuration.pobox?.name || 'pobox'"
155
163
  v-model="formData.pobox.value"
156
164
  :status="formData.pobox.error ? 'error' : ''"
165
+ :i18n="i18n"
157
166
  @validate="onValidate"
158
167
  />
159
168
  <!-- end cmd-form-element -->
@@ -171,6 +180,7 @@
171
180
  :name="configuration.zip?.name || 'zip'"
172
181
  v-model="formData.zip.value"
173
182
  :status="formData.zip.error ? 'error' : ''"
183
+ :i18n="i18n"
174
184
  @validate="onValidate"
175
185
  />
176
186
  <!-- end cmd-form-element -->
@@ -186,6 +196,7 @@
186
196
  :name="configuration.city?.name || 'city'"
187
197
  v-model="formData.city.value"
188
198
  :status="formData.city.error ? 'error' : ''"
199
+ :i18n="i18n"
189
200
  @validate="onValidate"
190
201
  />
191
202
  <!-- end cmd-form-element -->
@@ -202,6 +213,7 @@
202
213
  :name="configuration.additionalAddressInfo?.name || 'additional-address-info'"
203
214
  v-model="formData.additionalAddressInfo.value"
204
215
  :status="formData.additionalAddressInfo.error ? 'error' : ''"
216
+ :i18n="i18n"
205
217
  @validate="onValidate"
206
218
  />
207
219
  <!-- end cmd-form-element -->
@@ -216,9 +228,10 @@
216
228
  :required="configuration.userMessage?.required"
217
229
  :name="configuration.userMessage?.name || 'user-message'"
218
230
  :textCharactersLeft="getMessage('basic_form.text.characters_left')"
219
- :maxLength="configuration.userMessage?.maxLength"
231
+ :maxlength="configuration.userMessage?.maxLength"
220
232
  v-model="formData.userMessage.value"
221
233
  :status="formData.userMessage.error ? 'error' : ''"
234
+ :i18n="i18n"
222
235
  @validate="onValidate"
223
236
  />
224
237
  <!-- end cmd-form-element -->
@@ -237,6 +250,7 @@
237
250
  :replaceInputType="configuration.acceptPrivacy?.replaceInputType"
238
251
  v-model="formData.acceptPrivacy.value"
239
252
  :status="formData.acceptPrivacy.error ? 'error' : ''"
253
+ :i18n="i18n"
240
254
  @validate="onValidate">
241
255
  <template v-slot:labeltext>
242
256
  <span ref="dataPrivacy" v-html="getMessage('basic_form.labeltext.data_privacy')"></span>
@@ -252,7 +266,6 @@
252
266
  // import mixins
253
267
  import I18n from "../mixins/I18n.js"
254
268
  import DefaultMessageProperties from "../mixins/CmdBasicForm/DefaultMessageProperties.js"
255
- import FieldValidation from "../mixins/FieldValidation.js"
256
269
  import {ContactFormValidator} from "../utils/ContactFormValidation.js"
257
270
 
258
271
  import {openFancyBox} from "./CmdFancyBox.vue"
@@ -261,8 +274,7 @@ export default {
261
274
  emits: ["submit"],
262
275
  mixins: [
263
276
  I18n,
264
- DefaultMessageProperties,
265
- FieldValidation
277
+ DefaultMessageProperties
266
278
  ],
267
279
  inject: {
268
280
  editModeContext: {
@@ -413,27 +425,14 @@ export default {
413
425
  */
414
426
  submitButton: {
415
427
  type: Object,
416
- default() {
417
- return {
418
- iconClass: "icon-message-send",
419
- text: "Send mail",
420
- type: "submit",
421
- position: "belowFieldset",
422
- primary: true
423
- }
424
- }
428
+ required: false
425
429
  },
426
430
  /**
427
431
  * properties for CmdHeadline-component
428
432
  */
429
433
  cmdHeadline: {
430
434
  type: Object,
431
- default() {
432
- return {
433
- headlineText: "Basic Form",
434
- headlineLevel: 3
435
- }
436
- }
435
+ required: false
437
436
  },
438
437
  /**
439
438
  * properties for CmdForm-component
@@ -449,6 +448,18 @@ export default {
449
448
  openFancyBox({url: event.target.getAttribute("href")})
450
449
  })
451
450
  },
451
+ computed: {
452
+ submitButtonProperties() {
453
+ return {
454
+ iconClass: "icon-message-send",
455
+ text: "Send mail",
456
+ type: "submit",
457
+ position: "belowFieldset",
458
+ primary: true,
459
+ ...this.submitButton
460
+ }
461
+ }
462
+ },
452
463
  methods: {
453
464
  onSubmit(event) {
454
465
  this.onValidate()
@@ -359,11 +359,11 @@ export default {
359
359
 
360
360
  // set default-tooltip if customTooltip is not set
361
361
  if (this.validationStatus === 'error') {
362
- return this.getMessage("cmdformelement.validationTooltip.an_error_occurred")
362
+ return this.getMessage("cmdformelement.validation_tooltip.an_error_occurred")
363
363
  } else if (this.validationStatus === 'success') {
364
- return this.getMessage("cmdformelement.validationTooltip.information_is_filled_correctly")
364
+ return this.getMessage("cmdformelement.validation_tooltip.information_is_filled_correctly")
365
365
  }
366
- return this.getMessage("cmdformelement.validationTooltip.open_field_requirements")
366
+ return this.getMessage("cmdformelement.validation_tooltip.open_field_requirements")
367
367
  },
368
368
  // get the displayed option name
369
369
  optionName() {
@@ -759,7 +759,7 @@ export default {
759
759
  // check if field is type "email"
760
760
  if (this.$attrs.type === "email") {
761
761
  requirements.push({
762
- message: this.getMessage("cmdformelement.validationTooltip.is_valid_email"),
762
+ message: this.getMessage("cmdformelement.validation_tooltip.is_valid_email"),
763
763
  valid: () => this.$refs.input.checkValidity()
764
764
  })
765
765
  }
@@ -98,9 +98,9 @@
98
98
  <!-- begin default-view -->
99
99
  <!-- begin image with figure/figcaption -->
100
100
  <figure v-else-if="useFigureTag" :class="['cmd-image', textAlign]">
101
- <figcaption v-if="figcaption?.position === 'top' && figcaption?.text" v-html="figcaption?.text"/>
101
+ <figcaption v-if="figcaption?.position === 'top' && figcaption?.text && figcaption?.show" v-html="figcaption?.text"/>
102
102
  <img :src="imageSource" :alt="image?.alt" :title="image?.tooltip" @load="onImageLoaded"/>
103
- <figcaption v-if="figcaption?.position !== 'top' && figcaption?.text" v-html="figcaption?.text"/>
103
+ <figcaption v-if="figcaption?.position !== 'top' && figcaption?.text && figcaption?.show" v-html="figcaption?.text"/>
104
104
  </figure>
105
105
  <!-- end image with figure/figcaption -->
106
106
 
@@ -259,11 +259,11 @@ export default {
259
259
 
260
260
  // set default-tooltip if customTooltip is not set
261
261
  if (this.validationStatus === 'error') {
262
- return this.getMessage("cmdformelement.validationTooltip.an_error_occurred")
262
+ return this.getMessage("cmdformelement.validation_tooltip.an_error_occurred")
263
263
  } else if (this.validationStatus === 'success') {
264
- return this.getMessage("cmdformelement.validationTooltip.information_is_filled_correctly")
264
+ return this.getMessage("cmdformelement.validation_tooltip.information_is_filled_correctly")
265
265
  }
266
- return this.getMessage("cmdformelement.validationTooltip.open_field_requirements")
266
+ return this.getMessage("cmdformelement.validation_tooltip.open_field_requirements")
267
267
  },
268
268
  inputValue: {
269
269
  // read inputValue
@@ -16,6 +16,7 @@
16
16
  <button
17
17
  v-if="buttonPrintViewOptions?.show"
18
18
  :class="['button', {'primary': buttonPrintViewOptions.primary}]"
19
+ id="print-view-button"
19
20
  :title="buttonPrintViewOptions.text ? buttonPrintViewOptions.icon?.tooltip : null"
20
21
  @click="showFancyBox"
21
22
  >
@@ -150,15 +151,21 @@ export default {
150
151
  </style>
151
152
 
152
153
  <style lang="scss">
154
+ /* begin cmd-page-footer -------------------------------------------------------------------------------------------- */
153
155
  @import "../assets/styles/variables";
154
156
 
155
- @media only screen and (max-width: $small-max-width) {
157
+ @media only screen and (width <= $small-max-width) {
156
158
  .cmd-page-footer {
157
159
  align-items: flex-start;
158
160
 
159
161
  > .button-wrapper {
160
162
  margin-left: 0;
163
+
164
+ #print-view-button {
165
+ display: none;
166
+ }
161
167
  }
162
168
  }
163
169
  }
170
+ /* end cmd-page-footer -------------------------------------------------------------------------------------------- */
164
171
  </style>
@@ -9,8 +9,8 @@
9
9
 
10
10
  <!-- begin CmdListOfRequirements -->
11
11
  <CmdListOfRequirements
12
- v-if="cmdListOfRequirements.showRequirements"
13
- v-bind="cmdListOfRequirements"
12
+ v-if="cmdListOfRequirementsProperties.showRequirements"
13
+ v-bind="cmdListOfRequirementsProperties"
14
14
  />
15
15
  <!-- end CmdListOfRequirements -->
16
16
  </CmdTooltip>
@@ -51,17 +51,21 @@ export default {
51
51
  */
52
52
  cmdListOfRequirements: {
53
53
  type: Object,
54
- default() {
55
- return {
56
- showRequirements: true,
57
- validationTooltip: "",
58
- inputRequirements: [],
59
- inputAttributes: {},
60
- showHeadline: true,
61
- inputModelValue: "",
62
- helplink: {},
63
- labelText: ""
64
- }
54
+ required: false
55
+ }
56
+ },
57
+ computed: {
58
+ cmdListOfRequirementsProperties() {
59
+ return {
60
+ showRequirements: true,
61
+ validationTooltip: "",
62
+ inputRequirements: [],
63
+ inputAttributes: {},
64
+ showHeadline: true,
65
+ inputModelValue: "",
66
+ helplink: {},
67
+ labelText: "",
68
+ ...this.cmdListOfRequirements
65
69
  }
66
70
  }
67
71
  },
@@ -87,5 +91,6 @@ export default {
87
91
  }
88
92
  }
89
93
  }
94
+
90
95
  /* end cmd-tooltip-for-form-elements ---------------------------------------------------------------------------------------- */
91
96
  </style>
@@ -2,7 +2,6 @@ export default {
2
2
  data() {
3
3
  return {
4
4
  defaultMessageProperties: {
5
- "cmdformelement.headline.requirements_for_input": "Requirements for input",
6
5
  "cmdformelement.validation_tooltip.an_error_occurred": "An error occurred!",
7
6
  "cmdformelement.validation_tooltip.information_is_filled_correctly": "This information is filled correctly!",
8
7
  "cmdformelement.validation_tooltip.caps_lock_is_activated": "Attention: Caps lock is activated!",
@@ -161,19 +161,15 @@ export default {
161
161
  },
162
162
  computed: {
163
163
  listOfRequirements() {
164
- if (this.cmdListOfRequirements == null) {
165
- return {
166
- showRequirements: true,
167
- showHeadline: true,
168
- validationTooltip: this.validationTooltip,
169
- inputRequirements: this.inputRequirements,
170
- inputAttributes: this.$attrs,
171
- inputModelValue: this.modelValue,
172
- helplink: {},
173
- labelText: this.labelText
174
- }
164
+ return {
165
+ validationTooltip: this.validationTooltip,
166
+ inputRequirements: this.inputRequirements,
167
+ inputAttributes: this.$attrs,
168
+ inputModelValue: this.modelValue,
169
+ labelText: this.labelText,
170
+ i18n: this.i18n,
171
+ ...this.cmdListOfRequirements
175
172
  }
176
- return this.cmdListOfRequirements
177
173
  },
178
174
  getValidationMessage() {
179
175
  // check if all requirements are valid