@eturnity/eturnity_reusable_components 7.24.3-EPDM-10576.1 → 7.24.3-EPDM-11320.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/.eslintrc.js +125 -0
- package/package.json +6 -20
- package/src/App.vue +75 -70
- package/src/components/addNewButton/index.vue +24 -27
- package/src/components/banner/actionBanner/index.vue +32 -30
- package/src/components/banner/banner/index.vue +88 -80
- package/src/components/banner/infoBanner/index.vue +36 -44
- package/src/components/buttons/buttonIcon/index.vue +83 -78
- package/src/components/buttons/closeButton/index.vue +26 -26
- package/src/components/buttons/mainButton/index.vue +80 -76
- package/src/components/card/index.vue +56 -52
- package/src/components/collapsableInfoText/index.vue +81 -76
- package/src/components/deleteIcon/index.vue +31 -28
- package/src/components/draggableInputHandle/index.vue +20 -17
- package/src/components/dropdown/Dropdown.stories.js +8 -8
- package/src/components/dropdown/index.vue +75 -72
- package/src/components/errorMessage/index.vue +23 -23
- package/src/components/filter/filterSettings.vue +349 -333
- package/src/components/filter/index.vue +130 -130
- package/src/components/filter/parentDropdown.vue +43 -40
- package/src/components/icon/Icons.stories.js +4 -4
- package/src/components/icon/iconCache.js +1 -1
- package/src/components/icon/iconCollection.vue +40 -37
- package/src/components/icon/index.vue +72 -65
- package/src/components/iconWrapper/index.vue +122 -118
- package/src/components/infoCard/index.vue +20 -17
- package/src/components/infoText/index.vue +88 -82
- package/src/components/inputs/checkbox/index.vue +91 -94
- package/src/components/inputs/inputNumber/index.vue +508 -488
- package/src/components/inputs/inputNumberQuestion/index.vue +127 -124
- package/src/components/inputs/inputText/index.vue +265 -252
- package/src/components/inputs/radioButton/index.vue +135 -120
- package/src/components/inputs/searchInput/index.vue +84 -81
- package/src/components/inputs/select/index.vue +644 -631
- package/src/components/inputs/select/option/index.vue +91 -91
- package/src/components/inputs/select/select.stories.js +7 -7
- package/src/components/inputs/slider/index.vue +46 -46
- package/src/components/inputs/switchField/index.vue +159 -152
- package/src/components/inputs/textAreaInput/index.vue +120 -113
- package/src/components/inputs/toggle/index.vue +137 -127
- package/src/components/label/index.vue +64 -61
- package/src/components/markerItem/index.vue +40 -40
- package/src/components/modals/actionModal/index.vue +32 -29
- package/src/components/modals/infoModal/index.vue +34 -27
- package/src/components/modals/modal/index.vue +88 -80
- package/src/components/navigationTabs/index.vue +50 -47
- package/src/components/pageSubtitle/index.vue +33 -29
- package/src/components/pageTitle/index.vue +47 -39
- package/src/components/pagination/index.vue +64 -62
- package/src/components/progressBar/index.vue +70 -67
- package/src/components/projectMarker/index.vue +172 -163
- package/src/components/rangeSlider/Slider.vue +449 -449
- package/src/components/rangeSlider/index.vue +282 -270
- package/src/components/rangeSlider/utils/dom.js +3 -3
- package/src/components/selectedOptions/index.vue +51 -51
- package/src/components/sideMenu/index.vue +117 -109
- package/src/components/spinner/index.vue +37 -34
- package/src/components/tableDropdown/index.vue +343 -326
- package/src/components/tables/mainTable/index.vue +109 -106
- package/src/components/tables/viewTable/index.vue +105 -92
- package/src/components/threeDots/index.vue +174 -171
- package/src/components/videoThumbnail/index.vue +67 -59
- package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
- package/.prettierrc +0 -7
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
@@ -1,154 +1,154 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
2
|
+
<PageWrapper ref="dropdown">
|
3
|
+
<ParentDropdown
|
4
|
+
:dropdown-text="dropdownText ? dropdownText : 'Default view'"
|
5
|
+
:is-open="isDropdownOpen"
|
4
6
|
@on-toggle="onToggleDropdown()"
|
5
|
-
:isOpen="isDropdownOpen"
|
6
|
-
:dropdownText="dropdownText ? dropdownText : 'Default view'"
|
7
7
|
/>
|
8
|
-
<
|
8
|
+
<FilterSettings
|
9
9
|
v-if="isDropdownOpen"
|
10
|
-
:
|
11
|
-
:
|
12
|
-
:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
:active-language="activeLanguage"
|
11
|
+
:active-view="activeView"
|
12
|
+
:button-text="buttonText"
|
13
|
+
:filter-data="filterData"
|
14
|
+
:filter-views="filterViews"
|
15
|
+
:has-active-view="hasActiveView"
|
16
|
+
:settings-translations="settingsTranslations"
|
17
|
+
@on-apply-current-view="onApplyCurrentView()"
|
17
18
|
@on-cancel-view="onCancelSettings()"
|
19
|
+
@on-container-click="onContainerClick()"
|
18
20
|
@on-drag-change="$emit('on-drag-change', $event)"
|
19
|
-
@on-
|
21
|
+
@on-filter-change="onFilterChange($event)"
|
20
22
|
@on-prevent-close="onPreventClose($event)"
|
21
23
|
@on-reset-filters="onResetFilters()"
|
22
|
-
@on-
|
23
|
-
|
24
|
-
|
25
|
-
:activeLanguage="activeLanguage"
|
26
|
-
:settingsTranslations="settingsTranslations"
|
24
|
+
@on-save-new-view="$emit('on-save-new-view')"
|
25
|
+
@on-view-delete="onViewDelete($event)"
|
26
|
+
@on-view-select="onViewSelect($event)"
|
27
27
|
/>
|
28
|
-
</
|
28
|
+
</PageWrapper>
|
29
29
|
</template>
|
30
30
|
|
31
31
|
<script>
|
32
|
-
import styled from 'vue3-styled-components'
|
33
|
-
import
|
34
|
-
import
|
32
|
+
import styled from 'vue3-styled-components'
|
33
|
+
import ParentDropdown from './parentDropdown'
|
34
|
+
import FilterSettings from './filterSettings'
|
35
35
|
|
36
|
-
const PageWrapper = styled.div`
|
36
|
+
const PageWrapper = styled.div`
|
37
37
|
position: relative;
|
38
38
|
`
|
39
39
|
|
40
|
-
export default {
|
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
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
}
|
77
|
-
},
|
78
|
-
data() {
|
79
|
-
return {
|
80
|
-
isDropdownOpen: false,
|
81
|
-
activeFilter: null,
|
82
|
-
preventOutsideClick: false
|
83
|
-
}
|
84
|
-
},
|
85
|
-
methods: {
|
86
|
-
onToggleDropdown() {
|
87
|
-
this.isDropdownOpen = !this.isDropdownOpen
|
88
|
-
},
|
89
|
-
onContainerClick() {
|
90
|
-
// due to newer versions of Chrome (121), contains() is not always working.
|
91
|
-
// So, we need to add this so that the filter modal won't close
|
92
|
-
// when we open a dropdown. EPDM-9732
|
93
|
-
this.preventOutsideClick = true
|
94
|
-
setTimeout(() => {
|
95
|
-
this.preventOutsideClick = false
|
96
|
-
}, 100)
|
97
|
-
},
|
98
|
-
clickOutside(event) {
|
99
|
-
if (
|
100
|
-
this.$refs.dropdown &&
|
101
|
-
!this.$refs.dropdown.$el.contains(event.target) &&
|
102
|
-
!this.preventOutsideClick
|
103
|
-
) {
|
104
|
-
this.isDropdownOpen = false
|
40
|
+
export default {
|
41
|
+
name: 'FilterComponent',
|
42
|
+
components: {
|
43
|
+
ParentDropdown,
|
44
|
+
PageWrapper,
|
45
|
+
FilterSettings
|
46
|
+
},
|
47
|
+
props: {
|
48
|
+
filterData: {
|
49
|
+
required: true
|
50
|
+
},
|
51
|
+
dropdownText: {
|
52
|
+
required: false
|
53
|
+
},
|
54
|
+
filterViews: {
|
55
|
+
required: true
|
56
|
+
},
|
57
|
+
activeView: {
|
58
|
+
required: false,
|
59
|
+
default: null
|
60
|
+
},
|
61
|
+
buttonText: {
|
62
|
+
required: false
|
63
|
+
},
|
64
|
+
hasActiveView: {
|
65
|
+
required: false
|
66
|
+
},
|
67
|
+
activeLanguage: {
|
68
|
+
required: false,
|
69
|
+
default: 'en-us'
|
70
|
+
},
|
71
|
+
settingsTranslations: {
|
72
|
+
required: false
|
73
|
+
},
|
74
|
+
closeDropdown: {
|
75
|
+
required: false
|
105
76
|
}
|
106
77
|
},
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
// this.preventOutsideClick = true is needed for when the user clicks on the calendar icon on the date range
|
114
|
-
// because clicking the calendar does not trigger the @focus
|
115
|
-
this.preventOutsideClick = true
|
116
|
-
this.$emit('on-filter-settings-change', data)
|
117
|
-
this.onPreventClose(false)
|
118
|
-
},
|
119
|
-
onCancelSettings() {
|
120
|
-
this.onToggleDropdown()
|
121
|
-
this.$emit('on-cancel-view')
|
122
|
-
},
|
123
|
-
onViewSelect(item) {
|
124
|
-
this.onToggleDropdown()
|
125
|
-
this.$emit('on-filter-view-select', item)
|
126
|
-
},
|
127
|
-
onViewDelete(item) {
|
128
|
-
this.onToggleDropdown()
|
129
|
-
this.$emit('on-filter-view-delete', item)
|
78
|
+
data() {
|
79
|
+
return {
|
80
|
+
isDropdownOpen: false,
|
81
|
+
activeFilter: null,
|
82
|
+
preventOutsideClick: false
|
83
|
+
}
|
130
84
|
},
|
131
|
-
|
132
|
-
|
133
|
-
|
85
|
+
watch: {
|
86
|
+
closeDropdown(newVal) {
|
87
|
+
if (newVal) {
|
88
|
+
this.isDropdownOpen = false
|
89
|
+
}
|
90
|
+
}
|
134
91
|
},
|
135
|
-
|
136
|
-
this.
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
this.
|
92
|
+
mounted() {
|
93
|
+
document.addEventListener('click', this.clickOutside)
|
94
|
+
},
|
95
|
+
beforeDestroy() {
|
96
|
+
document.removeEventListener('click', this.clickOutside)
|
97
|
+
},
|
98
|
+
methods: {
|
99
|
+
onToggleDropdown() {
|
100
|
+
this.isDropdownOpen = !this.isDropdownOpen
|
101
|
+
},
|
102
|
+
onContainerClick() {
|
103
|
+
// due to newer versions of Chrome (121), contains() is not always working.
|
104
|
+
// So, we need to add this so that the filter modal won't close
|
105
|
+
// when we open a dropdown. EPDM-9732
|
106
|
+
this.preventOutsideClick = true
|
107
|
+
setTimeout(() => {
|
108
|
+
this.preventOutsideClick = false
|
109
|
+
}, 100)
|
110
|
+
},
|
111
|
+
clickOutside(event) {
|
112
|
+
if (
|
113
|
+
this.$refs.dropdown &&
|
114
|
+
!this.$refs.dropdown.$el.contains(event.target) &&
|
115
|
+
!this.preventOutsideClick
|
116
|
+
) {
|
117
|
+
this.isDropdownOpen = false
|
118
|
+
}
|
119
|
+
},
|
120
|
+
onPreventClose(value) {
|
121
|
+
setTimeout(() => {
|
122
|
+
this.preventOutsideClick = value
|
123
|
+
}, 100)
|
124
|
+
},
|
125
|
+
onFilterChange(data) {
|
126
|
+
// this.preventOutsideClick = true is needed for when the user clicks on the calendar icon on the date range
|
127
|
+
// because clicking the calendar does not trigger the @focus
|
128
|
+
this.preventOutsideClick = true
|
129
|
+
this.$emit('on-filter-settings-change', data)
|
130
|
+
this.onPreventClose(false)
|
131
|
+
},
|
132
|
+
onCancelSettings() {
|
133
|
+
this.onToggleDropdown()
|
134
|
+
this.$emit('on-cancel-view')
|
135
|
+
},
|
136
|
+
onViewSelect(item) {
|
137
|
+
this.onToggleDropdown()
|
138
|
+
this.$emit('on-filter-view-select', item)
|
139
|
+
},
|
140
|
+
onViewDelete(item) {
|
141
|
+
this.onToggleDropdown()
|
142
|
+
this.$emit('on-filter-view-delete', item)
|
143
|
+
},
|
144
|
+
onApplyCurrentView() {
|
145
|
+
this.onToggleDropdown()
|
146
|
+
this.$emit('on-apply-current-view')
|
147
|
+
},
|
148
|
+
onResetFilters() {
|
149
|
+
this.onToggleDropdown()
|
150
|
+
this.$emit('on-reset-filters')
|
150
151
|
}
|
151
152
|
}
|
152
153
|
}
|
153
|
-
}
|
154
154
|
</script>
|
@@ -1,34 +1,37 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
<PageWrapper @click="$emit('on-toggle')">
|
3
|
+
<IconWrapper>
|
4
|
+
<Icon
|
5
|
+
name="settings"
|
6
|
+
size="18px"
|
7
|
+
/>
|
8
|
+
</IconWrapper>
|
9
|
+
<TitleWrapper :is-open="isOpen">
|
10
|
+
<TitleText>
|
8
11
|
{{ dropdownText }}
|
9
|
-
</
|
10
|
-
<
|
11
|
-
<
|
12
|
-
@click.stop="$emit('on-toggle')"
|
12
|
+
</TitleText>
|
13
|
+
<ArrowWrapper>
|
14
|
+
<Icon
|
13
15
|
:name="isOpen ? 'arrow_up' : 'arrow_down'"
|
14
16
|
size="12px"
|
17
|
+
@click.stop="$emit('on-toggle')"
|
15
18
|
/>
|
16
|
-
</
|
17
|
-
</
|
18
|
-
</
|
19
|
+
</ArrowWrapper>
|
20
|
+
</TitleWrapper>
|
21
|
+
</PageWrapper>
|
19
22
|
</template>
|
20
23
|
|
21
24
|
<script>
|
22
|
-
import styled from 'vue3-styled-components'
|
23
|
-
import Icon from '../icon'
|
25
|
+
import styled from 'vue3-styled-components'
|
26
|
+
import Icon from '../icon'
|
24
27
|
|
25
|
-
const PageWrapper = styled.div`
|
28
|
+
const PageWrapper = styled.div`
|
26
29
|
display: grid;
|
27
30
|
grid-template-columns: auto auto;
|
28
31
|
cursor: pointer;
|
29
32
|
`
|
30
33
|
|
31
|
-
const IconWrapper = styled.div`
|
34
|
+
const IconWrapper = styled.div`
|
32
35
|
display: grid;
|
33
36
|
align-items: center;
|
34
37
|
justify-items: center;
|
@@ -37,8 +40,8 @@ const IconWrapper = styled.div`
|
|
37
40
|
padding: 6px;
|
38
41
|
`
|
39
42
|
|
40
|
-
const TitleAttrs = { isOpen: Boolean }
|
41
|
-
const TitleWrapper = styled('div', TitleAttrs)`
|
43
|
+
const TitleAttrs = { isOpen: Boolean }
|
44
|
+
const TitleWrapper = styled('div', TitleAttrs)`
|
42
45
|
display: grid;
|
43
46
|
grid-template-columns: auto auto;
|
44
47
|
align-items: center;
|
@@ -46,18 +49,18 @@ const TitleWrapper = styled('div', TitleAttrs)`
|
|
46
49
|
grid-gap: 10px;
|
47
50
|
border: 1px solid ${(props) => props.theme.colors.grey4};
|
48
51
|
background-color: ${(props) =>
|
49
|
-
|
52
|
+
props.isOpen ? props.theme.colors.grey5 : props.theme.colors.white};
|
50
53
|
border-left: none;
|
51
54
|
border-radius: 0px 4px 4px 0px;
|
52
55
|
padding: 6px 14px;
|
53
56
|
user-select: none;
|
54
57
|
`
|
55
58
|
|
56
|
-
const TitleText = styled.div`
|
59
|
+
const TitleText = styled.div`
|
57
60
|
font-size: 13px;
|
58
61
|
`
|
59
62
|
|
60
|
-
const ArrowWrapper = styled.div`
|
63
|
+
const ArrowWrapper = styled.div`
|
61
64
|
display: grid;
|
62
65
|
align-items: center;
|
63
66
|
|
@@ -67,25 +70,25 @@ const ArrowWrapper = styled.div`
|
|
67
70
|
}
|
68
71
|
`
|
69
72
|
|
70
|
-
export default {
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
},
|
80
|
-
props: {
|
81
|
-
isOpen: {
|
82
|
-
required: true,
|
83
|
-
default: false
|
73
|
+
export default {
|
74
|
+
name: 'ParentDropdown',
|
75
|
+
components: {
|
76
|
+
PageWrapper,
|
77
|
+
Icon,
|
78
|
+
IconWrapper,
|
79
|
+
TitleWrapper,
|
80
|
+
TitleText,
|
81
|
+
ArrowWrapper
|
84
82
|
},
|
85
|
-
|
86
|
-
|
87
|
-
|
83
|
+
props: {
|
84
|
+
isOpen: {
|
85
|
+
required: true,
|
86
|
+
default: false
|
87
|
+
},
|
88
|
+
dropdownText: {
|
89
|
+
required: true,
|
90
|
+
default: 'View'
|
91
|
+
}
|
88
92
|
}
|
89
93
|
}
|
90
|
-
}
|
91
94
|
</script>
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import
|
1
|
+
import IconCollection from './iconCollection.vue'
|
2
2
|
|
3
3
|
export default {
|
4
4
|
title: 'icon',
|
5
|
-
component:
|
5
|
+
component: IconCollection
|
6
6
|
// argTypes: {},
|
7
7
|
}
|
8
8
|
|
9
9
|
const Template = (args, { argTypes }) => ({
|
10
10
|
// Components used in your story `template` are defined in the `components` object
|
11
|
-
components: {
|
11
|
+
components: { IconCollection },
|
12
12
|
// The story's `args` need to be mapped into the template through the `setup()` method
|
13
13
|
props: Object.keys(argTypes),
|
14
|
-
template: '<
|
14
|
+
template: '<IconCollection v-bind="$props" />'
|
15
15
|
|
16
16
|
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
17
17
|
// How to use:
|
@@ -1,31 +1,34 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
2
|
+
<Wrapper>
|
3
|
+
<IconWrapper
|
4
|
+
v-for="iconItem in iconList"
|
5
|
+
:key="iconItem.name"
|
6
|
+
>
|
4
7
|
<div>
|
5
|
-
<
|
8
|
+
<RCIcon
|
9
|
+
:color="color"
|
10
|
+
:hovered-color="hoveredColor"
|
6
11
|
:name="iconItem.name"
|
7
12
|
:size="size"
|
8
|
-
:hoveredColor="hoveredColor"
|
9
|
-
:color="color"
|
10
13
|
/>
|
11
14
|
</div>
|
12
15
|
<h3>{{ iconItem.name }}</h3>
|
13
|
-
</
|
14
|
-
</
|
16
|
+
</IconWrapper>
|
17
|
+
</Wrapper>
|
15
18
|
</template>
|
16
19
|
|
17
20
|
<script>
|
18
|
-
import
|
19
|
-
import styled from 'vue3-styled-components'
|
21
|
+
import RCIcon from './index.vue'
|
22
|
+
import styled from 'vue3-styled-components'
|
20
23
|
|
21
|
-
const Wrapper = styled.div`
|
24
|
+
const Wrapper = styled.div`
|
22
25
|
display: block;
|
23
26
|
text-align: center;
|
24
27
|
justify-items: center;
|
25
28
|
width: 100%;
|
26
29
|
background-color: #ccc;
|
27
30
|
`
|
28
|
-
const IconWrapper = styled.div`
|
31
|
+
const IconWrapper = styled.div`
|
29
32
|
display: inline-flex;
|
30
33
|
flex-direction: column;
|
31
34
|
background-color: white;
|
@@ -35,34 +38,34 @@ const IconWrapper = styled.div`
|
|
35
38
|
text-align: center;
|
36
39
|
margin: 10px;
|
37
40
|
`
|
38
|
-
export default {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
41
|
+
export default {
|
42
|
+
name: 'CollectionComponent',
|
43
|
+
components: { RCIcon, IconWrapper, Wrapper },
|
44
|
+
props: {
|
45
|
+
size: { required: false },
|
46
|
+
color: { required: false },
|
47
|
+
hoveredColor: { required: false }
|
48
|
+
},
|
49
|
+
data() {
|
50
|
+
return {
|
51
|
+
iconList: []
|
52
|
+
}
|
53
|
+
},
|
51
54
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
+
mounted() {
|
56
|
+
this.importAll(require.context('../../assets/svgIcons/', true, /\.svg$/))
|
57
|
+
},
|
55
58
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
methods: {
|
60
|
+
importAll(r) {
|
61
|
+
r.keys().forEach((key) =>
|
62
|
+
this.iconList.push({
|
63
|
+
pathLong: r(key),
|
64
|
+
pathShort: key,
|
65
|
+
name: key.replace('.svg', '').replace('./', '')
|
66
|
+
})
|
67
|
+
)
|
68
|
+
}
|
65
69
|
}
|
66
70
|
}
|
67
|
-
}
|
68
71
|
</script>
|