From 1799941421d2fed284c588f59242d1c5a399e49d Mon Sep 17 00:00:00 2001 From: taiga-family-bot Date: Fri, 6 Dec 2024 14:01:53 +0000 Subject: [PATCH] chore: apply changes after linting [bot] --- projects/cdk/utils/di/create-options.ts | 2 +- .../utils/miscellaneous/provide-options.ts | 2 +- .../core/components/button/button.options.ts | 2 +- .../notification/notification.options.ts | 2 +- .../components/form/examples/1/index.ts | 18 ++++++------- .../components/navigation/examples/1/index.ts | 4 +-- .../segmented/segmented.component.ts | 4 +-- .../layout/components/form/form.directive.ts | 27 +++++++++---------- .../components/header/header.directive.ts | 2 +- 9 files changed, 31 insertions(+), 32 deletions(-) diff --git a/projects/cdk/utils/di/create-options.ts b/projects/cdk/utils/di/create-options.ts index eb96d6e11f46..86525cefc7d9 100644 --- a/projects/cdk/utils/di/create-options.ts +++ b/projects/cdk/utils/di/create-options.ts @@ -5,7 +5,7 @@ export function tuiCreateOptions( defaults: T, ): [ token: InjectionToken, - provider: (item: ProviderToken> | Partial) => FactoryProvider, + provider: (item: Partial | ProviderToken>) => FactoryProvider, ] { const token = tuiCreateToken(defaults); diff --git a/projects/cdk/utils/miscellaneous/provide-options.ts b/projects/cdk/utils/miscellaneous/provide-options.ts index 5bbb4b14de5c..32c7d3493c49 100644 --- a/projects/cdk/utils/miscellaneous/provide-options.ts +++ b/projects/cdk/utils/miscellaneous/provide-options.ts @@ -3,7 +3,7 @@ import {inject} from '@angular/core'; export function tuiProvideOptions( provide: InjectionToken, - options: ProviderToken> | Partial, + options: Partial | ProviderToken>, fallback: T, ): FactoryProvider { return { diff --git a/projects/core/components/button/button.options.ts b/projects/core/components/button/button.options.ts index 31b929ab97bf..3a18fa46fd19 100644 --- a/projects/core/components/button/button.options.ts +++ b/projects/core/components/button/button.options.ts @@ -1,4 +1,4 @@ -import {tuiCreateOptions} from '@taiga-ui/cdk'; +import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di'; import type {TuiAppearanceOptions} from '@taiga-ui/core/directives/appearance'; import type {TuiSizeXL, TuiSizeXS} from '@taiga-ui/core/types'; diff --git a/projects/core/components/notification/notification.options.ts b/projects/core/components/notification/notification.options.ts index 810167730129..53c94c4add50 100644 --- a/projects/core/components/notification/notification.options.ts +++ b/projects/core/components/notification/notification.options.ts @@ -1,5 +1,5 @@ -import {tuiCreateOptions} from '@taiga-ui/cdk'; import type {TuiStringHandler} from '@taiga-ui/cdk/types'; +import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di'; import type {TuiAppearanceOptions} from '@taiga-ui/core/directives/appearance'; import type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types'; diff --git a/projects/demo/src/modules/components/form/examples/1/index.ts b/projects/demo/src/modules/components/form/examples/1/index.ts index dcdf47d39e7b..40db010e17c5 100644 --- a/projects/demo/src/modules/components/form/examples/1/index.ts +++ b/projects/demo/src/modules/components/form/examples/1/index.ts @@ -18,23 +18,23 @@ import {TuiCardLarge, TuiForm, TuiHeader} from '@taiga-ui/layout'; @Component({ standalone: true, imports: [ + AsyncPipe, NgIf, ReactiveFormsModule, - TuiCardLarge, TuiAppearance, + TuiButton, + TuiCardLarge, + TuiError, + TuiFieldErrorPipe, TuiForm, TuiHeader, - TuiTitle, + TuiIcon, + TuiNotification, TuiSegmented, + TuiSwitch, TuiTextfield, - TuiButton, - TuiNotification, - TuiIcon, + TuiTitle, TuiTooltip, - TuiSwitch, - TuiError, - TuiFieldErrorPipe, - AsyncPipe, ], templateUrl: './index.html', encapsulation, diff --git a/projects/demo/src/modules/components/navigation/examples/1/index.ts b/projects/demo/src/modules/components/navigation/examples/1/index.ts index 81d29209a54c..2a1d486ef0fa 100644 --- a/projects/demo/src/modules/components/navigation/examples/1/index.ts +++ b/projects/demo/src/modules/components/navigation/examples/1/index.ts @@ -50,15 +50,15 @@ const ICON = TuiDataListDropdownManager, TuiDropdown, TuiFade, + TuiForm, TuiHeader, TuiIcon, TuiNavigation, TuiRepeatTimes, TuiSwitch, TuiTabs, - TuiTitle, - TuiForm, TuiTextfield, + TuiTitle, ], templateUrl: './index.html', encapsulation, diff --git a/projects/kit/components/segmented/segmented.component.ts b/projects/kit/components/segmented/segmented.component.ts index 85158f5c03e1..d05d8b76f055 100644 --- a/projects/kit/components/segmented/segmented.component.ts +++ b/projects/kit/components/segmented/segmented.component.ts @@ -10,8 +10,8 @@ import { } from '@angular/core'; import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; import {ResizeObserverService} from '@ng-web-apis/resize-observer'; -import {tuiCreateOptions} from '@taiga-ui/cdk'; import {tuiZonefree} from '@taiga-ui/cdk/observables'; +import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di'; import {tuiInjectElement, tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom'; import {tuiPx} from '@taiga-ui/cdk/utils/miscellaneous'; import type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types'; @@ -20,7 +20,7 @@ import {tuiBadgeNotificationOptionsProvider} from '@taiga-ui/kit/components/badg import {TuiSegmentedDirective} from './segmented.directive'; export const [TUI_SEGMENTED_OPTIONS, tuiSegmentedOptionsProvider] = tuiCreateOptions({ - size: 's' as TuiSizeS | TuiSizeL, + size: 's' as TuiSizeL | TuiSizeS, }); @Component({ diff --git a/projects/layout/components/form/form.directive.ts b/projects/layout/components/form/form.directive.ts index d8a151e29fdc..ed777416db99 100644 --- a/projects/layout/components/form/form.directive.ts +++ b/projects/layout/components/form/form.directive.ts @@ -1,11 +1,10 @@ +import type {InjectionToken, Provider} from '@angular/core'; import { ChangeDetectionStrategy, Component, Directive, inject, - type InjectionToken, Input, - type Provider, ViewEncapsulation, } from '@angular/core'; import type {TuiStringHandler} from '@taiga-ui/cdk/types'; @@ -39,10 +38,13 @@ class TuiFormStyles {} @Directive({ standalone: true, selector: '[tuiForm]', - host: { - tuiForm: '', - '[attr.data-size]': 'size', - }, + providers: [ + tuiButtonOptionsProvider(TuiForm), + tuiNotificationOptionsProvider(TuiForm), + projectSize(TUI_HEADER_OPTIONS, (size) => HEADER_SIZE[size]!), + projectSize(TUI_SWITCH_OPTIONS, (size) => (size === 'l' ? 'm' : 's')), + projectSize(TUI_SEGMENTED_OPTIONS, (size) => (size === 'l' ? 'm' : 's')), + ], hostDirectives: [ { directive: TuiTextfieldOptionsDirective, @@ -53,19 +55,16 @@ class TuiFormStyles {} ], }, ], - providers: [ - tuiButtonOptionsProvider(TuiForm), - tuiNotificationOptionsProvider(TuiForm), - projectSize(TUI_HEADER_OPTIONS, (size) => HEADER_SIZE[size]!), - projectSize(TUI_SWITCH_OPTIONS, (size) => (size === 'l' ? 'm' : 's')), - projectSize(TUI_SEGMENTED_OPTIONS, (size) => (size === 'l' ? 'm' : 's')), - ], + host: { + tuiForm: '', + '[attr.data-size]': 'size', + }, }) export class TuiForm { protected readonly nothing = tuiWithStyles(TuiFormStyles); @Input('tuiForm') - size: TuiSizeS | TuiSizeL = 'l'; + public size: TuiSizeL | TuiSizeS = 'l'; } function projectSize( diff --git a/projects/layout/components/header/header.directive.ts b/projects/layout/components/header/header.directive.ts index 7447917bd1fb..a94f8884e4f8 100644 --- a/projects/layout/components/header/header.directive.ts +++ b/projects/layout/components/header/header.directive.ts @@ -6,7 +6,7 @@ import { Input, ViewEncapsulation, } from '@angular/core'; -import {tuiCreateOptions} from '@taiga-ui/cdk'; +import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di'; import {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous'; import {tuiButtonOptionsProvider} from '@taiga-ui/core/components/button'; import type {TuiSizeXXL, TuiSizeXXS} from '@taiga-ui/core/types';