comand-component-library 4.0.16 → 4.0.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -178,6 +178,8 @@ export default {
178
178
  <style>
179
179
  /* begin cmd-site-header ---------------------------------------------------------------------------------------- */
180
180
  .cmd-site-header {
181
+ --logo-width-on-scroll: 50%;
182
+
181
183
  grid-area: site-header;
182
184
  display: flex;
183
185
  flex-direction: column;
@@ -199,6 +201,7 @@ export default {
199
201
  transform-origin: top left;
200
202
  transition: var(--header-scroll-animation);
201
203
  margin: 0;
204
+ width: 100%;
202
205
  }
203
206
  }
204
207
  }
@@ -212,7 +215,7 @@ export default {
212
215
  figure {
213
216
  img {
214
217
  transition: var(--header-scroll-animation);
215
- height: 5rem;
218
+ width: var(--logo-width-on-scroll);
216
219
  }
217
220
  }
218
221
  }
@@ -223,12 +226,12 @@ export default {
223
226
  header, .cmd-main-navigation nav, .cmd-list-of-links {
224
227
  max-width: var(--max-width);
225
228
  width: 100%; /* stretch flex-item */
226
- margin: 0 auto;
227
229
  padding: 0 var(--default-padding);
228
230
  }
229
231
 
230
232
  .cmd-main-navigation nav {
231
233
  width: auto;
234
+ margin: 0 0 0 auto; /* align nav to right */
232
235
  }
233
236
 
234
237
  .top-header {
@@ -3,7 +3,7 @@
3
3
  @click.prevent
4
4
  :class="['cmd-slide-button', 'button', 'keep-behavior-on-small-devices', slideButtonType]"
5
5
  :title="getDirection.tooltip">
6
- <!-- being CmdIcon -->
6
+ <!-- begin CmdIcon -->
7
7
  <CmdIcon :iconClass="getDirection.iconClass || 'next'" />
8
8
  <!-- end CmdIcon -->
9
9
  </a>
@@ -19,9 +19,12 @@ export default {
19
19
  "basic_form.placeholder.zip": "Zip:",
20
20
  "basic_form.labeltext.city": "City:",
21
21
  "basic_form.placeholder.city": "City:",
22
- "basic_form.labeltext.additional_address_info": "Additional address information",
22
+ "basic_form.labeltext.pobox": "PO Box:",
23
+ "basic_form.placeholder.pobox": "PO Box:",
24
+ "basic_form.labeltext.country": "Country:",
25
+ "basic_form.labeltext.additional_address_info": "Additional address information:",
23
26
  "basic_form.placeholder.additional_address_info": "Additional address information",
24
- "basic_form.labeltext.additional_text": "Additional text",
27
+ "basic_form.labeltext.additional_text": "Additional text:",
25
28
  "basic_form.placeholder.additional_text": "Additional text",
26
29
  "basic_form.labeltext.data_privacy": "I accept handling and saving of my personal data a mentioned in the <a href='/content/data-privacy-en.html' class='fancybox'>private policy</a>."
27
30
  }
@@ -1,18 +1,23 @@
1
1
  <template>
2
2
  <div class="cmd-pages-basic-form">
3
- <!-- being CmdForm -->
4
- <CmdForm @submit="onSubmit"
5
- novalidate="novalidate"
6
- :textLegend="getMessage('basic_form.legend')"
7
- :submitButton="submitButton"
3
+ <!-- begin CmdHeadline -->
4
+ <CmdHeadline v-if="cmdHeadline" v-bind="cmdHeadline" />
5
+ <!-- end CmdHeadline -->
6
+
7
+ <!-- begin CmdForm -->
8
+ <CmdForm
9
+ @submit="onSubmit"
10
+ novalidate="novalidate"
11
+ :textLegend="getMessage('basic_form.legend')"
12
+ :submitButton="submitButton"
8
13
  >
9
- <div v-if="configuration.salutation" class="flex-container no-flex">
14
+ <div v-if="configuration.salutation" class="flex-container no-flex order-male-female">
10
15
  <!-- begin cmd-form-element -->
11
16
  <CmdFormElement
12
17
  element="input"
13
18
  type="radio"
14
19
  :labelText="getMessage('basic_form.labeltext.salutation_male')"
15
- :name="configuration.salutation?.name || salutation"
20
+ :name="configuration.salutation?.name || 'salutation'"
16
21
  inputValue="m"
17
22
  :replaceInputType="configuration.salutation?.replaceInputType"
18
23
  v-model="formData.salutation"
@@ -25,7 +30,7 @@
25
30
  element="input"
26
31
  type="radio"
27
32
  :labelText="getMessage('basic_form.labeltext.salutation_female')"
28
- :name="configuration.salutation?.name || salutation"
33
+ :name="configuration.salutation?.name || 'salutation'"
29
34
  inputValue="f"
30
35
  :replaceInputType="configuration.salutation?.replaceInputType"
31
36
  v-model="formData.salutation"
@@ -38,7 +43,7 @@
38
43
  <slot name="top"></slot>
39
44
  <!-- end slot (top) -->
40
45
 
41
- <div v-if="configuration.lastName || configuration.firstName" class="flex-container">
46
+ <div v-if="configuration.lastName || configuration.firstName" class="flex-container order-lastname-firstname">
42
47
  <!-- begin cmd-form-element -->
43
48
  <CmdFormElement
44
49
  v-if="configuration.lastName"
@@ -71,7 +76,7 @@
71
76
  />
72
77
  <!-- end cmd-form-element -->
73
78
  </div>
74
- <div v-if="configuration.email || configuration.phone" class="flex-container">
79
+ <div v-if="configuration.email || configuration.phone" class="flex-container order-phone-email">
75
80
  <!-- begin cmd-form-element -->
76
81
  <CmdFormElement
77
82
  v-if="configuration.email"
@@ -105,7 +110,22 @@
105
110
  <!-- end cmd-form-element -->
106
111
  </div>
107
112
 
108
- <div v-if="configuration.streetNo || configuration.zip || configuration.city" class="flex-container">
113
+ <div v-if="configuration.streetNo || configuration.streetNo || (configuration.zip && configuration.city)" class="flex-container">
114
+ <!-- begin cmd-form-element -->
115
+ <CmdFormElement
116
+ v-if="configuration.country"
117
+ element="select"
118
+ :labelText="getMessage('basic_form.labeltext.country')"
119
+ :selectOptions="configuration.country?.selectOptions"
120
+ :required="configuration.country?.required"
121
+ :name="configuration.country?.name || 'country'"
122
+ v-model="formData.country.value"
123
+ :status="formData.country.error ? 'error' : ''"
124
+ @validate="onValidate"
125
+ @change="onCountrySelect"
126
+ />
127
+ <!-- end cmd-form-element -->
128
+
109
129
  <!-- begin cmd-form-element -->
110
130
  <CmdFormElement
111
131
  v-if="configuration.streetNo"
@@ -121,11 +141,27 @@
121
141
  />
122
142
  <!-- end cmd-form-element -->
123
143
 
124
- <div class="input-wrapper">
144
+ <!-- begin cmd-form-element -->
145
+ <CmdFormElement
146
+ v-if="configuration.pobox"
147
+ element="input"
148
+ :type="configuration.pobox?.type || 'text'"
149
+ :labelText="getMessage('basic_form.labeltext.pobox')"
150
+ :placeholder="getMessage('basic_form.placeholder.pobox')"
151
+ :required="configuration.pobox?.required"
152
+ :name="configuration.pobox?.name || 'pobox'"
153
+ v-model="formData.pobox.value"
154
+ :status="formData.pobox.error ? 'error' : ''"
155
+ @validate="onValidate"
156
+ />
157
+ <!-- end cmd-form-element -->
158
+
159
+ <div class="input-wrapper" :class="showCityBeforeZip ? 'order-city-zip' : 'order-zip-city'">
125
160
  <!-- begin cmd-form-element -->
126
161
  <CmdFormElement
127
162
  v-if="configuration.zip"
128
163
  element="input"
164
+ class="input-zip"
129
165
  :type="configuration.zip?.type || 'number'"
130
166
  :labelText="getMessage('basic_form.labeltext.zip')"
131
167
  :placeholder="getMessage('basic_form.placeholder.zip')"
@@ -237,18 +273,13 @@ export default {
237
273
  streetNo: {value: ''},
238
274
  zip: {value: ''},
239
275
  city: {value: ''},
276
+ pobox: {value: ''},
277
+ country: {value: ''},
240
278
  additionalAddressInfo: {value: ''},
241
279
  additionalText: {value: ''},
242
280
  acceptPrivacy: {value: false}
243
281
  },
244
- nativeButton: {
245
- icon: {
246
- show: true,
247
- iconClass: "icon-message-send",
248
- tooltip: "Send message"
249
- },
250
- text: "Send"
251
- }
282
+ cityBeforeZip: this.showCityBeforeZip
252
283
  }
253
284
  },
