classcard-ui 0.2.300 → 0.2.301
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/dist/classcard-ui.common.js +10 -6
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +10 -6
- package/dist/classcard-ui.umd.js.map +1 -1
- package/dist/classcard-ui.umd.min.js +1 -1
- package/dist/classcard-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CSelect/CSelect.vue +20 -16
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div class="flex justify-between
|
|
3
|
+
<div class="flex w-full justify-between" v-if="label">
|
|
4
4
|
<div class="flex items-center">
|
|
5
5
|
<!-- label of select field -->
|
|
6
6
|
<label class="block text-sm font-medium text-gray-900">
|
|
7
7
|
{{ label }}
|
|
8
8
|
</label>
|
|
9
9
|
<!-- asterisk sign to render if field is required -->
|
|
10
|
-
<p v-if="isRequired" class="text-red-600
|
|
10
|
+
<p v-if="isRequired" class="ml-1 text-red-600">*</p>
|
|
11
11
|
</div>
|
|
12
12
|
<span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
|
|
13
13
|
</div>
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
aria-expanded="true"
|
|
25
25
|
aria-labelledby="listbox-label"
|
|
26
26
|
:class="classes"
|
|
27
|
-
class="relative w-full rounded-md pl-3 pr-10
|
|
27
|
+
class="focus:outline-none relative w-full cursor-pointer rounded-md py-2 pl-3 pr-10 text-left disabled:opacity-50 sm:text-sm"
|
|
28
28
|
:disabled="isDisabled"
|
|
29
29
|
/>
|
|
30
30
|
|
|
31
|
-
<div class="absolute top-2 left-3 flex
|
|
32
|
-
<span class="flex items-center">
|
|
31
|
+
<div class="pointer-events-none absolute top-2 left-3 flex">
|
|
32
|
+
<span class="flex items-center" :style="selectedOptionStyles">
|
|
33
33
|
<c-avatar
|
|
34
34
|
v-if="showImage && !selectSearch"
|
|
35
35
|
size="extraextrasmall"
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
</span>
|
|
55
55
|
</span>
|
|
56
56
|
</div>
|
|
57
|
-
<div class="absolute top-2.5 right-3 flex
|
|
57
|
+
<div class="pointer-events-none absolute top-2.5 right-3 flex">
|
|
58
58
|
<div
|
|
59
59
|
v-if="type == 'tertiary' ? showFocus : true"
|
|
60
|
-
class="right-0 flex items-center
|
|
60
|
+
class="pointer-events-none right-0 flex items-center"
|
|
61
61
|
>
|
|
62
62
|
<c-icon name="selector" type="solid" class="h-5 w-5"></c-icon>
|
|
63
63
|
</div>
|
|
@@ -72,22 +72,22 @@
|
|
|
72
72
|
>
|
|
73
73
|
<div
|
|
74
74
|
v-if="toggleDropdown && !isDisabled"
|
|
75
|
-
class="absolute mt-1 rounded-md bg-white shadow-lg
|
|
75
|
+
class="absolute z-10 mt-1 w-full rounded-md bg-white shadow-lg"
|
|
76
76
|
>
|
|
77
77
|
<ul
|
|
78
78
|
tabindex="-1"
|
|
79
79
|
role="listbox"
|
|
80
80
|
aria-labelledby="listbox-label"
|
|
81
|
-
class="max-h-60 rounded-md py-1 text-base ring-1 ring-gray-900 ring-opacity-5
|
|
81
|
+
class="focus:outline-none max-h-60 overflow-auto rounded-md py-1 text-base ring-1 ring-gray-900 ring-opacity-5 sm:text-sm"
|
|
82
82
|
>
|
|
83
83
|
<li
|
|
84
84
|
v-if="addAction"
|
|
85
85
|
@mousedown="actionEvent($event)"
|
|
86
|
-
class="flex
|
|
86
|
+
class="relative flex cursor-pointer select-none py-2 pl-3 pr-9 text-indigo-500 hover:bg-indigo-100 hover:text-indigo-700"
|
|
87
87
|
>
|
|
88
88
|
<c-icon
|
|
89
89
|
type="outline"
|
|
90
|
-
class="h-5 w-5
|
|
90
|
+
class="mr-1 h-5 w-5 text-indigo-400 group-hover:text-indigo-500"
|
|
91
91
|
name="plus"
|
|
92
92
|
></c-icon>
|
|
93
93
|
{{ addAction.label }}
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
id="listbox-option-0"
|
|
99
99
|
role="option"
|
|
100
100
|
@mousedown="handleSelect($event, option)"
|
|
101
|
-
class="
|
|
102
|
-
:class="option.isDisabled ? '
|
|
101
|
+
class="relative cursor-pointer select-none py-2 pl-3 pr-9 text-gray-900 hover:bg-indigo-700 hover:text-white"
|
|
102
|
+
:class="option.isDisabled ? 'pointer-events-none opacity-50' : ''"
|
|
103
103
|
>
|
|
104
104
|
<span class="flex items-center">
|
|
105
105
|
<c-avatar
|
|
@@ -110,12 +110,12 @@
|
|
|
110
110
|
></c-avatar>
|
|
111
111
|
<span
|
|
112
112
|
:class="showImage && option.image ? 'ml-3' : ''"
|
|
113
|
-
class="
|
|
113
|
+
class="list-options block break-words font-normal"
|
|
114
114
|
>{{ option[renderOptionName] }}
|
|
115
115
|
</span>
|
|
116
116
|
</span>
|
|
117
117
|
|
|
118
|
-
<span class="
|
|
118
|
+
<span class="absolute inset-y-0 right-0 flex items-center pr-4 text-indigo-600">
|
|
119
119
|
<c-icon
|
|
120
120
|
id="list-icon"
|
|
121
121
|
v-show="showSelectedValue"
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
</div>
|
|
130
130
|
</transition>
|
|
131
131
|
<!-- validation error message -->
|
|
132
|
-
<p v-if="!isValidate" class="mt-2 text-
|
|
132
|
+
<p v-if="!isValidate" class="mt-2 text-left text-sm text-red-600">
|
|
133
133
|
{{ errorMessage }}
|
|
134
134
|
</p>
|
|
135
135
|
<p v-if="helpText" class="mt-2 text-sm text-gray-500">
|
|
@@ -173,6 +173,10 @@ export default {
|
|
|
173
173
|
},
|
|
174
174
|
// validation is passed or not
|
|
175
175
|
isValidate: { type: Boolean },
|
|
176
|
+
// will truncate the text in input field
|
|
177
|
+
selectedOptionStyles: {
|
|
178
|
+
type: String,
|
|
179
|
+
},
|
|
176
180
|
// validation error message
|
|
177
181
|
errorMessage: {
|
|
178
182
|
type: String,
|