-
Notifications
You must be signed in to change notification settings - Fork 160
Implement input group type token #8051
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
Conversation
- Add dev sample
…into iganchev/input-group-token-master
projects/igniteui-angular/src/lib/input-group/input-group.component.spec.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/input-group/input-group.component.ts
Outdated
Show resolved
Hide resolved
| */ | ||
| @Input() | ||
| public type = 'line'; | ||
| public set type(value: IgxInputGroupType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation works fine, but I feel like it should be the same as in the IgxInputGroup component. If we expose the input to be templateable or if (for some reason) a user passes items that have and input in them, those should behave consistently w/ the input group from the view template. So the select component should get the InputGroupToken injected in it's constructor (optional) and type should return this._type || this._inputGroupToken || 'line'. As we are passing any specified type to the input in the template, there should be no inconsistencies when it is provided.
@IvayloG , @damyanpetev , thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think might be an issue, but the input group child may one day not be static and interfere with this setter. So I'd still go that route anyway.
| */ | ||
| @Input() | ||
| public type = 'line'; | ||
| public set type(value: IgxInputGroupType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think might be an issue, but the input group child may one day not be static and interfere with this setter. So I'd still go that route anyway.
| * Defines the InputGroupType DI token. | ||
| */ | ||
| // Should this go trough Interface https://angular.io/api/core/InjectionToken | ||
| export const InputGroupToken = new InjectionToken<IgxInputGroupType>('InputGroupType'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd take the more fitting token name of IGX_INPUT_GROUP_TYPE
| /** | ||
| * An @Input property that sets how the select will be styled. | ||
| * The allowed values are `line`, `box` and `border`. The default is `line`. | ||
| * The allowed values are `line`, `box` and `border`. The input-group default is `line`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick, but this change isn't really needed
Closes #6751
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)