|
@@ -84,6 +84,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImpor
|
|
type: Input
|
|
type: Input
|
|
}] } });
|
|
}] } });
|
|
|
|
|
|
|
|
+class IconComponent {
|
|
|
|
+ constructor() {
|
|
|
|
+ this.icon = '';
|
|
|
|
+ this.iconClass = '';
|
|
|
|
+ this.fill = 'currentColor';
|
|
|
|
+ this.strokeWidth = 1.5;
|
|
|
|
+ this.strokeColor = 'currentColor';
|
|
|
|
+ this.size = '6';
|
|
|
|
+ this.iconPath = '';
|
|
|
|
+ }
|
|
|
|
+ ngOnInit() {
|
|
|
|
+ this.iconPath = this.getIconPath();
|
|
|
|
+ this.strokeColor = this.getFormattedColor(this.strokeColor);
|
|
|
|
+ this.fill = this.getFormattedColor(this.fill);
|
|
|
|
+ }
|
|
|
|
+ getFormattedColor(color) {
|
|
|
|
+ if (color.startsWith('--')) {
|
|
|
|
+ const rgbValue = getComputedStyle(document.documentElement).getPropertyValue(color).trim();
|
|
|
|
+ return `rgb(${rgbValue})`;
|
|
|
|
+ }
|
|
|
|
+ return color;
|
|
|
|
+ }
|
|
|
|
+ getIconPath() {
|
|
|
|
+ return ` assets/images/icons.svg#${this.icon}`;
|
|
|
|
+ }
|
|
|
|
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
|
|
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.0", type: IconComponent, isStandalone: true, selector: "ct-icon", inputs: { icon: "icon", iconClass: "iconClass", fill: "fill", strokeWidth: "strokeWidth", strokeColor: "strokeColor", size: "size" }, ngImport: i0, template: "<svg\n [ngClass]=\"iconClass\"\n [attr.fill]=\"fill\"\n [attr.stroke-width]=\"strokeWidth\"\n [attr.stroke]=\"strokeColor\"\n class=\"flex size-full\">\n <use [attr.xlink:href]=\"iconPath\"></use>\n</svg>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
|
|
+}
|
|
|
|
+i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: IconComponent, decorators: [{
|
|
|
|
+ type: Component,
|
|
|
|
+ args: [{ selector: 'ct-icon', standalone: true, imports: [NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg\n [ngClass]=\"iconClass\"\n [attr.fill]=\"fill\"\n [attr.stroke-width]=\"strokeWidth\"\n [attr.stroke]=\"strokeColor\"\n class=\"flex size-full\">\n <use [attr.xlink:href]=\"iconPath\"></use>\n</svg>\n" }]
|
|
|
|
+ }], propDecorators: { icon: [{
|
|
|
|
+ type: Input
|
|
|
|
+ }], iconClass: [{
|
|
|
|
+ type: Input
|
|
|
|
+ }], fill: [{
|
|
|
|
+ type: Input
|
|
|
|
+ }], strokeWidth: [{
|
|
|
|
+ type: Input
|
|
|
|
+ }], strokeColor: [{
|
|
|
|
+ type: Input
|
|
|
|
+ }], size: [{
|
|
|
|
+ type: Input
|
|
|
|
+ }] } });
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Public API Surface of circletone
|
|
* Public API Surface of circletone
|
|
*/
|
|
*/
|
|
@@ -92,5 +137,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImpor
|
|
* Generated bundle index. Do not edit.
|
|
* Generated bundle index. Do not edit.
|
|
*/
|
|
*/
|
|
|
|
|
|
-export { ButtonComponent, tailwindPreset };
|
|
|
|
|
|
+export { ButtonComponent, IconComponent, tailwindPreset };
|
|
//# sourceMappingURL=circletone.mjs.map
|
|
//# sourceMappingURL=circletone.mjs.map
|