Skip to content

Commit

Permalink
refactor!: remove deprecated entities (#2108)
Browse files Browse the repository at this point in the history
BREAKING CHANGES: remove WithDateMaskPipeConfig, TUI_DATE_MASK, TUI_DATE_RANGE_MASK, TuiProgressColorSegmentsAsyncPipe, TuiNotificationService, TuiProgressColorSegmentsPipe, COUNTRIES, Country, second argument in TuiHideSelectedPipe
  • Loading branch information
vladimirpotekhin authored Jul 15, 2022
1 parent ecdcc74 commit 3517ecd
Show file tree
Hide file tree
Showing 173 changed files with 541 additions and 1,479 deletions.
6 changes: 3 additions & 3 deletions projects/addon-commerce/tokens/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {InjectionToken} from '@angular/core';
import {extractI18n} from '@taiga-ui/i18n';
import {tuiExtractI18n} from '@taiga-ui/i18n';
import {Observable, of} from 'rxjs';

export const TUI_CARD_NUMBER_TEXTS = new InjectionToken(`Number and card number i18n`, {
factory: extractI18n('cardNumber'),
factory: tuiExtractI18n('cardNumber'),
});

export const TUI_CARD_EXPIRY_TEXTS = new InjectionToken(`Expiry and card expiry i18n`, {
factory: extractI18n('cardExpiry'),
factory: tuiExtractI18n('cardExpiry'),
});

export const TUI_CARD_CVC_TEXTS = new InjectionToken<Observable<[string, string]>>(
Expand Down
10 changes: 5 additions & 5 deletions projects/addon-doc/src/components/example/example.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@angular/core';
import {LOCATION} from '@ng-web-apis/common';
import {TUI_IS_CYPRESS, TuiHandler} from '@taiga-ui/cdk';
import {TuiNotification, TuiNotificationsService} from '@taiga-ui/core';
import {TuiAlertService, TuiNotification} from '@taiga-ui/core';
import {TUI_COPY_TEXTS} from '@taiga-ui/kit';
import {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';
import {BehaviorSubject, Observable, Subject} from 'rxjs';
Expand Down Expand Up @@ -67,8 +67,8 @@ export class TuiDocExampleComponent {
@Attribute('id')
readonly id: string | null,
@Inject(Clipboard) private readonly clipboard: Clipboard,
@Inject(TuiNotificationsService)
private readonly notifications: TuiNotificationsService,
@Inject(TuiAlertService)
private readonly alertService: TuiAlertService,
@Inject(LOCATION) private readonly location: Location,
@Inject(TUI_COPY_TEXTS) private readonly copyTexts$: Observable<[string, string]>,
@Inject(TUI_DOC_EXAMPLE_TEXTS) readonly texts: [string, string, string],
Expand All @@ -93,8 +93,8 @@ export class TuiDocExampleComponent {
const url = `${currentUrl}#${this.id}`;

this.clipboard.copy(url);
this.notifications
.show(this.texts[1], {
this.alertService
.open(this.texts[1], {
label: this.texts[2],
status: TuiNotification.Success,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
tuiIsNativeFocusedIn,
} from '@taiga-ui/cdk';
import {TuiHostedDropdownComponent} from '@taiga-ui/core';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {LEFT_ALIGNED_DROPDOWN_CONTROLLER_PROVIDER} from '@taiga-ui/kit';
import {Observable} from 'rxjs';
import {take} from 'rxjs/operators';
Expand Down Expand Up @@ -92,7 +92,7 @@ export class TuiToolbarNewComponent {
@Inject(TUI_IMAGE_LOADER)
private readonly imageLoader: TuiHandler<File, Observable<string>>,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
@Inject(TUI_EDITOR_OPTIONS)
private readonly defaultOptions: TuiEditorOptions,
) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {TuiEditor} from '@taiga-ui/addon-editor/abstract';
import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives';
import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {combineLatest, Observable} from 'rxjs';
import {map} from 'rxjs/operators';

Expand Down Expand Up @@ -30,6 +30,6 @@ export class TuiAlignContentComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
TUI_EDITOR_CODE_OPTIONS,
TUI_EDITOR_TOOLBAR_TEXTS,
} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {distinctUntilChanged, map} from 'rxjs/operators';

Expand All @@ -25,9 +25,9 @@ export class TuiCodeComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
@Inject(TUI_EDITOR_CODE_OPTIONS)
readonly codeOptionsTexts$: Observable<LanguageEditor['editorCodeOptions']>,
readonly codeOptionsTexts$: Observable<TuiLanguageEditor['editorCodeOptions']>,
) {}

onCode(isCodeBlock: boolean): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {TuiEditor} from '@taiga-ui/addon-editor/abstract';
import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives';
import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {distinctUntilChanged, map} from 'rxjs/operators';

Expand All @@ -20,7 +20,7 @@ export class TuiDetailsRemoveComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}

removeDetails(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {TuiEditor} from '@taiga-ui/addon-editor/abstract';
import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives';
import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';

@Component({
Expand All @@ -14,7 +14,7 @@ export class TuiDetailsComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}

setDetails(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TUI_EDITOR_FONT_OPTIONS,
TUI_EDITOR_TOOLBAR_TEXTS,
} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {map} from 'rxjs/operators';

Expand Down Expand Up @@ -45,10 +45,10 @@ export class TuiFontSizeComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
@Inject(TUI_EDITOR_FONT_OPTIONS)
private readonly fontOptionsTexts$: Observable<
LanguageEditor['editorFontOptions']
TuiLanguageEditor['editorFontOptions']
>,
) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {defaultEditorTools} from '@taiga-ui/addon-editor/constants';
import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives';
import {TuiEditorTool} from '@taiga-ui/addon-editor/enums';
import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {combineLatest, Observable} from 'rxjs';
import {map} from 'rxjs/operators';

Expand Down Expand Up @@ -41,7 +41,7 @@ export class TuiFontStyleComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}

isEnabled(tool: TuiEditorTool): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TuiEditorOptions,
} from '@taiga-ui/addon-editor/tokens';
import {tuiDefaultProp} from '@taiga-ui/cdk';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {distinctUntilChanged, map} from 'rxjs/operators';

Expand All @@ -32,7 +32,7 @@ export class TuiHighlightColorComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
@Inject(TUI_EDITOR_OPTIONS)
private readonly defaultOptions: TuiEditorOptions,
) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {TuiEditor} from '@taiga-ui/addon-editor/abstract';
import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives';
import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {combineLatest, Observable} from 'rxjs';
import {map} from 'rxjs/operators';

Expand All @@ -26,6 +26,6 @@ export class TuiListConfigsComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TuiEditorOptions,
} from '@taiga-ui/addon-editor/tokens';
import {tuiDefaultProp} from '@taiga-ui/cdk';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {distinctUntilChanged, map} from 'rxjs/operators';

Expand Down Expand Up @@ -36,7 +36,7 @@ export class TuiTableCellColorComponent {
private readonly defaultOptions: TuiEditorOptions,
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}

isBlankColor(color: string): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {TuiEditor} from '@taiga-ui/addon-editor/abstract';
import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives';
import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {map} from 'rxjs/operators';

Expand All @@ -17,7 +17,7 @@ export class TuiTableCreateComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}

addTable({rows, cols}: {rows: number; cols: number}): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {TuiEditor} from '@taiga-ui/addon-editor/abstract';
import {TuiTiptapEditorService} from '@taiga-ui/addon-editor/directives';
import {TUI_EDITOR_TOOLBAR_TEXTS} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {distinctUntilChanged, map} from 'rxjs/operators';

Expand All @@ -25,7 +25,7 @@ export class TuiTableMergeCellsComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}

