@eturnity/eturnity_reusable_components 6.33.0 → 6.33.1-EPDM-5205

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": "6.33.0",
3
+ "version": "6.33.1-EPDM-5205",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -1,12 +1,12 @@
1
1
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect x="2.98828" y="6" width="3" height="1.6" transform="rotate(90 2.98828 6)" fill="white"/>
3
- <path d="M2.21317 10.8279L4.35603 8.32892H0.0703125L2.21317 10.8279Z" fill="white"/>
4
- <path fill-rule="evenodd" clip-rule="evenodd" d="M2.18945 6C2.74174 6 3.18945 5.55228 3.18945 5C3.18945 4.44772 2.74174 4 2.18945 4C1.63717 4 1.18945 4.44772 1.18945 5C1.18945 5.55228 1.63717 6 2.18945 6ZM2.18945 7C3.29402 7 4.18945 6.10457 4.18945 5C4.18945 3.89543 3.29402 3 2.18945 3C1.08488 3 0.189453 3.89543 0.189453 5C0.189453 6.10457 1.08488 7 2.18945 7Z" fill="white"/>
5
- <rect x="7.77344" y="3" width="6" height="1.6" transform="rotate(90 7.77344 3)" fill="white"/>
6
- <path d="M6.99833 10.8279L9.14118 8.32892H4.85547L6.99833 10.8279Z" fill="white"/>
7
- <path fill-rule="evenodd" clip-rule="evenodd" d="M6.97461 3C7.52689 3 7.97461 2.55228 7.97461 2C7.97461 1.44772 7.52689 1 6.97461 1C6.42232 1 5.97461 1.44772 5.97461 2C5.97461 2.55228 6.42232 3 6.97461 3ZM6.97461 4C8.07918 4 8.97461 3.10457 8.97461 2C8.97461 0.895431 8.07918 0 6.97461 0C5.87004 0 4.97461 0.895431 4.97461 2C4.97461 3.10457 5.87004 4 6.97461 4Z" fill="white"/>
8
- <rect x="12.5605" y="5" width="4" height="1.6" transform="rotate(90 12.5605 5)" fill="white"/>
9
- <path d="M11.7854 10.8279L13.9283 8.32892H9.64258L11.7854 10.8279Z" fill="white"/>
10
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.7617 5C12.314 5 12.7617 4.55228 12.7617 4C12.7617 3.44772 12.314 3 11.7617 3C11.2094 3 10.7617 3.44772 10.7617 4C10.7617 4.55228 11.2094 5 11.7617 5ZM11.7617 6C12.8663 6 13.7617 5.10457 13.7617 4C13.7617 2.89543 12.8663 2 11.7617 2C10.6571 2 9.76172 2.89543 9.76172 4C9.76172 5.10457 10.6571 6 11.7617 6Z" fill="white"/>
11
- <rect x="14" y="14" width="14" height="1.6" transform="rotate(-180 14 14)" fill="white"/>
12
- </svg>
2
+ <path transform="rotate(90 2.98828 6)" fill="white" d="M2.9883 6h3v1.6H2.9883Z" />
3
+ <path d="M2.21317 10.8279L4.35603 8.32892H0.0703125L2.21317 10.8279Z" fill="white" />
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M2.18945 6C2.74174 6 3.18945 5.55228 3.18945 5C3.18945 4.44772 2.74174 4 2.18945 4C1.63717 4 1.18945 4.44772 1.18945 5C1.18945 5.55228 1.63717 6 2.18945 6ZM2.18945 7C3.29402 7 4.18945 6.10457 4.18945 5C4.18945 3.89543 3.29402 3 2.18945 3C1.08488 3 0.189453 3.89543 0.189453 5C0.189453 6.10457 1.08488 7 2.18945 7Z" fill="white" />
5
+ <path transform="rotate(90 7.77344 3)" fill="white" d="M7.7734 3h6v1.6H7.7734Z" />
6
+ <path d="M6.99833 10.8279L9.14118 8.32892H4.85547L6.99833 10.8279Z" fill="white" />
7
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.97461 3C7.52689 3 7.97461 2.55228 7.97461 2C7.97461 1.44772 7.52689 1 6.97461 1C6.42232 1 5.97461 1.44772 5.97461 2C5.97461 2.55228 6.42232 3 6.97461 3ZM6.97461 4C8.07918 4 8.97461 3.10457 8.97461 2C8.97461 0.895431 8.07918 0 6.97461 0C5.87004 0 4.97461 0.895431 4.97461 2C4.97461 3.10457 5.87004 4 6.97461 4Z" fill="white" />
8
+ <path transform="rotate(90 12.5605 5)" fill="white" d="M12.5605 5h4v1.6H12.5605Z" />
9
+ <path d="M11.7854 10.8279L13.9283 8.32892H9.64258L11.7854 10.8279Z" fill="white" />
10
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.7617 5C12.314 5 12.7617 4.55228 12.7617 4C12.7617 3.44772 12.314 3 11.7617 3C11.2094 3 10.7617 3.44772 10.7617 4C10.7617 4.55228 11.2094 5 11.7617 5ZM11.7617 6C12.8663 6 13.7617 5.10457 13.7617 4C13.7617 2.89543 12.8663 2 11.7617 2C10.6571 2 9.76172 2.89543 9.76172 4C9.76172 5.10457 10.6571 6 11.7617 6Z" fill="white" />
11
+ <path transform="rotate(-180 14 14)" fill="white" d="M14 14h14v1.6H14Z" />
12
+ </svg>
@@ -104,12 +104,7 @@
104
104
  :src="require('../../assets/icons/collapse_arrow_icon.svg')"
