Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(design)!: remove color property from DaffPaginatorComponent #2873

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions libs/design/paginator/src/paginator-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
}
}
20 changes: 2 additions & 18 deletions libs/design/paginator/src/paginator/paginator.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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
Expand All @@ -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;
}
Expand Down
Loading