@eturnity/eturnity_reusable_components 6.43.9-qa-16-11.6.1 → 6.44.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "6.43.9-qa-16-11.06.1",
3
+ "version": "6.44.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -104,7 +104,12 @@
104
104
  :src="require('../../assets/icons/collapse_arrow_icon.svg')"
105
105
  />
106
106
  </arrow-wrapper>
107
- <options-container v-if="isOpen" ref="optionsContainer">
107
+ <options-container
108
+ v-if="isOpen"
109
+ :top="getItemLocation('top')"
110
+ :left="getItemLocation('left')"
111
+ ref="optionsContainer"
112
+ >
108
113
  <options-wrapper @click.prevent.stop>
109
114
  <search-container @click.prevent.stop>
110
115
  <search-input
@@ -283,7 +288,8 @@ const OptionsContainer = styled('div', optionsAttrs)`
283
288
  position: absolute;
284
289
  display: grid;
285
290
  grid-template-rows: 1fr auto;
286
- left: 20px;
291
+ top: ${(props) => props.top + 'px'};
292
+ left: ${(props) => props.left + 'px'};
287
293
  width: auto;
288
294
  max-height: 360px;
289
295
  min-height: 200px;
@@ -506,7 +512,7 @@ export default {
506
512
  methods: {
507
513
  toggleOpen(event) {
508
514
  if (
509
- this.disabled ||
515
+ this.isDisabled ||
510
516
  (event &&
511
517
  !(event.target === this.$el) &&
512
518
  !this.$el.contains(event.target))
@@ -557,6 +563,14 @@ export default {
557
563
  this.inputText = value
558
564
  this.$emit('dropdown-search', value)
559
565
  },
566
+ getItemLocation(value) {
567
+ let ref = this.$refs.dropdownItem[0]
568
+ let location = ref.$el.getBoundingClientRect()[value]
569
+ if (value === 'top') {
570
+ location = location + window.scrollY + 40
571
+ }
572
+ return location
573
+ },
560
574
  clickOutside(event) {
561
575
  if (event.target === this.$el || this.$el.contains(event.target)) {
562
576
  return
@@ -1,15 +1,9 @@
1
1
  <template>
2
- <page-container
3
- :tableHeight="tableHeight"
4
- :shouldSetCustomHeight="doesTableContainDraggables"
5
- >
2
+ <page-container>
6
3
  <table-title v-if="titleText">
7
4
  {{ titleText }}
8
5
  </table-title>
9
- <table-scroll
10
- ref="tableRef"
11
- :isPositionAbsolute="doesTableContainDraggables"
12
- >
6
+ <table-scroll>
13
7
  <table-wrapper :fullWidth="fullWidth">
14
8
  <spinner-wrapper v-if="isLoading">
15
9
  <spinner />
@@ -32,15 +26,7 @@
32
26
  import styled from 'vue-styled-components'
33
27
  import Spinner from '../../spinner'
34
28
 
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
- `
29
+ const PageContainer = styled.div``
44
30
 
45
31
  const TableTitle = styled.div`
46
32
  margin-bottom: 16px;
@@ -49,27 +35,15 @@ const TableTitle = styled.div`
49
35
  text-transform: uppercase;
50
36
  `
51
37
 
52
- const tableScrollProps = {
53
- isPositionAbsolute: Boolean
54
- }
55
-
56
- const TableScroll = styled('div', tableScrollProps)`
38
+ const TableScroll = styled.div`
57
39
  max-width: 100%;
58
- height: auto;
59
- ${(props) =>
60
- props.isPositionAbsolute &&
61
- `
62
- position: absolute;
63
- left: -20px;
64
- `}
65
40
  `
66
41
 
67
42
  const wrapperAttrs = { fullWidth: Boolean }
68
43
  const TableWrapper = styled('div', wrapperAttrs)`
69
44
  width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
70
45
  max-width: 100%;
71
- overflow-x: auto;
72
- overflow-y: hidden;
46
+ overflow: auto;
73
47
 
74
48
  ::-webkit-scrollbar {
75
49
  height: 5px; //height of the whole scrollbar area
@@ -93,11 +67,7 @@ const SpinnerWrapper = styled.div`
93
67
  justify-items: center;
94
68
  `
95
69
 
96
- const containerAttrs = {
97
- cellPaddings: String,
98
- tableCursor: String
99
- }
100
-
70
+ const containerAttrs = { cellPaddings: String, tableCursor: String }
101
71
  const TableContainer = styled('table', containerAttrs)`
102
72
  width: 100%;
103
73
  border-collapse: collapse;
@@ -408,39 +378,6 @@ export default {
408
378
  tableCursor: {
409
379
  required: false
410
380
  }
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
- }
444
381
  }
445
382
  }
446
383
  </script>
@@ -8,6 +8,8 @@
8
8
  <dropdown-container
9
9
  v-if="isOpen"
10
10
  @click.stop
11
+ :top="getItemLocation('top')"
12
+ :right="getItemLocation('right')"
11
13
  :containerWidth="childOpen ? 440 : 240"
12
14
  ref="dropdownContainer"
13
15
  >
@@ -128,7 +130,6 @@ const PageContainer = styled.div`
128
130
  justify-items: center;
129
131
  width: 30px;
130
132
  height: 30px;
131
- position: relative;
132
133
 
133
134
  &:hover {
134
135
  background-color: ${(props) => props.theme.colors.grey5};
@@ -157,15 +158,12 @@ const DotItem = styled.div`
157
158
  border-radius: 50%;
158
159
  `
159
160
 
160
- const dropdownAttrs = {
161
- containerWidth: Number
162
- }
161
+ const dropdownAttrs = { top: Number, right: Number, containerWidth: Number }
163
162
  const DropdownContainer = styled('div', dropdownAttrs)`
164
163
  z-index: 99;
165
164
  height: 200px;
166
- top: 0;
167
- right: 27px;
168
-
165
+ top: ${(props) => props.top + 'px'};
166
+ left: ${(props) => props.right - props.containerWidth + 'px'};
169
167
  position: absolute;
170
168
  display: grid;
171
169
  grid-template-columns: auto auto;
@@ -301,6 +299,14 @@ export default {
301
299
  document.removeEventListener('click', this.clickOutside)
302
300
  }
303
301
  },
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
+ },
304
310
  hasChildren(item) {
305
311
  return !!item.children && !!item.children.length
306
312
  },