Skip to content

Commit 9873bae

Browse files
authored
fix(grid-summaries): themes params not fully working (#15531)
Closes #15477
1 parent 8dc0051 commit 9873bae

File tree

8 files changed

+112
-45
lines changed

8 files changed

+112
-45
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@types/source-map": "0.5.2",
7575
"express": "^4.21.1",
7676
"fflate": "^0.8.1",
77-
"igniteui-theming": "^16.0.0",
77+
"igniteui-theming": "^17.0.0",
7878
"igniteui-trial-watermark": "^3.0.2",
7979
"lodash-es": "^4.17.21",
8080
"rxjs": "^7.8.0",

projects/igniteui-angular/migrations/migration-collection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@
216216
"version": "19.1.1",
217217
"description": "Updates Ignite UI for Angular from v19.1.0 to v19.1.1",
218218
"factory": "./update-19_1_1"
219+
},
220+
"migration-44": {
221+
"version": "19.1.4",
222+
"description": "Updates Ignite UI for Angular from v19.1.0 to v19.1.4",
223+
"factory": "./update-19_1_4"
219224
}
220225
}
221226
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "../../common/schema/theme-changes.schema.json",
3+
"changes": [
4+
{
5+
"name": "$root-summaries-background",
6+
"remove": true,
7+
"owner": "grid-theme",
8+
"type": "property"
9+
},
10+
{
11+
"name": "$root-summaries-text-color",
12+
"remove": true,
13+
"owner": "grid-theme",
14+
"type": "property"
15+
},
16+
{
17+
"name": "$body-summaries-background",
18+
"remove": true,
19+
"owner": "grid-theme",
20+
"type": "property"
21+
},
22+
{
23+
"name": "$body-summaries-text-color",
24+
"remove": true,
25+
"owner": "grid-theme",
26+
"type": "property"
27+
}
28+
]
29+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import * as path from 'path';
2+
3+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
4+
import { setupTestTree } from '../common/setup.spec';
5+
6+
const version = '19.1.4';
7+
const themes = [
8+
'circular-theme'
9+
];
10+
const testFilePath = '/testSrc/appPrefix/component/${theme}.component.scss';
11+
12+
describe(`Update to ${version}`, () => {
13+
let appTree: UnitTestTree;
14+
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
15+
16+
beforeEach(() => {
17+
appTree = setupTestTree();
18+
});
19+
20+
const migrationName = 'migration-44';
21+
22+
it('should remove the summaries related properties from the grid theme', async () => {
23+
const testFilePath = `/testSrc/appPrefix/component/test.component.scss`;
24+
25+
appTree.create(
26+
testFilePath,
27+
`$my-grid-theme: grid-theme(
28+
$header-background: orange,
29+
$root-summaries-background: orange,
30+
$root-summaries-text-color: black,
31+
$body-summaries-background: orange,
32+
$body-summaries-text-color: black,
33+
);`
34+
);
35+
36+
const tree = await schematicRunner.runSchematic(migrationName, {}, appTree);
37+
38+
expect(tree.readContent(testFilePath)).toEqual(
39+
`$my-grid-theme: grid-theme(
40+
$header-background: orange,
41+
);`
42+
);
43+
});
44+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type {
2+
Rule,
3+
SchematicContext,
4+
Tree
5+
} from '@angular-devkit/schematics';
6+
import { UpdateChanges } from '../common/UpdateChanges';
7+
8+
const version = '19.1.4';
9+
10+
export default (): Rule => async (host: Tree, context: SchematicContext) => {
11+
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
12+
const update = new UpdateChanges(__dirname, host, context);
13+
update.applyChanges();
14+
};

projects/igniteui-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"tslib": "^2.3.0",
7474
"igniteui-trial-watermark": "^3.0.2",
7575
"lodash-es": "^4.17.21",
76-
"igniteui-theming": "^16.0.0",
76+
"igniteui-theming": "^17.0.0",
7777
"@igniteui/material-icons-extended": "^3.1.0"
7878
},
7979
"peerDependencies": {

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

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,8 @@
9090
/// @param {Color} $excel-filtering-actions-foreground [null] - The text color of the excel style filtering options.
9191
/// @param {Color} $excel-filtering-actions-hover-foreground [null] - The text color of the excel style filtering options in hover/focus state.
9292
/// @param {Color} $excel-filtering-actions-disabled-foreground [null] - The text color of the excel style filtering options in disabled state.
93-
/// @param {Color} $tree-filtered-text-color [null] - grouping row background color on focus.
94-
/// @param {Color} $body-summaries-background [null] - The background color of the summary groups located the body.
95-
/// @param {Color} $body-summaries-text-color [null] - The text color of the summary results located the body.
96-
/// @param {Color} $root-summaries-background [null] - The background color of the summary groups located the footer.
97-
/// @param {Color} $root-summaries-text-color [null] - The text color of the summary results located the footer.
93+
/// @param {Color} $tree-filtered-text-color [null] - Grouping row background color on focus.
94+
/// @param {Color} $summaries-patch-background [null] - The leading summaries patch backround. Used in hierarchical grids.
9895
/// @param {Color} $row-highlight [null] - The grid row highlight indication color.
9996
/// @param {box-shadow} $grid-shadow [null] - The shadow of the grid.
10097
/// @param {box-shadow} $drag-shadow [null] - The shadow used for movable elements (ex. column headers).
@@ -204,11 +201,6 @@
204201
$excel-filtering-actions-hover-foreground: null,
205202
$excel-filtering-actions-disabled-foreground: null,
206203
207-
$body-summaries-background: null,
208-
$body-summaries-text-color: null,
209-
$root-summaries-background: null,
210-
$root-summaries-text-color: null,
211-
212204
$row-highlight: null,
213205
$grid-shadow: null,
214206
$drag-shadow: null,
@@ -217,6 +209,7 @@
217209
$drop-area-border-radius: null,
218210
$grid-border-color: null,
219211
$sortable-header-icon-hover-color: null,
212+
$summaries-patch-background: null,
220213
221214
$cell-selected-within-background: null,
222215
$cell-selected-within-text-color: null,
@@ -434,14 +427,6 @@
434427
$filtering-row-text-color: text-contrast(to-opaque($filtering-row-background));
435428
}
436429

437-
@if not($body-summaries-text-color) and $body-summaries-background {
438-
$body-summaries-text-color: text-contrast($body-summaries-background);
439-
}
440-
441-
@if not($root-summaries-text-color) and $root-summaries-background {
442-
$root-summaries-text-color: text-contrast($root-summaries-background);
443-
}
444-
445430
@if not($grid-shadow) {
446431
$grid-elevation: map.get($grid-schema, 'grid-elevation');
447432
$grid-shadow: elevation($grid-elevation);
@@ -556,11 +541,6 @@
556541
tree-selected-filtered-row-text-color: $tree-selected-filtered-row-text-color,
557542
tree-selected-filtered-cell-text-color: $tree-selected-filtered-cell-text-color,
558543

559-
body-summaries-background: $body-summaries-background,
560-
body-summaries-text-color: $body-summaries-text-color,
561-
root-summaries-background: $root-summaries-background,
562-
root-summaries-text-color: $root-summaries-text-color,
563-
564544
row-highlight: $row-highlight,
565545
grid-shadow: $grid-shadow,
566546
drag-shadow: $drag-shadow,
@@ -569,6 +549,7 @@
569549
drop-area-border-radius: $drop-area-border-radius,
570550
sortable-header-icon-hover-color: $sortable-header-icon-hover-color,
571551
grid-border-color: $grid-border-color,
552+
summaries-patch-background: $summaries-patch-background,
572553

573554
cell-selected-within-background: $cell-selected-within-background,
574555
cell-selected-within-text-color: $cell-selected-within-text-color,
@@ -2286,37 +2267,31 @@
22862267
%grid-summaries {
22872268
display: flex;
22882269
overflow: hidden;
2289-
background: var-get($theme, 'root-summaries-background');
22902270
outline-style: none;
2291-
2292-
%igx-grid-summary__result {
2293-
color: var-get($theme, 'root-summaries-text-color');
2294-
}
2295-
2271+
background-color: var-get($theme, 'summaries-patch-background');
22962272
}
22972273

22982274
%grid-summaries--body {
2299-
background: var-get($theme, 'body-summaries-background');
2275+
--summaries-patch-background: var(--ig-gray-100);
2276+
23002277
border-bottom: rem(1px) dashed var-get($theme, 'row-border-color');
2278+
background-color: var-get($theme, 'summaries-patch-background');
23012279

23022280
&:last-of-type {
23032281
border-bottom: none;
23042282
}
23052283

2306-
%igx-grid-summary__result {
2307-
color: var-get($theme, 'body-summaries-text-color');
2284+
.igx-grid-summary {
2285+
--background-color: inherit;
2286+
--result-color: #{adaptive-contrast(var(--background-color))};
23082287
}
23092288
}
23102289

23112290
%grid-summaries-patch {
2312-
@if $bootstrap-theme {
2313-
background: color($color: 'gray', $variant: 100);
2314-
} @else {
2315-
background: inherit;
2316-
}
23172291
position: relative;
2318-
z-index: 1;
2292+
background: inherit;
23192293
border-inline-end: rem(1px) solid var-get($theme, 'header-border-color');
2294+
z-index: 1;
23202295

23212296
@if $variant == 'indigo' {
23222297
border-top: rem(1px) solid var-get($theme, 'header-border-color');
@@ -3199,7 +3174,7 @@
31993174
} @else {
32003175
background: color($color: 'surface', $variant: 500);
32013176
}
3202-
3177+
32033178
box-shadow: elevation(if($variant == 'indigo', if($theme-variant == 'light', 24, 23), 24));
32043179

32053180
@if $variant == 'material' or $variant == 'bootstrap' {

0 commit comments

Comments
 (0)