105
105
  />
106
106
  </arrow-wrapper>
107
- <options-container
108
- v-if="isOpen"
109
- :top="getItemLocation('top')"
110
- :left="getItemLocation('left')"
111
- ref="optionsContainer"
112
- >
107
+ <options-container v-if="isOpen" ref="optionsContainer">
113
108
  <options-wrapper @click.prevent.stop>
114
109
  <search-container @click.prevent.stop>
115
110
  <search-input
@@ -288,8 +283,7 @@ const OptionsContainer = styled('div', optionsAttrs)`
288
283
  position: absolute;
289
284
  display: grid;
290
285
  grid-template-rows: 1fr auto;
291
- top: ${(props) => props.top + 'px'};
292
- left: ${(props) => props.left + 'px'};
286
+ left: 20px;
293
287
  width: auto;
294
288
  max-height: 360px;
295
289
  min-height: 200px;
@@ -558,14 +552,6 @@ export default {
558
552
  this.inputText = value
559
553
  this.$emit('dropdown-search', value)
560
554
  },
561
- getItemLocation(value) {
562
- let ref = this.$refs.dropdownItem[0]
563
- let location = ref.$el.getBoundingClientRect()[value]
564
- if (value === 'top') {
565
- location = location + window.scrollY + 40
566
- }
567
- return location
568
- },
569
555
  clickOutside(event) {
570
556
  if (event.target === this.$el || this.$el.contains(event.target)) {
571
557
  return
@@ -1,9 +1,15 @@
1
1
  <template>
2
- <page-container>
2
+ <page-container
3
+ :tableHeight="tableHeight"
4
+ :shouldSetCustomHeight="doesTableContainDraggables"
5
+ >
3
6
  <table-title v-if="titleText">
4
7
  {{ titleText }}
5
8
  </table-title>
6
- <table-scroll>
9
+ <table-scroll
10
+ ref="tableRef"
11
+ :isPositionAbsolute="doesTableContainDraggables"
12
+ >
7
13
  <table-wrapper :fullWidth="fullWidth">
8
14
  <spinner-wrapper v-if="isLoading">
9
15
  <spinner />
@@ -26,7 +32,15 @@
26
32
  import styled from 'vue-styled-components'
27
33
  import Spinner from '../../spinner'
28
34
 
29
- const PageContainer = styled.div``
35
+ const pageContainerProps = {
36
+ tableHeight: String,
37
+ shouldSetCustomHeight: Boolean
38
+ }
39
+ const PageContainer = styled('div', pageContainerProps)`
40
+ position: relative;
41
+ height: ${(props) =>
42
+ props.shouldSetCustomHeight ? props.tableHeight : 'auto'};
43
+ `
30
44
 
31
45
  const TableTitle = styled.div`
32
46
  margin-bottom: 16px;
@@ -35,15 +49,27 @@ const TableTitle = styled.div`
35
49
  text-transform: uppercase;
36
50
  `
37
51
 
38
- const TableScroll = styled.div`
52
+ const tableScrollProps = {
53
+ isPositionAbsolute: Boolean
54
+ }
55
+
56
+ const TableScroll = styled('div', tableScrollProps)`
39
57
  max-width: 100%;
