@weni/unnnic-system 2.8.0 → 2.8.2

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": "@weni/unnnic-system",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -17,6 +17,7 @@
17
17
  :scheme="active ? 'brand-weni-soft' : 'neutral-cloudy'"
18
18
  size="sm"
19
19
  :icon="icon"
20
+ :filled="iconFilled"
20
21
  />
21
22
  <span class="unnnic-side-bar-item__label">
22
23
  {{ text }}
@@ -46,6 +47,10 @@ export default {
46
47
  type: String,
47
48
  default: null,
48
49
  },
50
+ iconFilled: {
51
+ type: Boolean,
52
+ default: false,
53
+ },
49
54
  text: {
50
55
  type: String,
51
56
  default: null,
@@ -11,6 +11,7 @@
11
11
  :currentStep="currentStep"
12
12
  :attachedElement="currentStepOptions.attachedElement"
13
13
  @end="end"
14
+ @close="close"
14
15
  @next-step="nextStep"
15
16
  />
16
17
  </template>
@@ -36,6 +37,7 @@ export default {
36
37
  validator: validateSteps,
37
38
  },
38
39
  },
40
+ emits: ['endTour', 'nextStep', 'close'],
39
41
 
40
42
  data() {
41
43
  return {
@@ -91,9 +93,17 @@ export default {
91
93
  end() {
92
94
  this.isTourActive = false;
93
95
  this.currentStep = 1;
96
+ this.$emit('endTour');
94
97
  },
95
- handleStep(step) {
96
- if (this.currentStep < this.steps.length) {
98
+ close() {
99
+ this.$emit('close');
100
+ },
101
+ async handleStep(step) {
102
+ if (this.currentStep <= this.steps.length) {
103
+ const { beforeRender } = this.steps[step - 1];
104
+
105
+ if (beforeRender) await beforeRender();
106
+
97
107
  this.currentStep = step;
98
108
  }
99
109
  },
@@ -104,7 +114,6 @@ export default {
104
114
  end();
105
115
  return;
106
116
  }
107
-
108
117
  handleStep(currentStep + 1);
109
118
  },
110
119
  updateMaskRect() {
@@ -8,13 +8,14 @@
8
8
  <h1 class="header__title">{{ step.title }}</h1>
9
9
  <p
10
10
  class="header__close-tour"
11
- @click="$emit('end')"
11
+ @click.stop="$emit('close')"
12
12
  >
13
13
  {{ i18n('close_tour') }}
14
14
  </p>
15
15
  </header>
16
16
  <p class="popover__description">{{ step.description }}</p>
17
17
  <UnnnicButton
18
+ v-if="!step.hiddenNextStepButton"
18
19
  type="primary"
19
20
  @click="$emit('nextStep')"
20
21
  >
@@ -56,7 +57,7 @@ export default {
56
57
  },
57
58
  },
58
59
 
59
- emits: ['end', 'nextStep'],
60
+ emits: ['end', 'nextStep', 'close'],
60
61
 
61
62
  data() {
62
63
  return {