-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cdk)!: refactor the way new custom dialogs are created
- Loading branch information
Showing
26 changed files
with
113 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
projects/addon-mobile/components/mobile-dialog/mobile-dialog-options.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 8 additions & 10 deletions
18
projects/addon-mobile/components/mobile-dialog/mobile-dialog.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
projects/addon-mobile/components/sheet-dialog/sheet-dialog.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import {inject, Injectable} from '@angular/core'; | ||
import {TuiPopoverService} from '@taiga-ui/cdk'; | ||
import {TUI_DIALOGS} from '@taiga-ui/core'; | ||
import {PolymorpheusComponent} from '@tinkoff/ng-polymorpheus'; | ||
|
||
import {TuiSheetDialogComponent} from './sheet-dialog.component'; | ||
import {TUI_SHEET_DIALOG_OPTIONS, TuiSheetDialogOptions} from './sheet-dialog.options'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
useFactory: () => | ||
new TuiSheetDialogService( | ||
TUI_DIALOGS, | ||
TuiSheetDialogComponent, | ||
inject(TUI_SHEET_DIALOG_OPTIONS), | ||
), | ||
}) | ||
export class TuiSheetDialogService extends TuiPopoverService<TuiSheetDialogOptions<any>> { | ||
protected readonly items$ = inject(TUI_DIALOGS); | ||
protected readonly component = new PolymorpheusComponent(TuiSheetDialogComponent); | ||
protected readonly options = { | ||
...inject(TUI_SHEET_DIALOG_OPTIONS), | ||
data: undefined, | ||
}; | ||
} | ||
export class TuiSheetDialogService extends TuiPopoverService< | ||
TuiSheetDialogOptions<any> | ||
> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
projects/addon-preview/components/preview-dialog/preview-dialog.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import {inject, Injectable} from '@angular/core'; | ||
import {Injectable} from '@angular/core'; | ||
import {TuiPopoverService} from '@taiga-ui/cdk'; | ||
import {TUI_DIALOGS} from '@taiga-ui/core'; | ||
import {PolymorpheusComponent} from '@tinkoff/ng-polymorpheus'; | ||
|
||
import {TuiPreviewDialogComponent} from './preview-dialog.component'; | ||
|
||
@Injectable({providedIn: 'root'}) | ||
export class TuiPreviewDialogService extends TuiPopoverService<unknown> { | ||
protected readonly items$ = inject(TUI_DIALOGS); | ||
protected readonly options = {}; | ||
protected readonly component = new PolymorpheusComponent(TuiPreviewDialogComponent); | ||
} | ||
@Injectable({ | ||
providedIn: 'root', | ||
useFactory: () => new TuiPreviewDialogService(TUI_DIALOGS, TuiPreviewDialogComponent), | ||
}) | ||
export class TuiPreviewDialogService extends TuiPopoverService<unknown> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
import {Directive} from '@angular/core'; | ||
import {TuiPopoverDirective, TuiPopoverService} from '@taiga-ui/cdk'; | ||
import {TuiDialogOptions} from '@taiga-ui/core/interfaces'; | ||
import {tuiAsPopover, TuiPopoverDirective} from '@taiga-ui/cdk'; | ||
|
||
import {TuiDialogOptions} from './dialog.interfaces'; | ||
import {TuiDialogService} from './dialog.service'; | ||
|
||
@Directive({ | ||
selector: 'ng-template[tuiDialog]', | ||
inputs: ['options: tuiDialogOptions', 'open: tuiDialog'], | ||
outputs: ['openChange: tuiDialogChange'], | ||
providers: [ | ||
{ | ||
provide: TuiPopoverService, | ||
useExisting: TuiDialogService, | ||
}, | ||
], | ||
providers: [tuiAsPopover(TuiDialogService)], | ||
}) | ||
export class TuiDialogDirective<T> extends TuiPopoverDirective<TuiDialogOptions<T>> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
import {inject, Injectable} from '@angular/core'; | ||
import {TuiPopoverService} from '@taiga-ui/cdk'; | ||
import type {TuiDialogOptions} from '@taiga-ui/core/interfaces'; | ||
import {PolymorpheusComponent} from '@tinkoff/ng-polymorpheus'; | ||
|
||
import {TuiDialogComponent} from './dialog.component'; | ||
import {TuiDialogOptions} from './dialog.interfaces'; | ||
import {TUI_DIALOG_OPTIONS, TUI_DIALOGS} from './dialog.tokens'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
useFactory: () => | ||
new TuiDialogService(TUI_DIALOGS, TuiDialogComponent, inject(TUI_DIALOG_OPTIONS)), | ||
}) | ||
export class TuiDialogService extends TuiPopoverService<TuiDialogOptions<any>> { | ||
protected readonly items$ = inject(TUI_DIALOGS); | ||
protected readonly component = new PolymorpheusComponent(TuiDialogComponent); | ||
protected readonly options: TuiDialogOptions<any> = { | ||
...inject(TUI_DIALOG_OPTIONS), | ||
data: undefined, | ||
}; | ||
} | ||
export class TuiDialogService extends TuiPopoverService<TuiDialogOptions<any>> {} |
Oops, something went wrong.