comand-component-library 3.1.24 → 3.1.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) 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 +1 -1
  4. package/src/App.vue +29 -7
  5. package/src/assets/data/accordion.json +13 -4
  6. package/src/assets/data/top-header-navigation.json +15 -9
  7. package/src/components/CmdAccordion.vue +68 -21
  8. package/src/components/CmdCookieDisclaimer.vue +3 -4
  9. package/src/components/CmdFakeSelect.vue +8 -1
  10. package/src/components/CmdFancyBox.vue +31 -1
  11. package/src/components/CmdFooterNavigation.vue +6 -0
  12. package/src/components/CmdFormElement.vue +72 -17
  13. package/src/components/CmdGoogleMaps.vue +3 -0
  14. package/src/components/CmdImageGallery.vue +3 -2
  15. package/src/components/CmdImageZoom.vue +6 -0
  16. package/src/components/CmdMainHeadline.vue +9 -0
  17. package/src/components/CmdMainNavigation.vue +24 -0
  18. package/src/components/CmdMultipleSwitch.vue +1 -5
  19. package/src/components/CmdMultistepFormProgressBar.vue +6 -0
  20. package/src/components/CmdOpeningHours.vue +23 -2
  21. package/src/components/CmdPager.vue +24 -2
  22. package/src/components/CmdProgressBar.vue +10 -4
  23. package/src/components/CmdShareButtons.vue +6 -0
  24. package/src/components/CmdSiteHeader.vue +12 -16
  25. package/src/components/CmdSlideButton.vue +3 -0
  26. package/src/components/CmdSlideshow.vue +25 -4
  27. package/src/components/CmdSwitchButton.vue +44 -1
  28. package/src/components/CmdSystemMessage.vue +32 -11
  29. package/src/components/CmdTable.vue +38 -20
  30. package/src/components/CmdTabs.vue +12 -3
  31. package/src/components/CmdThumbnailScroller.vue +28 -10
  32. package/src/components/CmdTooltip.vue +3 -0
  33. package/src/components/CmdTopHeaderNavigation.vue +10 -3
  34. package/src/components/CmdUploadForm.vue +26 -1
  35. package/src/components/CmdWidthLimitationWrapper.vue +26 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "3.1.24",
3
+ "version": "3.1.28",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -41,7 +41,6 @@
41
41
  <li><a href="#section-upload-form">Upload-Form</a></li>
42
42
  </ul>
43
43
  </div>
44
-
45
44
  <hr/>
46
45
  </CmdWidthLimitationWrapper>
47
46
 
@@ -49,11 +48,13 @@
49
48
  <CmdWidthLimitationWrapper>
50
49
  <h2 class="headline-demopage">Accordion</h2>
51
50
  <h3>Single mode (only one can be opened)</h3>
51
+ <a href="#" @click.prevent="toggleAllAccordions()">Toggle all accordions</a>
52
52
  <CmdAccordion :accordionData="accordionData.accordionData1"
53
53
  toggleMode="single"
54
54
  tooltip="Click to toggle content"
55
55
  openIconClass="icon-single-arrow-up"
56
56
  closeIconClass="icon-single-arrow-down"
57
+ ref="accordionGroup1"
57
58
  />
58
59
  <h3>Multiple mode (all can be opened)</h3>
59
60
  <CmdAccordion :accordionData="accordionData.accordionData2"
@@ -61,14 +62,16 @@
61
62
  tooltip="Click to toggle content"
62
63
  openIconClass="icon-single-arrow-up"
63
64
  closeIconClass="icon-single-arrow-down"
65
+ ref="accordionGroup2"
64
66
  />
65
- <h3>Customized headline-level</h3>
67
+ <h3>Customized headline-level (without transition of content)</h3>
66
68
  <CmdAccordion :accordionData="accordionData.accordionData2"
67
69
  toggleMode="multiple"
68
70
  tooltip="Click to toggle content"
69
71
  openIconClass="icon-single-arrow-up"
70
72
  closeIconClass="icon-single-arrow-down"
71
73
  accordion-headline-level="h4"
74
+ :use-transition="false"
72
75
  />
73
76
  <h3>Data given by slots</h3>
74
77
  <CmdAccordion :accordionData="1">
@@ -81,6 +84,16 @@
81
84
  </p>
