@eturnity/eturnity_reusable_components 8.7.5-EPIC-8593.0 → 8.7.5-EPIC-8593.2

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": "8.7.5-EPIC-8593.0",
3
+ "version": "8.7.5-EPIC-8593.2",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -68,7 +68,17 @@
68
68
  <Icon name="current_variant" size="20px" />
69
69
  </IconWrapper>
70
70
  <IconWrapper v-if="hasError" data-test-id="error_wrapper" size="16px">
71
- <Icon cursor="default" name="warning" size="16px" />
71
+ <InfoText
72
+ v-if="infoErrorMessage != ''"
73
+ :align-arrow="infoTextAlign"
74
+ :app-theme="appTheme"
75
+ button-type="error"
76
+ data-test-id="info_text_message"
77
+ icon-name="warning"
78
+ :size="fontSize ? fontSize : '16px'"
79
+ :text="infoErrorMessage"
80
+ />
81
+ <Icon v-else cursor="default" name="warning" size="16px" />
72
82
  </IconWrapper>
73
83
  <IconWrapper
74
84
  v-if="iconName && !hasError && inputType !== 'password'"
@@ -148,10 +158,10 @@
148
158
  }
149
159
  const InputContainer = styled('input', inputProps)`
150
160
  border: ${(props) =>
151
- props.isError
152
- ? '1px solid ' + props.theme.colors.red
153
- : props.noBorder
161
+ props.noBorder
154
162
  ? 'none'
163
+ : props.isError
164
+ ? '1px solid ' + props.theme.colors.red
155
165
  : props.borderColor
156
166
  ? props.theme.colors[props.borderColor]
157
167
  ? '1px solid ' + props.theme.colors[props.borderColor]
@@ -410,6 +420,11 @@
410
420
  default: '',
411
421
  type: String,
412
422
  },
423
+ infoErrorMessage: {
424
+ required: false,
425
+ default: '',
426
+ type: String,
427
+ },
413
428
  },
414
429
  data() {
415
430
  return {
@@ -8,7 +8,9 @@
8
8
  <InputWrapper
9
9
  :align-items="alignItems"
10
10
  :has-label="!!label && label.length > 0"
11
+ :min-width="minWidth"
11
12
  :no-relative="noRelative"
13
+ :text-center="textCenter"
12
14
  >
13
15
  <LabelWrapper
14
16
  v-if="label"
@@ -43,7 +45,9 @@
43
45
  <SelectButton
44
46
  ref="select"
45
47
  :bg-color="
46
- buttonBgColor || colorMode == 'dark'
48
+ buttonBgColor
49
+ ? buttonBgColor
50
+ : colorMode == 'dark'
47
51
  ? 'transparentBlack1'
48
52
  : colorMode == 'transparent'
49
53
  ? 'transparent'
@@ -72,6 +76,7 @@
72
76
  :show-border="showBorder"
73
77
  :show-disabled-background="showDisabledBackground"
74
78
  :table-padding-left="tablePaddingLeft"
79
+ :text-center="textCenter"
75
80
  @click="toggleDropdown"
76
81
  @keydown="onKeyDown"
77
82
  >
@@ -110,6 +115,7 @@
110
115
  <slot name="selector" :selected-value="selectedValue"></slot>
111
116
  </Selector>
112
117
  <Caret
118
+ v-if="showCaret"
113
119
  class="caret_dropdown"
114
120
  :color-mode="colorMode"
115
121
  @click.stop="toggleCaretDropdown"
@@ -274,11 +280,13 @@
274
280
  selectWidth: String,
275
281
  optionWidth: String,
276
282
  noRelative: Boolean,
283
+ textCenter: Boolean,
277
284
  }
278
285
  const Container = styled('div', inputProps)`
279
286
  width: ${(props) => props.selectWidth};
280
287
  position: ${(props) => (props.noRelative ? 'static' : 'relative')};
281
288
  display: inline-block;
