mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
@@ -0,0 +1,68 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { Point } from './../models/point';
|
||||
import { RaphaelBase } from './../raphael-base';
|
||||
import { RaphaelService } from './../raphael.service';
|
||||
|
||||
@Directive({selector: 'raphael-icon-script'})
|
||||
export class RaphaelIconScriptDirective extends RaphaelBase implements OnInit {
|
||||
@Input()
|
||||
paper: any;
|
||||
|
||||
@Input()
|
||||
position: Point;
|
||||
|
||||
@Input()
|
||||
text: string;
|
||||
|
||||
@Output()
|
||||
error = new EventEmitter();
|
||||
|
||||
@Input()
|
||||
strokeWidth: number;
|
||||
|
||||
@Input()
|
||||
fillColors: any;
|
||||
|
||||
@Input()
|
||||
stroke: any;
|
||||
|
||||
@Input()
|
||||
fillOpacity: any;
|
||||
|
||||
constructor(public elementRef: ElementRef,
|
||||
raphaelService: RaphaelService) {
|
||||
super(elementRef, raphaelService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.draw(this.position);
|
||||
}
|
||||
|
||||
public draw(position: Point) {
|
||||
let path1 = this.paper.path(`m 5,2 0,0.094 c 0.23706,0.064 0.53189,0.1645 0.8125,0.375 0.5582,0.4186 1.05109,1.228 1.15625,2.5312
|
||||
l 8.03125,0 1,0 1,0 c 0,-3 -2,-3 -2,-3 l -10,0 z M 4,3 4,13 2,13 c 0,3 2,3 2,3 l 9,0 c 0,0 2,0 2,-3 L 15,6 6,6 6,5.5 C 6,4.1111
|
||||
5.5595,3.529 5.1875,3.25 4.8155,2.971 4.5,3 4.5,3 L 4,3 z`).attr({
|
||||
'stroke': this.stroke,
|
||||
'fill': this.fillColors
|
||||
});
|
||||
return path1.transform('T' + position.x + ',' + position.y);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user