1
|
import {Component, HostBinding, Input} from '@angular/core';
|
2
|
import {DomSanitizer} from '@angular/platform-browser';
|
3
|
import {ButtonsCustomization} from '../../openaireLibrary/connect/community/CustomizationOptions';
|
4
|
|
5
|
|
6
|
@Component({
|
7
|
selector: 'quick-look-buttons',
|
8
|
template: `
|
9
|
|
10
|
<div>
|
11
|
<a class="uk-button preview-button" >Button</a>
|
12
|
</div>
|
13
|
|
14
|
|
15
|
`,
|
16
|
styles:[`
|
17
|
.preview-button {
|
18
|
color: var(--color);
|
19
|
background-color: var(--background-color);
|
20
|
border-color: var(--border-color);
|
21
|
border-style: var(--border-style);
|
22
|
border-width: var(--border-width);
|
23
|
border-radius: var(--border-radius);
|
24
|
}
|
25
|
.preview-button:hover {
|
26
|
color: var(--color-hover);
|
27
|
background-color: var(--background-color-hover);
|
28
|
border-color: var(--border-color-hover);
|
29
|
|
30
|
}
|
31
|
|
32
|
`]
|
33
|
|
34
|
})
|
35
|
|
36
|
export class QuickLookButtonsComponent {
|
37
|
@Input() buttons:ButtonsCustomization;
|
38
|
|
39
|
@HostBinding("attr.style")
|
40
|
public get valueAsStyle(): any {
|
41
|
return this.sanitizer.bypassSecurityTrustStyle(`
|
42
|
--color: ${this.buttons.color};
|
43
|
--background-color: ${this.buttons.backgroundColor};
|
44
|
--border-color: ${this.buttons.borderColor};
|
45
|
--border-style: ${this.buttons.borderStyle};
|
46
|
--border-width: ${this.buttons.borderWidth + 'px'};
|
47
|
--border-radius: ${this.buttons.borderRadius + 'px'};
|
48
|
--color-hover: ${this.buttons.onHover.color};
|
49
|
--background-color-hover: ${this.buttons.onHover.backgroundColor};
|
50
|
--border-color-hover: ${this.buttons.onHover.borderColor};
|
51
|
`);
|
52
|
}
|
53
|
constructor( private sanitizer: DomSanitizer) {
|
54
|
}
|
55
|
|
56
|
|
57
|
|
58
|
}
|