evui 3.3.4 → 3.3.5

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": "evui",
3
- "version": "3.3.4",
3
+ "version": "3.3.5",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -555,7 +555,6 @@ class EvChart {
555
555
  if (!updateSelTip.keepDomain) {
556
556
  this.lastTip.pos = null;
557
557
  this.lastHitInfo = null;
558
- this.defaultSelectInfo = null;
559
558
  }
560
559
  }
561
560
 
@@ -713,6 +712,8 @@ class EvChart {
713
712
  this.overlayCanvas.removeEventListener('mouseleave', this.onMouseLeave);
714
713
  this.overlayCanvas.removeEventListener('dblclick', this.onDblClick);
715
714
  this.overlayCanvas.removeEventListener('click', this.onClick);
715
+ this.overlayCanvas.removeEventListener('mousedown', this.onMouseDown);
716
+ this.overlayCanvas.removeEventListener('wheel', this.onWheel);
716
717
  }
717
718
 
718
719
  if (this.options.tooltip.use) {
@@ -160,15 +160,17 @@ const modules = {
160
160
  }
161
161
  };
162
162
 
163
- if (this.options?.tooltip?.useScrollbar) {
164
- this.overlayCanvas.addEventListener('wheel', (e) => {
165
- const isTooltipVisible = this.tooltipDOM.style.display === 'block';
163
+ this.onWheel = (e) => {
164
+ const isTooltipVisible = this.tooltipDOM.style.display === 'block';
166
165
 
167
- if (isTooltipVisible) {
168
- e.preventDefault();
169
- this.tooltipBodyDOM.scrollTop += e.deltaY;
170
- }
171
- });
166
+ if (isTooltipVisible) {
167
+ e.preventDefault();
168
+ this.tooltipBodyDOM.scrollTop += e.deltaY;
169
+ }
170
+ };
171
+
172
+ if (this.options?.tooltip?.useScrollbar) {
173
+ this.overlayCanvas.addEventListener('wheel', this.onWheel, { passive: false });
172
174
  }
173
175
 
174
176
  this.overlayCanvas.addEventListener('mousemove', this.onMouseMove);
@@ -408,6 +410,7 @@ const modules = {
408
410
  * @returns {boolean}
409
411
  */
410
412
  selectItemByData(targetInfo) {
413
+ this.defaultSelectInfo = targetInfo;
411
414
  const foundInfo = this.getItem(targetInfo, false);
412
415
 
413
416
  if (foundInfo) {
@@ -48,7 +48,7 @@
48
48
  </template>
49
49
 
50
50
  <script>
51
- import { reactive, toRefs, onMounted, onUnmounted } from 'vue';
51
+ import { reactive, toRefs, onMounted, onBeforeUnmount } from 'vue';
52
52
 
53
53
  export default {
54
54
  name: 'EvMessage',
@@ -125,8 +125,9 @@ export default {
125
125
  startTimer();
126
126
  document.addEventListener('keydown', keydown);
127
127
  });
128
- onUnmounted(() => {
128
+ onBeforeUnmount(() => {
129
129
  document.removeEventListener('keydown', keydown);
130
+ clearTimer();
130
131
  });
131
132
  return {
132
133
  startTimer,
@@ -83,7 +83,7 @@
83
83
  </template>
84
84
 
85
85
  <script>
86
- import { reactive, toRefs, watch, onMounted, ref } from 'vue';
86
+ import { reactive, toRefs, watch, onMounted, ref, onBeforeUnmount } from 'vue';
87
87
  import EvButton from '@/components/button/Button.vue';
88
88
 
89
89
  export default {
@@ -226,6 +226,9 @@ export default {
226
226
  document.removeEventListener('keydown', keydown);
227
227
  }
228
228
  });
229
+ onBeforeUnmount(() => {
230
+ document.removeEventListener('keydown', keydown);
231
+ });
229
232
  return {
230
233
  closeMsg,
231
234
  ...toRefs(state),
@@ -55,7 +55,7 @@
55
55
  </template>
56
56
 
57
57
  <script>
58
- import { reactive, toRefs, onMounted, onUnmounted } from 'vue';
58
+ import { reactive, toRefs, onMounted, onBeforeUnmount } from 'vue';
59
59
 
60
60
  export default {
61
61
  name: 'EvNotification',
@@ -153,8 +153,9 @@ export default {
153
153
  startTimer();
154
154
  document.addEventListener('keydown', keydown);
155
155
  });
156
- onUnmounted(() => {
156
+ onBeforeUnmount(() => {
157
157
  document.removeEventListener('keydown', keydown);
158
+ clearTimer();
158
159
  });
159
160
  return {
160
161
  startTimer,