Skip to content

Commit

Permalink
feat(kit): review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
al-march authored and splincode committed Sep 23, 2024
1 parent b15a38a commit 9156cb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 6 additions & 3 deletions projects/kit/directives/highlight/highlight.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import {ResizeObserverService} from '@ng-web-apis/resize-observer';
import {svgNodeFilter} from '@taiga-ui/cdk/constants';
import {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';
import {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous';
import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';

import {TUI_HIGHLIGHT_OPTIONS} from './highlight.options';
export const [TUI_HIGHLIGHT_OPTIONS, tuiHighlightOptionsProvider] = tuiCreateOptions({
highlightColor: 'var(--tui-service-selection-background)',
});

@Directive({
standalone: true,
Expand All @@ -22,7 +25,7 @@ export class TuiHighlight implements OnChanges {
private readonly el = tuiInjectElement();
private readonly renderer = inject(Renderer2);
private readonly doc = inject(DOCUMENT);
private readonly options = inject(TUI_HIGHLIGHT_OPTIONS);

private readonly highlight: HTMLElement = this.setUpHighlight();
private readonly treeWalker = this.doc.createTreeWalker(
this.el,
Expand All @@ -34,7 +37,7 @@ export class TuiHighlight implements OnChanges {
public tuiHighlight = '';

@Input()
public tuiHighlightColor = this.options.highlightColor;
public tuiHighlightColor = inject(TUI_HIGHLIGHT_OPTIONS).highlightColor;

constructor() {
inject(ResizeObserverService, {self: true})
Expand Down
5 changes: 0 additions & 5 deletions projects/kit/directives/highlight/highlight.options.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/kit/directives/highlight/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './highlight.directive';
export * from './highlight.options';

0 comments on commit 9156cb0

Please sign in to comment.