@taocompany/magic-grid 0.7.1 → 0.7.2

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/dist/index.es.js CHANGED
@@ -10697,10 +10697,22 @@ var bg = class {
10697
10697
  return this.deps.getLazyLoadHost?.()?.isLoading(e) ?? !1;
10698
10698
  }
10699
10699
  expandAll(e) {
10700
- if (this.active) for (let t of gg(this.deps.getTreeTreeRoots(), (e) => this.isNodeExpandable(e))) this.expandedRowIds.has(t) || this.expandNode(t, e);
10700
+ if (!this.active) return;
10701
+ let t = gg(this.deps.getTreeTreeRoots(), (e) => this.isNodeExpandable(e)), n = !1;
10702
+ for (let e of t) {
10703
+ if (this.expandedRowIds.has(e)) continue;
10704
+ let t = _g(this.deps.getTreeTreeRoots(), e);
10705
+ !t || !this.isNodeExpandable(t) || (this.expandedRowIds.add(e), n = !0);
10706
+ }
10707
+ n && this.deps.onTreeStateChanged?.();
10701
10708
  }
10702
10709
  collapseAll() {
10703
- if (this.active) for (let e of [...this.expandedRowIds]) this.collapseNode(e, "api");
10710
+ if (!this.active) return;
10711
+ let e = [...this.expandedRowIds];
10712
+ if (e.length === 0) return;
10713
+ let t = this.deps.getLazyLoadHost?.();
10714
+ for (let n of e) t?.abortLoad(n), this.expandedRowIds.delete(n);
10715
+ this.deps.onTreeStateChanged?.();
10704
10716
  }
10705
10717
  isAllExpandableNodesExpanded() {
10706
10718
  if (!this.active) return !1;
@@ -21368,7 +21380,7 @@ var DT = class {
21368
21380
  getTreeTreeRoots: () => this.rowModel.getTreeTreeRoots(),
21369
21381
  getLazyLoadHost: () => this.treeLazyLoadService,
21370
21382
  onNodeOpened: (e) => {
21371
- this.eventBus.emit("treeNodeOpened", e), this.syncTreeTableDisplay();
21383
+ this.eventBus.emit("treeNodeOpened", e);
21372
21384
  },
21373
21385
  onTreeStateChanged: () => {
21374
21386
  this.syncTreeTableDisplay();