hy-virtual-tree 2.0.13 → 2.0.14

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.14
4
+
5
+ _2026-05-11_
6
+
7
+ (1)新增 默认展开 和 筛选展开 逻辑
8
+
3
9
  ### 2.0.13
4
10
 
5
11
  _2026-05-07_
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* hy-virtual-tree v2.0.13 */
1
+ /* hy-virtual-tree v2.0.14 */
2
2
  import './svg_bundle.js';
3
3
  const isString = (e) => typeof e === 'string';
4
4
  const isNumber = (e) => typeof e === 'number';
@@ -10030,6 +10030,7 @@ class VirtualTree {
10030
10030
  // }
10031
10031
  }
10032
10032
  });
10033
+ this._renderHandler();
10033
10034
  config.onLoad && config.onLoad();
10034
10035
  // @ts-ignore
10035
10036
  // 更新函数
@@ -10153,6 +10154,7 @@ class VirtualTree {
10153
10154
  // this._destroyDomSet.delete($destroy)
10154
10155
  // }
10155
10156
  this._isForceHiddenExpandIcon = undefined;
10157
+ this._renderHandler();
10156
10158
  this._updateCheckedKeys();
10157
10159
  this._refreshVirtualScroll();
10158
10160
  callback && callback();
@@ -10196,6 +10198,17 @@ class VirtualTree {
10196
10198
  }
10197
10199
  };
10198
10200
  })();
10201
+ /** 渲染初始化 */
10202
+ _isRenderInitial = false;
10203
+ _renderHandler() {
10204
+ if (this._isRenderInitial)
10205
+ return;
10206
+ const expandedKeys = new Set(this._tree.treeNodeMap.keys());
10207
+ if (expandedKeys.size) {
10208
+ this._expandedKeySet = expandedKeys;
10209
+ this._isRenderInitial = true;
10210
+ }
10211
+ }
10199
10212
  /** 获取指定节点 */
10200
10213
  getNode = (data) => {
10201
10214
  const key = isObject(data)
@@ -10335,6 +10348,7 @@ class VirtualTree {
10335
10348
  }, this._filterMethod, this._tree);
10336
10349
  const keys = doFilter(params, filterAll);
10337
10350
  if (keys) {
10351
+ this._expandedKeySet = keys;
10338
10352
  this._hiddenExpandIconKeySet = hiddenExpandIconKeySet;
10339
10353
  this._hiddenNodeKeySet = hiddenNodeKeySet;
10340
10354
  this._isForceHiddenExpandIcon = isForceHiddenExpandIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-virtual-tree",
3
- "version": "2.0.13",
3
+ "version": "2.0.14",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",