classcard-ui 0.2.297 → 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 +67 -112
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +67 -112
- 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 +3 -1
- package/src/components/CSelect/CSelect.vue +20 -16
- package/src/components/CTable/CTable.vue +15 -70
- package/src/icons.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "classcard-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.301",
|
|
4
4
|
"main": "dist/classcard-ui.common.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
"eslint": "^6.7.2",
|
|
54
54
|
"eslint-plugin-vue": "^6.2.2",
|
|
55
55
|
"postcss": "^7.0.36",
|
|
56
|
+
"prettier": "^2.5.1",
|
|
57
|
+
"prettier-plugin-tailwindcss": "^0.1.6",
|
|
56
58
|
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.14",
|
|
57
59
|
"vue-template-compiler": "^2.6.14"
|
|
58
60
|
},
|
|
@@ -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,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div
|
|
4
|
-
slot="table-actions"
|
|
5
|
-
v-if="tableActions"
|
|
6
|
-
class="bg-gray-50 rounded-lg p-3 mb-4"
|
|
7
|
-
>
|
|
3
|
+
<div slot="table-actions" v-if="tableActions" class="mb-4 rounded-lg bg-gray-50 p-3">
|
|
8
4
|
<div class="flex justify-between">
|
|
9
5
|
<div v-if="searching">
|
|
10
6
|
<c-input
|
|
@@ -22,55 +18,22 @@
|
|
|
22
18
|
<div>
|
|
23
19
|
<button
|
|
24
20
|
@click="handleToggle"
|
|
25
|
-
class="
|
|
26
|
-
inline-flex
|
|
27
|
-
justify-center
|
|
28
|
-
w-full
|
|
29
|
-
rounded-md
|
|
30
|
-
border border-gray-200
|
|
31
|
-
shadow-sm
|
|
32
|
-
px-2
|
|
33
|
-
py-2
|
|
34
|
-
bg-white
|
|
35
|
-
text-sm
|
|
36
|
-
font-medium
|
|
37
|
-
hover:bg-gray-50
|
|
38
|
-
focus:outline-none focus:outline-none
|
|
39
|
-
focus:ring-2 focus:ring-offset-2 focus:ring-indigo-600
|
|
40
|
-
"
|
|
21
|
+
class="focus:outline-none inline-flex w-full justify-center rounded-md border border-gray-200 bg-white px-2 py-2 text-sm font-medium shadow-sm hover:bg-gray-50 focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2"
|
|
41
22
|
aria-haspopup="true"
|
|
42
23
|
aria-expanded="true"
|
|
43
24
|
>
|
|
44
|
-
<c-icon
|
|
45
|
-
name="view-board"
|
|
46
|
-
type="solid"
|
|
47
|
-
class="text-gray-400 h-5 w-5"
|
|
48
|
-
></c-icon>
|
|
25
|
+
<c-icon name="view-board" type="solid" class="h-5 w-5 text-gray-400"></c-icon>
|
|
49
26
|
<c-icon
|
|
50
27
|
name="chevron-down"
|
|
51
28
|
type="solid"
|
|
52
|
-
class="ml-1
|
|
29
|
+
class="ml-1 h-5 w-5 text-gray-400"
|
|
53
30
|
></c-icon>
|
|
54
31
|
</button>
|
|
55
32
|
</div>
|
|
56
33
|
<!-- dropdown having list of all columns to show hide -->
|
|
57
34
|
<div
|
|
58
35
|
v-if="toggleDropdown"
|
|
59
|
-
class="
|
|
60
|
-
origin-top-right
|
|
61
|
-
absolute
|
|
62
|
-
right-0
|
|
63
|
-
mt-2
|
|
64
|
-
-mr-1
|
|
65
|
-
w-56
|
|
66
|
-
rounded-md
|
|
67
|
-
shadow-lg
|
|
68
|
-
bg-white
|
|
69
|
-
ring-1 ring-gray-900 ring-opacity-5
|
|
70
|
-
z-100
|
|
71
|
-
overflow-y-auto
|
|
72
|
-
max-h-96
|
|
73
|
-
"
|
|
36
|
+
class="absolute right-0 z-10 mt-2 -mr-1 max-h-96 w-56 origin-top-right overflow-y-auto rounded-md bg-white shadow-lg ring-1 ring-gray-900 ring-opacity-5"
|
|
74
37
|
tabindex="0"
|
|
75
38
|
@blur="handleToggle"
|
|
76
39
|
>
|
|
@@ -84,15 +47,7 @@
|
|
|
84
47
|
href="#"
|
|
85
48
|
v-for="column in showHideColumnList"
|
|
86
49
|
v-bind:key="column.field"
|
|
87
|
-
class="
|
|
88
|
-
flex
|
|
89
|
-
block
|
|
90
|
-
px-4
|
|
91
|
-
py-2
|
|
92
|
-
text-sm text-gray-700
|
|
93
|
-
hover:bg-gray-100
|
|
94
|
-
hover:text-gray-900
|
|
95
|
-
"
|
|
50
|
+
class="block flex px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
|
|
96
51
|
role="menuitem"
|
|
97
52
|
>
|
|
98
53
|
<c-checkbox
|
|
@@ -121,12 +76,10 @@
|
|
|
121
76
|
</div>
|
|
122
77
|
|
|
123
78
|
<vue-good-table
|
|
124
|
-
class="
|
|
79
|
+
class="overflow-hidden rounded-lg border-2 border-solid border-gray-100"
|
|
125
80
|
mode="remote"
|
|
126
81
|
ref="my-table"
|
|
127
|
-
:styleClass="
|
|
128
|
-
showLoader ? 'vgt-table opacity-50 pointer-events-none' : 'vgt-table'
|
|
129
|
-
"
|
|
82
|
+
:styleClass="showLoader ? 'vgt-table opacity-50 pointer-events-none' : 'vgt-table'"
|
|
130
83
|
row-style-class="focus:outline-none"
|
|
131
84
|
min-height="400px"
|
|
132
85
|
:globalSearch="true"
|
|
@@ -170,21 +123,21 @@
|
|
|
170
123
|
<c-icon
|
|
171
124
|
v-if="props.column.direction == null"
|
|
172
125
|
name="sort-ascending-solid"
|
|
173
|
-
class="h-5 w-5
|
|
126
|
+
class="sortingIcon invisible ml-3 h-5 w-5"
|
|
174
127
|
type="solid"
|
|
175
128
|
></c-icon>
|
|
176
129
|
<!-- renders when direction is asc -->
|
|
177
130
|
<c-icon
|
|
178
131
|
v-else-if="props.column.direction == 'asc'"
|
|
179
132
|
name="sort-ascending-solid"
|
|
180
|
-
class="h-5 w-5
|
|
133
|
+
class="ml-3 h-5 w-5"
|
|
181
134
|
type="solid"
|
|
182
135
|
></c-icon>
|
|
183
136
|
<!-- renders when direction is desc -->
|
|
184
137
|
<c-icon
|
|
185
138
|
v-else-if="props.column.direction == 'desc'"
|
|
186
139
|
name="sort-descending-solid"
|
|
187
|
-
class="h-5 w-5
|
|
140
|
+
class="ml-3 h-5 w-5"
|
|
188
141
|
type="solid"
|
|
189
142
|
></c-icon>
|
|
190
143
|
</span>
|
|
@@ -195,11 +148,7 @@
|
|
|
195
148
|
<template slot="table-row" slot-scope="props">
|
|
196
149
|
<!-- renders if drag and drop is present in table -->
|
|
197
150
|
<span v-if="props.column.field == 'drag'">
|
|
198
|
-
<c-icon
|
|
199
|
-
name="menu-solid"
|
|
200
|
-
type="solid"
|
|
201
|
-
class="h-5 w-5 text-gray-500 handle"
|
|
202
|
-
></c-icon>
|
|
151
|
+
<c-icon name="menu-solid" type="solid" class="handle h-5 w-5 text-gray-500"></c-icon>
|
|
203
152
|
</span>
|
|
204
153
|
<!-- if customization or adding another form element is required -->
|
|
205
154
|
<span v-else-if="props.column.customizeColumn">
|
|
@@ -223,7 +172,7 @@
|
|
|
223
172
|
<!-- Custom loader for table -->
|
|
224
173
|
<template slot="loadingContent">
|
|
225
174
|
<svg
|
|
226
|
-
class="
|
|
175
|
+
class="ml-auto mr-auto h-7 w-7 animate-spin text-white"
|
|
227
176
|
xmlns="http://www.w3.org/2000/svg"
|
|
228
177
|
fill="none"
|
|
229
178
|
viewBox="0 0 24 24"
|
|
@@ -376,12 +325,8 @@ export default {
|
|
|
376
325
|
},
|
|
377
326
|
// array of rows after drag and drop
|
|
378
327
|
rearrange(oldIndex, newIndex) {
|
|
379
|
-
const movedItem = this.reorderedArray.find(
|
|
380
|
-
|
|
381
|
-
);
|
|
382
|
-
const remainingItems = this.reorderedArray.filter(
|
|
383
|
-
(item, index) => index !== oldIndex
|
|
384
|
-
);
|
|
328
|
+
const movedItem = this.reorderedArray.find((item, index) => index === oldIndex);
|
|
329
|
+
const remainingItems = this.reorderedArray.filter((item, index) => index !== oldIndex);
|
|
385
330
|
const reorderedItems = [
|
|
386
331
|
...remainingItems.slice(0, newIndex),
|
|
387
332
|
movedItem,
|
package/src/icons.js
CHANGED
|
@@ -39,8 +39,10 @@ export default {
|
|
|
39
39
|
"M19.9,12.66a1,1,0,0,1,0-1.32L21.18,9.9a1,1,0,0,0,.12-1.17l-2-3.46a1,1,0,0,0-1.07-.48l-1.88.38a1,1,0,0,1-1.15-.66l-.61-1.83A1,1,0,0,0,13.64,2h-4a1,1,0,0,0-1,.68L8.08,4.51a1,1,0,0,1-1.15.66L5,4.79A1,1,0,0,0,4,5.27L2,8.73A1,1,0,0,0,2.1,9.9l1.27,1.44a1,1,0,0,1,0,1.32L2.1,14.1A1,1,0,0,0,2,15.27l2,3.46a1,1,0,0,0,1.07.48l1.88-.38a1,1,0,0,1,1.15.66l.61,1.83a1,1,0,0,0,1,.68h4a1,1,0,0,0,.95-.68l.61-1.83a1,1,0,0,1,1.15-.66l1.88.38a1,1,0,0,0,1.07-.48l2-3.46a1,1,0,0,0-.12-1.17ZM18.41,14l.8.9-1.28,2.22-1.18-.24a3,3,0,0,0-3.45,2L12.92,20H10.36L10,18.86a3,3,0,0,0-3.45-2l-1.18.24L4.07,14.89l.8-.9a3,3,0,0,0,0-4l-.8-.9L5.35,6.89l1.18.24a3,3,0,0,0,3.45-2L10.36,4h2.56l.38,1.14a3,3,0,0,0,3.45,2l1.18-.24,1.28,2.22-.8.9A3,3,0,0,0,18.41,14ZM11.64,8a4,4,0,1,0,4,4A4,4,0,0,0,11.64,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,11.64,14Z",
|
|
40
40
|
integration:
|
|
41
41
|
"M10,13H4a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V14A1,1,0,0,0,10,13ZM9,19H5V15H9ZM20,3H14a1,1,0,0,0-1,1v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V4A1,1,0,0,0,20,3ZM19,9H15V5h4Zm1,7H18V14a1,1,0,0,0-2,0v2H14a1,1,0,0,0,0,2h2v2a1,1,0,0,0,2,0V18h2a1,1,0,0,0,0-2ZM10,3H4A1,1,0,0,0,3,4v6a1,1,0,0,0,1,1h6a1,1,0,0,0,1-1V4A1,1,0,0,0,10,3ZM9,9H5V5H9Z",
|
|
42
|
-
clipboard:
|
|
42
|
+
"clipboard-solid":
|
|
43
43
|
"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z",
|
|
44
|
+
clipboard:
|
|
45
|
+
"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
|
|
44
46
|
package:
|
|
45
47
|
"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7",
|
|
46
48
|
document:
|
|
@@ -199,4 +201,6 @@ export default {
|
|
|
199
201
|
"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm3 4a1 1 0 000 2h.01a1 1 0 100-2H7zm3 0a1 1 0 000 2h3a1 1 0 100-2h-3zm-3 4a1 1 0 100 2h.01a1 1 0 100-2H7zm3 0a1 1 0 100 2h3a1 1 0 100-2h-3z",
|
|
200
202
|
"clipboard-check-outline":
|
|
201
203
|
"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",
|
|
204
|
+
"home":
|
|
205
|
+
"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"
|
|
202
206
|
};
|