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

chore(demo): use new modern Angular routing approach for documentation section Recipes #910

Merged
merged 1 commit into from
Jan 16, 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
27 changes: 7 additions & 20 deletions projects/demo/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,14 @@ export const appRoutes: Routes = [
},
{
path: DemoPath.Card,
loadChildren: () =>
import('../pages/recipes/card/card-doc.module').then(m => m.CardDocModule),
loadComponent: () => import('../pages/recipes/card/card-doc.component'),
data: {
title: 'Card',
},
},
{
path: DemoPath.Phone,
loadChildren: () =>
import('../pages/recipes/phone/phone-doc.module').then(m => m.PhoneDocModule),
loadComponent: () => import('../pages/recipes/phone/phone-doc.component'),
data: {
title: 'Phone',
},
Expand All @@ -206,40 +204,29 @@ export const appRoutes: Routes = [
},
{
path: DemoPath.Textarea,
loadChildren: () =>
import('../pages/recipes/textarea/textarea-doc.module').then(
m => m.TextareaDocModule,
),
loadComponent: () => import('../pages/recipes/textarea/textarea-doc.component'),
data: {
title: 'Textarea',
},
},
{
path: DemoPath.Prefix,
loadChildren: () =>
import('../pages/recipes/prefix/prefix-doc.module').then(
m => m.PrefixDocModule,
),
loadComponent: () => import('../pages/recipes/prefix/prefix-doc.component'),
data: {
title: 'With prefix',
},
},
{
path: DemoPath.Postfix,
loadChildren: () =>
import('../pages/recipes/postfix/postfix-doc.module').then(
m => m.PostfixDocModule,
),
loadComponent: () => import('../pages/recipes/postfix/postfix-doc.component'),
data: {
title: 'With postfix',
},
},
{
path: DemoPath.Placeholder,
loadChildren: () =>
import('../pages/recipes/placeholder/placeholder-doc.module').then(
m => m.PlaceholderDocModule,
),
loadComponent: () =>
import('../pages/recipes/placeholder/placeholder-doc.component'),
data: {
title: 'With placeholder',
},
Expand Down
12 changes: 3 additions & 9 deletions projects/demo/src/pages/recipes/card/card-doc.component.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {RouterLink} from '@angular/router';
import {DemoPath} from '@demo/constants';
import {TuiDocExample, TuiDocExampleModule, TuiDocPageModule} from '@taiga-ui/addon-doc';
import {TuiAddonDocModule, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiLinkModule} from '@taiga-ui/core';

import {CardDocExample1} from './examples/1-basic/component';

@Component({
standalone: true,
selector: 'card-doc',
imports: [
TuiDocPageModule,
TuiLinkModule,
RouterLink,
TuiDocExampleModule,
CardDocExample1,
],
imports: [TuiAddonDocModule, TuiLinkModule, RouterLink, CardDocExample1],
templateUrl: './card-doc.template.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CardDocComponent {
export default class CardDocComponent {
readonly maskExpressionDocPage = `/${DemoPath.MaskExpression}`;
readonly dateMaskDocPage = `/${DemoPath.Date}`;

Expand Down
28 changes: 0 additions & 28 deletions projects/demo/src/pages/recipes/card/card-doc.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ import {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms';
import {MaskitoDirective} from '@maskito/angular';
import {MaskitoOptions} from '@maskito/core';
import {maskitoDateOptionsGenerator} from '@maskito/kit';
import {TuiGroupModule, TuiPrimitiveTextfieldModule} from '@taiga-ui/core';
import {TuiGroupModule} from '@taiga-ui/core';
import {TuiInputModule} from '@taiga-ui/kit';

@Component({
standalone: true,
selector: 'card-doc-example-1',
imports: [
ReactiveFormsModule,
TuiGroupModule,
TuiInputModule,
TuiPrimitiveTextfieldModule,
MaskitoDirective,
],
imports: [ReactiveFormsModule, TuiGroupModule, TuiInputModule, MaskitoDirective],
templateUrl: './template.html',
styleUrls: ['./style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {FormsModule} from '@angular/forms';
import {MaskitoDirective} from '@maskito/angular';
import {
TuiFlagPipeModule,
TuiPrimitiveTextfieldModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
import {TuiFlagPipeModule, TuiTextfieldControllerModule} from '@taiga-ui/core';
import {TuiInputModule} from '@taiga-ui/kit';

import mask from './mask';
Expand All @@ -14,13 +10,11 @@ import mask from './mask';
standalone: true,
selector: 'phone-doc-example-1',
imports: [
TuiInputModule,
TuiTextfieldControllerModule,
ReactiveFormsModule,
FormsModule,
TuiPrimitiveTextfieldModule,
MaskitoDirective,
TuiFlagPipeModule,
TuiInputModule,
TuiTextfieldControllerModule,
],
template: `
<tui-input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {FormControl, ReactiveFormsModule} from '@angular/forms';
import {MaskitoDirective} from '@maskito/angular';
import {
TuiFlagPipeModule,
TuiPrimitiveTextfieldModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
import {TuiFlagPipeModule, TuiTextfieldControllerModule} from '@taiga-ui/core';
import {TuiInputModule} from '@taiga-ui/kit';

import mask from './mask';
Expand All @@ -14,12 +10,11 @@ import mask from './mask';
standalone: true,
selector: 'phone-doc-example-2',
imports: [
TuiInputModule,
ReactiveFormsModule,
TuiTextfieldControllerModule,
TuiPrimitiveTextfieldModule,
MaskitoDirective,
ReactiveFormsModule,
TuiFlagPipeModule,
TuiInputModule,
TuiTextfieldControllerModule,
],
templateUrl: './template.html',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {RouterLink} from '@angular/router';
import {DemoPath, DocExamplePrimaryTab} from '@demo/constants';
import {TuiDocExample, TuiDocExampleModule, TuiDocPageModule} from '@taiga-ui/addon-doc';
import {TuiAddonDocModule, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiLinkModule} from '@taiga-ui/core';

import {PhoneUSDocExample1} from './examples/1-us-phone/component';
Expand All @@ -11,17 +11,16 @@ import {PhoneKZDocExample2} from './examples/2-kz-phone/component';
standalone: true,
selector: 'phone-doc',
imports: [
TuiDocPageModule,
TuiAddonDocModule,
TuiLinkModule,
RouterLink,
TuiDocExampleModule,
PhoneUSDocExample1,
PhoneKZDocExample2,
],
templateUrl: './phone-doc.template.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PhoneDocComponent {
export default class PhoneDocComponent {
readonly maskExpressionDocPage = `/${DemoPath.MaskExpression}`;
readonly prefixDocPage = `/${DemoPath.Prefix}`;

Expand Down
36 changes: 0 additions & 36 deletions projects/demo/src/pages/recipes/phone/phone-doc.module.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ChangeDetectionStrategy, Component, ElementRef, ViewChild} from '@angular/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {FormsModule} from '@angular/forms';
import {MaskitoDirective} from '@maskito/angular';
import {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';
import {TuiTextfieldControllerModule} from '@taiga-ui/core';
import {TuiInputModule} from '@taiga-ui/kit';

import mask from './mask';
Expand All @@ -10,12 +10,10 @@ import mask from './mask';
standalone: true,
selector: 'placeholder-doc-example-1',
imports: [
TuiInputModule,
TuiTextfieldControllerModule,
ReactiveFormsModule,
FormsModule,
TuiPrimitiveTextfieldModule,
MaskitoDirective,
TuiInputModule,
TuiTextfieldControllerModule,
],
template: `
<tui-input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {ChangeDetectionStrategy, Component, ElementRef, ViewChild} from '@angular/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {FormsModule} from '@angular/forms';
import {MaskitoDirective} from '@maskito/angular';
import {
TuiFlagPipeModule,
TuiPrimitiveTextfieldModule,
TuiTextfieldControllerModule,
} from '@taiga-ui/core';
import {TuiFlagPipeModule, TuiTextfieldControllerModule} from '@taiga-ui/core';
import {TuiInputModule} from '@taiga-ui/kit';

import mask, {PLACEHOLDER, removePlaceholder} from './mask';
Expand All @@ -14,13 +10,11 @@ import mask, {PLACEHOLDER, removePlaceholder} from './mask';
standalone: true,
selector: 'placeholder-doc-example-2',
imports: [
TuiInputModule,
TuiTextfieldControllerModule,
ReactiveFormsModule,
FormsModule,
TuiPrimitiveTextfieldModule,
MaskitoDirective,
TuiFlagPipeModule,
TuiInputModule,
TuiTextfieldControllerModule,
],
template: `
<tui-input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ChangeDetectionStrategy, Component, ElementRef, ViewChild} from '@angular/core';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {FormsModule} from '@angular/forms';
import {MaskitoDirective} from '@maskito/angular';
import {TuiPrimitiveTextfieldModule, TuiTextfieldControllerModule} from '@taiga-ui/core';
import {TuiTextfieldControllerModule} from '@taiga-ui/core';
import {TuiInputModule} from '@taiga-ui/kit';

import mask from './mask';
Expand All @@ -10,12 +10,10 @@ import mask from './mask';
standalone: true,
selector: 'placeholder-doc-example-3',
imports: [
TuiInputModule,
TuiTextfieldControllerModule,
ReactiveFormsModule,
FormsModule,
TuiPrimitiveTextfieldModule,
MaskitoDirective,
TuiInputModule,
TuiTextfieldControllerModule,
],
template: `
<tui-input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {RouterLink} from '@angular/router';
import {DemoPath, DocExamplePrimaryTab} from '@demo/constants';
import {TuiDocExample, TuiDocExampleModule, TuiDocPageModule} from '@taiga-ui/addon-doc';
import {TuiAddonDocModule, TuiDocExample} from '@taiga-ui/addon-doc';
import {TuiLinkModule} from '@taiga-ui/core';

import {PlaceholderDocExample1} from './examples/1-cvc-code/component';
Expand All @@ -12,8 +12,7 @@ import {PlaceholderDocExample3} from './examples/3-date/component';
standalone: true,
selector: 'placeholder-doc',
imports: [
TuiDocPageModule,
TuiDocExampleModule,
TuiAddonDocModule,
TuiLinkModule,
RouterLink,
PlaceholderDocExample1,
Expand All @@ -23,7 +22,7 @@ import {PlaceholderDocExample3} from './examples/3-date/component';
templateUrl: './placeholder-doc.template.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PlaceholderDocComponent {
export default class PlaceholderDocComponent {
readonly maskExpressionDocPage = `/${DemoPath.MaskExpression}`;
readonly processorsDocPage = `/${DemoPath.Processors}`;
readonly pluginsDocPage = `/${DemoPath.Plugins}`;
Expand Down
Loading