@eturnity/eturnity_reusable_components 7.6.1 → 7.8.1-EPDM-9696.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 +1 -1
- package/src/App.vue +1 -2
- package/src/assets/theme.js +1 -0
- package/src/components/infoCard/index.vue +19 -21
- package/src/components/infoText/index.vue +1 -0
- package/src/components/label/index.vue +104 -0
- package/src/components/pagination/index.vue +19 -4
- package/src/components/tables/mainTable/index.vue +3 -3
- package/src/components/threeDots/index.vue +18 -13
package/package.json
CHANGED
package/src/App.vue
CHANGED
package/src/assets/theme.js
CHANGED
@@ -1,38 +1,36 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
<info-container>
|
3
|
+
<icon name="info" size="24px" />
|
4
|
+
<text-container>
|
5
|
+
<slot />
|
6
|
+
</text-container>
|
7
|
+
</info-container>
|
8
8
|
</template>
|
9
|
-
|
9
|
+
|
10
10
|
<script>
|
11
11
|
import styled from 'vue-styled-components'
|
12
|
-
import
|
13
|
-
|
12
|
+
import Icon from '../icon'
|
13
|
+
|
14
|
+
const InfoContainer = styled.div`
|
14
15
|
display: flex;
|
15
|
-
align-items: flex-start;
|
16
16
|
gap: 15px;
|
17
17
|
padding: 20px;
|
18
|
-
|
19
|
-
min-width: 450px;
|
20
|
-
border: 1px dashed #dee2eb;
|
18
|
+
border: 1px dashed ${(props) => props.theme.colors.grey4};
|
21
19
|
border-radius: 4px;
|
22
|
-
margin:20px 0;
|
23
20
|
`
|
24
21
|
|
25
|
-
const
|
22
|
+
const TextContainer = styled.div`
|
26
23
|
font-size: 13px;
|
24
|
+
width: 100%;
|
27
25
|
`
|
28
26
|
|
29
27
|
|
30
28
|
export default {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
29
|
+
name: 'InfoCard',
|
30
|
+
components: {
|
31
|
+
Icon,
|
32
|
+
InfoContainer,
|
33
|
+
TextContainer
|
34
|
+
}
|
37
35
|
}
|
38
36
|
</script>
|
@@ -0,0 +1,104 @@
|
|
1
|
+
<template>
|
2
|
+
<label-wrapper
|
3
|
+
:labelAlign="labelAlign">
|
4
|
+
<input-label
|
5
|
+
:labelFontColor="labelFontColor"
|
6
|
+
:fontSize="fontSize"
|
7
|
+
>
|
8
|
+
<slot></slot>
|
9
|
+
<optionalLabel v-if="labelOptional"
|
10
|
+
>({{ $gettext('Optional') }})</optionalLabel
|
11
|
+
></input-label
|
12
|
+
>
|
13
|
+
<info-text
|
14
|
+
v-if="infoTextMessage"
|
15
|
+
:text="infoTextMessage"
|
16
|
+
borderColor="#ccc"
|
17
|
+
:size="fontSize ? fontSize : '16px'"
|
18
|
+
:alignArrow="infoTextAlign"
|
19
|
+
/>
|
20
|
+
</label-wrapper>
|
21
|
+
</template>
|
22
|
+
|
23
|
+
<script>
|
24
|
+
import styled from 'vue-styled-components'
|
25
|
+
import InfoText from '../infoText'
|
26
|
+
|
27
|
+
|
28
|
+
const labelAttrs = { fontSize: String, labelFontColor: String }
|
29
|
+
const InputLabel = styled('div', labelAttrs)`
|
30
|
+
color: ${(props) =>
|
31
|
+
props.theme.colors[props.labelFontColor]
|
32
|
+
? props.theme.colors[props.labelFontColor]
|
33
|
+
: props.labelFontColor
|
34
|
+
? props.labelFontColor
|
35
|
+
: props.theme.colors.eturnityGrey};
|
36
|
+
|
37
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
38
|
+
font-weight: 700;
|
39
|
+
`
|
40
|
+
const optionalLabel = styled.span`
|
41
|
+
font-weight: 300;
|
42
|
+
`
|
43
|
+
|
44
|
+
const LabelWrapper = styled('div',{labelAlign:String})`
|
45
|
+
${props=>props.labelAlign=='horizontal'?
|
46
|
+
'display: inline-grid;':
|
47
|
+
'display: grid;'
|
48
|
+
}
|
49
|
+
${props=>props.labelAlign=='horizontal'?
|
50
|
+
'margin-right: 10px;':
|
51
|
+
'margin-bottom: 8px;'
|
52
|
+
}
|
53
|
+
vertical-align: center;
|
54
|
+
grid-template-columns: auto auto;
|
55
|
+
grid-gap: 12px;
|
56
|
+
align-items: center;
|
57
|
+
justify-content: start;
|
58
|
+
`
|
59
|
+
export default {
|
60
|
+
// import labelText from "@eturnity/eturnity_reusable_components/src/components/label"
|
61
|
+
// To use:
|
62
|
+
// <label-text
|
63
|
+
// infoTextAlign="right" // left by default
|
64
|
+
// infoTextMessage="My info message"
|
65
|
+
// label="Question 5"
|
66
|
+
// />
|
67
|
+
name: 'input-text',
|
68
|
+
components: {
|
69
|
+
InfoText,
|
70
|
+
InputLabel,
|
71
|
+
LabelWrapper,
|
72
|
+
optionalLabel
|
73
|
+
},
|
74
|
+
data() {
|
75
|
+
return {
|
76
|
+
inputTypeData: 'text'
|
77
|
+
}
|
78
|
+
},
|
79
|
+
props: {
|
80
|
+
infoTextMessage: {
|
81
|
+
required: false
|
82
|
+
},
|
83
|
+
infoTextAlign: {
|
84
|
+
required: false
|
85
|
+
},
|
86
|
+
labelOptional: {
|
87
|
+
required: false,
|
88
|
+
default: false
|
89
|
+
},
|
90
|
+
fontSize: {
|
91
|
+
required: false,
|
92
|
+
default: null
|
93
|
+
},
|
94
|
+
labelFontColor: {
|
95
|
+
required: false,
|
96
|
+
default: 'black'
|
97
|
+
},
|
98
|
+
labelAlign: {
|
99
|
+
required: false,
|
100
|
+
default: 'vertical'
|
101
|
+
},
|
102
|
+
},
|
103
|
+
}
|
104
|
+
</script>
|
@@ -7,7 +7,11 @@
|
|
7
7
|
@click="fetchPage(paginationParams.previous)"
|
8
8
|
>
|
9
9
|
<arrowIconContainer>
|
10
|
-
<icon
|
10
|
+
<icon
|
11
|
+
name="arrow_left"
|
12
|
+
:color="getTheme.colors.brightBlue"
|
13
|
+
size="12px"
|
14
|
+
/>
|
11
15
|
</arrowIconContainer>
|
12
16
|
<arrowText>{{ $gettext('back') }}</arrowText>
|
13
17
|
</paginationLink>
|
@@ -55,7 +59,11 @@
|
|
55
59
|
>
|
56
60
|
<arrowText>{{ $gettext('forward') }}</arrowText>
|
57
61
|
<arrowIconContainer>
|
58
|
-
<icon
|
62
|
+
<icon
|
63
|
+
name="arrow_right"
|
64
|
+
:color="getTheme.colors.brightBlue"
|
65
|
+
size="12px"
|
66
|
+
/>
|
59
67
|
</arrowIconContainer>
|
60
68
|
</paginationLink>
|
61
69
|
</paginationWrapper>
|
@@ -64,8 +72,10 @@
|
|
64
72
|
<script>
|
65
73
|
import styled from 'vue-styled-components'
|
66
74
|
import icon from '../icon'
|
75
|
+
import theme from '@/assets/theme.js'
|
76
|
+
|
67
77
|
const paginationWrapper = styled.nav`
|
68
|
-
color:
|
78
|
+
color: ${(props) => props.theme.brightBlue};
|
69
79
|
font-size: 13px;
|
70
80
|
display: flex;
|
71
81
|
flex-wrap: wrap;
|
@@ -85,7 +95,7 @@ const paginationLink = styled.div`
|
|
85
95
|
|
86
96
|
&.active {
|
87
97
|
color: #fff;
|
88
|
-
background-color:
|
98
|
+
background-color: ${(props) => props.theme.brightBlue};
|
89
99
|
padding: 7px 12px;
|
90
100
|
border-radius: 4px;
|
91
101
|
}
|
@@ -106,6 +116,11 @@ export default {
|
|
106
116
|
arrowIconContainer
|
107
117
|
},
|
108
118
|
props: ['fetchPage', 'currentPage', 'paginationParams'],
|
119
|
+
computed: {
|
120
|
+
getTheme() {
|
121
|
+
return theme
|
122
|
+
}
|
123
|
+
},
|
109
124
|
methods: {
|
110
125
|
getNewProjects(num) {
|
111
126
|
this.$emit('on-pagination-change', num)
|
@@ -10,7 +10,7 @@
|
|
10
10
|
ref="tableRef"
|
11
11
|
:isPositionAbsolute="doesTableContainDraggables"
|
12
12
|
>
|
13
|
-
<table-wrapper :fullWidth="fullWidth">
|
13
|
+
<table-wrapper class="main-table-wrapper" :fullWidth="fullWidth">
|
14
14
|
<spinner-wrapper v-if="isLoading">
|
15
15
|
<spinner />
|
16
16
|
</spinner-wrapper>
|
@@ -72,7 +72,7 @@ const TableWrapper = styled('div', wrapperAttrs)`
|
|
72
72
|
overflow-y: hidden;
|
73
73
|
|
74
74
|
::-webkit-scrollbar {
|
75
|
-
height:
|
75
|
+
height: 10px; //height of the whole scrollbar area
|
76
76
|
}
|
77
77
|
|
78
78
|
::-webkit-scrollbar-track {
|
@@ -81,7 +81,7 @@ const TableWrapper = styled('div', wrapperAttrs)`
|
|
81
81
|
}
|
82
82
|
|
83
83
|
::-webkit-scrollbar-thumb {
|
84
|
-
border-bottom:
|
84
|
+
border-bottom: 10px solid ${(props) => props.theme.colors.brightBlue}; // width of the actual scrollbar
|
85
85
|
border-radius: 4px;
|
86
86
|
}
|
87
87
|
`
|
@@ -23,17 +23,17 @@
|
|
23
23
|
v-for="child in childOpen"
|
24
24
|
:key="child.value"
|
25
25
|
@click.stop="
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
onSelect({
|
27
|
+
item: child,
|
28
|
+
hasChildren: hasChildren(child)
|
29
|
+
})
|
30
|
+
"
|
31
31
|
@keyup.enter.stop="
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
onSelect({
|
33
|
+
item: child,
|
34
|
+
hasChildren: hasChildren(child)
|
35
|
+
})
|
36
|
+
"
|
37
37
|
>
|
38
38
|
{{ child.name }}
|
39
39
|
</option-child>
|
@@ -45,10 +45,11 @@
|
|
45
45
|
tabindex="0"
|
46
46
|
@click.stop="onSelect({ item: item, hasChildren: hasChildren(item) })"
|
47
47
|
@keyup.enter="
|
48
|
-
|
49
|
-
|
48
|
+
onSelect({ item: item, hasChildren: hasChildren(item) })
|
49
|
+
"
|
50
50
|
@mouseover="onItemHover({ index, item })"
|
51
51
|
:isDisabled="item.disabled"
|
52
|
+
:title="item.title"
|
52
53
|
>
|
53
54
|
<arrow-left
|
54
55
|
:hasChildren="hasChildren(item)"
|
@@ -68,9 +69,10 @@
|
|
68
69
|
// import ThreeDots from "@eturnity/eturnity_reusable_components/src/components/threeDots"
|
69
70
|
// To use:
|
70
71
|
// <three-dots
|
72
|
+
// :isLoading="true"
|
71
73
|
// :options="listOptions"
|
74
|
+
// @on-click="onClick($event)"
|
72
75
|
// @on-select="onSelect($event)"
|
73
|
-
// :isLoading="true"
|
74
76
|
// />
|
75
77
|
// options to pass:
|
76
78
|
// listOptions: [
|
@@ -203,6 +205,8 @@ const OptionItem = styled('div', optionAttrs)`
|
|
203
205
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
204
206
|
font-size: 13px;
|
205
207
|
position: relative;
|
208
|
+
${(props) => (props.isDisabled ? `background-color: ${ props.theme.colors.grey5 }!important` : '')};
|
209
|
+
${(props) => (props.isDisabled ? `color: ${ props.theme.colors.grey2 }` : '')};
|
206
210
|
|
207
211
|
&:hover {
|
208
212
|
background-color: #ebeef4;
|
@@ -368,6 +372,7 @@ export default {
|
|
368
372
|
},
|
369
373
|
onSelect({ item, hasChildren }) {
|
370
374
|
if (hasChildren || item.disabled) {
|
375
|
+
this.$emit('on-click', item)
|
371
376
|
return
|
372
377
|
}
|
373
378
|
this.$emit('on-select', item)
|