classcard-ui 0.2.664 → 0.2.667
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 +73 -85
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +73 -85
- 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 +5 -5
- package/src/components/CMultiselect/CMultiselect.vue +16 -23
- package/src/components/CRadio/CRadio.vue +15 -29
- package/src/components/CSelect/CSelect.vue +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "classcard-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.667",
|
|
4
4
|
"main": "dist/classcard-ui.umd.min.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/core": "^7.15.5",
|
|
42
|
-
"@storybook/addon-actions": "^6.5.
|
|
43
|
-
"@storybook/addon-essentials": "^6.5.
|
|
44
|
-
"@storybook/addon-links": "^6.5.
|
|
45
|
-
"@storybook/vue": "^6.5.
|
|
42
|
+
"@storybook/addon-actions": "^6.5.10",
|
|
43
|
+
"@storybook/addon-essentials": "^6.5.10",
|
|
44
|
+
"@storybook/addon-links": "^6.5.10",
|
|
45
|
+
"@storybook/vue": "^6.5.10",
|
|
46
46
|
"@tailwindcss/postcss7-compat": "^2.2.14",
|
|
47
47
|
"@types/lodash-es": "^4.17.5",
|
|
48
48
|
"@vue/cli-plugin-babel": "^4.5.13",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div class="flex items-center">
|
|
4
|
-
<
|
|
5
|
-
label
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<div class="flex w-full items-center justify-between" v-if="label">
|
|
4
|
+
<div class="flex items-center">
|
|
5
|
+
<!-- label of multiselect field -->
|
|
6
|
+
<label v-if="label" class="text-sm font-medium text-gray-900">{{ label }}</label>
|
|
7
|
+
<!-- asterisk sign to render if field is required -->
|
|
8
|
+
<p v-if="isRequired" class="ml-1 text-red-600">*</p>
|
|
9
|
+
</div>
|
|
10
|
+
<span v-if="hint" class="text-sm text-gray-500">{{ hint }}</span>
|
|
9
11
|
</div>
|
|
10
12
|
<v-select
|
|
11
13
|
class="disabled-opacity-50 disabled-pointer-events-none disabled-cursor-default mt-1 text-sm"
|
|
@@ -44,9 +46,7 @@
|
|
|
44
46
|
</template>
|
|
45
47
|
<!-- eslint-disable-next-line vue/no-unused-vars -->
|
|
46
48
|
<template #no-options="{ search, searching, loading }">
|
|
47
|
-
<span v-if="search.length < 1"
|
|
48
|
-
>Start typing to search for options...</span
|
|
49
|
-
>
|
|
49
|
+
<span v-if="search.length < 1">Start typing to search for options...</span>
|
|
50
50
|
<span v-else>No options found, try searching something else.</span>
|
|
51
51
|
</template>
|
|
52
52
|
<template #spinner="{ loading }">
|
|
@@ -76,11 +76,7 @@
|
|
|
76
76
|
<slot name="custom-option" v-bind:option="option"></slot>
|
|
77
77
|
</template>
|
|
78
78
|
<template v-if="showOptionImage" v-slot:option="option">
|
|
79
|
-
<div
|
|
80
|
-
:class="`flex w-full ${
|
|
81
|
-
option.description ? 'items-start' : 'items-center'
|
|
82
|
-
}`"
|
|
83
|
-
>
|
|
79
|
+
<div :class="`flex w-full ${option.description ? 'items-start' : 'items-center'}`">
|
|
84
80
|
<c-avatar
|
|
85
81
|
v-if="option.image"
|
|
86
82
|
size="extraextrasmall"
|
|
@@ -106,9 +102,7 @@
|
|
|
106
102
|
</div>
|
|
107
103
|
</template>
|
|
108
104
|
<template #list-footer>
|
|
109
|
-
<li ref="load" class="loader" v-show="hasNextPage">
|
|
110
|
-
Loading more options...
|
|
111
|
-
</li>
|
|
105
|
+
<li ref="load" class="loader" v-show="hasNextPage">Loading more options...</li>
|
|
112
106
|
<li
|
|
113
107
|
v-if="showFooterButton"
|
|
114
108
|
class="group sticky bottom-0 mt-1 cursor-pointer select-none bg-gray-50 py-2 pl-3 pr-9 text-gray-700 hover:bg-gray-100 hover:text-gray-900"
|
|
@@ -235,15 +229,14 @@ export default {
|
|
|
235
229
|
type: Boolean,
|
|
236
230
|
default: false,
|
|
237
231
|
},
|
|
232
|
+
// text adjacent to label of dropdown to provide hint about field
|
|
233
|
+
hint: { type: String },
|
|
238
234
|
},
|
|
239
235
|
computed: {},
|
|
240
236
|
data() {
|
|
241
237
|
return {
|
|
242
238
|
loaderSearching: true,
|
|
243
|
-
value:
|
|
244
|
-
this.optionsSelected && this.optionsSelected.length
|
|
245
|
-
? this.optionsSelected
|
|
246
|
-
: [],
|
|
239
|
+
value: this.optionsSelected && this.optionsSelected.length ? this.optionsSelected : [],
|
|
247
240
|
observer: null,
|
|
248
241
|
};
|
|
249
242
|
},
|
|
@@ -298,7 +291,7 @@ export default {
|
|
|
298
291
|
@apply cursor-pointer;
|
|
299
292
|
}
|
|
300
293
|
.vs__dropdown-toggle {
|
|
301
|
-
@apply w-full rounded-md border border-gray-300 bg-white pl-3 text-left shadow-sm focus:border-indigo-500 focus:
|
|
294
|
+
@apply focus:outline-none w-full rounded-md border border-gray-300 bg-white pl-3 text-left shadow-sm focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 sm:text-sm;
|
|
302
295
|
padding-top: 0.4rem;
|
|
303
296
|
padding-bottom: 0.4rem;
|
|
304
297
|
}
|
|
@@ -326,7 +319,7 @@ export default {
|
|
|
326
319
|
@apply pt-0 pr-3;
|
|
327
320
|
}
|
|
328
321
|
.vs__dropdown-menu {
|
|
329
|
-
@apply mt-2 max-h-60 overflow-auto rounded-md bg-white py-0 text-base shadow-lg ring-1 ring-opacity-5
|
|
322
|
+
@apply focus:outline-none mt-2 max-h-60 overflow-auto rounded-md bg-white py-0 text-base shadow-lg ring-1 ring-opacity-5 sm:text-sm;
|
|
330
323
|
}
|
|
331
324
|
.vs__dropdown-option {
|
|
332
325
|
@apply py-2;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div class="-space-y-px rounded-md bg-white">
|
|
3
|
+
<div class="-space-y-px rounded-md bg-white" :class="customWrapperClasses">
|
|
4
4
|
<div
|
|
5
5
|
v-for="(item, index) in items"
|
|
6
6
|
class="relative pb-4 first:rounded-t-md last:rounded-b-md"
|
|
@@ -17,26 +17,17 @@
|
|
|
17
17
|
class="mt-0.5 h-4 w-4 cursor-pointer border-gray-300 text-indigo-600 focus:ring-indigo-500 disabled:opacity-50"
|
|
18
18
|
:disabled="isDisabled"
|
|
19
19
|
/>
|
|
20
|
-
<label
|
|
21
|
-
class="ml-3 flex cursor-pointer flex-col"
|
|
22
|
-
@click="onChange(item.value)"
|
|
23
|
-
>
|
|
20
|
+
<label class="ml-3 flex cursor-pointer flex-col" @click="onChange(item.value)">
|
|
24
21
|
<span
|
|
25
22
|
class="block text-sm font-medium text-gray-900"
|
|
26
|
-
:class="
|
|
27
|
-
customClasses && item.value === selectedItem
|
|
28
|
-
? 'text-indigo-900'
|
|
29
|
-
: ''
|
|
30
|
-
"
|
|
23
|
+
:class="customClasses && item.value === selectedItem ? 'text-indigo-900' : ''"
|
|
31
24
|
>
|
|
32
25
|
{{ item[labelName] }}
|
|
33
26
|
</span>
|
|
34
27
|
<span
|
|
35
28
|
class="block text-sm"
|
|
36
29
|
:class="
|
|
37
|
-
customClasses && item.value === selectedItem
|
|
38
|
-
? 'text-indigo-700'
|
|
39
|
-
: 'text-gray-500'
|
|
30
|
+
customClasses && item.value === selectedItem ? 'text-indigo-700' : 'text-gray-500'
|
|
40
31
|
"
|
|
41
32
|
>
|
|
42
33
|
{{ item.description }}
|
|
@@ -67,14 +58,17 @@ export default {
|
|
|
67
58
|
type: Boolean,
|
|
68
59
|
default: false,
|
|
69
60
|
},
|
|
61
|
+
customWrapperClasses: {
|
|
62
|
+
type: String,
|
|
63
|
+
},
|
|
70
64
|
name: {
|
|
71
65
|
type: String,
|
|
72
66
|
required: true,
|
|
73
67
|
},
|
|
74
|
-
labelName:{
|
|
75
|
-
type:String,
|
|
76
|
-
default:
|
|
77
|
-
}
|
|
68
|
+
labelName: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "label",
|
|
71
|
+
},
|
|
78
72
|
},
|
|
79
73
|
data() {
|
|
80
74
|
return {
|
|
@@ -91,18 +85,10 @@ export default {
|
|
|
91
85
|
classes(item, index) {
|
|
92
86
|
let classForRadio = "";
|
|
93
87
|
if (item.value === this.selectedItem && index === 0) {
|
|
94
|
-
classForRadio =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
index === this.items.length - 1
|
|
99
|
-
) {
|
|
100
|
-
classForRadio =
|
|
101
|
-
"border p-4 border-indigo-200 rounded-b-md bg-indigo-50";
|
|
102
|
-
} else if (
|
|
103
|
-
item.value === this.selectedItem &&
|
|
104
|
-
0 < index < this.items.length - 1
|
|
105
|
-
) {
|
|
88
|
+
classForRadio = "border p-4 border-indigo-200 rounded-t-md bg-indigo-50";
|
|
89
|
+
} else if (item.value === this.selectedItem && index === this.items.length - 1) {
|
|
90
|
+
classForRadio = "border p-4 border-indigo-200 rounded-b-md bg-indigo-50";
|
|
91
|
+
} else if (item.value === this.selectedItem && 0 < index < this.items.length - 1) {
|
|
106
92
|
classForRadio = "border p-4 border-indigo-200 bg-indigo-50";
|
|
107
93
|
} else {
|
|
108
94
|
classForRadio = "border p-4 border-gray-200";
|