@veritree/ui 0.25.0 → 0.27.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/index.js CHANGED
@@ -64,6 +64,8 @@ import VTDisclosureDetails from "./src/components/Disclosure/VTDisclosureDetails
64
64
  import VTDisclosureHeader from "./src/components/Disclosure/VTDisclosureHeader.vue";
65
65
  import VTDisclosureIcon from "./src/components/Disclosure/VTDisclosureIcon.vue";
66
66
  import VTDisclosureContent from "./src/components/Disclosure/VTDisclosureContent.vue";
67
+ import VTSkeleton from "./src/components/Skeleton/VTSkeleton.vue";
68
+ import VTSkeletonItem from "./src/components/Skeleton/VTSkeletonItem.vue";
67
69
 
68
70
  export {
69
71
  VTAvatar,
@@ -132,4 +134,6 @@ export {
132
134
  VTDisclosureHeader,
133
135
  VTDisclosureIcon,
134
136
  VTDisclosureContent,
137
+ VTSkeleton,
138
+ VTSkeletonItem
135
139
  };
package/nuxt.js CHANGED
@@ -13,6 +13,7 @@ const components = [
13
13
  'src/components/Image',
14
14
  'src/components/Popover',
15
15
  'src/components/ProgressBar',
16
+ 'src/components/Skeleton',
16
17
  'src/components/Spinner',
17
18
  'src/components/Tabs',
18
19
  'src/components/Tooltip',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/ui",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,7 +1,14 @@
1
1
  <template>
2
2
  <img
3
3
  :src="srcComputed"
4
- :class="{ 'animate-pulse': !isLoaded }"
4
+ :class="[
5
+ headless ? null : isLoaded ? null : 'animate-pulse',
6
+ headless
7
+ ? null
8
+ : hasObjectFit
9
+ ? `h-full w-full ${objectFitComputed}`
10
+ : null,
11
+ ]"
5
12
  v-bind="$attrs"
6
13
  @load="onLoad"
7
14
  @error="onError"
@@ -15,18 +22,26 @@ export default {
15
22
  name: 'VTImage',
16
23
 
17
24
  props: {
18
- src: {
19
- type: String,
20
- default: '',
25
+ headless: {
26
+ type: Boolean,
27
+ default: false,
21
28
  },
22
29
  cdnSrc: {
23
30
  type: [String, Object],
24
31
  default: null,
25
32
  },
33
+ objectFit: {
34
+ type: String,
35
+ default: null,
36
+ },
26
37
  placeholder: {
27
38
  type: String,
28
39
  default: `data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22600%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20%25%7Bw%7D%20%25%7Bh%7D%22%20preserveAspectRatio%3D%22none%22%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20style%3D%22fill%3A%23bbb%3B%22%3E%3C%2Frect%3E%3C%2Fsvg%3E`,
29
40
  },
41
+ src: {
42
+ type: String,
43
+ default: '',
44
+ },
30
45
  },
31
46
 
32
47
  data() {
@@ -56,6 +71,20 @@ export default {
56
71
 
57
72
  return null;
58
73
  },
74
+
75
+ hasObjectFit() {
76
+ return this.objectFit;
77
+ },
78
+
79
+ objectFitComputed() {
80
+ return this.hasObjectFit
81
+ ? this.objectFit === 'cover'
82
+ ? 'object-cover'
83
+ : this.objectFit === 'contain'
84
+ ? 'object-contain'
85
+ : null
86
+ : null;
87
+ },
59
88
  },
60
89
 
61
90
  methods: {
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class="animate-pulse">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: 'VTSkeleton',
10
+ };
11
+ </script>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div class="bg-gray-300" />
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'VTSkeletonItem',
8
+ };
9
+ </script>