monobill-mintui 0.6.679 → 0.6.680
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/components/tree/Tree.d.ts +1 -0
- package/dist/components/tree/Tree.d.ts.map +1 -1
- package/dist/components/tree/browser.js +35 -7
- package/dist/components/tree/index.cjs +1 -1
- package/dist/components/tree/index.js +35 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +35 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14745,17 +14745,45 @@ var $ = class extends HTMLElement {
|
|
|
14745
14745
|
}
|
|
14746
14746
|
_undo() {
|
|
14747
14747
|
let e = this._undoStack.pop();
|
|
14748
|
-
|
|
14749
|
-
|
|
14750
|
-
|
|
14751
|
-
}), Z(this, "mint-tree-undo", { items: this.items }));
|
|
14748
|
+
if (!e) return;
|
|
14749
|
+
let t = this._items;
|
|
14750
|
+
this._redoStack.push(q(this._items)), this._items = e, this._render(), this._emitHistoryChange(t), Z(this, "mint-tree-undo", { items: this.items });
|
|
14752
14751
|
}
|
|
14753
14752
|
_redo() {
|
|
14754
14753
|
let e = this._redoStack.pop();
|
|
14755
|
-
|
|
14756
|
-
|
|
14754
|
+
if (!e) return;
|
|
14755
|
+
let t = this._items;
|
|
14756
|
+
this._undoStack.push(q(this._items)), this._items = e, this._render(), this._emitHistoryChange(t), Z(this, "mint-tree-redo", { items: this.items });
|
|
14757
|
+
}
|
|
14758
|
+
_emitHistoryChange(e) {
|
|
14759
|
+
let t = this.items, n = (e) => {
|
|
14760
|
+
let t = /* @__PURE__ */ new Map(), n = (e, r) => e.forEach((e, i) => {
|
|
14761
|
+
let a = String(e.id);
|
|
14762
|
+
t.set(a, {
|
|
14763
|
+
parentId: r,
|
|
14764
|
+
index: i,
|
|
14765
|
+
item: e
|
|
14766
|
+
}), n(e.children || [], a);
|
|
14767
|
+
});
|
|
14768
|
+
return n(e, null), t;
|
|
14769
|
+
}, r = n(e), i = n(this._items), a = [...new Set([...r.keys(), ...i.keys()])].find((e) => {
|
|
14770
|
+
let t = r.get(e), n = i.get(e);
|
|
14771
|
+
return t && n && (t.parentId !== n.parentId || t.index !== n.index);
|
|
14772
|
+
});
|
|
14773
|
+
if (Z(this, "mint-tree-change", {
|
|
14774
|
+
items: t,
|
|
14757
14775
|
itemId: this._selectedId
|
|
14758
|
-
}),
|
|
14776
|
+
}), !a) return;
|
|
14777
|
+
let o = r.get(a), s = i.get(a), c = {
|
|
14778
|
+
itemId: a,
|
|
14779
|
+
item: { ...s.item },
|
|
14780
|
+
items: t,
|
|
14781
|
+
oldParentId: o.parentId,
|
|
14782
|
+
newParentId: s.parentId,
|
|
14783
|
+
oldIndex: o.index,
|
|
14784
|
+
newIndex: s.index
|
|
14785
|
+
};
|
|
14786
|
+
Z(this, o.parentId === s.parentId ? "mint-tree-reorder" : "mint-tree-reparent", c);
|
|
14759
14787
|
}
|
|
14760
14788
|
_keyboardIndent(e) {
|
|
14761
14789
|
let t = Y(this._items, e);
|