254
285
  props: {
@@ -281,6 +312,24 @@ export default {
281
312
  required: false,
282
313
  type: "phone"
283
314
  },
315
+ country: {
316
+ required: false,
317
+ element: "select",
318
+ selectOptions: [
319
+ {
320
+ text: "Please select...",
321
+ value: ""
322
+ },
323
+ {
324
+ text: "United States",
325
+ value: "us"
326
+ },
327
+ {
328
+ text: "Germany",
329
+ value: "de"
330
+ },
331
+ ]
332
+ },
284
333
  streetNo: {
285
334
  required: false,
286
335
  type: "text"
@@ -308,6 +357,13 @@ export default {
308
357
  }
309
358
  }
310
359
  },
360
+ /**
361
+ * activate to show city first/left then zip next/right
362
+ */
363
+ showCityBeforeZip: {
364
+ type: Boolean,
365
+ default: false
366
+ },
311
367
  /**
312
368
  * receiver e-mail-address the form is sent to
313
369
  */
@@ -329,6 +385,18 @@ export default {
329
385
  primary: true
330
386
  }
331
387
  }
388
+ },
389
+ /**
390
+ * properties for CmdHeadline-component
391
+ */
392
+ cmdHeadline: {
393
+ type: Object,
394
+ default() {
395
+ return {
396
+ headlineText: "Basic Form",
397
+ headlineLevel: 3
398
+ }
399
+ }
332
400
  }
