Skip to content

Commit f24e7cb

Browse files
authored
Merge pull request #15120 from IgniteUI/19.0.x
Mass Merge 19.0.x to master
2 parents 0d44a2d + 88995e0 commit f24e7cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+517
-364
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,27 @@ All notable changes for each version of this project will be documented in this
1515
### New Features
1616
- `IgxColumn`
1717
- Introduced the `disabledSummaries` property, allowing users to specify which summaries should be disabled for a given column. This property accepts an array of strings corresponding to the summary keys, enabling selective control over both default summaries (e.g., 'Count', 'Min') and any custom summaries created by the user.
18+
- `Themes`
19+
- **Deprecation** The utility mixins `light-theme`, `dark-theme`, `bootstrap-light-theme`, `bootstrap-dark-theme`, `fluent-light-theme`, `fluent-dark-theme`, `indigo-light-theme`, and `indigo-dark-theme` have been deprecated and will be removed in version 20 of Ignite UI for Angular. Switch to the more generic `theme` mixin instead.
20+
Example:
21+
```scss
22+
$my-light-palette: palette(
23+
$primary: navy,
24+
$secondary: rebeccapurple,
25+
$surface: white,
26+
);
27+
28+
// Before:
29+
@include light-theme(
30+
$palette: $my-light-palette
31+
);
32+
33+
// After:
34+
@include theme(
35+
$palette: $my-light-palette,
36+
$schema: $light-material-schema,
37+
);
38+
```
1839

1940
## 18.2.0
2041
### General

package-lock.json

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

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@
8585
"devDependencies": {
8686
"@angular-devkit/build-angular": "^19.0.0",
8787
"@angular-devkit/schematics": "^19.0.0",
88-
"@angular-eslint/builder": "^19.0.0-alpha.1",
89-
"@angular-eslint/eslint-plugin": "^19.0.0-alpha.1",
90-
"@angular-eslint/eslint-plugin-template": "^19.0.0-alpha.1",
91-
"@angular-eslint/schematics": "^19.0.0-alpha.1",
92-
"@angular-eslint/template-parser": "^19.0.0-alpha.1",
88+
"@angular-eslint/builder": "^19.0.0",
89+
"@angular-eslint/eslint-plugin": "^19.0.0",
90+
"@angular-eslint/eslint-plugin-template": "^19.0.0",
91+
"@angular-eslint/schematics": "^19.0.0",
92+
"@angular-eslint/template-parser": "^19.0.0",
9393
"@angular/cli": "^19.0.0",
9494
"@angular/compiler-cli": "^19.0.0",
9595
"@angular/language-service": "^19.0.0",

projects/igniteui-angular/src/lib/avatar/avatar.component.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,28 @@ describe('Avatar', () => {
170170

171171
expect(instance.src).toEqual("/assets/Test%20-%2017.jpg");
172172
});
173+
174+
it('should not throw error if src is null', () => {
175+
const fixture = TestBed.createComponent(InitImageAvatarComponent);
176+
fixture.detectChanges();
177+
expect(() => {
178+
const instance = fixture.componentInstance.avatar;
179+
instance.src = null;
180+
fixture.detectChanges();
181+
}).not.toThrow();
182+
});
183+
184+
it('avatar with [src] and fallback [initials] should not throw error if src is null', () => {
185+
const fixture = TestBed.createComponent(AvatarWithAttribsComponent);
186+
fixture.detectChanges();
187+
const instance = fixture.componentInstance.avatar;
188+
expect(instance.type).toEqual(IgxAvatarType.INITIALS);
189+
expect(instance.initials).toEqual('ZK');
190+
expect(() => {
191+
instance.src = null;
192+
fixture.detectChanges();
193+
}).not.toThrow();
194+
});
173195
});
174196

