@eturnity/eturnity_reusable_components 1.0.54 → 1.0.58
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
|
@@ -24,7 +24,12 @@
|
|
|
24
24
|
</main-table>
|
|
25
25
|
<br />
|
|
26
26
|
<br />
|
|
27
|
-
<
|
|
27
|
+
<toggle
|
|
28
|
+
@on-toggle-change="onInputChange($event)"
|
|
29
|
+
:isChecked="inputValue"
|
|
30
|
+
label="My Label Text"
|
|
31
|
+
labelAlign="right"
|
|
32
|
+
/>
|
|
28
33
|
</page-container>
|
|
29
34
|
</ThemeProvider>
|
|
30
35
|
</template>
|
|
@@ -35,7 +40,7 @@ import theme from "./assets/theme"
|
|
|
35
40
|
import styled from "vue-styled-components"
|
|
36
41
|
import MainTable from "@/components/tables/mainTable"
|
|
37
42
|
import ThreeDots from "@/components/threeDots"
|
|
38
|
-
import
|
|
43
|
+
import Toggle from "@/components/inputs/toggle"
|
|
39
44
|
|
|
40
45
|
const PageContainer = styled.div`
|
|
41
46
|
padding: 40px;
|
|
@@ -48,11 +53,11 @@ export default {
|
|
|
48
53
|
PageContainer,
|
|
49
54
|
MainTable,
|
|
50
55
|
ThreeDots,
|
|
51
|
-
|
|
56
|
+
Toggle,
|
|
52
57
|
},
|
|
53
58
|
data() {
|
|
54
59
|
return {
|
|
55
|
-
inputValue:
|
|
60
|
+
inputValue: true,
|
|
56
61
|
checkedOption: "button_1",
|
|
57
62
|
question: {
|
|
58
63
|
number_format_precision: 4,
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
@keydown.space.prevent="onToggleChange"
|
|
14
14
|
:disabled="disabled"
|
|
15
15
|
>
|
|
16
|
-
<toggle-background
|
|
16
|
+
<toggle-background
|
|
17
|
+
:backgroundColor="backgroundColor"
|
|
18
|
+
:isChecked="isChecked"
|
|
19
|
+
/>
|
|
17
20
|
<toggle-dot
|
|
18
21
|
:isChecked="isChecked"
|
|
19
22
|
:toggleColor="toggleColor"
|
|
@@ -43,6 +46,7 @@
|
|
|
43
46
|
// backgroundColor="blue"
|
|
44
47
|
// labelAlign="right"
|
|
45
48
|
// fontColor="black"
|
|
49
|
+
// :disabled="true"
|
|
46
50
|
// />
|
|
47
51
|
|
|
48
52
|
import styled from "vue-styled-components"
|
|
@@ -72,7 +76,7 @@ const LabelText = styled("div", toggleAttrs)`
|
|
|
72
76
|
props.size === "medium"
|
|
73
77
|
? "16px"
|
|
74
78
|
: props.size === "small"
|
|
75
|
-
? "
|
|
79
|
+
? "13px"
|
|
76
80
|
: "16px"};
|
|
77
81
|
`
|
|
78
82
|
|
|
@@ -104,16 +108,18 @@ const ToggleWrapper = styled("span", toggleAttrs)`
|
|
|
104
108
|
}
|
|
105
109
|
`
|
|
106
110
|
|
|
107
|
-
const
|
|
108
|
-
const ToggleBackground = styled("span",
|
|
111
|
+
const backgroundAttrs = { backgroundColor: String, isChecked: Boolean }
|
|
112
|
+
const ToggleBackground = styled("span", backgroundAttrs)`
|
|
109
113
|
display: inline-block;
|
|
110
114
|
border-radius: 100px;
|
|
111
115
|
height: 100%;
|
|
112
116
|
width: 100%;
|
|
113
117
|
background-color: ${(props) =>
|
|
114
|
-
props.
|
|
118
|
+
props.isChecked
|
|
115
119
|
? props.backgroundColor
|
|
116
|
-
|
|
120
|
+
? props.backgroundColor
|
|
121
|
+
: props.theme.colors.green
|
|
122
|
+
: props.theme.colors.grey3};
|
|
117
123
|
transition: 0.4s ease;
|
|
118
124
|
`
|
|
119
125
|
|
|
@@ -137,7 +143,7 @@ const ToggleDot = styled("span", toggleProps)`
|
|
|
137
143
|
: props.size === "small"
|
|
138
144
|
? "10px"
|
|
139
145
|
: "14px"};
|
|
140
|
-
left:
|
|
146
|
+
left: 4px
|
|
141
147
|
bottom: ${(props) =>
|
|
142
148
|
props.size === "medium" ? "5px" : props.size === "small" ? "3px" : "5px"};
|
|
143
149
|
background-color: ${(props) =>
|
|
@@ -146,8 +152,8 @@ const ToggleDot = styled("span", toggleProps)`
|
|
|
146
152
|
: props.isChecked
|
|
147
153
|
? props.toggleColor
|
|
148
154
|
? props.toggleColor
|
|
149
|
-
: props.theme.colors.
|
|
150
|
-
: props.theme.colors.
|
|
155
|
+
: props.theme.colors.white
|
|
156
|
+
: props.theme.colors.white};
|
|
151
157
|
border-radius: 100%;
|
|
152
158
|
transition: transform 0.4s ease;
|
|
153
159
|
transform: ${(props) =>
|
|
@@ -195,7 +201,7 @@ export default {
|
|
|
195
201
|
},
|
|
196
202
|
size: {
|
|
197
203
|
required: false,
|
|
198
|
-
default: "
|
|
204
|
+
default: "small",
|
|
199
205
|
},
|
|
200
206
|
labelAlign: {
|
|
201
207
|
required: false,
|
|
@@ -171,7 +171,7 @@ const TableContainer = styled.table`
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
.text {
|
|
174
|
-
padding
|
|
174
|
+
padding: 10px 0 10px 18px;
|
|
175
175
|
color: ${(props) => props.theme.colors.black};
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -180,7 +180,7 @@ const TableContainer = styled.table`
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.icons-container {
|
|
183
|
-
width:
|
|
183
|
+
width: 1%; // necessary so it doesn't take up too much white space
|
|
184
184
|
display: table-cell;
|
|
185
185
|
flex-wrap: nowrap;
|
|
186
186
|
background-color: #fff;
|