classcard-ui 0.2.411 → 0.2.414

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "classcard-ui",
3
- "version": "0.2.411",
3
+ "version": "0.2.414",
4
4
  "main": "dist/classcard-ui.common.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -29,11 +29,34 @@
29
29
  <c-icon
30
30
  name="arrow-up"
31
31
  type="solid"
32
- class="mx-1 h-5 w-5 text-indigo-600"
32
+ class="mr-1 h-5 w-5 flex-none text-indigo-600"
33
33
  viewBox="0 0 20 20"
34
34
  ></c-icon>
35
35
  <span class="text-sm font-medium text-indigo-900"> Upload </span>
36
36
  </button>
37
+ <div
38
+ class="relative hidden h-full w-full overflow-hidden rounded-full lg:block"
39
+ @click="initFilestack()"
40
+ v-if="displayMode == 'overlay' && !icon && isAvatar"
41
+ >
42
+ <img
43
+ v-if="imageUrl"
44
+ class="relative h-full w-full rounded-full object-cover"
45
+ :src="imageUrl"
46
+ />
47
+ <c-avatar
48
+ v-else
49
+ size="very large"
50
+ :nameInitials="shortName"
51
+ :rounded="true"
52
+ ></c-avatar>
53
+ <label
54
+ class="absolute inset-0 flex h-full w-full cursor-pointer items-center justify-center bg-gray-900 bg-opacity-75 text-sm font-medium text-white opacity-0 focus-within:opacity-100 hover:opacity-100"
55
+ >
56
+ <span>Change</span>
57
+ <span class="sr-only"> user photo</span>
58
+ </label>
59
+ </div>
37
60
  <div :class="filestackClasses" id="filestack-uploader"></div>
38
61
  <p v-if="!isValidate" class="mt-2 text-sm text-red-600">
39
62
  {{ errorMessage }}
@@ -44,17 +67,30 @@
44
67
  <script>
45
68
  import * as filestack from "filestack-js";
46
69
  import CIcon from "../CIcon/CIcon.vue";
70
+ import CAvatar from "../CAvatar/CAvatar.vue";
47
71
 
48
72
  export default {
49
73
  name: "CUpload",
50
74
  components: {
51
75
  CIcon,
76
+ CAvatar,
52
77
  },
53
78
  props: {
54
79
  buttonText: {
55
80
  type: String,
56
81
  default: "Upload",
57
82
  },
83
+ isAvatar: {
84
+ type: Boolean,
85
+ default: false,
86
+ },
87
+ shortName: {
88
+ type: String,
89
+ },
90
+ imageUrl: {
91
+ type: String,
92
+ default: "",
93
+ },
58
94
  icon: {
59
95
  type: Object,
60
96
  },
@@ -106,6 +142,10 @@ export default {
106
142
  type: Boolean,
107
143
  default: false,
108
144
  },
145
+ isCircle: {
146
+ type: Boolean,
147
+ default: false,
148
+ },
109
149
  },
110
150
  data() {
111
151
  return {};
@@ -127,6 +167,7 @@ export default {
127
167
  aspectRatio: this.aspectRatio ? this.aspectRatio : 1 / 1,
128
168
  force: this.aspectRatio ? true : false,
129
169
  },
170
+ circle: this.isCircle,
130
171
  },
131
172
  };
132
173
  const picker = client.picker(options);