@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.
Files changed (47) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +42 -181
  3. package/src/assets/svgIcons/charger_icon_white.svg +44 -0
  4. package/src/assets/svgIcons/collections.svg +3 -0
  5. package/src/assets/svgIcons/dashboard.svg +3 -0
  6. package/src/assets/svgIcons/energy_meter.svg +12 -0
  7. package/src/assets/svgIcons/erase.svg +1 -1
  8. package/src/assets/svgIcons/expand.svg +1 -0
  9. package/src/assets/svgIcons/logout.svg +3 -0
  10. package/src/assets/svgIcons/split.svg +94 -0
  11. package/src/assets/svgIcons/subscriptions.svg +3 -0
  12. package/src/assets/theme.js +3 -0
  13. package/src/components/addNewButton/index.vue +12 -8
  14. package/src/components/buttons/mainButton/index.vue +35 -23
  15. package/src/components/card/index.vue +95 -0
  16. package/src/components/draggableInputHandle/index.vue +47 -0
  17. package/src/components/errorMessage/index.vue +1 -3
  18. package/src/components/filter/filterSettings.vue +15 -10
  19. package/src/components/filter/index.vue +12 -1
  20. package/src/components/icon/iconCollection.vue +5 -5
  21. package/src/components/icon/index.vue +10 -2
  22. package/src/components/iconWrapper/index.vue +17 -12
  23. package/src/components/infoCard/index.vue +36 -0
  24. package/src/components/infoText/index.vue +2 -12
  25. package/src/components/inputs/checkbox/index.vue +5 -0
  26. package/src/components/inputs/inputNumber/index.vue +48 -17
  27. package/src/components/inputs/inputText/index.vue +24 -5
  28. package/src/components/inputs/radioButton/index.vue +66 -49
  29. package/src/components/inputs/searchInput/index.vue +6 -0
  30. package/src/components/inputs/select/index.vue +138 -68
  31. package/src/components/inputs/select/option/index.vue +15 -2
  32. package/src/components/inputs/switchField/index.vue +7 -11
  33. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +0 -8
  34. package/src/components/inputs/textAreaInput/index.vue +12 -7
  35. package/src/components/inputs/toggle/index.vue +82 -82
  36. package/src/components/label/index.vue +103 -0
  37. package/src/components/modals/modal/index.vue +46 -13
  38. package/src/components/navigationTabs/index.vue +105 -0
  39. package/src/components/pageSubtitle/index.vue +1 -8
  40. package/src/components/pageTitle/index.vue +32 -4
  41. package/src/components/pagination/index.vue +136 -129
  42. package/src/components/projectMarker/index.vue +39 -33
  43. package/src/components/sideMenu/index.vue +270 -0
  44. package/src/components/tables/mainTable/index.vue +3 -3
  45. package/src/components/threeDots/index.vue +31 -22
  46. package/src/helpers/numberConverter.js +4 -2
  47. package/src/helpers/translateLang.js +9 -1
@@ -1,5 +1,14 @@
1
1
  <template>
2
- <title-text :color="color" :fontSize="fontSize" :uppercase="uppercase">{{ text }}</title-text>
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 textAttrs = { color: String, fontSize: String, uppercase: Boolean }
15
- const TitleText = styled("div", textAttrs)`
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
- <!-- 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 name="arrow_left" color="#1a237e" size="12px"/>
11
- </arrowIconContainer>
12
- <arrowText>{{ $gettext('back') }}</arrowText>
13
- </paginationLink>
14
-
15
- <!-- First page -->
16
- <paginationLink
17
- v-if="currentPage > 2 && paginationParams.pages > 3"
18
- @click="fetchPage(1)"
19
- >1</paginationLink
20
- >
21
-
22
- <!-- Back tree dots -->
23
- <span v-if="currentPage > 3 && paginationParams.pages > 4">...</span>
24
-
25
- <!-- Current block -->
26
- <paginationLink
27
- v-for="number in paginationNumbers()"
28
- :key="number"
29
- :class="[currentPage === number ? 'active' : '']"
30
- @click="fetchPage(number)"
31
- >{{ number }}</paginationLink
32
- >
33
-
34
- <!-- Forward tree dots -->
35
- <span
36
- v-if="
37
- paginationParams.pages - currentPage > 2 && paginationParams.pages > 4
38
- "
39
- >...</span
40
- >
41
-
42
- <!-- End page -->
43
- <paginationLink
44
- v-if="
45
- paginationParams.pages - currentPage > 1 && paginationParams.pages > 3
46
- "
47
- @click="fetchPage(paginationParams.pages)"
48
- >{{ paginationParams.pages }}</paginationLink
49
- >
50
-
51
- <!-- Forward button -->
52
- <paginationLink
53
- v-if="paginationParams.next"
54
- @click="fetchPage(paginationParams.next)"
55
- >
56
- <arrowText>{{ $gettext('forward') }}</arrowText>
57
- <arrowIconContainer>
58
- <icon name="arrow_right" color="#1a237e" size="12px" />
59
- </arrowIconContainer>
60
- </paginationLink>
61
- </paginationWrapper>
62
- </template>
63
-
64
- <script>
65
- import styled from "vue-styled-components"
66
- import icon from "../icon"
67
- const paginationWrapper=styled.nav`
68
- color: #1a237e;
69
- font-size: 13px;
70
- display: -webkit-box;
71
- display: -ms-flexbox;
72
- display: flex;
73
- -ms-flex-wrap: wrap;
74
- flex-wrap: wrap;
75
- -webkit-box-pack: end;
76
- -ms-flex-pack: end;
77
- justify-content: flex-end;
78
- -webkit-box-align: center;
79
- -ms-flex-align: center;
80
- align-items: center;
81
- margin-bottom: 2px;
82
- margin-top: 10px;
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
- const paginationLink=styled.div`
85
- display: flex;
86
- padding: 0px 5px;
87
- margin: 0 2px;
88
- text-align: center;
89
- border-radius: 3px;
90
- white-space: nowrap;
91
- cursor: pointer;
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
- &.active{
94
- color: #fff;
95
- background-color: #5c67ac;
96
- padding: 7px 12px;
97
- border-radius: 4px;
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
- const arrowText=styled.div``
101
- const arrowIconContainer=styled.div`
102
- margin:0 10px;
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
- props: ["fetchPage","currentPage","paginationParams"],
116
- methods: {
117
- getNewProjects(num) {
118
- this.$emit('on-pagination-change', num)
119
- },
120
- paginationNumbers() {
121
- const prev = this.paginationParams.previous
122
- const next = this.paginationParams.next
123
- const n = prev + 1 || next - 1
124
- if (this.paginationParams.pages === 2) {
125
- return prev ? [n - 1, n] : [n, n + 1]
126
- } else {
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
- </script>
137
-
143
+ }
144
+ </script>
@@ -1,16 +1,15 @@
1
1
  <template>
2
- <page-container :withDate="!!date">
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 "vue-styled-components"
92
- import Icon from "../icon"
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 PageContainerAttrs = {
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
- props.hasIcon || props.isEditionAllowed ? 'auto 1fr' : '1fr'};
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
- props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
139
- border-radius: 4px;
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: "project-marker",
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 (this.markerData.can_be_deleted && (!this.isLimitedPartner || this.isGroupSupport)) && this.isEditable
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("editHandler")
283
+ this.$emit('editHandler')
278
284
  },
279
285
  onDelete() {
280
286
  this.closeDeleteModal()
281
- this.$emit("deleteHandler")
287
+ this.$emit('deleteHandler')
282
288
  }
283
289
  }
284
290
  }