@eturnity/eturnity_reusable_components 6.46.5-qa-16-11.27 → 6.48.0-EPDM-9012.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "6.46.5-qa-16-11.27",
3
+ "version": "6.48.0-EPDM-9012.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
-
4
+ <page-title text="Hello" infoText="The ElektroForm solar integration has been activated for your company. Please log in with your Brunner Informatik Cloud-ID. Eturnity will not store your credentials but just a token for the connection."></page-title>
5
5
  <br/>
6
6
  <input-number
7
7
  :value="value"
@@ -114,6 +114,7 @@ import iconCollection from '@/components/icon/iconCollection'
114
114
  import dropdownComponent from '@/components/dropdown'
115
115
  import videoThumbnail from '@/components/videoThumbnail'
116
116
  import icon from '@/components/icon'
117
+ import pageTitle from '@/components/pageTitle'
117
118
  // import TableDropdown from "@/components/tableDropdown"
118
119
 
119
120
  const PageContainer = styled.div`
@@ -137,6 +138,7 @@ export default {
137
138
  SwitchField,
138
139
  iconCollection,
139
140
  dropdownComponent,
141
+ pageTitle,
140
142
  videoThumbnail,
141
143
  icon
142
144
  },
@@ -0,0 +1,3 @@
1
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M17 10H1C0.45 10 0 10.45 0 11V17C0 17.55 0.45 18 1 18H17C17.55 18 18 17.55 18 17V11C18 10.45 17.55 10 17 10ZM4 16C2.9 16 2 15.1 2 14C2 12.9 2.9 12 4 12C5.1 12 6 12.9 6 14C6 15.1 5.1 16 4 16ZM17 0H1C0.45 0 0 0.45 0 1V7C0 7.55 0.45 8 1 8H17C17.55 8 18 7.55 18 7V1C18 0.45 17.55 0 17 0ZM4 6C2.9 6 2 5.1 2 4C2 2.9 2.9 2 4 2C5.1 2 6 2.9 6 4C6 5.1 5.1 6 4 6Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 10H8V0H0V10ZM0 18H8V12H0V18ZM10 18H18V8H10V18ZM10 0V6H18V0H10Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 12H8V10H0V12ZM0 16H8V14H0V16ZM0 8H8V6H0V8ZM0 2V4H8V2H0ZM10 2H18V16H10V2Z" fill="white"/>
3
+ </svg>
@@ -127,7 +127,7 @@
127
127
  ? $gettext('min') + ' (' + filter.unit + ')'
128
128
  : $gettext('min')
129
129
  "
130
- :numberPrecision="2"
130
+ :numberPrecision="isIntegerRange(filter.filter_type) ? 0 : 2"
131
131
  :value="filter.range.start"
132
132
  @input-change="
133
133
  onChange({
@@ -147,7 +147,7 @@
147
147
  ? $gettext('max') + ' (' + filter.unit + ')'
148
148
  : $gettext('max')
149
149
  "
150
- :numberPrecision="2"
150
+ :numberPrecision="isIntegerRange(filter.filter_type) ? 0 : 2"
151
151
  :value="filter.range.end"
152
152
  @input-change="
153
153
  onChange({
@@ -340,7 +340,7 @@ const DragContainer = styled.div`
340
340
 
