@eturnity/eturnity_reusable_components 6.37.0-EPDM-8148.2 → 6.37.0-EPDM-8148.3
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/components/iconWrapper/index.vue +141 -118
package/package.json
CHANGED
@@ -1,129 +1,152 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
:disabled="disabled"
|
4
|
-
:size="size"
|
5
|
-
:backgroundColor="backgroundColor"
|
2
|
+
<Wrapper
|
3
|
+
:disabled="disabled"
|
4
|
+
:size="size"
|
5
|
+
:backgroundColor="backgroundColor"
|
6
6
|
:borderRadius="borderRadius"
|
7
7
|
:hasBorder="hasBorder"
|
8
8
|
:color="iconColor"
|
9
9
|
:hoveredBackgroundColor="hoveredBackgroundColor"
|
10
10
|
:isHovered="isHovered"
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
11
|
+
>
|
12
|
+
<icon
|
13
|
+
:disabled="disabled"
|
14
|
+
:size="iconSize"
|
15
|
+
:name="name"
|
16
|
+
:color="iconColor"
|
17
|
+
:hoveredColor="hoveredIconColor"
|
18
|
+
:isStriked="isStriked"
|
19
|
+
/>
|
20
|
+
|
21
|
+
<caret v-if="hasCaret">
|
22
|
+
<iconWrapper
|
23
|
+
:disabled="disabled"
|
24
|
+
size="10px"
|
25
|
+
name="arrow_down"
|
26
|
+
:iconColor="iconColor"
|
27
|
+
:hoveredBackgroundColor="hoveredIconColor"
|
28
|
+
borderRadius="1px"
|
29
|
+
/>
|
30
|
+
</caret>
|
31
|
+
</Wrapper>
|
32
|
+
</template>
|
33
|
+
|
34
|
+
<script>
|
35
|
+
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
36
|
+
// How to use:
|
37
|
+
//<icon
|
38
|
+
// name="House" //required. a svg file named [name].svg should be present in /assets/svgIcons
|
39
|
+
// color="red"
|
40
|
+
// hoveredColor="blue"
|
41
|
+
// size="60px" by default, this is 30px
|
42
|
+
// />
|
43
|
+
|
44
|
+
import styled from 'vue-styled-components'
|
45
|
+
import icon from '../icon'
|
46
|
+
const wrapperAttrs = {
|
47
|
+
color: String,
|
48
|
+
isHovered: Boolean,
|
49
|
+
borderRadius: String,
|
50
|
+
disabled: Boolean,
|
51
|
+
size: String,
|
52
|
+
backgroundColor: String,
|
53
|
+
hoveredBackgroundColor: String,
|
54
|
+
hasBorder: Boolean
|
55
|
+
}
|
56
|
+
const Wrapper = styled('div', wrapperAttrs)`
|
57
|
+
position: relative;
|
58
|
+
display: inline-flex;
|
59
|
+
width: ${(props) => props.size};
|
60
|
+
height: ${(props) => props.size};
|
61
|
+
border: ${(props) =>
|
62
|
+
props.hasBorder
|
63
|
+
? 'solid 1px ' + props.theme.colors[props.color] || props.color
|
64
|
+
: ''};
|
65
|
+
justify-content: center;
|
66
|
+
align-items: center;
|
67
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
68
|
+
background-color: ${(props) =>
|
69
|
+
props.theme.colors[props.backgroundColor] || props.backgroundColor};
|
70
|
+
border-radius: ${(props) => props.borderRadius};
|
71
|
+
${(props) =>
|
72
|
+
props.isHovered
|
73
|
+
? 'background-color:' +
|
74
|
+
props.theme.colors[props.hoveredBackgroundColor] ||
|
75
|
+
props.hoveredBackgroundColor
|
76
|
+
: ''};
|
77
|
+
&:hover {
|
78
|
+
background-color: ${(props) =>
|
79
|
+
props.theme.colors[props.hoveredBackgroundColor] ||
|
80
|
+
props.hoveredBackgroundColor};
|
81
|
+
}
|
82
|
+
`
|
83
|
+
const caret = styled.div`
|
84
|
+
position: absolute;
|
85
|
+
bottom: 3px;
|
86
|
+
right: 2px;
|
87
|
+
height: 10px;
|
88
|
+
`
|
67
89
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
90
|
+
export default {
|
91
|
+
name: 'iconWrapper',
|
92
|
+
components: {
|
93
|
+
Wrapper,
|
94
|
+
icon,
|
95
|
+
caret
|
96
|
+
},
|
97
|
+
props: {
|
98
|
+
disabled: {
|
99
|
+
required: false,
|
100
|
+
default: false
|
101
|
+
},
|
102
|
+
name: {
|
103
|
+
required: true
|
104
|
+
},
|
105
|
+
iconColor: {
|
106
|
+
required: false,
|
107
|
+
default: 'white'
|
108
|
+
},
|
109
|
+
hoveredIconColor: {
|
110
|
+
required: false
|
111
|
+
},
|
112
|
+
backgroundColor: {
|
113
|
+
required: false
|
114
|
+
},
|
115
|
+
hasBorder: {
|
116
|
+
required: false,
|
117
|
+
default: false
|
118
|
+
},
|
119
|
+
hoveredBackgroundColor: {
|
120
|
+
required: false,
|
121
|
+
default: 'transparentWhite1'
|
122
|
+
},
|
123
|
+
size: {
|
124
|
+
required: false,
|
125
|
+
default: '32px'
|
126
|
+
},
|
127
|
+
iconSize: {
|
128
|
+
required: false,
|
129
|
+
default: '18px'
|
130
|
+
},
|
131
|
+
hasCaret: {
|
132
|
+
required: false,
|
133
|
+
default: false
|
134
|
+
},
|
135
|
+
borderRadius: {
|
136
|
+
required: false,
|
137
|
+
default: '4px'
|
74
138
|
},
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
default: false
|
79
|
-
},
|
80
|
-
name: {
|
81
|
-
required: true
|
82
|
-
},
|
83
|
-
iconColor: {
|
84
|
-
required: false,
|
85
|
-
default: 'white'
|
86
|
-
},
|
87
|
-
hoveredIconColor: {
|
88
|
-
required: false
|
89
|
-
},
|
90
|
-
backgroundColor: {
|
91
|
-
required: false,
|
92
|
-
},
|
93
|
-
hasBorder: {
|
94
|
-
required: false,
|
95
|
-
},
|
96
|
-
hoveredBackgroundColor: {
|
97
|
-
required: false,
|
98
|
-
default:"transparentWhite1"
|
99
|
-
},
|
100
|
-
size: {
|
101
|
-
required: false,
|
102
|
-
default: '32px'
|
103
|
-
},
|
104
|
-
iconSize:{
|
105
|
-
required: false,
|
106
|
-
default:'18px'
|
107
|
-
},
|
108
|
-
hasCaret:{
|
109
|
-
required: false,
|
110
|
-
default: false
|
111
|
-
},
|
112
|
-
borderRadius:{
|
113
|
-
required:false,
|
114
|
-
default:'4px'
|
115
|
-
},
|
116
|
-
isHovered:{
|
117
|
-
required:false,
|
118
|
-
default:false
|
119
|
-
},
|
120
|
-
isStriked:{
|
121
|
-
required:false,
|
122
|
-
default:false
|
123
|
-
}
|
139
|
+
isHovered: {
|
140
|
+
required: false,
|
141
|
+
default: false
|
124
142
|
},
|
125
|
-
|
126
|
-
|
143
|
+
isStriked: {
|
144
|
+
required: false,
|
145
|
+
default: false
|
127
146
|
}
|
147
|
+
},
|
148
|
+
data() {
|
149
|
+
return {}
|
128
150
|
}
|
129
|
-
|
151
|
+
}
|
152
|
+
</script>
|