From 6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Wed, 29 Aug 2018 17:01:32 +0300 Subject: merge from ecomp a88f0072 - Modern UI Issue-ID: VID-378 Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6 Signed-off-by: Ittay Stern --- .../src/app/shared/components/svg/svg-component.ts | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 vid-webpack-master/src/app/shared/components/svg/svg-component.ts (limited to 'vid-webpack-master/src/app/shared/components/svg/svg-component.ts') diff --git a/vid-webpack-master/src/app/shared/components/svg/svg-component.ts b/vid-webpack-master/src/app/shared/components/svg/svg-component.ts new file mode 100644 index 000000000..2e4642432 --- /dev/null +++ b/vid-webpack-master/src/app/shared/components/svg/svg-component.ts @@ -0,0 +1,47 @@ +import { + AfterViewChecked, + Component, + ElementRef, + EventEmitter, + Input, + Output +} from "@angular/core"; +import * as _ from 'lodash'; + +@Component({ + selector : 'vid-svg-icon', + template: ` + + + `, + + +}) +export class SvgComponent implements AfterViewChecked{ + @Input() mode : string = 'primary'; + @Input() size : string = 'large'; + @Input() testId : string = null; + @Input() name : string = null; + @Input() clickable : boolean = false; + @Input() fill : string ; + @Input() widthViewBox: string = null; + @Input() heightViewBox: string = null; + + constructor(private elRef: ElementRef) {} + + ngAfterViewChecked(): void { + if(!_.isNil(this.fill)){ + this.elRef.nativeElement.children[0].children[0].children[0].style.fill = this.fill; + } + + if(this.widthViewBox && this.heightViewBox){ + this.elRef.nativeElement.children[0].children[0].children[0].setAttribute('viewBox', "1 1 " + this.widthViewBox + " " + this.heightViewBox) + } + + } +} -- cgit 1.2.3-korg