82
85
  </template>
83
86
  </CmdAccordion>
87
+ <CmdAccordion :accordionData="1" :useCustomHeader="true">
88
+ <template v-slot:customHeadline0>
89
+ <h4>Some headline</h4>
90
+ </template>
91
+ <template v-slot:accordionContent0>
92
+ <p>
93
+ Content
94
+ </p>
95
+ </template>
96
+ </CmdAccordion>
84
97
  </CmdWidthLimitationWrapper>
85
98
 
86
99
  <!-- begin advanced form elements --------------------------------------------------------------------------------------------------------------------------------------------------->
@@ -124,6 +137,7 @@
124
137
  <CmdFormElement labelText="Input for selectbox:"
125
138
  element="select"
126
139
  :status="formElementStatus"
140
+ v-model:value="selectedOption"
127
141
  :selectOptions="selectOptions"
128
142
  />
129
143
  <CmdFormElement labelText="Input for datalist:"
@@ -409,6 +423,7 @@
409
423
  <CmdFormElement element="input"
410
424
  labelText="Label for replaced radiobutton"
411
425
  type="radio"
426
+ class="replace-input-type"
412
427
  id="inputfield13"
413
428
  name="replaced-radiogroup"
414
429
  inputValue="radiobuttonValue1"
@@ -417,6 +432,7 @@
417
432
  <CmdFormElement element="input"
418
433
  labelText="Label for replaced radiobutton"
419
434
  type="radio"
435
+ class="replace-input-type"
420
436
  id="inputfield14"
421
437
  name="replaced-radiogroup"
422
438
  inputValue="radiobuttonValue2"
@@ -647,9 +663,6 @@
647
663
  :items="pagerData.length"
648
664
  :itemsPerPage="1"
649
665
  @click="showPagePager = $event"
650
- :showLinksAsButtons="true"
651
- :prevButton="{'iconClass': 'icon-single-arrow-left', 'buttonText': 'prev' }"
652
- :nextButton="{'iconClass': 'icon-single-arrow-right', 'buttonText': 'next' }"
653
666
  />
654
667
  </CmdWidthLimitationWrapper>
655
668
 
