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