project-booster-vue 9.44.2 → 9.44.4
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/PbQuestion-Features-Question-Modal-Link.stories.mdx +59 -0
- package/src/components/question/PbQuestion.vue +14 -3
- package/src/components/question/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-scenario-questions-pb-question-/360/237/246/240-features-question-modal-link-101-1-snap.png +0 -0
- package/src/components/question/default-payload-modal.json +51 -0
- package/src/components/trezor/PbTrezor.vue +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { nestedAppDecorator } from '../../../.storybook/nested-app-decorator';
|
|
2
|
+
import { Story, Preview, Meta, Props, ArgsTable, Source, Canvas } from '@storybook/addon-docs';
|
|
3
|
+
import PbQuestion from './PbQuestion';
|
|
4
|
+
import { TemplateSandbox } from './PbQuestion.stories.mdx';
|
|
5
|
+
import DEFAULT_PAYLOAD from './default-payload-modal.json';
|
|
6
|
+
|
|
7
|
+
<Meta
|
|
8
|
+
title="Project Booster/Scenario/Questions/PbQuestion 🦠/Features/Question/Modal Link"
|
|
9
|
+
component={PbQuestion}
|
|
10
|
+
argTypes={{
|
|
11
|
+
onStepCompleted: {
|
|
12
|
+
action: 'Step completed',
|
|
13
|
+
table: { disable: true },
|
|
14
|
+
},
|
|
15
|
+
}}
|
|
16
|
+
decorators={[
|
|
17
|
+
nestedAppDecorator(
|
|
18
|
+
{
|
|
19
|
+
actions: {
|
|
20
|
+
sendEventToBus({}, payload) {
|
|
21
|
+
console.log('Event sent to bus', payload);
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
[],
|
|
26
|
+
),
|
|
27
|
+
]}
|
|
28
|
+
parameters={{
|
|
29
|
+
layout: 'fullscreen',
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
# `PbQuestion` - Modal Link 101
|
|
34
|
+
|
|
35
|
+
## Definition
|
|
36
|
+
|
|
37
|
+
It is possible to customize the component behaviour by defining properties in the provided `payload` property.
|
|
38
|
+
|
|
39
|
+
Here is a simple payload:
|
|
40
|
+
|
|
41
|
+
<Source language="json" code={JSON.stringify(DEFAULT_PAYLOAD, null, ' ')} />
|
|
42
|
+
|
|
43
|
+
where:
|
|
44
|
+
|
|
45
|
+
- `viewModel` is the question view model, it defines the question `label` and the answers component type, and if `forceBackButton` is set to true, will always display the back button
|
|
46
|
+
- `answers` is the list of answers for the question. They have a `code` to identify them and a `viewModel` to
|
|
47
|
+
inflate the component previously defined.
|
|
48
|
+
|
|
49
|
+
<Canvas>
|
|
50
|
+
<Story
|
|
51
|
+
name="101"
|
|
52
|
+
inline={false}
|
|
53
|
+
height="862px"
|
|
54
|
+
parameters={{ controls: { disable: true } }}
|
|
55
|
+
args={{ payload: DEFAULT_PAYLOAD, minHeight: 'auto' }}
|
|
56
|
+
>
|
|
57
|
+
{TemplateSandbox.bind({})}
|
|
58
|
+
</Story>
|
|
59
|
+
</Canvas>
|
|
@@ -1273,15 +1273,26 @@ $answers-apparition-duration: '0.5s';
|
|
|
1273
1273
|
|
|
1274
1274
|
<style lang="scss">
|
|
1275
1275
|
@import 'pb-variables';
|
|
1276
|
+
$responsive-breakpoint: 'm';
|
|
1276
1277
|
|
|
1277
1278
|
.pb-question {
|
|
1278
1279
|
&__dialog-help {
|
|
1279
1280
|
&__title {
|
|
1280
|
-
|
|
1281
|
+
@include set-font-scale('06', 'm');
|
|
1282
|
+
padding: $mu100 $mu250 $mu050 $mu250;
|
|
1283
|
+
|
|
1284
|
+
@include set-from-screen($responsive-breakpoint) {
|
|
1285
|
+
padding: $mu200 $mu250 $mu050 $mu250;
|
|
1286
|
+
}
|
|
1281
1287
|
|
|
1282
1288
|
h2 {
|
|
1283
|
-
@include set-font-scale('
|
|
1284
|
-
|
|
1289
|
+
@include set-font-scale('08', 'm');
|
|
1290
|
+
@include set-font-face('semi-bold');
|
|
1291
|
+
margin-bottom: $mu025;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
p {
|
|
1295
|
+
margin-top: 0;
|
|
1285
1296
|
}
|
|
1286
1297
|
}
|
|
1287
1298
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"viewModel": {
|
|
3
|
+
"label": "Quel est votre revenu fiscal de référence annuel de votre foyer fiscal ?",
|
|
4
|
+
"subtitle": "Posez la question à votre propritétaire, cette information est utile pour le calcul des aides.",
|
|
5
|
+
"answersComponent": "PbCard"
|
|
6
|
+
},
|
|
7
|
+
"answers": {
|
|
8
|
+
"LOW_IDF_1": {
|
|
9
|
+
"code": "LOW",
|
|
10
|
+
"viewModel": {
|
|
11
|
+
"title": "0 - 20 593 €",
|
|
12
|
+
"borderColor": "#0FB5FC"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"MIDDLE_IDF_1": {
|
|
16
|
+
"code": "MIDDLE",
|
|
17
|
+
"viewModel": {
|
|
18
|
+
"title": "20 593 - 25 068 €",
|
|
19
|
+
"borderColor": "#FFDD2D"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"HIGH_IDF_1": {
|
|
23
|
+
"code": "HIGH",
|
|
24
|
+
"viewModel": {
|
|
25
|
+
"title": "25 068 - 38 184 €",
|
|
26
|
+
"borderColor": "#B073FF"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"VERYHIGH_IDF_1": {
|
|
30
|
+
"code": "VERY-HIGH",
|
|
31
|
+
"viewModel": {
|
|
32
|
+
"title": "Plus de 38 184 €",
|
|
33
|
+
"borderColor": "#FF8CF4"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"helpArea": [
|
|
38
|
+
{
|
|
39
|
+
"type": "link",
|
|
40
|
+
"label": "Voir l’aide pour trouver votre revenu fiscal",
|
|
41
|
+
"action": {
|
|
42
|
+
"type": "MODAL",
|
|
43
|
+
"viewModelDialog": {
|
|
44
|
+
"headerTitle": "Ou trouver votre revenu fiscal de référence ?",
|
|
45
|
+
"subTitle": "Sur votre dernier avis d’imposition disponible dans votre espace impots-gouv.fr",
|
|
46
|
+
"imgUrl": "https://storage.googleapis.com/project-booster-media/energyrenovation/reference_tax_income.png"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|