@@ -872,6 +885,7 @@ export default {
872
885
 
873
886
  data() {
874
887
  return {
888
+ accordionGroupOpen: false,
875
889
  showPageMultistep: 1,
876
890
  showPagePager: 1,
877
891
  selectedOptions: [],
@@ -891,6 +905,7 @@ export default {
891
905
  multipleSwitchCheckbox: ['b'],
892
906
  multipleSwitchRadio: 'c',
893
907
  fancyBoxCookieDisclaimer: false,
908
+ selectedOption: "2",
894
909
  selectOptions: [
895
910
  {
896
911
  text: "Option 1",
@@ -898,8 +913,7 @@ export default {
898
913
  },
899
914
  {
900
915
  text: "Option 2",
901
- value: "2",
902
- selected: true
916
+ value: "2"
903
917
  },
904
918
  {
905
919
  text: "Option 3",
@@ -964,6 +978,14 @@ export default {
964
978
  },
965
979
  executeSearch() {
966
980
  return Math.floor(Math.random() * 100)
981
+ },
982
+ toggleAllAccordions() {
983
+ if(this.accordionGroupOpen) {
984
+ this.$refs.accordionGroup1.closeAll()
985
+ } else{
986
+ this.$refs.accordionGroup1.openAll()
987
+ }
988
+ this.accordionGroupOpen = !this.accordionGroupOpen
967
989
  }
968
990
  }
969
991
  }
@@ -2,19 +2,28 @@
2
2
  "accordionData1": [
3
3
  {
4
4
  "headline": "First",
5
- "iconClass": "icon-globe",
5
+ "icon": {
6
+ "iconClass": "icon-globe",
7
+ "tooltip": "Globe"
8
+ },
6
9
  "content": "Text 1",
7
10
  "status": false
8
11
  },
9
12
  {
10
13
  "headline": "Second",
11
- "iconClass": "icon-user-profile",
14
+ "icon": {
15
+ "iconClass": "icon-user-profile",
16
+ "tooltip": "User profile"
17
+ },
12
18
  "content": "Text 2",
13
- "status": false
19
+ "status": true
14
20
  },
15
21
  {
16
22
  "headline": "Third",
17
- "iconClass": "icon-home",
23
+ "icon": {
24
+ "iconClass": "icon-home",
25
+ "tooltip": "Home"
26
+ },
18
27
  "content": "Text 3",
19
28
  "status": false
20
29
  }
@@ -1,21 +1,27 @@
1
1
  [
2
2
  {
3
- "type": "href",
3
+ "linkType": "href",
4
4
  "path": "http://www.comand-cms.com",
5
5
  "target": "_blank",
6
- "iconClass": "icon-globe",
7
- "linkName": "CoManD-CMS"
6
+ "icon": {
7
+ "iconClass": "icon-globe",
8
+ "tooltip": "CoManD-CMS"
9
+ }
8
10
  },
9
11
  {
10
- "type": "href",
12
+ "linkType": "href",
11
13
  "path": "#anchor-section4",
12
- "iconClass": "icon-mail",
13
- "linkName": "Contact"
14
+ "icon": {
15
+ "iconClass": "icon-mail",
16
+ "tooltip": "Contact"
17
+ }
14
18
  },
15
19
  {
16
- "type": "href",
20
+ "linkType": "href",
17
21
  "path": "#anchor-section3",
18
- "iconClass": "icon-user-profile",
19
- "tooltip": "Login"
22
+ "icon": {
23
+ "iconClass": "icon-user-profile",
24
+ "tooltip": "Login"
25
+ }
20
26
  }
21
27
  ]
@@ -1,16 +1,20 @@
1
1
  <template>
2
2
  <div :class="['cmd-accordion flex-container vertical', {'no-gap' : !gapBetween, 'active' : active}]">
3
3
  <div v-for="(accordionContent, index) in accordion" :key="index">
4
- <a href="#" :title="tooltip" @click.prevent="toggleContentVisibility(accordionContent)">
4
+ <a v-if="!useCustomHeader" href="#" :title="accordionContent.status ? iconOpen.icon.tooltip : iconClosed.icon.tooltip" @click.prevent="toggleContentVisibility(accordionContent)">
5
5
  <slot :name="'accordionHeadline' + index">
6
6
  <component :is="accordionHeadlineLevel">
7
- <span v-if="accordionContent.iconClass" :class="accordionContent.iconClass"></span>
7
+ <span v-if="accordionContent.icon && accordionContent.icon.iconClass" :class="accordionContent.icon.iconClass" :title="accordionContent.icon.tooltip"></span>
8
8
  <span v-if="accordionContent.headline">{{ accordionContent.headline }}</span>
9
9
  </component>
10
10
  </slot>
11
+ <span class="toggle-icon" :class="[accordionContent.status ? iconOpen.icon.iconClass : iconClosed.icon.iconClass]"></span>
12
+ </a>
13
+ <a v-else href="#" :title="tooltip" @click.prevent="toggleContentVisibility(accordionContent)">
14
+ <slot :name="'customHeadline' + index"><p>{{ accordionContent.headline }}</p></slot>
11
15
  <span class="toggle-icon" :class="[accordionContent.status ? openIconClass : closeIconClass]"></span>
12
16
  </a>
13
- <transition name="fade">
17
+ <transition :name="toggleTransition">
14
18
  <div class="accordion-content" v-if="accordionContent.status" aria-expanded="true">
15
19
  <slot :name="'accordionContent' + index">
16
20
  <p>{{ accordionContent.content }}</p>
@@ -31,14 +35,29 @@ export default {
31
35
  }
32
36
  },
33
37
  props: {
38
+ /**
39
+ * use transition to expand accordion-content
40
+ */
41
+ useTransition: {
42
+ type: Boolean,
43
+ default: true
44
+ },
34
45
  /**
35
46
  * toggle if mode if only one accordion can be opened (or multiple ones)
47
+ *
36
48
  * values: single, multiple
37
49
  */
38
50
  toggleMode: {
39
51
  type: String,
40
52
  default: "single"
41
53
  },
54
+ /**
55
+ * activate if you want to use a customized header
56
+ */
57
+ useCustomHeader: {
58
+ type: Boolean,
59
+ default: false
60
+ },
42
61
  /**
43
62
  * set if a gap is shown between multiple accordions
44
63
  */
@@ -47,7 +66,7 @@ export default {
47
66
  default: true
48
67
  },
49
68
  /**
50
- * headlien for accordion-box that is also visible is accordion is collapsed
69
+ * headline for accordion-box that is also visible is accordion is collapsed
51
70
  */
52
71
  accordionHeadlineLevel: {
53
72
  type: String,
@@ -71,25 +90,37 @@ export default {
71
90
  required: true
72
91
  },
73
92
  /**
74
- * iconClass for icon to expand an accordion
75
- */
76
- openIconClass: {
77
- type: String,
78
- default: "icon-single-arrow-up"
79
- },
80
- /**
81
- * iconClass for icon to collapse an accordion
93
+ * icon to expand an accordion
82
94
  */
83
- closeIconClass: {
84
- type: String,
85
- default: "icon-single-arrow-down"
95
+ iconOpen: {
96
+ type: Object,
97
+ default: function() {
98
+ return {
99
+ icon: {
100
+ iconClass: "icon-single-arrow-up",
101
+ tooltip: "Close content"
102
+ }
103
+ }
104
+ },
86
105
  },
87
106
  /**
88
- * tooltip shown on hover for open/close-icon
107
+ * icon to collapse an accordion
89
108
  */
90
- tooltip: {
91
- type: String,
92
- required: false
109
+ iconClosed: {
110
+ type: Object,
111
+ default: function() {
112
+ return {
113
+ icon: {
114
+ iconClass: "icon-single-arrow-down",
115
+ tooltip: "Show content"
116
+ }
117
+ }
118
+ }
119
+ }
120
+ },
121
+ computed: {
122
+ toggleTransition() {
123
+ return this.useTransition && 'fade'
93
124
  }
94
125
  },
95
126
  methods: {
@@ -104,6 +135,22 @@ export default {
104
135
  }
105
136
  }
106
137
  }
138
+ },
139
+ /**
140
+ * method will be called from outside by $refs
141
+ */
142
+ openAll() {
143
+ for (let i = 0; i < this.accordion.length; i++) {
144
+ this.accordion[i].status = true;
145
+ }
146
+ },
147
+ /**
148
+ * method will be called from outside by $refs
149
+ */
150
+ closeAll() {
151
+ for (let i = 0; i < this.accordion.length; i++) {
152
+ this.accordion[i].status = false;
153
+ }
107
154
  }
108
155
  },
109
156
  watch: {
@@ -131,7 +178,7 @@ export default {
131
178
  margin-bottom: var(--default-margin);
132
179
 
133
180
  > div {
134
- > a {
181
+ > a, > div:first-child {
135
182
  display: flex;
136
183
  align-items: center;
137
184
  gap: var(--grid-gap);
@@ -172,7 +219,7 @@ export default {
172
219
  border-top: 0;
173
220
  }
174
221
 
175
- > span {
222
+ > span, > a {
176
223
  font-size: inherit;
177
224
 
178
225
  &[class*="icon-"] {
@@ -3,9 +3,8 @@
3
3
  <div class="cmd-cookie-disclaimer">
4
4
  <h2 v-if="headline">{{ headline }}</h2>
5
5
  <slot name="cookie-options">
6
- <div class="grid-container-two-fractions">
7
6
  <div v-if="cookieOptions.required">
8
- <h2>{{ cookieOptions.required.headline }}</h2>
7
+ <h3>{{ cookieOptions.required.headline }}</h3>
9
8
  <CmdAccordion :accordion-data="cookieOptions.required.cookies.length" :accordionData="2">
10
9
  <template v-for="(cookie, index) in cookieOptions.required.cookies"
11
10
  v-slot:[`accordionHeadline${index}`]
@@ -35,8 +34,9 @@
35
34
  </template>
36
35
  </CmdAccordion>
37
36
  </div>
37
+ <hr />
38
38
  <div v-if="cookieOptions.optional">
39
- <h2>{{ cookieOptions.optional.headline }}</h2>
39
+ <h3>{{ cookieOptions.optional.headline }}</h3>
40
40
  <CmdAccordion :accordion-data="cookieOptions.optional.cookies.length" :accordionData="2">
41
41
  <template v-for="(cookie, index) in cookieOptions.optional.cookies"
42
42
  v-slot:[`accordionHeadline${index}`]
@@ -62,7 +62,6 @@
62
62
  </template>
63
63
  </CmdAccordion>
64
64
  </div>
65
- </div>
66
65
  </slot>
67
66
  <slot name="privacy-text">
68
67
  </slot>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :class="[status, 'cmd-select label']">
3
- <span>Label for FakeSelect:</span>
3
+ <span>{{ labelText }}</span>
4
4
  <ul :class="{'open': showOptions}" @clickout="closeOptions">
5
5
  <li>
6
6
  <a href="#" @click.prevent="toggleOptions">
@@ -94,6 +94,13 @@ export default {
94
94
  dropdownIconClass: {
95
95
  type: String,
96
96
  default: "icon-single-arrow-down"
97
+ },
98
+ /**
99
+ * label-text for fake-select
100
+ */
101
+ labelText: {
102
+ type: String,
103
+ required: false
97
104
  }
98
105
  },
99
106
  methods: {
@@ -4,7 +4,7 @@
4
4
  aria-labelledby="fancybox">
5
5
  <div class="popup" :class="{'image' : fancyBoxImageUrl || fancyBoxGallery }">
6
6
  <div class="button-wrapper no-flex"
7
- v-if="((fancyboxOptions.printButtons && (fancyboxOptions.printButtons.color || fancyboxOptions.printButtons.grayscale))) || fancyboxOptions.closeIcon">
7
+ v-if="(fancyboxOptions.printButtons && (fancyboxOptions.printButtons.color || fancyboxOptions.printButtons.grayscale)) || fancyboxOptions.closeIcon">
8
8
  <a href="#"
9
9
  v-if="fancyboxOptions.printButtons && fancyboxOptions.printButtons.color"
10
10
  :class="['button', fancyboxOptions.printButtons.color.iconClass]"
@@ -69,10 +69,16 @@
69
69
  const FancyBox = defineComponent({
70
70
  name: "CmdFancyBox",
71
71
  props: {
72
+ /**
73
+ * set if content should be loaded by url
74
+ */
72
75
  url: {
73
76
  type: String,
74
77
  required: false
75
78
  },
79
+ /**
80
+ * options to show at top (closeIcon, printButtons)
81
+ */
76
82
  fancyboxOptions: {
77
83
  type: Object,
78
84
  default() {
@@ -94,34 +100,58 @@
94
100
  }
95
101
  }
96
102
  },
103
+ /**
104
+ * allow closing fancybox by escape-key
105
+ */
97
106
  allowEscapeKey: {
98
107
  type: Boolean,
99
108
  default: true
100
109
  },
110
+ /**
111
+ * the content shown in the main area
112
+ */
101
113
  content: {
102
114
  type: String,
103
115
  required: false
104
116
  },
117
+ /**
118
+ *
119
+ */
105
120
  elements: {
106
121
  type: Array,
107
122
  required: false
108
123
  },
124
+ /**
125
+ * use if a gallery of images should be opened (and navigated) inside fancybox
126
+ */
109
127
  fancyBoxGallery: {
110
128
  type: Array,
111
129
  required: false
112
130
  },
131
+ /**
132
+ * if gallery is used, you can set default index
133
+ */
113
134
  defaultGalleryIndex: {
114
135
  type: Number,
115
136
  required: false
116
137
  },
138
+ /**
139
+ * show/hide entire fancybox
140
+ */
117
141
  show: {
118
142
  type: Boolean,
119
143
  default: false
120
144
  },
145
+ /**
146
+ * show/hide overlay (around fancybox, above website)
147
+ */
121
148
  showOverlay: {
122
149
  type: Boolean,
123
150
  default: true
124
151
  },
152
+ /**
153
+ * show slide-buttons (left/previous and right/next)
154
+ */
125
155
  slideButtons: {
126
156
  type: Object,
127
157
  default() {
@@ -24,10 +24,16 @@ import {openFancyBox} from "./CmdFancyBox.vue"
24
24
  export default {
25
25
  name: "CmdFooterNavigation",
26
26
  props: {
27
+ /**
28
+ * headlien above links
29
+ */
27
30
  headline: {
28
31
  type: String,
29
32
  required: false
30
33
  },
34
+ /**
35
+ * list of links shown vertically
36
+ */
31
37
  footerNavigation: {
32
38
  type: Array,
33
39
  required: false