@eturnity/eturnity_reusable_components 6.37.0-EPDM-8148.7 → 6.37.0-EPDM-2198.1
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 +42 -181
- package/src/assets/svgIcons/charger_icon_white.svg +44 -0
- package/src/assets/svgIcons/collections.svg +3 -0
- package/src/assets/svgIcons/dashboard.svg +3 -0
- package/src/assets/svgIcons/energy_meter.svg +12 -0
- package/src/assets/svgIcons/erase.svg +1 -1
- package/src/assets/svgIcons/expand.svg +1 -0
- package/src/assets/svgIcons/logout.svg +3 -0
- package/src/assets/svgIcons/split.svg +94 -0
- package/src/assets/svgIcons/subscriptions.svg +3 -0
- package/src/assets/theme.js +3 -0
- package/src/components/addNewButton/index.vue +12 -8
- package/src/components/buttons/mainButton/index.vue +35 -23
- package/src/components/card/index.vue +95 -0
- package/src/components/draggableInputHandle/index.vue +47 -0
- package/src/components/errorMessage/index.vue +1 -3
- package/src/components/filter/filterSettings.vue +15 -10
- package/src/components/filter/index.vue +12 -1
- package/src/components/icon/iconCollection.vue +5 -5
- package/src/components/icon/index.vue +10 -2
- package/src/components/iconWrapper/index.vue +17 -12
- package/src/components/infoCard/index.vue +36 -0
- package/src/components/infoText/index.vue +2 -12
- package/src/components/inputs/checkbox/index.vue +5 -0
- package/src/components/inputs/inputNumber/index.vue +48 -17
- package/src/components/inputs/inputText/index.vue +24 -5
- package/src/components/inputs/radioButton/index.vue +66 -49
- package/src/components/inputs/searchInput/index.vue +6 -0
- package/src/components/inputs/select/index.vue +122 -58
- package/src/components/inputs/select/option/index.vue +5 -1
- package/src/components/inputs/switchField/index.vue +7 -11
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +0 -8
- package/src/components/inputs/textAreaInput/index.vue +12 -7
- package/src/components/inputs/toggle/index.vue +82 -82
- package/src/components/label/index.vue +103 -0
- package/src/components/modals/modal/index.vue +46 -13
- package/src/components/navigationTabs/index.vue +105 -0
- package/src/components/pageSubtitle/index.vue +1 -8
- package/src/components/pageTitle/index.vue +32 -4
- package/src/components/pagination/index.vue +136 -129
- package/src/components/projectMarker/index.vue +39 -33
- package/src/components/sideMenu/index.vue +270 -0
- package/src/components/tables/mainTable/index.vue +3 -3
- package/src/components/threeDots/index.vue +31 -22
- package/src/helpers/numberConverter.js +4 -2
- package/src/helpers/translateLang.js +9 -1
@@ -5,15 +5,20 @@
|
|
5
5
|
:alignItems="alignItems"
|
6
6
|
>
|
7
7
|
<label-wrapper v-if="label">
|
8
|
-
<input-label
|
9
|
-
|
10
|
-
|
8
|
+
<input-label
|
9
|
+
:labelFontColor="labelFontColor"
|
10
|
+
:fontSize="fontSize"
|
11
|
+
:data-id="labelDataId"
|
12
|
+
>{{ label }}
|
13
|
+
<optionalLabel v-if="labelOptional"
|
14
|
+
>({{ $gettext('Optional') }})</optionalLabel
|
15
|
+
></input-label
|
16
|
+
>
|
11
17
|
<info-text
|
12
18
|
v-if="infoTextMessage"
|
13
19
|
:text="infoTextMessage"
|
14
|
-
borderColor="#ccc"
|
15
20
|
:size="fontSize ? fontSize : '16px'"
|
16
|
-
:
|
21
|
+
:alignArrow="infoTextAlign"
|
17
22
|
/>
|
18
23
|
</label-wrapper>
|
19
24
|
<input-error-wrapper>
|
@@ -28,6 +33,7 @@
|
|
28
33
|
:value="value"
|
29
34
|
@input="onChangeHandler"
|
30
35
|
@blur="onInputBlur"
|
36
|
+
@keyup.enter="onEnterPress"
|
31
37
|
:noBorder="noBorder"
|
32
38
|
:disabled="disabled"
|
33
39
|
:isDisabled="disabled"
|
@@ -38,6 +44,7 @@
|
|
38
44
|
:hasFocus="hasFocus"
|
39
45
|
:backgroundColor="backgroundColor"
|
40
46
|
:disabledBackgroundColor="disabledBackgroundColor"
|
47
|
+
:data-id="inputDataId"
|
41
48
|
/>
|
42
49
|
<icon-wrapper
|
43
50
|
v-if="inputType === 'password' && !isError"
|
@@ -310,9 +317,21 @@ export default {
|
|
310
317
|
},
|
311
318
|
borderColor: {
|
312
319
|
required: false
|
320
|
+
},
|
321
|
+
labelDataId: {
|
322
|
+
required: false,
|
323
|
+
default: ''
|
324
|
+
},
|
325
|
+
inputDataId: {
|
326
|
+
required: false,
|
327
|
+
default: ''
|
313
328
|
}
|
314
329
|
},
|
315
330
|
methods: {
|
331
|
+
onEnterPress(event){
|
332
|
+
this.$emit('on-enter-click')
|
333
|
+
this.$refs.inputElement.$el.blur()
|
334
|
+
},
|
316
335
|
onChangeHandler($event) {
|
317
336
|
this.$emit('input-change', $event)
|
318
337
|
},
|
@@ -1,7 +1,12 @@
|
|
1
1
|
<template>
|
2
2
|
<component-wrapper :layout="layout">
|
3
3
|
<radio-wrapper v-for="(item, index) in options" :key="item.value">
|
4
|
-
<label-container
|
4
|
+
<label-container
|
5
|
+
:size="size"
|
6
|
+
:isDisabled="item.disabled"
|
7
|
+
:isChecked="selectedOption === item.value"
|
8
|
+
:checkmarkColor="checkmarkColor"
|
9
|
+
>
|
5
10
|
<radio
|
6
11
|
type="radio"
|
7
12
|
:value="selectedOption"
|
@@ -9,6 +14,7 @@
|
|
9
14
|
:name="'radioButtons_' + radioName"
|
10
15
|
:checked="selectedOption === item.value"
|
11
16
|
:disabled="item.disabled"
|
17
|
+
:data-id="`radio_button_${dataId}_option_${item.value}`"
|
12
18
|
/>
|
13
19
|
<span class="checkmark"></span>
|
14
20
|
<label-text :isDisabled="item.disabled">{{ item.label }}</label-text>
|
@@ -54,17 +60,17 @@
|
|
54
60
|
// { label: 'Button 4', value: 'button_4', disabled: true }
|
55
61
|
// ]
|
56
62
|
|
57
|
-
import styled from
|
58
|
-
import Modal from
|
59
|
-
import InfoText from
|
63
|
+
import styled from 'vue-styled-components'
|
64
|
+
import Modal from '../../modals/modal'
|
65
|
+
import InfoText from '../../infoText'
|
60
66
|
|
61
67
|
const wrapperProps = {
|
62
|
-
layout: String
|
68
|
+
layout: String
|
63
69
|
}
|
64
|
-
const ComponentWrapper = styled(
|
70
|
+
const ComponentWrapper = styled('div', wrapperProps)`
|
65
71
|
display: flex;
|
66
72
|
flex-direction: ${(props) =>
|
67
|
-
props.layout ===
|
73
|
+
props.layout === 'vertical' ? 'column' : 'row'};
|
68
74
|
grid-gap: 10px 5px;
|
69
75
|
flex-wrap: wrap;
|
70
76
|
`
|
@@ -83,8 +89,13 @@ const RadioWrapper = styled.div`
|
|
83
89
|
grid-gap: 10px;
|
84
90
|
`
|
85
91
|
|
86
|
-
const containerProps = {
|
87
|
-
|
92
|
+
const containerProps = {
|
93
|
+
size: String,
|
94
|
+
isDisabled: Boolean,
|
95
|
+
isChecked: Boolean,
|
96
|
+
checkmarkColor: String
|
97
|
+
}
|
98
|
+
const LabelContainer = styled('label', containerProps)`
|
88
99
|
display: grid;
|
89
100
|
grid-template-columns: auto 1fr auto;
|
90
101
|
grid-gap: 15px;
|
@@ -92,30 +103,30 @@ const LabelContainer = styled("label", containerProps)`
|
|
92
103
|
color: ${(props) =>
|
93
104
|
props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
|
94
105
|
position: relative;
|
95
|
-
cursor: ${(props) => (props.isDisabled ?
|
106
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
96
107
|
font-size: ${(props) =>
|
97
|
-
props.size ===
|
98
|
-
?
|
99
|
-
: props.size ===
|
100
|
-
|
101
|
-
|
108
|
+
props.size === 'large'
|
109
|
+
? '16px'
|
110
|
+
: props.size === 'medium'
|
111
|
+
? '13px'
|
112
|
+
: '10px'};
|
102
113
|
user-select: none;
|
103
114
|
flex: auto;
|
104
115
|
align-self: baseline;
|
105
116
|
|
106
117
|
.checkmark {
|
107
118
|
height: ${(props) =>
|
108
|
-
props.size ===
|
109
|
-
?
|
110
|
-
: props.size ===
|
111
|
-
|
112
|
-
|
119
|
+
props.size === 'large'
|
120
|
+
? '23px'
|
121
|
+
: props.size === 'medium'
|
122
|
+
? '16px'
|
123
|
+
: '12px'};
|
113
124
|
width: ${(props) =>
|
114
|
-
props.size ===
|
115
|
-
?
|
116
|
-
: props.size ===
|
117
|
-
|
118
|
-
|
125
|
+
props.size === 'large'
|
126
|
+
? '23px'
|
127
|
+
: props.size === 'medium'
|
128
|
+
? '16px'
|
129
|
+
: '12px'};
|
119
130
|
background-color: #fff;
|
120
131
|
border-radius: 100%;
|
121
132
|
border: 1px solid ${(props) => props.theme.colors.mediumGray};
|
@@ -124,28 +135,29 @@ const LabelContainer = styled("label", containerProps)`
|
|
124
135
|
justify-content: center;
|
125
136
|
|
126
137
|
&:after {
|
127
|
-
content:
|
128
|
-
display: ${(props) => props.isChecked ? 'block' : 'none'};
|
138
|
+
content: '';
|
139
|
+
display: ${(props) => (props.isChecked ? 'block' : 'none')};
|
129
140
|
width: ${(props) =>
|
130
|
-
props.size ===
|
131
|
-
?
|
132
|
-
: props.size ===
|
133
|
-
|
134
|
-
|
141
|
+
props.size === 'large'
|
142
|
+
? '10px'
|
143
|
+
: props.size === 'medium'
|
144
|
+
? '8px'
|
145
|
+
: '6px'};
|
135
146
|
height: ${(props) =>
|
136
|
-
props.size ===
|
137
|
-
?
|
138
|
-
: props.size ===
|
139
|
-
|
140
|
-
|
147
|
+
props.size === 'large'
|
148
|
+
? '10px'
|
149
|
+
: props.size === 'medium'
|
150
|
+
? '8px'
|
151
|
+
: '6px'};
|
141
152
|
border-radius: 100%;
|
142
|
-
background: ${(props) =>
|
153
|
+
background: ${(props) =>
|
154
|
+
props.checkmarkColor ? props.checkmarkColor : props.theme.colors.green};
|
143
155
|
}
|
144
156
|
}
|
145
157
|
`
|
146
158
|
|
147
159
|
const textAttrs = { isDisabled: Boolean }
|
148
|
-
const LabelText = styled(
|
160
|
+
const LabelText = styled('div', textAttrs)`
|
149
161
|
color: ${(props) =>
|
150
162
|
props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
|
151
163
|
`
|
@@ -186,7 +198,7 @@ const ModalImageContainer = styled.div`
|
|
186
198
|
`
|
187
199
|
|
188
200
|
export default {
|
189
|
-
name:
|
201
|
+
name: 'radio-button',
|
190
202
|
components: {
|
191
203
|
Radio,
|
192
204
|
ComponentWrapper,
|
@@ -198,24 +210,24 @@ export default {
|
|
198
210
|
ModalImage,
|
199
211
|
ModalImageContainer,
|
200
212
|
InfoText,
|
201
|
-
LabelText
|
213
|
+
LabelText
|
202
214
|
},
|
203
215
|
props: {
|
204
216
|
selectedOption: {
|
205
217
|
required: true,
|
206
|
-
default: false
|
218
|
+
default: false
|
207
219
|
},
|
208
220
|
options: {
|
209
221
|
required: true,
|
210
|
-
default: []
|
222
|
+
default: []
|
211
223
|
},
|
212
224
|
layout: {
|
213
225
|
required: false,
|
214
|
-
default:
|
226
|
+
default: 'horizontal' //2 options: 'vertical' (only 1 per row) & 'horizontal' (many per row)
|
215
227
|
},
|
216
228
|
size: {
|
217
229
|
required: false,
|
218
|
-
default:
|
230
|
+
default: 'medium' // small, medium, large
|
219
231
|
},
|
220
232
|
name: {
|
221
233
|
required: false,
|
@@ -224,6 +236,10 @@ export default {
|
|
224
236
|
checkmarkColor: {
|
225
237
|
required: false,
|
226
238
|
default: ''
|
239
|
+
},
|
240
|
+
dataId: {
|
241
|
+
type: String,
|
242
|
+
default: 'key'
|
227
243
|
}
|
228
244
|
},
|
229
245
|
data() {
|
@@ -234,17 +250,18 @@ export default {
|
|
234
250
|
},
|
235
251
|
methods: {
|
236
252
|
onInputHandler(value) {
|
237
|
-
this.$emit(
|
253
|
+
this.$emit('on-radio-change', value)
|
238
254
|
},
|
239
255
|
isImageOpen(index) {
|
240
256
|
return this.selectedImage === index
|
241
257
|
},
|
242
258
|
toggleImageModal(value) {
|
243
259
|
this.selectedImage = value
|
244
|
-
}
|
260
|
+
}
|
245
261
|
},
|
246
262
|
created() {
|
247
|
-
this.radioName =
|
248
|
-
|
263
|
+
this.radioName =
|
264
|
+
this.name.length === 0 ? Math.round(Math.random() * 10000) : this.name
|
265
|
+
}
|
249
266
|
}
|
250
267
|
</script>
|
@@ -11,6 +11,7 @@
|
|
11
11
|
:inputWidth="inputWidth"
|
12
12
|
:isFilter="isFilter"
|
13
13
|
:hasFocus="hasFocus"
|
14
|
+
:data-id="dataId"
|
14
15
|
/>
|
15
16
|
<img
|
16
17
|
class="search-icn"
|
@@ -30,6 +31,7 @@
|
|
30
31
|
// inputWidth="250px"
|
31
32
|
// @on-change="function($event)"
|
32
33
|
// :isFilter="true" // to set the height at 30px
|
34
|
+
// data-id="test-data-id"
|
33
35
|
// />
|
34
36
|
import styled from 'vue-styled-components'
|
35
37
|
|
@@ -104,6 +106,10 @@ export default {
|
|
104
106
|
hasFocus: {
|
105
107
|
required: false,
|
106
108
|
default: false
|
109
|
+
},
|
110
|
+
dataId: {
|
111
|
+
required: false,
|
112
|
+
default: ''
|
107
113
|
}
|
108
114
|
},
|
109
115
|
methods: {
|
@@ -8,7 +8,7 @@
|
|
8
8
|
:hasLabel="!!label && label.length > 0"
|
9
9
|
:alignItems="alignItems"
|
10
10
|
>
|
11
|
-
<label-wrapper v-if="label">
|
11
|
+
<label-wrapper v-if="label" :data-id="labelDataId">
|
12
12
|
<input-label
|
13
13
|
:fontColor="
|
14
14
|
labelFontColor || colorMode == 'dark' ? 'white' : 'eturnityGrey'
|
@@ -22,9 +22,7 @@
|
|
22
22
|
<info-text
|
23
23
|
v-if="infoTextMessage"
|
24
24
|
:text="infoTextMessage"
|
25
|
-
|
26
|
-
:size="fontSize ? fontSize : '16px'"
|
27
|
-
:alignText="infoTextAlign"
|
25
|
+
:size="infoTextSize"
|
28
26
|
/>
|
29
27
|
</label-wrapper>
|
30
28
|
<select-button-wrapper :disabled="disabled">
|
@@ -45,7 +43,13 @@
|
|
45
43
|
:disabled="disabled"
|
46
44
|
@keydown.native="onKeyDown"
|
47
45
|
:showBorder="showBorder"
|
46
|
+
:data-id="dataId"
|
47
|
+
:paddingLeft="paddingLeft"
|
48
48
|
>
|
49
|
+
<draggableInputHandle
|
50
|
+
v-if="isDraggable && !isSearchBarVisible"
|
51
|
+
:height="selectHeight"
|
52
|
+
/>
|
49
53
|
<inputText
|
50
54
|
v-if="isSearchBarVisible"
|
51
55
|
ref="searchInput"
|
@@ -62,7 +66,12 @@
|
|
62
66
|
@input-change="searchChange"
|
63
67
|
@click.native.stop
|
64
68
|
/>
|
65
|
-
<selector
|
69
|
+
<selector
|
70
|
+
v-else
|
71
|
+
:showBorder="showBorder"
|
72
|
+
:selectWidth="selectWidth"
|
73
|
+
:paddingLeft="paddingLeft"
|
74
|
+
>
|
66
75
|
<slot name="selector" :selectedValue="selectedValue"></slot>
|
67
76
|
</selector>
|
68
77
|
<Caret @click.stop="toggleCaretDropdown">
|
@@ -104,6 +113,7 @@
|
|
104
113
|
:selectedValue="selectedValue"
|
105
114
|
@option-selected="optionSelected"
|
106
115
|
@option-hovered="optionHovered"
|
116
|
+
@mouseleave="optionLeave"
|
107
117
|
>
|
108
118
|
<slot name="dropdown"></slot>
|
109
119
|
</selectDropdown>
|
@@ -121,6 +131,8 @@
|
|
121
131
|
// optionWidth="50%"
|
122
132
|
// label="that is a label"
|
123
133
|
// alignItems="vertical"
|
134
|
+
// label-data-id="test-label0data-id"
|
135
|
+
// data-id="test-data-id"
|
124
136
|
// >
|
125
137
|
// <template #selector="{selectedValue}">
|
126
138
|
// value selected: {{selectedValue}}
|
@@ -137,21 +149,40 @@ import styled from 'vue-styled-components'
|
|
137
149
|
import InfoText from '../../infoText'
|
138
150
|
import icon from '../../icon'
|
139
151
|
import inputText from '../inputText'
|
152
|
+
import draggableInputHandle from '../../draggableInputHandle'
|
153
|
+
|
154
|
+
const CARET_WIDTH = '30px'
|
155
|
+
const BORDER_WIDTH = '1px'
|
140
156
|
|
141
157
|
const Caret = styled.div`
|
142
158
|
display: flex;
|
143
159
|
align-items: center;
|
144
160
|
justify-content: center;
|
145
|
-
width:
|
146
|
-
min-width:
|
161
|
+
width: ${CARET_WIDTH};
|
162
|
+
min-width: ${CARET_WIDTH};
|
147
163
|
height: 100%;
|
148
|
-
align-items: stretch
|
164
|
+
align-items: stretch;
|
149
165
|
cursor: pointer;
|
150
166
|
margin-left: auto;
|
151
167
|
`
|
152
168
|
|
153
|
-
const
|
154
|
-
|
169
|
+
const selectorProps = {
|
170
|
+
selectWidth: String,
|
171
|
+
paddingLeft: String,
|
172
|
+
showBorder: Boolean
|
173
|
+
}
|
174
|
+
const Selector = styled('div', selectorProps)`
|
175
|
+
${(props) => props.selectWidth === '100%' ? 'width: 100%;' : `width: calc(${props.selectWidth} -
|
176
|
+
(
|
177
|
+
${CARET_WIDTH} +
|
178
|
+
${props.paddingLeft}
|
179
|
+
${props.showBorder ? `+ (${BORDER_WIDTH} * 2)` : ''}
|
180
|
+
)
|
181
|
+
);
|
182
|
+
white-space: nowrap;
|
183
|
+
text-overflow: ellipsis;
|
184
|
+
overflow: hidden;`
|
185
|
+
}
|
155
186
|
`
|
156
187
|
|
157
188
|
const labelAttrs = { fontSize: String, fontColor: String }
|
@@ -160,7 +191,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
160
191
|
props.theme.colors[props.fontColor]
|
161
192
|
? props.theme.colors[props.fontColor]
|
162
193
|
: props.fontColor};
|
163
|
-
font-size: ${(props) =>
|
194
|
+
font-size: ${(props) => props.fontSize};
|
164
195
|
font-weight: 700;
|
165
196
|
`
|
166
197
|
const optionalLabel = styled.span`
|
@@ -168,7 +199,7 @@ const optionalLabel = styled.span`
|
|
168
199
|
`
|
169
200
|
const inputProps = { selectWidth: String, optionWidth: String }
|
170
201
|
const Container = styled('div', inputProps)`
|
171
|
-
width: ${(props) =>
|
202
|
+
width: ${(props) => props.selectWidth};
|
172
203
|
position: relative;
|
173
204
|
display: inline-block;
|
174
205
|
`
|
@@ -196,15 +227,16 @@ const selectButtonAttrs = {
|
|
196
227
|
height: String,
|
197
228
|
selectMinHeight: String,
|
198
229
|
isSearchBarVisible: Boolean,
|
199
|
-
showBorder: Boolean
|
230
|
+
showBorder: Boolean,
|
231
|
+
paddingLeft: String
|
200
232
|
}
|
201
233
|
const selectButton = styled('div', selectButtonAttrs)`
|
202
234
|
position: relative;
|
203
235
|
box-sizing: border-box;
|
204
236
|
border-radius: 4px;
|
205
|
-
|
237
|
+
${(props) =>
|
238
|
+
props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}`};
|
206
239
|
text-align: left;
|
207
|
-
border-radius: 4px;
|
208
240
|
min-height: ${(props) =>
|
209
241
|
props.selectHeight
|
210
242
|
? props.selectHeight
|
@@ -219,7 +251,9 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
219
251
|
${({ showBorder, theme, hasError }) =>
|
220
252
|
showBorder &&
|
221
253
|
`
|
222
|
-
border:
|
254
|
+
border: ${BORDER_WIDTH} solid ${
|
255
|
+
hasError ? theme.colors.red : theme.colors.grey4
|
256
|
+
}
|
223
257
|
`}
|
224
258
|
background-color:${(props) =>
|
225
259
|
props.disabled
|
@@ -232,46 +266,51 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
232
266
|
? props.theme.colors[props.fontColor]
|
233
267
|
: props.fontColor};
|
234
268
|
${(props) => (props.disabled ? 'pointer-events: none' : '')};
|
269
|
+
overflow: hidden;
|
270
|
+
& > .handle {
|
271
|
+
border-right: ${(props) =>
|
272
|
+
props.hasError ? props.theme.colors.red : props.theme.colors.grey4}
|
273
|
+
1px solid;
|
274
|
+
}
|
235
275
|
`
|
236
276
|
const selectDropdownAttrs = {
|
237
277
|
hoveredBgColor: String,
|
238
278
|
bgColor: String,
|
239
279
|
fontColor: String,
|
240
|
-
selectWidth: String,
|
241
280
|
optionWidth: String,
|
242
281
|
hoveredIndex: Number,
|
243
282
|
hoveredValue: Number | String,
|
244
283
|
selectedValue: Number | String
|
245
284
|
}
|
246
285
|
const selectDropdown = styled('div', selectDropdownAttrs)`
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
286
|
+
box-sizing: border-box;
|
287
|
+
z-index: ${(props) => (props.isActive ? '2' : '1')};
|
288
|
+
position: absolute;
|
289
|
+
top: 5px;
|
290
|
+
border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
|
291
|
+
border-radius: 4px;
|
292
|
+
display: flex;
|
293
|
+
flex-direction: column;
|
294
|
+
align-items: flex-start;
|
295
|
+
padding: 0px;
|
296
|
+
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
297
|
+
width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
|
298
|
+
background-color: ${(props) =>
|
299
|
+
props.theme.colors[props.bgColor]
|
300
|
+
? props.theme.colors[props.bgColor]
|
301
|
+
: props.bgColor};
|
302
|
+
color: ${(props) =>
|
303
|
+
props.theme.colors[props.fontColor]
|
304
|
+
? props.theme.colors[props.fontColor]
|
305
|
+
: props.fontColor};
|
306
|
+
max-height: 300px;
|
307
|
+
overflow-y: auto;
|
308
|
+
& > div[data-value='${(props) => props.hoveredValue}'] {
|
309
|
+
background-color: ${(props) =>
|
310
|
+
props.theme.colors[props.hoveredBgColor]
|
311
|
+
? props.theme.colors[props.hoveredBgColor]
|
312
|
+
: props.hoveredBgColor};
|
313
|
+
}
|
275
314
|
`
|
276
315
|
const DropdownWrapper = styled('div')`
|
277
316
|
position: relative;
|
@@ -295,7 +334,7 @@ export default {
|
|
295
334
|
},
|
296
335
|
fontSize: {
|
297
336
|
required: false,
|
298
|
-
default:
|
337
|
+
default: '13px'
|
299
338
|
},
|
300
339
|
label: {
|
301
340
|
required: false
|
@@ -304,15 +343,17 @@ export default {
|
|
304
343
|
required: false,
|
305
344
|
default: false
|
306
345
|
},
|
307
|
-
|
308
|
-
required: false
|
346
|
+
labelDataId: {
|
347
|
+
required: false,
|
348
|
+
default: ''
|
309
349
|
},
|
310
|
-
|
350
|
+
infoTextMessage: {
|
311
351
|
required: false
|
312
352
|
},
|
313
353
|
selectWidth: {
|
354
|
+
type: String,
|
314
355
|
required: false,
|
315
|
-
default:
|
356
|
+
default: '100%'
|
316
357
|
},
|
317
358
|
selectHeight: {
|
318
359
|
type: String,
|
@@ -335,6 +376,10 @@ export default {
|
|
335
376
|
required: false,
|
336
377
|
default: false
|
337
378
|
},
|
379
|
+
dropdownAutoClose: {
|
380
|
+
required: false,
|
381
|
+
default: false
|
382
|
+
},
|
338
383
|
alignItems: {
|
339
384
|
required: false,
|
340
385
|
default: 'horizontal'
|
@@ -381,6 +426,18 @@ export default {
|
|
381
426
|
showBorder: {
|
382
427
|
required: false,
|
383
428
|
default: true
|
429
|
+
},
|
430
|
+
infoTextSize: {
|
431
|
+
required: false,
|
432
|
+
default: '14px'
|
433
|
+
},
|
434
|
+
dataId: {
|
435
|
+
type: String,
|
436
|
+
default: ''
|
437
|
+
},
|
438
|
+
isDraggable: {
|
439
|
+
type: Boolean,
|
440
|
+
default: false
|
384
441
|
}
|
385
442
|
},
|
386
443
|
|
@@ -398,12 +455,14 @@ export default {
|
|
398
455
|
icon,
|
399
456
|
Caret,
|
400
457
|
Selector,
|
401
|
-
inputText
|
458
|
+
inputText,
|
459
|
+
draggableInputHandle
|
402
460
|
},
|
403
461
|
|
404
462
|
data() {
|
405
463
|
return {
|
406
464
|
selectedValue: null,
|
465
|
+
paddingLeft: this.isDraggable ? '30px' : '15px',
|
407
466
|
isDropdownOpen: false,
|
408
467
|
isActive: false,
|
409
468
|
textSearch: '',
|
@@ -460,6 +519,11 @@ export default {
|
|
460
519
|
this.blur()
|
461
520
|
}
|
462
521
|
},
|
522
|
+
optionLeave() {
|
523
|
+
if (this.dropdownAutoClose) {
|
524
|
+
this.isDropdownOpen = false
|
525
|
+
}
|
526
|
+
},
|
463
527
|
searchChange(value) {
|
464
528
|
this.textSearch = value
|
465
529
|
this.$emit('search-change', value)
|
@@ -473,9 +537,6 @@ export default {
|
|
473
537
|
}
|
474
538
|
})
|
475
539
|
},
|
476
|
-
onSelectSlotClick() {
|
477
|
-
this.toggleDropdown()
|
478
|
-
},
|
479
540
|
clickOutside(event) {
|
480
541
|
const dropdownRef = this.$refs.dropdown
|
481
542
|
// we need to prevent closing on selecting an option, because in the case of
|
@@ -521,18 +582,21 @@ export default {
|
|
521
582
|
this.$refs.dropdown.$el.scrollTop = topPos
|
522
583
|
}
|
523
584
|
}
|
585
|
+
},
|
586
|
+
clearSearch() {
|
587
|
+
this.textSearch = ''
|
524
588
|
}
|
525
589
|
},
|
526
590
|
computed: {
|
527
591
|
optionLength() {
|
528
592
|
if (this.isDropdownOpen) {
|
529
|
-
return this.$refs.dropdown.$
|
530
|
-
} else {
|
531
|
-
return 0
|
593
|
+
return this.$refs.dropdown.$el.childElementCount
|
532
594
|
}
|
595
|
+
|
596
|
+
return 0
|
533
597
|
},
|
534
598
|
isSearchBarVisible() {
|
535
|
-
return this.isSearchable && this.
|
599
|
+
return this.isSearchable && this.isDropdownOpen
|
536
600
|
}
|
537
601
|
},
|
538
602
|
watch: {
|