Skip to content

Commit 1c1af6a

Browse files
committed
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular into mdragnev/refactor-density
2 parents 6de2417 + 68b2a7b commit 1c1af6a

27 files changed

+602
-87
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ All notable changes for each version of this project will be documented in this
1010
- Now accept the following custom `inputFormat` options, as Angular's DatePipe:
1111
- Fractional seconds: S, SS, SSS.
1212
- Period (Am/Pm): a, aa, aaa, aaaa, aaaaa
13+
- `IgxPivotGrid`
14+
- Added templatable row dimension headers displayed on the top, above all row headers.
15+
- Replace the `showPivotConfigurationUI` property with `pivotUI` property, adding ability now to enable/disable the configuration UI and/or the new row dimension headers.
16+
- Added `sortable` property for each IPivotDimension.
1317

1418
### General
1519
- Removed deprecated property `displayDensity`. Size is now controlled only through the custom CSS property `--ig-size`. Refer to the [Update Guide](https://www.infragistics.com/products/ignite-ui-angular/angular/components/general/update-guide) and components documentation for usage details.

projects/igniteui-angular/migrations/update-18_0_0/changes/inputs.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
"selector": "igx-row-island",
4141
"type": "component"
4242
}
43+
},
44+
{
45+
"name": "showPivotConfigurationUI",
46+
"replaceWith": "pivotUI",
47+
"valueTransform": "pivotConfigurationUI_to_pivotUI",
48+
"owner": {
49+
"selector": "igx-pivot-grid",
50+
"type": "component"
51+
}
4352
}
4453
]
4554
}

projects/igniteui-angular/migrations/update-18_0_0/index.spec.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,36 @@ describe(`Update to ${version}`, () => {
193193
<igx-row-island/>
194194
</igx-hierarchical-grid>`);
195195
});
196+
197+
it('should replace PivotGrid property `showPivotConfigurationUI` with `pivotUI`', async () => {
198+
appTree.create(`/testSrc/appPrefix/component/test.component.html`,
199+
`
200+
<igx-pivot-grid [showPivotConfigurationUI]="false"></igx-pivot-grid>
201+
`
202+
);
203+
204+
const tree = await schematicRunner.runSchematic(migrationName, { shouldInvokeLS: false }, appTree);
205+
206+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.html')).toEqual(
207+
`
208+
<igx-pivot-grid [pivotUI]="{ showConfiguration: false }"></igx-pivot-grid>
209+
`
210+
);
211+
});
212+
213+
it('should replace PivotGrid property `showPivotConfigurationUI` with `pivotUI`', async () => {
214+
appTree.create(`/testSrc/appPrefix/component/test.component.html`,
215+
`
216+
<igx-pivot-grid [showPivotConfigurationUI]="testProp"></igx-pivot-grid>
217+
`
218+
);
219+
220+
const tree = await schematicRunner.runSchematic(migrationName, { shouldInvokeLS: false }, appTree);
221+
222+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.html')).toEqual(
223+
`
224+
<igx-pivot-grid [pivotUI]="{ showConfiguration: testProp }"></igx-pivot-grid>
225+
`
226+
);
227+
});
196228
});

projects/igniteui-angular/migrations/update-18_0_0/index.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Rule, SchematicContext, Tree } from "@angular-devkit/schematics";
2-
import { UpdateChanges } from '../common/UpdateChanges';
32
import { FileChange, findElementNodes, getAttribute, getSourceOffset, hasAttribute, parseFile } from '../common/util';
43
import { nativeImport } from 'igniteui-angular/migrations/common/import-helper.js';
54
import type { Element } from '@angular/compiler';
5+
import { BoundPropertyObject, InputPropertyType, UpdateChanges } from "../common/UpdateChanges";
66

77
const version = "18.0.0";
88

@@ -59,7 +59,22 @@ export default (): Rule => async (host: Tree, context: SchematicContext) => {
5959
// then we can`t do anything and we just remove the property.
6060
});
6161
}
62-
applyChanges();
6362

