@ -32,6 +32,7 @@ import { StatsPickerEditor } from '../components/OptionsUI/stats';
* Returns collection of common field config properties definitions
* Returns collection of common field config properties definitions
* /
* /
export const getStandardFieldConfigs = ( ) = > {
export const getStandardFieldConfigs = ( ) = > {
const category = [ 'Standard field options' ] ;
const title : FieldConfigPropertyItem < any , string , StringFieldConfigSettings > = {
const title : FieldConfigPropertyItem < any , string , StringFieldConfigSettings > = {
id : 'title' ,
id : 'title' ,
path : 'title' ,
path : 'title' ,
@ -45,6 +46,7 @@ export const getStandardFieldConfigs = () => {
expandTemplateVars : true ,
expandTemplateVars : true ,
} ,
} ,
shouldApply : field = > field . type !== FieldType . time ,
shouldApply : field = > field . type !== FieldType . time ,
category ,
} ;
} ;
const unit : FieldConfigPropertyItem < any , string , StringFieldConfigSettings > = {
const unit : FieldConfigPropertyItem < any , string , StringFieldConfigSettings > = {
@ -62,6 +64,7 @@ export const getStandardFieldConfigs = () => {
} ,
} ,
shouldApply : field = > field . type === FieldType . number ,
shouldApply : field = > field . type === FieldType . number ,
category ,
} ;
} ;
const min : FieldConfigPropertyItem < any , number , NumberFieldConfigSettings > = {
const min : FieldConfigPropertyItem < any , number , NumberFieldConfigSettings > = {
@ -78,6 +81,7 @@ export const getStandardFieldConfigs = () => {
placeholder : 'auto' ,
placeholder : 'auto' ,
} ,
} ,
shouldApply : field = > field . type === FieldType . number ,
shouldApply : field = > field . type === FieldType . number ,
category ,
} ;
} ;
const max : FieldConfigPropertyItem < any , number , NumberFieldConfigSettings > = {
const max : FieldConfigPropertyItem < any , number , NumberFieldConfigSettings > = {
@ -95,6 +99,7 @@ export const getStandardFieldConfigs = () => {
} ,
} ,
shouldApply : field = > field . type === FieldType . number ,
shouldApply : field = > field . type === FieldType . number ,
category ,
} ;
} ;
const decimals : FieldConfigPropertyItem < any , number , NumberFieldConfigSettings > = {
const decimals : FieldConfigPropertyItem < any , number , NumberFieldConfigSettings > = {
@ -115,6 +120,7 @@ export const getStandardFieldConfigs = () => {
} ,
} ,
shouldApply : field = > field . type === FieldType . number ,
shouldApply : field = > field . type === FieldType . number ,
category ,
} ;
} ;
const thresholds : FieldConfigPropertyItem < any , ThresholdsConfig , ThresholdsFieldConfigSettings > = {
const thresholds : FieldConfigPropertyItem < any , ThresholdsConfig , ThresholdsFieldConfigSettings > = {
@ -135,6 +141,7 @@ export const getStandardFieldConfigs = () => {
] ,
] ,
} ,
} ,
shouldApply : field = > field . type === FieldType . number ,
shouldApply : field = > field . type === FieldType . number ,
category : [ 'Color & thresholds' ] ,
} ;
} ;
const mappings : FieldConfigPropertyItem < any , ValueMapping [ ] , ValueMappingFieldConfigSettings > = {
const mappings : FieldConfigPropertyItem < any , ValueMapping [ ] , ValueMappingFieldConfigSettings > = {
@ -149,6 +156,7 @@ export const getStandardFieldConfigs = () => {
settings : { } ,
settings : { } ,
defaultValue : [ ] ,
defaultValue : [ ] ,
shouldApply : field = > field . type === FieldType . number ,
shouldApply : field = > field . type === FieldType . number ,
category : [ 'Value mappings' ] ,
} ;
} ;
const noValue : FieldConfigPropertyItem < any , string , StringFieldConfigSettings > = {
const noValue : FieldConfigPropertyItem < any , string , StringFieldConfigSettings > = {
@ -166,6 +174,7 @@ export const getStandardFieldConfigs = () => {
} ,
} ,
// ??? any optionsUi with no value
// ??? any optionsUi with no value
shouldApply : ( ) = > true ,
shouldApply : ( ) = > true ,
category ,
} ;
} ;
const links : FieldConfigPropertyItem < any , DataLink [ ] , StringFieldConfigSettings > = {
const links : FieldConfigPropertyItem < any , DataLink [ ] , StringFieldConfigSettings > = {
@ -180,6 +189,7 @@ export const getStandardFieldConfigs = () => {
placeholder : '-' ,
placeholder : '-' ,
} ,
} ,
shouldApply : ( ) = > true ,
shouldApply : ( ) = > true ,
category : [ 'Data links' ] ,
} ;
} ;
const color : FieldConfigPropertyItem < any , string , StringFieldConfigSettings > = {
const color : FieldConfigPropertyItem < any , string , StringFieldConfigSettings > = {
@ -194,9 +204,10 @@ export const getStandardFieldConfigs = () => {
placeholder : '-' ,
placeholder : '-' ,
} ,
} ,
shouldApply : ( ) = > true ,
shouldApply : ( ) = > true ,
category : [ 'Color & thresholds' ] ,
} ;
} ;
return [ unit , min , max , decimals , title , noValue , thresholds , mappings , links , color ] ;
return [ unit , min , max , decimals , title , noValue , color , thresholds , mappings , links ] ;
} ;
} ;
/ * *
/ * *