Skip to content

Commit 6bdd10f

Browse files
authored
Merge pull request #15925 from IgniteUI/20.0.x
Mass Merge 20.0.x to master
2 parents 5694a54 + 9953ebd commit 6bdd10f

File tree

106 files changed

+5569
-1265
lines changed

Some content is hidden

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

106 files changed

+5569
-1265
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
All notable changes for each version of this project will be documented in this file.
44

5+
## 20.0.2
6+
7+
### New Features
8+
- **Separating Button and Icon Button Themes** - The `button-theme` and `icon-button-theme` functions are still available, but for more targeted customization, you can now use the specific theme function for each button type.
9+
- **Component Themes Enchancements** - Component themes have been improved to automatically calculate all necessary states (e.g., hover, focus, active) based on just a few key values. For example, customizing a contained button requires only a background color:
10+
```scss
11+
$custom-contained-button: contained-button-theme(
12+
$background: #09f;
13+
);
14+
```
15+
516
## 20.0.0
617

718
### General

projects/igniteui-angular-elements/src/analyzer/elements.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ import { IgxGridToolbarComponent } from "../../../igniteui-angular/src/lib/grids
1414
import { IgxToolbarToken } from "../../../igniteui-angular/src/lib/grids/toolbar/token";
1515
import { IgxColumnComponent } from "../../../igniteui-angular/src/lib/grids/columns/column.component";
1616
import { IgxColumnGroupComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-group.component";
17+
import { IgxColumnLayoutComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-layout.component";
18+
import { IgxGridToolbarExporterComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-exporter.component";
19+
import { IgxGridToolbarHidingComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-hiding.component";
20+
import { IgxGridToolbarPinningComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-pinning.component";
1721
import { IgxRowIslandComponent } from "../../../igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component";
1822
import { IgxActionStripComponent } from "../../../igniteui-angular/src/lib/action-strip/action-strip.component";
1923
import { IgxActionStripToken } from "../../../igniteui-angular/src/lib/action-strip/token";
2024
import { IgxGridEditingActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component";
2125
import { IgxGridActionsBaseDirective } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive";
2226
import { IgxGridPinningActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component";
23-
import { IgxColumnLayoutComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-layout.component";
24-
import { IgxGridToolbarExporterComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-exporter.component";
25-
import { IgxGridToolbarHidingComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-hiding.component";
26-
import { IgxGridToolbarPinningComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-pinning.component";
2727
import { IgxGridStateComponent } from "../lib/state.component";
2828

2929
export const registerComponents = [

projects/igniteui-angular-elements/src/app/wrapper/wrapper.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export class TemplateWrapperComponent {
1616

1717
public templateFunctions: TemplateFunction[] = [];
1818
public templateRendered = new Subject<HTMLElement>();
19-
2019
private childParts: WeakMap<HTMLElement, RootPart> = new WeakMap();
2120

2221
/**
@@ -28,7 +27,7 @@ export class TemplateWrapperComponent {
2827
public templateRefs: QueryList<TemplateRef<any>>;
2928

3029
constructor(private cdr: ChangeDetectorRef) { }
31-
30+
3231
protected litRender(container: HTMLElement, templateFunc: (arg: any) => TemplateResult, arg: any) {
3332
const part = render(templateFunc(arg), container);
3433

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@
231231
"version": "20.0.0",
232232
"description": "Updates Ignite UI for Angular from v19.2.0 to v20.0.0",
233233
"factory": "./update-20_0_0"
234+
},
235+
"migration-47": {
236+
"version": "20.0.2",
237+
"description": "Updates Ignite UI for Angular from v20.0.0 to v20.0.2",
238+
"factory": "./update-20_0_2"
234239
}
235240
}
236241
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../../common/schema/theme-changes.schema.json",
3+
"changes": [
4+
{
5+
"name": "$interim-bottom-line-color",
6+
"remove": true,
7+
"owner": "input-group-theme",
8+
"type": "property"
9+
}
10+
]
11+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 = '20.0.2';
7+
8+
describe(`Update to ${version}`, () => {
9+
let appTree: UnitTestTree;
10+
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
11+
12+
beforeEach(() => {
13+
appTree = setupTestTree();
14+
});
15+
16+
const migrationName = 'migration-47';
17+
18+
it('should remove the $interim-bottom-line-color property from the input-group theme', async () => {
19+
const testFilePath = `/testSrc/appPrefix/component/test.component.scss`;
20+
21+
appTree.create(
22+
testFilePath,
23+
`$my-input-group-theme: input-group-theme(
24+
$box-background: #ccc,
25+
$interim-bottom-line-color: orange,
26+
);`
27+
);
28+
29+
const tree = await schematicRunner.runSchematic(migrationName, {}, appTree);
30+
31+
expect(tree.readContent(testFilePath)).toEqual(
32+
`$my-input-group-theme: input-group-theme(
33+
$box-background: #ccc,
34+
);`
35+
);
36+
});
37+
});
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 = '20.0.2';
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/src/lib/calendar/calendar.component.spec.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -596,18 +596,13 @@ describe("IgxCalendar - ", () => {
596596
By.css(`${HelperTestFunctions.CALENDAR_ROW_CSSCLASS}`),
597597
);
598598

599+
const expectedWeeks = ["W", "1", "2", "3", "4", "5", "6"];
600+
599601
calendarRows.forEach((row, idx) => {
600602
const firstRowItem = row.nativeElement.children[0];
601-
602-
if (idx === 0) {
603-
expect(firstRowItem.firstChild.innerText).toEqual(
604-
"W",
605-
);
606-
} else {
607-
expect(firstRowItem.firstChild.innerText).toEqual(
608-
idx.toString(),
609-
);
610-
}
603+
expect(firstRowItem.firstChild.innerText).toEqual(
604+
expectedWeeks[idx],
605+
);
611606
});
612607
});
613608

@@ -626,12 +621,7 @@ describe("IgxCalendar - ", () => {
626621
const firstRowItem = row.nativeElement.children[0];
627622
if (idx === 5) {
628623
expect(firstRowItem.firstChild.innerText).toEqual(
629-
"13",
630-
);
631-
}
632-
if (idx === 6) {
633-
expect(firstRowItem.firstChild.innerText).toEqual(
634-
"14",
624+
"12",
635625
);
636626
}
637627
});
@@ -648,7 +638,7 @@ describe("IgxCalendar - ", () => {
648638
const firstRowItem = row.nativeElement.children[0];
649639
if (idx === 5) {
650640
expect(firstRowItem.firstChild.innerText).toEqual(
651-
"44",
641+
"43",
652642
);
653643
}
654644
});
@@ -664,6 +654,7 @@ describe("IgxCalendar - ", () => {
664654
calendarRowsDec.forEach((row, idx) => {
665655
const firstRowItem = row.nativeElement.children[0];
666656
if (idx === 6) {
657+
// With simple counting for Sunday start, expect 53
667658
expect(firstRowItem.firstChild.innerText).toEqual(
668659
"53",
669660
);

projects/igniteui-angular/src/lib/calendar/common/model.spec.ts

Lines changed: 123 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ describe("Calendar Day Model", () => {
2020
const { year, month, date } = firstOfJan;
2121
expect([year, month, date]).toEqual([2024, 0, 1]);
2222

23-
// First week of 2024
23+
// First week of 2024 (ISO 8601 - January 1, 2024 is Monday, so Week 1)
2424
expect(firstOfJan.week).toEqual(1);
2525

26+
// Test week numbering with different week starts
27+
expect(firstOfJan.getWeekNumber(1)).toEqual(1); // Monday start (ISO 8601)
28+
expect(firstOfJan.getWeekNumber(0)).toBeGreaterThan(50); // Sunday start (belongs to prev year)
29+
2630
// 2024/01/01 is a Monday
2731
expect(firstOfJan.day).toEqual(1);
2832
expect(firstOfJan.weekend).toBeFalse();
@@ -79,6 +83,124 @@ describe("Calendar Day Model", () => {
7983
});
8084
});
8185

86+
describe("Week numbering", () => {
87+
it("should use ISO 8601 for Monday start and simple counting for others", () => {
88+
// January 1, 2025 is a Wednesday
89+
const jan1_2025 = new CalendarDay({ year: 2025, month: 0, date: 1 });
90+
expect(jan1_2025.day).toEqual(3); // Wednesday
91+
92+
// Monday start: Uses ISO 8601 standard
93+
expect(jan1_2025.getWeekNumber(1)).toEqual(1); // Week 1 contains Jan 1
94+
95+
// Sunday start: Uses simple counting - Jan 1 (Wed) belongs to prev year
96+
expect(jan1_2025.getWeekNumber(0)).toBeGreaterThan(50); // Week 52 of 2024
97+
});
98+
99+
it("should handle ISO 8601 year boundaries for Monday start", () => {
100+
// January 1, 2026 is a Thursday
101+
const jan1_2026 = new CalendarDay({ year: 2026, month: 0, date: 1 });
102+
expect(jan1_2026.day).toEqual(4); // Thursday
103+
104+
// Monday start: ISO 8601 logic applies
105+
expect(jan1_2026.getWeekNumber(1)).toEqual(1); // Week 1 of 2026
106+
});
107+
108+
it("should handle previous year's last week for Monday start", () => {
109+
// January 1, 2027 is a Friday
110+
const jan1_2027 = new CalendarDay({ year: 2027, month: 0, date: 1 });
111+
expect(jan1_2027.day).toEqual(5); // Friday
112+
113+
// Monday start: ISO 8601 logic - belongs to previous year
114+
const actualWeek = jan1_2027.getWeekNumber(1);
115+
expect(actualWeek).toBeGreaterThan(50); // Should be Week 52 or 53 of 2026
116+
});
117+
118+
it("should work correctly with custom week starts using appropriate logic", () => {
119+
const testDate = new CalendarDay({ year: 2024, month: 2, date: 15 }); // March 15, 2024 (Friday)
120+
121+
// Test different week start days
122+
const mondayStart = testDate.getWeekNumber(1); // ISO 8601
123+
const tuesdayStart = testDate.getWeekNumber(2); // Simple counting
124+
const wednesdayStart = testDate.getWeekNumber(3); // Simple counting
125+
const thursdayStart = testDate.getWeekNumber(4); // Simple counting
126+
const fridayStart = testDate.getWeekNumber(5); // Simple counting
127+
const saturdayStart = testDate.getWeekNumber(6); // Simple counting
128+
const sundayStart = testDate.getWeekNumber(0); // Simple counting
129+
130+
// All should be valid week numbers (positive integers)
131+
expect(mondayStart).toBeGreaterThan(0);
132+
expect(tuesdayStart).toBeGreaterThan(0);
133+
expect(wednesdayStart).toBeGreaterThan(0);
134+
expect(thursdayStart).toBeGreaterThan(0);
135+
expect(fridayStart).toBeGreaterThan(0);
136+
expect(saturdayStart).toBeGreaterThan(0);
137+
expect(sundayStart).toBeGreaterThan(0);
138+
});
139+
140+
it("should apply ISO 8601 logic only for Monday start", () => {
141+
// January 4, 2024 is a Thursday - always Week 1 in ISO 8601
142+
const jan4_2024 = new CalendarDay({ year: 2024, month: 0, date: 4 });
143+
expect(jan4_2024.day).toEqual(4); // Thursday
144+
145+
// Only Monday start uses ISO 8601
146+
expect(jan4_2024.getWeekNumber(1)).toEqual(1); // Monday start: ISO 8601
147+
148+
// Other starts use simple counting, so results may vary
149+
const sundayWeek = jan4_2024.getWeekNumber(0);
150+
const tuesdayWeek = jan4_2024.getWeekNumber(2);
151+
expect(sundayWeek).toBeGreaterThan(0);
152+
expect(tuesdayWeek).toBeGreaterThan(0);
153+
});
154+
155+
it("should handle December dates that belong to next year's Week 1 for Monday start", () => {
156+
// December 30, 2024 is a Monday
157+
const dec30_2024 = new CalendarDay({ year: 2024, month: 11, date: 30 });
158+
expect(dec30_2024.day).toEqual(1); // Monday
159+
160+
// Monday start: This should be Week 1 of 2025 in ISO 8601
161+
expect(dec30_2024.getWeekNumber(1)).toEqual(1); // Week 1 of 2025
162+
});
163+
164+
it("should default to Monday start when no parameter provided", () => {
165+
const testDate = new CalendarDay({ year: 2024, month: 0, date: 1 });
166+
167+
// Should default to Monday start (ISO 8601 standard)
168+
expect(testDate.getWeekNumber()).toEqual(testDate.getWeekNumber(1));
169+
expect(testDate.week).toEqual(testDate.getWeekNumber(1));
170+
});
171+
172+
it("should handle leap years correctly", () => {
173+
// Test February 29, 2024 (leap year)
174+
const feb29_2024 = new CalendarDay({ year: 2024, month: 1, date: 29 });
175+
expect(feb29_2024.day).toEqual(4); // Thursday
176+
177+
// Should calculate week number correctly for leap year date
178+
const weekNumber = feb29_2024.getWeekNumber(1);
179+
expect(weekNumber).toBeGreaterThan(0);
180+
expect(weekNumber).toBeLessThan(54); // Valid week range
181+
});
182+
183+
it("should correctly handle the January 2024 Sunday start case", () => {
184+
// January 1, 2024 is a Monday, with Sunday start (0)
185+
const jan1_2024 = new CalendarDay({ year: 2024, month: 0, date: 1 });
186+
const jan7_2024 = new CalendarDay({ year: 2024, month: 0, date: 7 }); // Sunday
187+
const jan8_2024 = new CalendarDay({ year: 2024, month: 0, date: 8 }); // Monday
188+
189+
expect(jan1_2024.day).toEqual(1); // Monday
190+
expect(jan7_2024.day).toEqual(0); // Sunday
191+
expect(jan8_2024.day).toEqual(1); // Monday
192+
193+
// With Sunday start, Jan 1 should be in previous year's last week
194+
expect(jan1_2024.getWeekNumber(0)).toBeGreaterThan(50); // Week 53 of 2023
195+
196+
// Jan 7 (first Sunday) should be Week 1
197+
expect(jan7_2024.getWeekNumber(0)).toEqual(1);
198+
199+
// Jan 8 should also be Week 1 (same week as Jan 7)
200+
expect(jan8_2024.getWeekNumber(0)).toEqual(1);
201+
});
202+
});
203+
82204
describe("Date ranges", () => {
83205
start = new CalendarDay({ year: 2024, month: 0, date: 11 });
84206
const endFuture = start.add("day", 7);

0 commit comments

Comments
 (0)