@avakhula/ui 0.0.16 → 0.0.18

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": "@avakhula/ui",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.umd.cjs",
6
6
  "source": "src/index.js",
package/src/App.vue CHANGED
@@ -6,11 +6,17 @@
6
6
  :is-multiple="false"
7
7
  />
8
8
 
9
- <button @click="changeValue">test</button>
9
+ <button @click="changeValue">Change value</button>
10
+ <button @click="changeValueInProps">Change value in props</button>
11
+
12
+ <ib-checkbox @input="test1" class="hello"/>
10
13
  </template>
11
14
 
12
15
  <script>
13
16
  import IbSelect from "./components/TreeSelect/Select.vue";
17
+ import IbCheckbox from "./components/Form/Checkbox/Checkbox.vue"
18
+
19
+
14
20
  const testData = [
15
21
  {
16
22
  id: "1",
@@ -68,12 +74,21 @@ export default {
68
74
  },
69
75
  components: {
70
76
  IbSelect,
77
+ IbCheckbox
71
78
  },
72
79
  methods: {
80
+ test1() {
81
+ console.log('test 1')
82
+ },
83
+
73
84
  changeValue() {
74
85
  console.log('test')
75
86
  this.test = testData[2].id
76
87
  },
88
+ changeValueInProps() {
89
+ console.log('test')
90
+ this.test = testData[3].id
91
+ },
77
92
  },
78
93
  };
79
94
  </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <label
3
- :class="classes"
3
+ v-bind="attrs"
4
4
  :for="id"
5
5
  :tabindex="disabled ? -1 : 0"
6
6
  @keypress.prevent="onChange"
@@ -47,6 +47,7 @@
47
47
  </template>
48
48
  <script>
49
49
  import generateUID from "../../../helpers/generateUID";
50
+ import removeEvents from "../../../helpers/removeEvents";
50
51
  import IbIcon from "../../Icon.vue";
51
52
 
52
53
  export default {
@@ -100,6 +101,7 @@ export default {
100
101
  methods: {
101
102
  onChange() {
102
103
  this.checked = !this.checked;
104
+ console.log('input')
103
105
  this.$emit("input", this.checked);
104
106
  },
105
107
  },
@@ -116,10 +118,18 @@ export default {
116
118
  indeterminate() {
117
119
  return this.isChecked === null;
118
120
  },
121
+ attrs() {
122
+ const attrsList = { ...removeEvents({ ...this.$attrs }) };
123
+
124
+ attrsList.class = [this.classes, attrsList.class];
125
+
126
+ return attrsList;
127
+ },
119
128
  },
120
129
  components: {
121
130
  IbIcon,
122
131
  },
132
+ inheritAttrs: false,
123
133
  };
124
134
  </script>
125
135
 
@@ -275,9 +275,6 @@ export default {
275
275
  },
276
276
  modelValue: {
277
277
  type: [Number, String, Array],
278
- default() {
279
- return [];
280
- },
281
278
  },
282
279
  value: {
283
280
  type: [Number, String, Array],
@@ -371,6 +368,10 @@ export default {
371
368
  },
372
369
  },
373
370
  watch: {
371
+ value(value) {
372
+ this.val = value;
373
+ this.setPreparedValues();
374
+ },
374
375
  modelValue(value) {
375
376
  this.val = value;
376
377
  this.setPreparedValues();