@eturnity/eturnity_reusable_components 1.0.18 → 1.0.22
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
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component-wrapper>
|
|
3
|
-
<container
|
|
3
|
+
<container
|
|
4
|
+
:checkColor="checkColor"
|
|
5
|
+
:size="size"
|
|
6
|
+
:hasLabel="!!label.length"
|
|
7
|
+
:backgroundColor="backgroundColor"
|
|
8
|
+
:isChecked="isChecked"
|
|
4
9
|
>{{ label }}
|
|
5
10
|
<input-checkbox
|
|
6
11
|
type="checkbox"
|
|
@@ -20,6 +25,8 @@
|
|
|
20
25
|
// :isChecked="isChecked" //required
|
|
21
26
|
// @on-event-handler="onInputChange($event)" //required
|
|
22
27
|
// checkColor="blue"
|
|
28
|
+
// size="small"
|
|
29
|
+
// backgroundColor="red"
|
|
23
30
|
// />
|
|
24
31
|
import styled from "vue-styled-components"
|
|
25
32
|
|
|
@@ -27,10 +34,16 @@ const ComponentWrapper = styled.div`
|
|
|
27
34
|
display: inline-block;
|
|
28
35
|
`
|
|
29
36
|
|
|
30
|
-
const containerAttrs = {
|
|
37
|
+
const containerAttrs = {
|
|
38
|
+
checkColor: String,
|
|
39
|
+
size: String,
|
|
40
|
+
hasLabel: Boolean,
|
|
41
|
+
backgroundColor: String,
|
|
42
|
+
isChecked: Boolean,
|
|
43
|
+
}
|
|
31
44
|
const Container = styled("label", containerAttrs)`
|
|
32
45
|
display: grid;
|
|
33
|
-
height: 28px;
|
|
46
|
+
height: ${(props) => (props.hasLabel ? "28px" : "auto")};
|
|
34
47
|
align-content: center;
|
|
35
48
|
color: ${(props) => props.theme.colors.black};
|
|
36
49
|
position: relative;
|
|
@@ -44,11 +57,30 @@ const Container = styled("label", containerAttrs)`
|
|
|
44
57
|
position: absolute;
|
|
45
58
|
top: 0;
|
|
46
59
|
left: 0;
|
|
47
|
-
height:
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
height: ${(props) =>
|
|
61
|
+
props.size === "medium"
|
|
62
|
+
? "25px"
|
|
63
|
+
: props.size === "small"
|
|
64
|
+
? "16px"
|
|
65
|
+
: "25px"};
|
|
66
|
+
width: ${(props) =>
|
|
67
|
+
props.size === "medium"
|
|
68
|
+
? "25px"
|
|
69
|
+
: props.size === "small"
|
|
70
|
+
? "16px"
|
|
71
|
+
: "25px"};
|
|
72
|
+
background-color: ${(props) =>
|
|
73
|
+
props.isChecked
|
|
74
|
+
? "#fff"
|
|
75
|
+
: props.backgroundColor
|
|
76
|
+
? props.backgroundColor
|
|
77
|
+
: props.theme.colors.green};
|
|
50
78
|
border-radius: 4px;
|
|
51
|
-
border: 1px solid
|
|
79
|
+
border: 1px solid
|
|
80
|
+
${(props) =>
|
|
81
|
+
props.isChecked && props.backgroundColor
|
|
82
|
+
? props.backgroundColor
|
|
83
|
+
: props.theme.colors.mediumGray};
|
|
52
84
|
|
|
53
85
|
&:after {
|
|
54
86
|
content: "";
|
|
@@ -58,14 +90,27 @@ const Container = styled("label", containerAttrs)`
|
|
|
58
90
|
}
|
|
59
91
|
|
|
60
92
|
.checkmark:after {
|
|
61
|
-
left:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
93
|
+
left: ${(props) =>
|
|
94
|
+
props.size === "medium" ? "9px" : props.size === "small" ? "5px" : "9px"};
|
|
95
|
+
top: ${(props) =>
|
|
96
|
+
props.size === "medium" ? "5px" : props.size === "small" ? "2px" : "5px"};
|
|
97
|
+
width: ${(props) =>
|
|
98
|
+
props.size === "medium" ? "5px" : props.size === "small" ? "3px" : "5px"};
|
|
99
|
+
height: ${(props) =>
|
|
100
|
+
props.size === "medium"
|
|
101
|
+
? "10px"
|
|
102
|
+
: props.size === "small"
|
|
103
|
+
? "6px"
|
|
104
|
+
: "10px"};
|
|
65
105
|
border: solid
|
|
66
106
|
${(props) =>
|
|
67
|
-
props.checkColor ? props.checkColor : props.theme.colors.
|
|
68
|
-
border-width:
|
|
107
|
+
props.checkColor ? props.checkColor : props.theme.colors.white};
|
|
108
|
+
border-width: ${(props) =>
|
|
109
|
+
props.size === "medium"
|
|
110
|
+
? "0 3px 3px 0"
|
|
111
|
+
: props.size === "small"
|
|
112
|
+
? "0 2px 2px 0"
|
|
113
|
+
: "0 3px 3px 0"};
|
|
69
114
|
transform: rotate(45deg);
|
|
70
115
|
}
|
|
71
116
|
`
|
|
@@ -102,6 +147,13 @@ export default {
|
|
|
102
147
|
checkColor: {
|
|
103
148
|
required: false,
|
|
104
149
|
},
|
|
150
|
+
size: {
|
|
151
|
+
required: false,
|
|
152
|
+
default: "medium", // small, medium
|
|
153
|
+
},
|
|
154
|
+
backgroundColor: {
|
|
155
|
+
required: false,
|
|
156
|
+
},
|
|
105
157
|
},
|
|
106
158
|
methods: {
|
|
107
159
|
onChangeHandler(value) {
|
|
@@ -65,12 +65,23 @@ const TableContainer = styled.table`
|
|
|
65
65
|
th {
|
|
66
66
|
padding: 12px 20px;
|
|
67
67
|
background-color: ${(props) => props.theme.colors.blue1};
|
|
68
|
+
|
|
69
|
+
.ordering {
|
|
70
|
+
display: grid;
|
|
71
|
+
grid-template-columns: 1fr auto;
|
|
72
|
+
grid-gap: 6px;
|
|
73
|
+
}
|
|
68
74
|
}
|
|
69
75
|
|
|
70
76
|
td {
|
|
71
77
|
padding: 7px 10px;
|
|
72
78
|
border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
|
|
73
79
|
|
|
80
|
+
&.empty {
|
|
81
|
+
height: 100px;
|
|
82
|
+
text-align: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
74
85
|
&.no-border {
|
|
75
86
|
border-bottom: none;
|
|
76
87
|
}
|