@eturnity/eturnity_reusable_components 7.24.3-EPDM-10528.0 → 7.24.3-EPDM-7509.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.24.3-EPDM-10528.0",
3
+ "version": "7.24.3-EPDM-7509.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -18,6 +18,8 @@
18
18
  v-else
19
19
  :cellPaddings="cellPaddings"
20
20
  :tableCursor="tableCursor"
21
+ @mouseover="setHovers($event)"
22
+ @mouseleave="setHovers($event)"
21
23
  >
22
24
  <slot />
23
25
  </table-container>
@@ -121,8 +123,8 @@ const TableContainer = styled('table', containerAttrs)`
121
123
  }
122
124
 
123
125
  tbody {
124
- tr {
125
- &:hover {
126
+ tr, td {
127
+ &:hover, &.hover {
126
128
  background-color: ${(props) => props.theme.colors.white};
127
129
  cursor: ${(props) => (props.tableCursor ? props.tableCursor : 'auto')};
128
130
 
@@ -425,6 +427,31 @@ export default {
425
427
  }
426
428
  },
427
429
  methods: {
430
+ setHovers(event) {
431
+ if (event.target.tagName !== 'TABLE') {
432
+ console.log('over', event)
433
+ let hoveredCell = event.target
434
+ console.log(hoveredCell.tagName)
435
+
436
+ if (hoveredCell.tagName !== 'TD') {
437
+ let currentParentElement = hoveredCell.parentElement
438
+ while (currentParentElement.tagName !== 'TR') {
439
+ console.log(currentParentElement.tagName)
440
+ if (currentParentElement.tagName === 'TD') hoveredCell = currentParentElement
441
+ currentParentElement = currentParentElement.parentElement
442
+ }
443
+ }
444
+
445
+ if (hoveredCell) {
446
+ const rowChildren = Array.from(hoveredCell.parentElement.children)
447
+ const rowList = Array.from(document.querySelectorAll('tr'))
448
+ rowList.forEach((el) => {
449
+ const cells = Array.from(el.children)
450
+ cells[rowChildren.indexOf(hoveredCell)].classList.add('hover')
451
+ })
452
+ }
453
+ }
454
+ },
428
455
  observeTableHeight() {
429
456
  if (!this.$refs.tableRef) return
430
457