@eturnity/eturnity_reusable_components 7.24.3-EPDM-11320.0 → 7.24.3-EPDM-11143.1
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/.prettierrc +7 -0
- package/package.json +20 -6
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/App.vue +70 -75
- package/src/assets/svgIcons/copy.svg +10 -0
- package/src/components/addNewButton/index.vue +27 -24
- package/src/components/banner/actionBanner/index.vue +30 -32
- package/src/components/banner/banner/index.vue +80 -88
- package/src/components/banner/infoBanner/index.vue +44 -36
- package/src/components/buttons/buttonIcon/index.vue +78 -83
- package/src/components/buttons/closeButton/index.vue +26 -26
- package/src/components/buttons/mainButton/index.vue +76 -80
- package/src/components/card/index.vue +52 -56
- package/src/components/collapsableInfoText/index.vue +76 -81
- package/src/components/deleteIcon/index.vue +28 -31
- package/src/components/draggableInputHandle/index.vue +17 -20
- package/src/components/dropdown/Dropdown.stories.js +8 -8
- package/src/components/dropdown/index.vue +72 -75
- package/src/components/errorMessage/index.vue +23 -23
- package/src/components/filter/filterSettings.vue +329 -349
- package/src/components/filter/index.vue +130 -130
- package/src/components/filter/parentDropdown.vue +40 -43
- package/src/components/icon/Icons.stories.js +4 -4
- package/src/components/icon/iconCache.js +1 -1
- package/src/components/icon/iconCollection.vue +37 -40
- package/src/components/icon/index.vue +65 -72
- package/src/components/iconWrapper/index.vue +118 -122
- package/src/components/infoCard/index.vue +17 -20
- package/src/components/infoText/index.vue +82 -88
- package/src/components/inputs/checkbox/index.vue +94 -91
- package/src/components/inputs/inputNumber/index.vue +488 -508
- package/src/components/inputs/inputNumberQuestion/index.vue +124 -127
- package/src/components/inputs/inputText/index.vue +252 -265
- package/src/components/inputs/radioButton/index.vue +120 -135
- package/src/components/inputs/searchInput/index.vue +81 -84
- package/src/components/inputs/select/index.vue +631 -644
- 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 +152 -159
- package/src/components/inputs/textAreaInput/index.vue +113 -120
- package/src/components/inputs/toggle/index.vue +127 -137
- package/src/components/label/index.vue +61 -64
- package/src/components/markerItem/index.vue +40 -40
- package/src/components/modals/actionModal/index.vue +29 -32
- package/src/components/modals/infoModal/index.vue +27 -34
- package/src/components/modals/modal/index.vue +80 -88
- package/src/components/navigationTabs/index.vue +47 -50
- package/src/components/pageSubtitle/index.vue +29 -33
- package/src/components/pageTitle/index.vue +39 -47
- package/src/components/pagination/index.vue +62 -64
- package/src/components/progressBar/index.vue +67 -70
- package/src/components/projectMarker/index.vue +163 -172
- package/src/components/rangeSlider/Slider.vue +449 -449
- package/src/components/rangeSlider/index.vue +270 -282
- package/src/components/rangeSlider/utils/dom.js +3 -3
- package/src/components/selectedOptions/index.vue +51 -51
- package/src/components/sideMenu/index.vue +109 -117
- package/src/components/spinner/index.vue +34 -37
- package/src/components/tableDropdown/index.vue +326 -343
- package/src/components/tables/mainTable/index.vue +106 -109
- package/src/components/tables/viewTable/index.vue +92 -105
- package/src/components/threeDots/index.vue +171 -174
- package/src/components/videoThumbnail/index.vue +59 -67
- package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
- package/.eslintrc.js +0 -125
@@ -1,66 +1,63 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
:
|
4
|
-
:
|
2
|
+
<page-container
|
3
|
+
:tableHeight="tableHeight"
|
4
|
+
:shouldSetCustomHeight="doesTableContainDraggables"
|
5
5
|
>
|
6
|
-
<
|
6
|
+
<table-title v-if="titleText">
|
7
7
|
{{ titleText }}
|
8
|
-
</
|
9
|
-
<
|
8
|
+
</table-title>
|
9
|
+
<table-scroll
|
10
10
|
ref="tableRef"
|
11
|
-
:
|
11
|
+
:isPositionAbsolute="doesTableContainDraggables"
|
12
12
|
>
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
<
|
18
|
-
<Spinner />
|
19
|
-
</SpinnerWrapper>
|
20
|
-
<TableContainer
|
13
|
+
<table-wrapper class="main-table-wrapper" :fullWidth="fullWidth">
|
14
|
+
<spinner-wrapper v-if="isLoading">
|
15
|
+
<spinner />
|
16
|
+
</spinner-wrapper>
|
17
|
+
<table-container
|
21
18
|
v-else
|
22
|
-
:
|
23
|
-
:
|
19
|
+
:cellPaddings="cellPaddings"
|
20
|
+
:tableCursor="tableCursor"
|
24
21
|
>
|
25
|
-
<slot
|
26
|
-
</
|
27
|
-
</
|
28
|
-
</
|
29
|
-
</
|
22
|
+
<slot />
|
23
|
+
</table-container>
|
24
|
+
</table-wrapper>
|
25
|
+
</table-scroll>
|
26
|
+
</page-container>
|
30
27
|
</template>
|
31
28
|
|
32
29
|
<script>
|
33
30
|
// ToDo: add this to storybook
|
34
31
|
// import MainTable from "@eturnity/eturnity_reusable_components/src/components/tables/mainTable"
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
32
|
+
import styled from 'vue3-styled-components'
|
33
|
+
import Spinner from '../../spinner'
|
34
|
+
import dragIconSvg from '../../../assets/icons/drag_icon.svg?url'
|
35
|
+
import subpositionIconSvg from '../../../assets/icons/subposition_icon.svg?url'
|
36
|
+
import arrowDownSvg from '../../../assets/icons/arrow_down.svg?url'
|
37
|
+
import arrowUpRedSvg from '../../../assets/icons/arrow_up_red.svg?url'
|
38
|
+
|
39
|
+
const pageContainerProps = {
|
40
|
+
tableHeight: String,
|
41
|
+
shouldSetCustomHeight: Boolean
|
42
|
+
}
|
43
|
+
const PageContainer = styled('div', pageContainerProps)`
|
47
44
|
position: relative;
|
48
45
|
height: ${(props) =>
|
49
|
-
|
46
|
+
props.shouldSetCustomHeight ? props.tableHeight : 'auto'};
|
50
47
|
`
|
51
48
|
|
52
|
-
|
49
|
+
const TableTitle = styled.div`
|
53
50
|
margin-bottom: 16px;
|
54
51
|
font-weight: bold;
|
55
52
|
font-size: 14px;
|
56
53
|
text-transform: uppercase;
|
57
54
|
`
|
58
55
|
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
const tableScrollProps = {
|
57
|
+
isPositionAbsolute: Boolean
|
58
|
+
}
|
62
59
|
|
63
|
-
|
60
|
+
const TableScroll = styled('div', tableScrollProps)`
|
64
61
|
max-width: 100%;
|
65
62
|
height: auto;
|
66
63
|
${(props) =>
|
@@ -71,8 +68,8 @@
|
|
71
68
|
`}
|
72
69
|
`
|
73
70
|
|
74
|
-
|
75
|
-
|
71
|
+
const wrapperAttrs = { fullWidth: Boolean }
|
72
|
+
const TableWrapper = styled('div', wrapperAttrs)`
|
76
73
|
width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
|
77
74
|
max-width: 100%;
|
78
75
|
overflow-x: auto;
|
@@ -93,19 +90,19 @@
|
|
93
90
|
}
|
94
91
|
`
|
95
92
|
|
96
|
-
|
93
|
+
const SpinnerWrapper = styled.div`
|
97
94
|
height: 150px;
|
98
95
|
display: grid;
|
99
96
|
align-items: center;
|
100
97
|
justify-items: center;
|
101
98
|
`
|
102
99
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
100
|
+
const containerAttrs = {
|
101
|
+
cellPaddings: String,
|
102
|
+
tableCursor: String
|
103
|
+
}
|
107
104
|
|
108
|
-
|
105
|
+
const TableContainer = styled('table', containerAttrs)`
|
109
106
|
width: 100%;
|
110
107
|
border-collapse: collapse;
|
111
108
|
border: none;
|
@@ -162,7 +159,7 @@
|
|
162
159
|
|
163
160
|
td {
|
164
161
|
padding: ${(props) =>
|
165
|
-
|
162
|
+
props.cellPaddings ? props.cellPaddings : '6px 6px 7px 4px'};
|
166
163
|
border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
|
167
164
|
|
168
165
|
&.empty {
|
@@ -381,70 +378,70 @@
|
|
381
378
|
}
|
382
379
|
`
|
383
380
|
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
381
|
+
export default {
|
382
|
+
name: 'main-table',
|
383
|
+
components: {
|
384
|
+
TableScroll,
|
385
|
+
TableWrapper,
|
386
|
+
SpinnerWrapper,
|
387
|
+
Spinner,
|
388
|
+
TableContainer,
|
389
|
+
PageContainer,
|
390
|
+
TableTitle
|
391
|
+
},
|
392
|
+
props: {
|
393
|
+
fullWidth: {
|
394
|
+
required: false,
|
395
|
+
default: true
|
394
396
|
},
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
default: true
|
399
|
-
},
|
400
|
-
cellPaddings: {
|
401
|
-
required: false,
|
402
|
-
default: ''
|
403
|
-
},
|
404
|
-
isLoading: {
|
405
|
-
required: false,
|
406
|
-
default: false
|
407
|
-
},
|
408
|
-
titleText: {
|
409
|
-
required: false,
|
410
|
-
default: null
|
411
|
-
},
|
412
|
-
tableCursor: {
|
413
|
-
required: false
|
414
|
-
}
|
397
|
+
cellPaddings: {
|
398
|
+
required: false,
|
399
|
+
default: ''
|
415
400
|
},
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
doesTableContainDraggables: false
|
420
|
-
}
|
401
|
+
isLoading: {
|
402
|
+
required: false,
|
403
|
+
default: false
|
421
404
|
},
|
422
|
-
|
423
|
-
|
405
|
+
titleText: {
|
406
|
+
required: false,
|
407
|
+
default: null
|
424
408
|
},
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
409
|
+
tableCursor: {
|
410
|
+
required: false
|
411
|
+
}
|
412
|
+
},
|
413
|
+
data() {
|
414
|
+
return {
|
415
|
+
tableHeight: 'auto',
|
416
|
+
doesTableContainDraggables: false
|
417
|
+
}
|
418
|
+
},
|
419
|
+
mounted() {
|
420
|
+
this.observeTableHeight()
|
421
|
+
},
|
422
|
+
beforeDestroy() {
|
423
|
+
if (this.resizeObserver) {
|
424
|
+
this.resizeObserver.disconnect()
|
425
|
+
}
|
426
|
+
},
|
427
|
+
methods: {
|
428
|
+
observeTableHeight() {
|
429
|
+
if (!this.$refs.tableRef) return
|
430
|
+
|
431
|
+
const tableElement = this.$refs.tableRef.$el
|
432
|
+
|
433
|
+
this.resizeObserver = new ResizeObserver(() => {
|
434
|
+
const newTableHeight = this.titleText
|
435
|
+
? tableElement.offsetHeight + 33
|
436
|
+
: tableElement.offsetHeight
|
437
|
+
this.tableHeight = `${newTableHeight}px`
|
438
|
+
this.doesTableContainDraggables = Boolean(
|
439
|
+
tableElement.querySelector('.drag-container')
|
440
|
+
)
|
441
|
+
})
|
442
|
+
|
443
|
+
this.resizeObserver.observe(tableElement)
|
448
444
|
}
|
449
445
|
}
|
446
|
+
}
|
450
447
|
</script>
|
@@ -1,74 +1,61 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
2
|
+
<page-wrapper>
|
3
|
+
<title-text>
|
4
4
|
{{ tableTitle }}
|
5
|
-
</
|
6
|
-
<
|
7
|
-
<
|
8
|
-
<
|
9
|
-
<
|
10
|
-
</
|
11
|
-
<
|
5
|
+
</title-text>
|
6
|
+
<table-scroll>
|
7
|
+
<table-wrapper :fullWidth="fullWidth">
|
8
|
+
<spinner-wrapper v-if="isLoading">
|
9
|
+
<spinner />
|
10
|
+
</spinner-wrapper>
|
11
|
+
<table-container v-else>
|
12
12
|
<thead>
|
13
13
|
<tr>
|
14
|
-
<
|
15
|
-
v-for="(item, index) in headerItems"
|
16
|
-
:key="index"
|
17
|
-
>
|
14
|
+
<table-header v-for="(item, index) in headerItems" :key="index">
|
18
15
|
{{ item.value }}
|
19
|
-
</
|
20
|
-
<div v-if="showIconsContainer && tableItems.length"
|
16
|
+
</table-header>
|
17
|
+
<div v-if="showIconsContainer && tableItems.length" />
|
21
18
|
</tr>
|
22
19
|
</thead>
|
23
20
|
<tbody>
|
24
|
-
<
|
25
|
-
|
26
|
-
colspan="100"
|
27
|
-
>
|
28
|
-
<EmptyContainer>
|
21
|
+
<empty-td colspan="100" v-if="!tableItems.length && !isLoading">
|
22
|
+
<empty-container>
|
29
23
|
{{ emptyText }}
|
30
|
-
</
|
31
|
-
</
|
32
|
-
<
|
33
|
-
v-for="(
|
34
|
-
v-else
|
35
|
-
:key="index"
|
36
|
-
>
|
37
|
-
<TableItem
|
38
|
-
v-for="(item, idx) in row"
|
39
|
-
:key="idx"
|
40
|
-
>
|
24
|
+
</empty-container>
|
25
|
+
</empty-td>
|
26
|
+
<table-row v-for="(row, index) in tableItems" :key="index" v-else>
|
27
|
+
<table-item v-for="(item, idx) in row" :key="idx">
|
41
28
|
{{ item.value }}
|
42
|
-
</
|
43
|
-
<
|
44
|
-
<
|
45
|
-
color="gray"
|
29
|
+
</table-item>
|
30
|
+
<icons-container v-if="showIconsContainer">
|
31
|
+
<delete-icon
|
46
32
|
@click="$emit('on-click-delete', index)"
|
33
|
+
color="gray"
|
47
34
|
/>
|
48
|
-
</
|
49
|
-
</
|
35
|
+
</icons-container>
|
36
|
+
</table-row>
|
50
37
|
</tbody>
|
51
|
-
</
|
52
|
-
</
|
53
|
-
</
|
54
|
-
</
|
38
|
+
</table-container>
|
39
|
+
</table-wrapper>
|
40
|
+
</table-scroll>
|
41
|
+
</page-wrapper>
|
55
42
|
</template>
|
56
43
|
|
57
44
|
<script>
|
58
45
|
// This is a read only table. Pass it data, and it displays it
|
59
46
|
// ToDo: add this to storybook
|
60
47
|
// import ViewTable from "@eturnity/eturnity_reusable_components/src/components/tables/viewTable"
|
61
|
-
|
62
|
-
|
63
|
-
|
48
|
+
import styled from 'vue3-styled-components'
|
49
|
+
import DeleteIcon from '../../deleteIcon'
|
50
|
+
import Spinner from '../../spinner'
|
64
51
|
|
65
|
-
|
52
|
+
const TableScroll = styled.div`
|
66
53
|
position: relative;
|
67
54
|
max-width: 100%;
|
68
55
|
`
|
69
56
|
|
70
|
-
|
71
|
-
|
57
|
+
const wrapperAttrs = { fullWidth: Boolean }
|
58
|
+
const TableWrapper = styled('div', wrapperAttrs)`
|
72
59
|
width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
|
73
60
|
max-width: 100%;
|
74
61
|
overflow: auto;
|
@@ -86,13 +73,13 @@
|
|
86
73
|
}
|
87
74
|
`
|
88
75
|
|
89
|
-
|
76
|
+
const TableContainer = styled.table`
|
90
77
|
width: 100%;
|
91
78
|
border-collapse: collapse;
|
92
79
|
border: none;
|
93
80
|
`
|
94
81
|
|
95
|
-
|
82
|
+
const TableItem = styled.td`
|
96
83
|
border: 1px solid ${(props) => props.theme.colors.grey3};
|
97
84
|
width: auto;
|
98
85
|
white-space: nowrap;
|
@@ -100,30 +87,30 @@
|
|
100
87
|
text-align: right;
|
101
88
|
`
|
102
89
|
|
103
|
-
|
90
|
+
const TableHeader = styled(TableItem)`
|
104
91
|
background-color: #e6e8ee;
|
105
92
|
font-weight: 700;
|
106
93
|
text-align: left;
|
107
94
|
`
|
108
95
|
|
109
|
-
|
96
|
+
const TableRow = styled.tr`
|
110
97
|
&:hover {
|
111
98
|
background-color: #f5f7fa;
|
112
99
|
cursor: pointer;
|
113
100
|
}
|
114
101
|
`
|
115
102
|
|
116
|
-
|
103
|
+
const TitleText = styled.div`
|
117
104
|
font-weight: 700;
|
118
105
|
margin-bottom: 6px;
|
119
106
|
`
|
120
107
|
|
121
|
-
|
108
|
+
const PageWrapper = styled.div`
|
122
109
|
margin: 16px 0;
|
123
110
|
font-size: 13px;
|
124
111
|
`
|
125
112
|
|
126
|
-
|
113
|
+
const IconsContainer = styled.div`
|
127
114
|
width: 100%;
|
128
115
|
display: inline-flex;
|
129
116
|
flex-wrap: nowrap;
|
@@ -134,7 +121,7 @@
|
|
134
121
|
}
|
135
122
|
`
|
136
123
|
|
137
|
-
|
124
|
+
const SpinnerWrapper = styled.div`
|
138
125
|
border: 1px solid ${(props) => props.theme.colors.grey3};
|
139
126
|
height: 150px;
|
140
127
|
display: grid;
|
@@ -142,67 +129,67 @@
|
|
142
129
|
justify-items: center;
|
143
130
|
`
|
144
131
|
|
145
|
-
|
132
|
+
const EmptyContainer = styled.div`
|
146
133
|
display: grid;
|
147
134
|
align-items: center;
|
148
135
|
justify-items: center;
|
149
136
|
height: 100px;
|
150
137
|
`
|
151
138
|
|
152
|
-
|
139
|
+
const EmptyTd = styled.td`
|
153
140
|
border: 1px solid ${(props) => props.theme.colors.grey3};
|
154
141
|
`
|
155
142
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
143
|
+
export default {
|
144
|
+
name: 'view-table',
|
145
|
+
components: {
|
146
|
+
TableScroll,
|
147
|
+
TableWrapper,
|
148
|
+
TableContainer,
|
149
|
+
TableHeader,
|
150
|
+
TableItem,
|
151
|
+
TableRow,
|
152
|
+
TitleText,
|
153
|
+
PageWrapper,
|
154
|
+
DeleteIcon,
|
155
|
+
IconsContainer,
|
156
|
+
Spinner,
|
157
|
+
SpinnerWrapper,
|
158
|
+
EmptyContainer,
|
159
|
+
EmptyTd
|
160
|
+
},
|
161
|
+
props: {
|
162
|
+
headerItems: {
|
163
|
+
required: true
|
164
|
+
},
|
165
|
+
tableItems: {
|
166
|
+
required: true
|
167
|
+
},
|
168
|
+
fullWidth: {
|
169
|
+
required: false,
|
170
|
+
default: true
|
173
171
|
},
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
},
|
178
|
-
tableItems: {
|
179
|
-
required: true
|
180
|
-
},
|
181
|
-
fullWidth: {
|
182
|
-
required: false,
|
183
|
-
default: true
|
184
|
-
},
|
185
|
-
tableTitle: {
|
186
|
-
required: false,
|
187
|
-
default: null
|
188
|
-
},
|
189
|
-
showDeleteButton: {
|
190
|
-
required: false,
|
191
|
-
default: false
|
192
|
-
},
|
193
|
-
isLoading: {
|
194
|
-
required: false,
|
195
|
-
default: false
|
196
|
-
},
|
197
|
-
emptyText: {
|
198
|
-
required: false,
|
199
|
-
default: 'There are no items'
|
200
|
-
}
|
172
|
+
tableTitle: {
|
173
|
+
required: false,
|
174
|
+
default: null
|
201
175
|
},
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
176
|
+
showDeleteButton: {
|
177
|
+
required: false,
|
178
|
+
default: false
|
179
|
+
},
|
180
|
+
isLoading: {
|
181
|
+
required: false,
|
182
|
+
default: false
|
183
|
+
},
|
184
|
+
emptyText: {
|
185
|
+
required: false,
|
186
|
+
default: 'There are no items'
|
187
|
+
}
|
188
|
+
},
|
189
|
+
computed: {
|
190
|
+
showIconsContainer() {
|
191
|
+
return this.showDeleteButton
|
206
192
|
}
|
207
193
|
}
|
194
|
+
}
|
208
195
|
</script>
|