Skip to content

IgxTree Implementation #8945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0c07a75
feat(tree): add IgxTree, initial commit, #7475
ViktorSlavov Jan 21, 2021
9e67bb8
chore(*): BiState implementation
Feb 19, 2021
a3e40e3
chore(tree): modify template to incorporate future Drag-drop requirem…
ViktorSlavov Mar 11, 2021
4ccc506
chore(tree): tree styling, initial commit
Mar 17, 2021
1f7e793
chore(tree): cascade selection implementation
MonikaKirkova Mar 4, 2021
e65fe55
ci(azure): remove tree tests from `non-grid` test batch
ViktorSlavov Mar 17, 2021
2e4477f
chore(tree): cleanup, add API docs, refactor common test functions
ViktorSlavov Mar 18, 2021
b1c0e66
chore(tree): revert treenode.children to querylist, add comment
ViktorSlavov Mar 18, 2021
1eedbe4
chore(tree): fix failing tests by properly passing jasmine.createSpyO…
ViktorSlavov Mar 18, 2021
c55ccb4
chore(tree): add styling for disabled states, add indentation per node
ViktorSlavov Mar 18, 2021
a866f4b
chore(tree): fix lint, add expandedChange event
ViktorSlavov Mar 25, 2021
c35e51d
chore(tree): remove duplicate sass variable
ViktorSlavov Mar 25, 2021
c090034
chore(tree): initial navigation implementation
Mar 15, 2021
8f8ad0f
chore(tree): adding node styles, use focused class selector
Mar 26, 2021
513a600
chore(tree): use actual focus for navigation, add disabled handling
ViktorSlavov Mar 29, 2021
324e16b
chore(tree): cleanup old styles, rename styles, update all themes
Mar 29, 2021
3ce31a9
refactor(tree): refactor tree nav, cleanup unused snippets
ViktorSlavov Apr 2, 2021
73891c0
chore(tree): fix rebase conflicts
ViktorSlavov Apr 7, 2021
d491ad5
chore(tree): add display density, include tree resource string in output
ViktorSlavov Apr 9, 2021
38db659
chore(tree): add loading input, add `load-on-demand` node in sample
ViktorSlavov Apr 9, 2021
f2ea450
refactor(theme): address issues, update control flow statement
desig9stein Apr 12, 2021
8ad596d
chore(tree): road-to-100% coverage, WIP
ViktorSlavov Apr 14, 2021
89cfceb
Merge remote-tracking branch 'remotes/origin/master' into vslavov/tre…
ViktorSlavov Apr 14, 2021
2255ee9
chore(tree): fix typo in tree theme
ViktorSlavov Apr 14, 2021
d72fff6
chore(tree): keyboard navigation tests
teodosiah Apr 6, 2021
7d58970
chore(tree): destroy services in unit test, add test for events
ViktorSlavov Apr 15, 2021
09e30d2
chore(tree): update tree-node roles, add basic tests
ViktorSlavov Apr 15, 2021
a22283a
Merge pull request #9280 from IgniteUI/thristodorova/tree-navigation-…
ViktorSlavov Apr 15, 2021
916d47b
chore(tree): api documentation refactoring
teodosiah Apr 15, 2021
e7d1024
chore(tree): handle node selection for add/delete nodes, prune public…
ViktorSlavov Apr 15, 2021
377ef49
test(tree): rename public children property in mock generators
ViktorSlavov Apr 16, 2021
c6eb6a5
Merge branch 'master' into vslavov/tree-POC
simeonoff Apr 16, 2021
5bbf8eb
test(tree): organize nav tests, add configureSuite to each, xit failing
ViktorSlavov Apr 16, 2021
3a36b6e
docs(tree): add README, CHANGELOG entry, update product README table
ViktorSlavov Apr 16, 2021
9e208d3
Merge branch 'master' into vslavov/tree-POC
simeonoff Apr 16, 2021
6ee3cea
chore(tree): cleanup sample, re-export IgxTree interfaces
ViktorSlavov Apr 16, 2021
580013e
Merge branch 'master' into vslavov/tree-POC
simeonoff Apr 16, 2021
7949bb4
Merge branch 'master' into vslavov/tree-POC
Lipata Apr 18, 2021
a93282b
Merge branch 'master' into vslavov/tree-POC
kdinev Apr 19, 2021
37f0298
Addressing review comment about changelog
kdinev Apr 19, 2021
cd08cd2
chore(tree): address review comments
ViktorSlavov Apr 19, 2021
12dee65
test(tree): add missing `owner` properties in selection tests
ViktorSlavov Apr 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,27 @@ All notable changes for each version of this project will be documented in this
- `onDataPreLoad` -> `dataPreLoad`

