@ticatec/uniface-element 0.1.49 → 0.1.51
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.
|
@@ -23,12 +23,14 @@
|
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
<div style="width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: row">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
{#if $$slots[sidebar]}
|
|
27
|
+
<div bind:this={sidebar}
|
|
28
|
+
style="height: 100%; flex: 0 0 auto; overflow: auto; border-right: 1px solid var(--uniface-plain-border-color, #f0f0f0); width: {sidebarWidth}; {maxWidth} {minWidth}">
|
|
29
|
+
<slot name="sidebar"></slot>
|
|
30
|
+
</div>
|
|
31
|
+
{#if sidebarResize}
|
|
32
|
+
<Split direction="vertical" bindingPanel={sidebar}/>
|
|
33
|
+
{/if}
|
|
32
34
|
{/if}
|
|
33
35
|
<div style="height: 100%; flex: 1 1 auto; overflow: hidden; display: flex; flex-direction: column">
|
|
34
36
|
{#if $$slots['header']}
|
package/dist/lib/TreeNodes.js
CHANGED
|
@@ -74,6 +74,7 @@ export class CommonTreeNodes {
|
|
|
74
74
|
const parentKey = item[this.parentKeyField];
|
|
75
75
|
if (this.checkIsRoot(item)) { //|| !this.nodeMap.has(parentKey)
|
|
76
76
|
this._nodes.push(node);
|
|
77
|
+
this._nodes.sort(this.compareFun);
|
|
77
78
|
}
|
|
78
79
|
else {
|
|
79
80
|
const parentNode = this.nodeMap.get(parentKey);
|
|
@@ -125,6 +126,9 @@ export default class TreeNodes extends CommonTreeNodes {
|
|
|
125
126
|
if (parent && parent.children && parent.children.length > 0) {
|
|
126
127
|
parent.children = parent.children.sort(this.compareFun);
|
|
127
128
|
}
|
|
129
|
+
else {
|
|
130
|
+
this._nodes.sort(this.compareFun);
|
|
131
|
+
}
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
134
|
remove(item) {
|
|
@@ -133,10 +137,18 @@ export default class TreeNodes extends CommonTreeNodes {
|
|
|
133
137
|
if (node) {
|
|
134
138
|
let parent = this.nodeMap.get(node.item[this.parentKeyField]);
|
|
135
139
|
this.nodeMap.delete(idKey);
|
|
136
|
-
if (parent
|
|
137
|
-
|
|
140
|
+
if (parent) {
|
|
141
|
+
if (parent.children) {
|
|
142
|
+
let pos = parent.children.findIndex(el => el.item[this.keyField] == idKey);
|
|
143
|
+
if (pos > -1) {
|
|
144
|
+
parent.children.splice(pos, 1);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
let pos = this._nodes.findIndex(el => el.item[this.keyField] == idKey);
|
|
138
150
|
if (pos > -1) {
|
|
139
|
-
|
|
151
|
+
this._nodes.splice(pos, 1);
|
|
140
152
|
}
|
|
141
153
|
}
|
|
142
154
|
}
|