mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
use typescrit in angular table
This commit is contained in:
parent
372e892fab
commit
32543cac10
@ -2,6 +2,7 @@ import _ from 'lodash';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import kbn from 'app/core/utils/kbn';
|
import kbn from 'app/core/utils/kbn';
|
||||||
import { getValueFormat, getColorFromHexRgbOrName, GrafanaThemeType } from '@grafana/ui';
|
import { getValueFormat, getColorFromHexRgbOrName, GrafanaThemeType } from '@grafana/ui';
|
||||||
|
import { Style } from '../table2/types';
|
||||||
|
|
||||||
export class TableRenderer {
|
export class TableRenderer {
|
||||||
formatters: any[];
|
formatters: any[];
|
||||||
@ -51,7 +52,7 @@ export class TableRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getColorForValue(value, style) {
|
getColorForValue(value, style: Style) {
|
||||||
if (!style.thresholds) {
|
if (!style.thresholds) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -63,7 +64,7 @@ export class TableRenderer {
|
|||||||
return getColorFromHexRgbOrName(_.first(style.colors), this.theme);
|
return getColorFromHexRgbOrName(_.first(style.colors), this.theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultCellFormatter(v, style) {
|
defaultCellFormatter(v, style: Style) {
|
||||||
if (v === null || v === void 0 || v === undefined) {
|
if (v === null || v === void 0 || v === undefined) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -190,7 +191,7 @@ export class TableRenderer {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
setColorState(value, style) {
|
setColorState(value, style: Style) {
|
||||||
if (!style.colorMode) {
|
if (!style.colorMode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user