@eturnity/eturnity_reusable_components 1.2.48-EPDM-5846.4 → 1.2.48-EPDM-5846.6
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
@@ -20,7 +20,7 @@
|
|
20
20
|
:alignText="infoTextAlign"
|
21
21
|
/>
|
22
22
|
</label-wrapper>
|
23
|
-
<
|
23
|
+
<select-button-wrapper :disabled="disabled">
|
24
24
|
<selectButton
|
25
25
|
ref="select"
|
26
26
|
@click="toggleDropdown"
|
@@ -29,6 +29,7 @@
|
|
29
29
|
:fontColor="buttonFontColor || colorMode=='dark'?'white':'black'"
|
30
30
|
:hasError="hasError"
|
31
31
|
:isSearchBarVisible="isSearchBarVisible"
|
32
|
+
:disabled="disabled"
|
32
33
|
@keydown.native="onKeyDown"
|
33
34
|
>
|
34
35
|
<inputText
|
@@ -42,9 +43,9 @@
|
|
42
43
|
:value="textSearch"
|
43
44
|
@keydown.stop="onKeyDown"
|
44
45
|
@input-change="searchChange" />
|
45
|
-
<
|
46
|
+
<selector v-else>
|
46
47
|
<slot name="selector" :selectedValue="selectedValue"></slot>
|
47
|
-
</
|
48
|
+
</selector>
|
48
49
|
<Caret @click.stop="toggleCaretDropdown" >
|
49
50
|
<icon v-if="isDropdownOpen" name="arrow_up" size="12px" :color="caretColor || colorMode=='dark'?'white':'transparentBlack1'"/>
|
50
51
|
<icon v-else name="arrow_down" size="12px" :color="caretColor || colorMode=='dark'?'white':'transparentBlack1'"/>
|
@@ -65,7 +66,7 @@
|
|
65
66
|
<slot name="dropdown"></slot>
|
66
67
|
</selectDropdown>
|
67
68
|
</DropdownWrapper>
|
68
|
-
</
|
69
|
+
</select-button-wrapper>
|
69
70
|
</input-wrapper>
|
70
71
|
</Container>
|
71
72
|
</template>
|
@@ -95,14 +96,21 @@
|
|
95
96
|
import icon from '../../icon'
|
96
97
|
import inputText from '../inputText'
|
97
98
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
99
|
+
const Caret = styled.div`
|
100
|
+
display: flex;
|
101
|
+
align-items: center;
|
102
|
+
justify-content: center;
|
103
|
+
width: 30px;
|
104
|
+
min-width: 30px;
|
105
|
+
height: 100%;
|
104
106
|
padding-top: 5px;
|
105
|
-
|
107
|
+
cursor: pointer;
|
108
|
+
margin-left: auto;
|
109
|
+
`
|
110
|
+
|
111
|
+
const Selector = styled.div`
|
112
|
+
width: 100%;
|
113
|
+
`
|
106
114
|
|
107
115
|
const labelAttrs = { fontSize: String }
|
108
116
|
const InputLabel = styled('div', labelAttrs)`
|
@@ -123,10 +131,19 @@ const LabelWrapper = styled.div`
|
|
123
131
|
align-items: center;
|
124
132
|
justify-content: start;
|
125
133
|
`
|
134
|
+
|
135
|
+
const SelectButtonWrapperAttrs = {
|
136
|
+
disabled: Boolean
|
137
|
+
}
|
138
|
+
const SelectButtonWrapper = styled('div', SelectButtonWrapperAttrs)`
|
139
|
+
${(props) => props.disabled ? 'cursor: not-allowed' : '' };
|
140
|
+
`
|
141
|
+
|
126
142
|
const selectButtonAttrs={
|
127
143
|
bgColor: String,
|
128
144
|
fontColor: String,
|
129
145
|
hasError: Boolean,
|
146
|
+
disabled: Boolean,
|
130
147
|
selectHeight: String,
|
131
148
|
isSearchBarVisible: Boolean
|
132
149
|
}
|
@@ -138,13 +155,13 @@ const selectButton = styled('div',selectButtonAttrs)`
|
|
138
155
|
text-align:left;
|
139
156
|
border-radius:4px;
|
140
157
|
min-height:36px;
|
141
|
-
display:
|
142
|
-
grid-template-columns:auto 40px;
|
158
|
+
display: flex;
|
143
159
|
align-items: center;
|
144
160
|
max-height:${props=>props.selectHeight};
|
145
161
|
border:1px solid ${(props) => props.hasError ? props.theme.colors.red : props.theme.colors.grey4}
|
146
|
-
background-color:${(props) => props.theme.colors[props.bgColor]?props.theme.colors[props.bgColor]:props.bgColor};
|
162
|
+
background-color:${(props) => props.disabled ? props.theme.colors.grey5 : props.theme.colors[props.bgColor] ? props.theme.colors[props.bgColor] : props.bgColor};
|
147
163
|
color:${(props) => props.theme.colors[props.fontColor]?props.theme.colors[props.fontColor]:props.fontColor};
|
164
|
+
${(props) => props.disabled ? 'pointer-events: none' : '' };
|
148
165
|
`
|
149
166
|
const selectDropdownAttrs={bgColor:String,fontColor:String,selectWidth: String, optionWidth: String,hoveredIndex:Number,selectedValue:Number | String}
|
150
167
|
const selectDropdown = styled('div',selectDropdownAttrs)`
|
@@ -255,6 +272,10 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
255
272
|
required: false,
|
256
273
|
default: false
|
257
274
|
},
|
275
|
+
disabled: {
|
276
|
+
required: false,
|
277
|
+
default: false
|
278
|
+
},
|
258
279
|
isAutoSearch:{
|
259
280
|
required:false,
|
260
281
|
default:true
|
@@ -263,6 +284,7 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
263
284
|
|
264
285
|
components: {
|
265
286
|
selectButton,
|
287
|
+
SelectButtonWrapper,
|
266
288
|
selectDropdown,
|
267
289
|
Container,
|
268
290
|
InputLabel,
|
@@ -272,6 +294,7 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
272
294
|
DropdownWrapper,
|
273
295
|
icon,
|
274
296
|
Caret,
|
297
|
+
Selector,
|
275
298
|
inputText
|
276
299
|
},
|
277
300
|
|