From 37df2105843125edb80b3011777afdc05fd88f66 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Thu, 3 Apr 2025 16:03:02 +0300 Subject: [PATCH 1/2] refactor(calendar): remove unused params --- .../update-19_2_0/changes/theme-changes.json | 24 +++++++++++++ .../migrations/update-19_2_0/index.spec.ts | 20 +++++++++++ .../components/calendar/_calendar-theme.scss | 35 ------------------- 3 files changed, 44 insertions(+), 35 deletions(-) diff --git a/projects/igniteui-angular/migrations/update-19_2_0/changes/theme-changes.json b/projects/igniteui-angular/migrations/update-19_2_0/changes/theme-changes.json index 2f0e4aac656..093539707cf 100644 --- a/projects/igniteui-angular/migrations/update-19_2_0/changes/theme-changes.json +++ b/projects/igniteui-angular/migrations/update-19_2_0/changes/theme-changes.json @@ -30,6 +30,30 @@ "remove": true, "owner": "switch-theme", "type": "property" + }, + { + "name": "$date-selected-current-outline", + "remove": true, + "owner": "calendar-theme", + "type": "property" + }, + { + "name": "$date-selected-current-hover-outline", + "remove": true, + "owner": "calendar-theme", + "type": "property" + }, + { + "name": "$date-selected-current-focus-outline", + "remove": true, + "owner": "calendar-theme", + "type": "property" + }, + { + "name": "$date-special-current-border-color", + "remove": true, + "owner": "calendar-theme", + "type": "property" } ] } diff --git a/projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts b/projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts index a65cde1c1ba..36a872504d0 100644 --- a/projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts +++ b/projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts @@ -58,4 +58,24 @@ describe(`Update to ${version}`, () => { );` ); }); + + it('should remove unused properties from the calendar theme', async () => { + const testFilePath = `/testSrc/appPrefix/component/test.component.scss`; + + appTree.create( + testFilePath, + `$calendar-theme: calendar-theme( + $date-special-current-border-color: orange, + $date-selected-current-outline: orange, + $date-selected-current-hover-outline: orange, + $date-selected-current-focus-outline: orange, + );` + ); + + const tree = await schematicRunner.runSchematic(migrationName, {}, appTree); + + expect(tree.readContent(testFilePath)).toEqual( + `$calendar-theme: calendar-theme();` + ); + }); }); diff --git a/projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-theme.scss b/projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-theme.scss index 88dce836976..1ade53b3f2e 100644 --- a/projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-theme.scss +++ b/projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-theme.scss @@ -108,10 +108,6 @@ /// @param {Color} $date-selected-current-range-focus-foreground [null] - The :focus foreground of the current date in the selected range. /// @param {Color} $date-selected-current-range-focus-background [null] - The :focus background of the current date in the selected range. /// -/// @param {Color} $date-selected-current-outline [null] - The outline of the current selected date. -/// @param {Color} $date-selected-current-hover-outline [null] - The :hover outline of the current selected date. -/// @param {Color} $date-selected-current-focus-outline [null] - The :focus outline of the current selected date. -/// /// @param {Color} $date-selected-special-border-color: [null] - The border color of the selected special date, /// @param {Color} $date-selected-special-hover-border-color: [null] - The :hover border color of the selected special date, /// @param {Color} $date-selected-special-focus-border-color: [null] - The :focus border color of the selected special date, @@ -137,8 +133,6 @@ /// @param {Color} $date-special-range-foreground [null] - The foreground of the dates inside a range and marked as special. /// @param {Color} $date-special-range-border-color [null] - The outline of the dates inside a range and marked as special. /// -/// @param {Color} $date-special-current-border-color [null] - The outline color of a special current date. -/// /// @param {Color} $border-color [null] - The calendar border color. /// /// @param {Color} $date-border-color [null] - The border color of the date. @@ -282,10 +276,6 @@ $date-selected-current-hover-border-color: null, $date-selected-current-focus-border-color: null, - $date-selected-current-outline: null, - $date-selected-current-hover-outline: null, - $date-selected-current-focus-outline: null, - $date-selected-special-border-color: null, $date-selected-special-hover-border-color: null, $date-selected-special-focus-border-color: null, @@ -310,7 +300,6 @@ $date-special-range-focus-background: null, $date-special-range-foreground: null, $date-special-range-border-color: null, - $date-special-current-border-color: null, $date-disabled-foreground: null, $date-disabled-range-foreground: null, @@ -400,26 +389,6 @@ } } - @if $variant == 'material' or $variant == 'indigo' { - @if not($date-selected-current-outline) and $content-background { - @if meta.type-of($content-background) == 'color' { - $date-selected-current-outline: $content-background; - } - } - - @if not($date-selected-current-hover-outline) and $content-background { - @if meta.type-of($content-background) == 'color' { - $date-selected-current-hover-outline: $content-background; - } - } - - @if not($date-selected-current-focus-outline) and $content-background { - @if meta.type-of($content-background) == 'color' { - $date-selected-current-focus-outline: $content-background; - } - } - } - @if not($content-foreground) and $content-background { @if meta.type-of($content-background) == 'color' { $content-foreground: text-contrast($content-background); @@ -640,10 +609,6 @@ date-selected-current-hover-foreground: $date-selected-current-hover-foreground, date-selected-current-focus-foreground: $date-selected-current-focus-foreground, - date-selected-current-outline: $date-selected-current-outline, - date-selected-current-hover-outline: $date-selected-current-hover-outline, - date-selected-current-focus-outline: $date-selected-current-focus-outline, - date-selected-special-border-color: $date-selected-special-border-color, date-selected-special-hover-border-color: $date-selected-special-hover-border-color, date-selected-special-focus-border-color: $date-selected-special-focus-border-color, From 5ae3d8c1b217c3b1fc34fbbe08de081875a11309 Mon Sep 17 00:00:00 2001 From: desig9stein Date: Thu, 3 Apr 2025 17:33:26 +0300 Subject: [PATCH 2/2] chore(calendar): fix migrations --- .../igniteui-angular/migrations/update-19_2_0/index.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts b/projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts index 36a872504d0..46fd2eaba8c 100644 --- a/projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts +++ b/projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts @@ -69,13 +69,16 @@ describe(`Update to ${version}`, () => { $date-selected-current-outline: orange, $date-selected-current-hover-outline: orange, $date-selected-current-focus-outline: orange, + $content-background: black );` ); const tree = await schematicRunner.runSchematic(migrationName, {}, appTree); expect(tree.readContent(testFilePath)).toEqual( - `$calendar-theme: calendar-theme();` + `$calendar-theme: calendar-theme( + $content-background: black + );` ); }); });