comand-component-library 3.3.1 → 3.3.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comand-component-library",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "dependencies": {
20
20
  "clickout-event": "^1.1.2",
21
- "comand-frontend-framework": "^3.2.95",
21
+ "comand-frontend-framework": "^3.2.97",
22
22
  "core-js": "^3.20.1",
23
23
  "prismjs": "^1.27.0",
24
24
  "sass": "^1.54.9",
package/src/App.vue CHANGED
@@ -793,18 +793,21 @@
793
793
  <a id="section-boxes"></a>
794
794
  <CmdWidthLimitationWrapper>
795
795
  <h2 class="headline-demopage">Boxes</h2>
796
- <h3>Boxes in BoxWrapper with Flexbox</h3>
797
- <CmdBoxWrapper :useFlexbox="true">
798
- <CmdBox v-for="index in 14" :key="index" textBody="Content" :cmd-headline="{headlineText: 'Headline ' + index, headlineLevel: 5}" />
796
+ <CmdBoxWrapper :useFlexbox="true" :cmdHeadline="{headlineText: 'Boxes in BoxWrapper with flexbox', headlineLevel: 3}" >
797
+ <CmdBox v-for="index in 14" :key="index" textBody="Content" :cmd-headline="{headlineText: 'Headline ' + index, headlineLevel: 4}" />
799
798
  </CmdBoxWrapper>
800
- <h3>Content boxes</h3>
801
- <div class="grid-container-create-columns">
802
- <div class="grid-small-item">
799
+ <CmdBoxWrapper :useFlexbox="true" :cmdHeadline="{headlineText: 'Different examples of content-boxes (in BoxWrapper)', headlineLevel: 3}">
800
+ <CmdBox
801
+ :stretch-vertically="false"
802
+ :cmdHeadline="{headlineText: 'Box with cutoff text', headlineLevel: 4}"
803
+ textBody="This is a long text that is cutoff after a specific number of lines that can be defined by the property 'cutoffTextLines'"
804
+ :cutoff-text-lines="3"
805
+ />
803
806
  <CmdBox :useSlots="['header', 'body', 'footer']">
804
807
  <template v-slot:header>
805
- <h3>
806
- Headline for box
807
- </h3>
808
+ <h4>
809
+ Texts given by slots
810
+ </h4>
808
811
  </template>
809
812
  <template v-slot:body>
810
813
  <div class="padding">
@@ -812,7 +815,7 @@
812
815
  This content with paragraphs inside is placed inside the box-body.
813
816
  </p>
814
817
  <p>
815
- <strong>Header, Content and Footer of this box are given by slots.</strong>
818
+ <strong>Header, Content/Body and Footer of this box are given by slots.</strong>
816
819
  </p>
817
820
  </div>
818
821
  </template>
@@ -822,13 +825,11 @@
822
825
  </p>
823
826
  </template>
824
827
  </CmdBox>
825
- </div>
826
- <div class="grid-small-item">
827
- <CmdBox>
828
+ <CmdBox :useSlots="['header', 'body']">
828
829
  <template v-slot:header>
829
- <h3>
830
+ <h4>
830
831
  Box with links
831
- </h3>
832
+ </h4>
832
833
  </template>
833
834
  <template v-slot:body>
834
835
  <ul class="navigation">
@@ -838,31 +839,28 @@
838
839
  <li><a href="#" @click.prevent="">Link name 4</a></li>
839
840
  </ul>
840
841
  </template>
842
+ <!-- will not be displayed, because useSlots-property does not contain 'footer' in array -->
841
843
  <template v-slot:footer>
842
844
  <p>
843
845
  footer content
844
846
  </p>
845
847
  </template>
846
848
  </CmdBox>
847
- </div>
848
- <div class="grid-small-item">
849
- <CmdBox :cmdHeadline="{headlineText: 'Collapsible box', headlineLevel: 4}" :collapsible="true">
849
+ <CmdBox :useSlots="['header', 'body']" :cmdHeadline="{headlineText: 'Collapsible box', headlineLevel: 4}" :collapsible="true">
850
850
  <template v-slot:header>
851
- <h3>
851
+ <h4>
852
852
  Collapsible box with image
