hy-virtual-tree 1.1.40 → 1.1.42
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 +14 -0
- package/dist/index.js +12 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -138,13 +138,20 @@ class Icon {
|
|
|
138
138
|
el.style.width = `${config.width}px`;
|
|
139
139
|
el.style.height = `${config.height}px`;
|
|
140
140
|
el.addEventListener('click', (e) => {
|
|
141
|
-
if (
|
|
142
|
-
|
|
141
|
+
if (this._disabled)
|
|
142
|
+
return;
|
|
143
|
+
if (config.onClick) {
|
|
144
|
+
config.onClick(e);
|
|
145
|
+
e.stopPropagation();
|
|
143
146
|
}
|
|
144
|
-
e.stopPropagation();
|
|
145
147
|
});
|
|
146
148
|
el.addEventListener('dblclick', (e) => {
|
|
147
|
-
|
|
149
|
+
if (this._disabled)
|
|
150
|
+
return;
|
|
151
|
+
if (config.onDbclick) {
|
|
152
|
+
config.onDbclick(e);
|
|
153
|
+
e.stopPropagation();
|
|
154
|
+
}
|
|
148
155
|
});
|
|
149
156
|
this._el = el;
|
|
150
157
|
}
|
|
@@ -2095,7 +2102,7 @@ class VirtualTree {
|
|
|
2095
2102
|
onClick: () => {
|
|
2096
2103
|
if (getDisabled(config, item))
|
|
2097
2104
|
return;
|
|
2098
|
-
item.checkedMark = !(isChecked(item) || item.checkedMark);
|
|
2105
|
+
item.checkedMark = item.children?.length ? !(isChecked(item) || item.checkedMark) : !isChecked(item);
|
|
2099
2106
|
toggleCheckbox(item, item.checkedMark, true, true, false, this._hiddenNodeKeySet);
|
|
2100
2107
|
if (isChecked(item) || isIndeterminate(item)) {
|
|
2101
2108
|
item.checkedMark = true;
|