earthsdk3 3.11.2 → 3.11.3-beta.1

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/earthsdk3.js CHANGED
@@ -43,7 +43,7 @@ function to(n) {
43
43
  }
44
44
  let Ni;
45
45
  try {
46
- const n = "earthsdk3", i = "3.11.2", e = "2026-08-14T01:44:25.000Z", t = "北京西部世界科技有限公司", s = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", r = "96c00e37006fd8a610c7b19b647f2b40a48e8846", l = ((Date.now() - 1786671865e3) / 36e5).toFixed(1), h = `%c🌏 ${n}%c ${i}.${r.slice(0, 8)}.${e} (距今${l}个小时)
46
+ const n = "earthsdk3", i = "3.11.3-beta.1", e = "2026-09-09T06:37:16.000Z", t = "北京西部世界科技有限公司", s = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", r = "d983ef6edbe46624b3bae491829389ea6120258b", l = ((Date.now() - 1788935836e3) / 36e5).toFixed(1), h = `%c🌏 ${n}%c ${i}.${r.slice(0, 8)}.${e} (距今${l}个小时)
47
47
  %c${s ? s + `
48
48
  ` : ""}当前网站正在使用${n},此软件版权归${t}所有
49
49
  `;
@@ -57,7 +57,7 @@ try {
57
57
  },
58
58
  // @ts-ignore
59
59
  get gituri() {
60
- return GITURI_ && GITURI_.replace("${commitId}", "96c00e37006fd8a610c7b19b647f2b40a48e8846");
60
+ return GITURI_ && GITURI_.replace("${commitId}", "d983ef6edbe46624b3bae491829389ea6120258b");
61
61
  },
62
62
  // @ts-ignore
63
63
  get info() {
@@ -65,7 +65,7 @@ try {
65
65
  },
66
66
  // @ts-ignore
67
67
  get date() {
68
- return "2026-08-14T01:44:25.000Z";
68
+ return "2026-09-09T06:37:16.000Z";
69
69
  },
70
70
  // @ts-ignore
71
71
  get author() {
@@ -73,7 +73,7 @@ try {
73
73
  },
74
74
  // @ts-ignore
75
75
  get version() {
76
- return "3.11.2";
76
+ return "3.11.3-beta.1";
77
77
  },
78
78
  // @ts-ignore
79
79
  get name() {
@@ -81,7 +81,7 @@ try {
81
81
  },
82
82
  // @ts-ignore
83
83
  get commitId() {
84
- return "96c00e37006fd8a610c7b19b647f2b40a48e8846";
84
+ return "d983ef6edbe46624b3bae491829389ea6120258b";
85
85
  },
86
86
  /**
87
87
  * 打印版权信息到控制台
@@ -4855,6 +4855,11 @@ class Sd extends E {
4855
4855
  ));
4856
4856
  a(this, "_containerScrollTop", this.disposeVar(y(0)));
4857
4857
  a(this, "_containerClientHeight", this.disposeVar(y(-1)));
4858
+ // 可选的筛选函数:非空时,树中只显示匹配的节点及其祖先链(祖先自动展开)
4859
+ // 注意:节点改名不会触发重绘,筛选期间改名后需调用 tree.forceRedraw() 刷新
4860
+ a(this, "_filterFunc", this.disposeVar(
4861
+ y(void 0)
4862
+ ));
4858
4863
  a(this, "_container", this.disposeVar(
4859
4864
  y(void 0)
4860
4865
  ));
@@ -4882,16 +4887,15 @@ class Sd extends E {
4882
4887
  this._tree.itemsChanged,
4883
4888
  t.changed,
4884
4889
  s.changed,
4885
- r
4890
+ r,
4891
+ this._filterFunc.changed
4886
4892
  )
4887
- ), { redrawInfo: l } = this, h = (d) => {
4888
- const u = d.uiTreeObject;
4889
- return !!d.children && (!u || !u.collapsed);
4890
- };
4893
+ ), { redrawInfo: l } = this;
4891
4894
  this.dispose(
4892
4895
  o.disposableOn(() => {
4896
+ const c = this._createTraverseFunc();
4893
4897
  if (l.topFreeSpaceHeight = 0, l.topUnvisibleItemNum = 0, l.middleTreeItems.length = 0, l.bottomFreeSpaceHeight = 0, l.bottomUnvisibleItemNum = 0, this._containerClientHeight.value >= 0) {
4894
- const d = Wl(this._tree.getDescendants(h)), u = this._tree.itemDivHeight, p = u * d, f = os([
4898
+ const d = Wl(this._tree.getDescendants(c)), u = this._tree.itemDivHeight, p = u * d, f = os([
4895
4899
  Ls([
4896
4900
  os([p - t.value, 0]),
4897
4901
  s.value
@@ -4903,7 +4907,7 @@ class Sd extends E {
4903
4907
  _ > 0 && (l.topUnvisibleItemNum = _, l.topFreeSpaceHeight = _ * this._tree.itemDivHeight);
4904
4908
  const S = _ + b;
4905
4909
  let P = 0;
4906
- for (let V of this._tree.getDescendants(h)) {
4910
+ for (let V of this._tree.getDescendants(c)) {
4907
4911
  if (P >= S)
4908
4912
  break;
4909
4913
  P >= _ && l.middleTreeItems.push(V), ++P;
@@ -4911,25 +4915,34 @@ class Sd extends E {
4911
4915
  const R = d - _ - b;
4912
4916
  R > 0 && (l.bottomUnvisibleItemNum = R, l.bottomFreeSpaceHeight = R * this._tree.itemDivHeight);
4913
4917
  } else
4914
- for (let d of this._tree.getDescendants(h))
4918
+ for (let d of this._tree.getDescendants(c))
4915
4919
  l.middleTreeItems.push(d);
4916
4920
  this._redrawEvent.emit(l);
4917
4921
  })
4918
4922
  );
4919
- let c;
4923
+ let h;
4920
4924
  this.dispose(
4921
- () => c && (c.destroy(), c = void 0)
4925
+ () => h && (h.destroy(), h = void 0)
4922
4926
  ), this.dispose(
4923
- this.containerChanged.disposableOn((d) => {
4924
- c && (c.destroy(), c = void 0), d && (c = Bn(), c.start(() => {
4925
- const { scrollTop: u, clientHeight: p } = d;
4926
- typeof u > "u" || typeof p > "u" ? Ji(
4927
+ this.containerChanged.disposableOn((c) => {
4928
+ h && (h.destroy(), h = void 0), c && (h = Bn(), h.start(() => {
4929
+ const { scrollTop: d, clientHeight: u } = c;
4930
+ typeof d > "u" || typeof u > "u" ? Ji(
4927
4931
  "createUiTreeWithContainer error: conainter has no scrollTop or clientHeight property!"
4928
- ) : (this.containerScrollTop = u, this.containerClientHeight = p);
4932
+ ) : (this.containerScrollTop = d, this.containerClientHeight = u);
4929
4933
  }));
4930
4934
  })
4931
4935
  );
4932
4936
  }
4937
+ get filterFunc() {
4938
+ return this._filterFunc.value;
4939
+ }
4940
+ set filterFunc(e) {
4941
+ this._filterFunc.value = e;
4942
+ }
4943
+ get filterFuncChanged() {
4944
+ return this._filterFunc.changed;
4945
+ }
4933
4946
  get container() {
4934
4947
  return this._container.value;
4935
4948
  }
@@ -4942,11 +4955,31 @@ class Sd extends E {
4942
4955
  get redrawInfo() {
4943
4956
  return this._redrawInfo;
4944
4957
  }
4945
- getTreeItemPos(e) {
4946
- const t = (o) => {
4947
- const l = o.uiTreeObject;
4948
- return !!o.children && (!l || !l.collapsed);
4958
+ /**
4959
+ * 生成遍历用的 traverseFunc(决定 getDescendants 是否下钻)
4960
+ * 无筛选时按 collapsed 状态下钻;有筛选时先 DFS 计算可见集(匹配节点及其祖先链),
4961
+ * 只下钻存在可见后代的节点,忽略 collapsed(不修改节点的折叠状态)。
4962
+ * redraw 与 getTreeItemPos 必须共用此方法,保证虚拟滚动与定位一致。
4963
+ */
4964
+ _createTraverseFunc() {
4965
+ const e = this._filterFunc.value;
4966
+ if (!e)
4967
+ return (r) => {
4968
+ const o = r.uiTreeObject;
4969
+ return !!r.children && (!o || !o.collapsed);
4970
+ };
4971
+ const t = /* @__PURE__ */ new Set(), s = (r) => {
4972
+ let o = !1;
4973
+ if (r.children)
4974
+ for (let h of r.children)
4975
+ s(h) && (o = !0);
4976
+ const l = !!e(r) || o;
4977
+ return l && o && t.add(r), l;
4949
4978
  };
4979
+ return s(this._tree.root), (r) => !!r.children && t.has(r);
4980
+ }
4981
+ getTreeItemPos(e) {
4982
+ const t = this._createTraverseFunc();
4950
4983
  let s = 0, r = !1;
4951
4984
  for (let o of this._tree.getDescendants(t)) {
4952
4985
  if (o === e) {