Skip to content

Commit

Permalink
fix: (input group) Add type of input group and example (#2190)
Browse files Browse the repository at this point in the history
* fix (input group): Add type of input group and example

* update description

Co-authored-by: Mike O'Donnell <mikerodonnell89@users.noreply.github.com>
  • Loading branch information
JKMarkowski and mikerodonnell89 committed Mar 20, 2020
1 parent 00baee2 commit 473aa07
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,20 @@
(addOnButtonClicked)="searchTerm = ''">
</fd-input-group>
<br/>
<span>searchTerm: {{searchTerm}}</span>
<span>Search term: {{searchTerm}}</span>

<br/>
<br/>
<br/>

<label fd-form-label>Search input with search type</label>
<fd-input-group
[disabled]="false"
[(ngModel)]="searchTermSecond"
[glyph]="'search'"
[placeholder]="'Search'"
[button]="true"
[type]="'search'">
</fd-input-group>
<br/>
<span>Search term: {{searchTermSecond}}</span>
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ import { Component } from '@angular/core';
export class InputGroupSearchExampleComponent {

searchTerm = 'Search Term';
searchTermSecond = 'Search Term';

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
</fd-docs-section-title>
<description>
This input group automatically shows a clear search button when the user has entered a value in the input.
The input type can be changed using <code>[type]="'search'"</code> inside the <code>InputGroup</code>.
</description>
<component-example>
<fd-input-group-search-example></fd-input-group-search-example>
Expand Down
2 changes: 1 addition & 1 deletion libs/core/src/lib/input-group/input-group.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
[class]="inShellbar ? 'fd-shellbar__input-group__input' : ''"
fd-input-group-input
[compact]="compact"
type="text"
[type]="type"
*ngIf="!inputElement && !inputTemplate"
placeholder="{{placeholder}}">
</ng-template>
4 changes: 4 additions & 0 deletions libs/core/src/lib/input-group/input-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ export class InputGroupComponent implements ControlValueAccessor {
@Input()
buttonType: ButtonType;

/** The type of the input, used in Input Group. By default value is set to 'text' */
@Input()
type: string = 'text';

/** Button options. Options include 'emphasized' and 'light'. Leave empty for default.' */
@Input()
buttonOptions: ButtonOptions | ButtonOptions[] = 'light';
Expand Down

0 comments on commit 473aa07

Please sign in to comment.