Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
38c6ad8
refactor(grid): Remove display density from base grid and filtering
mddragnev Apr 9, 2024
7677ba2
refactor(ESF): remove displayDensity usage within the ESF
mddragnev Apr 9, 2024
10020ec
refactor(*): remove some more usage of displayDensity within the grid
mddragnev Apr 9, 2024
ecf06fa
refactor(toolbar): Remove density usage. Update toolbar to become dyn…
mddragnev Apr 9, 2024
84a8dfc
refactor(summaries): remove density usage. Remove leftover classes
mddragnev Apr 9, 2024
ecf6590
chore(*): remove some more leftover density usage
mddragnev Apr 9, 2024
6f31f34
refactor(hGrid): remove density usage
mddragnev Apr 10, 2024
27e6231
refactor(treeGrid): remove density usage
mddragnev Apr 10, 2024
6360cb4
refactor(pivot): remove the usage of display density in pivot grid
mddragnev Apr 15, 2024
a3bc80a
test(grid): fix all build time errors so that the tests run
mddragnev Apr 15, 2024
3ebf717
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
mddragnev Apr 24, 2024
8be56af
chore(*): change the way that the size is handled. Fix some tests
mddragnev Apr 24, 2024
4dda947
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
mddragnev Apr 26, 2024
846b1db
test(grid): Fix the failing tests
mddragnev Apr 29, 2024
b0565c4
chore(*): fix lint
mddragnev Apr 29, 2024
593c7d4
Merge branch 'master' into mdragnev/refactor-density
mddragnev Apr 29, 2024
a6d72bc
fix(grid): fix grid and pivot flickering because of throttleTime on t…
mddragnev Apr 29, 2024
76eca7f
test(*): lower wait time because of the throttleTime
mddragnev Apr 29, 2024
8de094a
chore(*): Try fixing the flickering of pivot and issue #13000
mddragnev Apr 30, 2024
e554e60
Merge branch 'master' into mdragnev/refactor-density
mddragnev May 7, 2024
e6f8a0e
chore(samples): Remove density usage from dev samples
mddragnev May 8, 2024
69e4ed9
chore(*): Add the removal of displayDensity to the changelog
mddragnev May 8, 2024
d9587e8
Merge branch 'mdragnev/refactor-density' of https://github.com/Ignite…
mddragnev May 8, 2024
b6f8e53
chore(*): fix lint
mddragnev May 8, 2024
e6e765a
chore(*): Add migrations from 17.2.x to 18.0.0
mddragnev May 10, 2024
5392d9f
Merge branch 'master' into mdragnev/refactor-density
mddragnev May 10, 2024
027d698
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
mddragnev May 13, 2024
e253f96
chore(migration): update migration name in the spec file due to merge
mddragnev May 13, 2024
0671838
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
mddragnev May 21, 2024
4974582
chore(migration): update migration to use css var instead of shorter …
mddragnev May 21, 2024
8b8a052
chore(esf): Move hostbinding of --component-size to the css
mddragnev May 21, 2024
a117961
chore(*): use isConnected API of the native element instead document.…
mddragnev May 21, 2024
415271b
chore(*): Mark size related properties as hidden and internal
mddragnev May 21, 2024
9283b6a
chore(*): Move sizing test function the the correct file within the t…
mddragnev May 21, 2024
d26a2a5
chore(*): Update dev sample not to use internal enum Size
mddragnev May 21, 2024
08a4301
chore(*): fix lint
mddragnev May 21, 2024
6f94757
chore(*): remove fdescribe from migrations tests
mddragnev May 21, 2024
2f623d2
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
mddragnev May 21, 2024
528a251
chore(*): clean up the dev samples
mddragnev May 22, 2024
7a57fb9
Merge branch 'master' into mdragnev/refactor-density
ChronosSF May 22, 2024
3171f9b
Merge branch 'master' into mdragnev/refactor-density
ChronosSF May 27, 2024
6de2417
Merge branch 'master' into mdragnev/refactor-density
ChronosSF May 27, 2024
1c1af6a
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
mddragnev May 28, 2024
5e48b93
Merge branch 'master' into mdragnev/refactor-density
dkamburov May 28, 2024
1a17280
Merge branch 'master' into mdragnev/refactor-density
ChronosSF May 28, 2024
358d6df
Merge branch 'master' into mdragnev/refactor-density
simeonoff May 28, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ All notable changes for each version of this project will be documented in this
- `IgxCombo`, `IgxSimpleCombo`:
- Introduced abillity for hiding the clear icon button when the custom clear icon template is empty.
- `IgxDateTimeEditor`, `IgxTimePicker`:
- Now accept the following custom `inputFormat` options, as Angular's DatePipe:
- Fractional seconds: S, SS, SSS.
- Period (Am/Pm): a, aa, aaa, aaaa, aaaaa
- Now accept the following custom `inputFormat` options, as Angular's DatePipe:
- Fractional seconds: S, SS, SSS.
- Period (Am/Pm): a, aa, aaa, aaaa, aaaaa
- `IgxPivotGrid`
- Added templatable row dimension headers displayed on the top, above all row headers.
- Replace the `showPivotConfigurationUI` property with `pivotUI` property, adding ability now to enable/disable the configuration UI and/or the new row dimension headers.
- Added `sortable` property for each IPivotDimension.

