comand-component-library 4.2.70 → 4.2.71
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 +599 -553
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/ComponentLibrary.vue +18 -3
- package/src/assets/data/multistep-form-wrapper-page-1.json +25 -0
- package/src/components/CmdBackToTopButton.vue +6 -0
- package/src/components/CmdForm.vue +7 -0
- package/src/components/CmdMultistepFormWrapper.vue +24 -14
|
@@ -15,10 +15,14 @@
|
|
|
15
15
|
<!-- begin slot for progress-bar -->
|
|
16
16
|
|
|
17
17
|
<div v-show="page === currentPage" :class="'multistep-page-' + page" v-for="(page, index) in numberOfPages" :key="index">
|
|
18
|
-
<CmdSystemMessage v-if="
|
|
18
|
+
<CmdSystemMessage v-if="statusForPages.some(item => item.page === page)" :systemMessage="getSystemMessage(page)" validationStatus="error" />
|
|
19
19
|
<!-- begin slot for page content -->
|
|
20
|
-
<slot
|
|
21
|
-
|
|
20
|
+
<slot
|
|
21
|
+
:name="'page-' + page"
|
|
22
|
+
:setErrorOnPage="(message) => setErrorOnPage(page, message)"
|
|
23
|
+
:removeErrorOnPage="() => removeErrorOnPage(page)"
|
|
24
|
+
:atleastOnePageWithError="atleastOnePageWithError"
|
|
25
|
+
/>
|
|
22
26
|
<!-- end slot for page content -->
|
|
23
27
|
</div>
|
|
24
28
|
|
|
@@ -49,7 +53,8 @@ export default {
|
|
|
49
53
|
data () {
|
|
50
54
|
return {
|
|
51
55
|
currentPage: 1,
|
|
52
|
-
|
|
56
|
+
statusForPages: [],
|
|
57
|
+
inputMade: false
|
|
53
58
|
}
|
|
54
59
|
},
|
|
55
60
|
props: {
|
|
@@ -97,25 +102,27 @@ export default {
|
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
104
|
},
|
|
100
|
-
mounted() {
|
|
101
|
-
console.log("slots:", this.$slots)
|
|
102
|
-
},
|
|
103
105
|
methods: {
|
|
104
106
|
getSystemMessage(page) {
|
|
105
|
-
const pageEntry = this.
|
|
107
|
+
const pageEntry = this.statusForPages.find(item => item.page === page);
|
|
106
108
|
return pageEntry.message
|
|
107
109
|
},
|
|
108
110
|
setErrorOnPage(page, message) {
|
|
109
|
-
const exists = this.
|
|
111
|
+
const exists = this.statusForPages.some(item => item.page === page);
|
|
110
112
|
|
|
113
|
+
this.inputMade = true
|
|
114
|
+
|
|
111
115
|
if (!exists) {
|
|
112
|
-
this.
|
|
116
|
+
this.statusForPages.push({ page: page, message: message });
|
|
113
117
|
}
|
|
114
118
|
},
|
|
115
119
|
removeErrorOnPage(page) {
|
|
116
|
-
const index = this.
|
|
120
|
+
const index = this.statusForPages.findIndex(item => item.page === page);
|
|
121
|
+
|
|
122
|
+
this.inputMade = true
|
|
123
|
+
|
|
117
124
|
if (index !== -1) {
|
|
118
|
-
this.
|
|
125
|
+
this.statusForPages.splice(index, 1);
|
|
119
126
|
}
|
|
120
127
|
},
|
|
121
128
|
setCurrentPage(page) {
|
|
@@ -133,14 +140,17 @@ export default {
|
|
|
133
140
|
}
|
|
134
141
|
},
|
|
135
142
|
computed: {
|
|
143
|
+
atleastOnePageWithError() {
|
|
144
|
+
return this.statusForPages.length > 0 || !this.inputMade
|
|
145
|
+
},
|
|
136
146
|
pageHasError() {
|
|
137
|
-
return this.
|
|
147
|
+
return this.statusForPages.some((item) => {
|
|
138
148
|
return item.page === this.currentPage
|
|
139
149
|
})
|
|
140
150
|
},
|
|
141
151
|
errorSteps() {
|
|
142
152
|
const steps = []
|
|
143
|
-
this.
|
|
153
|
+
this.statusForPages.find((item) => {
|
|
144
154
|
steps.push(item.page)
|
|
145
155
|
})
|
|
146
156
|
console.log("steps", steps)
|