@eturnity/eturnity_reusable_components 1.2.84 → 1.2.85-EPDM-3013.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.
@@ -1,59 +1,68 @@
1
1
  <template>
2
- <optionContainer :data-value="value" :hoveredBgColor="hoveredBgColor || colorMode=='dark'?'#000000':'grey5'" @click="clickHandler" @mouseover="hoverHandler">
3
- <slot></slot>
4
- </optionContainer>
5
- </template>
2
+ <optionContainer
3
+ :data-value="value"
4
+ :hoveredBgColor="
5
+ hoveredBgColor || colorMode == 'dark' ? '#000000' : 'grey5'
6
+ "
7
+ @click="clickHandler"
8
+ @mouseover="hoverHandler"
9
+ >
10
+ <slot></slot>
11
+ </optionContainer>
12
+ </template>
6
13
 
7
- <script>
14
+ <script>
8
15
  // import selectButton from './selectButton'
9
16
  // import selectDropdown from './selectDropDown'
10
- import styled from 'vue-styled-components'
11
- const optionProps={hoveredBgColor:String}
12
- const optionContainer = styled('div',optionProps)`
13
- display:flex;
14
- cursor: pointer;
15
- flex-direction: row;
16
- justify-content: space-between;
17
- align-items: center;
18
- padding: 12px 10px;
19
- gap: 14px;
20
- width:100%;
21
- box-sizing:inherit;
22
- &:hover{
23
- background-color:${(props) => props.theme.colors[props.hoveredBgColor]?props.theme.colors[props.hoveredBgColor]:props.hoveredBgColor};
24
- }
25
- `
17
+ import styled from 'vue-styled-components'
18
+ const optionProps = { hoveredBgColor: String }
19
+ const optionContainer = styled('div', optionProps)`
20
+ display: flex;
21
+ cursor: pointer;
22
+ flex-direction: row;
23
+ justify-content: space-between;
24
+ align-items: center;
25
+ padding: 12px 10px;
26
+ gap: 14px;
27
+ width: 100%;
28
+ box-sizing: inherit;
29
+ &:hover {
30
+ background-color: ${(props) =>
31
+ props.theme.colors[props.hoveredBgColor]
32
+ ? props.theme.colors[props.hoveredBgColor]
33
+ : props.hoveredBgColor};
34
+ }
35
+ `
26
36
 
27
- export default {
28
- name: 'RCoption',
37
+ export default {
38
+ name: 'RCoption',
29
39
 
30
- props: {
31
- value: {
32
- required: true
33
- },
34
- hoveredBgColor:{
35
- required:false,
36
- },
37
- colorMode:{
38
- required:false,
39
- default:'light'
40
- }
40
+ props: {
41
+ value: {
42
+ required: true
43
+ },
44
+ hoveredBgColor: {
45
+ required: false
41
46
  },
47
+ colorMode: {
48
+ required: false,
49
+ default: 'light'
50
+ }
51
+ },
42
52
 
43
- components: {optionContainer},
53
+ components: { optionContainer },
44
54
 
45
- data() {
46
- return {}
47
- },
48
- methods:{
49
- clickHandler(){
50
- this.$parent.$emit('option-selected',this.value)
51
- },
52
- hoverHandler(){
53
- this.$parent.$emit('option-hovered',this.value)
54
- }
55
+ data() {
56
+ return {}
57
+ },
58
+ methods: {
59
+ clickHandler() {
60
+ this.$parent.$emit('option-selected', this.value)
55
61
  },
56
- computed: {
62
+ hoverHandler() {
63
+ this.$parent.$emit('option-hovered', this.value)
57
64
  }
58
- }
59
- </script>
65
+ },
66
+ computed: {}
67
+ }
68
+ </script>
@@ -0,0 +1,137 @@
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;
83
+ `
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;
92
+
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
114
+ },
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
+ }
133
+ }
134
+ }
135
+ }
136
+ </script>
137
+
@@ -332,6 +332,7 @@ const TableContainer = styled('table', containerAttrs)`
332
332
  font-size: 13px;
333
333
  padding: 5px 10px;
334
334
  background: #fff;
335
+ height: unset;
335
336
 
336
337
  &:focus {
337
338
  background: ${(props) => props.theme.colors.grey5};
@@ -66,6 +66,8 @@ export const datePickerLang = (lang) => {
66
66
  return 'fr'
67
67
  } else if (lang === 'it-it' || lang === 'it-ch') {
68
68
  return 'it'
69
+ } else if (lang === 'en-us' || lang === 'en-gb') {
70
+ return 'en'
69
71
  } else {
70
72
  return lang
71
73
  }