comand-component-library 3.1.43 → 3.1.46
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/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
@@ -0,0 +1,220 @@
|
|
1
|
+
// import mixins
|
2
|
+
import I18n from "./I18n"
|
3
|
+
import GlobalDefaultMessageProperties from "./GlobalDefaultMessageProperties"
|
4
|
+
|
5
|
+
export default {
|
6
|
+
data() {
|
7
|
+
return {
|
8
|
+
validationStatus: "",
|
9
|
+
capsLockActivated: false
|
10
|
+
}
|
11
|
+
},
|
12
|
+
mixins: [
|
13
|
+
I18n,
|
14
|
+
GlobalDefaultMessageProperties
|
15
|
+
],
|
16
|
+
props: {
|
17
|
+
/**
|
18
|
+
* validation message shown on clicking the status-icon of a form-element with state
|
19
|
+
*/
|
20
|
+
validationMessage: {
|
21
|
+
type: String,
|
22
|
+
required: false
|
23
|
+
},
|
24
|
+
/**
|
25
|
+
* link to faq/help
|
26
|
+
*/
|
27
|
+
helplink: {
|
28
|
+
type: Object,
|
29
|
+
default() {
|
30
|
+
return {
|
31
|
+
show: true,
|
32
|
+
url: "helpurl",
|
33
|
+
target: "help",
|
34
|
+
text: "Open help",
|
35
|
+
// text: this.getMessage("cmdfieldvalidation.open_detailed_help"),
|
36
|
+
icon: {
|
37
|
+
iconClass: "icon-questionmark-circle",
|
38
|
+
tooltip: "Open help in new tab"
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
},
|
43
|
+
/**
|
44
|
+
* define custom requirement for validation
|
45
|
+
*
|
46
|
+
* prepared functions are already defined in FieldValidation.js
|
47
|
+
*/
|
48
|
+
customRequirements: {
|
49
|
+
type: Array,
|
50
|
+
required: false
|
51
|
+
},
|
52
|
+
/**
|
53
|
+
* toggle requirements in tooltip
|
54
|
+
*/
|
55
|
+
showRequirements: {
|
56
|
+
type: Boolean,
|
57
|
+
default: true
|
58
|
+
},
|
59
|
+
iconError: {
|
60
|
+
type: String,
|
61
|
+
default: "icon-error-circle"
|
62
|
+
} ,
|
63
|
+
iconWarning: {
|
64
|
+
type: String,
|
65
|
+
default: "icon-exclamation-circle"
|
66
|
+
},
|
67
|
+
iconSuccess: {
|
68
|
+
type: String,
|
69
|
+
default: "icon-check-circle"
|
70
|
+
},
|
71
|
+
iconInfo: {
|
72
|
+
type: String,
|
73
|
+
default: "icon-info-circle"
|
74
|
+
},
|
75
|
+
iconCapsLock: {
|
76
|
+
type: String,
|
77
|
+
default: "icon-home"
|
78
|
+
},
|
79
|
+
iconHelp: {
|
80
|
+
type: String,
|
81
|
+
default: "icon-questionmark-circle"
|
82
|
+
}
|
83
|
+
},
|
84
|
+
computed: {
|
85
|
+
getValidationMessage() {
|
86
|
+
if (this.validationStatus !== "") {
|
87
|
+
if (this.validationStatus === "error" && !this.validationMessage) {
|
88
|
+
return this.getMessage("cmdfieldvalidation.information_not_filled_correctly")
|
89
|
+
}
|
90
|
+
if (this.validationStatus === "warning" && this.capsLockActivated) {
|
91
|
+
return this.getMessage("cmdfieldvalidation.caps_lock_is_activated")
|
92
|
+
}
|
93
|
+
if (this.validationStatus === "success") {
|
94
|
+
return this.getMessage("cmdfieldvalidation.information_filled_correctly")
|
95
|
+
}
|
96
|
+
}
|
97
|
+
return ""
|
98
|
+
},
|
99
|
+
getStatusIconClass() {
|
100
|
+
if (this.validationStatus !== "") {
|
101
|
+
if (!this.capsLockActivated) {
|
102
|
+
if (this.validationStatus === "error") {
|
103
|
+
return this.iconError
|
104
|
+
} else if (this.validationStatus === "warning") {
|
105
|
+
return this.iconWarning
|
106
|
+
} else if (this.validationStatus === "success") {
|
107
|
+
return this.iconSuccess
|
108
|
+
}
|
109
|
+
return this.iconInfo
|
110
|
+
} else {
|
111
|
+
return this.iconCapsLock
|
112
|
+
}
|
113
|
+
}
|
114
|
+
return this.iconHelp
|
115
|
+
},
|
116
|
+
inputRequirements() {
|
117
|
+
const standardRequirements = []
|
118
|
+
// check if field is required
|
119
|
+
if(this.$attrs.required) {
|
120
|
+
standardRequirements.push({
|
121
|
+
message: this.getRequirementMessage(),
|
122
|
+
valid(value, attributes) {
|
123
|
+
return !attributes.required || value.length > 0
|
124
|
+
}
|
125
|
+
})
|
126
|
+
}
|
127
|
+
// check if filed has a minimum length
|
128
|
+
if(this.$attrs.minlength) {
|
129
|
+
standardRequirements.push({
|
130
|
+
message: "Input has minimum length (" + this.value.length + "/" + this.$attrs.minlength + ")",
|
131
|
+
valid(value, attributes) {
|
132
|
+
return value.length >= attributes.minlength
|
133
|
+
}
|
134
|
+
})
|
135
|
+
}
|
136
|
+
// check is field has custom requirements defined
|
137
|
+
if(!this.customRequirements || !this.customRequirements.length) {
|
138
|
+
return standardRequirements
|
139
|
+
}
|
140
|
+
// duplicate existing requirements into new (combined) array
|
141
|
+
return [...standardRequirements, ...this.customRequirements]
|
142
|
+
}
|
143
|
+
},
|
144
|
+
methods: {
|
145
|
+
checkForCapsLock(event) {
|
146
|
+
if ((["password", "number", "url", "email"].includes(this.$attrs.type)) && event.getModifierState("CapsLock")) {
|
147
|
+
this.capsLockActivated = true
|
148
|
+
this.validationStatus = "warning"
|
149
|
+
} else {
|
150
|
+
this.capsLockActivated = false
|
151
|
+
this.validationStatus = ""
|
152
|
+
}
|
153
|
+
},
|
154
|
+
getRequirementMessage() {
|
155
|
+
return this.getMessage("cmdfieldvalidation.required_field_is_filled")
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
|
160
|
+
function validateSpecialCharacters(message = "Field contains Special character") {
|
161
|
+
return {
|
162
|
+
message,
|
163
|
+
valid(value) {
|
164
|
+
return !/^[a-z0-9\s]*$/i.test(value)
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
function validateNumbers(message = "Field contains numbers") {
|
170
|
+
return {
|
171
|
+
message, // short for message: message
|
172
|
+
valid(value) {
|
173
|
+
return /\d/.test(value)
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
function validateNumbersOnly(message = "Field contains numbers only") {
|
179
|
+
return {
|
180
|
+
message, // short for message: message
|
181
|
+
valid(value) {
|
182
|
+
return /^\d*$/.test(value)
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
function validateCharacters(message = "Field contains at least one character") {
|
188
|
+
return {
|
189
|
+
message,
|
190
|
+
valid(value) {
|
191
|
+
return /[a-z]/i.test(value)
|
192
|
+
}
|
193
|
+
}
|
194
|
+
}
|
195
|
+
|
196
|
+
function validateCapitalLetters(message = "Field contains capital letters") {
|
197
|
+
return {
|
198
|
+
message,
|
199
|
+
valid(value) {
|
200
|
+
return /[A-Z]/.test(value)
|
201
|
+
}
|
202
|
+
}
|
203
|
+
}
|
204
|
+
/*
|
205
|
+
function validateMaxlength(message = "Input has maximum length") {
|
206
|
+
return {
|
207
|
+
message,
|
208
|
+
valid(value, attributes) {
|
209
|
+
return value.length <= attributes.maxlength
|
210
|
+
}
|
211
|
+
}
|
212
|
+
}
|
213
|
+
*/
|
214
|
+
export {
|
215
|
+
validateSpecialCharacters,
|
216
|
+
validateNumbers,
|
217
|
+
validateNumbersOnly,
|
218
|
+
validateCharacters,
|
219
|
+
validateCapitalLetters
|
220
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export default {
|
2
|
+
data() {
|
3
|
+
return {
|
4
|
+
defaultMessageProperties: {
|
5
|
+
"cmdfieldvalidation.open_detailed_help": "Open detailed help!",
|
6
|
+
|
7
|
+
"cmdfieldvalidation.information_not_filled_correctly": "This information is not filled correctly!",
|
8
|
+
"cmdfieldvalidation.information_filled_correctly": "This information is filled correctly!",
|
9
|
+
"cmdfieldvalidation.caps_lock_is_activated": "Attention: Caps lock is activated!",
|
10
|
+
"cmdfieldvalidation.required_field_is_filled": "Required field is filled!",
|
11
|
+
"cmdfieldvalidation.field_contains_special_character": "Field contains Special character"
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
export default {
|
2
|
+
props: {
|
3
|
+
/**
|
4
|
+
* Message properties for internationalization.
|
5
|
+
*
|
6
|
+
* You can either specify an object with key-value-pairs or a function which
|
7
|
+
* takes at least one input parameter (the key) and returns the according
|
8
|
+
* message.
|
9
|
+
*
|
10
|
+
* If key-value-pairs are provided, the value can be either a string or a
|
11
|
+
* function. If it is a function, then it is called with an array of
|
12
|
+
* replacements for placeholders in the message.
|
13
|
+
*
|
14
|
+
* If a function is provided, it is called with two parameters. The first
|
15
|
+
* parameter is the message key and the second parameter is an array of
|
16
|
+
* replacements for placeholders in the message.
|
17
|
+
*
|
18
|
+
* Example:
|
19
|
+
* <pre>
|
20
|
+
* {
|
21
|
+
* "my.message1": "My {0} test message with {1} placeholders",
|
22
|
+
* "my.message2": params => "My {0} message".replace("{0}", params[0])
|
23
|
+
* }
|
24
|
+
* </pre>
|
25
|
+
*/
|
26
|
+
i18n: {
|
27
|
+
type: [Object, Function],
|
28
|
+
default: () => ({})
|
29
|
+
}
|
30
|
+
},
|
31
|
+
methods: {
|
32
|
+
getMessage(key, ...params) {
|
33
|
+
if (!key) {
|
34
|
+
return ""
|
35
|
+
}
|
36
|
+
let messages = this.i18n
|
37
|
+
if (typeof this.i18n === "function") {
|
38
|
+
messages = this.i18n.call(this, key, params)
|
39
|
+
if (typeof messages !== "object") {
|
40
|
+
return messages
|
41
|
+
}
|
42
|
+
}
|
43
|
+
let message =
|
44
|
+
messages[key] ||
|
45
|
+
(this.defaultMessageProperties && this.defaultMessageProperties[key]) ||
|
46
|
+
key
|
47
|
+
if (typeof message === "function") {
|
48
|
+
return message.call(this, params || [])
|
49
|
+
}
|
50
|
+
if (Array.isArray(params) && params.length) {
|
51
|
+
params.forEach((param, index) => (message = message.replace("{" + index + "}", param)))
|
52
|
+
}
|
53
|
+
return message
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import {nextSequenceValue} from "../utils/globalSequence";
|
2
|
+
|
3
|
+
export default {
|
4
|
+
data() {
|
5
|
+
return {
|
6
|
+
tooltip: false,
|
7
|
+
tooltipId: "tooltip-" + nextSequenceValue()
|
8
|
+
}
|
9
|
+
},
|
10
|
+
props: {
|
11
|
+
/**
|
12
|
+
* useCustomTooltip
|
13
|
+
*/
|
14
|
+
useCustomTooltip: {
|
15
|
+
type: Boolean,
|
16
|
+
default: true
|
17
|
+
},
|
18
|
+
/**
|
19
|
+
* allow closing tooltip by escape-key
|
20
|
+
*/
|
21
|
+
allowEscapeKey: {
|
22
|
+
type: Boolean,
|
23
|
+
default: true
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { createRouter, createWebHistory } from "vue-router"
|
2
|
+
import {routeHandler as tabsRouteHandler} from "../documentation/tabs"
|
3
|
+
import ContainerPage from "../documentation/views/ContainerPage"
|
4
|
+
import HelpHome from "../documentation/views/HelpHome"
|
5
|
+
import IconFont from "../documentation/views/IconFont"
|
6
|
+
import componentsDescription from "../documentation/data/componentsDescription"
|
7
|
+
import ComponentDocumentation from "../ComponentDocumentation"
|
8
|
+
|
9
|
+
const routes = []
|
10
|
+
|
11
|
+
const componentNames = Object.keys(componentsDescription)
|
12
|
+
|
13
|
+
routes.push({
|
14
|
+
path: "/",
|
15
|
+
name: "home",
|
16
|
+
component: HelpHome
|
17
|
+
})
|
18
|
+
|
19
|
+
routes.push({
|
20
|
+
path: "/subsubpage/:param1/:param2",
|
21
|
+
name: "subsubpage",
|
22
|
+
redirect: {
|
23
|
+
name: componentNames[0]
|
24
|
+
}
|
25
|
+
})
|
26
|
+
|
27
|
+
const componentsRoute = {
|
28
|
+
path: "/components",
|
29
|
+
name: "components",
|
30
|
+
component: ComponentDocumentation,
|
31
|
+
redirect: {
|
32
|
+
name: componentNames[0]
|
33
|
+
},
|
34
|
+
children: []
|
35
|
+
}
|
36
|
+
|
37
|
+
for(let i = 0 ; i < componentNames.length ; i++) {
|
38
|
+
componentsRoute.children.push(
|
39
|
+
{
|
40
|
+
path: componentNames[i] + "/:tab?",
|
41
|
+
name: componentNames[i],
|
42
|
+
component: ContainerPage,
|
43
|
+
props: () => ({
|
44
|
+
componentName: componentNames[i],
|
45
|
+
previousComponentName: i === 0 ? componentNames[componentNames.length - 1] : componentNames[i - 1],
|
46
|
+
nextComponentName: i === componentNames.length - 1 ? componentNames[0] : componentNames[i + 1]
|
47
|
+
})
|
48
|
+
}
|
49
|
+
)
|
50
|
+
}
|
51
|
+
|
52
|
+
routes.push(componentsRoute)
|
53
|
+
|
54
|
+
routes.push({
|
55
|
+
path: "/iconfont",
|
56
|
+
name: "iconfont",
|
57
|
+
component: IconFont
|
58
|
+
})
|
59
|
+
|
60
|
+
const router = createRouter({
|
61
|
+
history: createWebHistory(process.env.BASE_URL),
|
62
|
+
routes
|
63
|
+
})
|
64
|
+
|
65
|
+
router.beforeEach(tabsRouteHandler)
|
66
|
+
|
67
|
+
export default router
|
package/src/utilities.js
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
function getRoute (entry) {
|
2
|
-
if(entry.
|
3
|
-
return entry.
|
4
|
-
}
|
5
|
-
return {
|
6
|
-
name: entry.link.name,
|
7
|
-
params: entry.link.params || {} // if entry.link.params is set (or return empty object)
|
2
|
+
if(entry.path) {
|
3
|
+
return entry.path
|
8
4
|
}
|
5
|
+
return entry.route
|
9
6
|
}
|
10
7
|
|
11
8
|
export { getRoute }
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* @param filename
|
3
|
+
* @returns {string} file extension of given filename or empty string if filename is empty/undefined
|
4
|
+
*/
|
5
|
+
function getFileExtension(filename) {
|
6
|
+
if (filename) {
|
7
|
+
const positionOfLastDot = filename.lastIndexOf(".")
|
8
|
+
if (positionOfLastDot > -1) {
|
9
|
+
return filename.substring(positionOfLastDot + 1)
|
10
|
+
}
|
11
|
+
}
|
12
|
+
return ""
|
13
|
+
}
|
14
|
+
|
15
|
+
export { getFileExtension }
|
package/src/utils/dom.js
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
const sequences = {}
|
2
|
+
|
3
|
+
function nextSequenceValue(sequenceName = "defaultSequence") {
|
4
|
+
const currentValue = sequences[sequenceName] || 0 // get currentValue for specific sequence (else set value to 0)
|
5
|
+
sequences[sequenceName] = currentValue + 1 // raise currentValue by 1
|
6
|
+
return sequences[sequenceName]
|
7
|
+
}
|
8
|
+
|
9
|
+
function currentSequenceValue(sequenceName = "defaultSequence") {
|
10
|
+
return sequences[sequenceName] || 0 // get currentValue for specific sequence (else set value to 0)
|
11
|
+
}
|
12
|
+
|
13
|
+
export {nextSequenceValue, currentSequenceValue}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"iconClass": "icon-user-profile",
|
4
|
-
"type": "href",
|
5
|
-
"linkName": "",
|
6
|
-
"path": "#",
|
7
|
-
"target": "",
|
8
|
-
"tooltip": "Link without name, but tooltip"
|
9
|
-
},
|
10
|
-
{
|
11
|
-
"type": "href",
|
12
|
-
"linkName": "Private policy",
|
13
|
-
"path": "",
|
14
|
-
"target": "",
|
15
|
-
"fancybox": true
|
16
|
-
},
|
17
|
-
{
|
18
|
-
"type": "href",
|
19
|
-
"linkName": "CoManD-Website",
|
20
|
-
"path": "http://www.comand-cms.com",
|
21
|
-
"target": "_blank"
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"type": "href",
|
25
|
-
"linkName": "Router with path",
|
26
|
-
"path": "http://www.comand-cms.com"
|
27
|
-
},
|
28
|
-
{
|
29
|
-
"type": "href",
|
30
|
-
"linkName": "Router with name",
|
31
|
-
"path": "#"
|
32
|
-
},
|
33
|
-
{
|
34
|
-
"type": "href",
|
35
|
-
"linkName": "Router with name and params",
|
36
|
-
"path": "#"
|
37
|
-
}
|
38
|
-
]
|
@@ -1,31 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"iso2": "de",
|
4
|
-
"name": "Deutsch",
|
5
|
-
"tooltip": "Sprache zu deutsch wechseln",
|
6
|
-
"link": {
|
7
|
-
"type": "router",
|
8
|
-
"path": "/"
|
9
|
-
}
|
10
|
-
},
|
11
|
-
{
|
12
|
-
"iso2": "en",
|
13
|
-
"name": "English",
|
14
|
-
"tooltip": "Switch language to English",
|
15
|
-
"link": {
|
16
|
-
"type": "router",
|
17
|
-
"name": "somename",
|
18
|
-
"params": {
|
19
|
-
"id": 123
|
20
|
-
}
|
21
|
-
}
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"iso2": "fr",
|
25
|
-
"name": "Francais",
|
26
|
-
"tooltip": "Switch language to Francais",
|
27
|
-
"link": {
|
28
|
-
"path": "#"
|
29
|
-
}
|
30
|
-
}
|
31
|
-
]
|
@@ -1,27 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"path": "",
|
4
|
-
"name": "Contact",
|
5
|
-
"iconClass": "icon-address"
|
6
|
-
},
|
7
|
-
{
|
8
|
-
"path": "",
|
9
|
-
"name": "Settings",
|
10
|
-
"iconClass": "icon-configuration"
|
11
|
-
},
|
12
|
-
{
|
13
|
-
"path": "",
|
14
|
-
"name": "Attachments",
|
15
|
-
"iconClass": "icon-attachment"
|
16
|
-
},
|
17
|
-
{
|
18
|
-
"path": "",
|
19
|
-
"name": "Terms and Conditions",
|
20
|
-
"iconClass": "icon-section-sign"
|
21
|
-
},
|
22
|
-
{
|
23
|
-
"path": "",
|
24
|
-
"name": "Summary",
|
25
|
-
"iconClass": "icon-rows"
|
26
|
-
}
|
27
|
-
]
|
@@ -1,47 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"name": "Entry 1",
|
4
|
-
"href": "",
|
5
|
-
"target": "",
|
6
|
-
"subentries": []
|
7
|
-
},
|
8
|
-
{
|
9
|
-
"name": "Entry 2",
|
10
|
-
"href": "",
|
11
|
-
"target": "",
|
12
|
-
"subentries": [
|
13
|
-
{
|
14
|
-
"name": "Entry 2.1",
|
15
|
-
"href": "",
|
16
|
-
"target": "",
|
17
|
-
"subentries": [
|
18
|
-
{
|
19
|
-
"name": "Entry 2.1.1",
|
20
|
-
"href": "",
|
21
|
-
"target": ""
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"name": "Entry 2.1.2",
|
25
|
-
"href": "",
|
26
|
-
"target": ""
|
27
|
-
},
|
28
|
-
{
|
29
|
-
"name": "Entry 2.1.3",
|
30
|
-
"href": "",
|
31
|
-
"target": ""
|
32
|
-
}
|
33
|
-
]
|
34
|
-
},
|
35
|
-
{
|
36
|
-
"name": "Entry 2.2",
|
37
|
-
"href": "",
|
38
|
-
"target": ""
|
39
|
-
}
|
40
|
-
]
|
41
|
-
},
|
42
|
-
{
|
43
|
-
"name": "CoManD-CMS",
|
44
|
-
"href": "http://www.comand-cms.com",
|
45
|
-
"target": "_blank"
|
46
|
-
}
|
47
|
-
]
|
@@ -1,27 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"linkType": "href",
|
4
|
-
"path": "http://www.comand-cms.com",
|
5
|
-
"target": "_blank",
|
6
|
-
"icon": {
|
7
|
-
"iconClass": "icon-globe",
|
8
|
-
"tooltip": "CoManD-CMS"
|
9
|
-
}
|
10
|
-
},
|
11
|
-
{
|
12
|
-
"linkType": "href",
|
13
|
-
"path": "#anchor-section4",
|
14
|
-
"icon": {
|
15
|
-
"iconClass": "icon-mail",
|
16
|
-
"tooltip": "Contact"
|
17
|
-
}
|
18
|
-
},
|
19
|
-
{
|
20
|
-
"linkType": "href",
|
21
|
-
"path": "#anchor-section3",
|
22
|
-
"icon": {
|
23
|
-
"iconClass": "icon-user-profile",
|
24
|
-
"tooltip": "Login"
|
25
|
-
}
|
26
|
-
}
|
27
|
-
]
|