project-booster-vue 9.44.11 → 9.45.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 +1 -1
- package/src/components/mozaic/dialog/MDialog.vue +33 -32
- package/src/components/mozaic/dialog/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-mozaic-components-m-dialog-/342/232/233/357/270/217-showcase-hide-overlay-1-snap.png +0 -0
- package/src/components/question/space-input/PbSpaceInput.vue +8 -2
- package/src/components/trezor/PbTrezor.vue +22 -0
- package/src/components/trezor/PbTrezorInterface.ts +6 -0
- package/src/components/trezor/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-trezor-pb-trezor-/360/237/246/240-101-sandbox-1-snap.png +0 -0
- package/src/components/trezor/default-payload.json +8 -0
package/package.json
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<m-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<transition name="m-dialog__slide-bottom">
|
|
4
|
+
<m-flex
|
|
5
|
+
v-if="showDialog"
|
|
6
|
+
class="m-dialog__container"
|
|
7
|
+
align-items="center"
|
|
8
|
+
justify-content="center"
|
|
9
|
+
:aria-hidden="showDialog"
|
|
10
|
+
:style="`height: ${componentHeight};`"
|
|
11
|
+
>
|
|
12
|
+
<div class="m-dialog__container m-dialog__container--overlay" @click.prevent="hide()"></div>
|
|
13
|
+
<m-flex class="m-dialog" direction="column" :style="dialogStyle">
|
|
14
|
+
<div class="m-dialog__header" :class="{ 'm-dialog__header--padding-right': !hideCross }">
|
|
15
|
+
<!-- @slot Dialog header slot -->
|
|
16
|
+
<slot name="header" />
|
|
17
|
+
</div>
|
|
18
|
+
<div class="m-dialog__body-top" :style="`opacity: ${bodyShadowTopOpacity}`" />
|
|
19
|
+
<div ref="pbDialogBody" class="m-dialog__body" @scroll="handleScroll">
|
|
20
|
+
<!-- @slot Dialog body slot -->
|
|
21
|
+
<slot name="body" />
|
|
22
|
+
</div>
|
|
23
|
+
<div class="m-dialog__body-bottom" :style="`opacity: ${bodyShadowBottomOpacity}`" />
|
|
24
|
+
<div class="m-dialog__footer">
|
|
25
|
+
<!-- @slot Dialog footer slot -->
|
|
26
|
+
<slot name="footer" />
|
|
27
|
+
</div>
|
|
28
|
+
<div v-if="!hideCross" class="m-dialog__close" @click="hide()">
|
|
29
|
+
<m-icon :icon="CROSS_ICON" size="m" color="grey-500" />
|
|
30
|
+
</div>
|
|
31
|
+
</m-flex>
|
|
31
32
|
</m-flex>
|
|
32
|
-
</
|
|
33
|
-
</
|
|
33
|
+
</transition>
|
|
34
|
+
</div>
|
|
34
35
|
</template>
|
|
35
36
|
|
|
36
37
|
<script lang="ts">
|
|
@@ -249,6 +250,7 @@ $responsive-breakpoint: 'm';
|
|
|
249
250
|
max-height: 100%;
|
|
250
251
|
overflow: hidden;
|
|
251
252
|
position: relative;
|
|
253
|
+
z-index: 999;
|
|
252
254
|
|
|
253
255
|
@include set-from-screen('m') {
|
|
254
256
|
max-height: 50vh;
|
|
@@ -279,7 +281,6 @@ $responsive-breakpoint: 'm';
|
|
|
279
281
|
right: 0;
|
|
280
282
|
top: 0;
|
|
281
283
|
width: 100vw;
|
|
282
|
-
z-index: 100;
|
|
283
284
|
}
|
|
284
285
|
|
|
285
286
|
&__container--overlay {
|
|
@@ -263,13 +263,19 @@ export default defineComponent({
|
|
|
263
263
|
|
|
264
264
|
const validationSchema = initValidation(componentId, computedPayload);
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
const disabledButton = (value: any) => {
|
|
267
267
|
const validation = computedPayload.value.viewModel.validation;
|
|
268
|
-
if (
|
|
268
|
+
if (value && parseInt(value) >= validation.minValue && parseInt(value) <= validation.maxValue) {
|
|
269
269
|
disabledNextStep.value = false;
|
|
270
270
|
} else {
|
|
271
271
|
disabledNextStep.value = true;
|
|
272
272
|
}
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
disabledButton(space.value);
|
|
276
|
+
|
|
277
|
+
watch(space, async (newValue) => {
|
|
278
|
+
disabledButton(newValue);
|
|
273
279
|
});
|
|
274
280
|
|
|
275
281
|
const { handleSubmit } = useForm({ validationSchema: validationSchema.value });
|
|
@@ -116,6 +116,7 @@ import MLink from '../mozaic/link/MLink.vue';
|
|
|
116
116
|
import MTextInput from '../mozaic/text-input/MTextInput.vue';
|
|
117
117
|
import { ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
118
118
|
import { object, string, boolean, number } from 'yup';
|
|
119
|
+
import { TrezorInterface } from './PbTrezorInterface';
|
|
119
120
|
import objectPath from 'object-path';
|
|
120
121
|
const BACK_ICON =
|
|
121
122
|
'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
|
|
@@ -187,6 +188,26 @@ export default defineComponent({
|
|
|
187
188
|
props.payload.viewModel.defaultValue?.zipcode?.path,
|
|
188
189
|
) || null;
|
|
189
190
|
|
|
191
|
+
const convertToTypeOf = (typedVar: string, input: any): string | number => {
|
|
192
|
+
switch (typedVar) {
|
|
193
|
+
case 'string':
|
|
194
|
+
return input.toString();
|
|
195
|
+
case 'float':
|
|
196
|
+
return parseFloat(input);
|
|
197
|
+
case 'integer':
|
|
198
|
+
return parseInt(input);
|
|
199
|
+
default:
|
|
200
|
+
return input;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const metadata = props.payload.viewModel.metadata;
|
|
205
|
+
let sendingMetadata: any;
|
|
206
|
+
|
|
207
|
+
metadata.forEach((meta: TrezorInterface) => {
|
|
208
|
+
sendingMetadata[meta.attribut] = convertToTypeOf(meta.type, getAnswerValue(meta.answerCode, meta.path)) || null;
|
|
209
|
+
});
|
|
210
|
+
|
|
190
211
|
let formData = ref<any>({
|
|
191
212
|
values: {
|
|
192
213
|
lastname: '',
|
|
@@ -239,6 +260,7 @@ export default defineComponent({
|
|
|
239
260
|
},
|
|
240
261
|
optin: formData.value.values.optin,
|
|
241
262
|
optinPartners: formData.value.values.optinPartners,
|
|
263
|
+
metadata: sendingMetadata,
|
|
242
264
|
},
|
|
243
265
|
typeLead: props.payload.viewModel.typeLead,
|
|
244
266
|
});
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
"path": "value"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
+
"metadata": [
|
|
13
|
+
{
|
|
14
|
+
"attribut": "surface",
|
|
15
|
+
"type": "float",
|
|
16
|
+
"answerCode": "LMFR_HEAT_PUMP_AIR_WATER_QUESTION_SURFACE_AREA",
|
|
17
|
+
"path": "space"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
12
20
|
"translationErrors": {
|
|
13
21
|
"lastname": "Le nom est requis",
|
|
14
22
|
"firstname": "Le prénom est requis",
|