@eturnity/eturnity_reusable_components 7.30.3 → 7.32.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 (81) hide show
  1. package/.eslintrc.js +184 -0
  2. package/.prettierrc +8 -6
  3. package/package.json +9 -21
  4. package/src/App.vue +79 -78
  5. package/src/assets/theme.js +3 -3
  6. package/src/components/addNewButton/AddNewButton.stories.js +2 -2
  7. package/src/components/addNewButton/index.vue +48 -51
  8. package/src/components/banner/actionBanner/index.vue +54 -55
  9. package/src/components/banner/banner/banner.stories.js +5 -5
  10. package/src/components/banner/banner/index.vue +159 -159
  11. package/src/components/banner/infoBanner/index.vue +41 -53
  12. package/src/components/buttons/buttonIcon/index.vue +125 -122
  13. package/src/components/buttons/closeButton/CloseButton.stories.js +3 -3
  14. package/src/components/buttons/closeButton/index.vue +49 -49
  15. package/src/components/buttons/mainButton/index.vue +108 -108
  16. package/src/components/card/index.vue +70 -70
  17. package/src/components/collapsableInfoText/index.vue +96 -94
  18. package/src/components/deleteIcon/DeleteIcon.stories.js +4 -4
  19. package/src/components/deleteIcon/index.vue +54 -54
  20. package/src/components/draggableInputHandle/index.vue +37 -37
  21. package/src/components/dropdown/Dropdown.stories.js +9 -10
  22. package/src/components/dropdown/index.vue +106 -106
  23. package/src/components/errorMessage/index.vue +52 -52
  24. package/src/components/filter/filterSettings.vue +428 -422
  25. package/src/components/filter/index.vue +135 -135
  26. package/src/components/filter/parentDropdown.vue +73 -73
  27. package/src/components/icon/Icons.stories.js +7 -7
  28. package/src/components/icon/iconCollection.vue +53 -53
  29. package/src/components/icon/index.vue +122 -122
  30. package/src/components/iconWrapper/index.vue +156 -156
  31. package/src/components/infoCard/index.vue +30 -32
  32. package/src/components/infoText/index.vue +142 -137
  33. package/src/components/inputs/checkbox/Checkbox.stories.js +8 -8
  34. package/src/components/inputs/checkbox/index.vue +190 -180
  35. package/src/components/inputs/inputNumber/InputNumber.stories.js +41 -41
  36. package/src/components/inputs/inputNumber/index.vue +696 -696
  37. package/src/components/inputs/inputNumberQuestion/index.vue +185 -182
  38. package/src/components/inputs/inputText/InputText.stories.js +22 -22
  39. package/src/components/inputs/inputText/index.vue +337 -336
  40. package/src/components/inputs/radioButton/RadioButton.stories.js +16 -16
  41. package/src/components/inputs/radioButton/index.vue +222 -219
  42. package/src/components/inputs/searchInput/SearchInput.stories.js +8 -8
  43. package/src/components/inputs/searchInput/index.vue +127 -126
  44. package/src/components/inputs/select/index.vue +792 -791
  45. package/src/components/inputs/select/option/index.vue +124 -124
  46. package/src/components/inputs/select/select.stories.js +31 -32
  47. package/src/components/inputs/slider/index.vue +99 -99
  48. package/src/components/inputs/switchField/index.vue +220 -222
  49. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +57 -57
  50. package/src/components/inputs/textAreaInput/index.vue +171 -173
  51. package/src/components/inputs/toggle/Toggle.stories.js +14 -14
  52. package/src/components/inputs/toggle/index.vue +214 -217
  53. package/src/components/label/index.vue +82 -82
  54. package/src/components/markerItem/index.vue +68 -66
  55. package/src/components/modals/actionModal/index.vue +54 -54
  56. package/src/components/modals/infoModal/index.vue +39 -36
  57. package/src/components/modals/modal/index.vue +134 -134
  58. package/src/components/modals/modal/modal.stories.js +5 -5
  59. package/src/components/navigationTabs/index.vue +96 -94
  60. package/src/components/pageSubtitle/index.vue +55 -49
  61. package/src/components/pageTitle/index.vue +56 -56
  62. package/src/components/pagination/index.vue +92 -89
  63. package/src/components/progressBar/index.vue +107 -107
  64. package/src/components/projectMarker/index.vue +246 -244
  65. package/src/components/rangeSlider/Slider.vue +491 -465
  66. package/src/components/rangeSlider/index.vue +410 -410
  67. package/src/components/rangeSlider/utils/dom.js +5 -5
  68. package/src/components/selectedOptions/index.vue +119 -119
  69. package/src/components/sideMenu/index.vue +199 -199
  70. package/src/components/spinner/index.vue +57 -57
  71. package/src/components/tableDropdown/index.vue +520 -520
  72. package/src/components/tables/mainTable/index.vue +417 -400
  73. package/src/components/tables/viewTable/index.vue +171 -171
  74. package/src/components/threeDots/index.vue +340 -334
  75. package/src/components/videoThumbnail/index.vue +86 -86
  76. package/src/components/videoThumbnail/videoThumbnail.stories.js +14 -16
  77. package/src/helpers/numberConverter.js +2 -2
  78. package/src/helpers/translateLang.js +9 -9
  79. package/src/mixins/inputValidations.js +5 -5
  80. package/public/favicon.ico +0 -0
  81. package/public/index.html +0 -17
