@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.
Files changed (67) hide show
  1. package/.prettierrc +7 -0
  2. package/package.json +20 -6
  3. package/public/favicon.ico +0 -0
  4. package/public/index.html +17 -0
  5. package/src/App.vue +70 -75
  6. package/src/assets/svgIcons/copy.svg +10 -0
  7. package/src/components/addNewButton/index.vue +27 -24
  8. package/src/components/banner/actionBanner/index.vue +30 -32
  9. package/src/components/banner/banner/index.vue +80 -88
  10. package/src/components/banner/infoBanner/index.vue +44 -36
  11. package/src/components/buttons/buttonIcon/index.vue +78 -83
  12. package/src/components/buttons/closeButton/index.vue +26 -26
  13. package/src/components/buttons/mainButton/index.vue +76 -80
  14. package/src/components/card/index.vue +52 -56
  15. package/src/components/collapsableInfoText/index.vue +76 -81
  16. package/src/components/deleteIcon/index.vue +28 -31
  17. package/src/components/draggableInputHandle/index.vue +17 -20
  18. package/src/components/dropdown/Dropdown.stories.js +8 -8
  19. package/src/components/dropdown/index.vue +72 -75
  20. package/src/components/errorMessage/index.vue +23 -23
  21. package/src/components/filter/filterSettings.vue +329 -349
  22. package/src/components/filter/index.vue +130 -130
  23. package/src/components/filter/parentDropdown.vue +40 -43
  24. package/src/components/icon/Icons.stories.js +4 -4
  25. package/src/components/icon/iconCache.js +1 -1
  26. package/src/components/icon/iconCollection.vue +37 -40
  27. package/src/components/icon/index.vue +65 -72
  28. package/src/components/iconWrapper/index.vue +118 -122
  29. package/src/components/infoCard/index.vue +17 -20
  30. package/src/components/infoText/index.vue +82 -88
  31. package/src/components/inputs/checkbox/index.vue +94 -91
  32. package/src/components/inputs/inputNumber/index.vue +488 -508
  33. package/src/components/inputs/inputNumberQuestion/index.vue +124 -127
  34. package/src/components/inputs/inputText/index.vue +252 -265
  35. package/src/components/inputs/radioButton/index.vue +120 -135
  36. package/src/components/inputs/searchInput/index.vue +81 -84
  37. package/src/components/inputs/select/index.vue +631 -644
  38. package/src/components/inputs/select/option/index.vue +91 -91
  39. package/src/components/inputs/select/select.stories.js +7 -7
  40. package/src/components/inputs/slider/index.vue +46 -46
  41. package/src/components/inputs/switchField/index.vue +152 -159
  42. package/src/components/inputs/textAreaInput/index.vue +113 -120
  43. package/src/components/inputs/toggle/index.vue +127 -137
  44. package/src/components/label/index.vue +61 -64
  45. package/src/components/markerItem/index.vue +40 -40
  46. package/src/components/modals/actionModal/index.vue +29 -32
  47. package/src/components/modals/infoModal/index.vue +27 -34
  48. package/src/components/modals/modal/index.vue +80 -88
  49. package/src/components/navigationTabs/index.vue +47 -50
  50. package/src/components/pageSubtitle/index.vue +29 -33
  51. package/src/components/pageTitle/index.vue +39 -47
  52. package/src/components/pagination/index.vue +62 -64
  53. package/src/components/progressBar/index.vue +67 -70
  54. package/src/components/projectMarker/index.vue +163 -172
  55. package/src/components/rangeSlider/Slider.vue +449 -449
  56. package/src/components/rangeSlider/index.vue +270 -282
  57. package/src/components/rangeSlider/utils/dom.js +3 -3
  58. package/src/components/selectedOptions/index.vue +51 -51
  59. package/src/components/sideMenu/index.vue +109 -117
  60. package/src/components/spinner/index.vue +34 -37
  61. package/src/components/tableDropdown/index.vue +326 -343
  62. package/src/components/tables/mainTable/index.vue +106 -109
  63. package/src/components/tables/viewTable/index.vue +92 -105
  64. package/src/components/threeDots/index.vue +171 -174
  65. package/src/components/videoThumbnail/index.vue +59 -67
  66. package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
  67. package/.eslintrc.js +0 -125
