Skip to content

Commit 061341a

Browse files
CopilotMayaKirova
andauthored
fix(grid): Replace large theme.css with angular.json bundled alternate theme; add OnDestroy cleanup
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-angular/sessions/12bdcdf6-0c85-490e-b44e-497f597e2474 Co-authored-by: MayaKirova <10397980+MayaKirova@users.noreply.github.com>
1 parent 23ce4df commit 061341a

5 files changed

Lines changed: 57 additions & 15205 deletions

File tree

angular.json

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@
2222
},
2323
"index": "src/index.html",
2424
"polyfills": [
25-
"zone.js"
25+
"zone.js"
2626
],
2727
"tsConfig": "src/tsconfig.app.json",
2828
"assets": [
2929
"src/favicon.ico",
3030
"src/assets",
31-
"src/web.config",
32-
{
33-
"glob": "theme.css",
34-
"input": "src/app/grid-cellMerging",
35-
"output": "assets/grid-cellMerging"
36-
}
31+
"src/web.config"
3732
],
3833
"styles": [
39-
"src/styles/styles.scss"
34+
"src/styles/styles.scss",
35+
{
36+
"input": "src/styles/grid-cell-merging-alternate-theme.scss",
37+
"bundleName": "grid-cell-merging-alternate-theme",
38+
"inject": false
39+
}
4040
],
4141
"scripts": [],
4242
"extractLicenses": false,
@@ -211,8 +211,8 @@
211211
"tsConfig": "projects/igniteui-angular/tsconfig.spec.json",
212212
"karmaConfig": "projects/igniteui-angular/karma.conf.js",
213213
"exclude": [
214-
"migrations",
215-
"schematics"
214+
"migrations",
215+
"schematics"
216216
]
217217
}
218218
},
@@ -297,11 +297,19 @@
297297
"projects/igniteui-angular-elements/src/styles.scss"
298298
],
299299
"scripts": [
300-
{ "input": "./node_modules/lit-html/lit-html.js", "inject": false },
301-
{ "input": "./node_modules/lit-html/development/directive.js", "inject": false }
300+
{
301+
"input": "./node_modules/lit-html/lit-html.js",
302+
"inject": false
303+
},
304+
{
305+
"input": "./node_modules/lit-html/development/directive.js",
306+
"inject": false
307+
}
302308
],
303309
"stylePreprocessorOptions": {
304-
"includePaths": ["node_modules"]
310+
"includePaths": [
311+
"node_modules"
312+
]
305313
},
306314
"browser": "projects/igniteui-angular-elements/src/main.ts"
307315
},
@@ -333,7 +341,10 @@
333341
],
334342
"outputHashing": "none",
335343
"optimization": true,
336-
"externalDependencies": ["lit", "igniteui-i18n-core"]
344+
"externalDependencies": [
345+
"lit",
346+
"igniteui-i18n-core"
347+
]
337348
},
338349
"development": {
339350
"optimization": false,
@@ -342,8 +353,8 @@
342353
"namedChunks": true
343354
},
344355
"dev-app": {
345-
"browser": "projects/igniteui-angular-elements/src/main.app.ts",
346-
"tsConfig": "projects/igniteui-angular-elements/tsconfig.app.json"
356+
"browser": "projects/igniteui-angular-elements/src/main.app.ts",
357+
"tsConfig": "projects/igniteui-angular-elements/tsconfig.app.json"
347358
}
348359
},
349360
"defaultConfiguration": "production"
@@ -370,7 +381,7 @@
370381
"builder": "@angular/build:karma",
371382
"options": {
372383
"main": "projects/igniteui-angular-elements/src/test.ts",
373-
"polyfills": [
384+
"polyfills": [
374385
"projects/igniteui-angular-elements/src/polyfills.ts"
375386
],
376387
"tsConfig": "projects/igniteui-angular-elements/tsconfig.spec.json",
@@ -384,7 +395,9 @@
384395
"projects/igniteui-angular-elements/src/styles.scss"
385396
],
386397
"stylePreprocessorOptions": {
387-
"includePaths": ["node_modules"]
398+
"includePaths": [
399+
"node_modules"
400+
]
388401
},
389402
"scripts": []
390403
}
@@ -523,7 +536,9 @@
523536
"projects/igniteui-angular-performance/src/styles.scss"
524537
],
525538
"stylePreprocessorOptions": {
526-
"includePaths": ["node_modules"]
539+
"includePaths": [
540+
"node_modules"
541+
]
527542
}
528543
},
529544
"configurations": {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,8 @@
13721372
}
13731373

13741374
%igx-grid__tr--merged {
1375-
border-block-end: 0 !important;
1375+
border-bottom: 0;
1376+
border-block-end: 0;
13761377
}
13771378

13781379
%igx-grid__tr--merged-top {

src/app/grid-cellMerging/grid-cellMerging.component.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ViewChild, inject, signal } from '@angular/core';
1+
import { Component, OnDestroy, ViewChild, inject, signal } from '@angular/core';
22
import { DOCUMENT } from '@angular/common';
33
import { FormsModule } from '@angular/forms';
44
import {
@@ -57,9 +57,10 @@ import { INVOICE_DATA } from '../shared/invoiceData';
5757
IgxIconButtonDirective
5858
]
5959
})
60-
export class GridCellMergingComponent {
60+
export class GridCellMergingComponent implements OnDestroy {
6161
private readonly document = inject(DOCUMENT);
6262
public themeLoaded = signal(false);
63+
private readonly THEME_LINK_ID = 'grid-cell-merging-alternate-theme';
6364
public hierarchicalData = HIERARCHICAL_DATA.concat(HIERARCHICAL_DATA).concat(HIERARCHICAL_DATA);
6465
public treeData = HIERARCHICAL_SAMPLE_DATA;
6566
public treeGridMergeStrategy = new ByLevelTreeGridMergeStrategy();
@@ -80,17 +81,20 @@ export class GridCellMergingComponent {
8081
this.data = allData;
8182
}
8283

84+
public ngOnDestroy(): void {
85+
this.document.getElementById(this.THEME_LINK_ID)?.remove();
86+
}
87+
8388
public toggleTheme(): void {
84-
const id = 'grid-cell-merging-theme';
85-
const existing = this.document.getElementById(id);
89+
const existing = this.document.getElementById(this.THEME_LINK_ID);
8690
if (existing) {
8791
existing.remove();
8892
this.themeLoaded.set(false);
8993
} else {
9094
const link = this.document.createElement('link');
9195
link.rel = 'stylesheet';
92-
link.href = 'assets/grid-cellMerging/theme.css';
93-
link.id = id;
96+
link.href = 'grid-cell-merging-alternate-theme.css';
97+
link.id = this.THEME_LINK_ID;
9498
this.document.head.appendChild(link);
9599
this.themeLoaded.set(true);
96100
}

0 commit comments

Comments
 (0)