Skip to content

Commit

Permalink
chore: apply changes after linting [bot]
Browse files Browse the repository at this point in the history
  • Loading branch information
taiga-family-bot authored and github-actions[bot] committed Dec 6, 2024
1 parent 9a57872 commit 1799941
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion projects/cdk/utils/di/create-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function tuiCreateOptions<T>(
defaults: T,
): [
token: InjectionToken<T>,
provider: (item: ProviderToken<Partial<T>> | Partial<T>) => FactoryProvider,
provider: (item: Partial<T> | ProviderToken<Partial<T>>) => FactoryProvider,
] {
const token = tuiCreateToken(defaults);

Expand Down
2 changes: 1 addition & 1 deletion projects/cdk/utils/miscellaneous/provide-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {inject} from '@angular/core';

export function tuiProvideOptions<T>(
provide: InjectionToken<T>,
options: ProviderToken<Partial<T>> | Partial<T>,
options: Partial<T> | ProviderToken<Partial<T>>,
fallback: T,
): FactoryProvider {
return {
Expand Down
2 changes: 1 addition & 1 deletion projects/core/components/button/button.options.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
18 changes: 9 additions & 9 deletions projects/demo/src/modules/components/form/examples/1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ const ICON =
TuiDataListDropdownManager,
TuiDropdown,
TuiFade,
TuiForm,
TuiHeader,
TuiIcon,
TuiNavigation,
TuiRepeatTimes,
TuiSwitch,
TuiTabs,
TuiTitle,
TuiForm,
TuiTextfield,
TuiTitle,
],
templateUrl: './index.html',
encapsulation,
Expand Down
4 changes: 2 additions & 2 deletions projects/kit/components/segmented/segmented.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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({
Expand Down
27 changes: 13 additions & 14 deletions projects/layout/components/form/form.directive.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion projects/layout/components/header/header.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 1799941

Please sign in to comment.