classcard-ui 0.2.475 → 0.2.481
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 +67 -59
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +67 -59
- 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 +104 -104
- 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 +89 -89
- 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 +150 -150
- package/src/components/CButton/index.js +2 -2
- package/src/components/CButtonGroup/CButtonGroup.vue +100 -100
- package/src/components/CButtonGroup/index.js +2 -2
- package/src/components/CButtonIcon/CButtonIcon.vue +108 -108
- 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/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 -118
- package/src/components/CConfirmActionModal/index.js +3 -3
- package/src/components/CDatepicker/CDatepicker.vue +134 -134
- 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 +91 -91
- package/src/components/CEditor/index.js +2 -2
- package/src/components/CFormSectionHeading/CFormSectionHeading.vue +52 -52
- package/src/components/CFormSectionHeading/index.js +2 -2
- package/src/components/CGroupedSelect/CGroupedSelect.vue +212 -212
- package/src/components/CGroupedSelect/index.js +3 -3
- package/src/components/CIcon/CIcon.vue +72 -72
- package/src/components/CIcon/index.js +2 -2
- package/src/components/CIconDropdown/CIconDropdown.vue +94 -94
- package/src/components/CIconDropdown/index.js +2 -2
- package/src/components/CInput/CInput.vue +115 -115
- package/src/components/CInput/index.js +2 -2
- package/src/components/CInputAddon/CInputAddon.vue +199 -199
- package/src/components/CInputAddon/index.js +2 -2
- package/src/components/CInputEmail/CInputEmail.vue +84 -84
- 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 +313 -313
- 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 +62 -62
- package/src/components/CPhoneNumber/index.js +2 -2
- package/src/components/CRadio/CRadio.vue +70 -70
- 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 +89 -89
- package/src/components/CReorderableStackedList/index.js +2 -2
- package/src/components/CSelect/CSelect.vue +283 -283
- 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 +87 -87
- package/src/components/CStackedList/index.js +2 -2
- package/src/components/CStats/CStats.vue +88 -88
- package/src/components/CStats/index.js +2 -2
- package/src/components/CSwitch/CSwitch.vue +132 -132
- package/src/components/CSwitch/index.js +2 -2
- package/src/components/CTable/CTable.vue +501 -495
- package/src/components/CTable/index.js +2 -2
- package/src/components/CTabs/CTabs.vue +107 -107
- 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 +85 -85
- 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 +196 -196
- package/src/components/CUpload/index.js +2 -2
- package/src/components/index.js +47 -47
- package/src/icons.js +244 -244
- 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/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 +29 -29
- 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,87 +1,87 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<ul>
|
|
4
|
-
<li
|
|
5
|
-
v-for="items in listItems"
|
|
6
|
-
v-bind:key="items.size"
|
|
7
|
-
class="flex items-center justify-between py-4"
|
|
8
|
-
:class="{ 'cursor-pointer': items.collapse, 'border-b border-gray-200': divider === true }"
|
|
9
|
-
v-on="items.collapse ? { click: () => collapseList() } : null"
|
|
10
|
-
>
|
|
11
|
-
<div class="flex">
|
|
12
|
-
<c-icon
|
|
13
|
-
v-if="items.collapse"
|
|
14
|
-
:name="showSection ? 'chevron-down' : 'chevron-right'"
|
|
15
|
-
type="solid"
|
|
16
|
-
class="mt-3 mr-3 h-5 w-5 shrink-0 text-gray-900"
|
|
17
|
-
></c-icon>
|
|
18
|
-
<c-avatar
|
|
19
|
-
:size="items.size"
|
|
20
|
-
:rounded="items.rounded"
|
|
21
|
-
:image="items.image"
|
|
22
|
-
class="shrink-0"
|
|
23
|
-
></c-avatar>
|
|
24
|
-
<div class="ml-3">
|
|
25
|
-
<div class="flex pb-1">
|
|
26
|
-
<p class="text-sm font-medium text-gray-900">
|
|
27
|
-
{{ items.heading }}
|
|
28
|
-
</p>
|
|
29
|
-
<c-tag
|
|
30
|
-
v-if="items.tag"
|
|
31
|
-
:label="items.tagLabel"
|
|
32
|
-
:color="items.tagColor"
|
|
33
|
-
class="relative bottom-0.5 ml-2.5"
|
|
34
|
-
></c-tag>
|
|
35
|
-
</div>
|
|
36
|
-
<p class="text-sm text-gray-500">{{ items.description }}</p>
|
|
37
|
-
<div v-if="showSection" class="mt-3">
|
|
38
|
-
<slot></slot>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<!-- <c-icon
|
|
43
|
-
v-if="items.listIcon"
|
|
44
|
-
name="trash"
|
|
45
|
-
class="h-5 w-5 text-gray-500 hover:text-red-500 cursor-pointer"
|
|
46
|
-
type="solid"
|
|
47
|
-
></c-icon> -->
|
|
48
|
-
<button
|
|
49
|
-
v-if="items.listIcon"
|
|
50
|
-
type="button"
|
|
51
|
-
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"
|
|
52
|
-
>
|
|
53
|
-
<c-icon name="trash" type="solid" class="h-5 w-5 hover:text-red-800"></c-icon>
|
|
54
|
-
</button>
|
|
55
|
-
</li>
|
|
56
|
-
</ul>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
59
|
-
<script>
|
|
60
|
-
import CAvatar from "../CAvatar/CAvatar.vue";
|
|
61
|
-
import CTag from "../CTag/CTag.vue";
|
|
62
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
63
|
-
export default {
|
|
64
|
-
name: "CStackedList",
|
|
65
|
-
components: { CAvatar, CTag, CIcon },
|
|
66
|
-
props: {
|
|
67
|
-
listItems: {
|
|
68
|
-
type: Array,
|
|
69
|
-
required: true,
|
|
70
|
-
},
|
|
71
|
-
divider: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: true,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
data() {
|
|
77
|
-
return {
|
|
78
|
-
showSection: false,
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
methods: {
|
|
82
|
-
collapseList() {
|
|
83
|
-
this.showSection = !this.showSection;
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<ul>
|
|
4
|
+
<li
|
|
5
|
+
v-for="items in listItems"
|
|
6
|
+
v-bind:key="items.size"
|
|
7
|
+
class="flex items-center justify-between py-4"
|
|
8
|
+
:class="{ 'cursor-pointer': items.collapse, 'border-b border-gray-200': divider === true }"
|
|
9
|
+
v-on="items.collapse ? { click: () => collapseList() } : null"
|
|
10
|
+
>
|
|
11
|
+
<div class="flex">
|
|
12
|
+
<c-icon
|
|
13
|
+
v-if="items.collapse"
|
|
14
|
+
:name="showSection ? 'chevron-down' : 'chevron-right'"
|
|
15
|
+
type="solid"
|
|
16
|
+
class="mt-3 mr-3 h-5 w-5 shrink-0 text-gray-900"
|
|
17
|
+
></c-icon>
|
|
18
|
+
<c-avatar
|
|
19
|
+
:size="items.size"
|
|
20
|
+
:rounded="items.rounded"
|
|
21
|
+
:image="items.image"
|
|
22
|
+
class="shrink-0"
|
|
23
|
+
></c-avatar>
|
|
24
|
+
<div class="ml-3">
|
|
25
|
+
<div class="flex pb-1">
|
|
26
|
+
<p class="text-sm font-medium text-gray-900">
|
|
27
|
+
{{ items.heading }}
|
|
28
|
+
</p>
|
|
29
|
+
<c-tag
|
|
30
|
+
v-if="items.tag"
|
|
31
|
+
:label="items.tagLabel"
|
|
32
|
+
:color="items.tagColor"
|
|
33
|
+
class="relative bottom-0.5 ml-2.5"
|
|
34
|
+
></c-tag>
|
|
35
|
+
</div>
|
|
36
|
+
<p class="text-sm text-gray-500">{{ items.description }}</p>
|
|
37
|
+
<div v-if="showSection" class="mt-3">
|
|
38
|
+
<slot></slot>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<!-- <c-icon
|
|
43
|
+
v-if="items.listIcon"
|
|
44
|
+
name="trash"
|
|
45
|
+
class="h-5 w-5 text-gray-500 hover:text-red-500 cursor-pointer"
|
|
46
|
+
type="solid"
|
|
47
|
+
></c-icon> -->
|
|
48
|
+
<button
|
|
49
|
+
v-if="items.listIcon"
|
|
50
|
+
type="button"
|
|
51
|
+
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"
|
|
52
|
+
>
|
|
53
|
+
<c-icon name="trash" type="solid" class="h-5 w-5 hover:text-red-800"></c-icon>
|
|
54
|
+
</button>
|
|
55
|
+
</li>
|
|
56
|
+
</ul>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
<script>
|
|
60
|
+
import CAvatar from "../CAvatar/CAvatar.vue";
|
|
61
|
+
import CTag from "../CTag/CTag.vue";
|
|
62
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
63
|
+
export default {
|
|
64
|
+
name: "CStackedList",
|
|
65
|
+
components: { CAvatar, CTag, CIcon },
|
|
66
|
+
props: {
|
|
67
|
+
listItems: {
|
|
68
|
+
type: Array,
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
divider: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
data() {
|
|
77
|
+
return {
|
|
78
|
+
showSection: false,
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
collapseList() {
|
|
83
|
+
this.showSection = !this.showSection;
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
</script>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CStackedList from './CStackedList.vue'
|
|
2
|
-
|
|
1
|
+
import CStackedList from './CStackedList.vue'
|
|
2
|
+
|
|
3
3
|
export default CStackedList
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- <div>
|
|
3
|
-
<dl class="mt-5 sm:flex sm:flex-col md:flex md:flex-row justify-between">
|
|
4
|
-
<div
|
|
5
|
-
:class="index == statsCount.length - 1 ? '' : 'mr-2'"
|
|
6
|
-
class="bg-white w-full overflow-hidden shadow rounded-lg"
|
|
7
|
-
v-for="(count, index) in statsCount"
|
|
8
|
-
v-bind:key="count.number"
|
|
9
|
-
>
|
|
10
|
-
<div class="px-4 pt-3 pb-1 flex">
|
|
11
|
-
<c-icon
|
|
12
|
-
v-if="count.icon"
|
|
13
|
-
:name="count.icon.name"
|
|
14
|
-
:type="count.icon.type"
|
|
15
|
-
:class="count.icon.class"
|
|
16
|
-
></c-icon>
|
|
17
|
-
<div :class="count.icon ? 'ml-3' : ''">
|
|
18
|
-
<dt class="text-sm text-gray-500 flex">
|
|
19
|
-
<span>{{ count.label }}</span>
|
|
20
|
-
<span class="text-sm text-gray-900 ml-1">{{ count.number }}</span>
|
|
21
|
-
</dt>
|
|
22
|
-
<dd class="text-2xl font-semibold text-gray-900">
|
|
23
|
-
{{ count.totalCount }}
|
|
24
|
-
</dd>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="ml-12 pb-2 flex items-center" v-if="count.tag || count.days">
|
|
28
|
-
<c-tag v-if="count.tag" :label="count.tag.label" :color="count.tag.color"></c-tag>
|
|
29
|
-
<label v-if="count.days" class="text-xs text-gray-500 ml-1">{{ count.days }}</label>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</dl>
|
|
33
|
-
</div> -->
|
|
34
|
-
<!-- This example requires Tailwind CSS v2.0+ -->
|
|
35
|
-
<div>
|
|
36
|
-
<dl
|
|
37
|
-
class="mt-5 grid grid-cols-1 rounded-lg bg-gray-100 overflow-hidden divide-y divide-gray-200 md:grid-cols-3 md:divide-y-0 md:divide-x"
|
|
38
|
-
>
|
|
39
|
-
<div class="px-4 py-5 sm:p-6" v-for="count in statsCount" v-bind:key="count.number">
|
|
40
|
-
<div class="flex">
|
|
41
|
-
<c-icon
|
|
42
|
-
v-if="count.icon"
|
|
43
|
-
:name="count.icon.name"
|
|
44
|
-
:type="count.icon.type"
|
|
45
|
-
:class="count.icon.class"
|
|
46
|
-
></c-icon>
|
|
47
|
-
<div :class="count.icon ? 'ml-3' : ''">
|
|
48
|
-
<dt class="text-sm text-gray-500 flex">
|
|
49
|
-
<span>{{ count.label }}</span>
|
|
50
|
-
<span class="text-sm text-gray-900 ml-1">{{ count.number }}</span>
|
|
51
|
-
</dt>
|
|
52
|
-
<dd class="text-2xl font-semibold text-gray-900">
|
|
53
|
-
{{ count.totalCount }}
|
|
54
|
-
</dd>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<div class="ml-8 pb-2 flex items-center" v-if="count.tag || count.days">
|
|
58
|
-
<c-tag
|
|
59
|
-
v-if="count.tag"
|
|
60
|
-
:label="count.tag.label"
|
|
61
|
-
:color="count.tag.color"
|
|
62
|
-
:tagClasses="count.tag.class"
|
|
63
|
-
></c-tag>
|
|
64
|
-
<label v-if="count.days" class="text-xs text-gray-500 ml-1">{{ count.days }}</label>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</dl>
|
|
68
|
-
</div>
|
|
69
|
-
</template>
|
|
70
|
-
|
|
71
|
-
<script>
|
|
72
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
73
|
-
import CTag from "../CTag/CTag.vue";
|
|
74
|
-
export default {
|
|
75
|
-
name: "CStats",
|
|
76
|
-
components: { CIcon, CTag },
|
|
77
|
-
props: {
|
|
78
|
-
statsCount: {
|
|
79
|
-
type: Array,
|
|
80
|
-
},
|
|
81
|
-
// icon: {
|
|
82
|
-
// type: Object,
|
|
83
|
-
// },
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
</script>
|
|
87
|
-
|
|
88
|
-
<style></style>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- <div>
|
|
3
|
+
<dl class="mt-5 sm:flex sm:flex-col md:flex md:flex-row justify-between">
|
|
4
|
+
<div
|
|
5
|
+
:class="index == statsCount.length - 1 ? '' : 'mr-2'"
|
|
6
|
+
class="bg-white w-full overflow-hidden shadow rounded-lg"
|
|
7
|
+
v-for="(count, index) in statsCount"
|
|
8
|
+
v-bind:key="count.number"
|
|
9
|
+
>
|
|
10
|
+
<div class="px-4 pt-3 pb-1 flex">
|
|
11
|
+
<c-icon
|
|
12
|
+
v-if="count.icon"
|
|
13
|
+
:name="count.icon.name"
|
|
14
|
+
:type="count.icon.type"
|
|
15
|
+
:class="count.icon.class"
|
|
16
|
+
></c-icon>
|
|
17
|
+
<div :class="count.icon ? 'ml-3' : ''">
|
|
18
|
+
<dt class="text-sm text-gray-500 flex">
|
|
19
|
+
<span>{{ count.label }}</span>
|
|
20
|
+
<span class="text-sm text-gray-900 ml-1">{{ count.number }}</span>
|
|
21
|
+
</dt>
|
|
22
|
+
<dd class="text-2xl font-semibold text-gray-900">
|
|
23
|
+
{{ count.totalCount }}
|
|
24
|
+
</dd>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="ml-12 pb-2 flex items-center" v-if="count.tag || count.days">
|
|
28
|
+
<c-tag v-if="count.tag" :label="count.tag.label" :color="count.tag.color"></c-tag>
|
|
29
|
+
<label v-if="count.days" class="text-xs text-gray-500 ml-1">{{ count.days }}</label>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</dl>
|
|
33
|
+
</div> -->
|
|
34
|
+
<!-- This example requires Tailwind CSS v2.0+ -->
|
|
35
|
+
<div>
|
|
36
|
+
<dl
|
|
37
|
+
class="mt-5 grid grid-cols-1 rounded-lg bg-gray-100 overflow-hidden divide-y divide-gray-200 md:grid-cols-3 md:divide-y-0 md:divide-x"
|
|
38
|
+
>
|
|
39
|
+
<div class="px-4 py-5 sm:p-6" v-for="count in statsCount" v-bind:key="count.number">
|
|
40
|
+
<div class="flex">
|
|
41
|
+
<c-icon
|
|
42
|
+
v-if="count.icon"
|
|
43
|
+
:name="count.icon.name"
|
|
44
|
+
:type="count.icon.type"
|
|
45
|
+
:class="count.icon.class"
|
|
46
|
+
></c-icon>
|
|
47
|
+
<div :class="count.icon ? 'ml-3' : ''">
|
|
48
|
+
<dt class="text-sm text-gray-500 flex">
|
|
49
|
+
<span>{{ count.label }}</span>
|
|
50
|
+
<span class="text-sm text-gray-900 ml-1">{{ count.number }}</span>
|
|
51
|
+
</dt>
|
|
52
|
+
<dd class="text-2xl font-semibold text-gray-900">
|
|
53
|
+
{{ count.totalCount }}
|
|
54
|
+
</dd>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="ml-8 pb-2 flex items-center" v-if="count.tag || count.days">
|
|
58
|
+
<c-tag
|
|
59
|
+
v-if="count.tag"
|
|
60
|
+
:label="count.tag.label"
|
|
61
|
+
:color="count.tag.color"
|
|
62
|
+
:tagClasses="count.tag.class"
|
|
63
|
+
></c-tag>
|
|
64
|
+
<label v-if="count.days" class="text-xs text-gray-500 ml-1">{{ count.days }}</label>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</dl>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script>
|
|
72
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
73
|
+
import CTag from "../CTag/CTag.vue";
|
|
74
|
+
export default {
|
|
75
|
+
name: "CStats",
|
|
76
|
+
components: { CIcon, CTag },
|
|
77
|
+
props: {
|
|
78
|
+
statsCount: {
|
|
79
|
+
type: Array,
|
|
80
|
+
},
|
|
81
|
+
// icon: {
|
|
82
|
+
// type: Object,
|
|
83
|
+
// },
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<style></style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CStats from './CStats.vue'
|
|
2
|
-
|
|
1
|
+
import CStats from './CStats.vue'
|
|
2
|
+
|
|
3
3
|
export default CStats
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<!-- small toggle -->
|
|
4
|
-
<div
|
|
5
|
-
v-if="size === 'small'"
|
|
6
|
-
:class="label == '' ? 'items-center' : 'items-start'"
|
|
7
|
-
class="flex cursor-pointer justify-between"
|
|
8
|
-
>
|
|
9
|
-
<span
|
|
10
|
-
class="flex flex-grow flex-col"
|
|
11
|
-
id="smallleft"
|
|
12
|
-
v-if="direction == 'left'"
|
|
13
|
-
@click="switchValue"
|
|
14
|
-
>
|
|
15
|
-
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
16
|
-
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
17
|
-
</span>
|
|
18
|
-
<button
|
|
19
|
-
type="button"
|
|
20
|
-
class="group focus:outline-none relative inline-flex h-5 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-full focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:opacity-50"
|
|
21
|
-
aria-pressed="false"
|
|
22
|
-
@click="switchValue"
|
|
23
|
-
:disabled="disabled"
|
|
24
|
-
>
|
|
25
|
-
<span class="sr-only">Use setting</span>
|
|
26
|
-
<span
|
|
27
|
-
aria-hidden="true"
|
|
28
|
-
class="pointer-events-none absolute h-full w-full rounded-md bg-white"
|
|
29
|
-
></span>
|
|
30
|
-
<span
|
|
31
|
-
aria-hidden="true"
|
|
32
|
-
:class="{ 'bg-indigo-600': isToggle, 'bg-gray-200': !isToggle }"
|
|
33
|
-
class="pointer-events-none absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out"
|
|
34
|
-
></span>
|
|
35
|
-
<span
|
|
36
|
-
aria-hidden="true"
|
|
37
|
-
:class="{ 'translate-x-5': isToggle, 'translate-x-0': !isToggle }"
|
|
38
|
-
class="pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-full border border-gray-200 bg-white ring-0 transition-transform duration-200 ease-in-out"
|
|
39
|
-
></span>
|
|
40
|
-
</button>
|
|
41
|
-
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'" @click="switchValue">
|
|
42
|
-
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
43
|
-
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
44
|
-
</span>
|
|
45
|
-
</div>
|
|
46
|
-
<!-- large toggle -->
|
|
47
|
-
<div
|
|
48
|
-
v-else
|
|
49
|
-
:class="label == '' ? 'items-center' : 'items-start'"
|
|
50
|
-
class="flex cursor-pointer justify-between"
|
|
51
|
-
>
|
|
52
|
-
<span
|
|
53
|
-
class="flex flex-grow flex-col"
|
|
54
|
-
id="toggleLabel"
|
|
55
|
-
v-if="direction == 'left'"
|
|
56
|
-
@click="switchValue"
|
|
57
|
-
>
|
|
58
|
-
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
59
|
-
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
60
|
-
</span>
|
|
61
|
-
<button
|
|
62
|
-
type="button"
|
|
63
|
-
aria-pressed="false"
|
|
64
|
-
:class="{ 'bg-indigo-600': isToggle == 1, 'bg-gray-200': isToggle == 0 }"
|
|
65
|
-
@click.stop="switchValue"
|
|
66
|
-
class="focus:outline-none relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:opacity-50"
|
|
67
|
-
:disabled="disabled"
|
|
68
|
-
>
|
|
69
|
-
<span class="sr-only">Use setting</span>
|
|
70
|
-
<span
|
|
71
|
-
aria-hidden="true"
|
|
72
|
-
:class="{ 'translate-x-5': isToggle == 1, 'translate-x-0': isToggle == 0 }"
|
|
73
|
-
class="inline-block h-5 w-5 transform rounded-full bg-white ring-0 transition duration-200 ease-in-out"
|
|
74
|
-
></span>
|
|
75
|
-
</button>
|
|
76
|
-
<span class="flex flex-col disabled:opacity-50" id="toggleLabel" v-if="direction == 'right'">
|
|
77
|
-
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
78
|
-
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
79
|
-
</span>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</template>
|
|
83
|
-
|
|
84
|
-
<script>
|
|
85
|
-
export default {
|
|
86
|
-
name: "CSwitch",
|
|
87
|
-
components: {},
|
|
88
|
-
props: {
|
|
89
|
-
label: {
|
|
90
|
-
type: String,
|
|
91
|
-
},
|
|
92
|
-
description: {
|
|
93
|
-
type: String,
|
|
94
|
-
},
|
|
95
|
-
returnToggleValue: {
|
|
96
|
-
type: Function,
|
|
97
|
-
},
|
|
98
|
-
classes: {
|
|
99
|
-
type: String,
|
|
100
|
-
},
|
|
101
|
-
value: { type: Number },
|
|
102
|
-
size: {
|
|
103
|
-
type: String,
|
|
104
|
-
},
|
|
105
|
-
direction: {
|
|
106
|
-
type: String,
|
|
107
|
-
},
|
|
108
|
-
disabled: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
default: false,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
data() {
|
|
114
|
-
return {
|
|
115
|
-
isToggle: this.value,
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
methods: {
|
|
119
|
-
switchValue() {
|
|
120
|
-
this.isToggle = this.isToggle === 1 ? 0 : 1;
|
|
121
|
-
this.$emit("returnToggleValue", this.isToggle);
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
watch: {
|
|
125
|
-
value() {
|
|
126
|
-
this.isToggle = this.value;
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
</script>
|
|
131
|
-
|
|
132
|
-
<style></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<!-- small toggle -->
|
|
4
|
+
<div
|
|
5
|
+
v-if="size === 'small'"
|
|
6
|
+
:class="label == '' ? 'items-center' : 'items-start'"
|
|
7
|
+
class="flex cursor-pointer justify-between"
|
|
8
|
+
>
|
|
9
|
+
<span
|
|
10
|
+
class="flex flex-grow flex-col"
|
|
11
|
+
id="smallleft"
|
|
12
|
+
v-if="direction == 'left'"
|
|
13
|
+
@click="switchValue"
|
|
14
|
+
>
|
|
15
|
+
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
16
|
+
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
17
|
+
</span>
|
|
18
|
+
<button
|
|
19
|
+
type="button"
|
|
20
|
+
class="group focus:outline-none relative inline-flex h-5 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-full focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:opacity-50"
|
|
21
|
+
aria-pressed="false"
|
|
22
|
+
@click="switchValue"
|
|
23
|
+
:disabled="disabled"
|
|
24
|
+
>
|
|
25
|
+
<span class="sr-only">Use setting</span>
|
|
26
|
+
<span
|
|
27
|
+
aria-hidden="true"
|
|
28
|
+
class="pointer-events-none absolute h-full w-full rounded-md bg-white"
|
|
29
|
+
></span>
|
|
30
|
+
<span
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
:class="{ 'bg-indigo-600': isToggle, 'bg-gray-200': !isToggle }"
|
|
33
|
+
class="pointer-events-none absolute mx-auto h-4 w-9 rounded-full transition-colors duration-200 ease-in-out"
|
|
34
|
+
></span>
|
|
35
|
+
<span
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
:class="{ 'translate-x-5': isToggle, 'translate-x-0': !isToggle }"
|
|
38
|
+
class="pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-full border border-gray-200 bg-white ring-0 transition-transform duration-200 ease-in-out"
|
|
39
|
+
></span>
|
|
40
|
+
</button>
|
|
41
|
+
<span class="flex flex-col" id="toggleLabel" v-if="direction == 'right'" @click="switchValue">
|
|
42
|
+
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
43
|
+
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
<!-- large toggle -->
|
|
47
|
+
<div
|
|
48
|
+
v-else
|
|
49
|
+
:class="label == '' ? 'items-center' : 'items-start'"
|
|
50
|
+
class="flex cursor-pointer justify-between"
|
|
51
|
+
>
|
|
52
|
+
<span
|
|
53
|
+
class="flex flex-grow flex-col"
|
|
54
|
+
id="toggleLabel"
|
|
55
|
+
v-if="direction == 'left'"
|
|
56
|
+
@click="switchValue"
|
|
57
|
+
>
|
|
58
|
+
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
59
|
+
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
60
|
+
</span>
|
|
61
|
+
<button
|
|
62
|
+
type="button"
|
|
63
|
+
aria-pressed="false"
|
|
64
|
+
:class="{ 'bg-indigo-600': isToggle == 1, 'bg-gray-200': isToggle == 0 }"
|
|
65
|
+
@click.stop="switchValue"
|
|
66
|
+
class="focus:outline-none relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:opacity-50"
|
|
67
|
+
:disabled="disabled"
|
|
68
|
+
>
|
|
69
|
+
<span class="sr-only">Use setting</span>
|
|
70
|
+
<span
|
|
71
|
+
aria-hidden="true"
|
|
72
|
+
:class="{ 'translate-x-5': isToggle == 1, 'translate-x-0': isToggle == 0 }"
|
|
73
|
+
class="inline-block h-5 w-5 transform rounded-full bg-white ring-0 transition duration-200 ease-in-out"
|
|
74
|
+
></span>
|
|
75
|
+
</button>
|
|
76
|
+
<span class="flex flex-col disabled:opacity-50" id="toggleLabel" v-if="direction == 'right'">
|
|
77
|
+
<span v-if="label" :class="classes" class="text-gray-900">{{ label }}</span>
|
|
78
|
+
<span v-if="description" class="text-sm text-gray-500">{{ description }}</span>
|
|
79
|
+
</span>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
|
|
84
|
+
<script>
|
|
85
|
+
export default {
|
|
86
|
+
name: "CSwitch",
|
|
87
|
+
components: {},
|
|
88
|
+
props: {
|
|
89
|
+
label: {
|
|
90
|
+
type: String,
|
|
91
|
+
},
|
|
92
|
+
description: {
|
|
93
|
+
type: String,
|
|
94
|
+
},
|
|
95
|
+
returnToggleValue: {
|
|
96
|
+
type: Function,
|
|
97
|
+
},
|
|
98
|
+
classes: {
|
|
99
|
+
type: String,
|
|
100
|
+
},
|
|
101
|
+
value: { type: Number },
|
|
102
|
+
size: {
|
|
103
|
+
type: String,
|
|
104
|
+
},
|
|
105
|
+
direction: {
|
|
106
|
+
type: String,
|
|
107
|
+
},
|
|
108
|
+
disabled: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
data() {
|
|
114
|
+
return {
|
|
115
|
+
isToggle: this.value,
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
methods: {
|
|
119
|
+
switchValue() {
|
|
120
|
+
this.isToggle = this.isToggle === 1 ? 0 : 1;
|
|
121
|
+
this.$emit("returnToggleValue", this.isToggle);
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
watch: {
|
|
125
|
+
value() {
|
|
126
|
+
this.isToggle = this.value;
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<style></style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CSwitch from './CSwitch.vue'
|
|
2
|
-
|
|
1
|
+
import CSwitch from './CSwitch.vue'
|
|
2
|
+
|
|
3
3
|
export default CSwitch
|