Skip to content

Commit

Permalink
refactor: rename TuiErrorComponent to TuiError (#7819)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Jun 18, 2024
1 parent 3c4fc96 commit a2ee5b4
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,7 @@ function replaceFieldError({
});

if (elements.length) {
addImportToClosestModule(
resource.componentPath,
'TuiErrorComponent',
'@taiga-ui/core',
);
addImportToClosestModule(resource.componentPath, 'TuiError', '@taiga-ui/core');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
},
{
from: {name: 'TuiErrorModule', moduleSpecifier: '@taiga-ui/core'},
to: {name: 'TuiErrorComponent', moduleSpecifier: '@taiga-ui/core'},
to: {name: 'TuiError', moduleSpecifier: '@taiga-ui/core'},
},
{
from: {name: 'TuiExpandModule', moduleSpecifier: '@taiga-ui/core'},
Expand Down Expand Up @@ -1216,7 +1216,7 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
moduleSpecifier: '@taiga-ui/core',
},
to: {
name: 'TuiErrorComponent',
name: 'TuiError',
moduleSpecifier: '@taiga-ui/core',
},
},
Expand Down
2 changes: 1 addition & 1 deletion projects/core/components/error/error.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [tuiHeightCollapse, tuiFadeIn],
})
export class TuiErrorComponent {
export class TuiError {
protected readonly options = tuiToAnimationOptions(inject(TUI_ANIMATIONS_SPEED));
protected error: TuiValidationError | null = null;
protected visible = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {FormsModule} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiValidationError} from '@taiga-ui/cdk';
import {TuiErrorComponent, TuiLabel} from '@taiga-ui/core';
import {TuiError, TuiLabel} from '@taiga-ui/core';
import {TuiSwitchComponent} from '@taiga-ui/kit';

@Component({
standalone: true,
imports: [FormsModule, TuiLabel, TuiSwitchComponent, TuiErrorComponent],
imports: [FormsModule, TuiLabel, TuiSwitchComponent, TuiError],
templateUrl: './index.html',
encapsulation,
changeDetection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
```ts
import {TuiErrorComponent} from '@taiga-ui/core';
import {TuiError} from '@taiga-ui/core';

// ...

@Component({
standalone: true,
imports: [
// ...
TuiErrorComponent,
TuiError,
],
// ...
})
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/components/error/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {RouterLink} from '@angular/router';
import {changeDetection} from '@demo/emulate/change-detection';
import {TuiDemo} from '@demo/utils';
import {TuiValidationError} from '@taiga-ui/cdk';
import {TuiErrorComponent, TuiLink} from '@taiga-ui/core';
import {TuiError, TuiLink} from '@taiga-ui/core';

@Component({
standalone: true,
imports: [RouterLink, TuiDemo, TuiErrorComponent, TuiLink],
imports: [RouterLink, TuiDemo, TuiError, TuiLink],
templateUrl: './index.html',
changeDetection,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Component} from '@angular/core';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiErrorComponent, TuiGroupDirective, TuiHint} from '@taiga-ui/core';
import {TuiError, TuiGroupDirective, TuiHint} from '@taiga-ui/core';
import {TuiDataListWrapper, TuiFieldErrorPipe} from '@taiga-ui/kit';
import {
TuiInputModule,
Expand All @@ -18,7 +18,7 @@ import {
TuiGroupDirective,
TuiInputModule,
TuiHint,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
TuiMultiSelectModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
tuiCardNumberValidator,
TuiInputCardGroup,
} from '@taiga-ui/addon-commerce';
import {TuiErrorComponent} from '@taiga-ui/core';
import {TuiError} from '@taiga-ui/core';
import {TuiFieldErrorPipe} from '@taiga-ui/kit';

@Component({
Expand All @@ -18,7 +18,7 @@ import {TuiFieldErrorPipe} from '@taiga-ui/kit';
TuiFieldErrorPipe,
AsyncPipe,
ReactiveFormsModule,
TuiErrorComponent,
TuiError,
],
templateUrl: './index.html',
changeDetection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
tuiCardNumberValidator,
TuiInputCardGroup,
} from '@taiga-ui/addon-commerce';
import {TuiErrorComponent} from '@taiga-ui/core';
import {TuiError} from '@taiga-ui/core';
import {TuiFieldErrorPipe} from '@taiga-ui/kit';
import {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';

Expand All @@ -19,7 +19,7 @@ import {PolymorpheusOutlet, PolymorpheusTemplate} from '@taiga-ui/polymorpheus';
ReactiveFormsModule,
PolymorpheusOutlet,
PolymorpheusTemplate,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@taiga-ui/addon-commerce';
import {
TuiAlertService,
TuiErrorComponent,
TuiError,
TuiTextfield,
tuiTextfieldOptionsProvider,
} from '@taiga-ui/core';
Expand All @@ -26,7 +26,7 @@ import {TuiFieldErrorPipe} from '@taiga-ui/kit';
TuiInputCVC,
TuiInputExpire,
TuiInputCard,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
JsonPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiDay} from '@taiga-ui/cdk';
import {TuiErrorComponent} from '@taiga-ui/core';
import {TuiError} from '@taiga-ui/core';
import {TuiFieldErrorPipe} from '@taiga-ui/kit';
import {
TuiInputDateModule,
Expand All @@ -16,7 +16,7 @@ import {
standalone: true,
imports: [
TuiInputDateModule,
TuiErrorComponent,
TuiError,
TuiTextfieldControllerModule,
TuiFieldErrorPipe,
ReactiveFormsModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {FormControl, ReactiveFormsModule} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiValidationError} from '@taiga-ui/cdk';
import {TuiErrorComponent} from '@taiga-ui/core';
import {TuiError} from '@taiga-ui/core';
import {
TuiFieldErrorPipe,
TuiFileComponent,
Expand All @@ -27,7 +27,7 @@ import {map} from 'rxjs';
TuiFileComponent,
NgForOf,
AsyncPipe,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
TuiFileRejectedPipe,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import {
TuiDataListComponent,
TuiDataListDirective,
TuiErrorComponent,
TuiError,
TuiOptionComponent,
} from '@taiga-ui/core';
import {TuiFieldErrorPipe} from '@taiga-ui/kit';
Expand Down Expand Up @@ -49,7 +49,7 @@ function tagValidator(tag: string): boolean {
NgForOf,
TuiOptionComponent,
TuiDataListDirective,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Component} from '@angular/core';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiButton, TuiErrorComponent, TuiLink} from '@taiga-ui/core';
import {TuiButton, TuiError, TuiLink} from '@taiga-ui/core';
import {TuiAvatarComponent, TuiFieldErrorPipe} from '@taiga-ui/kit';
import {TuiCardLarge} from '@taiga-ui/layout';
import {
Expand All @@ -18,7 +18,7 @@ import {
TuiIslandDirective,
ReactiveFormsModule,
TuiInputPhoneModule,
TuiErrorComponent,
TuiError,
TuiTextfieldControllerModule,
TuiFieldErrorPipe,
AsyncPipe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {tuiMarkControlAsTouchedAndValidate} from '@taiga-ui/cdk';
import {TuiErrorComponent, TuiHint, TuiLabel} from '@taiga-ui/core';
import {TuiError, TuiHint, TuiLabel} from '@taiga-ui/core';
import {TUI_VALIDATION_ERRORS, TuiFieldErrorPipe} from '@taiga-ui/kit';
import {TuiTextareaModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';

Expand All @@ -27,7 +27,7 @@ export function maxLengthMessageFactory(context: {requiredLength: string}): stri
TuiTextareaModule,
TuiHint,
TuiTextfieldControllerModule,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {tuiMarkControlAsTouchedAndValidate} from '@taiga-ui/cdk';
import {TuiErrorComponent} from '@taiga-ui/core';
import {TuiError} from '@taiga-ui/core';
import {TuiFieldErrorPipe} from '@taiga-ui/kit';
import {TuiInputModule} from '@taiga-ui/legacy';

Expand All @@ -14,7 +14,7 @@ import {TuiInputModule} from '@taiga-ui/legacy';
imports: [
ReactiveFormsModule,
TuiInputModule,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
],
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/markup/form/examples/1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/
import {changeDetection} from '@demo/emulate/change-detection';
import {TuiAmountPipe, TuiCurrency, TuiCurrencyPipe} from '@taiga-ui/addon-commerce';
import {TuiDay, TuiTime} from '@taiga-ui/cdk';
import {TuiButton, TuiErrorComponent, TuiGroupDirective, TuiLabel} from '@taiga-ui/core';
import {TuiButton, TuiError, TuiGroupDirective, TuiLabel} from '@taiga-ui/core';
import {
TuiBlockDirective,
TuiCheckboxComponent,
Expand Down Expand Up @@ -52,7 +52,7 @@ class Account {
TuiStepper,
ReactiveFormsModule,
TuiInputModule,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
TuiInputDateModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {RouterLink} from '@angular/router';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {DemoRoute} from '@demo/routes';
import {TuiErrorComponent, TuiLabel, TuiLink} from '@taiga-ui/core';
import {TuiError, TuiLabel, TuiLink} from '@taiga-ui/core';
import {TuiFieldErrorPipe} from '@taiga-ui/kit';
import {TuiInputModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';
import {distinctUntilChanged} from 'rxjs';
Expand Down Expand Up @@ -36,7 +36,7 @@ export function superComputerValidator(field: AbstractControl): Validators | nul
TuiLabel,
TuiInputModule,
TuiTextfieldControllerModule,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
RouterLink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {tuiIsFalsy} from '@taiga-ui/cdk';
import {TuiErrorComponent, TuiTextfield} from '@taiga-ui/core';
import {TuiError, TuiTextfield} from '@taiga-ui/core';
import {TUI_VALIDATION_ERRORS, TuiFieldErrorPipe} from '@taiga-ui/kit';
import {
TuiInputModule,
Expand All @@ -20,7 +20,7 @@ import {interval, map, of, scan, startWith} from 'rxjs';
TuiInputModule,
TuiTextfield,
TuiTextfieldControllerModule,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
TuiInputNumberModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {tuiMarkControlAsTouchedAndValidate, TuiValidationError} from '@taiga-ui/cdk';
import {TuiButton, TuiErrorComponent, TuiLabel} from '@taiga-ui/core';
import {TuiButton, TuiError, TuiLabel} from '@taiga-ui/core';
import {TuiCheckboxComponent, TuiFieldErrorPipe} from '@taiga-ui/kit';
import {TuiInputModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';
import type {PolymorpheusContent} from '@taiga-ui/polymorpheus';
Expand All @@ -21,7 +21,7 @@ const secretRegexTwelve = /^\d{12}$/;
TuiLabel,
TuiInputModule,
TuiTextfieldControllerModule,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
TuiCheckboxComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiValidationError} from '@taiga-ui/cdk';
import {TuiButton, TuiErrorComponent, TuiTextfield} from '@taiga-ui/core';
import {TuiButton, TuiError, TuiTextfield} from '@taiga-ui/core';
import {TuiFieldErrorPipe} from '@taiga-ui/kit';
import {TuiInputPhoneModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';
import type {PolymorpheusContent} from '@taiga-ui/polymorpheus';
Expand All @@ -25,7 +25,7 @@ import type {PolymorpheusContent} from '@taiga-ui/polymorpheus';
TuiTextfield,
TuiTextfieldControllerModule,
TuiButton,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {ReactiveFormsModule, UntypedFormBuilder, Validators} from '@angular/form
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TUI_IS_E2E, TuiValidationError} from '@taiga-ui/cdk';
import {TuiErrorComponent} from '@taiga-ui/core';
import {TuiError} from '@taiga-ui/core';
import {TuiFieldErrorPipe} from '@taiga-ui/kit';
import {TuiInputModule} from '@taiga-ui/legacy';
import {delay, of} from 'rxjs';
Expand All @@ -26,7 +26,7 @@ function asyncValidatorFn(isE2E: boolean): AsyncValidatorFn {
imports: [
ReactiveFormsModule,
TuiInputModule,
TuiErrorComponent,
TuiError,
TuiFieldErrorPipe,
AsyncPipe,
],
Expand Down

0 comments on commit a2ee5b4

Please sign in to comment.