Skip to content

Commit

Permalink
Fix tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Stitz committed Jun 13, 2018
1 parent 85d9044 commit 06c3ab6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
38 changes: 13 additions & 25 deletions src/model/Column.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import AEventDispatcher from '../internal/AEventDispatcher';
import {similar} from '../internal/math';
import {fixCSS} from '../internal/utils';
import {defaultGroup} from './Group';
import {IColumnDesc, IDataRow, IGroup, IGroupData} from './interfaces';
import {isMissingValue} from './missing';
import Ranking, {ISortCriteria} from './Ranking';
import { similar } from '../internal/math';
import { fixCSS } from '../internal/utils';
import { defaultGroup } from './Group';
import { IColumnDesc, IDataRow, IGroup, IGroupData, EGuessedState } from './interfaces';
import { isMissingValue } from './missing';
import Ranking, { ISortCriteria } from './Ranking';

export {IColumnDesc} from './interfaces';
export { IColumnDesc } from './interfaces';

export interface IFlatColumn {
readonly col: Column;
Expand Down Expand Up @@ -37,24 +37,12 @@ export interface IColumnParent {

}



/**
* flag if column type was guessed
*/
readonly guessed?: EGuessedState;
export interface IColumnMetaData {
label: string;
description: string;
color: string | null;
}

export enum EGuessedState {
UNKNOWN,
GUESSED,
CHECKED
}

/**
* a column in LineUp
*/
Expand Down Expand Up @@ -188,9 +176,9 @@ export default class Column extends AEventDispatcher {
*/
protected createEventList() {
return super.createEventList().concat([Column.EVENT_WIDTH_CHANGED, Column.EVENT_FILTER_CHANGED,
Column.EVENT_LABEL_CHANGED, Column.EVENT_METADATA_CHANGED, Column.EVENT_VISIBILITY_CHANGED, Column.EVENT_SUMMARY_RENDERER_TYPE_CHANGED,
Column.EVENT_ADD_COLUMN, Column.EVENT_REMOVE_COLUMN, Column.EVENT_RENDERER_TYPE_CHANGED, Column.EVENT_GROUP_RENDERER_TYPE_CHANGED, Column.EVENT_SORTMETHOD_CHANGED, Column.EVENT_MOVE_COLUMN,
Column.EVENT_DIRTY, Column.EVENT_DIRTY_HEADER, Column.EVENT_DIRTY_VALUES, Column.EVENT_GROUPING_CHANGED, Column.EVENT_DATA_LOADED]);
Column.EVENT_LABEL_CHANGED, Column.EVENT_METADATA_CHANGED, Column.EVENT_VISIBILITY_CHANGED, Column.EVENT_SUMMARY_RENDERER_TYPE_CHANGED,
Column.EVENT_ADD_COLUMN, Column.EVENT_REMOVE_COLUMN, Column.EVENT_RENDERER_TYPE_CHANGED, Column.EVENT_GROUP_RENDERER_TYPE_CHANGED, Column.EVENT_SORTMETHOD_CHANGED, Column.EVENT_MOVE_COLUMN,
Column.EVENT_DIRTY, Column.EVENT_DIRTY_HEADER, Column.EVENT_DIRTY_VALUES, Column.EVENT_GROUPING_CHANGED, Column.EVENT_DATA_LOADED]);
}

getWidth() {
Expand Down Expand Up @@ -230,7 +218,7 @@ export default class Column extends AEventDispatcher {
*/
flatten(r: IFlatColumn[], offset: number, _levelsToGo = 0, _padding = 0): number {
const w = this.getWidth();
r.push({col: this, offset, width: w});
r.push({ col: this, offset, width: w });
return w;
}

Expand Down Expand Up @@ -315,12 +303,12 @@ export default class Column extends AEventDispatcher {
private isSortedByMeImpl(selector: ((r: Ranking) => ISortCriteria[])): { asc: 'asc' | 'desc' | undefined, priority: string | undefined } {
const ranker = this.findMyRanker();
if (!ranker) {
return {asc: undefined, priority: undefined};
return { asc: undefined, priority: undefined };
}
const criterias = selector(ranker);
const index = criterias.findIndex((c) => c.col === this);
if (index < 0) {
return {asc: undefined, priority: undefined};
return { asc: undefined, priority: undefined };
}
return {
asc: criterias[index].asc ? 'asc' : 'desc',
Expand Down
11 changes: 11 additions & 0 deletions src/model/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ export interface IStyleColumn {
}


export enum EGuessedState {
UNKNOWN,
GUESSED,
CHECKED
}


export interface IColumnDesc extends Partial<IStyleColumn> {
/**
* label of the column
Expand All @@ -59,6 +66,10 @@ export interface IColumnDesc extends Partial<IStyleColumn> {
* the column type
*/
type: string;
/**
* flag if column type was guessed
*/
readonly guessed?: EGuessedState;
}


Expand Down

0 comments on commit 06c3ab6

Please sign in to comment.