@eturnity/eturnity_reusable_components 1.0.20 → 1.0.21

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,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <component-wrapper>
3
- <container :checkColor="checkColor"
3
+ <container
4
+ :checkColor="checkColor"
5
+ :size="size"
6
+ :hasLabel="!!label.length"
7
+ :backgroundColor="backgroundColor"
4
8
  >{{ label }}
5
9
  <input-checkbox
6
10
  type="checkbox"
@@ -20,6 +24,8 @@
20
24
  // :isChecked="isChecked" //required
21
25
  // @on-event-handler="onInputChange($event)" //required
22
26
  // checkColor="blue"
27
+ // size="small"
28
+ // backgroundColor="red"
23
29
  // />
24
30
  import styled from "vue-styled-components"
25
31
 
@@ -27,10 +33,15 @@ const ComponentWrapper = styled.div`
27
33
  display: inline-block;
28
34
  `
29
35
 
30
- const containerAttrs = { checkColor: String }
36
+ const containerAttrs = {
37
+ checkColor: String,
38
+ size: String,
39
+ hasLabel: Boolean,
40
+ backgroundColor: String,
41
+ }
31
42
  const Container = styled("label", containerAttrs)`
32
43
  display: grid;
33
- height: 28px;
44
+ height: ${(props) => (props.hasLabel ? "28px" : "auto")};
34
45
  align-content: center;
35
46
  color: ${(props) => props.theme.colors.black};
36
47
  position: relative;
@@ -44,9 +55,20 @@ const Container = styled("label", containerAttrs)`
44
55
  position: absolute;
45
56
  top: 0;
46
57
  left: 0;
47
- height: 25px;
48
- width: 25px;
49
- background-color: #fff;
58
+ height: ${(props) =>
59
+ props.size === "medium"
60
+ ? "25px"
61
+ : props.size === "small"
62
+ ? "16px"
63
+ : "25px"};
64
+ width: ${(props) =>
65
+ props.size === "medium"
66
+ ? "25px"
67
+ : props.size === "small"
68
+ ? "16px"
69
+ : "25px"};
70
+ background-color: ${(props) =>
71
+ props.backgroundColor ? props.backgroundColor : props.theme.colors.green};
50
72
  border-radius: 4px;
51
73
  border: 1px solid ${(props) => props.theme.colors.mediumGray};
52
74
 
@@ -58,14 +80,27 @@ const Container = styled("label", containerAttrs)`
58
80
  }
59
81
 
60
82
  .checkmark:after {
61
- left: 9px;
62
- top: 5px;
63
- width: 5px;
64
- height: 10px;
83
+ left: ${(props) =>
84
+ props.size === "medium" ? "9px" : props.size === "small" ? "5px" : "9px"};
85
+ top: ${(props) =>
86
+ props.size === "medium" ? "5px" : props.size === "small" ? "2px" : "5px"};
87
+ width: ${(props) =>
88
+ props.size === "medium" ? "5px" : props.size === "small" ? "3px" : "5px"};
89
+ height: ${(props) =>
90
+ props.size === "medium"
91
+ ? "10px"
92
+ : props.size === "small"
93
+ ? "6px"
94
+ : "10px"};
65
95
  border: solid
66
96
  ${(props) =>
67
- props.checkColor ? props.checkColor : props.theme.colors.black};
68
- border-width: 0 3px 3px 0;
97
+ props.checkColor ? props.checkColor : props.theme.colors.white};
98
+ border-width: ${(props) =>
99
+ props.size === "medium"
100
+ ? "0 3px 3px 0"
101
+ : props.size === "small"
102
+ ? "0 2px 2px 0"
103
+ : "0 3px 3px 0"};
69
104
  transform: rotate(45deg);
70
105
  }
71
106
  `
@@ -102,6 +137,13 @@ export default {
102
137
  checkColor: {
103
138
  required: false,
104
139
  },
140
+ size: {
141
+ required: false,
142
+ default: "medium", // small, medium
143
+ },
144
+ backgroundColor: {
145
+ required: false,
146
+ },
105
147
  },
106
148
  methods: {
107
149
  onChangeHandler(value) {