@eturnity/eturnity_reusable_components 8.7.5-EPIC-8593 → 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 +1 -1
- package/src/App.vue +6 -6
- package/src/assets/svgIcons/add_icon-1.svg +2 -2
- 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/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/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/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/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/variants.svg +2 -5
- package/src/assets/svgIcons/vdv.svg +5 -0
- package/src/assets/svgIcons/virtual_storage.svg +2 -3
- package/src/assets/theme.js +594 -29
- package/src/components/buttons/buttonIcon/index.vue +110 -32
- package/src/components/buttons/mainButton/index.vue +74 -42
- 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/infoText/index.vue +9 -5
- package/src/components/inputs/inputNumber/index.vue +5 -0
- package/src/components/inputs/inputText/index.vue +6 -0
- package/src/components/modals/modal/index.vue +10 -5
- package/src/components/projectMarker/index.vue +2 -1
- package/src/components/selectedOptions/index.vue +1 -0
- package/src/components/sideMenu/index.vue +92 -48
- package/src/components/spinner/index.vue +66 -33
- package/src/components/tableDropdown/index.vue +40 -33
- package/src/components/tables/mainTable/index.vue +16 -11
- package/src/assets/svgIcons/inverter-1.svg +0 -5
- package/src/assets/svgIcons/subsidies-1.svg +0 -5
@@ -21,6 +21,7 @@
|
|
21
21
|
<InfoText
|
22
22
|
v-if="infoTextMessage != ''"
|
23
23
|
:align-arrow="infoTextAlign"
|
24
|
+
:app-theme="appTheme"
|
24
25
|
data-test-id="info_text_message"
|
25
26
|
:size="fontSize ? fontSize : '16px'"
|
26
27
|
:text="infoTextMessage"
|
@@ -263,6 +264,11 @@
|
|
263
264
|
default: '',
|
264
265
|
type: String,
|
265
266
|
},
|
267
|
+
appTheme: {
|
268
|
+
type: String,
|
269
|
+
required: false,
|
270
|
+
default: 'light',
|
271
|
+
},
|
266
272
|
alignItems: {
|
267
273
|
required: false,
|
268
274
|
default: 'horizontal',
|
@@ -8,14 +8,19 @@
|
|
8
8
|
>
|
9
9
|
<ModalContainer
|
10
10
|
v-if="isOpen"
|
11
|
+
:is-loading="isLoading"
|
11
12
|
:overflow="overflowRule"
|
12
13
|
@click="onClickModalContainer"
|
13
14
|
>
|
14
15
|
<Spinner v-if="isLoading" :limited-to-modal="true" size="50px" />
|
15
|
-
<ContentContainer
|
16
|
+
<ContentContainer v-if="!isLoading">
|
16
17
|
<slot></slot>
|
17
18
|
</ContentContainer>
|
18
|
-
<CloseButton
|
19
|
+
<CloseButton
|
20
|
+
v-if="!hideClose && !isLoading"
|
21
|
+
class="close"
|
22
|
+
@click="onCloseModal()"
|
23
|
+
/>
|
19
24
|
</ModalContainer>
|
20
25
|
</PageWrapper>
|
21
26
|
</template>
|
@@ -62,7 +67,7 @@
|
|
62
67
|
}
|
63
68
|
`
|
64
69
|
|
65
|
-
const modalContainerAttrs = { overflow: String }
|
70
|
+
const modalContainerAttrs = { overflow: String, isLoading: Boolean }
|
66
71
|
const ModalContainer = styled('div', modalContainerAttrs)`
|
67
72
|
align-self: center;
|
68
73
|
justify-self: center;
|
@@ -74,8 +79,8 @@
|
|
74
79
|
overflow: ${(props) => props.overflow};
|
75
80
|
max-width: 95%;
|
76
81
|
max-height: 95%;
|
77
|
-
min-width: 100px;
|
78
|
-
min-height: 100px;
|
82
|
+
min-width: ${(props) => (props.isLoading ? '400px' : '100px')};
|
83
|
+
min-height: ${(props) => (props.isLoading ? '500px' : '100px')};
|
79
84
|
|
80
85
|
::-webkit-scrollbar {
|
81
86
|
width: 0.3em;
|
@@ -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,
|
@@ -25,18 +25,22 @@
|
|
25
25
|
item.type === 'template')
|
26
26
|
"
|
27
27
|
/>
|
28
|
-
<
|
28
|
+
<TemplateItem
|
29
29
|
v-if="
|
30
30
|
item.type &&
|
31
31
|
item.type === 'template' &&
|
32
32
|
(item.value === '' || item.value === '-')
|
33
33
|
"
|
34
34
|
:key="index + '_button'"
|
35
|
-
:show-archived="showArchived"
|
36
|
-
@click.stop="onTemplateClick(item.row)"
|
37
35
|
>
|
38
|
-
|
39
|
-
|
36
|
+
<MainButton
|
37
|
+
button-size="small"
|
38
|
+
:text="$gettext('Use template...')"
|
39
|
+
type="secondary"
|
40
|
+
:variant="showArchived ? 'cancel' : 'main'"
|
41
|
+
@click.stop="onTemplateClick(item.row)"
|
42
|
+
/>
|
43
|
+
</TemplateItem>
|
40
44
|
<TemplateLink
|
41
45
|
v-else-if="
|
42
46
|
item.type && item.type === 'template' && item.value !== ''
|
@@ -68,7 +72,7 @@
|
|
68
72
|
class="input-placeholder"
|
69
73
|
:show-archived="showArchived"
|
70
74
|
>
|
71
|
-
<
|
75
|
+
<TableItem> {{ item.value }}</TableItem>
|
72
76
|
</TextContainer>
|
73
77
|
<InputText
|
74
78
|
v-else
|
@@ -89,7 +93,7 @@
|
|
89
93
|
"
|
90
94
|
:show-archived="showArchived"
|
91
95
|
>
|
92
|
-
<
|
96
|
+
<TableItem> {{ item.value }}</TableItem>
|
93
97
|
</TextContainer>
|
94
98
|
</NestedContainer>
|
95
99
|
</ComponentItem>
|
@@ -97,7 +101,7 @@
|
|
97
101
|
<ArrowWrapper :show-archived="showArchived">
|
98
102
|
<InfoWrapper v-if="showArchived">
|
99
103
|
<InfoText
|
100
|
-
|
104
|
+
button-type="error"
|
101
105
|
:text="
|
102
106
|
$gettext(`Component has been archived and shouldn't be used`)
|
103
107
|
"
|
@@ -121,7 +125,7 @@
|
|
121
125
|
@on-change="onSearch($event)"
|
122
126
|
/>
|
123
127
|
</SearchContainer>
|
124
|
-
<Spinner v-if="optionsLoading" />
|
128
|
+
<Spinner v-if="optionsLoading" size="small" />
|
125
129
|
<EmptyText v-else-if="!optionsLoading && !optionItems.length">
|
126
130
|
{{ emptyText ? emptyText : $gettext('No components found.') }}
|
127
131
|
</EmptyText>
|
@@ -136,15 +140,19 @@
|
|
136
140
|
@keyup.enter="onItemClick(item)"
|
137
141
|
>
|
138
142
|
<template v-for="(option, idx) in optionsDisplay" :key="idx">
|
139
|
-
<
|
143
|
+
<DropdownItem v-if="option !== 'template'">
|
140
144
|
{{ !!item[option] ? item[option] : '-' }}
|
141
|
-
</
|
142
|
-
<
|
145
|
+
</DropdownItem>
|
146
|
+
<TemplateItem
|
143
147
|
v-else-if="option === 'template' && item.has_template"
|
144
|
-
@click.stop="onTemplateClick(item)"
|
145
148
|
>
|
146
|
-
|
147
|
-
|
149
|
+
<MainButton
|
150
|
+
button-size="small"
|
151
|
+
:text="$gettext('Use template...')"
|
152
|
+
type="secondary"
|
153
|
+
@click.stop="onTemplateClick(item)"
|
154
|
+
/>
|
155
|
+
</TemplateItem>
|
148
156
|
<NoTemplate
|
149
157
|
v-else-if="option === 'template' && !item.has_template"
|
150
158
|
>
|
@@ -198,6 +206,7 @@
|
|
198
206
|
import Icon from '../icon'
|
199
207
|
import theme from '@/assets/theme.js'
|
200
208
|
import InfoText from '../infoText'
|
209
|
+
import MainButton from '../buttons/mainButton'
|
201
210
|
|
202
211
|
const rowAttrs = { disabled: Boolean, isOpen: Boolean }
|
203
212
|
const DropdownRow = styled('div', rowAttrs)`
|
@@ -210,7 +219,7 @@
|
|
210
219
|
|
211
220
|
.input-placeholder {
|
212
221
|
height: 25px;
|
213
|
-
|
222
|
+
margin-left: -2px;
|
214
223
|
}
|
215
224
|
`
|
216
225
|
|
@@ -234,13 +243,19 @@
|
|
234
243
|
padding: 8px 0 10px 0 !important;
|
235
244
|
}
|
236
245
|
}
|
237
|
-
|
238
|
-
span {
|
239
|
-
padding-left: 15px;
|
240
|
-
}
|
241
246
|
}
|
242
247
|
`
|
243
248
|
|
249
|
+
const TableItem = styled.span`
|
250
|
+
padding-left: 15px;
|
251
|
+
`
|
252
|
+
|
253
|
+
const TemplateItem = styled.span`
|
254
|
+
padding-left: 15px;
|
255
|
+
`
|
256
|
+
|
257
|
+
const DropdownItem = styled.span``
|
258
|
+
|
244
259
|
const containerAttrs = { colSpan: Number, width: String }
|
245
260
|
const ComponentContainer = styled('div', containerAttrs)`
|
246
261
|
display: contents;
|
@@ -356,17 +371,6 @@
|
|
356
371
|
`
|
357
372
|
|
358
373
|
const templateAttrs = { showArchived: Boolean }
|
359
|
-
const TemplateButton = styled('div', templateAttrs)`
|
360
|
-
cursor: pointer;
|
361
|
-
background-color: #263238;
|
362
|
-
color: ${(props) =>
|
363
|
-
props.showArchived ? props.theme.colors.red : props.theme.colors.white};
|
364
|
-
padding: 4px 10px;
|
365
|
-
display: inline-block;
|
366
|
-
border-radius: 4px;
|
367
|
-
text-align: center;
|
368
|
-
margin-left: 15px;
|
369
|
-
`
|
370
374
|
|
371
375
|
const NoTemplate = styled('div', templateAttrs)`
|
372
376
|
color: ${(props) =>
|
@@ -392,7 +396,7 @@
|
|
392
396
|
const inputContainerAttrs = { hasMessage: Boolean }
|
393
397
|
const InputContainer = styled('div', inputContainerAttrs)`
|
394
398
|
margin-left: ${(props) => (props.hasMessage ? '10px' : '0')};
|
395
|
-
display:
|
399
|
+
display: block;
|
396
400
|
align-items: center;
|
397
401
|
justify-content: flex-start;
|
398
402
|
|
@@ -466,7 +470,7 @@
|
|
466
470
|
OptionsWrapper,
|
467
471
|
OptionsItem,
|
468
472
|
SearchContainer,
|
469
|
-
|
473
|
+
MainButton,
|
470
474
|
NoTemplate,
|
471
475
|
TemplateLink,
|
472
476
|
InputText,
|
@@ -481,6 +485,9 @@
|
|
481
485
|
Icon,
|
482
486
|
InfoText,
|
483
487
|
InfoWrapper,
|
488
|
+
TableItem,
|
489
|
+
TemplateItem,
|
490
|
+
DropdownItem,
|
484
491
|
},
|
485
492
|
props: {
|
486
493
|
colSpan: {
|