@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 +8 -0
- package/components/BreadCrumb.vue +31 -0
- package/components/Input.vue +15 -3
- package/lib.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -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>
|
package/components/Input.vue
CHANGED
|
@@ -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.
|
|
51
|
-
|
|
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,
|