Skip to content

Commit

Permalink
fix(addon-table): drop legacy package dependency (#9373)
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea authored Oct 7, 2024
1 parent 47d7178 commit 1171fbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions projects/addon-table/components/table/td/td.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {ChangeDetectionStrategy, Component, ContentChild} from '@angular/core';
import {TuiControl} from '@taiga-ui/cdk/classes';
import {AbstractTuiControl} from '@taiga-ui/legacy/classes';

@Component({
standalone: true,
Expand All @@ -9,13 +8,10 @@ import {AbstractTuiControl} from '@taiga-ui/legacy/classes';
styleUrls: ['./td.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
'[class._editable]': 'current || legacy',
'[class._editable]': 'control',
},
})
export class TuiTableTd {
@ContentChild(TuiControl)
protected readonly current: unknown;

@ContentChild(AbstractTuiControl)
protected readonly legacy: unknown;
protected readonly control: unknown;
}
6 changes: 3 additions & 3 deletions projects/legacy/classes/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ChangeDetectorRef, DestroyRef, Directive, inject, Input} from '@angular/
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import type {AbstractControl, ControlValueAccessor} from '@angular/forms';
import {NgControl, NgModel} from '@angular/forms';
import {TuiValueTransformer} from '@taiga-ui/cdk/classes';
import {TuiControl, TuiValueTransformer} from '@taiga-ui/cdk/classes';
import {EMPTY_FUNCTION} from '@taiga-ui/cdk/constants';
import {tuiIsPresent, tuiProvide} from '@taiga-ui/cdk/utils/miscellaneous';
import {
Expand Down Expand Up @@ -255,6 +255,6 @@ export abstract class AbstractTuiControl<T>
}
}

export function tuiAsControl<T>(control: Type<AbstractTuiControl<T>>): Provider {
return tuiProvide(AbstractTuiControl, control);
export function tuiAsControl<T>(control: Type<AbstractTuiControl<T>>): Provider[] {
return [tuiProvide(AbstractTuiControl, control), tuiProvide(TuiControl, control)];
}

0 comments on commit 1171fbc

Please sign in to comment.