-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(search): implementa modo trigger no componente
Implementa modo trigger no componente, ativando a busca via `enter` ou `click` no ícone fixes DTHFUI-7809
- Loading branch information
1 parent
bc4c627
commit 196ba3e
Showing
8 changed files
with
115 additions
and
97 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
30 changes: 22 additions & 8 deletions
30
projects/ui/src/lib/components/po-search/po-search.component.html
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 |
---|---|---|
@@ -1,29 +1,43 @@ | ||
<div class="po-search" [class.po-search-disabled]="disabled"> | ||
<div class="po-search-icon"> | ||
<div *ngIf="type === 'action'" class="po-search-icon"> | ||
<po-icon [p-icon]="icon ? icon : 'po-icon-search'"></po-icon> | ||
</div> | ||
|
||
<input | ||
#poSearchInput | ||
type="text" | ||
class="po-search-input" | ||
type="text" | ||
[ariaLabel]="ariaLabel" | ||
[class.po-search-icon-right]="!!poSearchInput.value && !disabled" | ||
[class.po-search-input-clean]="!!poSearchInput.value && !disabled" | ||
[class.po-search-input-trigger]="type === 'trigger'" | ||
[disabled]="disabled" | ||
[placeholder]="literals.search" | ||
(blur)="onBlur()" | ||
(focus)="onFocus()" | ||
(input)="onSearchChange($event.target.value)" | ||
(input)="onSearchChange($event.target.value, type === 'action' ? true : false)" | ||
(keyup.enter)="onSearchChange($event.target.value, type === 'trigger' ? true : false)" | ||
/> | ||
|
||
<div *ngIf="!!poSearchInput.value && !disabled" class="po-search-container-clean"> | ||
<div class="po-search-buttons"> | ||
<button | ||
class="po-search-clean" | ||
*ngIf="!!poSearchInput.value && !disabled" | ||
class="po-search-button po-search-button-clean" | ||
type="button" | ||
[ariaLabel]="literals.clean" | ||
(click)="clearSearch()" | ||
(keydown.enter)="clearSearch()" | ||
> | ||
<po-icon p-icon="po-icon-clear-content"></po-icon> | ||
</button> | ||
|
||
<button | ||
*ngIf="type === 'trigger'" | ||
class="po-search-button po-search-button-trigger" | ||
type="button" | ||
[ariaLabel]="literals.search" | ||
(click)="onSearchChange(poSearchInput.value, true)" | ||
(keydown.enter)="onSearchChange(poSearchInput.value, true)" | ||
[disabled]="disabled" | ||
> | ||
<po-icon [p-icon]="icon ? icon : 'po-icon-search'"> </po-icon> | ||
</button> | ||
</div> | ||
</div> |
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.