Skip to content

Commit

Permalink
feat: viewMode passing added
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Aug 30, 2024
1 parent 38c0e8d commit d5ebf3a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ng-template #additionalToolbarContentLeft>
<ocx-slot
name="onecx-shell-search-config"
[inputs]="{ pageName: pageName, currentInputFieldValues: currentInputFieldValues, displayedColumns: displayedColumnsIds}"
[inputs]="{ pageName: pageName, currentInputFieldValues: currentInputFieldValues, displayedColumns: displayedColumnsIds, viewMode: viewMode}"
[outputs]="{ searchConfigSelected: selectedSearchConfigChanged }"
></ocx-slot>
<ng-container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,18 @@ export class SearchHeaderComponent implements AfterViewInit {
this.header = value
}
@Input() subheader: string | undefined
@Input() viewMode: 'basic' | 'advanced' = 'basic'
_viewMode: 'basic' | 'advanced' = 'basic'
@Input()
get viewMode(): 'basic' | 'advanced' {
return this._viewMode
}
set viewMode(viewMode: 'basic' | 'advanced') {
if (this.viewMode !== viewMode) {
this._viewMode = viewMode
this.updateHeaderActions()
setTimeout(() => this.addKeyUpEventListener())
}
}
@Input() manualBreadcrumbs = false
_actions: Action[] = []
@Input()
Expand Down Expand Up @@ -82,6 +93,7 @@ export class SearchHeaderComponent implements AfterViewInit {
@Output() selectedSearchConfigChanged: EventEmitter<{
inputValues: { [key: string]: unknown }
displayedColumns: string[]
viewMode: 'basic' | 'advanced'
}> = new EventEmitter()
@Output() viewModeChanged: EventEmitter<'basic' | 'advanced'> = new EventEmitter()
@ContentChild('additionalToolbarContent')
Expand Down Expand Up @@ -109,8 +121,6 @@ export class SearchHeaderComponent implements AfterViewInit {
toggleViewMode() {
this.viewMode = this.viewMode === 'basic' ? 'advanced' : 'basic'
this.viewModeChanged?.emit(this.viewMode)
this.updateHeaderActions()
setTimeout(() => this.addKeyUpEventListener())
}

onResetClicked() {
Expand Down

0 comments on commit d5ebf3a

Please sign in to comment.