hy-virtual-tree 2.0.11 → 2.0.13
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 +12 -0
- package/dist/index.js +11 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hy-virtual-tree v2.0.
|
|
1
|
+
/* hy-virtual-tree v2.0.13 */
|
|
2
2
|
import './svg_bundle.js';
|
|
3
3
|
const isString = (e) => typeof e === 'string';
|
|
4
4
|
const isNumber = (e) => typeof e === 'number';
|
|
@@ -6709,7 +6709,7 @@ const getElement = (vnode) => {
|
|
|
6709
6709
|
return vnode.el;
|
|
6710
6710
|
};
|
|
6711
6711
|
const createVNode = (arg, render) => {
|
|
6712
|
-
const el =
|
|
6712
|
+
const el = isElement(arg) ? arg : document.createElement(arg);
|
|
6713
6713
|
let target = {
|
|
6714
6714
|
el,
|
|
6715
6715
|
children: [],
|
|
@@ -7968,6 +7968,7 @@ const useConfig = (config) => {
|
|
|
7968
7968
|
// checkOnClickLeaf: true,
|
|
7969
7969
|
// checkOnDblclickParentNode: true,
|
|
7970
7970
|
// indent: 16,
|
|
7971
|
+
showExpand: true,
|
|
7971
7972
|
...getGlobalVirtualTreeConfig(),
|
|
7972
7973
|
...config,
|
|
7973
7974
|
props,
|
|
@@ -8259,7 +8260,6 @@ function useCheck(props, instance) {
|
|
|
8259
8260
|
if (instance._hiddenNodeKeySet.has(node.key) || (tree.hiddenNodeKeySet.has(node.key) && nodeClick))
|
|
8260
8261
|
return;
|
|
8261
8262
|
}
|
|
8262
|
-
console.log('???', checked);
|
|
8263
8263
|
checkedKeySet[checked ? 'add' : 'delete'](node.key);
|
|
8264
8264
|
const children = node.children;
|
|
8265
8265
|
if ((!checkStrictly || checkOnDbclick) && children) {
|
|
@@ -9041,7 +9041,8 @@ const customRender = (options) => {
|
|
|
9041
9041
|
if (isObject(value) && value.el) {
|
|
9042
9042
|
// 处理从外部传入的没有挂载方法的节点
|
|
9043
9043
|
if (!value.mount) {
|
|
9044
|
-
value = createVNode(
|
|
9044
|
+
value = createVNode('div', (vnode) => {
|
|
9045
|
+
vnode.el.appendChild(value.el);
|
|
9045
9046
|
vnode.$destroy = value.$destroy;
|
|
9046
9047
|
});
|
|
9047
9048
|
}
|
|
@@ -9461,6 +9462,7 @@ class VirtualTree {
|
|
|
9461
9462
|
hiddenNodeKeySet: new Set()
|
|
9462
9463
|
};
|
|
9463
9464
|
_rowSelection = {};
|
|
9465
|
+
_showExpand = true;
|
|
9464
9466
|
_business;
|
|
9465
9467
|
_expandedKeySet = new Set(); // 展开的key
|
|
9466
9468
|
_hiddenExpandIconKeySet = new Set(); // 隐藏展开图标
|
|
@@ -9503,6 +9505,7 @@ class VirtualTree {
|
|
|
9503
9505
|
this._getKey = getKey;
|
|
9504
9506
|
this._businessConfig = config.businessConfig;
|
|
9505
9507
|
this._rowSelection = config.rowSelection;
|
|
9508
|
+
this._showExpand = isBoolean(config.showExpand) ? config.showExpand : true;
|
|
9506
9509
|
this._render(config);
|
|
9507
9510
|
}
|
|
9508
9511
|
/** 创建树数据 */
|
|
@@ -9873,7 +9876,10 @@ class VirtualTree {
|
|
|
9873
9876
|
&& item.data.deviceStatus === 0) {
|
|
9874
9877
|
contentContainer.el.style.color = config.placeholderColor;
|
|
9875
9878
|
}
|
|
9876
|
-
|
|
9879
|
+
if (this._showExpand) {
|
|
9880
|
+
const expandIcon = generateExpandIcon(item);
|
|
9881
|
+
contentContainer.el.appendChild(expandIcon);
|
|
9882
|
+
}
|
|
9877
9883
|
// 多选框/单选框
|
|
9878
9884
|
generateCheckbox(contentContainer, item);
|
|
9879
9885
|
// 整个节点内容
|