341
341
  const RowContainer = styled('div', TitleAttrs)`
342
342
  padding: 10px 14px;
343
- width: 300px;
343
+ min-width: 300px;
344
344
 
345
345
  ${({ showBorder, theme }) =>
346
346
  showBorder &&
@@ -615,6 +615,9 @@ export default {
615
615
  return type === 'multi_select_integer' || type === 'multi_select_string'
616
616
  },
617
617
  isRangeSelector(type) {
618
+ return type === 'integer_range' || type === 'number_range'
619
+ },
620
+ isIntegerRange(type) {
618
621
  return type === 'integer_range'
619
622
  },
620
623
  isDateSelector(type) {
@@ -120,10 +120,11 @@ export default {
120
120
  isStriked:{
121
121
  required:false,
122
122
  default:false
123
+
124
+ }
125
+ },
126
+ data() {
127
+ return {}
123
128
  }
124
- },
125
- data() {
126
- return {}
127
129
  }
128
- }
129
130
  </script>
@@ -10,7 +10,6 @@
10
10
  </icon-img>
11
11
  <text-overlay
12
12
  v-if="showInfo"
13
- :borderColor="borderColor"
14
13
  :width="width"
15
14
  :halfComputedTextInfoWidth="halfComputedTextInfoWidth"
16
15
  :alignArrow="alignArrow"
@@ -27,7 +26,6 @@
27
26
  //To use:
28
27
  // <info-text
29
28
  // text="Veritatis et quasi architecto beatae vitae"
30
- // borderColor="#ccc"
31
29
  // size="20"
32
30
  // alignArrow="right" // which side the arrow should be on
33
31
  // />
@@ -37,7 +35,6 @@ import icon from '../icon'
37
35
 
38
36
  const textAttrs = {
39
37
  iconSize: String,
40
- borderColor: String,
41
38
  alignArrow: String,
42
39
  width: String,
43
40
  halfComputedTextInfoWidth: Number
@@ -111,10 +108,6 @@ export default {
111
108
  text: {
112
109
  required: false
113
110
  },
114
- borderColor: {
115
- required: false,
116
- default: null
117
- },
118
111
  size: {
119
112
  required: false,
120
113
  default: '14px'
@@ -156,11 +149,7 @@ export default {
156
149
  },
157
150
  computed: {
158
151
  iconColor() {
159
- return this.isActive
160
- ? this.borderColor
161
- ? this.borderColor
162
- : theme.colors.secondary
163
- : theme.colors.mediumGray
152
+ return theme.colors.mediumGray
164
153
  },
165
154
  halfComputedTextInfoWidth() {
166
155
  return parseInt(this.width) / 2
@@ -32,7 +32,6 @@ const Template = (args, { argTypes }) => ({
32
32
  // fontSize="13px"
33
33
  // labelText="Number of Modules"
34
34
  // labelInfoText="Here is some information for you..."
35
- // labelInfoAlign="left"
36
35
  // />
37
36
  })
38
37
 
@@ -129,8 +128,7 @@ WithLabelInfo.args = {
129
128
  textAlign: "left",
130
129
  showLinearUnitName: false,
131
130
  labelText: "Number Input",
132
- labelInfoText: "Here is some information for you...",
133
- labelInfoAlign: "right",
131
+ labelInfoText: "Here is some information for you..."
134
132
  }
135
133
 
136
134
  export const LargerFont = Template.bind({})
@@ -19,9 +19,6 @@
19
19
  <info-text
20
20
  v-if="labelInfoText"
21
21
  :text="labelInfoText"
22
- borderColor="#ccc"
23
- size="14px"
24
- :alignText="labelInfoAlign"
25
22
  />
26
23
  </label-wrapper>
27
24
  <input-wrapper>
@@ -95,7 +92,6 @@
95
92
  // fontSize="13px"
96
93
  // labelText="Number of Modules"
97
94
  // labelInfoText="Here is some information for you..."
98
- // labelInfoAlign="left"
99
95
  // :minNumber="0"
100
96
  // fontColor="blue"
101
97
  // />
@@ -400,10 +396,6 @@ export default {
400
396
  required: false,
401
397
  default: null
402
398
  },
403
- labelInfoAlign: {
404
- required: false,
405
- default: 'left'
406
- },
407
399
  defaultNumber: {
408
400
  required: false,
409
401
  default: null
@@ -21,7 +21,6 @@ const Template = (args, { argTypes }) => ({
21
21
  // @input-change="onInputChange({ value: $event, type: 'companyName' })"
22
22
  // :isError="checkErrors()"
23
23
  // :errorMessage="This is my error message"
24
- // infoTextAlign="right" // left by default
25
24
  // infoTextMessage="My info message"
26
25
  // label="Question 5"
27
26
  // alignItems="horizontal" // horizontal, vertical
@@ -17,9 +17,7 @@
17
17
  <info-text
18
18
  v-if="infoTextMessage"
19
19
  :text="infoTextMessage"
20
- borderColor="#ccc"
21
20
  :size="fontSize ? fontSize : '16px'"
22
- :alignText="infoTextAlign"
23
21
  />
24
22
  </label-wrapper>
25
23
  <input-error-wrapper>
@@ -206,7 +204,6 @@ export default {
206
204
  // @input-blur="onInputBlur($event)"
207
205
  // :isError="checkErrors()"
208
206
  // :errorMessage="This is my error message"
209
- // infoTextAlign="right" // left by default
210
207
  // infoTextMessage="My info message"
211
208
  // label="Question 5"
212
209
  // alignItems="horizontal" // horizontal, vertical
@@ -270,9 +267,6 @@ export default {
270
267
  infoTextMessage: {
271
268
  required: false
272
269
  },
273
- infoTextAlign: {
274
- required: false
275
- },
276
270
  label: {
277
271
  required: false
278
272
  },
@@ -22,9 +22,7 @@
22
22
  <info-text
23
23
  v-if="infoTextMessage"
24
24
  :text="infoTextMessage"
25
- borderColor="#ccc"
26
25
  :size="fontSize ? fontSize : '16px'"
27
- :alignText="infoTextAlign"
28
26
  />
29
27
  </label-wrapper>
30
28
  <select-button-wrapper :disabled="disabled">
@@ -104,6 +102,7 @@
104
102
  :selectedValue="selectedValue"
105
103
  @option-selected="optionSelected"
106
104
  @option-hovered="optionHovered"
105
+ @mouseleave="optionLeave"
107
106
  >
108
107
  <slot name="dropdown"></slot>
109
108
  </selectDropdown>
@@ -312,9 +311,6 @@ export default {
312
311
  infoTextMessage: {
313
312
  required: false
314
313
  },
315
- infoTextAlign: {
316
- required: false
317
- },
318
314
  selectWidth: {
319
315
  required: false,
320
316
  default: null
@@ -340,6 +336,10 @@ export default {
340
336
  required: false,
341
337
  default: false
342
338
  },
339
+ dropdownAutoClose: {
340
+ required: false,
341
+ default: false
342
+ },
343
343
  alignItems: {
344
344
  required: false,
345
345
  default: 'horizontal'
@@ -465,6 +465,11 @@ export default {
465
465
  this.blur()
466
466
  }
467
467
  },
468
+ optionLeave() {
469
+ if(this.dropdownAutoClose) {
470
+ this.isDropdownOpen = false
471
+ }
472
+ },
468
473
  searchChange(value) {
469
474
  this.textSearch = value
470
475
  this.$emit('search-change', value)
@@ -15,9 +15,6 @@
15
15
  <info-text
16
16
  v-if="infoTextMessage"
17
17
  :text="infoTextMessage"
18
- borderColor="#ccc"
19
- size="14px"
20
- :alignText="infoTextAlign"
21
18
  />
22
19
  </label-container>
23
20
 
@@ -48,9 +45,6 @@
48
45
  @click.native.stop
49
46
  v-if="infoTextMessage"
50
47
  :text="infoTextMessage"
51
- borderColor="#ccc"
52
- size="14px"
53
- :alignText="infoTextAlign"
54
48
  />
55
49
  </label-container>
56
50
  </flex-wrapper>
@@ -202,9 +196,6 @@ export default {
202
196
  infoTextMessage: {
203
197
  required: false
204
198
  },
205
- infoTextAlign: {
206
- required: false
207
- },
208
199
  colorMode: {
209
200
  required: false,
210
201
  default: 'light'
@@ -22,7 +22,6 @@ const Template = (args, { argTypes }) => ({
22
22
  // rowHeight="4" //optional
23
23
  // :isError="false"
24
24
  // :errorText="$gettext('field_required')"
25
- // infoTextAlign="right" // left by default
26
25
  // infoTextMessage="My info message"
27
26
  // label="Question 5"
28
27
  // alignItems="horizontal" // horizontal, vertical
@@ -37,7 +36,6 @@ Default.args = {
37
36
  rowHeight: "2",
38
37
  isError: false,
39
38
  errorText: "This field is required",
40
- infoTextAlign: "right",
41
39
  infoTextMessage: "",
42
40
  label: "",
43
41
  value: "",
@@ -52,7 +50,6 @@ Disabled.args = {
52
50
  rowHeight: "2",
53
51
  isError: false,
54
52
  errorText: "This field is required",
55
- infoTextAlign: "right",
56
53
  infoTextMessage: "",
57
54
  label: "",
58
55
  value: "",
@@ -67,7 +64,6 @@ Error.args = {
67
64
  rowHeight: "2",
68
65
  isError: true,
69
66
  errorText: "This field is required",
70
- infoTextAlign: "right",
71
67
  infoTextMessage: "",
72
68
  label: "",
73
69
  value: "",
@@ -82,7 +78,6 @@ WithLabel.args = {
82
78
  rowHeight: "2",
83
79
  isError: false,
84
80
  errorText: "This field is required",
85
- infoTextAlign: "right",
86
81
  infoTextMessage: "Here is some information",
87
82
  label: "Description",
88
83
  value: "Here is my description!",
@@ -97,7 +92,6 @@ HorizontalLabel.args = {
97
92
  rowHeight: "2",
98
93
  isError: false,
99
94
  errorText: "This field is required",
100
- infoTextAlign: "right",
101
95
  infoTextMessage: "Here is some information",
102
96
  label: "Description",
103
97
  value: "Here is my description!",
@@ -112,7 +106,6 @@ LargerTextArea.args = {
112
106
  rowHeight: "5",
113
107
  isError: false,
114
108
  errorText: "This field is required",
115
- infoTextAlign: "right",
116
109
  infoTextMessage: "Here is some information",
117
110
  label: "Description",
118
111
  value: "Here is my description!",
@@ -127,7 +120,6 @@ LargerFontSize.args = {
127
120
  fontSize: "24px",
128
121
  isError: false,
129
122
  errorText: "This field is required",
130
- infoTextAlign: "right",
131
123
  infoTextMessage: "Here is some information",
132
124
  label: "Description",
133
125
  value: "Here is my description!",
@@ -11,9 +11,7 @@
11
11
  <info-text
12
12
  v-if="infoTextMessage"
13
13
  :text="infoTextMessage"
14
- borderColor="#ccc"
15
14
  size="16px"
16
- :alignText="infoTextAlign"
17
15
  />
18
16
  </label-wrapper>
19
17
  <input-container
@@ -47,7 +45,6 @@
47
45
  // rowHeight="4" //optional
48
46
  // :isError="false"
49
47
  // :errorText="$gettext('field_required')"
50
- // infoTextAlign="right" // left by default
51
48
  // infoTextMessage="My info message"
52
49
  // label="Question 5"
53
50
  // alignItems="horizontal" // horizontal, vertical
@@ -167,9 +164,6 @@ export default {
167
164
  infoTextMessage: {
168
165
  required: false
169
166
  },
170
- infoTextAlign: {
171
- required: false
172
- },
173
167
  label: {
174
168
  required: false
175
169
  },
@@ -9,9 +9,6 @@
9
9
  <info-text
10
10
  v-if="infoTextMessage"
11
11
  :text="infoTextMessage"
12
- borderColor="#ccc"
13
- size="14px"
14
- :alignText="infoTextAlign"
15
12
  />
16
13
  </label-container>
17
14
  <toggle-wrapper
@@ -45,9 +42,6 @@
45
42
  @click.native.stop
46
43
  v-if="infoTextMessage"
47
44
  :text="infoTextMessage"
48
- borderColor="#ccc"
49
- size="14px"
50
- :alignText="infoTextAlign"
51
45
  />
52
46
  </label-container>
53
47
  </flex-wrapper>
@@ -67,7 +61,6 @@
67
61
  // labelAlign="right"
68
62
  // fontColor="black"
69
63
  // :disabled="true"
70
- // infoTextAlign="right" // left by default
71
64
  // infoTextMessage="My info message"
72
65
  // />
73
66
 
@@ -271,10 +264,7 @@ export default {
271
264
  },
272
265
  infoTextMessage: {
273
266
  required: false,
274
- },
275
- infoTextAlign: {
276
- required: false,
277
- },
267
+ }
278
268
  },
279
269
  methods: {
280
270
  onToggleChange() {
@@ -4,11 +4,8 @@
4
4
  {{ text }}
5
5
  </span>
6
6
  <info-text
7
- :text="infoText"
8
7
  v-if="!!infoText"
9
- size="14px"
10
- borderColor="#ccc"
11
- :alignText="alignInfoText"
8
+ :text="infoText"
12
9
  />
13
10
  </subtitle-text>
14
11
  </template>
@@ -55,10 +52,6 @@ export default {
55
52
  required: false,
56
53
  default: null,
57
54
  },
58
- alignInfoText: {
59
- required: false,
60
- default: "left",
61
- },
62
55
  marginBottom: {
63
56
  required: false,
64
57
  default: "30px",
@@ -1,5 +1,13 @@
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
+ />
10
+ </title-wrap>
3
11
  </template>
4
12
 
5
13
  <script>
@@ -10,25 +18,41 @@
10
18
  // color="red"
11
19
  // />
12
20
  import styled from "vue-styled-components"
21
+ import InfoText from "../infoText"
13
22
 
14
- const textAttrs = { color: String, fontSize: String, uppercase: Boolean }
15
- const TitleText = styled("div", textAttrs)`
23
+ const wrapAttrs = { hasInfoText: Boolean }
24
+ const TitleWrap = styled("div", wrapAttrs)`
25
+ display: grid;
26
+ align-items: center;
27
+ grid-gap: 12px;
28
+ grid-template-columns: ${(props) =>
29
+ props.hasInfoText ? "auto auto 1fr" : "1fr"};
30
+ margin-bottom: 20px;
31
+ `
32
+
33
+ const titleAttrs = { color: String, fontSize: String, uppercase: Boolean }
34
+ const TitleText = styled('span', titleAttrs)`
16
35
  color: ${(props) => (props.color ? props.color : props.theme.colors.black)};
17
36
  font-weight: bold;
18
37
  font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
19
38
  text-transform: ${(props) => (props.uppercase ? 'uppercase' : 'none')};
20
- margin-bottom: 20px;
21
39
  `