853
- </h3>
853
+ </h4>
854
854
  </template>
855
855
  <template v-slot:body>
856
- <img src="media/images/content-images/logo-business-edition-landscape.jpg" alt="Alternative text"/>
856
+ <img src="media/images/content-images/logo-business-edition-landscape.jpg" alt="Alternative text" />
857
857
  </template>
858
858
  </CmdBox>
859
- </div>
860
- <div class="grid-small-item">
861
- <CmdBox>
859
+ <CmdBox :useSlots="['header', 'body', 'footer']">
862
860
  <template v-slot:header>
863
- <h3>
861
+ <h4>
864
862
  Box with image and content
865
- </h3>
863
+ </h4>
866
864
  </template>
867
865
  <template v-slot:body>
868
866
  <img src="media/images/content-images/logo-business-edition-landscape.jpg" alt="Alternative text"/>
@@ -877,8 +875,7 @@
877
875
  </p>
878
876
  </template>
879
877
  </CmdBox>
880
- </div>
881
- </div>
878
+ </CmdBoxWrapper>
882
879
  <h3>Product boxes</h3>
883
880
  <div class="grid-container-create-columns">
884
881
  <div class="grid-small-item" v-for="(product, index) in boxProductData" :key="index">
@@ -10,7 +10,10 @@
10
10
  <dl v-if="showLabels">
11
11
  <!-- begin company -->
12
12
  <dt v-if="addressData.company?.value">
13
- <span v-if="addressData.company.iconClass && showLabelIcons" :class="addressData.company.iconClass" :title="getMessage('cmdaddressdata.labeltext.company')"></span>
13
+ <!-- begin CmdIcon -->
14
+ <CmdIcon v-if="addressData.company.iconClass && showLabelIcons" :iconClass="addressData.company.iconClass" :tooltip="getMessage('cmdaddressdata.labeltext.company')" />
15
+ <!-- end CmdIcon -->
16
+
14
17
  <span v-if="showLabelTexts">{{ getMessage('cmdaddressdata.labeltext.company')}}</span>
15
18
  </dt>
16
19
  <dd v-if="addressData.company?.value" class="org">{{ addressData.company.value }}</dd>
@@ -19,7 +22,10 @@
19
22
  <!-- begin address -->
20
23
  <template v-if="addressData.address && addressData.address !== undefined">
21
24
  <dt class="address">
22
- <span v-if="addressData.address.iconClass && showLabelIcons" :class="addressData.address.iconClass" :title="getMessage('cmdaddressdata.labeltext.address')"></span>
25
+ <!-- begin CmdIcon -->
26
+ <CmdIcon v-if="addressData.address.iconClass && showLabelIcons" :iconClass="addressData.address.iconClass" :tooltip="getMessage('cmdaddressdata.labeltext.address')" />
27
+ <!-- end CmdIcon -->
28
+
23
29
  <span v-if="showLabelTexts">{{ getMessage('cmdaddressdata.labeltext.address')}}</span>
24
30
  </dt>
25
31
  <dd v-if="addressData.address">
@@ -43,7 +49,10 @@
43
49
 
44
50
  <!-- begin telephone -->
45
51
  <dt v-if="addressData.telephone?.value">
46
- <span v-if="addressData.telephone.iconClass && showLabelIcons" :class="addressData.telephone.iconClass" :title="getMessage('cmdaddressdata.labeltext.telephone')"></span>
52
+ <!-- begin CmdIcon -->
53
+ <CmdIcon v-if="addressData.telephone.iconClass && showLabelIcons" :iconClass="addressData.telephone.iconClass" :tooltip="getMessage('cmdaddressdata.labeltext.telephone')" />
54
+ <!-- end CmdIcon -->
55
+
47
56
  <span v-if="showLabelTexts">{{ getMessage('cmdaddressdata.labeltext.telephone')}}</span>
48
57
  </dt>
49
58
  <dd v-if="addressData.telephone?.value">
@@ -53,7 +62,10 @@
53
62
 
54
63
  <!-- begin mobile phone -->
55
64
  <dt v-if="addressData.mobilephone?.value">
