@eturnity/eturnity_reusable_components 8.19.8-EPDM-15273.1 → 8.19.8-EPDM-14690.4
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 +3 -1
- package/src/DemoChart.vue +424 -0
- package/src/TestChart.vue +229 -0
- package/src/assets/theme.js +78 -0
- package/src/components/barchart/BottomFields.vue +126 -36
- package/src/components/barchart/composables/useAxisCalculations.js +1 -1
- package/src/components/barchart/composables/useChartData.js +1 -1
- package/src/components/barchart/composables/useTooltip.js +28 -3
- package/src/components/barchart/index.vue +58 -15
- package/src/components/barchart/styles/bottomFields.js +18 -4
- package/src/components/barchart/styles/chart.js +1 -0
- package/src/components/buttons/mainButton/index.vue +2 -0
- package/src/components/errorMessage/index.vue +1 -1
- package/src/components/icon/index.vue +4 -2
- package/src/components/infoCard/index.vue +15 -3
- package/src/components/infoCard/infoCard.spec.js +3 -3
- package/src/components/infoText/index.vue +36 -31
- package/src/components/inputs/inputNumber/index.vue +92 -6
- package/src/components/pageTitle/index.vue +0 -1
- package/src/components/tag/proTag/index.vue +19 -0
- package/src/assets/svgIcons/flip_horizontally.svg +0 -6
@@ -240,6 +240,8 @@
|
|
240
240
|
return this.isDisabled
|
241
241
|
? this.theme.mainButton[this.appTheme][this.type][this.variant]
|
242
242
|
.disabled.textColor
|
243
|
+
: this.iconColor
|
244
|
+
? this.iconColor
|
243
245
|
: this.theme.mainButton[this.appTheme][this.type][this.variant]
|
244
246
|
.default.textColor
|
245
247
|
},
|
@@ -208,9 +208,11 @@
|
|
208
208
|
!props.disableHover &&
|
209
209
|
`
|
210
210
|
&:hover svg path:not(.fix, .isStrokePath) {
|
211
|
-
${`${props.fillType}: ${
|
211
|
+
${`${props.fillType}: ${
|
212
|
+
props.theme.colors[props.hoveredColor] || props.color
|
213
|
+
};`}
|
212
214
|
&:hover svg isStrokePath:not(.fix) {
|
213
|
-
${`stroke: ${props.hoveredColor || props.color};`}
|
215
|
+
${`stroke: ${props.theme.colors[props.hoveredColor] || props.color};`}
|
214
216
|
}
|
215
217
|
&:hover + div {
|
216
218
|
background-color: ${props.hoveredColor};
|
@@ -73,7 +73,12 @@
|
|
73
73
|
type: {
|
74
74
|
required: false,
|
75
75
|
type: String,
|
76
|
-
default: '
|
76
|
+
default: 'info_simple',
|
77
|
+
validator(value) {
|
78
|
+
return ['info_simple', 'warning', 'error_minor', 'info'].includes(
|
79
|
+
value
|
80
|
+
)
|
81
|
+
},
|
77
82
|
},
|
78
83
|
minWidth: {
|
79
84
|
required: false,
|
@@ -112,8 +117,11 @@
|
|
112
117
|
},
|
113
118
|
},
|
114
119
|
computed: {
|
115
|
-
|
120
|
+
isInfoSimple() {
|
116
121
|
// this property is used for tests
|
122
|
+
return this.type === 'info_simple'
|
123
|
+
},
|
124
|
+
isInfo() {
|
117
125
|
return this.type === 'info'
|
118
126
|
},
|
119
127
|
isWarning() {
|
@@ -148,9 +156,13 @@
|
|
148
156
|
stylesCollection.borderStyle = 'dashed'
|
149
157
|
stylesCollection.borderColor = theme.colors.grey4
|
150
158
|
stylesCollection.iconColor = theme.colors.red
|
151
|
-
} else {
|
159
|
+
} else if (this.isInfoSimple) {
|
152
160
|
stylesCollection.borderStyle = 'dashed'
|
153
161
|
stylesCollection.borderColor = theme.colors.grey4
|
162
|
+
} else {
|
163
|
+
stylesCollection.color = theme.semanticColors.teal[800]
|
164
|
+
stylesCollection.backgroundColor = theme.semanticColors.blue[300]
|
165
|
+
stylesCollection.iconColor = theme.semanticColors.teal[800]
|
154
166
|
}
|
155
167
|
|
156
168
|
return stylesCollection
|
@@ -45,19 +45,19 @@ describe('RCInfoCard.vue', () => {
|
|
45
45
|
},
|
46
46
|
})
|
47
47
|
|
48
|
-
expect(wrapper.vm.
|
48
|
+
expect(wrapper.vm.isInfoSimple).toBe(true)
|
49
49
|
expect(wrapper.vm.isWarning).toBe(false)
|
50
50
|
expect(wrapper.vm.isErrorMinor).toBe(false)
|
51
51
|
|
52
52
|
await wrapper.setProps({ type: 'warning' })
|
53
53
|
|
54
|
-
expect(wrapper.vm.
|
54
|
+
expect(wrapper.vm.isInfoSimple).toBe(false)
|
55
55
|
expect(wrapper.vm.isWarning).toBe(true)
|
56
56
|
expect(wrapper.vm.isErrorMinor).toBe(false)
|
57
57
|
|
58
58
|
await wrapper.setProps({ type: 'error_minor' })
|
59
59
|
|
60
|
-
expect(wrapper.vm.
|
60
|
+
expect(wrapper.vm.isInfoSimple).toBe(false)
|
61
61
|
expect(wrapper.vm.isWarning).toBe(false)
|
62
62
|
expect(wrapper.vm.isErrorMinor).toBe(true)
|
63
63
|
})
|
@@ -15,37 +15,40 @@
|
|
15
15
|
:is-disabled="isDisabled"
|
16
16
|
:padding="padding"
|
17
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
|
-
|
18
|
+
<template v-if="!$slots.trigger">
|
19
|
+
<LabelWrapper
|
20
|
+
v-if="labelText && labelAlign === 'left'"
|
21
|
+
:color="iconColor || computedIconColor"
|
22
|
+
:size="labelSize"
|
23
|
+
>
|
24
|
+
{{ labelText }}
|
25
|
+
</LabelWrapper>
|
26
|
+
<Dot
|
27
|
+
v-if="type === 'dot'"
|
28
|
+
:color="dotColor"
|
29
|
+
data-test-id="infoText_dot"
|
30
|
+
/>
|
31
|
+
<IconComponent
|
32
|
+
v-else-if="!noIcon"
|
33
|
+
:color="iconColor || computedIconColor"
|
34
|
+
:cursor="isDisabled ? 'not-allowed' : 'pointer'"
|
35
|
+
:disabled="isDisabled"
|
36
|
+
:hovered-color="iconColor || computedIconColor"
|
37
|
+
:name="iconName"
|
38
|
+
:size="size"
|
39
|
+
/>
|
40
|
+
<LabelWrapper
|
41
|
+
v-if="labelText && labelAlign === 'right'"
|
42
|
+
:color="iconColor || computedIconColor"
|
43
|
+
:size="labelSize"
|
44
|
+
>
|
45
|
+
{{ labelText }}
|
46
|
+
</LabelWrapper>
|
47
|
+
</template>
|
48
|
+
<slot name="trigger"></slot>
|
46
49
|
</IconWrapper>
|
47
50
|
</div>
|
48
|
-
<Teleport v-if="isVisible" to="body">
|
51
|
+
<Teleport v-if="isVisible && !!text" to="body">
|
49
52
|
<TextWrapper data-test-id="info_text_wrapper" :style="wrapperStyle">
|
50
53
|
<TextOverlay
|
51
54
|
ref="infoBox"
|
@@ -227,7 +230,7 @@
|
|
227
230
|
},
|
228
231
|
infoPosition: {
|
229
232
|
required: false,
|
230
|
-
default:
|
233
|
+
default: null,
|
231
234
|
type: String,
|
232
235
|
},
|
233
236
|
maxWidth: {
|
@@ -363,7 +366,9 @@
|
|
363
366
|
{ position: 'left', space: spaceLeft },
|
364
367
|
].sort((a, b) => b.space - a.space)
|
365
368
|
|
366
|
-
const bestPosition =
|
369
|
+
const bestPosition = props.infoPosition
|
370
|
+
? props.infoPosition
|
371
|
+
: positions[0].position
|
367
372
|
|
368
373
|
let top, left, arrowPosition
|
369
374
|
|
@@ -30,7 +30,61 @@
|
|
30
30
|
/>
|
31
31
|
</LabelWrapper>
|
32
32
|
<InputWrapper>
|
33
|
+
<InputInfoText
|
34
|
+
v-if="!!inputInfoText"
|
35
|
+
info-position="bottom"
|
36
|
+
:text="inputInfoText"
|
37
|
+
>
|
38
|
+
<template #trigger>
|
39
|
+
<InputContainer
|
40
|
+
v-bind="$attrs"
|
41
|
+
ref="inputField1"
|
42
|
+
:align-items="alignItems"
|
43
|
+
:background-color="
|
44
|
+
colorMode === 'transparent' ? 'transparent' : backgroundColor
|
45
|
+
"
|
46
|
+
:border-color="
|
47
|
+
colorMode === 'transparent' && !borderColor
|
48
|
+
? 'white'
|
49
|
+
: borderColor
|
50
|
+
"
|
51
|
+
:color-mode="colorMode"
|
52
|
+
:data-id="inputDataId"
|
53
|
+
:data-qa-id="dataQaId"
|
54
|
+
:disabled="disabled && !isDisabledStyledOnly"
|
55
|
+
:font-color="colorMode === 'transparent' ? 'white' : fontColor"
|
56
|
+
:font-size="fontSize"
|
57
|
+
:has-label-slot="hasLabelSlot"
|
58
|
+
:has-slot="hasSlot"
|
59
|
+
:has-unit="unitName && !!unitName.length"
|
60
|
+
:input-height="inputHeight"
|
61
|
+
:is-border-error-only="isBorderErrorOnly"
|
62
|
+
:is-disabled="disabled"
|
63
|
+
:is-error="isError"
|
64
|
+
:is-info-border="isInfoBorder"
|
65
|
+
:is-interactive="isInteractive"
|
66
|
+
:min-width="minWidth"
|
67
|
+
:no-border="noBorder"
|
68
|
+
:placeholder="displayedPlaceholder"
|
69
|
+
:read-only="isReadOnly"
|
70
|
+
:readonly="isReadOnly"
|
71
|
+
:show-arrow-controls="showArrowControls"
|
72
|
+
:show-linear-unit-name="showLinearUnitName"
|
73
|
+
:slot-size="slotSize"
|
74
|
+
:text-align="textAlign"
|
75
|
+
:value="formatWithCurrency(value)"
|
76
|
+
@blur="onInputBlur($event)"
|
77
|
+
@focus="focusInput()"
|
78
|
+
@input="onInput($event)"
|
79
|
+
@keydown.down="decrementValue"
|
80
|
+
@keydown.up="incrementValue"
|
81
|
+
@keyup.enter="onEnterPress"
|
82
|
+
/>
|
83
|
+
</template>
|
84
|
+
</InputInfoText>
|
85
|
+
|
33
86
|
<InputContainer
|
87
|
+
v-else
|
34
88
|
v-bind="$attrs"
|
35
89
|
ref="inputField1"
|
36
90
|
:align-items="alignItems"
|
@@ -43,20 +97,23 @@
|
|
43
97
|
:color-mode="colorMode"
|
44
98
|
:data-id="inputDataId"
|
45
99
|
:data-qa-id="dataQaId"
|
46
|
-
:disabled="disabled"
|
100
|
+
:disabled="disabled && !isDisabledStyledOnly"
|
47
101
|
:font-color="colorMode === 'transparent' ? 'white' : fontColor"
|
48
102
|
:font-size="fontSize"
|
49
103
|
:has-label-slot="hasLabelSlot"
|
50
104
|
:has-slot="hasSlot"
|
51
105
|
:has-unit="unitName && !!unitName.length"
|
52
106
|
:input-height="inputHeight"
|
107
|
+
:is-border-error-only="isBorderErrorOnly"
|
53
108
|
:is-disabled="disabled"
|
54
109
|
:is-error="isError"
|
110
|
+
:is-info-border="isInfoBorder"
|
55
111
|
:is-interactive="isInteractive"
|
56
112
|
:min-width="minWidth"
|
57
113
|
:no-border="noBorder"
|
58
114
|
:placeholder="displayedPlaceholder"
|
59
115
|
:read-only="isReadOnly"
|
116
|
+
:readonly="isReadOnly"
|
60
117
|
:show-arrow-controls="showArrowControls"
|
61
118
|
:show-linear-unit-name="showLinearUnitName"
|
62
119
|
:slot-size="slotSize"
|
@@ -69,6 +126,7 @@
|
|
69
126
|
@keydown.up="incrementValue"
|
70
127
|
@keyup.enter="onEnterPress"
|
71
128
|
/>
|
129
|
+
|
72
130
|
<SlotContainer v-if="hasSlot" :is-error="isError" :slot-size="slotSize">
|
73
131
|
<slot></slot>
|
74
132
|
</SlotContainer>
|
@@ -80,7 +138,7 @@
|
|
80
138
|
>{{ unitName }}</UnitContainer
|
81
139
|
>
|
82
140
|
<IconWrapper
|
83
|
-
v-if="isError && !showLinearUnitName"
|
141
|
+
v-if="isError && !showLinearUnitName && !isBorderErrorOnly"
|
84
142
|
:margin-right="showSelect ? selectWidth : 0"
|
85
143
|
size="16px"
|
86
144
|
>
|
@@ -134,7 +192,9 @@
|
|
134
192
|
</ArrowButton>
|
135
193
|
</ArrowControls>
|
136
194
|
</InputWrapper>
|
137
|
-
<ErrorMessage v-if="isError">{{
|
195
|
+
<ErrorMessage v-if="isError && errorMessage">{{
|
196
|
+
errorMessage
|
197
|
+
}}</ErrorMessage>
|
138
198
|
</Container>
|
139
199
|
</template>
|
140
200
|
|
@@ -205,6 +265,8 @@
|
|
205
265
|
colorMode: String,
|
206
266
|
showArrowControls: Boolean,
|
207
267
|
readOnly: Boolean,
|
268
|
+
isBorderErrorOnly: Boolean,
|
269
|
+
isInfoBorder: Boolean,
|
208
270
|
}
|
209
271
|
|
210
272
|
const Container = styled('div', inputProps)`
|
@@ -217,7 +279,9 @@
|
|
217
279
|
|
218
280
|
const InputContainer = styled('input', inputProps)`
|
219
281
|
border: ${(props) =>
|
220
|
-
props.
|
282
|
+
props.isInfoBorder
|
283
|
+
? '1px solid ' + props.theme.semanticColors.blue[500]
|
284
|
+
: props.isError
|
221
285
|
? '1px solid ' + props.theme.colors.red
|
222
286
|
: props.noBorder
|
223
287
|
? 'none'
|
@@ -236,16 +300,17 @@
|
|
236
300
|
showLinearUnitName,
|
237
301
|
colorMode,
|
238
302
|
showArrowControls,
|
303
|
+
isBorderErrorOnly,
|
239
304
|
}) =>
|
240
305
|
showArrowControls
|
241
306
|
? '40px'
|
242
307
|
: colorMode === 'transparent'
|
243
308
|
? '0'
|
244
309
|
: slotSize
|
245
|
-
? isError && !showLinearUnitName
|
310
|
+
? isError && !showLinearUnitName && !isBorderErrorOnly
|
246
311
|
? 'calc(' + slotSize + ' + 24px)'
|
247
312
|
: 'calc(' + slotSize + ' + 10px)'
|
248
|
-
: isError && !showLinearUnitName
|
313
|
+
: isError && !showLinearUnitName && !isBorderErrorOnly
|
249
314
|
? '24px'
|
250
315
|
: '5px'};
|
251
316
|
border-radius: ${(props) =>
|
@@ -457,6 +522,10 @@
|
|
457
522
|
background-color: ${({ theme }) => theme.colors.grey4};
|
458
523
|
`
|
459
524
|
|
525
|
+
const InputInfoText = styled(InfoText)`
|
526
|
+
width: 100%;
|
527
|
+
`
|
528
|
+
|
460
529
|
export default {
|
461
530
|
name: 'InputNumber',
|
462
531
|
components: {
|
@@ -480,6 +549,7 @@
|
|
480
549
|
ArrowControls,
|
481
550
|
ArrowButton,
|
482
551
|
ArrowDivider,
|
552
|
+
InputInfoText,
|
483
553
|
},
|
484
554
|
inheritAttrs: false,
|
485
555
|
props: {
|
@@ -699,6 +769,22 @@
|
|
699
769
|
type: Boolean,
|
700
770
|
default: false,
|
701
771
|
},
|
772
|
+
isBorderErrorOnly: {
|
773
|
+
type: Boolean,
|
774
|
+
default: false,
|
775
|
+
},
|
776
|
+
isInfoBorder: {
|
777
|
+
type: Boolean,
|
778
|
+
default: false,
|
779
|
+
},
|
780
|
+
inputInfoText: {
|
781
|
+
type: String,
|
782
|
+
default: '',
|
783
|
+
},
|
784
|
+
isDisabledStyledOnly: {
|
785
|
+
type: Boolean,
|
786
|
+
default: false,
|
787
|
+
},
|
702
788
|
},
|
703
789
|
data() {
|
704
790
|
return {
|
@@ -46,7 +46,6 @@
|
|
46
46
|
color: ${(props) => (props.color ? props.color : props.theme.colors.black)};
|
47
47
|
font-weight: 600;
|
48
48
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '20px')};
|
49
|
-
text-transform: ${(props) => (props.uppercase ? 'uppercase' : 'none')};
|
50
49
|
`
|
51
50
|
|
52
51
|
export default {
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<template>
|
2
|
+
<RCButton
|
3
|
+
button-size="tiny"
|
4
|
+
icon="star"
|
5
|
+
icon-color="yellow"
|
6
|
+
text="PRO"
|
7
|
+
type="protag"
|
8
|
+
variant="main"
|
9
|
+
/>
|
10
|
+
</template>
|
11
|
+
<script>
|
12
|
+
import RCButton from '../../buttons/mainButton'
|
13
|
+
export default {
|
14
|
+
name: 'ProTag',
|
15
|
+
components: {
|
16
|
+
RCButton,
|
17
|
+
},
|
18
|
+
}
|
19
|
+
</script>
|