dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/helper/helper.component.ts @ 59152
1 | 58534 | k.triantaf | import {Component, Input} from '@angular/core'; |
---|---|---|---|
2 | 55964 | argiro.kok | import 'rxjs'; |
3 | 51834 | konstantin | |
4 | 50169 | argiro.kok | @Component({ |
5 | selector: 'helper', |
||
6 | template: ` |
||
7 | 52820 | argiro.kok | <div *ngIf=" texts && texts.length > 0 && !tooltip" [ngClass]=styleName>
|
8 | 51834 | konstantin | <div *ngFor="let text of texts " [innerHTML]="text.content | safeHtml">
|
9 | 50169 | argiro.kok | </div>
|
10 | </div>
|
||
11 | 52820 | argiro.kok | <span *ngIf=" texts && texts.length > 0 && tooltip" >
|
12 | <span uk-tooltip="pos:right; delay:10; "
|
||
13 | title="{{buildTooltip()}}">
|
||
14 | <span class="uk-icon"> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="info" ratio="1"><path d="M12.13,11.59 C11.97,12.84 10.35,14.12 9.1,14.16 C6.17,14.2 9.89,9.46 8.74,8.37 C9.3,8.16 10.62,7.83 10.62,8.81 C10.62,9.63 10.12,10.55 9.88,11.32 C8.66,15.16 12.13,11.15 12.14,11.18 C12.16,11.21 12.16,11.35 12.13,11.59 C12.08,11.95 12.16,11.35 12.13,11.59 L12.13,11.59 Z M11.56,5.67 C11.56,6.67 9.36,7.15 9.36,6.03 C9.36,5 11.56,4.54 11.56,5.67 L11.56,5.67 Z"></path><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg></span>
|
||
15 | </span>
|
||
16 | </span>
|
||
17 | 50169 | argiro.kok | `
|
18 | })
|
||
19 | export class HelperComponent { |
||
20 | 56620 | k.triantaf | @Input() texts = []; |
21 | 50169 | argiro.kok | @Input() style:boolean = false; |
22 | @Input() styleName:string = ''; |
||
23 | 52820 | argiro.kok | @Input() tooltip:boolean = false; |
24 | 58534 | k.triantaf | |
25 | 56620 | k.triantaf | constructor () {} |
26 | 50169 | argiro.kok | |
27 | 56620 | k.triantaf | buildTooltip(): string { |
28 | var text:string="<div class='uk-padding-small uk-width-xxlarge'>"; |
||
29 | for(var i=0; i< this.texts.length; i++){ |
||
30 | text+=this.texts[i].content; |
||
31 | 50169 | argiro.kok | }
|
32 | 56620 | k.triantaf | text+="</div>"; |
33 | return text; |
||
34 | 50169 | argiro.kok | }
|
35 | |||
36 | }
|