@weni/unnnic-system 2.0.14 → 2.0.16

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.0.14",
3
+ "version": "2.0.16",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -104,9 +104,9 @@ export default {
104
104
  },
105
105
  },
106
106
  methods: {
107
- onClick() {
107
+ onClick($event) {
108
108
  if (!this.clickable) return;
109
- this.$emit('click');
109
+ this.$emit('click', $event);
110
110
  },
111
111
  },
112
112
  };
@@ -10,7 +10,7 @@
10
10
  class="unnnic-select-smart__input"
11
11
  ref="selectSmartInput"
12
12
  :modelValue="inputValue"
13
- :placeholder="autocompletePlaceholder || selectedLabel"
13
+ :placeholder="placeholder || autocompletePlaceholder || selectedLabel"
14
14
  :type="type"
15
15
  :size="size"
16
16
  :disabled="disabled"
@@ -158,7 +158,11 @@ export default {
158
158
  selectFirst: {
159
159
  type: Boolean,
160
160
  default: true,
161
- }
161
+ },
162
+ placeholder: {
163
+ type: String,
164
+ default: null,
165
+ },
162
166
  },
163
167
 
164
168
  data() {
@@ -10,14 +10,17 @@
10
10
  ${disabled ? 'unnnic-tag__label--disabled' : ''}`"
11
11
  >{{ text }}</span
12
12
  >
13
- <UnnnicIcon
14
- v-if="hasCloseIcon"
15
- icon="close-1"
13
+ <div
14
+ @click.stop="emitClose"
16
15
  class="unnnic-tag__icon"
17
- scheme="neutral-darkest"
18
- size="xs"
19
- @click.stop="$emit('close')"
20
- />
16
+ v-if="hasCloseIcon"
17
+ >
18
+ <UnnnicIcon
19
+ icon="close-1"
20
+ scheme="neutral-darkest"
21
+ size="xs"
22
+ />
23
+ </div>
21
24
  </div>
22
25
  </template>
23
26
 
@@ -56,6 +59,9 @@ export default {
56
59
  if (!this.closeClicked) return;
57
60
  this.$emit('close-click');
58
61
  },
62
+ emitClose() {
63
+ this.$emit('close');
64
+ },
59
65
  },
60
66
  };
61
67
  </script>
@@ -115,6 +121,7 @@ export default {
115
121
  }
116
122
 
117
123
  &__icon {
124
+ display: flex;
118
125
  margin-right: $unnnic-inline-ant;
119
126
  cursor: pointer;
120
127
  }
@@ -1,59 +0,0 @@
1
- import unnnicSelectSmart from '../components/SelectSmart/SelectSmart.vue';
2
-
3
- export default {
4
- title: 'Form/SelectSmart2',
5
- component: unnnicSelectSmart,
6
- argTypes: {
7
- 'on-update:model-value': { action: '@update:model-value' },
8
- size: { control: { type: 'select', options: ['md', 'sm'] } },
9
- type: { control: { type: 'select', options: ['normal', 'error'] } },
10
- },
11
- };
12
-
13
- const Template = (args, { argTypes }) => ({
14
- props: Object.keys(argTypes),
15
-
16
- components: {
17
- unnnicSelectSmart,
18
- },
19
-
20
- data() {
21
- return {
22
- selected: [],
23
- options: [
24
- {
25
- value: 't1',
26
- label: 'teste 1'
27
- },
28
- {
29
- value: 't2',
30
- label: 'teste 2'
31
- },
32
- {
33
- value: 't3',
34
- label: 'teste 3'
35
- },
36
- ]
37
- };
38
- },
39
-
40
- template: `
41
- <div>
42
- <pre>v-model: {{ content }}</pre>
43
- <unnnic-select-smart :options="options" v-model="selected" multiple :selectFirst="false" />
44
- </div>
45
- `,
46
-
47
- methods: {},
48
- });
49
-
50
- export const Default = Template.bind({});
51
-
52
- Default.args = {
53
- label: 'Label',
54
- placeholder: 'Placeholder',
55
- maxLength: 150,
56
- disabled: false,
57
- type: 'normal',
58
- errors: [],
59
- };