@@ -1,493 +1,510 @@
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 class="main-table-wrapper" :full-width="fullWidth">
14
+ <SpinnerWrapper v-if="isLoading">
15
+ <Spinner />
16
+ </SpinnerWrapper>
17
+ <TableContainer
18
18
  v-else
19
- :cellPaddings="cellPaddings"
20
- :tableCursor="tableCursor"
21
- @mouseover="hasAimHover ? setHovers($event) : null"
19
+ :cell-paddings="cellPaddings"
20
+ :table-cursor="tableCursor"
22
21
  @mouseleave="hasAimHover ? removeHoverClass() : null"
22
+ @mouseover="hasAimHover ? setHovers($event) : null"
23
23
  >
24
- <slot />
25
- </table-container>
26
- </table-wrapper>
27
- </table-scroll>
28
- </page-container>
24
+ <slot></slot>
25
+ </TableContainer>
26
+ </TableWrapper>
27
+ </TableScroll>
28
+ </PageContainer>
29
29
  </template>
30
30
 
31
31
  <script>
32
- // ToDo: add this to storybook
33
- // import MainTable from "@eturnity/eturnity_reusable_components/src/components/tables/mainTable"
34
- import styled from 'vue3-styled-components'
35
- import Spinner from '../../spinner'
36
- import dragIconSvg from '../../../assets/icons/drag_icon.svg?url'
37
- import subpositionIconSvg from '../../../assets/icons/subposition_icon.svg?url'
38
- import arrowDownSvg from '../../../assets/icons/arrow_down.svg?url'
39
- import arrowUpRedSvg from '../../../assets/icons/arrow_up_red.svg?url'
40
-
41
- const pageContainerProps = {
42
- tableHeight: String,
43
- shouldSetCustomHeight: Boolean
44
- }
45
- const PageContainer = styled('div', pageContainerProps)`
46
- position: relative;
47
- height: ${(props) =>
48
- props.shouldSetCustomHeight ? props.tableHeight : 'auto'};
49
- `
50
-
51
- const TableTitle = styled.div`
52
- margin-bottom: 16px;
53
- font-weight: bold;
54
- font-size: 14px;
55
- text-transform: uppercase;
56
- `
57
-
58
- const tableScrollProps = {
59
- isPositionAbsolute: Boolean
60
- }
61
-
62
- const TableScroll = styled('div', tableScrollProps)`
63
- max-width: 100%;
64
- height: auto;
65
- ${(props) =>
66
- props.isPositionAbsolute &&
67
- `
32
+ // ToDo: add this to storybook
33
+ // import MainTable from "@eturnity/eturnity_reusable_components/src/components/tables/mainTable"
34
+ import styled from 'vue3-styled-components'
35
+ import Spinner from '../../spinner'
36
+ import dragIconSvg from '../../../assets/icons/drag_icon.svg?url'
37
+ import subpositionIconSvg from '../../../assets/icons/subposition_icon.svg?url'
38
+ import arrowDownSvg from '../../../assets/icons/arrow_down.svg?url'
39
+ import arrowUpRedSvg from '../../../assets/icons/arrow_up_red.svg?url'
40
+
41
+ const pageContainerProps = {
42
+ tableHeight: String,
43
+ shouldSetCustomHeight: Boolean,
44
+ }
45
+ const PageContainer = styled('div', pageContainerProps)`
46
+ position: relative;
47
+ height: ${(props) =>
48
+ props.shouldSetCustomHeight ? props.tableHeight : 'auto'};
49
+ `
50
+
51
+ const TableTitle = styled.div`
52
+ margin-bottom: 16px;
53
+ font-weight: bold;
54
+ font-size: 14px;
55
+ text-transform: uppercase;
56
+ `
57
+
58
+ const tableScrollProps = {
59
+ isPositionAbsolute: Boolean,
60
+ }
61
+
62
+ const TableScroll = styled('div', tableScrollProps)`
63
+ max-width: 100%;
64
+ height: auto;
65
+ ${(props) =>
66
+ props.isPositionAbsolute &&
67
+ `
68
68
  position: absolute;