### General
- 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.

## 17.2.0
### New Features
- `IgxAvatar`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
{
"$schema": "../../common/schema/binding.schema.json",
"changes": [
{
"name": "displayDensity",
"remove": true,
"owner": {
"selector": "igx-grid",
"type": "component"
}
},
{
"name": "displayDensity",
"remove": true,
"owner": {
"selector": "igx-tree-grid",
"type": "component"
}
},
{
"name": "displayDensity",
"remove": true,
"owner": {
"selector": "igx-pivot-grid",
"type": "component"
}
},
{
"name": "displayDensity",
"remove": true,
"owner": {
"selector": "igx-hierarchical-grid",
"type": "component"
}
},
{
"name": "displayDensity",
"remove": true,
"owner": {
"selector": "igx-row-island",
"type": "component"
}
},
{
"name": "showPivotConfigurationUI",
"replaceWith": "pivotUI",
Expand Down
164 changes: 164 additions & 0 deletions projects/igniteui-angular/migrations/update-18_0_0/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,170 @@ describe(`Update to ${version}`, () => {

const migrationName = 'migration-38';

it('should remove displayDensity property from igx-grid and replace it with inline style if its value is not set to a component member', async () => {
appTree.create(
'/testSrc/appPrefix/component/test.component.html', `
<igx-grid [data]="data" [displayDensity]="'cosy'" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-grid>
<igx-grid [data]="data" displayDensity="cosy" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-grid>`);

const tree = await schematicRunner.runSchematic(migrationName, { shouldInvokeLS: false }, appTree);

expect(tree.readContent('/testSrc/appPrefix/component/test.component.html'))
.toEqual(`
<igx-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-medium)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-grid>
<igx-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-medium)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-grid>`);
});

it('should only remove and not replace displayDensity property from igx-grid if it is bound to something different than a value', async () => {
appTree.create(
'/testSrc/appPrefix/component/test.component.html', `
<igx-grid [data]="data" [displayDensity]="density" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-grid>`);

const tree = await schematicRunner.runSchematic(migrationName, { shouldInvokeLS: false }, appTree);

expect(tree.readContent('/testSrc/appPrefix/component/test.component.html'))
.toEqual(`
<igx-grid [data]="data" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-grid>`);
});

it('should remove displayDensity property from igx-tree-grid and replace it with inline style if its value is not set to a component member', async () => {
appTree.create(
'/testSrc/appPrefix/component/test.component.html', `
<igx-tree-grid [data]="data" [displayDensity]="'comfortable'" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-tree-grid>
<igx-tree-grid [data]="data" displayDensity="compact" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-tree-grid>`);

const tree = await schematicRunner.runSchematic(migrationName, { shouldInvokeLS: false }, appTree);

expect(tree.readContent('/testSrc/appPrefix/component/test.component.html'))
.toEqual(`
<igx-tree-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-large)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-tree-grid>
<igx-tree-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-small)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-tree-grid>`);
});

it('should remove displayDensity property from igx-pivot-grid and replace it with inline style if its value is not set to a component member', async () => {
appTree.create(
'/testSrc/appPrefix/component/test.component.html', `
<igx-pivot-grid [data]="data" [displayDensity]="'comfortable'" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-pivot-grid>
<igx-pivot-grid [data]="data" displayDensity="compact" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-pivot-grid>`);

const tree = await schematicRunner.runSchematic(migrationName, { shouldInvokeLS: false }, appTree);

expect(tree.readContent('/testSrc/appPrefix/component/test.component.html'))
.toEqual(`
<igx-pivot-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-large)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-pivot-grid>
<igx-pivot-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-small)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
</igx-pivot-grid>`);
});

it('should remove displayDensity property from igx-hierarchical-grid and igx-row-island and replace it with inline style if its value is not set to a component member', async () => {
appTree.create(
'/testSrc/appPrefix/component/test.component.html', `
<igx-hierarchical-grid [data]="data" [displayDensity]="'comfortable'" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
<igx-row-island [displayDensity]="'comfortable'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-row-island [displayDensity]="'compact'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-row-island/>
<igx-row-island/>
</igx-hierarchical-grid>
<igx-hierarchical-grid [data]="data" displayDensity="compact" height="300px" width="300px">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
<igx-row-island displayDensity="comfortable">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-row-island displayDensity="cosy">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-row-island/>
<igx-row-island/>
</igx-hierarchical-grid>`);

const tree = await schematicRunner.runSchematic(migrationName, { shouldInvokeLS: false }, appTree);

expect(tree.readContent('/testSrc/appPrefix/component/test.component.html'))
.toEqual(`
<igx-hierarchical-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-large)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
<igx-row-island [style.--ig-size]="'var(--ig-size-large)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-row-island [style.--ig-size]="'var(--ig-size-small)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-row-island/>
<igx-row-island/>
</igx-hierarchical-grid>
<igx-hierarchical-grid [data]="data" height="300px" width="300px" [style.--ig-size]="'var(--ig-size-small)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-column field="TrackProgress" header="Track Progress"></igx-column>
<igx-column field="CountryFlag" header="Country"></igx-column>
<igx-row-island [style.--ig-size]="'var(--ig-size-large)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-row-island [style.--ig-size]="'var(--ig-size-medium)'">
<igx-column field="Name" header="Athlete"></igx-column>
<igx-row-island/>
<igx-row-island/>
</igx-hierarchical-grid>`);
});

it('should replace PivotGrid property `showPivotConfigurationUI` with `pivotUI`', async () => {
appTree.create(`/testSrc/appPrefix/component/test.component.html`,
`
Expand Down
52 changes: 52 additions & 0 deletions projects/igniteui-angular/migrations/update-18_0_0/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Rule, SchematicContext, Tree } from "@angular-devkit/schematics";
import { FileChange, findElementNodes, getAttribute, getSourceOffset, hasAttribute, parseFile } from '../common/util';
import { nativeImport } from 'igniteui-angular/migrations/common/import-helper.js';
import type { Element } from '@angular/compiler';
import { BoundPropertyObject, InputPropertyType, UpdateChanges } from "../common/UpdateChanges";

const version = "18.0.0";
Expand All @@ -7,7 +10,55 @@ export default (): Rule => async (host: Tree, context: SchematicContext) => {
context.logger.info(
`Applying migration for Ignite UI for Angular to version ${version}`,
);
const { HtmlParser } = await nativeImport('@angular/compiler') as typeof import('@angular/compiler');
const update = new UpdateChanges(__dirname, host, context);
const changes = new Map<string, FileChange[]>();
const prop = ["displayDensity", "[displayDensity]"];
const tags = ["igx-grid", "igx-hierarchical-grid", "igx-row-island", "igx-tree-grid", "igx-pivot-grid"]

const applyChanges = () => {
for (const [path, change] of changes.entries()) {
let buffer = host.read(path).toString();
change.sort((c, c1) => c.position - c1.position)
.reverse()
.forEach(c => buffer = c.apply(buffer));

host.overwrite(path, buffer);
}
};

const addChange = (path: string, change: FileChange) => {
if (changes.has(path)) {
changes.get(path).push(change);
} else {
changes.set(path, [change]);
}
};

for (const path of update.templateFiles) {
const grid = findElementNodes(parseFile(new HtmlParser(), host, path), tags);
grid
.filter(node => hasAttribute(node as Element, prop))
.map(node => getSourceOffset(node as Element))
.forEach(offset => {
const { startTag, file, node } = offset;
const { value } = getAttribute(node, prop)[0];
// using includes and not the value itself because the value might be either [displayDensity]='comfortable' or displayDensity="'comfortable'"
if (value.includes('comfortable')) {
const newProp = ` [style.--ig-size]="'var(--ig-size-large)'"`;
addChange(file.url, new FileChange(startTag.end - 1, newProp, '', "insert"));
}
else if (value.includes('cosy')) {
const newProp = ` [style.--ig-size]="'var(--ig-size-medium)'"`;
addChange(file.url, new FileChange(startTag.end - 1, newProp, '', "insert"));
} else if (value.includes('compact')) {
const newProp = ` [style.--ig-size]="'var(--ig-size-small)'"`;
addChange(file.url, new FileChange(startTag.end - 1, newProp, '', "insert"));
}
// We don`t have else because if density it set like this: [displayDensity]="customDensity"
// then we can`t do anything and we just remove the property.
});
}

update.addValueTransform('pivotConfigurationUI_to_pivotUI', (args: BoundPropertyObject): void => {
args.bindingType = InputPropertyType.EVAL;
Expand All @@ -24,5 +75,6 @@ export default (): Rule => async (host: Tree, context: SchematicContext) => {
}
});

applyChanges();
update.applyChanges();
};
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,5 @@
@include m(fw) {
@extend %grid-summary--fixed-width !optional;
}

@include m(cosy) {
@extend %igx-grid-summary !optional;
@extend %igx-grid-summary--cosy !optional;

@include e(item) {
@extend %igx-grid-summary__item--cosy !optional;
}
}

@include m(compact) {
@extend %igx-grid-summary !optional;
@extend %igx-grid-summary--compact !optional;

@include e(item) {
@extend %igx-grid-summary__item--compact !optional;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,5 @@
@include e(dd-list){
@extend %igx-grid-toolbar__dd-list !optional;
}

@include m(cosy){
@extend %igx-grid-toolbar !optional;
@extend %igx-grid-toolbar--cosy !optional;
}

@include m(compact){
@extend %igx-grid-toolbar !optional;
@extend %igx-grid-toolbar--compact !optional;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
);

%igx-grid-toolbar {
@include sizable();
--component-size: var(--ig-size, var(--ig-size-large));
position: relative;
width: 100%;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
@extend %igx-excel-filter__loading !optional;
}

@include e(sizing) {
@extend %igx-excel-filter__sizing !optional;
}
Comment on lines +13 to +15
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a new class selector? Can't we simply use the existing %grid-excel-filter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you take a look at the usage of the newly introduced class:

 @HostBinding('class.igx-excel-filter__sizing') protected get shouldApplySizes(): boolean { return !(this._minHeight || this._maxHeight); } 

we set this only if we do not have neither minHeight nor maxHeight set from the inputs of the ESF. If we use the exising main css class %grid-excel-filter we cannot do this unless we set min/maxHeight as inline styles that override the default behaviour of the sizing mixin which I don't really like


@include e(tree) {
@extend %igx-excel-filter__tree !optional;
}
Expand Down
Loading