dfish-widget 1.0.74 → 1.0.75
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/lib/index.esm.js +38 -24
- package/lib/index.esm.js.map +1 -1
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -5682,18 +5682,25 @@ const props = __props;
|
|
|
5682
5682
|
return item
|
|
5683
5683
|
};
|
|
5684
5684
|
|
|
5685
|
-
const merge = (newList
|
|
5686
|
-
if (!Array.isArray(newList)) return
|
|
5687
|
-
const
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5685
|
+
const merge = (newList) => {
|
|
5686
|
+
if (!Array.isArray(newList)) return []
|
|
5687
|
+
const oldList = JSON.parse(JSON.stringify(props.children));
|
|
5688
|
+
mergeChildren(newList, oldList);
|
|
5689
|
+
props.children.length = 0;
|
|
5690
|
+
props.children.push.apply(props.children, newList);
|
|
5691
|
+
flatList.value = toFlat(newList);
|
|
5692
|
+
};
|
|
5693
|
+
|
|
5694
|
+
const mergeChildren = (newList, oldList) => {
|
|
5695
|
+
for (let n of newList) {
|
|
5696
|
+
let o = oldList.find(v => v[propValue] === n[propValue]);
|
|
5697
|
+
if (o) {
|
|
5698
|
+
if (o[propChildren]) {
|
|
5699
|
+
if (n[propChildren]) mergeChildren(n[propChildren], o[propChildren]);
|
|
5700
|
+
else n[propChildren] = o[propChildren];
|
|
5701
|
+
}
|
|
5702
|
+
if (o.expanded != null) {
|
|
5703
|
+
n.expanded = o.expanded;
|
|
5697
5704
|
}
|
|
5698
5705
|
}
|
|
5699
5706
|
}
|
|
@@ -6700,18 +6707,25 @@ const props = __props;
|
|
|
6700
6707
|
return item
|
|
6701
6708
|
};
|
|
6702
6709
|
|
|
6703
|
-
const merge = (newList
|
|
6704
|
-
if (!Array.isArray(newList)) return
|
|
6705
|
-
const
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6710
|
+
const merge = (newList) => {
|
|
6711
|
+
if (!Array.isArray(newList)) return []
|
|
6712
|
+
const oldList = JSON.parse(JSON.stringify(props.children));
|
|
6713
|
+
mergeChildren(newList, oldList);
|
|
6714
|
+
props.children.length = 0;
|
|
6715
|
+
props.children.push.apply(props.children, newList);
|
|
6716
|
+
flatList.value = toFlat(newList);
|
|
6717
|
+
};
|
|
6718
|
+
|
|
6719
|
+
const mergeChildren = (newList, oldList) => {
|
|
6720
|
+
for (let n of newList) {
|
|
6721
|
+
let o = oldList.find(v => v[propValue] === n[propValue]);
|
|
6722
|
+
if (o) {
|
|
6723
|
+
if (o[propChildren]) {
|
|
6724
|
+
if (n[propChildren]) mergeChildren(n[propChildren], o[propChildren]);
|
|
6725
|
+
else n[propChildren] = o[propChildren];
|
|
6726
|
+
}
|
|
6727
|
+
if (o.expanded != null) {
|
|
6728
|
+
n.expanded = o.expanded;
|
|
6715
6729
|
}
|
|
6716
6730
|
}
|
|
6717
6731
|
}
|