@eturnity/eturnity_reusable_components 6.37.0-EPDM-8148.6 → 6.37.0-EPDM-2198.1
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 +42 -181
- package/src/assets/svgIcons/charger_icon_white.svg +44 -0
- package/src/assets/svgIcons/collections.svg +3 -0
- package/src/assets/svgIcons/dashboard.svg +3 -0
- package/src/assets/svgIcons/energy_meter.svg +12 -0
- package/src/assets/svgIcons/erase.svg +1 -1
- package/src/assets/svgIcons/expand.svg +1 -0
- package/src/assets/svgIcons/logout.svg +3 -0
- package/src/assets/svgIcons/split.svg +94 -0
- package/src/assets/svgIcons/subscriptions.svg +3 -0
- package/src/assets/theme.js +3 -0
- package/src/components/addNewButton/index.vue +12 -8
- package/src/components/buttons/mainButton/index.vue +35 -23
- package/src/components/card/index.vue +95 -0
- package/src/components/draggableInputHandle/index.vue +47 -0
- package/src/components/errorMessage/index.vue +1 -3
- package/src/components/filter/filterSettings.vue +15 -10
- package/src/components/filter/index.vue +12 -1
- package/src/components/icon/iconCollection.vue +5 -5
- package/src/components/icon/index.vue +10 -2
- package/src/components/iconWrapper/index.vue +17 -12
- package/src/components/infoCard/index.vue +36 -0
- package/src/components/infoText/index.vue +2 -12
- package/src/components/inputs/checkbox/index.vue +5 -0
- package/src/components/inputs/inputNumber/index.vue +48 -17
- package/src/components/inputs/inputText/index.vue +24 -5
- package/src/components/inputs/radioButton/index.vue +66 -49
- package/src/components/inputs/searchInput/index.vue +6 -0
- package/src/components/inputs/select/index.vue +138 -68
- package/src/components/inputs/select/option/index.vue +15 -2
- package/src/components/inputs/switchField/index.vue +7 -11
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +0 -8
- package/src/components/inputs/textAreaInput/index.vue +12 -7
- package/src/components/inputs/toggle/index.vue +82 -82
- package/src/components/label/index.vue +103 -0
- package/src/components/modals/modal/index.vue +46 -13
- package/src/components/navigationTabs/index.vue +105 -0
- package/src/components/pageSubtitle/index.vue +1 -8
- package/src/components/pageTitle/index.vue +32 -4
- package/src/components/pagination/index.vue +136 -129
- package/src/components/projectMarker/index.vue +39 -33
- package/src/components/sideMenu/index.vue +270 -0
- package/src/components/tables/mainTable/index.vue +3 -3
- package/src/components/threeDots/index.vue +31 -22
- package/src/helpers/numberConverter.js +4 -2
- package/src/helpers/translateLang.js +9 -1
@@ -1,5 +1,14 @@
|
|
1
1
|
<template>
|
2
|
-
<title-
|
2
|
+
<title-wrap :hasInfoText="!!infoText">
|
3
|
+
<title-text :color="color" :fontSize="fontSize" :uppercase="uppercase">
|
4
|
+
{{ text }}
|
5
|
+
</title-text>
|
6
|
+
<info-text
|
7
|
+
v-if="!!infoText"
|
8
|
+
:text="infoText"
|
9
|
+
:alignArrow="infoAlign"
|
10
|
+
/>
|
11
|
+
</title-wrap>
|
3
12
|
</template>
|
4
13
|
|
5
14
|
<script>
|
@@ -10,20 +19,32 @@
|
|
10
19
|
// color="red"
|
11
20
|
// />
|
12
21
|
import styled from "vue-styled-components"
|
22
|
+
import InfoText from "../infoText"
|
13
23
|
|
14
|
-
const
|
15
|
-
const
|
24
|
+
const wrapAttrs = { hasInfoText: Boolean }
|
25
|
+
const TitleWrap = styled("div", wrapAttrs)`
|
26
|
+
display: grid;
|
27
|
+
align-items: center;
|
28
|
+
grid-gap: 12px;
|
29
|
+
grid-template-columns: ${(props) =>
|
30
|
+
props.hasInfoText ? "auto auto 1fr" : "1fr"};
|
31
|
+
margin-bottom: 20px;
|
32
|
+
`
|
33
|
+
|
34
|
+
const titleAttrs = { color: String, fontSize: String, uppercase: Boolean }
|
35
|
+
const TitleText = styled('span', titleAttrs)`
|
16
36
|
color: ${(props) => (props.color ? props.color : props.theme.colors.black)};
|
17
37
|
font-weight: bold;
|
18
38
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
19
39
|
text-transform: ${(props) => (props.uppercase ? 'uppercase' : 'none')};
|
20
|
-
margin-bottom: 20px;
|
21
40
|
`
|
22
41
|
|
23
42
|
export default {
|
24
43
|
name: "page-title",
|
25
44
|
components: {
|
26
45
|
TitleText,
|
46
|
+
TitleWrap,
|
47
|
+
InfoText
|
27
48
|
},
|
28
49
|
props: {
|
29
50
|
text: {
|
@@ -39,6 +60,13 @@ export default {
|
|
39
60
|
uppercase: {
|
40
61
|
required: false,
|
41
62
|
default: true
|
63
|
+
},
|
64
|
+
infoText: {
|
65
|
+
required: false,
|
66
|
+
default: null,
|
67
|
+
},
|
68
|
+
infoAlign: {
|
69
|
+
required: false,
|
42
70
|
}
|
43
71
|
},
|
44
72
|
}
|
@@ -1,137 +1,144 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
>
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
2
|
+
<!-- Check, if pages more than 1 -->
|
3
|
+
<paginationWrapper v-if="paginationParams.pages > 1">
|
4
|
+
<!-- Back button -->
|
5
|
+
<paginationLink
|
6
|
+
v-if="paginationParams.previous"
|
7
|
+
@click="fetchPage(paginationParams.previous)"
|
8
|
+
>
|
9
|
+
<arrowIconContainer>
|
10
|
+
<icon
|
11
|
+
name="arrow_left"
|
12
|
+
:color="getTheme.colors.brightBlue"
|
13
|
+
size="12px"
|
14
|
+
/>
|
15
|
+
</arrowIconContainer>
|
16
|
+
<arrowText>{{ $gettext('back') }}</arrowText>
|
17
|
+
</paginationLink>
|
18
|
+
|
19
|
+
<!-- First page -->
|
20
|
+
<paginationLink
|
21
|
+
v-if="currentPage > 2 && paginationParams.pages > 3"
|
22
|
+
@click="fetchPage(1)"
|
23
|
+
>1</paginationLink
|
24
|
+
>
|
25
|
+
|
26
|
+
<!-- Back tree dots -->
|
27
|
+
<span v-if="currentPage > 3 && paginationParams.pages > 4">...</span>
|
28
|
+
|
29
|
+
<!-- Current block -->
|
30
|
+
<paginationLink
|
31
|
+
v-for="number in paginationNumbers()"
|
32
|
+
:key="number"
|
33
|
+
:class="[currentPage === number ? 'active' : '']"
|
34
|
+
@click="fetchPage(number)"
|
35
|
+
>{{ number }}</paginationLink
|
36
|
+
>
|
37
|
+
|
38
|
+
<!-- Forward tree dots -->
|
39
|
+
<span
|
40
|
+
v-if="
|
41
|
+
paginationParams.pages - currentPage > 2 && paginationParams.pages > 4
|
42
|
+
"
|
43
|
+
>...</span
|
44
|
+
>
|
45
|
+
|
46
|
+
<!-- End page -->
|
47
|
+
<paginationLink
|
48
|
+
v-if="
|
49
|
+
paginationParams.pages - currentPage > 1 && paginationParams.pages > 3
|
50
|
+
"
|
51
|
+
@click="fetchPage(paginationParams.pages)"
|
52
|
+
>{{ paginationParams.pages }}</paginationLink
|
53
|
+
>
|
54
|
+
|
55
|
+
<!-- Forward button -->
|
56
|
+
<paginationLink
|
57
|
+
v-if="paginationParams.next"
|
58
|
+
@click="fetchPage(paginationParams.next)"
|
59
|
+
>
|
60
|
+
<arrowText>{{ $gettext('forward') }}</arrowText>
|
61
|
+
<arrowIconContainer>
|
62
|
+
<icon
|
63
|
+
name="arrow_right"
|
64
|
+
:color="getTheme.colors.brightBlue"
|
65
|
+
size="12px"
|
66
|
+
/>
|
67
|
+
</arrowIconContainer>
|
68
|
+
</paginationLink>
|
69
|
+
</paginationWrapper>
|
70
|
+
</template>
|
71
|
+
|
72
|
+
<script>
|
73
|
+
import styled from 'vue-styled-components'
|
74
|
+
import icon from '../icon'
|
75
|
+
import theme from '@/assets/theme.js'
|
76
|
+
|
77
|
+
const paginationWrapper = styled.nav`
|
78
|
+
color: ${(props) => props.theme.brightBlue};
|
79
|
+
font-size: 13px;
|
80
|
+
display: flex;
|
81
|
+
flex-wrap: wrap;
|
82
|
+
justify-content: flex-end;
|
83
|
+
align-items: center;
|
84
|
+
margin-bottom: 2px;
|
85
|
+
margin-top: 10px;
|
83
86
|
`
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
87
|
+
const paginationLink = styled.div`
|
88
|
+
display: flex;
|
89
|
+
padding: 0px 5px;
|
90
|
+
margin: 0 2px;
|
91
|
+
text-align: center;
|
92
|
+
border-radius: 3px;
|
93
|
+
white-space: nowrap;
|
94
|
+
cursor: pointer;
|
92
95
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
96
|
+
&.active {
|
97
|
+
color: #fff;
|
98
|
+
background-color: ${(props) => props.theme.brightBlue};
|
99
|
+
padding: 7px 12px;
|
100
|
+
border-radius: 4px;
|
101
|
+
}
|
102
|
+
`
|
103
|
+
const arrowText = styled.div``
|
104
|
+
const arrowIconContainer = styled.div`
|
105
|
+
margin: 0 10px;
|
106
|
+
display: flex;
|
107
|
+
align-items: center;
|
108
|
+
`
|
109
|
+
export default {
|
110
|
+
name: 'pagination-component',
|
111
|
+
components: {
|
112
|
+
paginationWrapper,
|
113
|
+
paginationLink,
|
114
|
+
icon,
|
115
|
+
arrowText,
|
116
|
+
arrowIconContainer
|
117
|
+
},
|
118
|
+
props: ['fetchPage', 'currentPage', 'paginationParams'],
|
119
|
+
computed: {
|
120
|
+
getTheme() {
|
121
|
+
return theme
|
98
122
|
}
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
display:flex;
|
104
|
-
align-items: center;
|
105
|
-
`
|
106
|
-
export default {
|
107
|
-
name: 'pagination-component',
|
108
|
-
components:{
|
109
|
-
paginationWrapper,
|
110
|
-
paginationLink,
|
111
|
-
icon,
|
112
|
-
arrowText,
|
113
|
-
arrowIconContainer
|
123
|
+
},
|
124
|
+
methods: {
|
125
|
+
getNewProjects(num) {
|
126
|
+
this.$emit('on-pagination-change', num)
|
114
127
|
},
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
return prev
|
128
|
-
? next
|
129
|
-
? [n - 1, n, n + 1]
|
130
|
-
: [n - 2, n - 1, n]
|
131
|
-
: [n, n + 1, n + 2]
|
132
|
-
}
|
128
|
+
paginationNumbers() {
|
129
|
+
const prev = this.paginationParams.previous
|
130
|
+
const next = this.paginationParams.next
|
131
|
+
const n = prev + 1 || next - 1
|
132
|
+
if (this.paginationParams.pages === 2) {
|
133
|
+
return prev ? [n - 1, n] : [n, n + 1]
|
134
|
+
} else {
|
135
|
+
return prev
|
136
|
+
? next
|
137
|
+
? [n - 1, n, n + 1]
|
138
|
+
: [n - 2, n - 1, n]
|
139
|
+
: [n, n + 1, n + 2]
|
133
140
|
}
|
134
141
|
}
|
135
142
|
}
|
136
|
-
|
137
|
-
|
143
|
+
}
|
144
|
+
</script>
|
@@ -1,16 +1,15 @@
|
|
1
1
|
<template>
|
2
|
-
<page-container
|
2
|
+
<page-container>
|
3
3
|
<marker-container
|
4
4
|
v-if="markerData"
|
5
|
+
:hasBorderRadius="hasBorderRadius"
|
6
|
+
:withDate="!!date"
|
5
7
|
:backgroundColor="markerData.color"
|
6
8
|
:hasIcon="!!iconName"
|
7
9
|
:isEditionAllowed="editionAllowed"
|
8
10
|
:isActive="activated"
|
9
11
|
:cursor="cursor"
|
10
|
-
@click.native="editionAllowed
|
11
|
-
? activated = !activated
|
12
|
-
: ''
|
13
|
-
"
|
12
|
+
@click.native="editionAllowed ? (activated = !activated) : ''"
|
14
13
|
>
|
15
14
|
<icon
|
16
15
|
v-if="!!iconName"
|
@@ -20,10 +19,7 @@
|
|
20
19
|
:cursor="cursor"
|
21
20
|
/>
|
22
21
|
<span>{{ markerData.translations[activeLanguage].name }}</span>
|
23
|
-
<dot-wrapper
|
24
|
-
v-if="editionAllowed"
|
25
|
-
class="dotContainer"
|
26
|
-
>
|
22
|
+
<dot-wrapper v-if="editionAllowed" class="dotContainer">
|
27
23
|
<dot-icon />
|
28
24
|
<dot-icon />
|
29
25
|
<dot-icon />
|
@@ -38,10 +34,7 @@
|
|
38
34
|
</edit-item>
|
39
35
|
<edit-item @click.native="onEditClick">
|
40
36
|
<icon-container>
|
41
|
-
<icon
|
42
|
-
name="edit_button"
|
43
|
-
size="14px"
|
44
|
-
/>
|
37
|
+
<icon name="edit_button" size="14px" />
|
45
38
|
</icon-container>
|
46
39
|
<div>{{ $gettext('Edit') }}</div>
|
47
40
|
</edit-item>
|
@@ -59,10 +52,7 @@
|
|
59
52
|
<page-title :text="$gettext('delete_confirm_text')" />
|
60
53
|
<page-subtitle :text="$gettext('delete_confirm_subtext')" />
|
61
54
|
<cta-container>
|
62
|
-
<main-button
|
63
|
-
@click.native="onDelete"
|
64
|
-
:text="$gettext('Delete')"
|
65
|
-
/>
|
55
|
+
<main-button @click.native="onDelete" :text="$gettext('Delete')" />
|
66
56
|
<main-button
|
67
57
|
type="cancel"
|
68
58
|
@click.native="closeDeleteModal"
|
@@ -88,21 +78,17 @@
|
|
88
78
|
// @deleteHandler="onMarkerDelete($event)"
|
89
79
|
// />
|
90
80
|
|
91
|
-
import styled from
|
92
|
-
import Icon from
|
81
|
+
import styled from 'vue-styled-components'
|
82
|
+
import Icon from '../icon'
|
93
83
|
import Modal from '../modals/modal'
|
94
84
|
import PageTitle from '../pageTitle'
|
95
85
|
import DeleteIcon from '../deleteIcon'
|
96
86
|
import PageSubtitle from '../pageSubtitle'
|
97
87
|
import MainButton from '../buttons/mainButton'
|
98
88
|
|
99
|
-
const
|
100
|
-
withDate: Boolean
|
101
|
-
}
|
102
|
-
const PageContainer = styled('div', PageContainerAttrs)`
|
89
|
+
const PageContainer = styled.div`
|
103
90
|
display: flex;
|
104
91
|
align-items: center;
|
105
|
-
gap: 10px;
|
106
92
|
font-size: 12px;
|
107
93
|
line-height: 14px;
|
108
94
|
`
|
@@ -119,7 +105,9 @@ const CtaContainer = styled.div`
|
|
119
105
|
`
|
120
106
|
|
121
107
|
const MarkerAttrs = {
|
108
|
+
hasBorderRadius: Boolean,
|
122
109
|
backgroundColor: String,
|
110
|
+
withDate: Boolean,
|
123
111
|
hasIcon: Boolean,
|
124
112
|
isEditionAllowed: Boolean,
|
125
113
|
isActive: Boolean,
|
@@ -128,17 +116,22 @@ const MarkerAttrs = {
|
|
128
116
|
const MarkerContainer = styled('div', MarkerAttrs)`
|
129
117
|
display: grid;
|
130
118
|
grid-template-columns: ${(props) =>
|
131
|
-
|
119
|
+
props.hasIcon || props.isEditionAllowed ? 'auto 1fr' : '1fr'};
|
132
120
|
grid-gap: 5px;
|
133
121
|
position: relative;
|
134
122
|
align-items: center;
|
135
123
|
padding: 2px 7px;
|
136
124
|
color: ${(props) => props.theme.colors.white};
|
137
125
|
background-color: ${(props) =>
|
138
|
-
|
139
|
-
border
|
126
|
+
props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
|
127
|
+
border: 1px solid
|
128
|
+
${(props) =>
|
129
|
+
props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
|
130
|
+
border-radius: ${(props) =>
|
131
|
+
props.hasBorderRadius ? (props.withDate ? '4px 0 0 4px' : '4px') : '0'};
|
132
|
+
|
140
133
|
white-space: nowrap;
|
141
|
-
cursor: ${(props) => props.isEditionAllowed ? 'pointer' : props.cursor};
|
134
|
+
cursor: ${(props) => (props.isEditionAllowed ? 'pointer' : props.cursor)};
|
142
135
|
|
143
136
|
.dotContainer {
|
144
137
|
display: ${(props) => (props.isActive ? 'flex' : 'none')};
|
@@ -194,10 +187,15 @@ const IconContainer = styled.div`
|
|
194
187
|
line-height: 0;
|
195
188
|
`
|
196
189
|
|
197
|
-
const Date = styled.div
|
190
|
+
const Date = styled.div`
|
191
|
+
padding: 2px 5px;
|
192
|
+
border: 1px solid ${(props) => props.theme.colors.grey4};
|
193
|
+
border-left: none;
|
194
|
+
border-radius: 0 4px 4px 0;
|
195
|
+
`
|
198
196
|
|
199
197
|
export default {
|
200
|
-
name:
|
198
|
+
name: 'project-marker',
|
201
199
|
components: {
|
202
200
|
PageContainer,
|
203
201
|
MarkerContainer,
|
@@ -242,6 +240,10 @@ export default {
|
|
242
240
|
cursor: {
|
243
241
|
required: false,
|
244
242
|
default: 'default'
|
243
|
+
},
|
244
|
+
hasBorderRadius: {
|
245
|
+
required: false,
|
246
|
+
default: true
|
245
247
|
}
|
246
248
|
},
|
247
249
|
data() {
|
@@ -252,7 +254,11 @@ export default {
|
|
252
254
|
},
|
253
255
|
computed: {
|
254
256
|
editionAllowed() {
|
255
|
-
return (
|
257
|
+
return (
|
258
|
+
this.markerData.can_be_deleted &&
|
259
|
+
(!this.isLimitedPartner || this.isGroupSupport) &&
|
260
|
+
this.isEditable
|
261
|
+
)
|
256
262
|
},
|
257
263
|
iconName() {
|
258
264
|
if (this.markerData.choice === 'sold') {
|
@@ -274,11 +280,11 @@ export default {
|
|
274
280
|
this.deleteModalOpened = false
|
275
281
|
},
|
276
282
|
onEditClick() {
|
277
|
-
this.$emit(
|
283
|
+
this.$emit('editHandler')
|
278
284
|
},
|
279
285
|
onDelete() {
|
280
286
|
this.closeDeleteModal()
|
281
|
-
this.$emit(
|
287
|
+
this.$emit('deleteHandler')
|
282
288
|
}
|
283
289
|
}
|
284
290
|
}
|