classcard-ui 0.2.646 → 0.2.649

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.646",
3
+ "version": "0.2.649",
4
4
  "main": "dist/classcard-ui.umd.min.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -12,13 +12,13 @@
12
12
  </div>
13
13
  <div
14
14
  v-else
15
- :class="`flex-none ${nameInitialsClasses} border-${
16
- isDynamicallyColored ? customColor : 'red'
17
- }-300 bg-${
18
- isDynamicallyColored ? customColor : 'red'
19
- }-100 text-center font-medium text-${
20
- isDynamicallyColored ? customColor : 'red'
21
- }-600`"
15
+ :class="[
16
+ 'flex-none text-center font-medium',
17
+ nameInitialsClasses,
18
+ `border-${isDynamicallyColored ? customColor : 'red'}-300`,
19
+ `bg-${isDynamicallyColored ? customColor : 'red'}-100`,
20
+ `text-${isDynamicallyColored ? customColor : 'red'}-600`,
21
+ ]"
22
22
  :style="[
23
23
  size == 'medium' ? { 'line-height': '3rem' } : '',
24
24
  size == 'large' ? { 'line-height': '3.5rem' } : '',
@@ -12,68 +12,72 @@
12
12
  <span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
13
13
  </div>
14
14
 
15
- <div class="relative" :class="label ? 'mt-1' : ''">
16
- <input
17
- type="text"
18
- v-model="selectSearch"
19
- @click="toggleDropdown = !toggleDropdown"
20
- @focus="type == 'tertiary' ? (showFocus = true) : ''"
21
- @blur="close()"
22
- @keyup="search()"
23
- aria-haspopup="listbox"
24
- aria-expanded="true"
25
- aria-labelledby="listbox-label"
26
- :class="{ ...classes, [inputClasses]: true }"
27
- class="relative w-full cursor-pointer rounded-md py-2 pl-3 pr-10 text-left text-sm focus:outline-none disabled:opacity-50 sm:text-sm"
28
- :disabled="isDisabled"
29
- autocomplete="off"
30
- />
15
+ <div class="relative">
16
+ <div class="relative truncate" :class="label ? 'mt-1' : ''">
17
+ <input
18
+ type="text"
19
+ v-model="selectSearch"
20
+ @click="toggleDropdown = !toggleDropdown"
21
+ @focus="type == 'tertiary' ? (showFocus = true) : ''"
22
+ @blur="close()"
23
+ @keyup="search()"
24
+ aria-haspopup="listbox"
25
+ aria-expanded="true"
26
+ aria-labelledby="listbox-label"
27
+ :class="{ ...classes, [inputClasses]: true }"
28
+ class="relative w-full cursor-pointer rounded-md py-2 pl-3 pr-10 text-left text-sm focus:outline-none disabled:opacity-50 sm:text-sm"
29
+ :disabled="isDisabled"
30
+ autocomplete="off"
31
+ />
31
32
 
32
- <div class="pointer-events-none absolute top-[7px] left-3 flex">
33
- <span class="flex items-center" :style="selectedOptionStyles">
34
- <div v-if="showImage && !selectSearch && value">
35
- <c-avatar
36
- v-if="value.photo"
37
- size="extraextrasmall"
38
- :image="value.photo"
39
- :rounded="true"
40
- ></c-avatar>
41
- <c-avatar
42
- v-else
43
- size="extraextrasmall"
44
- :nameInitials="value.initials"
45
- :rounded="true"
46
- :isDynamicallyColored="coloredAvatars"
47
- ></c-avatar>
48
- </div>
49
- <c-icon
50
- v-if="icon && !showImage"
51
- :class="icon.class"
52
- :name="icon.name"
53
- :type="icon.type"
54
- >
55
- </c-icon>
56
- <span :class="showImage ? 'ml-3' : ''" class="block truncate text-sm">
57
- {{
58
- selectedValue
59
- ? selectedValue
60
- : !selectSearch || selectSearch == ""
61
- ? placeholder
62
- : null
63
- }}
64
- </span>
65
- </span>
66
- </div>
67
- <div class="pointer-events-none absolute top-2 right-3 flex">
68
33
  <div
69
- v-if="type == 'tertiary' ? showFocus : true"
70
- class="pointer-events-none right-0 flex items-center"
34
+ class="pointer-events-none absolute inset-0 left-3 flex h-[38px] items-center overflow-hidden pr-10"
71
35
  >
72
- <c-icon
73
- name="selector"
74
- type="solid"
75
- class="h-5 w-5 text-gray-400"
76
- ></c-icon>
36
+ <div class="flex items-center truncate" :style="selectedOptionStyles">
37
+ <div v-if="showImage && !selectSearch && value">
38
+ <c-avatar
39
+ v-if="value.photo"
40
+ size="extraextrasmall"
41
+ :image="value.photo"
42
+ :rounded="true"
43
+ ></c-avatar>
44
+ <c-avatar
45
+ v-else
46
+ size="extraextrasmall"
47
+ :nameInitials="value.initials"
48
+ :rounded="true"
49
+ :isDynamicallyColored="coloredAvatars"
50
+ ></c-avatar>
51
+ </div>
52
+ <c-icon
53
+ v-if="icon && !showImage"
54
+ :class="icon.class"
55
+ :name="icon.name"
56
+ :type="icon.type"
57
+ >
58
+ </c-icon>
59
+ <p :class="showImage ? 'ml-3' : ''" class="block truncate text-sm">
60
+ {{
61
+ selectedValue
62
+ ? selectedValue
63
+ : !selectSearch || selectSearch == ""
64
+ ? placeholder
65
+ : null
66
+ }}
67
+ </p>
68
+ </div>
69
+ </div>
70
+ <div class="pointer-events-none absolute top-2 right-3 flex">
71
+ <div
72
+ v-if="type == 'tertiary' ? showFocus : true"
73
+ class="pointer-events-none right-0 flex items-center"
74
+ >
75
+ <c-icon
76
+ name="selector"
77
+ type="solid"
78
+ class="h-5 w-5 text-gray-400"
79
+ ></c-icon>
80
+ </div>
77
81
  </div>
78
82
  </div>
79
83
  <transition
@@ -8,7 +8,7 @@
8
8
  </div>
9
9
  <button
10
10
  type="button"
11
- class="focus:outline-none inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
11
+ class="inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
12
12
  @click="initFilestack()"
13
13
  v-if="displayMode == 'overlay' && icon"
14
14
  >
@@ -22,7 +22,7 @@
22
22
  </button>
23
23
  <button
24
24
  type="button"
25
- class="focus:outline-none mt-1.5 flex h-full w-auto items-center justify-center rounded-lg border-2 border-dashed border-gray-300 px-9 py-14 text-center hover:border-gray-400"
25
+ class="mt-1.5 flex h-full w-auto items-center justify-center rounded-lg border-2 border-dashed border-gray-300 px-9 py-14 text-center hover:border-gray-400 focus:outline-none"
26
26
  @click="initFilestack()"
27
27
  v-if="displayMode == 'overlay' && !icon && !isAvatar"
28
28
  >
@@ -44,7 +44,13 @@
44
44
  class="relative h-full w-full rounded-full object-cover"
45
45
  :src="imageUrl"
46
46
  />
47
- <c-avatar v-else size="very large" :nameInitials="shortName" :rounded="true"></c-avatar>
47
+ <c-avatar
48
+ v-else
49
+ size="very large"
50
+ :nameInitials="shortName"
51
+ :isDynamicallyColored="coloredAvatars"
52
+ :rounded="true"
53
+ ></c-avatar>
48
54
  <label
49
55
  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"
50
56
  >
@@ -161,9 +167,13 @@ export default {
161
167
  type: Boolean,
162
168
  default: false,
163
169
  },
170
+ coloredAvatars: {
171
+ type: Boolean,
172
+ default: false,
173
+ },
164
174
  uploadSources: {
165
175
  type: Array,
166
- default:() => ["local_file_system", "unsplash"],
176
+ default: () => ["local_file_system", "unsplash"],
167
177
  },
168
178
  },
169
179
  data() {