Skip to content

Commit e17d7cd

Browse files
authored
fix(tree-grid): chevron selected icon color (#17519)
1 parent 9f416c3 commit e17d7cd

3 files changed

Lines changed: 45 additions & 7 deletions

File tree

projects/igniteui-angular/grids/themes/_base.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,13 @@ $z-grid-loading: 10003;
512512
border-inline-end-color: var-get($theme, 'body-column-selected-border-color');
513513
}
514514

515+
.igx-grid__tree-grouping-indicator {
516+
color: var-get($theme, 'row-selected-text-color');
517+
518+
&:hover {
519+
color: var-get($theme, 'row-selected-text-color');
520+
}
521+
}
515522

516523
&:hover {
517524
color: var-get($theme, 'row-selected-hover-text-color');

src/app/grid-theme-builder/grid-theme-builder.sample.html

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
[style.--ig-grid-row-border-color]="gridRowBorderColor() || null"
2727
[style.--ig-grid-header-text-color]="gridHeaderTextColor() || null">
2828

29-
<igx-buttongroup class="preview-switcher" selectionMode="singleRequired" (selected)="activePreview.set($event.index === 0 ? 'grid' : 'hierarchical')">
29+
<igx-buttongroup class="preview-switcher" selectionMode="singleRequired"
30+
(selected)="activePreview.set($event.index === 0 ? 'grid' : $event.index === 1 ? 'tree' : 'hierarchical')">
3031
<button igxButton [selected]="activePreview() === 'grid'">Grid</button>
32+
<button igxButton [selected]="activePreview() === 'tree'">Tree Grid</button>
3133
<button igxButton [selected]="activePreview() === 'hierarchical'">Hierarchical Grid</button>
3234
</igx-buttongroup>
3335

@@ -159,6 +161,33 @@
159161
</igx-paginator>
160162
</igx-grid>
161163
}
164+
@else if (activePreview() === 'tree') {
165+
<igx-tree-grid
166+
[data]="treeData"
167+
[primaryKey]="'ID'"
168+
[childDataKey]="'ChildCompanies'"
169+
[expansionDepth]="1"
170+
[rowSelection]="'multiple'"
171+
[cellSelection]="'multiple'"
172+
[autoGenerate]="false"
173+
[height]="'600px'">
174+
175+
<igx-column field="ID" header="ID" dataType="string" [hidden]="true">
176+
</igx-column>
177+
<igx-column field="CompanyName" header="Company" dataType="string"
178+
[sortable]="true" [resizable]="true">
179+
</igx-column>
180+
<igx-column field="ContactName" header="Contact" dataType="string"
181+
[sortable]="true" [resizable]="true">
182+
</igx-column>
183+
<igx-column field="ContactTitle" header="Title" dataType="string"
184+
[sortable]="true" [resizable]="true">
185+
</igx-column>
186+
<igx-column field="Country" header="Country" dataType="string"
187+
[sortable]="true" [resizable]="true">
188+
</igx-column>
189+
</igx-tree-grid>
190+
}
162191
@else {
163192
<igx-hierarchical-grid
164193
[style.--ig-grid-summary-pinned-border-width]="gridSummaryPinnedBorderWidth() || null"

src/app/grid-theme-builder/grid-theme-builder.sample.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { IGX_GRID_DIRECTIVES, IgxActionStripComponent, IgxButtonDirective, IgxBu
44
import { IgxAccordionComponent } from 'igniteui-angular/accordion';
55
import { IGX_EXPANSION_PANEL_DIRECTIVES } from 'igniteui-angular/expansion-panel';
66
import { IgxHierarchicalGridComponent, IgxRowIslandComponent } from 'igniteui-angular/grids/hierarchical-grid';
7+
import { IgxTreeGridComponent } from 'igniteui-angular/grids/tree-grid';
78
import { IgxInputGroupComponent, IgxInputDirective } from 'igniteui-angular/input-group';
89
import { IGX_SELECT_DIRECTIVES } from 'igniteui-angular/select';
910
import { PropertyChangeService } from '../properties-panel/property-change.service';
10-
import { SAMPLE_DATA } from '../shared/sample-data';
11+
import { HIERARCHICAL_SAMPLE_DATA, SAMPLE_DATA } from '../shared/sample-data';
1112
import { BorderRuleEditorComponent } from './border-rule-editor.component';
1213
import { BORDER_DEFAULTS, BorderSignals, BorderTarget } from './border-rule-editor.types';
1314
import { ColorPickerComponent } from './color-picker.component';
@@ -26,7 +27,7 @@ class EmployeesSummary extends IgxNumberSummaryOperand {
2627
templateUrl: 'grid-theme-builder.sample.html',
2728
changeDetection: ChangeDetectionStrategy.OnPush,
2829
encapsulation: ViewEncapsulation.None,
29-
imports: [FormsModule, IGX_GRID_DIRECTIVES, IgxHierarchicalGridComponent, IgxRowIslandComponent, IgxActionStripComponent, IgxButtonDirective, IgxButtonGroupComponent, IgxAccordionComponent, IGX_EXPANSION_PANEL_DIRECTIVES, IGX_SELECT_DIRECTIVES, IgxInputGroupComponent, IgxInputDirective, ColorPickerComponent, BorderRuleEditorComponent]
30+
imports: [FormsModule, IGX_GRID_DIRECTIVES, IgxHierarchicalGridComponent, IgxRowIslandComponent, IgxTreeGridComponent, IgxActionStripComponent, IgxButtonDirective, IgxButtonGroupComponent, IgxAccordionComponent, IGX_EXPANSION_PANEL_DIRECTIVES, IGX_SELECT_DIRECTIVES, IgxInputGroupComponent, IgxInputDirective, ColorPickerComponent, BorderRuleEditorComponent]
3031
})
3132
export class GridThemeBuilderSampleComponent implements OnInit, AfterViewInit {
3233
protected readonly gridForeground = signal('');
@@ -91,10 +92,10 @@ export class GridThemeBuilderSampleComponent implements OnInit, AfterViewInit {
9192
private readonly sampleEl = viewChild.required<ElementRef>('sampleEl');
9293
private readonly customControlsTemplate = viewChild.required<TemplateRef<any>>('customControls');
9394

94-
// Only one grid preview is mounted at a time: both a flat grid and a
95-
// 4-level-deep hierarchical grid are expensive to initialize, and neither
96-
// is needed while the other is what's actually being themed.
97-
protected readonly activePreview = signal<'grid' | 'hierarchical'>('grid');
95+
// Only one grid preview is mounted at a time. The hierarchical preview is
96+
// expensive to initialize, and hidden grids aren't needed while another
97+
// grid type is being themed.
98+
protected readonly activePreview = signal<'grid' | 'tree' | 'hierarchical'>('grid');
9899

99100
protected readonly showExport = signal(false);
100101
protected readonly copiedExport = signal<'css' | 'scss' | null>(null);
@@ -262,6 +263,7 @@ export class GridThemeBuilderSampleComponent implements OnInit, AfterViewInit {
262263
private readonly propertyChangeService = inject(PropertyChangeService);
263264

264265
public data: Array<any>;
266+
public readonly treeData = HIERARCHICAL_SAMPLE_DATA;
265267
public readonly hierarchicalData = this.generateHierarchicalData(10, 3);
266268
public readonly employeesSummary = EmployeesSummary;
267269

0 commit comments

Comments
 (0)