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,147 +1,147 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<slot></slot>
|
|
4
|
-
<button
|
|
5
|
-
v-if="type == 'tertiary'"
|
|
6
|
-
:class="customClasses"
|
|
7
|
-
class="focus:outline-none flex cursor-pointer flex-row rounded-md px-4 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"
|
|
8
|
-
@click.prevent="$emit('action')"
|
|
9
|
-
>
|
|
10
|
-
<c-icon
|
|
11
|
-
v-if="icon"
|
|
12
|
-
:type="icon.type"
|
|
13
|
-
:class="iconClasses"
|
|
14
|
-
:name="icon.name"
|
|
15
|
-
:viewBox="icon.viewBox"
|
|
16
|
-
></c-icon
|
|
17
|
-
>{{ label }}
|
|
18
|
-
<slot name="customButtonContent"></slot>
|
|
19
|
-
</button>
|
|
20
|
-
<button
|
|
21
|
-
v-else-if="type != 'tertiary' && label.length"
|
|
22
|
-
:type="type"
|
|
23
|
-
:class="classes"
|
|
24
|
-
:disabled="disabled"
|
|
25
|
-
class="focus:outline-none inline-flex items-center rounded-md px-4 py-2 text-sm font-medium shadow-sm focus:ring-2 focus:ring-offset-2 disabled:opacity-50"
|
|
26
|
-
@click.prevent="$emit('action')"
|
|
27
|
-
>
|
|
28
|
-
<c-icon v-if="isLoading" class="mr-2 h-4 w-4" name="loader"></c-icon>
|
|
29
|
-
<c-icon
|
|
30
|
-
v-if="icon && !isLoading"
|
|
31
|
-
:type="icon.type"
|
|
32
|
-
:class="iconClasses"
|
|
33
|
-
:name="icon.name"
|
|
34
|
-
:viewBox="icon.viewBox"
|
|
35
|
-
></c-icon>
|
|
36
|
-
{{ label }}
|
|
37
|
-
<slot name="customButtonContent"></slot>
|
|
38
|
-
</button>
|
|
39
|
-
<button
|
|
40
|
-
v-else-if="type != 'tertiary' && label.length == 0"
|
|
41
|
-
:type="type"
|
|
42
|
-
:class="classes"
|
|
43
|
-
:disabled="disabled"
|
|
44
|
-
class="focus:outline-none inline-flex items-center rounded-md px-3 py-2 text-sm font-medium shadow-sm focus:ring-2 focus:ring-offset-2 disabled:opacity-50"
|
|
45
|
-
@click.prevent="$emit('action')"
|
|
46
|
-
>
|
|
47
|
-
<c-icon v-if="isLoading" class="mr-2 h-4 w-4" name="loader"></c-icon>
|
|
48
|
-
<c-icon
|
|
49
|
-
v-if="icon && !isLoading"
|
|
50
|
-
:type="icon.type"
|
|
51
|
-
:class="iconClasses"
|
|
52
|
-
:name="icon.name"
|
|
53
|
-
:viewBox="icon.viewBox"
|
|
54
|
-
></c-icon>
|
|
55
|
-
<slot name="customButtonContent"></slot>
|
|
56
|
-
</button>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<script>
|
|
61
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
62
|
-
export default {
|
|
63
|
-
name: "CButton",
|
|
64
|
-
components: { CIcon },
|
|
65
|
-
props: {
|
|
66
|
-
label: {
|
|
67
|
-
type: String,
|
|
68
|
-
},
|
|
69
|
-
icon: {
|
|
70
|
-
type: Object,
|
|
71
|
-
},
|
|
72
|
-
type: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: "primary",
|
|
75
|
-
required: true,
|
|
76
|
-
},
|
|
77
|
-
isLoading: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false,
|
|
80
|
-
},
|
|
81
|
-
disabled: {
|
|
82
|
-
type: Boolean,
|
|
83
|
-
},
|
|
84
|
-
action: {
|
|
85
|
-
type: Function,
|
|
86
|
-
},
|
|
87
|
-
customClasses: {
|
|
88
|
-
type: String,
|
|
89
|
-
default: "",
|
|
90
|
-
},
|
|
91
|
-
iconCustomClasses: {
|
|
92
|
-
type: String,
|
|
93
|
-
default: "",
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
computed: {
|
|
98
|
-
classes() {
|
|
99
|
-
let classes = {
|
|
100
|
-
"text-gray-700 border bg-white border-gray-300 hover:bg-gray-50 focus:ring-indigo-600":
|
|
101
|
-
this.type == "white",
|
|
102
|
-
"text-indigo-700 bg-indigo-100 hover:bg-indigo-200 focus:ring-indigo-500":
|
|
103
|
-
this.type == "secondary",
|
|
104
|
-
"text-white hover:bg-indigo-800 bg-indigo-700 focus:ring-indigo-600":
|
|
105
|
-
this.type == "primary",
|
|
106
|
-
"text-white hover:bg-red-800 bg-red-700 focus:ring-red-600 border border-transparent":
|
|
107
|
-
this.type == "danger",
|
|
108
|
-
"text-white hover:bg-green-800 bg-green-700 focus:ring-green-600 border border-transparent":
|
|
109
|
-
this.type == "success",
|
|
110
|
-
"text-green-800 border border-solid border-gray-300 bg-white hover:bg-gray-50 focus:ring-indigo-600":
|
|
111
|
-
this.type == "secondary-success",
|
|
112
|
-
"text-gray-700 hover:bg-gray-200 bg-gray-100": this.type == "secondary-gray",
|
|
113
|
-
"bg-red-100 text-red-800 hover:bg-red-200 focus:ring-red-200": this.type == "light-red",
|
|
114
|
-
"bg-green-100 text-green-800 hover:bg-green-200 focus:ring-green-200":
|
|
115
|
-
this.type == "light-green",
|
|
116
|
-
"bg-gray-800 text-white hover:bg-gray-700 focus:ring-gray-500": this.type == "dark-blue",
|
|
117
|
-
"cursor-default pointer-events-none": this.isLoading,
|
|
118
|
-
};
|
|
119
|
-
classes[this.customClasses] = true;
|
|
120
|
-
return classes;
|
|
121
|
-
},
|
|
122
|
-
iconClasses() {
|
|
123
|
-
let iconClasses = {
|
|
124
|
-
"h-5 w-5 mr-1": this.iconCustomClasses ? false : true,
|
|
125
|
-
"text-indigo-400": this.type == "secondary",
|
|
126
|
-
"text-white":
|
|
127
|
-
this.type == "success" ||
|
|
128
|
-
this.type == "primary" ||
|
|
129
|
-
this.type == "danger" ||
|
|
130
|
-
this.type == "dark-blue",
|
|
131
|
-
"text-gray-400": this.type == "secondary-gray" || this.type == "white",
|
|
132
|
-
"text-red-400": this.type == "light-red",
|
|
133
|
-
};
|
|
134
|
-
iconClasses[this.iconCustomClasses] = true;
|
|
135
|
-
return iconClasses;
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
methods: {
|
|
140
|
-
onClick() {
|
|
141
|
-
this.$emit("onClick");
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
};
|
|
145
|
-
</script>
|
|
146
|
-
|
|
147
|
-
<style></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<slot></slot>
|
|
4
|
+
<button
|
|
5
|
+
v-if="type == 'tertiary'"
|
|
6
|
+
:class="customClasses"
|
|
7
|
+
class="focus:outline-none flex cursor-pointer flex-row rounded-md px-4 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"
|
|
8
|
+
@click.prevent="$emit('action')"
|
|
9
|
+
>
|
|
10
|
+
<c-icon
|
|
11
|
+
v-if="icon"
|
|
12
|
+
:type="icon.type"
|
|
13
|
+
:class="iconClasses"
|
|
14
|
+
:name="icon.name"
|
|
15
|
+
:viewBox="icon.viewBox"
|
|
16
|
+
></c-icon
|
|
17
|
+
>{{ label }}
|
|
18
|
+
<slot name="customButtonContent"></slot>
|
|
19
|
+
</button>
|
|
20
|
+
<button
|
|
21
|
+
v-else-if="type != 'tertiary' && label.length"
|
|
22
|
+
:type="type"
|
|
23
|
+
:class="classes"
|
|
24
|
+
:disabled="disabled"
|
|
25
|
+
class="focus:outline-none inline-flex items-center rounded-md px-4 py-2 text-sm font-medium shadow-sm focus:ring-2 focus:ring-offset-2 disabled:opacity-50"
|
|
26
|
+
@click.prevent="$emit('action')"
|
|
27
|
+
>
|
|
28
|
+
<c-icon v-if="isLoading" class="mr-2 h-4 w-4" name="loader"></c-icon>
|
|
29
|
+
<c-icon
|
|
30
|
+
v-if="icon && !isLoading"
|
|
31
|
+
:type="icon.type"
|
|
32
|
+
:class="iconClasses"
|
|
33
|
+
:name="icon.name"
|
|
34
|
+
:viewBox="icon.viewBox"
|
|
35
|
+
></c-icon>
|
|
36
|
+
{{ label }}
|
|
37
|
+
<slot name="customButtonContent"></slot>
|
|
38
|
+
</button>
|
|
39
|
+
<button
|
|
40
|
+
v-else-if="type != 'tertiary' && label.length == 0"
|
|
41
|
+
:type="type"
|
|
42
|
+
:class="classes"
|
|
43
|
+
:disabled="disabled"
|
|
44
|
+
class="focus:outline-none inline-flex items-center rounded-md px-3 py-2 text-sm font-medium shadow-sm focus:ring-2 focus:ring-offset-2 disabled:opacity-50"
|
|
45
|
+
@click.prevent="$emit('action')"
|
|
46
|
+
>
|
|
47
|
+
<c-icon v-if="isLoading" class="mr-2 h-4 w-4" name="loader"></c-icon>
|
|
48
|
+
<c-icon
|
|
49
|
+
v-if="icon && !isLoading"
|
|
50
|
+
:type="icon.type"
|
|
51
|
+
:class="iconClasses"
|
|
52
|
+
:name="icon.name"
|
|
53
|
+
:viewBox="icon.viewBox"
|
|
54
|
+
></c-icon>
|
|
55
|
+
<slot name="customButtonContent"></slot>
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
62
|
+
export default {
|
|
63
|
+
name: "CButton",
|
|
64
|
+
components: { CIcon },
|
|
65
|
+
props: {
|
|
66
|
+
label: {
|
|
67
|
+
type: String,
|
|
68
|
+
},
|
|
69
|
+
icon: {
|
|
70
|
+
type: Object,
|
|
71
|
+
},
|
|
72
|
+
type: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "primary",
|
|
75
|
+
required: true,
|
|
76
|
+
},
|
|
77
|
+
isLoading: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false,
|
|
80
|
+
},
|
|
81
|
+
disabled: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
},
|
|
84
|
+
action: {
|
|
85
|
+
type: Function,
|
|
86
|
+
},
|
|
87
|
+
customClasses: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: "",
|
|
90
|
+
},
|
|
91
|
+
iconCustomClasses: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: "",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
computed: {
|
|
98
|
+
classes() {
|
|
99
|
+
let classes = {
|
|
100
|
+
"text-gray-700 border bg-white border-gray-300 hover:bg-gray-50 focus:ring-indigo-600":
|
|
101
|
+
this.type == "white",
|
|
102
|
+
"text-indigo-700 bg-indigo-100 hover:bg-indigo-200 focus:ring-indigo-500":
|
|
103
|
+
this.type == "secondary",
|
|
104
|
+
"text-white hover:bg-indigo-800 bg-indigo-700 focus:ring-indigo-600":
|
|
105
|
+
this.type == "primary",
|
|
106
|
+
"text-white hover:bg-red-800 bg-red-700 focus:ring-red-600 border border-transparent":
|
|
107
|
+
this.type == "danger",
|
|
108
|
+
"text-white hover:bg-green-800 bg-green-700 focus:ring-green-600 border border-transparent":
|
|
109
|
+
this.type == "success",
|
|
110
|
+
"text-green-800 border border-solid border-gray-300 bg-white hover:bg-gray-50 focus:ring-indigo-600":
|
|
111
|
+
this.type == "secondary-success",
|
|
112
|
+
"text-gray-700 hover:bg-gray-200 bg-gray-100": this.type == "secondary-gray",
|
|
113
|
+
"bg-red-100 text-red-800 hover:bg-red-200 focus:ring-red-200": this.type == "light-red",
|
|
114
|
+
"bg-green-100 text-green-800 hover:bg-green-200 focus:ring-green-200":
|
|
115
|
+
this.type == "light-green",
|
|
116
|
+
"bg-gray-800 text-white hover:bg-gray-700 focus:ring-gray-500": this.type == "dark-blue",
|
|
117
|
+
"cursor-default pointer-events-none": this.isLoading,
|
|
118
|
+
};
|
|
119
|
+
classes[this.customClasses] = true;
|
|
120
|
+
return classes;
|
|
121
|
+
},
|
|
122
|
+
iconClasses() {
|
|
123
|
+
let iconClasses = {
|
|
124
|
+
"h-5 w-5 mr-1": this.iconCustomClasses ? false : true,
|
|
125
|
+
"text-indigo-400": this.type == "secondary",
|
|
126
|
+
"text-white":
|
|
127
|
+
this.type == "success" ||
|
|
128
|
+
this.type == "primary" ||
|
|
129
|
+
this.type == "danger" ||
|
|
130
|
+
this.type == "dark-blue",
|
|
131
|
+
"text-gray-400": this.type == "secondary-gray" || this.type == "white",
|
|
132
|
+
"text-red-400": this.type == "light-red",
|
|
133
|
+
};
|
|
134
|
+
iconClasses[this.iconCustomClasses] = true;
|
|
135
|
+
return iconClasses;
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
methods: {
|
|
140
|
+
onClick() {
|
|
141
|
+
this.$emit("onClick");
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<style></style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CButton from './CButton.vue'
|
|
2
|
-
|
|
1
|
+
import CButton from './CButton.vue'
|
|
2
|
+
|
|
3
3
|
export default CButton
|
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<span
|
|
4
|
-
v-if="!hideDropdownIcon"
|
|
5
|
-
class="relative -ml-px block sm:hidden sm:shadow-sm"
|
|
6
|
-
>
|
|
7
|
-
<div>
|
|
8
|
-
<button
|
|
9
|
-
@click="showButtons = !showButtons"
|
|
10
|
-
type="button"
|
|
11
|
-
class="focus:ring-blue-600 focus:border-blue-600 focus:outline-none relative inline-flex items-center rounded-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-900 hover:bg-gray-50 focus:z-10 focus:ring-1 sm:rounded-md sm:px-3"
|
|
12
|
-
id="menu-3"
|
|
13
|
-
aria-expanded="false"
|
|
14
|
-
aria-haspopup="true"
|
|
15
|
-
>
|
|
16
|
-
<span class="">{{ buttonObject[0].label }}</span>
|
|
17
|
-
<c-icon
|
|
18
|
-
type="solid"
|
|
19
|
-
name="chevron-down"
|
|
20
|
-
class="ml-2 h-5 w-5"
|
|
21
|
-
></c-icon>
|
|
22
|
-
</button>
|
|
23
|
-
</div>
|
|
24
|
-
<div
|
|
25
|
-
v-show="showButtons"
|
|
26
|
-
class="ring-black focus:outline-none absolute z-10 mt-2 w-full origin-top-right rounded-md bg-white shadow-lg ring-1 ring-opacity-5"
|
|
27
|
-
role="menu"
|
|
28
|
-
aria-orientation="vertical"
|
|
29
|
-
>
|
|
30
|
-
<div class="py-1">
|
|
31
|
-
<a
|
|
32
|
-
v-for="button in buttonObject"
|
|
33
|
-
v-bind:key="button.label"
|
|
34
|
-
href="#"
|
|
35
|
-
class="flex px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:bg-gray-100 focus:text-gray-900"
|
|
36
|
-
role="menuitem"
|
|
37
|
-
>
|
|
38
|
-
<div v-if="button.icon == ''" class="h-5"></div>
|
|
39
|
-
<c-icon
|
|
40
|
-
v-if="button.icon"
|
|
41
|
-
:name="button.icon"
|
|
42
|
-
type="solid"
|
|
43
|
-
class="-ml-1 mr-2 h-5 w-5 text-gray-400"
|
|
44
|
-
></c-icon>
|
|
45
|
-
{{ button.label }}
|
|
46
|
-
</a>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</span>
|
|
50
|
-
<span :class="buttonClass">
|
|
51
|
-
<button
|
|
52
|
-
v-for="(button, index) in buttonObject"
|
|
53
|
-
v-bind:key="button.label"
|
|
54
|
-
type="button"
|
|
55
|
-
class="focus:outline-none relative inline-flex items-center border-r border-l border-t border-b border-gray-300 bg-white px-2 py-2 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"
|
|
56
|
-
:class="{
|
|
57
|
-
'rounded-r-md rounded-l-none border-l border-r':
|
|
58
|
-
index == buttonObject.length - 1,
|
|
59
|
-
'rounded-l-md': index == 0,
|
|
60
|
-
'border-r-0': index != buttonObject.length - 1,
|
|
61
|
-
'px-4': button.label,
|
|
62
|
-
}"
|
|
63
|
-
@click="handleEvent(button.onClickAction)"
|
|
64
|
-
@blur="handleEvent(button.blurAction)"
|
|
65
|
-
>
|
|
66
|
-
<div v-if="button.icon == ''" class="h-5"></div>
|
|
67
|
-
<c-icon
|
|
68
|
-
v-if="button.icon"
|
|
69
|
-
:name="button.icon"
|
|
70
|
-
type="solid"
|
|
71
|
-
:class="button.label ? '-ml-1 mr-2' : ''"
|
|
72
|
-
class="h-5 w-5 text-gray-400"
|
|
73
|
-
></c-icon>
|
|
74
|
-
{{ button.label }}
|
|
75
|
-
<slot></slot>
|
|
76
|
-
</button>
|
|
77
|
-
</span>
|
|
78
|
-
</div>
|
|
79
|
-
</template>
|
|
80
|
-
|
|
81
|
-
<script>
|
|
82
|
-
import CIcon from "../CIcon/CIcon.vue";
|
|
83
|
-
export default {
|
|
84
|
-
name: "CButtonGroup",
|
|
85
|
-
components: { CIcon },
|
|
86
|
-
props: {
|
|
87
|
-
buttonObject: {
|
|
88
|
-
type: Array,
|
|
89
|
-
required: true,
|
|
90
|
-
},
|
|
91
|
-
hideDropdownIcon: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
default: false,
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
data() {
|
|
97
|
-
return {
|
|
98
|
-
showButtons: false,
|
|
99
|
-
buttonClass:
|
|
100
|
-
this.hideDropdownIcon === true
|
|
101
|
-
? "z-0 relative inline-flex rounded-md block"
|
|
102
|
-
: "z-0 relative inline-flex hidden rounded-md sm:block",
|
|
103
|
-
};
|
|
104
|
-
},
|
|
105
|
-
methods: {
|
|
106
|
-
handleEvent(function_name) {
|
|
107
|
-
if (function_name) function_name();
|
|
108
|
-
},
|
|
109
|
-
buttonAction(event, value) {
|
|
110
|
-
this.$emit("onClick", value);
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
</script>
|
|
115
|
-
|
|
116
|
-
<style></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<span
|
|
4
|
+
v-if="!hideDropdownIcon"
|
|
5
|
+
class="relative -ml-px block sm:hidden sm:shadow-sm"
|
|
6
|
+
>
|
|
7
|
+
<div>
|
|
8
|
+
<button
|
|
9
|
+
@click="showButtons = !showButtons"
|
|
10
|
+
type="button"
|
|
11
|
+
class="focus:ring-blue-600 focus:border-blue-600 focus:outline-none relative inline-flex items-center rounded-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-900 hover:bg-gray-50 focus:z-10 focus:ring-1 sm:rounded-md sm:px-3"
|
|
12
|
+
id="menu-3"
|
|
13
|
+
aria-expanded="false"
|
|
14
|
+
aria-haspopup="true"
|
|
15
|
+
>
|
|
16
|
+
<span class="">{{ buttonObject[0].label }}</span>
|
|
17
|
+
<c-icon
|
|
18
|
+
type="solid"
|
|
19
|
+
name="chevron-down"
|
|
20
|
+
class="ml-2 h-5 w-5"
|
|
21
|
+
></c-icon>
|
|
22
|
+
</button>
|
|
23
|
+
</div>
|
|
24
|
+
<div
|
|
25
|
+
v-show="showButtons"
|
|
26
|
+
class="ring-black focus:outline-none absolute z-10 mt-2 w-full origin-top-right rounded-md bg-white shadow-lg ring-1 ring-opacity-5"
|
|
27
|
+
role="menu"
|
|
28
|
+
aria-orientation="vertical"
|
|
29
|
+
>
|
|
30
|
+
<div class="py-1">
|
|
31
|
+
<a
|
|
32
|
+
v-for="button in buttonObject"
|
|
33
|
+
v-bind:key="button.label"
|
|
34
|
+
href="#"
|
|
35
|
+
class="flex px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:bg-gray-100 focus:text-gray-900"
|
|
36
|
+
role="menuitem"
|
|
37
|
+
>
|
|
38
|
+
<div v-if="button.icon == ''" class="h-5"></div>
|
|
39
|
+
<c-icon
|
|
40
|
+
v-if="button.icon"
|
|
41
|
+
:name="button.icon"
|
|
42
|
+
type="solid"
|
|
43
|
+
class="-ml-1 mr-2 h-5 w-5 text-gray-400"
|
|
44
|
+
></c-icon>
|
|
45
|
+
{{ button.label }}
|
|
46
|
+
</a>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</span>
|
|
50
|
+
<span :class="buttonClass">
|
|
51
|
+
<button
|
|
52
|
+
v-for="(button, index) in buttonObject"
|
|
53
|
+
v-bind:key="button.label"
|
|
54
|
+
type="button"
|
|
55
|
+
class="focus:outline-none relative inline-flex items-center border-r border-l border-t border-b border-gray-300 bg-white px-2 py-2 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"
|
|
56
|
+
:class="{
|
|
57
|
+
'rounded-r-md rounded-l-none border-l border-r':
|
|
58
|
+
index == buttonObject.length - 1,
|
|
59
|
+
'rounded-l-md': index == 0,
|
|
60
|
+
'border-r-0': index != buttonObject.length - 1,
|
|
61
|
+
'px-4': button.label,
|
|
62
|
+
}"
|
|
63
|
+
@click="handleEvent(button.onClickAction)"
|
|
64
|
+
@blur="handleEvent(button.blurAction)"
|
|
65
|
+
>
|
|
66
|
+
<div v-if="button.icon == ''" class="h-5"></div>
|
|
67
|
+
<c-icon
|
|
68
|
+
v-if="button.icon"
|
|
69
|
+
:name="button.icon"
|
|
70
|
+
type="solid"
|
|
71
|
+
:class="button.label ? '-ml-1 mr-2' : ''"
|
|
72
|
+
class="h-5 w-5 text-gray-400"
|
|
73
|
+
></c-icon>
|
|
74
|
+
{{ button.label }}
|
|
75
|
+
<slot></slot>
|
|
76
|
+
</button>
|
|
77
|
+
</span>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script>
|
|
82
|
+
import CIcon from "../CIcon/CIcon.vue";
|
|
83
|
+
export default {
|
|
84
|
+
name: "CButtonGroup",
|
|
85
|
+
components: { CIcon },
|
|
86
|
+
props: {
|
|
87
|
+
buttonObject: {
|
|
88
|
+
type: Array,
|
|
89
|
+
required: true,
|
|
90
|
+
},
|
|
91
|
+
hideDropdownIcon: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
data() {
|
|
97
|
+
return {
|
|
98
|
+
showButtons: false,
|
|
99
|
+
buttonClass:
|
|
100
|
+
this.hideDropdownIcon === true
|
|
101
|
+
? "z-0 relative inline-flex rounded-md block"
|
|
102
|
+
: "z-0 relative inline-flex hidden rounded-md sm:block",
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
handleEvent(function_name) {
|
|
107
|
+
if (function_name) function_name();
|
|
108
|
+
},
|
|
109
|
+
buttonAction(event, value) {
|
|
110
|
+
this.$emit("onClick", value);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<style></style>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CButtonGroup from './CButtonGroup.vue'
|
|
2
|
-
|
|
1
|
+
import CButtonGroup from './CButtonGroup.vue'
|
|
2
|
+
|
|
3
3
|
export default CButtonGroup
|