coersystem
Version:
Library for Angular projects
112 lines (105 loc) • 5.98 kB
JavaScript
import * as i0 from '@angular/core';
import { input, Directive, output, NgModule } from '@angular/core';
import { Tools } from 'coersystem/tools';
class CoerRefDirective {
constructor(template) {
this.template = template;
//Inputs
this.coerRef = input('');
this.title = input('');
this.icon = input('');
this.isDisabled = input(false);
this.show = input(true);
this.tooltip = input('');
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoerRefDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.1", type: CoerRefDirective, isStandalone: false, selector: "[coerRef]", inputs: { coerRef: { classPropertyName: "coerRef", publicName: "coerRef", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null }, show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoerRefDirective, decorators: [{
type: Directive,
args: [{
selector: '[coerRef]',
standalone: false
}]
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
class LifeCycleDirective {
constructor(element) {
this.element = element;
//Outputs
this.onInit = output();
this.afterViewInit = output();
this.onReady = output();
this.onDestroy = output();
}
ngOnInit() {
this.onInit.emit(this.element.nativeElement);
}
ngAfterViewInit() {
this.afterViewInit.emit(this.element.nativeElement);
Tools.Sleep().then(() => this.onReady.emit(this.element.nativeElement));
}
ngOnDestroy() {
this.onDestroy.emit(this.element.nativeElement);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: LifeCycleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.1", type: LifeCycleDirective, isStandalone: false, selector: "[lifeCycle]", outputs: { onInit: "onInit", afterViewInit: "afterViewInit", onReady: "onReady", onDestroy: "onDestroy" }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: LifeCycleDirective, decorators: [{
type: Directive,
args: [{
selector: '[lifeCycle]',
standalone: false
}]
}], ctorParameters: () => [{ type: i0.ElementRef }] });
class ElementDataDirective {
constructor(element) {
this.element = element;
//Outputs
this.onLoadedData = output();
}
ngAfterViewInit() {
Tools.Sleep().then(() => {
this.onLoadedData.emit({
innerText: this.element.nativeElement.innerText
});
});
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ElementDataDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.1", type: ElementDataDirective, isStandalone: false, selector: "[elementData]", outputs: { onLoadedData: "onLoadedData" }, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ElementDataDirective, decorators: [{
type: Directive,
args: [{
selector: '[elementData]',
standalone: false
}]
}], ctorParameters: () => [{ type: i0.ElementRef }] });
class DirectivesModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: DirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: DirectivesModule, declarations: [CoerRefDirective,
ElementDataDirective,
LifeCycleDirective], exports: [CoerRefDirective,
ElementDataDirective,
LifeCycleDirective] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: DirectivesModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: DirectivesModule, decorators: [{
type: NgModule,
args: [{
declarations: [
CoerRefDirective,
ElementDataDirective,
LifeCycleDirective,
],
exports: [
CoerRefDirective,
ElementDataDirective,
LifeCycleDirective
]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { CoerRefDirective, DirectivesModule, ElementDataDirective, LifeCycleDirective };
//# sourceMappingURL=coersystem-directives.mjs.map