Move the icons options as input parameters

This commit is contained in:
mauriziovitale84 2016-10-24 10:41:50 +01:00
parent e14876f8a7
commit a93f72cf37
9 changed files with 60 additions and 9 deletions

View File

@ -1 +1,2 @@
<raphael-icon-send [position]="position"></raphael-icon-send>
<raphael-icon-send [position]="position" [stroke]="options.stroke" [strokeWidth]="options.strokeWidth"
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-icon-send>

View File

@ -33,10 +33,14 @@ export class DiagramIconSendTaskComponent {
position: any;
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''};
constructor(public elementRef: ElementRef,
private diagramColorService: DiagramColorService) {}
ngOnInit() {
this.position = {x: this.data.x + 4, y: this.data.y + 4};
this.options.stroke = 'none' ;
this.options.fillColors = '#16964d' ;
}
}

View File

@ -1 +1,2 @@
<raphael-icon-service [position]="position"></raphael-icon-service>
<raphael-icon-service [position]="position" [stroke]="options.stroke" [strokeWidth]="options.strokeWidth"
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-icon-service>

View File

@ -33,10 +33,14 @@ export class DiagramIconServiceTaskComponent {
position: any;
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''};
constructor(public elementRef: ElementRef,
private diagramColorService: DiagramColorService) {}
ngOnInit() {
this.position = {x: this.data.x + 4, y: this.data.y + 4};
this.options.stroke = 'none' ;
this.options.fillColors = '#72a7d0' ;
}
}

View File

@ -1 +1,2 @@
<raphael-icon-user [position]="position"></raphael-icon-user>
<raphael-icon-user [position]="position" [stroke]="options.stroke" [strokeWidth]="options.strokeWidth"
[fillColors]="options.fillColors" [fillOpacity]="options.fillOpacity"></raphael-icon-user>

View File

@ -33,10 +33,14 @@ export class DiagramIconUserTaskComponent {
position: any;
options: any = {stroke: '', fillColors: '', fillOpacity: '', strokeWidth: ''};
constructor(public elementRef: ElementRef,
private diagramColorService: DiagramColorService) {}
ngOnInit() {
this.position = {x: this.data.x + 4, y: this.data.y + 4};
this.options.stroke = 'none' ;
this.options.fillColors = '#d1b575' ;
}
}

View File

@ -34,6 +34,18 @@ export class RaphaelIconSendDirective extends RaphaelBase implements OnInit {
@Output()
onError = new EventEmitter();
@Input()
strokeWidth: number;
@Input()
fillColors: any;
@Input()
stroke: any;
@Input()
fillOpacity: any;
constructor(public elementRef: ElementRef,
raphaelService: RaphaelService) {
super(elementRef, raphaelService);
@ -47,8 +59,8 @@ export class RaphaelIconSendDirective extends RaphaelBase implements OnInit {
public draw(position: Point) {
let path1 = this.paper.path(`M 1 3 L 9 11 L 17 3 L 1 3 z M 1 5 L 1 13 L 5 9 L 1 5 z M 17 5 L 13 9 L 17 13 L 17 5 z M 6 10 L 1 15
L 17 15 L 12 10 L 9 13 L 6 10 z`).attr({
'stroke': 'none',
'fill': '#16964d'
'stroke': this.stroke,
'fill': this.fillColors
});
return path1.transform('T' + position.x + ',' + position.y);
}

View File

@ -34,6 +34,18 @@ export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit {
@Output()
onError = new EventEmitter();
@Input()
strokeWidth: number;
@Input()
fillColors: any;
@Input()
stroke: any;
@Input()
fillOpacity: any;
constructor(public elementRef: ElementRef,
raphaelService: RaphaelService) {
super(elementRef, raphaelService);
@ -64,8 +76,8 @@ export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit {
' 10.5,2.875 10.5,2.875 L 10,1 8,1 z m 1,5 c 1.656854,0 3,1.3431458 3,3 0,1.656854 -1.343146,3 -3,3 C 7.3431458,12' +
' 6,10.656854 6,9 6,7.3431458 7.3431458,6 9,6 z').attr({
'opacity': 1,
'stroke': 'none',
'fill': '#72a7d0'
'stroke': this.stroke,
'fill': this.fillColors
});
return path1.transform('T' + position.x + ',' + position.y);
}

View File

@ -34,6 +34,18 @@ export class RaphaelIconUserDirective extends RaphaelBase implements OnInit {
@Output()
onError = new EventEmitter();
@Input()
strokeWidth: number;
@Input()
fillColors: any;
@Input()
stroke: any;
@Input()
fillOpacity: any;
constructor(public elementRef: ElementRef,
raphaelService: RaphaelService) {
super(elementRef, raphaelService);
@ -49,8 +61,8 @@ export class RaphaelIconUserDirective extends RaphaelBase implements OnInit {
l 0,-3.0222 C 12.555557,0.8221 9.0000001,1.0001 9.0000001,1.0001 c 0,0 -3.5555556,-0.178 -3.9111111,3.5555 l 0,3.0222 c
0,0 0,2.3111 1.2444443,2.3111 l 0,1.7778 L 1,15.2222 1,17 17,17`).attr({
'opacity': 1,
'stroke': 'none',
'fill': '#d1b575'
'stroke': this.stroke,
'fill': this.fillColors
});
return path1.transform('T' + position.x + ',' + position.y);
}