UNPKG

@obliczeniowo/elementary

Version:
82 lines (75 loc) 4.13 kB
import * as i0 from '@angular/core'; import { Input, Component, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { keys } from '@obliczeniowo/elementary/objects'; /** * Gradient svg object. * * @example * * <svg> * <def> * <g obl-svg-linear-gradient [gradient]="gradientDefObject" [name]="gradientId"></g> * </def> * ... * </svg> */ class SvgLinearGradientComponent { /** required gradient definition object */ gradient; /** If set then use coordinates measured as px not percentage of object filled with it */ gradientUnits; /** required parameter used as unique id */ name; static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SvgLinearGradientComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: SvgLinearGradientComponent, isStandalone: false, selector: "g[obl-svg-linear-gradient]", inputs: { gradient: "gradient", gradientUnits: "gradientUnits", name: "name" }, ngImport: i0, template: "<svg:linearGradient\n [id]=\"name\"\n [attr.x1]=\"gradient.x1\"\n [attr.x2]=\"gradient.x2 ?? '100%'\"\n [attr.y1]=\"gradient.y1\"\n [attr.y2]=\"gradient.y2\"\n [attr.gradientUnits]=\"gradientUnits\"\n>\n @for (point of gradient.points; track $index) {\n <stop\n [attr.offset]=\"point.offset\"\n [style.stopColor]=\"point.color\"\n [style.opacity]=\"point.offset\"\n ></stop>\n }\n</svg:linearGradient>\n", styles: [""] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SvgLinearGradientComponent, decorators: [{ type: Component, args: [{ selector: 'g[obl-svg-linear-gradient]', standalone: false, template: "<svg:linearGradient\n [id]=\"name\"\n [attr.x1]=\"gradient.x1\"\n [attr.x2]=\"gradient.x2 ?? '100%'\"\n [attr.y1]=\"gradient.y1\"\n [attr.y2]=\"gradient.y2\"\n [attr.gradientUnits]=\"gradientUnits\"\n>\n @for (point of gradient.points; track $index) {\n <stop\n [attr.offset]=\"point.offset\"\n [style.stopColor]=\"point.color\"\n [style.opacity]=\"point.offset\"\n ></stop>\n }\n</svg:linearGradient>\n" }] }], propDecorators: { gradient: [{ type: Input }], gradientUnits: [{ type: Input }], name: [{ type: Input }] } }); class SvgModule { static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SvgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: SvgModule, declarations: [SvgLinearGradientComponent], imports: [CommonModule], exports: [SvgLinearGradientComponent] }); static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SvgModule, imports: [CommonModule] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: SvgModule, decorators: [{ type: NgModule, args: [{ declarations: [ SvgLinearGradientComponent ], imports: [ CommonModule, ], exports: [ SvgLinearGradientComponent ] }] }] }); const ns = 'http://www.w3.org/2000/svg'; const xlink = 'http://www.w3.org/1999/xlink'; class Style { styles; toString() { let styleTxt = ''; keys(this.styles).forEach((key) => { styleTxt += `${key}:${this.styles[key].toString()};`; }); return styleTxt; } constructor(styleObject) { this.styles = styleObject; } } /** * Generated bundle index. Do not edit. */ export { Style, SvgLinearGradientComponent, SvgModule, ns, xlink }; //# sourceMappingURL=obliczeniowo-elementary-svg.mjs.map