2021-05-19 13:40:29 +02:00
|
|
|
import {Component, HostBinding, Input} from '@angular/core';
|
|
|
|
import {DomSanitizer} from '@angular/platform-browser';
|
|
|
|
import {ButtonsCustomization} from '../../openaireLibrary/connect/community/CustomizationOptions';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'quick-look-buttons',
|
|
|
|
template: `
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<a class="uk-button preview-button" >Button</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
`,
|
|
|
|
styles:[`
|
|
|
|
.preview-button {
|
|
|
|
color: var(--color);
|
|
|
|
background-color: var(--background-color);
|
|
|
|
border-color: var(--border-color);
|
2022-08-01 11:18:47 +02:00
|
|
|
border-style: solid;
|
2021-05-19 13:40:29 +02:00
|
|
|
border-width: var(--border-width);
|
|
|
|
border-radius: var(--border-radius);
|
|
|
|
}
|
|
|
|
.preview-button:hover {
|
|
|
|
color: var(--color-hover);
|
|
|
|
background-color: var(--background-color-hover);
|
|
|
|
border-color: var(--border-color-hover);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
`]
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
export class QuickLookButtonsComponent {
|
|
|
|
@Input() buttons:ButtonsCustomization;
|
2022-08-01 11:18:47 +02:00
|
|
|
@Input() border:ButtonsCustomization;
|
2021-05-19 13:40:29 +02:00
|
|
|
|
|
|
|
@HostBinding("attr.style")
|
|
|
|
public get valueAsStyle(): any {
|
|
|
|
return this.sanitizer.bypassSecurityTrustStyle(`
|
|
|
|
--color: ${this.buttons.color};
|
|
|
|
--background-color: ${this.buttons.backgroundColor};
|
|
|
|
--border-color: ${this.buttons.borderColor};
|
2022-08-01 11:18:47 +02:00
|
|
|
--border-style: ${this.border.borderStyle};
|
|
|
|
--border-width: ${this.border.borderWidth + 'px'};
|
|
|
|
--border-radius: ${this.border.borderRadius + 'px'};
|
2021-05-19 13:40:29 +02:00
|
|
|
--color-hover: ${this.buttons.onHover.color};
|
|
|
|
--background-color-hover: ${this.buttons.onHover.backgroundColor};
|
|
|
|
--border-color-hover: ${this.buttons.onHover.borderColor};
|
|
|
|
`);
|
|
|
|
}
|
|
|
|
constructor( private sanitizer: DomSanitizer) {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|