project-booster-vue 8.115.3 → 8.115.7
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/package.json +1 -1
- package/src/components/question/dimensions-input/PbDimensionsInput.vue +26 -2
- package/src/components/question/list-select/PbListSelect.vue +20 -4
- package/src/components/question/space-input/PbSpaceInput.vue +26 -1
- package/src/components/restitution/PbRestitutionExit.vue +6 -3
package/package.json
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
</div>
|
|
63
63
|
</m-flex>
|
|
64
64
|
</m-flex>
|
|
65
|
-
<m-flex class="pb-dimensions-input__buttons-container" direction="column">
|
|
65
|
+
<m-flex class="pb-dimensions-input__buttons-container" direction="column" align-items="center">
|
|
66
66
|
<m-button
|
|
67
67
|
class="pb-dimensions-input__button"
|
|
68
68
|
:label="computedPayload.viewModel.actionLabel"
|
|
@@ -70,6 +70,15 @@
|
|
|
70
70
|
size="l"
|
|
71
71
|
@click="handleFormSubmit"
|
|
72
72
|
/>
|
|
73
|
+
<m-link
|
|
74
|
+
v-if="payload.skippable"
|
|
75
|
+
class="pb-dimensions-input__link"
|
|
76
|
+
:label="payload.skippable.label"
|
|
77
|
+
width="full"
|
|
78
|
+
size="l"
|
|
79
|
+
@click="skipQuestion"
|
|
80
|
+
:theme="payload.skippable.theme"
|
|
81
|
+
/>
|
|
73
82
|
</m-flex>
|
|
74
83
|
</m-flex>
|
|
75
84
|
</form>
|
|
@@ -266,7 +275,17 @@ export default {
|
|
|
266
275
|
],
|
|
267
276
|
});
|
|
268
277
|
});
|
|
269
|
-
|
|
278
|
+
const skipQuestion = () => {
|
|
279
|
+
/**
|
|
280
|
+
* Emitted when step is completed
|
|
281
|
+
* @event dynamic event name according to completedEventName prop
|
|
282
|
+
* @type {Event}
|
|
283
|
+
*/
|
|
284
|
+
emit(props.completedEventName, {
|
|
285
|
+
answers: props.payload?.skippable?.defaultAnswer ? [props.payload?.skippable?.defaultAnswer] : [],
|
|
286
|
+
nextStep: props.payload?.skippable?.nextStep,
|
|
287
|
+
});
|
|
288
|
+
};
|
|
270
289
|
onMounted(() => {
|
|
271
290
|
setTimeout(() => {
|
|
272
291
|
pbDimensionsInputLengthInput.value.focus();
|
|
@@ -282,6 +301,7 @@ export default {
|
|
|
282
301
|
computedPayload,
|
|
283
302
|
pbDimensionsInputLengthInput,
|
|
284
303
|
handleFormSubmit,
|
|
304
|
+
skipQuestion,
|
|
285
305
|
};
|
|
286
306
|
},
|
|
287
307
|
};
|
|
@@ -415,5 +435,9 @@ $responsive-breakpoint: 'm';
|
|
|
415
435
|
position: sticky;
|
|
416
436
|
z-index: 1;
|
|
417
437
|
}
|
|
438
|
+
|
|
439
|
+
&__link {
|
|
440
|
+
margin-top: $mu250;
|
|
441
|
+
}
|
|
418
442
|
}
|
|
419
443
|
</style>
|
|
@@ -54,10 +54,11 @@
|
|
|
54
54
|
@click="skipQuestion"
|
|
55
55
|
/>
|
|
56
56
|
<m-button
|
|
57
|
-
v-if="hasSelectedAnswers"
|
|
57
|
+
v-if="hasSelectedAnswers || payload.multiSelect.alwaysDisplayMultiSelectButton"
|
|
58
58
|
class="pb-list-select__validate-button"
|
|
59
59
|
size="m"
|
|
60
60
|
size-from-l="l"
|
|
61
|
+
:disabled="!hasSelectedAnswers"
|
|
61
62
|
:label="validateButtonProps.label"
|
|
62
63
|
:left-icon="validateButtonProps.leftIcon"
|
|
63
64
|
:right-icon="validateButtonProps.rightIcon"
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
</template>
|
|
72
73
|
|
|
73
74
|
<script>
|
|
74
|
-
import { ref, computed } from 'vue';
|
|
75
|
+
import { ref, computed, onMounted } from 'vue';
|
|
75
76
|
import objectPath from 'object-path';
|
|
76
77
|
import MFlex from '../../mozaic/flex/MFlex';
|
|
77
78
|
import MButton from '../../mozaic/buttons/MButton';
|
|
@@ -166,10 +167,22 @@ export default {
|
|
|
166
167
|
return displayedAnswers;
|
|
167
168
|
});
|
|
168
169
|
|
|
170
|
+
const updateSelectedAnswers = () => {
|
|
171
|
+
selectedAnswers.value = displayedAnswers.value
|
|
172
|
+
.filter((answer) => !!answer.selected)
|
|
173
|
+
.map((answer) => ({ key: answer.code, value: true }));
|
|
174
|
+
};
|
|
169
175
|
const handleSelectionChange = (items) => {
|
|
170
176
|
selectedAnswers.value = Object.entries(items)
|
|
171
177
|
.filter(([key, value]) => !!value)
|
|
172
178
|
.map(([key, value]) => ({ key, value }));
|
|
179
|
+
Object.entries(items).map(([key, value]) => {
|
|
180
|
+
displayedAnswers.value.map((answer) => {
|
|
181
|
+
if (answer.code === key) {
|
|
182
|
+
answer.selected = value;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
173
186
|
};
|
|
174
187
|
|
|
175
188
|
const hasSelectedAnswers = computed(() => {
|
|
@@ -225,7 +238,7 @@ export default {
|
|
|
225
238
|
}
|
|
226
239
|
|
|
227
240
|
let nextStep;
|
|
228
|
-
if (props.payload?.
|
|
241
|
+
if (props.payload?.multiSelect) {
|
|
229
242
|
nextStep = props.payload.multiSelect.actions.VALIDATE.nextStep;
|
|
230
243
|
} else if (props.payload?.answers[answersToSubmit[0].value]?.nextStep) {
|
|
231
244
|
nextStep = props.payload.answers[answersToSubmit[0].value].nextStep;
|
|
@@ -335,7 +348,9 @@ export default {
|
|
|
335
348
|
}
|
|
336
349
|
return valueToDecorate;
|
|
337
350
|
};
|
|
338
|
-
|
|
351
|
+
onMounted(() => {
|
|
352
|
+
updateSelectedAnswers();
|
|
353
|
+
});
|
|
339
354
|
return {
|
|
340
355
|
BACK_ICON,
|
|
341
356
|
INFO_ICON,
|
|
@@ -352,6 +367,7 @@ export default {
|
|
|
352
367
|
skipQuestion,
|
|
353
368
|
submitAnswers,
|
|
354
369
|
decorateBoolean,
|
|
370
|
+
updateSelectedAnswers,
|
|
355
371
|
};
|
|
356
372
|
},
|
|
357
373
|
};
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
</m-flexy-col>
|
|
57
57
|
</m-flex>
|
|
58
58
|
|
|
59
|
-
<m-flex class="pb-space-input__buttons-container" direction="column">
|
|
59
|
+
<m-flex class="pb-space-input__buttons-container" direction="column" align-items="center">
|
|
60
60
|
<m-button
|
|
61
61
|
class="pb-space-input__button"
|
|
62
62
|
:label="computedPayload.viewModel.actionLabel"
|
|
@@ -64,6 +64,15 @@
|
|
|
64
64
|
size="l"
|
|
65
65
|
@click="handleFormSubmit"
|
|
66
66
|
/>
|
|
67
|
+
<m-link
|
|
68
|
+
v-if="payload.skippable"
|
|
69
|
+
class="pb-space-input__link"
|
|
70
|
+
:label="payload.skippable.label"
|
|
71
|
+
:theme="payload.skippable.theme"
|
|
72
|
+
width="full"
|
|
73
|
+
size="l"
|
|
74
|
+
@click="skipQuestion"
|
|
75
|
+
/>
|
|
67
76
|
</m-flex>
|
|
68
77
|
</m-flex>
|
|
69
78
|
</form>
|
|
@@ -233,6 +242,17 @@ export default {
|
|
|
233
242
|
],
|
|
234
243
|
});
|
|
235
244
|
});
|
|
245
|
+
const skipQuestion = () => {
|
|
246
|
+
/**
|
|
247
|
+
* Emitted when step is completed
|
|
248
|
+
* @event dynamic event name according to completedEventName prop
|
|
249
|
+
* @type {Event}
|
|
250
|
+
*/
|
|
251
|
+
emit(props.completedEventName, {
|
|
252
|
+
answers: props.payload?.skippable?.defaultAnswer ? [props.payload?.skippable?.defaultAnswer] : [],
|
|
253
|
+
nextStep: props.payload?.skippable?.nextStep,
|
|
254
|
+
});
|
|
255
|
+
};
|
|
236
256
|
|
|
237
257
|
const isShowingFooter = computed(() => {
|
|
238
258
|
return computedPayload.value.viewModel.footer;
|
|
@@ -254,6 +274,7 @@ export default {
|
|
|
254
274
|
handleFormSubmit,
|
|
255
275
|
isShowingFooter,
|
|
256
276
|
decorateBoolean,
|
|
277
|
+
skipQuestion,
|
|
257
278
|
};
|
|
258
279
|
},
|
|
259
280
|
};
|
|
@@ -382,5 +403,9 @@ $responsive-breakpoint: 'm';
|
|
|
382
403
|
position: sticky;
|
|
383
404
|
z-index: 1;
|
|
384
405
|
}
|
|
406
|
+
|
|
407
|
+
&__link {
|
|
408
|
+
margin-top: $mu250;
|
|
409
|
+
}
|
|
385
410
|
}
|
|
386
411
|
</style>
|
|
@@ -73,10 +73,13 @@ export default {
|
|
|
73
73
|
$responsive-breakpoint: 'l';
|
|
74
74
|
|
|
75
75
|
.pb-restitution-exit {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
margin: $mu350 0;
|
|
77
|
+
|
|
78
|
+
@include set-from-screen('m') {
|
|
79
|
+
margin: $mu300 0;
|
|
80
|
+
}
|
|
79
81
|
|
|
82
|
+
&__section {
|
|
80
83
|
&-title {
|
|
81
84
|
@include set-font-face('semi-bold');
|
|
82
85
|
@include set-font-scale('07', 'm');
|