treege 1.0.6 → 1.0.7

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/treege/releases)
2
2
 
3
- ## v1.0.6
4
- - **[fix]** : tree node unique id
3
+ ## v1.0.7
4
+ - **[fix]** : remove tree node and its children only if is a decision node. Now you can remove a tree node without removing its children.
package/dist/main.js CHANGED
@@ -5926,7 +5926,21 @@ const rl = (e, t) => {
5926
5926
  return a;
5927
5927
  }
5928
5928
  return null;
5929
- }, _p = (e, t) => (!e || !t || (Object.defineProperty(e, "children", { value: e.children.filter((n) => n.uuid !== t.uuid) }), Object.defineProperty(e, "attributes", { value: { ...e.attributes, isLeaf: !0 } })), null), Ep = (e, t, n) => {
5929
+ }, _p = (e, t) => !e || !t ? null : e.attributes.isDecision || t.attributes.isDecision ? (Object.defineProperty(e, "children", {
5930
+ value: [...e.children.filter((n) => n.uuid !== t.uuid)]
5931
+ }), Object.defineProperty(e, "attributes", {
5932
+ value: {
5933
+ ...e.attributes,
5934
+ isLeaf: !e.children.length
5935
+ }
5936
+ }), null) : (Object.defineProperty(e, "children", {
5937
+ value: [...e.children.filter((n) => n.uuid !== t.uuid), ...t.children]
5938
+ }), Object.defineProperty(e, "attributes", {
5939
+ value: {
5940
+ ...e.attributes,
5941
+ isLeaf: !t.children.length
5942
+ }
5943
+ }), null), Ep = (e, t, n) => {
5930
5944
  const r = er(e, t);
5931
5945
  return nl(r, n);
5932
5946
  }, Tp = ({ tree: e, path: t, uuid: n }) => {
@@ -7861,7 +7875,7 @@ const ze = {
7861
7875
  /* @__PURE__ */ i.jsx(Va, { open: d, onClose: a, title: l(), children: /* @__PURE__ */ i.jsx(Zp, { onClose: a }) }),
7862
7876
  /* @__PURE__ */ i.jsx(zp, { open: t, onClose: o, title: y, children: /* @__PURE__ */ i.jsx(zs, { data: b, renderCustomNodeElement: Wa }) })
7863
7877
  ] });
7864
- }, bm = "1.0.6", ym = ({ children: e, initialTree: t, initialTreeId: n, backendConfig: r }) => {
7878
+ }, bm = "1.0.7", ym = ({ children: e, initialTree: t, initialTreeId: n, backendConfig: r }) => {
7865
7879
  const [o, s] = be(Qe.currentHierarchyPointNode), [a, l] = be(Qe.modalOpen), [c, d] = be(Qe.treeModalOpen), [f, p] = be(Qe.treePath), [h, y] = Ja(kp, t || Qe.tree), [b, g] = be(
7866
7880
  n ? { ...Qe.currentTree, id: n } : Qe.currentTree
7867
7881
  ), v = kr(