Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: Icon component move to core, make standalone #6965

Merged
merged 5 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,8 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifier[] = [
from: {name: 'tuiStringHashToHsl', moduleSpecifier: '@taiga-ui/kit'},
to: {name: 'tuiStringHashToHsl', moduleSpecifier: '@taiga-ui/core'},
},
{
from: {name: 'TuiIconModule', moduleSpecifier: '@taiga-ui/experimental'},
to: {name: 'TuiIconComponent', moduleSpecifier: '@taiga-ui/core'},
},
];
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core';
import type {TuiStringHandler} from '@taiga-ui/cdk';
import {TUI_ICON_RESOLVER} from '@taiga-ui/core';
import {TUI_ICON_RESOLVER} from '@taiga-ui/core/tokens';

@Component({
standalone: true,
selector: 'tui-icon',
template: '',
host: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './icon.component';
export * from './icon.module';
1 change: 1 addition & 0 deletions projects/core/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export * from '@taiga-ui/core/components/expand';
export * from '@taiga-ui/core/components/group';
export * from '@taiga-ui/core/components/hints-host';
export * from '@taiga-ui/core/components/hosted-dropdown';
export * from '@taiga-ui/core/components/icon';
export * from '@taiga-ui/core/components/label';
export * from '@taiga-ui/core/components/link';
export * from '@taiga-ui/core/components/loader';
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ export const ROUTES: Routes = [
},
},
{
path: 'experimental/icon',
path: 'components/icon',
loadChildren: async () =>
(await import('../experimental/icon/icon.module')).ExampleTuiIconModule,
(await import('../components/icon/icon.module')).ExampleTuiIconModule,
data: {
title: 'Icon',
},
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/app/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,10 +891,10 @@ export const pages: TuiDocPages = [
route: '/experimental/header',
},
{
section: 'Experimental',
section: 'Components',
title: 'Icon',
keywords: 'icons, image, картинка, свг, svg, графика, иконка',
route: '/experimental/icon',
route: '/components/icon',
},
{
section: 'Experimental',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiPlatformModule} from '@taiga-ui/cdk';
import {TuiIconModule} from '@taiga-ui/experimental';
import {TuiIconComponent} from '@taiga-ui/core';
import {TuiBadgeDirective} from '@taiga-ui/kit';

@Component({
standalone: true,
selector: 'tui-badge-example-3',
imports: [TuiBadgeDirective, TuiPlatformModule, TuiIconModule],
imports: [TuiBadgeDirective, TuiPlatformModule, TuiIconComponent],
templateUrl: './index.html',
styleUrls: ['./index.less'],
encapsulation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc';
import {TuiPlatformModule} from '@taiga-ui/cdk';
import {TuiFallbackSrcPipe, TuiNotificationModule} from '@taiga-ui/core';
import {TuiButtonModule, TuiIconModule} from '@taiga-ui/experimental';
import {
TuiFallbackSrcPipe,
TuiIconComponent,
TuiNotificationModule,
} from '@taiga-ui/core';
import {TuiButtonModule} from '@taiga-ui/experimental';
import {
TuiAvatarComponent,
TuiBadgedContentComponent,
Expand All @@ -22,7 +26,7 @@ import {TuiBadgedContentExample3} from './examples/3';
imports: [
CommonModule,
TuiBadgeNotificationComponent,
TuiIconModule,
TuiIconComponent,
TuiBadgeDirective,
TuiBadgedContentComponent,
TuiAvatarComponent,
Expand Down
5 changes: 2 additions & 3 deletions projects/demo/src/modules/components/block/block.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import {NgModule} from '@angular/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {TuiExamplePipe} from '@demo/utils';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiGroupDirective, TuiTooltipModule} from '@taiga-ui/core';
import {TuiGroupDirective, TuiIconComponent, TuiTooltipModule} from '@taiga-ui/core';
import {
TuiCheckboxModule,
TuiIconModule,
TuiRadioComponent,
TuiTitleModule,
TuiToggleModule,
Expand All @@ -32,7 +31,7 @@ import {TuiBlockExample3} from './examples/3';
TuiFadeDirective,
TuiTitleModule,
TuiToggleModule,
TuiIconModule,
TuiIconComponent,
TuiExamplePipe,
tuiGetDocModules(ExampleTuiBlockComponent),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
```ts
import {NgModule} from '@angular/core';
import {TuiIconModule} from '@taiga-ui/experimental';
import {TuiIconComponent} from '@taiga-ui/core';
// ...

@NgModule({
imports: [
// ...
TuiIconModule,
TuiIconComponent,
],
})
export class MyModule {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core';
import {TuiIconModule} from '@taiga-ui/experimental';
import {TuiIconComponent, TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core';

import {TuiIconExample1} from './examples/1';
import {TuiIconExample2} from './examples/2';
Expand All @@ -12,7 +11,7 @@ import {ExampleTuiIconComponent} from './icon.component';
@NgModule({
imports: [
CommonModule,
TuiIconModule,
TuiIconComponent,
TuiLinkModule,
TuiNotificationModule,
tuiGetDocModules(ExampleTuiIconComponent),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import {
TuiDataListModule,
TuiDropdownDirective,
TuiDropdownOpenDirective,
TuiIconComponent,
TuiNotificationModule,
} from '@taiga-ui/core';
import {
TuiButtonModule,
TuiCardModule,
TuiCellModule,
TuiCheckboxModule,
TuiIconModule,
TuiSurfaceModule,
TuiTitleModule,
TuiToggleModule,
Expand Down Expand Up @@ -49,7 +49,7 @@ import {ExampleTuiSwipeActionsComponent} from './swipe-actions.component';
TuiSwipeActionsAutoCloseDirective,
TuiAmountPipe,
TuiBadgedContentComponent,
TuiIconModule,
TuiIconComponent,
TuiToggleModule,
TuiBadgeComponent,
TuiNotificationModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import {NgModule} from '@angular/core';
import {ReactiveFormsModule} from '@angular/forms';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiActiveZoneModule} from '@taiga-ui/cdk';
import {TuiDataListModule, TuiDropdownModule, TuiGroupDirective} from '@taiga-ui/core';
import {TuiButtonModule, TuiIconModule} from '@taiga-ui/experimental';
import {
TuiDataListModule,
TuiDropdownModule,
TuiGroupDirective,
TuiIconComponent,
} from '@taiga-ui/core';
import {TuiButtonModule} from '@taiga-ui/experimental';
import {
TuiDataListWrapperModule,
TuiSelectModule,
Expand Down Expand Up @@ -32,7 +37,7 @@ import {TuiDropdownHoverExample4} from './examples/4';
TuiToggleModule,
TuiDataListModule,
TuiGroupDirective,
TuiIconModule,
TuiIconComponent,
DropdownDocumentationModule,
tuiGetDocModules(ExampleTuiDropdownHoverComponent),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiNotificationModule} from '@taiga-ui/core';
import {
TuiButtonGroupModule,
TuiIconModule,
TuiSurfaceModule,
} from '@taiga-ui/experimental';
import {TuiIconComponent, TuiNotificationModule} from '@taiga-ui/core';
import {TuiButtonGroupModule, TuiSurfaceModule} from '@taiga-ui/experimental';

import {ExampleTuiButtonGroupComponent} from './button-group.component';
import {TuiButtonGroupExample1} from './examples/1';
Expand All @@ -16,7 +12,7 @@ import {TuiButtonGroupExample3} from './examples/3';
@NgModule({
imports: [
CommonModule,
TuiIconModule,
TuiIconComponent,
TuiSurfaceModule,
TuiNotificationModule,
TuiButtonGroupModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {CommonModule} from '@angular/common';
import {NgModule} from '@angular/core';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiNotificationModule} from '@taiga-ui/core';
import {TuiButtonModule, TuiIconModule} from '@taiga-ui/experimental';
import {TuiIconComponent, TuiNotificationModule} from '@taiga-ui/core';
import {TuiButtonModule} from '@taiga-ui/experimental';
import {TuiAvatarComponent} from '@taiga-ui/kit';

import {ExampleTuiButtonComponent} from './button.component';
Expand All @@ -17,7 +17,7 @@ import {TuiButtonExample5} from './examples/5';
CommonModule,
TuiButtonModule,
TuiNotificationModule,
TuiIconModule,
TuiIconComponent,
TuiAvatarComponent,
tuiGetDocModules(ExampleTuiButtonComponent),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
TuiFallbackSrcPipe,
TuiHintModule,
TuiHostedDropdownModule,
TuiIconComponent,
TuiInitialsPipe,
TuiLinkModule,
TuiNotificationModule,
Expand All @@ -24,7 +25,6 @@ import {
TuiCardModule,
TuiCellModule,
TuiHeaderDirective,
TuiIconModule,
TuiSurfaceModule,
TuiThumbnailCardModule,
TuiTitleModule,
Expand Down Expand Up @@ -70,7 +70,7 @@ import {TuiCardLargeExample12} from './examples/12';
FormsModule,
TuiRippleModule,
TuiThumbnailCardModule,
TuiIconModule,
TuiIconComponent,
TuiButtonModule,
TuiHeaderDirective,
TuiCellModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
TuiFallbackSrcPipe,
TuiHintModule,
TuiHostedDropdownModule,
TuiIconComponent,
TuiInitialsPipe,
TuiLinkModule,
TuiNotificationModule,
Expand All @@ -23,7 +24,6 @@ import {
TuiCardModule,
TuiCellModule,
TuiHeaderDirective,
TuiIconModule,
TuiSurfaceModule,
TuiThumbnailCardModule,
TuiTitleModule,
Expand Down Expand Up @@ -64,7 +64,7 @@ import {TuiCardMediumExample7} from './examples/7';
FormsModule,
TuiRippleModule,
TuiThumbnailCardModule,
TuiIconModule,
TuiIconComponent,
TuiButtonModule,
TuiHeaderDirective,
TuiCellModule,
Expand Down
4 changes: 2 additions & 2 deletions projects/demo/src/modules/experimental/cell/cell.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {
TuiGroupDirective,
TuiHostedDropdownModule,
TuiIconComponent,
TuiLabelModule,
TuiLinkModule,
TuiLoaderModule,
Expand All @@ -17,7 +18,6 @@ import {
TuiCardModule,
TuiCellModule,
TuiCheckboxModule,
TuiIconModule,
TuiSurfaceModule,
TuiThumbnailCardModule,
TuiTitleModule,
Expand Down Expand Up @@ -63,7 +63,7 @@ import {TuiCellExample7} from './examples/7';
TuiToggleModule,
TuiTooltipModule,
TuiTitleModule,
TuiIconModule,
TuiIconComponent,
TuiCheckboxModule,
TuiLoaderModule,
TuiSensitiveDirective,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {
TuiIconComponent,
TuiNotificationModule,
TuiTextfieldControllerModule,
TuiTooltipModule,
} from '@taiga-ui/core';
import {
TuiButtonModule,
TuiHeaderDirective,
TuiIconModule,
TuiTitleModule,
TuiToggleModule,
} from '@taiga-ui/experimental';
Expand Down Expand Up @@ -38,7 +38,7 @@ import {ExampleTuiCellComponent} from './header.component';
TuiTooltipModule,
TuiHeaderDirective,
TuiTitleModule,
TuiIconModule,
TuiIconComponent,
TuiSensitiveDirective,
TuiSelectModule,
TuiDataListWrapperModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import {TuiExamplePipe, TuiSetupComponent} from '@demo/utils';
import {tuiGetDocModules} from '@taiga-ui/addon-doc';
import {TuiIconComponent} from '@taiga-ui/core';
import {
TuiCheckboxModule,
TuiIconModule,
TuiLabelDirective,
TuiRadioComponent,
TuiTextfieldComponent,
Expand Down Expand Up @@ -36,7 +36,7 @@ import {ExampleTuiLabelComponent} from './label.component';
TuiSetupComponent,
tuiGetDocModules(ExampleTuiLabelComponent),
TuiToggleModule,
TuiIconModule,
TuiIconComponent,
TuiTextfieldComponent,
TuiTextfieldDirective,
TuiTooltipModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {
TuiDataListModule,
TuiDropdownModule,
TuiExpandModule,
TuiIconComponent,
TuiLinkModule,
TuiNotificationModule,
} from '@taiga-ui/core';
import {
TuiButtonModule,
TuiCardModule,
TuiHeaderDirective,
TuiIconModule,
TuiNavigationModule,
TuiSurfaceModule,
TuiTitleModule,
Expand Down Expand Up @@ -44,7 +44,7 @@ import {ExampleTuiNavigationComponent} from './navigation.component';
TuiNavigationModule,
TuiAvatarComponent,
TuiButtonModule,
TuiIconModule,
TuiIconComponent,
TuiBadgeDirective,
TuiBadgeNotificationComponent,
TuiDropdownModule,
Expand Down
Loading
Loading