Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
inconsistent: {
unselected: {
parent: ClrSelectedState.INDETERMINATE,
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
parent: ClrSelectedState.UNSELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,
},
indeterminate: {
parent: ClrSelectedState.SELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.UNSELECTED,
},
},
childrenOnly: {
unselected: {
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,
},
indeterminate: {
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.UNSELECTED,
},
},
inconsistent: {
unselected: {
parent: ClrSelectedState.INDETERMINATE,
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
parent: ClrSelectedState.UNSELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,
},
indeterminate: {
parent: ClrSelectedState.SELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.UNSELECTED,
},
},
childrenOnly: {
unselected: {
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,
},
indeterminate: {
child1: ClrSelectedState.SELECTED,
},
inconsistent: {
unselected: {
parent: ClrSelectedState.INDETERMINATE,
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
parent: ClrSelectedState.UNSELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,
},
indeterminate: {
parent: ClrSelectedState.SELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.UNSELECTED,
},
},
};
larger = [
{
name: 'Item A',
selected: ClrSelectedState.UNSELECTED,
children: this.addChildren('A'),
},
{
name: 'Item B',
selected: ClrSelectedState.UNSELECTED,
children: this.addChildren('B'),
},
},
},
inconsistent: {
unselected: {
parent: ClrSelectedState.INDETERMINATE,
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
parent: ClrSelectedState.UNSELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,
},
indeterminate: {
parent: ClrSelectedState.SELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.UNSELECTED,
},
},
};
larger = [
{
name: 'Item A',
selected: ClrSelectedState.UNSELECTED,
children: this.addChildren('A'),
},
{
name: 'Item B',
selected: ClrSelectedState.UNSELECTED,
children: this.addChildren('B'),
@Component({
selector: 'clr-pre-selection-demo',
styleUrls: ['../tree-view.demo.scss'],
templateUrl: './pre-selection.html',
})
export class PreSelectionDemo {
eager = {
consistent: {
unselected: {
parent: ClrSelectedState.UNSELECTED,
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
parent: ClrSelectedState.SELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,
},
indeterminate: {
parent: ClrSelectedState.INDETERMINATE,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.UNSELECTED,
},
},
inconsistent: {
unselected: {
parent: ClrSelectedState.INDETERMINATE,
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
.filter(key => selectedMap[key] === ClrSelectedState.SELECTED)
.join(', ');
parent: ClrSelectedState.INDETERMINATE,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.UNSELECTED,
},
},
inconsistent: {
unselected: {
parent: ClrSelectedState.INDETERMINATE,
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
parent: ClrSelectedState.UNSELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,
},
indeterminate: {
parent: ClrSelectedState.SELECTED,
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.UNSELECTED,
},
},
childrenOnly: {
unselected: {
child1: ClrSelectedState.UNSELECTED,
child2: ClrSelectedState.UNSELECTED,
},
selected: {
child1: ClrSelectedState.SELECTED,
child2: ClrSelectedState.SELECTED,