comand-component-library 4.0.7 → 4.0.9

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.
Files changed (34) hide show
  1. package/dist/comand-component-library.js +2682 -2376
  2. package/dist/comand-component-library.umd.cjs +3 -3
  3. package/dist/style.css +1 -1
  4. package/package.json +2 -2
  5. package/src/ComponentLibrary.vue +95 -17
  6. package/src/assets/data/list-of-links.json +13 -1
  7. package/src/assets/data/pages/list-of-downloads.json +56 -0
  8. package/src/assets/data/pages/list-of-site-links.json +78 -0
  9. package/src/assets/data/social-networks-page-by-json.json +2 -2
  10. package/src/assets/styles/component-library-global-styles.scss +19 -7
  11. package/src/componentSettingsDataAndControls.vue +27 -2
  12. package/src/components/CmdFakeSelect.vue +10 -21
  13. package/src/components/CmdFormElement.vue +5 -2
  14. package/src/components/CmdInputGroup.vue +1 -1
  15. package/src/components/CmdListOfLinks.vue +72 -12
  16. package/src/components/CmdListOfLinksItem.vue +14 -3
  17. package/src/components/CmdPageFooter.vue +83 -0
  18. package/src/components/CmdPagination.vue +4 -4
  19. package/src/components/CmdSidebar.vue +2 -0
  20. package/src/components/CmdSocialNetworks.vue +39 -27
  21. package/src/components/CmdSwitchLanguage.vue +3 -1
  22. package/src/components/CmdTextImageBlock.vue +44 -15
  23. package/src/components/CmdWidthLimitationWrapper.vue +27 -6
  24. package/src/components/EditComponentWrapper.vue +4 -0
  25. package/src/index.js +3 -1
  26. package/src/main.js +1 -1
  27. package/src/mixins/CmdFakeSelect/DefaultMessageProperties.js +0 -1
  28. package/src/mixins/pages/BasicForm/DefaultMessageProperties.js +28 -0
  29. package/src/pages/BasicForm.vue +341 -0
  30. package/src/pages/PageOverview.vue +53 -0
  31. package/src/pages/PageWrapper.vue +260 -0
  32. package/src/pages/SegmentedListsOfLinks.vue +34 -0
  33. /package/src/assets/styles/{transitions.scss → transitions.css} +0 -0
  34. /package/src/mixins/{CmdPager → CmdPagination}/DefaultMessageProperties.js +0 -0
