@grafana/scenes 4.26.1--canary.734.9385486259.0 → 4.26.1--canary.770.9385565703.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -2071,11 +2071,7 @@ async function getDataSource(datasource, scopedVars) {
2071
2071
  }
2072
2072
 
2073
2073
  function writeSceneLog(logger, message, ...rest) {
2074
- let loggingEnabled = false;
2075
- if (typeof window !== "undefined") {
2076
- loggingEnabled = localStorage.getItem("grafana.debug.scenes") === "true";
2077
- }
2078
- if (loggingEnabled) {
2074
+ if (window.grafanaSceneLogging) {
2079
2075
  console.log(`${logger}: `, message, ...rest);
2080
2076
  }
2081
2077
  }
@@ -2959,6 +2955,7 @@ const OptionWithCheckbox = ({
2959
2955
  isSelected,
2960
2956
  renderOptionLabel
2961
2957
  }) => {
2958
+ var _b;
2962
2959
  const _a = innerProps, rest = __objRest$3(_a, ["onMouseMove", "onMouseOver"]);
2963
2960
  const theme = ui.useTheme2();
2964
2961
  const selectStyles = ui.getSelectStyles(theme);
@@ -2967,17 +2964,17 @@ const OptionWithCheckbox = ({
2967
2964
  ref: innerRef,
2968
2965
  className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
2969
2966
  }, rest), {
2970
- "aria-label": "Select option",
2971
- "data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(
2972
- data.label || String(data.value)
2973
- ),
2967
+ "data-testid": e2eSelectors.selectors.components.Select.option,
2974
2968
  title: data.title
2975
2969
  }), /* @__PURE__ */ React__default["default"].createElement("div", {
2976
2970
  className: optionStyles.checkbox
2977
2971
  }, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
2978
2972
  value: isSelected
2979
2973
  })), /* @__PURE__ */ React__default["default"].createElement("div", {
2980
- className: selectStyles.optionBody
2974
+ className: selectStyles.optionBody,
2975
+ "data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(
2976
+ (_b = data.label) != null ? _b : String(data.value)
2977
+ )
2981
2978
  }, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
2982
2979
  };
2983
2980
  OptionWithCheckbox.displayName = "SelectMenuOptions";
@@ -5216,9 +5213,6 @@ class VizPanel extends SceneObjectBase {
5216
5213
  (_a = this._panelContext) != null ? _a : this._panelContext = this.buildPanelContext();
5217
5214
  return this._panelContext;
5218
5215
  }
5219
- clearFieldConfigCache() {
5220
- this._dataWithFieldConfig = void 0;
5221
- }
5222
5216
  applyFieldConfig(rawData) {
5223
5217
  var _a, _b, _c, _d;
5224
5218
  const plugin = this._plugin;
@@ -11136,174 +11130,6 @@ const PanelBuilders = {
11136
11130
  }
11137
11131
  };
11138
11132
 
