@eturnity/eturnity_reusable_components 8.7.5-EPDM-6306.0 → 8.7.5-EPIC-8593
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 +3 -2
- package/src/Test.vue +12 -76
- package/src/assets/svgIcons/add_plus.svg +4 -0
- package/src/assets/svgIcons/checkmark_white.svg +4 -0
- package/src/assets/svgIcons/clenergy.svg +4 -0
- package/src/assets/svgIcons/clickable_info.svg +2 -2
- package/src/assets/svgIcons/clickable_info_white.svg +5 -0
- package/src/assets/svgIcons/erase_white.svg +4 -0
- package/src/assets/svgIcons/module.svg +2 -2
- package/src/assets/svgIcons/optimizer.svg +2 -5
- package/src/assets/svgIcons/order.svg +3 -0
- package/src/assets/svgIcons/question_mark.svg +3 -0
- package/src/assets/svgIcons/question_mark_white.svg +4 -0
- package/src/assets/svgIcons/reorder_string.svg +3 -0
- package/src/assets/svgIcons/switch_polarity.svg +5 -0
- package/src/assets/svgIcons/transparent_warning.svg +4 -0
- package/src/assets/svgIcons/warning_triangle.svg +3 -0
- package/src/assets/svgIcons/warning_triangle_white.svg +5 -0
- package/src/assets/theme.js +13 -1
- package/src/components/buttons/buttonIcon/index.vue +31 -6
- package/src/components/buttons/mainButton/MainButton.stories.js +13 -0
- package/src/components/buttons/mainButton/index.vue +45 -3
- package/src/components/infoLabel/index.vue +63 -0
- package/src/components/infoText/index.vue +168 -38
- package/src/components/infoText/infoText.spec.js +1 -1
- package/src/components/inputs/checkbox/index.vue +11 -2
- package/src/components/inputs/inputNumber/index.vue +78 -64
- package/src/components/modals/modal/index.vue +23 -13
- package/src/components/panelRangeInfo/index.vue +196 -0
- package/src/components/selectedOptions/index.vue +2 -12
- package/src/components/selectedOptions/selectedOptions.spec.js +1 -1
- package/src/components/tabsHeader/index.vue +75 -61
- package/src/helpers/numberConverter.js +1 -1
- package/src/components/stringDesign/DropdownMenu/index.vue +0 -1009
- /package/src/assets/svgIcons/{close_for_modals,_tool_tips.svg → close.svg} +0 -0
@@ -0,0 +1,196 @@
|
|
1
|
+
<template>
|
2
|
+
<Container :width="width">
|
3
|
+
<MainLine />
|
4
|
+
<MainLineHighlight :max-percent="maxPercent" :min-percent="minPercent" />
|
5
|
+
<TopValueContainer :position="valuePercent + '%'">
|
6
|
+
<TextWrapper :background-color="arrowColor">{{ value }}</TextWrapper>
|
7
|
+
<Arrow :background-color="arrowColor" />
|
8
|
+
<VerticalMarkerArrow :color="colorVerticalMarkerArrow" />
|
9
|
+
</TopValueContainer>
|
10
|
+
<BottomValueContainer :position="minPercent + '%'">
|
11
|
+
<TextWrapper>{{ minValue }}</TextWrapper>
|
12
|
+
<VerticalMarker side="bottom" />
|
13
|
+
</BottomValueContainer>
|
14
|
+
<BottomValueContainer :position="maxPercent + '%'">
|
15
|
+
<TextWrapper>{{ maxValue }}</TextWrapper>
|
16
|
+
<VerticalMarker side="bottom" />
|
17
|
+
</BottomValueContainer>
|
18
|
+
</Container>
|
19
|
+
</template>
|
20
|
+
|
21
|
+
<script>
|
22
|
+
// import ProgressBar from "@eturnity/eturnity_reusable_components/src/components/progressBar"
|
23
|
+
//To Use:
|
24
|
+
// <progress-bar
|
25
|
+
// fillColor="#000"
|
26
|
+
// backgroundColor="#888"
|
27
|
+
// minWidth="150px"
|
28
|
+
// maxWidth="100%"
|
29
|
+
// :fillProgress="50" //should be a number for percent
|
30
|
+
// stepNumber="4"
|
31
|
+
// :labelText="translate('step')"
|
32
|
+
// />
|
33
|
+
import styled from 'vue3-styled-components'
|
34
|
+
const Container = styled.div`
|
35
|
+
position: relative;
|
36
|
+
display: flex;
|
37
|
+
height: 47px;
|
38
|
+
width: ${(props) => props.width};
|
39
|
+
`
|
40
|
+
const TopValueContainer = styled('div', { position: String })`
|
41
|
+
font-size: 11px;
|
42
|
+
left: ${(props) => props.position};
|
43
|
+
position: absolute;
|
44
|
+
display: flex;
|
45
|
+
justify-content: center
|
46
|
+
width: 0px;
|
47
|
+
color:${(props) => props.theme.colors.black};
|
48
|
+
item-align: center;
|
49
|
+
|
50
|
+
`
|
51
|
+
const BottomValueContainer = styled('div', { position: String })`
|
52
|
+
font-size: 12px;
|
53
|
+
left: ${(props) => props.position};
|
54
|
+
width: 0px;
|
55
|
+
bottom: -2px;
|
56
|
+
position: absolute;
|
57
|
+
display: flex;
|
58
|
+
justify-content: center;
|
59
|
+
item-align: center;
|
60
|
+
border-radius: 4px;
|
61
|
+
color: white;
|
62
|
+
`
|
63
|
+
const TextWrapper = styled('div', { backgroundColor: String })`
|
64
|
+
padding: 2px 6px;
|
65
|
+
background-color: ${(props) =>
|
66
|
+
props.theme.colors[props.backgroundColor] || props.backgroundColor};
|
67
|
+
border-radius: 4px;
|
68
|
+
`
|
69
|
+
const Arrow = styled('div', { backgroundColor: String })`
|
70
|
+
position: absolute;
|
71
|
+
bottom: -10px;
|
72
|
+
left: calc(50% - 6px);
|
73
|
+
width: 0;
|
74
|
+
height: 0;
|
75
|
+
border: 6px solid transparent;
|
76
|
+
border-top-color: ${(props) =>
|
77
|
+
props.theme.colors[props.backgroundColor] || props.backgroundColor};
|
78
|
+
filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
|
79
|
+
`
|
80
|
+
const MainLine = styled.div`
|
81
|
+
display: block;
|
82
|
+
position: absolute;
|
83
|
+
bottom: 16px;
|
84
|
+
height: 4px;
|
85
|
+
width: 100%;
|
86
|
+
border-radius: 4px;
|
87
|
+
background-color: ${(props) => props.theme.colors.grey4};
|
88
|
+
`
|
89
|
+
const MainLineHighlight = styled('div', {
|
90
|
+
minPercent: Number,
|
91
|
+
maxPercent: Number,
|
92
|
+
})`
|
93
|
+
display: block;
|
94
|
+
position: absolute;
|
95
|
+
left: ${(props) => props.minPercent + '%'};
|
96
|
+
right: ${(props) => 100 - props.maxPercent + '%'};
|
97
|
+
bottom: 16px;
|
98
|
+
height: 4px;
|
99
|
+
background-color: white;
|
100
|
+
`
|
101
|
+
const VerticalMarker = styled('div')`
|
102
|
+
position: absolute;
|
103
|
+
width: 1px;
|
104
|
+
height: 8px;
|
105
|
+
background-color: white;
|
106
|
+
display: inline-block;
|
107
|
+
top: -6px;
|
108
|
+
left: 0px;
|
109
|
+
`
|
110
|
+
const VerticalMarkerArrow = styled('div', { color: String })`
|
111
|
+
position: absolute;
|
112
|
+
width: 1px;
|
113
|
+
height: 4px;
|
114
|
+
background-color: ${(props) => props.color};
|
115
|
+
display: inline-block;
|
116
|
+
bottom: -14px;
|
117
|
+
left: 0px;
|
118
|
+
`
|
119
|
+
export default {
|
120
|
+
name: 'ProgressBar',
|
121
|
+
components: {
|
122
|
+
Container,
|
123
|
+
MainLineHighlight,
|
124
|
+
Arrow,
|
125
|
+
TopValueContainer,
|
126
|
+
BottomValueContainer,
|
127
|
+
MainLine,
|
128
|
+
VerticalMarker,
|
129
|
+
VerticalMarkerArrow,
|
130
|
+
TextWrapper,
|
131
|
+
},
|
132
|
+
props: {
|
133
|
+
minValue: {
|
134
|
+
required: true,
|
135
|
+
type: Number,
|
136
|
+
},
|
137
|
+
maxValue: {
|
138
|
+
required: true,
|
139
|
+
type: Number,
|
140
|
+
},
|
141
|
+
value: {
|
142
|
+
required: true,
|
143
|
+
type: Number,
|
144
|
+
},
|
145
|
+
arrowColor: {
|
146
|
+
required: false,
|
147
|
+
type: String,
|
148
|
+
default: 'white',
|
149
|
+
},
|
150
|
+
width: {
|
151
|
+
required: false,
|
152
|
+
type: String,
|
153
|
+
default: null,
|
154
|
+
},
|
155
|
+
},
|
156
|
+
data() {
|
157
|
+
return {}
|
158
|
+
},
|
159
|
+
computed: {
|
160
|
+
minPercent() {
|
161
|
+
if (this.maxValue === this.minValue) {
|
162
|
+
return 50
|
163
|
+
} else {
|
164
|
+
return 30
|
165
|
+
}
|
166
|
+
},
|
167
|
+
maxPercent() {
|
168
|
+
if (this.maxValue === this.minValue) {
|
169
|
+
return 50
|
170
|
+
} else {
|
171
|
+
return 70
|
172
|
+
}
|
173
|
+
},
|
174
|
+
valuePercent() {
|
175
|
+
let percent
|
176
|
+
if (this.maxValue === this.minValue) {
|
177
|
+
percent = this.minPercent + 10 * (this.value - this.minValue)
|
178
|
+
} else {
|
179
|
+
percent =
|
180
|
+
this.minPercent +
|
181
|
+
((this.maxPercent - this.minPercent) /
|
182
|
+
(this.maxValue - this.minValue)) *
|
183
|
+
(this.value - this.minValue)
|
184
|
+
}
|
185
|
+
return Math.max(0, Math.min(100, percent))
|
186
|
+
},
|
187
|
+
colorVerticalMarkerArrow() {
|
188
|
+
if (this.value < this.maxValue && this.value > this.minValue) {
|
189
|
+
return 'black'
|
190
|
+
} else {
|
191
|
+
return 'white'
|
192
|
+
}
|
193
|
+
},
|
194
|
+
},
|
195
|
+
}
|
196
|
+
</script>
|
@@ -5,12 +5,7 @@
|
|
5
5
|
<TitleContainer>
|
6
6
|
<BoxTitle> {{ numberSelected }} {{ selectedText }} </BoxTitle>
|
7
7
|
<IconContainer @click="$emit('on-close')">
|
8
|
-
<Icon
|
9
|
-
color="white"
|
10
|
-
cursor="pointer"
|
11
|
-
name="close_for_modals,_tool_tips"
|
12
|
-
size="14px"
|
13
|
-
/>
|
8
|
+
<Icon color="white" cursor="pointer" name="close" size="14px" />
|
14
9
|
</IconContainer>
|
15
10
|
</TitleContainer>
|
16
11
|
<DividerContainer>
|
@@ -91,12 +86,7 @@
|
|
91
86
|
</EmptyText>
|
92
87
|
<CloseContainer>
|
93
88
|
<IconContainer @click="$emit('on-close')">
|
94
|
-
<Icon
|
95
|
-
color="white"
|
96
|
-
cursor="pointer"
|
97
|
-
name="close_for_modals,_tool_tips"
|
98
|
-
size="14px"
|
99
|
-
/>
|
89
|
+
<Icon color="white" cursor="pointer" name="close" size="14px" />
|
100
90
|
</IconContainer>
|
101
91
|
</CloseContainer>
|
102
92
|
</BoxContainer>
|
@@ -5,7 +5,7 @@ import theme from '@/assets/theme'
|
|
5
5
|
|
6
6
|
jest.mock('@/components/icon/iconCache.mjs', () => ({
|
7
7
|
// need to mock this due to how jest handles import.meta
|
8
|
-
fetchIcon: jest.fn(() => Promise.resolve('
|
8
|
+
fetchIcon: jest.fn(() => Promise.resolve('close.svg')),
|
9
9
|
}))
|
10
10
|
|
11
11
|
describe('RCSelectedOptions.vue', () => {
|
@@ -4,80 +4,94 @@
|
|
4
4
|
<TabItem
|
5
5
|
v-for="item in tabsData"
|
6
6
|
:key="item.id"
|
7
|
+
:full-size="fullSize"
|
7
8
|
:is-active="activeTab === item.id"
|
8
9
|
@click="onTabClick({ id: item.id })"
|
9
10
|
>
|
10
|
-
{{ item.text }}
|
11
|
+
<div>{{ item.text }}</div>
|
12
|
+
<RCIcon v-if="item.hasError" name="warning" size="14px" />
|
11
13
|
</TabItem>
|
12
14
|
</TabsContainer>
|
13
15
|
</PageContainer>
|
14
16
|
</template>
|
15
17
|
|
16
18
|
<script>
|
17
|
-
// import RCTabsHeader from "@eturnity/eturnity_reusable_components/src/components/tabsHeader"
|
18
|
-
// To use:
|
19
|
-
// <RCTabsHeader
|
20
|
-
// :activeTab="activeTabIndex" // should match the 'id'
|
21
|
-
// :tabsData="[
|
22
|
-
// {
|
23
|
-
// text: 'Tab 1',
|
24
|
-
// id: 0
|
25
|
-
//
|
26
|
-
//
|
27
|
-
//
|
28
|
-
//
|
29
|
-
//
|
30
|
-
//
|
31
|
-
//
|
32
|
-
|
19
|
+
// import RCTabsHeader from "@eturnity/eturnity_reusable_components/src/components/tabsHeader"
|
20
|
+
// To use:
|
21
|
+
// <RCTabsHeader
|
22
|
+
// :activeTab="activeTabIndex" // should match the 'id'
|
23
|
+
// :tabsData="[
|
24
|
+
// {
|
25
|
+
// text: 'Tab 1',
|
26
|
+
// id: 0,
|
27
|
+
// hasError: true // optional
|
28
|
+
// },
|
29
|
+
// {
|
30
|
+
// text: 'Tab 1',
|
31
|
+
// id: 1,
|
32
|
+
// hasError: false // optional
|
33
|
+
// }
|
34
|
+
// ]"
|
35
|
+
// />
|
36
|
+
import styled from 'vue3-styled-components'
|
37
|
+
import RCIcon from '../icon'
|
33
38
|
|
34
|
-
const PageContainer = styled.div``
|
39
|
+
const PageContainer = styled.div``
|
35
40
|
|
36
|
-
const TabsContainer = styled.div`
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
`
|
41
|
+
const TabsContainer = styled.div`
|
42
|
+
display: flex;
|
43
|
+
cursor: pointer;
|
44
|
+
width: 100%;
|
41
45
|
|
42
|
-
|
43
|
-
|
44
|
-
padding: 10px 20px;
|
45
|
-
font-size: 14px;
|
46
|
-
font-weight: 700;
|
47
|
-
background-color: ${(props) =>
|
48
|
-
props.isActive ? props.theme.colors.grey5 : props.theme.colors.white};
|
49
|
-
border-top: 3px solid
|
50
|
-
${(props) =>
|
51
|
-
props.isActive
|
52
|
-
? props.theme.colors.brightBlue
|
53
|
-
: props.theme.colors.grey4};
|
54
|
-
flex-grow: 1;
|
55
|
-
`
|
46
|
+
border-bottom: 1px solid ${(props) => props.theme.colors.purple7};
|
47
|
+
`
|
56
48
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
49
|
+
const TabAttrs = { isActive: Boolean, fullSize: Boolean }
|
50
|
+
const TabItem = styled('div', TabAttrs)`
|
51
|
+
display: flex;
|
52
|
+
align-items: center;
|
53
|
+
justify-content: center;
|
54
|
+
gap: 8px;
|
55
|
+
padding: 10px 25px;
|
56
|
+
font-size: 14px;
|
57
|
+
font-weight: 400;
|
58
|
+
color: ${(props) =>
|
59
|
+
props.isActive ? props.theme.colors.purple6 : props.theme.colors.black};
|
60
|
+
border-bottom: ${(props) =>
|
61
|
+
props.isActive ? '1px solid' + props.theme.colors.purple6 : 'unset'};
|
62
|
+
flex-grow: ${(props) => (props.fullSize ? 1 : 0)};
|
63
|
+
`
|
64
|
+
|
65
|
+
export default {
|
66
|
+
name: 'RCTabsHeader',
|
67
|
+
components: {
|
68
|
+
PageContainer,
|
69
|
+
TabsContainer,
|
70
|
+
TabItem,
|
71
|
+
RCIcon,
|
72
|
+
},
|
73
|
+
props: {
|
74
|
+
tabsData: {
|
75
|
+
required: true,
|
76
|
+
type: Array,
|
77
|
+
},
|
78
|
+
activeTab: {
|
79
|
+
required: true,
|
80
|
+
type: Number,
|
81
|
+
},
|
82
|
+
fullSize: {
|
83
|
+
type: Boolean,
|
84
|
+
default: true,
|
85
|
+
},
|
86
|
+
},
|
87
|
+
emits: ['on-tab-change'],
|
88
|
+
methods: {
|
89
|
+
onTabClick({ id }) {
|
90
|
+
if (id === this.activeTab) {
|
91
|
+
return
|
92
|
+
}
|
93
|
+
this.$emit('on-tab-change', id)
|
94
|
+
},
|
68
95
|
},
|
69
|
-
activeTab: {
|
70
|
-
required: true,
|
71
|
-
type: Number
|
72
|
-
}
|
73
|
-
},
|
74
|
-
methods: {
|
75
|
-
onTabClick({ id }) {
|
76
|
-
if (id === this.activeTab) {
|
77
|
-
return
|
78
|
-
}
|
79
|
-
this.$emit('on-tab-change', id)
|
80
|
-
}
|
81
96
|
}
|
82
|
-
}
|
83
97
|
</script>
|
@@ -94,7 +94,7 @@ export const stringToNumber = ({
|
|
94
94
|
|
95
95
|
export const numberToString = ({ value, numberPrecision, minDecimals }) => {
|
96
96
|
const minimumRounding = minDecimals ? minDecimals : 0
|
97
|
-
value =
|
97
|
+
value = parseFloat(value)
|
98
98
|
return value.toLocaleString(langForLocaleString(), {
|
99
99
|
minimumFractionDigits: minimumRounding, // removing this for now. Why do we need this to be a minimum amount?
|
100
100
|
maximumFractionDigits:
|