-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core):
TextfieldController
add prefix, postfix and filler (#3188)
- Loading branch information
1 parent
336dcd8
commit 75276fb
Showing
31 changed files
with
338 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
projects/core/directives/textfield-controller/textfield-filler.directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {Directive, forwardRef, InjectionToken, Input} from '@angular/core'; | ||
import {AbstractTuiController} from '@taiga-ui/cdk'; | ||
|
||
export const TUI_TEXTFIELD_FILLER = new InjectionToken<TuiTextfieldFillerDirective>( | ||
`[TUI_TEXTFIELD_FILLER]: tuiTextfieldPrefix`, | ||
{ | ||
factory: () => new TuiTextfieldFillerDirective(), | ||
}, | ||
); | ||
|
||
@Directive({ | ||
selector: `[tuiTextfieldFiller]`, | ||
providers: [ | ||
{ | ||
provide: TUI_TEXTFIELD_FILLER, | ||
useExisting: forwardRef(() => TuiTextfieldFillerDirective), | ||
}, | ||
], | ||
}) | ||
export class TuiTextfieldFillerDirective extends AbstractTuiController { | ||
@Input(`tuiTextfieldFiller`) | ||
filler = ``; | ||
} |
23 changes: 23 additions & 0 deletions
23
projects/core/directives/textfield-controller/textfield-postfix.directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {Directive, forwardRef, InjectionToken, Input} from '@angular/core'; | ||
import {AbstractTuiController} from '@taiga-ui/cdk'; | ||
|
||
export const TUI_TEXTFIELD_POSTFIX = new InjectionToken<TuiTextfieldPostfixDirective>( | ||
`[TUI_TEXTFIELD_POSTFIX]: tuiTextfieldPostfix`, | ||
{ | ||
factory: () => new TuiTextfieldPostfixDirective(), | ||
}, | ||
); | ||
|
||
@Directive({ | ||
selector: `[tuiTextfieldPostfix]`, | ||
providers: [ | ||
{ | ||
provide: TUI_TEXTFIELD_POSTFIX, | ||
useExisting: forwardRef(() => TuiTextfieldPostfixDirective), | ||
}, | ||
], | ||
}) | ||
export class TuiTextfieldPostfixDirective extends AbstractTuiController { | ||
@Input(`tuiTextfieldPostfix`) | ||
postfix = ``; | ||
} |
23 changes: 23 additions & 0 deletions
23
projects/core/directives/textfield-controller/textfield-prefix.directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {Directive, forwardRef, InjectionToken, Input} from '@angular/core'; | ||
import {AbstractTuiController} from '@taiga-ui/cdk'; | ||
|
||
export const TUI_TEXTFIELD_PREFIX = new InjectionToken<TuiTextfieldPrefixDirective>( | ||
`[TUI_TEXTFIELD_PREFIX]: tuiTextfieldPrefix`, | ||
{ | ||
factory: () => new TuiTextfieldPrefixDirective(), | ||
}, | ||
); | ||
|
||
@Directive({ | ||
selector: `[tuiTextfieldPrefix]`, | ||
providers: [ | ||
{ | ||
provide: TUI_TEXTFIELD_PREFIX, | ||
useExisting: forwardRef(() => TuiTextfieldPrefixDirective), | ||
}, | ||
], | ||
}) | ||
export class TuiTextfieldPrefixDirective extends AbstractTuiController { | ||
@Input(`tuiTextfieldPrefix`) | ||
prefix = ``; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.