mergeCells(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TUI_EDITOR_TABLE_COMMANDS,
TUI_EDITOR_TOOLBAR_TEXTS,
} from '@taiga-ui/addon-editor/tokens';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {map} from 'rxjs/operators';

Expand All @@ -19,19 +19,6 @@ export enum TuiTableCommands {
DeleteRow,
}

// `export const TableComands = TuiTableCommands;` doesn't work as expected type reference
/**
* @deprecated in v3.0 {@link TuiTableCommands}
*/
export enum TableComands {
InsertColumnBefore,
InsertColumnAfter,
InsertRowBefore,
InsertRowAfter,
DeleteColumn,
DeleteRow,
}

@Component({
selector: 'tui-table-row-column-manager',
templateUrl: './table-row-column-manager.template.html',
Expand All @@ -56,9 +43,9 @@ export class TuiTableRowColumnManagerComponent {
constructor(
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
@Inject(TUI_EDITOR_TABLE_COMMANDS)
readonly tableCommandTexts$: Observable<LanguageEditor['editorTableCommands']>,
readonly tableCommandTexts$: Observable<TuiLanguageEditor['editorTableCommands']>,
) {}

onTableOption(command: TuiTableCommands): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TuiEditorOptions,
} from '@taiga-ui/addon-editor/tokens';
import {tuiDefaultProp} from '@taiga-ui/cdk';
import {LanguageEditor} from '@taiga-ui/i18n';
import {TuiLanguageEditor} from '@taiga-ui/i18n';
import {Observable} from 'rxjs';
import {distinctUntilChanged, map} from 'rxjs/operators';

Expand All @@ -34,6 +34,6 @@ export class TuiTextColorComponent {
private readonly defaultOptions: TuiEditorOptions,
@Inject(TuiTiptapEditorService) readonly editor: TuiEditor,
@Inject(TUI_EDITOR_TOOLBAR_TEXTS)
readonly texts$: Observable<LanguageEditor['toolbarTools']>,
readonly texts$: Observable<TuiLanguageEditor['toolbarTools']>,
) {}
}
10 changes: 5 additions & 5 deletions projects/addon-editor/tokens/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {InjectionToken} from '@angular/core';
import {TuiEditorTool} from '@taiga-ui/addon-editor/enums';
import {extractI18n} from '@taiga-ui/i18n';
import {tuiExtractI18n} from '@taiga-ui/i18n';

export const TUI_EDITOR_COLOR_SELECTOR_MODE_NAMES = new InjectionToken<[string, string]>(
`tui-color-selector i18n`,
Expand All @@ -25,26 +25,26 @@ export type EditorToolbarTexts =
| 'backColor';

export const TUI_EDITOR_TOOLBAR_TEXTS = new InjectionToken(`tui-editor-toolbar i18n`, {
factory: extractI18n('toolbarTools'),
factory: tuiExtractI18n('toolbarTools'),
});

export const TUI_EDITOR_TABLE_COMMANDS = new InjectionToken(
'tui-editor-toolbar table i18n',
{
factory: extractI18n('editorTableCommands'),
factory: tuiExtractI18n('editorTableCommands'),
},
);

export const TUI_EDITOR_CODE_OPTIONS = new InjectionToken(
'tui-editor-toolbar codes options',
{
factory: extractI18n('editorCodeOptions'),
factory: tuiExtractI18n('editorCodeOptions'),
},
);

export const TUI_EDITOR_FONT_OPTIONS = new InjectionToken(
'tui-editor-toolbar font options',
{
factory: extractI18n('editorFontOptions'),
factory: tuiExtractI18n('editorFontOptions'),
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Output,
} from '@angular/core';
import {clamp, tuiDefaultProp} from '@taiga-ui/cdk';
import {LanguageKit} from '@taiga-ui/i18n';
import {TuiLanguageKit} from '@taiga-ui/i18n';
import {TUI_PAGINATION_TEXTS} from '@taiga-ui/kit';
import {Observable} from 'rxjs';

Expand All @@ -32,7 +32,7 @@ export class TuiPreviewPaginationComponent {

constructor(
@Inject(TUI_PAGINATION_TEXTS)
readonly texts$: Observable<LanguageKit['pagination']>,
readonly texts$: Observable<TuiLanguageKit['pagination']>,
) {}

get leftButtonDisabled(): boolean {
Expand Down
Loading

0 comments on commit 3517ecd

Please sign in to comment.