Skip to content

Commit

Permalink
feat(platform): add searchFieldInputText input and searchFieldInputCh…
Browse files Browse the repository at this point in the history
…ange events to platform table toolbar
  • Loading branch information
mikerodonnell89 committed Jan 17, 2025
1 parent 151a028 commit 8c6689a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
(searchSubmit)="submitSearch($event)"
(cancelSearch)="submitSearch($event)"
[disableSuggestionsFoundAnnouncer]="true"
(inputChange)="searchInputChanged($event)"
></fdp-search-field>
}
@if (editMode !== 'none') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
ContentChild,
DestroyRef,
Directive,
EventEmitter,
Input,
Output,
Signal,
TemplateRef,
ViewChild,
Expand Down Expand Up @@ -150,6 +152,20 @@ export class TableToolbarComponent implements TableToolbarInterface {
@Input()
headingLevel: HeadingLevel = 2;

/** Search field input text. */
@Input()
set searchFieldInputText(text: string) {
this._searchInputText = text;
this.submitSearch({ text, category: null });
}
get searchFieldInputText(): string {
return this._searchInputText;
}

/** Event emitted when the search field input is changed. */
@Output()
searchFieldInputChange = new EventEmitter<string>();

/** @hidden */
@ContentChild(TableToolbarActionsComponent)
tableToolbarActionsComponent: TableToolbarActionsComponent;
Expand Down Expand Up @@ -190,6 +206,11 @@ export class TableToolbarComponent implements TableToolbarInterface {
this._table.search(search);
}

/** @hidden */
searchInputChanged(event: SearchInput): void {
this.searchFieldInputChange.emit(event.text);
}

/** @hidden */
openSorting(): void {
this._table.openTableSortSettings.emit();
Expand Down

0 comments on commit 8c6689a

Please sign in to comment.