import { KbqTreeModule } from '@koobiq/components/tree';Selector: [kbqTreeNodeOutlet]
| Name | Description |
|---|---|
| changeDetectorRef: ChangeDetectorRef | |
| viewContainer: ViewContainerRef |
Selector: kbq-tree
Exported as: kbqTree| Name | Description |
|---|---|
| dataDiffer: IterableDiffer |
Differ used to find the changes in the data provided by the data source. |
| dataSource: DataSource |
Provides a stream containing the latest data array to render. Influenced by the tree's stream of view window (what dataNodes are currently on screen). Data source can be an observable of data array, or a data array to render. |
| destroyRef: DestroyRef | |
| nodeDefs: QueryList |
The tree node template for the tree |
| nodeOutlet: KbqTreeNodeOutlet | |
| trackBy: TrackByFunction |
Tracking function that will be used to check the differences in data changes. Used similarly to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data relative to the function to know if a node should be added/removed/moved. Accepts a function that takes two parameters, `index` and `item`. |
| treeControl: TreeControl |
|
| viewChange: BehaviorSubject<{ start: number; end: number; }> | Stream containing the latest information on what rows are being displayed on screen. Can be used by the data source to as a heuristic of what data should be provided. |
Data node definition for the KbqTree. Captures the node's template and a when predicate that describes when this node should be used.
Selector: [kbqTreeNodeDef]
| Name | Description |
|---|---|
@Input('kbqTreeNode')
data: T
|
|
@Input('kbqTreeNodeDefWhen')
when: (index: number, nodeData: T) => boolean
|
Function that should return true if this node template should be used for the provided node data and index. If left undefined, this node will be considered the default node template to use when no other when functions return true for the data. For every node, there must be at least one when function that passes or an undefined to default. |
| template: TemplateRef |
Selector: [kbqTreeNodePadding]
Exported as: kbqTreeNodePadding| Name | Description |
|---|---|
@Input('kbqTreeNodePaddingIndent')
indent: string | number
|
|
| iconWidth: number | |
| indentUnits: string | CSS units used for the indentation value. |
| leftPadding: number | |
| leftPaddingForFirstLevel: number | |
| level: number | |
| withIcon: boolean |
| Name | Description |
|---|---|
@Input() dataSource: DataSource |
Provides a stream containing the latest data array to render. Influenced by the tree's stream of view window (what dataNodes are currently on screen). Data source can be an observable of data array, or a data array to render. |
@Input() trackBy: TrackByFunction |
Tracking function that will be used to check the differences in data changes. Used similarly to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data relative to the function to know if a node should be added/removed/moved. Accepts a function that takes two parameters, `index` and `item`. |
@Input() treeControl: TreeControl |
|
| dataDiffer: IterableDiffer |
Differ used to find the changes in the data provided by the data source. |
| destroyRef: DestroyRef | |
| nodeDefs: QueryList |
The tree node template for the tree |
| nodeOutlet: KbqTreeNodeOutlet | |
| viewChange: BehaviorSubject<{ start: number; end: number; }> | Stream containing the latest information on what rows are being displayed on screen. Can be used by the data source to as a heuristic of what data should be provided. |
Selector: kbq-tree-node-toggle
Exported as: kbqTreeNodeToggle| Name | Description |
|---|---|
| disabled: boolean | |
| iconState: boolean | |
| node: T | |
| recursive: boolean |
Selector: kbq-tree-option
Exported as: kbqTreeOption| Name | Description |
|---|---|
@Input() checkboxThirdState: boolean
|
|
@Input() disabled: any
|
|
@Input() selectable: boolean
|
|
@Input() showCheckbox: any
|
|
@Output('onSelectionChange')
onSelectionChange: EventEmitter |
|
| actionButton: KbqOptionActionComponent | |
| checkboxState: KbqPseudoCheckboxState | |
| data: T | |
| destroyed: Subject |
|
| dropdownTrigger: KbqDropdownTrigger | |
| externalPseudoCheckbox: boolean | |
| hasFocus: boolean | |
| id: string | |
| isExpandable: boolean | |
| isExpanded: boolean | |
| isToggleInDefaultPlace: boolean | |
| level: number | |
| mostRecentTreeNode: KbqTreeNode |
The most recently created `KbqTreeNode`. We save it in static variable so we can retrieve it in `KbqTree` and set the data to it. |
| onBlur: Subject |
|
| onFocus: Subject |
|
| parentTextElement: ElementRef |
|
| preventBlur: boolean | |
| pseudoCheckbox: KbqPseudoCheckbox | |
| selected: boolean | |
| toggleElement: KbqTreeNodeToggleBaseDirective |
|
| toggleElementComponent: KbqTreeNodeToggleBaseDirective |
|
| toggleElementDirective: KbqTreeNodeToggleBaseDirective |
|
| tooltipTrigger: KbqTooltipTrigger | |
| tree: any | |
| updateCheckboxState: () => void | |
| userInteraction: EventEmitter |
|
| value: any | |
| viewValue: string |
Selector: [kbq-tree-node-toggle], [kbqTreeNodeToggle]
Exported as: kbqTreeNodeToggle| Name | Description |
|---|---|
| disabled: boolean | |
| iconState: boolean | |
| node: T | |
| recursive: boolean |
Selector: kbq-tree-selection
Exported as: kbqTreeSelection| Name | Description |
|---|---|
@Input() autoSelect: boolean
|
|
@Input() disabled: boolean
|
|
@Input() noUnselectLast: boolean
|
|
@Input() treeControl: FlatTreeControl |
|
@Output('navigationChange')
navigationChange: EventEmitter |
|
@Output('onCopy')
onCopy: EventEmitter |
|
@Output('onSelectAll')
onSelectAll: EventEmitter |
|
@Output('selectionChange')
selectionChange: EventEmitter |
|
| dataDiffer: IterableDiffer |
Differ used to find the changes in the data provided by the data source. |
| dataSource: DataSource |
Provides a stream containing the latest data array to render. Influenced by the tree's stream of view window (what dataNodes are currently on screen). Data source can be an observable of data array, or a data array to render. |
| destroyRef: DestroyRef | |
| focusMonitor: FocusMonitor | |
| inSelect: boolean | Indicates whether this component is placed inside a KbqFormField component. |
| isEmpty: boolean | |
| keyManager: FocusKeyManager |
|
| multiple: boolean | |
| multipleMode: MultipleMode | |
| nodeDefs: QueryList |
The tree node template for the tree |
| nodeOutlet: KbqTreeNodeOutlet | |
| onChange: (value: any) => void | `View -> model callback called when value changes` |
| onTouched: () => void | `View -> model callback called when select has been touched` |
| optionBlurChanges: Observable |
|
| optionFocusChanges: Observable |
|
| optionShouldHoldFocusOnBlur: boolean | |
| renderedOptions: QueryList |
|
| resetFocusedItemOnBlur: boolean | |
| selectionModel: SelectionModel |
|
| showCheckbox: boolean | |
| trackBy: TrackByFunction |
Tracking function that will be used to check the differences in data changes. Used similarly to `ngFor` `trackBy` function. Optimize node operations by identifying a node based on its data relative to the function to know if a node should be added/removed/moved. Accepts a function that takes two parameters, `index` and `item`. |
| unorderedOptions: QueryList |
|
| userTabIndex: number | |
| viewChange: BehaviorSubject<{ start: number; end: number; }> | Stream containing the latest information on what rows are being displayed on screen. Can be used by the data source to as a heuristic of what data should be provided. |
Selector: kbq-tree-node
Exported as: kbqTreeNode| Name | Description |
|---|---|
| data: T | |
| destroyed: Subject |
|
| isExpanded: boolean | |
| level: number | |
| mostRecentTreeNode: KbqTreeNode |
The most recently created `KbqTreeNode`. We save it in static variable so we can retrieve it in `KbqTree` and set the data to it. |
| tree: KbqTreeBase |
Context provided to the tree node component.
| Name | Description |
|---|---|
| $implicit: T | Data for the node. |
| count: number | Length of the number of total dataNodes. |
| index: number | Index location of the node. |
| level: number | Depth of the node. |
Nested tree control. Able to expand/collapse a subtree recursively for NestedNode type.
| Name | Description |
|---|---|
| dataNodes: T[] | |
| expansionModel: SelectionModel |
A selection model with multi-selection to track expansion status. |
| filterModel: SelectionModel |
|
| filterValue: BehaviorSubject |
|
| getChildren: (dataNode: T) => Observable |
|
| getLevel: (dataNode: T) => number | Get depth of a given data node, return the level number. This is for flat tree node. |
| isExpandable: (dataNode: T) => boolean | Whether the data node is expandable. Returns true if expandable. This is for flat tree node. |
Base tree control. It has basic toggle/expand/collapse operations on a single data node.
| Name | Description |
|---|---|
| dataNodes: T[] | |
| expansionModel: SelectionModel |
A selection model with multi-selection to track expansion status. |
| filterModel: SelectionModel |
|
| filterValue: BehaviorSubject |
|
| getChildren: (dataNode: T) => Observable |
Gets a stream that emits whenever the given data node's children change. |
| getLevel: (dataNode: T) => number | Get depth of a given data node, return the level number. This is for flat tree node. |
| isExpandable: (dataNode: T) => boolean | Whether the data node is expandable. Returns true if expandable. This is for flat tree node. |
Data source for nested tree. The data source for nested tree doesn't have to consider node flattener, or the way to expand or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node.
| Name | Description |
|---|---|
| data: T[] |
| Name | Description |
|---|---|
| result: T[] |
Tree flattener to convert a normal type of node to node with children & level information. Transform nested nodes of type `T` to flattened nodes of type `F`. For example, the input data of type `T` is nested, and contains its children data: SomeNode: { key: 'Fruits', children: [ NodeOne: { key: 'Apple', }, NodeTwo: { key: 'Pear', } ] } After flattener flatten the tree, the structure will become SomeNode: { key: 'Fruits', expandable: true, level: 1 }, NodeOne: { key: 'Apple', expandable: false, level: 2 }, NodeTwo: { key: 'Pear', expandable: false, level: 2 } and the output flattened type is `F` with additional information.
| Name | Description |
|---|---|
| getChildren: (node: T) => T[] | Observable |
|
| getLevel: (node: F) => number | |
| isExpandable: (node: F) => boolean | |
| transformFunction: (node: T, level: number, parent: F) => F |
Flat tree control. Able to expand/collapse a subtree recursively for flattened tree.
| Name | Description |
|---|---|
| compareValues: (firstValue: any, secondValue: any) => boolean | compareValues will be used to comparing values. |
| compareViewValues: (firstViewValue: any, secondViewValue: any) => boolean | compareValues will be used to comparing values. |
| dataNodes: T[] | |
| expandedItemsBeforeFiltration: T[] | |
| expansionModel: SelectionModel |
A selection model with multi-selection to track expansion status. |
| filterModel: SelectionModel |
|
| filterValue: BehaviorSubject |
|
| getChildren: (dataNode: T) => Observable |
Gets a stream that emits whenever the given data node's children change. |
| getLevel: (dataNode: T) => number | |
| getValue: (dataNode: T) => any | getValue will be used to determine if the tree contains value or not. Used in method hasValue |
| getViewValue: (dataNode: T) => string | getViewValue will be used for filter nodes. Returned value will be first argument in filterNodesFunction |
| isDisabled: (dataNode: T) => boolean | isDisabled will be used to determine if the node is disabled. |
| isExpandable: (dataNode: T) => boolean |
| Name | Description |
|---|---|
| result: T[] |
Represents a change event for a tree option.
| Name | Description |
|---|---|
| isUserInput: boolean | |
| source: KbqTreeOption |
| Name | Description |
|---|---|
| result: T[] | |
| setValues: (values: string[]) => void |
| Name | Description |
|---|---|
| options: T[] | |
| source: KbqTreeSelection |
Event class that occurs when copying an item from the KbqTreeSelection. Used to pass data about the copied item and copy context.
| Name | Description |
|---|---|
| event: KeyboardEvent | |
| option: T | |
| source: KbqTreeSelection |
| Name | Description |
|---|---|
| option: T | |
| source: KbqTreeSelection |
| Name | Description |
|---|---|
| option: T | |
| options: T[] | |
| source: KbqTreeSelection |
Data source for flat tree. The data source need to handle expansion/collapsion of the tree node and change the data feed to `KbqTree`. The nested tree nodes of type `T` are flattened through `MсTreeFlattener`, and converted to type `F` for `KbqTree` to consume.
| Name | Description |
|---|---|
| data: T[] | |
| expandedData: BehaviorSubject |
|
| filteredData: BehaviorSubject |
|
| flattenedData: BehaviorSubject |
| Name | Description |
|---|---|
| result: T[] |
Tree control interface. User can implement TreeControl to expand/collapse dataNodes in the tree.
The Tree will use this TreeControl to expand/collapse a node.
User can also use it outside the `
| Name | Description |
|---|---|
| dataNodes: T[] | The saved tree nodes data for `expandAll` action. |
| expansionModel: SelectionModel |
The expansion model |
| filterModel: SelectionModel |
|
| filterValue: BehaviorSubject |
| Name | Description |
|---|---|
| option: KbqTreeOption |
const defaultCompareValues(firstValue: string, secondValue: string): boolean;
| Parameters | Description |
|---|---|
| firstValue: string | |
| secondValue: string |
const defaultCompareViewValues(firstViewValue: string, secondViewValue: string): boolean;
| Parameters | Description |
|---|---|
| firstViewValue: string | |
| secondViewValue: string |
const kbqTreeSelectAllValue: string;
Injection token used to provide the parent component to options.
const KBQ_TREE_OPTION_PARENT_COMPONENT: InjectionToken<any>;
const KBQ_SELECTION_TREE_VALUE_ACCESSOR: any;