comand-component-library 3.1.25 → 3.1.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,22 +2,24 @@
2
2
  <div class="cmd-table-wrapper">
3
3
  <table :class="{'full-width': fullWidth}">
4
4
  <thead>
5
- <tr>
6
- <th v-for="tablehead in 10" :key="tablehead">Table head {{ tablehead }}</th>
7
- <th>Table head 11
8
- <a v-if="collapsible === true"
9
- href="#" @click.prevent="showTableData = !showTableData"
10
- :class="[showTableData ? closeIconClass : openIconClass]">
11
- </a>
12
- </th>
13
- </tr>
5
+ <tr>
6
+ <th v-for="tablehead in 10" :key="tablehead">Table head {{ tablehead }}</th>
7
+ <th>Table head 11
8
+ <a v-if="collapsible"
9
+ href="#" @click.prevent="showTableData = !showTableData"
10
+ :class="showTableData ? iconCollapse.iconClass : iconExpand.iconClass"
11
+ :title="showTableData ? iconExpand.tooltip : iconCollapse.tooltip"
12
+ >
13
+ </a>
14
+ </th>
15
+ </tr>
14
16
  </thead>
15
17
  <transition name="fade">
16
- <tbody v-show="showTableData === true">
17
- <tr v-for="tablerows in 10" :key="tablerows">
18
- <td v-for="tabledata in 10" :key="tabledata">Table data {{ tabledata + 1 }}</td>
19
- <td>Table data 11</td>
20
- </tr>
18
+ <tbody v-show="showTableData" aria-expanded="true">
19
+ <tr v-for="tablerows in 10" :key="tablerows">
20
+ <td v-for="tabledata in 10" :key="tabledata">Table data {{ tabledata + 1 }}</td>
21
+ <td>Table data 11</td>
22
+ </tr>
21
23
  </tbody>
22
24
  </transition>
23
25
  </table>
@@ -33,21 +35,37 @@ export default {
33
35
  }
34
36
  },
35
37
  props: {
38
+ /**
39
+ * activate if table should be collapsible
40
+ */
36
41
  collapsible: {
37
42
  type: Boolean,
38
43
  default: false
39
44
  },
45
+ /**
46
+ * activate if table should be stretched to full width of its parent-container (else table will be as wide as its content)
47
+ */
40
48
  fullWidth: {
41
49
  type: Boolean,
42
50
  default: false
43
51
  },
44
- openIconClass: {
45
- type: String,
46
- required: true
52
+ iconExpand: {
53
+ type: Object,
54
+ default: function() {
55
+ return {
56
+ iconClass: "icon-single-arrow-down",
57
+ tooltip: "Expand table"
58
+ }
59
+ }
47
60
  },
48
- closeIconClass: {
49
- type: String,
50
- required: true
61
+ iconCollapse: {
62
+ type: Object,
63
+ default: function() {
64
+ return {
65
+ iconClass: "icon-single-arrow-up",
66
+ tooltip: "Collapse table"
67
+ }
68
+ }
51
69
  }
52
70
  }
53
71
  }
@@ -8,7 +8,7 @@
8
8
  </a>
9
9
  </li>
10
10
  </ul>
11
- <template v-if="useComponent">
11
+ <template v-if="useSlot">
12
12
  <div v-show="showTab === index" v-for="(tab, index) in tabs" :key="index" aria-live="assertive">
13
13
  <slot :name="'tab-content-' + index"></slot>
14
14
  </div>
@@ -29,15 +29,24 @@ export default {
29
29
  }
30
30
  },
