@weni/unnnic-system 1.16.37 → 1.16.39-develop.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.
@@ -13,39 +13,6 @@ export default {
13
13
  },
14
14
  };
15
15
 
16
- const Template = (args, { argTypes }) => ({
17
- props: Object.keys(argTypes),
18
- components: { unnnicSelectSmart },
19
- data() {
20
- return {
21
- exampleValue: '',
22
- };
23
- },
24
-
25
- methods: {
26
- addDynamicOption() {
27
- const value = Math.floor(Math.random() * 1e3);
28
-
29
- this.exampleOptions.push({
30
- value: `option${value}`,
31
- label: `Option ${value}`,
32
- });
33
- },
34
- },
35
-
36
- template: `
37
- <div>
38
- <unnnic-select-smart
39
- v-model="exampleValue"
40
- :options="exampleOptions"
41
- v-bind="$props"
42
- />
43
-
44
- <button v-if="!(disabled || autocomplete)" @click="addDynamicOption">Add dynamic option</button>
45
- </div>
46
- `,
47
- });
48
-
49
16
  const exampleOptionsDefault = [
50
17
  { value: '', label: 'Select some option' },
51
18
  { value: '5', label: 'Option 5' },
@@ -97,6 +64,41 @@ const exampleOptionsFirstSelected = [
97
64
  { value: '5', label: 'Option 5' },
98
65
  ];
99
66
 
67
+ const Template = (args, { argTypes }) => ({
68
+ props: Object.keys(argTypes),
69
+ components: { unnnicSelectSmart },
70
+ data() {
71
+ return {
72
+ exampleValue: [],
73
+ };
74
+ },
75
+
76
+ methods: {
77
+ addDynamicOption() {
78
+ const value = Math.floor(Math.random() * 1e3);
79
+
80
+ this.exampleOptions.push({
81
+ value: `option${value}`,
82
+ label: `Option ${value}`,
83
+ });
84
+ },
85
+ },
86
+
87
+ template: `
88
+ <div>
89
+ <unnnic-select-smart
90
+ v-model="exampleValue"
91
+ :options="exampleOptions || []"
92
+ v-bind="$props"
93
+ />
94
+
95
+ <p>v-model: {{exampleValue}}</p>
96
+
97
+ <button v-if="!(disabled || autocomplete)" @click="addDynamicOption">Add dynamic option</button>
98
+ </div>
99
+ `,
100
+ });
101
+
100
102
  export const Default = Template.bind({});
101
103
  Default.args = {
102
104
  exampleOptions: exampleOptionsDefault,
@@ -115,6 +117,7 @@ OrderedByIndex.args = {
115
117
 
116
118
  export const Disabled = Template.bind({});
117
119
  Disabled.args = {
120
+ exampleOptions: exampleOptionsDefault,
118
121
  disabled: true,
119
122
  };
120
123
 
@@ -0,0 +1,34 @@
1
+ import unnnicTransitionRipple from '../components/TransitionRipple/TransitionRipple.vue';
2
+ import colorsList from '../utils/colorsList';
3
+
4
+ export default {
5
+ title: 'Transitions/Ripple',
6
+ component: unnnicTransitionRipple,
7
+ argTypes: {
8
+ color: {
9
+ control: {
10
+ type: 'select',
11
+ options: colorsList,
12
+ },
13
+ },
14
+ },
15
+ };
16
+
17
+ const Template = (args, { argTypes }) => ({
18
+ props: Object.keys(argTypes),
19
+ components: {
20
+ unnnicTransitionRipple,
21
+ },
22
+ template: `
23
+ <div ref="transitionContainer" @mousedown="(event) => this.$refs.transitionRipple.addRipple(event)" style="width: 100%; height: 100px;">
24
+ Click to activate transition
25
+
26
+ <unnnic-transition-ripple ref="transitionRipple" v-bind="$props" />
27
+ </div>
28
+ `,
29
+ });
30
+
31
+ export const Default = Template.bind({});
32
+ Default.args = {
33
+ color: 'weni-600',
34
+ };
package/src/utils/call.js CHANGED
@@ -3,14 +3,14 @@ import Alert from '../components/Alert/Alert.vue';
3
3
  import Modal from '../components/Modal/Modal.vue';
4
4
 
5
5
  export default {
6
- callAlert({ props, seconds }) {
6
+ callAlert({ props }) {
7
7
  const AlertClass = Vue.extend(Alert);
8
8
  const instance = new AlertClass({
9
9
  propsData: { ...props, onClose: () => { instance.$el.remove(); } },
10
+ created() { this.$on(['close'], () => { instance.$el.remove(); }); },
10
11
  });
11
12
  instance.$mount();
12
13
  document.body.appendChild(instance.$el);
13
- setTimeout(() => { instance.$el.remove(); }, seconds * 1000);
14
14
  },
15
15
 
16
16
  callModal({ props }) {