@eturnity/eturnity_reusable_components 6.33.1-EPDM-7762.0 → 6.33.1-EPDM-7762.2
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
@@ -14,9 +14,11 @@
|
|
14
14
|
labelFontColor || colorMode == 'dark' ? 'white' : 'eturnityGrey'
|
15
15
|
"
|
16
16
|
:fontSize="fontSize"
|
17
|
-
>{{ label }}
|
18
|
-
|
19
|
-
|
17
|
+
>{{ label }}
|
18
|
+
<optionalLabel v-if="labelOptional">
|
19
|
+
({{ $gettext('Optional') }})</optionalLabel
|
20
|
+
>
|
21
|
+
</input-label>
|
20
22
|
<info-text
|
21
23
|
v-if="infoTextMessage"
|
22
24
|
:text="infoTextMessage"
|
@@ -91,9 +93,7 @@
|
|
91
93
|
:hoveredIndex="hoveredIndex"
|
92
94
|
:isActive="isActive"
|
93
95
|
:optionWidth="optionWidth"
|
94
|
-
:
|
95
|
-
dropdownBgColor || colorMode == 'dark' ? 'black' : 'white'
|
96
|
-
"
|
96
|
+
:hoveredBgColor="colorMode == 'dark' ? 'black' : dropdownBgColor"
|
97
97
|
:fontColor="
|
98
98
|
dropdownFontColor || colorMode == 'dark' ? 'white' : 'black'
|
99
99
|
"
|
@@ -151,7 +151,7 @@ const Selector = styled.div`
|
|
151
151
|
width: 100%;
|
152
152
|
`
|
153
153
|
|
154
|
-
const labelAttrs = { fontSize: String }
|
154
|
+
const labelAttrs = { fontSize: String, fontColor: String }
|
155
155
|
const InputLabel = styled('div', labelAttrs)`
|
156
156
|
color: ${(props) =>
|
157
157
|
props.theme.colors[props.fontColor]
|
@@ -162,7 +162,6 @@ const InputLabel = styled('div', labelAttrs)`
|
|
162
162
|
`
|
163
163
|
const optionalLabel = styled.span`
|
164
164
|
font-weight: 300;
|
165
|
-
|
166
165
|
`
|
167
166
|
const inputProps = { selectWidth: String, optionWidth: String }
|
168
167
|
const Container = styled('div', inputProps)`
|
@@ -198,8 +197,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
198
197
|
position: relative;
|
199
198
|
box-sizing: border-box;
|
200
199
|
border-radius: 4px;
|
201
|
-
padding: ${(props) =>
|
202
|
-
props.isSearchBarVisible ? '0' : '0px 0px 0 15px'};
|
200
|
+
padding: ${(props) => (props.isSearchBarVisible ? '0' : '0px 0px 0 15px')};
|
203
201
|
text-align: left;
|
204
202
|
border-radius: 4px;
|
205
203
|
min-height: 36px;
|
@@ -224,7 +222,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
224
222
|
${(props) => (props.disabled ? 'pointer-events: none' : '')};
|
225
223
|
`
|
226
224
|
const selectDropdownAttrs = {
|
227
|
-
|
225
|
+
hoveredBgColor: String,
|
228
226
|
fontColor: String,
|
229
227
|
selectWidth: String,
|
230
228
|
optionWidth: String,
|
@@ -245,20 +243,20 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
245
243
|
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
246
244
|
width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
|
247
245
|
background-color:${(props) =>
|
248
|
-
props.theme.colors[props.
|
249
|
-
? props.theme.colors[props.
|
250
|
-
: props.
|
246
|
+
props.theme.colors[props.hoveredBgColor]
|
247
|
+
? props.theme.colors[props.hoveredBgColor]
|
248
|
+
: props.hoveredBgColor};
|
251
249
|
color:${(props) =>
|
252
250
|
props.theme.colors[props.fontColor]
|
253
251
|
? props.theme.colors[props.fontColor]
|
254
252
|
: props.fontColor};
|
255
253
|
max-height:300px;
|
256
254
|
overflow-y:auto;
|
257
|
-
& [data-value="${(props) => props.selectedValue}"]{
|
258
|
-
backdrop-filter: brightness(1.4);
|
259
|
-
}
|
260
255
|
&>div:nth-child(${(props) => props.hoveredIndex}){
|
261
|
-
|
256
|
+
background-color:${(props) =>
|
257
|
+
props.theme.colors[props.hoveredBgColor]
|
258
|
+
? props.theme.colors[props.hoveredBgColor]
|
259
|
+
: props.hoveredBgColor};
|
262
260
|
}
|
263
261
|
`
|
264
262
|
const DropdownWrapper = styled('div')`
|
@@ -325,7 +323,8 @@ export default {
|
|
325
323
|
required: false
|
326
324
|
},
|
327
325
|
dropdownBgColor: {
|
328
|
-
required: false
|
326
|
+
required: false,
|
327
|
+
default: 'grey5'
|
329
328
|
},
|
330
329
|
dropdownFontColor: {
|
331
330
|
required: false
|
@@ -1,59 +1,68 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
<optionContainer
|
3
|
+
:data-value="value"
|
4
|
+
:hoveredBgColor="colorMode == 'dark' ? '#000000' : 'hoveredBgColor'"
|
5
|
+
:backgroundColor="colorMode == 'dark' ? '#000000' : '#fff'"
|
6
|
+
@click="clickHandler"
|
7
|
+
@mouseover="hoverHandler"
|
8
|
+
>
|
9
|
+
<slot></slot>
|
10
|
+
</optionContainer>
|
11
|
+
</template>
|
6
12
|
|
7
|
-
|
13
|
+
<script>
|
8
14
|
// import selectButton from './selectButton'
|
9
15
|
// import selectDropdown from './selectDropDown'
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
import styled from 'vue-styled-components'
|
17
|
+
const optionProps = { hoveredBgColor: String, backgroundColor: String }
|
18
|
+
const optionContainer = styled('div', optionProps)`
|
19
|
+
display: flex;
|
20
|
+
cursor: pointer;
|
21
|
+
flex-direction: row;
|
22
|
+
justify-content: space-between;
|
23
|
+
align-items: center;
|
24
|
+
padding: 12px 10px;
|
25
|
+
gap: 14px;
|
26
|
+
width: 100%;
|
27
|
+
background-color: ${(props) => props.backgroundColor};
|
28
|
+
box-sizing: inherit;
|
29
|
+
&:hover {
|
30
|
+
background-color: ${(props) =>
|
31
|
+
props.theme.colors[props.hoveredBgColor]
|
32
|
+
? props.theme.colors[props.hoveredBgColor]
|
33
|
+
: props.hoveredBgColor};
|
34
|
+
}
|
35
|
+
`
|
26
36
|
|
27
|
-
|
28
|
-
|
37
|
+
export default {
|
38
|
+
name: 'RCoption',
|
29
39
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
},
|
37
|
-
colorMode:{
|
38
|
-
required:false,
|
39
|
-
default:'light'
|
40
|
-
}
|
40
|
+
props: {
|
41
|
+
value: {
|
42
|
+
required: true
|
43
|
+
},
|
44
|
+
hoveredBgColor: {
|
45
|
+
required: false
|
41
46
|
},
|
47
|
+
colorMode: {
|
48
|
+
required: false,
|
49
|
+
default: 'light'
|
50
|
+
}
|
51
|
+
},
|
42
52
|
|
43
|
-
|
53
|
+
components: { optionContainer },
|
44
54
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
},
|
52
|
-
hoverHandler(){
|
53
|
-
this.$parent.$emit('option-hovered',this.value)
|
54
|
-
}
|
55
|
+
data() {
|
56
|
+
return {}
|
57
|
+
},
|
58
|
+
methods: {
|
59
|
+
clickHandler() {
|
60
|
+
this.$parent.$emit('option-selected', this.value)
|
55
61
|
},
|
56
|
-
|
62
|
+
hoverHandler() {
|
63
|
+
this.$parent.$emit('option-hovered', this.value)
|
57
64
|
}
|
58
|
-
}
|
59
|
-
|
65
|
+
},
|
66
|
+
computed: {}
|
67
|
+
}
|
68
|
+
</script>
|