63+
update.addValueTransform('pivotConfigurationUI_to_pivotUI', (args: BoundPropertyObject): void => {
64+
args.bindingType = InputPropertyType.EVAL;
65+
66+
switch (args.value) {
67+
case 'true':
68+
args.value = '{ showConfiguration: true }';
69+
break;
70+
case 'false':
71+
args.value = '{ showConfiguration: false }';
72+
break;
73+
default:
74+
args.value = `{ showConfiguration: ${args.value} }`;
75+
}
76+
});
77+
78+
applyChanges();
6479
update.applyChanges();
6580
};

projects/igniteui-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
}
9595
},
9696
"igxDevDependencies": {
97-
"@igniteui/angular-schematics": "~17.2.1320"
97+
"@igniteui/angular-schematics": "~18.0.1330-beta.0"
9898
},
9999
"ng-update": {
100100
"migrations": "./migrations/migration-collection.json",

projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,6 +3055,15 @@
30553055
border-bottom: 0;
30563056
}
30573057

3058+
%igx-grid__tr-pivot--small-row-area {
3059+
height: var(--header-size);
3060+
align-items: flex-end;
3061+
3062+
border-inline-start: 0;
3063+
border-inline-end: 0;
3064+
border-bottom: var-get($theme, 'header-border-width') var-get($theme, 'header-border-style') var-get($theme, 'header-border-color');
3065+
}
3066+
30583067
%igx-grid__tr-pivot--filter-container {
30593068
display: flex;
30603069
flex-direction: column;
@@ -3112,6 +3121,33 @@
31123121
align-items: center;
31133122
}
31143123
}
3124+
3125+
igx-pivot-row-header-group {
3126+
padding-left: pad-inline(
3127+
map.get($grid-header-padding-inline, 'compact'),
3128+
map.get($grid-header-padding-inline, 'cosy'),
3129+
map.get($grid-header-padding-inline, 'comfortable')
3130+
);
3131+
3132+
igx-pivot-row-dimension-header {
3133+
align-items: center;
3134+
3135+
.igx-grid-th__icons {
3136+
padding-right: pad-inline(
3137+
map.get($grid-header-padding-inline, 'compact'),
3138+
map.get($grid-header-padding-inline, 'cosy'),
3139+
map.get($grid-header-padding-inline, 'comfortable')
3140+
);
3141+
}
3142+
}
3143+
3144+
&:last-of-type {
3145+
igx-pivot-row-dimension-header {
3146+
border-inline-end: 0;
3147+
}
3148+
}
3149+
}
31153150
}
3151+
31163152
// Pivot grid END
31173153
}