56
- <span v-if="addressData.mobilephone.iconClass && showLabelIcons" :class="addressData.mobilephone.iconClass" :title="getMessage('cmdaddressdata.labeltext.mobile_phone')"></span>
65
+ <!-- begin CmdIcon -->
66
+ <CmdIcon v-if="addressData.mobilephone.iconClass && showLabelIcons" :iconClass="addressData.mobilephone.iconClass" :tooltip="getMessage('cmdaddressdata.labeltext.mobile_phone')" />
67
+ <!-- end CmdIcon -->
68
+
57
69
  <span v-if="showLabelTexts">{{ getMessage('cmdaddressdata.labeltext.mobile_phone')}}</span>
58
70
  </dt>
59
71
  <dd v-if="addressData.mobilephone?.value">
@@ -63,7 +75,10 @@
63
75
 
64
76
  <!-- begin fax -->
65
77
  <dt v-if="addressData.fax?.value">
66
- <span v-if="addressData.fax.iconClass && showLabelIcons" :class="addressData.fax.iconClass" :title="getMessage('cmdaddressdata.labeltext.fax')"></span>
78
+ <!-- begin CmdIcon -->
79
+ <CmdIcon v-if="addressData.fax.iconClass && showLabelIcons" :iconClass="addressData.fax.iconClass" :tooltip="getMessage('cmdaddressdata.labeltext.fax')" />
80
+ <!-- end CmdIcon -->
81
+
67
82
  <span v-if="showLabelTexts">{{ getMessage('cmdaddressdata.labeltext.fax')}}</span>
68
83
  </dt>
69
84
  <dd v-if="addressData.fax?.value" class="fax">{{ addressData.fax.value }}</dd>
@@ -71,7 +86,10 @@
71
86
 
72
87
  <!-- begin email -->
73
88
  <dt v-if="addressData.email?.value">
74
- <span v-if="addressData.email.iconClass && showLabelIcons" :class="addressData.email.iconClass" :title="getMessage('cmdaddressdata.labeltext.email')"></span>
89
+ <!-- begin CmdIcon -->
90
+ <CmdIcon v-if="addressData.email.iconClass && showLabelIcons" :iconClass="addressData.email.iconClass" :tooltip="getMessage('cmdaddressdata.labeltext.email')" />
91
+ <!-- end CmdIcon -->
92
+
75
93
  <span v-if="showLabelTexts">{{ getMessage('cmdaddressdata.labeltext.email')}}</span>
76
94
  </dt>
77
95
  <dd class="email" v-if="addressData.email?.value">
@@ -125,12 +143,14 @@ import DefaultMessageProperties from "../mixins/CmdAddressData/DefaultMessagePro
125
143
 
126
144
  // import components
127
145
  import CmdHeadline from "./CmdHeadline"
146
+ import CmdIcon from "./CmdIcon"
128
147
 