@@ -0,0 +1,78 @@
1
+ [
2
+ {
3
+ "headline": {
4
+ "headlineLevel": 4,
5
+ "headlineText": "Segment #1 (vertical list)"
6
+ },
7
+ "orientation": "vertical",
8
+ "links": [
9
+ {
10
+ "iconClass": "icon-home",
11
+ "type": "href",
12
+ "text": "Link #1",
13
+ "path": "#"
14
+ },
15
+ {
16
+ "iconClass": "icon-user-profile",
17
+ "type": "href",
18
+ "text": "Link #2",
19
+ "path": "#",
20
+ "children": [
21
+ {
22
+ "iconClass": "icon-link",
23
+ "type": "href",
24
+ "text": "Sublink #1",
25
+ "path": "#"
26
+ },
27
+ {
28
+ "iconClass": "icon-export",
29
+ "type": "href",
30
+ "text": "Sublink #2",
31
+ "path": "#"
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ "type": "href",
37
+ "text": "Link #3",
38
+ "path": "#"
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "headline": {
44
+ "headlineLevel": 4,
45
+ "headlineText": "Segment #2 (horizontal list)"
46
+ },
47
+ "orientation": "horizontal",
48
+ "links": [
49
+ {
50
+ "type": "href",
51
+ "text": "Link #1",
52
+ "path": "#"
53
+ },
54
+ {
55
+ "type": "href",
56
+ "text": "Link #2",
57
+ "path": "#",
58
+ "children": [
59
+ {
60
+ "type": "href",
61
+ "text": "Sublink #1",
62
+ "path": "#"
63
+ },
64
+ {
65
+ "type": "href",
66
+ "text": "Sublink #2",
67
+ "path": "#"
68
+ }
69
+ ]
70
+ },
71
+ {
72
+ "type": "href",
73
+ "text": "Link #3",
74
+ "path": "#"
75
+ }
76
+ ]
77
+ }
78
+ ]
@@ -7,9 +7,9 @@
7
7
  "linkText": "Share"
8
8
  },
9
9
  {
10
- "id": "social-network-twitter",
10
+ "id": "social-network-x",
11
11
  "path": "https://twitter.com/home?status=http%3A%2F%2Fdevelopment.comand-cms.com%2Fmodule%2Fteam.html",
12
- "tooltip": "Share this page on twitter",
12
+ "tooltip": "Share this page on X",
13
13
  "iconClass": "icon-twitter",
14
14
  "linkText": "Share"
15
15
  },
@@ -39,7 +39,7 @@
39
39
  @import 'variables'; /* scss-variables (only used for media-query-breakpoints) */
40
40
  /* ---------------------------------------------- END IMPORTS -------------------------------------------------- */
41
41
 
42
- // assign scss-variables for breakpoints (from variables.scss) to css-variables, to get access to their value in JavaScript by getComputedStyle(document.documentElement).getPropertyValue
42
+ /* assign scss-variables for breakpoints (from variables.scss) to css-variables, to get access to their value in JavaScript by getComputedStyle(document.documentElement).getPropertyValue */
43
43
  html {
44
44
  --medium-max-width: #{$medium-max-width};
45
45
  --small-max-width: #{$small-max-width};
@@ -250,6 +250,18 @@ body.avoid-scrolling {
250
250
 
251
251
  &.success {
252
252
  --status-color: var(--success-color);
253
+
254
+ .label-text > a {
255
+ &:has([class*="icon-"]) {
256
+ &:hover, &:active, &:focus {
257
+ cursor: default;
258
+
259
+ [class*="icon-"] {
260
+ color: var(--success-color);
261
+ }
262
+ }
263
+ }
264
+ }
253
265
  }
254
266
 
255
267
  &.info {
@@ -301,6 +313,12 @@ body.avoid-scrolling {
301
313
 
302
314
  /* ---------------------------------------------- BEGIN COLORS-SCHEMES (LIGHT-/DARK-MODE) -------------------------------------------------- */
303
315
  html {
316
+ --color-scheme-text-color-buttons: var(--dark-mode-text-color-buttons);
317
+ --color-scheme-text-color-inverted: var(--light-mode-text-color);
318
+ --color-scheme-background: var(--dark-mode-background);
319
+ --color-scheme-background-inverted: var(--light-mode-background);
320
+ --default-background-color-lightness: 20%;
321
+
304
322
  &.light-mode {
305
323
  /* assign default colors for custom light-mode set by class */
306
324
  --color-scheme-text-color: var(--light-mode-text-color);
@@ -311,12 +329,6 @@ html {
311
329
  --default-background-color-lightness: 97%;
312
330
  }
313
331
 
314
- --color-scheme-text-color-buttons: var(--dark-mode-text-color-buttons);
315
- --color-scheme-text-color-inverted: var(--light-mode-text-color);
316
- --color-scheme-background: var(--dark-mode-background);
317
- --color-scheme-background-inverted: var(--light-mode-background);
318
- --default-background-color-lightness: 20%;
319
-
320
332
  &.dark-mode {
321
333
  /* assign default colors for custom dark-mode set by class */
322
334
  --color-scheme-text-color: var(--dark-mode-text-color);
@@ -339,7 +339,8 @@ data() {
339
339
  largeIcons: false,
340
340
  sectionAnchors: false,
341
341
  orientation: "vertical",
342
- align: "left"
342
+ align: "left",
343
+ showListStyleItems: false
343
344
  },
344
345
  cmdListOfLinksSettingsControls: {
345
346
  align: [
@@ -366,6 +367,16 @@ data() {
366
367
  text: "Horizontal",
367
368
  value: "horizontal"
368
369
  }
370
+ ],
371
+ showListStyleItems: [
372
+ {
373
+ text: "False (default)",
374
+ value: false
375
+ },
376
+ {
377
+ text: "True",
378
+ value: true
379
+ }
369
380
  ]
370
381
  },
371
382
  cmdLoginFormSettingsData: {
@@ -458,6 +469,9 @@ data() {
458
469
  headlineLevel: 3
459
470
  }
460
471
  },
472
+ cmdPageFooterSettingsData: {
473
+ useSmallButtons: false
474
+ },
461
475
  cmdPaginationSettingsData: {
462
476
  pages: 3,
463
477
  itemsPerPage: 1,
@@ -580,7 +594,8 @@ data() {
580
594
  cmdTextImageBlockSettingsData: {
581
595
  htmlContent: "Text given as html-content",
582
596
  paragraphTextAlign: "left",
583
- headlinePosition: "aboveImage"
597
+ headlinePosition: "aboveImage",
598
+ orientation: "vertical"
584
599
  },
585
600
  cmdTextImageBlockSettingsControls: {
586
601
  paragraphTextAlign: [
@@ -606,6 +621,16 @@ data() {
606
621
  text: "Below Image",
607
622
  value: "belowImage"
608
623
  }
624
+ ],
625
+ orientation: [
626
+ {
627
+ text: "Vertical (default)",
628
+ value: "vertical"
629
+ },
630
+ {
631
+ text: "Horizontal",
632
+ value: "horizontal"
633
+ }
609
634
  ]
610
635
  },
611
636
  cmdThumbnailScrollerSettingsData: {
@@ -24,7 +24,7 @@
24
24
  <a v-if="($attrs.required || inputRequirements.length) && showStatusIcon"
25
25
  href="#"
26
26
  @click.prevent
27
- :title="!useCustomTooltip ? getValidationMessage : ''"
27
+ :title="validationTooltip"
28
28
  :aria-errormessage="tooltipId"
29
29
  aria-live="assertive"
30
30
  :id="tooltipId">
@@ -71,7 +71,7 @@
71
71
  <!-- end optional icon -->
72
72
 
73
73
  <!-- begin text -->
74
- <span v-if="optionName" class="option-name" :style="limitWidthStyle">{{ optionName }}</span>
74
+ <span v-if="optionName" class="option-name">{{ optionName }}</span>
75
75
  <!-- end text -->
76
76
 
77
77
  <!-- begin custom dropdown-icon -->
@@ -179,7 +179,8 @@
179
179
  <script>
180
180
  // import mixins
181
181
  import I18n from "../mixins/I18n"
182
- import DefaultMessageProperties from "../mixins/CmdFakeSelect/DefaultMessageProperties"
182
+ import DefaultMessagePropertiesFakeSelect from "../mixins/CmdFakeSelect/DefaultMessageProperties"
183
+ import DefaultMessagePropertiesFormElement from "../mixins/CmdFormElement/DefaultMessageProperties"
183
184
  import FieldValidation from "../mixins/FieldValidation"
184
185
  import Identifier from "../mixins/Identifier"
185
186
  import Tooltip from "../mixins/Tooltip"
@@ -189,7 +190,8 @@ export default {
189
190
  inheritAttrs: false,
190
191
  mixins: [
191
192
  I18n,
192
- DefaultMessageProperties,
193
+ DefaultMessagePropertiesFakeSelect,
194
+ DefaultMessagePropertiesFormElement,
193
195
  FieldValidation,
194
196
  Identifier,
195
197
  Tooltip
@@ -198,7 +200,6 @@ export default {
198
200
  return {
199
201
  showOptions: false,
200
202
  validationStatus: "",
201
- limitWidthStyle: null,
202
203
  allOptionsSelected: false
203
204
  }
204
205
  },
@@ -428,16 +429,6 @@ export default {
428
429
  return this.getMessage("cmdfakeselect.linktext.select_all_options")
429
430
  }
430
431
  },
431
- mounted() {
432
- //this.$nextTick(this.limitWidth)
433
- //setTimeout(this.limitWidth, 250)
434
- const hnd = setInterval(() => {
435
- if (this.$refs.fakeselect) {
436
- clearInterval(hnd)
437
- this.limitWidth()
438
- }
439
- }, 100)
440
- },
441
432
  methods: {
442
433
  toggleAllOptions() {
443
434
  this.validationStatus = "success"
@@ -454,12 +445,6 @@ export default {
454
445
 
455
446
  this.$emit("update:modelValue", checkboxValues)
456
447
  },
457
- limitWidth() {
458
- if (this.$refs.fakeselect) {
459
- const outerWidth = this.$refs.fakeselect.offsetWidth
460
- this.limitWidthStyle = {width: outerWidth / 100 * 90 + "px"}
461
- }
462
- },
463
448
  toggleOptions() {
464
449
  if (this.$attrs.disabled !== 'disabled') {
465
450
  this.showOptions = !this.showOptions
@@ -570,6 +555,10 @@ export default {
570
555
  color: var(--color-scheme-text-color);
571
556
  border-radius: var(--default-border-radius);
572
557
 
558
+ img {
559
+ flex-shrink: 0;
560
+ }
561
+
573
562
  span, [class*="icon"] {
574
563
  color: var(--color-scheme-text-color);
575
564
  }
@@ -881,8 +881,11 @@ export default {
881
881
  }
882
882
 
883
883
  &.has-state, & + .cmd-tooltip {
884
- * {
885
- --status-color: var(--error-color);
884
+
885
+ &.error {
886
+ * {
887
+ --status-color: var(--error-color);
888
+ }
886
889
  }
887
890
 
888
891
  ::placeholder {
@@ -242,7 +242,7 @@ export default {
242
242
  updateStatus() {
243
243
  if (this.required) {
244
244
  if (this.inputValue?.length) {
245
- this.validationStatus = ""
245
+ this.validationStatus = "success"
246
246
  return
247
247
  }
248
248
  this.validationStatus = "error"
@@ -1,5 +1,12 @@
1
1
  <template>
2
- <div :class="['cmd-list-of-links', {box: styleAsBox, horizontal: orientation === 'horizontal', 'section-anchors': sectionAnchors, 'large-icons': largeIcons}]">
2
+ <div :class="['cmd-list-of-links',
3
+ {
4
+ box: styleAsBox, horizontal: orientation === 'horizontal',
5
+ 'section-anchors': sectionAnchors,
6
+ 'large-icons': largeIcons,
7
+ 'show-list-style-items': showListStyleItems
8
+ }
9
+ ]">
3
10
  <!-- begin cmd-headline -->
4
11
  <CmdHeadline
5
12
  v-if="cmdHeadline?.headlineText || editModeContext"
@@ -9,6 +16,7 @@
9
16
 
10
17
  <!-- begin list of links -->
11
18
  <ul :class="['flex-container', {'no-gap': !useGap}, 'align-' + align, setStretchClass]">
19
+ <!-- begin CmdListOfLinksItem-->
12
20
  <CmdListOfLinksItem
13
21
  v-if="!editModeContext"
14
22
  v-for="(link, index) in links"
@@ -16,6 +24,7 @@
16
24
  :class="{'active': sectionAnchors && activeSection === index}"
17
25
  :link="link"
18
26
  />
27
+ <!-- end CmdListOfLinksItem-->
19
28
 
20
29
  <!-- begin edit-mode -->
21
30
  <li v-else>
@@ -31,11 +40,14 @@
31
40
  :componentPath="['props', 'links', index]"
32
41
  :itemProvider="itemProvider"
33
42
  >
43
+ <!-- begin CmdListOfLinksItem-->
34
44
  <CmdListOfLinksItem
35
45
  :class="{'active': sectionAnchors && activeSection === index}"
36
46
  :link="link"
37
47
  />
48
+ <!-- end CmdListOfLinksItem-->
38
49
  </EditComponentWrapper>
50
+
39
51
  <button v-if="links.length === 0" type="button" class="button confirm small" @click="onAddItem">
40
52
  <span class="icon-plus"></span>
41
53
  <span>Add new entry</span>
@@ -48,7 +60,10 @@
48
60
  </template>
49
61
 
50
62
  <script>
63
+ // import mixins (editMode only)
51
64
  import EditMode from "../mixins/EditMode.vue"
65
+
66
+ // import utils (editMode only)
52
67
  import {buildComponentPath, updateHandlerProvider} from "../utils/editmode.js"
53
68
 
54
69
  export default {
@@ -97,6 +112,15 @@ export default {
97
112
  type: Number,
98
113
  default: 0
99
114
  },
115
+ /**
116
+ * toggle list-style-items visibility
117
+ *
118
+ * @affectsStyling: true
119
+ */
120
+ showListStyleItems: {
121
+ type: Boolean,
122
+ default: false
123
+ },
100
124
  /**
101
125
  * set horizontal alignment
102
126
  *
@@ -200,6 +224,19 @@ export default {
200
224
  &.align-right li {
201
225
  text-align: right;
202
226
  }
227
+
228
+ ul {
229
+ display: flex;
230
+ flex-direction: column;
231
+ margin-left: calc(var(--default-padding) * 2);
232
+ }
233
+ }
234
+
235
+ &.show-list-style-items {
236
+ li {
237
+ list-style-type: disc;
238
+ margin-left: 1.7rem;
239
+ }
203
240
  }
204
241
 
205
242
  &.horizontal {
@@ -210,6 +247,7 @@ export default {
210
247
  > li {
211
248
  flex: none;
212
249
  display: flex;
250
+ flex-direction: column;
213
251
  }
214
252
 
215
253
  &.align-right {
@@ -224,20 +262,42 @@ export default {
224
262
  }
225
263
 
226
264
  &.large-icons {
227
- li a {
228
- display: flex;
229
- flex-direction: column;
230
- gap: calc(var(--default-gap) / 4);
231
- text-decoration: none;
232
- align-items: center;
233
- justify-content: center;
265
+ li {
266
+ list-style-type: none;
267
+
268
+ a {
269
+ display: flex;
270
+ flex-direction: column;
271
+ gap: calc(var(--default-gap) / 4);
272
+ text-decoration: none;
273
+ align-items: center;
274
+ justify-content: center;
275
+
276
+ span {
277
+ margin: 0;
278
+ }
234
279
 
235
- span {
236
- margin: 0;
280
+ [class*="icon-"] {
281
+ font-size: 5rem;
282
+ }
237
283
  }
284
+ }
285
+ }
286
+ }
287
+ </style>
238
288
 
239
- [class*="icon-"] {
240
- font-size: 5rem;
289
+ <style lang="scss">
290
+ @import '../assets/styles/variables';
291
+
292
+ @media only screen and (max-width: $medium-max-width) {
293
+ .cmd-list-of-links {
294
+ > ul {
295
+ ul {
296
+ gap: calc(var(--default-gap) / 2);
297
+
298
+ > li:first-child {
299
+ margin-top: calc(var(--default-gap) / 2);
300
+ }
241
301
  }
242
302
  }
243
303
  }
@@ -15,15 +15,26 @@
15
15
  <!-- end use href --->
16
16
 
17
17
  <!-- begin use router-link -->
18
- <router-link v-else-if="link.type === 'router'"
19
- :to="getRoute(link)"
20
- :title="link.tooltip">
18
+ <router-link
19
+ v-else-if="link.type === 'router'"
20
+ :to="getRoute(link)"
21
+ :title="link.tooltip">
21
22
  <!-- begin CmdIcon -->
22
23
  <CmdIcon v-if="link.iconClass" :iconClass="link.iconClass" :type="link.iconType" />
23
24
  <!-- end CmdIcon -->
24
25
  <span v-if="link.text">{{ link.text }}</span>
25
26
  </router-link>
26
27
  <!-- end use router-link -->
28
+
29
+ <!-- begin CmdListOfLinksItem for nested children -->
30
+ <ul v-if="!editModeContext">
31
+ <CmdListOfLinksItem
32
+ v-for="(child, index) in link.children"
33
+ :key="index"
34
+ :link="child"
35
+ />
36
+ </ul>
37
+ <!-- end CmdListOfLinksItem for nested children -->
27
38
  </li>
28
39
  <!-- end default-view -->
29
40
 
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <div :class="['cmd-page-footer flex-container', {'small-buttons': useSmallButtons}]">
3
+ <!-- begin button print-preview -->
4
+ <button
5
+ v-if="buttonPrintView.show"
6
+ :class="['button', {'primary': buttonPrintView.primary}]"
7
+ :title="buttonPrintView.text ? buttonPrintView.icon?.tooltip : null"
8
+ >
9
+ <span v-if="buttonPrintView.icon?.show" :class="buttonPrintView.icon?.iconClass"></span>
10
+ <span v-if="buttonPrintView.text">{{buttonPrintView.text}}</span>
11
+ </button>
12
+ <!-- end button print-preview -->
13
+
14
+ <!-- begin slot-content -->
15
+ <slot></slot>
16
+ <!-- end slot-content -->
17
+
18
+ <!-- begin CmdSocialNetworks -->
19
+ <CmdSocialNetworks v-if="cmdSocialNetworks" :networks="cmdSocialNetworks">
20
+ <slot name="cmd-social-networks"></slot>
21
+ </CmdSocialNetworks>
22
+ <!-- end CmdSocialNetworks -->
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ export default {
28
+ name: "CmdPageFooter",
29
+ props: {
30
+ /**
31
+ * define button for print-preview
32
+ */
33
+ buttonPrintView: {
34
+ type: Object,
35
+ default() {
36
+ return {
37
+ show: true,
38
+ primary: false,
39
+ icon: {
40
+ show: true,
41
+ iconClass: "icon-print-preview",
42
+ tooltip: "Open print preview"
43
+ },
44
+ text: "Print preview"
45
+ }
46
+ }
47
+ },
48
+ /**
49
+ * activate to use small buttons
50
+ */
51
+ useSmallButtons: {
52
+ type: Boolean,
53
+ default: true
54
+ },
55
+ /**
56
+ * properties for CmdSocialNetworks-component
57
+ */
58
+ cmdSocialNetworks: {
59
+ type: Array,
60
+ required: false
61
+ }
62
+ }
63
+ }
64
+ </script>
65
+
66
+ <style>
67
+ /* begin cmd-page-footer -------------------------------------------------------------------------------------------- */
68
+ .cmd-page-footer {
69
+ align-items: flex-end;
70
+
71
+ &.small-buttons {
72
+ button, .button {
73
+ padding: var(--button-padding-small);
74
+ min-height: var(--button-min-height-small);
75
+
76
+ span {
77
+ font-size: var(--font-size-small);
78
+ }
79
+ }
80
+ }
81
+ }
82
+ /* end cmd-page-footer -------------------------------------------------------------------------------------------- */
83
+ </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="cmd-pager">
2
+ <div class="cmd-pagination">
3
3
  <!-- begin button/link to previous page -->
4
4
  <a
5
5
  :href="getPreviousHref"
@@ -47,10 +47,10 @@
47
47
  <script>
48
48
  // import mixins
49
49
  import I18n from "../mixins/I18n"
50
- import DefaultMessageProperties from "../mixins/CmdPager/DefaultMessageProperties"
50
+ import DefaultMessageProperties from "../mixins/CmdPagination/DefaultMessageProperties"
51
51
 
52
52
  export default {
53
- name: "CmdPager",
53
+ name: "CmdPagination",
54
54
  mixins: [
55
55
  I18n,
56
56
  DefaultMessageProperties
@@ -172,7 +172,7 @@ export default {
172
172
 
173
173
  <style>
174
174
  /* begin cmd-pagination ---------------------------------------------------------------------------------------- */
175
- .cmd-pager {
175
+ .cmd-pagination {
176
176
  display: flex;
177
177
  justify-content: space-between;
178
178
 
@@ -130,6 +130,8 @@ export default {
130
130
 
131
131
  &.box {
132
132
  padding: 0;
133
+
134
+ border-left: 0;
133
135
  }
134
136
 
135
137
  .cmd-box-wrapper > .grid-container-create-columns {