Skip to content

Commit

Permalink
refactor(kit): dump legacy controls to legacy package (#7538)
Browse files Browse the repository at this point in the history
Signed-off-by: waterplea <[email protected]>
Co-authored-by: taiga-family-bot <[email protected]>
Co-authored-by: splincode <[email protected]>
  • Loading branch information
3 people authored May 24, 2024
1 parent 2aa95a8 commit f1cfb16
Show file tree
Hide file tree
Showing 406 changed files with 488 additions and 553 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ import {
TEXTFIELD_CONTROLLER_PROVIDER,
TUI_COMMON_ICONS,
TUI_TEXTFIELD_WATCHED_CONTROLLER,
TuiAppearanceDirective,
tuiAsDataListHost,
TuiDataListComponent,
TuiDataListDirective,
TuiDropdownModule,
TuiIconComponent,
TuiSvgComponent,
TuiWrapperModule,
} from '@taiga-ui/core';
import {TUI_ARROW_OPTIONS} from '@taiga-ui/kit';
import {TuiChevronDirective} from '@taiga-ui/kit';
import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';

Expand Down Expand Up @@ -78,6 +80,9 @@ const EXPIRE_COMPLETE_LENGTH = 5; // MM/YY
ResizeObserverModule,
TuiSvgComponent,
PolymorpheusModule,
TuiIconComponent,
TuiAppearanceDirective,
TuiChevronDirective,
],
templateUrl: './input-card-grouped.template.html',
styleUrls: ['./input-card-grouped.style.less'],
Expand Down Expand Up @@ -154,7 +159,6 @@ export class TuiInputCardGroupedComponent
protected readonly cardGroupedTexts$ = inject(TUI_INPUT_CARD_GROUPED_TEXTS);
protected readonly controller = inject(TUI_TEXTFIELD_WATCHED_CONTROLLER);
protected readonly icons = inject(TUI_COMMON_ICONS);
protected readonly arrowOptions = inject(TUI_ARROW_OPTIONS);

