project-booster-vue 9.25.0 → 9.26.0
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
|
@@ -247,3 +247,51 @@ export const customFooter = {
|
|
|
247
247
|
{TemplateSandbox.bind({})}
|
|
248
248
|
</Story>
|
|
249
249
|
</Canvas>
|
|
250
|
+
|
|
251
|
+
## With modal support
|
|
252
|
+
|
|
253
|
+
export const withModal = {
|
|
254
|
+
viewModel: {
|
|
255
|
+
validation: {
|
|
256
|
+
maxValue: 10001,
|
|
257
|
+
maxErrorMessage: 'La surface doit être comprise entre 100m² et 10 000m²',
|
|
258
|
+
minValue: 99,
|
|
259
|
+
minErrorMessage: 'La surface doit être comprise entre 100m² et 10 000m²',
|
|
260
|
+
},
|
|
261
|
+
backLabel: 'Question précédente',
|
|
262
|
+
label: 'Quelle est votre surface ?',
|
|
263
|
+
placeholder: 'Votre surface',
|
|
264
|
+
actionLabel: 'Continuer',
|
|
265
|
+
image: null,
|
|
266
|
+
},
|
|
267
|
+
helpArea: [
|
|
268
|
+
{
|
|
269
|
+
type: 'text',
|
|
270
|
+
label: 'Besoin d’aide pour calculer la surface ?',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
type: 'link',
|
|
274
|
+
label: 'Voir le guide pour calculer sa surface',
|
|
275
|
+
action: {
|
|
276
|
+
type: 'MODAL',
|
|
277
|
+
dialogViewModel: {
|
|
278
|
+
headerTitle: 'Pour calculer la surface chauffée c’est facile.',
|
|
279
|
+
htmlContent:
|
|
280
|
+
'<p>Pour calculer la surface chauffée c’est facile.</p><p> Il suffit de déduire de <strong>la surface habitable</strong> de votre habitation, <strong>les surfaces des pièces non chauffées</strong> par la pompe à chaleur. </p><p> Les pièces non chauffées peuvent être des pièces annexes (buanderie, véranda, …) ou de pièces chauffées par un autre mode de chauffage (radiateurs électriques par exemple). </p><p> <strong>Attention :</strong> le garage et le grenier ne sont pas pris en compte dans la surface habitable de base, il ne faut donc pas les déduire </p>',
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
<Source language="json" code={JSON.stringify(withModal, null, ' ')} />
|
|
288
|
+
|
|
289
|
+
<Canvas>
|
|
290
|
+
<Story
|
|
291
|
+
name="Showcase - Feature with modal"
|
|
292
|
+
parameters={{ controls: { disable: true } }}
|
|
293
|
+
args={{ payload: withModal }}
|
|
294
|
+
>
|
|
295
|
+
{TemplateSandbox.bind({})}
|
|
296
|
+
</Story>
|
|
297
|
+
</Canvas>
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@click.once="$emit('go-back')"
|
|
13
13
|
/>
|
|
14
14
|
</m-flex>
|
|
15
|
+
|
|
15
16
|
<form
|
|
16
17
|
class="pb-space-input__form-container"
|
|
17
18
|
ref="pbSpaceInputFormContainerObserver"
|
|
@@ -57,6 +58,30 @@
|
|
|
57
58
|
</m-flexy-col>
|
|
58
59
|
</m-flex>
|
|
59
60
|
|
|
61
|
+
<m-flex
|
|
62
|
+
class="pb-space-input__help"
|
|
63
|
+
v-if="computedPayload.helpArea"
|
|
64
|
+
direction="column"
|
|
65
|
+
align-items="center"
|
|
66
|
+
justify-content="center"
|
|
67
|
+
>
|
|
68
|
+
<div v-for="helpItem in computedPayload.helpArea" :key="helpItem.type">
|
|
69
|
+
<div v-if="helpItem.type === 'text'">
|
|
70
|
+
<p class="pb-space-input__help__text">{{ helpItem.label }}</p>
|
|
71
|
+
</div>
|
|
72
|
+
<div v-if="helpItem.type === 'link'">
|
|
73
|
+
<m-link
|
|
74
|
+
class="pb-space-input__help__link"
|
|
75
|
+
:label="helpItem.label"
|
|
76
|
+
width="full"
|
|
77
|
+
size="l"
|
|
78
|
+
theme="primary"
|
|
79
|
+
@click="handleShowModal(helpItem.action.dialogViewModel)"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</m-flex>
|
|
84
|
+
|
|
60
85
|
<m-flex class="pb-space-input__buttons-container" direction="column" align-items="center">
|
|
61
86
|
<m-button
|
|
62
87
|
class="pb-space-input__button"
|
|
@@ -77,6 +102,30 @@
|
|
|
77
102
|
</m-flex>
|
|
78
103
|
</m-flex>
|
|
79
104
|
</form>
|
|
105
|
+
|
|
106
|
+
<m-dialog
|
|
107
|
+
class="pb-space-input__dialog"
|
|
108
|
+
:show-dialog="showModal"
|
|
109
|
+
width="680px"
|
|
110
|
+
height="520px"
|
|
111
|
+
maxHeight="100vh"
|
|
112
|
+
@update:show-dialog="handleShowModal"
|
|
113
|
+
v-if="computedPayload.helpArea"
|
|
114
|
+
>
|
|
115
|
+
<template v-slot:header>
|
|
116
|
+
<div class="pb-space-input__dialog__title">
|
|
117
|
+
<h2>{{ contentModal.headerTitle }}</h2>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
120
|
+
<template v-slot:body>
|
|
121
|
+
<div class="pb-space-input__dialog__body" v-html="contentModal.htmlContent"></div>
|
|
122
|
+
</template>
|
|
123
|
+
<template v-slot:footer>
|
|
124
|
+
<m-flex class="pb-space-input__dialog__footer" align-items="center" justify-content="center">
|
|
125
|
+
<m-button label="Fermer" theme="bordered-neutral" @click.prevent="handleShowModal"></m-button>
|
|
126
|
+
</m-flex>
|
|
127
|
+
</template>
|
|
128
|
+
</m-dialog>
|
|
80
129
|
</m-flex>
|
|
81
130
|
</template>
|
|
82
131
|
|
|
@@ -93,6 +142,7 @@ import MLink from '../../mozaic/link/MLink.vue';
|
|
|
93
142
|
import MTextInput from '../../mozaic/text-input/MTextInput.vue';
|
|
94
143
|
import MFlexyCol from '../../mozaic/grid/MFlexyCol.vue';
|
|
95
144
|
import MIcon from '../../mozaic/icon/MIcon.vue';
|
|
145
|
+
import MDialog from '../../mozaic/dialog/MDialog.vue';
|
|
96
146
|
import DEFAULT_PAYLOAD from './default-payload.json';
|
|
97
147
|
import { SpaceInputPayload } from '@/components/question/space-input/SpaceInput';
|
|
98
148
|
import { ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
@@ -145,6 +195,7 @@ export default defineComponent({
|
|
|
145
195
|
MFlexyCol,
|
|
146
196
|
MTextInput,
|
|
147
197
|
MIcon,
|
|
198
|
+
MDialog,
|
|
148
199
|
},
|
|
149
200
|
|
|
150
201
|
props: {
|
|
@@ -194,9 +245,19 @@ export default defineComponent({
|
|
|
194
245
|
return merge(tempPayload, props.payload);
|
|
195
246
|
});
|
|
196
247
|
const pbSpaceInputTextInput = ref<HTMLElement>();
|
|
248
|
+
const showModal = ref(false);
|
|
249
|
+
const contentModal = ref({});
|
|
197
250
|
|
|
198
251
|
const space = computeDefaultValue(props.runtimeOptions, props.answers!, computedPayload);
|
|
199
252
|
|
|
253
|
+
const handleShowModal = ({ headerTitle, htmlContent }: { headerTitle: string; htmlContent: string }) => {
|
|
254
|
+
showModal.value = !showModal.value;
|
|
255
|
+
|
|
256
|
+
if (headerTitle && htmlContent) {
|
|
257
|
+
contentModal.value = { headerTitle, htmlContent };
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
200
261
|
const validationSchema = initValidation(componentId, computedPayload);
|
|
201
262
|
|
|
202
263
|
const { handleSubmit } = useForm({ validationSchema: validationSchema.value });
|
|
@@ -250,6 +311,9 @@ export default defineComponent({
|
|
|
250
311
|
handleFormSubmit,
|
|
251
312
|
isShowingFooter,
|
|
252
313
|
skipQuestion,
|
|
314
|
+
showModal,
|
|
315
|
+
handleShowModal,
|
|
316
|
+
contentModal,
|
|
253
317
|
};
|
|
254
318
|
},
|
|
255
319
|
});
|
|
@@ -382,5 +446,29 @@ $responsive-breakpoint: 'm';
|
|
|
382
446
|
&__link {
|
|
383
447
|
margin-top: $mu250;
|
|
384
448
|
}
|
|
449
|
+
|
|
450
|
+
&__dialog {
|
|
451
|
+
&__title {
|
|
452
|
+
padding: $mu250 $mu250 0 $mu250;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
&__body {
|
|
456
|
+
padding: 0 $mu250;
|
|
457
|
+
@include set-font-scale('05', 'l');
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
&__footer {
|
|
461
|
+
padding: $mu100 $mu250 $mu250 $mu250;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
&__help {
|
|
466
|
+
margin-bottom: $mu250;
|
|
467
|
+
|
|
468
|
+
&__link,
|
|
469
|
+
&__text {
|
|
470
|
+
margin: 0;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
385
473
|
}
|
|
386
474
|
</style>
|