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(core)!: Alert refactor to not require module imports #6670

Merged
merged 6 commits into from
Feb 5, 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {TUI_IS_IOS, TuiDialog} from '@taiga-ui/cdk';
import {TUI_IS_IOS, TuiPopover} from '@taiga-ui/cdk';
import {POLYMORPHEUS_CONTEXT} from '@tinkoff/ng-polymorpheus';

import {TuiMobileDialogOptions} from './mobile-dialog.options';
Expand All @@ -17,7 +17,7 @@ export class TuiMobileDialogComponent<I> {
constructor(
@Inject(TUI_IS_IOS) readonly isIOS: boolean,
@Inject(POLYMORPHEUS_CONTEXT)
readonly context: TuiDialog<TuiMobileDialogOptions<I>, number>,
readonly context: TuiPopover<TuiMobileDialogOptions<I>, number>,
) {}

onAction(index: number): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {inject, Injectable} from '@angular/core';
import {TuiBaseDialogContext, TuiPopoverService} from '@taiga-ui/cdk';
import {TuiPopoverContext, TuiPopoverService} from '@taiga-ui/cdk';
import {TUI_DIALOGS} from '@taiga-ui/core';
import {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';
import {Observable} from 'rxjs';
Expand All @@ -22,7 +22,7 @@ export class TuiMobileDialogService extends TuiPopoverService<
> {
override open(
content: PolymorpheusContent<
TuiBaseDialogContext<number> & TuiMobileDialogOptions<any>
TuiMobileDialogOptions<any> & TuiPopoverContext<number>
>,
options: Partial<TuiMobileDialogOptions<any>> = {},
): Observable<number> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ViewChild,
ViewChildren,
} from '@angular/core';
import {EMPTY_QUERY, TuiDialog, tuiPure} from '@taiga-ui/cdk';
import {EMPTY_QUERY, TuiPopover, tuiPure} from '@taiga-ui/cdk';
import {
TUI_ANIMATIONS_SPEED,
TUI_CLOSE_WORD,
Expand Down Expand Up @@ -67,7 +67,7 @@ export class TuiSheetDialogComponent<I> implements AfterViewInit {
@Inject(TUI_COMMON_ICONS) readonly icons: TuiCommonIcons,
@Inject(TUI_CLOSE_WORD) readonly closeWord$: Observable<string>,
@Inject(POLYMORPHEUS_CONTEXT)
readonly context: TuiDialog<TuiSheetDialogOptions<I>, any>,
readonly context: TuiPopover<TuiSheetDialogOptions<I>, any>,
) {}

@HostBinding('style.top.px')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Inject,
ViewEncapsulation,
} from '@angular/core';
import {TuiDialog} from '@taiga-ui/cdk';
import {TuiPopover} from '@taiga-ui/cdk';
import {tuiSlideInTop} from '@taiga-ui/core';
import {POLYMORPHEUS_CONTEXT} from '@tinkoff/ng-polymorpheus';

Expand All @@ -20,7 +20,7 @@ import {POLYMORPHEUS_CONTEXT} from '@tinkoff/ng-polymorpheus';
export class TuiPreviewDialogComponent {
constructor(
@Inject(POLYMORPHEUS_CONTEXT)
readonly context: TuiDialog<void, void>,
readonly context: TuiPopover<void, void>,
) {}

@HostListener('document:keydown.esc')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {ChangeDetectionStrategy, Component, Inject, inject} from '@angular/core';
import {WINDOW} from '@ng-web-apis/common';
import {TUI_PARENT_ANIMATION, TuiContext} from '@taiga-ui/cdk';
import {TuiContext} from '@taiga-ui/cdk';
import {
TUI_ANIMATIONS_SPEED,
TUI_CLOSE_WORD,
TUI_COMMON_ICONS,
TUI_MEDIA,
TUI_PARENT_ANIMATION,
TuiBrightness,
TuiCommonIcons,
tuiIsMobile,
Expand Down
46 changes: 0 additions & 46 deletions projects/cdk/abstract/dialog.directive.ts

This file was deleted.

51 changes: 0 additions & 51 deletions projects/cdk/abstract/dialog.service.ts

This file was deleted.

2 changes: 0 additions & 2 deletions projects/cdk/abstract/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export * from './control';
export * from './controller';
export * from './dialog.directive';
export * from './dialog.service';
export * from './interactive';
export * from './multiple-control';
export * from './nullable-control';
Expand Down
66 changes: 0 additions & 66 deletions projects/cdk/components/alert-host/alert-host.component.ts

This file was deleted.

12 changes: 0 additions & 12 deletions projects/cdk/components/alert-host/alert-host.module.ts

This file was deleted.

2 changes: 0 additions & 2 deletions projects/cdk/components/alert-host/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions projects/cdk/components/alert-host/ng-package.json

This file was deleted.

1 change: 0 additions & 1 deletion projects/cdk/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from '@taiga-ui/cdk/components/alert-host';
export * from '@taiga-ui/cdk/components/dropdown-host';
export * from '@taiga-ui/cdk/components/scroll-controls';
1 change: 0 additions & 1 deletion projects/cdk/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export * from './always-true-handler';
export * from './browser';
export * from './empty';
export * from './matcher';
export * from './parent-animation';
export * from './polling-time';
export * from './stringify';
export * from './svg-node-filter';
Expand Down
13 changes: 0 additions & 13 deletions projects/cdk/constants/parent-animation.ts

This file was deleted.

8 changes: 4 additions & 4 deletions projects/cdk/constants/used-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ export const TUI_USED_ICONS = [
'tuiIconSortAscending',
'tuiIconSortDescending',
'tuiIconSortOff',
'tuiIconInfo',
'tuiIconCheckCircle',
'tuiIconXCircle',
'tuiIconAlertCircle',
'tuiIconCheck',
'tuiIconMinusLarge',
'tuiIconChevronUp',
'tuiIconHelpCircle',
'tuiIconClose',
'tuiIconAlertCircle',
'tuiIconChevronRight',
'tuiIconInfo',
'tuiIconCheckCircle',
'tuiIconXCircle',
'tuiIconChevronLeft',
'tuiIconCalendarLarge',
'tuiIconStarLarge',
Expand Down
3 changes: 0 additions & 3 deletions projects/cdk/interfaces/alert-context.ts

This file was deleted.

7 changes: 0 additions & 7 deletions projects/cdk/interfaces/aria-dialog-context.ts

This file was deleted.

10 changes: 0 additions & 10 deletions projects/cdk/interfaces/base-dialog-context.ts

This file was deleted.

3 changes: 0 additions & 3 deletions projects/cdk/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export * from './alert-context';
export * from './aria-dialog-context';
export * from './base-dialog-context';
export * from './context';
export * from './control-value-transformer';
export * from './day-like';
Expand Down
21 changes: 0 additions & 21 deletions projects/cdk/tokens/alerts.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/cdk/tokens/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './active-element';
export * from './alerts';
export * from './base-href';
export * from './default-renderer';
export * from './ensure-base-href';
Expand Down
1 change: 1 addition & 0 deletions projects/cdk/tokens/removed-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {ɵAnimationEngine as AnimationEngine} from '@angular/animations/browser'
import {inject, InjectFlags} from '@angular/core';
import {tuiCreateTokenFromFactory} from '@taiga-ui/cdk/utils';
import {BehaviorSubject, map, share, startWith, switchMap, timer} from 'rxjs';

/**
* Element currently being removed by AnimationEngine
*/
Expand Down
5 changes: 0 additions & 5 deletions projects/cdk/types/dialog.ts

This file was deleted.

Loading
Loading