69
69
  left: -20px;
70
70
  `}
71
- `
71
+ `
72
72
 
73
- const wrapperAttrs = { fullWidth: Boolean }
74
- const TableWrapper = styled('div', wrapperAttrs)`
75
- width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
76
- max-width: 100%;
77
- overflow-x: auto;
78
- overflow-y: hidden;
79
-
80
- ::-webkit-scrollbar {
81
- height: 10px; //height of the whole scrollbar area
82
- }
73
+ const wrapperAttrs = { fullWidth: Boolean }
74
+ const TableWrapper = styled('div', wrapperAttrs)`
75
+ width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
76
+ max-width: 100%;
77
+ overflow-x: auto;
78
+ overflow-y: hidden;
83
79
 
84
- ::-webkit-scrollbar-track {
85
- background: ${(props) => props.theme.colors.grey2};
86
- border-radius: 4px;
87
- }
88
-
89
- ::-webkit-scrollbar-thumb {
90
- border-bottom: 10px solid ${(props) => props.theme.colors.brightBlue}; // width of the actual scrollbar
91
- border-radius: 4px;
92
- }
93
- `
94
-
95
- const SpinnerWrapper = styled.div`
96
- height: 150px;
97
- display: grid;
98
- align-items: center;
99
- justify-items: center;
100
- `
101
-
102
- const containerAttrs = {
103
- cellPaddings: String,
104
- tableCursor: String
105
- }
106
-
107
- const TableContainer = styled('table', containerAttrs)`
108
- width: 100%;
109
- border-collapse: collapse;
110
- border: none;
111
- font-size: 13px;
112
-
113
- thead {
114
- font-weight: bold;
80
+ ::-webkit-scrollbar {
81
+ height: 10px; //height of the whole scrollbar area
82
+ }
115
83
 
116
- tr {
117
- border-bottom: none !important;
84
+ ::-webkit-scrollbar-track {
85
+ background: ${(props) => props.theme.colors.grey2};
86
+ border-radius: 4px;
118
87
  }
119
- }
120
88
 
121
- .collective-row-toggle {
122
- cursor: pointer !important;
89
+ ::-webkit-scrollbar-thumb {
90
+ border-bottom: 10px solid ${(props) => props.theme.colors.brightBlue}; // width of the actual scrollbar
91
+ border-radius: 4px;
92
+ }
93
+ `
94
+
95
+ const SpinnerWrapper = styled.div`
96
+ height: 150px;
97
+ display: grid;
98
+ align-items: center;
99
+ justify-items: center;
100
+ `
101
+
102
+ const containerAttrs = {
103
+ cellPaddings: String,
104
+ tableCursor: String,
123
105
  }
124
106
 
