@eturnity/eturnity_reusable_components 1.0.75 → 1.0.76
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 +1 -1
- package/src/App.vue +17 -3
- package/src/components/inputs/toggle/index.vue +18 -4
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -13,8 +13,21 @@
|
|
|
13
13
|
<tbody>
|
|
14
14
|
<tr>
|
|
15
15
|
<td class="text">Body 2</td>
|
|
16
|
-
<td
|
|
17
|
-
|
|
16
|
+
<td>
|
|
17
|
+
<toggle
|
|
18
|
+
@on-toggle-change="onInputChange($event)"
|
|
19
|
+
:isChecked="isChecked"
|
|
20
|
+
labelAlign="right"
|
|
21
|
+
/>
|
|
22
|
+
</td>
|
|
23
|
+
<td>
|
|
24
|
+
<toggle
|
|
25
|
+
@on-toggle-change="onInputChange($event)"
|
|
26
|
+
:isChecked="isChecked"
|
|
27
|
+
labelAlign="right"
|
|
28
|
+
:disabled="true"
|
|
29
|
+
/>
|
|
30
|
+
</td>
|
|
18
31
|
<div class="icons-container">
|
|
19
32
|
<three-dots :options="listOptions" :isLoading="false" />
|
|
20
33
|
</div>
|
|
@@ -28,6 +41,7 @@
|
|
|
28
41
|
:isChecked="isChecked"
|
|
29
42
|
label="My Label Text"
|
|
30
43
|
labelAlign="right"
|
|
44
|
+
:disabled="true"
|
|
31
45
|
/>
|
|
32
46
|
</page-container>
|
|
33
47
|
</ThemeProvider>
|
|
@@ -64,7 +78,7 @@ export default {
|
|
|
64
78
|
number_max_allowed: 10,
|
|
65
79
|
unit_short_name: "cm",
|
|
66
80
|
},
|
|
67
|
-
isChecked:
|
|
81
|
+
isChecked: false,
|
|
68
82
|
listOptions: [
|
|
69
83
|
{
|
|
70
84
|
name: "Option 1",
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
tabindex="0"
|
|
12
12
|
@keydown.space.prevent="onToggleChange"
|
|
13
13
|
:disabled="disabled"
|
|
14
|
+
:backgroundColor="backgroundColor"
|
|
15
|
+
:isChecked="isChecked"
|
|
14
16
|
>
|
|
15
17
|
<toggle-background
|
|
16
18
|
:backgroundColor="backgroundColor"
|
|
@@ -69,7 +71,13 @@ const FlexWrapper = styled("div", flexAttrs)`
|
|
|
69
71
|
cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
|
|
70
72
|
`
|
|
71
73
|
|
|
72
|
-
const toggleAttrs = {
|
|
74
|
+
const toggleAttrs = {
|
|
75
|
+
size: String,
|
|
76
|
+
fontColor: String,
|
|
77
|
+
disabled: Boolean,
|
|
78
|
+
backgroundColor: String,
|
|
79
|
+
isChecked: Boolean,
|
|
80
|
+
}
|
|
73
81
|
const LabelText = styled("div", toggleAttrs)`
|
|
74
82
|
color: ${(props) =>
|
|
75
83
|
props.fontColor ? props.fontColor : props.theme.colors.darkGray};
|
|
@@ -84,7 +92,13 @@ const LabelText = styled("div", toggleAttrs)`
|
|
|
84
92
|
const ToggleWrapper = styled("span", toggleAttrs)`
|
|
85
93
|
display: inline-block;
|
|
86
94
|
border: ${(props) =>
|
|
87
|
-
props.disabled
|
|
95
|
+
props.disabled
|
|
96
|
+
? "1px solid " + props.theme.colors.disabled
|
|
97
|
+
: props.isChecked
|
|
98
|
+
? props.backgroundColor
|
|
99
|
+
? "1px solid " + props.backgroundColor
|
|
100
|
+
: "1px solid " + props.theme.colors.green
|
|
101
|
+
: "1px solid " + props.theme.colors.grey3}
|
|
88
102
|
position: relative;
|
|
89
103
|
cursor: ${(props) => (props.disabled ? "not-allowed" : "pointer")};
|
|
90
104
|
width: ${(props) =>
|
|
@@ -97,7 +111,7 @@ const ToggleWrapper = styled("span", toggleAttrs)`
|
|
|
97
111
|
props.size === "medium"
|
|
98
112
|
? "24px"
|
|
99
113
|
: props.size === "small"
|
|
100
|
-
? "
|
|
114
|
+
? "14px"
|
|
101
115
|
: "24px"};
|
|
102
116
|
border-radius: 9px;
|
|
103
117
|
|
|
@@ -154,7 +168,7 @@ const ToggleDot = styled("span", toggleProps)`
|
|
|
154
168
|
: "14px"};
|
|
155
169
|
left: 3px
|
|
156
170
|
bottom: ${(props) =>
|
|
157
|
-
props.size === "medium" ? "5px" : props.size === "small" ? "
|
|
171
|
+
props.size === "medium" ? "5px" : props.size === "small" ? "2px" : "5px"};
|
|
158
172
|
background-color: ${(props) =>
|
|
159
173
|
props.disabled
|
|
160
174
|
? props.theme.colors.disabled
|