From e91ff6c1ed7f29798973a966680e6f9c0d0a21a4 Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Mon, 11 Dec 2023 18:04:50 +0300 Subject: [PATCH 1/2] feat(angular)!: standalone `MaskitoDirective`, `MaskitoCVA`, `MaskitoPipe` --- projects/angular/src/index.ts | 2 +- projects/angular/src/lib/deprecated.ts | 27 +++++++++++++++++++ projects/angular/src/lib/maskito.cva.ts | 3 ++- projects/angular/src/lib/maskito.directive.ts | 4 +-- projects/angular/src/lib/maskito.module.ts | 11 -------- projects/angular/src/lib/maskito.pipe.ts | 1 + projects/angular/src/lib/maskito.spec.ts | 7 ++--- .../default-tabs/angular-default-tab.ts | 4 +-- .../demo/src/pages/cypress/cypress.module.ts | 4 +-- .../overwrite-mode/overwrite-mode.module.ts | 4 +-- .../documentation/plugins/plugins.module.ts | 4 +-- .../angular/angular-doc.component.ts | 4 +-- .../frameworks/angular/angular-doc.module.ts | 14 +++------- .../angular/angular-doc.template.html | 20 +++++++++----- .../angular/examples/1-nested/component.ts | 5 ++++ .../angular/examples/2-nested/component.ts | 4 +++ .../angular/examples/3-cva/component.ts | 9 ++++++- .../angular/examples/4-pipe/component.ts | 3 +++ .../examples/basic-directive-approach.md | 2 ++ .../angular/examples/custom-input-example.md | 2 ++ .../angular/examples/import-maskito-module.md | 13 --------- .../angular/examples/import-maskito.md | 13 +++++++++ .../frameworks/react/react-doc.module.ts | 4 +-- .../pages/frameworks/vue/vue-doc.module.ts | 4 +-- .../date-range/date-range-mask-doc.module.ts | 4 +-- .../date-time/date-time-mask-doc.module.ts | 4 +-- .../pages/kit/date/date-mask-doc.module.ts | 4 +-- .../kit/number/number-mask-doc.module.ts | 4 +-- .../kit/template/kit-template-doc.module.ts | 4 +-- .../pages/kit/time/time-mask-doc.module.ts | 4 +-- .../demo/src/pages/phone/phone-doc.module.ts | 4 +-- .../src/pages/recipes/card/card-doc.module.ts | 4 +-- .../pages/recipes/phone/phone-doc.module.ts | 4 +-- .../placeholder/placeholder-doc.module.ts | 4 +-- .../recipes/postfix/postfix-doc.module.ts | 4 +-- .../pages/recipes/prefix/prefix-doc.module.ts | 4 +-- .../recipes/textarea/textarea-doc.module.ts | 4 +-- 37 files changed, 129 insertions(+), 91 deletions(-) create mode 100644 projects/angular/src/lib/deprecated.ts delete mode 100644 projects/angular/src/lib/maskito.module.ts delete mode 100644 projects/demo/src/pages/frameworks/angular/examples/import-maskito-module.md create mode 100644 projects/demo/src/pages/frameworks/angular/examples/import-maskito.md diff --git a/projects/angular/src/index.ts b/projects/angular/src/index.ts index 1ddb58875..d8f6c23d5 100644 --- a/projects/angular/src/index.ts +++ b/projects/angular/src/index.ts @@ -1,4 +1,4 @@ +export * from './lib/deprecated'; export * from './lib/maskito.cva'; export * from './lib/maskito.directive'; -export * from './lib/maskito.module'; export * from './lib/maskito.pipe'; diff --git a/projects/angular/src/lib/deprecated.ts b/projects/angular/src/lib/deprecated.ts new file mode 100644 index 000000000..d3bd2c48f --- /dev/null +++ b/projects/angular/src/lib/deprecated.ts @@ -0,0 +1,27 @@ +import {NgModule} from '@angular/core'; + +import {MaskitoCVA} from './maskito.cva'; +import {MaskitoDirective} from './maskito.directive'; +import {MaskitoPipe} from './maskito.pipe'; + +/** + * @deprecated Use standalone `MaskitoDirective`, `MaskitoCVA` and `MaskitoPipe` instead. + * Learn more: https://maskito.dev/frameworks/angular + * ___ + * TODO: Delete it in v3.0 (after Taiga UI 4.0 will be released and bumped in this repository). + * Taiga UI (3.x.x) uses Maskito (1.x.x) <=> Maskito (2.x.x) uses Taiga UI (3.x.x) to build demo application. + * Also, NPM workspaces create symlinks for `@maskito/*` inside `node_modules`. + * All this together don't allow us to build Maskito's demo without this legacy module. + * ___ + * > nx build demo + * ``` + * ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-input-date.js:465:29-42 - + * Error: export 'MaskitoModule' (imported as 'MaskitoModule') was not found in '@maskito/angular' + * (possible exports: MaskitoCVA, MaskitoDirective, MaskitoPipe) + * ``` + */ +@NgModule({ + imports: [MaskitoDirective, MaskitoCVA, MaskitoPipe], + exports: [MaskitoDirective, MaskitoCVA, MaskitoPipe], +}) +export class MaskitoModule {} diff --git a/projects/angular/src/lib/maskito.cva.ts b/projects/angular/src/lib/maskito.cva.ts index 43137ef5d..fc83e1ff3 100644 --- a/projects/angular/src/lib/maskito.cva.ts +++ b/projects/angular/src/lib/maskito.cva.ts @@ -3,6 +3,7 @@ import {DefaultValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms'; import {MASKITO_DEFAULT_OPTIONS, MaskitoOptions, maskitoTransform} from '@maskito/core'; @Directive({ + standalone: true, selector: 'input[maskito], textarea[maskito]', providers: [ DefaultValueAccessor, @@ -19,7 +20,7 @@ import {MASKITO_DEFAULT_OPTIONS, MaskitoOptions, maskitoTransform} from '@maskit '(compositionend)': '$any(this.accessor)._compositionEnd($event.target.value)', }, }) -export class MaskitoCva { +export class MaskitoCVA { @Input() maskito: MaskitoOptions | null = MASKITO_DEFAULT_OPTIONS; diff --git a/projects/angular/src/lib/maskito.directive.ts b/projects/angular/src/lib/maskito.directive.ts index 4a399d131..b4d874da0 100644 --- a/projects/angular/src/lib/maskito.directive.ts +++ b/projects/angular/src/lib/maskito.directive.ts @@ -16,9 +16,7 @@ import { MaskitoOptions, } from '@maskito/core'; -@Directive({ - selector: '[maskito]', -}) +@Directive({standalone: true, selector: '[maskito]'}) export class MaskitoDirective implements OnDestroy, OnChanges { private maskedElement: Maskito | null = null; diff --git a/projects/angular/src/lib/maskito.module.ts b/projects/angular/src/lib/maskito.module.ts deleted file mode 100644 index 9e041af29..000000000 --- a/projects/angular/src/lib/maskito.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {NgModule} from '@angular/core'; - -import {MaskitoCva} from './maskito.cva'; -import {MaskitoDirective} from './maskito.directive'; -import {MaskitoPipe} from './maskito.pipe'; - -@NgModule({ - declarations: [MaskitoDirective, MaskitoCva, MaskitoPipe], - exports: [MaskitoDirective, MaskitoCva, MaskitoPipe], -}) -export class MaskitoModule {} diff --git a/projects/angular/src/lib/maskito.pipe.ts b/projects/angular/src/lib/maskito.pipe.ts index b5d53254e..b2fad34eb 100644 --- a/projects/angular/src/lib/maskito.pipe.ts +++ b/projects/angular/src/lib/maskito.pipe.ts @@ -2,6 +2,7 @@ import {Pipe, PipeTransform} from '@angular/core'; import {MASKITO_DEFAULT_OPTIONS, MaskitoOptions, maskitoTransform} from '@maskito/core'; @Pipe({ + standalone: true, name: 'maskito', }) export class MaskitoPipe implements PipeTransform { diff --git a/projects/angular/src/lib/maskito.spec.ts b/projects/angular/src/lib/maskito.spec.ts index 91efe68fc..8a5875c53 100644 --- a/projects/angular/src/lib/maskito.spec.ts +++ b/projects/angular/src/lib/maskito.spec.ts @@ -1,11 +1,13 @@ import {Component} from '@angular/core'; import {ComponentFixture, TestBed} from '@angular/core/testing'; import {FormControl, ReactiveFormsModule} from '@angular/forms'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoCVA, MaskitoDirective, MaskitoPipe} from '@maskito/angular'; import {MaskitoOptions} from '@maskito/core'; describe('Maskito Angular package', () => { @Component({ + standalone: true, + imports: [MaskitoDirective, MaskitoCVA, MaskitoPipe, ReactiveFormsModule], template: `
{{ control.value | maskito: options }}
{ beforeEach(() => { TestBed.configureTestingModule({ - imports: [MaskitoModule, ReactiveFormsModule], - declarations: [TestComponent], + imports: [TestComponent], }); fixture = TestBed.createComponent(TestComponent); diff --git a/projects/demo/src/app/utils/add-default-tabs-processor/default-tabs/angular-default-tab.ts b/projects/demo/src/app/utils/add-default-tabs-processor/default-tabs/angular-default-tab.ts index 000b8fcbd..3beaf091e 100644 --- a/projects/demo/src/app/utils/add-default-tabs-processor/default-tabs/angular-default-tab.ts +++ b/projects/demo/src/app/utils/add-default-tabs-processor/default-tabs/angular-default-tab.ts @@ -1,5 +1,5 @@ export const ANGULAR_DEFAULT_TAB = `import {Component} from '@angular/core'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import type {MaskitoOptions} from '@maskito/core'; import mask from './mask'; @@ -7,7 +7,7 @@ import mask from './mask'; @Component({ selector: 'my-app', standalone: true, - imports: [MaskitoModule], + imports: [MaskitoDirective], template: '', }) export class App { diff --git a/projects/demo/src/pages/cypress/cypress.module.ts b/projects/demo/src/pages/cypress/cypress.module.ts index 98f1517f7..751188ce1 100644 --- a/projects/demo/src/pages/cypress/cypress.module.ts +++ b/projects/demo/src/pages/cypress/cypress.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiGroupModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -19,7 +19,7 @@ import {TestDocExample6} from './examples/6-multi-character-prefix/component'; imports: [ CommonModule, FormsModule, - MaskitoModule, + MaskitoDirective, TuiInputModule, TuiGroupModule, TuiAddonDocModule, diff --git a/projects/demo/src/pages/documentation/overwrite-mode/overwrite-mode.module.ts b/projects/demo/src/pages/documentation/overwrite-mode/overwrite-mode.module.ts index 4455a7435..a4e7c76ea 100644 --- a/projects/demo/src/pages/documentation/overwrite-mode/overwrite-mode.module.ts +++ b/projects/demo/src/pages/documentation/overwrite-mode/overwrite-mode.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiHintModule, TuiLinkModule, TuiTextfieldControllerModule} from '@taiga-ui/core'; import {TuiInputModule, TuiTextareaModule} from '@taiga-ui/kit'; @@ -17,7 +17,7 @@ import {OverwriteModeDocPageComponent} from './overwrite-mode.component'; imports: [ CommonModule, FormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiLinkModule, TuiInputModule, diff --git a/projects/demo/src/pages/documentation/plugins/plugins.module.ts b/projects/demo/src/pages/documentation/plugins/plugins.module.ts index 64a010157..8ef4c55b8 100644 --- a/projects/demo/src/pages/documentation/plugins/plugins.module.ts +++ b/projects/demo/src/pages/documentation/plugins/plugins.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -15,7 +15,7 @@ import {PluginsDocPageComponent} from './plugins.component'; imports: [ CommonModule, FormsModule, - MaskitoModule, + MaskitoDirective, TuiLinkModule, TuiInputModule, TuiNotificationModule, diff --git a/projects/demo/src/pages/frameworks/angular/angular-doc.component.ts b/projects/demo/src/pages/frameworks/angular/angular-doc.component.ts index e7662b8a4..441ab7173 100644 --- a/projects/demo/src/pages/frameworks/angular/angular-doc.component.ts +++ b/projects/demo/src/pages/frameworks/angular/angular-doc.component.ts @@ -11,9 +11,7 @@ import {TuiDocExample} from '@taiga-ui/addon-doc'; export class AngularDocPageComponent { readonly coreConceptsOverviewDocPage = `/${DemoPath.CoreConceptsOverview}`; - readonly importMaskitoModuleExample = import( - './examples/import-maskito-module.md?raw' - ); + readonly importMaskitoExample = import('./examples/import-maskito.md?raw'); readonly basicDirectiveApproach = import( './examples/basic-directive-approach.md?raw' diff --git a/projects/demo/src/pages/frameworks/angular/angular-doc.module.ts b/projects/demo/src/pages/frameworks/angular/angular-doc.module.ts index 29378061e..6eb6146ef 100644 --- a/projects/demo/src/pages/frameworks/angular/angular-doc.module.ts +++ b/projects/demo/src/pages/frameworks/angular/angular-doc.module.ts @@ -1,11 +1,9 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core'; -import {TuiCheckboxLabeledModule, TuiInputModule} from '@taiga-ui/kit'; import {AngularDocPageComponent} from './angular-doc.component'; import {NestedDocExample1} from './examples/1-nested/component'; @@ -16,23 +14,17 @@ import {PipeDocExample4} from './examples/4-pipe/component'; @NgModule({ imports: [ CommonModule, - FormsModule, - ReactiveFormsModule, - MaskitoModule, - TuiInputModule, + MaskitoDirective, TuiLinkModule, TuiNotificationModule, - TuiCheckboxLabeledModule, TuiAddonDocModule, RouterModule.forChild(tuiGenerateRoutes(AngularDocPageComponent)), - ], - declarations: [ - AngularDocPageComponent, NestedDocExample1, NestedDocExample2, CvaDocExample3, PipeDocExample4, ], + declarations: [AngularDocPageComponent], exports: [AngularDocPageComponent], }) export class AngularDocPageModule {} diff --git a/projects/demo/src/pages/frameworks/angular/angular-doc.template.html b/projects/demo/src/pages/frameworks/angular/angular-doc.template.html index 1a99d4e2b..1d3f63a17 100644 --- a/projects/demo/src/pages/frameworks/angular/angular-doc.template.html +++ b/projects/demo/src/pages/frameworks/angular/angular-doc.template.html @@ -77,6 +77,7 @@

Nested input element

Nested input element + + When directly on native input/textarea tag, + MaskitoCVA + formats value set programmatically with Angular forms. + Nested input element
  • Import - MaskitoModule - to your module + MaskitoDirective + to your component / module
  • diff --git a/projects/demo/src/pages/frameworks/angular/examples/1-nested/component.ts b/projects/demo/src/pages/frameworks/angular/examples/1-nested/component.ts index 0d57c3a18..146948f5a 100644 --- a/projects/demo/src/pages/frameworks/angular/examples/1-nested/component.ts +++ b/projects/demo/src/pages/frameworks/angular/examples/1-nested/component.ts @@ -1,8 +1,13 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; +import {FormsModule} from '@angular/forms'; +import {MaskitoDirective} from '@maskito/angular'; import {MaskitoElementPredicate, MaskitoOptions} from '@maskito/core'; +import {TuiInputModule} from '@taiga-ui/kit'; @Component({ + standalone: true, selector: 'nested-doc-example-1', + imports: [MaskitoDirective, FormsModule, TuiInputModule], templateUrl: './template.html', changeDetection: ChangeDetectionStrategy.OnPush, }) diff --git a/projects/demo/src/pages/frameworks/angular/examples/2-nested/component.ts b/projects/demo/src/pages/frameworks/angular/examples/2-nested/component.ts index c04d99c1b..5a2fa8ac9 100644 --- a/projects/demo/src/pages/frameworks/angular/examples/2-nested/component.ts +++ b/projects/demo/src/pages/frameworks/angular/examples/2-nested/component.ts @@ -1,7 +1,11 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; +import {FormsModule} from '@angular/forms'; +import {TuiCheckboxLabeledModule, TuiInputModule} from '@taiga-ui/kit'; @Component({ + standalone: true, selector: 'nested-doc-example-2', + imports: [FormsModule, TuiInputModule, TuiCheckboxLabeledModule], templateUrl: './template.html', changeDetection: ChangeDetectionStrategy.OnPush, }) diff --git a/projects/demo/src/pages/frameworks/angular/examples/3-cva/component.ts b/projects/demo/src/pages/frameworks/angular/examples/3-cva/component.ts index c493af392..8e2828794 100644 --- a/projects/demo/src/pages/frameworks/angular/examples/3-cva/component.ts +++ b/projects/demo/src/pages/frameworks/angular/examples/3-cva/component.ts @@ -1,9 +1,16 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; -import {FormControl} from '@angular/forms'; +import {FormControl, ReactiveFormsModule} from '@angular/forms'; +import {MaskitoCVA, MaskitoDirective} from '@maskito/angular'; import {maskitoNumberOptionsGenerator} from '@maskito/kit'; @Component({ + standalone: true, selector: 'cva-doc-example-3', + imports: [ + MaskitoDirective, + MaskitoCVA, // <--- Don't forget to import it + ReactiveFormsModule, + ], templateUrl: './template.html', changeDetection: ChangeDetectionStrategy.OnPush, }) diff --git a/projects/demo/src/pages/frameworks/angular/examples/4-pipe/component.ts b/projects/demo/src/pages/frameworks/angular/examples/4-pipe/component.ts index ba4821b7d..9bde34597 100644 --- a/projects/demo/src/pages/frameworks/angular/examples/4-pipe/component.ts +++ b/projects/demo/src/pages/frameworks/angular/examples/4-pipe/component.ts @@ -1,8 +1,11 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; +import {MaskitoPipe} from '@maskito/angular'; import {maskitoNumberOptionsGenerator} from '@maskito/kit'; @Component({ + standalone: true, selector: 'pipe-doc-example-4', + imports: [MaskitoPipe], templateUrl: './template.html', changeDetection: ChangeDetectionStrategy.OnPush, }) diff --git a/projects/demo/src/pages/frameworks/angular/examples/basic-directive-approach.md b/projects/demo/src/pages/frameworks/angular/examples/basic-directive-approach.md index 5f803fa8f..a5e6c5218 100644 --- a/projects/demo/src/pages/frameworks/angular/examples/basic-directive-approach.md +++ b/projects/demo/src/pages/frameworks/angular/examples/basic-directive-approach.md @@ -1,5 +1,6 @@ ```ts import {Component} from '@angular/core'; +import {MaskitoDirective} from '@maskito/angular'; import {MaskitoOptions} from '@maskito/core'; @Component({ @@ -7,6 +8,7 @@ import {MaskitoOptions} from '@maskito/core'; template: ` `, + imports: [MaskitoDirective], }) export class YourComponent { readonly maskitoOptions: MaskitoOptions = { diff --git a/projects/demo/src/pages/frameworks/angular/examples/custom-input-example.md b/projects/demo/src/pages/frameworks/angular/examples/custom-input-example.md index 7013b0c01..df8ed3a68 100644 --- a/projects/demo/src/pages/frameworks/angular/examples/custom-input-example.md +++ b/projects/demo/src/pages/frameworks/angular/examples/custom-input-example.md @@ -1,5 +1,6 @@ ```ts import {Component} from '@angular/core'; +import {MaskitoDirective} from '@maskito/angular'; import {MaskitoOptions, MaskitoElementPredicate} from '@maskito/core'; @Component({ @@ -12,6 +13,7 @@ import {MaskitoOptions, MaskitoElementPredicate} from '@maskito/core'; Using maskito with another library `, + imports: [MaskitoDirective], }) export class YourComponent { readonly maskitoOptions: MaskitoOptions = { diff --git a/projects/demo/src/pages/frameworks/angular/examples/import-maskito-module.md b/projects/demo/src/pages/frameworks/angular/examples/import-maskito-module.md deleted file mode 100644 index 0fa3f3969..000000000 --- a/projects/demo/src/pages/frameworks/angular/examples/import-maskito-module.md +++ /dev/null @@ -1,13 +0,0 @@ -```ts -import {NgModule} from '@angular/core'; -import {MaskitoModule} from '@maskito/angular'; - -@NgModule({ - // ... - imports: [ - // ... - MaskitoModule, - ], -}) -export class YourModule {} -``` diff --git a/projects/demo/src/pages/frameworks/angular/examples/import-maskito.md b/projects/demo/src/pages/frameworks/angular/examples/import-maskito.md new file mode 100644 index 000000000..e38f44edd --- /dev/null +++ b/projects/demo/src/pages/frameworks/angular/examples/import-maskito.md @@ -0,0 +1,13 @@ +```ts +import {Component} from '@angular/core'; +import {MaskitoDirective} from '@maskito/angular'; + +@Component({ + // ... + imports: [ + MaskitoDirective, + // ... + ], +}) +export class YourComponent {} +``` diff --git a/projects/demo/src/pages/frameworks/react/react-doc.module.ts b/projects/demo/src/pages/frameworks/react/react-doc.module.ts index 7366fb683..58d4a120f 100644 --- a/projects/demo/src/pages/frameworks/react/react-doc.module.ts +++ b/projects/demo/src/pages/frameworks/react/react-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core'; @@ -15,7 +15,7 @@ import {ReactDocPageComponent} from './react-doc.component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiLinkModule, TuiNotificationModule, diff --git a/projects/demo/src/pages/frameworks/vue/vue-doc.module.ts b/projects/demo/src/pages/frameworks/vue/vue-doc.module.ts index 5e03eda2b..1837086b6 100644 --- a/projects/demo/src/pages/frameworks/vue/vue-doc.module.ts +++ b/projects/demo/src/pages/frameworks/vue/vue-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core'; @@ -14,7 +14,7 @@ import {VueDocPageComponent} from './vue-doc.component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiLinkModule, TuiNotificationModule, diff --git a/projects/demo/src/pages/kit/date-range/date-range-mask-doc.module.ts b/projects/demo/src/pages/kit/date-range/date-range-mask-doc.module.ts index aa4477972..d94b9c983 100644 --- a/projects/demo/src/pages/kit/date-range/date-range-mask-doc.module.ts +++ b/projects/demo/src/pages/kit/date-range/date-range-mask-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiHintModule, TuiLinkModule, TuiTextfieldControllerModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -18,7 +18,7 @@ import {DateRangeMaskDocExample4} from './examples/4-range-separator/component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiHintModule, TuiInputModule, diff --git a/projects/demo/src/pages/kit/date-time/date-time-mask-doc.module.ts b/projects/demo/src/pages/kit/date-time/date-time-mask-doc.module.ts index e8eb5d013..13753f62d 100644 --- a/projects/demo/src/pages/kit/date-time/date-time-mask-doc.module.ts +++ b/projects/demo/src/pages/kit/date-time/date-time-mask-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule, TuiTextfieldControllerModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -16,7 +16,7 @@ import {DateTimeMaskDocExample2} from './examples/2-min-max/component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, TuiLinkModule, diff --git a/projects/demo/src/pages/kit/date/date-mask-doc.module.ts b/projects/demo/src/pages/kit/date/date-mask-doc.module.ts index f83b5f889..d7ba08a3d 100644 --- a/projects/demo/src/pages/kit/date/date-mask-doc.module.ts +++ b/projects/demo/src/pages/kit/date/date-mask-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule, TuiTextfieldControllerModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -16,7 +16,7 @@ import {DateMaskDocExample2} from './examples/2-min-max/component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, TuiLinkModule, diff --git a/projects/demo/src/pages/kit/number/number-mask-doc.module.ts b/projects/demo/src/pages/kit/number/number-mask-doc.module.ts index d7e6b66bf..34a92c8ea 100644 --- a/projects/demo/src/pages/kit/number/number-mask-doc.module.ts +++ b/projects/demo/src/pages/kit/number/number-mask-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import { TuiLabelModule, @@ -23,7 +23,7 @@ import {NumberMaskDocComponent} from './number-mask-doc.component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, TuiLabelModule, diff --git a/projects/demo/src/pages/kit/template/kit-template-doc.module.ts b/projects/demo/src/pages/kit/template/kit-template-doc.module.ts index 9affc44f4..83351b9e8 100644 --- a/projects/demo/src/pages/kit/template/kit-template-doc.module.ts +++ b/projects/demo/src/pages/kit/template/kit-template-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -13,7 +13,7 @@ import {KitTemplateDocComponent} from './kit-template-doc.component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, RouterModule.forChild(tuiGenerateRoutes(KitTemplateDocComponent)), diff --git a/projects/demo/src/pages/kit/time/time-mask-doc.module.ts b/projects/demo/src/pages/kit/time/time-mask-doc.module.ts index 666e06ee9..39a3c0392 100644 --- a/projects/demo/src/pages/kit/time/time-mask-doc.module.ts +++ b/projects/demo/src/pages/kit/time/time-mask-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiTextfieldControllerModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -16,7 +16,7 @@ import {TimeMaskDocComponent} from './time-mask-doc.component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, TuiTextfieldControllerModule, diff --git a/projects/demo/src/pages/phone/phone-doc.module.ts b/projects/demo/src/pages/phone/phone-doc.module.ts index 0735cd6b0..5251540f4 100644 --- a/projects/demo/src/pages/phone/phone-doc.module.ts +++ b/projects/demo/src/pages/phone/phone-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import { TuiErrorModule, @@ -24,7 +24,7 @@ import {PhoneDocComponent} from './phone-doc.component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, TuiFlagPipeModule, diff --git a/projects/demo/src/pages/recipes/card/card-doc.module.ts b/projects/demo/src/pages/recipes/card/card-doc.module.ts index 06144f104..5955b9f37 100644 --- a/projects/demo/src/pages/recipes/card/card-doc.module.ts +++ b/projects/demo/src/pages/recipes/card/card-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiGroupModule, TuiLinkModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -14,7 +14,7 @@ import {CardDocExample1} from './examples/1-basic/component'; imports: [ CommonModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, TuiGroupModule, diff --git a/projects/demo/src/pages/recipes/phone/phone-doc.module.ts b/projects/demo/src/pages/recipes/phone/phone-doc.module.ts index 6930f9301..effb2cfef 100644 --- a/projects/demo/src/pages/recipes/phone/phone-doc.module.ts +++ b/projects/demo/src/pages/recipes/phone/phone-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import { TuiFlagPipeModule, @@ -20,7 +20,7 @@ import {PhoneDocComponent} from './phone-doc.component'; CommonModule, FormsModule, ReactiveFormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiFlagPipeModule, TuiInputModule, diff --git a/projects/demo/src/pages/recipes/placeholder/placeholder-doc.module.ts b/projects/demo/src/pages/recipes/placeholder/placeholder-doc.module.ts index 3a7034998..330569fca 100644 --- a/projects/demo/src/pages/recipes/placeholder/placeholder-doc.module.ts +++ b/projects/demo/src/pages/recipes/placeholder/placeholder-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import { TuiFlagPipeModule, @@ -20,7 +20,7 @@ import {PlaceholderDocComponent} from './placeholder-doc.component'; imports: [ CommonModule, FormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiFlagPipeModule, TuiInputModule, diff --git a/projects/demo/src/pages/recipes/postfix/postfix-doc.module.ts b/projects/demo/src/pages/recipes/postfix/postfix-doc.module.ts index edfa6a54d..0d1050646 100644 --- a/projects/demo/src/pages/recipes/postfix/postfix-doc.module.ts +++ b/projects/demo/src/pages/recipes/postfix/postfix-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -15,7 +15,7 @@ import {PostfixDocComponent} from './postfix-doc.component'; imports: [ CommonModule, FormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, TuiLinkModule, diff --git a/projects/demo/src/pages/recipes/prefix/prefix-doc.module.ts b/projects/demo/src/pages/recipes/prefix/prefix-doc.module.ts index fef7c1f64..61256fb31 100644 --- a/projects/demo/src/pages/recipes/prefix/prefix-doc.module.ts +++ b/projects/demo/src/pages/recipes/prefix/prefix-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule, TuiNotificationModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -15,7 +15,7 @@ import {PrefixDocComponent} from './prefix-doc.component'; imports: [ CommonModule, FormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiInputModule, TuiLinkModule, diff --git a/projects/demo/src/pages/recipes/textarea/textarea-doc.module.ts b/projects/demo/src/pages/recipes/textarea/textarea-doc.module.ts index 01a36db85..d29aa46ca 100644 --- a/projects/demo/src/pages/recipes/textarea/textarea-doc.module.ts +++ b/projects/demo/src/pages/recipes/textarea/textarea-doc.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoModule} from '@maskito/angular'; +import {MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiLinkModule} from '@taiga-ui/core'; import {TuiTextareaModule} from '@taiga-ui/kit'; @@ -14,7 +14,7 @@ import {TextareaDocComponent} from './textarea-doc.component'; imports: [ CommonModule, FormsModule, - MaskitoModule, + MaskitoDirective, TuiAddonDocModule, TuiTextareaModule, TuiLinkModule, From 6bc4c8896417bdcaba266a7350ec00b0a8e08b02 Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Tue, 12 Dec 2023 11:58:21 +0300 Subject: [PATCH 2/2] chore(demo): add forgotten `MaskitoCVA` --- projects/demo/src/pages/cypress/cypress.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/demo/src/pages/cypress/cypress.module.ts b/projects/demo/src/pages/cypress/cypress.module.ts index 751188ce1..c646968f1 100644 --- a/projects/demo/src/pages/cypress/cypress.module.ts +++ b/projects/demo/src/pages/cypress/cypress.module.ts @@ -2,7 +2,7 @@ import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import {MaskitoDirective} from '@maskito/angular'; +import {MaskitoCVA, MaskitoDirective} from '@maskito/angular'; import {TuiAddonDocModule, tuiGenerateRoutes} from '@taiga-ui/addon-doc'; import {TuiGroupModule} from '@taiga-ui/core'; import {TuiInputModule} from '@taiga-ui/kit'; @@ -20,6 +20,7 @@ import {TestDocExample6} from './examples/6-multi-character-prefix/component'; CommonModule, FormsModule, MaskitoDirective, + MaskitoCVA, TuiInputModule, TuiGroupModule, TuiAddonDocModule,