### New Features
- Added `IgxTree` component
- Allows users to render hierarchical data in an easy-to-navigate way. The control is **not** data bound and takes a declarative approach, giving users more control over what is being rendered.
- Features API for handling selection (bi-state and cascading), node activation, node expansion state.
- Features extensive and easy-to-use keyboard navigation, fully compliant with W3 standards.
- Code example for a tree contructured from a hierarchical data set:
```html
<igx-tree>
<igx-tree-node *ngFor="let node of data" [data]="node" [expanded]="isNodeExpanded(node)" [selected]="isNodeSelected(node)">
{{ node.text }}
<img [src]="node.image" alt="node.imageAlt" />
<igx-tree-node *ngFor="let child of node.children" [data]="child" [expanded]="isNodeExpanded(child)" [selected]="isNodeSelected(child)">
{{ child.text }}
<igx-tree-node *ngFor="let leafChild of child.children" [data]="leafChild" [expanded]="isNodeExpanded(leafChild)" [selected]="isNodeSelected(leafChild)">
<a igxTreeNodeLink href="{{leafChild.location}}" target="_blank">{{ leafChild.text }}</a>
</igx-tree-node>
</igx-tree-node>
</igx-tree-node>
</igx-tree>
```
- For more information, check out the [README](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/tree/README.md), [specification](https://github.com/IgniteUI/igniteui-angular/wiki/Tree-Specification) and [official documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/tree)

- `IgxHierarchicalGrid`
- Added support for exporting hierarchical data.
- `IgxForOf`, `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ You can find source files under the [`src`](https://github.com/IgniteUI/igniteui
|tabs|Available|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/tabs/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/tabs)|||||
|time picker|Available|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/time-picker/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/time-picker)|||||
|toast|Available|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/toast/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/toast)|||||
|tree|Available|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/tree/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/tree)|||||
|tree grid|Available|[Readme](https://github.com/IgniteUI/igniteui-angular/blob/master/projects/igniteui-angular/src/lib/grids/tree-grid/README.md)|[Docs](https://www.infragistics.com/products/ignite-ui-angular/angular/components/treegrid/tree-grid)|||||

#### Components available in [igniteui-angular-charts](https://www.npmjs.com/package/igniteui-angular-charts)
Expand Down
2 changes: 1 addition & 1 deletion projects/igniteui-angular/karma.azure.non-grid.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function (config) {
random: false
},
tagPrefix: '#',
skipTags: 'hGrid,tGrid,grid,perf'
skipTags: 'hGrid,tGrid,grid,perf,treeView'
},
port: 9876,
colors: true,
Expand Down
12 changes: 6 additions & 6 deletions projects/igniteui-angular/src/lib/banner/banner.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, NgModule, EventEmitter, Output, Input, ViewChild, ElementRef,
ContentChild, HostBinding } from '@angular/core';
import { IgxExpansionPanelModule } from '../expansion-panel/expansion-panel.module';
import { AnimationSettings } from '../expansion-panel/expansion-panel.component';
import { IgxExpansionPanelComponent } from '../expansion-panel/public_api';
import { IgxIconModule, IgxIconComponent } from '../icon/public_api';
import { IToggleView } from '../core/navigation';
Expand All @@ -10,6 +9,7 @@ import { IgxRippleModule } from '../directives/ripple/ripple.directive';
import { IgxBannerActionsDirective } from './banner.directives';
import { CommonModule } from '@angular/common';
import { CancelableEventArgs, IBaseEventArgs } from '../core/utils';
import { ToggleAnimationSettings } from '../expansion-panel/toggle-animation-component';

export interface BannerEventArgs extends IBaseEventArgs {
banner: IgxBannerComponent;
Expand Down Expand Up @@ -111,11 +111,11 @@ export class IgxBannerComponent implements IToggleView {
/**
* Get the animation settings used by the banner open/close methods
* ```typescript
* let currentAnimations: AnimationSettings = banner.animationSettings
* let currentAnimations: ToggleAnimationSettings = banner.animationSettings
* ```
*/
@Input()
public get animationSettings(): AnimationSettings {
public get animationSettings(): ToggleAnimationSettings {
return this._animationSettings ? this._animationSettings : this._expansionPanel.animationSettings;
}

Expand All @@ -124,10 +124,10 @@ export class IgxBannerComponent implements IToggleView {
* ```typescript
* import { slideInLeft, slideOutRight } from 'igniteui-angular';
* ...
* banner.animationSettings: AnimationSettings = { openAnimation: slideInLeft, closeAnimation: slideOutRight };
* banner.animationSettings: ToggleAnimationSettings = { openAnimation: slideInLeft, closeAnimation: slideOutRight };
* ```
*/
public set animationSettings(settings: AnimationSettings) {
public set animationSettings(settings: ToggleAnimationSettings) {
this._animationSettings = settings;
}
/**
Expand Down Expand Up @@ -166,7 +166,7 @@ export class IgxBannerComponent implements IToggleView {
private _bannerActionTemplate: IgxBannerActionsDirective;

private _bannerEvent: BannerEventArgs;
private _animationSettings: AnimationSettings;
private _animationSettings: ToggleAnimationSettings;

constructor(public elementRef: ElementRef) { }

Expand Down
4 changes: 3 additions & 1 deletion projects/igniteui-angular/src/lib/core/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { IChipResourceStrings, ChipResourceStringsEN } from './chip-resources';
import { IListResourceStrings, ListResourceStringsEN } from './list-resources';
import { CalendarResourceStringsEN, ICalendarResourceStrings } from './calendar-resources';
import { IInputResourceStrings, InputResourceStringsEN } from './input-resources';
import { ITreeResourceStrings, TreeResourceStringsEN } from './tree-resources';

export interface IResourceStrings extends IGridResourceStrings, ITimePickerResourceStrings, ICalendarResourceStrings,
ICarouselResourceStrings, IChipResourceStrings, IInputResourceStrings, IDateRangePickerResourceStrings, IListResourceStrings,
IPaginatorResourceStrings { }
IPaginatorResourceStrings, ITreeResourceStrings { }

/**
* @hidden
Expand All @@ -26,6 +27,7 @@ export const CurrentResourceStrings = {
CarouselResStrings: cloneValue(CarouselResourceStringsEN),
ListResStrings: cloneValue(ListResourceStringsEN),
InputResStrings: cloneValue(InputResourceStringsEN),
TreeResStrings: cloneValue(TreeResourceStringsEN),
};

const updateResourceStrings = (currentStrings: IResourceStrings, newStrings: IResourceStrings) => {
Expand Down
9 changes: 9 additions & 0 deletions projects/igniteui-angular/src/lib/core/i18n/tree-resources.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface ITreeResourceStrings {
igx_expand?: string;
igx_collapse?: string;
}

export const TreeResourceStringsEN: ITreeResourceStrings = {
igx_expand: 'Expand',
igx_collapse: 'Collapse',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
////
/// @group components
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
/// @requires {mixin} bem-block
/// @requires {mixin} bem-elem
/// @requires {mixin} bem-mod
////

@include b(igx-tree) {
@extend %tree-display !optional;
}

@include b(igx-tree-node) {
$this: bem--selector-to-string(&);
@include register-component(str-slice($this, 2, -1));

@extend %tree-node !optional;

@include e(wrapper) {
@extend %node-wrapper !optional;

&:hover {
&::after {
@extend %indigo-opacity !optional;
}
}
}

@include e(wrapper, $m: cosy) {
@extend %node-wrapper--cosy !optional;
}

@include e(wrapper, $m: compact) {
@extend %node-wrapper--compact !optional;
}

// STATES START
@include e(wrapper, $m: selected) {
@extend %node-wrapper--selected !optional;
}

@include e(wrapper, $m: active) {
@extend %node-wrapper--active !optional;
}

@include e(wrapper, $mods: (active, selected)) {
@extend %node-wrapper--active-selected !optional;
}

@include e(wrapper, $m: focused) {
@extend %node-wrapper--focused !optional;
}

@include e(wrapper, $m: disabled) {
@extend %node-wrapper--disabled !optional;
}
// STATES END

@include e(content) {
@extend %node-content !optional;
}

@include e(spacer) {
@extend %node-spacer !optional;
}

@include e(toggle-button) {
@extend %node-toggle-button !optional;
}

@include e(toggle-button, $m: hidden) {
@extend %node-toggle-button--hidden !optional;
}

@include e(drop-indicator) {
@extend %node-drop-indicator !optional;
}

@include e(select) {
@extend %node-select !optional;
}

@include e(group) {
@extend %node-group !optional;
}
}
Loading