comand-component-library 3.1.91 → 3.1.92
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 +36 -34
- package/src/assets/styles/global-styles.scss +0 -1
- package/src/components/CmdBox.vue +3 -2
- package/src/components/CmdCookieDisclaimer.vue +19 -3
- package/src/components/CmdFormElement.vue +12 -3
- package/src/components/CmdLoginForm.vue +80 -103
- package/src/components/CmdNewsletterSubscription.vue +8 -2
- package/src/components/{CmdBoxSiteSearch.vue → CmdSiteSearch.vue} +32 -12
- package/src/components/CmdTooltipForInputElements.vue +1 -19
- package/src/documentation/generated/CmdLoginFormPropertyDescriptions.json +3 -3
- package/src/documentation/generated/CmdSiteSearchPropertyDescriptions.json +79 -0
- package/src/documentation/generated/CmdTooltipForInputElementsPropertyDescriptions.json +1 -6
- package/src/index.js +1 -1
- package/src/mixins/CmdFormElement/DefaultMessageProperties.js +2 -1
- package/src/mixins/FieldValidation.js +11 -6
@@ -1,8 +1,8 @@
|
|
1
1
|
<template>
|
2
2
|
<fieldset class="cmd-box-site-search flex-container">
|
3
3
|
<!-- begin legend -->
|
4
|
-
<legend
|
5
|
-
<!--
|
4
|
+
<legend :class="{'hidden' : !showLegend}">{{ textLegend }}</legend>
|
5
|
+
<!-- end legend -->
|
6
6
|
|
7
7
|
<!-- begin CmdHeadline -->
|
8
8
|
<CmdHeadline
|
@@ -12,20 +12,21 @@
|
|
12
12
|
<!-- end CmdHeadline -->
|
13
13
|
|
14
14
|
<!-- begin form-elements -->
|
15
|
-
<div class="flex-container">
|
15
|
+
<div class="flex-container align-bottom">
|
16
16
|
<!-- begin CmdFormElement for first input -->
|
17
17
|
<CmdFormElement
|
18
|
-
v-if="cmdFormElementInput1.show"
|
19
18
|
element="input"
|
20
19
|
:type="cmdFormElementInput1.type"
|
21
20
|
:show-label="cmdFormElementInput1.showLabel"
|
22
21
|
:labelText="cmdFormElementInput1.labelText"
|
23
22
|
:placeholder="cmdFormElementInput1.placeholder"
|
23
|
+
:required="cmdFormElementInput1.required"
|
24
|
+
:showSearchButton="cmdFormElementInput1.showSearchButton"
|
24
25
|
v-model="searchValue1"
|
25
26
|
/>
|
26
27
|
<!-- end CmdFormElement for first input -->
|
27
28
|
|
28
|
-
<div class="flex-container no-gap">
|
29
|
+
<div class="flex-container align-bottom no-gap">
|
29
30
|
<!-- begin CmdFormElement for second input -->
|
30
31
|
<CmdFormElement
|
31
32
|
v-if="cmdFormElementInput2.show"
|
@@ -34,6 +35,7 @@
|
|
34
35
|
:show-label="cmdFormElementInput2.showLabel"
|
35
36
|
:labelText="cmdFormElementInput2.labelText"
|
36
37
|
:placeholder="cmdFormElementInput2.placeholder"
|
38
|
+
:required="cmdFormElementInput2.required"
|
37
39
|
v-model="searchValue2"
|
38
40
|
/>
|
39
41
|
<!-- end CmdFormElement for second input -->
|
@@ -47,6 +49,7 @@
|
|
47
49
|
:show-label="cmdFormElementRadius.showLabel"
|
48
50
|
:labelText="cmdFormElementRadius.labelText"
|
49
51
|
:select-options="cmdFormElementRadius.selectOptions"
|
52
|
+
:required="cmdFormElementRadius.required"
|
50
53
|
/>
|
51
54
|
<!-- end CmdFormElement for radius -->
|
52
55
|
</div>
|
@@ -56,6 +59,7 @@
|
|
56
59
|
element="button"
|
57
60
|
:nativeButton="cmdFormElementSearchButton"
|
58
61
|
@click="onSearchButtonClick"
|
62
|
+
:disabled="buttonSearchDisabled"
|
59
63
|
aria-live="assertive"
|
60
64
|
/>
|
61
65
|
<!-- end CmdFormElement for search-button -->
|
@@ -87,7 +91,9 @@
|
|
87
91
|
</template>
|
88
92
|
<!-- end filters -->
|
89
93
|
</fieldset>
|
94
|
+
<!-- begin CmdFormFilters -->
|
90
95
|
<CmdFormFilters v-if="cmdFakeSelect?.show" v-model="searchFilters" :selectedOptionsName="getOptionName"/>
|
96
|
+
<!-- end CmdFormFilters -->
|
91
97
|
</template>
|
92
98
|
|
93
99
|
<script>
|
@@ -197,11 +203,12 @@ export default {
|
|
197
203
|
type: Object,
|
198
204
|
default() {
|
199
205
|
return {
|
200
|
-
|
201
|
-
|
202
|
-
|
206
|
+
type: "search",
|
207
|
+
showLabel: false,
|
208
|
+
required: true,
|
203
209
|
labelText: "What do you like to search for?",
|
204
|
-
placeholder: "
|
210
|
+
placeholder: "What do you like to search for?",
|
211
|
+
showSearchButton: false
|
205
212
|
}
|
206
213
|
}
|
207
214
|
},
|
@@ -214,9 +221,10 @@ export default {
|
|
214
221
|
return {
|
215
222
|
show: true,
|
216
223
|
type: "text",
|
217
|
-
showLabel:
|
224
|
+
showLabel: false,
|
225
|
+
required: true,
|
218
226
|
labelText: "Where do you like to search?",
|
219
|
-
placeholder: "
|
227
|
+
placeholder: "Enter city, zip, country"
|
220
228
|
}
|
221
229
|
}
|
222
230
|
},
|
@@ -228,9 +236,14 @@ export default {
|
|
228
236
|
default() {
|
229
237
|
return {
|
230
238
|
show: true,
|
231
|
-
showLabel:
|
239
|
+
showLabel: false,
|
240
|
+
required: false,
|
232
241
|
labelText: "Radius",
|
233
242
|
selectOptions: [
|
243
|
+
{
|
244
|
+
text: "None",
|
245
|
+
value: 0
|
246
|
+
},
|
234
247
|
{
|
235
248
|
text: "5 Km",
|
236
249
|
value: 5
|
@@ -311,6 +324,13 @@ export default {
|
|
311
324
|
set(value) {
|
312
325
|
this.$emit("update:modelValueSearchFilters", value)
|
313
326
|
}
|
327
|
+
},
|
328
|
+
buttonSearchDisabled() {
|
329
|
+
const validInput1 = !this.cmdFormElementInput1.required || this.searchValue1.trim()
|
330
|
+
const validInput2 = !this.cmdFormElementInput2.show || !this.cmdFormElementInput2.required || this.searchValue2.trim()
|
331
|
+
const validInputRadius = !this.cmdFormElementRadius.show || !this.cmdFormElementRadius.required || this.radius
|
332
|
+
|
333
|
+
return !(validInput1 && validInput2 && validInputRadius)
|
314
334
|
}
|
315
335
|
},
|
316
336
|
methods: {
|
@@ -7,15 +7,6 @@
|
|
7
7
|
:relatedId="relatedId"
|
8
8
|
:toggle-visibility-by-click="true">
|
9
9
|
|
10
|
-
<!-- begin CmdSystemMessage -->
|
11
|
-
<CmdSystemMessage
|
12
|
-
v-if="cmdListOfRequirements?.inputAttributes?.required && validationMessage"
|
13
|
-
:systemMessage="validationMessage"
|
14
|
-
:validation-status="validationStatus"
|
15
|
-
:iconClose="{show: false}"
|
16
|
-
/>
|
17
|
-
<!-- end CmdSystemMessage -->
|
18
|
-
|
19
10
|
<!-- begin CmdListOfRequirements -->
|
20
11
|
<CmdListOfRequirements
|
21
12
|
v-if="cmdListOfRequirements.showRequirements"
|
@@ -35,14 +26,12 @@
|
|
35
26
|
<script>
|
36
27
|
// import components
|
37
28
|
import CmdListOfRequirements from "./CmdListOfRequirements"
|
38
|
-
import CmdSystemMessage from "./CmdSystemMessage"
|
39
29
|
import CmdTooltip from "./CmdTooltip"
|
40
30
|
|
41
31
|
export default {
|
42
32
|
name: "CmdTooltipForInputElements",
|
43
33
|
components: {
|
44
34
|
CmdListOfRequirements,
|
45
|
-
CmdSystemMessage,
|
46
35
|
CmdTooltip
|
47
36
|
},
|
48
37
|
props: {
|
@@ -54,19 +43,12 @@ export default {
|
|
54
43
|
default: ""
|
55
44
|
},
|
56
45
|
/**
|
57
|
-
* validation-status for
|
46
|
+
* validation-status for CmdTooltip-component
|
58
47
|
*/
|
59
48
|
validationStatus: {
|
60
49
|
type: String,
|
61
50
|
default: ""
|
62
51
|
},
|
63
|
-
/**
|
64
|
-
* validation-message for CmdSystemMessage-component
|
65
|
-
*/
|
66
|
-
validationMessage: {
|
67
|
-
type: String,
|
68
|
-
default: ""
|
69
|
-
},
|
70
52
|
/**
|
71
53
|
* properties for CmdListOfRequirements-component
|
72
54
|
*/
|
@@ -4,7 +4,7 @@
|
|
4
4
|
"value for v-model (modelValue is default name in vue 3)"
|
5
5
|
]
|
6
6
|
},
|
7
|
-
"
|
7
|
+
"textLegendLoginForm": {
|
8
8
|
"comments": [
|
9
9
|
"text used as legend for login-fieldset"
|
10
10
|
],
|
@@ -19,9 +19,9 @@
|
|
19
19
|
"toggle legend visibility"
|
20
20
|
]
|
21
21
|
},
|
22
|
-
"
|
22
|
+
"textLegendForgotLoginForm": {
|
23
23
|
"comments": [
|
24
|
-
"legend for
|
24
|
+
"legend for forgot-login-fieldset"
|
25
25
|
],
|
26
26
|
"annotations": {
|
27
27
|
"requiredForAccessibility": [
|
@@ -0,0 +1,79 @@
|
|
1
|
+
{
|
2
|
+
"modelValueInput1": {
|
3
|
+
"comments": [
|
4
|
+
"custom modelValue for first input-field"
|
5
|
+
]
|
6
|
+
},
|
7
|
+
"modelValueInput2": {
|
8
|
+
"comments": [
|
9
|
+
"custom modelValue for second input-field"
|
10
|
+
]
|
11
|
+
},
|
12
|
+
"modelValueRadius": {
|
13
|
+
"comments": [
|
14
|
+
"custom modelValue for radius"
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"modelValueSearchFilters": {
|
18
|
+
"comments": [
|
19
|
+
"custom modelValue for search-filters"
|
20
|
+
]
|
21
|
+
},
|
22
|
+
"useFilters": {
|
23
|
+
"comments": [
|
24
|
+
"toggle use of filters (must configured)"
|
25
|
+
]
|
26
|
+
},
|
27
|
+
"textLegend": {
|
28
|
+
"comments": [
|
29
|
+
"text for legend"
|
30
|
+
],
|
31
|
+
"annotations": {
|
32
|
+
"requiredForAccessibility": [
|
33
|
+
"true"
|
34
|
+
]
|
35
|
+
}
|
36
|
+
},
|
37
|
+
"showLegend": {
|
38
|
+
"comments": [
|
39
|
+
"toggle legend visibility",
|
40
|
+
"",
|
41
|
+
"textLegend must be set"
|
42
|
+
]
|
43
|
+
},
|
44
|
+
"results": {
|
45
|
+
"comments": [
|
46
|
+
"send search result from outside to display inside this component"
|
47
|
+
]
|
48
|
+
},
|
49
|
+
"cmdHeadline": {
|
50
|
+
"comments": [
|
51
|
+
"properties for CmdHeadline-component"
|
52
|
+
]
|
53
|
+
},
|
54
|
+
"cmdFormElementInput1": {
|
55
|
+
"comments": [
|
56
|
+
"properties for CmdFormElement-component first search-field"
|
57
|
+
]
|
58
|
+
},
|
59
|
+
"cmdFormElementInput2": {
|
60
|
+
"comments": [
|
61
|
+
"properties for CmdFormElement-component for second search-field"
|
62
|
+
]
|
63
|
+
},
|
64
|
+
"cmdFormElementRadius": {
|
65
|
+
"comments": [
|
66
|
+
"properties for CmdFormElement-component for radius"
|
67
|
+
]
|
68
|
+
},
|
69
|
+
"cmdFormElementSearchButton": {
|
70
|
+
"comments": [
|
71
|
+
"properties for CmdFormElement-component for search-button"
|
72
|
+
]
|
73
|
+
},
|
74
|
+
"cmdFakeSelect": {
|
75
|
+
"comments": [
|
76
|
+
"properties for CmdFakeSelect-component for filters"
|
77
|
+
]
|
78
|
+
}
|
79
|
+
}
|
@@ -6,12 +6,7 @@
|
|
6
6
|
},
|
7
7
|
"validationStatus": {
|
8
8
|
"comments": [
|
9
|
-
"validation-status for
|
10
|
-
]
|
11
|
-
},
|
12
|
-
"validationMessage": {
|
13
|
-
"comments": [
|
14
|
-
"validation-message for CmdSystemMessage-component"
|
9
|
+
"validation-status for CmdTooltip-component"
|
15
10
|
]
|
16
11
|
},
|
17
12
|
"cmdListOfRequirements": {
|
package/src/index.js
CHANGED
@@ -5,7 +5,6 @@ export { default as CmdAddressData } from '@/components/CmdAddressData'
|
|
5
5
|
export { default as CmdBackToTopButton } from '@/components/CmdBackToTopButton'
|
6
6
|
export { default as CmdBankAccountData } from '@/components/CmdBankAccountData'
|
7
7
|
export { default as CmdBox } from '@/components/CmdBox'
|
8
|
-
export { default as CmdBoxSiteSearch } from '@/components/CmdBoxSiteSearch'
|
9
8
|
export { default as CmdBoxWrapper } from '@/components/CmdBoxWrapper'
|
10
9
|
export { default as CmdBreadcrumbs } from '@/components/CmdBreadcrumbs'
|
11
10
|
export { default as CmdCompanyLogo } from '@/components/CmdCompanyLogo'
|
@@ -31,6 +30,7 @@ export { default as CmdProgressBar } from '@/components/CmdProgressBar'
|
|
31
30
|
export { default as CmdShareButtons } from '@/components/CmdShareButtons'
|
32
31
|
export { default as CmdSiteFooter } from '@/components/CmdSiteFooter'
|
33
32
|
export { default as CmdSiteHeader } from '@/components/CmdSiteHeader'
|
33
|
+
export { default as CmdSiteSearch } from '@/components/CmdSiteSearch'
|
34
34
|
export { default as CmdSlideButton } from '@/components/CmdSlideButton'
|
35
35
|
export { default as CmdSlideshow } from '@/components/CmdSlideshow'
|
36
36
|
export { default as CmdSwitchLanguage } from '@/components/CmdSwitchLanguage'
|
@@ -6,7 +6,8 @@ export default {
|
|
6
6
|
"cmdformelement.validationTooltip.an_error_occurred": "An error occurred!",
|
7
7
|
"cmdformelement.validationTooltip.information_is_filled_correctly": "This information is filled correctly!",
|
8
8
|
"cmdformelement.validationTooltip.caps_lock_is_activated": "Attention: Caps lock is activated!",
|
9
|
-
"cmdformelement.validationTooltip.open_field_requirements": "Open field requirements!"
|
9
|
+
"cmdformelement.validationTooltip.open_field_requirements": "Open field requirements!",
|
10
|
+
"cmdformelement.validationTooltip.is_valid_email": "Is valid e-mail-address"
|
10
11
|
}
|
11
12
|
}
|
12
13
|
}
|
@@ -219,21 +219,23 @@ export default {
|
|
219
219
|
}
|
220
220
|
})
|
221
221
|
}
|
222
|
+
|
222
223
|
// check if field has a minimum length
|
223
224
|
if(this.$attrs.minlength) {
|
224
225
|
standardRequirements.push({
|
225
|
-
message: this.getMessage("cmdfieldvalidation.input_has_minimum_length") + "(" + this.modelValue.length + "/" + this.$attrs.minlength + ")",
|
226
|
+
message: this.getMessage("cmdfieldvalidation.input_has_minimum_length") + " (" + this.modelValue.length + "/" + this.$attrs.minlength + ")",
|
226
227
|
valid(value, attributes) {
|
227
228
|
return value.length >= attributes.minlength
|
228
229
|
}
|
229
230
|
})
|
230
231
|
}
|
231
|
-
|
232
|
-
if(!this.customRequirements || !this.customRequirements.length) {
|
233
|
-
return standardRequirements
|
234
|
-
}
|
232
|
+
|
235
233
|
// duplicate existing requirements into new (combined) array
|
236
|
-
return [
|
234
|
+
return [
|
235
|
+
...standardRequirements,
|
236
|
+
...(this.additionalStandardRequirements() || []),
|
237
|
+
...(this.customRequirements || [])
|
238
|
+
]
|
237
239
|
}
|
238
240
|
},
|
239
241
|
methods: {
|
@@ -246,6 +248,9 @@ export default {
|
|
246
248
|
this.validationStatus = ""
|
247
249
|
}
|
248
250
|
},
|
251
|
+
additionalStandardRequirements() {
|
252
|
+
return []
|
253
|
+
},
|
249
254
|
getRequirementMessage() {
|
250
255
|
return this.getMessage("cmdfieldvalidation.required_field_is_filled")
|
251
256
|
}
|