125
- tbody {
126
- tr {
127
- &:hover, td.hovered-column {
128
- background-color: ${(props) => props.theme.colors.white};
129
- cursor: ${(props) => (props.tableCursor ? props.tableCursor : 'auto')};
130
-
131
- .select-button,
132
- .arrow-container,
133
- .input-placeholder,
134
- .table-dropdown-item {
135
- background-color: ${(props) => props.theme.colors.grey5};
136
- }
107
+ const TableContainer = styled('table', containerAttrs)`
108
+ width: 100%;
109
+ border-collapse: collapse;
110
+ border: none;
111
+ font-size: 13px;
137
112
 
138
- input {
139
- background-color: ${(props) => props.theme.colors.grey5};
140
- }
141
- }
113
+ thead {
114
+ font-weight: bold;
142
115
 
143
- td {
144
- height: 40px;
116
+ tr {
117
+ border-bottom: none !important;
145
118
  }
146
119
  }
147
- }
148
-
149
- th {
150
- padding: 11px 15px;
151
- background-color: ${(props) => props.theme.colors.blue1};
152
- cursor: auto;
153
- height: 40px;
154
120
 
155
- .ordering {
156
- display: grid;
157
- grid-template-columns: 1fr auto;
158
- grid-gap: 6px;
121
+ .collective-row-toggle {
122
+ cursor: pointer !important;
159
123
  }
160
- }
161
-
162
- td {
163
- padding: ${(props) =>
164
- props.cellPaddings ? props.cellPaddings : '6px 6px 7px 4px'};
165
- border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
166
124
 
167
- &.empty {
168
- height: 100px;
169
- text-align: center;
170
- cursor: default;
171
- background-color: #fff !important;
172
- }
125
+ tbody {
126
+ tr {
127
+ &:hover,
128
+ td.hovered-column {
129
+ background-color: ${(props) => props.theme.colors.white};
130
+ cursor: ${(props) =>
131
+ props.tableCursor ? props.tableCursor : 'auto'};
132
+
133
+ .select-button,
134
+ .arrow-container,
135
+ .input-placeholder,
136
+ .table-dropdown-item {
137
+ background-color: ${(props) => props.theme.colors.grey5};
138
+ }
173
139
 
174
- &.no-border {
175
- border-bottom: none;
176
- }
140
+ input {
141
+ background-color: ${(props) => props.theme.colors.grey5};
142
+ }
143
+ }
177
144
 
178
- .collective-container {
179
- display: grid;
180
- grid-template-columns: auto 1fr;
181
- align-items: center;
182
- grid-gap: 10px;
183
- cursor: ${(props) => (props.tableCursor ? props.tableCursor : 'pointer')};
145
+ td {
146
+ height: 40px;
147
+ }
148
+ }
184
149
  }
185
150
 
186
- .collective-box {
187
- width: 22px;
188
- height: 22px;
189
- border-radius: 4px;
190
- color: #fff;
191
- background-color: ${(props) => props.theme.colors.grey3};
192
- font-size: 13px;
193
- font-weight: normal;
194
- display: grid;
195
- align-items: center;
196
- justify-items: center;
151
+ th {
152
+ padding: 11px 15px;
153
+ background-color: ${(props) => props.theme.colors.blue1};
154
+ cursor: auto;
155
+ height: 40px;
197
156
 
198
- &.open {
199
- background-color: ${(props) => props.theme.colors.green};
157
+ .ordering {
158
+ display: grid;
159
+ grid-template-columns: 1fr auto;
160
+ grid-gap: 6px;
200
161
  }
201
162
  }
202
- }
203
163
 
204
- td,
205
- th {
206
- white-space: nowrap;
207
- text-align: left;
164
+ td {
165
+ padding: ${(props) =>
166
+ props.cellPaddings ? props.cellPaddings : '6px 6px 7px 4px'};
167
+ border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
208
168
 
209
- &.align {
210
- &-left {
211
- text-align: left;
169
+ &.empty {
170
+ height: 100px;
171
+ text-align: center;
172
+ cursor: default;
173
+ background-color: #fff !important;
212
174
  }
213
175
 
214
- &-center {
215
- text-align: center;
176
+ &.no-border {
177
+ border-bottom: none;
216
178
  }
217
179
 
218
- &-right {
219
- text-align: right;
180
+ .collective-container {
181
+ display: grid;
182
+ grid-template-columns: auto 1fr;
183
+ align-items: center;
184
+ grid-gap: 10px;
185
+ cursor: ${(props) =>
186
+ props.tableCursor ? props.tableCursor : 'pointer'};
220
187
  }
221
- }
222
188
 
223
- &.checkbox {
224
- padding: 7px 15px !important;
225
- width: 40px;
189
+ .collective-box {
190
+ width: 22px;
191
+ height: 22px;
192
+ border-radius: 4px;
193
+ color: #fff;
194
+ background-color: ${(props) => props.theme.colors.grey3};
195
+ font-size: 13px;
196
+ font-weight: normal;
197
+ display: grid;
198
+ align-items: center;
199
+ justify-items: center;
200
+
201
+ &.open {
202
+ background-color: ${(props) => props.theme.colors.green};
203
+ }
204
+ }
226
205
  }
227
206
 
228
- &.checkbox-header {
229
- min-width: 40px;
230
- display: flex;
231
- gap: 10px;
232
- }
233
- }
207
+ td,
208
+ th {
209
+ white-space: nowrap;
210
+ text-align: left;
234
211
 
235
- tr {
236
- &.disabled {
237
- cursor: not-allowed !important;
238
- }
212
+ &.align {
213
+ &-left {
214
+ text-align: left;
215
+ }
239
216
 
240
- .arrow-dropdown {
241
- visibility: hidden;
242
- }
217
+ &-center {
218
+ text-align: center;
219
+ }
243
220
 
244
- &.footer {
245
- td {
246
- background-color: ${(props) => props.theme.colors.grey5};
247
- /* border-top: 1px solid ${(props) => props.theme.colors.grey4}; */
221
+ &-right {
222
+ text-align: right;
223
+ }
248
224
  }
249
225
 
250
- .text {
251
- cursor: auto !important;
226
+ &.checkbox {
227
+ padding: 7px 15px !important;
228
+ width: 40px;
252
229
  }
253
- }
254
230
 
255
- .text {
256
- padding: 10px 15px 10px 15px;
257
- color: ${(props) => props.theme.colors.black};
258
- cursor: ${(props) => (props.tableCursor ? props.tableCursor : 'auto')};
231
+ &.checkbox-header {
232
+ min-width: 40px;
233
+ display: flex;
234
+ gap: 10px;
235
+ }
259
236
  }
260
237
 
261
- .bold {
262
- font-weight: bold;
263
- }
238
+ tr {
239
+ &.disabled {
240
+ cursor: not-allowed !important;
241
+ }
264
242
 
265
- .icons-container {
266
- padding-right: 2px; // so that the icons are not cut off when hovering
267
- width: 1%; // necessary so it doesn't take up too much white space
268
- display: table-cell;
269
- flex-wrap: nowrap;
270
- background-color: #fff;
271
- vertical-align: middle;
272
- }
243
+ .arrow-dropdown {
244
+ visibility: hidden;
245
+ }
273
246
 
274
- .arrow-container {
275
- display: table-cell;
276
- vertical-align: middle;
277
- cursor: ${(props) => (props.tableCursor ? props.tableCursor : 'pointer')};
278
- border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
279
- }
247
+ &.footer {
248
+ td {
249
+ background-color: ${(props) => props.theme.colors.grey5};
250
+ /* border-top: 1px solid ${(props) => props.theme.colors.grey4}; */
251
+ }
280
252
 
281
- &.container-row td {
282
- padding: 0;
283
- }
253
+ .text {
254
+ cursor: auto !important;
255
+ }
256
+ }
284
257
 
285
- &.no-border {
286
- td,
287
- .arrow-container {
288
- border-bottom: none;
258
+ .text {
259
+ padding: 10px 15px 10px 15px;
260
+ color: ${(props) => props.theme.colors.black};
261
+ cursor: ${(props) => (props.tableCursor ? props.tableCursor : 'auto')};
289
262
  }
290
- }
291
263
 
292
- &:hover {
293
- input:disabled {
294
- background-color: ${(props) => props.theme.colors.grey5 + '!important'};
264
+ .bold {
265
+ font-weight: bold;
295
266
  }
296
267
 
297
- .drag-icon {
298
- visibility: visible;
268
+ .icons-container {
269
+ padding-right: 2px; // so that the icons are not cut off when hovering
270
+ width: 1%; // necessary so it doesn't take up too much white space
271
+ display: table-cell;
272
+ flex-wrap: nowrap;
273
+ background-color: #fff;
274
+ vertical-align: middle;
299
275
  }
300
276
 
301
- .drag-wrapper {
302
- background-color: ${(props) => props.theme.colors.grey5};
277
+ .arrow-container {
278
+ display: table-cell;
279
+ vertical-align: middle;
280
+ cursor: ${(props) =>
281
+ props.tableCursor ? props.tableCursor : 'pointer'};
282
+ border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
303
283
  }
304
284
 
305
- .arrow-dropdown {
306
- visibility: visible;
285
+ &.container-row td {
286
+ padding: 0;
307
287
  }
308
- }
309
288
 
310
- .drag-container {
311
- display: table-cell;
312
- width: 20px;
313
- min-width: 20px;
314
- height: 40px;
315
- }
289
+ &.no-border {
290
+ td,
291
+ .arrow-container {
292
+ border-bottom: none;
293
+ }
294
+ }
316
295
 
317
- .drag-wrapper {
318
- width: 16px;
319
- height: 36px;
320
- display: grid;
321
- align-items: center;
322
- justify-items: center;
323
- border-radius: 4px;
324
- }
296
+ &:hover {
297
+ input:disabled {
298
+ background-color: ${(props) =>
299
+ props.theme.colors.grey5 + '!important'};
300
+ }
301
+
302
+ .drag-icon {
303
+ visibility: visible;
304
+ }
325
305
 
326
- .drag-icon {
327
- visibility: hidden;
328
- width: 10px;
329
- height: 16px;
330
- cursor: grab;
331
- background-position: center;
332
- background-image: ${() => `url(${dragIconSvg})`};
306
+ .drag-wrapper {
307
+ background-color: ${(props) => props.theme.colors.grey5};
308
+ }
333
309
 
334
- &:active {
335
- cursor: grabbing;
310
+ .arrow-dropdown {
311
+ visibility: visible;
312
+ }
336
313
  }
337
- }
338
314
 
339
- .subposition-icon {
340
- width: 14px;
341
- height: 11px;
342
- background: no-repeat;
343
- margin-left: 10px;
344
- background-image: ${() => `url(${subpositionIconSvg})`};
345
- }
315
+ .drag-container {
316
+ display: table-cell;
317
+ width: 20px;
318
+ min-width: 20px;
319
+ height: 40px;
320
+ }
346
321
 
347
- .arrow-down {
348
- width: 14px;
349
- height: 11px;
350
- background: no-repeat;
351
- background-position: center;
352
- background-image: ${() => `url(${arrowDownSvg})`};
353
- }
322
+ .drag-wrapper {
323
+ width: 16px;
324
+ height: 36px;
325
+ display: grid;
326
+ align-items: center;
327
+ justify-items: center;
328
+ border-radius: 4px;
329
+ }
330
+
331
+ .drag-icon {
332
+ visibility: hidden;
333
+ width: 10px;
334
+ height: 16px;
335
+ cursor: grab;
336
+ background-position: center;
337
+ background-image: ${() => `url(${dragIconSvg})`};
338
+
339
+ &:active {
340
+ cursor: grabbing;
341
+ }
342
+ }
354
343
 
355
- .arrow-up {
356
- width: 14px;
357
- height: 11px;
358
- background: no-repeat;
359
- background-position: center;
360
- background-image: ${() => `url(${arrowUpRedSvg})`};
344
+ .subposition-icon {
345
+ width: 14px;
346
+ height: 11px;
347
+ background: no-repeat;
348
+ margin-left: 10px;
349
+ background-image: ${() => `url(${subpositionIconSvg})`};
350
+ }
351
+
352
+ .arrow-down {
353
+ width: 14px;
354
+ height: 11px;
355
+ background: no-repeat;
356
+ background-position: center;
357
+ background-image: ${() => `url(${arrowDownSvg})`};
358
+ }
359
+
360
+ .arrow-up {
361
+ width: 14px;
362
+ height: 11px;
363
+ background: no-repeat;
364
+ background-position: center;
365
+ background-image: ${() => `url(${arrowUpRedSvg})`};
366
+ }
361
367
  }
362
- }
363
368
 
364
- input {
365
- font-size: 13px;
366
- padding: 5px 10px;
367
- background: #fff;
368
- height: unset;
369
+ input {
370
+ font-size: 13px;
371
+ padding: 5px 10px;
372
+ background: #fff;
373
+ height: unset;
369
374
 
370
- &:focus {
371
- background: ${(props) => props.theme.colors.grey5};
375
+ &:focus {
376
+ background: ${(props) => props.theme.colors.grey5};
377
+ }
372
378
  }
373
- }
374
379
 
375
- .open-container {
376
- border: 1px solid ${(props) => props.theme.colors.grey4};
377
- border-radius: 4px;
378
- margin-bottom: 5px;
379
- cursor: auto;
380
- }
381
- `
382
-
383
- export default {
384
- name: 'main-table',
385
- components: {
386
- TableScroll,
387
- TableWrapper,
388
- SpinnerWrapper,
389
- Spinner,
390
- TableContainer,
391
- PageContainer,
392
- TableTitle
393
- },
394
- props: {
395
- fullWidth: {
396
- required: false,
397
- default: true
398
- },
399
- cellPaddings: {
400
- required: false,
401
- default: ''
380
+ .open-container {
381
+ border: 1px solid ${(props) => props.theme.colors.grey4};
382
+ border-radius: 4px;
383
+ margin-bottom: 5px;
384
+ cursor: auto;
385
+ }
386
+ `
387
+
388
+ export default {
389
+ name: 'MainTable',
390
+ components: {
391
+ TableScroll,
392
+ TableWrapper,
393
+ SpinnerWrapper,
394
+ Spinner,
395
+ TableContainer,
396
+ PageContainer,
397
+ TableTitle,
402
398
  },
403
- isLoading: {
404
- required: false,
405
- default: false
399
+ props: {
400
+ fullWidth: {
401
+ required: false,
402
+ default: true,
403
+ },
404
+ cellPaddings: {
405
+ required: false,
406
+ default: '',
407
+ },
408
+ isLoading: {
409
+ required: false,
410
+ default: false,
411
+ },
412
+ titleText: {
413
+ required: false,
414
+ default: null,
415
+ },
416
+ hasAimHover: {
417
+ required: false,
418
+ default: false,
419
+ },
420
+ tableCursor: {
421
+ required: false,
422
+ },
406
423
  },
407
- titleText: {
408
- required: false,
409
- default: null
424
+ data() {
425
+ return {
426
+ tableHeight: 'auto',
427
+ doesTableContainDraggables: false,
428
+ }
410
429
  },
411
- hasAimHover: {
412
- required: false,
413
- default: false
430
+ mounted() {
431
+ this.observeTableHeight()
414
432
  },
415
- tableCursor: {
416
- required: false
417
- }
418
- },
419
- data() {
420
- return {
421
- tableHeight: 'auto',
422
- doesTableContainDraggables: false
423
- }
424
- },
425
- mounted() {
426
- this.observeTableHeight()
427
- },
428
- beforeDestroy() {
429
- if (this.resizeObserver) {
430
- this.resizeObserver.disconnect()
431
- }
432
- },
433
- methods: {
434
- findParentElementByTagName(element, tagName) {
435
- let currentParentElement = element.parentElement
436
- while (currentParentElement && currentParentElement.tagName !== tagName) {
437
- currentParentElement = currentParentElement.parentElement
433
+ beforeUnmount() {
434
+ if (this.resizeObserver) {
435
+ this.resizeObserver.disconnect()
438
436
  }
439
-
440
- return currentParentElement && currentParentElement.tagName === tagName ? currentParentElement : null
441
- },
442
- removeHoverClass() {
443
- const hoveredItems = document.querySelectorAll('.hovered-column')
444
- hoveredItems.forEach((el) => {
445
- el.classList.remove('hovered-column')
446
- })
447
437
  },
448
- setHovers(event) {
449
- this.removeHoverClass()
450
- if (event.target.tagName !== 'TABLE' && event.target.tagName !== 'TH' && event.target.tagName !== 'TR') {
451
- let hoveredCell = event.target
452
-
453
- if (hoveredCell.tagName !== 'TD') {
454
- // Looking for hovered TD element
455
- hoveredCell = this.findParentElementByTagName(hoveredCell, 'TD')
438
+ methods: {
439
+ findParentElementByTagName(element, tagName) {
440
+ let currentParentElement = element.parentElement
441
+ while (
442
+ currentParentElement &&
443
+ currentParentElement.tagName !== tagName
444
+ ) {
445
+ currentParentElement = currentParentElement.parentElement
456
446
  }
457
447
 
458
- if (hoveredCell) {
459
- const rowChildren = Array.from(hoveredCell.parentElement.children)
460
- const hoveredCellIndex = rowChildren.indexOf(hoveredCell)
461
- const currentTable = this.findParentElementByTagName(hoveredCell, 'TABLE')
462
- if (currentTable) {
463
- const rowList = Array.from(currentTable.querySelectorAll('tr'))
464
- rowList.forEach((el) => {
465
- const cells = Array.from(el.children)
466
- if (cells[hoveredCellIndex]) {
467
- cells[hoveredCellIndex].classList.add('hovered-column')
468
- }
469
- })
448
+ return currentParentElement && currentParentElement.tagName === tagName
449
+ ? currentParentElement
450
+ : null
451
+ },
452
+ removeHoverClass() {
453
+ const hoveredItems = document.querySelectorAll('.hovered-column')
454
+ hoveredItems.forEach((el) => {
455
+ el.classList.remove('hovered-column')
456
+ })
457
+ },
458
+ setHovers(event) {
459
+ this.removeHoverClass()
460
+ if (
461
+ event.target.tagName !== 'TABLE' &&
462
+ event.target.tagName !== 'TH' &&
463
+ event.target.tagName !== 'TR'
464
+ ) {
465
+ let hoveredCell = event.target
466
+
467
+ if (hoveredCell.tagName !== 'TD') {
468
+ // Looking for hovered TD element
469
+ hoveredCell = this.findParentElementByTagName(hoveredCell, 'TD')
470
+ }
471
+
472
+ if (hoveredCell) {
473
+ const rowChildren = Array.from(hoveredCell.parentElement.children)
474
+ const hoveredCellIndex = rowChildren.indexOf(hoveredCell)
475
+ const currentTable = this.findParentElementByTagName(
476
+ hoveredCell,
477
+ 'TABLE'
478
+ )
479
+ if (currentTable) {
480
+ const rowList = Array.from(currentTable.querySelectorAll('tr'))
481
+ rowList.forEach((el) => {
482
+ const cells = Array.from(el.children)
483
+ if (cells[hoveredCellIndex]) {
484
+ cells[hoveredCellIndex].classList.add('hovered-column')
485
+ }
486
+ })
487
+ }
470
488
  }
471
489
  }
472
- }
490
+ },
491
+ observeTableHeight() {
492
+ if (!this.$refs.tableRef) return
493
+
494
+ const tableElement = this.$refs.tableRef.$el
495
+
496
+ this.resizeObserver = new ResizeObserver(() => {
497
+ const newTableHeight = this.titleText
498
+ ? tableElement.offsetHeight + 33
499
+ : tableElement.offsetHeight
500
+ this.tableHeight = `${newTableHeight}px`
501
+ this.doesTableContainDraggables = Boolean(
502
+ tableElement.querySelector('.drag-container')
503
+ )
504
+ })
505
+
506
+ this.resizeObserver.observe(tableElement)
507
+ },
473
508
  },
474
- observeTableHeight() {
475
- if (!this.$refs.tableRef) return
476
-
477
- const tableElement = this.$refs.tableRef.$el
478
-
479
- this.resizeObserver = new ResizeObserver(() => {
480
- const newTableHeight = this.titleText
481
- ? tableElement.offsetHeight + 33
482
- : tableElement.offsetHeight
483
- this.tableHeight = `${newTableHeight}px`
484
- this.doesTableContainDraggables = Boolean(
485
- tableElement.querySelector('.drag-container')
486
- )
487
- })
488
-
489
- this.resizeObserver.observe(tableElement)
490
- }
491
509
  }
492
- }
493
510
  </script>