@eturnity/eturnity_reusable_components 1.1.64 → 1.1.67
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/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -55,6 +55,12 @@
|
|
|
55
55
|
size="small"
|
|
56
56
|
:isDisabled="false"
|
|
57
57
|
/>
|
|
58
|
+
<main-button
|
|
59
|
+
text="Click me!"
|
|
60
|
+
:isDisabled="false"
|
|
61
|
+
type="primary"
|
|
62
|
+
@click.native="onClickButton()"
|
|
63
|
+
/>
|
|
58
64
|
</page-container>
|
|
59
65
|
</ThemeProvider>
|
|
60
66
|
</template>
|
|
@@ -70,6 +76,7 @@ import InputNumber from "@/components/inputs/inputNumber"
|
|
|
70
76
|
import Checkbox from "@/components/inputs/checkbox"
|
|
71
77
|
import PageSubtitle from "@/components/pageSubtitle"
|
|
72
78
|
import Spinner from "@/components/spinner"
|
|
79
|
+
import MainButton from "@/components/buttons/mainButton"
|
|
73
80
|
// import TableDropdown from "@/components/tableDropdown"
|
|
74
81
|
|
|
75
82
|
const PageContainer = styled.div`
|
|
@@ -88,6 +95,7 @@ export default {
|
|
|
88
95
|
PageSubtitle,
|
|
89
96
|
Spinner,
|
|
90
97
|
Checkbox,
|
|
98
|
+
MainButton,
|
|
91
99
|
// TableDropdown,
|
|
92
100
|
},
|
|
93
101
|
data() {
|
|
@@ -159,6 +167,9 @@ export default {
|
|
|
159
167
|
isDropdownOpen() {
|
|
160
168
|
return this.dropdownOpen
|
|
161
169
|
},
|
|
170
|
+
onClickButton() {
|
|
171
|
+
console.log("Test")
|
|
172
|
+
},
|
|
162
173
|
toggleDropdownOpen() {
|
|
163
174
|
this.dropdownOpen = !this.dropdownOpen
|
|
164
175
|
},
|
package/src/assets/theme.js
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<page-container>
|
|
3
|
+
<button-container
|
|
4
|
+
:isDisabled="isDisabled"
|
|
5
|
+
:type="type"
|
|
6
|
+
:customColor="customColor"
|
|
7
|
+
>
|
|
8
|
+
{{ text }}
|
|
9
|
+
</button-container>
|
|
10
|
+
</page-container>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
// To use:
|
|
15
|
+
// import MainButton from "@eturnity/eturnity_reusable_components/src/components/buttons/mainButton"
|
|
16
|
+
// <main-button
|
|
17
|
+
// type="secondary" // primary, secondary, cancel
|
|
18
|
+
// :isDisabled="true"
|
|
19
|
+
// text="Click Me"
|
|
20
|
+
// customColor="#ab5348"
|
|
21
|
+
// />
|
|
22
|
+
|
|
23
|
+
import styled from "vue-styled-components"
|
|
24
|
+
|
|
25
|
+
const PageContainer = styled.div``
|
|
26
|
+
|
|
27
|
+
const ButtonAttrs = { type: String, isDisabled: Boolean, customColor: String }
|
|
28
|
+
const ButtonContainer = styled("div", ButtonAttrs)`
|
|
29
|
+
padding: 7px 15px;
|
|
30
|
+
font-size: 13px;
|
|
31
|
+
color: ${(props) => props.theme.colors.white};
|
|
32
|
+
background-color: ${(props) =>
|
|
33
|
+
props.isDisabled
|
|
34
|
+
? props.theme.colors.disabled
|
|
35
|
+
: props.customColor
|
|
36
|
+
? props.customColor
|
|
37
|
+
: props.type === "primary"
|
|
38
|
+
? props.theme.colors.black
|
|
39
|
+
: props.type === "secondary"
|
|
40
|
+
? props.theme.colors.grey3
|
|
41
|
+
: props.type === "cancel"
|
|
42
|
+
? props.theme.colors.red
|
|
43
|
+
: props.theme.colors.black};
|
|
44
|
+
border-radius: 4px;
|
|
45
|
+
text-align: center;
|
|
46
|
+
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
|
47
|
+
user-select: none;
|
|
48
|
+
|
|
49
|
+
&:hover {
|
|
50
|
+
opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:active {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
`
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
name: "main-button",
|
|
60
|
+
components: {
|
|
61
|
+
PageContainer,
|
|
62
|
+
ButtonContainer,
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
type: {
|
|
66
|
+
required: false,
|
|
67
|
+
default: "primary",
|
|
68
|
+
},
|
|
69
|
+
isDisabled: {
|
|
70
|
+
required: false,
|
|
71
|
+
default: false,
|
|
72
|
+
},
|
|
73
|
+
text: {
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
customColor: {
|
|
77
|
+
required: false,
|
|
78
|
+
default: null,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
</script>
|