classcard-ui 0.2.1068 → 0.2.1069
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 +76 -65
- package/dist/classcard-ui.common.js.map +1 -1
- package/dist/classcard-ui.umd.js +76 -65
- 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 +82 -82
- 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 +212 -212
- 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 +152 -152
- package/src/components/CButton/index.js +2 -2
- package/src/components/CButtonGroup/CButtonGroup.vue +118 -118
- package/src/components/CButtonGroup/index.js +2 -2
- package/src/components/CButtonIcon/CButtonIcon.vue +117 -117
- 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 +134 -134
- package/src/components/CButtonSelect/index.js +2 -2
- package/src/components/CButtonSelectBorder/CButtonSelectBorder.vue +135 -135
- package/src/components/CButtonSelectBorder/index.js +3 -3
- package/src/components/CButtonWithDropdown/CButtonWithDropdown.vue +135 -135
- package/src/components/CButtonWithDropdown/index.js +2 -2
- package/src/components/CCalendar/CCalendar.vue +410 -410
- 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 +123 -123
- package/src/components/CCheckbox/index.js +2 -2
- package/src/components/CCircularButton/CCircularButton.vue +53 -53
- package/src/components/CCircularButton/index.js +2 -2
- package/src/components/CCollapsibleSection/CCollapsibleSection.vue +101 -101
- package/src/components/CCollapsibleSection/index.js +2 -2
- package/src/components/CColorDots/CColorDots.vue +51 -51
- package/src/components/CColorDots/index.js +3 -3
- package/src/components/CConfirmActionModal/CConfirmActionModal.vue +180 -180
- package/src/components/CConfirmActionModal/index.js +3 -3
- package/src/components/CDatepicker/CDatepicker.vue +201 -201
- 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 +98 -98
- 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 +245 -245
- package/src/components/CGroupedSelect/index.js +3 -3
- package/src/components/CIcon/CIcon.vue +91 -91
- package/src/components/CIcon/index.js +2 -2
- package/src/components/CIconDropdown/CIconDropdown.vue +146 -146
- package/src/components/CIconDropdown/index.js +2 -2
- package/src/components/CInput/CInput.vue +134 -134
- package/src/components/CInput/index.js +2 -2
- package/src/components/CInputAddon/CInputAddon.vue +228 -228
- 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/CInsetTabs/CInsetTabs.vue +88 -88
- package/src/components/CInsetTabs/index.js +3 -3
- package/src/components/CModalHeading/CModalHeading.vue +22 -22
- package/src/components/CModalHeading/index.js +2 -2
- package/src/components/CModuleHelpLinks/CModuleHelpLinks.vue +70 -70
- package/src/components/CModuleHelpLinks/index.js +3 -3
- package/src/components/CMultiselect/CMultiselect.vue +615 -615
- 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 +233 -233
- package/src/components/CPagination/index.js +2 -2
- package/src/components/CPhoneNumber/CPhoneNumber.vue +114 -114
- package/src/components/CPhoneNumber/index.js +2 -2
- package/src/components/CProgress/CProgress.vue +57 -57
- package/src/components/CProgress/index.js +2 -2
- package/src/components/CRadio/CRadio.vue +126 -126
- 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 +539 -530
- 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 +150 -150
- package/src/components/CStackedList/index.js +2 -2
- package/src/components/CStats/CStats.vue +116 -116
- package/src/components/CStats/index.js +2 -2
- package/src/components/CSwitch/CSwitch.vue +176 -176
- package/src/components/CSwitch/index.js +2 -2
- package/src/components/CTabLazy/CTabLazy.vue +63 -63
- package/src/components/CTabLazy/index.js +2 -2
- package/src/components/CTable/CTable.vue +671 -671
- package/src/components/CTable/index.js +2 -2
- package/src/components/CTabs/CTabs.vue +169 -169
- package/src/components/CTabs/index.js +2 -2
- package/src/components/CTag/CTag.vue +59 -59
- package/src/components/CTag/index.js +2 -2
- package/src/components/CTextarea/CTextarea.vue +107 -107
- 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 +267 -267
- package/src/components/CUpload/index.js +2 -2
- package/src/components/index.js +53 -53
- package/src/icons.js +453 -453
- 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 +47 -47
- 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 +41 -41
- package/src/stories/CButtonSelectBorder.stories.js +48 -48
- 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/CCircularButton.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 +71 -71
- package/src/stories/CIcon.stories.js +28 -28
- package/src/stories/CIconDropdown.stories.js +45 -45
- 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/CInsetTabs.stories.js +38 -38
- package/src/stories/CModalHeading.stories.js +25 -25
- package/src/stories/CModuleHelpLinks.stories.js +25 -25
- package/src/stories/CMultiselect.stories.js +167 -167
- 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/CProgress.stories.js +23 -23
- 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 +109 -109
- 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/CTabLazy.stories.js +26 -26
- package/src/stories/CTable.stories.js +169 -169
- package/src/stories/CTabs.stories.js +36 -36
- package/src/stories/CTag.stories.js +34 -34
- 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,117 +1,117 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<slot></slot>
|
|
4
|
-
<button
|
|
5
|
-
v-if="type == 'tertiary'"
|
|
6
|
-
class="focus:outline-none flex cursor-pointer flex-row rounded-md px-2 py-2 text-sm text-indigo-600 hover:bg-indigo-100 hover:text-indigo-800 focus:ring-2 focus:ring-indigo-200 focus:ring-offset-2"
|
|
7
|
-
@click.prevent="$emit('action')"
|
|
8
|
-
>
|
|
9
|
-
<c-icon
|
|
10
|
-
cursorType="cursor-pointer"
|
|
11
|
-
v-if="icon"
|
|
12
|
-
:type="icon.type"
|
|
13
|
-
:class="icon.class"
|
|
14
|
-
:name="icon.name"
|
|
15
|
-
></c-icon>
|
|
16
|
-
<slot></slot>
|
|
17
|
-
</button>
|
|
18
|
-
<button
|
|
19
|
-
v-else-if="type == 'rounded-hover'"
|
|
20
|
-
@click.prevent="$emit('action')"
|
|
21
|
-
class="focus:outline-none flex h-8 w-8 cursor-pointer items-center justify-center rounded-full bg-white text-gray-500 hover:bg-gray-100 hover:text-gray-500 focus:ring-2 focus:ring-indigo-500"
|
|
22
|
-
:class="isTransparent ? 'bg-transparent' : 'bg-white'"
|
|
23
|
-
>
|
|
24
|
-
<c-icon
|
|
25
|
-
v-if="icon"
|
|
26
|
-
cursorType="cursor-pointer"
|
|
27
|
-
:type="icon.type"
|
|
28
|
-
:class="icon.class"
|
|
29
|
-
:name="icon.name"
|
|
30
|
-
></c-icon>
|
|
31
|
-
</button>
|
|
32
|
-
<button
|
|
33
|
-
v-else
|
|
34
|
-
:type="type"
|
|
35
|
-
:class="classes"
|
|
36
|
-
class="focus:outline-none inline-flex items-center rounded-md px-2 py-2 text-sm font-medium shadow-sm focus:ring-2 focus:ring-offset-2"
|
|
37
|
-
@click.prevent="$emit('action')"
|
|
38
|
-
>
|
|
39
|
-
<c-icon
|
|
40
|
-
v-if="isLoading"
|
|
41
|
-
cursorType="cursor-pointer"
|
|
42
|
-
class="mr-2 h-5 w-5"
|
|
43
|
-
:class="loaderClasses"
|
|
44
|
-
name="loader"
|
|
45
|
-
></c-icon>
|
|
46
|
-
<c-icon
|
|
47
|
-
v-if="icon"
|
|
48
|
-
:type="icon.type"
|
|
49
|
-
:class="icon.class"
|
|
50
|
-
:name="icon.name"
|
|
51
|
-
:viewBox="icon.viewBox"
|
|
52
|
-
cursorType="cursor-pointer"
|
|
53
|
-
></c-icon>
|
|
54
|
-
<slot></slot>
|
|
55
|
-
</button>
|
|
56
|
-
</div>
|
|
57
|
-
</template>
|
|
58
|
-
|
|
59
|
-
<script>
|
|
60
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
61
|
-
export default {
|
|
62
|
-
name: "CButtonIcon",
|
|
63
|
-
components: { CIcon },
|
|
64
|
-
props: {
|
|
65
|
-
icon: {
|
|
66
|
-
type: Object,
|
|
67
|
-
},
|
|
68
|
-
type: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: "primary",
|
|
71
|
-
required: true,
|
|
72
|
-
},
|
|
73
|
-
isLoading: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false,
|
|
76
|
-
},
|
|
77
|
-
action: {
|
|
78
|
-
type: Function,
|
|
79
|
-
},
|
|
80
|
-
loaderClasses: {
|
|
81
|
-
type: String,
|
|
82
|
-
},
|
|
83
|
-
isTransparent: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
default: false,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
computed: {
|
|
90
|
-
classes() {
|
|
91
|
-
return {
|
|
92
|
-
"border border-gray-200 bg-white text-gray-700 hover:bg-gray-50 focus:ring-indigo-600":
|
|
93
|
-
this.type == "white",
|
|
94
|
-
"text-indigo-700 bg-indigo-100 hover:bg-indigo-200 focus:ring-indigo-500":
|
|
95
|
-
this.type == "secondary",
|
|
96
|
-
"border text-white hover:bg-indigo-800 bg-indigo-700 focus:ring-indigo-600":
|
|
97
|
-
this.type == "primary",
|
|
98
|
-
"border text-white hover:bg-red-800 bg-red-700 focus:ring-red-600":
|
|
99
|
-
this.type == "danger",
|
|
100
|
-
"border text-white hover:bg-green-800 bg-green-700 focus:ring-green-600":
|
|
101
|
-
this.type == "success",
|
|
102
|
-
"text-gray-900 hover:bg-gray-200 bg-gray-100":
|
|
103
|
-
this.type == "secondary-gray",
|
|
104
|
-
"cursor-default pointer-events-none": this.isLoading,
|
|
105
|
-
};
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
methods: {
|
|
110
|
-
onClick() {
|
|
111
|
-
this.$emit("onClick");
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
</script>
|
|
116
|
-
|
|
117
|
-
<style></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<slot></slot>
|
|
4
|
+
<button
|
|
5
|
+
v-if="type == 'tertiary'"
|
|
6
|
+
class="focus:outline-none flex cursor-pointer flex-row rounded-md px-2 py-2 text-sm text-indigo-600 hover:bg-indigo-100 hover:text-indigo-800 focus:ring-2 focus:ring-indigo-200 focus:ring-offset-2"
|
|
7
|
+
@click.prevent="$emit('action')"
|
|
8
|
+
>
|
|
9
|
+
<c-icon
|
|
10
|
+
cursorType="cursor-pointer"
|
|
11
|
+
v-if="icon"
|
|
12
|
+
:type="icon.type"
|
|
13
|
+
:class="icon.class"
|
|
14
|
+
:name="icon.name"
|
|
15
|
+
></c-icon>
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</button>
|
|
18
|
+
<button
|
|
19
|
+
v-else-if="type == 'rounded-hover'"
|
|
20
|
+
@click.prevent="$emit('action')"
|
|
21
|
+
class="focus:outline-none flex h-8 w-8 cursor-pointer items-center justify-center rounded-full bg-white text-gray-500 hover:bg-gray-100 hover:text-gray-500 focus:ring-2 focus:ring-indigo-500"
|
|
22
|
+
:class="isTransparent ? 'bg-transparent' : 'bg-white'"
|
|
23
|
+
>
|
|
24
|
+
<c-icon
|
|
25
|
+
v-if="icon"
|
|
26
|
+
cursorType="cursor-pointer"
|
|
27
|
+
:type="icon.type"
|
|
28
|
+
:class="icon.class"
|
|
29
|
+
:name="icon.name"
|
|
30
|
+
></c-icon>
|
|
31
|
+
</button>
|
|
32
|
+
<button
|
|
33
|
+
v-else
|
|
34
|
+
:type="type"
|
|
35
|
+
:class="classes"
|
|
36
|
+
class="focus:outline-none inline-flex items-center rounded-md px-2 py-2 text-sm font-medium shadow-sm focus:ring-2 focus:ring-offset-2"
|
|
37
|
+
@click.prevent="$emit('action')"
|
|
38
|
+
>
|
|
39
|
+
<c-icon
|
|
40
|
+
v-if="isLoading"
|
|
41
|
+
cursorType="cursor-pointer"
|
|
42
|
+
class="mr-2 h-5 w-5"
|
|
43
|
+
:class="loaderClasses"
|
|
44
|
+
name="loader"
|
|
45
|
+
></c-icon>
|
|
46
|
+
<c-icon
|
|
47
|
+
v-if="icon"
|
|
48
|
+
:type="icon.type"
|
|
49
|
+
:class="icon.class"
|
|
50
|
+
:name="icon.name"
|
|
51
|
+
:viewBox="icon.viewBox"
|
|
52
|
+
cursorType="cursor-pointer"
|
|
53
|
+
></c-icon>
|
|
54
|
+
<slot></slot>
|
|
55
|
+
</button>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script>
|
|
60
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
61
|
+
export default {
|
|
62
|
+
name: "CButtonIcon",
|
|
63
|
+
components: { CIcon },
|
|
64
|
+
props: {
|
|
65
|
+
icon: {
|
|
66
|
+
type: Object,
|
|
67
|
+
},
|
|
68
|
+
type: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "primary",
|
|
71
|
+
required: true,
|
|
72
|
+
},
|
|
73
|
+
isLoading: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false,
|
|
76
|
+
},
|
|
77
|
+
action: {
|
|
78
|
+
type: Function,
|
|
79
|
+
},
|
|
80
|
+
loaderClasses: {
|
|
81
|
+
type: String,
|
|
82
|
+
},
|
|
83
|
+
isTransparent: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
computed: {
|
|
90
|
+
classes() {
|
|
91
|
+
return {
|
|
92
|
+
"border border-gray-200 bg-white text-gray-700 hover:bg-gray-50 focus:ring-indigo-600":
|
|
93
|
+
this.type == "white",
|
|
94
|
+
"text-indigo-700 bg-indigo-100 hover:bg-indigo-200 focus:ring-indigo-500":
|
|
95
|
+
this.type == "secondary",
|
|
96
|
+
"border text-white hover:bg-indigo-800 bg-indigo-700 focus:ring-indigo-600":
|
|
97
|
+
this.type == "primary",
|
|
98
|
+
"border text-white hover:bg-red-800 bg-red-700 focus:ring-red-600":
|
|
99
|
+
this.type == "danger",
|
|
100
|
+
"border text-white hover:bg-green-800 bg-green-700 focus:ring-green-600":
|
|
101
|
+
this.type == "success",
|
|
102
|
+
"text-gray-900 hover:bg-gray-200 bg-gray-100":
|
|
103
|
+
this.type == "secondary-gray",
|
|
104
|
+
"cursor-default pointer-events-none": this.isLoading,
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
methods: {
|
|
110
|
+
onClick() {
|
|
111
|
+
this.$emit("onClick");
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
</script>
|
|
116
|
+
|
|
117
|
+
<style></style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CButtonIcon from './CButtonIcon.vue'
|
|
2
|
-
|
|
1
|
+
import CButtonIcon from './CButtonIcon.vue'
|
|
2
|
+
|
|
3
3
|
export default CButtonIcon
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span class="relative z-0 inline-flex w-full rounded-md shadow-sm">
|
|
3
|
-
<button
|
|
4
|
-
v-if="image"
|
|
5
|
-
type="button"
|
|
6
|
-
class="focus:outline-none relative -ml-px inline-flex items-center rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"
|
|
7
|
-
>
|
|
8
|
-
<img class="h-10 w-10" :src="image" />
|
|
9
|
-
</button>
|
|
10
|
-
<button
|
|
11
|
-
type="button"
|
|
12
|
-
class="focus:outline-none relative inline-flex w-full items-center justify-between rounded-r-md border border-gray-300 bg-white py-2 pl-4 pr-1 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"
|
|
13
|
-
:class="image ? 'rounded-r-md' : 'rounded-md'"
|
|
14
|
-
@click="$emit('action')"
|
|
15
|
-
>
|
|
16
|
-
{{ label }}
|
|
17
|
-
<c-icon type="solid" name="chevron-right" class="h-5 w-5"></c-icon>
|
|
18
|
-
</button>
|
|
19
|
-
</span>
|
|
20
|
-
</template>
|
|
21
|
-
<script>
|
|
22
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
23
|
-
export default {
|
|
24
|
-
name: "CButtonLink",
|
|
25
|
-
components: { CIcon },
|
|
26
|
-
props: {
|
|
27
|
-
label: {
|
|
28
|
-
type: String,
|
|
29
|
-
},
|
|
30
|
-
image: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: null,
|
|
33
|
-
},
|
|
34
|
-
action: {
|
|
35
|
-
type: Function,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<span class="relative z-0 inline-flex w-full rounded-md shadow-sm">
|
|
3
|
+
<button
|
|
4
|
+
v-if="image"
|
|
5
|
+
type="button"
|
|
6
|
+
class="focus:outline-none relative -ml-px inline-flex items-center rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"
|
|
7
|
+
>
|
|
8
|
+
<img class="h-10 w-10" :src="image" />
|
|
9
|
+
</button>
|
|
10
|
+
<button
|
|
11
|
+
type="button"
|
|
12
|
+
class="focus:outline-none relative inline-flex w-full items-center justify-between rounded-r-md border border-gray-300 bg-white py-2 pl-4 pr-1 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"
|
|
13
|
+
:class="image ? 'rounded-r-md' : 'rounded-md'"
|
|
14
|
+
@click="$emit('action')"
|
|
15
|
+
>
|
|
16
|
+
{{ label }}
|
|
17
|
+
<c-icon type="solid" name="chevron-right" class="h-5 w-5"></c-icon>
|
|
18
|
+
</button>
|
|
19
|
+
</span>
|
|
20
|
+
</template>
|
|
21
|
+
<script>
|
|
22
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
23
|
+
export default {
|
|
24
|
+
name: "CButtonLink",
|
|
25
|
+
components: { CIcon },
|
|
26
|
+
props: {
|
|
27
|
+
label: {
|
|
28
|
+
type: String,
|
|
29
|
+
},
|
|
30
|
+
image: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: null,
|
|
33
|
+
},
|
|
34
|
+
action: {
|
|
35
|
+
type: Function,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CButtonLink from './CButtonLink.vue'
|
|
2
|
-
|
|
1
|
+
import CButtonLink from './CButtonLink.vue'
|
|
2
|
+
|
|
3
3
|
export default CButtonLink
|
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<slot></slot>
|
|
4
|
-
<div
|
|
5
|
-
:class="[isDisabled ? 'opacity-50' : '', buttonWrapperClass]"
|
|
6
|
-
class="relative inline-block text-left"
|
|
7
|
-
>
|
|
8
|
-
<button
|
|
9
|
-
:type="type"
|
|
10
|
-
@click="toggleDropdown = !toggleDropdown"
|
|
11
|
-
@blur="close()"
|
|
12
|
-
:class="[classes, buttonClass]"
|
|
13
|
-
class="inline-flex w-full justify-center border border-transparent px-4 py-2 text-sm font-medium shadow-sm focus:outline-none"
|
|
14
|
-
aria-haspopup="listbox"
|
|
15
|
-
aria-expanded="true"
|
|
16
|
-
aria-labelledby="listbox-label"
|
|
17
|
-
:disabled="isDisabled"
|
|
18
|
-
>
|
|
19
|
-
<c-icon v-if="isLoading" class="mr-2 h-5 w-5" name="loader"></c-icon>
|
|
20
|
-
{{ label }}
|
|
21
|
-
<c-icon name="chevron-down" type="solid" class="ml-2 h-5 w-5"></c-icon>
|
|
22
|
-
</button>
|
|
23
|
-
|
|
24
|
-
<div
|
|
25
|
-
v-if="toggleDropdown"
|
|
26
|
-
:class="dropdownPositionClass"
|
|
27
|
-
class="absolute z-10 mt-2 -mr-1 w-56 rounded-md bg-white shadow-lg ring-1 ring-gray-900 ring-opacity-5"
|
|
28
|
-
>
|
|
29
|
-
<ul
|
|
30
|
-
class="py-1"
|
|
31
|
-
tabindex="-1"
|
|
32
|
-
role="listbox"
|
|
33
|
-
aria-labelledby="listbox-label"
|
|
34
|
-
>
|
|
35
|
-
<!-- item.isDisabled will make the list item unclickable and reduce the opacity -->
|
|
36
|
-
<li
|
|
37
|
-
v-for="item in items"
|
|
38
|
-
:key="item.text"
|
|
39
|
-
:class="[item.isDisabled ? 'pointer-events-none opacity-50 ' : '']"
|
|
40
|
-
class="flex cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
|
|
41
|
-
@mousedown="emitOptionAction(item.action)"
|
|
42
|
-
>
|
|
43
|
-
<c-icon
|
|
44
|
-
v-if="item.icon"
|
|
45
|
-
:type="item.iconType"
|
|
46
|
-
class="mr-2 h-5 w-5 text-gray-500"
|
|
47
|
-
:name="item.icon"
|
|
48
|
-
></c-icon>
|
|
49
|
-
<slot name="customIcon" v-if="item.customIcon"></slot>
|
|
50
|
-
{{ item.text }}
|
|
51
|
-
</li>
|
|
52
|
-
</ul>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script>
|
|
59
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
60
|
-
export default {
|
|
61
|
-
name: "CButtonSelect",
|
|
62
|
-
components: { CIcon },
|
|
63
|
-
props: {
|
|
64
|
-
label: {
|
|
65
|
-
type: String,
|
|
66
|
-
required: true,
|
|
67
|
-
},
|
|
68
|
-
type: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: "primary",
|
|
71
|
-
},
|
|
72
|
-
items: {
|
|
73
|
-
type: Array,
|
|
74
|
-
required: true,
|
|
75
|
-
},
|
|
76
|
-
isLoading: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
default: false,
|
|
79
|
-
},
|
|
80
|
-
dropdownPositionClass: {
|
|
81
|
-
type: String,
|
|
82
|
-
},
|
|
83
|
-
isDisabled: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
default: false,
|
|
86
|
-
},
|
|
87
|
-
buttonWrapperClass: {
|
|
88
|
-
type: String,
|
|
89
|
-
default: "",
|
|
90
|
-
},
|
|
91
|
-
buttonClass: {
|
|
92
|
-
type: String,
|
|
93
|
-
default: "",
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
data() {
|
|
97
|
-
return {
|
|
98
|
-
toggleDropdown: false,
|
|
99
|
-
};
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
computed: {
|
|
103
|
-
classes() {
|
|
104
|
-
return {
|
|
105
|
-
"text-gray-700 border-gray-300 rounded-md hover:bg-gray-50 focus:ring-indigo-600":
|
|
106
|
-
this.type == "secondary",
|
|
107
|
-
"text-white rounded-md hover:bg-indigo-800 bg-indigo-700 focus:ring-indigo-600":
|
|
108
|
-
this.type == "primary",
|
|
109
|
-
"text-white rounded-md hover:bg-red-800 bg-red-700 focus:ring-red-600":
|
|
110
|
-
this.type == "danger",
|
|
111
|
-
"text-white rounded-md hover:bg-green-800 bg-green-700 focus:ring-green-600":
|
|
112
|
-
this.type == "success",
|
|
113
|
-
"text-gray-700 border-gray-300 rounded-md hover:bg-gray-50 focus:ring-indigo-600 bg-white":
|
|
114
|
-
this.type == "white",
|
|
115
|
-
"cursor-default rounded-md pointer-events-none": this.isLoading,
|
|
116
|
-
//the type-white property contains the class rounded-r-md that would only round the button corner in the right direction
|
|
117
|
-
//while the other type property will round the button corners for all 4 direction
|
|
118
|
-
"text-gray-700 border-gray-300 rounded-r-md hover:bg-gray-50 focus:ring-indigo-600 bg-white":
|
|
119
|
-
this.type == "white-rounded-right",
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
methods: {
|
|
124
|
-
emitOptionAction(action) {
|
|
125
|
-
this.$emit("buttonActions", action);
|
|
126
|
-
},
|
|
127
|
-
close() {
|
|
128
|
-
this.toggleDropdown = false;
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
</script>
|
|
133
|
-
|
|
134
|
-
<style></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<slot></slot>
|
|
4
|
+
<div
|
|
5
|
+
:class="[isDisabled ? 'opacity-50' : '', buttonWrapperClass]"
|
|
6
|
+
class="relative inline-block text-left"
|
|
7
|
+
>
|
|
8
|
+
<button
|
|
9
|
+
:type="type"
|
|
10
|
+
@click="toggleDropdown = !toggleDropdown"
|
|
11
|
+
@blur="close()"
|
|
12
|
+
:class="[classes, buttonClass]"
|
|
13
|
+
class="inline-flex w-full justify-center border border-transparent px-4 py-2 text-sm font-medium shadow-sm focus:outline-none"
|
|
14
|
+
aria-haspopup="listbox"
|
|
15
|
+
aria-expanded="true"
|
|
16
|
+
aria-labelledby="listbox-label"
|
|
17
|
+
:disabled="isDisabled"
|
|
18
|
+
>
|
|
19
|
+
<c-icon v-if="isLoading" class="mr-2 h-5 w-5" name="loader"></c-icon>
|
|
20
|
+
{{ label }}
|
|
21
|
+
<c-icon name="chevron-down" type="solid" class="ml-2 h-5 w-5"></c-icon>
|
|
22
|
+
</button>
|
|
23
|
+
|
|
24
|
+
<div
|
|
25
|
+
v-if="toggleDropdown"
|
|
26
|
+
:class="dropdownPositionClass"
|
|
27
|
+
class="absolute z-10 mt-2 -mr-1 w-56 rounded-md bg-white shadow-lg ring-1 ring-gray-900 ring-opacity-5"
|
|
28
|
+
>
|
|
29
|
+
<ul
|
|
30
|
+
class="py-1"
|
|
31
|
+
tabindex="-1"
|
|
32
|
+
role="listbox"
|
|
33
|
+
aria-labelledby="listbox-label"
|
|
34
|
+
>
|
|
35
|
+
<!-- item.isDisabled will make the list item unclickable and reduce the opacity -->
|
|
36
|
+
<li
|
|
37
|
+
v-for="item in items"
|
|
38
|
+
:key="item.text"
|
|
39
|
+
:class="[item.isDisabled ? 'pointer-events-none opacity-50 ' : '']"
|
|
40
|
+
class="flex cursor-pointer px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900"
|
|
41
|
+
@mousedown="emitOptionAction(item.action)"
|
|
42
|
+
>
|
|
43
|
+
<c-icon
|
|
44
|
+
v-if="item.icon"
|
|
45
|
+
:type="item.iconType"
|
|
46
|
+
class="mr-2 h-5 w-5 text-gray-500"
|
|
47
|
+
:name="item.icon"
|
|
48
|
+
></c-icon>
|
|
49
|
+
<slot name="customIcon" v-if="item.customIcon"></slot>
|
|
50
|
+
{{ item.text }}
|
|
51
|
+
</li>
|
|
52
|
+
</ul>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script>
|
|
59
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
60
|
+
export default {
|
|
61
|
+
name: "CButtonSelect",
|
|
62
|
+
components: { CIcon },
|
|
63
|
+
props: {
|
|
64
|
+
label: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: true,
|
|
67
|
+
},
|
|
68
|
+
type: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "primary",
|
|
71
|
+
},
|
|
72
|
+
items: {
|
|
73
|
+
type: Array,
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
isLoading: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false,
|
|
79
|
+
},
|
|
80
|
+
dropdownPositionClass: {
|
|
81
|
+
type: String,
|
|
82
|
+
},
|
|
83
|
+
isDisabled: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
87
|
+
buttonWrapperClass: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: "",
|
|
90
|
+
},
|
|
91
|
+
buttonClass: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: "",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
data() {
|
|
97
|
+
return {
|
|
98
|
+
toggleDropdown: false,
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
computed: {
|
|
103
|
+
classes() {
|
|
104
|
+
return {
|
|
105
|
+
"text-gray-700 border-gray-300 rounded-md hover:bg-gray-50 focus:ring-indigo-600":
|
|
106
|
+
this.type == "secondary",
|
|
107
|
+
"text-white rounded-md hover:bg-indigo-800 bg-indigo-700 focus:ring-indigo-600":
|
|
108
|
+
this.type == "primary",
|
|
109
|
+
"text-white rounded-md hover:bg-red-800 bg-red-700 focus:ring-red-600":
|
|
110
|
+
this.type == "danger",
|
|
111
|
+
"text-white rounded-md hover:bg-green-800 bg-green-700 focus:ring-green-600":
|
|
112
|
+
this.type == "success",
|
|
113
|
+
"text-gray-700 border-gray-300 rounded-md hover:bg-gray-50 focus:ring-indigo-600 bg-white":
|
|
114
|
+
this.type == "white",
|
|
115
|
+
"cursor-default rounded-md pointer-events-none": this.isLoading,
|
|
116
|
+
//the type-white property contains the class rounded-r-md that would only round the button corner in the right direction
|
|
117
|
+
//while the other type property will round the button corners for all 4 direction
|
|
118
|
+
"text-gray-700 border-gray-300 rounded-r-md hover:bg-gray-50 focus:ring-indigo-600 bg-white":
|
|
119
|
+
this.type == "white-rounded-right",
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
methods: {
|
|
124
|
+
emitOptionAction(action) {
|
|
125
|
+
this.$emit("buttonActions", action);
|
|
126
|
+
},
|
|
127
|
+
close() {
|
|
128
|
+
this.toggleDropdown = false;
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
</script>
|
|
133
|
+
|
|
134
|
+
<style></style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CButtonSelect from './CButtonSelect.vue'
|
|
2
|
-
|
|
1
|
+
import CButtonSelect from './CButtonSelect.vue'
|
|
2
|
+
|
|
3
3
|
export default CButtonSelect
|