@tak-ps/vue-tabler 2.4.0 → 2.6.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 +9 -0
- package/components/BreadCrumb.vue +31 -0
- package/components/Epoch.vue +31 -0
- package/components/EpochRange.vue +33 -0
- package/lib.js +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,15 @@
|
|
|
10
10
|
|
|
11
11
|
## Version History
|
|
12
12
|
|
|
13
|
+
### v2.6.0
|
|
14
|
+
|
|
15
|
+
- :tada: Add Epoch Component
|
|
16
|
+
- :tada: Add EpochRange Component
|
|
17
|
+
|
|
18
|
+
### v2.5.0
|
|
19
|
+
|
|
20
|
+
- :tada: Add BreadCrumb Component
|
|
21
|
+
|
|
13
22
|
### v2.4.0
|
|
14
23
|
|
|
15
24
|
- :bug: Numeric input should output numerics in TablerInput
|
|
@@ -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>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span v-text='display'/>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
name: 'Epoch',
|
|
8
|
+
props: {
|
|
9
|
+
date: {
|
|
10
|
+
type: Number,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
format: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'ISO'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
display: function() {
|
|
20
|
+
const date = new Date(this.date)
|
|
21
|
+
if (this.format === 'ISO') {
|
|
22
|
+
return date.toISOString()
|
|
23
|
+
.replace('T', ' ')
|
|
24
|
+
.replace(/:[0-9]+\.[0-9]+[A-Z]/, '');
|
|
25
|
+
} else {
|
|
26
|
+
return date.toString();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span v-text='display'/>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
name: 'EpochRange',
|
|
8
|
+
props: {
|
|
9
|
+
start: {
|
|
10
|
+
type: Number,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
end: {
|
|
14
|
+
type: Number,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
display: function() {
|
|
20
|
+
const start = new Date(this.start)
|
|
21
|
+
const end = new Date(this.end)
|
|
22
|
+
|
|
23
|
+
const start_dt = start.toISOString().replace(/[A-Z].*/, '');
|
|
24
|
+
const end_dt = end.toISOString().replace(/[A-Z].*/, '');
|
|
25
|
+
if (start_dt === end_dt) {
|
|
26
|
+
return `${start.toISOString().replace(/[A-Z]/, ' ').replace(/:[0-9]+\.[0-9]+[A-Z]/, '')} - ${end.toISOString().replace(/^.*?[A-Z]/, '').replace(/:[0-9]+\.[0-9]+[A-Z]/, '')}`;
|
|
27
|
+
} else {
|
|
28
|
+
return `${start.toISOString().replace(/[A-Z]/, ' ').replace(/:[0-9]+\.[0-9]+[A-Z]/, '')} - ${end.toISOString().replace(/[A-Z]/, ' ').replace(/:[0-9]+\.[0-9]+[A-Z]/, '')}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
package/lib.js
CHANGED
|
@@ -6,8 +6,14 @@ 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';
|
|
10
|
+
import TablerEpoch from './components/Epoch.vue';
|
|
11
|
+
import TablerEpochRange from './components/EpochRange.vue';
|
|
9
12
|
|
|
10
13
|
export {
|
|
14
|
+
TablerEpoch,
|
|
15
|
+
TablerEpochRange,
|
|
16
|
+
TablerBreadCrumb,
|
|
11
17
|
TablerError,
|
|
12
18
|
TablerSelect,
|
|
13
19
|
TablerLoading,
|