project-booster-vue 9.34.0 → 9.35.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "9.34.0",
3
+ "version": "9.35.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -17,10 +17,19 @@
17
17
  {{ payload.viewModel.label }}
18
18
  </div>
19
19
 
20
- <div class="pb-warning-message__container--background">
20
+ <div class="pb-warning-message__head" v-if="payload.viewModel.headBlock">
21
+ <div class="pb-warning-message__head__image">
22
+ <img :src="payload.viewModel.headBlock.image" alt="Icon" />
23
+ </div>
24
+ <div class="pb-warning-message__head__text">
25
+ <p>{{ payload.viewModel.headBlock.text }}</p>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="pb-warning-message__container--background" v-if="payload">
21
30
  <m-flex class="pb-warning-message__container__message">
22
31
  <div class="pb-warning-message__container__message__left">
23
- <img :data-src="injectIcon(WARNING_ICON)" id="pb-warning-message-icon" alt="Icon" />
32
+ <img :data-src="injectIcon()" id="pb-warning-message-icon" alt="Icon" />
24
33
  </div>
25
34
  <div class="pb-warning-message__container__message__right">
26
35
  <h3>{{ payload.viewModel.subtitle }}</h3>
@@ -100,6 +109,7 @@ import { ScenarioStepAnswer } from '@/types/pb/Scenario';
100
109
  import SVGInjector from 'svg-injector';
101
110
  import { WarningMessagePayloadAction } from '@/types/pb/WarningMessage';
102
111
  import { DialogContent } from './dialogContent';
112
+ import { string } from 'yup';
103
113
  const BACK_ICON =
104
114
  'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
105
115
  const WARNING_ICON =
@@ -151,21 +161,31 @@ export default defineComponent({
151
161
  type: Object as PropType<Map<string, ScenarioStepAnswer[]>>,
152
162
  default: () => new Map<string, ScenarioStepAnswer[]>(),
153
163
  },
164
+ /**
165
+ * Component icon
166
+ */
167
+ icon: {
168
+ type: string,
169
+ default: () => WARNING_ICON,
170
+ },
154
171
  },
155
172
  methods: {
156
- injectIcon(icon: string) {
173
+ injectIcon() {
157
174
  this.$nextTick(() => {
158
- const element = document.getElementById('pb-warning-message-icon');
175
+ const element = document.querySelector('#pb-warning-message-icon');
159
176
  if (element) {
160
177
  SVGInjector(element, {
161
178
  each: function (svg) {
162
- (svg as any).setAttribute('fill', '#C65200');
179
+ if (svg) {
180
+ console.log(svg);
181
+ (svg as any).setAttribute('fill', '#C65200');
182
+ }
163
183
  },
164
184
  });
165
185
  }
166
186
  });
167
187
 
168
- return icon;
188
+ return this.icon;
169
189
  },
170
190
  callAction(action: WarningMessagePayloadAction) {
171
191
  if (action.type === 'STEP') {
@@ -280,6 +300,23 @@ $responsive-breakpoint: 'm';
280
300
  padding: 0 0 $mu250 0;
281
301
  }
282
302
 
303
+ &__head {
304
+ &__image {
305
+ width: 240px;
306
+
307
+ img {
308
+ height: auto;
309
+ width: 100%;
310
+ }
311
+ }
312
+
313
+ &__text {
314
+ @include set-font-face('semi-bold');
315
+ @include set-font-scale('05', 's');
316
+ text-align: center;
317
+ }
318
+ }
319
+
283
320
  &__container__message__right {
284
321
  h3 {
285
322
  @include set-font-face('semi-bold');
@@ -13,6 +13,10 @@
13
13
  "contentHtml": "Mon contenu de modal ici"
14
14
  }
15
15
  }
16
+ },
17
+ "headBlock": {
18
+ "image": "https://storage.googleapis.com/project-booster-media/new-house/Estimation%20Construction%20Neuve%20-%20Localisation.png",
19
+ "text": "Isolation des combles perdus"
16
20
  }
17
21
  },
18
22
  "callToActions": [