This commit fixes an issue where the check state of categories was lost when toggling between card and tree views. This is solved by immediately emitting node state changes for all nodes. This ensures consistent view transitions without any loss of node state information. Furthermore, this commit includes added unit tests for the modified code sections.
30 lines
831 B
TypeScript
30 lines
831 B
TypeScript
import { TreeNodeCheckState } from '@/presentation/components/Scripts/View/Tree/TreeView/Node/State/CheckState';
|
|
import { TreeNodeStateDescriptor } from '@/presentation/components/Scripts/View/Tree/TreeView/Node/State/StateDescriptor';
|
|
|
|
export class TreeNodeStateDescriptorStub implements TreeNodeStateDescriptor {
|
|
public checkState: TreeNodeCheckState = TreeNodeCheckState.Checked;
|
|
|
|
public isExpanded = false;
|
|
|
|
public isVisible = false;
|
|
|
|
public isMatched = false;
|
|
|
|
public isFocused = false;
|
|
|
|
public withFocus(isFocused: boolean): this {
|
|
this.isFocused = isFocused;
|
|
return this;
|
|
}
|
|
|
|
public withCheckState(checkState: TreeNodeCheckState): this {
|
|
this.checkState = checkState;
|
|
return this;
|
|
}
|
|
|
|
public withVisibility(isVisible: boolean): this {
|
|
this.isVisible = isVisible;
|
|
return this;
|
|
}
|
|
}
|