@eturnity/eturnity_reusable_components 6.42.1-EPDM-8599.0 → 6.42.1-EPDM-3013.7
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 +6 -3
- package/postcss.config.js +6 -0
- package/src/App.vue +1 -13
- package/src/assets/svgIcons/update.svg +3 -0
- package/src/components/filter/filterSettings.vue +645 -0
- package/src/components/filter/index.vue +132 -0
- package/src/components/filter/parentDropdown.vue +91 -0
- package/src/components/iconWrapper/index.vue +125 -118
- package/src/components/inputs/searchInput/index.vue +20 -10
- package/src/components/inputs/select/index.vue +4 -11
- package/src/components/inputs/select/option/index.vue +57 -48
- package/src/helpers/translateLang.js +2 -0
- package/src/components/infoCard/index.vue +0 -38
@@ -0,0 +1,132 @@
|
|
1
|
+
<template>
|
2
|
+
<page-wrapper ref="dropdown">
|
3
|
+
<parent-dropdown
|
4
|
+
@on-toggle="onToggleDropdown()"
|
5
|
+
:isOpen="isDropdownOpen"
|
6
|
+
:dropdownText="dropdownText ? dropdownText : 'Default view'"
|
7
|
+
/>
|
8
|
+
<filter-settings
|
9
|
+
v-if="isDropdownOpen"
|
10
|
+
:filterData="filterData"
|
11
|
+
:filterViews="filterViews"
|
12
|
+
:buttonText="buttonText"
|
13
|
+
@on-view-select="onViewSelect($event)"
|
14
|
+
@on-view-delete="onViewDelete($event)"
|
15
|
+
@on-save-new-view="$emit('on-save-new-view')"
|
16
|
+
@on-filter-change="onFilterChange($event)"
|
17
|
+
@on-cancel-view="onCancelSettings()"
|
18
|
+
@on-drag-change="$emit('on-drag-change', $event)"
|
19
|
+
@on-apply-current-view="onApplyCurrentView()"
|
20
|
+
@on-prevent-close="onPreventClose($event)"
|
21
|
+
@on-reset-filters="onResetFilters()"
|
22
|
+
:hasActiveView="hasActiveView"
|
23
|
+
:activeView="activeView"
|
24
|
+
:activeLanguage="activeLanguage"
|
25
|
+
:settingsTranslations="settingsTranslations"
|
26
|
+
/>
|
27
|
+
</page-wrapper>
|
28
|
+
</template>
|
29
|
+
|
30
|
+
<script>
|
31
|
+
import styled from 'vue-styled-components'
|
32
|
+
import parentDropdown from './parentDropdown'
|
33
|
+
import filterSettings from './filterSettings'
|
34
|
+
|
35
|
+
const PageWrapper = styled.div`
|
36
|
+
position: relative;
|
37
|
+
`
|
38
|
+
|
39
|
+
export default {
|
40
|
+
name: 'filter-component',
|
41
|
+
components: {
|
42
|
+
parentDropdown,
|
43
|
+
PageWrapper,
|
44
|
+
filterSettings
|
45
|
+
},
|
46
|
+
props: {
|
47
|
+
filterData: {
|
48
|
+
required: true
|
49
|
+
},
|
50
|
+
dropdownText: {
|
51
|
+
required: false
|
52
|
+
},
|
53
|
+
filterViews: {
|
54
|
+
required: true
|
55
|
+
},
|
56
|
+
activeView: {
|
57
|
+
required: false,
|
58
|
+
default: null
|
59
|
+
},
|
60
|
+
buttonText: {
|
61
|
+
required: false
|
62
|
+
},
|
63
|
+
hasActiveView: {
|
64
|
+
required: false
|
65
|
+
},
|
66
|
+
activeLanguage: {
|
67
|
+
required: false,
|
68
|
+
default: 'en-us'
|
69
|
+
},
|
70
|
+
settingsTranslations: {
|
71
|
+
required: false
|
72
|
+
}
|
73
|
+
},
|
74
|
+
data() {
|
75
|
+
return {
|
76
|
+
isDropdownOpen: false,
|
77
|
+
activeFilter: null,
|
78
|
+
preventOutsideClick: false
|
79
|
+
}
|
80
|
+
},
|
81
|
+
methods: {
|
82
|
+
onToggleDropdown() {
|
83
|
+
this.isDropdownOpen = !this.isDropdownOpen
|
84
|
+
},
|
85
|
+
clickOutside(event) {
|
86
|
+
if (
|
87
|
+
!this.$refs.dropdown.$el.contains(event.target) &&
|
88
|
+
!this.preventOutsideClick
|
89
|
+
) {
|
90
|
+
this.isDropdownOpen = false
|
91
|
+
}
|
92
|
+
},
|
93
|
+
onPreventClose(value) {
|
94
|
+
setTimeout(() => {
|
95
|
+
this.preventOutsideClick = value
|
96
|
+
}, 100)
|
97
|
+
},
|
98
|
+
onFilterChange(data) {
|
99
|
+
// this.preventOutsideClick = true is needed for when the user clicks on the calendar icon on the date range
|
100
|
+
// because clicking the calendar does not trigger the @focus
|
101
|
+
this.preventOutsideClick = true
|
102
|
+
this.$emit('on-filter-settings-change', data)
|
103
|
+
this.onPreventClose(false)
|
104
|
+
},
|
105
|
+
onCancelSettings() {
|
106
|
+
this.onToggleDropdown()
|
107
|
+
this.$emit('on-cancel-view')
|
108
|
+
},
|
109
|
+
onViewSelect(item) {
|
110
|
+
this.onToggleDropdown()
|
111
|
+
this.$emit('on-filter-view-select', item)
|
112
|
+
},
|
113
|
+
onViewDelete(item) {
|
114
|
+
this.$emit('on-filter-view-delete', item)
|
115
|
+
},
|
116
|
+
onApplyCurrentView() {
|
117
|
+
this.onToggleDropdown()
|
118
|
+
this.$emit('on-apply-current-view')
|
119
|
+
},
|
120
|
+
onResetFilters() {
|
121
|
+
this.onToggleDropdown()
|
122
|
+
this.$emit('on-reset-filters')
|
123
|
+
}
|
124
|
+
},
|
125
|
+
mounted() {
|
126
|
+
document.addEventListener('click', this.clickOutside)
|
127
|
+
},
|
128
|
+
beforeDestroy() {
|
129
|
+
document.removeEventListener('click', this.clickOutside)
|
130
|
+
}
|
131
|
+
}
|
132
|
+
</script>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
<template>
|
2
|
+
<page-wrapper @click="$emit('on-toggle')">
|
3
|
+
<icon-wrapper>
|
4
|
+
<icon name="settings" size="18px" />
|
5
|
+
</icon-wrapper>
|
6
|
+
<title-wrapper :isOpen="isOpen">
|
7
|
+
<title-text>
|
8
|
+
{{ dropdownText }}
|
9
|
+
</title-text>
|
10
|
+
<arrow-wrapper>
|
11
|
+
<icon
|
12
|
+
@click.native.stop="$emit('on-toggle')"
|
13
|
+
:name="isOpen ? 'arrow_up' : 'arrow_down'"
|
14
|
+
size="12px"
|
15
|
+
/>
|
16
|
+
</arrow-wrapper>
|
17
|
+
</title-wrapper>
|
18
|
+
</page-wrapper>
|
19
|
+
</template>
|
20
|
+
|
21
|
+
<script>
|
22
|
+
import styled from 'vue-styled-components'
|
23
|
+
import Icon from '../icon'
|
24
|
+
|
25
|
+
const PageWrapper = styled.div`
|
26
|
+
display: grid;
|
27
|
+
grid-template-columns: auto auto;
|
28
|
+
cursor: pointer;
|
29
|
+
`
|
30
|
+
|
31
|
+
const IconWrapper = styled.div`
|
32
|
+
display: grid;
|
33
|
+
align-items: center;
|
34
|
+
justify-items: center;
|
35
|
+
border: 1px solid ${(props) => props.theme.colors.grey4};
|
36
|
+
border-radius: 4px 0px 0px 4px;
|
37
|
+
padding: 6px;
|
38
|
+
`
|
39
|
+
|
40
|
+
const TitleAttrs = { isOpen: Boolean }
|
41
|
+
const TitleWrapper = styled('div', TitleAttrs)`
|
42
|
+
display: grid;
|
43
|
+
grid-template-columns: auto auto;
|
44
|
+
align-items: center;
|
45
|
+
justify-items: center;
|
46
|
+
grid-gap: 10px;
|
47
|
+
border: 1px solid ${(props) => props.theme.colors.grey4};
|
48
|
+
background-color: ${(props) =>
|
49
|
+
props.isOpen ? props.theme.colors.grey5 : props.theme.colors.white};
|
50
|
+
border-left: none;
|
51
|
+
border-radius: 0px 4px 4px 0px;
|
52
|
+
padding: 6px 14px;
|
53
|
+
user-select: none;
|
54
|
+
`
|
55
|
+
|
56
|
+
const TitleText = styled.div`
|
57
|
+
font-size: 13px;
|
58
|
+
`
|
59
|
+
|
60
|
+
const ArrowWrapper = styled.div`
|
61
|
+
display: grid;
|
62
|
+
align-items: center;
|
63
|
+
|
64
|
+
div {
|
65
|
+
height: auto !important;
|
66
|
+
min-height: unset;
|
67
|
+
}
|
68
|
+
`
|
69
|
+
|
70
|
+
export default {
|
71
|
+
name: 'parent-dropdown',
|
72
|
+
components: {
|
73
|
+
PageWrapper,
|
74
|
+
Icon,
|
75
|
+
IconWrapper,
|
76
|
+
TitleWrapper,
|
77
|
+
TitleText,
|
78
|
+
ArrowWrapper
|
79
|
+
},
|
80
|
+
props: {
|
81
|
+
isOpen: {
|
82
|
+
required: true,
|
83
|
+
default: false
|
84
|
+
},
|
85
|
+
dropdownText: {
|
86
|
+
required: true,
|
87
|
+
default: 'View'
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
</script>
|
@@ -1,129 +1,136 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
:disabled="disabled"
|
4
|
-
:size="size"
|
5
|
-
:backgroundColor="backgroundColor"
|
2
|
+
<Wrapper
|
3
|
+
:disabled="disabled"
|
4
|
+
:size="size"
|
5
|
+
:backgroundColor="backgroundColor"
|
6
6
|
:borderRadius="borderRadius"
|
7
7
|
:hasBorder="hasBorder"
|
8
8
|
:color="iconColor"
|
9
9
|
:hoveredBackgroundColor="hoveredBackgroundColor"
|
10
10
|
:isHovered="isHovered"
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
11
|
+
>
|
12
|
+
<icon
|
13
|
+
:disabled="disabled"
|
14
|
+
:size="iconSize"
|
15
|
+
:name="name"
|
16
|
+
:color="iconColor"
|
17
|
+
:hoveredColor="hoveredIconColor"
|
18
|
+
/>
|
19
|
+
<caret v-if="hasCaret">
|
20
|
+
<iconWrapper
|
21
|
+
:disabled="disabled"
|
22
|
+
size="10px"
|
23
|
+
name="arrow_down"
|
24
|
+
:iconColor="iconColor"
|
25
|
+
:hoveredBackgroundColor="hoveredIconColor"
|
26
|
+
borderRadius="1px"
|
27
|
+
/>
|
28
|
+
</caret>
|
29
|
+
</Wrapper>
|
30
|
+
</template>
|
31
|
+
|
32
|
+
<script>
|
33
|
+
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
34
|
+
// How to use:
|
35
|
+
//<icon
|
36
|
+
// name="House" //required. a svg file named [name].svg should be present in /assets/svgIcons
|
37
|
+
// color="red"
|
38
|
+
// hoveredColor="blue"
|
39
|
+
// size="60px" by default, this is 30px
|
40
|
+
// />
|
41
|
+
|
42
|
+
import styled from 'vue-styled-components'
|
43
|
+
import icon from '../icon'
|
44
|
+
const wrapperAttrs = {
|
45
|
+
isHovered: Boolean,
|
46
|
+
borderRadius: String,
|
47
|
+
disabled: Boolean,
|
48
|
+
size: String,
|
49
|
+
backgroundColor: String,
|
50
|
+
hoveredBackgroundColor: String
|
51
|
+
}
|
52
|
+
const Wrapper = styled('div', wrapperAttrs)`
|
53
|
+
position: relative;
|
54
|
+
display: inline-flex;
|
55
|
+
width: ${(props) => props.size};
|
56
|
+
height: ${(props) => props.size};
|
57
|
+
justify-content: center;
|
58
|
+
align-items: center;
|
59
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
60
|
+
background-color: ${(props) =>
|
61
|
+
props.theme.colors[props.backgroundColor] || props.backgroundColor};
|
62
|
+
border-radius: ${(props) => props.borderRadius};
|
63
|
+
${(props) =>
|
64
|
+
props.isHovered
|
65
|
+
? 'background-color:' +
|
66
|
+
props.theme.colors[props.hoveredBackgroundColor] ||
|
67
|
+
props.hoveredBackgroundColor
|
68
|
+
: ''};
|
69
|
+
&:hover {
|
70
|
+
background-color: ${(props) =>
|
71
|
+
props.theme.colors[props.hoveredBackgroundColor] ||
|
72
|
+
props.hoveredBackgroundColor};
|
73
|
+
}
|
74
|
+
`
|
75
|
+
const caret = styled.div`
|
76
|
+
position: absolute;
|
77
|
+
bottom: 3px;
|
78
|
+
right: 2px;
|
79
|
+
height: 10px;
|
80
|
+
`
|
67
81
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
82
|
+
export default {
|
83
|
+
name: 'iconWrapper',
|
84
|
+
components: {
|
85
|
+
Wrapper,
|
86
|
+
icon,
|
87
|
+
caret
|
88
|
+
},
|
89
|
+
props: {
|
90
|
+
disabled: {
|
91
|
+
required: false,
|
92
|
+
default: false
|
93
|
+
},
|
94
|
+
name: {
|
95
|
+
required: true
|
96
|
+
},
|
97
|
+
iconColor: {
|
98
|
+
required: false,
|
99
|
+
default: 'white'
|
100
|
+
},
|
101
|
+
hoveredIconColor: {
|
102
|
+
required: false
|
103
|
+
},
|
104
|
+
backgroundColor: {
|
105
|
+
required: false
|
106
|
+
},
|
107
|
+
hoveredBackgroundColor: {
|
108
|
+
required: false,
|
109
|
+
default: 'transparentWhite1'
|
110
|
+
},
|
111
|
+
size: {
|
112
|
+
required: false,
|
113
|
+
default: '32px'
|
114
|
+
},
|
115
|
+
iconSize: {
|
116
|
+
required: false,
|
117
|
+
default: '18px'
|
118
|
+
},
|
119
|
+
hasCaret: {
|
120
|
+
required: false,
|
121
|
+
default: false
|
74
122
|
},
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
default: false
|
79
|
-
},
|
80
|
-
name: {
|
81
|
-
required: true
|
82
|
-
},
|
83
|
-
iconColor: {
|
84
|
-
required: false,
|
85
|
-
default: 'white'
|
86
|
-
},
|
87
|
-
hoveredIconColor: {
|
88
|
-
required: false
|
89
|
-
},
|
90
|
-
backgroundColor: {
|
91
|
-
required: false,
|
92
|
-
},
|
93
|
-
hasBorder: {
|
94
|
-
required: false,
|
95
|
-
},
|
96
|
-
hoveredBackgroundColor: {
|
97
|
-
required: false,
|
98
|
-
default:"transparentWhite1"
|
99
|
-
},
|
100
|
-
size: {
|
101
|
-
required: false,
|
102
|
-
default: '32px'
|
103
|
-
},
|
104
|
-
iconSize:{
|
105
|
-
required: false,
|
106
|
-
default:'18px'
|
107
|
-
},
|
108
|
-
hasCaret:{
|
109
|
-
required: false,
|
110
|
-
default: false
|
111
|
-
},
|
112
|
-
borderRadius:{
|
113
|
-
required:false,
|
114
|
-
default:'4px'
|
115
|
-
},
|
116
|
-
isHovered:{
|
117
|
-
required:false,
|
118
|
-
default:false
|
119
|
-
},
|
120
|
-
isStriked:{
|
121
|
-
required:false,
|
122
|
-
default:false
|
123
|
-
}
|
123
|
+
borderRadius: {
|
124
|
+
required: false,
|
125
|
+
default: '6px'
|
124
126
|
},
|
125
|
-
|
126
|
-
|
127
|
+
isHovered: {
|
128
|
+
required: false,
|
129
|
+
default: false
|
127
130
|
}
|
131
|
+
},
|
132
|
+
data() {
|
133
|
+
return {}
|
128
134
|
}
|
129
|
-
|
135
|
+
}
|
136
|
+
</script>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<container>
|
2
|
+
<container :inputWidth="inputWidth">
|
3
3
|
<input-wrapper>
|
4
4
|
<input-container
|
5
5
|
ref="inputElement"
|
@@ -9,6 +9,7 @@
|
|
9
9
|
:disabled="disabled"
|
10
10
|
:isDisabled="disabled"
|
11
11
|
:inputWidth="inputWidth"
|
12
|
+
:isFilter="isFilter"
|
12
13
|
:hasFocus="hasFocus"
|
13
14
|
/>
|
14
15
|
<img
|
@@ -28,18 +29,24 @@
|
|
28
29
|
// :disabled="true"
|
29
30
|
// inputWidth="250px"
|
30
31
|
// @on-change="function($event)"
|
32
|
+
// :isFilter="true" // to set the height at 30px
|
31
33
|
// />
|
32
34
|
import styled from 'vue-styled-components'
|
33
35
|
|
34
|
-
const
|
35
|
-
|
36
|
+
const inputAttrs = {
|
37
|
+
isDisabled: Boolean,
|
38
|
+
inputWidth: String,
|
39
|
+
isFilter: Boolean
|
40
|
+
}
|
41
|
+
const Container = styled('div', inputAttrs)`
|
42
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
36
43
|
position: relative;
|
37
44
|
`
|
38
45
|
|
39
|
-
const inputAttrs = { isDisabled: Boolean, inputWidth: String }
|
40
46
|
const InputContainer = styled('input', inputAttrs)`
|
41
|
-
border: 1px solid ${(props) => props.theme.colors.
|
42
|
-
padding:
|
47
|
+
border: 1px solid ${(props) => props.theme.colors.grey4};
|
48
|
+
padding: ${(props) =>
|
49
|
+
props.isFilter ? '7px 30px 7px 10px' : '11px 30px 11px 10px'};
|
43
50
|
border-radius: 4px;
|
44
51
|
font-size: 13px;
|
45
52
|
color: ${(props) => props.theme.colors.black};
|
@@ -90,6 +97,10 @@ export default {
|
|
90
97
|
required: false,
|
91
98
|
default: null
|
92
99
|
},
|
100
|
+
isFilter: {
|
101
|
+
required: false,
|
102
|
+
default: false
|
103
|
+
},
|
93
104
|
hasFocus: {
|
94
105
|
required: false,
|
95
106
|
default: false
|
@@ -99,10 +110,10 @@ export default {
|
|
99
110
|
onChangeHandler(event) {
|
100
111
|
this.$emit('on-change', event)
|
101
112
|
},
|
102
|
-
focusInputElement(){
|
113
|
+
focusInputElement() {
|
103
114
|
this.$nextTick(() => {
|
104
|
-
this.$refs.inputElement.$el.focus()
|
105
|
-
})
|
115
|
+
this.$refs.inputElement.$el.focus()
|
116
|
+
})
|
106
117
|
}
|
107
118
|
},
|
108
119
|
watch: {
|
@@ -112,6 +123,5 @@ export default {
|
|
112
123
|
}
|
113
124
|
}
|
114
125
|
}
|
115
|
-
|
116
126
|
}
|
117
127
|
</script>
|
@@ -32,7 +32,6 @@
|
|
32
32
|
ref="select"
|
33
33
|
@click="toggleDropdown"
|
34
34
|
:selectHeight="selectHeight"
|
35
|
-
:selectMinHeight="selectMinHeight"
|
36
35
|
:bgColor="
|
37
36
|
buttonBgColor || colorMode == 'dark' ? 'transparentBlack1' : 'white'
|
38
37
|
"
|
@@ -145,7 +144,6 @@ const Caret = styled.div`
|
|
145
144
|
min-width: 30px;
|
146
145
|
height: 100%;
|
147
146
|
align-items: stretch
|
148
|
-
padding-top: 5px;
|
149
147
|
cursor: pointer;
|
150
148
|
margin-left: auto;
|
151
149
|
`
|
@@ -193,7 +191,6 @@ const selectButtonAttrs = {
|
|
193
191
|
hasError: Boolean,
|
194
192
|
disabled: Boolean,
|
195
193
|
selectHeight: String,
|
196
|
-
selectMinHeight: String,
|
197
194
|
isSearchBarVisible: Boolean,
|
198
195
|
showBorder: Boolean
|
199
196
|
}
|
@@ -204,7 +201,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
204
201
|
padding: ${(props) => (props.isSearchBarVisible ? '0' : '0px 0px 0 15px')};
|
205
202
|
text-align: left;
|
206
203
|
border-radius: 4px;
|
207
|
-
min-height:
|
204
|
+
min-height: 36px;
|
208
205
|
display: flex;
|
209
206
|
align-items: center;
|
210
207
|
max-height: ${(props) => props.selectHeight};
|
@@ -254,8 +251,9 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
254
251
|
props.theme.colors[props.fontColor]
|
255
252
|
? props.theme.colors[props.fontColor]
|
256
253
|
: props.fontColor};
|
257
|
-
max-height:300px;
|
258
|
-
|
254
|
+
max-height: 300px;
|
255
|
+
min-height: 39px;
|
256
|
+
overflow-y: auto;
|
259
257
|
& [data-value="${(props) => props.selectedValue}"]{
|
260
258
|
backdrop-filter: brightness(1.4);
|
261
259
|
}
|
@@ -305,14 +303,9 @@ export default {
|
|
305
303
|
default: null
|
306
304
|
},
|
307
305
|
selectHeight: {
|
308
|
-
type: String,
|
309
306
|
required: false,
|
310
307
|
default: null
|
311
308
|
},
|
312
|
-
selectMinHeight: {
|
313
|
-
required: false,
|
314
|
-
default: '36px'
|
315
|
-
},
|
316
309
|
optionWidth: {
|
317
310
|
required: false,
|
318
311
|
default: null
|