@eturnity/eturnity_reusable_components 1.0.73 → 1.0.74
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 +9 -27
- package/src/components/inputs/toggle/index.vue +7 -10
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -23,22 +23,12 @@
|
|
|
23
23
|
</main-table>
|
|
24
24
|
<br />
|
|
25
25
|
<br />
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
textAlign="left"
|
|
33
|
-
fontSize="13px"
|
|
34
|
-
labelText="Number of Modules"
|
|
35
|
-
labelInfoText="Here is some information for you..."
|
|
36
|
-
:disabled="true"
|
|
37
|
-
/>
|
|
38
|
-
</input-wrapper>
|
|
39
|
-
<br />
|
|
40
|
-
<br />
|
|
41
|
-
<delete-icon />
|
|
26
|
+
<toggle
|
|
27
|
+
@on-toggle-change="onInputChange($event)"
|
|
28
|
+
:isChecked="isChecked"
|
|
29
|
+
label="My Label Text"
|
|
30
|
+
labelAlign="right"
|
|
31
|
+
/>
|
|
42
32
|
</page-container>
|
|
43
33
|
</ThemeProvider>
|
|
44
34
|
</template>
|
|
@@ -49,18 +39,12 @@ import theme from "./assets/theme"
|
|
|
49
39
|
import styled from "vue-styled-components"
|
|
50
40
|
import MainTable from "@/components/tables/mainTable"
|
|
51
41
|
import ThreeDots from "@/components/threeDots"
|
|
52
|
-
import
|
|
53
|
-
import DeleteIcon from "@/components/deleteIcon"
|
|
42
|
+
import Toggle from "@/components/inputs/toggle"
|
|
54
43
|
|
|
55
44
|
const PageContainer = styled.div`
|
|
56
45
|
padding: 40px;
|
|
57
46
|
`
|
|
58
47
|
|
|
59
|
-
const InputWrapper = styled.div`
|
|
60
|
-
height: 36px;
|
|
61
|
-
width: 180px;
|
|
62
|
-
`
|
|
63
|
-
|
|
64
48
|
export default {
|
|
65
49
|
name: "App",
|
|
66
50
|
components: {
|
|
@@ -68,9 +52,7 @@ export default {
|
|
|
68
52
|
PageContainer,
|
|
69
53
|
MainTable,
|
|
70
54
|
ThreeDots,
|
|
71
|
-
|
|
72
|
-
InputWrapper,
|
|
73
|
-
DeleteIcon,
|
|
55
|
+
Toggle,
|
|
74
56
|
},
|
|
75
57
|
data() {
|
|
76
58
|
return {
|
|
@@ -136,7 +118,7 @@ export default {
|
|
|
136
118
|
return theme
|
|
137
119
|
},
|
|
138
120
|
onInputChange(event) {
|
|
139
|
-
this.
|
|
121
|
+
this.isChecked = event
|
|
140
122
|
},
|
|
141
123
|
},
|
|
142
124
|
}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<container>
|
|
3
|
-
<flex-wrapper :size="size">
|
|
4
|
-
<label-text
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@click="onToggleChange"
|
|
8
|
-
>{{ label }}</label-text
|
|
9
|
-
>
|
|
3
|
+
<flex-wrapper :size="size" @click="onToggleChange">
|
|
4
|
+
<label-text v-if="labelAlign === 'left'" :size="size">{{
|
|
5
|
+
label
|
|
6
|
+
}}</label-text>
|
|
10
7
|
<toggle-wrapper
|
|
11
8
|
role="checkbox"
|
|
12
9
|
:checked="isChecked"
|
|
13
10
|
:size="size"
|
|
14
11
|
tabindex="0"
|
|
15
|
-
@click="onToggleChange"
|
|
16
12
|
@keydown.space.prevent="onToggleChange"
|
|
17
13
|
:disabled="disabled"
|
|
18
14
|
>
|
|
@@ -69,6 +65,7 @@ const FlexWrapper = styled("div", flexAttrs)`
|
|
|
69
65
|
? "10px"
|
|
70
66
|
: "20px"};
|
|
71
67
|
align-items: center;
|
|
68
|
+
cursor: pointer;
|
|
72
69
|
`
|
|
73
70
|
|
|
74
71
|
const toggleAttrs = { size: String, fontColor: String, disabled: Boolean }
|
|
@@ -146,7 +143,7 @@ const ToggleDot = styled("span", toggleProps)`
|
|
|
146
143
|
: props.size === "small"
|
|
147
144
|
? "10px"
|
|
148
145
|
: "14px"};
|
|
149
|
-
left:
|
|
146
|
+
left: 3px
|
|
150
147
|
bottom: ${(props) =>
|
|
151
148
|
props.size === "medium" ? "5px" : props.size === "small" ? "3px" : "5px"};
|
|
152
149
|
background-color: ${(props) =>
|
|
@@ -164,7 +161,7 @@ const ToggleDot = styled("span", toggleProps)`
|
|
|
164
161
|
? props.size === "medium"
|
|
165
162
|
? "translateX(25px)"
|
|
166
163
|
: props.size === "small"
|
|
167
|
-
? "translateX(
|
|
164
|
+
? "translateX(13px)"
|
|
168
165
|
: "translateX(25px)"
|
|
169
166
|
: "translateX(0)"};
|
|
170
167
|
|