comand-component-library 3.3.82 → 3.3.83

Sign up to get free protection for your applications and to get access to all the features.
@@ -184,7 +184,10 @@
184
184
  @focus="tooltip = true"
185
185
  @blur="onBlur">
186
186
  </textarea>
187
- <span v-if="element === 'textarea' && showCharactersTextarea">{{ charactersTextarea }}</span>
187
+ <span v-if="element === 'textarea' && showCharactersTextarea" class="characters-left-wrapper">
188
+ <span v-if="textCharactersLeft">{{ textCharactersLeft }}</span>
189
+ <span :class="['characters-left', {error: charactersLeft === 0}]">{{ charactersLeft }}</span>
190
+ </span>
188
191
  <!-- end textarea -->
189
192
 
190
193
  <!-- begin searchfield -->
@@ -457,9 +460,9 @@ export default {
457
460
  * type-property must be set to textarea
458
461
  * showCharactersTextarea-property must be activated
459
462
  */
460
- textCharacters: {
463
+ textCharactersLeft: {
461
464
  type: String,
462
- default: "Characters"
465
+ default: "Characters left:"
463
466
  },
464
467
  /**
465
468
  * toggle visibility of search-button (next to search-field)
@@ -471,7 +474,7 @@ export default {
471
474
  /**
472
475
  * icon to delete search term
473
476
  *
474
- * element-property must me set to 'input'
477
+ * element-property must be set to 'input'
475
478
  * type-property must be set to 'search'
476
479
  *
477
480
  */
@@ -488,7 +491,7 @@ export default {
488
491
  /**
489
492
  * icon to search term
490
493
  *
491
- * element-property must me set to 'input'
494
+ * element-property must be set to 'input'
492
495
  * type-property must be set to 'search'
493
496
  *
494
497
  */
@@ -505,7 +508,7 @@ export default {
505
508
  /**
506
509
  * icon for error-validated items in list-of-requirements
507
510
  *
508
- * element-property must me set to 'input'
511
+ * element-property must be set to 'input'
509
512
  * showRequirements-subproperty (of CmdListOfRequirements) must be set to 'true'
510
513
  *
511
514
  */
@@ -522,7 +525,7 @@ export default {
522
525
  /**
523
526
  * icon for warning-validated items in list-of-requirements
524
527
  *
525
- * element-property must me set to 'input'
528
+ * element-property must be set to 'input'
526
529
  * showRequirements-subproperty (of CmdListOfRequirements) must be set to 'true'
527
530
  *
528
531
  */
@@ -539,7 +542,7 @@ export default {
539
542
  /**
540
543
  * icon for success-validated items in list-of-requirements
541
544
  *
542
- * element-property must me set to 'input'
545
+ * element-property must be set to 'input'
543
546
  * showRequirements-subproperty (of CmdListOfRequirements) must be set to 'true'
544
547
  *
545
548
  */
@@ -556,8 +559,8 @@ export default {
556
559
  /**
557
560
  * icon for info-validated items in list-of-requirements
558
561
  *
559
- * element-property must me set to 'input'
560
- * showRequirements-subproperty (of CmdListOfRequirements) must be set to 'true'
562
+ * element-property must be set to 'input'
563
+ * showRequirements-sub-property (of CmdListOfRequirements) must be set to 'true'
561
564
  *
562
565
  */
563
566
  iconHasStateInfo: {
@@ -600,7 +603,7 @@ export default {
600
603
  /**
601
604
  * icon to toggle password-visibility
602
605
  *
603
- * element-property must me set to 'input'
606
+ * element-property must be set to 'input'
604
607
  * type-property must be set to 'password'
605
608
  *
606
609
  */
@@ -617,7 +620,7 @@ export default {
617
620
  /**
618
621
  * icon to toggle password-visibility
619
622
  *
620
- * element-property must me set to 'input'
623
+ * element-property must be set to 'input'
621
624
  * type-property must be set to 'password'
622
625
  *
623
626
  */
@@ -626,7 +629,7 @@ export default {
626
629
  default() {
627
630
  return {
628
631
  show: true,
629
- iconClass: "icon-not-visible",
632
+ iconClass: "icon-not-visible"
630
633
  }
631
634
  }
632
635
  }
@@ -677,8 +680,8 @@ export default {
677
680
  }
678
681
  return false
679
682
  },
680
- charactersTextarea() {
681
- return this.textCharacters + " " + this.modelValue.length + "/" + this.getMaxLength()
683
+ charactersLeft() {
684
+ return this.getMaxLength() - this.modelValue.length
682
685
  },
683
686
  validationTooltip() {
684
687
  if (!this.useCustomTooltip) {
@@ -932,6 +935,24 @@ export default {
932
935
  }
933
936
  }
934
937
 
938
+ .characters-left-wrapper {
939
+ margin-top: calc(var(--default-margin) / 2);
940
+ display: block;
941
+
942
+ span:not(:only-child):first-child {
943
+ margin-right: calc(var(--default-margin) / 2);
944
+ color: var(--text-color);
945
+ }
946
+
947
+ .characters-left {
948
+ color: var(--text-color);
949
+
950
+ &.error {
951
+ color: var(--error-color);
952
+ }
953
+ }
954
+ }
955
+
935
956
  /* begin toggle-switch */
936
957
  /* no cmd-prefix-styling (class based on frontend-framework) */
937
958
  &.toggle-switch {
@@ -0,0 +1,167 @@
1
+ <template>
2
+ <aside :class="['cmd-sidebar', wrapperClass, {'box': styledAsBox, 'collapse-to-right': !collapseToLeft}]">
3
+ <!-- begin inner-sidebar-wrapper -->
4
+ <div class="inner-sidebar-wrapper">
5
+ <!-- begin CmdHeadline -->
6
+ <CmdHeadline
7
+ v-if="cmdHeadline?.headlineText && open"
8
+ :headlineText="cmdHeadline.headlineText"
9
+ :headlineLevel="cmdHeadline.headlineLevel || 3"
10
+ :textAlign="cmdHeadline.textAlign"
11
+ class="sidebar-main-headline"
12
+ />
13
+ <!-- end CmdHeadline -->
14
+
15
+ <!-- begin slot-content for open sidebar -->
16
+ <div v-if="open" class="open-slot-wrapper">
17
+ <slot name="open" :openBoxStatus="open"></slot>
18
+ </div>
19
+ <!-- end slot-content for open sidebar -->
20
+
21
+ <!-- begin slot-content for closed sidebar -->
22
+ <div v-else class="closed-slot-wrapper">
23
+ <slot name="closed" :openBoxStatus="open"></slot>
24
+ </div>
25
+ <!-- end slot-content for closed sidebar -->
26
+ </div>
27
+ <!-- end inner-sidebar-wrapper -->
28
+
29
+ <!-- begin column to toggle sidebar open-closed-status -->
30
+ <a v-if="collapsible"
31
+ href="#"
32
+ :title="open ? 'Collapse sidebar' : 'Expand sidebar'"
33
+ @click.prevent="toggleSidebar">
34
+ <span :class="iconClassOpenCollapse"></span>
35
+ </a>
36
+ <!-- end column to toggle sidebar open-closed-status -->
37
+ </aside>
38
+ </template>
39
+
40
+ <script>
41
+ export default {
42
+ name: "CmdSidebar",
43
+ data() {
44
+ return {
45
+ open: true
46
+ }
47
+ },
48
+ props: {
49
+ /**
50
+ * set if sidebar should be collapsible by the user
51
+ */
52
+ collapsible: {
53
+ type: Boolean,
54
+ default: true
55
+ },
56
+ /**
57
+ * set open/closed status from outside or as default
58
+ */
59
+ openSidebar: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ /**
64
+ * set if the sidebar should be styled as box (border, background, no padding in this case)
65
+ */
66
+ styledAsBox: {
67
+ type: Boolean,
68
+ default: true
69
+ },
70
+ /**
71
+ * set if the sidebar should collapse to the left (otherwise it will collapse to the right)
72
+ *
73
+ * collapsible-property must be set to true
74
+ */
75
+ collapseToLeft: {
76
+ type: Boolean,
77
+ default: true
78
+ },
79
+ /**
80
+ * properties for CmdHeadline-component
81
+ */
82
+ cmdHeadline: {
83
+ type: Object,
84
+ required: false
85
+ }
86
+ },
87
+ computed: {
88
+ wrapperClass() {
89
+ if (this.open) {
90
+ return 'open'
91
+ }
92
+ return 'closed'
93
+ },
94
+ iconClassOpenCollapse() {
95
+ if (this.collapseToLeft) {
96
+ if (this.open) {
97
+ return "icon-single-arrow-left"
98
+ }
99
+ return "icon-single-arrow-right"
100
+ } else {
101
+ if (this.open) {
102
+ return "icon-single-arrow-right"
103
+ }
104
+ return "icon-single-arrow-left"
105
+ }
106
+ }
107
+ },
108
+ methods: {
109
+ toggleSidebar() {
110
+ this.open = !this.open
111
+ this.$emit("toggleSidebar", this.open)
112
+ }
113
+ },
114
+ watch: {
115
+ openSidebar: {
116
+ handler() {
117
+ this.open = this.openSidebar
118
+ },
119
+ immediate: true
120
+ }
121
+ }
122
+ }
123
+ </script>
124
+
125
+ <style lang="scss">
126
+ .cmd-sidebar {
127
+ display: flex;
128
+ height: 100%;
129
+
130
+ &.box {
131
+ padding: 0;
132
+ }
133
+
134
+ .inner-sidebar-wrapper {
135
+ flex: 1;
136
+ display: flex;
137
+ flex-direction: column;
138
+
139
+ .cmd-headline.sidebar-main-headline {
140
+ padding: var(--default-padding);
141
+ margin: 0;
142
+ }
143
+ }
144
+
145
+ .open-slot-wrapper {
146
+ flex: 1;
147
+ }
148
+
149
+ & > a {
150
+ display: flex;
151
+ flex: none;
152
+ text-decoration: none;
153
+ padding: calc(var(--default-padding) / 2);
154
+ align-items: center;
155
+ border-left: var(--default-border);
156
+ }
157
+
158
+ &.collapse-to-right {
159
+ flex-direction: row-reverse;
160
+
161
+ > a {
162
+ border-left: 0;
163
+ border-right: var(--default-border);
164
+ }
165
+ }
166
+ }
167
+ </style>
@@ -1,12 +1,13 @@
1
1
  <template>
2
- <div :class="['cmd-table-wrapper', {'collapsed': !showTableData, 'full-width': fullWidth, 'has-caption': hasCaption}]">
2
+ <div
3
+ :class="['cmd-table-wrapper', {'collapsed': !showTableData, 'full-width': fullWidth, 'has-caption': hasCaption}]">
3
4
  <div v-if="collapsible || userCanToggleWidth" class="button-wrapper">
4
5
  <a v-if="userCanToggleWidth" class="button"
5
6
  href="#" @click.prevent="fullWidth = !fullWidth"
6
7
  :title="iconToggleWidth.tooltip"
7
8
  >
8
9
  <!-- begin CmdIcon -->
9
- <CmdIcon :iconClass="iconToggleWidth.iconClass" :type="iconToggleWidth.iconType" />
10
+ <CmdIcon :iconClass="iconToggleWidth.iconClass" :type="iconToggleWidth.iconType"/>
10
11
  <!-- end CmdIcon -->
11
12
  </a>
12
13
  <a v-if="collapsible" class="button"
@@ -14,12 +15,22 @@
14
15
  :title="showTableData ? iconCollapse.tooltip : iconExpand.tooltip"
15
16
  >
16
17
  <!-- begin CmdIcon -->
17
- <CmdIcon :iconClass="showTableData ? iconCollapse.iconClass : iconExpand.iconClass" :type="showTableData ? iconCollapse.iconType : iconExpand.iconType" />
18
+ <CmdIcon :iconClass="showTableData ? iconCollapse.iconClass : iconExpand.iconClass"
19
+ :type="showTableData ? iconCollapse.iconType : iconExpand.iconType"/>
18
20
  <!-- end CmdIcon -->
19
21
  </a>
20
22
  </div>
21
23
  <div class="inner-wrapper">
22
- <table :class="{'full-width': fullWidth}">
24
+ <!-- begin CmdSlideButton -->
25
+ <CmdSlideButton
26
+ v-if="showSlideButtons"
27
+ @click.prevent="scrollLeft"
28
+ slideButtonType="prev"
29
+ />
30
+ <!-- end CmdSlideButton -->
31
+
32
+ <!-- begin table -->
33
+ <table ref="table" :class="{'full-width': fullWidth, 'has-overflow': hasOverflow}">
23
34
  <caption v-if="tableData.caption?.text || caption?.text" :class="{ hidden: hideCaption }">
24
35
  {{ caption?.text || tableData.caption?.text }}
25
36
  </caption>
@@ -32,8 +43,10 @@
32
43
  </thead>
33
44
  <transition name="fade">
34
45
  <tbody v-show="showTableData" aria-expanded="true">
35
- <tr :class="{'active' : tableData.rowIndexHighlighted === indexRows}" v-for="(tablerows, indexRows) in tableData.tbody" :key="indexRows">
36
- <td :class="{'active' : tableData.columnIndexHighlighted === indexData}" v-for="(tabledata, indexData) in tablerows" :key="indexData">
46
+ <tr :class="{'active' : tableData.rowIndexHighlighted === indexRows}"
47
+ v-for="(tablerows, indexRows) in tableData.tbody" :key="indexRows">
48
+ <td :class="{'active' : tableData.columnIndexHighlighted === indexData}"
49
+ v-for="(tabledata, indexData) in tablerows" :key="indexData">
37
50
  {{ tabledata }}
38
51
  </td>
39
52
  </tr>
@@ -42,18 +55,28 @@
42
55
  <transition name="fade">
43
56
  <tfoot v-if="tableData.tfoot && tableData.tfoot.length && showTableData" aria-expanded="true">
44
57
  <tr>
45
- <td :class="{'active' : tableData.columnIndexHighlighted === indexFoot}" v-for="(tablefoot, indexFoot) in tableData.tfoot" :key="indexFoot">
58
+ <td :class="{'active' : tableData.columnIndexHighlighted === indexFoot}"
59
+ v-for="(tablefoot, indexFoot) in tableData.tfoot" :key="indexFoot">
46
60
  {{ tablefoot }}
47
61
  </td>
48
62
  </tr>
49
63
  </tfoot>
50
64
  </transition>
51
65
  </table>
66
+ <!-- end table -->
67
+
68
+ <!-- begin CmdSlideButton -->
69
+ <CmdSlideButton
70
+ v-if="showSlideButtons"
71
+ @click.prevent="scrollRight"
72
+ />
73
+ <!-- end CmdSlideButton -->
52
74
  </div>
53
75
  </div>
54
76
  </template>
55
77
 
56
78
  <script>
79
+ import { ref } from 'vue'
57
80
  export default {
58
81
  name: "CmdTable",
59
82
  data() {
@@ -100,6 +123,13 @@ export default {
100
123
  type: Boolean,
101
124
  default: true
102
125
  },
126
+ /**
127
+ * user can toggle width (full-width (=100% of parent container or as wide as table content) with button above table)
128
+ */
129
+ showSlideButtons: {
130
+ type: Boolean,
131
+ default: true
132
+ },
103
133
  /**
104
134
  * icon to expand table (vertically)
105
135
  *
@@ -168,6 +198,18 @@ export default {
168
198
  },
169
199
  hideCaption() {
170
200
  return this.caption?.show === false || (this.caption?.show !== true && !this.tableData.caption?.show)
201
+ },
202
+ hasOverflow() {
203
+ console.log("this.$refs.table", this.$refs.table)
204
+ // return this.$refs.table.scrollWidth > this.$refs.table.clientWidth
205
+ }
206
+ },
207
+ methods: {
208
+ scrollLeft() {
209
+ this.$refs.table.scrollLeft = 0
210
+ },
211
+ scrollRight() {
212
+ this.$refs.table.scrollRight = 0
171
213
  }
172
214
  }
173
215
  }
@@ -209,8 +251,20 @@ export default {
209
251
  }
210
252
 
211
253
  .inner-wrapper {
254
+ display: flex;
212
255
  overflow-x: auto;
213
256
  width: 100%;
257
+ padding: 0 4rem;
258
+ border: 1px solid red;
259
+
260
+ .cmd-slide-button {
261
+ left: 0;
262
+ }
263
+
264
+ .cmd-slide-button:last-child {
265
+ right: 0;
266
+ left: auto;
267
+ }
214
268
 
215
269
  table {
216
270
  table-layout: fixed;
@@ -108,7 +108,6 @@ export default {
108
108
  .cmd-tabs {
109
109
  > ul {
110
110
  margin-bottom: 0;
111
- display: -webkit-flex; /* Safari 6-8 */
112
111
  display: flex;
113
112
 
114
113
  > li {
@@ -142,6 +141,10 @@ export default {
142
141
  }
143
142
 
144
143
  &.active {
144
+ span, [class*="icon-"] {
145
+ color: var(--pure-white);
146
+ }
147
+
145
148
  &:hover, &:active {
146
149
  a, a:focus {
147
150
  color: var(--hyperlink-color);
@@ -151,7 +154,6 @@ export default {
151
154
  color: var(--hyperlink-color-highlighted);
152
155
  }
153
156
  }
154
-
155
157
  }
156
158
 
157
159
  a:focus {
@@ -161,7 +163,6 @@ export default {
161
163
  color: inherit !important;
162
164
  }
163
165
  }
164
-
165
166
  }
166
167
  }
167
168
 
package/src/index.js CHANGED
@@ -27,12 +27,13 @@ export { default as CmdMultistepFormProgressBar } from '@/components/CmdMultiste
27
27
  export { default as CmdOpeningHours } from '@/components/CmdOpeningHours.vue'
28
28
  export { default as CmdPager } from '@/components/CmdPager.vue'
29
29
  export { default as CmdProgressBar } from '@/components/CmdProgressBar.vue'
30
- export { default as CmdSocialNetworks } from '@/components/CmdSocialNetworks.vue'
30
+ export { default as CmdSidebar } from '@/components/CmdSidebar.vue'
31
31
  export { default as CmdSiteFooter } from '@/components/CmdSiteFooter.vue'
32
32
  export { default as CmdSiteHeader } from '@/components/CmdSiteHeader.vue'
33
33
  export { default as CmdSiteSearch } from '@/components/CmdSiteSearch.vue'
34
34
  export { default as CmdSlideButton } from '@/components/CmdSlideButton.vue'
35
35
  export { default as CmdSlideshow } from '@/components/CmdSlideshow.vue'
36
+ export { default as CmdSocialNetworks } from '@/components/CmdSocialNetworks.vue'
36
37
  export { default as CmdSwitchLanguage } from '@/components/CmdSwitchLanguage.vue'
37
38
  export { default as CmdSystemMessage } from '@/components/CmdSystemMessage.vue'
38
39
  export { default as CmdTable } from '@/components/CmdTable.vue'
package/src/main.js CHANGED
@@ -1,4 +1,4 @@
1
- /* import generated css from components */
1
+ /* begin imports css from comand-frontend-framework ---------------------------------------------------------------------------------------- */
2
2
  import "comand-frontend-framework/styles"
3
3
  /* end imports css from comand-frontend-framework ---------------------------------------------------------------------------------------- */
4
4
 
@@ -20,6 +20,9 @@ import directiveFocus from "./directives/focus"
20
20
  /* import additional iconfont containing company-logos */
21
21
  import '@/assets/styles/logos-iconfont.css'
22
22
 
23
+ /* import additional iconfont containing editmode-iconfont-icons */
24
+ import '@/assets/styles/editmode-iconfont.css'
25
+
23
26
  /* import css for global-styles */
24
27
  import '@/assets/styles/global-styles.scss'
25
28