project-booster-vue 9.44.10 → 9.44.11

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.44.10",
3
+ "version": "9.44.11",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -335,12 +335,12 @@ export default defineComponent({
335
335
  this.$emit('link-click');
336
336
  },
337
337
  handleCardClick() {
338
- this.cardLink ? window.open(this.cardLink, '_blank') : '';
338
+ this.cardLink ? window.open(this.cardLink, '_self') : '';
339
339
  !this.buttonLabel && !this.linkLabel ? this.$emit('card-click') : '';
340
340
  },
341
341
  handleButtonLinkClicked(href: string) {
342
342
  this.handleButtonClicked();
343
- window.open(href, '_blank');
343
+ window.open(href, '_self');
344
344
  },
345
345
  handleButtonClicked() {
346
346
  /**
@@ -8,6 +8,7 @@
8
8
  justify-content="center"
9
9
  :aria-hidden="showDialog"
10
10
  :style="`height: ${componentHeight};`"
11
+ @click.prevent="hide()"
11
12
  >
12
13
  <m-flex class="m-dialog" direction="column" :style="dialogStyle">
13
14
  <div class="m-dialog__header" :class="{ 'm-dialog__header--padding-right': !hideCross }">
@@ -4,9 +4,7 @@
4
4
  <div class="pb-progression-block__title">
5
5
  {{ title }}
6
6
  </div>
7
- <div v-if="subtitle" class="pb-progression-block__subtitle">
8
- {{ subtitle }}
9
- </div>
7
+ <div v-if="subtitle" class="pb-progression-block__subtitle" v-html="subtitle"></div>
10
8
  <m-flex class="pb-progression-block__price" align-items="baseline" justify-content="center" wrap>
11
9
  <div class="pb-progression-block__price-min">{{ roundDecadeDown(lowerPrice) }}</div>
12
10
  <div class="pb-progression-block__price-separator">{{ separatorLabel || 'et' }}</div>
@@ -89,6 +89,7 @@
89
89
  width="full"
90
90
  size="l"
91
91
  @click="handleFormSubmit"
92
+ :disabled="disabledNextStep"
92
93
  />
93
94
  <m-link
94
95
  v-if="payload.skippable"
@@ -130,7 +131,7 @@
130
131
  </template>
131
132
 
132
133
  <script lang="ts">
133
- import { defineComponent, computed, onMounted, PropType, ref, ComputedRef } from 'vue';
134
+ import { defineComponent, computed, onMounted, PropType, ref, ComputedRef, watch } from 'vue';
134
135
  import { v4 as uuidv4 } from 'uuid';
135
136
  import { useForm } from 'vee-validate';
136
137
  import * as yup from 'yup';
@@ -147,6 +148,7 @@ import DEFAULT_PAYLOAD from './default-payload.json';
147
148
  import { SpaceInputPayload } from '@/components/question/space-input/SpaceInput';
148
149
  import { ScenarioStepAnswer } from '@/types/pb/Scenario';
149
150
  import { decorate } from '@/services/decorate';
151
+ import { id } from 'date-fns/locale';
150
152
 
151
153
  const BACK_ICON =
152
154
  'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
@@ -247,8 +249,9 @@ export default defineComponent({
247
249
  const pbSpaceInputTextInput = ref<HTMLElement>();
248
250
  const showModal = ref(false);
249
251
  const contentModal = ref({});
252
+ const disabledNextStep = ref(true);
250
253
 
251
- const space = computeDefaultValue(props.runtimeOptions, props.answers!, computedPayload);
254
+ const space = ref(computeDefaultValue(props.runtimeOptions, props.answers!, computedPayload));
252
255
 
253
256
  const handleShowModal = ({ headerTitle, htmlContent }: { headerTitle: string; htmlContent: string }) => {
254
257
  showModal.value = !showModal.value;
@@ -260,6 +263,15 @@ export default defineComponent({
260
263
 
261
264
  const validationSchema = initValidation(componentId, computedPayload);
262
265
 
266
+ watch(space, async (newValue) => {
267
+ const validation = computedPayload.value.viewModel.validation;
268
+ if (newValue && parseInt(newValue) >= validation.minValue && parseInt(newValue) <= validation.maxValue) {
269
+ disabledNextStep.value = false;
270
+ } else {
271
+ disabledNextStep.value = true;
272
+ }
273
+ });
274
+
263
275
  const { handleSubmit } = useForm({ validationSchema: validationSchema.value });
264
276
  const handleFormSubmit = handleSubmit((values) => {
265
277
  const elementId = `text-input-${componentId}` as string;
@@ -314,6 +326,7 @@ export default defineComponent({
314
326
  showModal,
315
327
  handleShowModal,
316
328
  contentModal,
329
+ disabledNextStep,
317
330
  };
318
331
  },
319
332
  });