175197
@Component({

projects/igniteui-angular/src/lib/card/card.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ describe('Card', () => {
6868
InitCardComponent,
6969
InitOutlinedCardComponent,
7070
CardWithHeaderComponent,
71+
CardContentIconComponent,
7172
VerticalCardComponent,
7273
HorizontalCardComponent
7374
]
@@ -182,6 +183,16 @@ describe('Card', () => {
182183
expect(actions).not.toHaveClass(classes.actions.vertical);
183184
});
184185

186+
it('Should use Material Icons font-family for igx-icon in card content', () => {
187+
const fixture = TestBed.createComponent(CardContentIconComponent);
188+
fixture.detectChanges();
189+
190+
const iconElement = fixture.debugElement.query(By.css('igx-icon')).nativeElement;
191+
const computedStyle = window.getComputedStyle(iconElement);
192+
193+
expect(computedStyle.fontFamily).toBe('"Material Icons"');
194+
});
195+
185196
it('Should automatically align actions vertically when in horizontal layout', () => {
186197
const fixture = TestBed.createComponent(HorizontalCardComponent);
187198
fixture.detectChanges();
@@ -246,6 +257,16 @@ class InitOutlinedCardComponent {
246257
})
247258
class CardWithHeaderComponent { }
248259

260+
@Component({
261+
template: `<igx-card class="ig-typography">
262+
<igx-card-content>
263+
<igx-icon>face</igx-icon>
264+
</igx-card-content>
265+
<igx-card>`,
266+
imports: [IgxCardComponent, IgxCardContentDirective, IgxIconComponent]
267+
})
268+
class CardContentIconComponent { }
269+
249270
@Component({
250271
template: `<igx-card>
251272
<igx-card-media width="200px" height="50%">

projects/igniteui-angular/src/lib/carousel/carousel.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgIf, NgClass, NgFor, NgTemplateOutlet } from '@angular/common';
1+
import { NgIf, NgClass, NgFor, NgTemplateOutlet, DOCUMENT } from '@angular/common';
22
import {
33
AfterContentInit,
44
ChangeDetectorRef,
@@ -583,7 +583,8 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
583583
private iterableDiffers: IterableDiffers,
584584
@Inject(IgxAngularAnimationService) animationService: AnimationService,
585585
private platformUtil: PlatformUtil,
586-
private dir: IgxDirectionality
586+
private dir: IgxDirectionality,
587+
@Inject(DOCUMENT) private document: any
587588
) {
588589
super(animationService, cdr);
589590
this.differ = this.iterableDiffers.find([]).create(null);
@@ -1002,7 +1003,7 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
10021003
}
10031004

10041005
private focusElement() {
1005-
const focusedElement = document.activeElement;
1006+
const focusedElement = this.document.activeElement;
10061007

10071008
if (focusedElement.classList.contains('igx-carousel-indicators__indicator')) {
10081009
this.indicatorsElements[this.current].nativeElement.focus();

projects/igniteui-angular/src/lib/checkbox/checkbox.component.ts

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ import {
1414
Self,
1515
booleanAttribute,
1616
inject,
17-
DestroyRef
17+
DestroyRef,
18+
Inject
1819
} from '@angular/core';
1920
import { ControlValueAccessor, NgControl, Validators } from '@angular/forms';
2021
import { IgxRippleDirective } from '../directives/ripple/ripple.directive';
21-
import { IBaseEventArgs, mkenum } from '../core/utils';
22+
import { IBaseEventArgs, getComponentTheme, mkenum } from '../core/utils';
2223
import { EditorProvider, EDITOR_PROVIDER } from '../core/edit-provider';
23-
import { noop, Subject, Subscription } from 'rxjs';
24+
import { noop, Subject } from 'rxjs';
2425
import { takeUntil } from 'rxjs/operators';
25-
import { IgxTheme, ThemeService } from '../services/theme/theme.service';
26+
import { IgxTheme, THEME_TOKEN, ThemeToken } from '../services/theme/theme.token';
2627

2728
export const LabelPosition = /*@__PURE__*/mkenum({
2829
BEFORE: 'before',
@@ -492,28 +493,40 @@ export class IgxCheckboxComponent implements EditorProvider, AfterViewInit, Cont
492493
*/
493494
private _required = false;
494495
private elRef = inject(ElementRef);
495-
private _theme$ = new Subject<IgxTheme>();
496-
private _subscription: Subscription;
497496
private destroyRef = inject(DestroyRef);
498497

499498
constructor(
500499
protected cdr: ChangeDetectorRef,
501500
protected renderer: Renderer2,
502-
protected themeService: ThemeService,
501+
@Inject(THEME_TOKEN)
502+
protected themeToken: ThemeToken,
503503
@Optional() @Self() public ngControl: NgControl,
504504
) {
505505
if (this.ngControl !== null) {
506506
this.ngControl.valueAccessor = this;
507507
}
508508

509-
this.theme = this.themeService.globalTheme;
509+
this.theme = this.themeToken.theme;
510510

511-
this._subscription = this._theme$.asObservable().subscribe(value => {
512-
this.theme = value as IgxTheme;
513-
this.cdr.detectChanges();
511+
const { unsubscribe } = this.themeToken.onChange((theme) => {
512+
if (this.theme !== theme) {
513+
this.theme = theme;
514+
this.cdr.detectChanges();
515+
}
514516
});
515517

516-
this.destroyRef.onDestroy(() => this._subscription.unsubscribe());
518+
this.destroyRef.onDestroy(() => unsubscribe);
519+
}
520+
521+
private setComponentTheme() {
522+
if(!this.themeToken.preferToken) {
523+
const theme = getComponentTheme(this.elRef.nativeElement);
524+
525+
if (theme && theme !== this.theme) {
526+
this.theme = theme;
527+
this.cdr.markForCheck();
528+
}
529+
}
517530
}
518531

519532
/**
@@ -530,12 +543,7 @@ export class IgxCheckboxComponent implements EditorProvider, AfterViewInit, Cont
530543
}
531544
}
532545

533-
const theme = this.themeService.getComponentTheme(this.elRef);
534-
535-
if (theme) {
536-
this._theme$.next(theme);
537-
this.cdr.markForCheck();
538-
}
546+
this.setComponentTheme();
539547
}
540548

541549
/** @hidden @internal */

0 commit comments

Comments
 (0)