@tak-ps/vue-tabler 2.3.1 → 2.5.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.5.0
14
+
15
+ - :tada: Add BreadCrumb Component
16
+
17
+ ### v2.4.0
18
+
19
+ - :bug: Numeric input should output numerics in TablerInput
20
+
13
21
  ### v2.3.1
14
22
 
15
23
  - :rocket: Remove Debug Code
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <ol class="breadcrumb" aria-label="breadcrumbs">
3
+ <li class="breadcrumb-item"><a @click='$router.push("/")' class='cursor-pointer'>Home</a></li>
4
+ <li
5
+ :key='crumb_it'
6
+ v-for='(crumb, crumb_it) in crumbs'
7
+ class="breadcrumb-item"
8
+ :class='{
9
+ "active": crumb_it === crumbs.length - 1
10
+ }'
11
+ >
12
+ <a v-if='crumb_it === crumbs.length - 1' v-text='crumb'></a>
13
+ <a v-else @click='$router.push("/" + crumbs.splice(0, crumb_it + 1).join("/").toLowerCase())' class='cursor-pointer' v-text='crumb'></a>
14
+ </li>
15
+ </ol>
16
+ </template>
17
+
18
+ <script>
19
+ export default {
20
+ name: 'BreadCrumb',
21
+ data: function() {
22
+ return {
23
+ crumbs: this.$route.path.split('/').filter((crumb) => {
24
+ return crumb.length;
25
+ }).map((crumb) => {
26
+ return `${crumb[0].toUpperCase()}${crumb.slice(1, crumb.length)}`;
27
+ })
28
+ }
29
+ },
30
+ }
31
+ </script>
@@ -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
  }
package/lib.js CHANGED
@@ -6,8 +6,10 @@ import TablerProgress from './components/Progress.vue'
6
6
  import TablerLoading from './components/Loading.vue'
7
7
  import TablerToggle from './components/Toggle.vue'
8
8
  import TablerInput from './components/Input.vue'
9
+ import TablerBreadCrumb from './components/BreadCrumb.vue';
9
10
 
10
11
  export {
12
+ TablerBreadCrumb,
11
13
  TablerError,
12
14
  TablerSelect,
13
15
  TablerLoading,
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.1",
4
+ "version": "2.5.0",
5
5
  "main": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",