Implement HideChildrenInTreeview
This commit is contained in:
parent
e2da3142b5
commit
3e6204e917
6 changed files with 15 additions and 2 deletions
|
@ -128,6 +128,7 @@ export const DEFAULT_MAINCONTAINER_PROPS: IContainerProperties = {
|
|||
isAnchor: false,
|
||||
isFlex: false,
|
||||
xPositionReference: XPositionReference.Left,
|
||||
hideChildrenInTreeview: false,
|
||||
showChildrenDimensions: true, // TODO: put the dimension at the top (see pdf)
|
||||
showSelfDimensions: true, // TODO: put the dimension at the bottom (see pdf)
|
||||
isDimensionBorrower: true, // second dimensions from the bottom
|
||||
|
@ -173,6 +174,7 @@ export function GetDefaultContainerProps(type: string,
|
|||
xPositionReference: containerConfig.XPositionReference ?? XPositionReference.Left,
|
||||
minWidth: containerConfig.MinWidth ?? 1,
|
||||
maxWidth: containerConfig.MaxWidth ?? Number.MAX_SAFE_INTEGER,
|
||||
hideChildrenInTreeview: containerConfig.HideChildrenInTreeview ?? false,
|
||||
showChildrenDimensions: containerConfig.ShowChildrenDimensions ?? false,
|
||||
showSelfDimensions: containerConfig.ShowSelfDimensions ?? false,
|
||||
markPositionToDimensionBorrower: containerConfig.MarkPositionToDimensionBorrower ?? false,
|
||||
|
|
|
@ -3,7 +3,7 @@ import { IContainerModel } from '../Interfaces/IContainerModel';
|
|||
/**
|
||||
* Returns a Generator iterating of over the children depth-first
|
||||
*/
|
||||
export function * MakeIterator(root: IContainerModel): Generator<IContainerModel, void, unknown> {
|
||||
export function * MakeIterator(root: IContainerModel, enableHideChildrenInTreeview = false): Generator<IContainerModel, void, unknown> {
|
||||
const queue: IContainerModel[] = [root];
|
||||
const visited = new Set<IContainerModel>(queue);
|
||||
while (queue.length > 0) {
|
||||
|
@ -11,6 +11,10 @@ export function * MakeIterator(root: IContainerModel): Generator<IContainerModel
|
|||
|
||||
yield container;
|
||||
|
||||
if (enableHideChildrenInTreeview && container.properties.hideChildrenInTreeview) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (let i = container.children.length - 1; i >= 0; i--) {
|
||||
const child = container.children[i];
|
||||
if (visited.has(child)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue