@tak-ps/vue-tabler 2.6.0 → 2.7.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,10 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v2.7.0
14
+
15
+ - :tada: Add Bytes Component
16
+
13
17
  ### v2.6.0
14
18
 
15
19
  - :tada: Add Epoch Component
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <span v-text='display'/>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'Bytes',
8
+ props: {
9
+ bytes: {
10
+ type: Number,
11
+ required: true
12
+ }
13
+ },
14
+ computed: {
15
+ display: function() {
16
+ const i = this.bytes == 0 ? 0 : Math.floor(Math.log(this.bytes) / Math.log(1024));
17
+ return (this.bytes / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
18
+ }
19
+ }
20
+ }
21
+ </script>
package/lib.js CHANGED
@@ -7,10 +7,12 @@ import TablerLoading from './components/Loading.vue'
7
7
  import TablerToggle from './components/Toggle.vue'
8
8
  import TablerInput from './components/Input.vue'
9
9
  import TablerBreadCrumb from './components/BreadCrumb.vue';
10
+ import TablerBytes from './components/Bytes.vue';
10
11
  import TablerEpoch from './components/Epoch.vue';
11
12
  import TablerEpochRange from './components/EpochRange.vue';
12
13
 
13
14
  export {
15
+ TablerBytes,
14
16
  TablerEpoch,
15
17
  TablerEpochRange,
16
18
  TablerBreadCrumb,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/vue-tabler",
3
3
  "type": "module",
4
- "version": "2.6.0",
4
+ "version": "2.7.0",
5
5
  "main": "lib.js",
6
6
  "module": "lib.js",
7
7
  "description": "Tabler UI components for Vue3",