hy-virtual-tree 2.0.5 → 2.0.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Changelog
2
2
 
3
+ ### 2.0.6
4
+
5
+ _2026-03-13_
6
+
7
+ (1)修复元素销毁时,tooltip显示时无法跟随销毁
8
+
3
9
  ### 2.0.5
4
10
 
5
11
  _2026-03-13_
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* hy-virtual-tree v2.0.5 */
1
+ /* hy-virtual-tree v2.0.6 */
2
2
  import './svg_bundle.js';
3
3
  const isString = (e) => typeof e === 'string';
4
4
  const isNumber = (e) => typeof e === 'number';
@@ -7162,27 +7162,38 @@ class Tooltip {
7162
7162
  break;
7163
7163
  }
7164
7164
  }
7165
- hide() {
7165
+ hide(isRealTime = false) {
7166
7166
  this._openTimer && clearTimeout(this._openTimer);
7167
7167
  this._closeTimer && clearTimeout(this._closeTimer);
7168
- this._closeTimer = setTimeout(() => {
7168
+ if (isRealTime) {
7169
7169
  if (!this._el)
7170
7170
  return;
7171
- this._el.classList.remove('hy-tooltip-show');
7172
- this._closeTimer && clearTimeout(this._closeTimer);
7171
+ this._el.style.setProperty('top', '-10000px');
7172
+ this._el.style.setProperty('left', '-10000px');
7173
+ if (!this._el.parentElement)
7174
+ return;
7175
+ this._el.parentElement.removeChild(this._el);
7176
+ }
7177
+ else {
7173
7178
  this._closeTimer = setTimeout(() => {
7174
7179
  if (!this._el)
7175
7180
  return;
7176
- this._el.style.setProperty('top', '-10000px');
7177
- this._el.style.setProperty('left', '-10000px');
7178
- if (!this._el.parentElement)
7179
- return;
7180
- this._el.parentElement.removeChild(this._el);
7181
+ this._el.classList.remove('hy-tooltip-show');
7182
+ this._closeTimer && clearTimeout(this._closeTimer);
7183
+ this._closeTimer = setTimeout(() => {
7184
+ if (!this._el)
7185
+ return;
7186
+ this._el.style.setProperty('top', '-10000px');
7187
+ this._el.style.setProperty('left', '-10000px');
7188
+ if (!this._el.parentElement)
7189
+ return;
7190
+ this._el.parentElement.removeChild(this._el);
7191
+ }, 200);
7181
7192
  }, 200);
7182
- }, 200);
7193
+ }
7183
7194
  }
7184
7195
  destroy() {
7185
- this.hide();
7196
+ this.hide(true);
7186
7197
  this._timer && clearTimeout(this._timer);
7187
7198
  this._trigger && this._trigger.destroy();
7188
7199
  this._el = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-virtual-tree",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",