@grafana/scenes 5.14.8--canary.858.10850008598.0 → 5.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/CHANGELOG.md +23 -6
  2. package/dist/esm/behaviors/SceneQueryController.js +5 -60
  3. package/dist/esm/behaviors/SceneQueryController.js.map +1 -1
  4. package/dist/esm/components/SceneRefreshPicker.js +1 -4
  5. package/dist/esm/components/SceneRefreshPicker.js.map +1 -1
  6. package/dist/esm/components/SceneTimePicker.js +2 -1
  7. package/dist/esm/components/SceneTimePicker.js.map +1 -1
  8. package/dist/esm/components/VizPanel/VizPanel.js +6 -9
  9. package/dist/esm/components/VizPanel/VizPanel.js.map +1 -1
  10. package/dist/esm/core/SceneTimeRange.js +2 -13
  11. package/dist/esm/core/SceneTimeRange.js.map +1 -1
  12. package/dist/esm/core/sceneGraph/index.js +3 -3
  13. package/dist/esm/core/sceneGraph/index.js.map +1 -1
  14. package/dist/esm/core/sceneGraph/sceneGraph.js +26 -1
  15. package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
  16. package/dist/esm/index.js +1 -0
  17. package/dist/esm/index.js.map +1 -1
  18. package/dist/esm/querying/DataProviderProxy.js +37 -0
  19. package/dist/esm/querying/DataProviderProxy.js.map +1 -0
  20. package/dist/esm/querying/SceneQueryRunner.js +3 -1
  21. package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
  22. package/dist/esm/querying/registerQueryWithController.js +2 -19
  23. package/dist/esm/querying/registerQueryWithController.js.map +1 -1
  24. package/dist/esm/utils/getDataSource.js +1 -17
  25. package/dist/esm/utils/getDataSource.js.map +1 -1
  26. package/dist/esm/variables/adhoc/AdHocFilterRenderer.js +8 -12
  27. package/dist/esm/variables/adhoc/AdHocFilterRenderer.js.map +1 -1
  28. package/dist/esm/variables/adhoc/AdHocFiltersVariableUrlSyncHandler.js +4 -1
  29. package/dist/esm/variables/adhoc/AdHocFiltersVariableUrlSyncHandler.js.map +1 -1
  30. package/dist/esm/variables/components/VariableValueSelect.js +0 -5
  31. package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
  32. package/dist/esm/variables/utils.js.map +1 -1
  33. package/dist/esm/variables/variants/MultiValueVariable.js.map +1 -1
  34. package/dist/esm/variables/variants/TestVariable.js.map +1 -1
  35. package/dist/index.d.ts +43 -44
  36. package/dist/index.js +266 -488
  37. package/dist/index.js.map +1 -1
  38. package/package.json +2 -2
  39. package/dist/esm/behaviors/SceneRenderProfiler.js +0 -169
  40. package/dist/esm/behaviors/SceneRenderProfiler.js.map +0 -1
  41. package/dist/esm/core/sceneGraph/getQueryController.js +0 -19
  42. package/dist/esm/core/sceneGraph/getQueryController.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -945,6 +945,20 @@ declare class UserActionEvent extends BusEventWithPayload<UserActionEventPayload
945
945
  */
946
946
  declare function lookupVariable(name: string, sceneObject: SceneObject): SceneVariable | null;
947
947
 
948
+ /**
949
+ * Will walk up the scene object graph to the closest $timeRange scene object
950
+ */
951
+ declare function getTimeRange(sceneObject: SceneObject): SceneTimeRangeLike;
952
+
953
+ interface SceneQueryStateControllerState extends SceneObjectState {
954
+ isRunning: boolean;
955
+ }
956
+ interface SceneQueryControllerLike extends SceneObject<SceneQueryStateControllerState> {
957
+ isQueryController: true;
958
+ cancelAll(): void;
959
+ queryStarted(entry: SceneQueryControllerEntry): void;
960
+ queryCompleted(entry: SceneQueryControllerEntry): void;
961
+ }
948
962
  interface QueryResultWithState {
949
963
  state: LoadingState;
950
964
  }
@@ -954,40 +968,17 @@ interface SceneQueryControllerEntry {
954
968
  origin: SceneObject;
955
969
  cancel?: () => void;
956
970
  }
