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