289
+ text-align: ${(props) => (props.textCenter ? 'center' : 'left')};
282
290
  `
283
291
 
284
292
  const LabelWrapperAttrs = { infoTextMessage: Boolean }
@@ -315,6 +323,7 @@
315
323
  showDisabledBackground: Boolean,
316
324
  colorMode: String,
317
325
  isSearchBarVisible: Boolean,
326
+ textCenter: Boolean,
318
327
  }
319
328
  const SelectButton = styled('div', selectButtonAttrs)`
320
329
  position: ${(props) => (props.noRelative ? 'static' : 'relative')};
@@ -335,7 +344,7 @@
335
344
  ? props.tablePaddingLeft
336
345
  : props.paddingLeft
337
346
  }`};
338
- text-align: left;
347
+ text-align: ${(props) => (props.textCenter ? 'center' : 'left')};
339
348
  min-height: ${(props) =>
340
349
  props.selectHeight
341
350
  ? props.selectHeight
@@ -363,7 +372,7 @@
363
372
  ? props.theme.colors.grey5
364
373
  : props.theme.colors[props.bgColor]
365
374
  ? props.theme.colors[props.bgColor]
366
- : props.bgColor};
375
+ : props.bgColor} !important;
367
376
  color: ${(props) =>
368
377
  props.colorMode === 'transparent'
369
378
  ? props.theme.colors.white
@@ -440,6 +449,7 @@
440
449
  const inputAttrs = {
441
450
  alignItems: String,
442
451
  hasLabel: Boolean,
452
+ minWidth: String,
443
453
  noRelative: Boolean,
444
454
  }
445
455
  const InputWrapper = styled('div', inputAttrs)`
@@ -647,6 +657,16 @@
647
657
  type: String,
648
658
  required: false,
649
659
  },
660
+ showCaret: {
661
+ type: Boolean,
662
+ required: false,
663
+ default: true,
664
+ },
665
+ textCenter: {
666
+ type: Boolean,
667
+ required: false,
668
+ default: false,
669
+ },
650
670
  },
651
671
 
