comand-component-library 4.2.18 → 4.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ [
2
+ "tag 1", "tag 2", "tag 3"
3
+ ]
@@ -18,8 +18,7 @@
18
18
  "ImageGallery",
19
19
  "ImageZoom",
20
20
  "Link",
21
- "ListOfImages",
22
- "ListOfLinks",
21
+ "List",
23
22
  "LoginForm",
24
23
  "MailTool",
25
24
  "MainNavigation",
@@ -397,23 +397,7 @@ data() {
397
397
  }
398
398
  ]
399
399
  },
400
- cmdListOfImagesSettingsData: {
401
- styleAsBox: false,
402
- orientation: "vertical"
403
- },
404
- cmdListOfImagesSettingsControls: {
405
- orientation: [
406
- {
407
- text: "Vertical",
408
- value: "vertical"
409
- },
410
- {
411
- text: "Horizontal (default)",
412
- value: "horizontal"
413
- }
414
- ]
415
- },
416
- cmdListOfLinksSettingsData: {
400
+ cmdListSettingsData: {
417
401
  useGap: true,
418
402
  styleAsBox: false,
419
403
  largeIcons: false,
@@ -422,7 +406,21 @@ data() {
422
406
  align: "left",
423
407
  showListStyleItems: false
424
408
  },
425
- cmdListOfLinksSettingsControls: {
409
+ cmdListSettingsControls: {
410
+ listType: [
411
+ {
412
+ text: "Links",
413
+ value: "links"
414
+ },
415
+ {
416
+ text: "Images",
417
+ value: "images"
418
+ },
419
+ {
420
+ text: "Tags",
421
+ value: "tags"
422
+ }
423
+ ],
426
424
  align: [
427
425
  {
428
426
  text: "Left (default)",
@@ -232,7 +232,7 @@
232
232
 
233
233
  <!-- begin box-footer -->
234
234
  <div v-if="user.links && user.links.length" class="box-footer">
235
- <CmdListOfLinks :links="user.links" orientation="horizontal" :useGap="false"/>
235
+ <CmdList :links="user.links" orientation="horizontal" :useGap="false"/>
236
236
  </div>
237
237
  <!-- end box-footer -->
238
238
  </div>
@@ -1,11 +1,12 @@
1
1
  <template>
2
- <div :class="['cmd-list-of-links',
2
+ <div :class="['cmd-list',
3
3
  {
4
- box: styleAsBox, horizontal: orientation === 'horizontal',
4
+ box: styleAsBox,
5
5
  'section-anchors': sectionAnchors,
6
6
  'large-icons': largeIcons,
7
- 'show-list-style-items': showListStyleItems
8
- }
7
+ 'show-list-style-items': showListStyleItems,
8
+ },
9
+ 'list-type-' + listType
9
10
  ]">
10
11
  <!-- begin cmd-headline -->
11
12
  <CmdHeadline
@@ -15,46 +16,72 @@
15
16
  <!-- end cmd-headline -->
16
17
 
17
18
  <!-- begin list of links -->
18
- <ul :class="['flex-container', {'no-gap': !useGap}, 'align-' + align, setStretchClass]">
19
- <!-- begin CmdListOfLinksItem-->
20
- <CmdListOfLinksItem
21
- v-if="!editModeContext"
22
- v-for="(link, index) in links"
23
- :key="index"
24
- :class="{'active': sectionAnchors && activeSection === index}"
25
- :link="link"
26
- @click="emitClick($event, linkType)"
27
- />
28
- <!-- end CmdListOfLinksItem-->
19
+ <ul :class="['flex-container', {'no-gap': !useGap}, 'align-' + align, setStretchClass, {horizontal: orientation === 'horizontal'}]">
20
+ <template v-if="listType === 'links'">
21
+ <!-- begin CmdListOfLinksItem-->
22
+ <CmdListOfLinksItem
23
+ v-if="!editModeContext"
24
+ v-for="(link, index) in items"
25
+ :key="index"
26
+ :class="{'active': sectionAnchors && activeSection === index}"
27
+ :link="link"
28
+ @click="emitClick($event, linkType)"
29
+ />
30
+ <!-- end CmdListOfLinksItem-->
31
+
32
+ <!-- begin edit-mode -->
33
+ <li v-else>
34
+ <EditComponentWrapper
35
+ v-for="(link, index) in links"
36
+ :key="'x' + index"
37
+ class="edit-items"
38
+ :showComponentName="false"
39
+ componentTag="ul"
40
+ componentName="CmdLinkItem"
41
+ :componentProps="link"
42
+ :allowedComponentTypes="[]"
43
+ :componentPath="['props', 'links', index]"
44
+ :itemProvider="itemProvider"
45
+ >
46
+ <!-- begin CmdListOfLinksItem-->
47
+ <CmdListOfLinksItem
48
+ :class="{'active': sectionAnchors && activeSection === index}"
49
+ :link="link"
50
+ />
51
+ <!-- end CmdListOfLinksItem-->
52
+ </EditComponentWrapper>
29
53
 
30
- <!-- begin edit-mode -->
31
- <li v-else>
32
- <EditComponentWrapper
33
- v-for="(link, index) in links"
34
- :key="'x' + index"
35
- class="edit-items"
36
- :showComponentName="false"
37
- componentTag="ul"
38
- componentName="CmdLinkItem"
39
- :componentProps="link"
40
- :allowedComponentTypes="[]"
41
- :componentPath="['props', 'links', index]"
42
- :itemProvider="itemProvider"
43
- >
44
- <!-- begin CmdListOfLinksItem-->
45
- <CmdListOfLinksItem
46
- :class="{'active': sectionAnchors && activeSection === index}"
47
- :link="link"
48
- />
49
- <!-- end CmdListOfLinksItem-->
50
- </EditComponentWrapper>
54
+ <button v-if="links.length === 0" type="button" class="button confirm small" @click="onAddItem">
55
+ <span class="icon-plus"></span>
56
+ <span>Add new entry</span>
57
+ </button>
58
+ </li>
59
+ <!-- end edit-mode -->
60
+ </template>
51
61
 
52
- <button v-if="links.length === 0" type="button" class="button confirm small" @click="onAddItem">
53
- <span class="icon-plus"></span>
54
- <span>Add new entry</span>
55
- </button>
56
- </li>
57
- <!-- end edit-mode -->
62
+ <!-- begin list of images -->
63
+ <template v-if="listType === 'images'">
64
+ <li v-for="(image, index) in items" :key="index">
65
+ <!-- begin CmdImage with link-->
66
+ <a v-if="image.image.url" :href="image.image.url">
67
+ <CmdImage v-bind="image"/>
68
+ </a>
69
+ <!-- end CmdImage with link-->
70
+
71
+ <!-- begin CmdImage without link-->
72
+ <CmdImage v-else v-bind="image"/>
73
+ <!-- end CmdImage without link-->
74
+ </li>
75
+ </template>
76
+ <!-- end list of images -->
77
+
78
+ <!-- begin tags -->
79
+ <template v-if="listType === 'tags'">
80
+ <li v-for="(tag, index) in items" :key="index">
81
+ <small class="tag">{{ tag }}</small>
82
+ </li>
83
+ </template>
84
+ <!-- end tags -->
58
85
  </ul>
59
86
  <!-- end list of links -->
60
87
  </div>
@@ -72,6 +99,20 @@ export default {
72
99
  emits: ["click"],
73
100
  mixins: [EditMode],
74
101
  props: {
102
+ /**
103
+ * set list-type
104
+ *
105
+ * @allowedValues: links, images, tags
106
+ */
107
+ listType: {
108
+ typ: String,
109
+ default: "links",
110
+ validator(value) {
111
+ return value === "links" ||
112
+ value === "images" ||
113
+ value === "tags"
114
+ }
115
+ },
75
116
  /**
76
117
  * toggle gab between links
77
118
  */
@@ -139,9 +180,9 @@ export default {
139
180
  }
140
181
  },
141
182
  /**
142
- * list of displayed links
183
+ * list of displayed items
143
184
  */
144
- links: {
185
+ items: {
145
186
  type: Array,
146
187
  required: false
147
188
  },
@@ -168,7 +209,7 @@ export default {
168
209
  },
169
210
  computed: {
170
211
  setStretchClass() {
171
- if(this.largeIcons && this.orientation === "horizontal") {
212
+ if (this.largeIcons && this.orientation === "horizontal") {
172
213
  return "stretch"
173
214
  }
174
215
  return null
@@ -197,7 +238,7 @@ export default {
197
238
  if (cmdHeadlineUpdateHandler) {
198
239
  props.cmdHeadline = props.cmdHeadline || {}
199
240
  cmdHeadlineUpdateHandler.update(props.cmdHeadline)
200
- }
241
+ }
201
242
  }
202
243
  })
203
244
  },
@@ -209,8 +250,8 @@ export default {
209
250
  </script>
210
251
 
211
252
  <style>
212
- /* begin cmd-list-of-links ---------------------------------------------------------------------------------------- */
213
- .cmd-list-of-links {
253
+ /* begin cmd-list ---------------------------------------------------------------------------------------- */
254
+ .cmd-list {
214
255
  > ul {
215
256
  flex-direction: column;
216
257
  gap: calc(var(--default-gap) / 2);
@@ -243,26 +284,24 @@ export default {
243
284
  }
244
285
  }
245
286
 
246
- &.horizontal {
247
- > ul {
248
- gap: var(--default-gap);
249
- flex-direction: row;
250
-
251
- > li {
252
- flex: none;
253
- display: flex;
254
- flex-direction: column;
255
- }
287
+ .horizontal {
288
+ gap: var(--default-gap);
289
+ flex-direction: row;
256
290
 
257
- &.align-right {
258
- justify-content: flex-end;
259
- }
291
+ > li {
292
+ flex: none;
293
+ display: flex;
294
+ flex-direction: column;
295
+ max-width: 100%; /* avoid li to be stretched by large content */
296
+ }
260
297
 
261
- &.stretch {
262
- justify-content: space-around;
263
- }
298
+ &.align-right {
299
+ justify-content: flex-end;
264
300
  }
265
301
 
302
+ &.stretch {
303
+ justify-content: space-around;
304
+ }
266
305
  }
267
306
 
268
307
  &.large-icons {
@@ -294,7 +333,7 @@ export default {
294
333
  @import '../assets/styles/variables';
295
334
 
296
335
  @media only screen and (max-width: $medium-max-width) {
297
- .cmd-list-of-links {
336
+ .cmd-list {
298
337
  > ul {
299
338
  ul {
300
339
  gap: calc(var(--default-gap) / 2);
@@ -306,5 +345,6 @@ export default {
306
345
  }
307
346
  }
308
347
  }
309
- /* end cmd-list-of-links------------------------------------------------------------------------------------------ */
348
+
349
+ /* end cmd-list ------------------------------------------------------------------------------------------ */
310
350
  </style>
@@ -1,32 +1,32 @@
1
1
  <template>
2
2
  <!-- begin default-view -->
3
3
  <li v-if="!editing" class="cmd-list-of-links-item">
4
- <!-- begin CmdLink -->
5
- <!-- do not use v-bind to avoid unnecessary props to be provided for CmdLink causing warnings -->
6
- <CmdLink
7
- :linkType="link?.linkType"
8
- :text="link?.text"
9
- :path="link?.path"
10
- :target="link?.target"
11
- :icon="link?.icon"
12
- :fancybox="link?.fancybox"
13
- :tooltip="link?.tooltip"
14
- :styleAsButton="link?.styleAsButton"
15
- :primaryButton="link?.primaryButton"
16
- :styleAsBox="link?.styleAsBox"
17
- @click="emitClick($event, link)"
18
- />
19
- <!-- end CmdLink -->
20
-
21
- <!-- begin CmdListOfLinksItem for nested children -->
22
- <ul v-if="link?.children?.length">
23
- <CmdListOfLinksItem
24
- v-for="(child, index) in link?.children"
25
- :key="index"
26
- :link="child"
4
+ <!-- begin CmdLink -->
5
+ <!-- do not use v-bind to avoid unnecessary props to be provided for CmdLink causing warnings -->
6
+ <CmdLink
7
+ :linkType="link?.linkType"
8
+ :text="link?.text"
9
+ :path="link?.path"
10
+ :target="link?.target"
11
+ :icon="link?.icon"
12
+ :fancybox="link?.fancybox"
13
+ :tooltip="link?.tooltip"
14
+ :styleAsButton="link?.styleAsButton"
15
+ :primaryButton="link?.primaryButton"
16
+ :styleAsBox="link?.styleAsBox"
17
+ @click="emitClick($event, link)"
27
18
  />
28
- </ul>
29
- <!-- end CmdListOfLinksItem for nested children -->
19
+ <!-- end CmdLink -->
20
+
21
+ <!-- begin CmdListOfLinksItem for nested children -->
22
+ <ul v-if="link?.children?.length">
23
+ <CmdListOfLinksItem
24
+ v-for="(child, index) in link?.children"
25
+ :key="index"
26
+ :link="child"
27
+ />
28
+ </ul>
29
+ <!-- end CmdListOfLinksItem for nested children -->
30
30
  </li>
31
31
  <!-- end default-view -->
32
32
 
package/src/index.js CHANGED
@@ -24,8 +24,7 @@ export { default as CmdImageGallery } from '@/components/CmdImageGallery.vue'
24
24
  export { default as CmdImageZoom } from '@/components/CmdImageZoom.vue'
25
25
  export { default as CmdInputGroup } from '@/components/CmdInputGroup.vue'
26
26
  export { default as CmdLink } from '@/components/CmdLink.vue'
27
- export { default as CmdListOfImages } from '@/components/CmdListOfImages.vue'
28
- export { default as CmdListOfLinks } from '@/components/CmdListOfLinks.vue'
27
+ export { default as CmdList } from '@/components/CmdList.vue'
29
28
  export { default as CmdLoginForm } from '@/components/CmdLoginForm.vue'
30
29
  export { default as CmdMainNavigation } from '@/components/CmdMainNavigation.vue'
31
30
  export { default as CmdMultistepFormProgressBar } from '@/components/CmdMultistepFormProgressBar.vue'
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <div class="cmd-page-multiple-lists-of-links flex-container vertical">
3
3
  <template v-for="(segment, index) in segments" :key="index">
4
- <!-- begin CmdListOfLinks -->
5
- <CmdListOfLinks
4
+ <!-- begin CmdList -->
5
+ <CmdList
6
6
  :links="segment.links"
7
7
  :orientation="segment.orientation"
8
8
  :largeIcons="segment.largeIcons"
9
9
  :cmdHeadline="segment.headline"
10
10
  />
11
- <!-- end CmdListOfLinks -->
11
+ <!-- end CmdList -->
12
12
 
13
13
  <!-- begin slot-content -->
14
14
  <slot name="multiple-lists-of-links-slot-${index}"></slot>
@@ -1,214 +0,0 @@
1
- <template>
2
- <div :class="['cmd-list-of-images',
3
- {
4
- box: styleAsBox
5
- }
6
- ]">
7
- <!-- begin cmd-headline -->
8
- <CmdHeadline
9
- v-if="cmdHeadline?.headlineText"
10
- v-bind="cmdHeadline"
11
- />
12
- <!-- end cmd-headline -->
13
-
14
- <!-- begin list of images -->
15
- <ul :class="['list-of-images', {vertical: orientation === 'vertical'}]">
16
- <li v-for="(image, index) in images" :key="index">
17
- <!-- begin CmdImage with link-->
18
- <a v-if="image.image.url" href="#">
19
- <CmdImage v-bind="image" />
20
- </a>
21
- <!-- end CmdImage with link-->
22
-
23
- <!-- begin CmdImage without link-->
24
- <CmdImage v-else v-bind="image" />
25
- <!-- end CmdImage without link-->
26
- </li>
27
- <!-- end edit-mode -->
28
- </ul>
29
- <!-- end list of links -->
30
- </div>
31
- </template>
32
-
33
- <script>
34
- // import mixins (editMode only)
35
- import EditMode from "../mixins/EditMode.vue"
36
-
37
- // import utils (editMode only)
38
- // import {buildComponentPath, updateHandlerProvider} from "../utils/editmode.js"
39
-
40
- export default {
41
- name: "CmdListOfImages",
42
- emits: ["click"],
43
- //mixins: [EditMode],
44
- props: {
45
- /**
46
- * style component like a box
47
- *
48
- * @affectsStyling: true
49
- */
50
- styleAsBox: {
51
- type: Boolean,
52
- default: false
53
- },
54
- /**
55
- * list of displayed images
56
- */
57
- images: {
58
- type: Array,
59
- required: false
60
- },
61
- /**
62
- * toggle orientation of list
63
- *
64
- * @allowedValues: horizontal, vertical
65
- */
66
- orientation: {
67
- type: String,
68
- default: "vertical",
69
- validator(value) {
70
- return value === "horizontal" ||
71
- value === "vertical"
72
- }
73
- },
74
- /**
75
- * properties for CmdHeadline-component
76
- */
77
- cmdHeadline: {
78
- type: Object,
79
- required: false
80
- }
81
- },
82
- methods: {
83
- /*
84
- onAddItem() {
85
- this.editModeContext.content.addContent(
86
- buildComponentPath(this, 'props', 'links', -1),
87
- this.itemProvider)
88
- },
89
- itemProvider() {
90
- return {
91
- "iconClass": "icon-user-profile",
92
- "type": "href",
93
- "text": "Linktext",
94
- "path": "#",
95
- "tooltip": "Tooltip",
96
- "target": "_blank"
97
- }
98
- },
99
- updateHandlerProvider() {
100
- return updateHandlerProvider(this, {
101
- update(props, childUpdateHandlers) {
102
- const cmdHeadlineUpdateHandler = childUpdateHandlers?.find(handler => handler.name === "CmdHeadline")
103
- if (cmdHeadlineUpdateHandler) {
104
- props.cmdHeadline = props.cmdHeadline || {}
105
- cmdHeadlineUpdateHandler.update(props.cmdHeadline)
106
- }
107
- }
108
- })
109
- }
110
- */
111
- }
112
- }
113
- </script>
114
-
115
- <style>
116
- /* begin cmd-list-of-links ---------------------------------------------------------------------------------------- */
117
- .cmd-list-of-links {
118
- > ul {
119
- flex-direction: column;
120
- gap: calc(var(--default-gap) / 2);
121
- margin: 0;
122
-
123
- li {
124
- list-style: none;
125
- margin-left: 0 !important; /* overwrite default-settings from frontend-framework */
126
- }
127
-
128
- &.align-center {
129
- justify-content: center;
130
- }
131
-
132
- &.align-right li {
133
- text-align: right;
134
- }
135
-
136
- ul {
137
- display: flex;
138
- flex-direction: column;
139
- margin-left: calc(var(--default-padding) * 2);
140
- }
141
- }
142
-
143
- &.show-list-style-items {
144
- li {
145
- list-style-type: disc;
146
- margin-left: 1.7rem;
147
- }
148
- }
149
-
150
- &.horizontal {
151
- > ul {
152
- gap: var(--default-gap);
153
- flex-direction: row;
154
-
155
- > li {
156
- flex: none;
157
- display: flex;
158
- flex-direction: column;
159
- }
160
-
161
- &.align-right {
162
- justify-content: flex-end;
163
- }
164
-
165
- &.stretch {
166
- justify-content: space-around;
167
- }
168
- }
169
-
170
- }
171
-
172
- &.large-icons {
173
- li {
174
- list-style-type: none;
175
-
176
- a {
177
- display: flex;
178
- flex-direction: column;
179
- gap: calc(var(--default-gap) / 4);
180
- text-decoration: none;
181
- align-items: center;
182
- justify-content: center;
183
-
184
- span {
185
- margin: 0;
186
- }
187
-
188
- [class*="icon-"] {
189
- font-size: 5rem;
190
- }
191
- }
192
- }
193
- }
194
- }
195
- </style>
196
-
197
- <style lang="scss">
198
- @import '../assets/styles/variables';
199
-
200
- @media only screen and (max-width: $medium-max-width) {
201
- .cmd-list-of-links {
202
- > ul {
203
- ul {
204
- gap: calc(var(--default-gap) / 2);
205
-
206
- > li:first-child {
207
- margin-top: calc(var(--default-gap) / 2);
208
- }
209
- }
210
- }
211
- }
212
- }
213
- /* end cmd-list-of-links------------------------------------------------------------------------------------------ */
214
- </style>