classcard-ui 0.2.392 → 0.2.395
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 +2305 -2293
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.css +1 -1
- package/dist/classcard-ui.umd.js +2305 -2293
- 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/CMultiselect/CMultiselect.vue +1 -1
- package/src/components/CPagination/CPagination.vue +29 -19
- package/src/components/CStackedList/CStackedList.vue +10 -5
- package/src/components/CTable/CTable.vue +3 -3
- package/src/stories/CStackedList.stories.js +19 -8
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="
|
|
3
|
+
class="flex items-center justify-between border-gray-200 bg-white px-4 py-3 sm:px-6"
|
|
4
4
|
>
|
|
5
|
-
<div class="flex-1
|
|
5
|
+
<div class="flex flex-1 justify-between sm:hidden">
|
|
6
6
|
<a
|
|
7
7
|
href="#"
|
|
8
|
-
class="relative inline-flex items-center
|
|
8
|
+
class="relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"
|
|
9
9
|
>
|
|
10
10
|
Previous
|
|
11
11
|
</a>
|
|
12
12
|
<a
|
|
13
13
|
href="#"
|
|
14
|
-
class="ml-3
|
|
14
|
+
class="relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"
|
|
15
15
|
>
|
|
16
16
|
Next
|
|
17
17
|
</a>
|
|
18
18
|
</div>
|
|
19
|
-
<div class="hidden sm:flex
|
|
19
|
+
<div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
|
|
20
20
|
<div>
|
|
21
21
|
<p class="text-sm text-gray-700">
|
|
22
22
|
Showing
|
|
@@ -24,24 +24,26 @@
|
|
|
24
24
|
to
|
|
25
25
|
<span class="font-medium">{{ setPaginationRecords.to }}</span>
|
|
26
26
|
of
|
|
27
|
-
<span class="font-medium">{{
|
|
27
|
+
<span class="font-medium">{{
|
|
28
|
+
setPaginationRecords.totalRecords
|
|
29
|
+
}}</span>
|
|
28
30
|
results
|
|
29
31
|
</p>
|
|
30
32
|
</div>
|
|
31
33
|
<div>
|
|
32
34
|
<nav
|
|
33
|
-
class="relative z-0 inline-flex rounded-md shadow-sm
|
|
35
|
+
class="relative z-0 inline-flex -space-x-px rounded-md shadow-sm"
|
|
34
36
|
aria-label="Pagination"
|
|
35
37
|
>
|
|
36
38
|
<div class="hidden md:-mt-px md:flex">
|
|
37
39
|
<div
|
|
38
40
|
href="#"
|
|
39
41
|
@click="currentPageNumber == '1' ? '' : goToPreviousPage()"
|
|
40
|
-
class="relative inline-flex items-center
|
|
42
|
+
class="relative inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50"
|
|
41
43
|
:class="
|
|
42
44
|
currentPageNumber == '1'
|
|
43
|
-
? 'text-gray-400
|
|
44
|
-
: 'text-gray-500 hover:text-gray-700
|
|
45
|
+
? 'pointer-events-none text-gray-400'
|
|
46
|
+
: 'group cursor-pointer text-gray-500 hover:text-gray-700'
|
|
45
47
|
"
|
|
46
48
|
>
|
|
47
49
|
<span class="sr-only">Previous</span>
|
|
@@ -66,17 +68,15 @@
|
|
|
66
68
|
class="cursor-pointer"
|
|
67
69
|
:class="[
|
|
68
70
|
page == currentPageNumber
|
|
69
|
-
? 'z-10
|
|
71
|
+
? 'relative z-10 inline-flex items-center border border-indigo-500 bg-indigo-50 px-4 py-2 text-sm font-medium text-indigo-600'
|
|
70
72
|
: '',
|
|
71
73
|
page === '...'
|
|
72
|
-
? '
|
|
74
|
+
? 'relative inline-flex items-center border border-r-0 border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50'
|
|
73
75
|
: '',
|
|
74
76
|
page !== currentPageNumber && page !== '...'
|
|
75
|
-
? '
|
|
76
|
-
: '',
|
|
77
|
-
page == currentPageNumber + 1
|
|
78
|
-
? 'border-l-0'
|
|
77
|
+
? 'relative inline-flex items-center border border-r-0 border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50'
|
|
79
78
|
: '',
|
|
79
|
+
page == currentPageNumber + 1 ? 'border-l-0' : '',
|
|
80
80
|
]"
|
|
81
81
|
@click="changePage(page)"
|
|
82
82
|
>
|
|
@@ -87,12 +87,12 @@
|
|
|
87
87
|
</div>
|
|
88
88
|
<div
|
|
89
89
|
href="#"
|
|
90
|
-
class="relative inline-flex items-center
|
|
90
|
+
class="relative inline-flex items-center rounded-r-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50"
|
|
91
91
|
@click="currentPageNumber == lastPageNumber ? '' : goToNextPage()"
|
|
92
92
|
:class="
|
|
93
93
|
currentPageNumber == lastPageNumber
|
|
94
|
-
? 'text-gray-400
|
|
95
|
-
: 'text-gray-500 hover:text-gray-700
|
|
94
|
+
? 'pointer-events-none text-gray-400'
|
|
95
|
+
: 'group cursor-pointer text-gray-500 hover:text-gray-700'
|
|
96
96
|
"
|
|
97
97
|
>
|
|
98
98
|
<span class="sr-only">Next</span>
|
|
@@ -118,6 +118,8 @@
|
|
|
118
118
|
</div>
|
|
119
119
|
</template>
|
|
120
120
|
<script>
|
|
121
|
+
import { isEqual } from "lodash-es";
|
|
122
|
+
|
|
121
123
|
export default {
|
|
122
124
|
name: "CPagination",
|
|
123
125
|
props: {
|
|
@@ -188,5 +190,13 @@ export default {
|
|
|
188
190
|
this.$emit("setNextPage", nextPage);
|
|
189
191
|
},
|
|
190
192
|
},
|
|
193
|
+
watch: {
|
|
194
|
+
setPaginationRecords(newVal, oldVal) {
|
|
195
|
+
if (!isEqual(newVal, oldVal)) {
|
|
196
|
+
this.currentPageNumber = newVal.currentPage;
|
|
197
|
+
this.lastPageNumber = newVal.lastPage;
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
},
|
|
191
201
|
};
|
|
192
202
|
</script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<li
|
|
5
5
|
v-for="items in listItems"
|
|
6
6
|
v-bind:key="items.size"
|
|
7
|
-
class="
|
|
7
|
+
class="flex items-center justify-between py-4"
|
|
8
8
|
:class="{ 'cursor-pointer': items.collapse, 'border-b border-gray-200': divider === true }"
|
|
9
9
|
v-on="items.collapse ? { click: () => collapseList() } : null"
|
|
10
10
|
>
|
|
@@ -13,15 +13,20 @@
|
|
|
13
13
|
v-if="items.collapse"
|
|
14
14
|
:name="showSection ? 'chevron-down' : 'chevron-right'"
|
|
15
15
|
type="solid"
|
|
16
|
-
class="mt-3 mr-3
|
|
16
|
+
class="mt-3 mr-3 h-5 w-5 shrink-0 text-gray-900"
|
|
17
17
|
></c-icon>
|
|
18
|
-
<c-avatar
|
|
18
|
+
<c-avatar
|
|
19
|
+
:size="items.size"
|
|
20
|
+
:rounded="items.rounded"
|
|
21
|
+
:image="items.image"
|
|
22
|
+
class="shrink-0"
|
|
23
|
+
></c-avatar>
|
|
19
24
|
<div class="ml-3">
|
|
20
25
|
<div class="flex pb-1">
|
|
21
26
|
<p class="text-sm font-medium text-gray-900">
|
|
22
27
|
{{ items.heading }}
|
|
23
28
|
</p>
|
|
24
|
-
<c-tag v-if="items.tag" label="
|
|
29
|
+
<c-tag v-if="items.tag" :label="tagLabel" class="relative bottom-0.5 ml-2.5"></c-tag>
|
|
25
30
|
</div>
|
|
26
31
|
<p class="text-sm text-gray-500">{{ items.description }}</p>
|
|
27
32
|
<div v-if="showSection" class="mt-3">
|
|
@@ -38,7 +43,7 @@
|
|
|
38
43
|
<button
|
|
39
44
|
v-if="items.listIcon"
|
|
40
45
|
type="button"
|
|
41
|
-
class="
|
|
46
|
+
class="focus:outline-none flex h-8 w-8 items-center justify-center rounded-full text-gray-500 hover:bg-red-100 hover:text-red-800 focus:ring-2 focus:ring-red-500"
|
|
42
47
|
>
|
|
43
48
|
<c-icon name="trash" type="solid" class="h-5 w-5 hover:text-red-800"></c-icon>
|
|
44
49
|
</button>
|
|
@@ -397,9 +397,9 @@ export default {
|
|
|
397
397
|
isLoading() {
|
|
398
398
|
this.showLoader = this.isLoading;
|
|
399
399
|
},
|
|
400
|
-
paginationData() {
|
|
401
|
-
if (!isEqual(
|
|
402
|
-
this.paginationRecords =
|
|
400
|
+
paginationData(newValue, oldValue) {
|
|
401
|
+
if (!isEqual(newValue, oldValue)) {
|
|
402
|
+
this.paginationRecords = newValue;
|
|
403
403
|
}
|
|
404
404
|
},
|
|
405
405
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import CStackedList from
|
|
2
|
-
import
|
|
1
|
+
import CStackedList from "../components/CStackedList/CStackedList.vue";
|
|
2
|
+
import "./utils.css";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title:
|
|
5
|
+
title: "CStackedList",
|
|
6
6
|
component: CStackedList,
|
|
7
7
|
argTypes: {
|
|
8
8
|
listItems: { control: { type: "object" } },
|
|
9
|
-
divider: Boolean
|
|
9
|
+
divider: Boolean,
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -18,8 +18,19 @@ const Template = (args, { argTypes }) => ({
|
|
|
18
18
|
|
|
19
19
|
export const Default = Template.bind({});
|
|
20
20
|
Default.args = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
listItems: [
|
|
22
|
+
{
|
|
23
|
+
image:
|
|
24
|
+
"https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
|
|
25
|
+
heading: "Maths-Level1",
|
|
26
|
+
tagLabel: "test",
|
|
27
|
+
description: "calvin.hawkins@example.com",
|
|
28
|
+
size: "medium",
|
|
29
|
+
rounded: false,
|
|
30
|
+
tag: false,
|
|
31
|
+
collapse: false,
|
|
32
|
+
listIcon: true,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
divider: true,
|
|
25
36
|
};
|