Skip to content

Commit

Permalink
chore: remove legacy radio
Browse files Browse the repository at this point in the history
  • Loading branch information
waterplea authored and splincode committed Mar 27, 2024
1 parent 90ef9f6 commit 10b5e96
Show file tree
Hide file tree
Showing 98 changed files with 502 additions and 1,914 deletions.
2 changes: 2 additions & 0 deletions projects/cdk/abstract/interactive.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Directive, EventEmitter, HostBinding, Input, Output} from '@angular/core';
import {tuiPure} from '@taiga-ui/cdk/decorators';

const TUI = 'tui_interactive_';

Expand Down Expand Up @@ -73,6 +74,7 @@ export abstract class AbstractTuiInteractive {
return this.nativeId || this.autoIdString;
}

@tuiPure
protected updateFocused(focused: boolean): void {
this.focusedChange.emit(focused);
}
Expand Down
8 changes: 6 additions & 2 deletions projects/core/components/expand/expand.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ export class TuiExpandComponent {
}

@HostListener('transitionend.self', ['$event'])
protected onTransitionEnd({propertyName}: TransitionEvent): void {
if (propertyName === 'opacity' && this.state === State.Animated) {
protected onTransitionEnd({propertyName, pseudoElement}: TransitionEvent): void {
if (
propertyName === 'opacity' &&
!pseudoElement &&
this.state === State.Animated
) {
this.state = State.Idle;
}
}
Expand Down
28 changes: 4 additions & 24 deletions projects/demo/src/modules/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,6 @@ export const ROUTES: Routes = [
title: 'Chip',
},
},
{
path: 'experimental/radio',
loadChildren: async () =>
(await import('../experimental/radio/radio.module')).ExampleTuiRadioModule,
data: {
title: 'Radio ',
},
},
route({
path: 'components/title',
title: 'Title',
Expand Down Expand Up @@ -913,23 +905,11 @@ export const ROUTES: Routes = [
title: 'Pagination',
},
},
{
route({
path: 'components/radio',
loadChildren: async () =>
(await import('../components/radio/radio.module')).ExampleTuiRadioModule,
data: {
title: 'Radio',
},
},
{
path: 'components/radio-list',
loadChildren: async () =>
(await import('../components/radio-list/radio-list.module'))
.ExampleTuiRadioListModule,
data: {
title: 'RadioList',
},
},
title: 'Radio',
loadComponent: async () => import('../components/radio'),
}),
{
path: 'components/rating',
loadChildren: async () =>
Expand Down
13 changes: 0 additions & 13 deletions projects/demo/src/modules/app/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ export const pages: TuiDocPages = [
keywords: 'инпут, форма, ввод, radio, радио',
route: '/components/radio',
},
// TODO: Move into Radio page
{
section: 'Components',
title: 'RadioList',
keywords: 'инпут, форма, ввод, radio, радио, список, list',
route: '/components/radio-list',
},
{
section: 'Components',
title: 'Switch',
Expand Down Expand Up @@ -971,12 +964,6 @@ export const pages: TuiDocPages = [
keywords: 'tooltip, тултип, hint, подсказка, помощь, help',
route: '/experimental/tooltip',
},
{
section: 'Experimental',
title: 'Radio ',
keywords: 'чек, радио, ввод, форма, form, checkbox, radio, toggle',
route: '/experimental/radio',
},
{
section: 'Pipes',
title: 'Amount',
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/components/badge/badge.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
type TuiRawLoaderContent,
} from '@taiga-ui/addon-doc';
import {TuiLabelModule, type TuiSizeS, type TuiSizeXL} from '@taiga-ui/core';
import {TuiBadgeDirective, TuiFadeDirective, TuiRadioListModule} from '@taiga-ui/kit';
import {TuiBadgeDirective, TuiFadeDirective, TuiRadioListComponent} from '@taiga-ui/kit';

import {TuiBadgeExample1} from './examples/1';
import {TuiBadgeExample2} from './examples/2';
Expand All @@ -30,7 +30,7 @@ import {TuiBadgeExample6} from './examples/6';
NgIf,
TuiFadeDirective,
TuiLabelModule,
TuiRadioListModule,
TuiRadioListComponent,
FormsModule,

TuiBadgeExample1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@
class="tui-space_vertical-3"
>
<tui-radio-list
orientation="horizontal"
name="content-type"
size="s"
[items]="contentTypeVariants"
[style.flex-direction]="'row'"
[(ngModel)]="contentType"
/>
</label>
Expand Down
2 changes: 1 addition & 1 deletion projects/demo/src/modules/components/block/block.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
TuiTitleDirective,
TuiTooltipModule,
} from '@taiga-ui/core';
import {TuiRadioComponent} from '@taiga-ui/experimental';
import {
TuiAvatarComponent,
TuiBlockDirective,
TuiCheckboxComponent,
TuiFadeDirective,
TuiRadioComponent,
TuiSwitchComponent,
} from '@taiga-ui/kit';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<p>
<input
checked
tuiCheckbox
type="checkbox"
/>
</p>
<p>
<input
tuiCheckbox
type="checkbox"
/>
</p>
<p>
<input
tuiCheckbox
type="checkbox"
[checked]="checked"
/>
</p>
<button
tuiButton
(click)="checked = !checked"
>
Toggle
</button>
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiButtonModule} from '@taiga-ui/experimental';
import {TuiCheckboxComponent} from '@taiga-ui/kit';

@Component({
selector: 'tui-radio-example-2',
standalone: true,
imports: [TuiCheckboxComponent, TuiButtonModule],
templateUrl: './index.html',
encapsulation,
changeDetection,
})
export class TuiRadioExample2 {
protected value: any = null;
protected identityMatcher = (a: any, b: any): boolean => a?.test === b?.test;
export default class ExampleComponent {
protected checked = false;
}
8 changes: 8 additions & 0 deletions projects/demo/src/modules/components/checkbox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
CSS variable to customize color of native control emulation
</tui-notification>
</tui-doc-example>

<tui-doc-example
id="decorative"
description="If you only want to show checkbox for decorative purpose, without it being interactive — use it without Angular forms"
heading="Decorative"
[component]="2 | tuiComponent"
[content]="2 | tuiExample: 'html,ts'"
/>
</ng-template>

<tui-setup *pageTab="'Setup'" />
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/components/dialog/dialog.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
TuiInputModule,
TuiInputNumberModule,
TuiMarkerIconModule,
TuiRadioListModule,
TuiRadioListComponent,
} from '@taiga-ui/kit';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';

Expand Down Expand Up @@ -55,7 +55,7 @@ import {TuiDialogExampleComponent10} from './examples/10';
TuiAccordionModule,
TuiAmountPipe,
TuiButtonModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiInputModule,
TuiHintModule,
TuiLinkModule,
Expand Down
3 changes: 2 additions & 1 deletion projects/demo/src/modules/components/group/group.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
TuiTextfieldControllerModule,
TuiTitleDirective,
} from '@taiga-ui/core';
import {TuiButtonModule, TuiRadioComponent} from '@taiga-ui/experimental';
import {TuiButtonModule} from '@taiga-ui/experimental';
import {
TuiBadgeDirective,
TuiBlockDirective,
Expand All @@ -24,6 +24,7 @@ import {
TuiInputNumberModule,
TuiMultiSelectModule,
TuiProjectClassModule,
TuiRadioComponent,
TuiSelectModule,
} from '@taiga-ui/kit';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import {
TuiFieldErrorPipeModule,
TuiInputDateModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiUnfinishedValidatorModule,
} from '@taiga-ui/kit';

Expand All @@ -38,7 +38,7 @@ import {ExampleTuiInputDateComponent} from './input-date.component';
FormsModule,
CommonModule,
TuiLinkModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiButtonModule,
TuiInputDateModule,
TuiMobileCalendarDialogModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
TuiSvgModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
import {TuiInputNumberModule, TuiRadioListModule} from '@taiga-ui/kit';
import {TuiInputNumberModule, TuiRadioListComponent} from '@taiga-ui/kit';

import {InheritedDocumentationModule} from '../abstract/inherited-documentation/inherited-documentation.module';
import {TuiInputNumberExample1} from './examples/1';
Expand All @@ -33,7 +33,7 @@ import {ExampleTuiInputNumberComponent} from './input-number.component';
TuiInputNumberModule,
TuiCurrencyPipeModule,
TuiSvgModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiButtonModule,
TuiLinkModule,
TuiTextfieldControllerModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import {
TuiInputRangeModule,
TuiInputSliderModule,
TuiRadioListModule,
TuiRadioListComponent,
} from '@taiga-ui/kit';

import {InheritedDocumentationModule} from '../abstract/inherited-documentation/inherited-documentation.module';
Expand All @@ -36,7 +36,7 @@ import {ExampleTuiInputRangeComponent} from './input-range.component';
ReactiveFormsModule,
FormsModule,
CommonModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiAddonDocModule,
TuiButtonModule,
TuiLinkModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import {
TuiInputRangeModule,
TuiInputSliderModule,
TuiRadioListModule,
TuiRadioListComponent,
} from '@taiga-ui/kit';

import {InheritedDocumentationModule} from '../abstract/inherited-documentation/inherited-documentation.module';
Expand All @@ -34,7 +34,7 @@ import {ExampleTuiInputSliderComponent} from './input-slider.component';
ReactiveFormsModule,
FormsModule,
CommonModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiButtonModule,
TuiHintModule,
TuiAddonDocModule,
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/components/input/input.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
TuiInputDateModule,
TuiInputModule,
TuiInputNumberModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiSelectModule,
TuiUnmaskHandlerModule,
} from '@taiga-ui/kit';
Expand Down Expand Up @@ -70,7 +70,7 @@ import {ExampleTuiInputComponent} from './input.component';
TuiNotificationModule,
TuiRepeatTimesModule,
TuiSvgModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiButtonModule,
TuiInputCardModule,
TuiAvatarComponent,
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/components/loader/loader.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc';
import {TuiButtonModule, TuiLinkModule, TuiLoaderModule} from '@taiga-ui/core';
import {TuiRadioListModule} from '@taiga-ui/kit';
import {TuiRadioListComponent} from '@taiga-ui/kit';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';

import {TuiLoaderExample1} from './examples/1';
Expand All @@ -20,7 +20,7 @@ import {ExampleTuiLoaderComponent} from './loader.component';
FormsModule,
PolymorpheusModule,
TuiLoaderModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiButtonModule,
TuiLinkModule,
RouterModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
TuiAvatarComponent,
TuiDataListWrapperModule,
TuiMultiSelectModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiTagModule,
} from '@taiga-ui/kit';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';
Expand All @@ -48,7 +48,7 @@ import {ExampleTuiMultiSelectComponent} from './multi-select.component';
ScrollingModule,
TuiScrollbarComponent,
TuiMultiSelectModule,
TuiRadioListModule,
TuiRadioListComponent,
TuiButtonModule,
TuiLinkModule,
TuiAvatarComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
TuiBadgeDirective,
TuiInputSliderModule,
TuiPaginationModule,
TuiRadioListModule,
TuiRadioListComponent,
} from '@taiga-ui/kit';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';

Expand All @@ -24,7 +24,7 @@ import {ExampleTuiPaginationComponent} from './pagination.component';
TuiPaginationModule,
TuiInputSliderModule,
CommonModule,
TuiRadioListModule,
TuiRadioListComponent,
FormsModule,
ReactiveFormsModule,
TuiAddonDocModule,
Expand Down
Loading

0 comments on commit 10b5e96

Please sign in to comment.