mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Migrate table to cue model (#61852)
* WIP table cue model * WIP table types migration * refactor * WIP table cue * docs * veneer fix, docs * docs
This commit is contained in:
@@ -631,13 +631,35 @@ export enum TableCellBackgroundDisplayMode {
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO docs
|
||||
* Sort by field state
|
||||
*/
|
||||
export interface TableSortByFieldState {
|
||||
/**
|
||||
* Flag used to indicate descending sort order
|
||||
*/
|
||||
desc?: boolean;
|
||||
/**
|
||||
* Sets the display name of the field to sort by
|
||||
*/
|
||||
displayName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Footer options
|
||||
*/
|
||||
export interface TableFooterOptions {
|
||||
countRows?: boolean;
|
||||
enablePagination?: boolean;
|
||||
fields?: Array<string>;
|
||||
reducer: Array<string>;
|
||||
show: boolean;
|
||||
}
|
||||
|
||||
export const defaultTableFooterOptions: Partial<TableFooterOptions> = {
|
||||
fields: [],
|
||||
reducer: [],
|
||||
};
|
||||
|
||||
/**
|
||||
* Auto mode table cell options
|
||||
*/
|
||||
|
||||
@@ -11,12 +11,23 @@ TableCellDisplayMode: "auto" | "color-text" | "color-background" | "color-backgr
|
||||
// or a gradient.
|
||||
TableCellBackgroundDisplayMode: "basic" | "gradient" @cuetsy(kind="enum",memberNames="Basic|Gradient")
|
||||
|
||||
// TODO docs
|
||||
// Sort by field state
|
||||
TableSortByFieldState: {
|
||||
// Sets the display name of the field to sort by
|
||||
displayName: string
|
||||
// Flag used to indicate descending sort order
|
||||
desc?: bool
|
||||
} @cuetsy(kind="interface")
|
||||
|
||||
// Footer options
|
||||
TableFooterOptions: {
|
||||
show: bool
|
||||
reducer: [...string] // actually 1 value
|
||||
fields?: [...string]
|
||||
enablePagination?: bool
|
||||
countRows?: bool
|
||||
} @cuetsy(kind="interface")
|
||||
|
||||
// Auto mode table cell options
|
||||
TableAutoCellOptions: {
|
||||
type: TableCellDisplayMode & "auto"
|
||||
|
||||
@@ -23,3 +23,12 @@ export interface TextDimensionConfig extends BaseDimensionConfig<string>, Omit<r
|
||||
export interface ColorDimensionConfig extends BaseDimensionConfig<string>, Omit<raw.ColorDimensionConfig, 'fixed'> {}
|
||||
|
||||
export * from '../common/common.gen';
|
||||
|
||||
// TODO remove when https://github.com/grafana/cuetsy/issues/74 is fixed
|
||||
export const defaultTableFieldOptions: raw.TableFieldOptions = {
|
||||
align: 'auto',
|
||||
inspect: false,
|
||||
cellOptions: {
|
||||
type: raw.TableCellDisplayMode.Auto,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user