mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
85042: Make SearchComponent themeable
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
<ds-search></ds-search>
|
||||
<ds-themed-search></ds-themed-search>
|
||||
<ds-search-tracker></ds-search-tracker>
|
||||
|
@@ -14,10 +14,12 @@ import { SearchConfigurationService } from '../core/shared/search/search-configu
|
||||
import { JournalEntitiesModule } from '../entity-groups/journal-entities/journal-entities.module';
|
||||
import { ResearchEntitiesModule } from '../entity-groups/research-entities/research-entities.module';
|
||||
import { ThemedSearchPageComponent } from './themed-search-page.component';
|
||||
import { ThemedSearchComponent } from './themed-search.component';
|
||||
|
||||
const components = [
|
||||
SearchPageComponent,
|
||||
SearchComponent,
|
||||
ThemedSearchComponent,
|
||||
SearchTrackerComponent,
|
||||
ThemedSearchPageComponent
|
||||
];
|
||||
|
47
src/app/search-page/themed-search.component.ts
Normal file
47
src/app/search-page/themed-search.component.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { ThemedComponent } from '../shared/theme-support/themed.component';
|
||||
import { SearchComponent } from './search.component';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Context } from '../core/shared/context.model';
|
||||
|
||||
/**
|
||||
* Themed wrapper for SearchComponent
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-themed-search',
|
||||
styleUrls: [],
|
||||
templateUrl: '../shared/theme-support/themed.component.html',
|
||||
})
|
||||
export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
|
||||
protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = [
|
||||
'inPlaceSearch', 'searchEnabled', 'sideBarWidth', 'configuration$', 'context', 'scopeSelectable'
|
||||
];
|
||||
|
||||
@Input() inPlaceSearch = true;
|
||||
|
||||
@Input()
|
||||
searchEnabled = true;
|
||||
|
||||
@Input()
|
||||
sideBarWidth = 3;
|
||||
|
||||
@Input()
|
||||
configuration$: Observable<string>;
|
||||
|
||||
@Input()
|
||||
context: Context;
|
||||
|
||||
@Input() scopeSelectable = true;
|
||||
|
||||
protected getComponentName(): string {
|
||||
return 'SearchComponent';
|
||||
}
|
||||
|
||||
protected importThemedComponent(themeName: string): Promise<any> {
|
||||
return import(`../../themes/${themeName}/app/search-page/search.component`);
|
||||
}
|
||||
|
||||
protected importUnthemedComponent(): Promise<any> {
|
||||
return import('./search.component');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user