comand-component-library 4.3.21 → 4.3.22

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": "4.3.21",
3
+ "version": "4.3.22",
4
4
  "license": "GPL-3.0-only",
5
5
  "author": "CoManD-UI",
6
6
  "private": false,
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "clickout-event": "^1.1.2",
32
- "comand-frontend-framework": "^4.3.42",
32
+ "comand-frontend-framework": "^4.3.43",
33
33
  "comand-ui-iconfonts": "^1.0.19",
34
34
  "core-js": "^3.20.1",
35
35
  "prismjs": "^1.27.0",
@@ -175,38 +175,41 @@
175
175
  <a href="#" class="button small icon-cog" title="Open Component Settings"
176
176
  @click.prevent="openSettingsSidebar('CmdAccordion')"></a>
177
177
  </h2>
178
- <CmdAccordion ref="CmdAccordion" open :name="accordionData.name"
179
- :cmdHeadline="{ headlineText: 'Summary (no highlighting)' }"
180
- :textAccordionBody="accordionData.textAccordionBody" v-bind="cmdAccordionSettingsData" />
178
+ <CmdAccordion ref="CmdAccordion" open :name="accordionData.name"
179
+ :cmdHeadline="{ headlineText: 'Summary (no highlighting)' }"
180
+ :textAccordionBody="accordionData[0].textAccordionBody" v-bind="cmdAccordionSettingsData" />
181
181
  <CmdAccordion highlightLevel="primary" :name="accordionData.name"
182
182
  :cmdHeadline="{ headlineText: 'Summary (primary highlighting)' }"
183
- :textAccordionBody="accordionData.textAccordionBody" />
183
+ :textAccordionBody="accordionData[1].textAccordionBody" />
184
184
  <CmdAccordion highlightLevel="secondary" :name="accordionData.name"
185
185
  :cmdHeadline="{ headlineText: 'Summary (secondary highlighting)' }"
186
- :textAccordionBody="accordionData.textAccordionBody" />
186
+ :textAccordionBody="accordionData[2].textAccordionBody" />
187
187
  <CmdAccordion highlightLevel="tertiary" :name="accordionData.name"
188
188
  :cmdHeadline="{ headlineText: 'Summary (tertiary highlighting)' }"
189
- :textAccordionBody="accordionData.textAccordionBody" />
189
+ :textAccordionBody="accordionData[3].textAccordionBody" />
190
190
  </CmdWidthLimitationWrapper>
191
191
  <!-- end accordion --------------------------------------------------------------------------------------------------->
192
192
 
193
193
  <!-- begin accordions-wrapper --------------------------------------------------------------------------------------------------->
194
194
  <CmdWidthLimitationWrapper>
195
- <h2 class="headline-demopage" id="section-accordion">
195
+ <h2 class="headline-demopage" id="section-accordions-wrapper">
196
196
  <span>Accordions-Wrapper</span>
197
197
  <a href="#" class="button small icon-cog" title="Open Component Settings"
198
198
  @click.prevent="openSettingsSidebar('CmdAccordionsWrapper')"></a>
199
199
  </h2>
200
- <CmdAccordionsWrapper :useGap="false" :useRowViewAsDefault="true">
200
+ <CmdAccordionsWrapper ref="CmdAccordionsWrapper" v-bind="cmdAccordionsWrapperSettingsData">
201
201
  <template v-slot="slotProps">
202
202
  <CmdAccordion
203
- v-for="(accordion, index) in 5"
203
+ v-for="(accordion, index) in accordionData"
204
204
  :key="index"
205
205
  open
206
- :name="accordionData.name"
207
- :cmdHeadline="{ headlineText: 'Summary Accordion #' + (index + 1) }"
206
+ :accordionName="accordion.name"
207
+ :cmdHeadline="{ headlineText: accordion.cmdHeadline.headlineText }"
208
208
  :rowView="slotProps.rowView"
209
- :textAccordionBody="accordionData.textAccordionBody"
209
+ :openAccordionHasFullWidth="slotProps.fullWidth"
210
+ :textAccordionBody="accordion.textAccordionBody"
211
+ :allowMultipleExpandedBoxes="slotProps.allowMultipleExpandedBoxes"
212
+ :summaryWritingMode="slotProps.summaryWritingMode"
210
213
  />
211
214
  </template>
212
215
  </CmdAccordionsWrapper>
