From 5c91c6e8d06f475cb0c5b4e6a0050833b866113d Mon Sep 17 00:00:00 2001 From: Elain T Date: Fri, 14 Jun 2024 12:00:53 -0600 Subject: [PATCH] feat(design)!: remove `color` property from `DaffPaginatorComponent` (#2873) BREAKING CHANGE: The `color` property has been removed from the codebase. Paginators are no longer themable. --- .../design/paginator/src/paginator-theme.scss | 55 ------------------- .../src/paginator/paginator.component.ts | 20 +------ 2 files changed, 2 insertions(+), 73 deletions(-) diff --git a/libs/design/paginator/src/paginator-theme.scss b/libs/design/paginator/src/paginator-theme.scss index dc674b2a0d..67f51bdae2 100644 --- a/libs/design/paginator/src/paginator-theme.scss +++ b/libs/design/paginator/src/paginator-theme.scss @@ -2,19 +2,6 @@ @use '../../scss/core'; @use '../../scss/theming'; -@mixin daff-paginator-theme-variant($active-color) { - color: currentColor; - - &:hover, - &.selected { /* stylelint-disable-line selector-class-pattern */ - color: theming.daff-text-contrast($active-color); - - &:after { - background: $active-color; - } - } -} - @mixin daff-paginator-theme($theme) { $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); @@ -44,47 +31,5 @@ } } } - - &.daff-primary { - .daff-paginator__page-link { - @include daff-paginator-theme-variant(theming.daff-color($primary)); - } - } - - &.daff-secondary { - .daff-paginator__page-link { - @include daff-paginator-theme-variant(theming.daff-color($secondary)); - } - } - - &.daff-tertiary { - .daff-paginator__page-link { - @include daff-paginator-theme-variant(theming.daff-color($tertiary)); - } - } - - &.daff-theme { - .daff-paginator__page-link { - @include daff-paginator-theme-variant($base); - } - } - - &.daff-theme-contrast { - .daff-paginator__page-link { - @include daff-paginator-theme-variant($base-contrast); - } - } - - &.daff-black { - .daff-paginator__page-link { - @include daff-paginator-theme-variant($black); - } - } - - &.daff-white { - .daff-paginator__page-link { - @include daff-paginator-theme-variant($white); - } - } } } diff --git a/libs/design/paginator/src/paginator/paginator.component.ts b/libs/design/paginator/src/paginator/paginator.component.ts index 3a5d22e387..934f1f7421 100644 --- a/libs/design/paginator/src/paginator/paginator.component.ts +++ b/libs/design/paginator/src/paginator/paginator.component.ts @@ -25,18 +25,6 @@ import { DaffPaginatorPageOutOfRangeErrorMessage, } from '../utils/paginator-errors'; -/** - * An _elementRef and an instance of renderer2 are needed for the Colorable mixin - */ -class DaffPaginatorBase { - constructor(public _elementRef: ElementRef, public _renderer: Renderer2) {} -} - -/** - * @deprecated in v1.0.0 - */ -const _daffPaginatorBase = daffColorMixin(DaffPaginatorBase); - const visiblePageRange = 2; /** @@ -46,12 +34,9 @@ const visiblePageRange = 2; selector: 'daff-paginator', styleUrls: ['./paginator.component.scss'], templateUrl: './paginator.component.html', - //todo(damienwebdev): remove once decorators hit stage 3 - https://github.com/microsoft/TypeScript/issues/7342 - // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property - inputs: ['color'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class DaffPaginatorComponent extends _daffPaginatorBase implements OnChanges, DaffColorable { +export class DaffPaginatorComponent implements OnChanges { /** * @docs-private @@ -76,8 +61,7 @@ export class DaffPaginatorComponent extends _daffPaginatorBase implements OnChan */ _paginatorId: string; - constructor(private elementRef: ElementRef, private renderer: Renderer2) { - super(elementRef, renderer); + constructor(private elementRef: ElementRef) { const ariaLabel = elementRef.nativeElement.attributes['aria-label']; this._paginatorId = ariaLabel ? ariaLabel.nodeValue : null; }