@@ -1,66 +1,63 @@
1
1
  <template>
2
- <PageContainer
3
- :should-set-custom-height="doesTableContainDraggables"
4
- :table-height="tableHeight"
2
+ <page-container
3
+ :tableHeight="tableHeight"
4
+ :shouldSetCustomHeight="doesTableContainDraggables"
5
5
  >
6
- <TableTitle v-if="titleText">
6
+ <table-title v-if="titleText">
7
7
  {{ titleText }}
8
- </TableTitle>
9
- <TableScroll
8
+ </table-title>
9
+ <table-scroll
10
10
  ref="tableRef"
11
- :is-position-absolute="doesTableContainDraggables"
11
+ :isPositionAbsolute="doesTableContainDraggables"
12
12
  >
13
- <TableWrapper
14
- class="main-table-wrapper"
15
- :full-width="fullWidth"
16
- >
17
- <SpinnerWrapper v-if="isLoading">
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
- :cell-paddings="cellPaddings"
23
- :table-cursor="tableCursor"
19
+ :cellPaddings="cellPaddings"
20
+ :tableCursor="tableCursor"
24
21
  >
25
- <slot></slot>
26
- </TableContainer>
27
- </TableWrapper>
28
- </TableScroll>
29
- </PageContainer>
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
- import styled from 'vue3-styled-components'
36
- import Spinner from '../../spinner'
37
- import dragIconSvg from '../../../assets/icons/drag_icon.svg?url'
38
- import subpositionIconSvg from '../../../assets/icons/subposition_icon.svg?url'
39
- import arrowDownSvg from '../../../assets/icons/arrow_down.svg?url'
40
- import arrowUpRedSvg from '../../../assets/icons/arrow_up_red.svg?url'
41
-
42
- const pageContainerProps = {
43
- tableHeight: String,
44
- shouldSetCustomHeight: Boolean
45
- }
46
- const PageContainer = styled('div', pageContainerProps)`
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
- props.shouldSetCustomHeight ? props.tableHeight : 'auto'};
46
+ props.shouldSetCustomHeight ? props.tableHeight : 'auto'};
50
47
  `
51
48
 
52
- const TableTitle = styled.div`
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
- const tableScrollProps = {
60
- isPositionAbsolute: Boolean
61
- }
56
+ const tableScrollProps = {
57
+ isPositionAbsolute: Boolean
58
+ }
62
59
 
63
- const TableScroll = styled('div', tableScrollProps)`
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
- const wrapperAttrs = { fullWidth: Boolean }
75
- const TableWrapper = styled('div', wrapperAttrs)`
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
- const SpinnerWrapper = styled.div`
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
- const containerAttrs = {
104
- cellPaddings: String,
105
- tableCursor: String
106
- }
100
+ const containerAttrs = {
101
+ cellPaddings: String,
102
+ tableCursor: String
103
+ }
107
104
 