11139
- class VizConfigBuilder {
11140
- constructor(pluginId, pluginVersion, defaultOptions, defaultFieldConfig) {
11141
- this._pluginId = pluginId;
11142
- this._pluginVersion = pluginVersion;
11143
- this._fieldConfigBuilder = new FieldConfigBuilder(defaultFieldConfig);
11144
- this._panelOptionsBuilder = new PanelOptionsBuilder(defaultOptions);
11145
- }
11146
- setColor(color) {
11147
- this._fieldConfigBuilder.setColor(color);
11148
- return this;
11149
- }
11150
- setDecimals(decimals) {
11151
- this._fieldConfigBuilder.setDecimals(decimals);
11152
- return this;
11153
- }
11154
- setDisplayName(displayName) {
11155
- this._fieldConfigBuilder.setDisplayName(displayName);
11156
- return this;
11157
- }
11158
- setFilterable(filterable) {
11159
- this._fieldConfigBuilder.setFilterable(filterable);
11160
- return this;
11161
- }
11162
- setLinks(links) {
11163
- this._fieldConfigBuilder.setLinks(links);
11164
- return this;
11165
- }
11166
- setMappings(mappings) {
11167
- this._fieldConfigBuilder.setMappings(mappings);
11168
- return this;
11169
- }
11170
- setMax(max) {
11171
- this._fieldConfigBuilder.setMax(max);
11172
- return this;
11173
- }
11174
- setMin(min) {
11175
- this._fieldConfigBuilder.setMin(min);
11176
- return this;
11177
- }
11178
- setNoValue(noValue) {
11179
- this._fieldConfigBuilder.setNoValue(noValue);
11180
- return this;
11181
- }
11182
- setThresholds(thresholds) {
11183
- this._fieldConfigBuilder.setThresholds(thresholds);
11184
- return this;
11185
- }
11186
- setUnit(unit) {
11187
- this._fieldConfigBuilder.setUnit(unit);
11188
- return this;
11189
- }
11190
- setCustomFieldConfig(id, value) {
11191
- this._fieldConfigBuilder.setCustomFieldConfig(id, value);
11192
- return this;
11193
- }
11194
- setOverrides(builder) {
11195
- this._fieldConfigBuilder.setOverrides(builder);
11196
- return this;
11197
- }
11198
- setOption(id, value) {
11199
- this._panelOptionsBuilder.setOption(id, value);
11200
- return this;
11201
- }
11202
- build() {
11203
- return {
11204
- pluginId: this._pluginId,
11205
- pluginVersion: this._pluginVersion,
11206
- options: this._panelOptionsBuilder.build(),
11207
- fieldConfig: this._fieldConfigBuilder.build()
11208
- };
11209
- }
11210
- }
11211
-
11212
- const VizConfigBuilders = {
11213
- barchart() {
11214
- return new VizConfigBuilder(
11215
- "barchart",
11216
- "10.0.0",
11217
- () => BarChartPanelCfg_types_gen.defaultOptions,
11218
- () => BarChartPanelCfg_types_gen.defaultFieldConfig
11219
- );
11220
- },
11221
- bargauge() {
11222
- return new VizConfigBuilder("bargauge", "10.0.0", () => BarGaugePanelCfg_types_gen.defaultOptions);
11223
- },
11224
- datagrid() {
11225
- return new VizConfigBuilder("datagrid", "10.0.0", () => DatagridPanelCfg_types_gen.defaultOptions);
11226
- },
11227
- flamegraph() {
11228
- return new VizConfigBuilder("flamegraph", "10.0.0");
11229
- },
11230
- gauge() {
11231
- return new VizConfigBuilder("gauge", "10.0.0", () => GaugePanelCfg_types_gen.defaultOptions);
11232
- },
11233
- geomap() {
11234
- return new VizConfigBuilder("geomap", "10.0.0", () => GeomapPanelCfg_types_gen.defaultOptions);
11235
- },
11236
- heatmap() {
11237
- return new VizConfigBuilder("heatmap", "10.0.0", () => HeatmapPanelCfg_types_gen.defaultOptions);
11238
- },
11239
- histogram() {
11240
- return new VizConfigBuilder(
11241
- "histogram",
11242
- "10.0.0",
11243
- () => HistogramPanelCfg_types_gen.defaultOptions,
11244
- () => HistogramPanelCfg_types_gen.defaultFieldConfig
11245
- );
11246
- },
11247
- logs() {
11248
- return new VizConfigBuilder("logs", "10.0.0");
11249
- },
11250
- news() {
11251
- return new VizConfigBuilder("news", "10.0.0", () => NewsPanelCfg_types_gen.defaultOptions);
11252
- },
11253
- nodegraph() {
11254
- return new VizConfigBuilder("nodeGraph", "10.0.0");
11255
- },
11256
- piechart() {
11257
- return new VizConfigBuilder(
11258
- "piechart",
11259
- "10.0.0",
11260
- () => PieChartPanelCfg_types_gen.defaultOptions
11261
- );
11262
- },
11263
- stat() {
11264
- return new VizConfigBuilder("stat", "10.0.0", () => StatPanelCfg_types_gen.defaultOptions);
11265
- },
11266
- statetimeline() {
11267
- return new VizConfigBuilder(
11268
- "state-timeline",
11269
- "10.0.0",
11270
- () => StateTimelinePanelCfg_types_gen.defaultOptions,
11271
- () => StateTimelinePanelCfg_types_gen.defaultFieldConfig
11272
- );
11273
- },
11274
- statushistory() {
11275
- return new VizConfigBuilder(
11276
- "status-history",
11277
- "10.0.0",
11278
- () => StatusHistoryPanelCfg_types_gen.defaultOptions,
11279
- () => StatusHistoryPanelCfg_types_gen.defaultFieldConfig
11280
- );
11281
- },
11282
- table() {
11283
- return new VizConfigBuilder("table", "10.0.0", () => TablePanelCfg_types_gen.defaultOptions);
11284
- },
11285
- text() {
11286
- return new VizConfigBuilder("text", "10.0.0", () => TextPanelCfg_types_gen.defaultOptions);
11287
- },
11288
- timeseries() {
11289
- return new VizConfigBuilder("timeseries", "10.0.0");
11290
- },
11291
- trend() {
11292
- return new VizConfigBuilder("trend", "10.0.0");
11293
- },
11294
- traces() {
11295
- return new VizConfigBuilder("traces", "10.0.0");
11296
- },
11297
- xychart() {
11298
- return new VizConfigBuilder(
11299
- "xychart",
11300
- "10.0.0",
11301
- () => XYChartPanelCfg_types_gen.defaultOptions,
11302
- () => XYChartPanelCfg_types_gen.defaultFieldConfig
11303
- );
11304
- }
11305
- };
11306
-
11307
11133
  const sceneUtils = {
11308
11134
  getUrlWithAppState,
11309
11135
  registerRuntimePanelPlugin,
@@ -11328,7 +11154,6 @@ exports.ConstantVariable = ConstantVariable;
11328
11154
  exports.CustomVariable = CustomVariable;
11329
11155
  exports.DataSourceVariable = DataSourceVariable;
11330
11156
  exports.EmbeddedScene = EmbeddedScene;
11331
- exports.FieldConfigBuilder = FieldConfigBuilder;
11332
11157
  exports.FieldConfigBuilders = FieldConfigBuilders;
11333
11158
  exports.FieldConfigOverridesBuilder = FieldConfigOverridesBuilder;
11334
11159
  exports.GroupByVariable = GroupByVariable;
@@ -11383,10 +11208,7 @@ exports.UrlSyncManager = UrlSyncManager;
11383
11208
  exports.UserActionEvent = UserActionEvent;
11384
11209
  exports.VariableDependencyConfig = VariableDependencyConfig;
11385
11210
  exports.VariableValueControl = VariableValueControl;
11386
- exports.VariableValueSelectWrapper = VariableValueSelectWrapper;
11387
11211
  exports.VariableValueSelectors = VariableValueSelectors;
11388
- exports.VizConfigBuilder = VizConfigBuilder;
11389
- exports.VizConfigBuilders = VizConfigBuilders;
11390
11212
  exports.VizPanel = VizPanel;
11391
11213
  exports.VizPanelBuilder = VizPanelBuilder;
11392
11214
  exports.VizPanelMenu = VizPanelMenu;