957
- type SceneQueryControllerEntryType = 'data' | 'annotations' | 'variable' | 'alerts' | 'plugin';
958
- interface SceneInteractionProfileEvent {
959
- origin: string;
960
- duration: number;
961
- networkDuration: number;
962
- jsHeapSizeLimit: number;
963
- usedJSHeapSize: number;
964
- totalJSHeapSize: number;
965
- crumbs: string[];
966
- }
967
- interface SceneQueryStateControllerState extends SceneObjectState {
968
- isRunning: boolean;
969
- enableProfiling?: boolean;
970
- onProfileComplete?(event: SceneInteractionProfileEvent): void;
971
- }
972
- interface SceneQueryControllerLike extends SceneObject<SceneQueryStateControllerState> {
971
+ type SceneQueryControllerEntryType = 'data' | 'annotations' | 'variable' | 'alerts';
972
+ declare class SceneQueryController extends SceneObjectBase<SceneQueryStateControllerState> implements SceneQueryControllerLike {
973
+ #private;
973
974
  isQueryController: true;
974
- cancelAll(): void;
975
+ constructor();
975
976
  queryStarted(entry: SceneQueryControllerEntry): void;
976
977
  queryCompleted(entry: SceneQueryControllerEntry): void;
977
- startProfile(source: SceneObject): void;
978
- runningQueriesCount(): number;
978
+ private changeRunningQueryCount;
979
+ cancelAll(): void;
979
980
  }
980
981
 
981
- /**
982
- * Returns the closest query controller undefined if none found
983
- */
984
- declare function getQueryController(sceneObject: SceneObject): SceneQueryControllerLike | undefined;
985
-
986
- /**
987
- * Will walk up the scene object graph to the closest $timeRange scene object
988
- */
989
- declare function getTimeRange(sceneObject: SceneObject): SceneTimeRangeLike;
990
-
991
982
  interface UrlSyncManagerLike {
992
983
  initSync(root: SceneObject): void;
993
984
  cleanUp(root: SceneObject): void;
@@ -1089,6 +1080,15 @@ declare function getAncestor<ParentType>(sceneObject: SceneObject, ancestorType:
1089
1080
  * This will search down the full scene graph, looking for objects that match the provided descendentType type.
1090
1081
  */
1091
1082
  declare function findDescendents<T extends SceneObject>(scene: SceneObject, descendentType: SceneType<T>): T[];
1083
+ /**
1084
+ * Returns the closest query controller undefined if none found
1085
+ */
1086
+ declare function getQueryController(sceneObject: SceneObject): SceneQueryControllerLike | undefined;
1087
+ /**
1088
+ * Returns the closest SceneObject that has a state property with the
1089
+ * name urlSyncManager that is of type UrlSyncManager
1090
+ */
1091
+ declare function getUrlSyncManager(sceneObject: SceneObject): UrlSyncManagerLike | undefined;
1092
1092
 
1093
1093
  declare const sceneGraph: {
1094
1094
  getVariables: typeof getVariables;
@@ -1104,8 +1104,9 @@ declare const sceneGraph: {
1104
1104
  findObject: typeof findObject;
1105
1105
  findAllObjects: typeof findAllObjects;
1106
1106
  getAncestor: typeof getAncestor;
1107
- getQueryController: typeof getQueryController;
1108
1107
  findDescendents: typeof findDescendents;
1108
+ getQueryController: typeof getQueryController;
1109
+ getUrlSyncManager: typeof getUrlSyncManager;
1109
1110
  };
1110
1111
 
1111
1112
  interface ActWhenVariableChangedState extends SceneObjectState {
@@ -1151,19 +1152,6 @@ declare class PanelContextEventBus implements EventBus {
1151
1152
  newScopedBus(key: string, filter: EventFilterOptions): EventBus;
1152
1153
  }
1153
1154
 
1154
- declare class SceneQueryController extends SceneObjectBase<SceneQueryStateControllerState> implements SceneQueryControllerLike {
1155
- #private;
1156
- isQueryController: true;
1157
- private profiler;
1158
- constructor(state?: Partial<SceneQueryStateControllerState>);
1159
- runningQueriesCount: () => number;
1160
- startProfile(source: SceneObject): void;
1161
- queryStarted(entry: SceneQueryControllerEntry): void;
1162
- queryCompleted(entry: SceneQueryControllerEntry): void;
1163
- private changeRunningQueryCount;
1164
- cancelAll(): void;
1165
- }
1166
-
1167
1155
  interface LiveNowTimerState extends SceneObjectState {
1168
1156
  enabled: boolean;
1169
1157
  }
@@ -1434,6 +1422,17 @@ declare class SceneQueryRunner extends SceneObjectBase<QueryRunnerState> impleme
1434
1422
  private isQueryModeAuto;
1435
1423
  }
1436
1424
 
1425
+ interface DataProviderSharerState extends SceneDataState {
1426
+ source: SceneObjectRef<SceneDataProvider>;
1427
+ }
1428
+ declare class DataProviderProxy extends SceneObjectBase<DataProviderSharerState> implements SceneDataProvider {
1429
+ constructor(state: DataProviderSharerState);
1430
+ setContainerWidth(width: number): void;
1431
+ isDataReadyToDisplay(): boolean;
1432
+ cancelQuery(): void;
1433
+ getResultsStream(): Observable<SceneDataProviderResult>;
1434
+ }
1435
+
1437
1436
  type ExtraQueryDataProcessor = (primary: PanelData, secondary: PanelData) => Observable<PanelData>;
1438
1437
  interface ExtraQueryDescriptor {
1439
1438
  req: DataQueryRequest;
@@ -2768,4 +2767,4 @@ declare const sceneUtils: {
2768
2767
  isGroupByVariable: typeof isGroupByVariable;
2769
2768
  };
2770
2769
 
2771
- export { AdHocFiltersVariable, CancelActivationHandler, ConstantVariable, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariable, CustomVariableValue, DataLayerFilter, DataRequestEnricher, DataSourceVariable, DeepPartial, EmbeddedScene, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, FiltersRequestEnricher, FormatVariable, GroupByVariable, InterpolationFormatParameter, IntervalVariable, LocalValueVariable, MacroVariableConstructor, MultiValueVariable, MultiValueVariableState, NestedScene, NewSceneObjectAddedEvent, PanelBuilders, PanelOptionsBuilders, QueryRunnerState, QueryVariable, RuntimeDataSource, SafeSerializableSceneObject, SceneActivationHandler, SceneApp, SceneAppDrilldownView, SceneAppPage, SceneAppPageLike, SceneAppPageState, SceneAppRoute, SceneByFrameRepeater, SceneByVariableRepeater, SceneCSSGridItem, SceneCSSGridLayout, SceneCanvasText, SceneComponent, SceneComponentProps, SceneControlsSpacer, SceneDataLayerBase, SceneDataLayerControls, SceneDataLayerProvider, SceneDataLayerProviderState, SceneDataLayerSet, SceneDataLayerSetBase, SceneDataNode, SceneDataProvider, SceneDataProviderResult, SceneDataQuery, SceneDataState, SceneDataTransformer, SceneDataTransformerState, SceneDeactivationHandler, SceneDebugger, SceneFlexItem, SceneFlexItemLike, SceneFlexItemState, SceneFlexLayout, SceneGridItem, SceneGridItemLike, SceneGridItemStateLike, SceneGridLayout, SceneGridRow, SceneInteractionProfileEvent, SceneLayout, SceneLayoutChildOptions, SceneLayoutState, SceneObject, SceneObjectBase, SceneObjectRef, SceneObjectState, SceneObjectStateChangedEvent, SceneObjectStateChangedPayload, SceneObjectUrlSyncConfig, SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues, SceneObjectWithUrlSync, SceneQueryControllerEntry, SceneQueryControllerEntryType, SceneQueryControllerLike, SceneQueryRunner, SceneReactObject, SceneRefreshPicker, SceneRefreshPickerState, SceneRouteMatch, SceneStateChangedHandler, SceneStatelessBehavior, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeLike, SceneTimeRangeState, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneUrlSyncOptions, SceneVariable, SceneVariableDependencyConfigLike, SceneVariableSet, SceneVariableSetState, SceneVariableState, SceneVariableValueChangedEvent, SceneVariables, SplitLayout, TestVariable, TextBoxVariable, UrlSyncContextProvider, UrlSyncManager, UrlSyncManagerLike, UseStateHookOptions, UserActionEvent, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableDependencyConfig, VariableGetOptionsArgs, VariableValue, VariableValueControl, VariableValueOption, VariableValueSelectWrapper, VariableValueSelectors, VariableValueSingle, VizConfig, VizConfigBuilder, VizConfigBuilders, VizPanel, VizPanelBuilder, VizPanelMenu, VizPanelState, index$1 as behaviors, index as dataLayers, formatRegistry, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isFiltersRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, renderSelectForVariable, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState, useUrlSync };
2770
+ export { AdHocFiltersVariable, CancelActivationHandler, ConstantVariable, ControlsLayout, CustomFormatterVariable, CustomTransformOperator, CustomTransformerDefinition, CustomVariable, CustomVariableValue, DataLayerFilter, DataProviderProxy, DataRequestEnricher, DataSourceVariable, DeepPartial, EmbeddedScene, EmbeddedSceneState, ExtraQueryDataProcessor, ExtraQueryDescriptor, ExtraQueryProvider, FieldConfigBuilder, FieldConfigBuilders, FieldConfigOverridesBuilder, FiltersRequestEnricher, FormatVariable, GroupByVariable, InterpolationFormatParameter, IntervalVariable, LocalValueVariable, MacroVariableConstructor, MultiValueVariable, MultiValueVariableState, NestedScene, NewSceneObjectAddedEvent, PanelBuilders, PanelOptionsBuilders, QueryRunnerState, QueryVariable, RuntimeDataSource, SafeSerializableSceneObject, SceneActivationHandler, SceneApp, SceneAppDrilldownView, SceneAppPage, SceneAppPageLike, SceneAppPageState, SceneAppRoute, SceneByFrameRepeater, SceneByVariableRepeater, SceneCSSGridItem, SceneCSSGridLayout, SceneCanvasText, SceneComponent, SceneComponentProps, SceneControlsSpacer, SceneDataLayerBase, SceneDataLayerControls, SceneDataLayerProvider, SceneDataLayerProviderState, SceneDataLayerSet, SceneDataLayerSetBase, SceneDataNode, SceneDataProvider, SceneDataProviderResult, SceneDataQuery, SceneDataState, SceneDataTransformer, SceneDataTransformerState, SceneDeactivationHandler, SceneDebugger, SceneFlexItem, SceneFlexItemLike, SceneFlexItemState, SceneFlexLayout, SceneGridItem, SceneGridItemLike, SceneGridItemStateLike, SceneGridLayout, SceneGridRow, SceneLayout, SceneLayoutChildOptions, SceneLayoutState, SceneObject, SceneObjectBase, SceneObjectRef, SceneObjectState, SceneObjectStateChangedEvent, SceneObjectStateChangedPayload, SceneObjectUrlSyncConfig, SceneObjectUrlSyncHandler, SceneObjectUrlValue, SceneObjectUrlValues, SceneObjectWithUrlSync, SceneQueryControllerEntry, SceneQueryControllerEntryType, SceneQueryControllerLike, SceneQueryRunner, SceneReactObject, SceneRefreshPicker, SceneRefreshPickerState, SceneRouteMatch, SceneStateChangedHandler, SceneStatelessBehavior, SceneTimePicker, SceneTimeRange, SceneTimeRangeCompare, SceneTimeRangeLike, SceneTimeRangeState, SceneTimeRangeTransformerBase, SceneTimeZoneOverride, SceneToolbarButton, SceneToolbarInput, SceneUrlSyncOptions, SceneVariable, SceneVariableDependencyConfigLike, SceneVariableSet, SceneVariableSetState, SceneVariableState, SceneVariableValueChangedEvent, SceneVariables, SplitLayout, TestVariable, TextBoxVariable, UrlSyncContextProvider, UrlSyncManager, UrlSyncManagerLike, UseStateHookOptions, UserActionEvent, ValidateAndUpdateResult, VariableCustomFormatterFn, VariableDependencyConfig, VariableGetOptionsArgs, VariableValue, VariableValueControl, VariableValueOption, VariableValueSelectWrapper, VariableValueSelectors, VariableValueSingle, VizConfig, VizConfigBuilder, VizConfigBuilders, VizPanel, VizPanelBuilder, VizPanelMenu, VizPanelState, index$1 as behaviors, index as dataLayers, formatRegistry, isCustomVariableValue, isDataLayer, isDataRequestEnricher, isFiltersRequestEnricher, isSceneObject, registerQueryWithController, registerRuntimeDataSource, renderSelectForVariable, sceneGraph, sceneUtils, useSceneApp, useSceneObjectState, useUrlSync };