x4js 1.5.15 → 1.5.16
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/treeview.js +17 -13
- package/lib/cjs/version.js +1 -1
- package/lib/esm/treeview.js +17 -12
- package/lib/esm/version.js +1 -1
- package/lib/src/treeview.ts +18 -15
- package/lib/src/version.ts +1 -1
- package/lib/types/treeview.d.ts +5 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/treeview.js
CHANGED
|
@@ -294,20 +294,24 @@ class TreeView extends layout_1.VLayout {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
set selection(id) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
this.select(id, false);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* idem selection = xx but with a notification
|
|
301
|
+
* @param id
|
|
302
|
+
*/
|
|
303
|
+
select(id, notify = false) {
|
|
304
|
+
if (id === null || id === undefined) {
|
|
305
|
+
this._selectItem(null, null);
|
|
300
306
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
sel.addClass('selected');
|
|
310
|
-
sel.scrollIntoView();
|
|
307
|
+
else {
|
|
308
|
+
if (isFunction(this.m_props.items)) {
|
|
309
|
+
this.m_defer_sel = id;
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
let item = this.m_props.items.find((item) => item.id == id);
|
|
313
|
+
let citem = this._findItemWithId(item.id);
|
|
314
|
+
this._selectItem(item, citem, notify);
|
|
311
315
|
}
|
|
312
316
|
}
|
|
313
317
|
}
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/treeview.js
CHANGED
|
@@ -290,19 +290,24 @@ export class TreeView extends VLayout {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
set selection(id) {
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
this.select(id, false);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* idem selection = xx but with a notification
|
|
297
|
+
* @param id
|
|
298
|
+
*/
|
|
299
|
+
select(id, notify = false) {
|
|
300
|
+
if (id === null || id === undefined) {
|
|
301
|
+
this._selectItem(null, null);
|
|
295
302
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
sel.addClass('selected');
|
|
305
|
-
sel.scrollIntoView();
|
|
303
|
+
else {
|
|
304
|
+
if (isFunction(this.m_props.items)) {
|
|
305
|
+
this.m_defer_sel = id;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
let item = this.m_props.items.find((item) => item.id == id);
|
|
309
|
+
let citem = this._findItemWithId(item.id);
|
|
310
|
+
this._selectItem(item, citem, notify);
|
|
306
311
|
}
|
|
307
312
|
}
|
|
308
313
|
}
|
package/lib/esm/version.js
CHANGED
package/lib/src/treeview.ts
CHANGED
|
@@ -413,23 +413,26 @@ export class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
set selection(id: any) {
|
|
416
|
+
this.select( id, false );
|
|
417
|
+
}
|
|
416
418
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
this.m_selection = null;
|
|
422
|
-
|
|
423
|
-
if (id !== undefined) {
|
|
424
|
-
const { node: sel } = this._getNode( id );
|
|
425
|
-
if( sel ) {
|
|
426
|
-
this.m_selection = {
|
|
427
|
-
id: id,
|
|
428
|
-
el: sel
|
|
429
|
-
};
|
|
419
|
+
/**
|
|
420
|
+
* idem selection = xx but with a notification
|
|
421
|
+
* @param id
|
|
422
|
+
*/
|
|
430
423
|
|
|
431
|
-
|
|
432
|
-
|
|
424
|
+
public select( id: any, notify = false ) {
|
|
425
|
+
if (id === null || id === undefined) {
|
|
426
|
+
this._selectItem(null, null);
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
if (isFunction(this.m_props.items)) {
|
|
430
|
+
this.m_defer_sel = id;
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
let item = this.m_props.items.find((item) => item.id == id);
|
|
434
|
+
let citem = this._findItemWithId(item.id);
|
|
435
|
+
this._selectItem(item, citem, notify );
|
|
433
436
|
}
|
|
434
437
|
}
|
|
435
438
|
}
|
package/lib/src/version.ts
CHANGED
package/lib/types/treeview.d.ts
CHANGED
|
@@ -105,6 +105,11 @@ export declare class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
105
105
|
forEach(cb: (node: TreeNode) => boolean | void): any;
|
|
106
106
|
ensureVisible(id: any): void;
|
|
107
107
|
set selection(id: any);
|
|
108
|
+
/**
|
|
109
|
+
* idem selection = xx but with a notification
|
|
110
|
+
* @param id
|
|
111
|
+
*/
|
|
112
|
+
select(id: any, notify?: boolean): void;
|
|
108
113
|
private _getNode;
|
|
109
114
|
get selection(): any;
|
|
110
115
|
getNodeWithId(id: any): TreeNode;
|
package/lib/types/version.d.ts
CHANGED