constructor() {
super(inject(TUI_INPUT_CARD_GROUPED_OPTIONS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,7 @@
}

.t-icon {
.transition(transform);
.icon-button();

&_rotated {
transform: rotate(180deg);
}
border: 0.25rem solid transparent;
}

.t-placeholder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,19 @@
[src]="text"
/>
</div>
<tui-svg
<tui-icon
*ngIf="hasCleaner"
appearance="icon"
automation-id="tui-input-card-grouped__cleaner"
tuiWrapper
tuiAppearance="icon"
class="t-icon"
[src]="icons.close"
[icon]="icons.close"
(click)="clear()"
/>
<tui-svg
<tui-icon
*ngIf="hasDropdown"
appearance="icon"
automation-id="tui-input-card-grouped__dropdown"
tuiWrapper
class="t-icon"
[class.t-icon_rotated]="open"
[src]="arrowOptions.iconLarge"
tuiAppearance="icon"
tuiChevron
(click)="toggle()"
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion projects/addon-doc/components/demo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import {
import {
TuiChevronDirective,
TuiDataListWrapperModule,
TuiSelectModule,
TuiSwitchComponent,
} from '@taiga-ui/kit';
import {TuiSelectModule} from '@taiga-ui/legacy';

const MIN_WIDTH = 160;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ import {
import {
TuiBadgeDirective,
TuiDataListWrapperModule,
TuiInputNumberModule,
TuiSelectModule,
TuiSwitchComponent,
} from '@taiga-ui/kit';
import {TuiInputNumberModule, TuiSelectModule} from '@taiga-ui/legacy';
import {merge, switchMap} from 'rxjs';

import {TuiInputOpacityDirective} from '../internal/input-opacity';
Expand Down
2 changes: 1 addition & 1 deletion projects/addon-doc/components/language-switcher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {FormControl, ReactiveFormsModule} from '@angular/forms';
import {TuiDataList, TuiFlagPipe} from '@taiga-ui/core';
import type {TuiCountryIsoCode, TuiLanguageName} from '@taiga-ui/i18n';
import {TuiLanguageSwitcher} from '@taiga-ui/i18n';
import {TuiSelectModule} from '@taiga-ui/kit';
import {TuiSelectModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ReactiveFormsModule} from '@angular/forms';
import {TuiLanguageSwitcherComponent} from '@taiga-ui/addon-doc';
import {TuiDataList, TuiFlagPipe} from '@taiga-ui/core';
import {TuiLanguageSwitcher} from '@taiga-ui/i18n';
import {TuiSelectModule} from '@taiga-ui/kit';
import {TuiSelectModule} from '@taiga-ui/legacy';

describe('TuiLanguageSwitcherComponent', () => {
let component: TuiLanguageSwitcherComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ import {
TuiTextfieldControllerModule,
TuiTextfieldOptionsDirective,
} from '@taiga-ui/core';
import type {TuiInputComponent} from '@taiga-ui/kit';
import {TuiAccordionModule, TuiInputModule} from '@taiga-ui/kit';
import {TuiAccordionModule} from '@taiga-ui/kit';
import type {TuiInputComponent} from '@taiga-ui/legacy';
import {TuiInputModule} from '@taiga-ui/legacy';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';
import {combineLatest, filter, map, switchMap, take} from 'rxjs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import {
TuiHostedDropdownComponent,
tuiSlideInTop,
} from '@taiga-ui/core';
import {TUI_MOBILE_CALENDAR} from '@taiga-ui/kit';
import {
TUI_MOBILE_CALENDAR,
TuiInputDateComponent,
TuiInputDateMultiComponent,
TuiInputDateRangeComponent,
} from '@taiga-ui/kit';
} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
Output,
} from '@angular/core';
import {EMPTY_QUERY, TuiMapperPipe} from '@taiga-ui/cdk';
import {TuiSvgComponent} from '@taiga-ui/core';
import {TUI_ARROW_OPTIONS} from '@taiga-ui/kit';
import {TuiIconComponent} from '@taiga-ui/core';
import {TuiChevronDirective} from '@taiga-ui/kit';
import type {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';
import {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';

Expand All @@ -31,9 +31,10 @@ import {TuiTrComponent} from '../tr/tr.component';
NgForOf,
NgIf,
NgTemplateOutlet,
TuiSvgComponent,
TuiMapperPipe,
PolymorpheusModule,
TuiIconComponent,
TuiChevronDirective,
],
templateUrl: './tbody.template.html',
styleUrls: ['./tbody.style.less'],
Expand Down Expand Up @@ -62,7 +63,6 @@ export class TuiTbodyComponent<T extends Partial<Record<keyof T, any>>> {
@ContentChild(forwardRef(() => TuiRowDirective))
protected readonly row?: TuiRowDirective<T>;

protected readonly arrowOptions = inject(TUI_ARROW_OPTIONS);
protected readonly table = inject<TuiTableDirective<T>>(
forwardRef(() => TuiTableDirective),
);
Expand Down
6 changes: 0 additions & 6 deletions projects/addon-table/components/table/tbody/tbody.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@
}

.t-chevron {
.transition(transform);

position: sticky;
right: 0.75rem;
margin: 0 0.6875rem 0 auto;

&_rotated {
transform: rotate(180deg);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
{{ text }}
</ng-container>
</span>
<tui-svg
<tui-icon
class="t-chevron"
[class.t-chevron_rotated]="open"
[src]="arrowOptions.iconLarge"
[tuiChevron]="open"
/>
</button>
</th>
Expand Down
16 changes: 8 additions & 8 deletions projects/cdk/constants/used-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ export const TUI_USED_ICONS = [
'tuiIconChevronRight',
'tuiIconChevronLeft',
'tuiIconCalendarLarge',
'tuiIconChevronDown',
'tuiIconChevronDownLarge',
'tuiIconMinusLarge',
'tuiIconMinus',
'tuiIconFileLarge',
'tuiIconCheckCircleLarge',
'tuiIconAlertCircleLarge',
'tuiIconTrashLarge',
'tuiIconCopy',
'tuiIconPlus',
'tuiIconEyeLarge',
'tuiIconEyeOffLarge',
'tuiIconClock',
'tuiIconClockLarge',
'tuiIconStarLarge',
'tuiIconChevronDown',
'tuiIconCalendar',
'tuiIconRotate',
'tuiIconArrowLeft',
'tuiIconArrowRight',
'tuiIconPlus',
'tuiIconMinimize',
'tuiIconChevronDownLarge',
'tuiIconCopy',
'tuiIconEyeLarge',
'tuiIconEyeOffLarge',
'tuiIconClock',
'tuiIconClockLarge',
] as const;
2 changes: 1 addition & 1 deletion projects/core/components/data-list/option.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class TuiOptionComponent<T = unknown> implements OnDestroy {

// @bad TODO: Consider aria-activedescendant for proper accessibility implementation
protected onMouseMove(): void {
if (this.isMobile && !tuiIsNativeFocused(this.el)) {
if (!this.isMobile && !tuiIsNativeFocused(this.el)) {
this.el.focus({preventScroll: true});
}
}
Expand Down
1 change: 1 addition & 0 deletions projects/core/components/icon/icon.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
font-size: 1.5rem;
flex-shrink: 0;
vertical-align: middle;
box-sizing: border-box;

&._duo {
mask: var(--t-mask-bg) no-repeat center/contain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {TuiDataList, TuiTextfieldControllerModule} from '@taiga-ui/core';
import {
TuiSelectModule,
TuiStringifyContentPipeModule,
TuiStringifyPipe,
} from '@taiga-ui/kit';
import {TuiStringifyContentPipeModule, TuiStringifyPipe} from '@taiga-ui/kit';
import {TuiSelectModule} from '@taiga-ui/legacy';

import {VersionManagerComponent} from './version-manager.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiAmountPipe} from '@taiga-ui/addon-commerce';
import {TuiButtonDirective, TuiSvgComponent} from '@taiga-ui/core';
import {
TuiAccordionModule,
TuiDataListWrapperModule,
TuiInputModule,
TuiSelectModule,
} from '@taiga-ui/kit';
import {TuiAccordionModule, TuiDataListWrapperModule} from '@taiga-ui/kit';
import {TuiInputModule, TuiSelectModule} from '@taiga-ui/legacy';

class Account {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiArcChartComponent} from '@taiga-ui/addon-charts';
import {TuiAmountPipe} from '@taiga-ui/addon-commerce';
import {TuiInputNumberModule} from '@taiga-ui/kit';
import {TuiInputNumberModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
TuiBadgedContentComponent,
TuiBadgeDirective,
TuiBadgeNotificationComponent,
TuiInputModule,
} from '@taiga-ui/kit';
import {TuiInputModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiAxesComponent, TuiBarChartComponent} from '@taiga-ui/addon-charts';
import type {TuiContext} from '@taiga-ui/cdk';
import {tuiFormatNumber, TuiHint} from '@taiga-ui/core';
import {TuiDataListWrapperModule, TuiSelectModule} from '@taiga-ui/kit';
import {TuiDataListWrapperModule} from '@taiga-ui/kit';
import {TuiSelectModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ import {
TuiDropdownModule,
TuiLinkDirective,
} from '@taiga-ui/core';
import {
TuiBreadcrumbsModule,
tuiBreadcrumbsOptionsProvider,
TuiInputNumberModule,
} from '@taiga-ui/kit';
import {TuiBreadcrumbsModule, tuiBreadcrumbsOptionsProvider} from '@taiga-ui/kit';
import {TuiInputNumberModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
3 changes: 2 additions & 1 deletion projects/demo/src/modules/components/calendar-month/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
TuiYear,
} from '@taiga-ui/cdk';
import {TuiLinkDirective} from '@taiga-ui/core';
import {TuiCalendarMonthModule, TuiInputMonthRangeModule} from '@taiga-ui/kit';
import {TuiCalendarMonthModule} from '@taiga-ui/kit';
import {TuiInputMonthRangeModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
7 changes: 2 additions & 5 deletions projects/demo/src/modules/components/cell/examples/7/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ import {
TuiSurfaceDirective,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
import {
TuiAvatarComponent,
TuiDataListWrapperModule,
TuiSelectModule,
} from '@taiga-ui/kit';
import {TuiAvatarComponent, TuiDataListWrapperModule} from '@taiga-ui/kit';
import {TuiCardLargeDirective, TuiCellDirective} from '@taiga-ui/layout';
import {TuiSelectModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import {encapsulation} from '@demo/emulate/encapsulation';
import {assets} from '@demo/utils';
import {TUI_DEFAULT_MATCHER, TuiLetDirective} from '@taiga-ui/cdk';
import {TuiInitialsPipe, TuiTextfieldControllerModule} from '@taiga-ui/core';
import {
TuiAvatarComponent,
TuiComboBoxModule,
TuiDataListWrapperModule,
} from '@taiga-ui/kit';
import {TuiAvatarComponent, TuiDataListWrapperModule} from '@taiga-ui/kit';
import {TuiComboBoxModule} from '@taiga-ui/legacy';
import type {Observable} from 'rxjs';
import {delay, filter, of, startWith, Subject, switchMap} from 'rxjs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
TuiLoaderComponent,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
import {TuiAvatarComponent, TuiComboBoxModule} from '@taiga-ui/kit';
import {TuiAvatarComponent} from '@taiga-ui/kit';
import {TuiComboBoxModule} from '@taiga-ui/legacy';

import {databaseMockData} from './database-mock-data';
import {RequestService} from './request.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import {Component} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {changeDetection} from '@demo/emulate/change-detection';
import {
TuiComboBoxModule,
TuiDataListWrapperModule,
TuiFilterByInputPipeModule,
} from '@taiga-ui/kit';
import {TuiDataListWrapperModule, TuiFilterByInputPipeModule} from '@taiga-ui/kit';
import {TuiComboBoxModule} from '@taiga-ui/legacy';

@Component({
standalone: true,
Expand Down
Loading

0 comments on commit f1cfb16

Please sign in to comment.