projects/igniteui-angular/src/lib/grids/common/grid.interface.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { ISortingExpression, ISortingStrategy, SortingDirection } from '../../da
3434
import { IGridGroupingStrategy, IGridSortingStrategy } from './strategy';
3535
import { IForOfState, IgxGridForOfDirective } from '../../directives/for-of/for_of.directive';
3636
import { OverlaySettings } from '../../services/overlay/utilities';
37-
import { IDimensionsChange, IPivotConfiguration, IPivotDimension, IPivotKeys, IPivotValue, IValuesChange, PivotDimensionType } from '../pivot-grid/pivot-grid.interface';
37+
import { IDimensionsChange, IPivotConfiguration, IPivotDimension, IPivotKeys, IPivotValue, IValuesChange, PivotDimensionType, IPivotUISettings } from '../pivot-grid/pivot-grid.interface';
3838
import { IDataCloneStrategy } from '../../data-operations/data-clone-strategy';
3939
import { FormControl, FormGroup, ValidationErrors } from '@angular/forms';
4040
import { IgxGridValidationService } from '../grid/grid-validation.service';
@@ -1230,7 +1230,7 @@ export interface PivotGridType extends GridType {
12301230
*/
12311231
allDimensions: IPivotDimension[],
12321232
/** Specifies whether to show the pivot configuration UI in the grid. */
1233-
showPivotConfigurationUI: boolean;
1233+
pivotUI: IPivotUISettings;
12341234
/** @hidden @internal */
12351235
columnDimensions: IPivotDimension[];
12361236
/** @hidden @internal */
@@ -1273,12 +1273,15 @@ export interface PivotGridType extends GridType {
12731273
dimensionsChange: EventEmitter<IDimensionsChange>;
12741274
/** Emits an event when the values in the pivot grid change. */
12751275
valuesChange: EventEmitter<IValuesChange>;
1276+
/** Emits an event when the a dimension is sorted. */
1277+
dimensionsSortingExpressionsChange: EventEmitter<ISortingExpression[]>;
12761278
/** @hidden @internal */
12771279
pivotKeys: IPivotKeys;
12781280
hasMultipleValues: boolean;
12791281
excelStyleFilterMaxHeight: string;
12801282
excelStyleFilterMinHeight: string;
12811283
valueChipTemplate: TemplateRef<any>;
1284+
rowDimensionHeaderTemplate: TemplateRef<IgxColumnTemplateContext>;
12821285
}
12831286

12841287
export interface GridSVGIcon {

projects/igniteui-angular/src/lib/grids/headers/grid-header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ng-container *ngIf="!column.columnGroup">
1919
<div class="igx-grid-th__icons">
2020
<ng-container *ngIf="column.sortable && !disabled">
21-
<div class="sort-icon"
21+
<div #sortIconContainer class="sort-icon"
2222
[attr.data-sortIndex]="(grid.sortingOptions.mode === 'single' && grid.sortingExpressions.length <=1) ? null : column.field | sortingIndex:grid.sortingExpressions"
2323
(pointerdown)="onPointerDownIndicator($event)" (click)="onSortingIconClick($event)">
2424
<ng-container *ngTemplateOutlet="sortIconTemplate; context: { $implicit: this }"></ng-container>

projects/igniteui-angular/src/lib/grids/headers/grid-header.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export class IgxGridHeaderComponent implements DoCheck, OnDestroy {
4949
@ViewChild('defaultSortHeaderIconTemplate', { read: TemplateRef, static: true })
5050
protected defaultSortHeaderIconTemplate;
5151

52+
/**
53+
* @hidden
54+
*/
55+
@ViewChild('sortIconContainer', { read: ElementRef })
56+
protected sortIconContainer: ElementRef;
57+
5258
/**
5359
* Returns the `aria-selected` of the header.
5460
*/
@@ -172,7 +178,7 @@ export class IgxGridHeaderComponent implements DoCheck, OnDestroy {
172178
}
173179

174180
public sortDirection = SortingDirection.None;
175-
private _destroy$ = new Subject<boolean>();
181+
protected _destroy$ = new Subject<boolean>();
176182

177183
constructor(
178184
@Inject(IGX_GRID_BASE) public grid: GridType,

projects/igniteui-angular/src/lib/grids/pivot-grid/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Below is the list of all inputs that are specific to the pivot-grid look/behavio
7979
|Name|Type|Description|
8080
|--- |--- |--- |
8181
|`pivotConfiguration`|IPivotConfiguration|Gets/Sets the pivot configuration with all related dimensions and values.|
82-
|`showPivotConfigurationUI`|boolean|Gets/Sets the pivot configuration ui for the pivot grid - chips and their corresponding containers for row, filter, column dimensions and values|
82+
|`pivotUI`|IPivotUISettings|Gets/Sets whether to show the ui for the pivot grid configuration - chips and their corresponding containers for row, filter, column dimensions and values. Also enables/disabled row dimension headers.|
8383
|`defaultExpandState`| boolean | Gets/Sets the default expand state for all rows. |
8484

8585
Note that the pivot-grid extends base igx-grid, so most of the @Input properties make sense and work in the pivot-grid as well. Keep in mind that due to some specifics, not all grid features and @Input properties will work.

0 commit comments

Comments
 (0)