project-booster-vue 8.115.4 → 8.115.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "8.115.4",
3
+ "version": "8.115.8",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "test:unit": "vue-cli-service test:unit --forceExit --detectOpenHandles",
@@ -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>
@@ -72,7 +72,7 @@
72
72
  </template>
73
73
 
74
74
  <script>
75
- import { ref, computed } from 'vue';
75
+ import { ref, computed, onMounted } from 'vue';
76
76
  import objectPath from 'object-path';
77
77
  import MFlex from '../../mozaic/flex/MFlex';
78
78
  import MButton from '../../mozaic/buttons/MButton';
@@ -167,10 +167,22 @@ export default {
167
167
  return displayedAnswers;
168
168
  });
169
169
 
170
+ const updateSelectedAnswers = () => {
171
+ selectedAnswers.value = displayedAnswers.value
172
+ .filter((answer) => !!answer.selected)
173
+ .map((answer) => ({ key: answer.code, value: true }));
174
+ };
170
175
  const handleSelectionChange = (items) => {
171
176
  selectedAnswers.value = Object.entries(items)
172
177
  .filter(([key, value]) => !!value)
173
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
+ });
174
186
  };
175
187
 
176
188
  const hasSelectedAnswers = computed(() => {
@@ -226,7 +238,7 @@ export default {
226
238
  }
227
239
 
228
240
  let nextStep;
229
- if (props.payload?.multilselect) {
241
+ if (props.payload?.multiSelect) {
230
242
  nextStep = props.payload.multiSelect.actions.VALIDATE.nextStep;
231
243
  } else if (props.payload?.answers[answersToSubmit[0].value]?.nextStep) {
232
244
  nextStep = props.payload.answers[answersToSubmit[0].value].nextStep;
@@ -336,7 +348,9 @@ export default {
336
348
  }
337
349
  return valueToDecorate;
338
350
  };
339
-
351
+ onMounted(() => {
352
+ updateSelectedAnswers();
353
+ });
340
354
  return {
341
355
  BACK_ICON,
342
356
  INFO_ICON,
@@ -353,6 +367,7 @@ export default {
353
367
  skipQuestion,
354
368
  submitAnswers,
355
369
  decorateBoolean,
370
+ updateSelectedAnswers,
356
371
  };
357
372
  },
358
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>
@@ -4,7 +4,7 @@
4
4
  :class="`pb-restitution pb-restitution--${componentTheme}`"
5
5
  align-items="center"
6
6
  direction="column"
7
- :style="`min-height: ${displayRestitutionExit ? 'auto' : minHeight};`"
7
+ :style="`min-height: ${restitutionMinHeight};`"
8
8
  ref="pbRestitution"
9
9
  >
10
10
  <m-link
@@ -165,6 +165,7 @@ export default {
165
165
  notifications: [],
166
166
  displayDialog: false,
167
167
  dialogViewModel: null,
168
+ restitutionMinHeight: '100vh',
168
169
  }),
169
170
 
170
171
  computed: {
@@ -208,6 +209,9 @@ export default {
208
209
  this.projectSaveItemPayload = saveAction ? saveAction.payload : {};
209
210
  this.showSaveProjectItem = this.showSaveEstimate;
210
211
  }
212
+ setTimeout(() => {
213
+ this.restitutionMinHeight = this.payload?.exitOptions ? 'auto' : this.minHeight;
214
+ }, 300);
211
215
  },
212
216
 
213
217
  mounted() {
@@ -73,10 +73,13 @@ export default {
73
73
  $responsive-breakpoint: 'l';
74
74
 
75
75
  .pb-restitution-exit {
76
- &__section {
77
- margin-bottom: $mu400;
78
- margin-top: $mu400;
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');