@eturnity/eturnity_reusable_components 7.37.5-qa-elisee-7.42.0 → 7.39.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/assets/theme.js +0 -3
- package/src/components/icon/index.vue +2 -2
- package/src/components/infoCard/index.vue +9 -36
- package/src/components/infoText/index.vue +5 -24
- package/src/components/inputs/inputText/InputText.stories.js +2 -3
- package/src/components/inputs/inputText/index.vue +8 -49
- package/src/components/inputs/select/index.vue +3 -1
- package/src/components/inputs/select/option/index.vue +9 -1
- package/src/components/selectedOptions/index.vue +343 -38
- package/src/assets/svgIcons/compass.svg +0 -1
- package/src/assets/svgIcons/pause.svg +0 -6
- package/src/components/inputs/inputText/inputText.spec.js +0 -588
- package/src/components/roundTabs/index.vue +0 -107
package/package.json
CHANGED
package/src/assets/theme.js
CHANGED
@@ -111,10 +111,10 @@
|
|
111
111
|
props.backgroundColor ? props.backgroundColor : 'transparent'};
|
112
112
|
padding: ${(props) => (props.backgroundColor ? '3px' : '0')};
|
113
113
|
}
|
114
|
-
svg path
|
114
|
+
svg path {
|
115
115
|
${({ theme, color }) => color && `fill: ${theme.colors[color] || color};`}
|
116
116
|
}
|
117
|
-
&:hover svg path
|
117
|
+
&:hover svg path {
|
118
118
|
${({ theme, hoveredColor }) =>
|
119
119
|
hoveredColor && `fill: ${theme.colors[hoveredColor] || hoveredColor};`}
|
120
120
|
}
|
@@ -1,10 +1,6 @@
|
|
1
1
|
<template>
|
2
|
-
<InfoContainer
|
3
|
-
|
4
|
-
:border-color="borderColor"
|
5
|
-
:has-dashed-border="hasDashedBorder"
|
6
|
-
>
|
7
|
-
<RCIcon :color="color" name="info" size="24px" />
|
2
|
+
<InfoContainer>
|
3
|
+
<RCIcon name="info" size="24px" :color="color" />
|
8
4
|
<TextContainer>
|
9
5
|
<slot></slot>
|
10
6
|
</TextContainer>
|
@@ -14,24 +10,12 @@
|
|
14
10
|
<script>
|
15
11
|
import styled from 'vue3-styled-components'
|
16
12
|
import RCIcon from '../icon'
|
17
|
-
|
18
|
-
|
19
|
-
hasDashedBorder: Boolean,
|
20
|
-
borderColor: String,
|
21
|
-
}
|
22
|
-
const InfoContainer = styled('div', propsContainer)`
|
13
|
+
|
14
|
+
const InfoContainer = styled.div`
|
23
15
|
display: flex;
|
24
16
|
gap: 15px;
|
25
|
-
padding:
|
26
|
-
border: 1px ${(props) =>
|
27
|
-
${(props) =>
|
28
|
-
props.theme.colors[props.borderColor]
|
29
|
-
? props.theme.colors[props.borderColor]
|
30
|
-
: props.borderColor};
|
31
|
-
background-color: ${(props) =>
|
32
|
-
props.theme.colors[props.backgroundColor]
|
33
|
-
? props.theme.colors[props.backgroundColor]
|
34
|
-
: props.backgroundColor};
|
17
|
+
padding: 20px;
|
18
|
+
border: 1px dashed ${(props) => props.theme.colors.grey4};
|
35
19
|
border-radius: 4px;
|
36
20
|
`
|
37
21
|
|
@@ -49,19 +33,8 @@
|
|
49
33
|
},
|
50
34
|
props: {
|
51
35
|
color: {
|
52
|
-
required: false
|
53
|
-
}
|
54
|
-
|
55
|
-
required: false,
|
56
|
-
},
|
57
|
-
hasDashedBorder: {
|
58
|
-
required: false,
|
59
|
-
default: true,
|
60
|
-
},
|
61
|
-
borderColor: {
|
62
|
-
required: false,
|
63
|
-
default: 'grey4',
|
64
|
-
},
|
65
|
-
},
|
36
|
+
required: false
|
37
|
+
}
|
38
|
+
}
|
66
39
|
}
|
67
40
|
</script>
|
@@ -18,11 +18,10 @@
|
|
18
18
|
:align-arrow="alignArrow"
|
19
19
|
:half-computed-text-info-width="halfComputedTextInfoWidth"
|
20
20
|
:icon-size="size"
|
21
|
-
:info-position="infoPosition"
|
22
21
|
:max-width="maxWidth"
|
23
22
|
:width="width"
|
24
23
|
><slot></slot>
|
25
|
-
<span v-
|
24
|
+
<span v-html="text"></span>
|
26
25
|
</TextOverlay>
|
27
26
|
</IconWrapper>
|
28
27
|
</ComponentWrapper>
|
@@ -45,14 +44,10 @@
|
|
45
44
|
alignArrow: String,
|
46
45
|
width: String,
|
47
46
|
halfComputedTextInfoWidth: Number,
|
48
|
-
infoPosition: String,
|
49
47
|
}
|
50
48
|
const TextOverlay = styled('div', textAttrs)`
|
51
49
|
position: absolute;
|
52
|
-
${(props) =>
|
53
|
-
props.infoPosition == 'top'
|
54
|
-
? 'bottom : calc(' + props.iconSize + ' + 15px)'
|
55
|
-
: 'top : calc(' + props.iconSize + ' + 15px)'};
|
50
|
+
top: ${(props) => 'calc(' + props.iconSize + ' + 15px)'};
|
56
51
|
${(props) =>
|
57
52
|
props.alignArrow === 'left'
|
58
53
|
? 'left: calc(' + props.iconSize + ' /2 - 18px)'
|
@@ -68,17 +63,14 @@
|
|
68
63
|
font-weight: 400;
|
69
64
|
line-height: normal;
|
70
65
|
border-radius: 4px;
|
71
|
-
z-index:
|
66
|
+
z-index: 99;
|
72
67
|
color: ${(props) => props.theme.colors.white};
|
73
68
|
|
74
69
|
:before {
|
75
70
|
content: '';
|
76
71
|
background-color: ${(props) => props.theme.colors.black};
|
77
72
|
position: absolute;
|
78
|
-
|
79
|
-
${(props) =>
|
80
|
-
props.infoPosition == 'top' ? 'bottom : -10px' : 'top: 2px'};
|
81
|
-
|
73
|
+
top: 2px;
|
82
74
|
${(props) =>
|
83
75
|
props.alignArrow === 'left'
|
84
76
|
? 'left:40px;'
|
@@ -122,37 +114,26 @@
|
|
122
114
|
props: {
|
123
115
|
text: {
|
124
116
|
required: false,
|
125
|
-
default: '',
|
126
|
-
type: String,
|
127
117
|
},
|
128
118
|
size: {
|
129
119
|
required: false,
|
130
120
|
default: '14px',
|
131
|
-
type: String,
|
132
|
-
},
|
133
|
-
infoPosition: {
|
134
|
-
required: false,
|
135
|
-
default: 'bottom',
|
136
|
-
type: String,
|
137
121
|
},
|
138
122
|
alignArrow: {
|
139
123
|
required: false,
|
140
124
|
default: 'center',
|
141
|
-
type: String,
|
142
125
|
},
|
143
126
|
openTrigger: {
|
144
127
|
required: false,
|
145
128
|
default: 'onHover', // onHover, onClick
|
146
|
-
type: String,
|
147
129
|
},
|
148
130
|
width: {
|
149
131
|
required: false,
|
150
132
|
default: '200px',
|
151
|
-
type: String,
|
152
133
|
},
|
153
134
|
maxWidth: {
|
154
|
-
default: '400px',
|
155
135
|
type: String,
|
136
|
+
default: '400px',
|
156
137
|
},
|
157
138
|
},
|
158
139
|
data() {
|
@@ -3,7 +3,6 @@ import InputText from './index.vue'
|
|
3
3
|
export default {
|
4
4
|
title: 'InputText',
|
5
5
|
component: InputText,
|
6
|
-
tags: ['autodocs'],
|
7
6
|
// argTypes: {},
|
8
7
|
}
|
9
8
|
|
@@ -43,8 +42,8 @@ Default.args = {
|
|
43
42
|
textAlign: 'left',
|
44
43
|
}
|
45
44
|
|
46
|
-
export const
|
47
|
-
|
45
|
+
export const hasError = Template.bind({})
|
46
|
+
hasError.args = {
|
48
47
|
placeholder: 'Enter Value',
|
49
48
|
errorMessage: 'This field is required',
|
50
49
|
isError: true,
|
@@ -2,26 +2,22 @@
|
|
2
2
|
<Container>
|
3
3
|
<InputWrapper
|
4
4
|
:align-items="alignItems"
|
5
|
-
data-test-id="input_wrapper"
|
6
5
|
:has-label="!!label && label.length > 0"
|
7
6
|
>
|
8
7
|
<LabelWrapper v-if="label">
|
9
8
|
<InputLabel
|
10
|
-
ref="label"
|
11
9
|
:data-id="labelDataId"
|
12
|
-
data-test-id="label_wrapper"
|
13
10
|
:font-size="fontSize"
|
14
11
|
:label-font-color="labelFontColor"
|
15
12
|
>
|
16
13
|
{{ label }}
|
17
|
-
<OptionalLabel v-if="labelOptional"
|
14
|
+
<OptionalLabel v-if="labelOptional">
|
18
15
|
({{ $gettext('Optional') }})
|
19
16
|
</OptionalLabel>
|
20
17
|
</InputLabel>
|
21
18
|
<InfoText
|
22
|
-
v-if="infoTextMessage
|
19
|
+
v-if="infoTextMessage"
|
23
20
|
:align-arrow="infoTextAlign"
|
24
|
-
data-test-id="info_text_message"
|
25
21
|
:size="fontSize ? fontSize : '16px'"
|
26
22
|
:text="infoTextMessage"
|
27
23
|
/>
|
@@ -32,7 +28,6 @@
|
|
32
28
|
ref="inputElement"
|
33
29
|
:background-color="backgroundColor"
|
34
30
|
:data-id="inputDataId"
|
35
|
-
data-test-id="input"
|
36
31
|
:disabled="disabled"
|
37
32
|
:disabled-background-color="disabledBackgroundColor"
|
38
33
|
:font-color="fontColor"
|
@@ -49,26 +44,21 @@
|
|
49
44
|
:type="inputTypeData"
|
50
45
|
:value="value"
|
51
46
|
@blur="onInputBlur"
|
52
|
-
@focus="onInputFocus"
|
53
47
|
@input="onChangeHandler"
|
54
48
|
@keyup.enter="onEnterPress"
|
55
49
|
/>
|
56
50
|
<IconWrapper
|
57
51
|
v-if="inputType === 'password' && !isError"
|
58
|
-
data-test-id="password_visiblity_change_icon"
|
59
52
|
size="20px"
|
60
53
|
@click="toggleShowPassword()"
|
61
54
|
>
|
62
55
|
<Icon name="current_variant" size="20px" />
|
63
56
|
</IconWrapper>
|
64
|
-
<IconWrapper v-if="hasError"
|
57
|
+
<IconWrapper v-if="hasError" size="16px">
|
65
58
|
<Icon cursor="default" name="warning" size="16px" />
|
66
59
|
</IconWrapper>
|
67
60
|
</IconContainer>
|
68
|
-
<ErrorMessage
|
69
|
-
v-if="hasError && hasErrorMessage"
|
70
|
-
data-test-id="error_message_wrapper"
|
71
|
-
>
|
61
|
+
<ErrorMessage v-if="hasError && hasErrorMessage">
|
72
62
|
{{ dynamicErrorMessage }}
|
73
63
|
</ErrorMessage>
|
74
64
|
</InputErrorWrapper>
|
@@ -246,123 +236,93 @@
|
|
246
236
|
placeholder: {
|
247
237
|
required: false,
|
248
238
|
default: '',
|
249
|
-
type: String,
|
250
239
|
},
|
251
240
|
alignItems: {
|
252
241
|
required: false,
|
253
242
|
default: 'horizontal',
|
254
|
-
type: String,
|
255
|
-
validator(value) {
|
256
|
-
return ['horizontal', 'vertical'].includes(value)
|
257
|
-
},
|
258
243
|
},
|
259
244
|
isError: {
|
260
245
|
required: false,
|
261
246
|
default: false,
|
262
|
-
type: Boolean,
|
263
247
|
},
|
264
248
|
inputWidth: {
|
265
249
|
required: false,
|
266
250
|
default: null,
|
267
|
-
type: String,
|
268
251
|
},
|
269
252
|
inputHeight: {
|
270
253
|
required: false,
|
271
254
|
default: null,
|
272
|
-
type: String,
|
273
255
|
},
|
274
256
|
minWidth: {
|
275
257
|
required: false,
|
276
258
|
default: null,
|
277
|
-
type: String,
|
278
259
|
},
|
279
260
|
value: {
|
280
261
|
required: true,
|
281
262
|
default: null,
|
282
|
-
type: String,
|
283
263
|
},
|
284
264
|
errorMessage: {
|
285
265
|
required: false,
|
286
266
|
default: '',
|
287
|
-
type: String,
|
288
267
|
},
|
289
268
|
infoTextMessage: {
|
290
269
|
required: false,
|
291
|
-
default: '',
|
292
|
-
type: String,
|
293
270
|
},
|
294
271
|
infoTextAlign: {
|
295
272
|
required: false,
|
296
|
-
default: 'left',
|
297
|
-
type: String,
|
298
273
|
},
|
299
274
|
label: {
|
300
275
|
required: false,
|
301
|
-
default: '',
|
302
|
-
type: String,
|
303
276
|
},
|
304
277
|
labelOptional: {
|
305
278
|
required: false,
|
306
279
|
default: false,
|
307
|
-
type: Boolean,
|
308
280
|
},
|
309
281
|
noBorder: {
|
310
282
|
required: false,
|
311
283
|
default: false,
|
312
|
-
type: Boolean,
|
313
284
|
},
|
314
285
|
disabled: {
|
315
286
|
required: false,
|
316
287
|
default: false,
|
317
|
-
type: Boolean,
|
318
288
|
},
|
319
289
|
fontSize: {
|
320
290
|
required: false,
|
321
291
|
default: null,
|
322
|
-
type: String,
|
323
292
|
},
|
324
293
|
inputType: {
|
325
294
|
required: false,
|
326
295
|
default: 'text',
|
327
|
-
type: String,
|
328
296
|
},
|
329
297
|
labelFontColor: {
|
330
298
|
required: false,
|
331
299
|
default: 'black',
|
332
|
-
type: String,
|
333
300
|
},
|
334
301
|
backgroundColor: {
|
335
302
|
required: false,
|
336
|
-
type: String,
|
337
303
|
},
|
338
304
|
disabledBackgroundColor: {
|
339
305
|
required: false,
|
340
306
|
default: null,
|
341
|
-
type: String,
|
342
307
|
},
|
343
308
|
fontColor: {
|
344
309
|
required: false,
|
345
310
|
default: 'black',
|
346
|
-
type: String,
|
347
311
|
},
|
348
312
|
hasFocus: {
|
349
313
|
required: false,
|
350
314
|
default: false,
|
351
|
-
type: Boolean,
|
352
315
|
},
|
353
316
|
borderColor: {
|
354
317
|
required: false,
|
355
|
-
type: String,
|
356
318
|
},
|
357
319
|
labelDataId: {
|
358
320
|
required: false,
|
359
321
|
default: '',
|
360
|
-
type: String,
|
361
322
|
},
|
362
323
|
inputDataId: {
|
363
324
|
required: false,
|
364
325
|
default: '',
|
365
|
-
type: String,
|
366
326
|
},
|
367
327
|
},
|
368
328
|
data() {
|
@@ -375,10 +335,12 @@
|
|
375
335
|
return this.isError || this.error
|
376
336
|
},
|
377
337
|
hasErrorMessage() {
|
378
|
-
return
|
338
|
+
return (
|
339
|
+
(this.errorMessage && this.errorMessage.length > 0) || this.errMessage
|
340
|
+
)
|
379
341
|
},
|
380
342
|
dynamicErrorMessage() {
|
381
|
-
return this.errorMessage
|
343
|
+
return this.errMessage || this.errorMessage
|
382
344
|
},
|
383
345
|
},
|
384
346
|
watch: {
|
@@ -405,9 +367,6 @@
|
|
405
367
|
this.validateInput($event.target.value)
|
406
368
|
this.$emit('input-blur', $event.target.value)
|
407
369
|
},
|
408
|
-
onInputFocus($event) {
|
409
|
-
this.$emit('input-focus', $event.target.value)
|
410
|
-
},
|
411
370
|
toggleShowPassword() {
|
412
371
|
this.inputTypeData =
|
413
372
|
this.inputTypeData === 'password' ? 'text' : 'password'
|
@@ -613,7 +613,9 @@
|
|
613
613
|
if (this.isDropdownOpen) {
|
614
614
|
return this.$refs.dropdown.$el.childElementCount > 1
|
615
615
|
? this.$refs.dropdown.$el.childElementCount
|
616
|
-
: this.$refs.dropdown.$el.children[0]
|
616
|
+
: !!this.$refs.dropdown.$el.children[0]
|
617
|
+
? this.$refs.dropdown.$el.children[0].childElementCount
|
618
|
+
: 0
|
617
619
|
}
|
618
620
|
|
619
621
|
return 0
|
@@ -15,6 +15,7 @@
|
|
15
15
|
:is-disabled="isDisabled"
|
16
16
|
:min-width="minWidth"
|
17
17
|
:padding="padding"
|
18
|
+
:text-color="textColor"
|
18
19
|
:title="hoverText"
|
19
20
|
@click="clickHandler"
|
20
21
|
@mouseover="hoverHandler"
|
@@ -36,6 +37,7 @@
|
|
36
37
|
disabledBgColor: String,
|
37
38
|
disabledTextColor: String,
|
38
39
|
padding: String,
|
40
|
+
textColor: String,
|
39
41
|
}
|
40
42
|
const OptionContainer = styled('div', optionProps)`
|
41
43
|
display: flex;
|
@@ -67,7 +69,9 @@
|
|
67
69
|
? props.theme.colors[props.disabledTextColor]
|
68
70
|
: props.disabledTextColor
|
69
71
|
: props.theme.colors.grey3
|
70
|
-
:
|
72
|
+
: props.theme.colors[props.textColor]
|
73
|
+
? props.theme.colors[props.textColor]
|
74
|
+
: props.textColor};
|
71
75
|
&:hover {
|
72
76
|
background-color: ${(props) =>
|
73
77
|
!!props.disabledTextColor && props.isDisabled
|
@@ -125,6 +129,10 @@
|
|
125
129
|
required: false,
|
126
130
|
default: '12px 10px',
|
127
131
|
},
|
132
|
+
textColor: {
|
133
|
+
type: true,
|
134
|
+
default: 'inherit',
|
135
|
+
},
|
128
136
|
},
|
129
137
|
emits: ['option-hovered', 'option-selected'],
|
130
138
|
data() {
|