@@ -1011,7 +1014,7 @@
1011
1014
  </CmdWidthLimitationWrapper>
1012
1015
  <!-- end flexible-scroll-container --------------------------------------------------------------------------------------------------->
1013
1016
 
1014
- <!-- begin footnote --------------------------------------------------------------------------------------------------->
1017
+ <!-- begin footnotes --------------------------------------------------------------------------------------------------->
1015
1018
  <CmdWidthLimitationWrapper>
1016
1019
  <h2 class="headline-demopage" id="section-footnote">
1017
1020
  <span>Footnotes</span>
@@ -1021,18 +1024,15 @@
1021
1024
  <CmdFootnote
1022
1025
  ref="CmdFootnote"
1023
1026
  v-bind="cmdFootnoteSettingsData"
1024
- :cmdHeadline="{ headlineText: 'Footnote with asterisks', headlineLevel: 3}"
1025
- descriptionTermType="asterisk"
1026
- :descriptionData="footnoteData.descriptionData"
1027
+ :descriptionData="footnoteData[0].descriptionData"
1027
1028
  />
1028
1029
  <CmdFootnote
1029
- :cmdHeadline="{ headlineText: 'Footnote with numbers', headlineLevel: 3}"
1030
- descriptionTermType="number"
1031
- :descriptionData="footnoteData.descriptionData"
1030
+ :descriptionData="footnoteData[1].descriptionData"
1031
+ :descriptionTermType="footnoteData[1].descriptionTermType"
1032
1032
  />
1033
1033
 
1034
1034
  </CmdWidthLimitationWrapper>
1035
- <!-- end footnote --------------------------------------------------------------------------------------------------->
1035
+ <!-- end footnotes --------------------------------------------------------------------------------------------------->
1036
1036
 
1037
1037
  <!-- begin forms --------------------------------------------------------------------------------------------------->
1038
1038
  <CmdWidthLimitationWrapper>
