@eturnity/eturnity_reusable_components 7.51.16-EPDM-9631.0 → 7.51.16-qa-04-deploy.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 +1 -1
- package/src/assets/svgIcons/solarmarkt.svg +3 -0
- package/src/assets/theme.js +1 -0
- package/src/components/infoCard/InfoCard.stories.js +33 -7
- package/src/components/infoCard/index.vue +13 -1
- package/src/components/infoCard/infoCard.spec.js +8 -0
- package/src/components/sideMenu/index.vue +12 -3
package/package.json
CHANGED
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="26" height="26" viewBox="0 0 19 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.947 24.9C4.1 24.9 1.308 23.24.1 19.773c-.141-.389-.148-.542.1-.649l3.457-1.791c.218-.11.292-.1.393.177a4.731 4.731 0 0 0 4.8 3.039c2.459-.044 4.162-.874 4.162-2.5 0-1.448-1.574-3.046-4.849-3.42-.259-.027-.577-.06-.858-.1C3.8 13.986.871 11.979.737 7.921c-.151-4.6 2.4-7.81 8.708-7.81 4.735 0 7.455 2.236 8.582 5.194.142.378-.038.532-.251.6l-3.955 1.623c-.249.106-.348.029-.416-.147-.544-1.418-1.642-3.339-4.2-3.224-2.6.121-3.633 1.159-3.862 2.706-.316 2.128 1.568 3.117 5.1 3.527.318.035.711.106 1.175.176 4.558.636 6.967 3.083 6.967 6.768 0 5.446-4.047 7.564-9.637 7.564" fill="white"/>
|
3
|
+
</svg>
|
package/src/assets/theme.js
CHANGED
@@ -16,7 +16,18 @@ export default {
|
|
16
16
|
description: '',
|
17
17
|
},
|
18
18
|
color: {
|
19
|
-
description: 'Color of text
|
19
|
+
description: 'Color of the text (can overwrite preset styles)',
|
20
|
+
control: {
|
21
|
+
type: 'color',
|
22
|
+
presetColors: [
|
23
|
+
theme.colors.grey3,
|
24
|
+
theme.colors.grey4,
|
25
|
+
theme.colors.red,
|
26
|
+
],
|
27
|
+
},
|
28
|
+
},
|
29
|
+
iconColor: {
|
30
|
+
description: 'Color of the icon (can overwrite preset styles)',
|
20
31
|
control: {
|
21
32
|
type: 'color',
|
22
33
|
presetColors: [
|
@@ -97,6 +108,12 @@ InfoCardTypeWarning.args = {
|
|
97
108
|
type: 'warning',
|
98
109
|
}
|
99
110
|
|
111
|
+
export const InfoCardTypeErrorMinor = Template.bind({})
|
112
|
+
InfoCardTypeErrorMinor.args = {
|
113
|
+
...defaultInfoCardProps,
|
114
|
+
type: 'error_minor',
|
115
|
+
}
|
116
|
+
|
100
117
|
export const InfoCardTypeInfoMinWidth = Template.bind({})
|
101
118
|
InfoCardTypeInfoMinWidth.args = {
|
102
119
|
...defaultInfoCardProps,
|
@@ -108,7 +125,14 @@ export const InfoCardTypeInfoColorOverwritten = Template.bind({})
|
|
108
125
|
InfoCardTypeInfoColorOverwritten.args = {
|
109
126
|
...defaultInfoCardProps,
|
110
127
|
|
111
|
-
color: theme.colors.
|
128
|
+
color: theme.colors.green,
|
129
|
+
}
|
130
|
+
|
131
|
+
export const InfoCardTypeInfoIconColorOverwritten = Template.bind({})
|
132
|
+
InfoCardTypeInfoIconColorOverwritten.args = {
|
133
|
+
...defaultInfoCardProps,
|
134
|
+
|
135
|
+
iconColor: theme.colors.green,
|
112
136
|
}
|
113
137
|
|
114
138
|
export const InfoCardTypeWarningAlignItemsOverwritten = Template.bind({})
|
@@ -129,16 +153,18 @@ InfoCardTypeWarningPaddingOverwritten.args = {
|
|
129
153
|
padding: '50px',
|
130
154
|
}
|
131
155
|
|
132
|
-
export const
|
133
|
-
|
156
|
+
export const InfoCardTypeErrorMinorBorderColorOverwritten = Template.bind({})
|
157
|
+
InfoCardTypeErrorMinorBorderColorOverwritten.args = {
|
134
158
|
...defaultInfoCardProps,
|
159
|
+
type: 'error_minor',
|
135
160
|
|
136
|
-
borderColor: theme.colors.
|
161
|
+
borderColor: theme.colors.green,
|
137
162
|
}
|
138
163
|
|
139
|
-
export const
|
140
|
-
|
164
|
+
export const InfoCardTypeErrorMinorBorderStyleOverwritten = Template.bind({})
|
165
|
+
InfoCardTypeErrorMinorBorderStyleOverwritten.args = {
|
141
166
|
...defaultInfoCardProps,
|
167
|
+
type: 'error_minor',
|
142
168
|
|
143
169
|
borderStyle: 'solid none',
|
144
170
|
}
|
@@ -10,7 +10,7 @@
|
|
10
10
|
:preset-styles="presetStyles"
|
11
11
|
>
|
12
12
|
<RCIcon
|
13
|
-
:color="
|
13
|
+
:color="iconColor ? iconColor : presetStyles.iconColor"
|
14
14
|
data-test-id="info_card_icon"
|
15
15
|
name="info"
|
16
16
|
size="24px"
|
@@ -79,6 +79,11 @@
|
|
79
79
|
type: String,
|
80
80
|
default: '',
|
81
81
|
},
|
82
|
+
iconColor: {
|
83
|
+
required: false,
|
84
|
+
type: String,
|
85
|
+
default: '',
|
86
|
+
},
|
82
87
|
color: {
|
83
88
|
required: false,
|
84
89
|
type: String,
|
@@ -113,6 +118,9 @@
|
|
113
118
|
isWarning() {
|
114
119
|
return this.type === 'warning'
|
115
120
|
},
|
121
|
+
isErrorMinor() {
|
122
|
+
return this.type === 'error_minor'
|
123
|
+
},
|
116
124
|
presetStyles() {
|
117
125
|
// the types that doesn't have explicit border anyway have it transparent
|
118
126
|
// to avoid flickering in case the same info card would switch the types
|
@@ -128,6 +136,10 @@
|
|
128
136
|
stylesCollection.color = theme.colors.white
|
129
137
|
stylesCollection.backgroundColor = theme.colors.yellow
|
130
138
|
stylesCollection.iconColor = theme.colors.white
|
139
|
+
} else if (this.isErrorMinor) {
|
140
|
+
stylesCollection.borderStyle = 'dashed'
|
141
|
+
stylesCollection.borderColor = theme.colors.pureRed
|
142
|
+
stylesCollection.iconColor = theme.colors.pureRed
|
131
143
|
} else {
|
132
144
|
stylesCollection.borderStyle = 'dashed'
|
133
145
|
stylesCollection.borderColor = theme.colors.grey4
|
@@ -47,10 +47,18 @@ describe('RCInfoCard.vue', () => {
|
|
47
47
|
|
48
48
|
expect(wrapper.vm.isInfo).toBe(true)
|
49
49
|
expect(wrapper.vm.isWarning).toBe(false)
|
50
|
+
expect(wrapper.vm.isErrorMinor).toBe(false)
|
50
51
|
|
51
52
|
await wrapper.setProps({ type: 'warning' })
|
52
53
|
|
53
54
|
expect(wrapper.vm.isInfo).toBe(false)
|
54
55
|
expect(wrapper.vm.isWarning).toBe(true)
|
56
|
+
expect(wrapper.vm.isErrorMinor).toBe(false)
|
57
|
+
|
58
|
+
await wrapper.setProps({ type: 'error_minor' })
|
59
|
+
|
60
|
+
expect(wrapper.vm.isInfo).toBe(false)
|
61
|
+
expect(wrapper.vm.isWarning).toBe(false)
|
62
|
+
expect(wrapper.vm.isErrorMinor).toBe(true)
|
55
63
|
})
|
56
64
|
})
|
@@ -254,9 +254,6 @@
|
|
254
254
|
activeDropdown: null,
|
255
255
|
}
|
256
256
|
},
|
257
|
-
mounted() {
|
258
|
-
this.activeDropdown = this.activeParentTab
|
259
|
-
},
|
260
257
|
methods: {
|
261
258
|
toggleActiveDropdown(value) {
|
262
259
|
if (this.activeDropdown === value) {
|
@@ -266,5 +263,17 @@
|
|
266
263
|
}
|
267
264
|
},
|
268
265
|
},
|
266
|
+
watch: {
|
267
|
+
activeTab: {
|
268
|
+
// once active tab is received, check if any parent
|
269
|
+
// tab is active and if so open according dropdown
|
270
|
+
handler() {
|
271
|
+
if (this.activeParentTab) {
|
272
|
+
this.activeDropdown = this.activeParentTab
|
273
|
+
}
|
274
|
+
},
|
275
|
+
once: true,
|
276
|
+
},
|
277
|
+
},
|
269
278
|
}
|
270
279
|
</script>
|