333
401
  },
334
402
  mounted() {
@@ -349,6 +417,13 @@ export default {
349
417
 
350
418
  event.preventDefault();
351
419
  },
420
+ onCountrySelect(event) {
421
+ alert("Country selected")
422
+ console.log("country selected", event)
423
+ if (event === 'us' || event === 'uk') {
424
+ this.cityBeforeZip = true
425
+ }
426
+ },
352
427
  onValidate() {
353
428
  this.formData = Object.assign({}, this.validator.validate(this.formData));
354
429
  },
@@ -361,6 +436,11 @@ export default {
361
436
  openDataPrivacy(url) {
362
437
  openFancyBox({url})
363
438
  }
439
+ },
440
+ watch: {
441
+ cityBeforeZip() {
442
+ this.cityBeforeZip = this.showCityBeforeZip
443
+ }
364
444
  }
365
445
  }
366
446
  </script>
@@ -369,6 +449,14 @@ export default {
369
449
  .cmd-pages-basic-form {
370
450
  fieldset {
371
451
  margin: 0;
452
+
453
+ .order-city-zip {
454
+ flex-direction: row-reverse;
455
+ }
456
+
457
+ .input-zip {
458
+ max-width: 30%;
459
+ }
372
460
  }
373
461
  }
374
462
  </style>