129
148
  export default {
130
149
  name: "CmdAddressData",
131
150
  mixins: [I18n, DefaultMessageProperties],
132
151
  components: {
133
- CmdHeadline
152
+ CmdHeadline,
153
+ CmdIcon
134
154
  },
135
155
  props: {
136
156
  /**
@@ -1,14 +1,24 @@
1
1
  <template>
2
2
  <!-- begin cmd-back-to-top-button -->
3
3
  <transition name="fade">
4
- <a v-if="show" :class="iconBackToTop.iconClass" class="cmd-back-to-top-button" href="#" :title="iconBackToTop.tooltip" @click.prevent="onBackToTop"></a>
4
+ <a v-if="show" class="cmd-back-to-top-button" href="#" :title="iconBackToTop.tooltip" @click.prevent="onBackToTop">
5
+ <!-- begin CmdIcon -->
6
+ <CmdIcon :iconClass="iconBackToTop.iconClass" />
7
+ <!-- end CmdIcon -->
8
+ </a>
5
9
  </transition>
6
10
  <!-- end cmd-back-to-top-button -->
7
11
  </template>
8
12
 
9
13
  <script>
14
+ // import components
15
+ import CmdIcon from "./CmdIcon"
16
+
10
17
  export default {
11
18
  name: "CmdBackToTopButton",
19
+ components: {
20
+ CmdIcon
21
+ },
12
22
  data() {
13
23
  return {
14
24
  windowInnerHeight: window.innerHeight,
@@ -11,7 +11,9 @@
11
11
  <dd v-if="allowCopyByClick && entry.allowCopy">
12
12
  <span>{{ entry.value }}</span>
13
13
  <a href="#" @click.prevent="copyToClipboard(entry.value)" :title="iconCopy.tooltip">
14
- <span :class="iconCopy.iconClass"></span>
14
+ <!-- begin CmdIcon -->
15
+ <CmdIcon :iconClass="iconCopy.iconClass" />
16
+ <!-- end CmdIcon -->
15
17
  </a>
16
18
  </dd>
17
19
  <dd v-else :key="index">{{ entry.value }}</dd>
@@ -28,10 +30,14 @@
28
30
  <script>
29
31
  // import components
30
32
  import CmdHeadline from "./CmdHeadline"
33
+ import CmdIcon from "./CmdIcon"
31
34
 
32
35
  export default {
33
36
  name: "CmdBankAccountData",
34
- components: {CmdHeadline},
37
+ components: {
38
+ CmdHeadline,
39
+ CmdIcon
40
+ },
35
41
  props: {
36
42
  /**
37
43
  * bank account data
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <!-- begin boxType 'content' -->
3
3
  <div v-if="boxType === 'content'"
4
- :class="['cmd-box box content', {open : open, collapsible: collapsible, 'stretch-vertically': stretchVertically && open, 'stretch-horizontally': stretchHorizontally}]">
4
+ :class="['cmd-box box content', {open : open, collapsible: collapsible, 'stretch-vertically': stretchVertically && !collapsible, 'stretch-horizontally': stretchHorizontally}]">
5
5
  <template v-if="useSlots?.includes('header')">
6
6
  <!-- begin collapsible header with slot -->
7
7
  <div v-if="collapsible" class="box-header">
@@ -10,7 +10,9 @@
10
10
  <!-- end slot 'header' -->
11
11
 
12
12
  <a href="#" @click.prevent="toggleContentVisibility" :title="open ? iconOpen.tooltip : iconClosed.tooltip" class="toggle-icon">
13
- <span :class="[open ? iconOpen.iconClass : iconClosed.iconClass]"></span>
13
+ <!-- begin CmdIcon -->
14
+ <CmdIcon :iconClass="[open ? iconOpen.iconClass : iconClosed.iconClass]"></CmdIcon>
15
+ <!-- end CmdIcon -->
14
16
  </a>
15
17
  </div>
16
18
  <!-- end collapsible header with slot -->
@@ -32,7 +34,10 @@
32
34
  v-bind="cmdHeadline"
33
35
  />
34
36
  <!-- end CmdHeadline -->
35
- <span class="toggle-icon" :class="[open ? iconOpen.iconClass : iconClosed.iconClass]"></span>
37
+
38
+ <!-- begin CmdIcon -->
39
+ <CmdIcon class="toggle-icon" :iconClass="[open ? iconOpen.iconClass : iconClosed.iconClass]"></CmdIcon>
40
+ <!-- end CmdIcon -->
36
41
  </a>
37
42
  <!-- end header for collapsible -->
38
43
 
@@ -50,7 +55,9 @@
50
55
  <!-- begin slot 'body' -->
51
56
  <slot name="body">
52
57
  <transition :name="toggleTransition">
53
- <p class="padding">{{ textBody }}</p>
58
+ <div class="padding">
59
+ <p :class="{'cutoff-text': cutoffTextLines > 0, 'fade-last-line': fadeLastLine }">{{ textBody }}</p>
60
+ </div>
54
61
  </transition>
55
62
  </slot>
56
63
  <!-- end slot 'body' -->
@@ -125,12 +132,14 @@ import GlobalCurrency from "../mixins/GlobalCurrency"
125
132
 
126
133
  // import components
127
134
  import CmdHeadline from "./CmdHeadline"
135
+ import CmdIcon from "./CmdIcon"
128
136
  import CmdListOfLinks from "./CmdListOfLinks"
129
137
 
130
138
  export default {
131
139
  name: "CmdBox",
132
140
  components: {
133
141
  CmdHeadline,
142
+ CmdIcon,
134
143
  CmdListOfLinks,
135
144
  },
136
145
  mixins: [
@@ -167,6 +176,22 @@ export default {
167
176
  type: Boolean,
168
177
  default: false
169
178
  },
179
+ /**
180
+ * number of lines to show if text should be cutoff
181
+ */
182
+ cutoffTextLines: {
183
+ type: Number,
184
+ default: 0
185
+ },
186
+ /**
187
+ * show fade-effect on last line
188
+ *
189
+ * cutoffTextLines-property must be large 0
190
+ */
191
+ fadeLastLine: {
192
+ type: Boolean,
193
+ default: true
194
+ },
170
195
  /**
171
196
  * use transition to expand and collapse box-body
172
197
  *
@@ -307,6 +332,7 @@ export default {
307
332
  display: inline-flex;
308
333
  flex-direction: column;
309
334
  padding: 0;
335
+ align-self: start;
310
336
 
311
337
  &.stretch-horizontally {
312
338
  display: flex;
@@ -343,7 +369,7 @@ export default {
343
369
  // boyType === 'content'
344
370
  &.content {
345
371
  > * {
346
- > *:last-child {
372
+ *:last-child {
347
373
  margin-bottom: 0;
348
374
  }
349
375
  }
@@ -376,6 +402,21 @@ export default {
376
402
  flex-grow: 1;
377
403
  padding: 0;
378
404
 
405
+ p.cutoff-text {
406
+ overflow: hidden;
407
+ height: calc(var(--line-of-text-height) * v-bind(cutoffTextLines));
408
+
409
+ &.fade-last-line::after {
410
+ content: "";
411
+ width: 100%;
412
+ position: absolute;
413
+ left: 0;
414
+ bottom: 0;
415
+ height: var(--line-of-text-height);
416
+ background: linear-gradient(to bottom, transparent 0%, var(--default-background-color) 90%);
417
+ }
418
+ }
419
+
379
420
  .padding {
380
421
  padding: var(--default-padding);
381
422
  margin: 0;
@@ -1,22 +1,36 @@
1
1
  <template>
2
2
  <div class="cmd-box-wrapper">
3
- <div v-if="allowUserToToggleView || allowTogglingCollapsingBoxes" class="flex-container no-flex toggle-view">
4
- <a v-if="allowTogglingCollapsingBoxes" href="#" @click.prevent="toggleCollapsingBoxes" :title="collapsingBoxesOpen ? collapseBoxesIcon.tooltip : expandBoxesIcon.tooltip">
5
- <span :class="collapsingBoxesOpen ? expandBoxesIcon.iconClass : collapseBoxesIcon.iconClass"></span>
6
- </a>
7
- <a v-if="allowUserToToggleView" href="#" @click.prevent="oneBoxPerRow = !oneBoxPerRow" :title="oneBoxPerRow ? iconRowView.tooltip : iconGridView.tooltip">
8
- <span :class="oneBoxPerRow ? iconGridView.iconClass : iconRowView.iconClass"></span>
9
- </a>
3
+ <div class="flex-container no-flex headline-wrapper">
4
+ <!-- begin CmdHeadline -->
5
+ <CmdHeadline v-if="cmdHeadline.headlineText" v-bind="cmdHeadline" />
6
+ <!-- end CmdHeadline -->
7
+
8
+ <div v-if="allowUserToToggleOrientation || allowTogglingCollapsingBoxes" class="options-wrapper">
9
+ <a v-if="allowTogglingCollapsingBoxes" href="#" @click.prevent="toggleCollapsingBoxes" :title="collapsingBoxesOpen ? collapseBoxesIcon.tooltip : expandBoxesIcon.tooltip">
10
+ <CmdIcon :iconClass="collapsingBoxesOpen ? expandBoxesIcon.iconClass : collapseBoxesIcon.iconClass"/>
11
+ </a>
12
+ <a v-if="allowUserToToggleOrientation" href="#" @click.prevent="oneBoxPerRow = !oneBoxPerRow" :title="oneBoxPerRow ? iconRowView.tooltip : iconGridView.tooltip">
13
+ <CmdIcon :iconClass="oneBoxPerRow ? iconGridView.iconClass : iconRowView.iconClass"/>
14
+ </a>
15
+ </div>
10
16
  </div>
11
- <div :class="[useFlexbox ? 'flex-container' : 'grid-container-create-columns', {'one-box-per-row': oneBoxPerRow}]">
17
+ <div :class="[useFlexbox ? 'flex-container' : 'grid-container-create-columns', {'one-box-per-row': oneBoxPerRow, 'stretch-boxes-vertically': stretchBoxesVertically}]">
12
18
  <slot :collapsingBoxesOpen="collapsingBoxesOpen" :boxToggled="boxToggled" :currentOpenBox="currentOpenBox"></slot>
13
19
  </div>
14
20
  </div>
15
21
  </template>
16
22
 
17
23
  <script>
24
+ // import components
25
+ import CmdHeadline from "./CmdHeadline"
26
+ import CmdIcon from "./CmdIcon"
27
+
18
28
  export default {
19
29
  name: "CmdBoxWrapper",
30
+ components: {
31
+ CmdHeadline,
32
+ CmdIcon
33
+ },
20
34
  data() {
21
35
  return {
22
36
  oneBoxPerRow: this.useRowViewAsDefault,
@@ -33,9 +47,18 @@ export default {
33
47
  default: false
34
48
  },
35
49
  /**
36
- * activate if user can toggle grid- and row-view by himself
50
+ * stretch boxes inside vertically to same height
51
+ *
52
+ * will not take effect on collapsable boxes
53
+ */
54
+ stretchBoxesVertically: {
55
+ type: Boolean,
56
+ default: true
57
+ },
58
+ /**
59
+ * activate if user can toggle grid- and row-orientation by himself
37
60
  */
38
- allowUserToToggleView: {
61
+ allowUserToToggleOrientation: {
39
62
  type: Boolean,
40
63
  default: true
41
64
  },
@@ -79,6 +102,9 @@ export default {
79
102
  },
80
103
  /**
81
104
  * define the number of boxes per row (if view is grid-view)
105
+ *
106
+ * useFlexbox-property must be set to true
107
+ * slot may not be used
82
108
  */
83
109
  boxesPerRow: {
84
110
  type: [Number, Array],
@@ -103,12 +129,24 @@ export default {
103
129
  */
104
130
  iconRowView: {
105
131
  type: Object,
106
- default () {
132
+ default() {
107
133
  return {
108
134
  iconClass: 'icon-rows',
109
135
  tooltip: 'Toggle to grid view'
110
136
  }
111
137
  }
138
+ },
139
+ /**
140
+ * properties for CmdHeadline-component
141
+ */
142
+ cmdHeadline: {
143
+ type: Object,
144
+ default() {
145
+ return {
146
+ headlineText: "",
147
+ headlineLevel: 4
148
+ }
149
+ }
112
150
  }
113
151
  },
114
152
  computed: {
@@ -167,19 +205,41 @@ export default {
167
205
  @import '../assets/styles/variables';
168
206
 
169
207
  .cmd-box-wrapper {
170
- > .toggle-view {
171
- justify-content: flex-end;
208
+ display: flex;
209
+ flex-direction: column;
210
+ gap: calc(var(--default-gap) / 2);
211
+
212
+ &:not(:first-child) {
213
+ margin-top: calc(var(--default-margin) * 2);
214
+ }
215
+
216
+ > .headline-wrapper {
217
+ align-items: center;
218
+ justify-content: space-between;
172
219
  }
173
220
 
174
221
  > .flex-container {
175
222
  .cmd-headline {
176
- > * {
177
- white-space: nowrap;
178
- }
223
+ margin: 0;
179
224
  }
180
225
 
181
226
  &.one-box-per-row {
182
227
  flex-direction: column;
228
+
229
+ p.cutoff-text {
230
+ height: auto;
231
+
232
+ &.fade-last-line::after {
233
+ background: none;
234
+ }
235
+ }
236
+ }
237
+
238
+ &.stretch-boxes-vertically {
239
+ .stretch-vertically {
240
+ align-self: stretch;
241
+ height: auto; /* must be set to auto if inner boxes have als stretchVertically-property activated */
242
+ }
183
243
  }
184
244
  }
185
245
 
@@ -187,14 +247,6 @@ export default {
187
247
  grid-template-columns: repeat(v-bind(boxesPerRowLarge), minmax(0, 1fr));
188
248
  }
189
249
 
190
- .cmd-box {
191
- &.content {
192
- &.collapsible {
193
- align-self: flex-start;
194
- }
195
- }
196
- }
197
-
198
250
  @media only screen and (max-width: $medium-max-width) {
199
251
  > .grid-container-create-columns {
200
252
  grid-template-columns: repeat(v-bind(boxesPerRowMedium), minmax(0, 1fr));
@@ -1,21 +1,34 @@
1
1
  <template>
2
2
  <div :class="['cmd-headline', { 'has-pre-headline-text': preHeadlineText, 'has-icon': iconClass}]">
3
- <span v-if="iconClass" :class="iconClass"></span>
3
+ <!-- begin CmdIcon -->
4
+ <CmdIcon v-if="iconClass" :iconClass="iconClass" />
5
+ <!-- end CmdIcon -->
6
+
4
7
  <div v-if="preHeadlineText">
5
8
  <span class="pre-headline-text">{{ preHeadlineText }}</span>
6
9
  <component :is="getHeadlineTag">
10
+ <!-- being slot -->
7
11
  <slot>{{ headlineText }}</slot>
12
+ <!-- end slot -->
8
13
  </component>
9
14
  </div>
10
15
  <component v-else :is="getHeadlineTag">
16
+ <!-- being slot -->
11
17
  <slot>{{ headlineText }}</slot>
18
+ <!-- end slot -->
12
19
  </component>
13
20
  </div>
14
21
  </template>
15
22
 
16
23
  <script>
24
+ // import components
25
+ import CmdIcon from "./CmdIcon"
26
+
17
27
  export default {
18
28
  name: "CmdHeadline",
29
+ components: {
30
+ CmdIcon
31
+ },
19
32
  props: {
20
33
  /**
21
34
  * text for headline
@@ -13,7 +13,7 @@
13
13
  <!-- begin main-level -->
14
14
  <ul :class="{'stretch-items' : stretchMainItems}">
15
15
  <li class="close-nav" v-if="showOffcanvas">
16
- <a href="#" @click.prevent="showOffcanvas = false">
16
+ <a href="#" id="close-offcanvas" role="button" @click.prevent="closeOffcanvasNavigation">
17
17
  <span v-if="closeOffcanvas.iconClass" :class="closeOffcanvas.iconClass"></span>
18
18
  <span :class="{'hidden': !closeOffcanvas.showText}">{{ closeOffcanvas.text }}</span>
19
19
  </a>
@@ -125,8 +125,7 @@
125
125
  </nav>
126
126
 
127
127
  <!-- begin offCanvasButton -->
128
- <a href="#" class="button" id="toggle-offcanvas" @click.prevent="showOffcanvas = !showOffcanvas"
129
- v-if="persistOnMobile === false">
128
+ <a v-if="persistOnMobile === false" href="#" class="button" id="toggle-offcanvas" @click.prevent="toggleOffcanvasNavigation">
130
129
  <span :class="buttonOffcanvas.iconClass"></span>
131
130
  <span :class="{'hidden' : !buttonOffcanvas.showText}">{{ buttonOffcanvas.text }}</span>
132
131
  </a>
@@ -264,6 +263,19 @@ export default {
264
263
  },
265
264
  getRoute(navigationEntry) {
266
265
  return getRoute(navigationEntry)
266
+ },
267
+ closeOffcanvasNavigation() {
268
+ this.showOffcanvas = false
269
+ document.getElementById("toggle-offcanvas").focus()
270
+ },
271
+ toggleOffcanvasNavigation() {
272
+ if (this.showOffcanvas) {
273
+ this.closeOffcanvasNavigation()
274
+ } else {
275
+ // open offcanvas
276
+ this.showOffcanvas = true
277
+ this.$nextTick(() => document.getElementById("close-offcanvas").focus())
278
+ }
267
279
  }
268
280
  }
269
281
  }