diff --git a/docs/sources/packages_api/data/_index.md b/docs/sources/packages_api/data/_index.md index e42800292e2..9a06d4647c9 100644 --- a/docs/sources/packages_api/data/_index.md +++ b/docs/sources/packages_api/data/_index.md @@ -27,9 +27,12 @@ A library containing most of the core functionality and data types used in Grafa | [DataSourceApi](./datasourceapi/) | The main data source abstraction interface, represents an instance of a data sourceAlthough this is a class, datasource implementations do not \*yet\* need to extend it. As such, we can not yet add functions with default implementations. | | [DataSourcePlugin](./datasourceplugin/) | | | [FieldCache](./fieldcache/) | | +| [FieldConfigEditorBuilder](./fieldconfigeditorbuilder/) | Fluent API for declarative creation of field config option editors | +| [FieldConfigOptionsRegistry](./fieldconfigoptionsregistry/) | | | [GrafanaPlugin](./grafanaplugin/) | | | [LanguageProvider](./languageprovider/) | | | [MutableDataFrame](./mutabledataframe/) | | +| [PanelOptionsEditorBuilder](./paneloptionseditorbuilder/) | Fluent API for declarative creation of panel options | | [PanelPlugin](./panelplugin/) | | | [Registry](./registry/) | | | [ScaledVector](./scaledvector/) | | @@ -46,11 +49,12 @@ A library containing most of the core functionality and data types used in Grafa | [DataTransformerID](./datatransformerid/) | | | [ExploreMode](./exploremode/) | | | [FieldColorMode](./fieldcolormode/) | | +| [FieldConfigProperty](./fieldconfigproperty/) | | | [FieldMatcherID](./fieldmatcherid/) | | | [FieldType](./fieldtype/) | | | [FrameMatcherID](./framematcherid/) | Field name matchers | | [GrafanaThemeType](./grafanathemetype/) | | -| [LoadingState](./loadingstate/) | | +| [LoadingState](./loadingstate/) | Represent panel data loading state. | | [LogLevel](./loglevel/) | Mapping of log level abbreviation to canonical log level. Supported levels are reduce to limit color variation. | | [LogsDedupDescription](./logsdedupdescription/) | | | [LogsDedupStrategy](./logsdedupstrategy/) | | @@ -63,7 +67,7 @@ A library containing most of the core functionality and data types used in Grafa | [PluginState](./pluginstate/) | | | [PluginType](./plugintype/) | | | [ReducerID](./reducerid/) | | -| [ThresholdsMode](./thresholdsmode/) | | +| [ThresholdsMode](./thresholdsmode/) | Display mode | | [VariableOrigin](./variableorigin/) | | | [VariableSuggestionsScope](./variablesuggestionsscope/) | | | [VizOrientation](./vizorientation/) | | @@ -79,6 +83,7 @@ A library containing most of the core functionality and data types used in Grafa | [calculateFieldStats(rows, extractor)](./calculatefieldstats/) | | | [calculateLogsLabelStats(rows, label)](./calculatelogslabelstats/) | | | [calculateStats(values)](./calculatestats/) | | +| [doStandardCalcs(field, ignoreNulls, nullAsZero)](./dostandardcalcs/) | | | [eventFactory(name)](./eventfactory/) | | | [findCommonLabels(labelsSets)](./findcommonlabels/) | Returns a map labels that are common to the given label sets. | | [findHighlightChunksInText({ searchWords, textToHighlight, })](./findhighlightchunksintext/) | Adapt findMatchesInText for react-highlight-words findChunks handler. See https://github.com/bvaughn/react-highlight-words\#props | @@ -104,6 +109,7 @@ A library containing most of the core functionality and data types used in Grafa | [getValueFormatterIndex()](./getvalueformatterindex/) | | | [grafanaDataFrameToArrowTable(data)](./grafanadataframetoarrowtable/) | | | [guessFieldTypeForField(field)](./guessfieldtypeforfield/) | Looks at the data to guess the column type. This ignores any existing setting | +| [guessFieldTypeFromNameAndValue(name, v)](./guessfieldtypefromnameandvalue/) | Given a name and value, this will pick a reasonable field type | | [guessFieldTypeFromValue(v)](./guessfieldtypefromvalue/) | Given a value this will guess the best column typeTODO: better Date/Time support! Look for standard date strings? | | [locale(value, decimals)](./locale/) | | | [parseFlags(text)](./parseflags/) | Converts any mode modifiers in the text to the Javascript equivalent flag | @@ -131,8 +137,8 @@ A library containing most of the core functionality and data types used in Grafa | [toNumberString(value)](./tonumberstring/) | | | [transformDataFrame(options, data)](./transformdataframe/) | Apply configured transformations to the input data | | [updateDatasourcePluginOption(props, key, val)](./updatedatasourcepluginoption/) | | -| [updateDatasourcePluginResetOption(props, key)](./updatedatasourcepluginresetoption/) | | | [validateFieldConfig(config)](./validatefieldconfig/) | This checks that all options on FieldConfig make sense. It mutates any value that needs fixed. In particular this makes sure that the first threshold value is -Infinity (not valid in JSON) | +| [vectorator(vector)](./vectorator/) | Use functional programming with your vector | ## Interfaces @@ -143,23 +149,30 @@ A library containing most of the core functionality and data types used in Grafa | [AnnotationEvent](./annotationevent/) | | | [AnnotationQueryRequest](./annotationqueryrequest/) | Options passed to the datasource.annotationQuery method. See docs/plugins/developing/datasource.md | | [AppEvent](./appevent/) | | +| [ApplyFieldOverrideOptions](./applyfieldoverrideoptions/) | | | [AppPluginMeta](./apppluginmeta/) | | | [AppRootProps](./approotprops/) | | | [ArrowDataFrame](./arrowdataframe/) | | +| [BuildInfo](./buildinfo/) | Describes the build information that will be available via the Grafana configuration. | +| [CalculateFieldTransformerOptions](./calculatefieldtransformeroptions/) | | +| [ColorFieldConfigSettings](./colorfieldconfigsettings/) | | | [Column](./column/) | | | [ConfigOverrideRule](./configoverriderule/) | | | [CreatePlotOverlay](./createplotoverlay/) | | | [CSVConfig](./csvconfig/) | | | [CSVOptions](./csvoptions/) | | | [CSVParseCallbacks](./csvparsecallbacks/) | | +| [DataConfigSource](./dataconfigsource/) | Describes and API for exposing panel specific data configurations. | | [DataFrame](./dataframe/) | | | [DataFrameDTO](./dataframedto/) | Like a DataFrame, but fields may be a FieldDTO | | [DataLink](./datalink/) | Link configuration. The values may contain variables that need to be processed before running | | [DataLinkClickEvent](./datalinkclickevent/) | Callback info for DataLink click events | -| [DataQuery](./dataquery/) | | +| [DataLinksFieldConfigSettings](./datalinksfieldconfigsettings/) | | +| [DataQuery](./dataquery/) | These are the common properties available to all queries in all datasources Specific implementations will extend this interface adding the required properties for the given context | | [DataQueryError](./dataqueryerror/) | | | [DataQueryRequest](./dataqueryrequest/) | | | [DataQueryResponse](./dataqueryresponse/) | | +| [DataQueryTimings](./dataquerytimings/) | | | [DataSourceConstructor](./datasourceconstructor/) | | | [DataSourceInstanceSettings](./datasourceinstancesettings/) | Frontend settings model that is passed to Datasource constructor. This differs a bit from the model above as this data model is available to every user who has access to a data source (Viewers+). This is loaded in bootData (on page load), or from: /api/frontend/settings | | [DataSourceJsonData](./datasourcejsondata/) | | @@ -181,19 +194,20 @@ A library containing most of the core functionality and data types used in Grafa | [DynamicConfigValue](./dynamicconfigvalue/) | | | [ExploreQueryFieldProps](./explorequeryfieldprops/) | | | [ExploreStartPageProps](./explorestartpageprops/) | | +| [FeatureToggles](./featuretoggles/) | Describes available feature toggles in Grafana. These can be configured via the conf/custom.ini to enable features under development or not yet available in stable version. | | [Field](./field/) | | | [FieldCalcs](./fieldcalcs/) | | | [FieldColor](./fieldcolor/) | | | [FieldConfig](./fieldconfig/) | Every property is optionalPlugins may extend this with additional properties. Something like series overrides | +| [FieldConfigEditorConfig](./fieldconfigeditorconfig/) | | | [FieldConfigEditorProps](./fieldconfigeditorprops/) | | +| [FieldConfigPropertyItem](./fieldconfigpropertyitem/) | | | [FieldConfigSource](./fieldconfigsource/) | | | [FieldDisplay](./fielddisplay/) | | -| [FieldDisplayOptions](./fielddisplayoptions/) | | | [FieldDTO](./fielddto/) | Like a field, but properties are optional and values may be a simple array | | [FieldMatcherInfo](./fieldmatcherinfo/) | | | [FieldOverrideContext](./fieldoverridecontext/) | | | [FieldOverrideEditorProps](./fieldoverrideeditorprops/) | | -| [FieldPropertyEditorItem](./fieldpropertyeditoritem/) | | | [FieldReducerInfo](./fieldreducerinfo/) | | | [FieldWithIndex](./fieldwithindex/) | | | [FilterFieldsByNameTransformerOptions](./filterfieldsbynametransformeroptions/) | | @@ -202,12 +216,14 @@ A library containing most of the core functionality and data types used in Grafa | [FormattedValue](./formattedvalue/) | | | [FrameMatcherInfo](./framematcherinfo/) | | | [GetFieldDisplayValuesOptions](./getfielddisplayvaluesoptions/) | | +| [GrafanaConfig](./grafanaconfig/) | Describes all the different Grafana configuration values available for an instance. | | [GrafanaTheme](./grafanatheme/) | | | [GrafanaThemeCommons](./grafanathemecommons/) | | | [GraphSeriesXY](./graphseriesxy/) | View model projection of a series | | [HistoryItem](./historyitem/) | | | [IntervalValues](./intervalvalues/) | | | [Labels](./labels/) | | +| [LicenseInfo](./licenseinfo/) | Describes the license information about the current running instance of Grafana. | | [LinkModel](./linkmodel/) | Processed Link Model. The values are ready to use | | [LinkModelSupplier](./linkmodelsupplier/) | Provides a way to produce links on demandTODO: ScopedVars in in GrafanaUI package! | | [LogLabelStatsModel](./loglabelstatsmodel/) | | @@ -220,13 +236,18 @@ A library containing most of the core functionality and data types used in Grafa | [MetadataInspectorProps](./metadatainspectorprops/) | | | [MetricFindValue](./metricfindvalue/) | | | [MutableVector](./mutablevector/) | Vector with standard manipulation functions | -| [NavModel](./navmodel/) | | +| [NavModel](./navmodel/) | Interface used to describe different kinds of page titles and page navigation. Navmodels are usually generated in the backend and stored in Redux. | | [NavModelBreadcrumb](./navmodelbreadcrumb/) | | | [NavModelItem](./navmodelitem/) | | +| [NumberFieldConfigSettings](./numberfieldconfigsettings/) | | +| [OrganizeFieldsTransformerOptions](./organizefieldstransformeroptions/) | | | [PanelData](./paneldata/) | | | [PanelEditorProps](./paneleditorprops/) | | | [PanelMenuItem](./panelmenuitem/) | | | [PanelModel](./panelmodel/) | | +| [PanelOptionsEditorConfig](./paneloptionseditorconfig/) | | +| [PanelOptionsEditorItem](./paneloptionseditoritem/) | | +| [PanelOptionsEditorProps](./paneloptionseditorprops/) | | | [PanelPluginMeta](./panelpluginmeta/) | | | [PanelProps](./panelprops/) | | | [PluginBuildInfo](./pluginbuildinfo/) | | @@ -242,9 +263,12 @@ A library containing most of the core functionality and data types used in Grafa | [QueryHint](./queryhint/) | | | [QueryResultBase](./queryresultbase/) | | | [QueryResultMeta](./queryresultmeta/) | | +| [QueryResultMetaNotice](./queryresultmetanotice/) | QueryResultMetaNotice is a structure that provides user notices for query result data | +| [QueryResultMetaStat](./queryresultmetastat/) | | | [RangeMap](./rangemap/) | | | [RawTimeRange](./rawtimerange/) | | | [ReadWriteVector](./readwritevector/) | Apache arrow vectors are Read/Write | +| [ReduceDataOptions](./reducedataoptions/) | Options for how to turn DataFrames into an array of display values | | [ReduceTransformerOptions](./reducetransformeroptions/) | | | [RegistryItem](./registryitem/) | | | [RegistryItemWithOptions](./registryitemwithoptions/) | | @@ -253,18 +277,30 @@ A library containing most of the core functionality and data types used in Grafa | [ScopedVars](./scopedvars/) | | | [ScreenshotInfo](./screenshotinfo/) | | | [SelectableValue](./selectablevalue/) | Used in select elements | +| [SelectFieldConfigSettings](./selectfieldconfigsettings/) | | +| [SeriesToColumnsOptions](./seriestocolumnsoptions/) | | +| [StandardEditorProps](./standardeditorprops/) | | +| [StandardEditorsRegistryItem](./standardeditorsregistryitem/) | | +| [StringFieldConfigSettings](./stringfieldconfigsettings/) | | | [TableData](./tabledata/) | | | [TextMatch](./textmatch/) | | | [Threshold](./threshold/) | | -| [ThresholdsConfig](./thresholdsconfig/) | | +| [ThresholdsConfig](./thresholdsconfig/) | Config that is passed to the ThresholdsEditor | +| [ThresholdsFieldConfigSettings](./thresholdsfieldconfigsettings/) | | | [TimeOption](./timeoption/) | | | [TimeOptions](./timeoptions/) | | | [TimeRange](./timerange/) | | | [TimeSeries](./timeseries/) | | +| [TransformerRegistyItem](./transformerregistyitem/) | | +| [TransformerUIProps](./transformeruiprops/) | | +| [UnitFieldConfigSettings](./unitfieldconfigsettings/) | | | [UserOrgDTO](./userorgdto/) | | | [ValueFormat](./valueformat/) | | | [ValueFormatCategory](./valueformatcategory/) | | +| [ValueLinkConfig](./valuelinkconfig/) | | | [ValueMap](./valuemap/) | | +| [ValueMappingFieldConfigSettings](./valuemappingfieldconfigsettings/) | | +| [VariableModel](./variablemodel/) | | | [VariableSuggestion](./variablesuggestion/) | | | [Vector](./vector/) | | | [YAxis](./yaxis/) | | @@ -282,7 +318,11 @@ A library containing most of the core functionality and data types used in Grafa | Variable | Description | | --- | --- | +| [booleanOverrideProcessor](./booleanoverrideprocessor/) | | | [createDimension](./createdimension/) | | +| [createOrderFieldsComparer](./createorderfieldscomparer/) | | +| [DataLinkBuiltInVars](./datalinkbuiltinvars/) | | +| [dataLinksOverrideProcessor](./datalinksoverrideprocessor/) | | | [dateTime](./datetime/) | | | [dateTimeAsMoment](./datetimeasmoment/) | | | [dateTimeForTimeZone](./datetimefortimezone/) | | @@ -315,31 +355,46 @@ A library containing most of the core functionality and data types used in Grafa | [getValueFromDimension](./getvaluefromdimension/) | | | [guessFieldTypes](./guessfieldtypes/) | | | [hasMsResolution](./hasmsresolution/) | Checks if series time field has ms resolution | +| [identityOverrideProcessor](./identityoverrideprocessor/) | | | [isDataFrame](./isdataframe/) | | | [isDateTime](./isdatetime/) | | | [ISO\_8601](./iso_8601/) | | | [isTableData](./istabledata/) | | +| [locationUtil](./locationutil/) | | | [LogsParsers](./logsparsers/) | | | [MISSING\_VALUE](./missing_value/) | | | [MS\_DATE\_TIME\_FORMAT](./ms_date_time_format/) | | +| [numberOverrideProcessor](./numberoverrideprocessor/) | | | [objRemoveUndefined](./objremoveundefined/) | | | [onUpdateDatasourceJsonDataOption](./onupdatedatasourcejsondataoption/) | | +| [onUpdateDatasourceJsonDataOptionChecked](./onupdatedatasourcejsondataoptionchecked/) | | | [onUpdateDatasourceJsonDataOptionSelect](./onupdatedatasourcejsondataoptionselect/) | | | [onUpdateDatasourceOption](./onupdatedatasourceoption/) | | | [onUpdateDatasourceResetOption](./onupdatedatasourceresetoption/) | | | [onUpdateDatasourceSecureJsonDataOption](./onupdatedatasourcesecurejsondataoption/) | | | [onUpdateDatasourceSecureJsonDataOptionSelect](./onupdatedatasourcesecurejsondataoptionselect/) | | +| [selectOverrideProcessor](./selectoverrideprocessor/) | | | [setLocale](./setlocale/) | | +| [standardEditorsRegistry](./standardeditorsregistry/) | | | [standardFieldConfigEditorRegistry](./standardfieldconfigeditorregistry/) | | +| [standardTransformers](./standardtransformers/) | | +| [standardTransformersRegistry](./standardtransformersregistry/) | Registry of transformation options that can be driven by stored configuration files. | +| [stringOverrideProcessor](./stringoverrideprocessor/) | | +| [textUtil](./textutil/) | | +| [thresholdsOverrideProcessor](./thresholdsoverrideprocessor/) | | | [TIME\_FORMAT](./time_format/) | | | [toDataFrame](./todataframe/) | | | [toDuration](./toduration/) | | | [toLegacyResponseData](./tolegacyresponsedata/) | | +| [toPascalCase](./topascalcase/) | | | [toUtc](./toutc/) | | -| [transformersRegistry](./transformersregistry/) | | | [unEscapeStringFromRegex](./unescapestringfromregex/) | | +| [unitOverrideProcessor](./unitoverrideprocessor/) | | | [updateDatasourcePluginJsonDataOption](./updatedatasourcepluginjsondataoption/) | | +| [updateDatasourcePluginResetOption](./updatedatasourcepluginresetoption/) | | | [updateDatasourcePluginSecureJsonDataOption](./updatedatasourcepluginsecurejsondataoption/) | | +| [urlUtil](./urlutil/) | | +| [valueMappingsOverrideProcessor](./valuemappingsoverrideprocessor/) | | | [VAR\_CALC](./var_calc/) | | | [VAR\_CELL\_PREFIX](./var_cell_prefix/) | | | [VAR\_FIELD\_NAME](./var_field_name/) | | @@ -354,14 +409,13 @@ A library containing most of the core functionality and data types used in Grafa | [DataQueryResponseData](./dataqueryresponsedata/) | | | [DataSourceOptionsType](./datasourceoptionstype/) | | | [DataSourceQueryType](./datasourcequerytype/) | | -| [DataTransformer](./datatransformer/) | Immutable data transformation | +| [DataTransformer](./datatransformer/) | Function that transform data frames (AKA transformer) | | [DateTimeInput](./datetimeinput/) | | | [DecimalCount](./decimalcount/) | | | [Dimensions](./dimensions/) | | | [DisplayProcessor](./displayprocessor/) | | | [DurationInput](./durationinput/) | | | [DurationUnit](./durationunit/) | | -| [FieldConfigEditorRegistry](./fieldconfigeditorregistry/) | | | [FieldMatcher](./fieldmatcher/) | | | [FormatInput](./formatinput/) | | | [FrameMatcher](./framematcher/) | | @@ -372,9 +426,10 @@ A library containing most of the core functionality and data types used in Grafa | [LinkTarget](./linktarget/) | | | [MutableField](./mutablefield/) | | | [NavIndex](./navindex/) | | -| [Omit](./omit/) | | +| [Omit\_2](./omit_2/) | | | [PanelMigrationHandler](./panelmigrationhandler/) | Called when a panel is first loaded with current panel model | -| [PanelTypeChangedHandler](./paneltypechangedhandler/) | Called before a panel is initialized | +| [PanelOptionEditorsRegistry](./paneloptioneditorsregistry/) | | +| [PanelTypeChangedHandler](./paneltypechangedhandler/) | Called before a panel is initialized. Allows panel inspection for any updates before changing the panel type. | | [ScaleCalculator](./scalecalculator/) | | | [Subtract](./subtract/) | | | [TimeFragment](./timefragment/) | | @@ -383,6 +438,10 @@ A library containing most of the core functionality and data types used in Grafa | [TimeZone](./timezone/) | | | [TimeZoneBrowser](./timezonebrowser/) | | | [TimeZoneUtc](./timezoneutc/) | | +| [UrlQueryMap](./urlquerymap/) | Type to represent the values parsed from the query string. | +| [UrlQueryValue](./urlqueryvalue/) | Type to represent the value of a single query variable. | +| [ValueConverter](./valueconverter/) | | | [ValueFormatter](./valueformatter/) | | | [ValueMapping](./valuemapping/) | | +| [VariableType](./variabletype/) | | diff --git a/docs/sources/packages_api/data/appevents.md b/docs/sources/packages_api/data/appevents.md index f9277f08763..cc93eca43e5 100644 --- a/docs/sources/packages_api/data/appevents.md +++ b/docs/sources/packages_api/data/appevents.md @@ -10,19 +10,23 @@ draft = true ## AppEvents namespace +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + ### AppEvents namespace -Signature - -```typescript -export declare namespace AppEvents -``` Import ```typescript import { AppEvents } from '@grafana/data'; ``` +## Interfaces + +| Interface | Description | +| --- | --- | +| [AppEvent](./appevent/) | | + ## Variables | Variable | Description | diff --git a/docs/sources/packages_api/data/appevents/alertpayload.md b/docs/sources/packages_api/data/appevents/alertpayload.md index 753fa481885..5893f25698f 100644 --- a/docs/sources/packages_api/data/appevents/alertpayload.md +++ b/docs/sources/packages_api/data/appevents/alertpayload.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -type AlertPayload = [string, string?]; +export declare type AlertPayload = [string, string?]; ``` Import diff --git a/docs/sources/packages_api/data/appevents/appevent.md b/docs/sources/packages_api/data/appevents/appevent.md new file mode 100644 index 00000000000..5d89cb388bd --- /dev/null +++ b/docs/sources/packages_api/data/appevents/appevent.md @@ -0,0 +1,45 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "AppEvent" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## AppEvents.AppEvent interface + +Signature + +```typescript +export interface AppEvent +``` +Import + +```typescript +import { AppEvents } from '@grafana/data'; +const { AppEvent } = AppEvents; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [name](#name-property) | string | | +| [payload](#payload-property) | T | | + +### name property + +Signature + +```typescript +readonly name: string; +``` + +### payload property + +Signature + +```typescript +payload?: T; +``` diff --git a/docs/sources/packages_api/data/applyfieldoverrideoptions.md b/docs/sources/packages_api/data/applyfieldoverrideoptions.md new file mode 100644 index 00000000000..bf9b7b5c44d --- /dev/null +++ b/docs/sources/packages_api/data/applyfieldoverrideoptions.md @@ -0,0 +1,89 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ApplyFieldOverrideOptions" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## ApplyFieldOverrideOptions interface + +Signature + +```typescript +export interface ApplyFieldOverrideOptions +``` +Import + +```typescript +import { ApplyFieldOverrideOptions } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [autoMinMax](#autominmax-property) | boolean | | +| [data](#data-property) | DataFrame[] | | +| [fieldConfig](#fieldconfig-property) | FieldConfigSource | | +| [fieldConfigRegistry](#fieldconfigregistry-property) | FieldConfigOptionsRegistry | | +| [replaceVariables](#replacevariables-property) | InterpolateFunction | | +| [theme](#theme-property) | GrafanaTheme | | +| [timeZone](#timezone-property) | TimeZone | | + +### autoMinMax property + +Signature + +```typescript +autoMinMax?: boolean; +``` + +### data property + +Signature + +```typescript +data?: DataFrame[]; +``` + +### fieldConfig property + +Signature + +```typescript +fieldConfig: FieldConfigSource; +``` + +### fieldConfigRegistry property + +Signature + +```typescript +fieldConfigRegistry?: FieldConfigOptionsRegistry; +``` + +### replaceVariables property + +Signature + +```typescript +replaceVariables: InterpolateFunction; +``` + +### theme property + +Signature + +```typescript +theme: GrafanaTheme; +``` + +### timeZone property + +Signature + +```typescript +timeZone?: TimeZone; +``` diff --git a/docs/sources/packages_api/data/arrayvector.md b/docs/sources/packages_api/data/arrayvector.md index 1777bfee1bd..0fb71ce21b9 100644 --- a/docs/sources/packages_api/data/arrayvector.md +++ b/docs/sources/packages_api/data/arrayvector.md @@ -13,7 +13,7 @@ draft = true Signature ```typescript -export declare class ArrayVector implements MutableVector +export declare class ArrayVector extends FunctionalVector implements MutableVector ``` Import diff --git a/docs/sources/packages_api/data/booleanoverrideprocessor.md b/docs/sources/packages_api/data/booleanoverrideprocessor.md new file mode 100644 index 00000000000..55ae36ad40d --- /dev/null +++ b/docs/sources/packages_api/data/booleanoverrideprocessor.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "booleanOverrideProcessor" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## booleanOverrideProcessor variable + +### booleanOverrideProcessor variable + +Signature + +```typescript +booleanOverrideProcessor: (value: boolean, _context: FieldOverrideContext, _settings?: ThresholdsFieldConfigSettings | undefined) => boolean +``` +Import + +```typescript +import { booleanOverrideProcessor } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/runtime/buildinfo.md b/docs/sources/packages_api/data/buildinfo.md similarity index 78% rename from docs/sources/packages_api/runtime/buildinfo.md rename to docs/sources/packages_api/data/buildinfo.md index d5769a27f60..d05f50d3b6a 100644 --- a/docs/sources/packages_api/runtime/buildinfo.md +++ b/docs/sources/packages_api/data/buildinfo.md @@ -3,13 +3,15 @@ # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "BuildInfo" -keywords = ["grafana","documentation","sdk","@grafana/runtime"] +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ ## BuildInfo interface +Describes the build information that will be available via the Grafana configuration. + Signature ```typescript @@ -18,7 +20,7 @@ export interface BuildInfo Import ```typescript -import { BuildInfo } from '@grafana/runtime'; +import { BuildInfo } from '@grafana/data'; ``` Properties @@ -28,7 +30,7 @@ import { BuildInfo } from '@grafana/runtime'; | [edition](#edition-property) | string | | | [env](#env-property) | string | | | [hasUpdate](#hasupdate-property) | boolean | | -| [isEnterprise](#isenterprise-property) | boolean | | +| [isEnterprise](#isenterprise-property) | boolean | Is set to true when running Grafana Enterprise edition. | | [latestVersion](#latestversion-property) | string | | | [version](#version-property) | string | | @@ -66,6 +68,8 @@ hasUpdate: boolean; ### isEnterprise property +Is set to true when running Grafana Enterprise edition. + Signature ```typescript diff --git a/docs/sources/packages_api/data/calculatefieldtransformeroptions.md b/docs/sources/packages_api/data/calculatefieldtransformeroptions.md new file mode 100644 index 00000000000..61cbee333bf --- /dev/null +++ b/docs/sources/packages_api/data/calculatefieldtransformeroptions.md @@ -0,0 +1,71 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "CalculateFieldTransformerOptions" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## CalculateFieldTransformerOptions interface + +Signature + +```typescript +export interface CalculateFieldTransformerOptions +``` +Import + +```typescript +import { CalculateFieldTransformerOptions } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [alias](#alias-property) | string | | +| [include](#include-property) | string | | +| [nullValueMode](#nullvaluemode-property) | NullValueMode | | +| [reducer](#reducer-property) | ReducerID | | +| [replaceFields](#replacefields-property) | boolean | | + +### alias property + +Signature + +```typescript +alias?: string; +``` + +### include property + +Signature + +```typescript +include?: string; +``` + +### nullValueMode property + +Signature + +```typescript +nullValueMode?: NullValueMode; +``` + +### reducer property + +Signature + +```typescript +reducer: ReducerID; +``` + +### replaceFields property + +Signature + +```typescript +replaceFields?: boolean; +``` diff --git a/docs/sources/packages_api/data/circularvector.md b/docs/sources/packages_api/data/circularvector.md index 7b7164bfa71..c537ebe57ca 100644 --- a/docs/sources/packages_api/data/circularvector.md +++ b/docs/sources/packages_api/data/circularvector.md @@ -17,7 +17,7 @@ This supports addting to the 'head' or 'tail' and will grow the buffer to match Signature ```typescript -export declare class CircularVector implements MutableVector +export declare class CircularVector extends FunctionalVector implements MutableVector ``` Import diff --git a/docs/sources/packages_api/data/colorfieldconfigsettings.md b/docs/sources/packages_api/data/colorfieldconfigsettings.md new file mode 100644 index 00000000000..7f9998860a7 --- /dev/null +++ b/docs/sources/packages_api/data/colorfieldconfigsettings.md @@ -0,0 +1,35 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ColorFieldConfigSettings" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## ColorFieldConfigSettings interface + +Signature + +```typescript +export interface ColorFieldConfigSettings +``` +Import + +```typescript +import { ColorFieldConfigSettings } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [enableNamedColors](#enablenamedcolors-property) | boolean | | + +### enableNamedColors property + +Signature + +```typescript +enableNamedColors?: boolean; +``` diff --git a/docs/sources/packages_api/data/createorderfieldscomparer.md b/docs/sources/packages_api/data/createorderfieldscomparer.md new file mode 100644 index 00000000000..9762414ec8f --- /dev/null +++ b/docs/sources/packages_api/data/createorderfieldscomparer.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "createOrderFieldsComparer" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## createOrderFieldsComparer variable + +### createOrderFieldsComparer variable + +Signature + +```typescript +createOrderFieldsComparer: (indexByName: Record) => (a: string, b: string) => number +``` +Import + +```typescript +import { createOrderFieldsComparer } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/dataconfigsource.md b/docs/sources/packages_api/data/dataconfigsource.md new file mode 100644 index 00000000000..c91f2895cc7 --- /dev/null +++ b/docs/sources/packages_api/data/dataconfigsource.md @@ -0,0 +1,46 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "DataConfigSource" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## DataConfigSource interface + +Describes and API for exposing panel specific data configurations. + +Signature + +```typescript +export interface DataConfigSource +``` +Import + +```typescript +import { DataConfigSource } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [getFieldOverrideOptions](#getfieldoverrideoptions-property) | () => ApplyFieldOverrideOptions | undefined | | +| [getTransformations](#gettransformations-property) | () => DataTransformerConfig[] | undefined | | + +### getFieldOverrideOptions property + +Signature + +```typescript +getFieldOverrideOptions: () => ApplyFieldOverrideOptions | undefined; +``` + +### getTransformations property + +Signature + +```typescript +getTransformations: () => DataTransformerConfig[] | undefined; +``` diff --git a/docs/sources/packages_api/data/dataframeview.md b/docs/sources/packages_api/data/dataframeview.md index 43395acd443..97e0c163ca9 100644 --- a/docs/sources/packages_api/data/dataframeview.md +++ b/docs/sources/packages_api/data/dataframeview.md @@ -18,7 +18,7 @@ This abstraction will present the contents of a DataFrame as if it were a well t Signature ```typescript -export declare class DataFrameView implements Vector +export declare class DataFrameView extends FunctionalVector ``` Import @@ -47,12 +47,9 @@ The [DataFrameView.get()](./data/dataframeview/get.md) is optimized for use in a | Method | Modifiers | Description | | --- | --- | --- | -| [forEachRow(iterator)](#foreachrow-method) | | (BETA) | | [get(idx)](#get-method) | | (BETA) The contents of the object returned from this function are optimized for use in a loop. All calls return the same object but the index has changed. | | [getFieldDisplayProcessor(colIndex)](#getfielddisplayprocessor-method) | | (BETA) Helper function to return the [DisplayProcessor](./data/displayprocessor.md) for a given field column. | -| [map(iterator)](#map-method) | | (BETA) | | [toArray()](#toarray-method) | | (BETA) | -| [toJSON()](#tojson-method) | | (BETA) | > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > @@ -95,26 +92,6 @@ get length(): number; > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -### forEachRow method - -Signature - -```typescript -forEachRow(iterator: (row: T) => void): void; -``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| iterator | (row: T) => void | | - -Returns: - -`void` - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - ### get method The contents of the object returned from this function are optimized for use in a loop. All calls return the same object but the index has changed. @@ -175,26 +152,6 @@ getFieldDisplayProcessor(colIndex: number): DisplayProcessor | null; > This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. > -### map method - -Signature - -```typescript -map(iterator: (item: T, index: number) => V): V[]; -``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| iterator | (item: T, index: number) => V | | - -Returns: - -`V[]` - -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - ### toArray method Signature @@ -206,17 +163,3 @@ toArray(): T[]; `T[]` -> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. -> - -### toJSON method - -Signature - -```typescript -toJSON(): T[]; -``` -Returns: - -`T[]` - diff --git a/docs/sources/packages_api/data/datalink.md b/docs/sources/packages_api/data/datalink.md index 03b153374d8..edd7847328f 100644 --- a/docs/sources/packages_api/data/datalink.md +++ b/docs/sources/packages_api/data/datalink.md @@ -26,12 +26,23 @@ import { DataLink } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | +| [meta](#meta-property) | {
datasourceUid?: string;
} | | | [onBuildUrl](#onbuildurl-property) | (event: DataLinkClickEvent) => string | | | [onClick](#onclick-property) | (event: DataLinkClickEvent) => void | | | [targetBlank](#targetblank-property) | boolean | | | [title](#title-property) | string | | | [url](#url-property) | string | | +### meta property + +Signature + +```typescript +meta?: { + datasourceUid?: string; + }; +``` + ### onBuildUrl property Signature diff --git a/docs/sources/packages_api/ui/datalinkbuiltinvars.md b/docs/sources/packages_api/data/datalinkbuiltinvars.md similarity index 82% rename from docs/sources/packages_api/ui/datalinkbuiltinvars.md rename to docs/sources/packages_api/data/datalinkbuiltinvars.md index 3c8e2eb5f83..bf556c9f669 100644 --- a/docs/sources/packages_api/ui/datalinkbuiltinvars.md +++ b/docs/sources/packages_api/data/datalinkbuiltinvars.md @@ -3,7 +3,7 @@ # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "DataLinkBuiltInVars" -keywords = ["grafana","documentation","sdk","@grafana/ui"] +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ @@ -32,5 +32,5 @@ DataLinkBuiltInVars: { Import ```typescript -import { DataLinkBuiltInVars } from '@grafana/ui'; +import { DataLinkBuiltInVars } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/data/datalinksfieldconfigsettings.md b/docs/sources/packages_api/data/datalinksfieldconfigsettings.md new file mode 100644 index 00000000000..6527a7efd5b --- /dev/null +++ b/docs/sources/packages_api/data/datalinksfieldconfigsettings.md @@ -0,0 +1,22 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "DataLinksFieldConfigSettings" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## DataLinksFieldConfigSettings interface + +Signature + +```typescript +export interface DataLinksFieldConfigSettings +``` +Import + +```typescript +import { DataLinksFieldConfigSettings } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/datalinksoverrideprocessor.md b/docs/sources/packages_api/data/datalinksoverrideprocessor.md new file mode 100644 index 00000000000..0c770e310c7 --- /dev/null +++ b/docs/sources/packages_api/data/datalinksoverrideprocessor.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "dataLinksOverrideProcessor" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## dataLinksOverrideProcessor variable + +### dataLinksOverrideProcessor variable + +Signature + +```typescript +dataLinksOverrideProcessor: (value: any, _context: FieldOverrideContext, _settings?: DataLinksFieldConfigSettings | undefined) => DataLink[] +``` +Import + +```typescript +import { dataLinksOverrideProcessor } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/dataquery.md b/docs/sources/packages_api/data/dataquery.md index 418968de598..1c4ac7897ce 100644 --- a/docs/sources/packages_api/data/dataquery.md +++ b/docs/sources/packages_api/data/dataquery.md @@ -10,6 +10,8 @@ draft = true ## DataQuery interface +These are the common properties available to all queries in all datasources Specific implementations will extend this interface adding the required properties for the given context + Signature ```typescript @@ -25,10 +27,9 @@ import { DataQuery } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | | [datasource](#datasource-property) | string | null | For mixed data sources the selected datasource is on the query level. For non mixed scenarios this is undefined. | -| [hide](#hide-property) | boolean | true if query is disabled (ie not executed / sent to TSDB) | +| [hide](#hide-property) | boolean | true if query is disabled (ie should not be returned to the dashboard) | | [key](#key-property) | string | Unique, guid like, string used in explore mode | -| [maxLines](#maxlines-property) | number | For limiting result lines. | -| [metric](#metric-property) | any | | +| [queryType](#querytype-property) | string | Specify the query flavor | | [refId](#refid-property) | string | A - Z | ### datasource property @@ -43,7 +44,7 @@ datasource?: string | null; ### hide property -true if query is disabled (ie not executed / sent to TSDB) +true if query is disabled (ie should not be returned to the dashboard) Signature @@ -61,22 +62,14 @@ Unique, guid like, string used in explore mode key?: string; ``` -### maxLines property +### queryType property -For limiting result lines. +Specify the query flavor Signature ```typescript -maxLines?: number; -``` - -### metric property - -Signature - -```typescript -metric?: any; +queryType?: string; ``` ### refId property diff --git a/docs/sources/packages_api/data/dataquerytimings.md b/docs/sources/packages_api/data/dataquerytimings.md new file mode 100644 index 00000000000..efc1165d345 --- /dev/null +++ b/docs/sources/packages_api/data/dataquerytimings.md @@ -0,0 +1,35 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "DataQueryTimings" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## DataQueryTimings interface + +Signature + +```typescript +export interface DataQueryTimings +``` +Import + +```typescript +import { DataQueryTimings } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [dataProcessingTime](#dataprocessingtime-property) | number | | + +### dataProcessingTime property + +Signature + +```typescript +dataProcessingTime: number; +``` diff --git a/docs/sources/packages_api/data/datasourceapi.md b/docs/sources/packages_api/data/datasourceapi.md index 0cd0df685f4..d33d50a3669 100644 --- a/docs/sources/packages_api/data/datasourceapi.md +++ b/docs/sources/packages_api/data/datasourceapi.md @@ -144,7 +144,7 @@ static information about the datasource Signature ```typescript -meta?: DataSourcePluginMeta; +meta: DataSourcePluginMeta; ``` ### name property diff --git a/docs/sources/packages_api/data/datasourceinstancesettings.md b/docs/sources/packages_api/data/datasourceinstancesettings.md index 5373f5c0609..6a6bd76909a 100644 --- a/docs/sources/packages_api/data/datasourceinstancesettings.md +++ b/docs/sources/packages_api/data/datasourceinstancesettings.md @@ -34,6 +34,7 @@ import { DataSourceInstanceSettings } from '@grafana/data'; | [name](#name-property) | string | | | [password](#password-property) | string | | | [type](#type-property) | string | | +| [uid](#uid-property) | string | | | [url](#url-property) | string | | | [username](#username-property) | string | | | [withCredentials](#withcredentials-property) | boolean | | @@ -104,6 +105,14 @@ password?: string; type: string; ``` +### uid property + +Signature + +```typescript +uid: string; +``` + ### url property Signature diff --git a/docs/sources/packages_api/data/datasourcepluginmeta.md b/docs/sources/packages_api/data/datasourcepluginmeta.md index f65ce9e2672..15ebacf6c09 100644 --- a/docs/sources/packages_api/data/datasourcepluginmeta.md +++ b/docs/sources/packages_api/data/datasourcepluginmeta.md @@ -35,6 +35,7 @@ import { DataSourcePluginMeta } from '@grafana/data'; | [queryOptions](#queryoptions-property) | PluginMetaQueryOptions | | | [sort](#sort-property) | number | | | [streaming](#streaming-property) | boolean | | +| [tracing](#tracing-property) | boolean | | ### alerting property @@ -123,3 +124,11 @@ sort?: number; ```typescript streaming?: boolean; ``` + +### tracing property + +Signature + +```typescript +tracing?: boolean; +``` diff --git a/docs/sources/packages_api/data/datatransformer.md b/docs/sources/packages_api/data/datatransformer.md index ebb55c8ebaf..fd09b699fad 100644 --- a/docs/sources/packages_api/data/datatransformer.md +++ b/docs/sources/packages_api/data/datatransformer.md @@ -12,7 +12,7 @@ draft = true ### DataTransformer type -Immutable data transformation +Function that transform data frames (AKA transformer) Signature diff --git a/docs/sources/packages_api/data/datatransformerconfig.md b/docs/sources/packages_api/data/datatransformerconfig.md index 81814311c7b..3af459ceab3 100644 --- a/docs/sources/packages_api/data/datatransformerconfig.md +++ b/docs/sources/packages_api/data/datatransformerconfig.md @@ -24,11 +24,13 @@ import { DataTransformerConfig } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [id](#id-property) | string | | -| [options](#options-property) | TOptions | | +| [id](#id-property) | string | Unique identifier of transformer | +| [options](#options-property) | TOptions | Options to be passed to the transformer | ### id property +Unique identifier of transformer + Signature ```typescript @@ -37,6 +39,8 @@ id: string; ### options property +Options to be passed to the transformer + Signature ```typescript diff --git a/docs/sources/packages_api/data/datatransformerid.md b/docs/sources/packages_api/data/datatransformerid.md index dbf8aa76795..1eda8062ad7 100644 --- a/docs/sources/packages_api/data/datatransformerid.md +++ b/docs/sources/packages_api/data/datatransformerid.md @@ -28,10 +28,15 @@ import { DataTransformerID } from '@grafana/data'; | Member | Value | Description | | --- | --- | --- | | append | "append" | | +| calculateField | "calculateField" | | | filterByRefId | "filterByRefId" | | | filterFields | "filterFields" | | | filterFieldsByName | "filterFieldsByName" | | | filterFrames | "filterFrames" | | | noop | "noop" | | +| order | "order" | | +| organize | "organize" | | | reduce | "reduce" | | +| rename | "rename" | | +| seriesToColumns | "seriesToColumns" | | diff --git a/docs/sources/packages_api/data/datatransformerinfo.md b/docs/sources/packages_api/data/datatransformerinfo.md index f06fd163f9a..6b9a6f28b50 100644 --- a/docs/sources/packages_api/data/datatransformerinfo.md +++ b/docs/sources/packages_api/data/datatransformerinfo.md @@ -24,10 +24,12 @@ import { DataTransformerInfo } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [transformer](#transformer-property) | (options: TOptions) => DataTransformer | | +| [transformer](#transformer-property) | (options: TOptions) => DataTransformer | Function that configures transformation and returns a transformer | ### transformer property +Function that configures transformation and returns a transformer + Signature ```typescript diff --git a/docs/sources/packages_api/data/datemath.md b/docs/sources/packages_api/data/datemath.md index 45db080a88d..3bccc1ac85c 100644 --- a/docs/sources/packages_api/data/datemath.md +++ b/docs/sources/packages_api/data/datemath.md @@ -10,13 +10,11 @@ draft = true ## dateMath namespace +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + ### dateMath namespace -Signature - -```typescript -export declare namespace dateMath -``` Import ```typescript diff --git a/docs/sources/packages_api/data/datemath/ismathstring.md b/docs/sources/packages_api/data/datemath/ismathstring.md index ef842130b09..4c37a0ae86b 100644 --- a/docs/sources/packages_api/data/datemath/ismathstring.md +++ b/docs/sources/packages_api/data/datemath/ismathstring.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -function isMathString(text: string | DateTime | Date): boolean; +export declare function isMathString(text: string | DateTime | Date): boolean; ``` Import diff --git a/docs/sources/packages_api/data/datemath/isvalid.md b/docs/sources/packages_api/data/datemath/isvalid.md index 5fcff223611..7f6d0855649 100644 --- a/docs/sources/packages_api/data/datemath/isvalid.md +++ b/docs/sources/packages_api/data/datemath/isvalid.md @@ -17,7 +17,7 @@ Checks if text is a valid date which in this context means that it is either a M Signature ```typescript -function isValid(text: string | DateTime): boolean; +export declare function isValid(text: string | DateTime): boolean; ``` Import diff --git a/docs/sources/packages_api/data/datemath/parse.md b/docs/sources/packages_api/data/datemath/parse.md index 4ad4c0d1248..2debe831f5e 100644 --- a/docs/sources/packages_api/data/datemath/parse.md +++ b/docs/sources/packages_api/data/datemath/parse.md @@ -17,7 +17,7 @@ Parses different types input to a moment instance. There is a specific formattin Signature ```typescript -function parse(text: string | DateTime | Date, roundUp?: boolean, timezone?: TimeZone): DateTime | undefined; +export declare function parse(text?: string | DateTime | Date | null, roundUp?: boolean, timezone?: TimeZone): DateTime | undefined; ``` Import @@ -29,9 +29,9 @@ const { parse } = dateMath; | Parameter | Type | Description | | --- | --- | --- | -| text | string | DateTime | Date | | -| roundUp | boolean | | -| timezone | TimeZone | | +| text | string | DateTime | Date | null | | +| roundUp | boolean | See parseDateMath function. | +| timezone | TimeZone | Only string 'utc' is acceptable here, for anything else, local timezone is used. | Returns: diff --git a/docs/sources/packages_api/data/datemath/parsedatemath.md b/docs/sources/packages_api/data/datemath/parsedatemath.md index 88a44af6e56..62ed421bd31 100644 --- a/docs/sources/packages_api/data/datemath/parsedatemath.md +++ b/docs/sources/packages_api/data/datemath/parsedatemath.md @@ -17,7 +17,7 @@ Parses math part of the time string and shifts supplied time according to that m Signature ```typescript -function parseDateMath(mathString: string, time: any, roundUp?: boolean): DateTime | undefined; +export declare function parseDateMath(mathString: string, time: any, roundUp?: boolean): DateTime | undefined; ``` Import @@ -31,7 +31,7 @@ const { parseDateMath } = dateMath; | --- | --- | --- | | mathString | string | | | time | any | | -| roundUp | boolean | | +| roundUp | boolean | If true it will round the time to endOf time unit, otherwise to startOf time unit. | Returns: diff --git a/docs/sources/packages_api/data/displayvalue.md b/docs/sources/packages_api/data/displayvalue.md index f63409534fa..0ebead706c8 100644 --- a/docs/sources/packages_api/data/displayvalue.md +++ b/docs/sources/packages_api/data/displayvalue.md @@ -24,13 +24,15 @@ import { DisplayValue } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [color](#color-property) | string | | -| [numeric](#numeric-property) | number | | -| [percent](#percent-property) | number | | +| [color](#color-property) | string | Color based on configs or Threshold | +| [numeric](#numeric-property) | number | Use isNaN to check if it is a real number | +| [percent](#percent-property) | number | 0-1 between min & max | | [title](#title-property) | string | | ### color property +Color based on configs or Threshold + Signature ```typescript @@ -39,6 +41,8 @@ color?: string; ### numeric property +Use isNaN to check if it is a real number + Signature ```typescript @@ -47,6 +51,8 @@ numeric: number; ### percent property +0-1 between min & max + Signature ```typescript diff --git a/docs/sources/packages_api/data/dostandardcalcs.md b/docs/sources/packages_api/data/dostandardcalcs.md new file mode 100644 index 00000000000..f16e045962c --- /dev/null +++ b/docs/sources/packages_api/data/dostandardcalcs.md @@ -0,0 +1,36 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "doStandardCalcs" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## doStandardCalcs() function + +### doStandardCalcs() function + +Signature + +```typescript +export declare function doStandardCalcs(field: Field, ignoreNulls: boolean, nullAsZero: boolean): FieldCalcs; +``` +Import + +```typescript +import { doStandardCalcs } from '@grafana/data'; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| field | Field | | +| ignoreNulls | boolean | | +| nullAsZero | boolean | | + +Returns: + +`FieldCalcs` + diff --git a/docs/sources/packages_api/data/dynamicconfigvalue.md b/docs/sources/packages_api/data/dynamicconfigvalue.md index c79a19cb36f..a6c96c17837 100644 --- a/docs/sources/packages_api/data/dynamicconfigvalue.md +++ b/docs/sources/packages_api/data/dynamicconfigvalue.md @@ -24,24 +24,15 @@ import { DynamicConfigValue } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [custom](#custom-property) | boolean | | -| [prop](#prop-property) | string | | +| [id](#id-property) | string | | | [value](#value-property) | any | | -### custom property +### id property Signature ```typescript -custom?: boolean; -``` - -### prop property - -Signature - -```typescript -prop: string; +id: string; ``` ### value property diff --git a/docs/sources/packages_api/data/exploremode.md b/docs/sources/packages_api/data/exploremode.md index aa87f8fe679..4fe995bc8bc 100644 --- a/docs/sources/packages_api/data/exploremode.md +++ b/docs/sources/packages_api/data/exploremode.md @@ -29,4 +29,5 @@ import { ExploreMode } from '@grafana/data'; | --- | --- | --- | | Logs | "Logs" | | | Metrics | "Metrics" | | +| Tracing | "Tracing" | | diff --git a/docs/sources/packages_api/data/featuretoggles.md b/docs/sources/packages_api/data/featuretoggles.md new file mode 100644 index 00000000000..8d85c1aa029 --- /dev/null +++ b/docs/sources/packages_api/data/featuretoggles.md @@ -0,0 +1,86 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "FeatureToggles" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## FeatureToggles interface + +Describes available feature toggles in Grafana. These can be configured via the `conf/custom.ini` to enable features under development or not yet available in stable version. + +Signature + +```typescript +export interface FeatureToggles +``` +Import + +```typescript +import { FeatureToggles } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [expressions](#expressions-property) | boolean | | +| [meta](#meta-property) | boolean | | +| [newEdit](#newedit-property) | boolean | | +| [newVariables](#newvariables-property) | boolean | | +| [tracingIntegration](#tracingintegration-property) | boolean | | +| [transformations](#transformations-property) | boolean | | + +### expressions property + +Signature + +```typescript +expressions: boolean; +``` + +### meta property + +Signature + +```typescript +meta: boolean; +``` + +## Remarks + +Available only in Grafana Enterprise + +### newEdit property + +Signature + +```typescript +newEdit: boolean; +``` + +### newVariables property + +Signature + +```typescript +newVariables: boolean; +``` + +### tracingIntegration property + +Signature + +```typescript +tracingIntegration: boolean; +``` + +### transformations property + +Signature + +```typescript +transformations: boolean; +``` diff --git a/docs/sources/packages_api/data/field.md b/docs/sources/packages_api/data/field.md index d316d5ad3f2..16d86e77bc8 100644 --- a/docs/sources/packages_api/data/field.md +++ b/docs/sources/packages_api/data/field.md @@ -27,6 +27,7 @@ import { Field } from '@grafana/data'; | [calcs](#calcs-property) | FieldCalcs | Cache of reduced values | | [config](#config-property) | FieldConfig | Meta info about how field and how to display it | | [display](#display-property) | DisplayProcessor | Convert a value for display | +| [getLinks](#getlinks-property) | (config: ValueLinkConfig) => Array<LinkModel<Field>> | Get value data links with variables interpolated | | [labels](#labels-property) | Labels | | | [name](#name-property) | string | Name of the field (column) | | [parse](#parse-property) | (value: any) => T | Convert text to the field value | @@ -63,6 +64,16 @@ Convert a value for display display?: DisplayProcessor; ``` +### getLinks property + +Get value data links with variables interpolated + +Signature + +```typescript +getLinks?: (config: ValueLinkConfig) => Array>; +``` + ### labels property Signature diff --git a/docs/sources/packages_api/data/fieldconfig.md b/docs/sources/packages_api/data/fieldconfig.md index 689c09c0348..bd0eb36982b 100644 --- a/docs/sources/packages_api/data/fieldconfig.md +++ b/docs/sources/packages_api/data/fieldconfig.md @@ -17,7 +17,7 @@ Plugins may extend this with additional properties. Something like series overri Signature ```typescript -export interface FieldConfig +export interface FieldConfig ``` Import @@ -29,7 +29,7 @@ import { FieldConfig } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | | [color](#color-property) | FieldColor | | -| [custom](#custom-property) | Record<string, any> | | +| [custom](#custom-property) | TOptions | | | [decimals](#decimals-property) | number | null | | | [filterable](#filterable-property) | boolean | | | [links](#links-property) | DataLink[] | | @@ -56,7 +56,7 @@ color?: FieldColor; Signature ```typescript -custom?: Record; +custom?: TOptions; ``` ### decimals property diff --git a/docs/sources/packages_api/data/fieldconfigeditorbuilder.md b/docs/sources/packages_api/data/fieldconfigeditorbuilder.md new file mode 100644 index 00000000000..934a70fbe31 --- /dev/null +++ b/docs/sources/packages_api/data/fieldconfigeditorbuilder.md @@ -0,0 +1,155 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "FieldConfigEditorBuilder" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## FieldConfigEditorBuilder class + +Fluent API for declarative creation of field config option editors + +Signature + +```typescript +export declare class FieldConfigEditorBuilder extends OptionsUIRegistryBuilder, FieldConfigPropertyItem> +``` +Import + +```typescript +import { FieldConfigEditorBuilder } from '@grafana/data'; +``` +Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addBooleanSwitch(config)](#addbooleanswitch-method) | | | +| [addColorPicker(config)](#addcolorpicker-method) | | | +| [addNumberInput(config)](#addnumberinput-method) | | | +| [addRadio(config)](#addradio-method) | | | +| [addSelect(config)](#addselect-method) | | | +| [addTextInput(config)](#addtextinput-method) | | | +| [addUnitPicker(config)](#addunitpicker-method) | | | + +### addBooleanSwitch method + +Signature + +```typescript +addBooleanSwitch(config: FieldConfigEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | FieldConfigEditorConfig<TOptions, TSettings, boolean> | | + +Returns: + +`this` + +### addColorPicker method + +Signature + +```typescript +addColorPicker(config: FieldConfigEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | FieldConfigEditorConfig<TOptions, TSettings & ColorFieldConfigSettings, string> | | + +Returns: + +`this` + +### addNumberInput method + +Signature + +```typescript +addNumberInput(config: FieldConfigEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | FieldConfigEditorConfig<TOptions, TSettings & NumberFieldConfigSettings, number> | | + +Returns: + +`this` + +### addRadio method + +Signature + +```typescript +addRadio(config: FieldConfigEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | FieldConfigEditorConfig<TOptions, TSettings, TOption> | | + +Returns: + +`this` + +### addSelect method + +Signature + +```typescript +addSelect>(config: FieldConfigEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | FieldConfigEditorConfig<TOptions, TSettings, TOption> | | + +Returns: + +`this` + +### addTextInput method + +Signature + +```typescript +addTextInput(config: FieldConfigEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | FieldConfigEditorConfig<TOptions, TSettings & StringFieldConfigSettings, string> | | + +Returns: + +`this` + +### addUnitPicker method + +Signature + +```typescript +addUnitPicker(config: FieldConfigEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | FieldConfigEditorConfig<TOptions, TSettings & UnitFieldConfigSettings, string> | | + +Returns: + +`this` + diff --git a/docs/sources/packages_api/data/fieldconfigeditorconfig.md b/docs/sources/packages_api/data/fieldconfigeditorconfig.md new file mode 100644 index 00000000000..3eb5012303e --- /dev/null +++ b/docs/sources/packages_api/data/fieldconfigeditorconfig.md @@ -0,0 +1,126 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "FieldConfigEditorConfig" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## FieldConfigEditorConfig interface + +Signature + +```typescript +export interface FieldConfigEditorConfig +``` +Import + +```typescript +import { FieldConfigEditorConfig } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [category](#category-property) | string[] | Array of strings representing category of the field config property. First element in the array will make option render as collapsible section. | +| [defaultValue](#defaultvalue-property) | TValue | | +| [description](#description-property) | string | Description of the field config property. Will be displayed in the UI as form element description. | +| [name](#name-property) | string | Name of the field config property. Will be displayed in the UI as form element label. | +| [path](#path-property) | (keyof TOptions & string) | string | Path of the field config property to control. | +| [settings](#settings-property) | TSettings | Custom settings of the editor. | +| [shouldApply](#shouldapply-property) | (field: Field) => boolean | Function that allows specifying whether or not this field config should apply to a given field. | +| [showIf](#showif-property) | (currentConfig: TOptions) => boolean | Function that enables configuration of when field config property editor should be shown based on current panel field config. | + +### category property + +Array of strings representing category of the field config property. First element in the array will make option render as collapsible section. + +Signature + +```typescript +category?: string[]; +``` + +### defaultValue property + +Signature + +```typescript +defaultValue?: TValue; +``` + +### description property + +Description of the field config property. Will be displayed in the UI as form element description. + +Signature + +```typescript +description?: string; +``` + +### name property + +Name of the field config property. Will be displayed in the UI as form element label. + +Signature + +```typescript +name: string; +``` + +### path property + +Path of the field config property to control. + +Signature + +```typescript +path: (keyof TOptions & string) | string; +``` + +## Example + +Given field config object of a type: + +```ts +interface CustomFieldConfig { + a: { + b: string; + } +} + +``` +path can be either 'a' or 'a.b'. + +### settings property + +Custom settings of the editor. + +Signature + +```typescript +settings?: TSettings; +``` + +### shouldApply property + +Function that allows specifying whether or not this field config should apply to a given field. + +Signature + +```typescript +shouldApply?: (field: Field) => boolean; +``` + +### showIf property + +Function that enables configuration of when field config property editor should be shown based on current panel field config. + +Signature + +```typescript +showIf?: (currentConfig: TOptions) => boolean; +``` diff --git a/docs/sources/packages_api/data/fieldconfigeditorprops.md b/docs/sources/packages_api/data/fieldconfigeditorprops.md index d9dbb26595e..c854606d7af 100644 --- a/docs/sources/packages_api/data/fieldconfigeditorprops.md +++ b/docs/sources/packages_api/data/fieldconfigeditorprops.md @@ -13,7 +13,7 @@ draft = true Signature ```typescript -export interface FieldConfigEditorProps +export interface FieldConfigEditorProps extends Omit, 'item'> ``` Import @@ -25,7 +25,7 @@ import { FieldConfigEditorProps } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | | [context](#context-property) | FieldOverrideContext | | -| [item](#item-property) | FieldPropertyEditorItem<TValue, TSettings> | | +| [item](#item-property) | FieldConfigPropertyItem<TValue, TSettings> | | | [onChange](#onchange-property) | (value?: TValue) => void | | | [value](#value-property) | TValue | | @@ -42,7 +42,7 @@ context: FieldOverrideContext; Signature ```typescript -item: FieldPropertyEditorItem; +item: FieldConfigPropertyItem; ``` ### onChange property diff --git a/docs/sources/packages_api/data/fieldconfigoptionsregistry.md b/docs/sources/packages_api/data/fieldconfigoptionsregistry.md new file mode 100644 index 00000000000..ab40c498e9f --- /dev/null +++ b/docs/sources/packages_api/data/fieldconfigoptionsregistry.md @@ -0,0 +1,22 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "FieldConfigOptionsRegistry" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## FieldConfigOptionsRegistry class + +Signature + +```typescript +export declare class FieldConfigOptionsRegistry extends Registry +``` +Import + +```typescript +import { FieldConfigOptionsRegistry } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/fieldconfigproperty.md b/docs/sources/packages_api/data/fieldconfigproperty.md new file mode 100644 index 00000000000..a44887ece0c --- /dev/null +++ b/docs/sources/packages_api/data/fieldconfigproperty.md @@ -0,0 +1,40 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "FieldConfigProperty" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## FieldConfigProperty enum + +### FieldConfigProperty enum + +Signature + +```typescript +export declare enum FieldConfigProperty +``` +Import + +```typescript +import { FieldConfigProperty } from '@grafana/data'; +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| Color | "color" | | +| Decimals | "decimals" | | +| Links | "links" | | +| Mappings | "mappings" | | +| Max | "max" | | +| Min | "min" | | +| NoValue | "noValue" | | +| Thresholds | "thresholds" | | +| Title | "title" | | +| Unit | "unit" | | + diff --git a/docs/sources/packages_api/data/fieldpropertyeditoritem.md b/docs/sources/packages_api/data/fieldconfigpropertyitem.md similarity index 57% rename from docs/sources/packages_api/data/fieldpropertyeditoritem.md rename to docs/sources/packages_api/data/fieldconfigpropertyitem.md index 977a8367424..cf2609acac4 100644 --- a/docs/sources/packages_api/data/fieldpropertyeditoritem.md +++ b/docs/sources/packages_api/data/fieldconfigpropertyitem.md @@ -2,40 +2,41 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "FieldPropertyEditorItem" +title = "FieldConfigPropertyItem" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ -## FieldPropertyEditorItem interface +## FieldConfigPropertyItem interface Signature ```typescript -export interface FieldPropertyEditorItem extends RegistryItem +export interface FieldConfigPropertyItem extends OptionsEditorItem, TValue> ``` Import ```typescript -import { FieldPropertyEditorItem } from '@grafana/data'; +import { FieldConfigPropertyItem } from '@grafana/data'; ``` Properties | Property | Type | Description | | --- | --- | --- | -| [editor](#editor-property) | ComponentType<FieldConfigEditorProps<TValue, TSettings>> | | +| [isCustom](#iscustom-property) | boolean | true for plugin field config properties | | [override](#override-property) | ComponentType<FieldOverrideEditorProps<TValue, TSettings>> | | -| [process](#process-property) | (value: any, context: FieldOverrideContext, settings: TSettings) => TValue | | -| [settings](#settings-property) | TSettings | | +| [process](#process-property) | (value: any, context: FieldOverrideContext, settings?: TSettings) => TValue | undefined | null | | | [shouldApply](#shouldapply-property) | (field: Field) => boolean | | -### editor property +### isCustom property + +true for plugin field config properties Signature ```typescript -editor: ComponentType>; +isCustom?: boolean; ``` ### override property @@ -51,15 +52,7 @@ override: ComponentType>; Signature ```typescript -process: (value: any, context: FieldOverrideContext, settings: TSettings) => TValue; -``` - -### settings property - -Signature - -```typescript -settings: TSettings; +process: (value: any, context: FieldOverrideContext, settings?: TSettings) => TValue | undefined | null; ``` ### shouldApply property diff --git a/docs/sources/packages_api/data/fieldconfigsource.md b/docs/sources/packages_api/data/fieldconfigsource.md index 906dad3b5ab..4d6a7e0f70a 100644 --- a/docs/sources/packages_api/data/fieldconfigsource.md +++ b/docs/sources/packages_api/data/fieldconfigsource.md @@ -13,7 +13,7 @@ draft = true Signature ```typescript -export interface FieldConfigSource +export interface FieldConfigSource ``` Import @@ -24,7 +24,7 @@ import { FieldConfigSource } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [defaults](#defaults-property) | FieldConfig | | +| [defaults](#defaults-property) | FieldConfig<TOptions> | | | [overrides](#overrides-property) | ConfigOverrideRule[] | | ### defaults property @@ -32,7 +32,7 @@ import { FieldConfigSource } from '@grafana/data'; Signature ```typescript -defaults: FieldConfig; +defaults: FieldConfig; ``` ### overrides property diff --git a/docs/sources/packages_api/data/fielddisplay.md b/docs/sources/packages_api/data/fielddisplay.md index e40bd9efe66..6d41682df77 100644 --- a/docs/sources/packages_api/data/fielddisplay.md +++ b/docs/sources/packages_api/data/fielddisplay.md @@ -27,6 +27,7 @@ import { FieldDisplay } from '@grafana/data'; | [colIndex](#colindex-property) | number | | | [display](#display-property) | DisplayValue | | | [field](#field-property) | FieldConfig | | +| [getLinks](#getlinks-property) | () => LinkModel[] | | | [name](#name-property) | string | | | [rowIndex](#rowindex-property) | number | | | [sparkline](#sparkline-property) | GraphSeriesValue[][] | | @@ -56,6 +57,14 @@ display: DisplayValue; field: FieldConfig; ``` +### getLinks property + +Signature + +```typescript +getLinks?: () => LinkModel[]; +``` + ### name property Signature diff --git a/docs/sources/packages_api/data/fieldoverrideeditorprops.md b/docs/sources/packages_api/data/fieldoverrideeditorprops.md index 7f51820d237..45475536e16 100644 --- a/docs/sources/packages_api/data/fieldoverrideeditorprops.md +++ b/docs/sources/packages_api/data/fieldoverrideeditorprops.md @@ -13,7 +13,7 @@ draft = true Signature ```typescript -export interface FieldOverrideEditorProps +export interface FieldOverrideEditorProps extends Omit, 'item'> ``` Import @@ -25,9 +25,7 @@ import { FieldOverrideEditorProps } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | | [context](#context-property) | FieldOverrideContext | | -| [item](#item-property) | FieldPropertyEditorItem<TValue, TSettings> | | -| [onChange](#onchange-property) | (value?: any) => void | | -| [value](#value-property) | TValue | | +| [item](#item-property) | FieldConfigPropertyItem<TValue, TSettings> | | ### context property @@ -42,21 +40,5 @@ context: FieldOverrideContext; Signature ```typescript -item: FieldPropertyEditorItem; -``` - -### onChange property - -Signature - -```typescript -onChange: (value?: any) => void; -``` - -### value property - -Signature - -```typescript -value: TValue; +item: FieldConfigPropertyItem; ``` diff --git a/docs/sources/packages_api/data/fieldtype.md b/docs/sources/packages_api/data/fieldtype.md index 65c3e967758..479d335924d 100644 --- a/docs/sources/packages_api/data/fieldtype.md +++ b/docs/sources/packages_api/data/fieldtype.md @@ -32,4 +32,5 @@ import { FieldType } from '@grafana/data'; | other | "other" | | | string | "string" | | | time | "time" | | +| trace | "trace" | | diff --git a/docs/sources/packages_api/data/finduniquelabels.md b/docs/sources/packages_api/data/finduniquelabels.md index 07ab0dce90c..7e0057928c9 100644 --- a/docs/sources/packages_api/data/finduniquelabels.md +++ b/docs/sources/packages_api/data/finduniquelabels.md @@ -17,7 +17,7 @@ Returns a map of labels that are in `labels`, but not in `commonLabels`< Signature ```typescript -export declare function findUniqueLabels(labels: Labels, commonLabels: Labels): Labels; +export declare function findUniqueLabels(labels: Labels | undefined, commonLabels: Labels): Labels; ``` Import @@ -28,7 +28,7 @@ import { findUniqueLabels } from '@grafana/data'; | Parameter | Type | Description | | --- | --- | --- | -| labels | Labels | | +| labels | Labels | undefined | | | commonLabels | Labels | | Returns: diff --git a/docs/sources/packages_api/data/getfielddisplayvaluesoptions.md b/docs/sources/packages_api/data/getfielddisplayvaluesoptions.md index 9fcd8e9ba79..3b97aebb3c7 100644 --- a/docs/sources/packages_api/data/getfielddisplayvaluesoptions.md +++ b/docs/sources/packages_api/data/getfielddisplayvaluesoptions.md @@ -26,7 +26,8 @@ import { GetFieldDisplayValuesOptions } from '@grafana/data'; | --- | --- | --- | | [autoMinMax](#autominmax-property) | boolean | | | [data](#data-property) | DataFrame[] | | -| [fieldOptions](#fieldoptions-property) | FieldDisplayOptions | | +| [fieldConfig](#fieldconfig-property) | FieldConfigSource | | +| [reduceOptions](#reduceoptions-property) | ReduceDataOptions | | | [replaceVariables](#replacevariables-property) | InterpolateFunction | | | [sparkline](#sparkline-property) | boolean | | | [theme](#theme-property) | GrafanaTheme | | @@ -47,12 +48,20 @@ autoMinMax?: boolean; data?: DataFrame[]; ``` -### fieldOptions property +### fieldConfig property Signature ```typescript -fieldOptions: FieldDisplayOptions; +fieldConfig: FieldConfigSource; +``` + +### reduceOptions property + +Signature + +```typescript +reduceOptions: ReduceDataOptions; ``` ### replaceVariables property diff --git a/docs/sources/packages_api/data/getflotpairsconstant.md b/docs/sources/packages_api/data/getflotpairsconstant.md index d172b32129d..b8e89f568d3 100644 --- a/docs/sources/packages_api/data/getflotpairsconstant.md +++ b/docs/sources/packages_api/data/getflotpairsconstant.md @@ -28,8 +28,8 @@ import { getFlotPairsConstant } from '@grafana/data'; | Parameter | Type | Description | | --- | --- | --- | -| seriesData | GraphSeriesValue[][] | | -| range | TimeRange | | +| seriesData | GraphSeriesValue[][] | Series | +| range | TimeRange | Start and end time for the constant series | Returns: diff --git a/docs/sources/packages_api/data/getloglevelfromkey.md b/docs/sources/packages_api/data/getloglevelfromkey.md index 1ed6998be9a..80ba74ac803 100644 --- a/docs/sources/packages_api/data/getloglevelfromkey.md +++ b/docs/sources/packages_api/data/getloglevelfromkey.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -export declare function getLogLevelFromKey(key: string): LogLevel; +export declare function getLogLevelFromKey(key: string | number): LogLevel; ``` Import @@ -26,7 +26,7 @@ import { getLogLevelFromKey } from '@grafana/data'; | Parameter | Type | Description | | --- | --- | --- | -| key | string | | +| key | string | number | | Returns: diff --git a/docs/sources/packages_api/data/getseriestimestep.md b/docs/sources/packages_api/data/getseriestimestep.md index 54f569cd56e..3b451f67017 100644 --- a/docs/sources/packages_api/data/getseriestimestep.md +++ b/docs/sources/packages_api/data/getseriestimestep.md @@ -17,7 +17,7 @@ Returns minimal time step from series time field Signature ```typescript -getSeriesTimeStep: (timeField: Field>) => number | undefined +getSeriesTimeStep: (timeField: Field>) => number ``` Import diff --git a/docs/sources/packages_api/data/getvalueformat.md b/docs/sources/packages_api/data/getvalueformat.md index 49deb935d3b..9737e7b1185 100644 --- a/docs/sources/packages_api/data/getvalueformat.md +++ b/docs/sources/packages_api/data/getvalueformat.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -export declare function getValueFormat(id: string): ValueFormatter; +export declare function getValueFormat(id?: string | null): ValueFormatter; ``` Import @@ -26,7 +26,7 @@ import { getValueFormat } from '@grafana/data'; | Parameter | Type | Description | | --- | --- | --- | -| id | string | | +| id | string | null | | Returns: diff --git a/docs/sources/packages_api/data/grafanaconfig.md b/docs/sources/packages_api/data/grafanaconfig.md new file mode 100644 index 00000000000..548ba8e3997 --- /dev/null +++ b/docs/sources/packages_api/data/grafanaconfig.md @@ -0,0 +1,365 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "GrafanaConfig" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## GrafanaConfig interface + +Describes all the different Grafana configuration values available for an instance. + +Signature + +```typescript +export interface GrafanaConfig +``` +Import + +```typescript +import { GrafanaConfig } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [alertingEnabled](#alertingenabled-property) | boolean | | +| [alertingErrorOrTimeout](#alertingerrorortimeout-property) | string | | +| [alertingMinInterval](#alertingmininterval-property) | number | | +| [alertingNoDataOrNullValues](#alertingnodataornullvalues-property) | string | | +| [allowOrgCreate](#alloworgcreate-property) | boolean | | +| [appSubUrl](#appsuburl-property) | string | | +| [authProxyEnabled](#authproxyenabled-property) | boolean | | +| [autoAssignOrg](#autoassignorg-property) | boolean | | +| [bootData](#bootdata-property) | any | | +| [buildInfo](#buildinfo-property) | BuildInfo | | +| [datasources](#datasources-property) | {
[str: string]: DataSourceInstanceSettings;
} | | +| [defaultDatasource](#defaultdatasource-property) | string | | +| [disableLoginForm](#disableloginform-property) | boolean | | +| [disableSanitizeHtml](#disablesanitizehtml-property) | boolean | | +| [disableUserSignUp](#disableusersignup-property) | boolean | | +| [editorsCanAdmin](#editorscanadmin-property) | boolean | | +| [exploreEnabled](#exploreenabled-property) | boolean | | +| [externalUserMngInfo](#externalusermnginfo-property) | string | | +| [externalUserMngLinkName](#externalusermnglinkname-property) | string | | +| [externalUserMngLinkUrl](#externalusermnglinkurl-property) | string | | +| [featureToggles](#featuretoggles-property) | FeatureToggles | | +| [ldapEnabled](#ldapenabled-property) | boolean | | +| [licenseInfo](#licenseinfo-property) | LicenseInfo | | +| [loginError](#loginerror-property) | any | | +| [loginHint](#loginhint-property) | any | | +| [minRefreshInterval](#minrefreshinterval-property) | string | | +| [navTree](#navtree-property) | any | | +| [newPanelTitle](#newpaneltitle-property) | string | | +| [oauth](#oauth-property) | any | | +| [panels](#panels-property) | {
[key: string]: PanelPluginMeta;
} | | +| [passwordHint](#passwordhint-property) | any | | +| [pluginsToPreload](#pluginstopreload-property) | string[] | | +| [samlEnabled](#samlenabled-property) | boolean | | +| [theme](#theme-property) | GrafanaTheme | | +| [verifyEmailEnabled](#verifyemailenabled-property) | boolean | | +| [viewersCanEdit](#viewerscanedit-property) | boolean | | +| [windowTitlePrefix](#windowtitleprefix-property) | string | | + +### alertingEnabled property + +Signature + +```typescript +alertingEnabled: boolean; +``` + +### alertingErrorOrTimeout property + +Signature + +```typescript +alertingErrorOrTimeout: string; +``` + +### alertingMinInterval property + +Signature + +```typescript +alertingMinInterval: number; +``` + +### alertingNoDataOrNullValues property + +Signature + +```typescript +alertingNoDataOrNullValues: string; +``` + +### allowOrgCreate property + +Signature + +```typescript +allowOrgCreate: boolean; +``` + +### appSubUrl property + +Signature + +```typescript +appSubUrl: string; +``` + +### authProxyEnabled property + +Signature + +```typescript +authProxyEnabled: boolean; +``` + +### autoAssignOrg property + +Signature + +```typescript +autoAssignOrg: boolean; +``` + +### bootData property + +Signature + +```typescript +bootData: any; +``` + +### buildInfo property + +Signature + +```typescript +buildInfo: BuildInfo; +``` + +### datasources property + +Signature + +```typescript +datasources: { + [str: string]: DataSourceInstanceSettings; + }; +``` + +### defaultDatasource property + +Signature + +```typescript +defaultDatasource: string; +``` + +### disableLoginForm property + +Signature + +```typescript +disableLoginForm: boolean; +``` + +### disableSanitizeHtml property + +Signature + +```typescript +disableSanitizeHtml: boolean; +``` + +### disableUserSignUp property + +Signature + +```typescript +disableUserSignUp: boolean; +``` + +### editorsCanAdmin property + +Signature + +```typescript +editorsCanAdmin: boolean; +``` + +### exploreEnabled property + +Signature + +```typescript +exploreEnabled: boolean; +``` + +### externalUserMngInfo property + +Signature + +```typescript +externalUserMngInfo: string; +``` + +### externalUserMngLinkName property + +Signature + +```typescript +externalUserMngLinkName: string; +``` + +### externalUserMngLinkUrl property + +Signature + +```typescript +externalUserMngLinkUrl: string; +``` + +### featureToggles property + +Signature + +```typescript +featureToggles: FeatureToggles; +``` + +### ldapEnabled property + +Signature + +```typescript +ldapEnabled: boolean; +``` + +### licenseInfo property + +Signature + +```typescript +licenseInfo: LicenseInfo; +``` + +### loginError property + +Signature + +```typescript +loginError: any; +``` + +### loginHint property + +Signature + +```typescript +loginHint: any; +``` + +### minRefreshInterval property + +Signature + +```typescript +minRefreshInterval: string; +``` + +### navTree property + +Signature + +```typescript +navTree: any; +``` + +### newPanelTitle property + +Signature + +```typescript +newPanelTitle: string; +``` + +### oauth property + +Signature + +```typescript +oauth: any; +``` + +### panels property + +Signature + +```typescript +panels: { + [key: string]: PanelPluginMeta; + }; +``` + +### passwordHint property + +Signature + +```typescript +passwordHint: any; +``` + +### pluginsToPreload property + +Signature + +```typescript +pluginsToPreload: string[]; +``` + +### samlEnabled property + +Signature + +```typescript +samlEnabled: boolean; +``` + +### theme property + +Signature + +```typescript +theme: GrafanaTheme; +``` + +### verifyEmailEnabled property + +Signature + +```typescript +verifyEmailEnabled: boolean; +``` + +### viewersCanEdit property + +Signature + +```typescript +viewersCanEdit: boolean; +``` + +### windowTitlePrefix property + +Signature + +```typescript +windowTitlePrefix: string; +``` diff --git a/docs/sources/packages_api/data/grafanatheme.md b/docs/sources/packages_api/data/grafanatheme.md index 359d799e0df..b1b23f0af16 100644 --- a/docs/sources/packages_api/data/grafanatheme.md +++ b/docs/sources/packages_api/data/grafanatheme.md @@ -24,111 +24,49 @@ import { GrafanaTheme } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [background](#background-property) | {
dropdown: string;
scrollbar: string;
scrollbar2: string;
pageHeader: string;
} | | -| [colors](#colors-property) | {
black: string;
white: string;
dark1: string;
dark2: string;
dark3: string;
dark4: string;
dark5: string;
dark6: string;
dark7: string;
dark8: string;
dark9: string;
dark10: string;
gray1: string;
gray2: string;
gray3: string;
gray4: string;
gray5: string;
gray6: string;
gray7: string;
gray98: string;
gray95: string;
gray85: string;
gray70: string;
gray33: string;
gray25: string;
gray15: string;
gray10: string;
gray05: string;
blue95: string;
blue85: string;
blue77: string;
red88: string;
grayBlue: string;
inputBlack: string;
blue: string;
blue80: string;
blue77: string;
blue95: string;
blueFaint: string;
redBase: string;
redShade: string;
greenBase: string;
greenShade: string;
red: string;
yellow: string;
purple: string;
variable: string;
orange: string;
orangeDark: string;
queryRed: string;
queryGreen: string;
queryPurple: string;
queryKeyword: string;
queryOrange: string;
brandPrimary: string;
brandSuccess: string;
brandWarning: string;
brandDanger: string;
online: string;
warn: string;
critical: string;
link: string;
linkDisabled: string;
linkHover: string;
linkExternal: string;
body: string;
text: string;
textStrong: string;
textWeak: string;
textFaint: string;
textEmphasis: string;
panelBg: string;
bodyBg: string;
pageBg: string;
headingColor: string;
pageHeaderBorder: string;
formLabel: string;
formDescription: string;
formLegend: string;
formInputBg: string;
formInputBgDisabled: string;
formInputBorder: string;
formInputBorderHover: string;
formInputBorderActive: string;
formInputBorderInvalid: string;
formFocusOutline: string;
formInputText: string;
formInputDisabledText: string;
formInputTextStrong: string;
formInputTextWhite: string;
formValidationMessageText: string;
formValidationMessageBg: string;
formSwitchBg: string;
formSwitchBgActive: string;
formSwitchBgActiveHover: string;
formSwitchBgHover: string;
formSwitchBgDisabled: string;
formSwitchDot: string;
formCheckboxBg: string;
formCheckboxBgChecked: string;
formCheckboxBgCheckedHover: string;
formCheckboxCheckmark: string;
} | | +| [colors](#colors-property) | {
bg1: string;
bg2: string;
bg3: string;
border1: string;
border2: string;
border3: string;
bgBlue1: string;
bgBlue2: string;
dashboardBg: string;
bodyBg: string;
panelBg: string;
panelBorder: string;
pageHeaderBg: string;
pageHeaderBorder: string;
dropdownBg: string;
dropdownShadow: string;
dropdownOptionHoverBg: string;
link: string;
linkDisabled: string;
linkHover: string;
linkExternal: string;
textStrong: string;
textHeading: string;
text: string;
textSemiWeak: string;
textWeak: string;
textFaint: string;
textBlue: string;
formLabel: string;
formDescription: string;
formInputBg: string;
formInputBgDisabled: string;
formInputBorder: string;
formInputBorderHover: string;
formInputBorderActive: string;
formInputBorderInvalid: string;
formFocusOutline: string;
formInputText: string;
formInputDisabledText: string;
formInputPlaceholderText: string;
formValidationMessageText: string;
formValidationMessageBg: string;
formSwitchBg: string;
formSwitchBgActive: string;
formSwitchBgActiveHover: string;
formSwitchBgHover: string;
formSwitchBgDisabled: string;
formSwitchDot: string;
formCheckboxBg: string;
formCheckboxBgChecked: string;
formCheckboxBgCheckedHover: string;
formCheckboxCheckmark: string;
} | | | [isDark](#isdark-property) | boolean | | | [isLight](#islight-property) | boolean | | -| [shadow](#shadow-property) | {
pageHeader: string;
} | | +| [palette](#palette-property) | {
black: string;
white: string;
dark1: string;
dark2: string;
dark3: string;
dark4: string;
dark5: string;
dark6: string;
dark7: string;
dark8: string;
dark9: string;
dark10: string;
gray1: string;
gray2: string;
gray3: string;
gray4: string;
gray5: string;
gray6: string;
gray7: string;
gray98: string;
gray95: string;
gray85: string;
gray70: string;
gray60: string;
gray33: string;
gray25: string;
gray15: string;
gray10: string;
gray05: string;
blue95: string;
blue85: string;
blue80: string;
blue77: string;
red88: string;
redBase: string;
redShade: string;
greenBase: string;
greenShade: string;
red: string;
yellow: string;
purple: string;
orange: string;
orangeDark: string;
queryRed: string;
queryGreen: string;
queryPurple: string;
queryOrange: string;
brandPrimary: string;
brandSuccess: string;
brandWarning: string;
brandDanger: string;
online: string;
warn: string;
critical: string;
} | | +| [shadows](#shadows-property) | {
listItem: string;
} | | | [type](#type-property) | GrafanaThemeType | | -### background property - -Signature - -```typescript -background: { - dropdown: string; - scrollbar: string; - scrollbar2: string; - pageHeader: string; - }; -``` - ### colors property Signature ```typescript colors: { - black: string; - white: string; - dark1: string; - dark2: string; - dark3: string; - dark4: string; - dark5: string; - dark6: string; - dark7: string; - dark8: string; - dark9: string; - dark10: string; - gray1: string; - gray2: string; - gray3: string; - gray4: string; - gray5: string; - gray6: string; - gray7: string; - gray98: string; - gray95: string; - gray85: string; - gray70: string; - gray33: string; - gray25: string; - gray15: string; - gray10: string; - gray05: string; - blue95: string; - blue85: string; - blue77: string; - red88: string; - grayBlue: string; - inputBlack: string; - blue: string; - blue80: string; - blue77: string; - blue95: string; - blueFaint: string; - redBase: string; - redShade: string; - greenBase: string; - greenShade: string; - red: string; - yellow: string; - purple: string; - variable: string; - orange: string; - orangeDark: string; - queryRed: string; - queryGreen: string; - queryPurple: string; - queryKeyword: string; - queryOrange: string; - brandPrimary: string; - brandSuccess: string; - brandWarning: string; - brandDanger: string; - online: string; - warn: string; - critical: string; + bg1: string; + bg2: string; + bg3: string; + border1: string; + border2: string; + border3: string; + bgBlue1: string; + bgBlue2: string; + dashboardBg: string; + bodyBg: string; + panelBg: string; + panelBorder: string; + pageHeaderBg: string; + pageHeaderBorder: string; + dropdownBg: string; + dropdownShadow: string; + dropdownOptionHoverBg: string; link: string; linkDisabled: string; linkHover: string; linkExternal: string; - body: string; - text: string; textStrong: string; + textHeading: string; + text: string; + textSemiWeak: string; textWeak: string; textFaint: string; - textEmphasis: string; - panelBg: string; - bodyBg: string; - pageBg: string; - headingColor: string; - pageHeaderBorder: string; + textBlue: string; formLabel: string; formDescription: string; - formLegend: string; formInputBg: string; formInputBgDisabled: string; formInputBorder: string; @@ -138,8 +76,7 @@ colors: { formFocusOutline: string; formInputText: string; formInputDisabledText: string; - formInputTextStrong: string; - formInputTextWhite: string; + formInputPlaceholderText: string; formValidationMessageText: string; formValidationMessageBg: string; formSwitchBg: string; @@ -171,13 +108,76 @@ isDark: boolean; isLight: boolean; ``` -### shadow property +### palette property Signature ```typescript -shadow: { - pageHeader: string; +palette: { + black: string; + white: string; + dark1: string; + dark2: string; + dark3: string; + dark4: string; + dark5: string; + dark6: string; + dark7: string; + dark8: string; + dark9: string; + dark10: string; + gray1: string; + gray2: string; + gray3: string; + gray4: string; + gray5: string; + gray6: string; + gray7: string; + gray98: string; + gray95: string; + gray85: string; + gray70: string; + gray60: string; + gray33: string; + gray25: string; + gray15: string; + gray10: string; + gray05: string; + blue95: string; + blue85: string; + blue80: string; + blue77: string; + red88: string; + redBase: string; + redShade: string; + greenBase: string; + greenShade: string; + red: string; + yellow: string; + purple: string; + orange: string; + orangeDark: string; + queryRed: string; + queryGreen: string; + queryPurple: string; + queryOrange: string; + brandPrimary: string; + brandSuccess: string; + brandWarning: string; + brandDanger: string; + online: string; + warn: string; + critical: string; + }; +``` + +### shadows property + +Signature + +```typescript +shadows: { + listItem: string; }; ``` diff --git a/docs/sources/packages_api/data/grafanathemecommons.md b/docs/sources/packages_api/data/grafanathemecommons.md index 463b2a5041b..deb84b1aba4 100644 --- a/docs/sources/packages_api/data/grafanathemecommons.md +++ b/docs/sources/packages_api/data/grafanathemecommons.md @@ -30,7 +30,7 @@ import { GrafanaThemeCommons } from '@grafana/data'; | [name](#name-property) | string | | | [panelHeaderHeight](#panelheaderheight-property) | number | | | [panelPadding](#panelpadding-property) | number | | -| [spacing](#spacing-property) | {
insetSquishMd: string;
d: string;
xxs: string;
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
gutter: string;
formSpacingBase: number;
formMargin: string;
formFieldsetMargin: string;
formLegendMargin: string;
formInputHeight: string;
formButtonHeight: number;
formInputPaddingHorizontal: string;
formInputAffixPaddingHorizontal: string;
formInputMargin: string;
formLabelPadding: string;
formLabelMargin: string;
formValidationMessagePadding: string;
formValidationMessageMargin: string;
} | | +| [spacing](#spacing-property) | {
insetSquishMd: string;
d: string;
xxs: string;
xs: string;
sm: string;
md: string;
lg: string;
xl: string;
gutter: string;
formSpacingBase: number;
formMargin: string;
formFieldsetMargin: string;
formInputHeight: number;
formButtonHeight: number;
formInputPaddingHorizontal: string;
formInputAffixPaddingHorizontal: string;
formInputMargin: string;
formLabelPadding: string;
formLabelMargin: string;
formValidationMessagePadding: string;
formValidationMessageMargin: string;
inlineFormMargin: string;
} | | | [typography](#typography-property) | {
fontFamily: {
sansSerif: string;
monospace: string;
};
size: {
base: string;
xs: string;
sm: string;
md: string;
lg: string;
};
weight: {
light: number;
regular: number;
semibold: number;
bold: number;
};
lineHeight: {
xs: number;
sm: number;
md: number;
lg: number;
};
heading: {
h1: string;
h2: string;
h3: string;
h4: string;
h5: string;
h6: string;
};
link: {
decoration: string;
hoverDecoration: string;
};
} | | | [zIndex](#zindex-property) | {
dropdown: string;
navbarFixed: string;
sidemenu: string;
tooltip: string;
modalBackdrop: string;
modal: string;
typeahead: string;
} | | @@ -119,8 +119,7 @@ spacing: { formSpacingBase: number; formMargin: string; formFieldsetMargin: string; - formLegendMargin: string; - formInputHeight: string; + formInputHeight: number; formButtonHeight: number; formInputPaddingHorizontal: string; formInputAffixPaddingHorizontal: string; @@ -129,6 +128,7 @@ spacing: { formLabelMargin: string; formValidationMessagePadding: string; formValidationMessageMargin: string; + inlineFormMargin: string; }; ``` diff --git a/docs/sources/packages_api/data/graphseriesxy.md b/docs/sources/packages_api/data/graphseriesxy.md index 2b363204b64..86f1841b248 100644 --- a/docs/sources/packages_api/data/graphseriesxy.md +++ b/docs/sources/packages_api/data/graphseriesxy.md @@ -42,7 +42,7 @@ import { GraphSeriesXY } from '@grafana/data'; Signature ```typescript -color: string; +color?: string; ``` ### data property diff --git a/docs/sources/packages_api/data/guessfieldtypefromnameandvalue.md b/docs/sources/packages_api/data/guessfieldtypefromnameandvalue.md new file mode 100644 index 00000000000..ac010b781c0 --- /dev/null +++ b/docs/sources/packages_api/data/guessfieldtypefromnameandvalue.md @@ -0,0 +1,37 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "guessFieldTypeFromNameAndValue" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## guessFieldTypeFromNameAndValue() function + +### guessFieldTypeFromNameAndValue() function + +Given a name and value, this will pick a reasonable field type + +Signature + +```typescript +export declare function guessFieldTypeFromNameAndValue(name: string, v: any): FieldType; +``` +Import + +```typescript +import { guessFieldTypeFromNameAndValue } from '@grafana/data'; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| name | string | | +| v | any | | + +Returns: + +`FieldType` + diff --git a/docs/sources/packages_api/data/identityoverrideprocessor.md b/docs/sources/packages_api/data/identityoverrideprocessor.md new file mode 100644 index 00000000000..bf4bd07f662 --- /dev/null +++ b/docs/sources/packages_api/data/identityoverrideprocessor.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "identityOverrideProcessor" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## identityOverrideProcessor variable + +### identityOverrideProcessor variable + +Signature + +```typescript +identityOverrideProcessor: (value: T, _context: FieldOverrideContext, _settings: any) => T +``` +Import + +```typescript +import { identityOverrideProcessor } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/licenseinfo.md b/docs/sources/packages_api/data/licenseinfo.md new file mode 100644 index 00000000000..25ff5583b65 --- /dev/null +++ b/docs/sources/packages_api/data/licenseinfo.md @@ -0,0 +1,64 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "LicenseInfo" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## LicenseInfo interface + +Describes the license information about the current running instance of Grafana. + +Signature + +```typescript +export interface LicenseInfo +``` +Import + +```typescript +import { LicenseInfo } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [expiry](#expiry-property) | number | | +| [hasLicense](#haslicense-property) | boolean | | +| [licenseUrl](#licenseurl-property) | string | | +| [stateInfo](#stateinfo-property) | string | | + +### expiry property + +Signature + +```typescript +expiry: number; +``` + +### hasLicense property + +Signature + +```typescript +hasLicense: boolean; +``` + +### licenseUrl property + +Signature + +```typescript +licenseUrl: string; +``` + +### stateInfo property + +Signature + +```typescript +stateInfo: string; +``` diff --git a/docs/sources/packages_api/data/linkmodel.md b/docs/sources/packages_api/data/linkmodel.md index 1ed5a6c4d23..23e6d13cab2 100644 --- a/docs/sources/packages_api/data/linkmodel.md +++ b/docs/sources/packages_api/data/linkmodel.md @@ -15,7 +15,7 @@ Processed Link Model. The values are ready to use Signature ```typescript -export interface LinkModel +export interface LinkModel ``` Import diff --git a/docs/sources/packages_api/data/loadingstate.md b/docs/sources/packages_api/data/loadingstate.md index e82a02e2b5c..e85c2c65d0e 100644 --- a/docs/sources/packages_api/data/loadingstate.md +++ b/docs/sources/packages_api/data/loadingstate.md @@ -12,6 +12,8 @@ draft = true ### LoadingState enum +Represent panel data loading state. + Signature ```typescript diff --git a/docs/sources/packages_api/data/locationutil.md b/docs/sources/packages_api/data/locationutil.md new file mode 100644 index 00000000000..6ffecf3243a --- /dev/null +++ b/docs/sources/packages_api/data/locationutil.md @@ -0,0 +1,31 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "locationUtil" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## locationUtil variable + +### locationUtil variable + +Signature + +```typescript +locationUtil: { + initialize: ({ getConfig, buildParamsFromVariables, getTimeRangeForUrl }: LocationUtilDependencies) => void; + stripBaseFromUrl: (url: string) => string; + assureBaseUrl: (url: string) => string; + getTimeRangeUrlParams: () => string | null; + getVariablesUrlParams: (scopedVars?: ScopedVars | undefined) => string | null; + processUrl: (url: string) => string; +} +``` +Import + +```typescript +import { locationUtil } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/mutabledataframe.md b/docs/sources/packages_api/data/mutabledataframe.md index 6aa67d81e15..f927f469ecf 100644 --- a/docs/sources/packages_api/data/mutabledataframe.md +++ b/docs/sources/packages_api/data/mutabledataframe.md @@ -13,7 +13,7 @@ draft = true Signature ```typescript -export declare class MutableDataFrame implements DataFrame, MutableVector +export declare class MutableDataFrame extends FunctionalVector implements DataFrame, MutableVector ``` Import @@ -48,7 +48,6 @@ import { MutableDataFrame } from '@grafana/data'; | [get(idx)](#get-method) | | Get an object with a property for each field in the DataFrame | | [reverse()](#reverse-method) | | Reverse all values | | [set(index, value, addMissingFields)](#set-method) | | | -| [toArray()](#toarray-method) | | | | [toJSON()](#tojson-method) | | The simplified JSON values used in JSON.stringify() | | [validate()](#validate-method) | | | @@ -242,17 +241,6 @@ set(index: number, value: T, addMissingFields?: boolean): void; `void` -### toArray method - -Signature - -```typescript -toArray(): T[]; -``` -Returns: - -`T[]` - ### toJSON method The simplified JSON values used in JSON.stringify() diff --git a/docs/sources/packages_api/data/navmodel.md b/docs/sources/packages_api/data/navmodel.md index 6742dab642f..688e8e75e25 100644 --- a/docs/sources/packages_api/data/navmodel.md +++ b/docs/sources/packages_api/data/navmodel.md @@ -10,6 +10,8 @@ draft = true ## NavModel interface +Interface used to describe different kinds of page titles and page navigation. Navmodels are usually generated in the backend and stored in Redux. + Signature ```typescript @@ -24,12 +26,14 @@ import { NavModel } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [breadcrumbs](#breadcrumbs-property) | NavModelItem[] | | -| [main](#main-property) | NavModelItem | | -| [node](#node-property) | NavModelItem | | +| [breadcrumbs](#breadcrumbs-property) | NavModelItem[] | Describes breadcrumbs that are used in places such as data source settings., folder page and plugins page. | +| [main](#main-property) | NavModelItem | Main page. that wraps the navigation. Generate the children property generate tabs when used with the Page component. | +| [node](#node-property) | NavModelItem | This is the current active tab/navigation. | ### breadcrumbs property +Describes breadcrumbs that are used in places such as data source settings., folder page and plugins page. + Signature ```typescript @@ -38,6 +42,8 @@ breadcrumbs?: NavModelItem[]; ### main property +Main page. that wraps the navigation. Generate the `children` property generate tabs when used with the Page component. + Signature ```typescript @@ -46,6 +52,8 @@ main: NavModelItem; ### node property +This is the current active tab/navigation. + Signature ```typescript diff --git a/docs/sources/packages_api/ui/numberfieldconfigsettings.md b/docs/sources/packages_api/data/numberfieldconfigsettings.md similarity index 86% rename from docs/sources/packages_api/ui/numberfieldconfigsettings.md rename to docs/sources/packages_api/data/numberfieldconfigsettings.md index eb8e67e5140..747f3b84e65 100644 --- a/docs/sources/packages_api/ui/numberfieldconfigsettings.md +++ b/docs/sources/packages_api/data/numberfieldconfigsettings.md @@ -3,7 +3,7 @@ # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "NumberFieldConfigSettings" -keywords = ["grafana","documentation","sdk","@grafana/ui"] +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ @@ -18,7 +18,7 @@ export interface NumberFieldConfigSettings Import ```typescript -import { NumberFieldConfigSettings } from '@grafana/ui'; +import { NumberFieldConfigSettings } from '@grafana/data'; ``` Properties diff --git a/docs/sources/packages_api/ui/numberoverrideprocessor.md b/docs/sources/packages_api/data/numberoverrideprocessor.md similarity index 69% rename from docs/sources/packages_api/ui/numberoverrideprocessor.md rename to docs/sources/packages_api/data/numberoverrideprocessor.md index 07687358d73..6b35a03ba91 100644 --- a/docs/sources/packages_api/ui/numberoverrideprocessor.md +++ b/docs/sources/packages_api/data/numberoverrideprocessor.md @@ -3,7 +3,7 @@ # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "numberOverrideProcessor" -keywords = ["grafana","documentation","sdk","@grafana/ui"] +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ @@ -15,10 +15,10 @@ draft = true Signature ```typescript -numberOverrideProcessor: (value: any, context: FieldOverrideContext, settings: NumberFieldConfigSettings) => number +numberOverrideProcessor: (value: any, context: FieldOverrideContext, settings?: NumberFieldConfigSettings | undefined) => number | undefined ``` Import ```typescript -import { numberOverrideProcessor } from '@grafana/ui'; +import { numberOverrideProcessor } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/data/omit.md b/docs/sources/packages_api/data/omit_2.md similarity index 79% rename from docs/sources/packages_api/data/omit.md rename to docs/sources/packages_api/data/omit_2.md index 97c40a251ff..067dbcd2297 100644 --- a/docs/sources/packages_api/data/omit.md +++ b/docs/sources/packages_api/data/omit_2.md @@ -2,15 +2,15 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "Omit" +title = "Omit_2" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ -## Omit type +## Omit\_2 type -### Omit type +### Omit\_2 type Signature @@ -20,5 +20,5 @@ export declare type Omit = Pick>; Import ```typescript -import { Omit } from '@grafana/data'; +import { Omit_2 } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/data/onupdatedatasourcejsondataoptionchecked.md b/docs/sources/packages_api/data/onupdatedatasourcejsondataoptionchecked.md new file mode 100644 index 00000000000..21b6f90e920 --- /dev/null +++ b/docs/sources/packages_api/data/onupdatedatasourcejsondataoptionchecked.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "onUpdateDatasourceJsonDataOptionChecked" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## onUpdateDatasourceJsonDataOptionChecked variable + +### onUpdateDatasourceJsonDataOptionChecked variable + +Signature + +```typescript +onUpdateDatasourceJsonDataOptionChecked: (props: DataSourcePluginOptionsEditorProps, key: K) => (event: import("react").SyntheticEvent) => void +``` +Import + +```typescript +import { onUpdateDatasourceJsonDataOptionChecked } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/onupdatedatasourceoption.md b/docs/sources/packages_api/data/onupdatedatasourceoption.md index f4e4d78cba2..6751f100861 100644 --- a/docs/sources/packages_api/data/onupdatedatasourceoption.md +++ b/docs/sources/packages_api/data/onupdatedatasourceoption.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -onUpdateDatasourceOption: (props: DataSourcePluginOptionsEditorProps, key: "id" | "orgId" | "name" | "typeLogoUrl" | "type" | "access" | "url" | "password" | "user" | "database" | "basicAuth" | "basicAuthPassword" | "basicAuthUser" | "isDefault" | "jsonData" | "secureJsonData" | "secureJsonFields" | "readOnly" | "withCredentials" | "version") => (event: import("react").SyntheticEvent) => void +onUpdateDatasourceOption: (props: DataSourcePluginOptionsEditorProps, key: "type" | "name" | "id" | "orgId" | "typeLogoUrl" | "access" | "url" | "password" | "user" | "database" | "basicAuth" | "basicAuthPassword" | "basicAuthUser" | "isDefault" | "jsonData" | "secureJsonData" | "secureJsonFields" | "readOnly" | "withCredentials" | "version") => (event: import("react").SyntheticEvent) => void ``` Import diff --git a/docs/sources/packages_api/data/organizefieldstransformeroptions.md b/docs/sources/packages_api/data/organizefieldstransformeroptions.md new file mode 100644 index 00000000000..3ff1c0720c1 --- /dev/null +++ b/docs/sources/packages_api/data/organizefieldstransformeroptions.md @@ -0,0 +1,35 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "OrganizeFieldsTransformerOptions" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## OrganizeFieldsTransformerOptions interface + +Signature + +```typescript +export interface OrganizeFieldsTransformerOptions extends OrderFieldsTransformerOptions, RenameFieldsTransformerOptions +``` +Import + +```typescript +import { OrganizeFieldsTransformerOptions } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [excludeByName](#excludebyname-property) | Record<string, boolean> | | + +### excludeByName property + +Signature + +```typescript +excludeByName: Record; +``` diff --git a/docs/sources/packages_api/data/paneldata.md b/docs/sources/packages_api/data/paneldata.md index d632ce19d05..0434f165228 100644 --- a/docs/sources/packages_api/data/paneldata.md +++ b/docs/sources/packages_api/data/paneldata.md @@ -24,14 +24,17 @@ import { PanelData } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [error](#error-property) | DataQueryError | | -| [request](#request-property) | DataQueryRequest | | -| [series](#series-property) | DataFrame[] | | -| [state](#state-property) | LoadingState | | -| [timeRange](#timerange-property) | TimeRange | | +| [error](#error-property) | DataQueryError | Any query errors | +| [request](#request-property) | DataQueryRequest | Request contains the queries and properties sent to the datasource | +| [series](#series-property) | DataFrame[] | Contains data frames with field overrides applied | +| [state](#state-property) | LoadingState | State of the data (loading, done, error, streaming) | +| [timeRange](#timerange-property) | TimeRange | Contains the range from the request or a shifted time range if a request uses relative time | +| [timings](#timings-property) | DataQueryTimings | Timing measurements | ### error property +Any query errors + Signature ```typescript @@ -40,6 +43,8 @@ error?: DataQueryError; ### request property +Request contains the queries and properties sent to the datasource + Signature ```typescript @@ -48,6 +53,8 @@ request?: DataQueryRequest; ### series property +Contains data frames with field overrides applied + Signature ```typescript @@ -56,6 +63,8 @@ series: DataFrame[]; ### state property +State of the data (loading, done, error, streaming) + Signature ```typescript @@ -64,8 +73,20 @@ state: LoadingState; ### timeRange property +Contains the range from the request or a shifted time range if a request uses relative time + Signature ```typescript timeRange: TimeRange; ``` + +### timings property + +Timing measurements + +Signature + +```typescript +timings?: DataQueryTimings; +``` diff --git a/docs/sources/packages_api/data/paneleditorprops.md b/docs/sources/packages_api/data/paneleditorprops.md index 96501ad3ad2..d591e94294e 100644 --- a/docs/sources/packages_api/data/paneleditorprops.md +++ b/docs/sources/packages_api/data/paneleditorprops.md @@ -25,6 +25,8 @@ import { PanelEditorProps } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | | [data](#data-property) | PanelData | | +| [fieldConfig](#fieldconfig-property) | FieldConfigSource | Panel fields configuration - temporart solution TODO\[FieldConfig\]: Remove when we switch old editor to new | +| [onFieldConfigChange](#onfieldconfigchange-property) | (config: FieldConfigSource) => void | Enables panel field config manipulation TODO\[FieldConfig\]: Remove when we switch old editor to new | | [onOptionsChange](#onoptionschange-property) | (options: T, callback?: () => void) => void | | | [options](#options-property) | T | | @@ -36,6 +38,26 @@ import { PanelEditorProps } from '@grafana/data'; data: PanelData; ``` +### fieldConfig property + +Panel fields configuration - temporart solution TODO\[FieldConfig\]: Remove when we switch old editor to new + +Signature + +```typescript +fieldConfig: FieldConfigSource; +``` + +### onFieldConfigChange property + +Enables panel field config manipulation TODO\[FieldConfig\]: Remove when we switch old editor to new + +Signature + +```typescript +onFieldConfigChange: (config: FieldConfigSource) => void; +``` + ### onOptionsChange property Signature diff --git a/docs/sources/packages_api/data/panelevents.md b/docs/sources/packages_api/data/panelevents.md index 5f6729619f0..b6be44cd195 100644 --- a/docs/sources/packages_api/data/panelevents.md +++ b/docs/sources/packages_api/data/panelevents.md @@ -10,13 +10,11 @@ draft = true ## PanelEvents namespace +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + ### PanelEvents namespace -Signature - -```typescript -export declare namespace PanelEvents -``` Import ```typescript diff --git a/docs/sources/packages_api/data/panelevents/panelchangeviewpayload.md b/docs/sources/packages_api/data/panelevents/panelchangeviewpayload.md index 9c9bafa3929..eca2763e9a1 100644 --- a/docs/sources/packages_api/data/panelevents/panelchangeviewpayload.md +++ b/docs/sources/packages_api/data/panelevents/panelchangeviewpayload.md @@ -15,7 +15,7 @@ Payloads Signature ```typescript -interface PanelChangeViewPayload +export interface PanelChangeViewPayload ``` Import diff --git a/docs/sources/packages_api/data/panelmodel.md b/docs/sources/packages_api/data/panelmodel.md index 1dbe99e4197..4047fd2ca03 100644 --- a/docs/sources/packages_api/data/panelmodel.md +++ b/docs/sources/packages_api/data/panelmodel.md @@ -24,11 +24,20 @@ import { PanelModel } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | +| [fieldConfig](#fieldconfig-property) | FieldConfigSource | | | [id](#id-property) | number | | | [options](#options-property) | TOptions | | | [pluginVersion](#pluginversion-property) | string | | | [scopedVars](#scopedvars-property) | ScopedVars | | +### fieldConfig property + +Signature + +```typescript +fieldConfig: FieldConfigSource; +``` + ### id property Signature diff --git a/docs/sources/packages_api/data/paneloptioneditorsregistry.md b/docs/sources/packages_api/data/paneloptioneditorsregistry.md new file mode 100644 index 00000000000..f26f9d06311 --- /dev/null +++ b/docs/sources/packages_api/data/paneloptioneditorsregistry.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "PanelOptionEditorsRegistry" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## PanelOptionEditorsRegistry type + +### PanelOptionEditorsRegistry type + +Signature + +```typescript +export declare type PanelOptionEditorsRegistry = Registry; +``` +Import + +```typescript +import { PanelOptionEditorsRegistry } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/paneloptionseditorbuilder.md b/docs/sources/packages_api/data/paneloptionseditorbuilder.md new file mode 100644 index 00000000000..187d02af073 --- /dev/null +++ b/docs/sources/packages_api/data/paneloptionseditorbuilder.md @@ -0,0 +1,155 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "PanelOptionsEditorBuilder" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## PanelOptionsEditorBuilder class + +Fluent API for declarative creation of panel options + +Signature + +```typescript +export declare class PanelOptionsEditorBuilder extends OptionsUIRegistryBuilder> +``` +Import + +```typescript +import { PanelOptionsEditorBuilder } from '@grafana/data'; +``` +Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addBooleanSwitch(config)](#addbooleanswitch-method) | | | +| [addColorPicker(config)](#addcolorpicker-method) | | | +| [addNumberInput(config)](#addnumberinput-method) | | | +| [addRadio(config)](#addradio-method) | | | +| [addSelect(config)](#addselect-method) | | | +| [addTextInput(config)](#addtextinput-method) | | | +| [addUnitPicker(config)](#addunitpicker-method) | | | + +### addBooleanSwitch method + +Signature + +```typescript +addBooleanSwitch(config: PanelOptionsEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | PanelOptionsEditorConfig<TOptions, TSettings, boolean> | | + +Returns: + +`this` + +### addColorPicker method + +Signature + +```typescript +addColorPicker(config: PanelOptionsEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | PanelOptionsEditorConfig<TOptions, TSettings & ColorFieldConfigSettings, string> | | + +Returns: + +`this` + +### addNumberInput method + +Signature + +```typescript +addNumberInput(config: PanelOptionsEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | PanelOptionsEditorConfig<TOptions, TSettings & NumberFieldConfigSettings, number> | | + +Returns: + +`this` + +### addRadio method + +Signature + +```typescript +addRadio>(config: PanelOptionsEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | PanelOptionsEditorConfig<TOptions, TSettings, TOption> | | + +Returns: + +`this` + +### addSelect method + +Signature + +```typescript +addSelect>(config: PanelOptionsEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | PanelOptionsEditorConfig<TOptions, TSettings, TOption> | | + +Returns: + +`this` + +### addTextInput method + +Signature + +```typescript +addTextInput(config: PanelOptionsEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | PanelOptionsEditorConfig<TOptions, TSettings & StringFieldConfigSettings, string> | | + +Returns: + +`this` + +### addUnitPicker method + +Signature + +```typescript +addUnitPicker(config: PanelOptionsEditorConfig): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | PanelOptionsEditorConfig<TOptions, TSettings & UnitFieldConfigSettings, string> | | + +Returns: + +`this` + diff --git a/docs/sources/packages_api/data/paneloptionseditorconfig.md b/docs/sources/packages_api/data/paneloptionseditorconfig.md new file mode 100644 index 00000000000..e908db742d8 --- /dev/null +++ b/docs/sources/packages_api/data/paneloptionseditorconfig.md @@ -0,0 +1,115 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "PanelOptionsEditorConfig" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## PanelOptionsEditorConfig interface + +Signature + +```typescript +export interface PanelOptionsEditorConfig +``` +Import + +```typescript +import { PanelOptionsEditorConfig } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [category](#category-property) | string[] | Array of strings representing category of the option. First element in the array will make option render as collapsible section. | +| [defaultValue](#defaultvalue-property) | TValue | | +| [description](#description-property) | string | Description of the option. Will be displayed in the UI as form element description. | +| [name](#name-property) | string | Name of the option. Will be displayed in the UI as form element label. | +| [path](#path-property) | (keyof TOptions & string) | string | Path of the option property to control. | +| [settings](#settings-property) | TSettings | al Custom settings of the editor. | +| [showIf](#showif-property) | (currentConfig: TOptions) => boolean | Function that enables configuration of when option editor should be shown based on current panel option properties. | + +### category property + +Array of strings representing category of the option. First element in the array will make option render as collapsible section. + +Signature + +```typescript +category?: string[]; +``` + +### defaultValue property + +Signature + +```typescript +defaultValue?: TValue; +``` + +### description property + +Description of the option. Will be displayed in the UI as form element description. + +Signature + +```typescript +description?: string; +``` + +### name property + +Name of the option. Will be displayed in the UI as form element label. + +Signature + +```typescript +name: string; +``` + +### path property + +Path of the option property to control. + +Signature + +```typescript +path: (keyof TOptions & string) | string; +``` + +## Example + +Given options object of a type: + +```ts +interface Options { + a: { + b: string; + } +} + +``` +path can be either 'a' or 'a.b'. + +### settings property + +al Custom settings of the editor. + +Signature + +```typescript +settings?: TSettings; +``` + +### showIf property + +Function that enables configuration of when option editor should be shown based on current panel option properties. + +Signature + +```typescript +showIf?: (currentConfig: TOptions) => boolean; +``` diff --git a/docs/sources/packages_api/data/paneloptionseditoritem.md b/docs/sources/packages_api/data/paneloptionseditoritem.md new file mode 100644 index 00000000000..62b72020ee2 --- /dev/null +++ b/docs/sources/packages_api/data/paneloptionseditoritem.md @@ -0,0 +1,22 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "PanelOptionsEditorItem" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## PanelOptionsEditorItem interface + +Signature + +```typescript +export interface PanelOptionsEditorItem extends OptionsEditorItem, TValue> +``` +Import + +```typescript +import { PanelOptionsEditorItem } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/paneloptionseditorprops.md b/docs/sources/packages_api/data/paneloptionseditorprops.md new file mode 100644 index 00000000000..fab93652cfe --- /dev/null +++ b/docs/sources/packages_api/data/paneloptionseditorprops.md @@ -0,0 +1,22 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "PanelOptionsEditorProps" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## PanelOptionsEditorProps interface + +Signature + +```typescript +export interface PanelOptionsEditorProps extends StandardEditorProps +``` +Import + +```typescript +import { PanelOptionsEditorProps } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/panelplugin.md b/docs/sources/packages_api/data/panelplugin.md index 301123d3e4c..30034ce9bd0 100644 --- a/docs/sources/packages_api/data/panelplugin.md +++ b/docs/sources/packages_api/data/panelplugin.md @@ -13,7 +13,7 @@ draft = true Signature ```typescript -export declare class PanelPlugin extends GrafanaPlugin +export declare class PanelPlugin extends GrafanaPlugin ``` Import @@ -31,24 +31,27 @@ import { PanelPlugin } from '@grafana/data'; | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [angularPanelCtrl](#angularpanelctrl-property) | | any | Legacy angular ctrl. If this exists it will be used instead of the panel | -| [customFieldConfigs](#customfieldconfigs-property) | | FieldConfigEditorRegistry | | -| [defaults](#defaults-property) | | TOptions | | +| [defaults](#defaults-property) | | {} | null | | | [editor](#editor-property) | | ComponentClass<PanelEditorProps<TOptions>> | | +| [fieldConfigDefaults](#fieldconfigdefaults-property) | | FieldConfigSource<TFieldConfigOptions> | | +| [fieldConfigRegistry](#fieldconfigregistry-property) | | FieldConfigOptionsRegistry | | | [noPadding](#nopadding-property) | | boolean | | | [onPanelMigration](#onpanelmigration-property) | | PanelMigrationHandler<TOptions> | | | [onPanelTypeChanged](#onpaneltypechanged-property) | | PanelTypeChangedHandler<TOptions> | | -| [panel](#panel-property) | | ComponentType<PanelProps<TOptions>> | | +| [optionEditors](#optioneditors-property) | | PanelOptionEditorsRegistry | undefined | | +| [panel](#panel-property) | | ComponentType<PanelProps<TOptions>> | null | | Methods | Method | Modifiers | Description | | --- | --- | --- | -| [setCustomFieldConfigs(registry)](#setcustomfieldconfigs-method) | | | | [setDefaults(defaults)](#setdefaults-method) | | | | [setEditor(editor)](#seteditor-method) | | | | [setMigrationHandler(handler)](#setmigrationhandler-method) | | This function is called before the panel first loads if the current version is different than the version that was saved.This is a good place to support any changes to the options model | | [setNoPadding()](#setnopadding-method) | | | -| [setPanelChangeHandler(handler)](#setpanelchangehandler-method) | | This function is called when the visualization was changed. This passes in the options that were used in the previous visualization | +| [setPanelChangeHandler(handler)](#setpanelchangehandler-method) | | This function is called when the visualization was changed. This passes in the panel model for previous visualisation options inspection and panel model updates.This is useful for supporting PanelModel API updates when changing between Angular and React panels. | +| [setPanelOptions(builder)](#setpaneloptions-method) | | Enables panel options editor creation | +| [useFieldConfig(config)](#usefieldconfig-method) | | Allows specyfing which standard field config options panel should use and defining default values | ### constructor(panel) @@ -57,13 +60,13 @@ Constructs a new instance of the `PanelPlugin` class Signature ```typescript -constructor(panel: ComponentType>); +constructor(panel: ComponentType> | null); ``` Parameters | Parameter | Type | Description | | --- | --- | --- | -| panel | ComponentType<PanelProps<TOptions>> | | +| panel | ComponentType<PanelProps<TOptions>> | null | | ### angularPanelCtrl property @@ -75,20 +78,12 @@ Legacy angular ctrl. If this exists it will be used instead of the panel angularPanelCtrl?: any; ``` -### customFieldConfigs property - -Signature - -```typescript -customFieldConfigs?: FieldConfigEditorRegistry; -``` - ### defaults property Signature ```typescript -defaults?: TOptions; +get defaults(): {} | null; ``` ### editor property @@ -99,6 +94,22 @@ defaults?: TOptions; editor?: ComponentClass>; ``` +### fieldConfigDefaults property + +Signature + +```typescript +get fieldConfigDefaults(): FieldConfigSource; +``` + +### fieldConfigRegistry property + +Signature + +```typescript +get fieldConfigRegistry(): FieldConfigOptionsRegistry; +``` + ### noPadding property Signature @@ -123,31 +134,22 @@ onPanelMigration?: PanelMigrationHandler; onPanelTypeChanged?: PanelTypeChangedHandler; ``` +### optionEditors property + +Signature + +```typescript +get optionEditors(): PanelOptionEditorsRegistry | undefined; +``` + ### panel property Signature ```typescript -panel: ComponentType>; +panel: ComponentType> | null; ``` -### setCustomFieldConfigs method - -Signature - -```typescript -setCustomFieldConfigs(registry: FieldConfigEditorRegistry): this; -``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| registry | FieldConfigEditorRegistry | | - -Returns: - -`this` - ### setDefaults method Signature @@ -216,7 +218,9 @@ setNoPadding(): this; ### setPanelChangeHandler method -This function is called when the visualization was changed. This passes in the options that were used in the previous visualization +This function is called when the visualization was changed. This passes in the panel model for previous visualisation options inspection and panel model updates. + +This is useful for supporting PanelModel API updates when changing between Angular and React panels. Signature @@ -233,3 +237,127 @@ setPanelChangeHandler(handler: PanelTypeChangedHandler): this; `this` +### setPanelOptions method + +Enables panel options editor creation + +Signature + +```typescript +setPanelOptions(builder: (builder: PanelOptionsEditorBuilder) => void): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| builder | (builder: PanelOptionsEditorBuilder<TOptions>) => void | | + +Returns: + +`this` + +## Example + + +```typescript + +import { ShapePanel } from './ShapePanel'; + +interface ShapePanelOptions {} + +export const plugin = new PanelPlugin(ShapePanel) + .setPanelOptions(builder => { + builder + .addSelect({ + id: 'shape', + name: 'Shape', + description: 'Select shape to render' + settings: { + options: [ + {value: 'circle', label: 'Circle' }, + {value: 'square', label: 'Square }, + {value: 'triangle', label: 'Triangle } + ] + }, + }) + }) + +``` + +### useFieldConfig method + +Allows specyfing which standard field config options panel should use and defining default values + +Signature + +```typescript +useFieldConfig(config?: SetFieldConfigOptionsArgs): this; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| config | SetFieldConfigOptionsArgs<TFieldConfigOptions> | | + +Returns: + +`this` + +## Example + + +```typescript + +import { ShapePanel } from './ShapePanel'; + +interface ShapePanelOptions {} + +// when plugin should use all standard options +export const plugin = new PanelPlugin(ShapePanel) + .useFieldConfig(); + +// when plugin should only display specific standard options +// note, that options will be displayed in the order they are provided +export const plugin = new PanelPlugin(ShapePanel) + .useFieldConfig({ + standardOptions: [FieldConfigProperty.Min, FieldConfigProperty.Max] + }); + +// when standard option's default value needs to be provided +export const plugin = new PanelPlugin(ShapePanel) + .useFieldConfig({ + standardOptions: [FieldConfigProperty.Min, FieldConfigProperty.Max], + standardOptionsDefaults: { + [FieldConfigProperty.Min]: 20, + [FieldConfigProperty.Max]: 100 + } + }); + +// when custom field config options needs to be provided +export const plugin = new PanelPlugin(ShapePanel) + .useFieldConfig({ + useCustomConfig: builder => { + builder + .addNumberInput({ + id: 'shapeBorderWidth', + name: 'Border width', + description: 'Border width of the shape', + settings: { + min: 1, + max: 5, + }, + }) + .addSelect({ + id: 'displayMode', + name: 'Display mode', + description: 'How the shape shout be rendered' + settings: { + options: [{value: 'fill', label: 'Fill' }, {value: 'transparent', label: 'Transparent }] + }, + }) + }, + }); + + +``` + diff --git a/docs/sources/packages_api/data/panelprops.md b/docs/sources/packages_api/data/panelprops.md index 446c02bbf72..fc9789f2215 100644 --- a/docs/sources/packages_api/data/panelprops.md +++ b/docs/sources/packages_api/data/panelprops.md @@ -25,9 +25,11 @@ import { PanelProps } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | | [data](#data-property) | PanelData | | +| [fieldConfig](#fieldconfig-property) | FieldConfigSource | Panel fields configuration | | [height](#height-property) | number | | | [id](#id-property) | number | | | [onChangeTimeRange](#onchangetimerange-property) | (timeRange: AbsoluteTimeRange) => void | | +| [onFieldConfigChange](#onfieldconfigchange-property) | (config: FieldConfigSource) => void | Enables panel field config manipulation | | [onOptionsChange](#onoptionschange-property) | (options: T) => void | | | [options](#options-property) | T | | | [renderCounter](#rendercounter-property) | number | | @@ -45,6 +47,16 @@ import { PanelProps } from '@grafana/data'; data: PanelData; ``` +### fieldConfig property + +Panel fields configuration + +Signature + +```typescript +fieldConfig: FieldConfigSource; +``` + ### height property Signature @@ -69,6 +81,16 @@ id: number; onChangeTimeRange: (timeRange: AbsoluteTimeRange) => void; ``` +### onFieldConfigChange property + +Enables panel field config manipulation + +Signature + +```typescript +onFieldConfigChange: (config: FieldConfigSource) => void; +``` + ### onOptionsChange property Signature diff --git a/docs/sources/packages_api/data/paneltypechangedhandler.md b/docs/sources/packages_api/data/paneltypechangedhandler.md index 9f4d7aaf10c..ddc88a8f8c5 100644 --- a/docs/sources/packages_api/data/paneltypechangedhandler.md +++ b/docs/sources/packages_api/data/paneltypechangedhandler.md @@ -12,12 +12,12 @@ draft = true ### PanelTypeChangedHandler type -Called before a panel is initialized +Called before a panel is initialized. Allows panel inspection for any updates before changing the panel type. Signature ```typescript -export declare type PanelTypeChangedHandler = (options: Partial, prevPluginId: string, prevOptions: any) => Partial; +export declare type PanelTypeChangedHandler = (panel: PanelModel, prevPluginId: string, prevOptions: any) => Partial; ``` Import diff --git a/docs/sources/packages_api/data/pluginmeta.md b/docs/sources/packages_api/data/pluginmeta.md index 625ce71892a..bbf7953f8c1 100644 --- a/docs/sources/packages_api/data/pluginmeta.md +++ b/docs/sources/packages_api/data/pluginmeta.md @@ -28,6 +28,7 @@ import { PluginMeta } from '@grafana/data'; | [defaultNavUrl](#defaultnavurl-property) | string | | | [dependencies](#dependencies-property) | PluginDependencies | | | [enabled](#enabled-property) | boolean | | +| [enterprise](#enterprise-property) | boolean | | | [hasUpdate](#hasupdate-property) | boolean | | | [id](#id-property) | string | | | [includes](#includes-property) | PluginInclude[] | | @@ -73,6 +74,14 @@ dependencies?: PluginDependencies; enabled?: boolean; ``` +### enterprise property + +Signature + +```typescript +enterprise?: boolean; +``` + ### hasUpdate property Signature diff --git a/docs/sources/packages_api/data/pluginstate.md b/docs/sources/packages_api/data/pluginstate.md index 019945ee1f5..74d4686c6e0 100644 --- a/docs/sources/packages_api/data/pluginstate.md +++ b/docs/sources/packages_api/data/pluginstate.md @@ -29,4 +29,5 @@ import { PluginState } from '@grafana/data'; | --- | --- | --- | | alpha | "alpha" | | | beta | "beta" | | +| deprecated | "deprecated" | | diff --git a/docs/sources/packages_api/data/queryresultmeta.md b/docs/sources/packages_api/data/queryresultmeta.md index eb75935fbd7..eeb5fb3a07c 100644 --- a/docs/sources/packages_api/data/queryresultmeta.md +++ b/docs/sources/packages_api/data/queryresultmeta.md @@ -24,19 +24,54 @@ import { QueryResultMeta } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | -| [custom](#custom-property) | Record<string, any> | | +| [alignmentPeriod](#alignmentperiod-property) | string | | +| [custom](#custom-property) | Record<string, any> | DatasSource Specific Values | +| [gmdMeta](#gmdmeta-property) | any[] | Legacy data source specific, should be moved to custom | +| [json](#json-property) | boolean | | | [limit](#limit-property) | number | | -| [requestId](#requestid-property) | string | | +| [notices](#notices-property) | QueryResultMetaNotice[] | Meta Notices | +| [query](#query-property) | string | | +| [rawQuery](#rawquery-property) | string | | | [searchWords](#searchwords-property) | string[] | | +| [stats](#stats-property) | QueryResultMetaStat[] | Stats | +| [transformations](#transformations-property) | string[] | Used to track transformation ids that where part of the processing | + +### alignmentPeriod property + +Signature + +```typescript +alignmentPeriod?: string; +``` ### custom property +DatasSource Specific Values + Signature ```typescript custom?: Record; ``` +### gmdMeta property + +Legacy data source specific, should be moved to custom + +Signature + +```typescript +gmdMeta?: any[]; +``` + +### json property + +Signature + +```typescript +json?: boolean; +``` + ### limit property Signature @@ -45,12 +80,30 @@ custom?: Record; limit?: number; ``` -### requestId property +### notices property + +Meta Notices Signature ```typescript -requestId?: string; +notices?: QueryResultMetaNotice[]; +``` + +### query property + +Signature + +```typescript +query?: string; +``` + +### rawQuery property + +Signature + +```typescript +rawQuery?: string; ``` ### searchWords property @@ -60,3 +113,23 @@ requestId?: string; ```typescript searchWords?: string[]; ``` + +### stats property + +Stats + +Signature + +```typescript +stats?: QueryResultMetaStat[]; +``` + +### transformations property + +Used to track transformation ids that where part of the processing + +Signature + +```typescript +transformations?: string[]; +``` diff --git a/docs/sources/packages_api/data/queryresultmetanotice.md b/docs/sources/packages_api/data/queryresultmetanotice.md new file mode 100644 index 00000000000..e30ea254c31 --- /dev/null +++ b/docs/sources/packages_api/data/queryresultmetanotice.md @@ -0,0 +1,72 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "QueryResultMetaNotice" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## QueryResultMetaNotice interface + +QueryResultMetaNotice is a structure that provides user notices for query result data + +Signature + +```typescript +export interface QueryResultMetaNotice +``` +Import + +```typescript +import { QueryResultMetaNotice } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [inspect](#inspect-property) | 'meta' | 'error' | 'data' | 'stats' | Optionally suggest an appropriate tab for the panel inspector | +| [link](#link-property) | string | An optional link that may be displayed in the UI. This value may be an absolute URL or relative to grafana root | +| [severity](#severity-property) | 'info' | 'warning' | 'error' | Specify the notice severity | +| [text](#text-property) | string | Notice descriptive text | + +### inspect property + +Optionally suggest an appropriate tab for the panel inspector + +Signature + +```typescript +inspect?: 'meta' | 'error' | 'data' | 'stats'; +``` + +### link property + +An optional link that may be displayed in the UI. This value may be an absolute URL or relative to grafana root + +Signature + +```typescript +link?: string; +``` + +### severity property + +Specify the notice severity + +Signature + +```typescript +severity: 'info' | 'warning' | 'error'; +``` + +### text property + +Notice descriptive text + +Signature + +```typescript +text: string; +``` diff --git a/docs/sources/packages_api/data/queryresultmetastat.md b/docs/sources/packages_api/data/queryresultmetastat.md new file mode 100644 index 00000000000..fad3bfa5b8d --- /dev/null +++ b/docs/sources/packages_api/data/queryresultmetastat.md @@ -0,0 +1,44 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "QueryResultMetaStat" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## QueryResultMetaStat interface + +Signature + +```typescript +export interface QueryResultMetaStat extends FieldConfig +``` +Import + +```typescript +import { QueryResultMetaStat } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [title](#title-property) | string | | +| [value](#value-property) | number | | + +### title property + +Signature + +```typescript +title: string; +``` + +### value property + +Signature + +```typescript +value: number; +``` diff --git a/docs/sources/packages_api/data/rangeutil.md b/docs/sources/packages_api/data/rangeutil.md index 22ae8f52e17..b2a24ff9314 100644 --- a/docs/sources/packages_api/data/rangeutil.md +++ b/docs/sources/packages_api/data/rangeutil.md @@ -10,13 +10,11 @@ draft = true ## rangeUtil namespace +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + ### rangeUtil namespace -Signature - -```typescript -export declare namespace rangeUtil -``` Import ```typescript diff --git a/docs/sources/packages_api/data/rangeutil/describetextrange.md b/docs/sources/packages_api/data/rangeutil/describetextrange.md index cf0adef0b77..1132aba51ee 100644 --- a/docs/sources/packages_api/data/rangeutil/describetextrange.md +++ b/docs/sources/packages_api/data/rangeutil/describetextrange.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -function describeTextRange(expr: any): any; +export declare function describeTextRange(expr: any): any; ``` Import diff --git a/docs/sources/packages_api/data/rangeutil/getrelativetimeslist.md b/docs/sources/packages_api/data/rangeutil/getrelativetimeslist.md index cd8328d2e78..e1dab2a1876 100644 --- a/docs/sources/packages_api/data/rangeutil/getrelativetimeslist.md +++ b/docs/sources/packages_api/data/rangeutil/getrelativetimeslist.md @@ -15,113 +15,159 @@ draft = true Signature ```typescript -function getRelativeTimesList(timepickerSettings: any, currentDisplay: any): import("lodash").Dictionary<(number | { +export declare function getRelativeTimesList(timepickerSettings: any, currentDisplay: any): import("lodash").Dictionary<(number | { + from: string; + to: string; + display: string; + section: number; +} | (() => string) | (() => string) | (() => { + from: string; + to: string; + display: string; + section: number; +} | undefined) | ((...items: { + from: string; + to: string; + display: string; + section: number; +}[]) => number) | { + (...items: ConcatArray<{ from: string; to: string; display: string; section: number; - } | (() => string) | (() => string) | (() => { + }>[]): { from: string; to: string; display: string; section: number; - } | undefined) | ((...items: { + }[]; + (...items: ({ from: string; to: string; display: string; section: number; - }[]) => number) | { - (...items: ConcatArray<{ - from: string; - to: string; - display: string; - section: number; - }>[]): { - from: string; - to: string; - display: string; - section: number; - }[]; - (...items: ({ - from: string; - to: string; - display: string; - section: number; - } | ConcatArray<{ - from: string; - to: string; - display: string; - section: number; - }>)[]): { - from: string; - to: string; - display: string; - section: number; - }[]; - } | ((separator?: string | undefined) => string) | (() => { + } | ConcatArray<{ from: string; to: string; display: string; section: number; - }[]) | (() => { + }>)[]): { from: string; to: string; display: string; section: number; - } | undefined) | ((start?: number | undefined, end?: number | undefined) => { + }[]; +} | ((separator?: string | undefined) => string) | (() => { + from: string; + to: string; + display: string; + section: number; +}[]) | (() => { + from: string; + to: string; + display: string; + section: number; +} | undefined) | ((start?: number | undefined, end?: number | undefined) => { + from: string; + to: string; + display: string; + section: number; +}[]) | ((compareFn?: ((a: { + from: string; + to: string; + display: string; + section: number; +}, b: { + from: string; + to: string; + display: string; + section: number; +}) => number) | undefined) => { + from: string; + to: string; + display: string; + section: number; +}[]) | { + (start: number, deleteCount?: number | undefined): { from: string; to: string; display: string; section: number; - }[]) | ((compareFn?: ((a: { + }[]; + (start: number, deleteCount: number, ...items: { from: string; to: string; display: string; section: number; - }, b: { + }[]): { from: string; to: string; display: string; section: number; - }) => number) | undefined) => { + }[]; +} | ((...items: { + from: string; + to: string; + display: string; + section: number; +}[]) => number) | ((searchElement: { + from: string; + to: string; + display: string; + section: number; +}, fromIndex?: number | undefined) => number) | ((searchElement: { + from: string; + to: string; + display: string; + section: number; +}, fromIndex?: number | undefined) => number) | ((callbackfn: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => void, thisArg?: any) => void) | ((callbackfn: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => U, thisArg?: any) => U[]) | { + number) | ((searchElement: { - from: string; - to: string; - display: string; - section: number; - }, fromIndex?: number | undefined) => number) | ((searchElement: { - from: string; - to: string; - display: string; - section: number; - }, fromIndex?: number | undefined) => number) | ((callbackfn: (value: { + }>(callbackfn: (value: { from: string; to: string; display: string; @@ -131,7 +177,8 @@ function getRelativeTimesList(timepickerSettings: any, currentDisplay: any): imp to: string; display: string; section: number; - }[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: { + }[]) => value is S, thisArg?: any): S[]; + (callbackfn: (value: { from: string; to: string; display: string; @@ -141,231 +188,157 @@ function getRelativeTimesList(timepickerSettings: any, currentDisplay: any): imp to: string; display: string; section: number; - }[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: { + }[]) => unknown, thisArg?: any): { from: string; to: string; display: string; section: number; - }, index: number, array: { + }[]; +} | { + (callbackfn: (previousValue: { from: string; to: string; display: string; section: number; - }[]) => void, thisArg?: any) => void) | ((callbackfn: (value: { + }, currentValue: { from: string; to: string; display: string; section: number; - }, index: number, array: { + }, currentIndex: number, array: { from: string; to: string; display: string; section: number; - }[]) => U, thisArg?: any) => U[]) | { - (callbackfn: (value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => value is S, thisArg?: any): S[]; - (callbackfn: (value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => unknown, thisArg?: any): { - from: string; - to: string; - display: string; - section: number; - }[]; - } | { - (callbackfn: (previousValue: { - from: string; - to: string; - display: string; - section: number; - }, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => { - from: string; - to: string; - display: string; - section: number; - }): { - from: string; - to: string; - display: string; - section: number; - }; - (callbackfn: (previousValue: { - from: string; - to: string; - display: string; - section: number; - }, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => { - from: string; - to: string; - display: string; - section: number; - }, initialValue: { - from: string; - to: string; - display: string; - section: number; - }): { - from: string; - to: string; - display: string; - section: number; - }; - (callbackfn: (previousValue: U_1, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => U_1, initialValue: U_1): U_1; - } | { - (callbackfn: (previousValue: { - from: string; - to: string; - display: string; - section: number; - }, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => { - from: string; - to: string; - display: string; - section: number; - }): { - from: string; - to: string; - display: string; - section: number; - }; - (callbackfn: (previousValue: { - from: string; - to: string; - display: string; - section: number; - }, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => { - from: string; - to: string; - display: string; - section: number; - }, initialValue: { - from: string; - to: string; - display: string; - section: number; - }): { - from: string; - to: string; - display: string; - section: number; - }; - (callbackfn: (previousValue: U_2, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => U_2, initialValue: U_2): U_2; - } | { - (predicate: (this: void, value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, obj: { - from: string; - to: string; - display: string; - section: number; - }[]) => value is S_1, thisArg?: any): S_1 | undefined; - (predicate: (value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, obj: { - from: string; - to: string; - display: string; - section: number; - }[]) => unknown, thisArg?: any): { - from: string; - to: string; - display: string; - section: number; - } | undefined; - } | ((predicate: (value: { + }[]) => { + from: string; + to: string; + display: string; + section: number; + }): { + from: string; + to: string; + display: string; + section: number; + }; + (callbackfn: (previousValue: { + from: string; + to: string; + display: string; + section: number; + }, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => { + from: string; + to: string; + display: string; + section: number; + }, initialValue: { + from: string; + to: string; + display: string; + section: number; + }): { + from: string; + to: string; + display: string; + section: number; + }; + (callbackfn: (previousValue: U_1, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => U_1, initialValue: U_1): U_1; +} | { + (callbackfn: (previousValue: { + from: string; + to: string; + display: string; + section: number; + }, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => { + from: string; + to: string; + display: string; + section: number; + }): { + from: string; + to: string; + display: string; + section: number; + }; + (callbackfn: (previousValue: { + from: string; + to: string; + display: string; + section: number; + }, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => { + from: string; + to: string; + display: string; + section: number; + }, initialValue: { + from: string; + to: string; + display: string; + section: number; + }): { + from: string; + to: string; + display: string; + section: number; + }; + (callbackfn: (previousValue: U_2, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => U_2, initialValue: U_2): U_2; +} | { + (predicate: (this: void, value: { from: string; to: string; display: string; @@ -375,57 +348,84 @@ function getRelativeTimesList(timepickerSettings: any, currentDisplay: any): imp to: string; display: string; section: number; - }[]) => unknown, thisArg?: any) => number) | ((value: { + }[]) => value is S_1, thisArg?: any): S_1 | undefined; + (predicate: (value: { from: string; to: string; display: string; section: number; - }, start?: number | undefined, end?: number | undefined) => { + }, index: number, obj: { from: string; to: string; display: string; section: number; - }[]) | ((target: number, start: number, end?: number | undefined) => { + }[]) => unknown, thisArg?: any): { from: string; to: string; display: string; section: number; - }[]) | (() => IterableIterator<[number, { - from: string; - to: string; - display: string; - section: number; - }]>) | (() => IterableIterator) | (() => IterableIterator<{ - from: string; - to: string; - display: string; - section: number; - }>) | ((searchElement: { - from: string; - to: string; - display: string; - section: number; - }, fromIndex?: number | undefined) => boolean) | ((callback: (this: This, value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => U_3 | readonly U_3[], thisArg?: This | undefined) => U_3[]) | { - (this: U_4[][][][][][][][], depth: 7): U_4[]; - (this: U_5[][][][][][][], depth: 6): U_5[]; - (this: U_6[][][][][][], depth: 5): U_6[]; - (this: U_7[][][][][], depth: 4): U_7[]; - (this: U_8[][][][], depth: 3): U_8[]; - (this: U_9[][][], depth: 2): U_9[]; - (this: U_10[][], depth?: 1 | undefined): U_10[]; - (this: U_11[], depth: 0): U_11[]; - (depth?: number | undefined): any[]; - })[]>; + } | undefined; +} | ((predicate: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, obj: { + from: string; + to: string; + display: string; + section: number; +}[]) => unknown, thisArg?: any) => number) | ((value: { + from: string; + to: string; + display: string; + section: number; +}, start?: number | undefined, end?: number | undefined) => { + from: string; + to: string; + display: string; + section: number; +}[]) | ((target: number, start: number, end?: number | undefined) => { + from: string; + to: string; + display: string; + section: number; +}[]) | (() => IterableIterator<[number, { + from: string; + to: string; + display: string; + section: number; +}]>) | (() => IterableIterator) | (() => IterableIterator<{ + from: string; + to: string; + display: string; + section: number; +}>) | ((searchElement: { + from: string; + to: string; + display: string; + section: number; +}, fromIndex?: number | undefined) => boolean) | ((callback: (this: This, value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => U_3 | readonly U_3[], thisArg?: This | undefined) => U_3[]) | { + (this: U_4[][][][][][][][], depth: 7): U_4[]; + (this: U_5[][][][][][][], depth: 6): U_5[]; + (this: U_6[][][][][][], depth: 5): U_6[]; + (this: U_7[][][][][], depth: 4): U_7[]; + (this: U_8[][][][], depth: 3): U_8[]; + (this: U_9[][][], depth: 2): U_9[]; + (this: U_10[][], depth?: 1 | undefined): U_10[]; + (this: U_11[], depth: 0): U_11[]; + (depth?: number | undefined): any[]; +})[]>; ``` Import @@ -443,112 +443,158 @@ const { getRelativeTimesList } = rangeUtil; Returns: `import("lodash").Dictionary<(number | { + from: string; + to: string; + display: string; + section: number; +} | (() => string) | (() => string) | (() => { + from: string; + to: string; + display: string; + section: number; +} | undefined) | ((...items: { + from: string; + to: string; + display: string; + section: number; +}[]) => number) | { + (...items: ConcatArray<{ from: string; to: string; display: string; section: number; - } | (() => string) | (() => string) | (() => { + }>[]): { from: string; to: string; display: string; section: number; - } | undefined) | ((...items: { + }[]; + (...items: ({ from: string; to: string; display: string; section: number; - }[]) => number) | { - (...items: ConcatArray<{ - from: string; - to: string; - display: string; - section: number; - }>[]): { - from: string; - to: string; - display: string; - section: number; - }[]; - (...items: ({ - from: string; - to: string; - display: string; - section: number; - } | ConcatArray<{ - from: string; - to: string; - display: string; - section: number; - }>)[]): { - from: string; - to: string; - display: string; - section: number; - }[]; - } | ((separator?: string | undefined) => string) | (() => { + } | ConcatArray<{ from: string; to: string; display: string; section: number; - }[]) | (() => { + }>)[]): { from: string; to: string; display: string; section: number; - } | undefined) | ((start?: number | undefined, end?: number | undefined) => { + }[]; +} | ((separator?: string | undefined) => string) | (() => { + from: string; + to: string; + display: string; + section: number; +}[]) | (() => { + from: string; + to: string; + display: string; + section: number; +} | undefined) | ((start?: number | undefined, end?: number | undefined) => { + from: string; + to: string; + display: string; + section: number; +}[]) | ((compareFn?: ((a: { + from: string; + to: string; + display: string; + section: number; +}, b: { + from: string; + to: string; + display: string; + section: number; +}) => number) | undefined) => { + from: string; + to: string; + display: string; + section: number; +}[]) | { + (start: number, deleteCount?: number | undefined): { from: string; to: string; display: string; section: number; - }[]) | ((compareFn?: ((a: { + }[]; + (start: number, deleteCount: number, ...items: { from: string; to: string; display: string; section: number; - }, b: { + }[]): { from: string; to: string; display: string; section: number; - }) => number) | undefined) => { + }[]; +} | ((...items: { + from: string; + to: string; + display: string; + section: number; +}[]) => number) | ((searchElement: { + from: string; + to: string; + display: string; + section: number; +}, fromIndex?: number | undefined) => number) | ((searchElement: { + from: string; + to: string; + display: string; + section: number; +}, fromIndex?: number | undefined) => number) | ((callbackfn: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => void, thisArg?: any) => void) | ((callbackfn: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => U, thisArg?: any) => U[]) | { + number) | ((searchElement: { - from: string; - to: string; - display: string; - section: number; - }, fromIndex?: number | undefined) => number) | ((searchElement: { - from: string; - to: string; - display: string; - section: number; - }, fromIndex?: number | undefined) => number) | ((callbackfn: (value: { + }>(callbackfn: (value: { from: string; to: string; display: string; @@ -558,7 +604,8 @@ const { getRelativeTimesList } = rangeUtil; to: string; display: string; section: number; - }[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: { + }[]) => value is S, thisArg?: any): S[]; + (callbackfn: (value: { from: string; to: string; display: string; @@ -568,231 +615,157 @@ const { getRelativeTimesList } = rangeUtil; to: string; display: string; section: number; - }[]) => unknown, thisArg?: any) => boolean) | ((callbackfn: (value: { + }[]) => unknown, thisArg?: any): { from: string; to: string; display: string; section: number; - }, index: number, array: { + }[]; +} | { + (callbackfn: (previousValue: { from: string; to: string; display: string; section: number; - }[]) => void, thisArg?: any) => void) | ((callbackfn: (value: { + }, currentValue: { from: string; to: string; display: string; section: number; - }, index: number, array: { + }, currentIndex: number, array: { from: string; to: string; display: string; section: number; - }[]) => U, thisArg?: any) => U[]) | { - (callbackfn: (value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => value is S, thisArg?: any): S[]; - (callbackfn: (value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => unknown, thisArg?: any): { - from: string; - to: string; - display: string; - section: number; - }[]; - } | { - (callbackfn: (previousValue: { - from: string; - to: string; - display: string; - section: number; - }, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => { - from: string; - to: string; - display: string; - section: number; - }): { - from: string; - to: string; - display: string; - section: number; - }; - (callbackfn: (previousValue: { - from: string; - to: string; - display: string; - section: number; - }, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => { - from: string; - to: string; - display: string; - section: number; - }, initialValue: { - from: string; - to: string; - display: string; - section: number; - }): { - from: string; - to: string; - display: string; - section: number; - }; - (callbackfn: (previousValue: U_1, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => U_1, initialValue: U_1): U_1; - } | { - (callbackfn: (previousValue: { - from: string; - to: string; - display: string; - section: number; - }, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => { - from: string; - to: string; - display: string; - section: number; - }): { - from: string; - to: string; - display: string; - section: number; - }; - (callbackfn: (previousValue: { - from: string; - to: string; - display: string; - section: number; - }, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => { - from: string; - to: string; - display: string; - section: number; - }, initialValue: { - from: string; - to: string; - display: string; - section: number; - }): { - from: string; - to: string; - display: string; - section: number; - }; - (callbackfn: (previousValue: U_2, currentValue: { - from: string; - to: string; - display: string; - section: number; - }, currentIndex: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => U_2, initialValue: U_2): U_2; - } | { - (predicate: (this: void, value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, obj: { - from: string; - to: string; - display: string; - section: number; - }[]) => value is S_1, thisArg?: any): S_1 | undefined; - (predicate: (value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, obj: { - from: string; - to: string; - display: string; - section: number; - }[]) => unknown, thisArg?: any): { - from: string; - to: string; - display: string; - section: number; - } | undefined; - } | ((predicate: (value: { + }[]) => { + from: string; + to: string; + display: string; + section: number; + }): { + from: string; + to: string; + display: string; + section: number; + }; + (callbackfn: (previousValue: { + from: string; + to: string; + display: string; + section: number; + }, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => { + from: string; + to: string; + display: string; + section: number; + }, initialValue: { + from: string; + to: string; + display: string; + section: number; + }): { + from: string; + to: string; + display: string; + section: number; + }; + (callbackfn: (previousValue: U_1, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => U_1, initialValue: U_1): U_1; +} | { + (callbackfn: (previousValue: { + from: string; + to: string; + display: string; + section: number; + }, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => { + from: string; + to: string; + display: string; + section: number; + }): { + from: string; + to: string; + display: string; + section: number; + }; + (callbackfn: (previousValue: { + from: string; + to: string; + display: string; + section: number; + }, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => { + from: string; + to: string; + display: string; + section: number; + }, initialValue: { + from: string; + to: string; + display: string; + section: number; + }): { + from: string; + to: string; + display: string; + section: number; + }; + (callbackfn: (previousValue: U_2, currentValue: { + from: string; + to: string; + display: string; + section: number; + }, currentIndex: number, array: { + from: string; + to: string; + display: string; + section: number; + }[]) => U_2, initialValue: U_2): U_2; +} | { + (predicate: (this: void, value: { from: string; to: string; display: string; @@ -802,55 +775,82 @@ const { getRelativeTimesList } = rangeUtil; to: string; display: string; section: number; - }[]) => unknown, thisArg?: any) => number) | ((value: { + }[]) => value is S_1, thisArg?: any): S_1 | undefined; + (predicate: (value: { from: string; to: string; display: string; section: number; - }, start?: number | undefined, end?: number | undefined) => { + }, index: number, obj: { from: string; to: string; display: string; section: number; - }[]) | ((target: number, start: number, end?: number | undefined) => { + }[]) => unknown, thisArg?: any): { from: string; to: string; display: string; section: number; - }[]) | (() => IterableIterator<[number, { - from: string; - to: string; - display: string; - section: number; - }]>) | (() => IterableIterator) | (() => IterableIterator<{ - from: string; - to: string; - display: string; - section: number; - }>) | ((searchElement: { - from: string; - to: string; - display: string; - section: number; - }, fromIndex?: number | undefined) => boolean) | ((callback: (this: This, value: { - from: string; - to: string; - display: string; - section: number; - }, index: number, array: { - from: string; - to: string; - display: string; - section: number; - }[]) => U_3 | readonly U_3[], thisArg?: This | undefined) => U_3[]) | { - (this: U_4[][][][][][][][], depth: 7): U_4[]; - (this: U_5[][][][][][][], depth: 6): U_5[]; - (this: U_6[][][][][][], depth: 5): U_6[]; - (this: U_7[][][][][], depth: 4): U_7[]; - (this: U_8[][][][], depth: 3): U_8[]; - (this: U_9[][][], depth: 2): U_9[]; - (this: U_10[][], depth?: 1 | undefined): U_10[]; - (this: U_11[], depth: 0): U_11[]; - (depth?: number | undefined): any[]; - })[]>` + } | undefined; +} | ((predicate: (value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, obj: { + from: string; + to: string; + display: string; + section: number; +}[]) => unknown, thisArg?: any) => number) | ((value: { + from: string; + to: string; + display: string; + section: number; +}, start?: number | undefined, end?: number | undefined) => { + from: string; + to: string; + display: string; + section: number; +}[]) | ((target: number, start: number, end?: number | undefined) => { + from: string; + to: string; + display: string; + section: number; +}[]) | (() => IterableIterator<[number, { + from: string; + to: string; + display: string; + section: number; +}]>) | (() => IterableIterator) | (() => IterableIterator<{ + from: string; + to: string; + display: string; + section: number; +}>) | ((searchElement: { + from: string; + to: string; + display: string; + section: number; +}, fromIndex?: number | undefined) => boolean) | ((callback: (this: This, value: { + from: string; + to: string; + display: string; + section: number; +}, index: number, array: { + from: string; + to: string; + display: string; + section: number; +}[]) => U_3 | readonly U_3[], thisArg?: This | undefined) => U_3[]) | { + (this: U_4[][][][][][][][], depth: 7): U_4[]; + (this: U_5[][][][][][][], depth: 6): U_5[]; + (this: U_6[][][][][][], depth: 5): U_6[]; + (this: U_7[][][][][], depth: 4): U_7[]; + (this: U_8[][][][], depth: 3): U_8[]; + (this: U_9[][][], depth: 2): U_9[]; + (this: U_10[][], depth?: 1 | undefined): U_10[]; + (this: U_11[], depth: 0): U_11[]; + (depth?: number | undefined): any[]; +})[]>` diff --git a/docs/sources/packages_api/data/fielddisplayoptions.md b/docs/sources/packages_api/data/reducedataoptions.md similarity index 58% rename from docs/sources/packages_api/data/fielddisplayoptions.md rename to docs/sources/packages_api/data/reducedataoptions.md index 35d404ea950..378d009f47a 100644 --- a/docs/sources/packages_api/data/fielddisplayoptions.md +++ b/docs/sources/packages_api/data/reducedataoptions.md @@ -2,34 +2,38 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "FieldDisplayOptions" +title = "ReduceDataOptions" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ -## FieldDisplayOptions interface +## ReduceDataOptions interface + +Options for how to turn DataFrames into an array of display values Signature ```typescript -export interface FieldDisplayOptions extends FieldConfigSource +export interface ReduceDataOptions ``` Import ```typescript -import { FieldDisplayOptions } from '@grafana/data'; +import { ReduceDataOptions } from '@grafana/data'; ``` Properties | Property | Type | Description | | --- | --- | --- | -| [calcs](#calcs-property) | string[] | | -| [limit](#limit-property) | number | | +| [calcs](#calcs-property) | string[] | When !values, pick one value for the whole field | +| [limit](#limit-property) | number | if showing all values limit | | [values](#values-property) | boolean | | ### calcs property +When !values, pick one value for the whole field + Signature ```typescript @@ -38,6 +42,8 @@ calcs: string[]; ### limit property +if showing all values limit + Signature ```typescript diff --git a/docs/sources/packages_api/data/registry.md b/docs/sources/packages_api/data/registry.md index 272db9ad40b..b1ba3f93fd4 100644 --- a/docs/sources/packages_api/data/registry.md +++ b/docs/sources/packages_api/data/registry.md @@ -38,6 +38,7 @@ import { Registry } from '@grafana/data'; | --- | --- | --- | | [get(id)](#get-method) | | | | [getIfExists(id)](#getifexists-method) | | | +| [isEmpty()](#isempty-method) | | | | [list(ids)](#list-method) | | Return a list of values by ID, or all values if not specified | | [register(ext)](#register-method) | | | | [selectOptions(current, filter)](#selectoptions-method) | | | @@ -99,6 +100,17 @@ getIfExists(id: string | undefined): T | undefined; `T | undefined` +### isEmpty method + +Signature + +```typescript +isEmpty(): boolean; +``` +Returns: + +`boolean` + ### list method Return a list of values by ID, or all values if not specified diff --git a/docs/sources/packages_api/data/registryitem.md b/docs/sources/packages_api/data/registryitem.md index 4bdabf65547..d36bab2981a 100644 --- a/docs/sources/packages_api/data/registryitem.md +++ b/docs/sources/packages_api/data/registryitem.md @@ -43,7 +43,7 @@ aliasIds?: string[]; Signature ```typescript -description: string; +description?: string; ``` ### excludeFromPicker property diff --git a/docs/sources/packages_api/data/selectfieldconfigsettings.md b/docs/sources/packages_api/data/selectfieldconfigsettings.md new file mode 100644 index 00000000000..39a811215c2 --- /dev/null +++ b/docs/sources/packages_api/data/selectfieldconfigsettings.md @@ -0,0 +1,35 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "SelectFieldConfigSettings" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## SelectFieldConfigSettings interface + +Signature + +```typescript +export interface SelectFieldConfigSettings +``` +Import + +```typescript +import { SelectFieldConfigSettings } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [options](#options-property) | Array<SelectableValue<T>> | | + +### options property + +Signature + +```typescript +options: Array>; +``` diff --git a/docs/sources/packages_api/data/selectoverrideprocessor.md b/docs/sources/packages_api/data/selectoverrideprocessor.md new file mode 100644 index 00000000000..258ba2337c3 --- /dev/null +++ b/docs/sources/packages_api/data/selectoverrideprocessor.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "selectOverrideProcessor" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## selectOverrideProcessor variable + +### selectOverrideProcessor variable + +Signature + +```typescript +selectOverrideProcessor: (value: any, _context: FieldOverrideContext, _settings?: SelectFieldConfigSettings | undefined) => any +``` +Import + +```typescript +import { selectOverrideProcessor } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/seriestocolumnsoptions.md b/docs/sources/packages_api/data/seriestocolumnsoptions.md new file mode 100644 index 00000000000..43f4babf016 --- /dev/null +++ b/docs/sources/packages_api/data/seriestocolumnsoptions.md @@ -0,0 +1,35 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "SeriesToColumnsOptions" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## SeriesToColumnsOptions interface + +Signature + +```typescript +export interface SeriesToColumnsOptions +``` +Import + +```typescript +import { SeriesToColumnsOptions } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [byField](#byfield-property) | string | | + +### byField property + +Signature + +```typescript +byField?: string; +``` diff --git a/docs/sources/packages_api/data/standardeditorprops.md b/docs/sources/packages_api/data/standardeditorprops.md new file mode 100644 index 00000000000..c20edca2dbc --- /dev/null +++ b/docs/sources/packages_api/data/standardeditorprops.md @@ -0,0 +1,53 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "StandardEditorProps" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## StandardEditorProps interface + +Signature + +```typescript +export interface StandardEditorProps +``` +Import + +```typescript +import { StandardEditorProps } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [item](#item-property) | StandardEditorsRegistryItem<TValue, TSettings> | | +| [onChange](#onchange-property) | (value?: TValue) => void | | +| [value](#value-property) | TValue | | + +### item property + +Signature + +```typescript +item: StandardEditorsRegistryItem; +``` + +### onChange property + +Signature + +```typescript +onChange: (value?: TValue) => void; +``` + +### value property + +Signature + +```typescript +value: TValue; +``` diff --git a/docs/sources/packages_api/data/fieldconfigeditorregistry.md b/docs/sources/packages_api/data/standardeditorsregistry.md similarity index 59% rename from docs/sources/packages_api/data/fieldconfigeditorregistry.md rename to docs/sources/packages_api/data/standardeditorsregistry.md index 5f69f701399..8ecbcef9efe 100644 --- a/docs/sources/packages_api/data/fieldconfigeditorregistry.md +++ b/docs/sources/packages_api/data/standardeditorsregistry.md @@ -2,23 +2,23 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "FieldConfigEditorRegistry" +title = "standardEditorsRegistry" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ -## FieldConfigEditorRegistry type +## standardEditorsRegistry variable -### FieldConfigEditorRegistry type +### standardEditorsRegistry variable Signature ```typescript -export declare type FieldConfigEditorRegistry = Registry; +standardEditorsRegistry: Registry> ``` Import ```typescript -import { FieldConfigEditorRegistry } from '@grafana/data'; +import { standardEditorsRegistry } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/data/standardeditorsregistryitem.md b/docs/sources/packages_api/data/standardeditorsregistryitem.md new file mode 100644 index 00000000000..fb389c15914 --- /dev/null +++ b/docs/sources/packages_api/data/standardeditorsregistryitem.md @@ -0,0 +1,44 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "StandardEditorsRegistryItem" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## StandardEditorsRegistryItem interface + +Signature + +```typescript +export interface StandardEditorsRegistryItem extends RegistryItem +``` +Import + +```typescript +import { StandardEditorsRegistryItem } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [editor](#editor-property) | ComponentType<StandardEditorProps<TValue, TSettings>> | | +| [settings](#settings-property) | TSettings | | + +### editor property + +Signature + +```typescript +editor: ComponentType>; +``` + +### settings property + +Signature + +```typescript +settings?: TSettings; +``` diff --git a/docs/sources/packages_api/data/standardfieldconfigeditorregistry.md b/docs/sources/packages_api/data/standardfieldconfigeditorregistry.md new file mode 100644 index 00000000000..bb1cbc0bde6 --- /dev/null +++ b/docs/sources/packages_api/data/standardfieldconfigeditorregistry.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "standardFieldConfigEditorRegistry" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## standardFieldConfigEditorRegistry variable + +### standardFieldConfigEditorRegistry variable + +Signature + +```typescript +standardFieldConfigEditorRegistry: FieldConfigOptionsRegistry +``` +Import + +```typescript +import { standardFieldConfigEditorRegistry } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/standardtransformers.md b/docs/sources/packages_api/data/standardtransformers.md new file mode 100644 index 00000000000..0ea82097c37 --- /dev/null +++ b/docs/sources/packages_api/data/standardtransformers.md @@ -0,0 +1,37 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "standardTransformers" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## standardTransformers variable + +### standardTransformers variable + +Signature + +```typescript +standardTransformers: { + noopTransformer: import("..").DataTransformerInfo; + filterFieldsTransformer: import("..").DataTransformerInfo; + filterFieldsByNameTransformer: import("..").DataTransformerInfo; + filterFramesTransformer: import("..").DataTransformerInfo; + filterFramesByRefIdTransformer: import("..").DataTransformerInfo; + orderFieldsTransformer: import("..").DataTransformerInfo; + organizeFieldsTransformer: import("..").DataTransformerInfo; + appendTransformer: import("..").DataTransformerInfo; + reduceTransformer: import("..").DataTransformerInfo; + calculateFieldTransformer: import("..").DataTransformerInfo; + seriesToColumnsTransformer: import("..").DataTransformerInfo; + renameFieldsTransformer: import("..").DataTransformerInfo; +} +``` +Import + +```typescript +import { standardTransformers } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/standardtransformersregistry.md b/docs/sources/packages_api/data/standardtransformersregistry.md new file mode 100644 index 00000000000..fa4ad5e6cd2 --- /dev/null +++ b/docs/sources/packages_api/data/standardtransformersregistry.md @@ -0,0 +1,26 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "standardTransformersRegistry" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## standardTransformersRegistry variable + +### standardTransformersRegistry variable + +Registry of transformation options that can be driven by stored configuration files. + +Signature + +```typescript +standardTransformersRegistry: Registry> +``` +Import + +```typescript +import { standardTransformersRegistry } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/ui/stringfieldconfigsettings.md b/docs/sources/packages_api/data/stringfieldconfigsettings.md similarity index 68% rename from docs/sources/packages_api/ui/stringfieldconfigsettings.md rename to docs/sources/packages_api/data/stringfieldconfigsettings.md index 22118b772d9..6910388884d 100644 --- a/docs/sources/packages_api/ui/stringfieldconfigsettings.md +++ b/docs/sources/packages_api/data/stringfieldconfigsettings.md @@ -3,7 +3,7 @@ # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "StringFieldConfigSettings" -keywords = ["grafana","documentation","sdk","@grafana/ui"] +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ @@ -18,7 +18,7 @@ export interface StringFieldConfigSettings Import ```typescript -import { StringFieldConfigSettings } from '@grafana/ui'; +import { StringFieldConfigSettings } from '@grafana/data'; ``` Properties @@ -27,6 +27,8 @@ import { StringFieldConfigSettings } from '@grafana/ui'; | [expandTemplateVars](#expandtemplatevars-property) | boolean | | | [maxLength](#maxlength-property) | number | | | [placeholder](#placeholder-property) | string | | +| [rows](#rows-property) | number | | +| [useTextarea](#usetextarea-property) | boolean | | ### expandTemplateVars property @@ -51,3 +53,19 @@ maxLength?: number; ```typescript placeholder?: string; ``` + +### rows property + +Signature + +```typescript +rows?: number; +``` + +### useTextarea property + +Signature + +```typescript +useTextarea?: boolean; +``` diff --git a/docs/sources/packages_api/ui/stringoverrideprocessor.md b/docs/sources/packages_api/data/stringoverrideprocessor.md similarity index 71% rename from docs/sources/packages_api/ui/stringoverrideprocessor.md rename to docs/sources/packages_api/data/stringoverrideprocessor.md index 49292077ed1..45f03589785 100644 --- a/docs/sources/packages_api/ui/stringoverrideprocessor.md +++ b/docs/sources/packages_api/data/stringoverrideprocessor.md @@ -3,7 +3,7 @@ # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "stringOverrideProcessor" -keywords = ["grafana","documentation","sdk","@grafana/ui"] +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ @@ -15,10 +15,10 @@ draft = true Signature ```typescript -stringOverrideProcessor: (value: any, context: FieldOverrideContext, settings: StringFieldConfigSettings) => string +stringOverrideProcessor: (value: any, context: FieldOverrideContext, settings?: StringFieldConfigSettings | undefined) => any ``` Import ```typescript -import { stringOverrideProcessor } from '@grafana/ui'; +import { stringOverrideProcessor } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/data/textutil.md b/docs/sources/packages_api/data/textutil.md new file mode 100644 index 00000000000..2c9751d4df3 --- /dev/null +++ b/docs/sources/packages_api/data/textutil.md @@ -0,0 +1,29 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "textUtil" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## textUtil variable + +### textUtil variable + +Signature + +```typescript +textUtil: { + escapeHtml: typeof escapeHtml; + hasAnsiCodes: typeof hasAnsiCodes; + sanitize: typeof sanitize; + sanitizeUrl: typeof sanitizeUrl; +} +``` +Import + +```typescript +import { textUtil } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/threshold.md b/docs/sources/packages_api/data/threshold.md index d297f5c40db..c9c4a6f1cbb 100644 --- a/docs/sources/packages_api/data/threshold.md +++ b/docs/sources/packages_api/data/threshold.md @@ -25,7 +25,7 @@ import { Threshold } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | | [color](#color-property) | string | | -| [state](#state-property) | string | | +| [state](#state-property) | string | Warning, Error, LowLow, Low, OK, High, HighHigh etc | | [value](#value-property) | number | | ### color property @@ -38,6 +38,8 @@ color: string; ### state property +Warning, Error, LowLow, Low, OK, High, HighHigh etc + Signature ```typescript diff --git a/docs/sources/packages_api/data/thresholdsconfig.md b/docs/sources/packages_api/data/thresholdsconfig.md index 01acd0705c1..224781530ac 100644 --- a/docs/sources/packages_api/data/thresholdsconfig.md +++ b/docs/sources/packages_api/data/thresholdsconfig.md @@ -10,6 +10,8 @@ draft = true ## ThresholdsConfig interface +Config that is passed to the ThresholdsEditor + Signature ```typescript @@ -25,7 +27,7 @@ import { ThresholdsConfig } from '@grafana/data'; | Property | Type | Description | | --- | --- | --- | | [mode](#mode-property) | ThresholdsMode | | -| [steps](#steps-property) | Threshold[] | | +| [steps](#steps-property) | Threshold[] | Must be sorted by 'value', first value is always -Infinity | ### mode property @@ -37,6 +39,8 @@ mode: ThresholdsMode; ### steps property +Must be sorted by 'value', first value is always -Infinity + Signature ```typescript diff --git a/docs/sources/packages_api/data/thresholdsfieldconfigsettings.md b/docs/sources/packages_api/data/thresholdsfieldconfigsettings.md new file mode 100644 index 00000000000..f4dff721d59 --- /dev/null +++ b/docs/sources/packages_api/data/thresholdsfieldconfigsettings.md @@ -0,0 +1,22 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ThresholdsFieldConfigSettings" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## ThresholdsFieldConfigSettings interface + +Signature + +```typescript +export interface ThresholdsFieldConfigSettings +``` +Import + +```typescript +import { ThresholdsFieldConfigSettings } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/thresholdsmode.md b/docs/sources/packages_api/data/thresholdsmode.md index df7c9e30964..e9d7d360498 100644 --- a/docs/sources/packages_api/data/thresholdsmode.md +++ b/docs/sources/packages_api/data/thresholdsmode.md @@ -12,6 +12,8 @@ draft = true ### ThresholdsMode enum +Display mode + Signature ```typescript @@ -28,5 +30,5 @@ import { ThresholdsMode } from '@grafana/data'; | Member | Value | Description | | --- | --- | --- | | Absolute | "absolute" | | -| Percentage | "percentage" | | +| Percentage | "percentage" | between 0 and 1 (based on min/max) | diff --git a/docs/sources/packages_api/data/thresholdsoverrideprocessor.md b/docs/sources/packages_api/data/thresholdsoverrideprocessor.md new file mode 100644 index 00000000000..b0d7344ac51 --- /dev/null +++ b/docs/sources/packages_api/data/thresholdsoverrideprocessor.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "thresholdsOverrideProcessor" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## thresholdsOverrideProcessor variable + +### thresholdsOverrideProcessor variable + +Signature + +```typescript +thresholdsOverrideProcessor: (value: any, _context: FieldOverrideContext, _settings?: ThresholdsFieldConfigSettings | undefined) => ThresholdsConfig +``` +Import + +```typescript +import { thresholdsOverrideProcessor } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/tolegacyresponsedata.md b/docs/sources/packages_api/data/tolegacyresponsedata.md index a1ab2234a54..1b270f92526 100644 --- a/docs/sources/packages_api/data/tolegacyresponsedata.md +++ b/docs/sources/packages_api/data/tolegacyresponsedata.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -toLegacyResponseData: (frame: DataFrame) => TableData | TimeSeries +toLegacyResponseData: (frame: DataFrame) => TimeSeries | TableData ``` Import diff --git a/docs/sources/packages_api/data/transformersregistry.md b/docs/sources/packages_api/data/topascalcase.md similarity index 64% rename from docs/sources/packages_api/data/transformersregistry.md rename to docs/sources/packages_api/data/topascalcase.md index a21e1c9df2a..214403742bb 100644 --- a/docs/sources/packages_api/data/transformersregistry.md +++ b/docs/sources/packages_api/data/topascalcase.md @@ -2,23 +2,23 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "transformersRegistry" +title = "toPascalCase" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ -## transformersRegistry variable +## toPascalCase variable -### transformersRegistry variable +### toPascalCase variable Signature ```typescript -transformersRegistry: TransformerRegistry +toPascalCase: (string: string) => string ``` Import ```typescript -import { transformersRegistry } from '@grafana/data'; +import { toPascalCase } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/data/transformerregistyitem.md b/docs/sources/packages_api/data/transformerregistyitem.md new file mode 100644 index 00000000000..eea6f057e5c --- /dev/null +++ b/docs/sources/packages_api/data/transformerregistyitem.md @@ -0,0 +1,48 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "TransformerRegistyItem" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## TransformerRegistyItem interface + +Signature + +```typescript +export interface TransformerRegistyItem extends RegistryItem +``` +Import + +```typescript +import { TransformerRegistyItem } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [editor](#editor-property) | React.ComponentType<TransformerUIProps<TOptions>> | React component used as UI for the transformer | +| [transformation](#transformation-property) | DataTransformerInfo<TOptions> | Object describing transformer configuration | + +### editor property + +React component used as UI for the transformer + +Signature + +```typescript +editor: React.ComponentType>; +``` + +### transformation property + +Object describing transformer configuration + +Signature + +```typescript +transformation: DataTransformerInfo; +``` diff --git a/docs/sources/packages_api/data/transformeruiprops.md b/docs/sources/packages_api/data/transformeruiprops.md new file mode 100644 index 00000000000..fa0d7d301fb --- /dev/null +++ b/docs/sources/packages_api/data/transformeruiprops.md @@ -0,0 +1,57 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "TransformerUIProps" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## TransformerUIProps interface + +Signature + +```typescript +export interface TransformerUIProps +``` +Import + +```typescript +import { TransformerUIProps } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [input](#input-property) | DataFrame[] | Pre-transform data rames | +| [onChange](#onchange-property) | (options: T) => void | | +| [options](#options-property) | T | Transformer configuration, persisted on panel's model | + +### input property + +Pre-transform data rames + +Signature + +```typescript +input: DataFrame[]; +``` + +### onChange property + +Signature + +```typescript +onChange: (options: T) => void; +``` + +### options property + +Transformer configuration, persisted on panel's model + +Signature + +```typescript +options: T; +``` diff --git a/docs/sources/packages_api/runtime/systemjs.md b/docs/sources/packages_api/data/unitfieldconfigsettings.md similarity index 56% rename from docs/sources/packages_api/runtime/systemjs.md rename to docs/sources/packages_api/data/unitfieldconfigsettings.md index 0bd4bf7891f..4d862b62bcb 100644 --- a/docs/sources/packages_api/runtime/systemjs.md +++ b/docs/sources/packages_api/data/unitfieldconfigsettings.md @@ -2,23 +2,21 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "SystemJS" -keywords = ["grafana","documentation","sdk","@grafana/runtime"] +title = "UnitFieldConfigSettings" +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ -## SystemJS variable - -### SystemJS variable +## UnitFieldConfigSettings interface Signature ```typescript -SystemJS: any +export interface UnitFieldConfigSettings ``` Import ```typescript -import { SystemJS } from '@grafana/runtime'; +import { UnitFieldConfigSettings } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/data/unitoverrideprocessor.md b/docs/sources/packages_api/data/unitoverrideprocessor.md new file mode 100644 index 00000000000..92830a300d4 --- /dev/null +++ b/docs/sources/packages_api/data/unitoverrideprocessor.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "unitOverrideProcessor" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## unitOverrideProcessor variable + +### unitOverrideProcessor variable + +Signature + +```typescript +unitOverrideProcessor: (value: boolean, _context: FieldOverrideContext, _settings?: UnitFieldConfigSettings | undefined) => boolean +``` +Import + +```typescript +import { unitOverrideProcessor } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/updatedatasourcepluginresetoption.md b/docs/sources/packages_api/data/updatedatasourcepluginresetoption.md index b450ff4cb00..1f8900a2d74 100644 --- a/docs/sources/packages_api/data/updatedatasourcepluginresetoption.md +++ b/docs/sources/packages_api/data/updatedatasourcepluginresetoption.md @@ -8,28 +8,17 @@ type = "docs" draft = true +++ -## updateDatasourcePluginResetOption() function +## updateDatasourcePluginResetOption variable -### updateDatasourcePluginResetOption() function +### updateDatasourcePluginResetOption variable Signature ```typescript -export declare function updateDatasourcePluginResetOption(props: DataSourcePluginOptionsEditorProps, key: string): void; +updateDatasourcePluginResetOption: >(props: DataSourcePluginOptionsEditorProps, key: string) => void ``` Import ```typescript import { updateDatasourcePluginResetOption } from '@grafana/data'; ``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| props | DataSourcePluginOptionsEditorProps | | -| key | string | | - -Returns: - -`void` - diff --git a/docs/sources/packages_api/runtime/urlquerymap.md b/docs/sources/packages_api/data/urlquerymap.md similarity index 70% rename from docs/sources/packages_api/runtime/urlquerymap.md rename to docs/sources/packages_api/data/urlquerymap.md index 6afaf1165bd..751ee256650 100644 --- a/docs/sources/packages_api/runtime/urlquerymap.md +++ b/docs/sources/packages_api/data/urlquerymap.md @@ -3,7 +3,7 @@ # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "UrlQueryMap" -keywords = ["grafana","documentation","sdk","@grafana/runtime"] +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ @@ -12,6 +12,8 @@ draft = true ### UrlQueryMap type +Type to represent the values parsed from the query string. + Signature ```typescript @@ -20,5 +22,5 @@ export declare type UrlQueryMap = Record; Import ```typescript -import { UrlQueryMap } from '@grafana/runtime'; +import { UrlQueryMap } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/runtime/urlqueryvalue.md b/docs/sources/packages_api/data/urlqueryvalue.md similarity index 72% rename from docs/sources/packages_api/runtime/urlqueryvalue.md rename to docs/sources/packages_api/data/urlqueryvalue.md index a43fabcd0b4..a7755fd390b 100644 --- a/docs/sources/packages_api/runtime/urlqueryvalue.md +++ b/docs/sources/packages_api/data/urlqueryvalue.md @@ -3,7 +3,7 @@ # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "UrlQueryValue" -keywords = ["grafana","documentation","sdk","@grafana/runtime"] +keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" draft = true +++ @@ -12,6 +12,8 @@ draft = true ### UrlQueryValue type +Type to represent the value of a single query variable. + Signature ```typescript @@ -20,5 +22,5 @@ export declare type UrlQueryValue = string | number | boolean | string[] | numbe Import ```typescript -import { UrlQueryValue } from '@grafana/runtime'; +import { UrlQueryValue } from '@grafana/data'; ``` diff --git a/docs/sources/packages_api/data/urlutil.md b/docs/sources/packages_api/data/urlutil.md new file mode 100644 index 00000000000..2c33268a411 --- /dev/null +++ b/docs/sources/packages_api/data/urlutil.md @@ -0,0 +1,29 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "urlUtil" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## urlUtil variable + +### urlUtil variable + +Signature + +```typescript +urlUtil: { + renderUrl: typeof renderUrl; + toUrlParams: typeof toUrlParams; + appendQueryToUrl: typeof appendQueryToUrl; + getUrlSearchParams: typeof getUrlSearchParams; +} +``` +Import + +```typescript +import { urlUtil } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/valueconverter.md b/docs/sources/packages_api/data/valueconverter.md new file mode 100644 index 00000000000..b382b4e16fd --- /dev/null +++ b/docs/sources/packages_api/data/valueconverter.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ValueConverter" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## ValueConverter type + +### ValueConverter type + +Signature + +```typescript +export declare type ValueConverter = (val: any) => T; +``` +Import + +```typescript +import { ValueConverter } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/valuelinkconfig.md b/docs/sources/packages_api/data/valuelinkconfig.md new file mode 100644 index 00000000000..5b73343c60b --- /dev/null +++ b/docs/sources/packages_api/data/valuelinkconfig.md @@ -0,0 +1,48 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ValueLinkConfig" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## ValueLinkConfig interface + +Signature + +```typescript +export interface ValueLinkConfig +``` +Import + +```typescript +import { ValueLinkConfig } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [calculatedValue](#calculatedvalue-property) | DisplayValue | Result of field reduction | +| [valueRowIndex](#valuerowindex-property) | number | Index of the value row within Field. Should be provided only when value is not a result of a reduction | + +### calculatedValue property + +Result of field reduction + +Signature + +```typescript +calculatedValue?: DisplayValue; +``` + +### valueRowIndex property + +Index of the value row within Field. Should be provided only when value is not a result of a reduction + +Signature + +```typescript +valueRowIndex?: number; +``` diff --git a/docs/sources/packages_api/data/valuemappingfieldconfigsettings.md b/docs/sources/packages_api/data/valuemappingfieldconfigsettings.md new file mode 100644 index 00000000000..79efb025fc2 --- /dev/null +++ b/docs/sources/packages_api/data/valuemappingfieldconfigsettings.md @@ -0,0 +1,22 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ValueMappingFieldConfigSettings" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## ValueMappingFieldConfigSettings interface + +Signature + +```typescript +export interface ValueMappingFieldConfigSettings +``` +Import + +```typescript +import { ValueMappingFieldConfigSettings } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/valuemappingsoverrideprocessor.md b/docs/sources/packages_api/data/valuemappingsoverrideprocessor.md new file mode 100644 index 00000000000..fe1a82325e0 --- /dev/null +++ b/docs/sources/packages_api/data/valuemappingsoverrideprocessor.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "valueMappingsOverrideProcessor" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## valueMappingsOverrideProcessor variable + +### valueMappingsOverrideProcessor variable + +Signature + +```typescript +valueMappingsOverrideProcessor: (value: any, _context: FieldOverrideContext, _settings?: ValueMappingFieldConfigSettings | undefined) => ValueMapping[] +``` +Import + +```typescript +import { valueMappingsOverrideProcessor } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/variablemodel.md b/docs/sources/packages_api/data/variablemodel.md new file mode 100644 index 00000000000..bf98fbfea3b --- /dev/null +++ b/docs/sources/packages_api/data/variablemodel.md @@ -0,0 +1,53 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "VariableModel" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## VariableModel interface + +Signature + +```typescript +export interface VariableModel +``` +Import + +```typescript +import { VariableModel } from '@grafana/data'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [label](#label-property) | string | null | | +| [name](#name-property) | string | | +| [type](#type-property) | VariableType | | + +### label property + +Signature + +```typescript +label: string | null; +``` + +### name property + +Signature + +```typescript +name: string; +``` + +### type property + +Signature + +```typescript +type: VariableType; +``` diff --git a/docs/sources/packages_api/data/variabletype.md b/docs/sources/packages_api/data/variabletype.md new file mode 100644 index 00000000000..f2ac8a0556f --- /dev/null +++ b/docs/sources/packages_api/data/variabletype.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "VariableType" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## VariableType type + +### VariableType type + +Signature + +```typescript +export declare type VariableType = 'query' | 'adhoc' | 'constant' | 'datasource' | 'interval' | 'textbox' | 'custom'; +``` +Import + +```typescript +import { VariableType } from '@grafana/data'; +``` diff --git a/docs/sources/packages_api/data/vectorator.md b/docs/sources/packages_api/data/vectorator.md new file mode 100644 index 00000000000..06d1901765d --- /dev/null +++ b/docs/sources/packages_api/data/vectorator.md @@ -0,0 +1,46 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "vectorator" +keywords = ["grafana","documentation","sdk","@grafana/data"] +type = "docs" +draft = true ++++ + +## vectorator() function + +### vectorator() function + +Use functional programming with your vector + +Signature + +```typescript +export declare function vectorator(vector: Vector): { + [Symbol.iterator](): Generator; + forEach(iterator: (row: T) => void): void; + map(transform: (item: T, index: number) => V): V[]; + filter(predicate: (item: T) => V_1): T[]; +}; +``` +Import + +```typescript +import { vectorator } from '@grafana/data'; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| vector | Vector<T> | | + +Returns: + +`{ + [Symbol.iterator](): Generator; + forEach(iterator: (row: T) => void): void; + map(transform: (item: T, index: number) => V): V[]; + filter(predicate: (item: T) => V_1): T[]; +}` + diff --git a/docs/sources/packages_api/runtime/_index.md b/docs/sources/packages_api/runtime/_index.md index a61364f4f99..772222d1335 100644 --- a/docs/sources/packages_api/runtime/_index.md +++ b/docs/sources/packages_api/runtime/_index.md @@ -16,63 +16,65 @@ A library containing services, configurations etc. used to interact with the Gra | Class | Description | | --- | --- | -| [DataSourceWithBackend](./datasourcewithbackend/) | | +| [DataSourceWithBackend](./datasourcewithbackend/) | Extend this class to implement a data source plugin that is depending on the Grafana backend API. | | [GrafanaBootConfig](./grafanabootconfig/) | | ## Enumerations | Enumeration | Description | | --- | --- | -| [EchoEventType](./echoeventtype/) | | +| [EchoEventType](./echoeventtype/) | Supported echo event types that can be sent via the [EchoSrv](./runtime/echosrv.md). | +| [HealthStatus](./healthstatus/) | Describes the current healt status of a data source plugin. | +| [MetaAnalyticsEventName](./metaanalyticseventname/) | The meta analytics events that can be added to the echo service. | ## Functions | Function | Description | | --- | --- | -| [getAngularLoader()](./getangularloader/) | | -| [getDataSourceSrv()](./getdatasourcesrv/) | | -| [getEchoSrv()](./getechosrv/) | | -| [getLocationSrv()](./getlocationsrv/) | | -| [loadPluginCss(options)](./loadplugincss/) | | -| [setAngularLoader(v)](./setangularloader/) | | -| [setDataSourceSrv(instance)](./setdatasourcesrv/) | | -| [setEchoSrv(instance)](./setechosrv/) | | -| [setLocationSrv(instance)](./setlocationsrv/) | | +| [getAngularLoader()](./getangularloader/) | Used to retrieve the [AngularLoader](./runtime/angularloader.md) that enables the use of Angular components within a React component.Please see the [AngularComponent](./runtime/angularcomponent.md) for a proper example. | +| [getDataSourceSrv()](./getdatasourcesrv/) | Used to retrieve the [DataSourceSrv](./runtime/datasourcesrv.md) that is the entry point for communicating with a datasource that is added as a plugin (both external and internal). | +| [getEchoSrv()](./getechosrv/) | Used to retrieve the [EchoSrv](./runtime/echosrv.md) that can be used to report events to registered echo backends. | +| [getLocationSrv()](./getlocationsrv/) | Used to retrieve the [LocationSrv](./runtime/locationsrv.md) that can be used to automatically navigate the user to a new place in Grafana. | +| [loadPluginCss(options)](./loadplugincss/) | Use this to load css for a Grafana plugin by specifying a [PluginCssOptions](./runtime/plugincssoptions.md) containing styling for the dark and the light theme. | ## Interfaces | Interface | Description | | --- | --- | -| [AngularComponent](./angularcomponent/) | | -| [AngularLoader](./angularloader/) | | -| [BackendSrv](./backendsrv/) | | -| [BuildInfo](./buildinfo/) | | -| [DataSourceSrv](./datasourcesrv/) | | -| [EchoBackend](./echobackend/) | | -| [EchoEvent](./echoevent/) | | -| [EchoMeta](./echometa/) | | -| [EchoSrv](./echosrv/) | | -| [LocationSrv](./locationsrv/) | | +| [AngularComponent](./angularcomponent/) | Used to enable rendering of Angular components within a React component without losing proper typings. | +| [AngularLoader](./angularloader/) | Used to load an Angular component from the context of a React component. Please see the [AngularComponent](./runtime/angularcomponent.md) for a proper example. | +| [BackendSrv](./backendsrv/) | Used to communicate via http(s) to a remote backend such as the Grafana backend, a datasource etc. The BackendSrv is using the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) under the hood to handle all the communication.The request function can be used to perform a remote call by specifying a [BackendSrvRequest](./runtime/backendsrvrequest.md). To make the BackendSrv a bit easier to use we have added a couple of shorthand functions that will use default values executing the request. | +| [DashboardInfo](./dashboardinfo/) | Describes the basic dashboard information that can be passed as the meta analytics payload. | +| [DashboardViewEventPayload](./dashboardvieweventpayload/) | Describes the payload of a dashboard view event. | +| [DataRequestEventPayload](./datarequesteventpayload/) | Describes the payload of a data request event. | +| [DataRequestInfo](./datarequestinfo/) | Describes the data request information passed as the meta analytics payload. | +| [DataSourceSrv](./datasourcesrv/) | This is the entry point for communicating with a datasource that is added as a plugin (both external and internal). Via this service you will get access to the [DataSourceApi](./data/datasourceapi.md) that have a rich API for communicating with the datasource. | +| [EchoBackend](./echobackend/) | Describes echo backends that can be registered to receive of events. | +| [EchoEvent](./echoevent/) | Describes an echo event. | +| [EchoMeta](./echometa/) | Describes the meta information that are sent together with each event. | +| [EchoSrv](./echosrv/) | Used to send events to all the registered backends. This should be accessed via the [getEchoSrv()](./runtime/getechosrv.md) function. Will, by default, flush events to the backends every 10s or when the flush function is triggered. | +| [HealthCheckResult](./healthcheckresult/) | Describes the payload returned when checking the health of a data source plugin. | +| [LocationSrv](./locationsrv/) | If you need to automatically navigate the user to a new place in the application this should be done via the LocationSrv and it will make sure to update the application state accordingly. | | [LocationUpdate](./locationupdate/) | | -| [MetaAnalyticsEvent](./metaanalyticsevent/) | | -| [MetaAnalyticsEventPayload](./metaanalyticseventpayload/) | | +| [MetaAnalyticsEvent](./metaanalyticsevent/) | Describes meta analytics event with predefined [EchoEventType.MetaAnalytics](./runtime/echoeventtype/metaanalytics.md) type. | +| [PluginCssOptions](./plugincssoptions/) | Option to specify a plugin css that should be applied for the dark and the light theme. | +| [SizeMeta](./sizemeta/) | Describes a size with width/height | +| [TemplateSrv](./templatesrv/) | Via the TemplateSrv consumers get access to all the available template variables that can be used within the current active dashboard.For a more in-depth description visit: https://grafana.com/docs/grafana/latest/reference/templating | ## Variables | Variable | Description | | --- | --- | -| [config](./config/) | | -| [getBackendSrv](./getbackendsrv/) | | -| [registerEchoBackend](./registerechobackend/) | | -| [reportMetaAnalytics](./reportmetaanalytics/) | | -| [setBackendSrv](./setbackendsrv/) | | -| [SystemJS](./systemjs/) | | +| [config](./config/) | Use this to access the [GrafanaBootConfig](./runtime/grafanabootconfig.md) for the current running Grafana instance. | +| [getBackendSrv](./getbackendsrv/) | Used to retrieve the [BackendSrv](./runtime/backendsrv.md) that can be used to communicate via http(s) to a remote backend such as the Grafana backend, a datasource etc. | +| [getTemplateSrv](./gettemplatesrv/) | Used to retrieve the [TemplateSrv](./runtime/templatesrv.md) that can be used to fetch available template variables. | +| [registerEchoBackend](./registerechobackend/) | Used to register echo backends that will receive Grafana echo events during application runtime. | +| [reportMetaAnalytics](./reportmetaanalytics/) | Helper function to report meta analytics to the [EchoSrv](./runtime/echosrv.md). | ## Type Aliases | Type Alias | Description | | --- | --- | -| [BackendSrvRequest](./backendsrvrequest/) | Currently implemented with: https://docs.angularjs.org/api/ng/service/$http\#usage but that will likely change in the future | -| [UrlQueryMap](./urlquerymap/) | | -| [UrlQueryValue](./urlqueryvalue/) | | +| [BackendSrvRequest](./backendsrvrequest/) | Used to initiate a remote call via the [BackendSrv](./runtime/backendsrv.md) | +| [MetaAnalyticsEventPayload](./metaanalyticseventpayload/) | Describes the meta analytics payload passed with the [MetaAnalyticsEvent](./runtime/metaanalyticsevent.md) | diff --git a/docs/sources/packages_api/runtime/angularcomponent.md b/docs/sources/packages_api/runtime/angularcomponent.md index b7fed6cc9bb..0cea2912640 100644 --- a/docs/sources/packages_api/runtime/angularcomponent.md +++ b/docs/sources/packages_api/runtime/angularcomponent.md @@ -10,6 +10,8 @@ draft = true ## AngularComponent interface +Used to enable rendering of Angular components within a React component without losing proper typings. + Signature ```typescript @@ -20,16 +22,49 @@ export interface AngularComponent ```typescript import { AngularComponent } from '@grafana/runtime'; ``` + +## Example + + +```typescript +class Component extends PureComponent { + element: HTMLElement; + angularComponent: AngularComponent; + + componentDidMount() { + const template = '' // angular template here; + const scopeProps = { ctrl: angularController }; // angular scope properties here + const loader = getAngularLoader(); + this.angularComponent = loader.load(this.element, scopeProps, template); + } + + componentWillUnmount() { + if (this.angularComponent) { + this.angularComponent.destroy(); + } + } + + render() { + return ( +
(this.element = element)} /> + ); + } +} + +``` + Methods | Method | Description | | --- | --- | -| [destroy()](#destroy-method) | | -| [digest()](#digest-method) | | -| [getScope()](#getscope-method) | | +| [destroy()](#destroy-method) | Should be called when the React component will unmount. | +| [digest()](#digest-method) | Can be used to trigger a re-render of the Angular component. | +| [getScope()](#getscope-method) | Used to access the Angular scope from the React component. | ### destroy method +Should be called when the React component will unmount. + Signature ```typescript @@ -41,6 +76,8 @@ destroy(): void; ### digest method +Can be used to trigger a re-render of the Angular component. + Signature ```typescript @@ -52,6 +89,8 @@ digest(): void; ### getScope method +Used to access the Angular scope from the React component. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/angularloader.md b/docs/sources/packages_api/runtime/angularloader.md index 1e58b224f70..98b7eaf824c 100644 --- a/docs/sources/packages_api/runtime/angularloader.md +++ b/docs/sources/packages_api/runtime/angularloader.md @@ -10,6 +10,8 @@ draft = true ## AngularLoader interface +Used to load an Angular component from the context of a React component. Please see the [AngularComponent](./runtime/angularcomponent.md) for a proper example. + Signature ```typescript @@ -37,9 +39,9 @@ load(elem: any, scopeProps: any, template: string): AngularComponent; | Parameter | Type | Description | | --- | --- | --- | -| elem | any | | -| scopeProps | any | | -| template | string | | +| elem | any | the element that the Angular component will be loaded into. | +| scopeProps | any | values that will be accessed via the Angular scope. | +| template | string | template used by the Angular component. | Returns: diff --git a/docs/sources/packages_api/runtime/backendsrv.md b/docs/sources/packages_api/runtime/backendsrv.md index 93151a1f2a6..462498a2941 100644 --- a/docs/sources/packages_api/runtime/backendsrv.md +++ b/docs/sources/packages_api/runtime/backendsrv.md @@ -10,6 +10,10 @@ draft = true ## BackendSrv interface +Used to communicate via http(s) to a remote backend such as the Grafana backend, a datasource etc. The BackendSrv is using the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) under the hood to handle all the communication. + +The request function can be used to perform a remote call by specifying a [BackendSrvRequest](./runtime/backendsrvrequest.md). To make the BackendSrv a bit easier to use we have added a couple of shorthand functions that will use default values executing the request. + Signature ```typescript @@ -20,11 +24,16 @@ export interface BackendSrv ```typescript import { BackendSrv } from '@grafana/runtime'; ``` + +## Remarks + +By default Grafana will display an error message alert if the remote call fails. If you want to prevent this from happending you need to catch the error thrown by the BackendSrv and set the `isHandled = true` on the incoming error. + Methods | Method | Description | | --- | --- | -| [datasourceRequest(options)](#datasourcerequest-method) | | +| [datasourceRequest(options)](#datasourcerequest-method) | Special function used to communicate with datasources that will emit core events that the Grafana QueryInspector and QueryEditor is listening for to be able to display datasource query information. Can be skipped by adding option.silent when initializing the request. | | [delete(url)](#delete-method) | | | [get(url, params, requestId)](#get-method) | | | [patch(url, data)](#patch-method) | | @@ -34,6 +43,8 @@ import { BackendSrv } from '@grafana/runtime'; ### datasourceRequest method +Special function used to communicate with datasources that will emit core events that the Grafana QueryInspector and QueryEditor is listening for to be able to display datasource query information. Can be skipped by adding `option.silent` when initializing the request. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/backendsrvrequest.md b/docs/sources/packages_api/runtime/backendsrvrequest.md index 033e9715160..fc9802b56c8 100644 --- a/docs/sources/packages_api/runtime/backendsrvrequest.md +++ b/docs/sources/packages_api/runtime/backendsrvrequest.md @@ -12,7 +12,7 @@ draft = true ### BackendSrvRequest type -Currently implemented with: https://docs.angularjs.org/api/ng/service/$http\#usage but that will likely change in the future +Used to initiate a remote call via the [BackendSrv](./runtime/backendsrv.md) Signature diff --git a/docs/sources/packages_api/runtime/config.md b/docs/sources/packages_api/runtime/config.md index 63cf67790fd..11026fd3a77 100644 --- a/docs/sources/packages_api/runtime/config.md +++ b/docs/sources/packages_api/runtime/config.md @@ -12,6 +12,8 @@ draft = true ### config variable +Use this to access the [GrafanaBootConfig](./runtime/grafanabootconfig.md) for the current running Grafana instance. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/dashboardinfo.md b/docs/sources/packages_api/runtime/dashboardinfo.md new file mode 100644 index 00000000000..24af610cfd0 --- /dev/null +++ b/docs/sources/packages_api/runtime/dashboardinfo.md @@ -0,0 +1,64 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "DashboardInfo" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## DashboardInfo interface + +Describes the basic dashboard information that can be passed as the meta analytics payload. + +Signature + +```typescript +export interface DashboardInfo +``` +Import + +```typescript +import { DashboardInfo } from '@grafana/runtime'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [dashboardId](#dashboardid-property) | number | | +| [dashboardName](#dashboardname-property) | string | | +| [dashboardUid](#dashboarduid-property) | string | | +| [folderName](#foldername-property) | string | | + +### dashboardId property + +Signature + +```typescript +dashboardId: number; +``` + +### dashboardName property + +Signature + +```typescript +dashboardName: string; +``` + +### dashboardUid property + +Signature + +```typescript +dashboardUid: string; +``` + +### folderName property + +Signature + +```typescript +folderName?: string; +``` diff --git a/docs/sources/packages_api/runtime/dashboardvieweventpayload.md b/docs/sources/packages_api/runtime/dashboardvieweventpayload.md new file mode 100644 index 00000000000..2227c30398f --- /dev/null +++ b/docs/sources/packages_api/runtime/dashboardvieweventpayload.md @@ -0,0 +1,37 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "DashboardViewEventPayload" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## DashboardViewEventPayload interface + +Describes the payload of a dashboard view event. + +Signature + +```typescript +export interface DashboardViewEventPayload extends DashboardInfo +``` +Import + +```typescript +import { DashboardViewEventPayload } from '@grafana/runtime'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [eventName](#eventname-property) | MetaAnalyticsEventName.DashboardView | | + +### eventName property + +Signature + +```typescript +eventName: MetaAnalyticsEventName.DashboardView; +``` diff --git a/docs/sources/packages_api/runtime/datarequesteventpayload.md b/docs/sources/packages_api/runtime/datarequesteventpayload.md new file mode 100644 index 00000000000..898f7522ddf --- /dev/null +++ b/docs/sources/packages_api/runtime/datarequesteventpayload.md @@ -0,0 +1,37 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "DataRequestEventPayload" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## DataRequestEventPayload interface + +Describes the payload of a data request event. + +Signature + +```typescript +export interface DataRequestEventPayload extends DataRequestInfo +``` +Import + +```typescript +import { DataRequestEventPayload } from '@grafana/runtime'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [eventName](#eventname-property) | MetaAnalyticsEventName.DataRequest | | + +### eventName property + +Signature + +```typescript +eventName: MetaAnalyticsEventName.DataRequest; +``` diff --git a/docs/sources/packages_api/runtime/datarequestinfo.md b/docs/sources/packages_api/runtime/datarequestinfo.md new file mode 100644 index 00000000000..4142fa1f7d3 --- /dev/null +++ b/docs/sources/packages_api/runtime/datarequestinfo.md @@ -0,0 +1,91 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "DataRequestInfo" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## DataRequestInfo interface + +Describes the data request information passed as the meta analytics payload. + +Signature + +```typescript +export interface DataRequestInfo extends Partial +``` +Import + +```typescript +import { DataRequestInfo } from '@grafana/runtime'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [dataSize](#datasize-property) | number | | +| [datasourceId](#datasourceid-property) | number | | +| [datasourceName](#datasourcename-property) | string | | +| [duration](#duration-property) | number | | +| [error](#error-property) | string | | +| [panelId](#panelid-property) | number | | +| [panelName](#panelname-property) | string | | + +### dataSize property + +Signature + +```typescript +dataSize?: number; +``` + +### datasourceId property + +Signature + +```typescript +datasourceId?: number; +``` + +### datasourceName property + +Signature + +```typescript +datasourceName: string; +``` + +### duration property + +Signature + +```typescript +duration: number; +``` + +### error property + +Signature + +```typescript +error?: string; +``` + +### panelId property + +Signature + +```typescript +panelId?: number; +``` + +### panelName property + +Signature + +```typescript +panelName?: string; +``` diff --git a/docs/sources/packages_api/runtime/datasourcesrv.md b/docs/sources/packages_api/runtime/datasourcesrv.md index 423aac1e729..98b9eabeb87 100644 --- a/docs/sources/packages_api/runtime/datasourcesrv.md +++ b/docs/sources/packages_api/runtime/datasourcesrv.md @@ -10,6 +10,8 @@ draft = true ## DataSourceSrv interface +This is the entry point for communicating with a datasource that is added as a plugin (both external and internal). Via this service you will get access to the [DataSourceApi](./data/datasourceapi.md) that have a rich API for communicating with the datasource. + Signature ```typescript @@ -37,8 +39,8 @@ get(name?: string, scopedVars?: ScopedVars): Promise; | Parameter | Type | Description | | --- | --- | --- | -| name | string | | -| scopedVars | ScopedVars | | +| name | string | name of the datasource plugin you want to use. | +| scopedVars | ScopedVars | variables used to interpolate a templated passed as name. | Returns: diff --git a/docs/sources/packages_api/runtime/datasourcewithbackend.md b/docs/sources/packages_api/runtime/datasourcewithbackend.md index 28b9ff0bf72..4f36cf76982 100644 --- a/docs/sources/packages_api/runtime/datasourcewithbackend.md +++ b/docs/sources/packages_api/runtime/datasourcewithbackend.md @@ -10,6 +10,8 @@ draft = true ## DataSourceWithBackend class +Extend this class to implement a data source plugin that is depending on the Grafana backend API. + Signature ```typescript @@ -30,8 +32,12 @@ import { DataSourceWithBackend } from '@grafana/runtime'; | Method | Modifiers | Description | | --- | --- | --- | -| [query(request)](#query-method) | | Ideally final -- any other implementation would be wrong! | -| [testDatasource()](#testdatasource-method) | | | +| [applyTemplateVariables(query)](#applytemplatevariables-method) | | Override to apply template variables | +| [callHealthCheck()](#callhealthcheck-method) | | Run the datasource healthcheck | +| [getResource(path, params)](#getresource-method) | | Make a GET request to the datasource resource path | +| [postResource(path, body)](#postresource-method) | | Send a POST request to the datasource resource path | +| [query(request)](#query-method) | | Ideally final -- any other implementation may not work as expected | +| [testDatasource()](#testdatasource-method) | | Checks the plugin health | | [toDataQueryResponse(rsp)](#todataqueryresponse-method) | | This makes the arrow library loading async. | ### constructor(instanceSettings) @@ -49,9 +55,82 @@ constructor(instanceSettings: DataSourceInstanceSettings); | --- | --- | --- | | instanceSettings | DataSourceInstanceSettings<TOptions> | | +### applyTemplateVariables method + +Override to apply template variables + +Signature + +```typescript +/** @virtual */ +applyTemplateVariables(query: DataQuery): DataQuery; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| query | DataQuery | | + +Returns: + +`DataQuery` + +### callHealthCheck method + +Run the datasource healthcheck + +Signature + +```typescript +callHealthCheck(): Promise; +``` +Returns: + +`Promise` + +### getResource method + +Make a GET request to the datasource resource path + +Signature + +```typescript +getResource(path: string, params?: any): Promise; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| path | string | | +| params | any | | + +Returns: + +`Promise` + +### postResource method + +Send a POST request to the datasource resource path + +Signature + +```typescript +postResource(path: string, body?: any): Promise; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| path | string | | +| body | any | | + +Returns: + +`Promise` + ### query method -Ideally final -- any other implementation would be wrong! +Ideally final -- any other implementation may not work as expected Signature @@ -70,14 +149,16 @@ query(request: DataQueryRequest): Observable; ### testDatasource method +Checks the plugin health + Signature ```typescript -testDatasource(): Promise<{}>; +testDatasource(): Promise; ``` Returns: -`Promise<{}>` +`Promise` ### toDataQueryResponse method diff --git a/docs/sources/packages_api/runtime/echobackend.md b/docs/sources/packages_api/runtime/echobackend.md index 8eda2bb7504..9c537abfae0 100644 --- a/docs/sources/packages_api/runtime/echobackend.md +++ b/docs/sources/packages_api/runtime/echobackend.md @@ -10,6 +10,8 @@ draft = true ## EchoBackend interface +Describes echo backends that can be registered to receive of events. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/echoevent.md b/docs/sources/packages_api/runtime/echoevent.md index b36046433f7..636c398a4a9 100644 --- a/docs/sources/packages_api/runtime/echoevent.md +++ b/docs/sources/packages_api/runtime/echoevent.md @@ -10,6 +10,8 @@ draft = true ## EchoEvent interface +Describes an echo event. + Signature ```typescript @@ -25,7 +27,7 @@ import { EchoEvent } from '@grafana/runtime'; | Property | Type | Description | | --- | --- | --- | | [meta](#meta-property) | EchoMeta | | -| [payload](#payload-property) | P | | +| [payload](#payload-property) | P | Event payload containing event specific data. | | [type](#type-property) | EchoEventType | | ### meta property @@ -38,6 +40,8 @@ meta: EchoMeta; ### payload property +Event payload containing event specific data. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/echoeventtype.md b/docs/sources/packages_api/runtime/echoeventtype.md index 57ad62ed237..8a838aa7541 100644 --- a/docs/sources/packages_api/runtime/echoeventtype.md +++ b/docs/sources/packages_api/runtime/echoeventtype.md @@ -12,6 +12,8 @@ draft = true ### EchoEventType enum +Supported echo event types that can be sent via the [EchoSrv](./runtime/echosrv.md). + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/echometa.md b/docs/sources/packages_api/runtime/echometa.md index 09233df8175..d29d53bf36e 100644 --- a/docs/sources/packages_api/runtime/echometa.md +++ b/docs/sources/packages_api/runtime/echometa.md @@ -10,6 +10,8 @@ draft = true ## EchoMeta interface +Describes the meta information that are sent together with each event. + Signature ```typescript @@ -30,9 +32,9 @@ import { EchoMeta } from '@grafana/runtime'; | [ts](#ts-property) | number | A millisecond epoch | | [url](#url-property) | string | | | [userAgent](#useragent-property) | string | | -| [userId](#userid-property) | number | | -| [userLogin](#userlogin-property) | string | | -| [userSignedIn](#usersignedin-property) | boolean | | +| [userId](#userid-property) | number | The current users unique identifier. | +| [userLogin](#userlogin-property) | string | The current users username used to login into Grafana e.g. email. | +| [userSignedIn](#usersignedin-property) | boolean | True when user is logged in into Grafana. | | [windowSize](#windowsize-property) | SizeMeta | | ### screenSize property @@ -91,6 +93,8 @@ userAgent: string; ### userId property +The current users unique identifier. + Signature ```typescript @@ -99,6 +103,8 @@ userId: number; ### userLogin property +The current users username used to login into Grafana e.g. email. + Signature ```typescript @@ -107,6 +113,8 @@ userLogin: string; ### userSignedIn property +True when user is logged in into Grafana. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/echosrv.md b/docs/sources/packages_api/runtime/echosrv.md index 784f8702b7f..0d5a3df628a 100644 --- a/docs/sources/packages_api/runtime/echosrv.md +++ b/docs/sources/packages_api/runtime/echosrv.md @@ -10,6 +10,8 @@ draft = true ## EchoSrv interface +Used to send events to all the registered backends. This should be accessed via the [getEchoSrv()](./runtime/getechosrv.md) function. Will, by default, flush events to the backends every 10s or when the flush function is triggered. + Signature ```typescript @@ -24,12 +26,14 @@ import { EchoSrv } from '@grafana/runtime'; | Method | Description | | --- | --- | -| [addBackend(backend)](#addbackend-method) | | -| [addEvent(event, meta)](#addevent-method) | | -| [flush()](#flush-method) | | +| [addBackend(backend)](#addbackend-method) | Add a new echo backend to the list of backends that will receive events. | +| [addEvent(event, meta)](#addevent-method) | Call this to add event that will be sent to the echo backends upon next flush. | +| [flush()](#flush-method) | Call this to flush current events to the echo backends. | ### addBackend method +Add a new echo backend to the list of backends that will receive events. + Signature ```typescript @@ -47,6 +51,8 @@ addBackend(backend: EchoBackend): void; ### addEvent method +Call this to add event that will be sent to the echo backends upon next flush. + Signature ```typescript @@ -56,8 +62,8 @@ addEvent(event: Omit, meta?: {}): void; | Parameter | Type | Description | | --- | --- | --- | -| event | Omit<T, 'meta'> | | -| meta | {} | | +| event | Omit<T, 'meta'> | Object containing event information. | +| meta | {} | Object that will extend/override the default meta object. | Returns: @@ -65,6 +71,8 @@ addEvent(event: Omit, meta?: {}): void; ### flush method +Call this to flush current events to the echo backends. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/getangularloader.md b/docs/sources/packages_api/runtime/getangularloader.md index 3cbe44cff4b..5f8ce803e0a 100644 --- a/docs/sources/packages_api/runtime/getangularloader.md +++ b/docs/sources/packages_api/runtime/getangularloader.md @@ -12,6 +12,10 @@ draft = true ### getAngularLoader() function +Used to retrieve the [AngularLoader](./runtime/angularloader.md) that enables the use of Angular components within a React component. + +Please see the [AngularComponent](./runtime/angularcomponent.md) for a proper example. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/getbackendsrv.md b/docs/sources/packages_api/runtime/getbackendsrv.md index c708470eab5..9f2f304b664 100644 --- a/docs/sources/packages_api/runtime/getbackendsrv.md +++ b/docs/sources/packages_api/runtime/getbackendsrv.md @@ -12,6 +12,8 @@ draft = true ### getBackendSrv variable +Used to retrieve the [BackendSrv](./runtime/backendsrv.md) that can be used to communicate via http(s) to a remote backend such as the Grafana backend, a datasource etc. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/getdatasourcesrv.md b/docs/sources/packages_api/runtime/getdatasourcesrv.md index 03a2c2091f6..2e49dde8eeb 100644 --- a/docs/sources/packages_api/runtime/getdatasourcesrv.md +++ b/docs/sources/packages_api/runtime/getdatasourcesrv.md @@ -12,6 +12,8 @@ draft = true ### getDataSourceSrv() function +Used to retrieve the [DataSourceSrv](./runtime/datasourcesrv.md) that is the entry point for communicating with a datasource that is added as a plugin (both external and internal). + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/getechosrv.md b/docs/sources/packages_api/runtime/getechosrv.md index a66e023c246..689a7793831 100644 --- a/docs/sources/packages_api/runtime/getechosrv.md +++ b/docs/sources/packages_api/runtime/getechosrv.md @@ -12,6 +12,8 @@ draft = true ### getEchoSrv() function +Used to retrieve the [EchoSrv](./runtime/echosrv.md) that can be used to report events to registered echo backends. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/getlocationsrv.md b/docs/sources/packages_api/runtime/getlocationsrv.md index 09cbb5ca79a..0bfce1cb37e 100644 --- a/docs/sources/packages_api/runtime/getlocationsrv.md +++ b/docs/sources/packages_api/runtime/getlocationsrv.md @@ -12,6 +12,8 @@ draft = true ### getLocationSrv() function +Used to retrieve the [LocationSrv](./runtime/locationsrv.md) that can be used to automatically navigate the user to a new place in Grafana. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/setbackendsrv.md b/docs/sources/packages_api/runtime/gettemplatesrv.md similarity index 55% rename from docs/sources/packages_api/runtime/setbackendsrv.md rename to docs/sources/packages_api/runtime/gettemplatesrv.md index 25dba664a04..ff07d2905bd 100644 --- a/docs/sources/packages_api/runtime/setbackendsrv.md +++ b/docs/sources/packages_api/runtime/gettemplatesrv.md @@ -2,23 +2,25 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "setBackendSrv" +title = "getTemplateSrv" keywords = ["grafana","documentation","sdk","@grafana/runtime"] type = "docs" draft = true +++ -## setBackendSrv variable +## getTemplateSrv variable -### setBackendSrv variable +### getTemplateSrv variable + +Used to retrieve the [TemplateSrv](./runtime/templatesrv.md) that can be used to fetch available template variables. Signature ```typescript -setBackendSrv: (instance: BackendSrv) => void +getTemplateSrv: () => TemplateSrv ``` Import ```typescript -import { setBackendSrv } from '@grafana/runtime'; +import { getTemplateSrv } from '@grafana/runtime'; ``` diff --git a/docs/sources/packages_api/runtime/grafanabootconfig.md b/docs/sources/packages_api/runtime/grafanabootconfig.md index d5cf03729dd..98f3c9e325e 100644 --- a/docs/sources/packages_api/runtime/grafanabootconfig.md +++ b/docs/sources/packages_api/runtime/grafanabootconfig.md @@ -13,7 +13,7 @@ draft = true Signature ```typescript -export declare class GrafanaBootConfig +export declare class GrafanaBootConfig implements GrafanaConfig ``` Import @@ -55,13 +55,14 @@ import { GrafanaBootConfig } from '@grafana/runtime'; | [licenseInfo](#licenseinfo-property) | | LicenseInfo | | | [loginError](#loginerror-property) | | any | | | [loginHint](#loginhint-property) | | any | | +| [minRefreshInterval](#minrefreshinterval-property) | | string | | | [navTree](#navtree-property) | | any | | | [newPanelTitle](#newpaneltitle-property) | | string | | | [oauth](#oauth-property) | | any | | | [panels](#panels-property) | | {
[key: string]: PanelPluginMeta;
} | | | [passwordHint](#passwordhint-property) | | any | | -| [phantomJSRenderer](#phantomjsrenderer-property) | | boolean | | | [pluginsToPreload](#pluginstopreload-property) | | string[] | | +| [rendererAvailable](#rendereravailable-property) | | boolean | | | [samlEnabled](#samlenabled-property) | | boolean | | | [theme](#theme-property) | | GrafanaTheme | | | [verifyEmailEnabled](#verifyemailenabled-property) | | boolean | | @@ -285,6 +286,14 @@ loginError: any; loginHint: any; ``` +### minRefreshInterval property + +Signature + +```typescript +minRefreshInterval: string; +``` + ### navTree property Signature @@ -327,14 +336,6 @@ panels: { passwordHint: any; ``` -### phantomJSRenderer property - -Signature - -```typescript -phantomJSRenderer: boolean; -``` - ### pluginsToPreload property Signature @@ -343,6 +344,14 @@ phantomJSRenderer: boolean; pluginsToPreload: string[]; ``` +### rendererAvailable property + +Signature + +```typescript +rendererAvailable: boolean; +``` + ### samlEnabled property Signature diff --git a/docs/sources/packages_api/runtime/healthcheckresult.md b/docs/sources/packages_api/runtime/healthcheckresult.md new file mode 100644 index 00000000000..ad091eff0cc --- /dev/null +++ b/docs/sources/packages_api/runtime/healthcheckresult.md @@ -0,0 +1,55 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "HealthCheckResult" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## HealthCheckResult interface + +Describes the payload returned when checking the health of a data source plugin. + +Signature + +```typescript +export interface HealthCheckResult +``` +Import + +```typescript +import { HealthCheckResult } from '@grafana/runtime'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [details](#details-property) | Record<string, any> | | +| [message](#message-property) | string | | +| [status](#status-property) | HealthStatus | | + +### details property + +Signature + +```typescript +details?: Record; +``` + +### message property + +Signature + +```typescript +message: string; +``` + +### status property + +Signature + +```typescript +status: HealthStatus; +``` diff --git a/docs/sources/packages_api/runtime/healthstatus.md b/docs/sources/packages_api/runtime/healthstatus.md new file mode 100644 index 00000000000..2bf2f0621ca --- /dev/null +++ b/docs/sources/packages_api/runtime/healthstatus.md @@ -0,0 +1,35 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "HealthStatus" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## HealthStatus enum + +### HealthStatus enum + +Describes the current healt status of a data source plugin. + +Signature + +```typescript +export declare enum HealthStatus +``` +Import + +```typescript +import { HealthStatus } from '@grafana/runtime'; +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| Error | "ERROR" | | +| OK | "OK" | | +| Unknown | "UNKNOWN" | | + diff --git a/docs/sources/packages_api/runtime/loadplugincss.md b/docs/sources/packages_api/runtime/loadplugincss.md index 25bb738ac49..52b7418aa3c 100644 --- a/docs/sources/packages_api/runtime/loadplugincss.md +++ b/docs/sources/packages_api/runtime/loadplugincss.md @@ -12,6 +12,8 @@ draft = true ### loadPluginCss() function +Use this to load css for a Grafana plugin by specifying a [PluginCssOptions](./runtime/plugincssoptions.md) containing styling for the dark and the light theme. + Signature ```typescript @@ -26,7 +28,7 @@ import { loadPluginCss } from '@grafana/runtime'; | Parameter | Type | Description | | --- | --- | --- | -| options | PluginCssOptions | | +| options | PluginCssOptions | plugin styling for light and dark theme. | Returns: diff --git a/docs/sources/packages_api/runtime/locationsrv.md b/docs/sources/packages_api/runtime/locationsrv.md index 38d8e70d1ca..12dc74ae978 100644 --- a/docs/sources/packages_api/runtime/locationsrv.md +++ b/docs/sources/packages_api/runtime/locationsrv.md @@ -10,6 +10,8 @@ draft = true ## LocationSrv interface +If you need to automatically navigate the user to a new place in the application this should be done via the LocationSrv and it will make sure to update the application state accordingly. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/locationupdate.md b/docs/sources/packages_api/runtime/locationupdate.md index 710adc50131..3290877bfba 100644 --- a/docs/sources/packages_api/runtime/locationupdate.md +++ b/docs/sources/packages_api/runtime/locationupdate.md @@ -24,15 +24,14 @@ import { LocationUpdate } from '@grafana/runtime'; | Property | Type | Description | | --- | --- | --- | -| [partial](#partial-property) | boolean | Add the query argument to the existing URL | -| [path](#path-property) | string | | -| [query](#query-property) | UrlQueryMap | | +| [partial](#partial-property) | boolean | If set to true, the query argument will be added to the existing URL. | +| [path](#path-property) | string | Target path where you automatically wants to navigate the user. | +| [query](#query-property) | UrlQueryMap | Specify this value if you want to add values to the query string of the URL. | | [replace](#replace-property) | boolean | | -| [routeParams](#routeparams-property) | UrlQueryMap | Do not change this unless you are the angular router | ### partial property -Add the query argument to the existing URL +If set to true, the query argument will be added to the existing URL. Signature @@ -42,6 +41,8 @@ partial?: boolean; ### path property +Target path where you automatically wants to navigate the user. + Signature ```typescript @@ -50,6 +51,8 @@ path?: string; ### query property +Specify this value if you want to add values to the query string of the URL. + Signature ```typescript @@ -63,13 +66,3 @@ query?: UrlQueryMap; ```typescript replace?: boolean; ``` - -### routeParams property - -Do not change this unless you are the angular router - -Signature - -```typescript -routeParams?: UrlQueryMap; -``` diff --git a/docs/sources/packages_api/runtime/metaanalyticsevent.md b/docs/sources/packages_api/runtime/metaanalyticsevent.md index a79212da17c..8a8fc76c478 100644 --- a/docs/sources/packages_api/runtime/metaanalyticsevent.md +++ b/docs/sources/packages_api/runtime/metaanalyticsevent.md @@ -10,6 +10,8 @@ draft = true ## MetaAnalyticsEvent interface +Describes meta analytics event with predefined [EchoEventType.MetaAnalytics](./runtime/echoeventtype/metaanalytics.md) type. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/metaanalyticseventname.md b/docs/sources/packages_api/runtime/metaanalyticseventname.md new file mode 100644 index 00000000000..bf0f4aae5f5 --- /dev/null +++ b/docs/sources/packages_api/runtime/metaanalyticseventname.md @@ -0,0 +1,34 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "MetaAnalyticsEventName" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## MetaAnalyticsEventName enum + +### MetaAnalyticsEventName enum + +The meta analytics events that can be added to the echo service. + +Signature + +```typescript +export declare enum MetaAnalyticsEventName +``` +Import + +```typescript +import { MetaAnalyticsEventName } from '@grafana/runtime'; +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| DashboardView | "dashboard-view" | | +| DataRequest | "data-request" | | + diff --git a/docs/sources/packages_api/runtime/metaanalyticseventpayload.md b/docs/sources/packages_api/runtime/metaanalyticseventpayload.md index bd246211f01..99e57e1dc1d 100644 --- a/docs/sources/packages_api/runtime/metaanalyticseventpayload.md +++ b/docs/sources/packages_api/runtime/metaanalyticseventpayload.md @@ -8,127 +8,19 @@ type = "docs" draft = true +++ -## MetaAnalyticsEventPayload interface +## MetaAnalyticsEventPayload type + +### MetaAnalyticsEventPayload type + +Describes the meta analytics payload passed with the [MetaAnalyticsEvent](./runtime/metaanalyticsevent.md) Signature ```typescript -export interface MetaAnalyticsEventPayload +export declare type MetaAnalyticsEventPayload = DashboardViewEventPayload | DataRequestEventPayload; ``` Import ```typescript import { MetaAnalyticsEventPayload } from '@grafana/runtime'; ``` -Properties - -| Property | Type | Description | -| --- | --- | --- | -| [dashboardId](#dashboardid-property) | number | | -| [dashboardName](#dashboardname-property) | string | | -| [dashboardUid](#dashboarduid-property) | string | | -| [dataSize](#datasize-property) | number | | -| [datasourceId](#datasourceid-property) | number | | -| [datasourceName](#datasourcename-property) | string | | -| [duration](#duration-property) | number | | -| [error](#error-property) | string | | -| [eventName](#eventname-property) | string | | -| [folderName](#foldername-property) | string | | -| [panelId](#panelid-property) | number | | -| [panelName](#panelname-property) | string | | - -### dashboardId property - -Signature - -```typescript -dashboardId?: number; -``` - -### dashboardName property - -Signature - -```typescript -dashboardName?: string; -``` - -### dashboardUid property - -Signature - -```typescript -dashboardUid?: string; -``` - -### dataSize property - -Signature - -```typescript -dataSize?: number; -``` - -### datasourceId property - -Signature - -```typescript -datasourceId?: number; -``` - -### datasourceName property - -Signature - -```typescript -datasourceName: string; -``` - -### duration property - -Signature - -```typescript -duration: number; -``` - -### error property - -Signature - -```typescript -error?: string; -``` - -### eventName property - -Signature - -```typescript -eventName: string; -``` - -### folderName property - -Signature - -```typescript -folderName?: string; -``` - -### panelId property - -Signature - -```typescript -panelId?: number; -``` - -### panelName property - -Signature - -```typescript -panelName?: string; -``` diff --git a/docs/sources/packages_api/runtime/plugincssoptions.md b/docs/sources/packages_api/runtime/plugincssoptions.md new file mode 100644 index 00000000000..3c3529aac5b --- /dev/null +++ b/docs/sources/packages_api/runtime/plugincssoptions.md @@ -0,0 +1,46 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "PluginCssOptions" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## PluginCssOptions interface + +Option to specify a plugin css that should be applied for the dark and the light theme. + +Signature + +```typescript +export interface PluginCssOptions +``` +Import + +```typescript +import { PluginCssOptions } from '@grafana/runtime'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [dark](#dark-property) | string | | +| [light](#light-property) | string | | + +### dark property + +Signature + +```typescript +dark: string; +``` + +### light property + +Signature + +```typescript +light: string; +``` diff --git a/docs/sources/packages_api/runtime/registerechobackend.md b/docs/sources/packages_api/runtime/registerechobackend.md index c296e587774..7d16f95690e 100644 --- a/docs/sources/packages_api/runtime/registerechobackend.md +++ b/docs/sources/packages_api/runtime/registerechobackend.md @@ -12,6 +12,8 @@ draft = true ### registerEchoBackend variable +Used to register echo backends that will receive Grafana echo events during application runtime. + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/reportmetaanalytics.md b/docs/sources/packages_api/runtime/reportmetaanalytics.md index bd0d7bfce37..485c2383d6f 100644 --- a/docs/sources/packages_api/runtime/reportmetaanalytics.md +++ b/docs/sources/packages_api/runtime/reportmetaanalytics.md @@ -12,6 +12,8 @@ draft = true ### reportMetaAnalytics variable +Helper function to report meta analytics to the [EchoSrv](./runtime/echosrv.md). + Signature ```typescript diff --git a/docs/sources/packages_api/runtime/setlocationsrv.md b/docs/sources/packages_api/runtime/setlocationsrv.md deleted file mode 100644 index abe75712870..00000000000 --- a/docs/sources/packages_api/runtime/setlocationsrv.md +++ /dev/null @@ -1,34 +0,0 @@ -+++ -# ----------------------------------------------------------------------- -# Do not edit this file. It is automatically generated by API Documenter. -# ----------------------------------------------------------------------- -title = "setLocationSrv" -keywords = ["grafana","documentation","sdk","@grafana/runtime"] -type = "docs" -draft = true -+++ - -## setLocationSrv() function - -### setLocationSrv() function - -Signature - -```typescript -export declare function setLocationSrv(instance: LocationSrv): void; -``` -Import - -```typescript -import { setLocationSrv } from '@grafana/runtime'; -``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| instance | LocationSrv | | - -Returns: - -`void` - diff --git a/docs/sources/packages_api/runtime/sizemeta.md b/docs/sources/packages_api/runtime/sizemeta.md new file mode 100644 index 00000000000..5777afc26c4 --- /dev/null +++ b/docs/sources/packages_api/runtime/sizemeta.md @@ -0,0 +1,46 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "SizeMeta" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## SizeMeta interface + +Describes a size with width/height + +Signature + +```typescript +export interface SizeMeta +``` +Import + +```typescript +import { SizeMeta } from '@grafana/runtime'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [height](#height-property) | number | | +| [width](#width-property) | number | | + +### height property + +Signature + +```typescript +height: number; +``` + +### width property + +Signature + +```typescript +width: number; +``` diff --git a/docs/sources/packages_api/runtime/templatesrv.md b/docs/sources/packages_api/runtime/templatesrv.md new file mode 100644 index 00000000000..097ce67fbbd --- /dev/null +++ b/docs/sources/packages_api/runtime/templatesrv.md @@ -0,0 +1,43 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "TemplateSrv" +keywords = ["grafana","documentation","sdk","@grafana/runtime"] +type = "docs" +draft = true ++++ + +## TemplateSrv interface + +Via the TemplateSrv consumers get access to all the available template variables that can be used within the current active dashboard. + +For a more in-depth description visit: https://grafana.com/docs/grafana/latest/reference/templating + +Signature + +```typescript +export interface TemplateSrv +``` +Import + +```typescript +import { TemplateSrv } from '@grafana/runtime'; +``` +Methods + +| Method | Description | +| --- | --- | +| [getVariables()](#getvariables-method) | | + +### getVariables method + +Signature + +```typescript +getVariables(): VariableModel[]; +``` +Returns: + +`VariableModel[]` + diff --git a/docs/sources/packages_api/ui/_index.md b/docs/sources/packages_api/ui/_index.md index 6b57bf71b16..e9eaff804e0 100644 --- a/docs/sources/packages_api/ui/_index.md +++ b/docs/sources/packages_api/ui/_index.md @@ -17,39 +17,32 @@ A library containing the different design components of the Grafana ecosystem. | Class | Description | | --- | --- | | [ansicolor](./ansicolor/) | Represents an ANSI-escaped string. | -| [AsyncSelect](./asyncselect/) | | | [BarGauge](./bargauge/) | | | [BigValue](./bigvalue/) | | -| [ButtonSelect](./buttonselect/) | | | [Cascader](./cascader/) | | | [ClickOutsideWrapper](./clickoutsidewrapper/) | | +| [ClipboardButton](./clipboardbutton/) | | | [CustomScrollbar](./customscrollbar/) | Wraps component into component from react-custom-scrollbars | | [ErrorBoundary](./errorboundary/) | | | [ErrorBoundaryAlert](./errorboundaryalert/) | | -| [FieldDisplayEditor](./fielddisplayeditor/) | | | [Gauge](./gauge/) | | | [Graph](./graph/) | | | [GraphSeriesToggler](./graphseriestoggler/) | | -| [Input](./input/) | | | [JsonExplorer](./jsonexplorer/) | JsonExplorerJsonExplorer allows you to render JSON objects in HTML with a \*\*collapsible\*\* navigation. | | [JSONFormatter](./jsonformatter/) | | | [List](./list/) | | +| [ModalsProvider](./modalsprovider/) | | | [PieChart](./piechart/) | | | [Popover](./popover/) | | | [PopoverController](./popovercontroller/) | | | [Portal](./portal/) | | | [QueryField](./queryfield/) | Renders an editor field. Pass initial value as initialQuery and listen to changes in props.onValueChanged. This component can only process strings. Internally it uses Slate Value. Implement props.onTypeahead to use suggestions, see PromQueryField.tsx as an example. | -| [Select](./select/) | | | [SetInterval](./setinterval/) | | | [StatsPicker](./statspicker/) | | -| [Switch](./switch/) | | | [TableInputCSV](./tableinputcsv/) | Expects the container div to have size set and will fill it 100% | | [TagsInput](./tagsinput/) | | -| [ThresholdsEditor](./thresholdseditor/) | | | [ToggleButtonGroup](./togglebuttongroup/) | | -| [TransformationsEditor](./transformationseditor/) | | | [UnitPicker](./unitpicker/) | | -| [ValueMappingsEditor](./valuemappingseditor/) | | | [VizRepeater](./vizrepeater/) | | ## Enumerations @@ -62,7 +55,7 @@ A library containing the different design components of the Grafana ecosystem. | [BigValueJustifyMode](./bigvaluejustifymode/) | | | [CompletionItemKind](./completionitemkind/) | | | [EventsWithValidation](./eventswithvalidation/) | | -| [InputStatus](./inputstatus/) | | +| [LegacyInputStatus](./legacyinputstatus/) | | | [LegendDisplayMode](./legenddisplaymode/) | | | [PieChartType](./piecharttype/) | | @@ -70,31 +63,40 @@ A library containing the different design components of the Grafana ecosystem. | Function | Description | | --- | --- | +| [AsyncMultiSelect(props)](./asyncmultiselect/) | | +| [AsyncSelect(props)](./asyncselect/) | | | [BracesPlugin()](./bracesplugin/) | | +| [ButtonSelect({ placeholder, icon, variant, size, className, disabled, ...selectProps })](./buttonselect/) | | | [calculateFontSize(text, width, height, lineHeight, maxSize)](./calculatefontsize/) | | | [ClearPlugin()](./clearplugin/) | | | [ClipboardPlugin()](./clipboardplugin/) | | | [convertOldAngularValueMapping(panel)](./convertoldangularvaluemapping/) | Convert the angular single stat mapping to new react style | | [FadeTransition(props)](./fadetransition/) | | +| [Form({ defaultValues, onSubmit, validateOnMount, validateFieldsOnMount, children, validateOn, })](./form/) | | | [getTagColorsFromName(name)](./gettagcolorsfromname/) | Returns tag badge background and border colors based on hashed tag name. | | [IndentationPlugin()](./indentationplugin/) | | | [measureText(text, fontSize)](./measuretext/) | | +| [MultiSelect(props)](./multiselect/) | | | [NewlinePlugin()](./newlineplugin/) | | +| [RadioButtonGroup({ options, value, onChange, disabled, disabledOptions, size, fullWidth, })](./radiobuttongroup/) | | +| [renderOrCallToRender(itemToRender, props)](./renderorcalltorender/) | Given react node or function returns element accordingly | | [resetSelectStyles()](./resetselectstyles/) | | | [RunnerPlugin({ handler })](./runnerplugin/) | | | [Segment({ options, value, onChange, Component, className, allowCustomValue, placeholder, })](./segment/) | | | [SegmentAsync({ value, onChange, loadOptions, Component, className, allowCustomValue, placeholder, })](./segmentasync/) | | | [SegmentInput({ value: initialValue, onChange, Component, className, placeholder, autofocus, })](./segmentinput/) | | | [SegmentSelect({ value, options, onChange, onClickOutside, width, noOptionsMessage, allowCustomValue, })](./segmentselect/) | | +| [Select(props)](./select/) | | | [SelectionShortcutsPlugin()](./selectionshortcutsplugin/) | | +| [SelectValueEditor({ value, onChange, item, })](./selectvalueeditor/) | | | [sharedSingleStatMigrationHandler(panel)](./sharedsinglestatmigrationhandler/) | | -| [sharedSingleStatPanelChangedHandler(options, prevPluginId, prevOptions)](./sharedsinglestatpanelchangedhandler/) | | +| [sharedSingleStatPanelChangedHandler(panel, prevPluginId, prevOptions)](./sharedsinglestatpanelchangedhandler/) | | | [SlatePrism(optsParam)](./slateprism/) | A Slate plugin to highlight code syntax. | | [SlideOutTransition(props)](./slideouttransition/) | | | [stylesFactory(stylesCreator)](./stylesfactory/) | Creates memoized version of styles creator | | [SuggestionsPlugin({ onTypeahead, cleanText, onWillApplySuggestion, portalOrigin, })](./suggestionsplugin/) | | | [useTheme()](./usetheme/) | | -| [ValuePicker({ label, icon, options, onChange, variant })](./valuepicker/) | | +| [ValuePicker({ label, icon, options, onChange, variant, size, isFullWidth, })](./valuepicker/) | | ## Interfaces @@ -113,22 +115,22 @@ A library containing the different design components of the Grafana ecosystem. | [LegendItem](./legenditem/) | | | [LegendOptions](./legendoptions/) | | | [LegendRenderOptions](./legendrenderoptions/) | | -| [NumberFieldConfigSettings](./numberfieldconfigsettings/) | | -| [SelectFieldConfigSettings](./selectfieldconfigsettings/) | | | [SingleStatBaseOptions](./singlestatbaseoptions/) | | -| [StringFieldConfigSettings](./stringfieldconfigsettings/) | | +| [StyleProps](./styleprops/) | | | [SuggestionsState](./suggestionsstate/) | | | [Themeable](./themeable/) | | | [TypeaheadInput](./typeaheadinput/) | | | [TypeaheadOutput](./typeaheadoutput/) | | | [ValidationEvents](./validationevents/) | | | [ValidationRule](./validationrule/) | | +| [VizRepeaterRenderValueProps](./vizrepeaterrendervalueprops/) | | ## Namespaces | Namespace | Description | | --- | --- | | [DOMUtil](./domutil/) | | +| [RadioButtonGroup](./radiobuttongroup/) | | | [styleMixins](./stylemixins/) | | ## Variables @@ -142,31 +144,40 @@ A library containing the different design components of the Grafana ecosystem. | [ButtonCascader](./buttoncascader/) | | | [CallToActionCard](./calltoactioncard/) | | | [Chart](./chart/) | | +| [Checkbox](./checkbox/) | | | [Collapse](./collapse/) | | | [ColorPicker](./colorpicker/) | | | [colors](./colors/) | | | [ConfirmButton](./confirmbutton/) | | | [ConfirmModal](./confirmmodal/) | | +| [Container](./container/) | | | [ContextMenu](./contextmenu/) | | | [ControlledCollapse](./controlledcollapse/) | | -| [DataLinkBuiltInVars](./datalinkbuiltinvars/) | | +| [Counter](./counter/) | | | [DataLinkInput](./datalinkinput/) | | | [DataLinksContextMenu](./datalinkscontextmenu/) | | | [DataLinksEditor](./datalinkseditor/) | | +| [DataLinksInlineEditor](./datalinksinlineeditor/) | | | [DataSourceHttpSettings](./datasourcehttpsettings/) | | | [DEFAULT\_ANNOTATION\_COLOR](./default_annotation_color/) | | | [DeleteButton](./deletebutton/) | | | [Drawer](./drawer/) | | | [EmptySearchResult](./emptysearchresult/) | | | [ErrorWithStack](./errorwithstack/) | | +| [Field](./field/) | | +| [FieldConfigItemHeaderTitle](./fieldconfigitemheadertitle/) | | | [fieldMatchersUI](./fieldmatchersui/) | | -| [FieldPropertiesEditor](./fieldpropertieseditor/) | | | [FormField](./formfield/) | Default form field including label used in Grafana UI. Default input element is simple . You can also pass custom inputEl if required in which case inputWidth and inputProps are ignored. | | [FormLabel](./formlabel/) | | | [Forms](./forms/) | | | [FullWidthButtonContainer](./fullwidthbuttoncontainer/) | | +| [getAvailableIcons](./getavailableicons/) | | +| [getButtonStyles](./getbuttonstyles/) | | +| [getFormStyles](./getformstyles/) | | | [getLogRowStyles](./getlogrowstyles/) | | -| [getStandardFieldConfigs](./getstandardfieldconfigs/) | | +| [getStandardFieldConfigs](./getstandardfieldconfigs/) | Returns collection of common field config properties definitions | +| [getStandardOptionEditors](./getstandardoptioneditors/) | Returns collection of standard option editors definitions | +| [getStandardTransformers](./getstandardtransformers/) | | | [getTheme](./gettheme/) | | | [GraphContextMenu](./graphcontextmenu/) | | | [GraphLegend](./graphlegend/) | | @@ -174,7 +185,11 @@ A library containing the different design components of the Grafana ecosystem. | [hasValidationEvent](./hasvalidationevent/) | | | [HorizontalGroup](./horizontalgroup/) | | | [Icon](./icon/) | | -| [IndicatorsContainer](./indicatorscontainer/) | | +| [IconButton](./iconbutton/) | | +| [Input](./input/) | | +| [Label](./label/) | | +| [LegacyForms](./legacyforms/) | | +| [Legend](./legend/) | | | [LegendList](./legendlist/) | | | [LegendTable](./legendtable/) | | | [LinkButton](./linkbutton/) | | @@ -187,12 +202,15 @@ A library containing the different design components of the Grafana ecosystem. | [mockTheme](./mocktheme/) | | | [mockThemeContext](./mockthemecontext/) | Enables theme context mocking | | [Modal](./modal/) | | +| [ModalHeader](./modalheader/) | | +| [ModalRoot](./modalroot/) | | +| [ModalsController](./modalscontroller/) | | +| [ModalTabContent](./modaltabcontent/) | | +| [ModalTabsHeader](./modaltabsheader/) | | | [NO\_DATA\_COLOR](./no_data_color/) | | -| [NoOptionsMessage](./nooptionsmessage/) | | -| [NumberOverrideEditor](./numberoverrideeditor/) | | -| [numberOverrideProcessor](./numberoverrideprocessor/) | | | [NumberValueEditor](./numbervalueeditor/) | | | [OK\_COLOR](./ok_color/) | | +| [Pagination](./pagination/) | | | [PALETTE\_COLUMNS](./palette_columns/) | | | [PALETTE\_ROWS](./palette_rows/) | | | [PanelOptionsGrid](./paneloptionsgrid/) | | @@ -203,30 +221,28 @@ A library containing the different design components of the Grafana ecosystem. | [REGION\_FILL\_ALPHA](./region_fill_alpha/) | | | [SCHEMA](./schema/) | | | [SecretFormField](./secretformfield/) | Form field that has 2 states configured and not configured. If configured it will not show its contents and adds a reset button that will clear the input and makes it accessible. In non configured state it behaves like normal form field. This is used for passwords or anything that is encrypted on the server and is later returned encrypted to the user (like datasource passwords). | -| [SelectOverrideEditor](./selectoverrideeditor/) | | -| [selectOverrideProcessor](./selectoverrideprocessor/) | | | [selectThemeVariant](./selectthemevariant/) | | -| [SelectValueEditor](./selectvalueeditor/) | | | [SeriesColorPicker](./seriescolorpicker/) | | | [SeriesColorPickerPopover](./seriescolorpickerpopover/) | | | [SeriesColorPickerPopoverWithTheme](./seriescolorpickerpopoverwiththeme/) | | | [SeriesIcon](./seriesicon/) | | +| [Slider](./slider/) | | | [sortedColors](./sortedcolors/) | | | [Spinner](./spinner/) | | -| [StringOverrideEditor](./stringoverrideeditor/) | | -| [stringOverrideProcessor](./stringoverrideprocessor/) | | | [StringValueEditor](./stringvalueeditor/) | | +| [Switch](./switch/) | | | [Tab](./tab/) | | | [TabContent](./tabcontent/) | | | [Table](./table/) | | | [TabsBar](./tabsbar/) | | +| [Tag](./tag/) | | +| [TagList](./taglist/) | | +| [TextArea](./textarea/) | | | [ThemeContext](./themecontext/) | | | [TimeOfDayPicker](./timeofdaypicker/) | | -| [TimePicker](./timepicker/) | | +| [TimeRangePicker](./timerangepicker/) | | | [ToggleButton](./togglebutton/) | | | [Tooltip](./tooltip/) | | -| [TransformationRow](./transformationrow/) | | -| [transformersUIRegistry](./transformersuiregistry/) | | | [validate](./validate/) | | | [VerticalGroup](./verticalgroup/) | | | [withTheme](./withtheme/) | | @@ -236,6 +252,13 @@ A library containing the different design components of the Grafana ecosystem. | Type Alias | Description | | --- | --- | | [AlertVariant](./alertvariant/) | | +| [ButtonProps](./buttonprops/) | | +| [ButtonVariant](./buttonvariant/) | | +| [FormAPI](./formapi/) | | +| [FormInputSize](./forminputsize/) | | +| [IconName](./iconname/) | | +| [IconSize](./iconsize/) | | +| [IconType](./icontype/) | | | [LegendPlacement](./legendplacement/) | | | [PopoverContent](./popovercontent/) | | | [Renderable](./renderable/) | | diff --git a/docs/sources/packages_api/ui/ansicolor.md b/docs/sources/packages_api/ui/ansicolor.md index 0cd89625507..76986ed1c65 100644 --- a/docs/sources/packages_api/ui/ansicolor.md +++ b/docs/sources/packages_api/ui/ansicolor.md @@ -62,7 +62,7 @@ constructor(s?: string); | Parameter | Type | Description | | --- | --- | --- | -| s | string | | +| s | string | a string containing ANSI escape codes. | ### asChromeConsoleLogArguments property @@ -204,7 +204,7 @@ static strip(s: string): string; | Parameter | Type | Description | | --- | --- | --- | -| s | string | | +| s | string | a string containing ANSI escape codes. {string} clean string. | Returns: diff --git a/docs/sources/packages_api/runtime/setangularloader.md b/docs/sources/packages_api/ui/asyncmultiselect.md similarity index 51% rename from docs/sources/packages_api/runtime/setangularloader.md rename to docs/sources/packages_api/ui/asyncmultiselect.md index 38f5435e5fb..1b7873ff349 100644 --- a/docs/sources/packages_api/runtime/setangularloader.md +++ b/docs/sources/packages_api/ui/asyncmultiselect.md @@ -2,33 +2,33 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "setAngularLoader" -keywords = ["grafana","documentation","sdk","@grafana/runtime"] +title = "AsyncMultiSelect" +keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## setAngularLoader() function +## AsyncMultiSelect() function -### setAngularLoader() function +### AsyncMultiSelect() function Signature ```typescript -export declare function setAngularLoader(v: AngularLoader): void; +export declare function AsyncMultiSelect(props: AsyncMultiSelectProps): JSX.Element; ``` Import ```typescript -import { setAngularLoader } from '@grafana/runtime'; +import { AsyncMultiSelect } from '@grafana/ui'; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | -| v | AngularLoader | | +| props | AsyncMultiSelectProps<T> | | Returns: -`void` +`JSX.Element` diff --git a/docs/sources/packages_api/ui/asyncselect.md b/docs/sources/packages_api/ui/asyncselect.md index 54080fef06f..229d2083210 100644 --- a/docs/sources/packages_api/ui/asyncselect.md +++ b/docs/sources/packages_api/ui/asyncselect.md @@ -8,45 +8,26 @@ type = "docs" draft = true +++ -## AsyncSelect class +## AsyncSelect() function + +### AsyncSelect() function Signature ```typescript -export declare class AsyncSelect extends PureComponent> +export declare function AsyncSelect(props: AsyncSelectProps): JSX.Element; ``` Import ```typescript import { AsyncSelect } from '@grafana/ui'; ``` -Properties +Parameters -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [defaultProps](#defaultprops-property) | static | Partial<AsyncProps<any>> | | - -Methods - -| Method | Modifiers | Description | +| Parameter | Type | Description | | --- | --- | --- | -| [render()](#render-method) | | | +| props | AsyncSelectProps<T> | | -### defaultProps property - -Signature - -```typescript -static defaultProps: Partial>; -``` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` Returns: `JSX.Element` diff --git a/docs/sources/packages_api/ui/indicatorscontainer.md b/docs/sources/packages_api/ui/buttonprops.md similarity index 63% rename from docs/sources/packages_api/ui/indicatorscontainer.md rename to docs/sources/packages_api/ui/buttonprops.md index 4435b0abcb6..3ccfc126e8c 100644 --- a/docs/sources/packages_api/ui/indicatorscontainer.md +++ b/docs/sources/packages_api/ui/buttonprops.md @@ -2,23 +2,23 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "IndicatorsContainer" +title = "ButtonProps" keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## IndicatorsContainer variable +## ButtonProps type -### IndicatorsContainer variable +### ButtonProps type Signature ```typescript -IndicatorsContainer: (props: any) => JSX.Element +export declare type ButtonProps = CommonProps & ButtonHTMLAttributes; ``` Import ```typescript -import { IndicatorsContainer } from '@grafana/ui'; +import { ButtonProps } from '@grafana/ui'; ``` diff --git a/docs/sources/packages_api/ui/buttonselect.md b/docs/sources/packages_api/ui/buttonselect.md index 09f77ebcd8d..4110d273e64 100644 --- a/docs/sources/packages_api/ui/buttonselect.md +++ b/docs/sources/packages_api/ui/buttonselect.md @@ -8,45 +8,26 @@ type = "docs" draft = true +++ -## ButtonSelect class +## ButtonSelect() function + +### ButtonSelect() function Signature ```typescript -export declare class ButtonSelect extends PureComponent> +export declare function ButtonSelect({ placeholder, icon, variant, size, className, disabled, ...selectProps }: ButtonSelectProps): JSX.Element; ``` Import ```typescript import { ButtonSelect } from '@grafana/ui'; ``` -Properties +Parameters -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [onChange](#onchange-property) | | (item: SelectableValue<T>) => void | | - -Methods - -| Method | Modifiers | Description | +| Parameter | Type | Description | | --- | --- | --- | -| [render()](#render-method) | | | +| { placeholder, icon, variant, size, className, disabled, ...selectProps } | ButtonSelectProps<T> | | -### onChange property - -Signature - -```typescript -onChange: (item: SelectableValue) => void; -``` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` Returns: `JSX.Element` diff --git a/docs/sources/packages_api/ui/transformersuiregistry.md b/docs/sources/packages_api/ui/buttonvariant.md similarity index 61% rename from docs/sources/packages_api/ui/transformersuiregistry.md rename to docs/sources/packages_api/ui/buttonvariant.md index 6ea29e96862..bf2ad040b5e 100644 --- a/docs/sources/packages_api/ui/transformersuiregistry.md +++ b/docs/sources/packages_api/ui/buttonvariant.md @@ -2,23 +2,23 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "transformersUIRegistry" +title = "ButtonVariant" keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## transformersUIRegistry variable +## ButtonVariant type -### transformersUIRegistry variable +### ButtonVariant type Signature ```typescript -transformersUIRegistry: Registry> +export declare type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'link'; ``` Import ```typescript -import { transformersUIRegistry } from '@grafana/ui'; +import { ButtonVariant } from '@grafana/ui'; ``` diff --git a/docs/sources/packages_api/ui/cascader.md b/docs/sources/packages_api/ui/cascader.md index 410e8e077b0..db9e7b0e3a9 100644 --- a/docs/sources/packages_api/ui/cascader.md +++ b/docs/sources/packages_api/ui/cascader.md @@ -34,7 +34,6 @@ import { Cascader } from '@grafana/ui'; | [onBlur](#onblur-property) | | () => void | | | [onBlurCascade](#onblurcascade-property) | | () => void | | | [onChange](#onchange-property) | | (value: string[], selectedOptions: CascaderOption[]) => void | | -| [onClick](#onclick-property) | | () => void | | | [onCreateOption](#oncreateoption-property) | | (value: string) => void | | | [onInputKeyDown](#oninputkeydown-property) | | (e: React.KeyboardEvent<HTMLInputElement>) => void | | | [onSelect](#onselect-property) | | (obj: SelectableValue<string[]>) => void | | @@ -93,14 +92,6 @@ onBlurCascade: () => void; onChange: (value: string[], selectedOptions: CascaderOption[]) => void; ``` -### onClick property - -Signature - -```typescript -onClick: () => void; -``` - ### onCreateOption property Signature diff --git a/docs/sources/packages_api/ui/cascaderoption.md b/docs/sources/packages_api/ui/cascaderoption.md index a102c7246f2..d8b334bb56f 100644 --- a/docs/sources/packages_api/ui/cascaderoption.md +++ b/docs/sources/packages_api/ui/cascaderoption.md @@ -27,9 +27,9 @@ import { CascaderOption } from '@grafana/ui'; | [children](#children-property) | CascaderOption[] | Children will be shown in a submenu. Use 'items' instead, as 'children' exist to ensure backwards compatibility. | | [disabled](#disabled-property) | boolean | | | [items](#items-property) | CascaderOption[] | Items will be just flattened into the main list of items recursively. | -| [label](#label-property) | string | | -| [title](#title-property) | string | | -| [value](#value-property) | any | | +| [label](#label-property) | string | The label to display in the UI | +| [title](#title-property) | string | Avoid using | +| [value](#value-property) | any | The value used under the hood | ### children property @@ -61,6 +61,8 @@ items?: CascaderOption[]; ### label property +The label to display in the UI + Signature ```typescript @@ -69,6 +71,8 @@ label: string; ### title property +Avoid using + Signature ```typescript @@ -77,6 +81,8 @@ title?: string; ### value property +The value used under the hood + Signature ```typescript diff --git a/docs/sources/packages_api/ui/checkbox.md b/docs/sources/packages_api/ui/checkbox.md new file mode 100644 index 00000000000..1c86269a150 --- /dev/null +++ b/docs/sources/packages_api/ui/checkbox.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "Checkbox" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## Checkbox variable + +### Checkbox variable + +Signature + +```typescript +Checkbox: React.ForwardRefExoticComponent & React.RefAttributes> +``` +Import + +```typescript +import { Checkbox } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/clipboardbutton.md b/docs/sources/packages_api/ui/clipboardbutton.md new file mode 100644 index 00000000000..da15d0ce599 --- /dev/null +++ b/docs/sources/packages_api/ui/clipboardbutton.md @@ -0,0 +1,77 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ClipboardButton" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## ClipboardButton class + +Signature + +```typescript +export declare class ClipboardButton extends PureComponent +``` +Import + +```typescript +import { ClipboardButton } from '@grafana/ui'; +``` +Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [setRef](#setref-property) | | (elem: HTMLButtonElement) => void | | + +Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [componentDidMount()](#componentdidmount-method) | | | +| [componentWillUnmount()](#componentwillunmount-method) | | | +| [render()](#render-method) | | | + +### setRef property + +Signature + +```typescript +setRef: (elem: HTMLButtonElement) => void; +``` + +### componentDidMount method + +Signature + +```typescript +componentDidMount(): void; +``` +Returns: + +`void` + +### componentWillUnmount method + +Signature + +```typescript +componentWillUnmount(): void; +``` +Returns: + +`void` + +### render method + +Signature + +```typescript +render(): JSX.Element; +``` +Returns: + +`JSX.Element` + diff --git a/docs/sources/packages_api/ui/colorpicker.md b/docs/sources/packages_api/ui/colorpicker.md index a31d8c823b0..a0f7e6b9fcc 100644 --- a/docs/sources/packages_api/ui/colorpicker.md +++ b/docs/sources/packages_api/ui/colorpicker.md @@ -17,7 +17,7 @@ draft = true ```typescript ColorPicker: React.FunctionComponent & { children?: ColorPickerTriggerRenderer | undefined; -}, "onChange" | "color" | "children" | "onColorChange" | "enableNamedColors" | "customPickers" | "updatePopperPosition">> +}, "onChange" | "color" | "children" | "customPickers" | "onColorChange" | "enableNamedColors" | "updatePopperPosition">> ``` Import diff --git a/docs/sources/packages_api/ui/confirmbutton.md b/docs/sources/packages_api/ui/confirmbutton.md index 1cd1a7928d8..ec3799083fb 100644 --- a/docs/sources/packages_api/ui/confirmbutton.md +++ b/docs/sources/packages_api/ui/confirmbutton.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -ConfirmButton: React.FunctionComponent> +ConfirmButton: React.FunctionComponent> ``` Import diff --git a/docs/sources/packages_api/ui/nooptionsmessage.md b/docs/sources/packages_api/ui/container.md similarity index 65% rename from docs/sources/packages_api/ui/nooptionsmessage.md rename to docs/sources/packages_api/ui/container.md index 70b5d0d529b..12f75b0d534 100644 --- a/docs/sources/packages_api/ui/nooptionsmessage.md +++ b/docs/sources/packages_api/ui/container.md @@ -2,23 +2,23 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "NoOptionsMessage" +title = "Container" keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## NoOptionsMessage variable +## Container variable -### NoOptionsMessage variable +### Container variable Signature ```typescript -NoOptionsMessage: (props: any) => JSX.Element +Container: React.FC ``` Import ```typescript -import { NoOptionsMessage } from '@grafana/ui'; +import { Container } from '@grafana/ui'; ``` diff --git a/docs/sources/packages_api/ui/fieldpropertieseditor.md b/docs/sources/packages_api/ui/counter.md similarity index 64% rename from docs/sources/packages_api/ui/fieldpropertieseditor.md rename to docs/sources/packages_api/ui/counter.md index 166fa656a6c..a7cca75ec48 100644 --- a/docs/sources/packages_api/ui/fieldpropertieseditor.md +++ b/docs/sources/packages_api/ui/counter.md @@ -2,23 +2,23 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "FieldPropertiesEditor" +title = "Counter" keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## FieldPropertiesEditor variable +## Counter variable -### FieldPropertiesEditor variable +### Counter variable Signature ```typescript -FieldPropertiesEditor: React.FC +Counter: FC ``` Import ```typescript -import { FieldPropertiesEditor } from '@grafana/ui'; +import { Counter } from '@grafana/ui'; ``` diff --git a/docs/sources/packages_api/ui/datalinksinlineeditor.md b/docs/sources/packages_api/ui/datalinksinlineeditor.md new file mode 100644 index 00000000000..943505f6e46 --- /dev/null +++ b/docs/sources/packages_api/ui/datalinksinlineeditor.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "DataLinksInlineEditor" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## DataLinksInlineEditor variable + +### DataLinksInlineEditor variable + +Signature + +```typescript +DataLinksInlineEditor: React.FC +``` +Import + +```typescript +import { DataLinksInlineEditor } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/domutil.md b/docs/sources/packages_api/ui/domutil.md index dec1da7dba6..a6527f5fd49 100644 --- a/docs/sources/packages_api/ui/domutil.md +++ b/docs/sources/packages_api/ui/domutil.md @@ -10,13 +10,11 @@ draft = true ## DOMUtil namespace +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + ### DOMUtil namespace -Signature - -```typescript -export declare namespace DOMUtil -``` Import ```typescript diff --git a/docs/sources/packages_api/ui/domutil/getnextcharacter.md b/docs/sources/packages_api/ui/domutil/getnextcharacter.md index 49911981908..a10bc25c5eb 100644 --- a/docs/sources/packages_api/ui/domutil/getnextcharacter.md +++ b/docs/sources/packages_api/ui/domutil/getnextcharacter.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -function getNextCharacter(global?: any): any; +export declare function getNextCharacter(global?: any): any; ``` Import diff --git a/docs/sources/packages_api/ui/domutil/getpreviouscousin.md b/docs/sources/packages_api/ui/domutil/getpreviouscousin.md index 672228a1ec7..1ca49229a02 100644 --- a/docs/sources/packages_api/ui/domutil/getpreviouscousin.md +++ b/docs/sources/packages_api/ui/domutil/getpreviouscousin.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -function getPreviousCousin(node: any, selector: string): any; +export declare function getPreviousCousin(node: any, selector: string): any; ``` Import diff --git a/docs/sources/packages_api/ui/field.md b/docs/sources/packages_api/ui/field.md new file mode 100644 index 00000000000..d83775cf886 --- /dev/null +++ b/docs/sources/packages_api/ui/field.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "Field" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## Field variable + +### Field variable + +Signature + +```typescript +Field: React.FC +``` +Import + +```typescript +import { Field } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/numberoverrideeditor.md b/docs/sources/packages_api/ui/fieldconfigitemheadertitle.md similarity index 59% rename from docs/sources/packages_api/ui/numberoverrideeditor.md rename to docs/sources/packages_api/ui/fieldconfigitemheadertitle.md index c5e83a4d0bc..dd3ce7433bd 100644 --- a/docs/sources/packages_api/ui/numberoverrideeditor.md +++ b/docs/sources/packages_api/ui/fieldconfigitemheadertitle.md @@ -2,23 +2,23 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "NumberOverrideEditor" +title = "FieldConfigItemHeaderTitle" keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## NumberOverrideEditor variable +## FieldConfigItemHeaderTitle variable -### NumberOverrideEditor variable +### FieldConfigItemHeaderTitle variable Signature ```typescript -NumberOverrideEditor: React.FC> +FieldConfigItemHeaderTitle: React.FC ``` Import ```typescript -import { NumberOverrideEditor } from '@grafana/ui'; +import { FieldConfigItemHeaderTitle } from '@grafana/ui'; ``` diff --git a/docs/sources/packages_api/ui/fielddisplayeditor.md b/docs/sources/packages_api/ui/fielddisplayeditor.md deleted file mode 100644 index 31765b4f8b6..00000000000 --- a/docs/sources/packages_api/ui/fielddisplayeditor.md +++ /dev/null @@ -1,80 +0,0 @@ -+++ -# ----------------------------------------------------------------------- -# Do not edit this file. It is automatically generated by API Documenter. -# ----------------------------------------------------------------------- -title = "FieldDisplayEditor" -keywords = ["grafana","documentation","sdk","@grafana/ui"] -type = "docs" -draft = true -+++ - -## FieldDisplayEditor class - -Signature - -```typescript -export declare class FieldDisplayEditor extends PureComponent -``` -Import - -```typescript -import { FieldDisplayEditor } from '@grafana/ui'; -``` -Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [onCalcsChange](#oncalcschange-property) | | (calcs: string[]) => void | | -| [onDefaultsChange](#ondefaultschange-property) | | (value: FieldConfig) => void | | -| [onLimitChange](#onlimitchange-property) | | (event: React.ChangeEvent<HTMLInputElement>) => void | | -| [onShowValuesChange](#onshowvalueschange-property) | | (item: SelectableValue<boolean>) => void | | - -Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [render()](#render-method) | | | - -### onCalcsChange property - -Signature - -```typescript -onCalcsChange: (calcs: string[]) => void; -``` - -### onDefaultsChange property - -Signature - -```typescript -onDefaultsChange: (value: FieldConfig) => void; -``` - -### onLimitChange property - -Signature - -```typescript -onLimitChange: (event: React.ChangeEvent) => void; -``` - -### onShowValuesChange property - -Signature - -```typescript -onShowValuesChange: (item: SelectableValue) => void; -``` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` -Returns: - -`JSX.Element` - diff --git a/docs/sources/packages_api/ui/form.md b/docs/sources/packages_api/ui/form.md new file mode 100644 index 00000000000..ca88c1e41d0 --- /dev/null +++ b/docs/sources/packages_api/ui/form.md @@ -0,0 +1,34 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "Form" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## Form() function + +### Form() function + +Signature + +```typescript +export declare function Form({ defaultValues, onSubmit, validateOnMount, validateFieldsOnMount, children, validateOn, }: FormProps): JSX.Element; +``` +Import + +```typescript +import { Form } from '@grafana/ui'; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { defaultValues, onSubmit, validateOnMount, validateFieldsOnMount, children, validateOn, } | FormProps<T> | | + +Returns: + +`JSX.Element` + diff --git a/docs/sources/packages_api/ui/formapi.md b/docs/sources/packages_api/ui/formapi.md new file mode 100644 index 00000000000..f8f85e8616e --- /dev/null +++ b/docs/sources/packages_api/ui/formapi.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "FormAPI" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## FormAPI type + +### FormAPI type + +Signature + +```typescript +export declare type FormAPI = Pick, 'register' | 'errors' | 'control' | 'formState' | 'getValues'>; +``` +Import + +```typescript +import { FormAPI } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/forminputsize.md b/docs/sources/packages_api/ui/forminputsize.md new file mode 100644 index 00000000000..e2e6115d890 --- /dev/null +++ b/docs/sources/packages_api/ui/forminputsize.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "FormInputSize" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## FormInputSize type + +### FormInputSize type + +Signature + +```typescript +export declare type FormInputSize = 'sm' | 'md' | 'lg' | 'auto'; +``` +Import + +```typescript +import { FormInputSize } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/forms.md b/docs/sources/packages_api/ui/forms.md index 30780d31486..3c8fa7f8429 100644 --- a/docs/sources/packages_api/ui/forms.md +++ b/docs/sources/packages_api/ui/forms.md @@ -17,15 +17,17 @@ draft = true ```typescript Forms: { RadioButtonGroup: typeof RadioButtonGroup; - Switch: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; getFormStyles: (theme: import("@grafana/data").GrafanaTheme, options: { - variant: import("./Button").ButtonVariant; - size: import("../Button/types").ButtonSize; + variant: import("..").ButtonVariant; + size: import("../../types/size").ComponentSize; invalid: boolean; }) => { label: { label: string; + labelContent: string; description: string; + categories: string; + chevron: string; }; legend: { legend: string; @@ -36,7 +38,6 @@ Forms: { }; button: { button: string; - buttonWithIcon: string; iconButton: string; iconWrap: string; }; @@ -62,26 +63,49 @@ Forms: { }; }; Label: import("react").FC; - Input: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; Form: typeof Form; Field: import("react").FC; - Button: import("react").ForwardRefExoticComponent<{ - size?: "xs" | "sm" | "md" | "lg" | undefined; - variant?: "link" | "primary" | "secondary" | "destructive" | undefined; - icon?: string | undefined; - className?: string | undefined; - } & import("react").ButtonHTMLAttributes & import("react").RefAttributes>; - LinkButton: import("react").ForwardRefExoticComponent<{ - size?: "xs" | "sm" | "md" | "lg" | undefined; - variant?: "link" | "primary" | "secondary" | "destructive" | undefined; - icon?: string | undefined; - className?: string | undefined; - } & import("react").AnchorHTMLAttributes & import("react").RefAttributes>; - Select: typeof Select; - ButtonSelect: typeof ButtonSelect; - InputControl: ({ name, rules, as: InnerComponent, onChange, onBlur, onChangeName, onBlurName, valueName, defaultValue, control, ...rest }: import("react-hook-form").ControllerProps) => JSX.Element; - AsyncSelect: typeof AsyncSelect; - TextArea: import("react").FC; + InputControl: | import("react").ComponentClass | import("react").ReactElement import("react").ReactElement | null) | (new (props: any) => import("react").Component)>, ControlProp extends import("react-hook-form").Control> = import("react-hook-form").Control>>({ name, rules, as: InnerComponent, onBlur, onChange, onChangeName, onBlurName, valueName, defaultValue, control, ...rest }: import("react-hook-form").Assign<{ + name: string; + as: As; + rules?: Partial<{ + required: string | boolean | { + value: boolean; + message: string; + }; + min: string | number | { + value: string | number; + message: string; + }; + max: string | number | { + value: string | number; + message: string; + }; + maxLength: string | number | { + value: string | number; + message: string; + }; + minLength: string | number | { + value: string | number; + message: string; + }; + pattern: RegExp | { + value: RegExp; + message: string; + }; + validate: import("react-hook-form").Validate | Record; + }> | undefined; + onChange?: import("react-hook-form").EventFunction | undefined; + onBlur?: import("react-hook-form").EventFunction | undefined; + mode?: "onChange" | "onBlur" | "onSubmit" | undefined; + onChangeName?: string | undefined; + onBlurName?: string | undefined; + valueName?: string | undefined; + defaultValue?: any; + control?: ControlProp | undefined; + }, import("react-hook-form").AsProps>) => import("react").ReactElement import("react").ReactElement | null) | (new (props: any) => import("react").Component)>; + Checkbox: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; + Legend: import("react").FC; } ``` Import diff --git a/docs/sources/packages_api/ui/fullwidthbuttoncontainer.md b/docs/sources/packages_api/ui/fullwidthbuttoncontainer.md new file mode 100644 index 00000000000..c888c5af7f2 --- /dev/null +++ b/docs/sources/packages_api/ui/fullwidthbuttoncontainer.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "FullWidthButtonContainer" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## FullWidthButtonContainer variable + +### FullWidthButtonContainer variable + +Signature + +```typescript +FullWidthButtonContainer: FC +``` +Import + +```typescript +import { FullWidthButtonContainer } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/getavailableicons.md b/docs/sources/packages_api/ui/getavailableicons.md new file mode 100644 index 00000000000..edde1682127 --- /dev/null +++ b/docs/sources/packages_api/ui/getavailableicons.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "getAvailableIcons" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## getAvailableIcons variable + +### getAvailableIcons variable + +Signature + +```typescript +getAvailableIcons: () => IconName[] +``` +Import + +```typescript +import { getAvailableIcons } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/getbuttonstyles.md b/docs/sources/packages_api/ui/getbuttonstyles.md new file mode 100644 index 00000000000..116ca74cec2 --- /dev/null +++ b/docs/sources/packages_api/ui/getbuttonstyles.md @@ -0,0 +1,28 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "getButtonStyles" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## getButtonStyles variable + +### getButtonStyles variable + +Signature + +```typescript +getButtonStyles: (props: StyleProps) => { + button: string; + iconButton: string; + iconWrap: string; +} +``` +Import + +```typescript +import { getButtonStyles } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/getformstyles.md b/docs/sources/packages_api/ui/getformstyles.md new file mode 100644 index 00000000000..51f09a0293f --- /dev/null +++ b/docs/sources/packages_api/ui/getformstyles.md @@ -0,0 +1,68 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "getFormStyles" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## getFormStyles variable + +### getFormStyles variable + +Signature + +```typescript +getFormStyles: (theme: GrafanaTheme, options: { + variant: ButtonVariant; + size: ComponentSize; + invalid: boolean; +}) => { + label: { + label: string; + labelContent: string; + description: string; + categories: string; + chevron: string; + }; + legend: { + legend: string; + }; + fieldValidationMessage: { + fieldValidationMessage: string; + fieldValidationMessageIcon: string; + }; + button: { + button: string; + iconButton: string; + iconWrap: string; + }; + input: { + wrapper: string; + inputWrapper: string; + input: string; + inputDisabled: string; + addon: string; + prefix: string; + suffix: string; + loadingIndicator: string; + }; + switch: { + switch: string; + }; + checkbox: { + label: string; + description: string; + wrapper: string; + input: string; + checkmark: string; + }; +} +``` +Import + +```typescript +import { getFormStyles } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/getstandardfieldconfigs.md b/docs/sources/packages_api/ui/getstandardfieldconfigs.md new file mode 100644 index 00000000000..d69dd8361b6 --- /dev/null +++ b/docs/sources/packages_api/ui/getstandardfieldconfigs.md @@ -0,0 +1,26 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "getStandardFieldConfigs" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## getStandardFieldConfigs variable + +### getStandardFieldConfigs variable + +Returns collection of common field config properties definitions + +Signature + +```typescript +getStandardFieldConfigs: () => (FieldConfigPropertyItem | FieldConfigPropertyItem | FieldConfigPropertyItem | FieldConfigPropertyItem | FieldConfigPropertyItem)[] +``` +Import + +```typescript +import { getStandardFieldConfigs } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/getstandardoptioneditors.md b/docs/sources/packages_api/ui/getstandardoptioneditors.md new file mode 100644 index 00000000000..7ced3813dae --- /dev/null +++ b/docs/sources/packages_api/ui/getstandardoptioneditors.md @@ -0,0 +1,26 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "getStandardOptionEditors" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## getStandardOptionEditors variable + +### getStandardOptionEditors variable + +Returns collection of standard option editors definitions + +Signature + +```typescript +getStandardOptionEditors: () => (StandardEditorsRegistryItem | StandardEditorsRegistryItem | StandardEditorsRegistryItem | StandardEditorsRegistryItem | StandardEditorsRegistryItem | StandardEditorsRegistryItem | StandardEditorsRegistryItem | StandardEditorsRegistryItem)[] +``` +Import + +```typescript +import { getStandardOptionEditors } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/getstandardtransformers.md b/docs/sources/packages_api/ui/getstandardtransformers.md new file mode 100644 index 00000000000..eccb70e41ef --- /dev/null +++ b/docs/sources/packages_api/ui/getstandardtransformers.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "getStandardTransformers" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## getStandardTransformers variable + +### getStandardTransformers variable + +Signature + +```typescript +getStandardTransformers: () => TransformerRegistyItem[] +``` +Import + +```typescript +import { getStandardTransformers } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/gettagcolorsfromname.md b/docs/sources/packages_api/ui/gettagcolorsfromname.md index 10281d3b15d..9e5a4e5d4bd 100644 --- a/docs/sources/packages_api/ui/gettagcolorsfromname.md +++ b/docs/sources/packages_api/ui/gettagcolorsfromname.md @@ -17,7 +17,7 @@ Returns tag badge background and border colors based on hashed tag name. Signature ```typescript -export declare function getTagColorsFromName(name: string): { +export declare function getTagColorsFromName(name?: string): { color: string; borderColor: string; }; @@ -31,7 +31,7 @@ import { getTagColorsFromName } from '@grafana/ui'; | Parameter | Type | Description | | --- | --- | --- | -| name | string | | +| name | string | tag name | Returns: diff --git a/docs/sources/packages_api/ui/horizontalgroup.md b/docs/sources/packages_api/ui/horizontalgroup.md new file mode 100644 index 00000000000..443a4b33d6a --- /dev/null +++ b/docs/sources/packages_api/ui/horizontalgroup.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "HorizontalGroup" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## HorizontalGroup variable + +### HorizontalGroup variable + +Signature + +```typescript +HorizontalGroup: React.FC> +``` +Import + +```typescript +import { HorizontalGroup } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/icon.md b/docs/sources/packages_api/ui/icon.md index ca2aba9a70a..1b9eb646f43 100644 --- a/docs/sources/packages_api/ui/icon.md +++ b/docs/sources/packages_api/ui/icon.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -Icon: React.FC +Icon: React.ForwardRefExoticComponent> ``` Import diff --git a/docs/sources/packages_api/ui/iconbutton.md b/docs/sources/packages_api/ui/iconbutton.md new file mode 100644 index 00000000000..04174aae748 --- /dev/null +++ b/docs/sources/packages_api/ui/iconbutton.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "IconButton" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## IconButton variable + +### IconButton variable + +Signature + +```typescript +IconButton: React.ForwardRefExoticComponent> +``` +Import + +```typescript +import { IconButton } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/iconname.md b/docs/sources/packages_api/ui/iconname.md new file mode 100644 index 00000000000..5809dcfbffa --- /dev/null +++ b/docs/sources/packages_api/ui/iconname.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "IconName" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## IconName type + +### IconName type + +Signature + +```typescript +export declare type IconName = 'fa fa-spinner' | 'grafana' | 'question-circle' | 'angle-up' | 'history' | 'angle-down' | 'filter' | 'angle-left' | 'angle-right' | 'pen' | 'envelope' | 'percentage' | 'rocket' | 'power' | 'trash-alt' | 'slack' | 'download-alt' | 'mobile-android' | 'plus-square' | 'folder-plus' | 'folder-open' | 'file-copy-alt' | 'file-alt' | 'exchange-alt' | 'import' | 'exclamation-triangle' | 'times' | 'signin' | 'cloud-upload' | 'step-backward' | 'square-shape' | 'share-alt' | 'tag-alt' | 'forward' | 'check' | 'check-circle' | 'copy' | 'lock' | 'unlock' | 'panel-add' | 'arrow-random' | 'arrow-down' | 'arrows-h' | 'comment-alt' | 'code-branch' | 'arrow-right' | 'circle' | 'arrow-up' | 'arrow-from-right' | 'keyboard' | 'search' | 'chart-line' | 'search-minus' | 'clock-nine' | 'sync' | 'sign-in-alt' | 'cllud-download' | 'cog' | 'bars' | 'save' | 'apps' | 'link' | 'upload' | 'columns' | 'home-alt' | 'channel-add' | 'calendar-alt' | 'play' | 'pause' | 'calculator-alt' | 'compass' | 'sliders-v-alt' | 'bell' | 'database' | 'user' | 'camera' | 'plug' | 'shield' | 'key-skeleton-alt' | 'users-alt' | 'graph-bar' | 'book' | 'bolt' | 'comments-alt' | 'document-info' | 'info-circle' | 'bug' | 'cube' | 'star' | 'list-ul' | 'edit' | 'eye' | 'eye-slash' | 'monitor' | 'plus-circle' | 'arrow-left' | 'repeat' | 'external-link-alt' | 'minus' | 'signal' | 'search-plus' | 'minus-circle' | 'table' | 'plus' | 'heart' | 'heart-break' | 'ellipsis-v' | 'favorite'; +``` +Import + +```typescript +import { IconName } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/iconsize.md b/docs/sources/packages_api/ui/iconsize.md new file mode 100644 index 00000000000..476b258fb60 --- /dev/null +++ b/docs/sources/packages_api/ui/iconsize.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "IconSize" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## IconSize type + +### IconSize type + +Signature + +```typescript +export declare type IconSize = ComponentSize | 'xl' | 'xxl' | 'xxxl'; +``` +Import + +```typescript +import { IconSize } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/icontype.md b/docs/sources/packages_api/ui/icontype.md new file mode 100644 index 00000000000..13b7f7b530f --- /dev/null +++ b/docs/sources/packages_api/ui/icontype.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "IconType" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## IconType type + +### IconType type + +Signature + +```typescript +export declare type IconType = 'mono' | 'default'; +``` +Import + +```typescript +import { IconType } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/input.md b/docs/sources/packages_api/ui/input.md index a362b2c9e68..31a7523a549 100644 --- a/docs/sources/packages_api/ui/input.md +++ b/docs/sources/packages_api/ui/input.md @@ -8,93 +8,17 @@ type = "docs" draft = true +++ -## Input class +## Input variable + +### Input variable Signature ```typescript -export declare class Input extends PureComponent +Input: React.ForwardRefExoticComponent & React.RefAttributes> ``` Import ```typescript import { Input } from '@grafana/ui'; ``` -Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [defaultProps](#defaultprops-property) | static | {
className: string;
} | | -| [isInvalid](#isinvalid-property) | | boolean | | -| [populateEventPropsWithStatus](#populateeventpropswithstatus-property) | | (restProps: any, validationEvents: ValidationEvents | undefined) => any | | -| [state](#state-property) | | State | | -| [status](#status-property) | | InputStatus | | -| [validatorAsync](#validatorasync-property) | | (validationRules: ValidationRule[]) => (evt: React.ChangeEvent<HTMLInputElement>) => void | | - -Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [render()](#render-method) | | | - -### defaultProps property - -Signature - -```typescript -static defaultProps: { - className: string; - }; -``` - -### isInvalid property - -Signature - -```typescript -get isInvalid(): boolean; -``` - -### populateEventPropsWithStatus property - -Signature - -```typescript -populateEventPropsWithStatus: (restProps: any, validationEvents: ValidationEvents | undefined) => any; -``` - -### state property - -Signature - -```typescript -state: State; -``` - -### status property - -Signature - -```typescript -get status(): InputStatus; -``` - -### validatorAsync property - -Signature - -```typescript -validatorAsync: (validationRules: ValidationRule[]) => (evt: React.ChangeEvent) => void; -``` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` -Returns: - -`JSX.Element` - diff --git a/docs/sources/packages_api/ui/jsonexplorer.md b/docs/sources/packages_api/ui/jsonexplorer.md index b8354e74fd2..770075bbf98 100644 --- a/docs/sources/packages_api/ui/jsonexplorer.md +++ b/docs/sources/packages_api/ui/jsonexplorer.md @@ -61,10 +61,10 @@ constructor(json: any, open?: number, config?: JsonExplorerConfig, key?: string | Parameter | Type | Description | | --- | --- | --- | -| json | any | | -| open | number | | -| config | JsonExplorerConfig | | -| key | string | undefined | | +| json | any | The JSON object you want to render. It has to be an object or array. Do NOT pass raw JSON string. | +| open | number | his number indicates up to how many levels the rendered tree should expand. Set it to 0 to make the whole tree collapsed or set it to Infinity to expand the tree deeply | +| config | JsonExplorerConfig | defaultConfig = { hoverPreviewEnabled: false, hoverPreviewArrayCount: 100, hoverPreviewFieldCount: 5 }Available configurations: \#\#\#\#\#Hover Preview \* hoverPreviewEnabled: enable preview on hover \* hoverPreviewArrayCount: number of array items to show in preview Any array larger than this number will be shown as Array[XXX] where XXX is length of the array. \* hoverPreviewFieldCount: number of object properties to show for object preview. Any object with more properties that thin number will be truncated. | +| key | string | undefined | The key that this object in it's parent context | ### json property diff --git a/docs/sources/packages_api/ui/label.md b/docs/sources/packages_api/ui/label.md new file mode 100644 index 00000000000..9fd6dcb5b9c --- /dev/null +++ b/docs/sources/packages_api/ui/label.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "Label" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## Label variable + +### Label variable + +Signature + +```typescript +Label: React.FC +``` +Import + +```typescript +import { Label } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/legacyforms.md b/docs/sources/packages_api/ui/legacyforms.md new file mode 100644 index 00000000000..73d683c7d40 --- /dev/null +++ b/docs/sources/packages_api/ui/legacyforms.md @@ -0,0 +1,32 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "LegacyForms" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## LegacyForms variable + +### LegacyForms variable + +Signature + +```typescript +LegacyForms: { + Select: typeof Select; + AsyncSelect: typeof AsyncSelect; + IndicatorsContainer: (props: any) => JSX.Element; + NoOptionsMessage: (props: any) => JSX.Element; + ButtonSelect: typeof ButtonSelect; + Input: typeof Input; + Switch: typeof Switch; +} +``` +Import + +```typescript +import { LegacyForms } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/inputstatus.md b/docs/sources/packages_api/ui/legacyinputstatus.md similarity index 73% rename from docs/sources/packages_api/ui/inputstatus.md rename to docs/sources/packages_api/ui/legacyinputstatus.md index 4a5f2c2e130..2336858dbde 100644 --- a/docs/sources/packages_api/ui/inputstatus.md +++ b/docs/sources/packages_api/ui/legacyinputstatus.md @@ -2,25 +2,25 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "InputStatus" +title = "LegacyInputStatus" keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## InputStatus enum +## LegacyInputStatus enum -### InputStatus enum +### LegacyInputStatus enum Signature ```typescript -export declare enum InputStatus +export declare enum LegacyInputStatus ``` Import ```typescript -import { InputStatus } from '@grafana/ui'; +import { LegacyInputStatus } from '@grafana/ui'; ``` ## Enumeration Members diff --git a/docs/sources/packages_api/ui/legend.md b/docs/sources/packages_api/ui/legend.md new file mode 100644 index 00000000000..f12a00317f4 --- /dev/null +++ b/docs/sources/packages_api/ui/legend.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "Legend" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## Legend variable + +### Legend variable + +Signature + +```typescript +Legend: React.FC +``` +Import + +```typescript +import { Legend } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/linkbutton.md b/docs/sources/packages_api/ui/linkbutton.md index 8836ca58498..4b1a16963ea 100644 --- a/docs/sources/packages_api/ui/linkbutton.md +++ b/docs/sources/packages_api/ui/linkbutton.md @@ -15,9 +15,7 @@ draft = true Signature ```typescript -LinkButton: React.ForwardRefExoticComponent & { - disabled?: boolean | undefined; -} & React.RefAttributes> +LinkButton: React.ForwardRefExoticComponent & React.RefAttributes> ``` Import diff --git a/docs/sources/packages_api/ui/linkmodeltocontextmenuitems.md b/docs/sources/packages_api/ui/linkmodeltocontextmenuitems.md index 04a0037669d..ddfccf340ca 100644 --- a/docs/sources/packages_api/ui/linkmodeltocontextmenuitems.md +++ b/docs/sources/packages_api/ui/linkmodeltocontextmenuitems.md @@ -17,7 +17,7 @@ Delays creating links until we need to open the ContextMenu Signature ```typescript -linkModelToContextMenuItems: (links: LinkModelSupplier) => ContextMenuItem[] +linkModelToContextMenuItems: (links: () => LinkModel[]) => ContextMenuItem[] ``` Import diff --git a/docs/sources/packages_api/ui/modal.md b/docs/sources/packages_api/ui/modal.md index 4d5e10902d0..e81c5839e9c 100644 --- a/docs/sources/packages_api/ui/modal.md +++ b/docs/sources/packages_api/ui/modal.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -Modal: React.FunctionComponent> +Modal: React.FunctionComponent> ``` Import diff --git a/docs/sources/packages_api/ui/modalheader.md b/docs/sources/packages_api/ui/modalheader.md new file mode 100644 index 00000000000..5ff7d10e8ab --- /dev/null +++ b/docs/sources/packages_api/ui/modalheader.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ModalHeader" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## ModalHeader variable + +### ModalHeader variable + +Signature + +```typescript +ModalHeader: React.FC +``` +Import + +```typescript +import { ModalHeader } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/modalroot.md b/docs/sources/packages_api/ui/modalroot.md new file mode 100644 index 00000000000..aa07f1dc40f --- /dev/null +++ b/docs/sources/packages_api/ui/modalroot.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ModalRoot" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## ModalRoot variable + +### ModalRoot variable + +Signature + +```typescript +ModalRoot: () => JSX.Element +``` +Import + +```typescript +import { ModalRoot } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/modalscontroller.md b/docs/sources/packages_api/ui/modalscontroller.md new file mode 100644 index 00000000000..ab07ac69c77 --- /dev/null +++ b/docs/sources/packages_api/ui/modalscontroller.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ModalsController" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## ModalsController variable + +### ModalsController variable + +Signature + +```typescript +ModalsController: React.Consumer +``` +Import + +```typescript +import { ModalsController } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/modalsprovider.md b/docs/sources/packages_api/ui/modalsprovider.md new file mode 100644 index 00000000000..8df1350e3c1 --- /dev/null +++ b/docs/sources/packages_api/ui/modalsprovider.md @@ -0,0 +1,83 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ModalsProvider" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## ModalsProvider class + +Signature + +```typescript +export declare class ModalsProvider extends React.Component +``` +Import + +```typescript +import { ModalsProvider } from '@grafana/ui'; +``` +Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [constructor(props)](#constructor-props) | | Constructs a new instance of the ModalsProvider class | + +Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [hideModal](#hidemodal-property) | | () => void | | +| [showModal](#showmodal-property) | | (component: React.ComponentType<any>, props: any) => void | | + +Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [render()](#render-method) | | | + +### constructor(props) + +Constructs a new instance of the `ModalsProvider` class + +Signature + +```typescript +constructor(props: ModalsProviderProps); +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| props | ModalsProviderProps | | + +### hideModal property + +Signature + +```typescript +hideModal: () => void; +``` + +### showModal property + +Signature + +```typescript +showModal: (component: React.ComponentType, props: any) => void; +``` + +### render method + +Signature + +```typescript +render(): JSX.Element; +``` +Returns: + +`JSX.Element` + diff --git a/docs/sources/packages_api/ui/modaltabcontent.md b/docs/sources/packages_api/ui/modaltabcontent.md new file mode 100644 index 00000000000..256a89b702d --- /dev/null +++ b/docs/sources/packages_api/ui/modaltabcontent.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ModalTabContent" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## ModalTabContent variable + +### ModalTabContent variable + +Signature + +```typescript +ModalTabContent: React.FC +``` +Import + +```typescript +import { ModalTabContent } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/modaltabsheader.md b/docs/sources/packages_api/ui/modaltabsheader.md new file mode 100644 index 00000000000..5c1a81f69bb --- /dev/null +++ b/docs/sources/packages_api/ui/modaltabsheader.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "ModalTabsHeader" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## ModalTabsHeader variable + +### ModalTabsHeader variable + +Signature + +```typescript +ModalTabsHeader: React.FC +``` +Import + +```typescript +import { ModalTabsHeader } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/runtime/setdatasourcesrv.md b/docs/sources/packages_api/ui/multiselect.md similarity index 53% rename from docs/sources/packages_api/runtime/setdatasourcesrv.md rename to docs/sources/packages_api/ui/multiselect.md index aa6273dbbf8..bcb698d107f 100644 --- a/docs/sources/packages_api/runtime/setdatasourcesrv.md +++ b/docs/sources/packages_api/ui/multiselect.md @@ -2,33 +2,33 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "setDataSourceSrv" -keywords = ["grafana","documentation","sdk","@grafana/runtime"] +title = "MultiSelect" +keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## setDataSourceSrv() function +## MultiSelect() function -### setDataSourceSrv() function +### MultiSelect() function Signature ```typescript -export declare function setDataSourceSrv(instance: DataSourceSrv): void; +export declare function MultiSelect(props: MultiSelectCommonProps): JSX.Element; ``` Import ```typescript -import { setDataSourceSrv } from '@grafana/runtime'; +import { MultiSelect } from '@grafana/ui'; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | -| instance | DataSourceSrv | | +| props | MultiSelectCommonProps<T> | | Returns: -`void` +`JSX.Element` diff --git a/docs/sources/packages_api/ui/pagination.md b/docs/sources/packages_api/ui/pagination.md new file mode 100644 index 00000000000..2e575969fbd --- /dev/null +++ b/docs/sources/packages_api/ui/pagination.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "Pagination" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## Pagination variable + +### Pagination variable + +Signature + +```typescript +Pagination: React.FC +``` +Import + +```typescript +import { Pagination } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/queryfield.md b/docs/sources/packages_api/ui/queryfield.md index dc21011344c..10ab0a698b6 100644 --- a/docs/sources/packages_api/ui/queryfield.md +++ b/docs/sources/packages_api/ui/queryfield.md @@ -51,7 +51,6 @@ import { QueryField } from '@grafana/ui'; | [componentDidUpdate(prevProps, prevState)](#componentdidupdate-method) | | | | [componentWillUnmount()](#componentwillunmount-method) | | | | [render()](#render-method) | | | -| [UNSAFE\_componentWillReceiveProps(nextProps)](#unsafe_componentwillreceiveprops-method) | | | ### constructor(props, context) @@ -204,20 +203,3 @@ render(): JSX.Element; `JSX.Element` -### UNSAFE\_componentWillReceiveProps method - -Signature - -```typescript -UNSAFE_componentWillReceiveProps(nextProps: QueryFieldProps): void; -``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| nextProps | QueryFieldProps | | - -Returns: - -`void` - diff --git a/docs/sources/packages_api/ui/radiobuttongroup.md b/docs/sources/packages_api/ui/radiobuttongroup.md new file mode 100644 index 00000000000..68f32cd68ef --- /dev/null +++ b/docs/sources/packages_api/ui/radiobuttongroup.md @@ -0,0 +1,31 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "RadioButtonGroup" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## RadioButtonGroup namespace + +### RadioButtonGroup namespace + +Signature + +```typescript +export declare namespace RadioButtonGroup +``` +Import + +```typescript +import { RadioButtonGroup } from '@grafana/ui'; +``` + +## Variables + +| Variable | Description | +| --- | --- | +| [displayName](./displayname/) | | + diff --git a/docs/sources/packages_api/ui/radiobuttongroup/displayname.md b/docs/sources/packages_api/ui/radiobuttongroup/displayname.md new file mode 100644 index 00000000000..8cff5ca7a01 --- /dev/null +++ b/docs/sources/packages_api/ui/radiobuttongroup/displayname.md @@ -0,0 +1,25 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "displayName" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## RadioButtonGroup.displayName variable + +### RadioButtonGroup.displayName variable + +Signature + +```typescript +displayName: string +``` +Import + +```typescript +import { RadioButtonGroup } from '@grafana/ui'; +const { displayName } = RadioButtonGroup; +``` diff --git a/docs/sources/packages_api/ui/renderorcalltorender.md b/docs/sources/packages_api/ui/renderorcalltorender.md new file mode 100644 index 00000000000..40e1b6a83d7 --- /dev/null +++ b/docs/sources/packages_api/ui/renderorcalltorender.md @@ -0,0 +1,37 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "renderOrCallToRender" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## renderOrCallToRender() function + +### renderOrCallToRender() function + +Given react node or function returns element accordingly + +Signature + +```typescript +export declare function renderOrCallToRender(itemToRender: ((props?: TProps) => React.ReactNode) | React.ReactNode, props?: TProps): React.ReactNode; +``` +Import + +```typescript +import { renderOrCallToRender } from '@grafana/ui'; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| itemToRender | ((props?: TProps) => React.ReactNode) | React.ReactNode | | +| props | TProps | props to be passed to the function if item provided as such | + +Returns: + +`React.ReactNode` + diff --git a/docs/sources/packages_api/ui/select.md b/docs/sources/packages_api/ui/select.md index ab57a13ce32..09fb4f9cb6e 100644 --- a/docs/sources/packages_api/ui/select.md +++ b/docs/sources/packages_api/ui/select.md @@ -8,45 +8,26 @@ type = "docs" draft = true +++ -## Select class +## Select() function + +### Select() function Signature ```typescript -export declare class Select extends PureComponent> +export declare function Select(props: SelectCommonProps): JSX.Element; ``` Import ```typescript import { Select } from '@grafana/ui'; ``` -Properties +Parameters -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [defaultProps](#defaultprops-property) | static | Partial<LegacySelectProps<any>> | | - -Methods - -| Method | Modifiers | Description | +| Parameter | Type | Description | | --- | --- | --- | -| [render()](#render-method) | | | +| props | SelectCommonProps<T> | | -### defaultProps property - -Signature - -```typescript -static defaultProps: Partial>; -``` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` Returns: `JSX.Element` diff --git a/docs/sources/packages_api/ui/selectvalueeditor.md b/docs/sources/packages_api/ui/selectvalueeditor.md new file mode 100644 index 00000000000..c5c4baba0de --- /dev/null +++ b/docs/sources/packages_api/ui/selectvalueeditor.md @@ -0,0 +1,34 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "SelectValueEditor" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## SelectValueEditor() function + +### SelectValueEditor() function + +Signature + +```typescript +export declare function SelectValueEditor({ value, onChange, item, }: FieldConfigEditorProps>): JSX.Element; +``` +Import + +```typescript +import { SelectValueEditor } from '@grafana/ui'; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| { value, onChange, item, } | FieldConfigEditorProps<T, SelectFieldConfigSettings<T>> | | + +Returns: + +`JSX.Element` + diff --git a/docs/sources/packages_api/ui/sharedsinglestatpanelchangedhandler.md b/docs/sources/packages_api/ui/sharedsinglestatpanelchangedhandler.md index 0e4a0dafc2d..179f0f3a6b9 100644 --- a/docs/sources/packages_api/ui/sharedsinglestatpanelchangedhandler.md +++ b/docs/sources/packages_api/ui/sharedsinglestatpanelchangedhandler.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -export declare function sharedSingleStatPanelChangedHandler(options: Partial | any, prevPluginId: string, prevOptions: any): any; +export declare function sharedSingleStatPanelChangedHandler(panel: PanelModel> | any, prevPluginId: string, prevOptions: any): any; ``` Import @@ -26,7 +26,7 @@ import { sharedSingleStatPanelChangedHandler } from '@grafana/ui'; | Parameter | Type | Description | | --- | --- | --- | -| options | Partial<SingleStatBaseOptions> | any | | +| panel | PanelModel<Partial<SingleStatBaseOptions>> | any | | | prevPluginId | string | | | prevOptions | any | | diff --git a/docs/sources/packages_api/ui/singlestatbaseoptions.md b/docs/sources/packages_api/ui/singlestatbaseoptions.md index 08ebf14b06f..514c7e9d817 100644 --- a/docs/sources/packages_api/ui/singlestatbaseoptions.md +++ b/docs/sources/packages_api/ui/singlestatbaseoptions.md @@ -24,16 +24,8 @@ import { SingleStatBaseOptions } from '@grafana/ui'; | Property | Type | Description | | --- | --- | --- | -| [fieldOptions](#fieldoptions-property) | FieldDisplayOptions | | | [orientation](#orientation-property) | VizOrientation | | - -### fieldOptions property - -Signature - -```typescript -fieldOptions: FieldDisplayOptions; -``` +| [reduceOptions](#reduceoptions-property) | ReduceDataOptions | | ### orientation property @@ -42,3 +34,11 @@ fieldOptions: FieldDisplayOptions; ```typescript orientation: VizOrientation; ``` + +### reduceOptions property + +Signature + +```typescript +reduceOptions: ReduceDataOptions; +``` diff --git a/docs/sources/packages_api/ui/slider.md b/docs/sources/packages_api/ui/slider.md new file mode 100644 index 00000000000..1ed75b04bfa --- /dev/null +++ b/docs/sources/packages_api/ui/slider.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "Slider" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## Slider variable + +### Slider variable + +Signature + +```typescript +Slider: FunctionComponent +``` +Import + +```typescript +import { Slider } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/statspicker.md b/docs/sources/packages_api/ui/statspicker.md index f1e812a5a56..83c9a34acf1 100644 --- a/docs/sources/packages_api/ui/statspicker.md +++ b/docs/sources/packages_api/ui/statspicker.md @@ -25,7 +25,7 @@ import { StatsPicker } from '@grafana/ui'; | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [checkInput](#checkinput-property) | | () => void | | -| [defaultProps](#defaultprops-property) | static | {
width: number;
allowMultiple: boolean;
} | | +| [defaultProps](#defaultprops-property) | static | Partial<Props> | | | [onSelectionChange](#onselectionchange-property) | | (item: SelectableValue<string>) => void | | Methods @@ -49,10 +49,7 @@ checkInput: () => void; Signature ```typescript -static defaultProps: { - width: number; - allowMultiple: boolean; - }; +static defaultProps: Partial; ``` ### onSelectionChange property diff --git a/docs/sources/packages_api/ui/stringoverrideeditor.md b/docs/sources/packages_api/ui/stringoverrideeditor.md deleted file mode 100644 index ca0e674459b..00000000000 --- a/docs/sources/packages_api/ui/stringoverrideeditor.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -# ----------------------------------------------------------------------- -# Do not edit this file. It is automatically generated by API Documenter. -# ----------------------------------------------------------------------- -title = "StringOverrideEditor" -keywords = ["grafana","documentation","sdk","@grafana/ui"] -type = "docs" -draft = true -+++ - -## StringOverrideEditor variable - -### StringOverrideEditor variable - -Signature - -```typescript -StringOverrideEditor: React.FC> -``` -Import - -```typescript -import { StringOverrideEditor } from '@grafana/ui'; -``` diff --git a/docs/sources/packages_api/ui/stylemixins.md b/docs/sources/packages_api/ui/stylemixins.md index 0c6f5125f92..8ba67936dca 100644 --- a/docs/sources/packages_api/ui/stylemixins.md +++ b/docs/sources/packages_api/ui/stylemixins.md @@ -10,13 +10,11 @@ draft = true ## styleMixins namespace +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + ### styleMixins namespace -Signature - -```typescript -export declare namespace styleMixins -``` Import ```typescript @@ -28,5 +26,7 @@ import { styleMixins } from '@grafana/ui'; | Function | Description | | --- | --- | | [cardChrome(theme)](./cardchrome/) | | +| [hoverColor(color, theme)](./hovercolor/) | | | [listItem(theme)](./listitem/) | | +| [listItemSelected(theme)](./listitemselected/) | | diff --git a/docs/sources/packages_api/ui/stylemixins/cardchrome.md b/docs/sources/packages_api/ui/stylemixins/cardchrome.md index b7ea443efa7..71d5b067de9 100644 --- a/docs/sources/packages_api/ui/stylemixins/cardchrome.md +++ b/docs/sources/packages_api/ui/stylemixins/cardchrome.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -function cardChrome(theme: GrafanaTheme): string; +export declare function cardChrome(theme: GrafanaTheme): string; ``` Import diff --git a/docs/sources/packages_api/ui/stylemixins/hovercolor.md b/docs/sources/packages_api/ui/stylemixins/hovercolor.md new file mode 100644 index 00000000000..8b072e1ba38 --- /dev/null +++ b/docs/sources/packages_api/ui/stylemixins/hovercolor.md @@ -0,0 +1,36 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "hoverColor" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## styleMixins.hoverColor() function + +### styleMixins.hoverColor() function + +Signature + +```typescript +export declare function hoverColor(color: string, theme: GrafanaTheme): string; +``` +Import + +```typescript +import { styleMixins } from '@grafana/ui'; +const { hoverColor } = styleMixins; +``` +Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| color | string | | +| theme | GrafanaTheme | | + +Returns: + +`string` + diff --git a/docs/sources/packages_api/ui/stylemixins/listitem.md b/docs/sources/packages_api/ui/stylemixins/listitem.md index 104c833f519..773e5a6f1a4 100644 --- a/docs/sources/packages_api/ui/stylemixins/listitem.md +++ b/docs/sources/packages_api/ui/stylemixins/listitem.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -function listItem(theme: GrafanaTheme): string; +export declare function listItem(theme: GrafanaTheme): string; ``` Import diff --git a/docs/sources/packages_api/runtime/setechosrv.md b/docs/sources/packages_api/ui/stylemixins/listitemselected.md similarity index 50% rename from docs/sources/packages_api/runtime/setechosrv.md rename to docs/sources/packages_api/ui/stylemixins/listitemselected.md index 962444e4cea..6515038fba4 100644 --- a/docs/sources/packages_api/runtime/setechosrv.md +++ b/docs/sources/packages_api/ui/stylemixins/listitemselected.md @@ -2,33 +2,34 @@ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- -title = "setEchoSrv" -keywords = ["grafana","documentation","sdk","@grafana/runtime"] +title = "listItemSelected" +keywords = ["grafana","documentation","sdk","@grafana/ui"] type = "docs" draft = true +++ -## setEchoSrv() function +## styleMixins.listItemSelected() function -### setEchoSrv() function +### styleMixins.listItemSelected() function Signature ```typescript -export declare function setEchoSrv(instance: EchoSrv): void; +export declare function listItemSelected(theme: GrafanaTheme): string; ``` Import ```typescript -import { setEchoSrv } from '@grafana/runtime'; +import { styleMixins } from '@grafana/ui'; +const { listItemSelected } = styleMixins; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | -| instance | EchoSrv | | +| theme | GrafanaTheme | | Returns: -`void` +`string` diff --git a/docs/sources/packages_api/ui/styleprops.md b/docs/sources/packages_api/ui/styleprops.md new file mode 100644 index 00000000000..d6dec202310 --- /dev/null +++ b/docs/sources/packages_api/ui/styleprops.md @@ -0,0 +1,71 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "StyleProps" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## StyleProps interface + +Signature + +```typescript +export interface StyleProps +``` +Import + +```typescript +import { StyleProps } from '@grafana/ui'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [hasIcon](#hasicon-property) | boolean | | +| [hasText](#hastext-property) | boolean | | +| [size](#size-property) | ComponentSize | | +| [theme](#theme-property) | GrafanaTheme | | +| [variant](#variant-property) | ButtonVariant | | + +### hasIcon property + +Signature + +```typescript +hasIcon: boolean; +``` + +### hasText property + +Signature + +```typescript +hasText: boolean; +``` + +### size property + +Signature + +```typescript +size: ComponentSize; +``` + +### theme property + +Signature + +```typescript +theme: GrafanaTheme; +``` + +### variant property + +Signature + +```typescript +variant: ButtonVariant; +``` diff --git a/docs/sources/packages_api/ui/stylesfactory.md b/docs/sources/packages_api/ui/stylesfactory.md index 77cdca33b37..f39eeb3d113 100644 --- a/docs/sources/packages_api/ui/stylesfactory.md +++ b/docs/sources/packages_api/ui/stylesfactory.md @@ -28,7 +28,7 @@ import { stylesFactory } from '@grafana/ui'; | Parameter | Type | Description | | --- | --- | --- | -| stylesCreator | ResultFn | | +| stylesCreator | ResultFn | function accepting dependencies based on which styles are created | Returns: diff --git a/docs/sources/packages_api/ui/switch.md b/docs/sources/packages_api/ui/switch.md index f1daf731eb3..5b0d88b782e 100644 --- a/docs/sources/packages_api/ui/switch.md +++ b/docs/sources/packages_api/ui/switch.md @@ -8,57 +8,17 @@ type = "docs" draft = true +++ -## Switch class +## Switch variable + +### Switch variable Signature ```typescript -export declare class Switch extends PureComponent +Switch: React.ForwardRefExoticComponent & React.RefAttributes> ``` Import ```typescript import { Switch } from '@grafana/ui'; ``` -Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [internalOnChange](#internalonchange-property) | | (event: React.FormEvent<HTMLInputElement>) => void | | -| [state](#state-property) | | {
id: string;
} | | - -Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [render()](#render-method) | | | - -### internalOnChange property - -Signature - -```typescript -internalOnChange: (event: React.FormEvent) => void; -``` - -### state property - -Signature - -```typescript -state: { - id: string; - }; -``` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` -Returns: - -`JSX.Element` - diff --git a/docs/sources/packages_api/ui/table.md b/docs/sources/packages_api/ui/table.md index 7e5942b79a8..8b5129aaf64 100644 --- a/docs/sources/packages_api/ui/table.md +++ b/docs/sources/packages_api/ui/table.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -Table: ({ data, height, onCellClick, width }: Props) => JSX.Element +Table: FC ``` Import diff --git a/docs/sources/packages_api/ui/tag.md b/docs/sources/packages_api/ui/tag.md new file mode 100644 index 00000000000..cb2118a16ee --- /dev/null +++ b/docs/sources/packages_api/ui/tag.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "Tag" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## Tag variable + +### Tag variable + +Signature + +```typescript +Tag: React.ForwardRefExoticComponent> +``` +Import + +```typescript +import { Tag } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/taglist.md b/docs/sources/packages_api/ui/taglist.md new file mode 100644 index 00000000000..e2a359ce698 --- /dev/null +++ b/docs/sources/packages_api/ui/taglist.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "TagList" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## TagList variable + +### TagList variable + +Signature + +```typescript +TagList: FC +``` +Import + +```typescript +import { TagList } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/textarea.md b/docs/sources/packages_api/ui/textarea.md new file mode 100644 index 00000000000..6bc00a2d761 --- /dev/null +++ b/docs/sources/packages_api/ui/textarea.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "TextArea" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## TextArea variable + +### TextArea variable + +Signature + +```typescript +TextArea: React.ForwardRefExoticComponent & React.RefAttributes> +``` +Import + +```typescript +import { TextArea } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/thresholdseditor.md b/docs/sources/packages_api/ui/thresholdseditor.md deleted file mode 100644 index b66da107758..00000000000 --- a/docs/sources/packages_api/ui/thresholdseditor.md +++ /dev/null @@ -1,137 +0,0 @@ -+++ -# ----------------------------------------------------------------------- -# Do not edit this file. It is automatically generated by API Documenter. -# ----------------------------------------------------------------------- -title = "ThresholdsEditor" -keywords = ["grafana","documentation","sdk","@grafana/ui"] -type = "docs" -draft = true -+++ - -## ThresholdsEditor class - -Signature - -```typescript -export declare class ThresholdsEditor extends PureComponent -``` -Import - -```typescript -import { ThresholdsEditor } from '@grafana/ui'; -``` -Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [constructor(props)](#constructor-props) | | Constructs a new instance of the ThresholdsEditor class | - -Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [onAddThresholdAfter](#onaddthresholdafter-property) | | (threshold: ThresholdWithKey) => void | | -| [onBlur](#onblur-property) | | () => void | | -| [onChange](#onchange-property) | | () => void | | -| [onChangeThresholdColor](#onchangethresholdcolor-property) | | (threshold: ThresholdWithKey, color: string) => void | | -| [onChangeThresholdValue](#onchangethresholdvalue-property) | | (event: React.ChangeEvent<HTMLInputElement>, threshold: ThresholdWithKey) => void | | -| [onModeChanged](#onmodechanged-property) | | (item: SelectableValue<ThresholdsMode>) => void | | -| [onRemoveThreshold](#onremovethreshold-property) | | (threshold: ThresholdWithKey) => void | | -| [renderInput](#renderinput-property) | | (threshold: ThresholdWithKey) => JSX.Element | | - -Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [render()](#render-method) | | | - -### constructor(props) - -Constructs a new instance of the `ThresholdsEditor` class - -Signature - -```typescript -constructor(props: Props); -``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| props | Props | | - -### onAddThresholdAfter property - -Signature - -```typescript -onAddThresholdAfter: (threshold: ThresholdWithKey) => void; -``` - -### onBlur property - -Signature - -```typescript -onBlur: () => void; -``` - -### onChange property - -Signature - -```typescript -onChange: () => void; -``` - -### onChangeThresholdColor property - -Signature - -```typescript -onChangeThresholdColor: (threshold: ThresholdWithKey, color: string) => void; -``` - -### onChangeThresholdValue property - -Signature - -```typescript -onChangeThresholdValue: (event: React.ChangeEvent, threshold: ThresholdWithKey) => void; -``` - -### onModeChanged property - -Signature - -```typescript -onModeChanged: (item: SelectableValue) => void; -``` - -### onRemoveThreshold property - -Signature - -```typescript -onRemoveThreshold: (threshold: ThresholdWithKey) => void; -``` - -### renderInput property - -Signature - -```typescript -renderInput: (threshold: ThresholdWithKey) => JSX.Element; -``` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` -Returns: - -`JSX.Element` - diff --git a/docs/sources/packages_api/ui/timepicker.md b/docs/sources/packages_api/ui/timepicker.md deleted file mode 100644 index bea5a6b76b0..00000000000 --- a/docs/sources/packages_api/ui/timepicker.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -# ----------------------------------------------------------------------- -# Do not edit this file. It is automatically generated by API Documenter. -# ----------------------------------------------------------------------- -title = "TimePicker" -keywords = ["grafana","documentation","sdk","@grafana/ui"] -type = "docs" -draft = true -+++ - -## TimePicker variable - -### TimePicker variable - -Signature - -```typescript -TimePicker: React.FunctionComponent> -``` -Import - -```typescript -import { TimePicker } from '@grafana/ui'; -``` diff --git a/docs/sources/packages_api/ui/timerangepicker.md b/docs/sources/packages_api/ui/timerangepicker.md new file mode 100644 index 00000000000..ee0bc9d8279 --- /dev/null +++ b/docs/sources/packages_api/ui/timerangepicker.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "TimeRangePicker" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## TimeRangePicker variable + +### TimeRangePicker variable + +Signature + +```typescript +TimeRangePicker: React.FunctionComponent> +``` +Import + +```typescript +import { TimeRangePicker } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/transformationrow.md b/docs/sources/packages_api/ui/transformationrow.md deleted file mode 100644 index b74e7c3a8f9..00000000000 --- a/docs/sources/packages_api/ui/transformationrow.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -# ----------------------------------------------------------------------- -# Do not edit this file. It is automatically generated by API Documenter. -# ----------------------------------------------------------------------- -title = "TransformationRow" -keywords = ["grafana","documentation","sdk","@grafana/ui"] -type = "docs" -draft = true -+++ - -## TransformationRow variable - -### TransformationRow variable - -Signature - -```typescript -TransformationRow: ({ onRemove, editor, name, input }: TransformationRowProps) => JSX.Element -``` -Import - -```typescript -import { TransformationRow } from '@grafana/ui'; -``` diff --git a/docs/sources/packages_api/ui/transformationseditor.md b/docs/sources/packages_api/ui/transformationseditor.md deleted file mode 100644 index d9d91222f14..00000000000 --- a/docs/sources/packages_api/ui/transformationseditor.md +++ /dev/null @@ -1,91 +0,0 @@ -+++ -# ----------------------------------------------------------------------- -# Do not edit this file. It is automatically generated by API Documenter. -# ----------------------------------------------------------------------- -title = "TransformationsEditor" -keywords = ["grafana","documentation","sdk","@grafana/ui"] -type = "docs" -draft = true -+++ - -## TransformationsEditor class - -Signature - -```typescript -export declare class TransformationsEditor extends React.PureComponent -``` -Import - -```typescript -import { TransformationsEditor } from '@grafana/ui'; -``` -Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [onTransformationAdd](#ontransformationadd-property) | | () => void | | -| [onTransformationChange](#ontransformationchange-property) | | (idx: number, config: DataTransformerConfig<any>) => void | | -| [onTransformationRemove](#ontransformationremove-property) | | (idx: number) => void | | -| [renderTransformationEditors](#rendertransformationeditors-property) | | () => JSX.Element | undefined | | -| [state](#state-property) | | {
updateCounter: number;
} | | - -Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [render()](#render-method) | | | - -### onTransformationAdd property - -Signature - -```typescript -onTransformationAdd: () => void; -``` - -### onTransformationChange property - -Signature - -```typescript -onTransformationChange: (idx: number, config: DataTransformerConfig) => void; -``` - -### onTransformationRemove property - -Signature - -```typescript -onTransformationRemove: (idx: number) => void; -``` - -### renderTransformationEditors property - -Signature - -```typescript -renderTransformationEditors: () => JSX.Element | undefined; -``` - -### state property - -Signature - -```typescript -state: { - updateCounter: number; - }; -``` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` -Returns: - -`JSX.Element` - diff --git a/docs/sources/packages_api/ui/valuemappingseditor.md b/docs/sources/packages_api/ui/valuemappingseditor.md deleted file mode 100644 index 60496bcf714..00000000000 --- a/docs/sources/packages_api/ui/valuemappingseditor.md +++ /dev/null @@ -1,110 +0,0 @@ -+++ -# ----------------------------------------------------------------------- -# Do not edit this file. It is automatically generated by API Documenter. -# ----------------------------------------------------------------------- -title = "ValueMappingsEditor" -keywords = ["grafana","documentation","sdk","@grafana/ui"] -type = "docs" -draft = true -+++ - -## ValueMappingsEditor class - -Signature - -```typescript -export declare class ValueMappingsEditor extends PureComponent -``` -Import - -```typescript -import { ValueMappingsEditor } from '@grafana/ui'; -``` -Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [constructor(props)](#constructor-props) | | Constructs a new instance of the ValueMappingsEditor class | - -Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [onAddMapping](#onaddmapping-property) | | () => void | | -| [onRemoveMapping](#onremovemapping-property) | | (id: number) => void | | -| [updateGauge](#updategauge-property) | | (mapping: ValueMapping) => void | | - -Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [getMaxIdFromValueMappings(mappings)](#getmaxidfromvaluemappings-method) | | | -| [render()](#render-method) | | | - -### constructor(props) - -Constructs a new instance of the `ValueMappingsEditor` class - -Signature - -```typescript -constructor(props: Props); -``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| props | Props | | - -### onAddMapping property - -Signature - -```typescript -onAddMapping: () => void; -``` - -### onRemoveMapping property - -Signature - -```typescript -onRemoveMapping: (id: number) => void; -``` - -### updateGauge property - -Signature - -```typescript -updateGauge: (mapping: ValueMapping) => void; -``` - -### getMaxIdFromValueMappings method - -Signature - -```typescript -getMaxIdFromValueMappings(mappings: ValueMapping[]): number; -``` -Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| mappings | ValueMapping[] | | - -Returns: - -`number` - -### render method - -Signature - -```typescript -render(): JSX.Element; -``` -Returns: - -`JSX.Element` - diff --git a/docs/sources/packages_api/ui/valuepicker.md b/docs/sources/packages_api/ui/valuepicker.md index 50e1234d834..b64c6c1510a 100644 --- a/docs/sources/packages_api/ui/valuepicker.md +++ b/docs/sources/packages_api/ui/valuepicker.md @@ -15,7 +15,7 @@ draft = true Signature ```typescript -export declare function ValuePicker({ label, icon, options, onChange, variant }: ValuePickerProps): JSX.Element; +export declare function ValuePicker({ label, icon, options, onChange, variant, size, isFullWidth, }: ValuePickerProps): JSX.Element; ``` Import @@ -26,7 +26,7 @@ import { ValuePicker } from '@grafana/ui'; | Parameter | Type | Description | | --- | --- | --- | -| { label, icon, options, onChange, variant } | ValuePickerProps<T> | | +| { label, icon, options, onChange, variant, size, isFullWidth, } | ValuePickerProps<T> | | Returns: diff --git a/docs/sources/packages_api/ui/verticalgroup.md b/docs/sources/packages_api/ui/verticalgroup.md new file mode 100644 index 00000000000..ea7cee5d84c --- /dev/null +++ b/docs/sources/packages_api/ui/verticalgroup.md @@ -0,0 +1,24 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "VerticalGroup" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## VerticalGroup variable + +### VerticalGroup variable + +Signature + +```typescript +VerticalGroup: React.FC> +``` +Import + +```typescript +import { VerticalGroup } from '@grafana/ui'; +``` diff --git a/docs/sources/packages_api/ui/vizrepeater.md b/docs/sources/packages_api/ui/vizrepeater.md index 2ca33b0677e..13d0a155de8 100644 --- a/docs/sources/packages_api/ui/vizrepeater.md +++ b/docs/sources/packages_api/ui/vizrepeater.md @@ -39,6 +39,7 @@ import { VizRepeater } from '@grafana/ui'; | [componentDidUpdate(prevProps)](#componentdidupdate-method) | | | | [getOrientation()](#getorientation-method) | | | | [render()](#render-method) | | | +| [renderGrid()](#rendergrid-method) | | | ### constructor(props) @@ -102,3 +103,14 @@ render(): JSX.Element; `JSX.Element` +### renderGrid method + +Signature + +```typescript +renderGrid(): JSX.Element; +``` +Returns: + +`JSX.Element` + diff --git a/docs/sources/packages_api/ui/vizrepeaterrendervalueprops.md b/docs/sources/packages_api/ui/vizrepeaterrendervalueprops.md new file mode 100644 index 00000000000..fc601b1f242 --- /dev/null +++ b/docs/sources/packages_api/ui/vizrepeaterrendervalueprops.md @@ -0,0 +1,71 @@ ++++ +# ----------------------------------------------------------------------- +# Do not edit this file. It is automatically generated by API Documenter. +# ----------------------------------------------------------------------- +title = "VizRepeaterRenderValueProps" +keywords = ["grafana","documentation","sdk","@grafana/ui"] +type = "docs" +draft = true ++++ + +## VizRepeaterRenderValueProps interface + +Signature + +```typescript +export interface VizRepeaterRenderValueProps +``` +Import + +```typescript +import { VizRepeaterRenderValueProps } from '@grafana/ui'; +``` +Properties + +| Property | Type | Description | +| --- | --- | --- | +| [alignmentFactors](#alignmentfactors-property) | D | | +| [height](#height-property) | number | | +| [orientation](#orientation-property) | VizOrientation | | +| [value](#value-property) | V | | +| [width](#width-property) | number | | + +### alignmentFactors property + +Signature + +```typescript +alignmentFactors: D; +``` + +### height property + +Signature + +```typescript +height: number; +``` + +### orientation property + +Signature + +```typescript +orientation: VizOrientation; +``` + +### value property + +Signature + +```typescript +value: V; +``` + +### width property + +Signature + +```typescript +width: number; +``` diff --git a/package.json b/package.json index 366801ec109..eae360e41e8 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "jest-ci": "mkdir -p reports/junit && export JEST_JUNIT_OUTPUT_DIR=reports/junit && jest --ci --reporters=default --reporters=jest-junit --maxWorkers 2", "lint": "eslint public/app e2e/suite1 public/test --ext=.js,.ts,.tsx", "lint:fix": "yarn lint --fix", - "packages:build": "lerna run clean && lerna run build", - "packages:docsExtract": "rm -rf ./scripts/docs && lerna run docsExtract", + "packages:build": "lerna run clean && lerna run build --ignore @grafana-plugins/input-datasource", + "packages:docsExtract": "rm -rf ./reports/docs && lerna run docsExtract", "packages:docsToMarkdown": "api-documenter markdown --input-folder ./reports/docs/ --output-folder ./docs/sources/packages_api/ --hugo --draft", "packages:lint": "lerna run lint", "packages:prepare": "lerna version --no-push --no-git-tag-version --force-publish --exact", diff --git a/packages/grafana-data/package.json b/packages/grafana-data/package.json index abe8c841ec1..95d59a6e044 100644 --- a/packages/grafana-data/package.json +++ b/packages/grafana-data/package.json @@ -18,7 +18,7 @@ "build": "grafana-toolkit package:build --scope=data", "bundle": "rollup -c rollup.config.ts", "clean": "rimraf ./dist ./compiled", - "docsExtract": "api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log", + "docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log", "lint": "eslint src/ --ext=.js,.ts,.tsx", "typecheck": "tsc --noEmit" }, diff --git a/packages/grafana-data/src/types/config.ts b/packages/grafana-data/src/types/config.ts index 706231a3abb..93c7a0df544 100644 --- a/packages/grafana-data/src/types/config.ts +++ b/packages/grafana-data/src/types/config.ts @@ -3,7 +3,7 @@ import { PanelPluginMeta } from './panel'; import { GrafanaTheme } from './theme'; /** - * Describes the build information that will be available via the Grafana cofiguration. + * Describes the build information that will be available via the Grafana configuration. * * @public */ diff --git a/packages/grafana-data/src/types/datasource.ts b/packages/grafana-data/src/types/datasource.ts index 09434572b37..54191d9d23e 100644 --- a/packages/grafana-data/src/types/datasource.ts +++ b/packages/grafana-data/src/types/datasource.ts @@ -371,7 +371,7 @@ export interface DataQueryResponse { } /** - * These are the common properties avaliable to all queries in all datasources + * These are the common properties available to all queries in all datasources * Specific implementations will extend this interface adding the required properties * for the given context */ diff --git a/packages/grafana-data/src/types/fieldOverrides.ts b/packages/grafana-data/src/types/fieldOverrides.ts index 3264443cc98..cc760a20e1b 100644 --- a/packages/grafana-data/src/types/fieldOverrides.ts +++ b/packages/grafana-data/src/types/fieldOverrides.ts @@ -86,7 +86,7 @@ export interface FieldConfigEditorConfig boolean; diff --git a/packages/grafana-e2e/package.json b/packages/grafana-e2e/package.json index ad079f7bd9e..7095c451792 100644 --- a/packages/grafana-e2e/package.json +++ b/packages/grafana-e2e/package.json @@ -23,7 +23,7 @@ "build": "grafana-toolkit package:build --scope=e2e", "bundle": "rollup -c rollup.config.ts", "clean": "rimraf ./dist ./compiled", - "docsExtract": "api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log", + "docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log", "lint": "eslint cypress/ src/ --ext=.js,.ts,.tsx", "open": "cypress open", "start": "cypress run", diff --git a/packages/grafana-runtime/package.json b/packages/grafana-runtime/package.json index c75298f6dd0..28a88afa41e 100644 --- a/packages/grafana-runtime/package.json +++ b/packages/grafana-runtime/package.json @@ -18,7 +18,7 @@ "build": "grafana-toolkit package:build --scope=runtime", "bundle": "rollup -c rollup.config.ts", "clean": "rimraf ./dist ./compiled", - "docsExtract": "api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log", + "docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log", "lint": "eslint src/ --ext=.js,.ts,.tsx", "typecheck": "tsc --noEmit" }, diff --git a/packages/grafana-runtime/src/services/AngularLoader.ts b/packages/grafana-runtime/src/services/AngularLoader.ts index 8948e9e8922..b9eb563ddd5 100644 --- a/packages/grafana-runtime/src/services/AngularLoader.ts +++ b/packages/grafana-runtime/src/services/AngularLoader.ts @@ -1,6 +1,6 @@ /** * Used to enable rendering of Angular components within a - * React component without loosing proper typings. + * React component without losing proper typings. * * @example * ```typescript diff --git a/packages/grafana-runtime/src/services/EchoSrv.ts b/packages/grafana-runtime/src/services/EchoSrv.ts index 23e127e7e18..bea4ffa1632 100644 --- a/packages/grafana-runtime/src/services/EchoSrv.ts +++ b/packages/grafana-runtime/src/services/EchoSrv.ts @@ -27,7 +27,7 @@ export interface EchoMeta { */ userLogin: string; /** - * The current users uniqe identifier. + * The current users unique identifier. */ userId: number; /** diff --git a/packages/grafana-runtime/src/services/backendSrv.ts b/packages/grafana-runtime/src/services/backendSrv.ts index 9e107709bbe..77e01fbaff2 100644 --- a/packages/grafana-runtime/src/services/backendSrv.ts +++ b/packages/grafana-runtime/src/services/backendSrv.ts @@ -43,7 +43,7 @@ export type BackendSrvRequest = { * a datasource etc. The BackendSrv is using the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API | Fetch API} * under the hood to handle all the communication. * - * The request function can be used to perform a remote call by specifing a {@link BackendSrvRequest}. + * The request function can be used to perform a remote call by specifying a {@link BackendSrvRequest}. * To make the BackendSrv a bit easier to use we have added a couple of shorthand functions that will * use default values executing the request. * diff --git a/packages/grafana-runtime/src/services/templateSrv.ts b/packages/grafana-runtime/src/services/templateSrv.ts index 3362b581fcc..7b6fe6df195 100644 --- a/packages/grafana-runtime/src/services/templateSrv.ts +++ b/packages/grafana-runtime/src/services/templateSrv.ts @@ -4,7 +4,7 @@ import { VariableModel } from '@grafana/data'; * Via the TemplateSrv consumers get access to all the available template variables * that can be used within the current active dashboard. * - * For a mor in-depth description visit: https://grafana.com/docs/grafana/latest/reference/templating + * For a more in-depth description visit: https://grafana.com/docs/grafana/latest/reference/templating * @public */ export interface TemplateSrv { diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json index 9db4b586dc1..489895c6149 100644 --- a/packages/grafana-ui/package.json +++ b/packages/grafana-ui/package.json @@ -20,7 +20,7 @@ "build": "grafana-toolkit package:build --scope=ui", "bundle": "rollup -c rollup.config.ts", "clean": "rimraf ./dist ./compiled", - "docsExtract": "api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log", + "docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log", "lint": "eslint .storybook/ src/ --ext=.js,.ts,.tsx", "storybook": "start-storybook -p 9001 -c .storybook -s .storybook/static", "storybook:build": "build-storybook -o ./dist/storybook -c .storybook -s .storybook/static", diff --git a/packages/grafana-ui/src/components/Logs/LogRowContextProvider.tsx b/packages/grafana-ui/src/components/Logs/LogRowContextProvider.tsx index b11c33244cf..8e332b2059a 100644 --- a/packages/grafana-ui/src/components/Logs/LogRowContextProvider.tsx +++ b/packages/grafana-ui/src/components/Logs/LogRowContextProvider.tsx @@ -77,7 +77,7 @@ export const getRowContexts = async ( if (idField) { // For Loki this means we filter only the one row. Issue is we could have other rows logged at the same // ns which came before but they come in the response that search for logs after. This means right now - // we will show those as if they came after. This is not strictly correct but seems better than loosing them + // we will show those as if they came after. This is not strictly correct but seems better than losing them // and making this correct would mean quite a bit of complexity to shuffle things around and messing up //counts. if (idField.values.get(fieldIndex) === row.uid) { diff --git a/public/app/features/dashboard/components/PanelEditor/types.ts b/public/app/features/dashboard/components/PanelEditor/types.ts index 3cb069e3696..63d181fdc6b 100644 --- a/public/app/features/dashboard/components/PanelEditor/types.ts +++ b/public/app/features/dashboard/components/PanelEditor/types.ts @@ -19,7 +19,7 @@ export enum DisplayMode { } export const displayModes = [ - { value: DisplayMode.Fill, label: 'Fill', description: 'Use all avaliable space' }, + { value: DisplayMode.Fill, label: 'Fill', description: 'Use all available space' }, { value: DisplayMode.Fit, label: 'Fit', description: 'Fit in the space keeping ratio' }, { value: DisplayMode.Exact, label: 'Exact', description: 'Same size as the dashboard' }, ]; diff --git a/public/app/plugins/datasource/loki/result_transformer.ts b/public/app/plugins/datasource/loki/result_transformer.ts index 12e8dc2eb5f..b10ea6a06c3 100644 --- a/public/app/plugins/datasource/loki/result_transformer.ts +++ b/public/app/plugins/datasource/loki/result_transformer.ts @@ -56,7 +56,7 @@ export function legacyLogStreamToDataFrame( const ts = entry.ts || entry.timestamp; // iso string with nano precision, will be truncated but is parse-able times.add(ts); - // So this matches new format, we are loosing precision here, which sucks but no easy way to keep it and this + // So this matches new format, we are losing precision here, which sucks but no easy way to keep it and this // is for old pre 1.0.0 version Loki so probably does not affect that much. timesNs.add(dateTime(ts).valueOf() + '000000'); lines.add(entry.line); diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index b6d51ad5fd4..abd1aeaa957 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -700,7 +700,7 @@ function getColorForValue(data: any, value: number) { //------------------------------------------------ // Private utility functions -// Something like this should be avaliable in a +// Something like this should be available in a // DataFrame[] abstraction helper //------------------------------------------------