hy-virtual-tree 1.1.71 → 1.1.72

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,12 +1,19 @@
1
1
  ## Changelog
2
2
 
3
+ ### 1.1.72
4
+
5
+ _2026-02-02_
6
+
7
+ - 扩展[VirtualTree] 功能
8
+ (1)修复树形的展开和选中逻辑问题,提取展开逻辑函数
9
+
3
10
  ### 1.1.71
4
11
 
5
12
  _2026-01-31_
6
13
 
7
14
  - 扩展[VirtualTree] 功能
8
15
  (1)修复 channel业务下,设备下全部通道离线会导致设备的下拉选项隐藏问题
9
- 1)修复 tooltip 快速滚动导致不会隐藏问题
16
+ 2)修复 tooltip 快速滚动导致不会隐藏问题
10
17
 
11
18
  ### 1.1.70
12
19
 
package/dist/index.js CHANGED
@@ -8114,6 +8114,14 @@ const isCheckLeaf = (config, node) => {
8114
8114
  }
8115
8115
  return node.isLeaf;
8116
8116
  };
8117
+ const isExpandLeaf = (config, node) => {
8118
+ // 非通道业务 或 非设备类型
8119
+ if (config.business !== Business.CHANNEL || node.data.dataType !== DataType.DEVICE) {
8120
+ return node.isLeaf;
8121
+ }
8122
+ // 设备类型
8123
+ return config.businessConfig?.showOnlineState ? !node.count : !node.total;
8124
+ };
8117
8125
  function useCheck(props, instance) {
8118
8126
  const tree = instance._tree;
8119
8127
  const checkedKeys = new Set();
@@ -9658,10 +9666,7 @@ class VirtualTree {
9658
9666
  const icon = document.createElement('div');
9659
9667
  icon.classList.add('hy-tree-node__expand-icon');
9660
9668
  el.appendChild(icon);
9661
- const isHideIcon = config.business !== Business.CHANNEL || item.data.dataType !== DataType.DEVICE
9662
- ? item.isLeaf
9663
- : this._businessConfig?.showOnlineState ? !item.count : !item.total;
9664
- if (isHideIcon || this._hiddenExpandIconKeySet.has(item.key)) {
9669
+ if (isExpandLeaf(config, item) || this._hiddenExpandIconKeySet.has(item.key)) {
9665
9670
  el.style.setProperty('visibility', 'hidden');
9666
9671
  }
9667
9672
  else {
@@ -9830,7 +9835,7 @@ class VirtualTree {
9830
9835
  if (config.onNodeClick) {
9831
9836
  await config.onNodeClick(getNodeData(item), item, e);
9832
9837
  }
9833
- const isLeaf = isCheckLeaf(config, item);
9838
+ const isLeaf = isExpandLeaf(config, item);
9834
9839
  if (!getDisabled(config, item) && isShowSelect(config, item)) {
9835
9840
  if (config.checkOnClickNode) {
9836
9841
  toggleCheckbox(item, !(isChecked(item) || isIndeterminate(item)), true, true);
@@ -9880,6 +9885,7 @@ class VirtualTree {
9880
9885
  nodeClickTimer = setTimeout(() => {
9881
9886
  if (nodeClickCount === 1) {
9882
9887
  nodeClickHandle(e);
9888
+ nodeClickCount = 0;
9883
9889
  }
9884
9890
  else {
9885
9891
  nodeClickCount = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-virtual-tree",
3
- "version": "1.1.71",
3
+ "version": "1.1.72",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",