|
| 1 | +import { Component, ElementRef, ViewContainerRef, Renderer2, Injector, ChangeDetectionStrategy, QueryList, ValueProvider } from '@angular/core'; |
| 2 | +import { ComponentBase, ComponentMixins, IComponentBase, applyMixins, PropertyCollectionInfo, setValue } from '@syncfusion/ej2-angular-base'; |
| 3 | +import { Fab } from '@syncfusion/ej2-buttons'; |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +export const inputs: string[] = ['content','cssClass','disabled','enableHtmlSanitizer','enablePersistence','enableRtl','iconCss','iconPosition','isPrimary','isToggle','locale','position','target','visible']; |
| 8 | +export const outputs: string[] = ['created']; |
| 9 | +export const twoWays: string[] = []; |
| 10 | + |
| 11 | +/** |
| 12 | + * Represents the Angular Fab Component. |
| 13 | + * ```html |
| 14 | + * <button ejs-fab content='fab'></button> |
| 15 | + * ``` |
| 16 | + */ |
| 17 | +@Component({ |
| 18 | + selector: '[ejs-fab]', |
| 19 | + inputs: inputs, |
| 20 | + outputs: outputs, |
| 21 | + template: `<ng-content ></ng-content>`, |
| 22 | + changeDetection: ChangeDetectionStrategy.OnPush, |
| 23 | + queries: { |
| 24 | + |
| 25 | + } |
| 26 | +}) |
| 27 | +@ComponentMixins([ComponentBase]) |
| 28 | +export class FabComponent extends Fab implements IComponentBase { |
| 29 | + public containerContext : any; |
| 30 | + public tagObjects: any; |
| 31 | + public created: any; |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + constructor(private ngEle: ElementRef, private srenderer: Renderer2, private viewContainerRef:ViewContainerRef, private injector: Injector) { |
| 36 | + super(); |
| 37 | + this.element = this.ngEle.nativeElement; |
| 38 | + this.injectedModules = this.injectedModules || []; |
| 39 | + |
| 40 | + this.registerEvents(outputs); |
| 41 | + this.addTwoWay.call(this, twoWays); |
| 42 | + setValue('currentInstance', this, this.viewContainerRef); |
| 43 | + this.containerContext = new ComponentBase(); |
| 44 | + } |
| 45 | + |
| 46 | + public ngOnInit() { |
| 47 | + this.containerContext.ngOnInit(this); |
| 48 | + } |
| 49 | + |
| 50 | + public ngAfterViewInit(): void { |
| 51 | + this.containerContext.ngAfterViewInit(this); |
| 52 | + } |
| 53 | + |
| 54 | + public ngOnDestroy(): void { |
| 55 | + this.containerContext.ngOnDestroy(this); |
| 56 | + } |
| 57 | + |
| 58 | + public ngAfterContentChecked(): void { |
| 59 | + |
| 60 | + this.containerContext.ngAfterContentChecked(this); |
| 61 | + } |
| 62 | + |
| 63 | + public registerEvents: (eventList: string[]) => void; |
| 64 | + public addTwoWay: (propList: string[]) => void; |
| 65 | +} |
| 66 | + |
0 commit comments