22
40
 
23
41
  export default {
24
42
  name: "page-title",
25
43
  components: {
26
44
  TitleText,
45
+ TitleWrap,
46
+ InfoText
27
47
  },
28
48
  props: {
29
49
  text: {
30
50
  required: true,
31
51
  },
52
+ infoText: {
53
+ required: false,
54
+ default: null,
55
+ },
32
56
  color: {
33
57
  required: false,
34
58
  },
@@ -1,137 +1,129 @@
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 name="arrow_left" color="#0068de" 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="#0068de" 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: #0068de;
69
+ font-size: 13px;
70
+ display: flex;
71
+ flex-wrap: wrap;
72
+ justify-content: flex-end;
73
+ align-items: center;
74
+ margin-bottom: 2px;
75
+ margin-top: 10px;
83
76
  `
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;
77
+ const paginationLink = styled.div`
78
+ display: flex;
79
+ padding: 0px 5px;
80
+ margin: 0 2px;
81
+ text-align: center;
82
+ border-radius: 3px;
83
+ white-space: nowrap;
84
+ cursor: pointer;
92
85
 
93
- &.active{
94
- color: #fff;
95
- background-color: #5c67ac;
96
- padding: 7px 12px;
97
- border-radius: 4px;
98
- }
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
86
+ &.active {
87
+ color: #fff;
88
+ background-color: #0068de;
89
+ padding: 7px 12px;
90
+ border-radius: 4px;
91
+ }
92
+ `
93
+ const arrowText = styled.div``
94
+ const arrowIconContainer = styled.div`
95
+ margin: 0 10px;
96
+ display: flex;
97
+ align-items: center;
98
+ `
99
+ export default {
100
+ name: 'pagination-component',
101
+ components: {
102
+ paginationWrapper,
103
+ paginationLink,
104
+ icon,
105
+ arrowText,
106
+ arrowIconContainer
107
+ },
108
+ props: ['fetchPage', 'currentPage', 'paginationParams'],
109
+ methods: {
110
+ getNewProjects(num) {
111
+ this.$emit('on-pagination-change', num)
114
112
  },
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
- }
113
+ paginationNumbers() {
114
+ const prev = this.paginationParams.previous
115
+ const next = this.paginationParams.next
116
+ const n = prev + 1 || next - 1
117
+ if (this.paginationParams.pages === 2) {
118
+ return prev ? [n - 1, n] : [n, n + 1]
119
+ } else {
120
+ return prev
121
+ ? next
122
+ ? [n - 1, n, n + 1]
123
+ : [n - 2, n - 1, n]
124
+ : [n, n + 1, n + 2]
133
125
  }
134
126
  }
135
127
  }
136
- </script>
137
-
128
+ }
129
+ </script>
@@ -1,7 +1,9 @@
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"
@@ -96,13 +98,9 @@ import DeleteIcon from '../deleteIcon'
96
98
  import PageSubtitle from '../pageSubtitle'
97
99
  import MainButton from '../buttons/mainButton'
98
100
 
99
- const PageContainerAttrs = {
100
- withDate: Boolean
101
- }
102
- const PageContainer = styled('div', PageContainerAttrs)`
101
+ const PageContainer = styled.div`
103
102
  display: flex;
104
103
  align-items: center;
105
- gap: 10px;
106
104
  font-size: 12px;
107
105
  line-height: 14px;
108
106
  `
@@ -119,7 +117,9 @@ const CtaContainer = styled.div`
119
117
  `
120
118
 
121
119
  const MarkerAttrs = {
120
+ hasBorderRadius: Boolean,
122
121
  backgroundColor: String,
122
+ withDate: Boolean,
123
123
  hasIcon: Boolean,
124
124
  isEditionAllowed: Boolean,
125
125
  isActive: Boolean,
@@ -136,7 +136,12 @@ const MarkerContainer = styled('div', MarkerAttrs)`
136
136
  color: ${(props) => props.theme.colors.white};
137
137
  background-color: ${(props) =>
138
138
  props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
139
- border-radius: 4px;
139
+ <<<<<<< HEAD
140
+ border-radius: ${(props) => (props.hasBorderRadius ? '4px' : '0')};
141
+ =======
142
+ border: 1px solid ${(props) => props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
143
+ border-radius: ${(props) => props.withDate ? '4px 0 0 4px' : '4px'};
144
+ >>>>>>> origin/EPDM-9185
140
145
  white-space: nowrap;
141
146
  cursor: ${(props) => props.isEditionAllowed ? 'pointer' : props.cursor};
142
147
 
@@ -194,7 +199,12 @@ const IconContainer = styled.div`
194
199
  line-height: 0;
195
200
  `
196
201
 
197
- const Date = styled.div``
202
+ const Date = styled.div`
203
+ padding: 2px 5px;
204
+ border: 1px solid ${(props) => props.theme.colors.grey4};
205
+ border-left: none;
206
+ border-radius: 0 4px 4px 0;
207
+ `
198
208
 
199
209
  export default {
200
210
  name: "project-marker",
@@ -242,6 +252,10 @@ export default {
242
252
  cursor: {
243
253
  required: false,
244
254
  default: 'default'
255
+ },
256
+ hasBorderRadius: {
257
+ required: false,
258
+ default: true
245
259
  }
246
260
  },
247
261
  data() {
@@ -0,0 +1,264 @@
1
+ <template>
2
+ <page-container :isLoading="!tabsData.length">
3
+ <spinner-container v-if="!tabsData.length">
4
+ <spinner />
5
+ </spinner-container>
6
+ <list-container v-else>
7
+ <template v-for="(item, idx) in tabsData">
8
+ <list-item
9
+ v-if="!item.children"
10
+ :key="idx"
11
+ :isActive="activeTab === item.key"
12
+ @click="$emit('tab-click', { activeKey: item.key })"
13
+ >
14
+ <icon-container :isActive="activeTab === item.key">
15
+ <icon :name="item.icon" color="#fff" cursor="pointer" size="18px" />
16
+ </icon-container>
17
+ <list-text>{{ $gettext(item.label) }}</list-text>
18
+ </list-item>
19
+ <collapse-wrapper v-else :key="idx + item.key">
20
+ <collapse-container @click="toggleActiveDropdown(item.key)">
21
+ <icon-container :isActive="activeParentTab === item.key">
22
+ <icon
23
+ :name="item.icon"
24
+ color="#fff"
25
+ cursor="pointer"
26
+ size="18px"
27
+ />
28
+ </icon-container>
29
+ <list-text>{{ $gettext(item.label) }}</list-text>
30
+ <arrow-container>
31
+ <icon
32
+ :name="activeDropdown === item.key ? 'arrow_up' : 'arrow_down'"
33
+ color="white"
34
+ size="10px"
35
+ />
36
+ </arrow-container>
37
+ </collapse-container>
38
+ <template v-if="activeDropdown === item.key">
39
+ <sub-router
40
+ v-for="subItem in item.children"
41
+ :key="subItem.key"
42
+ :isActive="activeTab === subItem.key"
43
+ @click="
44
+ $emit('tab-click', {
45
+ activeKey: subItem.key,
46
+ parentKey: item.key
47
+ })
48
+ "
49
+ >
50
+ {{ $gettext(subItem.label) }}
51
+ </sub-router>
52
+ </template>
53
+ </collapse-wrapper>
54
+ </template>
55
+ </list-container>
56
+ <bottom-section v-if="hasLogout">
57
+ <icon-container
58
+ :isActive="false"
59
+ :isButton="true"
60
+ @click="$emit('on-logout')"
61
+ >
62
+ <rotate-icon
63
+ name="initial_situation"
64
+ color="#fff"
65
+ cursor="pointer"
66
+ size="18px"
67
+ />
68
+ </icon-container>
69
+ <app-version>{{ appVersion }}</app-version>
70
+ </bottom-section>
71
+ </page-container>
72
+ </template>
73
+
74
+ <script>
75
+ import styled from 'vue-styled-components'
76
+ import Icon from '../icon'
77
+ import Spinner from '../spinner'
78
+
79
+ const PageAttrs = { isLoading: Boolean }
80
+ const PageContainer = styled('div', PageAttrs)`
81
+ background-color: ${(props) =>
82
+ props.isLoading ? props.theme.colors.white : props.theme.colors.grey6};
83
+ padding: 14px 12px;
84
+ min-width: 220px;
85
+ display: flex;
86
+ flex-direction: column;
87
+ justify-content: space-between;
88
+ `
89
+
90
+ const ListContainer = styled.div`
91
+ display: grid;
92
+ grid-gap: 6px;
93
+ `
94
+
95
+ const IconAttrs = { isActive: Boolean, isButton: Boolean }
96
+
97
+ const ListItem = styled('div', IconAttrs)`
98
+ display: grid;
99
+ align-items: center;
100
+ grid-template-columns: auto 1fr;
101
+ grid-gap: 20px;
102
+ cursor: pointer;
103
+ padding: 4px;
104
+ border-radius: 6px;
105
+ background-color: ${(props) =>
106
+ props.isActive ? 'rgba(255, 255, 255, 0.1)' : ''};
107
+
108
+ :hover {
109
+ background-color: rgba(255, 255, 255, 0.1);
110
+ }
111
+ `
112
+
113
+ const ListText = styled.div`
114
+ font-size: 16px;
115
+ font-weight: 700;
116
+ color: ${(props) => props.theme.colors.white};
117
+ `
118
+
119
+ const IconContainer = styled('div', IconAttrs)`
120
+ display: grid;
121
+ align-items: center;
122
+ justify-items: center;
123
+ width: 32px;
124
+ height: 32px;
125
+ background-color: ${(props) =>
126
+ props.isActive ? props.theme.colors.red : 'rgba(255, 255, 255, 0.2)'};
127
+ border-radius: 6px;
128
+
129
+ ${({ isButton = false }) =>
130
+ isButton &&
131
+ `
132
+ cursor: pointer;
133
+ &:hover {
134
+ background-color: rgba(255, 255, 255, 0.3);
135
+ }
136
+ `}
137
+ `
138
+
139
+ const SpinnerContainer = styled.div`
140
+ margin-top: 30px;
141
+ `
142
+
143
+ const BottomSection = styled.div`
144
+ display: flex;
145
+ justify-content: space-between;
146
+ align-items: center;
147
+ `
148
+
149
+ const RotateIcon = styled(Icon)`
150
+ transform: rotate(-90deg);
151
+ `
152
+
153
+ const AppVersion = styled.p`
154
+ font-size: 11px;
155
+ line-height: 13px;
156
+ color: ${(props) => props.theme.colors.white};
157
+ margin-right: 6px;
158
+ `
159
+
160
+ const SubRouter = styled('div', IconAttrs)`
161
+ display: grid;
162
+ grid-template-columns: 1fr;
163
+ grid-gap: 10px;
164
+ align-items: center;
165
+ justify-items: flex-start;
166
+ cursor: pointer;
167
+ margin-left: 65px;
168
+ padding: 8px;
169
+ border-radius: 6px;
170
+ color: ${(props) => props.theme.colors.white};
171
+ font-weight: 700;
172
+ ${({ isActive }) =>
173
+ isActive &&
174
+ `
175
+ background: rgba(255, 255, 255, 0.1);
176
+ `}
177
+
178
+ &:hover {
179
+ background: rgba(255, 255, 255, 0.1);
180
+ }
181
+ `
182
+
183
+ const CollapseContainer = styled.div`
184
+ display: grid;
185
+ grid-template-columns: auto 1fr auto;
186
+ grid-gap: 20px;
187
+ padding: 4px;
188
+ border-radius: 6px;
189
+ align-items: center;
190
+ cursor: pointer;
191
+ &:hover {
192
+ background: rgba(255, 255, 255, 0.1);
193
+ }
194
+ `
195
+
196
+ const CollapseWrapper = styled.div`
197
+ display: grid;
198
+ grid-template-columns: 1fr;
199
+ grid-gap: 10px;
200
+ user-select: none;
201
+ margin-bottom: 2px;
202
+ `
203
+
204
+ const ArrowContainer = styled.div`
205
+ padding-bottom: 5px;
206
+ `
207
+
208
+ export default {
209
+ name: 'SideMenu',
210
+ components: {
211
+ PageContainer,
212
+ ListContainer,
213
+ ListItem,
214
+ ListText,
215
+ Icon,
216
+ IconContainer,
217
+ Spinner,
218
+ SpinnerContainer,
219
+ BottomSection,
220
+ RotateIcon,
221
+ AppVersion,
222
+ CollapseWrapper,
223
+ CollapseContainer,
224
+ SubRouter,
225
+ ArrowContainer
226
+ },
227
+ data() {
228
+ return {
229
+ activeDropdown: null
230
+ }
231
+ },
232
+ mounted() {
233
+ this.activeDropdown = this.activeParentTab
234
+ },
235
+ props: {
236
+ tabsData: {
237
+ required: true
238
+ },
239
+ activeTab: {
240
+ required: true
241
+ },
242
+ activeParentTab: {
243
+ required: false
244
+ },
245
+ hasLogout: {
246
+ required: false,
247
+ default: true
248
+ },
249
+ appVersion: {
250
+ required: false,
251
+ type: String
252
+ }
253
+ },
254
+ methods: {
255
+ toggleActiveDropdown(value) {
256
+ if (this.activeDropdown === value) {
257
+ this.activeDropdown = null
258
+ } else {
259
+ this.activeDropdown = value
260
+ }
261
+ }
262
+ }
263
+ }
264
+ </script>
@@ -331,7 +331,7 @@ export default {
331
331
  },
332
332
  findRelativeParent(element) {
333
333
  while (element.parentElement) {
334
- if (window.getComputedStyle(element.parentElement).position === 'relative') {
334
+ if (window.getComputedStyle(element.parentElement).position === 'relative' || window.getComputedStyle(element.parentElement).position === 'absolute') {
335
335
  return element.parentElement
336
336
  }
337
337
  element = element.parentElement