@saooti/octopus-sdk 33.2.20 → 33.2.22

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": "@saooti/octopus-sdk",
3
- "version": "33.2.20",
3
+ "version": "33.2.22",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -32,6 +32,7 @@ export default defineComponent({
32
32
  disable: {type: Boolean, default: false},
33
33
  onlyClick: {type: Boolean, default: false},
34
34
  isFixed: {type: Boolean, default: false},
35
+ relativeClass: {type: String, default: undefined},
35
36
  leftPos: {type: Boolean, default: false},
36
37
  },
37
38
  data () {
@@ -93,10 +94,23 @@ export default defineComponent({
93
94
  this.isClick = true;
94
95
  }
95
96
  this.show = true;
97
+
98
+ let parentLeft = 0;
99
+ let parentRight = 0;
100
+ let parentTop = 0;
101
+ let parentScrollTop = 0;
102
+ if(this.relativeClass){
103
+ const modalBody = document.getElementsByClassName(this.relativeClass)[0];
104
+ const modalBodyRect = modalBody.getBoundingClientRect();
105
+ parentLeft = modalBodyRect.left;
106
+ parentRight = modalBodyRect.right;
107
+ parentTop = modalBodyRect.top;
108
+ parentScrollTop=modalBody.scrollTop;
109
+ }
96
110
  const rectElement = (e.target as HTMLElement).getBoundingClientRect();
97
111
  (this.$refs.popover as HTMLElement).style.display = 'block';
98
- this.posX = this.leftPos? rectElement.right - (this.$refs.popover as HTMLElement).clientWidth : rectElement.left;
99
- this.posY = rectElement.bottom + (this.isFixed ? 0 : window.scrollY)+ 5;
112
+ this.posX = this.leftPos? (rectElement.right -parentRight ) - (this.$refs.popover as HTMLElement).clientWidth : (rectElement.left -parentLeft );
113
+ this.posY = ((rectElement.bottom+ parentScrollTop ) - parentTop ) + (this.isFixed ? 0 : window.scrollY)+ 5;
100
114
  }
101
115
  },
102
116
  async clearDataBlur (e: FocusEvent) {