hy-virtual-tree 1.1.9 → 1.1.11
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 +15 -0
- package/dist/index.js +10 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 1.1.11
|
|
4
|
+
|
|
5
|
+
_2025-09-02_
|
|
6
|
+
|
|
7
|
+
- 扩展[VirtualTree] 功能
|
|
8
|
+
(1)修复在开启rowSelection.checkStrictly时,双击节点无法触发全选问题
|
|
9
|
+
|
|
10
|
+
### 1.1.10
|
|
11
|
+
|
|
12
|
+
_2025-08-29_
|
|
13
|
+
|
|
14
|
+
- 扩展[VirtualTree] 功能
|
|
15
|
+
(1)对通过 filter 方法隐藏的节点不做勾选处理
|
|
16
|
+
(2)修复renderContent的样式问题
|
|
17
|
+
|
|
3
18
|
### 1.1.9
|
|
4
19
|
|
|
5
20
|
_2025-08-28_
|
package/dist/index.js
CHANGED
|
@@ -691,7 +691,7 @@ function useCheck(props, tree) {
|
|
|
691
691
|
};
|
|
692
692
|
const isChecked = (node) => checkedKeys.has(node.key);
|
|
693
693
|
const isIndeterminate = (node) => indeterminateKeys.has(node.key);
|
|
694
|
-
const toggleCheckbox = (node, isChecked, nodeClick = true, immediateUpdate = true, checkOnDbclick = false) => {
|
|
694
|
+
const toggleCheckbox = (node, isChecked, nodeClick = true, immediateUpdate = true, checkOnDbclick = false, hiddenNodeKeySet = new Set()) => {
|
|
695
695
|
const { type, checkStrictly, cancelable } = props.rowSelection;
|
|
696
696
|
const checkedKeySet = checkedKeys;
|
|
697
697
|
// 单选
|
|
@@ -707,6 +707,9 @@ function useCheck(props, tree) {
|
|
|
707
707
|
}
|
|
708
708
|
// 多选
|
|
709
709
|
const toggle = (node, checked) => {
|
|
710
|
+
// 对隐藏的节点不做处理
|
|
711
|
+
if (hiddenNodeKeySet.has(node.key))
|
|
712
|
+
return;
|
|
710
713
|
checkedKeySet[checked ? 'add' : 'delete'](node.key);
|
|
711
714
|
const children = node.children;
|
|
712
715
|
if ((!checkStrictly || checkOnDbclick) && children) {
|
|
@@ -1698,7 +1701,6 @@ class VirtualTree {
|
|
|
1698
1701
|
if (renderContent)
|
|
1699
1702
|
return renderContent(data, item);
|
|
1700
1703
|
const el = document.createElement('div');
|
|
1701
|
-
el.classList.add('hy-tree-node__content');
|
|
1702
1704
|
if (item.label) {
|
|
1703
1705
|
el.innerHTML = item.label;
|
|
1704
1706
|
}
|
|
@@ -1802,7 +1804,10 @@ class VirtualTree {
|
|
|
1802
1804
|
if (getDisabled(config, item))
|
|
1803
1805
|
return;
|
|
1804
1806
|
item.checkedMark = !(isChecked(item) || item.checkedMark);
|
|
1805
|
-
toggleCheckbox(item, item.checkedMark, true, true);
|
|
1807
|
+
toggleCheckbox(item, item.checkedMark, true, true, false, this._hiddenNodeKeySet);
|
|
1808
|
+
if (isChecked(item) || isIndeterminate(item)) {
|
|
1809
|
+
item.checkedMark = true;
|
|
1810
|
+
}
|
|
1806
1811
|
this.refresh();
|
|
1807
1812
|
}
|
|
1808
1813
|
});
|
|
@@ -1830,7 +1835,7 @@ class VirtualTree {
|
|
|
1830
1835
|
// 图标
|
|
1831
1836
|
customRender(generateIcon, item, content, 'hy-tree-icon');
|
|
1832
1837
|
// 内容
|
|
1833
|
-
customRender(generateContent, item, content);
|
|
1838
|
+
customRender(generateContent, item, content, 'hy-tree-node__content');
|
|
1834
1839
|
// 统计
|
|
1835
1840
|
customRender(generateStats, item, content);
|
|
1836
1841
|
// 右侧内容
|
|
@@ -1890,7 +1895,7 @@ class VirtualTree {
|
|
|
1890
1895
|
return;
|
|
1891
1896
|
}
|
|
1892
1897
|
nodeClickCount = 0;
|
|
1893
|
-
toggleCheckbox(item, !(isChecked(item) || isIndeterminate(item)), true, true);
|
|
1898
|
+
toggleCheckbox(item, !(isChecked(item) || isIndeterminate(item)), true, true, true);
|
|
1894
1899
|
this.refresh();
|
|
1895
1900
|
});
|
|
1896
1901
|
// 鼠标右键点击事件
|