classcard-ui 0.2.203 → 0.2.208
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 +141 -125
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.css +2 -2
- package/dist/classcard-ui.umd.js +141 -125
- 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/CDatepicker/CDatepicker.vue +4 -3
- package/src/components/CIcon/CIcon.vue +1 -1
- package/src/components/CInputAddon/CInputAddon.vue +6 -7
- package/src/components/CMultiselect/CMultiselect.vue +7 -1
- package/src/components/CPagination/CPagination.vue +73 -68
- package/src/components/CSwitch/CSwitch.vue +15 -14
- package/src/components/CTable/CTable.vue +71 -58
- package/src/components/CTabs/CTabs.vue +1 -1
- package/src/stories/CMultiselect.stories.js +2 -1
- package/src/stories/CPagination.stories.js +6 -1
- package/src/stories/CSwitch.stories.js +1 -0
package/package.json
CHANGED
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
:value="inputValue"
|
|
38
38
|
:class="[
|
|
39
39
|
disabled
|
|
40
|
-
? 'border-gray-100 text-gray-400'
|
|
41
|
-
: 'border-gray-300 text-gray-700',
|
|
40
|
+
? 'border-gray-100 border-l-0 text-gray-400'
|
|
41
|
+
: 'border-gray-300 border-l-0 text-gray-700',
|
|
42
42
|
'bg-white w-full p-2 appearance-none border rounded-r-md focus:outline-none focus:border-blue-500 text-sm',
|
|
43
43
|
]"
|
|
44
|
+
@click="togglePopover()"
|
|
44
45
|
:readonly="disabled"
|
|
45
46
|
/>
|
|
46
47
|
</div>
|
|
@@ -87,8 +88,8 @@ export default {
|
|
|
87
88
|
data() {
|
|
88
89
|
const masks = {
|
|
89
90
|
input: [
|
|
90
|
-
"YYYY/MM/DD",
|
|
91
91
|
"MMM DD, YYYY",
|
|
92
|
+
"YYYY/MM/DD",
|
|
92
93
|
"DD-MM-YYYY",
|
|
93
94
|
"DD/MM/YYYY",
|
|
94
95
|
"YYYY-MM-DD",
|
|
@@ -71,20 +71,19 @@
|
|
|
71
71
|
:disabled="disabled"
|
|
72
72
|
/>
|
|
73
73
|
<div class="absolute inset-y-0 right-3 flex items-center pointer-events-none">
|
|
74
|
+
<div
|
|
75
|
+
v-if="!isValidate"
|
|
76
|
+
class="right-0 pr-2 flex items-center pointer-events-none text-red-600"
|
|
77
|
+
>
|
|
78
|
+
<c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
|
|
79
|
+
</div>
|
|
74
80
|
<span
|
|
75
|
-
v-if="isValidate"
|
|
76
81
|
class="text-gray-500 sm:text-sm"
|
|
77
82
|
:class="disabled ? 'opacity-50' : ''"
|
|
78
83
|
>
|
|
79
84
|
{{ addon }}
|
|
80
85
|
</span>
|
|
81
86
|
</div>
|
|
82
|
-
<div
|
|
83
|
-
v-if="!isValidate"
|
|
84
|
-
class="absolute inset-y-0 right-0 pr-2 flex items-center pointer-events-none text-red-600"
|
|
85
|
-
>
|
|
86
|
-
<c-icon name="exclamation-circle" type="solid" class="h-5 w-5"></c-icon>
|
|
87
|
-
</div>
|
|
88
87
|
</div>
|
|
89
88
|
<div v-if="inlineAddon && addonType == 'leading'" class="relative mt-1 flex rounded-md">
|
|
90
89
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
|
@@ -74,7 +74,10 @@ export default {
|
|
|
74
74
|
required: true,
|
|
75
75
|
},
|
|
76
76
|
label: String,
|
|
77
|
-
placeholder:
|
|
77
|
+
placeholder: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: "Start typing... (min 2 characters) to search options",
|
|
80
|
+
},
|
|
78
81
|
// whether multiple fields are allowed or not
|
|
79
82
|
isMultiple: {
|
|
80
83
|
type: Boolean,
|
|
@@ -170,4 +173,7 @@ export default {
|
|
|
170
173
|
.vs__dropdown-toggle.vs__dropdown-option--highlight {
|
|
171
174
|
@apply bg-indigo-700 text-white;
|
|
172
175
|
}
|
|
176
|
+
.vs__dropdown-option--highlight {
|
|
177
|
+
@apply bg-indigo-700 text-white;
|
|
178
|
+
}
|
|
173
179
|
</style>
|
|
@@ -1,80 +1,85 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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">
|
|
5
|
+
Previous
|
|
6
|
+
</a>
|
|
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">
|
|
8
|
+
Next
|
|
9
|
+
</a>
|
|
10
|
+
</div>
|
|
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="
|
|
17
30
|
currentPageNumber == '1'
|
|
18
31
|
? 'text-gray-400 pointer-events-none'
|
|
19
|
-
: 'text-gray-500
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
>
|
|
61
|
-
Next
|
|
62
|
-
<c-icon
|
|
63
|
-
class="ml-3 h-5 w-5"
|
|
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()"
|
|
64
63
|
:class="
|
|
65
64
|
currentPageNumber == lastPageNumber
|
|
66
65
|
? 'text-gray-400 pointer-events-none'
|
|
67
|
-
: 'text-gray-500
|
|
66
|
+
: 'text-gray-500 hover:text-gray-700 group cursor-pointer'
|
|
68
67
|
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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>
|
|
73
77
|
</div>
|
|
74
|
-
</
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
75
80
|
</template>
|
|
76
81
|
<script>
|
|
77
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
82
|
+
// import CIcon from "../CIcon/CIcon.vue";
|
|
78
83
|
export default {
|
|
79
84
|
name: "CPagination",
|
|
80
85
|
props: {
|
|
@@ -92,7 +97,7 @@ export default {
|
|
|
92
97
|
},
|
|
93
98
|
},
|
|
94
99
|
components: {
|
|
95
|
-
|
|
100
|
+
|
|
96
101
|
},
|
|
97
102
|
data() {
|
|
98
103
|
return {
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
<div
|
|
5
5
|
v-if="size === 'small'"
|
|
6
6
|
:class="label == '' ? 'items-center' : 'items-start'"
|
|
7
|
-
class="flex justify-between"
|
|
7
|
+
class="flex justify-between cursor-pointer"
|
|
8
8
|
>
|
|
9
|
-
<span class="flex-grow flex flex-col" id="smallleft" v-if="direction == 'left'">
|
|
9
|
+
<span class="flex-grow flex flex-col" id="smallleft" v-if="direction == 'left'" @click="switchValue">
|
|
10
10
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
11
11
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
12
12
|
</span>
|
|
13
13
|
<button
|
|
14
14
|
type="button"
|
|
15
|
-
class="flex-shrink-0 group relative rounded-full inline-flex items-center justify-center h-5 w-10 cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
|
|
15
|
+
class="flex-shrink-0 group relative rounded-full inline-flex items-center justify-center h-5 w-10 cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50"
|
|
16
16
|
aria-pressed="false"
|
|
17
17
|
@click="switchValue"
|
|
18
|
+
:disabled="disabled"
|
|
18
19
|
>
|
|
19
20
|
<span class="sr-only">Use setting</span>
|
|
20
21
|
<span
|
|
@@ -32,14 +33,15 @@
|
|
|
32
33
|
class="pointer-events-none absolute left-0 inline-block h-5 w-5 border border-gray-200 rounded-full bg-white transform ring-0 transition-transform ease-in-out duration-200"
|
|
33
34
|
></span>
|
|
34
35
|
</button>
|
|
35
|
-
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'">
|
|
36
|
+
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'" @click="switchValue">
|
|
36
37
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
37
38
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
38
39
|
</span>
|
|
39
40
|
</div>
|
|
41
|
+
|
|
40
42
|
<!-- large toggle -->
|
|
41
|
-
<div v-else :class="label == '' ? 'items-center' : 'items-start'" class="flex justify-between">
|
|
42
|
-
<span class="flex-grow flex flex-col" id="toggleLabel" v-if="direction == 'left'">
|
|
43
|
+
<div v-else :class="label == '' ? 'items-center' : 'items-start'" class="flex justify-between cursor-pointer">
|
|
44
|
+
<span class="flex-grow flex flex-col" id="toggleLabel" v-if="direction == 'left'" @click="switchValue">
|
|
43
45
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
44
46
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
45
47
|
</span>
|
|
@@ -48,7 +50,8 @@
|
|
|
48
50
|
aria-pressed="false"
|
|
49
51
|
:class="{ 'bg-indigo-600': isToggle == 1, 'bg-gray-200': isToggle == 0 }"
|
|
50
52
|
@click="switchValue"
|
|
51
|
-
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
|
|
53
|
+
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50"
|
|
54
|
+
:disabled="disabled"
|
|
52
55
|
>
|
|
53
56
|
<span class="sr-only">Use setting</span>
|
|
54
57
|
<span
|
|
@@ -57,7 +60,7 @@
|
|
|
57
60
|
class="inline-block h-5 w-5 rounded-full bg-white transform ring-0 transition ease-in-out duration-200"
|
|
58
61
|
></span>
|
|
59
62
|
</button>
|
|
60
|
-
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'">
|
|
63
|
+
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'" @click="switchValue">
|
|
61
64
|
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
62
65
|
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
63
66
|
</span>
|
|
@@ -89,6 +92,9 @@ export default {
|
|
|
89
92
|
direction: {
|
|
90
93
|
type: String,
|
|
91
94
|
},
|
|
95
|
+
disabled: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
}
|
|
92
98
|
},
|
|
93
99
|
data() {
|
|
94
100
|
return {
|
|
@@ -97,12 +103,7 @@ export default {
|
|
|
97
103
|
},
|
|
98
104
|
methods: {
|
|
99
105
|
switchValue() {
|
|
100
|
-
|
|
101
|
-
if (this.isToggle == 1) {
|
|
102
|
-
this.isToggle = 0;
|
|
103
|
-
} else if (this.isToggle == 0) {
|
|
104
|
-
this.isToggle = 1;
|
|
105
|
-
}
|
|
106
|
+
this.isToggle = this.isToggle == 1 ? 0 : 1;
|
|
106
107
|
this.$emit("returnToggleValue", this.isToggle);
|
|
107
108
|
},
|
|
108
109
|
},
|
|
@@ -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
|
|
@@ -147,6 +157,7 @@
|
|
|
147
157
|
@setCurrentPage="setCurrentPageRecords"
|
|
148
158
|
@setPreviousPage="setPreviousPageRecords"
|
|
149
159
|
@setNextPage="setNextPageRecords"
|
|
160
|
+
class="border-t-0"
|
|
150
161
|
></c-pagination>
|
|
151
162
|
</template>
|
|
152
163
|
<!-- Custom loader for table -->
|
|
@@ -185,6 +196,7 @@ import CButtonIcon from "../CButtonIcon/CButtonIcon.vue";
|
|
|
185
196
|
import "vue-good-table/dist/vue-good-table.css";
|
|
186
197
|
import { VueGoodTable } from "vue-good-table";
|
|
187
198
|
import Sortable from "@shopify/draggable/lib/es5/sortable.js";
|
|
199
|
+
import CInput from '../CInput/CInput.vue';
|
|
188
200
|
|
|
189
201
|
export default {
|
|
190
202
|
name: "CTable",
|
|
@@ -194,6 +206,7 @@ export default {
|
|
|
194
206
|
VueGoodTable,
|
|
195
207
|
CPagination,
|
|
196
208
|
CButtonIcon,
|
|
209
|
+
CInput,
|
|
197
210
|
},
|
|
198
211
|
props: {
|
|
199
212
|
// To show or hide pagination section
|
|
@@ -285,7 +298,7 @@ export default {
|
|
|
285
298
|
return {
|
|
286
299
|
toggleDropdown: false,
|
|
287
300
|
showLoader: this.isLoading,
|
|
288
|
-
searchTerm:
|
|
301
|
+
searchTerm: '',
|
|
289
302
|
paginationRecords: this.paginationData,
|
|
290
303
|
reorderedArray: [...this.rows],
|
|
291
304
|
};
|
|
@@ -8,6 +8,7 @@ export default {
|
|
|
8
8
|
options: Array,
|
|
9
9
|
label: String,
|
|
10
10
|
filterable: Boolean,
|
|
11
|
+
optionLabel: String,
|
|
11
12
|
},
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -19,7 +20,6 @@ const Template = (args, { argTypes }) => ({
|
|
|
19
20
|
|
|
20
21
|
export const Default = Template.bind({});
|
|
21
22
|
Default.args = {
|
|
22
|
-
// options: ["list", "of", "options"],
|
|
23
23
|
options: [
|
|
24
24
|
{
|
|
25
25
|
text: "Subjects",
|
|
@@ -90,6 +90,7 @@ Default.args = {
|
|
|
90
90
|
children: [{ id: "15820_Package", text: "Mathematics" }],
|
|
91
91
|
},
|
|
92
92
|
],
|
|
93
|
+
optionLabel: "text",
|
|
93
94
|
label: "Active",
|
|
94
95
|
showOptionImage: true,
|
|
95
96
|
filterable: false,
|