21 lines
530 B
JavaScript
21 lines
530 B
JavaScript
import { Feature } from '../types/Feature';
|
|
export class Style extends Feature {
|
|
styleDict;
|
|
constructor(styleDict) {
|
|
super();
|
|
this.styleDict = styleDict;
|
|
}
|
|
getStyleDict() {
|
|
return this.styleDict;
|
|
}
|
|
getActionIcon(entity, action) {
|
|
const icon = this.styleDict[entity]?.icon;
|
|
return icon && icon[action];
|
|
}
|
|
getColor(entity, attr, value) {
|
|
const color = this.styleDict[entity]?.color;
|
|
return color && color[attr] && color[attr][value];
|
|
}
|
|
}
|
|
;
|