classcard-ui 0.2.705 → 0.2.708
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/README.md +24 -24
- package/dist/classcard-ui.common.js +68 -75
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +68 -75
- 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 +81 -81
- package/src/App.vue +16 -16
- package/src/components/CAlerts/CAlerts.vue +70 -70
- package/src/components/CAlerts/index.js +2 -2
- package/src/components/CAnchorTabs/CAnchorTabs.vue +96 -96
- package/src/components/CAnchorTabs/index.js +2 -2
- package/src/components/CAnchorTag/CAnchorTag.vue +62 -62
- package/src/components/CAnchorTag/index.js +2 -2
- package/src/components/CAvatar/CAvatar.vue +112 -112
- package/src/components/CAvatar/index.js +2 -2
- package/src/components/CAvatarGroup/CAvatarGroup.vue +145 -145
- package/src/components/CAvatarGroup/index.js +2 -2
- package/src/components/CBasicTable/CBasicTable.vue +184 -184
- package/src/components/CBasicTable/index.js +2 -2
- package/src/components/CBreadcrumbs/CBreadcrumbs.vue +38 -38
- package/src/components/CBreadcrumbs/index.js +2 -2
- package/src/components/CButton/CButton.vue +147 -147
- package/src/components/CButton/index.js +2 -2
- package/src/components/CButtonGroup/CButtonGroup.vue +116 -116
- package/src/components/CButtonGroup/index.js +2 -2
- package/src/components/CButtonIcon/CButtonIcon.vue +91 -91
- package/src/components/CButtonIcon/index.js +2 -2
- package/src/components/CButtonLink/CButtonLink.vue +39 -39
- package/src/components/CButtonLink/index.js +2 -2
- package/src/components/CButtonSelect/CButtonSelect.vue +103 -103
- package/src/components/CButtonSelect/index.js +2 -2
- package/src/components/CButtonWithDropdown/CButtonWithDropdown.vue +168 -168
- package/src/components/CButtonWithDropdown/index.js +2 -2
- package/src/components/CCalendar/CCalendar.vue +401 -401
- package/src/components/CCalendar/index.js +3 -3
- package/src/components/CCard/CCard.vue +49 -49
- package/src/components/CCard/index.js +2 -2
- package/src/components/CCheckbox/CCheckbox.vue +70 -70
- package/src/components/CCheckbox/index.js +2 -2
- package/src/components/CCollapsibleSection/CCollapsibleSection.vue +99 -99
- package/src/components/CCollapsibleSection/index.js +2 -2
- package/src/components/CColorDots/CColorDots.vue +35 -35
- package/src/components/CColorDots/index.js +3 -3
- package/src/components/CConfirmActionModal/CConfirmActionModal.vue +120 -120
- package/src/components/CConfirmActionModal/index.js +3 -3
- package/src/components/CDatepicker/CDatepicker.vue +139 -139
- package/src/components/CDatepicker/index.js +2 -2
- package/src/components/CDualSelect/CDualSelect.vue +193 -193
- package/src/components/CDualSelect/index.js +2 -2
- package/src/components/CEditor/CEditor.vue +96 -96
- package/src/components/CEditor/index.js +2 -2
- package/src/components/CFormSectionHeading/CFormSectionHeading.vue +53 -53
- package/src/components/CFormSectionHeading/index.js +2 -2
- package/src/components/CGroupedSelect/CGroupedSelect.vue +217 -217
- package/src/components/CGroupedSelect/index.js +3 -3
- package/src/components/CIcon/CIcon.vue +77 -77
- package/src/components/CIcon/index.js +2 -2
- package/src/components/CIconDropdown/CIconDropdown.vue +111 -111
- package/src/components/CIconDropdown/index.js +2 -2
- package/src/components/CInput/CInput.vue +120 -120
- package/src/components/CInput/index.js +2 -2
- package/src/components/CInputAddon/CInputAddon.vue +202 -202
- package/src/components/CInputAddon/index.js +2 -2
- package/src/components/CInputEmail/CInputEmail.vue +93 -93
- package/src/components/CInputEmail/index.js +2 -2
- package/src/components/CModalHeading/CModalHeading.vue +22 -22
- package/src/components/CModalHeading/index.js +2 -2
- package/src/components/CModuleHelpLinks/CModuleHelpLinks.vue +39 -39
- package/src/components/CModuleHelpLinks/index.js +3 -3
- package/src/components/CMultiselect/CMultiselect.vue +339 -339
- package/src/components/CMultiselect/index.js +2 -2
- package/src/components/CMultiselectr/CMultiselectr.vue +44 -44
- package/src/components/CMultiselectr/index.js +2 -2
- package/src/components/CPageHeading/CPageHeading.vue +56 -56
- package/src/components/CPageHeading/index.js +2 -2
- package/src/components/CPagination/CPagination.vue +202 -202
- package/src/components/CPagination/index.js +2 -2
- package/src/components/CPhoneNumber/CPhoneNumber.vue +81 -81
- package/src/components/CPhoneNumber/index.js +2 -2
- package/src/components/CRadio/CRadio.vue +106 -106
- package/src/components/CRadio/index.js +2 -2
- package/src/components/CRangeSlider/CRangeSlider.vue +55 -55
- package/src/components/CRangeSlider/index.js +2 -2
- package/src/components/CReorderableStackedList/CReorderableStackedList.vue +94 -94
- package/src/components/CReorderableStackedList/index.js +2 -2
- package/src/components/CSelect/CSelect.vue +348 -343
- package/src/components/CSelect/index.js +2 -2
- package/src/components/CSmallTimeline/CSmallTimeline.vue +40 -40
- package/src/components/CSmallTimeline/index.js +2 -2
- package/src/components/CStackedList/CStackedList.vue +132 -132
- package/src/components/CStackedList/index.js +2 -2
- package/src/components/CStats/CStats.vue +111 -111
- package/src/components/CStats/index.js +2 -2
- package/src/components/CSwitch/CSwitch.vue +140 -140
- package/src/components/CSwitch/index.js +2 -2
- package/src/components/CTable/CTable.vue +536 -536
- package/src/components/CTable/index.js +2 -2
- package/src/components/CTabs/CTabs.vue +111 -111
- package/src/components/CTabs/index.js +2 -2
- package/src/components/CTag/CTag.vue +36 -36
- package/src/components/CTag/index.js +2 -2
- package/src/components/CTextarea/CTextarea.vue +95 -95
- package/src/components/CTextarea/index.js +2 -2
- package/src/components/CTimeline/CTimeline.vue +237 -237
- package/src/components/CTimeline/index.js +2 -2
- package/src/components/CUpload/CUpload.vue +231 -231
- package/src/components/CUpload/index.js +2 -2
- package/src/components/index.js +48 -48
- package/src/icons.js +285 -285
- package/src/main.js +22 -22
- package/src/stories/CAlerts.stories.js +37 -37
- package/src/stories/CAnchorTabs.stories.js +29 -29
- package/src/stories/CAnchorTag.stories.js +36 -36
- package/src/stories/CAvatar.stories.js +38 -38
- package/src/stories/CAvatarGroup.stories.js +100 -100
- package/src/stories/CBasicTable.stories.js +316 -316
- package/src/stories/CBreadcrumbs.stories.js +24 -24
- package/src/stories/CButton.stories.js +46 -46
- package/src/stories/CButtonGroup.stories.js +33 -33
- package/src/stories/CButtonIcon.stories.js +27 -27
- package/src/stories/CButtonLink.stories.js +24 -24
- package/src/stories/CButtonSelect.stories.js +32 -32
- package/src/stories/CButtonWithDropdown.stories.js +41 -41
- package/src/stories/CCalendar.stories.js +16 -16
- package/src/stories/CCard.stories.js +30 -30
- package/src/stories/CCheckbox.stories.js +29 -29
- package/src/stories/CCollapsibleSection.stories.js +28 -28
- package/src/stories/CColorDots.stories.js +28 -28
- package/src/stories/CConfirmActionModal.stories.js +59 -59
- package/src/stories/CDatepicker.stories.js +30 -30
- package/src/stories/CDualSelect.stories.js +29 -29
- package/src/stories/CEditor.stories.js +30 -30
- package/src/stories/CFormSectionHeading.stories.js +34 -34
- package/src/stories/CGroupedSelect.stories.js +69 -69
- package/src/stories/CIcon.stories.js +26 -26
- package/src/stories/CIconDropdown.stories.js +39 -39
- package/src/stories/CInput.stories.js +36 -36
- package/src/stories/CInputAddon.stories.js +37 -37
- package/src/stories/CInputEmail.stories.js +27 -27
- package/src/stories/CModalHeading.stories.js +25 -25
- package/src/stories/CModuleHelpLinks.stories.js +25 -25
- package/src/stories/CMultiselect.stories.js +97 -97
- package/src/stories/CMultiselectr.stories.js +23 -23
- package/src/stories/CPageHeading.stories.js +32 -32
- package/src/stories/CPagination.stories.js +30 -30
- package/src/stories/CPhoneNumber.stories.js +29 -29
- package/src/stories/CRadio.stories.js +36 -36
- package/src/stories/CRangeSlider.stories.js +23 -23
- package/src/stories/CReorderableStackedList.stories.js +23 -23
- package/src/stories/CSelect.stories.js +50 -50
- package/src/stories/CSmallTimeline.stories.js +26 -26
- package/src/stories/CStackedList.stories.js +37 -37
- package/src/stories/CStats.stories.js +33 -33
- package/src/stories/CSwitch.stories.js +28 -28
- package/src/stories/CTable.stories.js +77 -77
- package/src/stories/CTabs.stories.js +33 -33
- package/src/stories/CTag.stories.js +23 -23
- package/src/stories/CTextarea.stories.js +32 -32
- package/src/stories/CTimeline.stories.js +26 -26
- package/src/stories/CUpload.stories.js +36 -36
- package/src/stories/Introduction.stories.mdx +207 -207
- package/src/stories/Page.vue +88 -88
- package/src/stories/assets/code-brackets.svg +0 -0
- package/src/stories/assets/colors.svg +0 -0
- package/src/stories/assets/comments.svg +0 -0
- package/src/stories/assets/direction.svg +0 -0
- package/src/stories/assets/flow.svg +0 -0
- package/src/stories/assets/plugin.svg +0 -0
- package/src/stories/assets/repo.svg +0 -0
- package/src/stories/assets/stackalt.svg +0 -0
- package/src/stories/header.css +26 -26
- package/src/stories/page.css +69 -69
- package/src/stories/utils.css +17 -17
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CMultiselect from './CMultiselect.vue'
|
|
2
|
-
|
|
1
|
+
import CMultiselect from './CMultiselect.vue'
|
|
2
|
+
|
|
3
3
|
export default CMultiselect
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<!-- <label class="text-sm text-gray-900">{{label}}</label>
|
|
4
|
-
<multiselect class="mt-1" v-model="value" :options="options" :multiple="true">
|
|
5
|
-
</multiselect> -->
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
<script>
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
// name: "CMultiselect",
|
|
12
|
-
// components: { Multiselect },
|
|
13
|
-
// props: {
|
|
14
|
-
// options: {
|
|
15
|
-
// type: Array,
|
|
16
|
-
// required: true,
|
|
17
|
-
// },
|
|
18
|
-
// label:String
|
|
19
|
-
// },
|
|
20
|
-
// computed: {},
|
|
21
|
-
// data() {
|
|
22
|
-
// return {
|
|
23
|
-
// value: [],
|
|
24
|
-
// };
|
|
25
|
-
// },
|
|
26
|
-
};
|
|
27
|
-
</script>
|
|
28
|
-
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
|
|
29
|
-
<style>
|
|
30
|
-
.multiselect__tags {
|
|
31
|
-
border: 1px solid #d1d5db;
|
|
32
|
-
}
|
|
33
|
-
.multiselect__placeholder {
|
|
34
|
-
color: #111827;
|
|
35
|
-
}
|
|
36
|
-
.multiselect__tag,
|
|
37
|
-
.multiselect__tag-icon:after,
|
|
38
|
-
.multiselect__tag-icon:hover,
|
|
39
|
-
.multiselect__option--highlight,
|
|
40
|
-
.multiselect__option--highlight::after {
|
|
41
|
-
background: #0369A1;
|
|
42
|
-
color: #fff;
|
|
43
|
-
}
|
|
44
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<!-- <label class="text-sm text-gray-900">{{label}}</label>
|
|
4
|
+
<multiselect class="mt-1" v-model="value" :options="options" :multiple="true">
|
|
5
|
+
</multiselect> -->
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
// name: "CMultiselect",
|
|
12
|
+
// components: { Multiselect },
|
|
13
|
+
// props: {
|
|
14
|
+
// options: {
|
|
15
|
+
// type: Array,
|
|
16
|
+
// required: true,
|
|
17
|
+
// },
|
|
18
|
+
// label:String
|
|
19
|
+
// },
|
|
20
|
+
// computed: {},
|
|
21
|
+
// data() {
|
|
22
|
+
// return {
|
|
23
|
+
// value: [],
|
|
24
|
+
// };
|
|
25
|
+
// },
|
|
26
|
+
};
|
|
27
|
+
</script>
|
|
28
|
+
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
|
|
29
|
+
<style>
|
|
30
|
+
.multiselect__tags {
|
|
31
|
+
border: 1px solid #d1d5db;
|
|
32
|
+
}
|
|
33
|
+
.multiselect__placeholder {
|
|
34
|
+
color: #111827;
|
|
35
|
+
}
|
|
36
|
+
.multiselect__tag,
|
|
37
|
+
.multiselect__tag-icon:after,
|
|
38
|
+
.multiselect__tag-icon:hover,
|
|
39
|
+
.multiselect__option--highlight,
|
|
40
|
+
.multiselect__option--highlight::after {
|
|
41
|
+
background: #0369A1;
|
|
42
|
+
color: #fff;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CMultiselect from './CMultiselect.vue'
|
|
2
|
-
|
|
1
|
+
import CMultiselect from './CMultiselect.vue'
|
|
2
|
+
|
|
3
3
|
export default CMultiselect
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="sticky top-0 z-10 -mx-16 bg-transparent px-16 backdrop-blur-xl">
|
|
3
|
-
<div
|
|
4
|
-
class="flex flex-col items-start justify-between pt-4 pb-2 sm:max-w-full sm:flex-row sm:items-center sm:pb-1"
|
|
5
|
-
>
|
|
6
|
-
<div>
|
|
7
|
-
<h2
|
|
8
|
-
class="mt-1 text-xl font-bold leading-7 text-gray-900 sm:mt-0 sm:truncate sm:text-xl"
|
|
9
|
-
>
|
|
10
|
-
{{ title }}
|
|
11
|
-
</h2>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="justify-self-end">
|
|
14
|
-
<slot></slot>
|
|
15
|
-
<div v-if="buttonType" class="mt-5 flex sm:mt-0 lg:mt-0 lg:ml-4">
|
|
16
|
-
<span class="sm:ml-3">
|
|
17
|
-
<c-button
|
|
18
|
-
:label="buttonType.label"
|
|
19
|
-
:icon="buttonType.icon"
|
|
20
|
-
:type="buttonType.type"
|
|
21
|
-
@action="emitAction"
|
|
22
|
-
></c-button>
|
|
23
|
-
</span>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
import CButton from "../CButton/CButton.vue";
|
|
32
|
-
export default {
|
|
33
|
-
name: "CPageHeading",
|
|
34
|
-
components: { CButton },
|
|
35
|
-
props: {
|
|
36
|
-
title: {
|
|
37
|
-
type: String,
|
|
38
|
-
required: true,
|
|
39
|
-
},
|
|
40
|
-
description: { type: String },
|
|
41
|
-
helpVideo: {
|
|
42
|
-
type: String,
|
|
43
|
-
},
|
|
44
|
-
helpArticle: { type: String },
|
|
45
|
-
buttonType: { type: Object },
|
|
46
|
-
callAction: {
|
|
47
|
-
type: Function,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
methods: {
|
|
51
|
-
emitAction() {
|
|
52
|
-
this.$emit("callAction");
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sticky top-0 z-10 -mx-16 bg-transparent px-16 backdrop-blur-xl">
|
|
3
|
+
<div
|
|
4
|
+
class="flex flex-col items-start justify-between pt-4 pb-2 sm:max-w-full sm:flex-row sm:items-center sm:pb-1"
|
|
5
|
+
>
|
|
6
|
+
<div>
|
|
7
|
+
<h2
|
|
8
|
+
class="mt-1 text-xl font-bold leading-7 text-gray-900 sm:mt-0 sm:truncate sm:text-xl"
|
|
9
|
+
>
|
|
10
|
+
{{ title }}
|
|
11
|
+
</h2>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="justify-self-end">
|
|
14
|
+
<slot></slot>
|
|
15
|
+
<div v-if="buttonType" class="mt-5 flex sm:mt-0 lg:mt-0 lg:ml-4">
|
|
16
|
+
<span class="sm:ml-3">
|
|
17
|
+
<c-button
|
|
18
|
+
:label="buttonType.label"
|
|
19
|
+
:icon="buttonType.icon"
|
|
20
|
+
:type="buttonType.type"
|
|
21
|
+
@action="emitAction"
|
|
22
|
+
></c-button>
|
|
23
|
+
</span>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import CButton from "../CButton/CButton.vue";
|
|
32
|
+
export default {
|
|
33
|
+
name: "CPageHeading",
|
|
34
|
+
components: { CButton },
|
|
35
|
+
props: {
|
|
36
|
+
title: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
description: { type: String },
|
|
41
|
+
helpVideo: {
|
|
42
|
+
type: String,
|
|
43
|
+
},
|
|
44
|
+
helpArticle: { type: String },
|
|
45
|
+
buttonType: { type: Object },
|
|
46
|
+
callAction: {
|
|
47
|
+
type: Function,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
methods: {
|
|
51
|
+
emitAction() {
|
|
52
|
+
this.$emit("callAction");
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
</script>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CPageHeading from './CPageHeading.vue'
|
|
2
|
-
|
|
1
|
+
import CPageHeading from './CPageHeading.vue'
|
|
2
|
+
|
|
3
3
|
export default CPageHeading
|
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="flex items-center justify-between border-gray-200 bg-white px-4 py-3 sm:px-6"
|
|
4
|
-
>
|
|
5
|
-
<div class="flex flex-1 justify-between sm:hidden">
|
|
6
|
-
<a
|
|
7
|
-
href="#"
|
|
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
|
-
>
|
|
10
|
-
Previous
|
|
11
|
-
</a>
|
|
12
|
-
<a
|
|
13
|
-
href="#"
|
|
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
|
-
>
|
|
16
|
-
Next
|
|
17
|
-
</a>
|
|
18
|
-
</div>
|
|
19
|
-
<div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
|
|
20
|
-
<div>
|
|
21
|
-
<p class="text-sm text-gray-700">
|
|
22
|
-
Showing
|
|
23
|
-
<span class="font-medium">{{ setPaginationRecords.from }}</span>
|
|
24
|
-
to
|
|
25
|
-
<span class="font-medium">{{ setPaginationRecords.to }}</span>
|
|
26
|
-
of
|
|
27
|
-
<span class="font-medium">{{
|
|
28
|
-
setPaginationRecords.totalRecords
|
|
29
|
-
}}</span>
|
|
30
|
-
results
|
|
31
|
-
</p>
|
|
32
|
-
</div>
|
|
33
|
-
<div>
|
|
34
|
-
<nav
|
|
35
|
-
class="relative z-0 inline-flex -space-x-px rounded-md shadow-sm"
|
|
36
|
-
aria-label="Pagination"
|
|
37
|
-
>
|
|
38
|
-
<div class="hidden md:-mt-px md:flex">
|
|
39
|
-
<div
|
|
40
|
-
href="#"
|
|
41
|
-
@click="currentPageNumber == '1' ? '' : goToPreviousPage()"
|
|
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"
|
|
43
|
-
:class="
|
|
44
|
-
currentPageNumber == '1'
|
|
45
|
-
? 'pointer-events-none text-gray-400'
|
|
46
|
-
: 'group cursor-pointer text-gray-500 hover:text-gray-700'
|
|
47
|
-
"
|
|
48
|
-
>
|
|
49
|
-
<span class="sr-only">Previous</span>
|
|
50
|
-
<!-- Heroicon name: solid/chevron-left -->
|
|
51
|
-
<svg
|
|
52
|
-
class="h-5 w-5"
|
|
53
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
-
viewBox="0 0 20 20"
|
|
55
|
-
fill="currentColor"
|
|
56
|
-
aria-hidden="true"
|
|
57
|
-
>
|
|
58
|
-
<path
|
|
59
|
-
fill-rule="evenodd"
|
|
60
|
-
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"
|
|
61
|
-
clip-rule="evenodd"
|
|
62
|
-
/>
|
|
63
|
-
</svg>
|
|
64
|
-
</div>
|
|
65
|
-
<div
|
|
66
|
-
v-for="page in pageRange"
|
|
67
|
-
:key="page"
|
|
68
|
-
class="cursor-pointer"
|
|
69
|
-
:class="[
|
|
70
|
-
page == currentPageNumber
|
|
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'
|
|
72
|
-
: '',
|
|
73
|
-
page === '...'
|
|
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'
|
|
75
|
-
: '',
|
|
76
|
-
page !== currentPageNumber && page !== '...'
|
|
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'
|
|
78
|
-
: '',
|
|
79
|
-
page == currentPageNumber + 1 ? 'border-l-0' : '',
|
|
80
|
-
]"
|
|
81
|
-
@click="changePage(page)"
|
|
82
|
-
>
|
|
83
|
-
<div v-if="page === '...'">...</div>
|
|
84
|
-
<div v-else>
|
|
85
|
-
{{ page }}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
<div
|
|
89
|
-
href="#"
|
|
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
|
-
@click="currentPageNumber == lastPageNumber ? '' : goToNextPage()"
|
|
92
|
-
:class="
|
|
93
|
-
currentPageNumber == lastPageNumber
|
|
94
|
-
? 'pointer-events-none text-gray-400'
|
|
95
|
-
: 'group cursor-pointer text-gray-500 hover:text-gray-700'
|
|
96
|
-
"
|
|
97
|
-
>
|
|
98
|
-
<span class="sr-only">Next</span>
|
|
99
|
-
<!-- Heroicon name: solid/chevron-right -->
|
|
100
|
-
<svg
|
|
101
|
-
class="h-5 w-5"
|
|
102
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
103
|
-
viewBox="0 0 20 20"
|
|
104
|
-
fill="currentColor"
|
|
105
|
-
aria-hidden="true"
|
|
106
|
-
>
|
|
107
|
-
<path
|
|
108
|
-
fill-rule="evenodd"
|
|
109
|
-
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"
|
|
110
|
-
clip-rule="evenodd"
|
|
111
|
-
/>
|
|
112
|
-
</svg>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</nav>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
</template>
|
|
120
|
-
<script>
|
|
121
|
-
import { isEqual } from "lodash-es";
|
|
122
|
-
|
|
123
|
-
export default {
|
|
124
|
-
name: "CPagination",
|
|
125
|
-
props: {
|
|
126
|
-
setPaginationRecords: {
|
|
127
|
-
type: Object,
|
|
128
|
-
},
|
|
129
|
-
setCurrentPage: {
|
|
130
|
-
type: Function,
|
|
131
|
-
},
|
|
132
|
-
setPreviousPage: {
|
|
133
|
-
type: Function,
|
|
134
|
-
},
|
|
135
|
-
setNextPage: {
|
|
136
|
-
type: Function,
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
components: {},
|
|
140
|
-
data() {
|
|
141
|
-
return {
|
|
142
|
-
currentPageNumber: this.setPaginationRecords.currentPage,
|
|
143
|
-
lastPageNumber: this.setPaginationRecords.lastPage,
|
|
144
|
-
};
|
|
145
|
-
},
|
|
146
|
-
computed: {
|
|
147
|
-
pageRange() {
|
|
148
|
-
var current = this.setPaginationRecords.currentPage,
|
|
149
|
-
last = this.setPaginationRecords.lastPage,
|
|
150
|
-
delta = 2,
|
|
151
|
-
left = current - delta,
|
|
152
|
-
right = current + delta + 1,
|
|
153
|
-
range = [],
|
|
154
|
-
rangeWithDots = [],
|
|
155
|
-
l;
|
|
156
|
-
for (let i = 1; i <= last; i++) {
|
|
157
|
-
if (i == 1 || i == last || (i >= left && i < right)) {
|
|
158
|
-
range.push(i);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
for (let i of range) {
|
|
162
|
-
if (l) {
|
|
163
|
-
if (i - l === 2) {
|
|
164
|
-
rangeWithDots.push(l + 1);
|
|
165
|
-
} else if (i - l !== 1) {
|
|
166
|
-
rangeWithDots.push("...");
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
rangeWithDots.push(i);
|
|
170
|
-
l = i;
|
|
171
|
-
}
|
|
172
|
-
return rangeWithDots;
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
methods: {
|
|
176
|
-
changePage(page) {
|
|
177
|
-
if (page !== "...") {
|
|
178
|
-
this.$emit("setCurrentPage", page);
|
|
179
|
-
this.currentPageNumber = page;
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
goToPreviousPage() {
|
|
183
|
-
var previousPage = this.currentPageNumber - 1;
|
|
184
|
-
this.currentPageNumber = previousPage;
|
|
185
|
-
this.$emit("setPreviousPage", previousPage);
|
|
186
|
-
},
|
|
187
|
-
goToNextPage() {
|
|
188
|
-
var nextPage = this.currentPageNumber + 1;
|
|
189
|
-
this.currentPageNumber = nextPage;
|
|
190
|
-
this.$emit("setNextPage", nextPage);
|
|
191
|
-
},
|
|
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
|
-
},
|
|
201
|
-
};
|
|
202
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex items-center justify-between border-gray-200 bg-white px-4 py-3 sm:px-6"
|
|
4
|
+
>
|
|
5
|
+
<div class="flex flex-1 justify-between sm:hidden">
|
|
6
|
+
<a
|
|
7
|
+
href="#"
|
|
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
|
+
>
|
|
10
|
+
Previous
|
|
11
|
+
</a>
|
|
12
|
+
<a
|
|
13
|
+
href="#"
|
|
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
|
+
>
|
|
16
|
+
Next
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
|
|
20
|
+
<div>
|
|
21
|
+
<p class="text-sm text-gray-700">
|
|
22
|
+
Showing
|
|
23
|
+
<span class="font-medium">{{ setPaginationRecords.from }}</span>
|
|
24
|
+
to
|
|
25
|
+
<span class="font-medium">{{ setPaginationRecords.to }}</span>
|
|
26
|
+
of
|
|
27
|
+
<span class="font-medium">{{
|
|
28
|
+
setPaginationRecords.totalRecords
|
|
29
|
+
}}</span>
|
|
30
|
+
results
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
<nav
|
|
35
|
+
class="relative z-0 inline-flex -space-x-px rounded-md shadow-sm"
|
|
36
|
+
aria-label="Pagination"
|
|
37
|
+
>
|
|
38
|
+
<div class="hidden md:-mt-px md:flex">
|
|
39
|
+
<div
|
|
40
|
+
href="#"
|
|
41
|
+
@click="currentPageNumber == '1' ? '' : goToPreviousPage()"
|
|
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"
|
|
43
|
+
:class="
|
|
44
|
+
currentPageNumber == '1'
|
|
45
|
+
? 'pointer-events-none text-gray-400'
|
|
46
|
+
: 'group cursor-pointer text-gray-500 hover:text-gray-700'
|
|
47
|
+
"
|
|
48
|
+
>
|
|
49
|
+
<span class="sr-only">Previous</span>
|
|
50
|
+
<!-- Heroicon name: solid/chevron-left -->
|
|
51
|
+
<svg
|
|
52
|
+
class="h-5 w-5"
|
|
53
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
+
viewBox="0 0 20 20"
|
|
55
|
+
fill="currentColor"
|
|
56
|
+
aria-hidden="true"
|
|
57
|
+
>
|
|
58
|
+
<path
|
|
59
|
+
fill-rule="evenodd"
|
|
60
|
+
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"
|
|
61
|
+
clip-rule="evenodd"
|
|
62
|
+
/>
|
|
63
|
+
</svg>
|
|
64
|
+
</div>
|
|
65
|
+
<div
|
|
66
|
+
v-for="page in pageRange"
|
|
67
|
+
:key="page"
|
|
68
|
+
class="cursor-pointer"
|
|
69
|
+
:class="[
|
|
70
|
+
page == currentPageNumber
|
|
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'
|
|
72
|
+
: '',
|
|
73
|
+
page === '...'
|
|
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'
|
|
75
|
+
: '',
|
|
76
|
+
page !== currentPageNumber && page !== '...'
|
|
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'
|
|
78
|
+
: '',
|
|
79
|
+
page == currentPageNumber + 1 ? 'border-l-0' : '',
|
|
80
|
+
]"
|
|
81
|
+
@click="changePage(page)"
|
|
82
|
+
>
|
|
83
|
+
<div v-if="page === '...'">...</div>
|
|
84
|
+
<div v-else>
|
|
85
|
+
{{ page }}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
<div
|
|
89
|
+
href="#"
|
|
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
|
+
@click="currentPageNumber == lastPageNumber ? '' : goToNextPage()"
|
|
92
|
+
:class="
|
|
93
|
+
currentPageNumber == lastPageNumber
|
|
94
|
+
? 'pointer-events-none text-gray-400'
|
|
95
|
+
: 'group cursor-pointer text-gray-500 hover:text-gray-700'
|
|
96
|
+
"
|
|
97
|
+
>
|
|
98
|
+
<span class="sr-only">Next</span>
|
|
99
|
+
<!-- Heroicon name: solid/chevron-right -->
|
|
100
|
+
<svg
|
|
101
|
+
class="h-5 w-5"
|
|
102
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
103
|
+
viewBox="0 0 20 20"
|
|
104
|
+
fill="currentColor"
|
|
105
|
+
aria-hidden="true"
|
|
106
|
+
>
|
|
107
|
+
<path
|
|
108
|
+
fill-rule="evenodd"
|
|
109
|
+
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"
|
|
110
|
+
clip-rule="evenodd"
|
|
111
|
+
/>
|
|
112
|
+
</svg>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</nav>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
120
|
+
<script>
|
|
121
|
+
import { isEqual } from "lodash-es";
|
|
122
|
+
|
|
123
|
+
export default {
|
|
124
|
+
name: "CPagination",
|
|
125
|
+
props: {
|
|
126
|
+
setPaginationRecords: {
|
|
127
|
+
type: Object,
|
|
128
|
+
},
|
|
129
|
+
setCurrentPage: {
|
|
130
|
+
type: Function,
|
|
131
|
+
},
|
|
132
|
+
setPreviousPage: {
|
|
133
|
+
type: Function,
|
|
134
|
+
},
|
|
135
|
+
setNextPage: {
|
|
136
|
+
type: Function,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
components: {},
|
|
140
|
+
data() {
|
|
141
|
+
return {
|
|
142
|
+
currentPageNumber: this.setPaginationRecords.currentPage,
|
|
143
|
+
lastPageNumber: this.setPaginationRecords.lastPage,
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
computed: {
|
|
147
|
+
pageRange() {
|
|
148
|
+
var current = this.setPaginationRecords.currentPage,
|
|
149
|
+
last = this.setPaginationRecords.lastPage,
|
|
150
|
+
delta = 2,
|
|
151
|
+
left = current - delta,
|
|
152
|
+
right = current + delta + 1,
|
|
153
|
+
range = [],
|
|
154
|
+
rangeWithDots = [],
|
|
155
|
+
l;
|
|
156
|
+
for (let i = 1; i <= last; i++) {
|
|
157
|
+
if (i == 1 || i == last || (i >= left && i < right)) {
|
|
158
|
+
range.push(i);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
for (let i of range) {
|
|
162
|
+
if (l) {
|
|
163
|
+
if (i - l === 2) {
|
|
164
|
+
rangeWithDots.push(l + 1);
|
|
165
|
+
} else if (i - l !== 1) {
|
|
166
|
+
rangeWithDots.push("...");
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
rangeWithDots.push(i);
|
|
170
|
+
l = i;
|
|
171
|
+
}
|
|
172
|
+
return rangeWithDots;
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
methods: {
|
|
176
|
+
changePage(page) {
|
|
177
|
+
if (page !== "...") {
|
|
178
|
+
this.$emit("setCurrentPage", page);
|
|
179
|
+
this.currentPageNumber = page;
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
goToPreviousPage() {
|
|
183
|
+
var previousPage = this.currentPageNumber - 1;
|
|
184
|
+
this.currentPageNumber = previousPage;
|
|
185
|
+
this.$emit("setPreviousPage", previousPage);
|
|
186
|
+
},
|
|
187
|
+
goToNextPage() {
|
|
188
|
+
var nextPage = this.currentPageNumber + 1;
|
|
189
|
+
this.currentPageNumber = nextPage;
|
|
190
|
+
this.$emit("setNextPage", nextPage);
|
|
191
|
+
},
|
|
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
|
+
},
|
|
201
|
+
};
|
|
202
|
+
</script>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CPagination from './CPagination.vue'
|
|
2
|
-
|
|
1
|
+
import CPagination from './CPagination.vue'
|
|
2
|
+
|
|
3
3
|
export default CPagination
|