@eturnity/eturnity_reusable_components 1.0.70 → 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 -23
- package/src/assets/icons/delete_icon.svg +1 -1
- package/src/assets/icons/delete_icon_gray.svg +1 -1
- package/src/components/deleteIcon/index.vue +18 -31
- package/src/components/inputs/toggle/index.vue +7 -10
- package/src/components/tables/mainTable/index.vue +1 -0
- package/src/components/threeDots/index.vue +8 -7
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
<th>Column 1</th>
|
|
8
8
|
<th>Column 2</th>
|
|
9
9
|
<th>Column 3</th>
|
|
10
|
-
<th>Column 4</th>
|
|
11
10
|
<div />
|
|
12
11
|
</tr>
|
|
13
12
|
</thead>
|
|
@@ -24,19 +23,12 @@
|
|
|
24
23
|
</main-table>
|
|
25
24
|
<br />
|
|
26
25
|
<br />
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
textAlign="left"
|
|
34
|
-
fontSize="13px"
|
|
35
|
-
labelText="Number of Modules"
|
|
36
|
-
labelInfoText="Here is some information for you..."
|
|
37
|
-
:disabled="true"
|
|
38
|
-
/>
|
|
39
|
-
</input-wrapper>
|
|
26
|
+
<toggle
|
|
27
|
+
@on-toggle-change="onInputChange($event)"
|
|
28
|
+
:isChecked="isChecked"
|
|
29
|
+
label="My Label Text"
|
|
30
|
+
labelAlign="right"
|
|
31
|
+
/>
|
|
40
32
|
</page-container>
|
|
41
33
|
</ThemeProvider>
|
|
42
34
|
</template>
|
|
@@ -47,17 +39,12 @@ import theme from "./assets/theme"
|
|
|
47
39
|
import styled from "vue-styled-components"
|
|
48
40
|
import MainTable from "@/components/tables/mainTable"
|
|
49
41
|
import ThreeDots from "@/components/threeDots"
|
|
50
|
-
import
|
|
42
|
+
import Toggle from "@/components/inputs/toggle"
|
|
51
43
|
|
|
52
44
|
const PageContainer = styled.div`
|
|
53
45
|
padding: 40px;
|
|
54
46
|
`
|
|
55
47
|
|
|
56
|
-
const InputWrapper = styled.div`
|
|
57
|
-
height: 36px;
|
|
58
|
-
width: 180px;
|
|
59
|
-
`
|
|
60
|
-
|
|
61
48
|
export default {
|
|
62
49
|
name: "App",
|
|
63
50
|
components: {
|
|
@@ -65,8 +52,7 @@ export default {
|
|
|
65
52
|
PageContainer,
|
|
66
53
|
MainTable,
|
|
67
54
|
ThreeDots,
|
|
68
|
-
|
|
69
|
-
InputWrapper,
|
|
55
|
+
Toggle,
|
|
70
56
|
},
|
|
71
57
|
data() {
|
|
72
58
|
return {
|
|
@@ -132,7 +118,7 @@ export default {
|
|
|
132
118
|
return theme
|
|
133
119
|
},
|
|
134
120
|
onInputChange(event) {
|
|
135
|
-
this.
|
|
121
|
+
this.isChecked = event
|
|
136
122
|
},
|
|
137
123
|
},
|
|
138
124
|
}
|
|
@@ -1,57 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<wrapper>
|
|
3
|
-
<icon
|
|
2
|
+
<wrapper @mouseover="isHovered = true" @mouseleave="isHovered = false">
|
|
3
|
+
<icon-image
|
|
4
|
+
v-if="isHovered"
|
|
5
|
+
:src="require('../../assets/icons/delete_icon.svg')"
|
|
6
|
+
/>
|
|
7
|
+
<icon-image
|
|
8
|
+
v-else
|
|
9
|
+
:src="require('../../assets/icons/delete_icon_gray.svg')"
|
|
10
|
+
/>
|
|
4
11
|
</wrapper>
|
|
5
12
|
</template>
|
|
6
13
|
|
|
7
14
|
<script>
|
|
8
15
|
// To use:
|
|
9
|
-
// <delete-icon
|
|
10
|
-
// color="gray" // red is default
|
|
11
|
-
// />
|
|
16
|
+
// <delete-icon />
|
|
12
17
|
import styled from "vue-styled-components"
|
|
13
18
|
|
|
14
19
|
const Wrapper = styled.div`
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
min-height: 40px;
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
`
|
|
22
|
-
|
|
23
|
-
const iconAttrs = { color: String }
|
|
24
|
-
const Icon = styled("span", iconAttrs)`
|
|
25
20
|
width: 30px;
|
|
26
21
|
height: 30px;
|
|
27
|
-
background-position: center;
|
|
28
22
|
cursor: pointer;
|
|
29
|
-
|
|
30
|
-
props.color === "red"
|
|
31
|
-
? `url(${require("../../assets/icons/delete_icon.svg")})`
|
|
32
|
-
: props.color === "gray"
|
|
33
|
-
? `url(${require("../../assets/icons/delete_icon_gray.svg")})`
|
|
34
|
-
: `url(${require("../../assets/icons/delete_icon.svg")})`};
|
|
23
|
+
`
|
|
35
24
|
|
|
25
|
+
const IconImage = styled.img`
|
|
36
26
|
&:hover {
|
|
37
|
-
|
|
27
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
|
38
28
|
border-radius: 4px;
|
|
39
|
-
background-image: ${() =>
|
|
40
|
-
`url(${require("../../assets/icons/delete_icon.svg")})`};
|
|
41
29
|
}
|
|
42
30
|
`
|
|
43
31
|
|
|
44
32
|
export default {
|
|
45
33
|
name: "delete-icon",
|
|
46
34
|
components: {
|
|
47
|
-
Icon,
|
|
48
35
|
Wrapper,
|
|
36
|
+
IconImage,
|
|
49
37
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
isHovered: false,
|
|
41
|
+
}
|
|
55
42
|
},
|
|
56
43
|
}
|
|
57
44
|
</script>
|
|
@@ -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
|
|
|
@@ -116,6 +116,14 @@ import Spinner from "../spinner"
|
|
|
116
116
|
const PageContainer = styled.div`
|
|
117
117
|
display: grid;
|
|
118
118
|
align-items: center;
|
|
119
|
+
justify-items: center;
|
|
120
|
+
width: 30px;
|
|
121
|
+
height: 30px;
|
|
122
|
+
|
|
123
|
+
&:hover {
|
|
124
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
|
125
|
+
border-radius: 4px;
|
|
126
|
+
}
|
|
119
127
|
`
|
|
120
128
|
|
|
121
129
|
const ButtonContainer = styled.div`
|
|
@@ -128,13 +136,6 @@ const ButtonContainer = styled.div`
|
|
|
128
136
|
// This is the dot color
|
|
129
137
|
background-color: #263238;
|
|
130
138
|
}
|
|
131
|
-
|
|
132
|
-
&:hover {
|
|
133
|
-
div {
|
|
134
|
-
// Dot color on hover
|
|
135
|
-
background-color: ${(props) => props.theme.colors.grey3};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
139
|
`
|
|
139
140
|
|
|
140
141
|
const DotItem = styled.div`
|