@eturnity/eturnity_reusable_components 8.7.5-EPDM-12618.3 → 8.7.5-EPIC-8593.0
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/App.vue +6 -6
- package/src/Test.vue +12 -76
- package/src/assets/svgIcons/add_icon-1.svg +2 -2
- package/src/assets/svgIcons/add_plus.svg +4 -0
- package/src/assets/svgIcons/arrow_down_unfilled.svg +4 -0
- package/src/assets/svgIcons/arrow_up_unfilled.svg +4 -0
- package/src/assets/svgIcons/battery.svg +2 -2
- package/src/assets/svgIcons/bell_alt.svg +1 -3
- package/src/assets/svgIcons/bexio.svg +3 -3
- package/src/assets/svgIcons/bom.svg +2 -2
- 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/collections.svg +1 -1
- package/src/assets/svgIcons/customer.svg +3 -0
- package/src/assets/svgIcons/dashboard.svg +1 -1
- package/src/assets/svgIcons/deal_flow.svg +2 -4
- package/src/assets/svgIcons/documents.svg +2 -3
- package/src/assets/svgIcons/efs.svg +5 -0
- package/src/assets/svgIcons/ems-1.svg +2 -2
- package/src/assets/svgIcons/ems.svg +2 -2
- package/src/assets/svgIcons/energy_meter.svg +3 -12
- package/src/assets/svgIcons/erase_white.svg +4 -0
- package/src/assets/svgIcons/financing_for_pv.svg +2 -5
- package/src/assets/svgIcons/free_technology.svg +2 -4
- package/src/assets/svgIcons/heat_pump.svg +5 -0
- package/src/assets/svgIcons/heating_system.svg +3 -0
- package/src/assets/svgIcons/initial_situation.svg +2 -2
- package/src/assets/svgIcons/integrations.svg +2 -2
- package/src/assets/svgIcons/inverter.svg +2 -2
- package/src/assets/svgIcons/k2.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/profile.svg +2 -3
- package/src/assets/svgIcons/profitability.svg +2 -2
- package/src/assets/svgIcons/project_analysis.svg +2 -3
- package/src/assets/svgIcons/project_settings.svg +2 -3
- package/src/assets/svgIcons/pv.svg +2 -2
- 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/run_simulation.svg +2 -2
- package/src/assets/svgIcons/settings.svg +2 -2
- package/src/assets/svgIcons/subscriptions.svg +2 -2
- package/src/assets/svgIcons/subsidies.svg +2 -2
- package/src/assets/svgIcons/switch_polarity.svg +5 -0
- package/src/assets/svgIcons/transparent_warning.svg +4 -0
- package/src/assets/svgIcons/variants.svg +2 -5
- package/src/assets/svgIcons/vdv.svg +5 -0
- package/src/assets/svgIcons/virtual_storage.svg +2 -3
- package/src/assets/svgIcons/warning_triangle.svg +3 -0
- package/src/assets/svgIcons/warning_triangle_white.svg +5 -0
- package/src/assets/theme.js +602 -25
- package/src/components/buttons/buttonIcon/index.vue +131 -28
- package/src/components/buttons/mainButton/MainButton.stories.js +13 -0
- package/src/components/buttons/mainButton/index.vue +105 -31
- package/src/components/filter/filterSettings.vue +4 -3
- package/src/components/icon/index.vue +26 -6
- package/src/components/infoCard/index.vue +12 -8
- package/src/components/infoLabel/index.vue +63 -0
- package/src/components/infoText/index.vue +176 -42
- 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 +5 -0
- package/src/components/inputs/inputText/index.vue +9 -1
- package/src/components/modals/modal/index.vue +21 -6
- package/src/components/panelRangeInfo/index.vue +196 -0
- package/src/components/projectMarker/index.vue +2 -1
- package/src/components/selectedOptions/index.vue +3 -12
- package/src/components/selectedOptions/selectedOptions.spec.js +1 -1
- package/src/components/sideMenu/index.vue +92 -48
- package/src/components/spinner/index.vue +66 -33
- package/src/components/tableDropdown/index.vue +44 -39
- package/src/components/tables/mainTable/index.vue +16 -11
- package/src/components/tabsHeader/index.vue +75 -61
- package/src/assets/svgIcons/inverter-1.svg +0 -5
- package/src/assets/svgIcons/subsidies-1.svg +0 -5
- 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>
|
@@ -163,6 +153,7 @@
|
|
163
153
|
width: auto;
|
164
154
|
max-width: 70%;
|
165
155
|
transform: translateX(-50%);
|
156
|
+
z-index: 999;
|
166
157
|
`
|
167
158
|
|
168
159
|
const CenterPageContainer = styled.div`
|
@@ -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', () => {
|
@@ -9,34 +9,54 @@
|
|
9
9
|
v-if="!item.children"
|
10
10
|
:key="idx"
|
11
11
|
:data-id="`sub_menu_settings_${item.key}`"
|
12
|
+
:fill-type="item.icon === 'free_technology' ? 'stroke' : 'fill'"
|
12
13
|
:is-active="activeTab === item.key || activeParentTab === item.key"
|
13
14
|
@click="$emit('tab-click', { activeKey: item.key })"
|
14
15
|
>
|
15
|
-
<IconContainer
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
<IconContainer :is-active="activeTab === item.key">
|
17
|
+
<Icon
|
18
|
+
:color="
|
19
|
+
activeTab === item.key ? theme.semanticColors.purple[500] : ''
|
20
|
+
"
|
21
|
+
cursor="pointer"
|
22
|
+
:fill-type="item.fillType"
|
23
|
+
:name="item.icon"
|
24
|
+
size="18px"
|
25
|
+
/>
|
19
26
|
</IconContainer>
|
20
|
-
<ListText
|
27
|
+
<ListText :is-active="activeTab === item.key">{{
|
28
|
+
$gettext(item.label)
|
29
|
+
}}</ListText>
|
21
30
|
</ListItem>
|
22
31
|
<CollapseWrapper v-else :key="idx + item.key">
|
23
32
|
<CollapseContainer
|
24
33
|
:data-id="`sub_menu_settings_${item.key}`"
|
34
|
+
:is-active="activeParentTab === item.key"
|
25
35
|
@click="toggleActiveDropdown(item.key)"
|
26
36
|
>
|
27
37
|
<IconContainer :is-active="activeParentTab === item.key">
|
28
38
|
<Icon
|
29
|
-
color="
|
39
|
+
:color="
|
40
|
+
activeParentTab === item.key
|
41
|
+
? theme.semanticColors.purple[500]
|
42
|
+
: ''
|
43
|
+
"
|
30
44
|
cursor="pointer"
|
31
45
|
:name="item.icon"
|
32
46
|
size="18px"
|
33
47
|
/>
|
34
48
|
</IconContainer>
|
35
|
-
<ListText
|
49
|
+
<ListText :is-active="activeTab === item.key">{{
|
50
|
+
$gettext(item.label)
|
51
|
+
}}</ListText>
|
36
52
|
<ArrowContainer>
|
37
53
|
<Icon
|
38
|
-
color="
|
39
|
-
:name="
|
54
|
+
:color="theme.semanticColors.grey[800]"
|
55
|
+
:name="
|
56
|
+
activeDropdown === item.key
|
57
|
+
? 'arrow_up_unfilled'
|
58
|
+
: 'arrow_down_unfilled'
|
59
|
+
"
|
40
60
|
size="10px"
|
41
61
|
/>
|
42
62
|
</ArrowContainer>
|
@@ -68,7 +88,7 @@
|
|
68
88
|
@click="$emit('on-logout')"
|
69
89
|
>
|
70
90
|
<RotateIcon
|
71
|
-
color="
|
91
|
+
:color="theme.semanticColors.teal[800]"
|
72
92
|
cursor="pointer"
|
73
93
|
name="initial_situation"
|
74
94
|
size="18px"
|
@@ -83,11 +103,11 @@
|
|
83
103
|
import styled from 'vue3-styled-components'
|
84
104
|
import Icon from '../icon'
|
85
105
|
import Spinner from '../spinner'
|
106
|
+
import theme from '@/assets/theme.js'
|
86
107
|
|
87
108
|
const PageAttrs = { isLoading: Boolean }
|
88
109
|
const PageContainer = styled('div', PageAttrs)`
|
89
|
-
background-color: ${(props) =>
|
90
|
-
props.isLoading ? props.theme.colors.white : props.theme.colors.grey6};
|
110
|
+
background-color: ${(props) => props.theme.semanticColors.grey[100]};
|
91
111
|
padding: 14px 12px;
|
92
112
|
min-width: 220px;
|
93
113
|
display: flex;
|
@@ -100,7 +120,7 @@
|
|
100
120
|
grid-gap: 6px;
|
101
121
|
`
|
102
122
|
|
103
|
-
const IconAttrs = { isActive: Boolean, isButton: Boolean }
|
123
|
+
const IconAttrs = { isActive: Boolean, isButton: Boolean, fillType: String }
|
104
124
|
|
105
125
|
const ListItem = styled('div', IconAttrs)`
|
106
126
|
display: grid;
|
@@ -109,19 +129,28 @@
|
|
109
129
|
grid-gap: 20px;
|
110
130
|
cursor: pointer;
|
111
131
|
padding: 4px;
|
112
|
-
border-radius:
|
132
|
+
border-radius: 4px;
|
113
133
|
background-color: ${(props) =>
|
114
|
-
props.isActive ?
|
134
|
+
props.isActive ? props.theme.semanticColors.purple[50] : ''};
|
135
|
+
color: ${(props) =>
|
136
|
+
props.isActive
|
137
|
+
? props.theme.semanticColors.purple[500]
|
138
|
+
: props.theme.semanticColors.teal[800]};
|
115
139
|
|
116
140
|
:hover {
|
117
|
-
background-color:
|
141
|
+
background-color: ${(props) => props.theme.semanticColors.purple[100]};
|
142
|
+
color: ${(props) => props.theme.semanticColors.purple[500]};
|
143
|
+
svg path:not(.fix) {
|
144
|
+
${(props) => props.fillType}: ${(props) =>
|
145
|
+
props.theme.semanticColors.purple[500]};
|
146
|
+
}
|
118
147
|
}
|
119
148
|
`
|
120
149
|
|
121
|
-
const
|
122
|
-
|
123
|
-
font-
|
124
|
-
|
150
|
+
const ListTextAttrs = { isActive: Boolean }
|
151
|
+
const ListText = styled('div', ListTextAttrs)`
|
152
|
+
font-size: 14px;
|
153
|
+
font-weight: 400;
|
125
154
|
`
|
126
155
|
|
127
156
|
const IconContainer = styled('div', IconAttrs)`
|
@@ -130,18 +159,16 @@
|
|
130
159
|
justify-items: center;
|
131
160
|
width: 32px;
|
132
161
|
height: 32px;
|
133
|
-
background-color: ${(props) =>
|
134
|
-
props.isActive ? props.theme.colors.red : 'rgba(255, 255, 255, 0.2)'};
|
135
162
|
border-radius: 6px;
|
136
163
|
|
137
164
|
${({ isButton = false }) =>
|
138
165
|
isButton &&
|
139
166
|
`
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
167
|
+
cursor: pointer;
|
168
|
+
&:hover {
|
169
|
+
background-color: ${(props) =>
|
170
|
+
props.theme.semanticColors.purple[100]};
|
171
|
+
`}
|
145
172
|
`
|
146
173
|
|
147
174
|
const SpinnerContainer = styled.div`
|
@@ -161,7 +188,7 @@
|
|
161
188
|
const AppVersion = styled.p`
|
162
189
|
font-size: 11px;
|
163
190
|
line-height: 13px;
|
164
|
-
color: ${(props) => props.theme.
|
191
|
+
color: ${(props) => props.theme.semanticColors.teal[800]};
|
165
192
|
margin-right: 6px;
|
166
193
|
`
|
167
194
|
|
@@ -174,30 +201,46 @@
|
|
174
201
|
cursor: pointer;
|
175
202
|
margin-left: 65px;
|
176
203
|
padding: 8px;
|
177
|
-
border-radius:
|
178
|
-
color: ${(props) =>
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
204
|
+
border-radius: 4px;
|
205
|
+
color: ${(props) =>
|
206
|
+
props.isActive
|
207
|
+
? props.theme.semanticColors.purple[500]
|
208
|
+
: props.theme.semanticColors.teal[800]};
|
209
|
+
font-weight: 400;
|
210
|
+
font-size: 14px;
|
211
|
+
background: ${(props) =>
|
212
|
+
props.isActive ? props.theme.semanticColors.purple[50] : ''};
|
185
213
|
|
186
214
|
&:hover {
|
187
|
-
background:
|
215
|
+
background: ${(props) => props.theme.semanticColors.purple[100]};
|
216
|
+
color: ${(props) => props.theme.semanticColors.purple[500]} !important;
|
188
217
|
}
|
189
218
|
`
|
190
219
|
|
191
|
-
const
|
220
|
+
const CollapseContainerAttrs = { isActive: Boolean }
|
221
|
+
const CollapseContainer = styled('div', CollapseContainerAttrs)`
|
192
222
|
display: grid;
|
193
223
|
grid-template-columns: auto 1fr auto;
|
194
224
|
grid-gap: 20px;
|
195
225
|
padding: 4px;
|
226
|
+
padding-right: 13px;
|
196
227
|
border-radius: 6px;
|
197
228
|
align-items: center;
|
198
229
|
cursor: pointer;
|
230
|
+
background: ${(props) =>
|
231
|
+
props.isActive ? props.theme.semanticColors.purple[50] : ''};
|
232
|
+
|
233
|
+
div {
|
234
|
+
color: ${(props) =>
|
235
|
+
props.isActive ? props.theme.semanticColors.purple[500] : ''};
|
236
|
+
}
|
237
|
+
|
199
238
|
&:hover {
|
200
|
-
background:
|
239
|
+
background: ${(props) => props.theme.semanticColors.purple[100]};
|
240
|
+
color: ${(props) => props.theme.semanticColors.purple[500]};
|
241
|
+
svg path:not(.fix) {
|
242
|
+
fill: ${(props) => props.theme.semanticColors.purple[500]};
|
243
|
+
}
|
201
244
|
}
|
202
245
|
`
|
203
246
|
|
@@ -254,17 +297,9 @@
|
|
254
297
|
data() {
|
255
298
|
return {
|
256
299
|
activeDropdown: null,
|
300
|
+
theme,
|
257
301
|
}
|
258
302
|
},
|
259
|
-
methods: {
|
260
|
-
toggleActiveDropdown(value) {
|
261
|
-
if (this.activeDropdown === value) {
|
262
|
-
this.activeDropdown = null
|
263
|
-
} else {
|
264
|
-
this.activeDropdown = value
|
265
|
-
}
|
266
|
-
},
|
267
|
-
},
|
268
303
|
watch: {
|
269
304
|
activeTab: {
|
270
305
|
// once active tab is received, check if any parent
|
@@ -277,5 +312,14 @@
|
|
277
312
|
once: true,
|
278
313
|
},
|
279
314
|
},
|
315
|
+
methods: {
|
316
|
+
toggleActiveDropdown(value) {
|
317
|
+
if (this.activeDropdown === value) {
|
318
|
+
this.activeDropdown = null
|
319
|
+
} else {
|
320
|
+
this.activeDropdown = value
|
321
|
+
}
|
322
|
+
},
|
323
|
+
},
|
280
324
|
}
|
281
325
|
</script>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<template>
|
2
|
-
<SpinnerContainer
|
2
|
+
<SpinnerContainer
|
3
|
+
v-if="fullWidth"
|
4
|
+
data-test-id="spinner_full_container"
|
5
|
+
:size="size"
|
6
|
+
>
|
3
7
|
<Container>
|
4
|
-
<SpinnerWrapper data-test-id="spinner_full_wrapper">
|
5
|
-
<
|
6
|
-
:class="{ white: isWhite }"
|
7
|
-
data-test-id="spinner_full_icon"
|
8
|
-
:style="{ width: size, height: size }"
|
9
|
-
/>
|
8
|
+
<SpinnerWrapper data-test-id="spinner_full_wrapper" :size="size">
|
9
|
+
<SpinnerCircle :is-white="isWhite" :size="size" />
|
10
10
|
</SpinnerWrapper>
|
11
11
|
</Container>
|
12
12
|
</SpinnerContainer>
|
@@ -15,21 +15,14 @@
|
|
15
15
|
data-test-id="spinner_container"
|
16
16
|
:limited-to-modal="limitedToModal"
|
17
17
|
>
|
18
|
-
<SpinnerWrapper data-test-id="spinner_wrapper">
|
19
|
-
<
|
20
|
-
:class="{ white: isWhite }"
|
21
|
-
data-test-id="spinner_icon"
|
22
|
-
:style="{ width: size, height: size }"
|
23
|
-
/>
|
18
|
+
<SpinnerWrapper data-test-id="spinner_wrapper" :size="size">
|
19
|
+
<SpinnerCircle :is-white="isWhite" :size="size" />
|
24
20
|
</SpinnerWrapper>
|
25
21
|
</Container>
|
26
22
|
</template>
|
27
23
|
|
28
24
|
<script>
|
29
|
-
// import Spinner from "@eturnity/eturnity_reusable_components/src/components/spinner"
|
30
|
-
// <spinner size="30px" />
|
31
25
|
import styled from 'vue3-styled-components'
|
32
|
-
import SpinnerSvg from '../../assets/icons/black_spinner.svg'
|
33
26
|
|
34
27
|
const SpinnerContainer = styled.div`
|
35
28
|
position: fixed;
|
@@ -43,35 +36,80 @@
|
|
43
36
|
justify-items: center;
|
44
37
|
z-index: 100;
|
45
38
|
`
|
39
|
+
|
46
40
|
const containerAttrs = { limitedToModal: Boolean }
|
47
41
|
const Container = styled('div', containerAttrs)`
|
48
42
|
display: grid;
|
49
43
|
align-items: center;
|
50
44
|
justify-items: center;
|
51
45
|
position: ${(props) => (props.limitedToModal ? 'absolute' : 'inherit')};
|
52
|
-
height:
|
53
|
-
width:
|
46
|
+
height: 100%;
|
47
|
+
width: 100%;
|
48
|
+
`
|
49
|
+
|
50
|
+
const wrapperAttrs = { size: String }
|
51
|
+
const SpinnerWrapper = styled('div', wrapperAttrs)`
|
52
|
+
width: ${(props) => getSpinnerSize(props.size)};
|
53
|
+
height: ${(props) => getSpinnerSize(props.size)};
|
54
54
|
`
|
55
55
|
|
56
|
-
const
|
57
|
-
|
58
|
-
|
56
|
+
const getSpinnerSize = (size) => {
|
57
|
+
switch (size) {
|
58
|
+
case 'small':
|
59
|
+
return '24px'
|
60
|
+
case 'large':
|
61
|
+
return '56px'
|
62
|
+
case 'medium':
|
63
|
+
default:
|
64
|
+
return '40px'
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
const circleAttrs = { size: String, isWhite: Boolean }
|
69
|
+
const SpinnerCircle = styled('div', circleAttrs)`
|
70
|
+
width: 100%;
|
71
|
+
height: 100%;
|
72
|
+
border-radius: 100%;
|
73
|
+
border: ${(props) => (props.size === 'large' ? '4px' : '2px')} solid
|
74
|
+
${(props) =>
|
75
|
+
props.isWhite ? props.theme.colors.grey5 : props.theme.colors.white};
|
76
|
+
border-top-color: ${(props) =>
|
77
|
+
props.isWhite
|
78
|
+
? props.theme.colors.white
|
79
|
+
: props.theme.semanticColors.purple[500]};
|
80
|
+
border-right-color: ${(props) =>
|
81
|
+
props.isWhite
|
82
|
+
? props.theme.colors.white
|
83
|
+
: props.theme.semanticColors.purple[500]};
|
84
|
+
border-bottom-color: ${(props) =>
|
85
|
+
props.isWhite
|
86
|
+
? props.theme.colors.white
|
87
|
+
: props.theme.semanticColors.purple[500]};
|
88
|
+
animation: spin 1s linear infinite;
|
89
|
+
transform: rotate(90deg);
|
59
90
|
|
60
|
-
|
61
|
-
|
91
|
+
@keyframes spin {
|
92
|
+
to {
|
93
|
+
transform: rotate(450deg);
|
94
|
+
}
|
62
95
|
}
|
63
96
|
`
|
64
97
|
|
65
98
|
export default {
|
66
|
-
name: '
|
99
|
+
name: 'NewSpinner',
|
67
100
|
components: {
|
101
|
+
SpinnerContainer,
|
102
|
+
SpinnerCircle,
|
68
103
|
Container,
|
69
104
|
SpinnerWrapper,
|
70
|
-
SpinnerContainer,
|
71
|
-
SpinnerSvg,
|
72
105
|
},
|
73
106
|
props: {
|
74
|
-
|
107
|
+
size: {
|
108
|
+
type: String,
|
109
|
+
default: 'medium',
|
110
|
+
validator: (value) => ['small', 'medium', 'large'].includes(value),
|
111
|
+
},
|
112
|
+
isWhite: {
|
75
113
|
required: false,
|
76
114
|
default: false,
|
77
115
|
type: Boolean,
|
@@ -81,12 +119,7 @@
|
|
81
119
|
default: false,
|
82
120
|
type: Boolean,
|
83
121
|
},
|
84
|
-
|
85
|
-
required: false,
|
86
|
-
default: '60px',
|
87
|
-
type: String,
|
88
|
-
},
|
89
|
-
isWhite: {
|
122
|
+
fullWidth: {
|
90
123
|
required: false,
|
91
124
|
default: false,
|
92
125
|
type: Boolean,
|