Skip to content

Commit

Permalink
fix(addon-table): fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
40oleg committed Mar 31, 2024
1 parent 223c252 commit db03843
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
9 changes: 6 additions & 3 deletions projects/addon-table/components/reorder/reorder.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Output,
} from '@angular/core';
import {TUI_TABLE_SHOW_HIDE_MESSAGE} from '@taiga-ui/addon-table/tokens';
import type {TuiContext} from '@taiga-ui/cdk';
import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';

import {TUI_REORDER_OPTIONS} from './reorder.options';
Expand All @@ -30,9 +31,6 @@ export class TuiReorderComponent<T> {
@Output()
public readonly enabledChange = new EventEmitter<T[]>();

@Input()
public container?: PolymorpheusContent;

protected order = new Map<number, number>();
protected unsortedItems: readonly T[] = [];
protected readonly options = inject(TUI_REORDER_OPTIONS);
Expand All @@ -48,6 +46,11 @@ export class TuiReorderComponent<T> {
}
}

@Input()
public content?: PolymorpheusContent<TuiContext<T> & {index: number}> = ({
$implicit,
}) => String($implicit);

@HostListener('focusout.stop')
protected noop(): void {}

Expand Down
2 changes: 0 additions & 2 deletions projects/addon-table/components/reorder/reorder.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
}

.t-draggable {
display: flex;
cursor: ns-resize;
align-items: center;
flex: 1 1 auto;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@
class="t-icon"
[src]="options.icons.drag"
/>
<ng-container
*polymorpheusOutlet="
container ? container : primitiveValue as template;
context: {$implicit: item, index: index}
"
>
<ng-container *polymorpheusOutlet="content as template; context: {$implicit: item, index: index}">
{{ template }}
</ng-container>
<ng-template #primitiveValue>{{ item }}</ng-template>
</div>
<button
appearance="icon"
Expand Down

0 comments on commit db03843

Please sign in to comment.