31
31
  props: {
32
+ /**
33
+ * activate if tabs should be (equally) stretched horizontally over full width of tab-content
34
+ */
32
35
  stretchTabs: {
33
36
  type: Boolean,
34
37
  default: false
35
38
  },
39
+ /**
40
+ * list of tabs (incl. tab-name and tab-content (optional))
41
+ */
36
42
  tabs: {
37
43
  type: Array,
38
- required: true,
44
+ required: true
39
45
  },
40
- useComponent: {
46
+ /**
47
+ * activate if content should be given by slot
48
+ */
49
+ useSlot: {
41
50
  type: Boolean,
42
51
  default: false
43
52
  }
@@ -1,17 +1,18 @@
1
1
  <template>
2
2
  <div :class="['cmd-thumbnail-scroller', {'gallery-scroller' : !allowOpenFancyBox}]">
3
- <CmdSlideButton @click.prevent="showPrevItem" :slideButtonType="slideButtons.previous"/>
3
+ <CmdSlideButton @click.prevent="showPrevItem" :slideButtons="cmdSlideButtons.prev"/>
4
4
  <transition-group name="slide" tag="ul">
5
5
  <li v-for="(image, index) in thumbnails" :key="image.imgId" :class="{'active' : imgIndex === index}">
6
6
  <a href="#" @click.prevent="showFancyBox(index)">
7
7
  <figure>
8
+ <figcaption v-if="figcaption.show && figcaption.position === 'above-image' && image.figcaption.length">{{ image.figcaption }}</figcaption>
8
9
  <img :src="image.srcImageSmall" :alt="image.alt"/>
9
- <figcaption v-if="showFigcaption">{{ image.figcaption }}</figcaption>
10
+ <figcaption v-if="figcaption.show && figcaption.position === 'below-image' && image.figcaption.length">{{ image.figcaption }}</figcaption>
10
11
  </figure>
11
12
  </a>
12
13
  </li>
13
14
  </transition-group>
14
- <CmdSlideButton @click.prevent="showNextItem" :slideButtonType="slideButtons.next"/>
15
+ <CmdSlideButton @click.prevent="showNextItem" :slideButtons="cmdSlideButtons.next"/>
15
16
  </div>
16
17
  </template>
17
18
 
@@ -26,47 +27,68 @@ export default {
26
27
  thumbnails: []
27
28
  }
28
29
  },
29
-
30
30
  components: {
31
31
  CmdSlideButton
32
32
  },
33
-
34
33
  props: {
34
+ /**
35
+ * list of thumbnail-scroller-items
36
+ */
35
37
  thumbnailScrollerItems: {
36
38
  type: Array,
37
39
  required: true
38
40
  },
41
+ /**
42
+ * allow large version of images to be opened in CmdFancyBox-component
43
+ */
39
44
  allowOpenFancyBox: {
40
45
  type: Boolean,
41
46
  default: true
42
47
  },
48
+ /**
49
+ * set a default index to activate/highlight a specific image/item
50
+ */
43
51
  imgIndex: {
44
52
  type: Number,
45
53
  required: false
46
54
  },
47
- showFigcaption: {
48
- type: Boolean,
49
- default: true
55
+ /**
56
+ * set figcaption
57
+ */
58
+ figcaption: {
59
+ type: Object,
60
+ default() {
61
+ return {
62
+ show: true,
63
+ position: "below-image"
64
+ }
65
+ }
50
66
  },
51
- slideButtons: {
67
+ /**
68
+ * properties for cmdSlideButtons-component
69
+ */
70
+ cmdSlideButtons: {
52
71
  type: Object,
53
72
  default() {
54
73
  return {
55
74
  "next": {
56
- "buttonType": "next",
57
- "iconClass": "icon-single-arrow-right",
58
- "tooltip": "Next"
75
+ "next": {
76
+ type: "next",
77
+ "iconClass": "icon-single-arrow-right",
78
+ "tooltip": "Next"
79
+ }
59
80
  },
60
- "previous": {
61
- "buttonType": "previous",
62
- "iconClass": "icon-single-arrow-left",
63
- "tooltip": "Previous"
81
+ "prev": {
82
+ "prev": {
83
+ type: "prev",
84
+ "iconClass": "icon-single-arrow-left",
85
+ "tooltip": "Previous"
86
+ }
64
87
  }
65
88
  }
66
89
  }
67
90
  }
68
91
  },
69
-
70
92
  methods: {
71
93
  showNextItem() {
72
94
  const thumbnail = this.thumbnails.shift(); // remove first element of array
@@ -6,6 +6,9 @@
6
6
  export default {
7
7
  name: "CmdTooltip",
8
8
  props: {
9
+ /**
10
+ * text for tooltip
11
+ */
9
12
  tooltipText: {
10
13
  type: String,
11
14
  required: true
@@ -2,10 +2,14 @@
2
2
  <div class="cmd-top-header-navigation">
3
3
  <ul class="flex-container" role="navigation">
4
4
  <li v-for="(link, index) in topHeaderNavigationData" :key="index">
5
- <a :href="link.path" :target="link.target" :title="!link.linkName ? link.tooltip : ''">
6
- <span v-if="link.iconClass" :class="link.iconClass"></span>
7
- <span v-if="link.linkName">{{ link.linkName }}</span>
5
+ <a v-if="link.linkType === 'href'" :href="link.path" :target="link.target" :title="link.icon.tooltip">
6
+ <span v-if="link.iconClass" :class="link.icon.iconClass"></span>
7
+ <span v-if="link.text">{{ link.text }}</span>
8
8
  </a>
9
+ <router-link v-else-if="link.linkType === 'router'" :to="link.path" :target="link.target" :title="link.icon.tooltip">
10
+ <span v-if="link.iconClass" :class="link.icon.iconClass"></span>
11
+ <span v-if="link.text">{{ link.text }}</span>
12
+ </router-link>
9
13
  </li>
10
14
  </ul>
11
15
  </div>
@@ -15,6 +19,9 @@
15
19
  export default {
16
20
  name: "CmdTopHeaderNavigation",
17
21
  props: {
22
+ /**
23
+ * list of navigation-entries
24
+ */
18
25
  topHeaderNavigationData: {
19
26
  type: Array,
20
27
  required: false
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <fieldset ref="upload" class="grid-container-create-columns cmd-upload-form">
2
+ <fieldset ref="upload" class=" cmd-upload-form grid-container-create-columns">
3
3
  <legend>Upload form</legend>
4
4
  <h2 v-if="headline">{{ headline }}</h2>
5
5
  <CmdFormElement
@@ -64,6 +64,7 @@
64
64
  </template>
65
65
 
66
66
  <script>
67
+ // import components
67
68
  import CmdFormElement from "./CmdFormElement"
68
69
  import CmdSystemMessage from "./CmdSystemMessage"
69
70
 
@@ -82,34 +83,58 @@ export default {
82
83
  CmdSystemMessage
83
84
  },
84
85
  props: {
86
+ /**
87
+ * headline for form
88
+ */
85
89
  headline: {
86
90
  type: String,
87
91
  required: false
88
92
  },
93
+ /**
94
+ * url to uplaod files
95
+ */
89
96
  uploadURL: {
90
97
  type: String,
91
98
  required: false
92
99
  },
100
+ /**
101
+ * activate if files for upload should be selected by native input (type="file")
102
+ */
93
103
  enableFileSelect: {
94
104
  type: Boolean,
95
105
  default: true
96
106
  },
107
+ /**
108
+ * activate if files should be dragged and dropped from os-file-explorer
109
+ */
97
110
  enableDragAndDrop: {
98
111
  type: Boolean,
99
112
  default: true
100
113
  },
114
+ /**
115
+ * enable textarea for additional comments
116
+ */
101
117
  enableComment: {
102
118
  type: Boolean,
103
119
  default: true
104
120
  },
121
+ /**
122
+ * set upload options
123
+ */
105
124
  uploadOptions: {
106
125
  type: Object,
107
126
  required: false
108
127
  },
128
+ /**
129
+ * list of allowed file types to upload (all can be selected)
130
+ */
109
131
  allowedFileTypes: {
110
132
  type: Array,
111
133
  required: true
112
134
  },
135
+ /**
136
+ * set maximum upload size (for all files combined)
137
+ */
113
138
  maxUploadSize: {
114
139
  type: Number,
115
140
  default: 10485760
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div class="cmd-width-limitation-wrapper" :class="{'sticky': sticky}">
3
- <component :is="innerComponent" :class="setInnerClass" v-if="innerWrapper">
4
- <a :id="anchorId" v-if="anchorId"></a>
3
+ <component v-if="innerWrapper" :is="innerComponent" :class="setInnerClass">
4
+ <a v-if="anchorId" :id="anchorId"></a>
5
5
  <slot></slot>
6
6
  </component>
7
7
  <template v-else>
8
- <a :id="anchorId" v-if="anchorId"></a>
8
+ <a v-if="anchorId" :id="anchorId"></a>
9
9
  <slot></slot>
10
10
  </template>
11
11
  </div>
@@ -15,6 +15,9 @@
15
15
  export default {
16
16
  name: "CmdWidthLimitationWrapper",
17
17
  props: {
18
+ /**
19
+ * set a html-tag as inner tag
20
+ */
18
21
  innerComponent: {
19
22
  type: String,
20
23
  default: "section",
@@ -22,18 +25,38 @@ export default {
22
25
  return value;
23
26
  }
24
27
  },
28
+ /**
29
+ * activate if the inner content should be wrapped in inner component tag
30
+ *
31
+ * (if deactivated, content will be directly placed inside cmd-width-limitation-wrapper)
32
+ */
25
33
  innerWrapper: {
26
34
  type: Boolean,
27
35
  default: true
28
36
  },
37
+ /**
38
+ * activate if wrapper (and its content) should be sticky (=postion remains the same if content below is scrolled)
39
+ *
40
+ * i.e. use for site-header
41
+ *
42
+ * keep attention that more than one sticky-element on same html-level can cause problems, if content below is scrolled
43
+ */
29
44
  sticky: {
30
45
  type: Boolean,
31
46
  default: false
32
47
  },
48
+ /**
49
+ * set class to inner component
50
+ *
51
+ * innerWrapper-property must be true
52
+ */
33
53
  innerClass: {
34
54
  type: String,
35
55
  required: false
36
56
  },
57
+ /**
58
+ * set id for (invisible) anchor to enable shortcuts
59
+ */
37
60
  anchorId: {
38
61
  type: String,
39
62
  required: false