108
- const TableContainer = styled('table', containerAttrs)`
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
- props.cellPaddings ? props.cellPaddings : '6px 6px 7px 4px'};
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
- export default {
385
- name: 'MainTable',
386
- components: {
387
- TableScroll,
388
- TableWrapper,
389
- SpinnerWrapper,
390
- Spinner,
391
- TableContainer,
392
- PageContainer,
393
- TableTitle
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
- props: {
396
- fullWidth: {
397
- required: false,
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
- data() {
417
- return {
418
- tableHeight: 'auto',
419
- doesTableContainDraggables: false
420
- }
401
+ isLoading: {
402
+ required: false,
403
+ default: false
421
404
  },
422
- mounted() {
423
- this.observeTableHeight()
405
+ titleText: {
406
+ required: false,
407
+ default: null
424
408
  },
425
- beforeDestroy() {
426
- if (this.resizeObserver) {
427
- this.resizeObserver.disconnect()
428
- }
429
- },
430
- methods: {
431
- observeTableHeight() {
432
- if (!this.$refs.tableRef) return
433
-
434
- const tableElement = this.$refs.tableRef.$el
435
-
436
- this.resizeObserver = new ResizeObserver(() => {
437
- const newTableHeight = this.titleText
438
- ? tableElement.offsetHeight + 33
439
- : tableElement.offsetHeight
440
- this.tableHeight = `${newTableHeight}px`
441
- this.doesTableContainDraggables = Boolean(
442
- tableElement.querySelector('.drag-container')
443
- )
444
- })
445
-
446
- this.resizeObserver.observe(tableElement)
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
- <PageWrapper>
3
- <TitleText>
2
+ <page-wrapper>
3
+ <title-text>
4
4
  {{ tableTitle }}
5
- </TitleText>
6
- <TableScroll>
7
- <TableWrapper :full-width="fullWidth">
8
- <SpinnerWrapper v-if="isLoading">
9
- <Spinner />
10
- </SpinnerWrapper>
11
- <TableContainer v-else>
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
- <TableHeader
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
- </TableHeader>
20
- <div v-if="showIconsContainer && tableItems.length"></div>
16
+ </table-header>
17
+ <div v-if="showIconsContainer && tableItems.length" />
21
18
  </tr>
22
19
  </thead>
23
20
  <tbody>
24
- <EmptyTd
25
- v-if="!tableItems.length && !isLoading"
26
- colspan="100"
27
- >
28
- <EmptyContainer>
21
+ <empty-td colspan="100" v-if="!tableItems.length && !isLoading">
22
+ <empty-container>
29
23
  {{ emptyText }}
30
- </EmptyContainer>
31
- </EmptyTd>
32
- <TableRow
33
- v-for="(row, index) in tableItems"
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
- </TableItem>
43
- <IconsContainer v-if="showIconsContainer">
44
- <DeleteIcon
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
- </IconsContainer>
49
- </TableRow>
35
+ </icons-container>
36
+ </table-row>
50
37
  </tbody>
51
- </TableContainer>
52
- </TableWrapper>
53
- </TableScroll>
54
- </PageWrapper>
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
- import styled from 'vue3-styled-components'
62
- import DeleteIcon from '../../deleteIcon'
63
- import Spinner from '../../spinner'
48
+ import styled from 'vue3-styled-components'
49
+ import DeleteIcon from '../../deleteIcon'
50
+ import Spinner from '../../spinner'
64
51
 
65
- const TableScroll = styled.div`
52
+ const TableScroll = styled.div`
66
53
  position: relative;
67
54
  max-width: 100%;
68
55
  `
69
56
 
70
- const wrapperAttrs = { fullWidth: Boolean }
71
- const TableWrapper = styled('div', wrapperAttrs)`
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
- const TableContainer = styled.table`
76
+ const TableContainer = styled.table`
90
77
  width: 100%;
91
78
  border-collapse: collapse;
92
79
  border: none;
93
80
  `
94
81
 
95
- const TableItem = styled.td`
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
- const TableHeader = styled(TableItem)`
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
- const TableRow = styled.tr`
96
+ const TableRow = styled.tr`
110
97
  &:hover {
111
98
  background-color: #f5f7fa;
112
99
  cursor: pointer;
113
100
  }
114
101
  `
115
102
 
116
- const TitleText = styled.div`
103
+ const TitleText = styled.div`
117
104
  font-weight: 700;
118
105
  margin-bottom: 6px;
119
106
  `
120
107
 
121
- const PageWrapper = styled.div`
108
+ const PageWrapper = styled.div`
122
109
  margin: 16px 0;
123
110
  font-size: 13px;
124
111
  `
125
112
 
126
- const IconsContainer = styled.div`
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
- const SpinnerWrapper = styled.div`
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
- const EmptyContainer = styled.div`
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
- const EmptyTd = styled.td`
139
+ const EmptyTd = styled.td`
153
140
  border: 1px solid ${(props) => props.theme.colors.grey3};
154
141
  `
155
142
 
156
- export default {
157
- name: 'ViewTable',
158
- components: {
159
- TableScroll,
160
- TableWrapper,
161
- TableContainer,
162
- TableHeader,
163
- TableItem,
164
- TableRow,
165
- TitleText,
166
- PageWrapper,
167
- DeleteIcon,
168
- IconsContainer,
169
- Spinner,
170
- SpinnerWrapper,
171
- EmptyContainer,
172
- EmptyTd
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
- props: {
175
- headerItems: {
176
- required: true
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
- computed: {
203
- showIconsContainer() {
204
- return this.showDeleteButton
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>