comand-component-library 4.2.38 → 4.2.40

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,81 @@
1
+ <template>
2
+ <section :class="['cmd-section flex-container', {box: styleAsBox, 'vertical': orientation === 'vertical'}]">
3
+ <!-- begin CmdHeadline -->
4
+ <CmdHeadline
5
+ v-if="cmdHeadline?.headlineText"
6
+ v-bind="cmdHeadlineProperties"
7
+ />
8
+ <!-- end CmdHeadline -->
9
+
10
+ <!-- begin content provided by property -->
11
+ <div v-if="content && !useSlot" v-html="content"></div>
12
+ <!-- end content provided by property -->
13
+
14
+ <!-- begin slot -->
15
+ <slot v-else></slot>
16
+ <!-- end slot -->
17
+ </section>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ name: "CmdSection",
23
+ props: {
24
+ /**
25
+ * provide content for section
26
+ */
27
+ content: {
28
+ type: String,
29
+ required: false
30
+ },
31
+ /**
32
+ * define if (default) slot should be used
33
+ */
34
+ useSlot: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ /**
39
+ * set if section should be styled as box
40
+ */
41
+ styleAsBox: {
42
+ type: Boolean,
43
+ default: false
44
+ },
45
+ /**
46
+ * set orientation for content
47
+ *
48
+ * @allowedValues: horizontal, vertical
49
+ */
50
+ orientation: {
51
+ type: String,
52
+ default: "vertical"
53
+ },
54
+ /**
55
+ * set properties for CmdHeadline-component
56
+ *
57
+ * @requiredForAccessibility: true
58
+ */
59
+ cmdHeadline: {
60
+ type: Object,
61
+ default: false
62
+ }
63
+ },
64
+ computed: {
65
+ cmdHeadlineProperties() {
66
+ return {
67
+ headlineLevel: 2,
68
+ ...this.cmdHeadline
69
+ }
70
+ }
71
+ }
72
+ }
73
+ </script>
74
+
75
+ <style>
76
+ .cmd-section {
77
+ &:not(.box) {
78
+ padding: 0;
79
+ }
80
+ }
81
+ </style>
@@ -41,7 +41,7 @@ export default {
41
41
  * set default v-model (must be named modelValue in Vue3)
42
42
  */
43
43
  modelValue: {
44
- type: Object,
44
+ type: [Object, String],
45
45
  required: false
46
46
  },
47
47
  /**
@@ -107,13 +107,22 @@ export default {
107
107
  methods: {
108
108
  showRecommendations() {
109
109
  this.item = {} // reset item
110
- this.$emit("update:modelValue", {itemId: "", displayValue: ""})
110
+ if(typeof this.modelValue === "string") {
111
+ this.$emit("update:modelValue", "")
112
+ } else {
113
+ this.$emit("update:modelValue", {itemId: "", displayValue: ""})
114
+ }
115
+
111
116
  this.showListOfRecommendations = true
112
117
  },
113
118
  optionSelected(item) {
114
119
  this.searchTerm = item.displayValue // set search-field to selected option
115
120
  this.showListOfRecommendations = false
116
- this.$emit("update:modelValue", {itemId: item.id, displayValue: item.displayValue})
121
+ if(typeof this.modelValue === "string") {
122
+ this.$emit("update:modelValue", item.displayValue)
123
+ } else {
124
+ this.$emit("update:modelValue", {itemId: item.id, displayValue: item.displayValue})
125
+ }
117
126
  },
118
127
  linkItem(item) {
119
128
  return {
package/src/index.js CHANGED
@@ -34,6 +34,7 @@ export { default as CmdPagination } from '@/components/CmdPagination.vue'
34
34
  export { default as CmdPageFooter } from '@/components/CmdPageFooter.vue'
35
35
  export { default as CmdPageHeader } from '@/components/CmdPageHeader.vue'
36
36
  export { default as CmdProgressBar } from '@/components/CmdProgressBar.vue'
37
+ export { default as CmdSection } from '@/components/CmdSection.vue'
37
38
  export { default as CmdSidebar } from '@/components/CmdSidebar.vue'
38
39
  export { default as CmdSiteFooter } from '@/components/CmdSiteFooter.vue'
39
40
  export { default as CmdSiteHeader } from '@/components/CmdSiteHeader.vue'