@obliczeniowo/elementary
Version:
Library made in Angular version 20
45 lines (40 loc) • 3.35 kB
JavaScript
import * as i0 from '@angular/core';
import { input, Component, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { keys } from '@obliczeniowo/elementary/objects';
class ColorKeyLegendComponent {
keys = input();
keysArray() {
return keys(this.keys() || {});
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ColorKeyLegendComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: ColorKeyLegendComponent, isStandalone: false, selector: "obl-color-key-legend", inputs: { keys: { classPropertyName: "keys", publicName: "keys", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@for (key of keysArray(); track $index) {\n <div class=\"record\">\n <div class=\"key\" [style.background]=\"keys()?.[key]?.color || undefined\"></div>\n <span>{{key}}</span>: <span>{{ keys()?.[key]?.count || ''}}</span>\n </div>\n}\n", styles: [":host{display:block;background-color:var(--default-background-color);padding:10px}.record{display:flex;flex-wrap:nowrap;padding:5px;align-items:center}.key{width:20px;height:20px;border-radius:50%;margin-right:10px}\n"] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ColorKeyLegendComponent, decorators: [{
type: Component,
args: [{ selector: 'obl-color-key-legend', standalone: false, template: "@for (key of keysArray(); track $index) {\n <div class=\"record\">\n <div class=\"key\" [style.background]=\"keys()?.[key]?.color || undefined\"></div>\n <span>{{key}}</span>: <span>{{ keys()?.[key]?.count || ''}}</span>\n </div>\n}\n", styles: [":host{display:block;background-color:var(--default-background-color);padding:10px}.record{display:flex;flex-wrap:nowrap;padding:5px;align-items:center}.key{width:20px;height:20px;border-radius:50%;margin-right:10px}\n"] }]
}] });
class ColorKeyLegendModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ColorKeyLegendModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: ColorKeyLegendModule, declarations: [ColorKeyLegendComponent], imports: [CommonModule], exports: [ColorKeyLegendComponent] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ColorKeyLegendModule, imports: [CommonModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ColorKeyLegendModule, decorators: [{
type: NgModule,
args: [{
declarations: [
ColorKeyLegendComponent
],
imports: [
CommonModule
],
exports: [
ColorKeyLegendComponent
]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { ColorKeyLegendComponent, ColorKeyLegendModule };
//# sourceMappingURL=obliczeniowo-elementary-color-key-legend.mjs.map