@@ -1,8 +1,41 @@
1
- {
2
- "name": "accordion-name",
3
- "cmdHeadline": {
4
- "headlineText": "Summary",
5
- "headlineLevel": 4
1
+ [
2
+ {
3
+ "name": "accordion-name",
4
+ "cmdHeadline": {
5
+ "headlineText": "Summary #1",
6
+ "headlineLevel": 4
7
+ },
8
+ "textAccordionBody": "This is text for accordion body #1!"
6
9
  },
7
- "textAccordionBody": "This is text for accordion body!"
8
- }
10
+ {
11
+ "name": "accordion-name",
12
+ "cmdHeadline": {
13
+ "headlineText": "Summary #2",
14
+ "headlineLevel": 4
15
+ },
16
+ "textAccordionBody": "This is text for accordion body #2!"
17
+ },
18
+ {
19
+ "name": "accordion-name",
20
+ "cmdHeadline": {
21
+ "headlineText": "Summary #3",
22
+ "headlineLevel": 4
23
+ },
24
+ "textAccordionBody": "This is text for accordion body #3!"
25
+ },
26
+ {
27
+ "name": "accordion-name",
28
+ "cmdHeadline": {
29
+ "headlineText": "Summary #4",
30
+ "headlineLevel": 4
31
+ },
32
+ "textAccordionBody": "This is text for accordion body #4!"
33
+ }, {
34
+ "name": "accordion-name",
35
+ "cmdHeadline": {
36
+ "headlineText": "Summary #5",
37
+ "headlineLevel": 4
38
+ },
39
+ "textAccordionBody": "This is text for accordion body #5!"
40
+ }
41
+ ]
@@ -1,8 +1,18 @@
1
- {
2
- "descriptionTermType": "number",
3
- "descriptionData": [
4
- "Footnotetext #1",
5
- "Footnotetext #2",
6
- "Footnotetext #3"
7
- ]
8
- }
1
+ [
2
+ {
3
+ "descriptionTermType": "asterisk",
4
+ "descriptionData": [
5
+ "Footnotetext #1",
6
+ "Footnotetext #2",
7
+ "Footnotetext #3"
8
+ ]
9
+ },
10
+ {
11
+ "descriptionTermType": "number",
12
+ "descriptionData": [
13
+ "Footnotetext #1",
14
+ "Footnotetext #2",
15
+ "Footnotetext #3"
16
+ ]
17
+ }
18
+ ]
@@ -1,5 +1,6 @@
1
1
  [
2
2
  "Accordion",
3
+ "AccordionsWrapper",
3
4
  "AddressData",
4
5
  "AdvancedFormElements",
5
6
  "BankAccountData",
@@ -11,6 +11,16 @@ export default {
11
11
  }
12
12
  },
13
13
  cmdAccordionSettingsControls: {
14
+ summaryWritingMode: [
15
+ {
16
+ text: "horizontal (default)",
17
+ value: "horizontal"
18
+ },
19
+ {
20
+ text: "vertical",
21
+ value: "vertical"
22
+ }
23
+ ],
14
24
  highlightLevel: [
15
25
  {
16
26
  text: "none (default)",
@@ -30,6 +40,29 @@ export default {
30
40
  }
31
41
  ]
32
42
  },
43
+ cmdAccordionsWrapperSettingsData: {
44
+ cmdHeadline: {
45
+ headlineText: "Accordions provided by Slot",
46
+ headlineLevel: 4
47
+ },
48
+ useGap: true,
49
+ useRowViewAsDefault: false,
50
+ fullWidth: true,
51
+ allowUserToToggleOrientation: true,
52
+ allowMultipleExpandedBoxes: false
53
+ },
54
+ cmdAccordionsWrapperSettingsControls: {
55
+ summaryWritingMode: [
56
+ {
57
+ text: "horizontal (default)",
58
+ value: "horizontal"
59
+ },
60
+ {
61
+ text: "vertical",
62
+ value: "vertical"
63
+ }
64
+ ]
65
+ },
33
66
  cmdAddressDataSettingsData: {
34
67
  cmdHeadline: {
35
68
  headlineText: "Address Data",
@@ -40,7 +73,8 @@ export default {
40
73
  showLabelTexts: false,
41
74
  showIconsOnly: false,
42
75
  showLabels: true,
43
- showCityBeforeZip: false
76
+ showCityBeforeZip: false,
77
+ styleAsBox: false
44
78
  },
45
79
  cmdAddressDataSettingsControls: {
46
80
  contentOrientation: [
@@ -60,7 +94,8 @@ export default {
60
94
  headlineLevel: 3
61
95
  },
62
96
  allowCopyByClick: false,
63
- additionalInformation: ""
97
+ additionalInformation: "",
98
+ styleAsBox: false
64
99
  },
65
100
  cmdBreadcrumbsSettingsData: {
66
101
  breadcrumbLabel: "You are here:",
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <!-- begin CmdAccordion ---------------------------------------------------------------------------------------- -->
3
- <details ref="cmdAccordion" :class="['cmd-accordion', highlightLevel, { 'flex-container no-gap' : rowView }]" :name="accordionName">
4
- <summary :class="{'writing-mode-vertical' : summaryWritingMode}">
3
+ <details ref="cmdAccordion"
4
+ :class="['cmd-accordion', highlightLevel, { 'flex-container no-gap' : rowView, 'stretch-to-full-width': openAccordionHasFullWidth }]"
5
+ :name="generateAccordionName"
6
+ >
7
+ <summary :class="{'writing-mode-vertical' : summaryWritingMode === 'vertical'}">
5
8
  <!--
6
9
  <span :class="[cmdIconClosed.iconClass, 'closed']" :title="cmdIconClosed.tooltip"></span>
7
10
  <span :class="[cmdIconOpen.iconClass, 'open']" :title="cmdIconOpen.tooltip"></span>
@@ -26,6 +29,8 @@
26
29
  </template>
27
30
 
28
31
  <script>
32
+ import {createUuid} from "../utils/common.js"
33
+
29
34
  export default {
30
35
  name: "CmdAccordion",
31
36
  mounted() {
@@ -78,6 +83,15 @@ export default {
78
83
  type: String,
79
84
  required: false
80
85
  },
86
+ /**
87
+ * open accordion uses remaining space in accordions-wrapper
88
+ *
89
+ * rowView must be false
90
+ */
91
+ openAccordionHasFullWidth: {
92
+ type: Boolean,
93
+ default: true
94
+ },
81
95
  /**
82
96
  * properties for CmdIcon-component if accordion is collapsed/closed
83
97
  */
@@ -130,9 +144,18 @@ export default {
130
144
  * accordion-name is required if multiple-accrdion-boxes should be connect (name must be identical)
131
145
  */
132
146
  accordionName: {
133
- type: Object,
147
+ type: String,
134
148
  required: false
135
149
  },
150
+ /**
151
+ * multiple boxes can be expanded if activated
152
+ *
153
+ * accordionName-property must have different value or kept empty for each accordion-box in wrapper
154
+ */
155
+ allowMultipleExpandedBoxes: {
156
+ type: Boolean,
157
+ default: false
158
+ },
136
159
  /**
137
160
  * properties for CmdHeadline-component
138
161
  */
@@ -142,6 +165,9 @@ export default {
142
165
  }
143
166
  },
144
167
  computed: {
168
+ generateAccordionName() {
169
+ return this.allowMultipleExpandedBoxes ? this.accordionName + "-" + createUuid() : this.accordionName
170
+ },
145
171
  cmdHeadlineProperties() {
146
172
  return {
147
173
  headlineLevel: 4,
@@ -170,6 +196,9 @@ export default {
170
196
  isOpen() {
171
197
  return this.$refs.cmdAccordion?.open + "test"
172
198
  }
199
+ },
200
+ mounted() {
201
+ this.isOpen()
173
202
  }
174
203
  }
175
204
  </script>
@@ -189,12 +218,16 @@ export default {
189
218
  summary {
190
219
  border: 0;
191
220
  }
221
+
222
+ &.stretch-to-full-width {
223
+ flex: 1; /* stretch accordion-body over remaining (horizontal) space in accordion-wrapper */
224
+ }
192
225
  }
193
226
 
194
227
  summary.writing-mode-vertical {
195
228
  writing-mode: vertical-rl;
196
229
  transform: rotate(180deg);
197
- }
230
+ }
198
231
  }
199
232
  /* end rowView */
200
233
 
@@ -2,22 +2,20 @@
2
2
  <!-- begin CmdBoxWrapper ---------------------------------------------------------------------------------------- -->
3
3
  <div class="cmd-accordions-wrapper">
4
4
  <div v-if="cmdHeadline.headlineText || allowUserToToggleOrientation" class="flex-container headline-wrapper">
5
- <!-- begin CmdHeadline -->
6
5
  <CmdHeadline v-if="cmdHeadline.headlineText" v-bind="cmdHeadline" />
7
- <!-- end CmdHeadline -->
8
6
 
7
+ <!-- begin toggle orientation TODO: replace by CmdLink -->
9
8
  <div v-if="allowUserToToggleOrientation" class="options-wrapper">
10
- <a href="#" @click.prevent="toggleOrientation" :title="rowView ? iconRowView.tooltip : iconColumnView.tooltip">
11
- <!-- begin CmdIcon -->
9
+ <a href="#" @click.prevent="toggleOrientation" class="toggle-orientation" :title="rowView ? iconRowView.tooltip : iconColumnView.tooltip">
12
10
  <CmdIcon :iconClass="rowView ? iconColumnView.iconClass : iconRowView.iconClass" :type="rowView ? iconColumnView.iconType : iconRowView.iconType" />
13
- <!-- end CmdIcon -->
14
11
  </a>
15
12
  </div>
13
+ <!-- begin end orientation -->
16
14
  </div>
17
- <div :class="['inner-accordions-wrapper',
15
+ <div :class="['inner-accordions-wrapper flex-container',
18
16
  {
19
17
  'no-gap': !useGap,
20
- 'flex-container' : rowView
18
+ 'flex-direction-column' : !rowView
21
19
  }
22
20
  ]">
23
21
  <slot
@@ -25,8 +23,9 @@
25
23
  :boxToggled="boxToggled"
26
24
  :boxIsOpen="boxIsOpen"
27
25
  :rowView="rowView"
26
+ :openAccordionHasFullWidth="fullWidth"
28
27
  :summaryWritingMode="summaryWritingMode"
29
- @toggleCollapse="boxIsToggled"
28
+ :allowMultipleExpandedBoxes="allowMultipleExpandedBoxes"
30
29
  >
31
30
  </slot>
32
31
  </div>
@@ -55,7 +54,6 @@ export default {
55
54
  type: Array,
56
55
  required: false
57
56
  },
58
-
59
57
  /**
60
58
  * activate if a gap between boxes should be used
61
59
  */
@@ -70,6 +68,15 @@ export default {
70
68
  type: Boolean,
71
69
  default: false
72
70
  },
71
+ /**
72
+ * open accordion uses remaining space in accordions-wrapper
73
+ *
74
+ * rowView must be false
75
+ */
76
+ fullWidth: {
77
+ type: Boolean,
78
+ default: true
79
+ },
73
80
  /**
74
81
  * set direction of text for summary
75
82
  *
@@ -165,40 +172,9 @@ export default {
165
172
  methods: {
166
173
  toggleOrientation() {
167
174
  this.rowView = !this.rowView
168
- this.oneBoxPerRow = this.rowView
169
- },
170
- boxIsOpen(index) {
171
- return this.currentOpenBox.includes(index)
172
- },
173
- toggleCollapsingBoxes() {
174
- this.collapsingBoxesOpen = !this.collapsingBoxesOpen
175
- },
176
- boxToggled(boxIndex, open) {
177
- if(this.allowMultipleExpandedBoxes) {
178
- if(open) {
179
- this.currentOpenBox.push(boxIndex)
180
- } else {
181
- // remove boxIndex from array to close specific box
182
- let position = this.currentOpenBox.indexOf(boxIndex)
183
- this.currentOpenBox.splice(position, 1)
184
- }
185
- } else {
186
- this.currentOpenBox = []
187
-
188
- // add current boxIndex to array to open specific box
189
- if(open) {
190
- this.currentOpenBox.push(boxIndex)
191
- }
192
- }
193
175
  }
194
176
  },
195
177
  watch: {
196
- openBoxesByDefault: {
197
- handler() {
198
- this.currentOpenBox = [...this.openBoxesByDefault || []]
199
- },
200
- immediate: true
201
- },
202
178
  useRowViewAsDefault: {
203
179
  handler() {
204
180
  this.oneBoxPerRow = this.useRowViewAsDefault
@@ -212,11 +188,37 @@ export default {
212
188
  <style>
213
189
  /* begin cmd-accordions-wrapper ---------------------------------------------------------------------------------------- */
214
190
  .cmd-accordions-wrapper {
191
+ .headline-wrapper {
192
+ align-items: center;
193
+
194
+ .options-wrapper {
195
+ flex: none;
196
+
197
+ }
198
+ }
199
+
215
200
  .inner-accordions-wrapper {
216
201
  .cmd-accordion {
217
202
  flex: none;
218
203
  }
219
204
  }
220
205
  }
206
+ </style>
207
+
208
+ <style lang="scss">
209
+ @import '../assets/styles/variables';
210
+
211
+ @media only screen and (max-width: $medium-max-width) {
212
+ .cmd-accordions-wrapper {
213
+ .toggle-orientation {
214
+ display: none; /* hide button, because accordions are displayed vertically only at this screen-resolution */
215
+ }
216
+
217
+ .inner-accordions-wrapper {
218
+ flex-direction: column; /* force accordions to be displayed vertically */
219
+ }
220
+ }
221
+ }
221
222
  /* end cmd-accordions-wrapper ---------------------------------------------------------------------------------------- */
222
- </style>
223
+ </style>
224
+
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <!-- begin CmdAddressData ---------------------------------------------------------------------------------------- -->
3
- <div class="cmd-address-data vcard">
3
+ <div :class="['cmd-address-data vcard', {box: styleAsBox}]">
4
4
  <!-- begin slot -->
5
5
  <template v-if="useSlot">
6
6
  <slot></slot>
@@ -184,6 +184,13 @@ export default {
184
184
  name: "CmdAddressData",
185
185
  mixins: [EditMode],
186
186
  props: {
187
+ /**
188
+ * style component as a box
189
+ */
190
+ styleAsBox: {
191
+ type: Boolean,
192
+ default: false
193
+ },
187
194
  /**
188
195
  * activate if you want to use slot instead for given structure
189
196
  */
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <!-- begin CmdBankAccountData ---------------------------------------------------------------------------------------- -->
3
- <div class="cmd-bank-account-data">
3
+ <div :class="['cmd-bank-account-data', {box: styleAsBox}]">
4
4
  <!-- begin slot -->
5
5
  <template v-if="useSlot">
6
6
  <slot></slot>
@@ -41,6 +41,13 @@
41
41
  export default {
42
42
  name: "CmdBankAccountData",
43
43
  props: {
44
+ /**
45
+ * style component as a box
46
+ */
47
+ styleAsBox: {
48
+ type: Boolean,
49
+ default: false
50
+ },
44
51
  /**
45
52
  * activate if you want to use slot instead for given structure
46
53
  */