x4js 1.5.9 → 1.5.12
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/cjs/textarea.js +6 -0
- package/lib/cjs/treeview.js +13 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/textarea.js +6 -0
- package/lib/esm/treeview.js +13 -1
- package/lib/esm/version.js +1 -1
- package/lib/src/textarea.ts +8 -0
- package/lib/src/treeview.ts +20 -4
- package/lib/src/version.ts +1 -1
- package/lib/types/textarea.d.ts +2 -0
- package/lib/types/treeview.d.ts +6 -3
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/textarea.js
CHANGED
package/lib/cjs/treeview.js
CHANGED
|
@@ -157,6 +157,14 @@ class TreeView extends layout_1.VLayout {
|
|
|
157
157
|
this.m_props.root = root;
|
|
158
158
|
this.update();
|
|
159
159
|
}
|
|
160
|
+
openAll(open = true) {
|
|
161
|
+
this.forEach((node) => {
|
|
162
|
+
if (node.children) {
|
|
163
|
+
node.open = open;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
this.__update();
|
|
167
|
+
}
|
|
160
168
|
/**
|
|
161
169
|
* same as root = xxx but keep elements open
|
|
162
170
|
*/
|
|
@@ -169,7 +177,9 @@ class TreeView extends layout_1.VLayout {
|
|
|
169
177
|
return false;
|
|
170
178
|
});
|
|
171
179
|
let oldSel = this.selection;
|
|
172
|
-
|
|
180
|
+
if (root) {
|
|
181
|
+
this.m_props.root = root;
|
|
182
|
+
}
|
|
173
183
|
this.forEach((node) => {
|
|
174
184
|
if (openList.indexOf(node.id) >= 0) {
|
|
175
185
|
node.open = true;
|
|
@@ -478,6 +488,8 @@ class TreeView extends layout_1.VLayout {
|
|
|
478
488
|
id: node.id,
|
|
479
489
|
text: node.name,
|
|
480
490
|
parent: node.parent,
|
|
491
|
+
cls: node.cls,
|
|
492
|
+
icon: node.icon
|
|
481
493
|
};
|
|
482
494
|
if (!node.leaf) {
|
|
483
495
|
elem.children = [];
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/textarea.js
CHANGED
package/lib/esm/treeview.js
CHANGED
|
@@ -155,6 +155,14 @@ export class TreeView extends VLayout {
|
|
|
155
155
|
this.m_props.root = root;
|
|
156
156
|
this.update();
|
|
157
157
|
}
|
|
158
|
+
openAll(open = true) {
|
|
159
|
+
this.forEach((node) => {
|
|
160
|
+
if (node.children) {
|
|
161
|
+
node.open = open;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
this.__update();
|
|
165
|
+
}
|
|
158
166
|
/**
|
|
159
167
|
* same as root = xxx but keep elements open
|
|
160
168
|
*/
|
|
@@ -167,7 +175,9 @@ export class TreeView extends VLayout {
|
|
|
167
175
|
return false;
|
|
168
176
|
});
|
|
169
177
|
let oldSel = this.selection;
|
|
170
|
-
|
|
178
|
+
if (root) {
|
|
179
|
+
this.m_props.root = root;
|
|
180
|
+
}
|
|
171
181
|
this.forEach((node) => {
|
|
172
182
|
if (openList.indexOf(node.id) >= 0) {
|
|
173
183
|
node.open = true;
|
|
@@ -471,6 +481,8 @@ export class TreeView extends VLayout {
|
|
|
471
481
|
id: node.id,
|
|
472
482
|
text: node.name,
|
|
473
483
|
parent: node.parent,
|
|
484
|
+
cls: node.cls,
|
|
485
|
+
icon: node.icon
|
|
474
486
|
};
|
|
475
487
|
if (!node.leaf) {
|
|
476
488
|
elem.children = [];
|
package/lib/esm/version.js
CHANGED
package/lib/src/textarea.ts
CHANGED
|
@@ -138,6 +138,14 @@ export class TextArea extends Component<TextAreaProps, TextAreaEventMap> {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
+
|
|
142
|
+
get text( ): string {
|
|
143
|
+
return this.value;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
set text( text: string ) {
|
|
147
|
+
this.value = text;
|
|
148
|
+
}
|
|
141
149
|
|
|
142
150
|
private _calcHeight(text: string): number {
|
|
143
151
|
return 1 + (text.match(/\n/g) || []).length;
|
package/lib/src/treeview.ts
CHANGED
|
@@ -44,9 +44,11 @@ function EvExpand(node: TreeNode) {
|
|
|
44
44
|
|
|
45
45
|
export interface HierarchicalNode {
|
|
46
46
|
id: number;
|
|
47
|
-
parent: number;
|
|
48
47
|
name: string;
|
|
49
|
-
|
|
48
|
+
parent?: number;
|
|
49
|
+
cls?: string;
|
|
50
|
+
leaf?: boolean
|
|
51
|
+
icon?: string;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
export interface TreeNode {
|
|
@@ -239,6 +241,16 @@ export class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
239
241
|
this.update();
|
|
240
242
|
}
|
|
241
243
|
|
|
244
|
+
openAll( open = true) {
|
|
245
|
+
this.forEach((node: TreeNode) => {
|
|
246
|
+
if( node.children ) {
|
|
247
|
+
node.open = open;
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
this.__update( )
|
|
252
|
+
}
|
|
253
|
+
|
|
242
254
|
/**
|
|
243
255
|
* same as root = xxx but keep elements open
|
|
244
256
|
*/
|
|
@@ -255,7 +267,9 @@ export class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
255
267
|
});
|
|
256
268
|
|
|
257
269
|
let oldSel = this.selection;
|
|
258
|
-
|
|
270
|
+
if( root ) {
|
|
271
|
+
this.m_props.root = root;
|
|
272
|
+
}
|
|
259
273
|
|
|
260
274
|
this.forEach((node: TreeNode): boolean => {
|
|
261
275
|
|
|
@@ -366,7 +380,7 @@ export class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
366
380
|
*
|
|
367
381
|
*/
|
|
368
382
|
|
|
369
|
-
forEach(cb: (node) => boolean) {
|
|
383
|
+
forEach(cb: (node: TreeNode) => boolean | void ) {
|
|
370
384
|
let found = null;
|
|
371
385
|
|
|
372
386
|
function scan(node) {
|
|
@@ -645,6 +659,8 @@ export class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
645
659
|
id: node.id,
|
|
646
660
|
text: node.name,
|
|
647
661
|
parent: node.parent,
|
|
662
|
+
cls: node.cls
|
|
663
|
+
icon: node.icon
|
|
648
664
|
};
|
|
649
665
|
|
|
650
666
|
if (!node.leaf) {
|
package/lib/src/version.ts
CHANGED
package/lib/types/textarea.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export declare class TextArea extends Component<TextAreaProps, TextAreaEventMap>
|
|
|
55
55
|
componentCreated(): void;
|
|
56
56
|
get value(): string;
|
|
57
57
|
set value(t: string);
|
|
58
|
+
get text(): string;
|
|
59
|
+
set text(text: string);
|
|
58
60
|
private _calcHeight;
|
|
59
61
|
private _updateHeight;
|
|
60
62
|
/**
|
package/lib/types/treeview.d.ts
CHANGED
|
@@ -36,9 +36,11 @@ export interface EvExpand extends BasicEvent {
|
|
|
36
36
|
}
|
|
37
37
|
export interface HierarchicalNode {
|
|
38
38
|
id: number;
|
|
39
|
-
parent: number;
|
|
40
39
|
name: string;
|
|
41
|
-
|
|
40
|
+
parent?: number;
|
|
41
|
+
cls?: string;
|
|
42
|
+
leaf?: boolean;
|
|
43
|
+
icon?: string;
|
|
42
44
|
}
|
|
43
45
|
export interface TreeNode {
|
|
44
46
|
id: any;
|
|
@@ -88,6 +90,7 @@ export declare class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
88
90
|
private __update;
|
|
89
91
|
updateElement(id: any): void;
|
|
90
92
|
set root(root: TreeNode);
|
|
93
|
+
openAll(open?: boolean): void;
|
|
91
94
|
/**
|
|
92
95
|
* same as root = xxx but keep elements open
|
|
93
96
|
*/
|
|
@@ -98,7 +101,7 @@ export declare class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
98
101
|
/**
|
|
99
102
|
*
|
|
100
103
|
*/
|
|
101
|
-
forEach(cb: (node:
|
|
104
|
+
forEach(cb: (node: TreeNode) => boolean | void): any;
|
|
102
105
|
ensureVisible(id: any): void;
|
|
103
106
|
set selection(id: any);
|
|
104
107
|
private _getNode;
|
package/lib/types/version.d.ts
CHANGED