project-booster-vue 9.30.0 → 9.31.1
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/pedagogy/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-pedagogy-pb-pedagogy-/360/237/246/240-101-sandbox-1-snap.png +0 -0
- package/src/components/pedagogy/default-payload.json +0 -11
- package/src/components/projects/project-hub/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-projects-pb-project-hub-/360/237/246/240-features-documents-media-showcase-with-media-documents-1-snap.png +0 -0
- package/src/components/question/PbQuestion.vue +20 -14
- package/src/components/warning-message/PbWarningMessage.stories.mdx +9 -0
- package/src/components/warning-message/PbWarningMessage.vue +87 -5
- package/src/components/warning-message/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-warning-message-pb-warning-message-/360/237/246/240-with-modal-1-snap.png +0 -0
- package/src/components/warning-message/dialogContent.ts +4 -0
- package/src/components/warning-message/with-modal.json +38 -0
package/package.json
CHANGED
|
@@ -15,17 +15,6 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"cards": [
|
|
18
|
-
{
|
|
19
|
-
"code": "CARD-1",
|
|
20
|
-
"viewModel": {
|
|
21
|
-
"url": "https://www.leroymerlin.fr/produits/cuisine/cuisine-equipee-delinia-id/",
|
|
22
|
-
"image": "https://media.leroymerlin.fr/Capture/37/bc/a121f7e74212ad2d356fd3cf2c8a/estimer-mon-budget-cuisine5e5d20ae063b330009a4a372.jpg?width=500&auto=webp&crop=16:9",
|
|
23
|
-
"title": "Estimer votre budget cuisine en quelques clics",
|
|
24
|
-
"width": "full",
|
|
25
|
-
"widthFromM": "1of3",
|
|
26
|
-
"widthFromL": "1of3"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
18
|
{
|
|
30
19
|
"code": "CARD-2",
|
|
31
20
|
"viewModel": {
|
|
@@ -1298,6 +1298,26 @@ $answers-apparition-duration: '0.5s';
|
|
|
1298
1298
|
}
|
|
1299
1299
|
}
|
|
1300
1300
|
|
|
1301
|
+
&__padding-bottom {
|
|
1302
|
+
height: $mu800;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
&__help {
|
|
1306
|
+
margin-bottom: $mu250;
|
|
1307
|
+
&__link,
|
|
1308
|
+
&__text {
|
|
1309
|
+
margin: 0;
|
|
1310
|
+
@include set-font-scale('05', 'l');
|
|
1311
|
+
@include set-font-face('regular');
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
</style>
|
|
1316
|
+
|
|
1317
|
+
<style lang="scss">
|
|
1318
|
+
@import 'pb-variables';
|
|
1319
|
+
|
|
1320
|
+
.pb-question {
|
|
1301
1321
|
&__dialog-help {
|
|
1302
1322
|
&__title {
|
|
1303
1323
|
padding: $mu250 $mu250 0 $mu250;
|
|
@@ -1316,19 +1336,5 @@ $answers-apparition-duration: '0.5s';
|
|
|
1316
1336
|
padding: $mu100 $mu250 $mu250 $mu250;
|
|
1317
1337
|
}
|
|
1318
1338
|
}
|
|
1319
|
-
|
|
1320
|
-
&__padding-bottom {
|
|
1321
|
-
height: $mu800;
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
&__help {
|
|
1325
|
-
margin-bottom: $mu250;
|
|
1326
|
-
&__link,
|
|
1327
|
-
&__text {
|
|
1328
|
-
margin: 0;
|
|
1329
|
-
@include set-font-scale('05', 'l');
|
|
1330
|
-
@include set-font-face('regular');
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
1339
|
}
|
|
1334
1340
|
</style>
|
|
@@ -4,6 +4,7 @@ import cloneDeep from 'lodash.clonedeep';
|
|
|
4
4
|
import PbWarningMessage from './PbWarningMessage';
|
|
5
5
|
import DEFAULT_PAYLOAD from './default-payload.json';
|
|
6
6
|
import WITHOUT_EXPLAIN_LINK from './without-explain-link.json';
|
|
7
|
+
import WITH_MODAL from './with-modal.json';
|
|
7
8
|
|
|
8
9
|
<Meta
|
|
9
10
|
title="Project Booster/Components/Warning Message/PbWarningMessage 🦠"
|
|
@@ -57,3 +58,11 @@ export const TemplateSandbox = (args, { argTypes }) => ({
|
|
|
57
58
|
{TemplateSandbox.bind({})}
|
|
58
59
|
</Story>
|
|
59
60
|
</Canvas>
|
|
61
|
+
|
|
62
|
+
# `PbWarningMessage` - With Modal
|
|
63
|
+
|
|
64
|
+
<Canvas>
|
|
65
|
+
<Story name="With Modal" args={{ payload: WITH_MODAL }}>
|
|
66
|
+
{TemplateSandbox.bind({})}
|
|
67
|
+
</Story>
|
|
68
|
+
</Canvas>
|
|
@@ -26,7 +26,16 @@
|
|
|
26
26
|
<h3>{{ payload.viewModel.subtitle }}</h3>
|
|
27
27
|
<p>{{ payload.viewModel.content }}</p>
|
|
28
28
|
<div class="pb-warning-message__container__message__right__link" v-if="payload.viewModel.explainLink">
|
|
29
|
-
<a
|
|
29
|
+
<a
|
|
30
|
+
v-if="payload.viewModel.explainLink.action"
|
|
31
|
+
href="#"
|
|
32
|
+
@click.prevent="handleHelpDialog(payload.viewModel.explainLink.action.viewModelDialog)"
|
|
33
|
+
>
|
|
34
|
+
{{ payload.viewModel.explainLink.label }}
|
|
35
|
+
</a>
|
|
36
|
+
<a v-else :href="payload.viewModel.explainLink.href">
|
|
37
|
+
{{ payload.viewModel.explainLink.label }}
|
|
38
|
+
</a>
|
|
30
39
|
</div>
|
|
31
40
|
</div>
|
|
32
41
|
</m-flex>
|
|
@@ -53,18 +62,44 @@
|
|
|
53
62
|
/>
|
|
54
63
|
</m-flex>
|
|
55
64
|
</div>
|
|
65
|
+
|
|
66
|
+
<m-dialog
|
|
67
|
+
class="pb-warning-message__dialog-help"
|
|
68
|
+
:show-dialog="displayDialogHelp"
|
|
69
|
+
width="771px"
|
|
70
|
+
height="492px"
|
|
71
|
+
maxHeight="100vh"
|
|
72
|
+
@update:show-dialog="handleHelpDialog"
|
|
73
|
+
v-if="dialogHelpContent"
|
|
74
|
+
>
|
|
75
|
+
<template #header>
|
|
76
|
+
<div class="pb-warning-message__dialog-help__title">
|
|
77
|
+
<h2>{{ dialogHelpContent.headerTitle }}</h2>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
<template #body>
|
|
81
|
+
<div class="pb-warning-message__dialog-help__body" v-html="dialogHelpContent.contentHtml"></div>
|
|
82
|
+
</template>
|
|
83
|
+
<template v-slot:footer>
|
|
84
|
+
<m-flex class="pb-question__dialog-help__footer" align-items="center" justify-content="center">
|
|
85
|
+
<m-button label="Fermer" theme="bordered-neutral" @click.prevent="handleHelpDialog"></m-button>
|
|
86
|
+
</m-flex>
|
|
87
|
+
</template>
|
|
88
|
+
</m-dialog>
|
|
56
89
|
</m-flex>
|
|
57
90
|
</template>
|
|
58
91
|
|
|
59
92
|
<script lang="ts">
|
|
60
|
-
import { defineComponent, PropType } from 'vue';
|
|
93
|
+
import { defineComponent, PropType, ref } from 'vue';
|
|
61
94
|
import { v4 as uuidv4 } from 'uuid';
|
|
62
95
|
import MFlex from './../mozaic/flex/MFlex.vue';
|
|
63
96
|
import MLink from '../mozaic/link/MLink.vue';
|
|
64
97
|
import MButton from '../mozaic/buttons/MButton.vue';
|
|
98
|
+
import MDialog from '../mozaic/dialog/MDialog.vue';
|
|
65
99
|
import { ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
66
100
|
import SVGInjector from 'svg-injector';
|
|
67
101
|
import { WarningMessagePayloadAction } from '@/types/pb/WarningMessage';
|
|
102
|
+
import { DialogContent } from './dialogContent';
|
|
68
103
|
const BACK_ICON =
|
|
69
104
|
'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
|
|
70
105
|
const WARNING_ICON =
|
|
@@ -76,6 +111,7 @@ export default defineComponent({
|
|
|
76
111
|
MFlex,
|
|
77
112
|
MLink,
|
|
78
113
|
MButton,
|
|
114
|
+
MDialog,
|
|
79
115
|
},
|
|
80
116
|
props: {
|
|
81
117
|
/**
|
|
@@ -146,6 +182,13 @@ export default defineComponent({
|
|
|
146
182
|
},
|
|
147
183
|
setup(props, { emit }) {
|
|
148
184
|
const componentId = uuidv4();
|
|
185
|
+
const displayDialogHelp = ref(false);
|
|
186
|
+
const dialogHelpContent = ref();
|
|
187
|
+
|
|
188
|
+
const handleHelpDialog = (content: DialogContent) => {
|
|
189
|
+
displayDialogHelp.value = !displayDialogHelp.value;
|
|
190
|
+
dialogHelpContent.value = content;
|
|
191
|
+
};
|
|
149
192
|
|
|
150
193
|
const skipQuestion = () => {
|
|
151
194
|
/**
|
|
@@ -168,6 +211,9 @@ export default defineComponent({
|
|
|
168
211
|
skipQuestion,
|
|
169
212
|
BACK_ICON,
|
|
170
213
|
WARNING_ICON,
|
|
214
|
+
displayDialogHelp,
|
|
215
|
+
handleHelpDialog,
|
|
216
|
+
dialogHelpContent,
|
|
171
217
|
};
|
|
172
218
|
},
|
|
173
219
|
});
|
|
@@ -184,7 +230,13 @@ $responsive-breakpoint: 'm';
|
|
|
184
230
|
@include set-font-face('regular');
|
|
185
231
|
flex-grow: 1;
|
|
186
232
|
margin: 0 auto;
|
|
187
|
-
|
|
233
|
+
padding: 0 $mu100;
|
|
234
|
+
width: calc(100% - #{$mu100} - #{$mu100});
|
|
235
|
+
|
|
236
|
+
@include set-from-screen($responsive-breakpoint) {
|
|
237
|
+
width: calc(100% - #{$mu200} - #{$mu200});
|
|
238
|
+
}
|
|
239
|
+
|
|
188
240
|
&__back-button-container {
|
|
189
241
|
align-self: flex-start;
|
|
190
242
|
}
|
|
@@ -251,7 +303,9 @@ $responsive-breakpoint: 'm';
|
|
|
251
303
|
}
|
|
252
304
|
|
|
253
305
|
&__container {
|
|
254
|
-
|
|
306
|
+
@include set-from-screen($responsive-breakpoint) {
|
|
307
|
+
width: 511px;
|
|
308
|
+
}
|
|
255
309
|
}
|
|
256
310
|
|
|
257
311
|
&__container__message__left {
|
|
@@ -274,7 +328,10 @@ $responsive-breakpoint: 'm';
|
|
|
274
328
|
|
|
275
329
|
&__container--button {
|
|
276
330
|
margin: $mu250 auto 0 auto;
|
|
277
|
-
|
|
331
|
+
|
|
332
|
+
@include set-from-screen($responsive-breakpoint) {
|
|
333
|
+
width: 311px;
|
|
334
|
+
}
|
|
278
335
|
|
|
279
336
|
&__ok {
|
|
280
337
|
margin-bottom: $mu100;
|
|
@@ -282,3 +339,28 @@ $responsive-breakpoint: 'm';
|
|
|
282
339
|
}
|
|
283
340
|
}
|
|
284
341
|
</style>
|
|
342
|
+
|
|
343
|
+
<style lang="scss">
|
|
344
|
+
@import 'pb-variables';
|
|
345
|
+
|
|
346
|
+
.pb-warning-message {
|
|
347
|
+
&__dialog-help {
|
|
348
|
+
&__title {
|
|
349
|
+
padding: $mu250 $mu250 0 $mu250;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
&__body {
|
|
353
|
+
padding: 0 $mu250;
|
|
354
|
+
@include set-font-scale('05', 'l');
|
|
355
|
+
&__image {
|
|
356
|
+
background-size: cover;
|
|
357
|
+
padding: 120px 0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
&__footer {
|
|
362
|
+
padding: $mu100 $mu250 $mu250 $mu250;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"viewModel": {
|
|
3
|
+
"backLabel": "Question précédente",
|
|
4
|
+
"label": "Vos travaux dans un appartement",
|
|
5
|
+
"subtitle": "Nous attirons votre attention !",
|
|
6
|
+
"content": "La pose d’une pompe à chaleur n’est pas adaptée a un appartement. Nous n’avons pas d’offre pour les appartements aujourd’hui..",
|
|
7
|
+
"explainLink": {
|
|
8
|
+
"type": "link",
|
|
9
|
+
"label": "Comment faire des travaux de rénovation énergétique en tant que locataire ?",
|
|
10
|
+
"action": {
|
|
11
|
+
"viewModelDialog": {
|
|
12
|
+
"headerTitle": "Votre travaux dans un appartement",
|
|
13
|
+
"contentHtml": "Mon contenu de modal ici"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"callToActions": [
|
|
19
|
+
{
|
|
20
|
+
"type": "button",
|
|
21
|
+
"label": "Ok, poursuivre l'estimation",
|
|
22
|
+
"action": {
|
|
23
|
+
"type": "STEP",
|
|
24
|
+
"code": "__END__"
|
|
25
|
+
},
|
|
26
|
+
"bordered": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "button",
|
|
30
|
+
"label": "Changer de le type de propriété",
|
|
31
|
+
"action": {
|
|
32
|
+
"type": "STEP",
|
|
33
|
+
"code": "__BACK__"
|
|
34
|
+
},
|
|
35
|
+
"bordered": true
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|