58
+ height: auto;
59
+ ${(props) =>
60
+ props.isPositionAbsolute &&
61
+ `
62
+ position: absolute;
63
+ left: -20px;
64
+ `}
40
65
  `
41
66
 
42
67
  const wrapperAttrs = { fullWidth: Boolean }
43
68
  const TableWrapper = styled('div', wrapperAttrs)`
44
69
  width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
45
70
  max-width: 100%;
46
- overflow: auto;
71
+ overflow-x: auto;
72
+ overflow-y: hidden;
47
73
 
48
74
  ::-webkit-scrollbar {
49
75
  height: 5px; //height of the whole scrollbar area
@@ -67,7 +93,11 @@ const SpinnerWrapper = styled.div`
67
93
  justify-items: center;
68
94
  `
69
95
 
70
- const containerAttrs = { cellPaddings: String, tableCursor: String }
96
+ const containerAttrs = {
97
+ cellPaddings: String,
98
+ tableCursor: String
99
+ }
100
+
71
101
  const TableContainer = styled('table', containerAttrs)`
72
102
  width: 100%;
73
103
  border-collapse: collapse;
@@ -378,6 +408,39 @@ export default {
378
408
  tableCursor: {
379
409
  required: false
380
410
  }
411
+ },
412
+ data() {
413
+ return {
414
+ tableHeight: 'auto',
415
+ doesTableContainDraggables: false
416
+ }
417
+ },
418
+ mounted() {
419
+ this.observeTableHeight()
420
+ },
421
+ beforeDestroy() {
422
+ if (this.resizeObserver) {
423
+ this.resizeObserver.disconnect()
424
+ }
425
+ },
426
+ methods: {
427
+ observeTableHeight() {
428
+ if (!this.$refs.tableRef) return
429
+
430
+ const tableElement = this.$refs.tableRef.$el
431
+
432
+ this.resizeObserver = new ResizeObserver(() => {
433
+ const newTableHeight = this.titleText
434
+ ? tableElement.offsetHeight + 33
435
+ : tableElement.offsetHeight
436
+ this.tableHeight = `${newTableHeight}px`
437
+ this.doesTableContainDraggables = Boolean(
438
+ tableElement.querySelector('.drag-container')
439
+ )
440
+ })
441
+
442
+ this.resizeObserver.observe(tableElement)
443
+ }
381
444
  }
382
445
  }
383
446
  </script>
@@ -8,8 +8,6 @@
8
8
  <dropdown-container
9
9
  v-if="isOpen"
10
10
  @click.stop
11
- :top="getItemLocation('top')"
12
- :right="getItemLocation('right')"
13
11
  :containerWidth="childOpen ? 440 : 240"
14
12
  ref="dropdownContainer"
15
13
  >
@@ -130,6 +128,7 @@ const PageContainer = styled.div`
130
128
  justify-items: center;
131
129
  width: 30px;
132
130
  height: 30px;
131
+ position: relative;
133
132
 
134
133
  &:hover {
135
134
  background-color: ${(props) => props.theme.colors.grey5};
@@ -158,12 +157,15 @@ const DotItem = styled.div`
158
157
  border-radius: 50%;
159
158
  `
160
159
 
161
- const dropdownAttrs = { top: Number, right: Number, containerWidth: Number }
160
+ const dropdownAttrs = {
161
+ containerWidth: Number
162
+ }
162
163
  const DropdownContainer = styled('div', dropdownAttrs)`
163
164
  z-index: 99;
164
165
  height: 200px;
165
- top: ${(props) => props.top + 'px'};
166
- left: ${(props) => props.right - props.containerWidth + 'px'};
166
+ top: 0;
167
+ right: 27px;
168
+
167
169
  position: absolute;
168
170
  display: grid;
169
171
  grid-template-columns: auto auto;
@@ -299,14 +301,6 @@ export default {
299
301
  document.removeEventListener('click', this.clickOutside)
300
302
  }
301
303
  },
302
- getItemLocation(value) {
303
- let ref = this.$refs.dropdownItem
304
- let location = ref.$el.getBoundingClientRect()[value]
305
- if (value === 'top') {
306
- location = location + window.scrollY
307
- }
308
- return location
309
- },
310
304
  hasChildren(item) {
311
305
  return !!item.children && !!item.children.length
312
306
  },