comand-component-library 3.1.53 → 3.1.54
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/comand-component-library.css +1 -1
- package/dist/comand-component-library.umd.min.js +1 -1
- package/package.json +1 -1
- package/src/App.vue +0 -55
- package/src/assets/data/breadcrumbs.json +2 -2
- package/src/components/CmdCookieDisclaimer.vue +63 -65
- package/src/index.js +0 -1
- package/src/router/index.js +0 -57
- package/src/ComponentDocumentation.vue +0 -156
- package/src/ComponentLibraryHelp.vue +0 -20
- package/src/components/CmdAccordion.vue +0 -253
- package/src/documentation/commonProps.js +0 -6
- package/src/documentation/components/ComponentCode.vue +0 -50
- package/src/documentation/components/ComponentProperties.vue +0 -237
- package/src/documentation/components/ExampleSectionWrapper.vue +0 -46
- package/src/documentation/components/ViewCodeData.vue +0 -113
- package/src/documentation/data/CmdAccordionHelp.js +0 -22
- package/src/documentation/data/CmdAddressDataHelp.js +0 -17
- package/src/documentation/data/CmdBackToTopButtonHelp.js +0 -3
- package/src/documentation/data/CmdBankAccountDataHelp.js +0 -8
- package/src/documentation/data/CmdBoxHelp.js +0 -45
- package/src/documentation/data/CmdBoxSiteSearchHelp.js +0 -11
- package/src/documentation/data/CmdBreadcrumbsHelp.js +0 -6
- package/src/documentation/data/CmdCompanyLogoHelp.js +0 -8
- package/src/documentation/data/CmdCookieDisclaimerHelp.js +0 -9
- package/src/documentation/data/CmdCopyrightInformation.js +0 -2
- package/src/documentation/data/CmdCustomHeadlineHelp.js +0 -8
- package/src/documentation/data/CmdFakeSelectHelp.js +0 -60
- package/src/documentation/data/CmdFancyBoxHelp.js +0 -7
- package/src/documentation/data/CmdFooterNavigationHelp.js +0 -5
- package/src/documentation/data/CmdFormElementHelp.js +0 -189
- package/src/documentation/data/CmdFormFiltersHelp.js +0 -6
- package/src/documentation/data/CmdFormHelp.js +0 -10
- package/src/documentation/data/CmdGoogleMapsHelp.js +0 -5
- package/src/documentation/data/CmdImageGalleryHelp.js +0 -5
- package/src/documentation/data/CmdImageZoomHelp.js +0 -6
- package/src/documentation/data/CmdListOfLinksHelp.js +0 -24
- package/src/documentation/data/CmdLoginFormHelp.js +0 -6
- package/src/documentation/data/CmdMainNavigationHelp.js +0 -7
- package/src/documentation/data/CmdMultistepFormProgressBarHelp.js +0 -6
- package/src/documentation/data/CmdOpeningHoursHelp.js +0 -10
- package/src/documentation/data/CmdPagerHelp.js +0 -7
- package/src/documentation/data/CmdProgressBarHelp.js +0 -13
- package/src/documentation/data/CmdShareButtonsHelp.js +0 -13
- package/src/documentation/data/CmdSiteHeaderHelp.js +0 -21
- package/src/documentation/data/CmdSlideButtonHelp.js +0 -10
- package/src/documentation/data/CmdSlideshowHelp.js +0 -7
- package/src/documentation/data/CmdSwitchLanguageHelp.js +0 -6
- package/src/documentation/data/CmdSystemMessageHelp.js +0 -32
- package/src/documentation/data/CmdTableHelp.js +0 -14
- package/src/documentation/data/CmdTabsHelp.js +0 -10
- package/src/documentation/data/CmdThumbnailScrollerHelp.js +0 -5
- package/src/documentation/data/CmdTooltipHelp.js +0 -13
- package/src/documentation/data/CmdUploadFormHelp.js +0 -17
- package/src/documentation/data/CmdWidthLimitationWrapperHelp.js +0 -7
- package/src/documentation/data/componentsDescription.json +0 -158
- package/src/documentation/generated/CmdAccordionPropertyDescriptions.json +0 -57
- package/src/documentation/generated/CmdAddressDataPropertyDescriptions.json +0 -32
- package/src/documentation/generated/CmdBackToTopButtonPropertyDescriptions.json +0 -12
- package/src/documentation/generated/CmdBankAccountDataPropertyDescriptions.json +0 -34
- package/src/documentation/generated/CmdBoxPropertyDescriptions.json +0 -91
- package/src/documentation/generated/CmdBoxSiteSearchPropertyDescriptions.json +0 -46
- package/src/documentation/generated/CmdBoxWrapperPropertyDescriptions.json +0 -47
- package/src/documentation/generated/CmdBreadcrumbsPropertyDescriptions.json +0 -17
- package/src/documentation/generated/CmdCompanyLogoPropertyDescriptions.json +0 -27
- package/src/documentation/generated/CmdCookieDisclaimerPropertyDescriptions.json +0 -22
- package/src/documentation/generated/CmdCustomHeadlinePropertyDescriptions.json +0 -22
- package/src/documentation/generated/CmdFakeSelectPropertyDescriptions.json +0 -84
- package/src/documentation/generated/CmdFancyBoxPropertyDescriptions.json +0 -62
- package/src/documentation/generated/CmdFooterNavigationPropertyDescriptions.json +0 -17
- package/src/documentation/generated/CmdFormElementPropertyDescriptions.json +0 -178
- package/src/documentation/generated/CmdFormFiltersPropertyDescriptions.json +0 -32
- package/src/documentation/generated/CmdFormPropertyDescriptions.json +0 -40
- package/src/documentation/generated/CmdGoogleMapsPropertyDescriptions.json +0 -7
- package/src/documentation/generated/CmdImageGalleryPropertyDescriptions.json +0 -22
- package/src/documentation/generated/CmdImageZoomPropertyDescriptions.json +0 -12
- package/src/documentation/generated/CmdListOfLinksPropertyDescriptions.json +0 -60
- package/src/documentation/generated/CmdLoginFormPropertyDescriptions.json +0 -90
- package/src/documentation/generated/CmdMainNavigationPropertyDescriptions.json +0 -62
- package/src/documentation/generated/CmdMultipleSwitchPropertyDescriptions.json +0 -52
- package/src/documentation/generated/CmdMultistepFormProgressBarPropertyDescriptions.json +0 -17
- package/src/documentation/generated/CmdOpeningHoursPropertyDescriptions.json +0 -42
- package/src/documentation/generated/CmdPagerPropertyDescriptions.json +0 -37
- package/src/documentation/generated/CmdProgressBarPropertyDescriptions.json +0 -32
- package/src/documentation/generated/CmdShareButtonsPropertyDescriptions.json +0 -34
- package/src/documentation/generated/CmdSiteHeaderPropertyDescriptions.json +0 -27
- package/src/documentation/generated/CmdSlideButtonPropertyDescriptions.json +0 -25
- package/src/documentation/generated/CmdSlideshowPropertyDescriptions.json +0 -42
- package/src/documentation/generated/CmdSwitchButtonPropertyDescriptions.json +0 -79
- package/src/documentation/generated/CmdSwitchLanguagePropertyDescriptions.json +0 -7
- package/src/documentation/generated/CmdSystemMessagePropertyDescriptions.json +0 -40
- package/src/documentation/generated/CmdTablePropertyDescriptions.json +0 -62
- package/src/documentation/generated/CmdTabsPropertyDescriptions.json +0 -27
- package/src/documentation/generated/CmdThumbnailScrollerPropertyDescriptions.json +0 -32
- package/src/documentation/generated/CmdTooltipPropertyDescriptions.json +0 -17
- package/src/documentation/generated/CmdUploadFormPropertyDescriptions.json +0 -90
- package/src/documentation/generated/CmdWidthLimitationWrapperPropertyDescriptions.json +0 -41
- package/src/documentation/generated/frameworkIcons.json +0 -730
- package/src/documentation/generated/logosIcons.json +0 -110
- package/src/documentation/tabs.js +0 -46
- package/src/documentation/views/ContainerPage.vue +0 -237
- package/src/documentation/views/HelpHome.vue +0 -13
- package/src/documentation/views/IconFont.vue +0 -80
- package/src/documentation/views/components/CmdAccordionHelp.vue +0 -78
- package/src/documentation/views/components/CmdAddressDataHelp.vue +0 -65
- package/src/documentation/views/components/CmdBackToTopButtonHelp.vue +0 -62
- package/src/documentation/views/components/CmdBankAccountDataHelp.vue +0 -88
- package/src/documentation/views/components/CmdBoxHelp.vue +0 -137
- package/src/documentation/views/components/CmdBoxSiteSearchHelp.vue +0 -60
- package/src/documentation/views/components/CmdBoxWrapperHelp.vue +0 -111
- package/src/documentation/views/components/CmdBreadcrumbsHelp.vue +0 -51
- package/src/documentation/views/components/CmdCompanyLogoHelp.vue +0 -48
- package/src/documentation/views/components/CmdCookieDisclaimerHelp.vue +0 -105
- package/src/documentation/views/components/CmdCustomHeadlineHelp.vue +0 -53
- package/src/documentation/views/components/CmdFakeSelectHelp.vue +0 -175
- package/src/documentation/views/components/CmdFancyBoxHelp.vue +0 -79
- package/src/documentation/views/components/CmdFormElementHelp.vue +0 -412
- package/src/documentation/views/components/CmdFormFiltersHelp.vue +0 -69
- package/src/documentation/views/components/CmdFormHelp.vue +0 -41
- package/src/documentation/views/components/CmdGoogleMapsHelp.vue +0 -55
- package/src/documentation/views/components/CmdImageGalleryHelp.vue +0 -46
- package/src/documentation/views/components/CmdImageZoomHelp.vue +0 -34
- package/src/documentation/views/components/CmdListOfLinksHelp.vue +0 -64
- package/src/documentation/views/components/CmdLoginFormHelp.vue +0 -117
- package/src/documentation/views/components/CmdMainNavigationHelp.vue +0 -94
- package/src/documentation/views/components/CmdMultistepFormProgressBarHelp.vue +0 -49
- package/src/documentation/views/components/CmdOpeningHoursHelp.vue +0 -49
- package/src/documentation/views/components/CmdPagerHelp.vue +0 -57
- package/src/documentation/views/components/CmdProgressBarHelp.vue +0 -47
- package/src/documentation/views/components/CmdShareButtonsHelp.vue +0 -65
- package/src/documentation/views/components/CmdSiteHeaderHelp.vue +0 -72
- package/src/documentation/views/components/CmdSlideButtonHelp.vue +0 -90
- package/src/documentation/views/components/CmdSlideshowHelp.vue +0 -60
- package/src/documentation/views/components/CmdSwitchLanguageHelp.vue +0 -64
- package/src/documentation/views/components/CmdSystemMessageHelp.vue +0 -86
- package/src/documentation/views/components/CmdTableHelp.vue +0 -84
- package/src/documentation/views/components/CmdTabsHelp.vue +0 -52
- package/src/documentation/views/components/CmdThumbnailScrollerHelp.vue +0 -50
- package/src/documentation/views/components/CmdTooltipHelp.vue +0 -59
- package/src/documentation/views/components/CmdUploadFormHelp.vue +0 -59
- package/src/documentation/views/components/CmdWidthLimitationWrapperHelp.vue +0 -46
@@ -1,253 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div :class="['cmd-accordion flex-container vertical', {'no-gap' : !gapBetween, 'active' : active}]">
|
3
|
-
<div v-for="(accordionContent, index) in accordion" :key="index">
|
4
|
-
<a v-if="!useCustomHeader" href="#" :title="accordionContent.status ? iconOpen.tooltip : iconClosed.tooltip" @click.prevent="toggleContentVisibility(accordionContent)">
|
5
|
-
<!-- begin slot for headline -->
|
6
|
-
<slot :name="'accordionHeadline' + index">
|
7
|
-
<!-- begin CmdCustomHeadline -->
|
8
|
-
<CmdCustomHeadline
|
9
|
-
v-if="accordionContent.headlineText && accordionContent.headlineLevel"
|
10
|
-
:headlineText="accordionContent.headlineText"
|
11
|
-
:headlineLevel="accordionContent.headlineLevel"
|
12
|
-
:iconClass="accordionContent.iconClass"
|
13
|
-
/>
|
14
|
-
<!-- end CmdCustomHeadline -->
|
15
|
-
</slot>
|
16
|
-
<!-- end slot for headline -->
|
17
|
-
<span class="toggle-icon" :class="[accordionContent.status ? iconOpen.iconClass : iconClosed.iconClass]"></span>
|
18
|
-
</a>
|
19
|
-
<!-- begin accordion-content -->
|
20
|
-
<transition :name="toggleTransition">
|
21
|
-
<div class="accordion-content" v-if="accordionContent.status" aria-expanded="true">
|
22
|
-
<slot :name="'accordionContent' + index">
|
23
|
-
<p>{{ accordionContent.content }}</p>
|
24
|
-
</slot>
|
25
|
-
</div>
|
26
|
-
</transition>
|
27
|
-
<!-- end accordion-content -->
|
28
|
-
</div>
|
29
|
-
</div>
|
30
|
-
</template>
|
31
|
-
|
32
|
-
<script>
|
33
|
-
// import components
|
34
|
-
import CmdCustomHeadline from "./CmdCustomHeadline"
|
35
|
-
|
36
|
-
export default {
|
37
|
-
name: "CmdAccordion",
|
38
|
-
components: {
|
39
|
-
CmdCustomHeadline
|
40
|
-
},
|
41
|
-
data() {
|
42
|
-
return {
|
43
|
-
accordion: [],
|
44
|
-
active: false
|
45
|
-
}
|
46
|
-
},
|
47
|
-
props: {
|
48
|
-
/**
|
49
|
-
* properties for CmdCustomHeadline-component
|
50
|
-
*/
|
51
|
-
cmdCustomHeadline: {
|
52
|
-
type: Object,
|
53
|
-
required: false
|
54
|
-
},
|
55
|
-
/**
|
56
|
-
* use transition to expand accordion-content
|
57
|
-
*/
|
58
|
-
useTransition: {
|
59
|
-
type: Boolean,
|
60
|
-
default: true
|
61
|
-
},
|
62
|
-
/**
|
63
|
-
* toggle if mode if only one accordion can be opened (or multiple ones)
|
64
|
-
*
|
65
|
-
* @allowedValues: single, multiple
|
66
|
-
*/
|
67
|
-
toggleMode: {
|
68
|
-
type: String,
|
69
|
-
default: "single"
|
70
|
-
},
|
71
|
-
/**
|
72
|
-
* activate if you want to use a customized header
|
73
|
-
*/
|
74
|
-
useCustomHeader: {
|
75
|
-
type: Boolean,
|
76
|
-
default: false
|
77
|
-
},
|
78
|
-
/**
|
79
|
-
* set if a gap should be shown between multiple accordions
|
80
|
-
*/
|
81
|
-
gapBetween: {
|
82
|
-
type: Boolean,
|
83
|
-
default: true
|
84
|
-
},
|
85
|
-
/**
|
86
|
-
* all information about the contents in all shown accordions
|
87
|
-
*/
|
88
|
-
accordionData: {
|
89
|
-
type: [Array, Number],
|
90
|
-
required: true
|
91
|
-
},
|
92
|
-
/**
|
93
|
-
* icon to expand an accordion
|
94
|
-
*
|
95
|
-
* @requiredForAccessibility: partial
|
96
|
-
*/
|
97
|
-
iconOpen: {
|
98
|
-
type: Object,
|
99
|
-
default: function() {
|
100
|
-
return {
|
101
|
-
iconClass: "icon-single-arrow-up",
|
102
|
-
tooltip: "Close content"
|
103
|
-
}
|
104
|
-
},
|
105
|
-
},
|
106
|
-
/**
|
107
|
-
* icon to collapse an accordion
|
108
|
-
*
|
109
|
-
* @requiredForAccessibility: partial
|
110
|
-
*/
|
111
|
-
iconClosed: {
|
112
|
-
type: Object,
|
113
|
-
default: function() {
|
114
|
-
return {
|
115
|
-
iconClass: "icon-single-arrow-down",
|
116
|
-
tooltip: "Show content"
|
117
|
-
}
|
118
|
-
}
|
119
|
-
}
|
120
|
-
},
|
121
|
-
computed: {
|
122
|
-
toggleTransition() {
|
123
|
-
if(this.useTransition) {
|
124
|
-
return "fade"
|
125
|
-
}
|
126
|
-
return ""
|
127
|
-
}
|
128
|
-
},
|
129
|
-
methods: {
|
130
|
-
toggleContentVisibility(accordionContent) {
|
131
|
-
accordionContent.status = !accordionContent.status
|
132
|
-
this.active = !this.active
|
133
|
-
|
134
|
-
if (this.toggleMode === 'single' || this.toggleMode === '') {
|
135
|
-
for (let i = 0; i < this.accordion.length; i++) {
|
136
|
-
if (this.accordion[i] !== accordionContent) {
|
137
|
-
this.accordion[i].status = false;
|
138
|
-
}
|
139
|
-
}
|
140
|
-
}
|
141
|
-
},
|
142
|
-
/**
|
143
|
-
* method will be called from outside by $refs
|
144
|
-
*/
|
145
|
-
openAll() {
|
146
|
-
for (let i = 0; i < this.accordion.length; i++) {
|
147
|
-
this.accordion[i].status = true;
|
148
|
-
}
|
149
|
-
},
|
150
|
-
/**
|
151
|
-
* method will be called from outside by $refs
|
152
|
-
*/
|
153
|
-
closeAll() {
|
154
|
-
for (let i = 0; i < this.accordion.length; i++) {
|
155
|
-
this.accordion[i].status = false;
|
156
|
-
}
|
157
|
-
}
|
158
|
-
},
|
159
|
-
watch: {
|
160
|
-
accordionData: {
|
161
|
-
handler() {
|
162
|
-
if (typeof this.accordionData === 'number') {
|
163
|
-
this.accordion = []
|
164
|
-
for (let i = 0; i < this.accordionData; i++) {
|
165
|
-
this.accordion.push({status: false})
|
166
|
-
}
|
167
|
-
} else {
|
168
|
-
// create copy of given data and assign to data-property
|
169
|
-
this.accordion = JSON.parse(JSON.stringify(this.accordionData))
|
170
|
-
}
|
171
|
-
},
|
172
|
-
immediate: true
|
173
|
-
}
|
174
|
-
}
|
175
|
-
}
|
176
|
-
</script>
|
177
|
-
|
178
|
-
<style lang="scss">
|
179
|
-
/* begin cmd-accordion ---------------------------------------------------------------------------------------- */
|
180
|
-
.cmd-accordion {
|
181
|
-
> div {
|
182
|
-
> a, > div:first-child {
|
183
|
-
display: flex;
|
184
|
-
align-items: center;
|
185
|
-
gap: var(--grid-gap);
|
186
|
-
border-radius: var(--border-radius);
|
187
|
-
padding: calc(var(--default-padding) / 2) var(--default-padding);
|
188
|
-
border: var(--default-border);
|
189
|
-
background: var(--default-background-color);
|
190
|
-
text-decoration: none;
|
191
|
-
|
192
|
-
&:hover, &:active, &:focus, &.active {
|
193
|
-
background: var(--primary-color);
|
194
|
-
border-color: var(--primary-color);
|
195
|
-
|
196
|
-
& + .accordion-content {
|
197
|
-
border-color: var(--primary-color);
|
198
|
-
}
|
199
|
-
|
200
|
-
* {
|
201
|
-
color: var(--pure-white);
|
202
|
-
}
|
203
|
-
}
|
204
|
-
|
205
|
-
&:first-child {
|
206
|
-
margin: 0;
|
207
|
-
}
|
208
|
-
|
209
|
-
> h2, > h3, > h4, > h5, > h6, .cmd-custom-headline {
|
210
|
-
margin-bottom: 0;
|
211
|
-
display: flex;
|
212
|
-
align-items: center;
|
213
|
-
}
|
214
|
-
|
215
|
-
label, .label {
|
216
|
-
margin-top: 0;
|
217
|
-
}
|
218
|
-
|
219
|
-
& + .accordion-content {
|
220
|
-
border-top: 0;
|
221
|
-
}
|
222
|
-
|
223
|
-
> span, > a {
|
224
|
-
font-size: inherit;
|
225
|
-
|
226
|
-
&[class*="icon-"] {
|
227
|
-
margin-left: auto;
|
228
|
-
font-size: 1rem;
|
229
|
-
}
|
230
|
-
}
|
231
|
-
}
|
232
|
-
|
233
|
-
.accordion-content {
|
234
|
-
padding: var(--default-padding);
|
235
|
-
border: var(--default-border);
|
236
|
-
border-bottom-left-radius: var(--border-radius);
|
237
|
-
border-bottom-right-radius: var(--border-radius);
|
238
|
-
background: var(--pure-white);
|
239
|
-
|
240
|
-
&.active {
|
241
|
-
border-bottom-left-radius: 0;
|
242
|
-
border-bottom-right-radius: 0;
|
243
|
-
}
|
244
|
-
|
245
|
-
> *:last-child {
|
246
|
-
margin-bottom: 0;
|
247
|
-
}
|
248
|
-
}
|
249
|
-
}
|
250
|
-
}
|
251
|
-
|
252
|
-
/* end cmd-accordion ------------------------------------------------------------------------------------------ */
|
253
|
-
</style>
|
@@ -1,50 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<pre :class="classLanguage"><code :class="classLanguage" v-html="codeFormatted"></code></pre>
|
3
|
-
<p v-if="codeCopied">Code was copied to clipboard!</p>
|
4
|
-
<a href="#" @click.prevent="copyToClipboard">
|
5
|
-
<span class="icon-duplicate-content"></span>
|
6
|
-
<span>Copy code</span>
|
7
|
-
</a>
|
8
|
-
</template>
|
9
|
-
|
10
|
-
<script>
|
11
|
-
import Prism from "prismjs"
|
12
|
-
import "prismjs/components/prism-json"
|
13
|
-
|
14
|
-
export default {
|
15
|
-
name: "ComponentCode",
|
16
|
-
data() {
|
17
|
-
return {
|
18
|
-
codeCopied: false
|
19
|
-
}
|
20
|
-
},
|
21
|
-
props: {
|
22
|
-
code: {
|
23
|
-
type: [String, Object, Array],
|
24
|
-
required: true
|
25
|
-
},
|
26
|
-
language: {
|
27
|
-
type: String,
|
28
|
-
default: "markup"
|
29
|
-
}
|
30
|
-
},
|
31
|
-
computed: {
|
32
|
-
codeFormatted() {
|
33
|
-
let codeUnformatted = this.code
|
34
|
-
if(typeof this.code !== "string") {
|
35
|
-
codeUnformatted = JSON.stringify(codeUnformatted, null, 2)
|
36
|
-
}
|
37
|
-
return Prism.highlight(codeUnformatted, Prism.languages[this.language], this.language)
|
38
|
-
},
|
39
|
-
classLanguage() {
|
40
|
-
return "language-" + this.language
|
41
|
-
}
|
42
|
-
},
|
43
|
-
methods: {
|
44
|
-
copyToClipboard() {
|
45
|
-
navigator.clipboard.writeText(this.code)
|
46
|
-
this.codeCopied = true
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
</script>
|
@@ -1,237 +0,0 @@
|
|
1
|
-
<script>
|
2
|
-
function getPropertyTypeName(type) {
|
3
|
-
if(Array.isArray(type)) {
|
4
|
-
return type.map(t => t.name).join(", ")
|
5
|
-
}
|
6
|
-
return type.name
|
7
|
-
}
|
8
|
-
|
9
|
-
function getPropertyDefault(defaultValue) {
|
10
|
-
if(typeof defaultValue === "function") {
|
11
|
-
return defaultValue()
|
12
|
-
}
|
13
|
-
return defaultValue
|
14
|
-
}
|
15
|
-
|
16
|
-
function getIcon(value) {
|
17
|
-
if (value === "partial") {
|
18
|
-
return "icon-exclamation-circle partial"
|
19
|
-
}
|
20
|
-
return value ? "icon-check-circle" : "icon-cancel-circle not-required";
|
21
|
-
}
|
22
|
-
|
23
|
-
function getTooltip(value) {
|
24
|
-
if (value === "partial") {
|
25
|
-
return "Parts of this property are required"
|
26
|
-
}
|
27
|
-
return value ? "Property is required for component" : "Property is not required for component"
|
28
|
-
}
|
29
|
-
|
30
|
-
function getPropertyDescription(propertyDescriptions, propertyName) {
|
31
|
-
if(propertyDescriptions) {
|
32
|
-
if(propertyDescriptions[propertyName]?.comments?.length) {
|
33
|
-
return propertyDescriptions[propertyName].comments.join("<br />")
|
34
|
-
}
|
35
|
-
}
|
36
|
-
return ""
|
37
|
-
}
|
38
|
-
|
39
|
-
function hasAnnotation(propertyDescriptions, propertyName, annotationName) {
|
40
|
-
return propertyDescriptions?.[propertyName]?.annotations?.[annotationName]?.length
|
41
|
-
}
|
42
|
-
|
43
|
-
// function hasAnnotationValue(propertyDescriptions, propertyName, annotationName, annotationValue) {
|
44
|
-
// return getAnnotationValues(propertyDescriptions, propertyName, annotationName).includes(annotationValue)
|
45
|
-
// }
|
46
|
-
|
47
|
-
function getAnnotationValues(propertyDescriptions, propertyName, annotationName) {
|
48
|
-
return (propertyDescriptions?.[propertyName]?.annotations?.[annotationName] || []).join("").split(/\s*,\s*/)
|
49
|
-
}
|
50
|
-
|
51
|
-
function getAnnotationValue(propertyDescriptions, propertyName, annotationName) {
|
52
|
-
const values = propertyDescriptions?.[propertyName]?.annotations?.[annotationName] || []
|
53
|
-
if (values.length) {
|
54
|
-
return values[0]
|
55
|
-
}
|
56
|
-
return null
|
57
|
-
}
|
58
|
-
|
59
|
-
// function getAnnotation(propertyDescriptions, propertyName, annotationName) {
|
60
|
-
// if(propertyDescriptions) {
|
61
|
-
// if(propertyDescriptions[propertyName]?.annotations?.[annotationName]?.length) {
|
62
|
-
// return propertyDescriptions[propertyName].annotations[annotationName].join("").split(/\s*,\s*/)
|
63
|
-
// }
|
64
|
-
// }
|
65
|
-
// return []
|
66
|
-
// }
|
67
|
-
|
68
|
-
function getPropertyStructure(propertyStructures, propertyName) {
|
69
|
-
if(propertyStructures?.[propertyName]) {
|
70
|
-
return JSON.stringify(propertyStructures?.[propertyName], null, 2)
|
71
|
-
}
|
72
|
-
return "-"
|
73
|
-
}
|
74
|
-
|
75
|
-
export {
|
76
|
-
getPropertyTypeName,
|
77
|
-
getPropertyDefault,
|
78
|
-
getIcon,
|
79
|
-
getTooltip,
|
80
|
-
getPropertyDescription,
|
81
|
-
getPropertyStructure
|
82
|
-
}
|
83
|
-
</script>
|
84
|
-
|
85
|
-
<script setup>
|
86
|
-
import { defineProps, computed } from "vue"
|
87
|
-
import {capitalize} from "../../utils/string"
|
88
|
-
import componentsDescription from "../data/componentsDescription.json"
|
89
|
-
|
90
|
-
const props = defineProps(
|
91
|
-
{
|
92
|
-
properties: {
|
93
|
-
type: Object,
|
94
|
-
required: true
|
95
|
-
},
|
96
|
-
propertyDescriptions: {
|
97
|
-
type: Object,
|
98
|
-
required: false
|
99
|
-
},
|
100
|
-
propertyStructures: {
|
101
|
-
type: Object,
|
102
|
-
required: false
|
103
|
-
}
|
104
|
-
}
|
105
|
-
)
|
106
|
-
|
107
|
-
const sortedProperties = computed(
|
108
|
-
function() {
|
109
|
-
return Object.entries(props.properties).sort((a, b) => a[0].localeCompare(b[0]))
|
110
|
-
}
|
111
|
-
)
|
112
|
-
|
113
|
-
function resolveComponentName(name) {
|
114
|
-
if (name.slice(0, 3) === "cmd" && name.length > 3) {
|
115
|
-
const componentName = capitalize(name)
|
116
|
-
if (componentsDescription[componentName]) {
|
117
|
-
return componentName
|
118
|
-
}
|
119
|
-
const componentNameParts = componentName.split(/(?<=[a-z])(?=[A-Z])/)
|
120
|
-
for (let i = componentNameParts.length - 2; i > 2; i--) {
|
121
|
-
const componentNameCandidate = componentNameParts.slice(0, i).join("")
|
122
|
-
if (componentsDescription[componentNameCandidate]) {
|
123
|
-
return componentNameCandidate
|
124
|
-
}
|
125
|
-
}
|
126
|
-
}
|
127
|
-
return null
|
128
|
-
}
|
129
|
-
|
130
|
-
function createComponentLink(name) {
|
131
|
-
// check if property.name starts with cmd-namespace-prefix
|
132
|
-
return !!resolveComponentName(name)
|
133
|
-
}
|
134
|
-
|
135
|
-
function createDetailLink(type) {
|
136
|
-
// check if property-type is array or object
|
137
|
-
if(Array.isArray(type)) {
|
138
|
-
return type.some(t => t.name === "Array" || t.name === "Object")
|
139
|
-
}
|
140
|
-
return type.name === "Array" || type.name === "Object"
|
141
|
-
}
|
142
|
-
</script>
|
143
|
-
|
144
|
-
<template>
|
145
|
-
<h2>Properties</h2>
|
146
|
-
<table class="table-properties">
|
147
|
-
<thead>
|
148
|
-
<tr>
|
149
|
-
<th>Name</th>
|
150
|
-
<th>Type</th>
|
151
|
-
<th>Required</th>
|
152
|
-
<th>Structure</th>
|
153
|
-
<th>Default</th>
|
154
|
-
<th>Req. for Accessibility</th>
|
155
|
-
<th>Allowed Values</th>
|
156
|
-
<th>Affects Styling</th>
|
157
|
-
<th>Description</th>
|
158
|
-
</tr>
|
159
|
-
</thead>
|
160
|
-
<tbody>
|
161
|
-
<tr v-for="([propertyName, property]) in sortedProperties" :key="propertyName">
|
162
|
-
<td>
|
163
|
-
<template v-if="createComponentLink(propertyName)">
|
164
|
-
<router-link :to="{name: resolveComponentName(propertyName), params: { tab: 'properties'}}" title="Open help page for this component">{{ propertyName }}</router-link>
|
165
|
-
</template>
|
166
|
-
<template v-else-if="createDetailLink(property.type)">
|
167
|
-
<a :href="'#' + propertyName">{{ propertyName }}</a>
|
168
|
-
</template>
|
169
|
-
<template v-else>
|
170
|
-
{{ propertyName }}
|
171
|
-
</template>
|
172
|
-
</td>
|
173
|
-
<td>
|
174
|
-
{{ getPropertyTypeName(property.type) }}
|
175
|
-
</td>
|
176
|
-
<td class="contains-status-icons">
|
177
|
-
<span :class="getIcon(property.required)" :title="getTooltip(property.required)"></span>
|
178
|
-
</td>
|
179
|
-
<td>
|
180
|
-
<pre v-if="getPropertyStructure(props.propertyStructures, propertyName)">{{ getPropertyStructure(props.propertyStructures, propertyName) }}</pre>
|
181
|
-
</td>
|
182
|
-
<td>
|
183
|
-
<pre v-if="getPropertyDefault(property.default)">{{getPropertyDefault(property.default) }}</pre>
|
184
|
-
<template v-else>
|
185
|
-
<em>(none)</em>
|
186
|
-
</template>
|
187
|
-
</td>
|
188
|
-
<td class="contains-status-icons">
|
189
|
-
<span :class="getIcon(getAnnotationValue(props.propertyDescriptions, propertyName, 'requiredForAccessibility'))" :title="getTooltip(property.required)"></span>
|
190
|
-
</td>
|
191
|
-
<td class="allowed-values">
|
192
|
-
<ul v-if="hasAnnotation(props.propertyDescriptions, propertyName, 'allowedValues')">
|
193
|
-
<li v-for="value in getAnnotationValues(props.propertyDescriptions, propertyName, 'allowedValues')" :key="value">{{ value }}</li>
|
194
|
-
</ul>
|
195
|
-
<em v-else>
|
196
|
-
(all)
|
197
|
-
</em>
|
198
|
-
</td>
|
199
|
-
<td class="contains-status-icons">
|
200
|
-
<span :class="getIcon(hasAnnotation(props.propertyDescriptions, propertyName, 'affectsStyling'))" :title="getTooltip(property.required)"></span>
|
201
|
-
</td>
|
202
|
-
<td v-html="getPropertyDescription(props.propertyDescriptions, propertyName)">
|
203
|
-
</td>
|
204
|
-
</tr>
|
205
|
-
</tbody>
|
206
|
-
</table>
|
207
|
-
</template>
|
208
|
-
|
209
|
-
<style lang="scss">
|
210
|
-
.table-properties {
|
211
|
-
td {
|
212
|
-
text-align: left;
|
213
|
-
|
214
|
-
&.contains-status-icons {
|
215
|
-
text-align: center;
|
216
|
-
|
217
|
-
span[class*="icon"] {
|
218
|
-
color: var(--success-color);
|
219
|
-
|
220
|
-
&.not-required {
|
221
|
-
color: var(--error-color);
|
222
|
-
}
|
223
|
-
|
224
|
-
&.partial {
|
225
|
-
color: var(--warning-color);
|
226
|
-
}
|
227
|
-
}
|
228
|
-
}
|
229
|
-
|
230
|
-
&.allowed-values {
|
231
|
-
ul {
|
232
|
-
margin: 0;
|
233
|
-
}
|
234
|
-
}
|
235
|
-
}
|
236
|
-
}
|
237
|
-
</style>
|
@@ -1,46 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<section class="example-section">
|
3
|
-
<a :id="getExampleId()"></a>
|
4
|
-
<!-- begin cmd-custom-headline -->
|
5
|
-
<CmdCustomHeadline
|
6
|
-
:preHeadlineText="getPreHeadlineText()"
|
7
|
-
:headlineText="headlineText"
|
8
|
-
:headlineLevel="3"
|
9
|
-
/>
|
10
|
-
<!-- end cmd-custom-headline -->
|
11
|
-
<slot></slot>
|
12
|
-
</section>
|
13
|
-
</template>
|
14
|
-
|
15
|
-
<script>
|
16
|
-
// import functions
|
17
|
-
import {currentSequenceValue, nextSequenceValue} from "../../utils/globalSequence";
|
18
|
-
|
19
|
-
// import components
|
20
|
-
import CmdCustomHeadline from "../../components/CmdCustomHeadline"
|
21
|
-
|
22
|
-
export default {
|
23
|
-
name: "ExampleSectionWrapper",
|
24
|
-
components: {
|
25
|
-
CmdCustomHeadline
|
26
|
-
},
|
27
|
-
props: {
|
28
|
-
componentName: {
|
29
|
-
type: String,
|
30
|
-
required: true
|
31
|
-
},
|
32
|
-
headlineText: {
|
33
|
-
type: String,
|
34
|
-
required: true
|
35
|
-
}
|
36
|
-
},
|
37
|
-
methods: {
|
38
|
-
getExampleId() {
|
39
|
-
return "example" + nextSequenceValue(this.componentName)
|
40
|
-
},
|
41
|
-
getPreHeadlineText() {
|
42
|
-
return "Example #" + currentSequenceValue(this.componentName)
|
43
|
-
}
|
44
|
-
}
|
45
|
-
}
|
46
|
-
</script>
|