@tak-ps/vue-tabler 2.3.0 → 2.4.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.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v2.4.0
14
+
15
+ - :bug: Numeric input should output numerics in TablerInput
16
+
17
+ ### v2.3.1
18
+
19
+ - :rocket: Remove Debug Code
20
+
13
21
  ### v2.3.0
14
22
 
15
23
  - :rocket: Improved List Component
@@ -21,7 +21,7 @@ export default {
21
21
  name: 'TablerInput',
22
22
  props: {
23
23
  modelValue: {
24
- type: String,
24
+ type: [String, Number],
25
25
  required: true
26
26
  },
27
27
  disabled: {
@@ -47,8 +47,20 @@ export default {
47
47
  },
48
48
  watch: {
49
49
  current: function() {
50
- if (this.current === this.modelValue) return;
51
- this.$emit('update:modelValue', this.current);
50
+ if (typeof this.modelValue === 'number') {
51
+ const current = Number(this.current);
52
+
53
+ if (isNaN(current)) {
54
+ this.error = 'Must be a number!';
55
+ } else if (current === this.modelValue) {
56
+ return;
57
+ } else {
58
+ this.$emit('update:modelValue', current);
59
+ }
60
+ } else {
61
+ if (this.current === this.modelValue) return;
62
+ this.$emit('update:modelValue', this.current);
63
+ }
52
64
  }
53
65
  }
54
66
  }
@@ -75,7 +75,6 @@ export default {
75
75
  buttonHeight() {
76
76
  if(!this.isMounted) return 100;
77
77
  const buttonDOM = this.$refs.button
78
- console.error(buttonDOM);
79
78
  return buttonDOM ? buttonDOM.offsetWidth : 100;
80
79
  },
81
80
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "2.3.0",
4
+ "version": "2.4.0",
5
5
  "main": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",