mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
/*
|
|
* Copyright (C) 2018-2021 StApps
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
* Software Foundation, version 3.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
import {Component, Input} from '@angular/core';
|
|
import {SCThings} from '@openstapps/core';
|
|
import {DataRoutingService} from '../data-routing.service';
|
|
|
|
/**
|
|
* Shows data items in lists such es search result
|
|
*/
|
|
@Component({
|
|
selector: 'stapps-data-list-item',
|
|
styleUrls: ['data-list-item.scss'],
|
|
templateUrl: 'data-list-item.html',
|
|
})
|
|
export class DataListItem {
|
|
/**
|
|
* Whether or not the list item should show a thumbnail
|
|
*/
|
|
@Input() hideThumbnail = false;
|
|
|
|
/**
|
|
* An item to show
|
|
*/
|
|
@Input() item: SCThings;
|
|
|
|
constructor(private readonly dataRoutingService: DataRoutingService) {}
|
|
|
|
/**
|
|
* Emit event that an item was selected
|
|
*/
|
|
notifySelect() {
|
|
this.dataRoutingService.emitChildEvent(this.item);
|
|
}
|
|
}
|