classcard-ui 0.2.212 → 0.2.216
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 +98 -86
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +98 -86
- 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/CPagination/CPagination.vue +75 -71
- package/src/components/CTable/CTable.vue +70 -58
- package/src/components/CTextarea/CTextarea.vue +1 -0
package/package.json
CHANGED
|
@@ -1,80 +1,84 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<div class="-
|
|
4
|
-
<a
|
|
5
|
-
@click="currentPageNumber == '1' ? '' : goToPreviousPage()"
|
|
6
|
-
class="pt-4 pr-1 inline-flex items-center text-sm font-medium"
|
|
7
|
-
:class="
|
|
8
|
-
currentPageNumber == '1'
|
|
9
|
-
? 'text-gray-400 pointer-events-none'
|
|
10
|
-
: 'text-gray-500 hover:text-gray-700 group cursor-pointer'
|
|
11
|
-
"
|
|
12
|
-
>
|
|
13
|
-
<c-icon
|
|
14
|
-
name="arrow-narrow-left-solid"
|
|
15
|
-
class="h-5 w-5 mr-3"
|
|
16
|
-
:class="
|
|
17
|
-
currentPageNumber == '1'
|
|
18
|
-
? 'text-gray-400 pointer-events-none'
|
|
19
|
-
: 'text-gray-500 group-hover:text-gray-800'
|
|
20
|
-
"
|
|
21
|
-
type="solid"
|
|
22
|
-
></c-icon>
|
|
2
|
+
<div class="bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6">
|
|
3
|
+
<div class="flex-1 flex justify-between sm:hidden">
|
|
4
|
+
<a href="#" class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
|
|
23
5
|
Previous
|
|
24
6
|
</a>
|
|
25
|
-
|
|
26
|
-
<div class="hidden md:-mt-px md:flex">
|
|
27
|
-
<div
|
|
28
|
-
v-for="page in pageRange"
|
|
29
|
-
:key="page"
|
|
30
|
-
class="text-gray-500 hover:text-gray-700 px-4 inline-flex items-center text-sm font-medium group"
|
|
31
|
-
:class="[
|
|
32
|
-
page == currentPageNumber
|
|
33
|
-
? 'border-indigo-500 border-t-4 cursor-pointer'
|
|
34
|
-
: 'hover:border-t-4',
|
|
35
|
-
page === '...' ? 'cursor-text hover:border-t-4 hover:border-transparent' : '',
|
|
36
|
-
page !== currentPageNumber && page !== '...'
|
|
37
|
-
? 'hover:border-gray-300 hover:border-t-4 cursor-pointer'
|
|
38
|
-
: '',
|
|
39
|
-
]"
|
|
40
|
-
@click="changePage(page)"
|
|
41
|
-
>
|
|
42
|
-
<div class="pt-4 group-hover:-mt-1" v-if="page === '...'">...</div>
|
|
43
|
-
<div v-else-if="page == currentPageNumber" class="pt-3.5 text-indigo-600">
|
|
44
|
-
{{ page }}
|
|
45
|
-
</div>
|
|
46
|
-
<div class="pt-4 group-hover:-mt-1" v-else>
|
|
47
|
-
{{ page }}
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
<div class="-mt-px w-0 flex-1 flex justify-end">
|
|
52
|
-
<a
|
|
53
|
-
@click="currentPageNumber == lastPageNumber ? '' : goToNextPage()"
|
|
54
|
-
class="pt-4 pl-1 inline-flex items-center text-sm"
|
|
55
|
-
:class="
|
|
56
|
-
currentPageNumber == lastPageNumber
|
|
57
|
-
? 'text-gray-400 pointer-events-none'
|
|
58
|
-
: 'text-gray-500 hover:text-gray-700 group cursor-pointer'
|
|
59
|
-
"
|
|
60
|
-
>
|
|
7
|
+
<a href="#" class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
|
|
61
8
|
Next
|
|
62
|
-
<c-icon
|
|
63
|
-
class="ml-3 h-5 w-5"
|
|
64
|
-
:class="
|
|
65
|
-
currentPageNumber == lastPageNumber
|
|
66
|
-
? 'text-gray-400 pointer-events-none'
|
|
67
|
-
: 'text-gray-500 group-hover:text-gray-800'
|
|
68
|
-
"
|
|
69
|
-
name="arrow-narrow-right-solid"
|
|
70
|
-
type="solid"
|
|
71
|
-
></c-icon>
|
|
72
9
|
</a>
|
|
73
10
|
</div>
|
|
74
|
-
|
|
11
|
+
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
|
|
12
|
+
<div>
|
|
13
|
+
<p class="text-sm text-gray-700">
|
|
14
|
+
Showing
|
|
15
|
+
<span class="font-medium">1</span>
|
|
16
|
+
to
|
|
17
|
+
<span class="font-medium">10</span>
|
|
18
|
+
of
|
|
19
|
+
<span class="font-medium">97</span>
|
|
20
|
+
results
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<nav class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px" aria-label="Pagination">
|
|
25
|
+
<div class="hidden md:-mt-px md:flex">
|
|
26
|
+
<div href="#"
|
|
27
|
+
@click="currentPageNumber == '1' ? '' : goToPreviousPage()"
|
|
28
|
+
class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-r-0 border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"
|
|
29
|
+
:class="
|
|
30
|
+
currentPageNumber == '1'
|
|
31
|
+
? 'text-gray-400 pointer-events-none'
|
|
32
|
+
: 'text-gray-500 hover:text-gray-700 group cursor-pointer'
|
|
33
|
+
"
|
|
34
|
+
>
|
|
35
|
+
<span class="sr-only">Previous</span>
|
|
36
|
+
<!-- Heroicon name: solid/chevron-left -->
|
|
37
|
+
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
38
|
+
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
|
|
39
|
+
</svg>
|
|
40
|
+
</div>
|
|
41
|
+
<div
|
|
42
|
+
v-for="page in pageRange"
|
|
43
|
+
:key="page"
|
|
44
|
+
:class="[
|
|
45
|
+
page == currentPageNumber
|
|
46
|
+
? 'z-10 bg-indigo-50 border-indigo-500 text-indigo-600 relative inline-flex items-center px-4 py-2 border text-sm font-medium'
|
|
47
|
+
: '',
|
|
48
|
+
page === '...' ? 'bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border border-r-0 text-sm font-medium' : '',
|
|
49
|
+
page !== currentPageNumber && page !== '...'
|
|
50
|
+
? 'bg-white border-gray-300 text-gray-500 hover:bg-gray-50 relative inline-flex items-center px-4 py-2 border border-r-0 text-sm font-medium'
|
|
51
|
+
: '',
|
|
52
|
+
]"
|
|
53
|
+
@click="changePage(page)"
|
|
54
|
+
>
|
|
55
|
+
<div v-if="page === '...'">...</div>
|
|
56
|
+
<div v-else>
|
|
57
|
+
{{ page }}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<div href="#"
|
|
61
|
+
class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50"
|
|
62
|
+
@click="currentPageNumber == lastPageNumber ? '' : goToNextPage()"
|
|
63
|
+
:class="
|
|
64
|
+
currentPageNumber == lastPageNumber
|
|
65
|
+
? 'text-gray-400 pointer-events-none'
|
|
66
|
+
: 'text-gray-500 hover:text-gray-700 group cursor-pointer'
|
|
67
|
+
"
|
|
68
|
+
>
|
|
69
|
+
<span class="sr-only">Next</span>
|
|
70
|
+
<!-- Heroicon name: solid/chevron-right -->
|
|
71
|
+
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
72
|
+
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
|
73
|
+
</svg>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</nav>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
75
80
|
</template>
|
|
76
81
|
<script>
|
|
77
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
78
82
|
export default {
|
|
79
83
|
name: "CPagination",
|
|
80
84
|
props: {
|
|
@@ -92,7 +96,7 @@ export default {
|
|
|
92
96
|
},
|
|
93
97
|
},
|
|
94
98
|
components: {
|
|
95
|
-
|
|
99
|
+
|
|
96
100
|
},
|
|
97
101
|
data() {
|
|
98
102
|
return {
|
|
@@ -148,4 +152,4 @@ export default {
|
|
|
148
152
|
},
|
|
149
153
|
},
|
|
150
154
|
};
|
|
151
|
-
</script>
|
|
155
|
+
</script>
|
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
|
|
4
|
+
<div slot="table-actions" v-if="tableActions" class="bg-gray-50 rounded-lg p-3 mb-4">
|
|
5
|
+
<div class="flex justify-between">
|
|
6
|
+
<div v-if="searching">
|
|
7
|
+
<c-input v-model="searchTerm" :isValidate="searching" :placeholder="searchPlaceholder" class="-mt-1 w-56" type="text"></c-input>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex">
|
|
10
|
+
<!-- dropdown icon on top right of table -->
|
|
11
|
+
<div class="relative inline-block text-left">
|
|
12
|
+
<!-- button to show list of columns to show hide in table -->
|
|
13
|
+
<div>
|
|
14
|
+
<button
|
|
15
|
+
@click="toggleDropdown = !toggleDropdown"
|
|
16
|
+
class="inline-flex justify-center w-full rounded-md border border-gray-200 shadow-sm px-2 py-2 bg-white text-sm font-medium hover:bg-gray-50 focus:outline-none focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-600"
|
|
17
|
+
aria-haspopup="true"
|
|
18
|
+
aria-expanded="true"
|
|
19
|
+
@blur="toggleDropdown = false"
|
|
20
|
+
>
|
|
21
|
+
<c-icon name="view-board" type="solid" class="text-gray-400 h-5 w-5"></c-icon>
|
|
22
|
+
<c-icon
|
|
23
|
+
name="chevron-down"
|
|
24
|
+
type="solid"
|
|
25
|
+
class="ml-1 text-gray-400 h-5 w-5"
|
|
26
|
+
></c-icon>
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
<!-- dropdown having list of all columns to show hide -->
|
|
30
|
+
<div
|
|
31
|
+
v-show="toggleDropdown"
|
|
32
|
+
class="origin-top-right absolute right-0 mt-2 -mr-1 w-56 rounded-md shadow-lg bg-white ring-1 ring-gray-900 ring-opacity-5 z-100 overflow-y-auto max-h-96"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
class="py-1"
|
|
36
|
+
role="menu"
|
|
37
|
+
aria-orientation="vertical"
|
|
38
|
+
aria-labelledby="option-menu"
|
|
39
|
+
>
|
|
40
|
+
<a
|
|
41
|
+
href="#"
|
|
42
|
+
v-for="column in showHideColumnList"
|
|
43
|
+
v-bind:key="column.field"
|
|
44
|
+
class="flex block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
|
|
45
|
+
role="menuitem"
|
|
46
|
+
>
|
|
47
|
+
<c-checkbox
|
|
48
|
+
:label="column.label"
|
|
49
|
+
@onChange="showHideColumn($event, column.field)"
|
|
50
|
+
:value="!column.hidden"
|
|
51
|
+
></c-checkbox>
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div>
|
|
58
|
+
<c-button-icon
|
|
59
|
+
type="white"
|
|
60
|
+
:icon="{ name: 'download-solid', type: 'solid', class: 'h-5 w-5 text-gray-400' }"
|
|
61
|
+
class="ml-3"
|
|
62
|
+
></c-button-icon>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
3
68
|
<vue-good-table
|
|
69
|
+
class="border-solid border-2 border-gray-100 rounded-lg overflow-hidden"
|
|
4
70
|
mode="remote"
|
|
5
71
|
ref="my-table"
|
|
6
72
|
:styleClass="showLoader ? 'vgt-table opacity-50 pointer-events-none' : 'vgt-table'"
|
|
@@ -13,6 +79,7 @@
|
|
|
13
79
|
:rows="rows"
|
|
14
80
|
:search-options="{
|
|
15
81
|
enabled: searching,
|
|
82
|
+
externalQuery: searchTerm,
|
|
16
83
|
placeholder: searchPlaceholder,
|
|
17
84
|
trigger: 'enter',
|
|
18
85
|
}"
|
|
@@ -82,63 +149,6 @@
|
|
|
82
149
|
{{ props.formattedRow[props.column.field] }}
|
|
83
150
|
</span>
|
|
84
151
|
</template>
|
|
85
|
-
<div slot="table-actions" v-if="tableActions">
|
|
86
|
-
<div class="flex flex-row-reverse">
|
|
87
|
-
<!-- dropdown icon on top right of table -->
|
|
88
|
-
<div>
|
|
89
|
-
<c-button-icon
|
|
90
|
-
type="white"
|
|
91
|
-
:icon="{ name: 'download', type: 'outline', class: 'h-5 w-5 text-gray-400' }"
|
|
92
|
-
class="ml-3"
|
|
93
|
-
></c-button-icon>
|
|
94
|
-
</div>
|
|
95
|
-
<div class="relative inline-block text-left">
|
|
96
|
-
<!-- button to show list of columns to show hide in table -->
|
|
97
|
-
<div>
|
|
98
|
-
<button
|
|
99
|
-
@click="toggleDropdown = !toggleDropdown"
|
|
100
|
-
class="inline-flex justify-center w-full rounded-md border border-gray-200 shadow-sm px-2 py-2 bg-white text-sm font-medium hover:bg-gray-50 focus:outline-none focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-600"
|
|
101
|
-
aria-haspopup="true"
|
|
102
|
-
aria-expanded="true"
|
|
103
|
-
>
|
|
104
|
-
<c-icon name="view-board" type="solid" class="text-gray-400 h-5 w-5"></c-icon>
|
|
105
|
-
<c-icon
|
|
106
|
-
name="chevron-down"
|
|
107
|
-
type="solid"
|
|
108
|
-
class="ml-1 text-gray-400 h-5 w-5"
|
|
109
|
-
></c-icon>
|
|
110
|
-
</button>
|
|
111
|
-
</div>
|
|
112
|
-
<!-- dropdown having list of all columns to show hide -->
|
|
113
|
-
<div
|
|
114
|
-
v-show="toggleDropdown"
|
|
115
|
-
class="origin-top-right absolute right-0 mt-2 -mr-1 w-56 rounded-md shadow-lg bg-white ring-1 ring-gray-900 ring-opacity-5 z-100 overflow-y-auto max-h-96"
|
|
116
|
-
>
|
|
117
|
-
<div
|
|
118
|
-
class="py-1"
|
|
119
|
-
role="menu"
|
|
120
|
-
aria-orientation="vertical"
|
|
121
|
-
aria-labelledby="option-menu"
|
|
122
|
-
>
|
|
123
|
-
<a
|
|
124
|
-
href="#"
|
|
125
|
-
v-for="column in showHideColumnList"
|
|
126
|
-
v-bind:key="column.field"
|
|
127
|
-
class="flex block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
|
|
128
|
-
role="menuitem"
|
|
129
|
-
>
|
|
130
|
-
<c-checkbox
|
|
131
|
-
:label="column.label"
|
|
132
|
-
@onChange="showHideColumn($event, column.field)"
|
|
133
|
-
:value="!column.hidden"
|
|
134
|
-
></c-checkbox>
|
|
135
|
-
</a>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
<slot name="action"></slot>
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
152
|
<!-- Custom pagination component -->
|
|
143
153
|
<template v-if="pagination" slot="pagination-bottom">
|
|
144
154
|
<c-pagination
|
|
@@ -185,6 +195,7 @@ import CButtonIcon from "../CButtonIcon/CButtonIcon.vue";
|
|
|
185
195
|
import "vue-good-table/dist/vue-good-table.css";
|
|
186
196
|
import { VueGoodTable } from "vue-good-table";
|
|
187
197
|
import Sortable from "@shopify/draggable/lib/es5/sortable.js";
|
|
198
|
+
import CInput from '../CInput/CInput.vue';
|
|
188
199
|
|
|
189
200
|
export default {
|
|
190
201
|
name: "CTable",
|
|
@@ -194,6 +205,7 @@ export default {
|
|
|
194
205
|
VueGoodTable,
|
|
195
206
|
CPagination,
|
|
196
207
|
CButtonIcon,
|
|
208
|
+
CInput,
|
|
197
209
|
},
|
|
198
210
|
props: {
|
|
199
211
|
// To show or hide pagination section
|
|
@@ -285,7 +297,7 @@ export default {
|
|
|
285
297
|
return {
|
|
286
298
|
toggleDropdown: false,
|
|
287
299
|
showLoader: this.isLoading,
|
|
288
|
-
searchTerm:
|
|
300
|
+
searchTerm: '',
|
|
289
301
|
paginationRecords: this.paginationData,
|
|
290
302
|
reorderedArray: [...this.rows],
|
|
291
303
|
};
|