652
672
  data() {
@@ -0,0 +1,175 @@
1
+ <template>
2
+ <!-- Check, if pages more than 1 -->
3
+ <PaginationWrapper v-if="paginationParams.pages > 1">
4
+ <PaginationLink v-if="paginationParams.previous" @click="fetchPage(1)">
5
+ <ArrowIconContainer>
6
+ <RCIcon name="start_of_the_list" size="14px" />
7
+ </ArrowIconContainer>
8
+ </PaginationLink>
9
+
10
+ <PaginationLink
11
+ v-if="paginationParams.previous"
12
+ @click="fetchPage(paginationParams.previous)"
13
+ >
14
+ <ArrowIconContainer>
15
+ <RCIcon name="arrow_left" size="14px" />
16
+ </ArrowIconContainer>
17
+ </PaginationLink>
18
+
19
+ <!-- Current block -->
20
+ <SelectWrapper>
21
+ <RCSelect
22
+ :button-font-color="getTheme.colors.gray1"
23
+ :dropdown-font-color="getTheme.colors.gray1"
24
+ font-size="14px"
25
+ :has-select-button-padding="false"
26
+ :is-auto-search="false"
27
+ :is-searchable="false"
28
+ :label-font-color="getTheme.colors.gray1"
29
+ left-padding="0px"
30
+ min-width="0px"
31
+ no-border
32
+ :no-max-width="true"
33
+ option-width="75px"
34
+ select-width="100%"
35
+ :show-border="false"
36
+ :show-caret="false"
37
+ text-center
38
+ :value="currentPage"
39
+ @input-change="fetchPage($event)"
40
+ >
41
+ <template #selector>
42
+ <SelectText>
43
+ {{ currentPage }} of {{ paginationParams.pages }}
44
+ </SelectText>
45
+ </template>
46
+ <template #dropdown>
47
+ <RCOption
48
+ v-for="number in paginationNumbers()"
49
+ :key="number"
50
+ text-center
51
+ :value="number"
52
+ >
53
+ {{ number }}
54
+ </RCOption>
55
+ </template>
56
+ </RCSelect>
57
+ </SelectWrapper>
58
+
59
+ <!-- Forward button -->
60
+ <PaginationLink
61
+ v-if="paginationParams.next"
62
+ @click="fetchPage(paginationParams.next)"
63
+ >
64
+ <ArrowIconContainer>
65
+ <RCIcon name="arrow_right" size="14px" />
66
+ </ArrowIconContainer>
67
+ </PaginationLink>
68
+ <PaginationLink
69
+ v-if="paginationParams.next"
70
+ @click="fetchPage(paginationParams.pages)"
71
+ >
72
+ <ArrowIconContainer>
73
+ <RCIcon name="end_of_the_list" size="14px" />
74
+ </ArrowIconContainer>
75
+ </PaginationLink>
76
+ </PaginationWrapper>
77
+ </template>
78
+
79
+ <script>
80
+ import styled from 'vue3-styled-components'
81
+ import RCIcon from '../icon'
82
+ import RCSelect from '../inputs/select'
83
+ import RCOption from '../inputs/select/option'
84
+ import theme from '@/assets/theme.js'
85
+
86
+ const PaginationWrapper = styled.nav`
87
+ gap: 5px;
88
+ font-size: 13px;
89
+ display: flex;
90
+ flex-wrap: wrap;
91
+ justify-content: flex-end;
92
+ align-items: center;
93
+ `
94
+ const PaginationLink = styled.div`
95
+ display: flex;
96
+ padding: 0px 5px;
97
+ margin: 0 2px;
98
+ text-align: center;
99
+ border-radius: 3px;
100
+ white-space: nowrap;
101
+ cursor: pointer;
102
+ color: ${(props) => props.theme.colors.brightBlue};
103
+
104
+ &.active {
105
+ color: ${(props) => props.theme.colors.white};
106
+ background-color: ${(props) => props.theme.colors.brightBlue};
107
+ padding: 7px 12px;
108
+ border-radius: 4px;
109
+ }
110
+ `
111
+ const ArrowIconContainer = styled.div`
112
+ display: flex;
113
+ align-items: center;
114
+ `
115
+
116
+ const SelectText = styled.div`
117
+ font-size: 14px;
118
+ color: ${(props) => props.theme.colors.grey1};
119
+ `
120
+
121
+ const SelectWrapper = styled.div`
122
+ display: flex;
123
+ align-items: center;
124
+ width: 75px;
125
+ `
126
+
127
+ export default {
128
+ name: 'PaginationV2',
129
+ components: {
130
+ PaginationWrapper,
131
+ PaginationLink,
132
+ RCIcon,
133
+ RCSelect,
134
+ RCOption,
135
+ SelectWrapper,
136
+ SelectText,
137
+ ArrowIconContainer,
138
+ },
139
+ props: {
140
+ fetchPage: {
141
+ type: Function,
142
+ required: true,
143
+ },
144
+ currentPage: {
145
+ type: Number,
146
+ required: true,
147
+ },
148
+ paginationParams: {
149
+ type: Object,
150
+ required: true,
151
+ },
152
+ },
153
+ data() {
154
+ return {
155
+ selectedValue: this.currentPage,
156
+ }
157
+ },
158
+ computed: {
159
+ getTheme() {
160
+ return theme
161
+ },
162
+ },
163
+ methods: {
164
+ getNewProjects(num) {
165
+ this.$emit('on-pagination-change', num)
166
+ },
167
+ paginationNumbers() {
168
+ return Array.from(
169
+ { length: this.paginationParams.pages },
170
+ (_, i) => i + 1
171
+ )
172
+ },
173
+ },
174
+ }
175
+ </script>