Skip to content

Commit

Permalink
feat!: delete all utils for legacy text-mask library
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov committed Feb 2, 2024
1 parent d4f9ff2 commit cd37383
Show file tree
Hide file tree
Showing 36 changed files with 3 additions and 1,023 deletions.
19 changes: 0 additions & 19 deletions projects/addon-commerce/constants/card-holder-mask.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {MaskitoOptions} from '@maskito/core';
import {tuiCreateCorrectionMask, TuiTextMaskListHandler} from '@taiga-ui/core';

const ALLOWED_REGEXP = /[A-Z]| /;
const MAP: Record<string, string> = {
А: 'F',
В: 'D',
Expand Down Expand Up @@ -31,14 +29,6 @@ const MAP: Record<string, string> = {
Я: 'Z',
};

// TODO: delete in v4.0
function toEnglishUppercaseLegacy(char: string): string | null {
const uppercase = char.toUpperCase();
const result = ALLOWED_REGEXP.test(uppercase) ? uppercase : MAP[uppercase];

return result || null;
}

function toEnglishUppercase(value: string): string {
return value
.toUpperCase()
Expand All @@ -63,12 +53,3 @@ export const TUI_CARD_HOLDER_MASK: MaskitoOptions = {
},
],
};

/**
* @deprecated Use {@link TUI_CARD_HOLDER_MASK} with {@link https://github.com/taiga-family/maskito Maskito}
* TODO: delete in v4.0
*/
export const cardHolderMask: TuiTextMaskListHandler = tuiCreateCorrectionMask(
ALLOWED_REGEXP,
toEnglishUppercaseLegacy,
);
53 changes: 0 additions & 53 deletions projects/addon-commerce/utils/create-auto-corrected-expire-pipe.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/addon-commerce/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './create-auto-corrected-expire-pipe';
export * from './format-currency';
export * from './get-code-by-currency';
export * from './get-currency-by-code';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import {
ChangeDetectionStrategy,
Component,
ElementRef,
Inject,
Optional,
} from '@angular/core';
import {ChangeDetectionStrategy, Component, ElementRef, Inject} from '@angular/core';
import {TuiIdService} from '@taiga-ui/cdk';
import {
TEXTFIELD_CONTROLLER_PROVIDER,
TUI_TEXTFIELD_WATCHED_CONTROLLER,
TuiTextfieldController,
} from '@taiga-ui/core/directives';
import {TuiTextfieldHost} from '@taiga-ui/core/interfaces';
import {TUI_LEGACY_MASK, TUI_TEXTFIELD_HOST} from '@taiga-ui/core/tokens';
import {TUI_TEXTFIELD_HOST} from '@taiga-ui/core/tokens';

@Component({
selector: 'input[tuiTextfield], textarea[tuiTextfield]',
Expand All @@ -29,7 +23,7 @@ import {TUI_LEGACY_MASK, TUI_TEXTFIELD_HOST} from '@taiga-ui/core/tokens';
'[tabIndex]': 'host.focusable ? 0 : -1',
'[readOnly]': 'host.readOnly',
'[value]': 'host.value',
'(input)': '!legacyMask && host.onValueChange($event.target.value)',
'(input)': 'host.onValueChange($event.target.value)',
},
})
export class TuiTextfieldComponent {
Expand All @@ -40,9 +34,6 @@ export class TuiTextfieldComponent {
@Inject(ElementRef) private readonly el: ElementRef<HTMLInputElement>,
@Inject(TuiIdService)
private readonly idService: TuiIdService,
@Optional()
@Inject(TUI_LEGACY_MASK)
readonly legacyMask: boolean | null,
) {
this.host.process(this.el.nativeElement);
}
Expand Down
1 change: 0 additions & 1 deletion projects/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export * from '@taiga-ui/core/directives';
export * from '@taiga-ui/core/enums';
export * from '@taiga-ui/core/interfaces';
export * from '@taiga-ui/core/internal';
export * from '@taiga-ui/core/mask';
export * from '@taiga-ui/core/observables';
export * from '@taiga-ui/core/pipes';
export * from '@taiga-ui/core/providers';
Expand Down
8 changes: 0 additions & 8 deletions projects/core/mask/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions projects/core/mask/ng-package.json

This file was deleted.

12 changes: 0 additions & 12 deletions projects/core/mask/number-mask-options.ts

This file was deleted.

10 changes: 0 additions & 10 deletions projects/core/mask/text-mask-config.ts

This file was deleted.

4 changes: 0 additions & 4 deletions projects/core/mask/text-mask-correction-handler.ts

This file was deleted.

10 changes: 0 additions & 10 deletions projects/core/mask/text-mask-list-handler.ts

This file was deleted.

5 changes: 0 additions & 5 deletions projects/core/mask/text-mask-list.ts

This file was deleted.

39 changes: 0 additions & 39 deletions projects/core/mask/text-mask-options.ts

This file was deleted.

12 changes: 0 additions & 12 deletions projects/core/mask/text-mask-pipe-handler.ts

This file was deleted.

9 changes: 0 additions & 9 deletions projects/core/mask/text-mask-pipe-result.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/core/tokens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export * from './icon-resolver';
export * from './icons';
export * from './icons-path';
export * from './is-mobile-resolution';
export * from './legacy-mask';
export * from './media';
export * from './mode';
export * from './notification-options';
Expand Down
8 changes: 0 additions & 8 deletions projects/core/tokens/legacy-mask.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/core/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from '@taiga-ui/core/utils/dom';
export * from '@taiga-ui/core/utils/format';
export * from '@taiga-ui/core/utils/mask';
export * from '@taiga-ui/core/utils/miscellaneous';
export * from '@taiga-ui/core/utils/mobile';
Loading

0 comments on commit cd37383

Please sign in to comment.