project-booster-vue 10.20.0 → 10.20.2

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": "10.20.0",
3
+ "version": "10.20.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -92,7 +92,7 @@ $responsive-breakpoint: 'm';
92
92
 
93
93
  @include set-from-screen($responsive-breakpoint) {
94
94
  padding: $mu250;
95
- width: 630px;
95
+ width: 720px;
96
96
  }
97
97
 
98
98
  &__title {
@@ -181,7 +181,7 @@ $responsive-breakpoint: 'm';
181
181
  width: 80%;
182
182
 
183
183
  @include set-from-screen($responsive-breakpoint) {
184
- width: 630px;
184
+ width: 720px;
185
185
  }
186
186
 
187
187
  @include set-font-face('regular');
@@ -367,7 +367,7 @@ $responsive-breakpoint: 's';
367
367
 
368
368
  .pb-card__items-container {
369
369
  align-items: center !important;
370
- justify-content: center !important;
370
+ justify-content: center;
371
371
  }
372
372
  }
373
373
 
@@ -135,24 +135,25 @@ const props = defineProps({
135
135
  });
136
136
 
137
137
  const emitClickEvent = (nextStep: any) => {
138
- if (nextStep.code) {
139
- $emit('next-step', {
140
- answsers: props.answers,
141
- nextStep: nextStep,
142
- });
143
- } else if (nextStep.conditionals) {
144
- let toNextStep = null;
145
- nextStep.conditionals.every((condition: any) => {
146
- const valid = areConditionsValid(condition!, props.answers, props.runtimeOptions);
147
- if (valid) {
148
- toNextStep = condition.nextStep;
149
- $emit('next-step', {
150
- answsers: props.answers,
151
- nextStep: toNextStep,
152
- });
153
- return;
154
- }
155
- });
138
+ if (nextStep) {
139
+ if (nextStep.code) {
140
+ $emit('next-step', {
141
+ answsers: props.answers,
142
+ nextStep: nextStep,
143
+ });
144
+ } else if (nextStep.conditionals) {
145
+ let toNextStep = null;
146
+ nextStep.conditionals.forEach((condition: any) => {
147
+ const valid = areConditionsValid(condition, props.answers, props.runtimeOptions);
148
+ if (valid) {
149
+ toNextStep = condition.nextStep;
150
+ $emit('next-step', {
151
+ answsers: props.answers,
152
+ nextStep: toNextStep,
153
+ });
154
+ }
155
+ });
156
+ }
156
157
  }
157
158
  };
158
159
  </script>
@@ -45,7 +45,6 @@ import { ref, computed, onMounted, Ref } from 'vue';
45
45
  import PbItemsList from '../../../items/PbItemsList.vue';
46
46
  import { sortAnswers } from '../sortAnswers';
47
47
  import { ScenarioStepAnswer } from '@/types/pb/Scenario';
48
- import { decorate } from '@/services/decorate';
49
48
  import MPbNavigation from '../../navigation/MPbNavigation.vue';
50
49
 
51
50
  const emit: any = defineEmits();
@@ -144,29 +143,7 @@ const showMorePosition = computed(() => {
144
143
  return props.payload?.viewModel?.showMore?.position ?? 'center';
145
144
  });
146
145
 
147
- // Submit
148
- const validateButtonProps = computed(() => {
149
- let label, leftIcon, rightIcon;
150
-
151
- if (props.payload?.multiSelect) {
152
- if (props.payload.multiSelect?.actions?.VALIDATE?.dynamicLabel) {
153
- const dynamicLabel = props.payload.multiSelect.actions.VALIDATE.dynamicLabel;
154
- label = selectedAnswers.value.length > 1 ? dynamicLabel.plural : dynamicLabel.single;
155
- label = label.replace('[$items]', `${selectedAnswers.value.length}`);
156
- } else {
157
- label = props.payload.multiSelect.actions?.VALIDATE.label;
158
- }
159
- leftIcon = props.payload.multiSelect.actions?.VALIDATE.leftIcon;
160
- rightIcon = props.payload.multiSelect.actions?.VALIDATE.rightIcon;
161
- } else {
162
- label = props.payload?.viewModel?.actionLabel;
163
- leftIcon = props.payload?.viewModel?.actionLeftIcon;
164
- rightIcon = props.payload?.viewModel?.actionRightIcon;
165
- }
166
-
167
- return { label, leftIcon, rightIcon };
168
- });
169
- const submitAnswers = () => {
146
+ const submitAnswers = ({ nextStep }: { nextStep: any }) => {
170
147
  const answersToSubmit = [];
171
148
  for (const answer of selectedAnswers.value) {
172
149
  answersToSubmit.push({
@@ -176,15 +153,6 @@ const submitAnswers = () => {
176
153
  });
177
154
  }
178
155
 
179
- let nextStep;
180
- if (props.payload?.multiSelect) {
181
- nextStep = props.payload.multiSelect.actions.VALIDATE.nextStep;
182
- } else if (props.payload?.answers[answersToSubmit[0].value]?.nextStep) {
183
- nextStep = props.payload.answers[answersToSubmit[0].value].nextStep;
184
- } else {
185
- nextStep = null;
186
- }
187
-
188
156
  /**
189
157
  * Emitted when step is completed
190
158
  * @event dynamic event name according to completedEventName prop
@@ -195,21 +163,6 @@ const submitAnswers = () => {
195
163
  nextStep: nextStep,
196
164
  });
197
165
  };
198
- const skipQuestion = () => {
199
- /**
200
- * Emitted when step is completed
201
- * @event dynamic event name according to completedEventName prop
202
- * @type {Event}
203
- */
204
- emit(props.completedEventName, {
205
- answers: props.payload?.skippable?.isAnswer
206
- ? props.payload?.skippable?.defaultAnswer
207
- ? [props.payload?.skippable?.defaultAnswer]
208
- : []
209
- : null,
210
- nextStep: props.payload?.skippable?.nextStep,
211
- });
212
- };
213
166
 
214
167
  onMounted(() => {
215
168
  updateSelectedAnswers();
@@ -36,11 +36,15 @@
36
36
  <m-notification
37
37
  :title="notification.title"
38
38
  :type="notification.type"
39
- :text="notification.text"
40
- :link-label="notification.linkLabel"
41
- @link-click="handleLinkClicked(notification.linkHref)"
42
39
  class="pb-restitution-list__notifications__container__block"
43
- />
40
+ >
41
+ <default>{{ notification.text }}</default>
42
+ <footer>
43
+ <MLink size="m" :href="notification.linkHref" target="_blank">
44
+ {{ notification.linkLabel }}
45
+ </MLink>
46
+ </footer>
47
+ </m-notification>
44
48
  </m-flex>
45
49
  </m-flex>
46
50
  </m-flex>
@@ -242,9 +246,6 @@ export default defineComponent({
242
246
  this.dialogContent = content;
243
247
  this.showDialog = !this.showDialog;
244
248
  },
245
- handleLinkClicked(href: string) {
246
- window.open(href, '_blank');
247
- },
248
249
  handleItemCreated({
249
250
  projectId,
250
251
  estimateName,
@@ -358,7 +359,7 @@ $responsive-breakpoint: 'm';
358
359
  width: calc(100% - 3.2rem);
359
360
 
360
361
  @include set-from-screen($responsive-breakpoint) {
361
- width: 630px;
362
+ width: 720px;
362
363
  margin-top: 0;
363
364
  }
364
365
 
@@ -379,7 +380,7 @@ $responsive-breakpoint: 'm';
379
380
  padding: $mu050;
380
381
 
381
382
  @include set-from-screen($responsive-breakpoint) {
382
- width: 630px;
383
+ width: 720px;
383
384
  flex-direction: row;
384
385
  margin: 0 auto;
385
386
  }
@@ -67,7 +67,7 @@ $responsive-breakpoint: 'm';
67
67
 
68
68
  @include set-from-screen($responsive-breakpoint) {
69
69
  padding: $mu250 0 0 0;
70
- width: 630px;
70
+ width: 720px;
71
71
  }
72
72
 
73
73
  &__title {
@@ -156,7 +156,7 @@ $responsive-breakpoint: 'm';
156
156
  width: 80%;
157
157
 
158
158
  @include set-from-screen($responsive-breakpoint) {
159
- width: 630px;
159
+ width: 720px;
160
160
  }
161
161
 
162
162
  @include set-font-face('regular');
@@ -27,12 +27,15 @@
27
27
  <div>
28
28
  <li>
29
29
  <div v-html="detail.text"></div>
30
+
30
31
  <m-flex v-if="detail.cost.min != detail.cost.max" align-items="center" justify-content="flex-end">
31
32
  <span v-html="formattedPriceRange(detail.cost.min)"></span>
32
33
  <span>&nbsp;et&nbsp;</span>
33
34
  <span v-html="formattedPriceRange(detail.cost.max)"></span>
34
35
  </m-flex>
35
- <div v-else v-html="formattedPriceRange(detail.cost.min)"></div>
36
+ <m-flex v-else align-items="center" justify-content="flex-end">
37
+ <span v-html="formattedPriceRange(detail.cost.min)"></span>
38
+ </m-flex>
36
39
  </li>
37
40
  </div>
38
41
  </ul>
@@ -458,6 +458,16 @@
458
458
  "code": "LMFR_QUESTION_SCENARIO_NO_SIMULATION",
459
459
  "type": "STEP",
460
460
  "component": "MPbQuestion",
461
+ "slots": {
462
+ "beforeContent": {
463
+ "display": true,
464
+ "component": "MPbProgress",
465
+ "totalStep": 7,
466
+ "currentStep": 7,
467
+ "sizeXlWidth": true,
468
+ "label": "Votre projet de salle de bains"
469
+ }
470
+ },
461
471
  "payload": {
462
472
  "viewModel": {
463
473
  "label": "Veuillez-nous excuser, nous n’avons trouvé aucun plan",
@@ -791,6 +801,16 @@
791
801
  "code": "LMFR_QUESTION_PICTURE_INFO",
792
802
  "type": "STEP",
793
803
  "component": "MPbQuestion",
804
+ "slots": {
805
+ "beforeContent": {
806
+ "display": true,
807
+ "component": "MPbProgress",
808
+ "totalStep": 7,
809
+ "currentStep": 7,
810
+ "sizeXlWidth": true,
811
+ "label": "Votre projet de rénovation cuisine"
812
+ }
813
+ },
794
814
  "payload": {
795
815
  "viewModel": {
796
816
  "label": "Si possible, ajoutez des photos de votre cuisine actuelle",
@@ -806,7 +826,7 @@
806
826
  "code": "DO_NOT_ADD_PICTURE",
807
827
  "value": "DO_NOT_ADD_PICTURE"
808
828
  },
809
- "label": "Ne pas ajouter maintenant",
829
+ "label": "Pas maintenant",
810
830
  "theme": "text-primary",
811
831
  "width": "full",
812
832
  "widthFromM": "fit",
@@ -873,7 +893,17 @@
873
893
  "LMFR_QUESTION_ADD_PICTURE": {
874
894
  "code": "LMFR_QUESTION_ADD_PICTURE",
875
895
  "type": "STEP",
876
- "component": "PbUploadDocument",
896
+ "component": "MPbUploadDocument",
897
+ "slots": {
898
+ "beforeContent": {
899
+ "display": true,
900
+ "component": "MPbProgress",
901
+ "totalStep": 7,
902
+ "currentStep": 8,
903
+ "sizeXlWidth": true,
904
+ "label": "Votre projet de salle de bains"
905
+ }
906
+ },
877
907
  "payload": {
878
908
  "viewModel": {
879
909
  "label": "Les photos de votre cuisine",
@@ -908,7 +938,7 @@
908
938
  "skippable": [
909
939
  {
910
940
  "isAnswer": true,
911
- "label": "Ajouter une photo plus tard",
941
+ "label": "Plus tard",
912
942
  "theme": "text-primary",
913
943
  "width": "full",
914
944
  "widthFromM": "fit",
@@ -111,7 +111,7 @@
111
111
  "CARPET": {
112
112
  "code": "CARPET",
113
113
  "viewModel": {
114
- "title": "Moquette, Sisal, Jonc de mer",
114
+ "title": "Moquette, sisal, jonc de mer",
115
115
  "image": "https://storage.googleapis.com/project-booster-media/floor/ground/ground-moquette.jpg"
116
116
  },
117
117
  "nextStep": {
@@ -269,6 +269,14 @@
269
269
  "slots": {
270
270
  "stickyBottom": {
271
271
  "display": false
272
+ },
273
+ "beforeContent": {
274
+ "display": true,
275
+ "component": "MPbProgress",
276
+ "totalStep": 9,
277
+ "currentStep": 3,
278
+ "sizeXlWidth": true,
279
+ "label": "Estimer le budget de votre revêtement de sol"
272
280
  }
273
281
  },
274
282
  "payload": {
@@ -286,7 +294,7 @@
286
294
  "MEDIUM": {
287
295
  "code": "OVERLAY",
288
296
  "viewModel": {
289
- "title": "A l’anglaise",
297
+ "title": "Anglaise",
290
298
  "text": "Lames parallèles et joints répartis irrégulièrement",
291
299
  "image": "https://storage.googleapis.com/project-booster-media/floor/ground/floor-parquet-english-style.png"
292
300
  },
@@ -399,22 +407,6 @@
399
407
  "code": "LMFR_FLOOR_QUESTION_CURRENT",
400
408
  "type": "STEP",
401
409
  "component": "MPbListSelect",
402
- "nextStep": {
403
- "conditionals": [
404
- {
405
- "conditions": ["isAnswerMatching('LMFR_FLOOR_QUESTION_NEW', 'CARPET')"],
406
- "nextStep": {
407
- "code": "LMFR_FLOOR_QUESTION_DIMENSION"
408
- }
409
- },
410
- {
411
- "conditions": ["!isAnswerMatching('LMFR_FLOOR_QUESTION_NEW', 'CARPET')"],
412
- "nextStep": {
413
- "code": "LMFR_FLOOR_QUESTION_ROOM_TYPE"
414
- }
415
- }
416
- ]
417
- },
418
410
  "slots": {
419
411
  "stickyBottom": {
420
412
  "display": false
@@ -441,13 +433,26 @@
441
433
  "order": ["Asc"],
442
434
  "path": ["meta.ranking"]
443
435
  },
436
+ "nextStep": {
437
+ "conditionals": [
438
+ {
439
+ "conditions": ["!isAnswerMatching('LMFR_FLOOR_QUESTION_NEW', 'CARPET')"],
440
+ "nextStep": {
441
+ "code": "LMFR_FLOOR_QUESTION_ROOM_TYPE"
442
+ }
443
+ },
444
+ {
445
+ "conditions": ["isAnswerMatching('LMFR_FLOOR_QUESTION_NEW', 'CARPET')"],
446
+ "nextStep": {
447
+ "code": "LMFR_FLOOR_QUESTION_DIMENSION"
448
+ }
449
+ }
450
+ ]
451
+ },
444
452
  "showMore": {
445
453
  "label": "Voir d'autres revêtements",
446
454
  "minItemsDisplayed": 4,
447
455
  "position": "start"
448
- },
449
- "nextStep": {
450
- "code": "LMFR_FLOOR_QUESTION_DUMP"
451
456
  }
452
457
  },
453
458
  "answers": {
@@ -589,6 +594,19 @@
589
594
  "code": "LMFR_FLOOR_QUESTION_DUMP",
590
595
  "type": "STEP",
591
596
  "component": "MPbQuestion",
597
+ "slots": {
598
+ "stickyBottom": {
599
+ "display": false
600
+ },
601
+ "beforeContent": {
602
+ "display": true,
603
+ "component": "MPbProgress",
604
+ "totalStep": 9,
605
+ "currentStep": 4,
606
+ "sizeXlWidth": true,
607
+ "label": "Estimer le budget de votre revêtement de sol"
608
+ }
609
+ },
592
610
  "nextStep": {
593
611
  "conditionals": [
594
612
  {
@@ -605,19 +623,6 @@
605
623
  }
606
624
  ]
607
625
  },
608
- "slots": {
609
- "stickyBottom": {
610
- "display": false
611
- },
612
- "beforeContent": {
613
- "display": true,
614
- "component": "MPbProgress",
615
- "totalStep": 9,
616
- "currentStep": 4,
617
- "sizeXlWidth": true,
618
- "label": "Estimer le budget de votre revêtement de sol"
619
- }
620
- },
621
626
  "payload": {
622
627
  "viewModel": {
623
628
  "label": "Voulez-vous retirer le revêtement de sol actuel ?",
@@ -1197,6 +1202,16 @@
1197
1202
  "nextStep": {
1198
1203
  "code": "LMFR_FLOOR_QUESTION_INSTALLATION"
1199
1204
  },
1205
+ "slots": {
1206
+ "beforeContent": {
1207
+ "display": true,
1208
+ "component": "MPbProgress",
1209
+ "totalStep": 9,
1210
+ "currentStep": 8,
1211
+ "sizeXlWidth": true,
1212
+ "label": "Estimer le budget de votre revêtement de sol"
1213
+ }
1214
+ },
1200
1215
  "payload": {
1201
1216
  "viewModel": {
1202
1217
  "label": "Quelle gamme de sol souple choisissez-vous ?",