@eturnity/eturnity_reusable_components 1.0.57 → 1.0.61
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,
|
|
@@ -49,7 +49,7 @@ const Container = styled("label", containerAttrs)`
|
|
|
49
49
|
align-content: center;
|
|
50
50
|
color: ${(props) => props.theme.colors.black};
|
|
51
51
|
position: relative;
|
|
52
|
-
padding-left: 42px;
|
|
52
|
+
/* padding-left: 42px; */
|
|
53
53
|
margin-bottom: 12px;
|
|
54
54
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
|
55
55
|
font-size: 16px;
|
|
@@ -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,
|
|
@@ -81,11 +81,15 @@ const TableContainer = styled.table`
|
|
|
81
81
|
background-color: ${(props) => props.theme.colors.grey5};
|
|
82
82
|
cursor: pointer;
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
td {
|
|
86
|
+
height: 40px;
|
|
87
|
+
}
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
th {
|
|
88
|
-
padding:
|
|
92
|
+
padding: 11px 15px;
|
|
89
93
|
background-color: ${(props) => props.theme.colors.blue1};
|
|
90
94
|
|
|
91
95
|
.ordering {
|
|
@@ -152,6 +156,15 @@ const TableContainer = styled.table`
|
|
|
152
156
|
text-align: right;
|
|
153
157
|
}
|
|
154
158
|
}
|
|
159
|
+
|
|
160
|
+
&.checkbox {
|
|
161
|
+
padding: 7px 15px !important;
|
|
162
|
+
width: 40px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&.checkbox-header {
|
|
166
|
+
width: 40px;
|
|
167
|
+
}
|
|
155
168
|
}
|
|
156
169
|
|
|
157
170
|
tr {
|