comand-component-library 4.2.94 → 4.2.96
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.js +951 -905
- package/package.json +1 -1
- package/src/ComponentLibrary.vue +12 -2
- package/src/assets/data/multistep-form-wrapper-page-1.json +1 -2
- package/src/components/CmdForm.vue +6 -0
- package/src/components/CmdMultistepFormWrapper.vue +31 -3
- package/src/mixins/CmdMultistepFormWrapper/DefaultMessageProperties.js +9 -0
package/package.json
CHANGED
package/src/ComponentLibrary.vue
CHANGED
|
@@ -1318,8 +1318,10 @@
|
|
|
1318
1318
|
</a>
|
|
1319
1319
|
</h2>
|
|
1320
1320
|
<h3>Data provided by property</h3>
|
|
1321
|
-
<CmdMultistepFormWrapper :requiredPages="[1, 2]">
|
|
1321
|
+
<CmdMultistepFormWrapper :requiredPages="[1, 2]" :defaultInputValues="multistepFormDefaultInputValues">
|
|
1322
|
+
|
|
1322
1323
|
<template v-slot:page-1="props">
|
|
1324
|
+
multistepFormDefaultInputValues: {{ multistepFormDefaultInputValues }}
|
|
1323
1325
|
<h3>Page 1 - all fields required</h3>
|
|
1324
1326
|
<CmdForm
|
|
1325
1327
|
:formElements="multistepFormWrapperPage1Data"
|
|
@@ -1340,7 +1342,7 @@
|
|
|
1340
1342
|
>
|
|
1341
1343
|
<CmdFormElement
|
|
1342
1344
|
element="input"
|
|
1343
|
-
type="
|
|
1345
|
+
type="tel"
|
|
1344
1346
|
labelText="Telephone:"
|
|
1345
1347
|
name="page-2-telephone"
|
|
1346
1348
|
id="page-2-telephone"
|
|
@@ -2160,6 +2162,14 @@ export default {
|
|
|
2160
2162
|
linkType: ""
|
|
2161
2163
|
}
|
|
2162
2164
|
},
|
|
2165
|
+
multistepFormDefaultInputValues: {
|
|
2166
|
+
1: {
|
|
2167
|
+
"form-element-text-surname": "Biock"
|
|
2168
|
+
},
|
|
2169
|
+
2: {
|
|
2170
|
+
"page-2-telephone": "12345/67890"
|
|
2171
|
+
}
|
|
2172
|
+
},
|
|
2163
2173
|
|
|
2164
2174
|
// assign data from json files to data-properties
|
|
2165
2175
|
addressData,
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
"type": "text",
|
|
5
5
|
"name": "form-element-text-surname",
|
|
6
6
|
"htmlClass": "form-element-text-class",
|
|
7
|
-
"value": "",
|
|
8
7
|
"labelText": "Surname",
|
|
9
8
|
"placeholder": "Surname",
|
|
10
9
|
"required": true,
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
"type": "text",
|
|
16
15
|
"name": "form-element-text-first-name",
|
|
17
16
|
"htmlClass": "form-element-text-class",
|
|
18
|
-
"value": "",
|
|
17
|
+
"value": "Raphael",
|
|
19
18
|
"labelText": "First Name",
|
|
20
19
|
"placeholder": "First Name",
|
|
21
20
|
"required": true,
|
|
@@ -68,6 +68,12 @@
|
|
|
68
68
|
v-model="formValues[item.name]"
|
|
69
69
|
@validation-status-change="formElementHasError($event, item.name)"
|
|
70
70
|
/>
|
|
71
|
+
<CmdFakeSelect
|
|
72
|
+
v-else-if="item.component === 'CmdFakeSelect'"
|
|
73
|
+
:class="item.htmlClass"
|
|
74
|
+
v-bind="item"
|
|
75
|
+
v-model="formValues[item.name]"
|
|
76
|
+
/>
|
|
71
77
|
<CmdInputGroup
|
|
72
78
|
v-else-if="item.component === 'CmdInputGroup'"
|
|
73
79
|
v-model="formValues[item.name]"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
<div v-show="currentPage === numberOfPages" class="multistep-page-last">
|
|
39
39
|
<CmdSystemMessage v-if="pagesWithError.length" validationStatus="error">
|
|
40
|
-
<p>
|
|
40
|
+
<p>{{ getMessage("multistep_form_wrapper.system_message.please_enter_all_required_data_on_the_pages") }} {{ pagesWithError.join(", ") }}</p>
|
|
41
41
|
</CmdSystemMessage>
|
|
42
42
|
|
|
43
43
|
<!-- begin slot for last step -->
|
|
@@ -73,8 +73,16 @@
|
|
|
73
73
|
</template>
|
|
74
74
|
|
|
75
75
|
<script>
|
|
76
|
+
// import mixins
|
|
77
|
+
import I18n from "../mixins/I18n.js"
|
|
78
|
+
import DefaultMessageProperties from "../mixins/CmdMultistepFormWrapper/DefaultMessageProperties.js"
|
|
79
|
+
|
|
76
80
|
export default {
|
|
77
81
|
name: "CmdMultistepFormWrapper",
|
|
82
|
+
mixins: [
|
|
83
|
+
I18n,
|
|
84
|
+
DefaultMessageProperties
|
|
85
|
+
],
|
|
78
86
|
data () {
|
|
79
87
|
return {
|
|
80
88
|
currentPage: 1,
|
|
@@ -84,6 +92,10 @@ export default {
|
|
|
84
92
|
}
|
|
85
93
|
},
|
|
86
94
|
props: {
|
|
95
|
+
defaultInputValues: {
|
|
96
|
+
type: Object,
|
|
97
|
+
required: false
|
|
98
|
+
},
|
|
87
99
|
requiredPages: {
|
|
88
100
|
type: Array,
|
|
89
101
|
default: []
|
|
@@ -193,10 +205,10 @@ export default {
|
|
|
193
205
|
if(this.validationStatusForSteps.length > 0 || this.inputMade.length === 0) {
|
|
194
206
|
return true
|
|
195
207
|
}
|
|
208
|
+
|
|
196
209
|
const requiredPagesSet = new Set(this.requiredPages)
|
|
197
210
|
const inputMadeSet = new Set(this.inputMade)
|
|
198
|
-
|
|
199
|
-
console.log("inputMadeSet", inputMadeSet)
|
|
211
|
+
|
|
200
212
|
return !requiredPagesSet.isSubsetOf(inputMadeSet) // check if all requiredPages are included in inputMade
|
|
201
213
|
|
|
202
214
|
},
|
|
@@ -274,6 +286,22 @@ export default {
|
|
|
274
286
|
}
|
|
275
287
|
}
|
|
276
288
|
}
|
|
289
|
+
},
|
|
290
|
+
watch: {
|
|
291
|
+
defaultInputValues: {
|
|
292
|
+
handler() {
|
|
293
|
+
this.formData = {}
|
|
294
|
+
if(this.defaultInputValues) {
|
|
295
|
+
for (const page in this.defaultInputValues) {
|
|
296
|
+
this.formData[page] = {
|
|
297
|
+
...this.defaultInputValues[page]
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
immediate: true,
|
|
303
|
+
deep: true
|
|
304
|
+
}
|
|
277
305
|
}
|
|
278
306
|
}
|
|
279
307
|
</script>
|