101577: Themed ThumbnailComponent

This commit is contained in:
Alexandre Vryghem
2023-04-21 00:06:02 +02:00
parent e4f483c308
commit 8e4247c2ac
26 changed files with 108 additions and 62 deletions

View File

@@ -0,0 +1,44 @@
import { ThemedComponent } from '../shared/theme-support/themed.component';
import { Component, Input } from '@angular/core';
import { ThumbnailComponent } from './thumbnail.component';
import { Bitstream } from '../core/shared/bitstream.model';
import { RemoteData } from '../core/data/remote-data';
@Component({
selector: 'ds-themed-thumbnail',
styleUrls: [],
templateUrl: '../shared/theme-support/themed.component.html',
})
export class ThemedThumbnailComponent extends ThemedComponent<ThumbnailComponent> {
@Input() thumbnail: Bitstream | RemoteData<Bitstream>;
@Input() defaultImage?: string | null;
@Input() alt?: string;
@Input() placeholder?: string;
@Input() limitWidth?: boolean;
protected inAndOutputNames: (keyof ThumbnailComponent & keyof this)[] = [
'thumbnail',
'defaultImage',
'alt',
'placeholder',
'limitWidth',
];
protected getComponentName(): string {
return 'ThumbnailComponent';
}
protected importThemedComponent(themeName: string): Promise<any> {
return import(`../../themes/${themeName}/app/thumbnail/thumbnail.component`);
}
protected importUnthemedComponent(): Promise<any> {
return import('./thumbnail.component');
}
}