comand-component-library 3.1.43 → 3.1.46
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 +47 -40
- package/src/App.vue +379 -136
- package/src/ComponentDocumentation.vue +156 -0
- package/src/ComponentLibraryHelp.vue +20 -0
- package/src/assets/data/accordion.json +21 -24
- package/src/assets/data/address-data.json +34 -0
- package/src/assets/data/bank-account-data.json +22 -0
- package/src/assets/data/box-product.json +14 -4
- package/src/assets/data/box-user.json +48 -22
- package/src/assets/data/breadcrumbs.json +11 -3
- package/src/assets/data/cookie-disclaimer.json +4 -4
- package/src/assets/data/fake-select-colors.json +4 -0
- package/src/assets/data/fake-select-countries.json +12 -12
- package/src/assets/data/fake-select-filter-options.json +14 -0
- package/src/assets/data/fake-select-options-with-icons.json +6 -12
- package/src/assets/data/fake-select-options.json +3 -3
- package/src/assets/data/list-of-links-section-anchors.json +23 -0
- package/src/assets/data/list-of-links-top-header-navigation.json +20 -0
- package/src/assets/data/list-of-links.json +42 -0
- package/src/assets/data/main-navigation.json +48 -0
- package/src/assets/data/multistep-form-progress-bar.json +33 -0
- package/src/assets/data/select-options.json +4 -0
- package/src/assets/data/{share-buttons.json → share-buttons-page-by-json.json} +8 -8
- package/src/assets/data/share-buttons-page-by-property.json +30 -0
- package/src/assets/data/switch-language.json +20 -0
- package/src/assets/data/table-large.json +1 -1
- package/src/assets/data/table-small.json +1 -1
- package/src/assets/styles/global-styles.scss +43 -14
- package/src/assets/styles/transitions.scss +21 -1
- package/src/components/CmdAccordion.vue +43 -42
- package/src/components/CmdAddressData.vue +124 -56
- package/src/components/CmdBackToTopButton.vue +3 -3
- package/src/components/CmdBankAccountData.vue +104 -0
- package/src/components/CmdBox.vue +253 -56
- package/src/components/CmdBoxSiteSearch.vue +138 -39
- package/src/components/CmdBoxWrapper.vue +206 -0
- package/src/components/CmdBreadcrumbs.vue +29 -13
- package/src/components/CmdCompanyLogo.vue +6 -4
- package/src/components/CmdCookieDisclaimer.vue +99 -75
- package/src/components/CmdCopyrightInformation.vue +1 -1
- package/src/components/CmdCustomHeadline.vue +93 -0
- package/src/components/CmdFakeSelect.vue +330 -66
- package/src/components/CmdFancyBox.vue +47 -33
- package/src/components/CmdForm.vue +107 -0
- package/src/components/CmdFormElement.vue +528 -83
- package/src/components/CmdFormFilters.vue +25 -11
- package/src/components/CmdGoogleMaps.vue +9 -3
- package/src/components/CmdImageGallery.vue +28 -5
- package/src/components/CmdImageZoom.vue +9 -1
- package/src/components/CmdListOfLinks.vue +169 -0
- package/src/components/CmdLoginForm.vue +146 -66
- package/src/components/CmdMainNavigation.vue +140 -42
- package/src/components/CmdMultipleSwitch.vue +33 -2
- package/src/components/CmdMultistepFormProgressBar.vue +60 -10
- package/src/components/CmdOpeningHours.vue +36 -10
- package/src/components/CmdPager.vue +7 -5
- package/src/components/CmdProgressBar.vue +21 -4
- package/src/components/CmdShareButtons.vue +64 -9
- package/src/components/CmdSiteHeader.vue +25 -12
- package/src/components/CmdSlideButton.vue +5 -2
- package/src/components/CmdSlideshow.vue +23 -7
- package/src/components/CmdSwitchButton.vue +15 -6
- package/src/components/CmdSwitchLanguage.vue +18 -10
- package/src/components/CmdSystemMessage.vue +30 -17
- package/src/components/CmdTable.vue +15 -7
- package/src/components/CmdTabs.vue +43 -3
- package/src/components/CmdThumbnailScroller.vue +22 -6
- package/src/components/CmdTooltip.vue +184 -11
- package/src/components/CmdUploadForm.vue +830 -176
- package/src/components/CmdWidthLimitationWrapper.vue +9 -6
- package/src/composables/event.js +8 -0
- package/src/composables/scrollspy.js +52 -0
- package/src/directives/focus.js +19 -0
- package/src/directives/telephone.js +1 -1
- package/src/documentation/commonProps.js +6 -0
- package/src/documentation/components/ComponentCode.vue +50 -0
- package/src/documentation/components/ComponentProperties.vue +237 -0
- package/src/documentation/components/ExampleSectionWrapper.vue +46 -0
- package/src/documentation/components/ViewCodeData.vue +113 -0
- package/src/documentation/data/CmdAccordionHelp.js +22 -0
- package/src/documentation/data/CmdAddressDataHelp.js +17 -0
- package/src/documentation/data/CmdBackToTopButtonHelp.js +3 -0
- package/src/documentation/data/CmdBankAccountDataHelp.js +8 -0
- package/src/documentation/data/CmdBoxHelp.js +45 -0
- package/src/documentation/data/CmdBoxSiteSearchHelp.js +11 -0
- package/src/documentation/data/CmdBreadcrumbsHelp.js +6 -0
- package/src/documentation/data/CmdCompanyLogoHelp.js +8 -0
- package/src/documentation/data/CmdCookieDisclaimerHelp.js +9 -0
- package/src/documentation/data/CmdCopyrightInformation.js +2 -0
- package/src/documentation/data/CmdCustomHeadlineHelp.js +8 -0
- package/src/documentation/data/CmdFakeSelectHelp.js +60 -0
- package/src/documentation/data/CmdFancyBoxHelp.js +7 -0
- package/src/documentation/data/CmdFooterNavigationHelp.js +5 -0
- package/src/documentation/data/CmdFormElementHelp.js +189 -0
- package/src/documentation/data/CmdFormFiltersHelp.js +6 -0
- package/src/documentation/data/CmdFormHelp.js +10 -0
- package/src/documentation/data/CmdGoogleMapsHelp.js +5 -0
- package/src/documentation/data/CmdImageGalleryHelp.js +5 -0
- package/src/documentation/data/CmdImageZoomHelp.js +6 -0
- package/src/documentation/data/CmdListOfLinksHelp.js +24 -0
- package/src/documentation/data/CmdLoginFormHelp.js +6 -0
- package/src/documentation/data/CmdMainNavigationHelp.js +7 -0
- package/src/documentation/data/CmdMultistepFormProgressBarHelp.js +6 -0
- package/src/documentation/data/CmdOpeningHoursHelp.js +10 -0
- package/src/documentation/data/CmdPagerHelp.js +7 -0
- package/src/documentation/data/CmdProgressBarHelp.js +13 -0
- package/src/documentation/data/CmdShareButtonsHelp.js +13 -0
- package/src/documentation/data/CmdSiteHeaderHelp.js +21 -0
- package/src/documentation/data/CmdSlideButtonHelp.js +10 -0
- package/src/documentation/data/CmdSlideshowHelp.js +7 -0
- package/src/documentation/data/CmdSwitchLanguageHelp.js +6 -0
- package/src/documentation/data/CmdSystemMessageHelp.js +32 -0
- package/src/documentation/data/CmdTableHelp.js +14 -0
- package/src/documentation/data/CmdTabsHelp.js +10 -0
- package/src/documentation/data/CmdThumbnailScrollerHelp.js +5 -0
- package/src/documentation/data/CmdTooltipHelp.js +13 -0
- package/src/documentation/data/CmdUploadFormHelp.js +17 -0
- package/src/documentation/data/CmdWidthLimitationWrapperHelp.js +7 -0
- package/src/documentation/data/componentsDescription.json +158 -0
- package/src/documentation/generated/CmdAccordionPropertyDescriptions.json +57 -0
- package/src/documentation/generated/CmdAddressDataPropertyDescriptions.json +32 -0
- package/src/documentation/generated/CmdBackToTopButtonPropertyDescriptions.json +12 -0
- package/src/documentation/generated/CmdBankAccountDataPropertyDescriptions.json +34 -0
- package/src/documentation/generated/CmdBoxPropertyDescriptions.json +91 -0
- package/src/documentation/generated/CmdBoxSiteSearchPropertyDescriptions.json +41 -0
- package/src/documentation/generated/CmdBoxWrapperPropertyDescriptions.json +47 -0
- package/src/documentation/generated/CmdBreadcrumbsPropertyDescriptions.json +17 -0
- package/src/documentation/generated/CmdCompanyLogoPropertyDescriptions.json +27 -0
- package/src/documentation/generated/CmdCookieDisclaimerPropertyDescriptions.json +22 -0
- package/src/documentation/generated/CmdCustomHeadlinePropertyDescriptions.json +22 -0
- package/src/documentation/generated/CmdFakeSelectPropertyDescriptions.json +79 -0
- package/src/documentation/generated/CmdFancyBoxPropertyDescriptions.json +62 -0
- package/src/documentation/generated/CmdFooterNavigationPropertyDescriptions.json +17 -0
- package/src/documentation/generated/CmdFormElementPropertyDescriptions.json +178 -0
- package/src/documentation/generated/CmdFormFiltersPropertyDescriptions.json +32 -0
- package/src/documentation/generated/CmdFormPropertyDescriptions.json +40 -0
- package/src/documentation/generated/CmdGoogleMapsPropertyDescriptions.json +7 -0
- package/src/documentation/generated/CmdImageGalleryPropertyDescriptions.json +22 -0
- package/src/documentation/generated/CmdImageZoomPropertyDescriptions.json +12 -0
- package/src/documentation/generated/CmdListOfLinksPropertyDescriptions.json +60 -0
- package/src/documentation/generated/CmdLoginFormPropertyDescriptions.json +90 -0
- package/src/documentation/generated/CmdMainNavigationPropertyDescriptions.json +62 -0
- package/src/documentation/generated/CmdMultipleSwitchPropertyDescriptions.json +52 -0
- package/src/documentation/generated/CmdMultistepFormProgressBarPropertyDescriptions.json +17 -0
- package/src/documentation/generated/CmdOpeningHoursPropertyDescriptions.json +42 -0
- package/src/documentation/generated/CmdPagerPropertyDescriptions.json +37 -0
- package/src/documentation/generated/CmdProgressBarPropertyDescriptions.json +32 -0
- package/src/documentation/generated/CmdShareButtonsPropertyDescriptions.json +34 -0
- package/src/documentation/generated/CmdSiteHeaderPropertyDescriptions.json +27 -0
- package/src/documentation/generated/CmdSlideButtonPropertyDescriptions.json +25 -0
- package/src/documentation/generated/CmdSlideshowPropertyDescriptions.json +42 -0
- package/src/documentation/generated/CmdSwitchButtonPropertyDescriptions.json +79 -0
- package/src/documentation/generated/CmdSwitchLanguagePropertyDescriptions.json +7 -0
- package/src/documentation/generated/CmdSystemMessagePropertyDescriptions.json +40 -0
- package/src/documentation/generated/CmdTablePropertyDescriptions.json +62 -0
- package/src/documentation/generated/CmdTabsPropertyDescriptions.json +27 -0
- package/src/documentation/generated/CmdThumbnailScrollerPropertyDescriptions.json +32 -0
- package/src/documentation/generated/CmdTooltipPropertyDescriptions.json +17 -0
- package/src/documentation/generated/CmdUploadFormPropertyDescriptions.json +90 -0
- package/src/documentation/generated/CmdWidthLimitationWrapperPropertyDescriptions.json +41 -0
- package/src/documentation/generated/frameworkIcons.json +730 -0
- package/src/documentation/generated/logosIcons.json +110 -0
- package/src/documentation/tabs.js +46 -0
- package/src/documentation/views/ContainerPage.vue +237 -0
- package/src/documentation/views/HelpHome.vue +13 -0
- package/src/documentation/views/IconFont.vue +80 -0
- package/src/documentation/views/components/CmdAccordionHelp.vue +78 -0
- package/src/documentation/views/components/CmdAddressDataHelp.vue +65 -0
- package/src/documentation/views/components/CmdBackToTopButtonHelp.vue +62 -0
- package/src/documentation/views/components/CmdBankAccountDataHelp.vue +88 -0
- package/src/documentation/views/components/CmdBoxHelp.vue +137 -0
- package/src/documentation/views/components/CmdBoxSiteSearchHelp.vue +60 -0
- package/src/documentation/views/components/CmdBoxWrapperHelp.vue +111 -0
- package/src/documentation/views/components/CmdBreadcrumbsHelp.vue +51 -0
- package/src/documentation/views/components/CmdCompanyLogoHelp.vue +48 -0
- package/src/documentation/views/components/CmdCookieDisclaimerHelp.vue +105 -0
- package/src/documentation/views/components/CmdCustomHeadlineHelp.vue +53 -0
- package/src/documentation/views/components/CmdFakeSelectHelp.vue +175 -0
- package/src/documentation/views/components/CmdFancyBoxHelp.vue +79 -0
- package/src/documentation/views/components/CmdFormElementHelp.vue +412 -0
- package/src/documentation/views/components/CmdFormFiltersHelp.vue +69 -0
- package/src/documentation/views/components/CmdFormHelp.vue +41 -0
- package/src/documentation/views/components/CmdGoogleMapsHelp.vue +55 -0
- package/src/documentation/views/components/CmdImageGalleryHelp.vue +46 -0
- package/src/documentation/views/components/CmdImageZoomHelp.vue +34 -0
- package/src/documentation/views/components/CmdListOfLinksHelp.vue +64 -0
- package/src/documentation/views/components/CmdLoginFormHelp.vue +117 -0
- package/src/documentation/views/components/CmdMainNavigationHelp.vue +94 -0
- package/src/documentation/views/components/CmdMultistepFormProgressBarHelp.vue +49 -0
- package/src/documentation/views/components/CmdOpeningHoursHelp.vue +49 -0
- package/src/documentation/views/components/CmdPagerHelp.vue +57 -0
- package/src/documentation/views/components/CmdProgressBarHelp.vue +47 -0
- package/src/documentation/views/components/CmdShareButtonsHelp.vue +65 -0
- package/src/documentation/views/components/CmdSiteHeaderHelp.vue +72 -0
- package/src/documentation/views/components/CmdSlideButtonHelp.vue +90 -0
- package/src/documentation/views/components/CmdSlideshowHelp.vue +60 -0
- package/src/documentation/views/components/CmdSwitchLanguageHelp.vue +64 -0
- package/src/documentation/views/components/CmdSystemMessageHelp.vue +86 -0
- package/src/documentation/views/components/CmdTableHelp.vue +84 -0
- package/src/documentation/views/components/CmdTabsHelp.vue +52 -0
- package/src/documentation/views/components/CmdThumbnailScrollerHelp.vue +50 -0
- package/src/documentation/views/components/CmdTooltipHelp.vue +59 -0
- package/src/documentation/views/components/CmdUploadFormHelp.vue +59 -0
- package/src/documentation/views/components/CmdWidthLimitationWrapperHelp.vue +46 -0
- package/src/index.js +6 -3
- package/src/main.js +25 -15
- package/src/mixins/CmdAddressData/DefaultMessageProperties.js +17 -0
- package/src/mixins/CmdBox/DefaultMessageProperties.js +10 -0
- package/src/mixins/CmdFakeSelect/DefaultMessageProperties.js +9 -0
- package/src/mixins/CmdFormElement/DefaultMessageProperties.js +9 -0
- package/src/mixins/CmdImageGallery/DefaultMessageProperties.js +9 -0
- package/src/mixins/CmdSiteSearch/DefaultMessageProperties.js +14 -0
- package/src/mixins/CmdUploadForm/DefaultMessageProperties.js +53 -0
- package/src/mixins/FieldValidation.js +220 -0
- package/src/mixins/GlobalDefaultMessageProperties.js +15 -0
- package/src/mixins/I18n.js +56 -0
- package/src/mixins/Tooltip.js +26 -0
- package/src/router/index.js +67 -0
- package/src/utilities.js +3 -6
- package/src/utils/GetFileExtension.js +15 -0
- package/src/utils/common.js +6 -0
- package/src/utils/dom.js +8 -0
- package/src/utils/globalSequence.js +13 -0
- package/src/utils/string.js +8 -0
- package/src/assets/data/address.json +0 -13
- package/src/assets/data/footer-navigation.json +0 -38
- package/src/assets/data/languages.json +0 -31
- package/src/assets/data/multisteps.json +0 -27
- package/src/assets/data/navigation.json +0 -47
- package/src/assets/data/pager.json +0 -11
- package/src/assets/data/top-header-navigation.json +0 -27
- package/src/components/CmdFooterNavigation.vue +0 -71
- package/src/components/CmdMainHeadline.vue +0 -75
- package/src/components/CmdTopHeaderNavigation.vue +0 -88
@@ -2,11 +2,15 @@
|
|
2
2
|
<div class="cmd-width-limitation-wrapper" :class="{'sticky': sticky}">
|
3
3
|
<component v-if="innerWrapper" :is="innerComponent" :class="setInnerClass">
|
4
4
|
<a v-if="anchorId" :id="anchorId"></a>
|
5
|
+
<!-- begin slot-content -->
|
5
6
|
<slot></slot>
|
7
|
+
<!-- end slot-content -->
|
6
8
|
</component>
|
7
9
|
<template v-else>
|
10
|
+
<!-- begin slot-content -->
|
8
11
|
<a v-if="anchorId" :id="anchorId"></a>
|
9
12
|
<slot></slot>
|
13
|
+
<!-- end slot-content -->
|
10
14
|
</template>
|
11
15
|
</div>
|
12
16
|
</template>
|
@@ -17,6 +21,8 @@ export default {
|
|
17
21
|
props: {
|
18
22
|
/**
|
19
23
|
* set a html-tag as inner tag
|
24
|
+
*
|
25
|
+
* @allowedValues: section, div
|
20
26
|
*/
|
21
27
|
innerComponent: {
|
22
28
|
type: String,
|
@@ -26,16 +32,17 @@ export default {
|
|
26
32
|
}
|
27
33
|
},
|
28
34
|
/**
|
29
|
-
* activate if the inner content should be wrapped in inner component tag
|
35
|
+
* activate if the inner content should be wrapped in inner component tag (recommended)
|
30
36
|
*
|
31
37
|
* (if deactivated, content will be directly placed inside cmd-width-limitation-wrapper)
|
38
|
+
*
|
32
39
|
*/
|
33
40
|
innerWrapper: {
|
34
41
|
type: Boolean,
|
35
42
|
default: true
|
36
43
|
},
|
37
44
|
/**
|
38
|
-
* activate if wrapper (and its content) should be sticky (=
|
45
|
+
* activate if wrapper (and its content) should be sticky (=position remains the same if content below is scrolled)
|
39
46
|
*
|
40
47
|
* i.e. use for site-header
|
41
48
|
*
|
@@ -104,10 +111,6 @@ export default {
|
|
104
111
|
top: 0;
|
105
112
|
}
|
106
113
|
|
107
|
-
&#site-footer {
|
108
|
-
|
109
|
-
}
|
110
|
-
|
111
114
|
&#site-footer {
|
112
115
|
padding: var(--grid-gap) 0;
|
113
116
|
border-top: var(--default-border);
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import {reactive} from "vue"
|
2
|
+
import {useEventListener} from "./event"
|
3
|
+
import {getOffsetTop} from "../utils/dom"
|
4
|
+
|
5
|
+
function toArray(items) {
|
6
|
+
if (items instanceof NodeList) {
|
7
|
+
return Array.from(items)
|
8
|
+
}
|
9
|
+
if (Array.isArray(items)) {
|
10
|
+
return items
|
11
|
+
}
|
12
|
+
return []
|
13
|
+
}
|
14
|
+
|
15
|
+
function buildItemList(itemSupplier, itemList) {
|
16
|
+
if (!itemList.length) {
|
17
|
+
const items = itemSupplier()
|
18
|
+
toArray(items).map((item, index) => {
|
19
|
+
const itemData = {
|
20
|
+
offsetTop: getOffsetTop(item)
|
21
|
+
}
|
22
|
+
if (index + 1 < items.length) {
|
23
|
+
itemData.height = getOffsetTop(items.item(index + 1)) - itemData.offsetTop
|
24
|
+
} else {
|
25
|
+
itemData.height = document.documentElement.scrollHeight - itemData.offsetTop
|
26
|
+
}
|
27
|
+
return itemData
|
28
|
+
}).forEach(item => itemList.push(item))
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
export function useScrollspy(itemSupplier, initialActiveItem = 0) {
|
33
|
+
const itemList = []
|
34
|
+
const scrollSpy = reactive({
|
35
|
+
activeItem: initialActiveItem,
|
36
|
+
reset() {
|
37
|
+
this.activeItem = 0
|
38
|
+
itemList.length = 0
|
39
|
+
}
|
40
|
+
})
|
41
|
+
useEventListener(window, "scroll", () => {
|
42
|
+
const sy = window.scrollY
|
43
|
+
buildItemList(itemSupplier, itemList)
|
44
|
+
for (let i = 0, c = itemList.length; i < c; i++) {
|
45
|
+
if (sy < itemList[i].offsetTop + itemList[i].height / 2) {
|
46
|
+
scrollSpy.activeItem = i
|
47
|
+
break
|
48
|
+
}
|
49
|
+
}
|
50
|
+
})
|
51
|
+
return scrollSpy
|
52
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export default {
|
2
|
+
// el = real dom-element
|
3
|
+
mounted(el) {
|
4
|
+
// check if element is native input-element
|
5
|
+
if(el.tagName === "INPUT" || el.tagName === "SELECT" || el.tagName === "TEXTAREA") {
|
6
|
+
el.focus()
|
7
|
+
} else {
|
8
|
+
// check if component is used, which contains a native input-element
|
9
|
+
const innerInputElement = el.querySelector("input, select, textarea")
|
10
|
+
if(innerInputElement) {
|
11
|
+
innerInputElement.focus()
|
12
|
+
}
|
13
|
+
// no input-element found
|
14
|
+
else {
|
15
|
+
console.warn("No input-element for focus-directive on element " + el.tagName + " found!")
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -2,7 +2,7 @@ export default {
|
|
2
2
|
// el = real dom-element
|
3
3
|
// binding.value = value of v-directive
|
4
4
|
mounted(el, binding) {
|
5
|
-
if (binding.value) {
|
5
|
+
if (binding.value && typeof binding.value === "string") {
|
6
6
|
let regex = /[^\d]/g // match everything except all digits (and continue (/g) after first match is found)
|
7
7
|
let phonenumber = binding.value.replace(/^\s*\+/, "00")
|
8
8
|
el.href = "tel:" + phonenumber.replace(regex, "")
|
@@ -0,0 +1,50 @@
|
|
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>
|
@@ -0,0 +1,237 @@
|
|
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>
|
@@ -0,0 +1,46 @@
|
|
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>
|
@@ -0,0 +1,113 @@
|
|
1
|
+
<script setup>
|
2
|
+
import {defineProps, ref, computed} from "vue"
|
3
|
+
import {isFrameMode} from "../../utils/common"
|
4
|
+
import ComponentCode from "./ComponentCode"
|
5
|
+
import CmdBox from "../../components/CmdBox"
|
6
|
+
|
7
|
+
defineProps({
|
8
|
+
code: {
|
9
|
+
type: String,
|
10
|
+
required: true
|
11
|
+
},
|
12
|
+
data: {
|
13
|
+
type: [String, Object, Array],
|
14
|
+
required: false
|
15
|
+
},
|
16
|
+
isFirstComponent: {
|
17
|
+
type: Boolean,
|
18
|
+
default: false
|
19
|
+
}
|
20
|
+
})
|
21
|
+
|
22
|
+
const responsiveWidth = ref("0px")
|
23
|
+
const frameUrl = new URL(location)
|
24
|
+
const showFrame = computed(() => !isFrameMode() && responsiveWidth.value !== "0px")
|
25
|
+
|
26
|
+
frameUrl.searchParams.set("frameMode", "true")
|
27
|
+
|
28
|
+
function changeWidth(width) {
|
29
|
+
responsiveWidth.value = width + "px"
|
30
|
+
}
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<template>
|
34
|
+
<div class="flex-container vertical">
|
35
|
+
<div>
|
36
|
+
<header class="flex-container" id="switch-device-view">
|
37
|
+
<h4>View</h4>
|
38
|
+
<ul v-if="isFirstComponent" class="flex-container">
|
39
|
+
<li>
|
40
|
+
Toggle width:
|
41
|
+
</li>
|
42
|
+
<li>
|
43
|
+
<a :class="['icon-device-smartphone', {'active': responsiveWidth === '600px'}]" href="#" @click.prevent="changeWidth(600)" title="Change view to smartphone (0-600px)"></a>
|
44
|
+
</li>
|
45
|
+
<li>
|
46
|
+
<a :class="['icon-device-tablet', {'active': responsiveWidth === '1023px'}]" href="#" @click.prevent="changeWidth(1023)" title="Change view to tablet (601px-1023px)"></a>
|
47
|
+
</li>
|
48
|
+
<li>
|
49
|
+
<a :class="['icon-device-laptop', {'active': responsiveWidth === '1280px'}]" href="#" @click.prevent="changeWidth(1280)" title="Change view to laptop (1024px-1280px)"></a>
|
50
|
+
</li>
|
51
|
+
<li>
|
52
|
+
<a :class="['icon-device-desktop', {'active': responsiveWidth === '0px'}]" href="#" @click.prevent="changeWidth(0)" title="Change view to desktop (1281px+)"></a>
|
53
|
+
</li>
|
54
|
+
</ul>
|
55
|
+
</header>
|
56
|
+
<div v-if="showFrame" id="responsive-view-wrapper" :style="{width: responsiveWidth}">
|
57
|
+
<iframe :src="frameUrl.href" id="responsive-view" :style="{width: responsiveWidth}"></iframe>
|
58
|
+
</div>
|
59
|
+
<slot v-if="!showFrame"></slot>
|
60
|
+
</div>
|
61
|
+
<div v-if="!isFrameMode()" class="flex-container">
|
62
|
+
<div>
|
63
|
+
<CmdBox :useSlots="['body']" :collapsible="true" :collapsingBoxesOpen="true" :cmdCustomHeadline="{headlineText: 'Code', headlineLevel: 4}">
|
64
|
+
<template v-slot:body>
|
65
|
+
<ComponentCode :code="code"/>
|
66
|
+
</template>
|
67
|
+
</CmdBox>
|
68
|
+
</div>
|
69
|
+
<div v-if="data">
|
70
|
+
<CmdBox :useSlots="['body']" :collapsible="true" :collapsingBoxesOpen="true" :cmdCustomHeadline="{headlineText: 'Data', headlineLevel: 4}">
|
71
|
+
<template v-slot:body>
|
72
|
+
<ComponentCode :code="data" language="json"/>
|
73
|
+
</template>
|
74
|
+
</CmdBox>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
</template>
|
79
|
+
|
80
|
+
<style lang="scss">
|
81
|
+
|
82
|
+
#responsive-view-wrapper {
|
83
|
+
resize: vertical;
|
84
|
+
overflow: hidden;
|
85
|
+
display: flex;
|
86
|
+
|
87
|
+
#responsive-view {
|
88
|
+
flex-grow: 1;
|
89
|
+
border: .1rem dotted var(--text-color);
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
#switch-device-view {
|
94
|
+
justify-content: space-between;
|
95
|
+
|
96
|
+
> * {
|
97
|
+
flex: none;
|
98
|
+
}
|
99
|
+
|
100
|
+
ul {
|
101
|
+
align-items: center;
|
102
|
+
|
103
|
+
li {
|
104
|
+
list-style-type: none;
|
105
|
+
margin: 0;
|
106
|
+
|
107
|
+
&:first-child {
|
108
|
+
white-space: nowrap;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
}
|
113
|
+
</style>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export default [`<CmdAccordion :accordionData="2" toggleMode="multiple">
|
2
|
+
<template v-slot:accordionHeadline0>
|
3
|
+
<h4>Accordion 1</h4>
|
4
|
+
</template>
|
5
|
+
<template v-slot:accordionContent0>
|
6
|
+
<p>
|
7
|
+
Content for accordion 1
|
8
|
+
</p>
|
9
|
+
</template>
|
10
|
+
<template v-slot:accordionHeadline1>
|
11
|
+
<h4>Accordion 2</h4>
|
12
|
+
</template>
|
13
|
+
<template v-slot:accordionContent1>
|
14
|
+
<p>
|
15
|
+
Content for accordion 2
|
16
|
+
</p>
|
17
|
+
</template>
|
18
|
+
</CmdAccordion>`,
|
19
|
+
`<CmdAccordion
|
20
|
+
:accordionData="accordion.accordionData1"
|
21
|
+
/>`
|
22
|
+
]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export default [`<CmdAddressData
|
2
|
+
:addressData="addressData"
|
3
|
+
:linkGoogleMaps="true"
|
4
|
+
:cmdCustomHeadline="{
|
5
|
+
headlineText: 'Address',
|
6
|
+
headlineLevel: 5
|
7
|
+
}"
|
8
|
+
/>`,
|
9
|
+
`<CmdAddressData
|
10
|
+
:addressData="addressData"
|
11
|
+
:linkGoogleMaps="false"
|
12
|
+
:cmdCustomHeadline="{
|
13
|
+
headlineText: 'Address',
|
14
|
+
headlineLevel: 5
|
15
|
+
}"
|
16
|
+
:showLabels="false"
|
17
|
+
/>`]
|