@grafana/scenes 5.4.1--canary.830.9976271928.0 → 5.4.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -14,8 +14,6 @@ var ui = require('@grafana/ui');
14
14
  var e2eSelectors = require('@grafana/e2e-selectors');
15
15
  var css = require('@emotion/css');
16
16
  var uFuzzy = require('@leeoniya/ufuzzy');
17
- var react = require('@floating-ui/react');
18
- var reactDom = require('react-dom');
19
17
  var reactUse = require('react-use');
20
18
  var operators = require('rxjs/operators');
21
19
  var ReactGridLayout = require('react-grid-layout');
@@ -43,19 +41,19 @@ var uFuzzy__default = /*#__PURE__*/_interopDefaultLegacy(uFuzzy);
43
41
  var ReactGridLayout__default = /*#__PURE__*/_interopDefaultLegacy(ReactGridLayout);
44
42
  var AutoSizer__default = /*#__PURE__*/_interopDefaultLegacy(AutoSizer);
45
43
 
46
- var __defProp$L = Object.defineProperty;
47
- var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
48
- var __hasOwnProp$L = Object.prototype.hasOwnProperty;
49
- var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
50
- var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
51
- var __spreadValues$L = (a, b) => {
44
+ var __defProp$K = Object.defineProperty;
45
+ var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
46
+ var __hasOwnProp$K = Object.prototype.hasOwnProperty;
47
+ var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
48
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
49
+ var __spreadValues$K = (a, b) => {
52
50
  for (var prop in b || (b = {}))
53
- if (__hasOwnProp$L.call(b, prop))
54
- __defNormalProp$L(a, prop, b[prop]);
55
- if (__getOwnPropSymbols$L)
56
- for (var prop of __getOwnPropSymbols$L(b)) {
57
- if (__propIsEnum$L.call(b, prop))
58
- __defNormalProp$L(a, prop, b[prop]);
51
+ if (__hasOwnProp$K.call(b, prop))
52
+ __defNormalProp$K(a, prop, b[prop]);
53
+ if (__getOwnPropSymbols$K)
54
+ for (var prop of __getOwnPropSymbols$K(b)) {
55
+ if (__propIsEnum$K.call(b, prop))
56
+ __defNormalProp$K(a, prop, b[prop]);
59
57
  }
60
58
  return a;
61
59
  };
@@ -64,7 +62,7 @@ function useAppQueryParams() {
64
62
  return runtime.locationSearchToObject(location.search || "");
65
63
  }
66
64
  function getUrlWithAppState(path, preserveParams) {
67
- const paramsCopy = __spreadValues$L({}, runtime.locationService.getSearchObject());
65
+ const paramsCopy = __spreadValues$K({}, runtime.locationService.getSearchObject());
68
66
  if (preserveParams) {
69
67
  for (const key of Object.keys(paramsCopy)) {
70
68
  if (!preserveParams.includes(key)) {
@@ -78,31 +76,31 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
78
76
  return React__default["default"].createElement(sceneObject.Component, { model: sceneObject, routeProps });
79
77
  }
80
78
 
81
- var __defProp$K = Object.defineProperty;
82
- var __defProps$u = Object.defineProperties;
83
- var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
84
- var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
85
- var __hasOwnProp$K = Object.prototype.hasOwnProperty;
86
- var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
87
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
88
- var __spreadValues$K = (a, b) => {
79
+ var __defProp$J = Object.defineProperty;
80
+ var __defProps$t = Object.defineProperties;
81
+ var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
82
+ var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
83
+ var __hasOwnProp$J = Object.prototype.hasOwnProperty;
84
+ var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
85
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
86
+ var __spreadValues$J = (a, b) => {
89
87
  for (var prop in b || (b = {}))
90
- if (__hasOwnProp$K.call(b, prop))
91
- __defNormalProp$K(a, prop, b[prop]);
92
- if (__getOwnPropSymbols$K)
93
- for (var prop of __getOwnPropSymbols$K(b)) {
94
- if (__propIsEnum$K.call(b, prop))
95
- __defNormalProp$K(a, prop, b[prop]);
88
+ if (__hasOwnProp$J.call(b, prop))
89
+ __defNormalProp$J(a, prop, b[prop]);
90
+ if (__getOwnPropSymbols$J)
91
+ for (var prop of __getOwnPropSymbols$J(b)) {
92
+ if (__propIsEnum$J.call(b, prop))
93
+ __defNormalProp$J(a, prop, b[prop]);
96
94
  }
97
95
  return a;
98
96
  };
99
- var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
97
+ var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
100
98
  const runtimePanelPlugins = /* @__PURE__ */ new Map();
101
99
  function registerRuntimePanelPlugin({ pluginId, plugin }) {
102
100
  if (runtimePanelPlugins.has(pluginId)) {
103
101
  throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);
104
102
  }
105
- plugin.meta = __spreadProps$u(__spreadValues$K({}, plugin.meta), {
103
+ plugin.meta = __spreadProps$t(__spreadValues$J({}, plugin.meta), {
106
104
  id: pluginId,
107
105
  name: pluginId,
108
106
  module: "runtime plugin",
@@ -130,39 +128,39 @@ function loadPanelPluginSync(pluginId) {
130
128
  return (_a = getPanelPluginFromCache(pluginId)) != null ? _a : runtimePanelPlugins.get(pluginId);
131
129
  }
132
130
 
133
- var __defProp$J = Object.defineProperty;
134
- var __defProps$t = Object.defineProperties;
135
- var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
136
- var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
137
- var __hasOwnProp$J = Object.prototype.hasOwnProperty;
138
- var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
139
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
140
- var __spreadValues$J = (a, b) => {
131
+ var __defProp$I = Object.defineProperty;
132
+ var __defProps$s = Object.defineProperties;
133
+ var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
134
+ var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
135
+ var __hasOwnProp$I = Object.prototype.hasOwnProperty;
136
+ var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
137
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
138
+ var __spreadValues$I = (a, b) => {
141
139
  for (var prop in b || (b = {}))
142
- if (__hasOwnProp$J.call(b, prop))
143
- __defNormalProp$J(a, prop, b[prop]);
144
- if (__getOwnPropSymbols$J)
145
- for (var prop of __getOwnPropSymbols$J(b)) {
146
- if (__propIsEnum$J.call(b, prop))
147
- __defNormalProp$J(a, prop, b[prop]);
140
+ if (__hasOwnProp$I.call(b, prop))
141
+ __defNormalProp$I(a, prop, b[prop]);
142
+ if (__getOwnPropSymbols$I)
143
+ for (var prop of __getOwnPropSymbols$I(b)) {
144
+ if (__propIsEnum$I.call(b, prop))
145
+ __defNormalProp$I(a, prop, b[prop]);
148
146
  }
149
147
  return a;
150
148
  };
151
- var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
152
- var __objRest$5 = (source, exclude) => {
149
+ var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
150
+ var __objRest$4 = (source, exclude) => {
153
151
  var target = {};
154
152
  for (var prop in source)
155
- if (__hasOwnProp$J.call(source, prop) && exclude.indexOf(prop) < 0)
153
+ if (__hasOwnProp$I.call(source, prop) && exclude.indexOf(prop) < 0)
156
154
  target[prop] = source[prop];
157
- if (source != null && __getOwnPropSymbols$J)
158
- for (var prop of __getOwnPropSymbols$J(source)) {
159
- if (exclude.indexOf(prop) < 0 && __propIsEnum$J.call(source, prop))
155
+ if (source != null && __getOwnPropSymbols$I)
156
+ for (var prop of __getOwnPropSymbols$I(source)) {
157
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$I.call(source, prop))
160
158
  target[prop] = source[prop];
161
159
  }
162
160
  return target;
163
161
  };
164
162
  function SceneComponentWrapperWithoutMemo(_a) {
165
- var _b = _a, { model } = _b, otherProps = __objRest$5(_b, ["model"]);
163
+ var _b = _a, { model } = _b, otherProps = __objRest$4(_b, ["model"]);
166
164
  var _a2;
167
165
  const Component = (_a2 = model.constructor["Component"]) != null ? _a2 : EmptyRenderer;
168
166
  const [_, setValue] = React.useState(0);
@@ -174,7 +172,7 @@ function SceneComponentWrapperWithoutMemo(_a) {
174
172
  if (!model.isActive) {
175
173
  return null;
176
174
  }
177
- return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$t(__spreadValues$J({}, otherProps), {
175
+ return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$s(__spreadValues$I({}, otherProps), {
178
176
  model
179
177
  }));
180
178
  }
@@ -220,19 +218,19 @@ class SceneObjectRef {
220
218
  }
221
219
  _ref = new WeakMap();
222
220
 
223
- var __defProp$I = Object.defineProperty;
224
- var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
225
- var __hasOwnProp$I = Object.prototype.hasOwnProperty;
226
- var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
227
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
228
- var __spreadValues$I = (a, b) => {
221
+ var __defProp$H = Object.defineProperty;
222
+ var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
223
+ var __hasOwnProp$H = Object.prototype.hasOwnProperty;
224
+ var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
225
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
226
+ var __spreadValues$H = (a, b) => {
229
227
  for (var prop in b || (b = {}))
230
- if (__hasOwnProp$I.call(b, prop))
231
- __defNormalProp$I(a, prop, b[prop]);
232
- if (__getOwnPropSymbols$I)
233
- for (var prop of __getOwnPropSymbols$I(b)) {
234
- if (__propIsEnum$I.call(b, prop))
235
- __defNormalProp$I(a, prop, b[prop]);
228
+ if (__hasOwnProp$H.call(b, prop))
229
+ __defNormalProp$H(a, prop, b[prop]);
230
+ if (__getOwnPropSymbols$H)
231
+ for (var prop of __getOwnPropSymbols$H(b)) {
232
+ if (__propIsEnum$H.call(b, prop))
233
+ __defNormalProp$H(a, prop, b[prop]);
236
234
  }
237
235
  return a;
238
236
  };
@@ -292,7 +290,7 @@ class SceneObjectBase {
292
290
  }
293
291
  setState(update) {
294
292
  const prevState = this._state;
295
- const newState = __spreadValues$I(__spreadValues$I({}, this._state), update);
293
+ const newState = __spreadValues$H(__spreadValues$H({}, this._state), update);
296
294
  this._state = Object.freeze(newState);
297
295
  this._setParent(update);
298
296
  this._handleActivationOfChangedStateProps(prevState, newState);
@@ -488,19 +486,19 @@ function forEachChild(state, callback) {
488
486
  }
489
487
  }
490
488
 
491
- var __defProp$H = Object.defineProperty;
492
- var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
493
- var __hasOwnProp$H = Object.prototype.hasOwnProperty;
494
- var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
495
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
496
- var __spreadValues$H = (a, b) => {
489
+ var __defProp$G = Object.defineProperty;
490
+ var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
491
+ var __hasOwnProp$G = Object.prototype.hasOwnProperty;
492
+ var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
493
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
494
+ var __spreadValues$G = (a, b) => {
497
495
  for (var prop in b || (b = {}))
498
- if (__hasOwnProp$H.call(b, prop))
499
- __defNormalProp$H(a, prop, b[prop]);
500
- if (__getOwnPropSymbols$H)
501
- for (var prop of __getOwnPropSymbols$H(b)) {
502
- if (__propIsEnum$H.call(b, prop))
503
- __defNormalProp$H(a, prop, b[prop]);
496
+ if (__hasOwnProp$G.call(b, prop))
497
+ __defNormalProp$G(a, prop, b[prop]);
498
+ if (__getOwnPropSymbols$G)
499
+ for (var prop of __getOwnPropSymbols$G(b)) {
500
+ if (__propIsEnum$G.call(b, prop))
501
+ __defNormalProp$G(a, prop, b[prop]);
504
502
  }
505
503
  return a;
506
504
  };
@@ -509,7 +507,7 @@ function cloneSceneObject(sceneObject, withState) {
509
507
  return new sceneObject.constructor(clonedState);
510
508
  }
511
509
  function cloneSceneObjectState(sceneState, withState) {
512
- const clonedState = __spreadValues$H({}, sceneState);
510
+ const clonedState = __spreadValues$G({}, sceneState);
513
511
  for (const key in clonedState) {
514
512
  const propValue = clonedState[key];
515
513
  if (propValue instanceof SceneObjectBase) {
@@ -606,25 +604,25 @@ function lookupVariable(name, sceneObject) {
606
604
  return null;
607
605
  }
608
606
 
609
- var __defProp$G = Object.defineProperty;
610
- var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
611
- var __hasOwnProp$G = Object.prototype.hasOwnProperty;
612
- var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
613
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
614
- var __spreadValues$G = (a, b) => {
607
+ var __defProp$F = Object.defineProperty;
608
+ var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
609
+ var __hasOwnProp$F = Object.prototype.hasOwnProperty;
610
+ var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
611
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
612
+ var __spreadValues$F = (a, b) => {
615
613
  for (var prop in b || (b = {}))
616
- if (__hasOwnProp$G.call(b, prop))
617
- __defNormalProp$G(a, prop, b[prop]);
618
- if (__getOwnPropSymbols$G)
619
- for (var prop of __getOwnPropSymbols$G(b)) {
620
- if (__propIsEnum$G.call(b, prop))
621
- __defNormalProp$G(a, prop, b[prop]);
614
+ if (__hasOwnProp$F.call(b, prop))
615
+ __defNormalProp$F(a, prop, b[prop]);
616
+ if (__getOwnPropSymbols$F)
617
+ for (var prop of __getOwnPropSymbols$F(b)) {
618
+ if (__propIsEnum$F.call(b, prop))
619
+ __defNormalProp$F(a, prop, b[prop]);
622
620
  }
623
621
  return a;
624
622
  };
625
623
  class SceneDataNode extends SceneObjectBase {
626
624
  constructor(state) {
627
- super(__spreadValues$G({
625
+ super(__spreadValues$F({
628
626
  data: emptyPanelData
629
627
  }, state));
630
628
  }
@@ -705,19 +703,19 @@ function evaluateTimeRange(from, to, timeZone, fiscalYearStartMonth, delay) {
705
703
  };
706
704
  }
707
705
 
708
- var __defProp$F = Object.defineProperty;
709
- var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
710
- var __hasOwnProp$F = Object.prototype.hasOwnProperty;
711
- var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
712
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
713
- var __spreadValues$F = (a, b) => {
706
+ var __defProp$E = Object.defineProperty;
707
+ var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
708
+ var __hasOwnProp$E = Object.prototype.hasOwnProperty;
709
+ var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
710
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
711
+ var __spreadValues$E = (a, b) => {
714
712
  for (var prop in b || (b = {}))
715
- if (__hasOwnProp$F.call(b, prop))
716
- __defNormalProp$F(a, prop, b[prop]);
717
- if (__getOwnPropSymbols$F)
718
- for (var prop of __getOwnPropSymbols$F(b)) {
719
- if (__propIsEnum$F.call(b, prop))
720
- __defNormalProp$F(a, prop, b[prop]);
713
+ if (__hasOwnProp$E.call(b, prop))
714
+ __defNormalProp$E(a, prop, b[prop]);
715
+ if (__getOwnPropSymbols$E)
716
+ for (var prop of __getOwnPropSymbols$E(b)) {
717
+ if (__propIsEnum$E.call(b, prop))
718
+ __defNormalProp$E(a, prop, b[prop]);
721
719
  }
722
720
  return a;
723
721
  };
@@ -734,7 +732,7 @@ class SceneTimeRange extends SceneObjectBase {
734
732
  state.fiscalYearStartMonth,
735
733
  state.UNSAFE_nowDelay
736
734
  );
737
- super(__spreadValues$F({ from, to, timeZone, value }, state));
735
+ super(__spreadValues$E({ from, to, timeZone, value }, state));
738
736
  this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["from", "to", "timezone"] });
739
737
  this.onTimeRangeChange = (timeRange) => {
740
738
  const update = {};
@@ -1364,25 +1362,25 @@ function collectAllVariables(sceneObject, record = {}) {
1364
1362
  return record;
1365
1363
  }
1366
1364
 
1367
- var __defProp$E = Object.defineProperty;
1368
- var __defProps$s = Object.defineProperties;
1369
- var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
1370
- var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
1371
- var __hasOwnProp$E = Object.prototype.hasOwnProperty;
1372
- var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
1373
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1374
- var __spreadValues$E = (a, b) => {
1365
+ var __defProp$D = Object.defineProperty;
1366
+ var __defProps$r = Object.defineProperties;
1367
+ var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
1368
+ var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
1369
+ var __hasOwnProp$D = Object.prototype.hasOwnProperty;
1370
+ var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
1371
+ var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1372
+ var __spreadValues$D = (a, b) => {
1375
1373
  for (var prop in b || (b = {}))
1376
- if (__hasOwnProp$E.call(b, prop))
1377
- __defNormalProp$E(a, prop, b[prop]);
1378
- if (__getOwnPropSymbols$E)
1379
- for (var prop of __getOwnPropSymbols$E(b)) {
1380
- if (__propIsEnum$E.call(b, prop))
1381
- __defNormalProp$E(a, prop, b[prop]);
1374
+ if (__hasOwnProp$D.call(b, prop))
1375
+ __defNormalProp$D(a, prop, b[prop]);
1376
+ if (__getOwnPropSymbols$D)
1377
+ for (var prop of __getOwnPropSymbols$D(b)) {
1378
+ if (__propIsEnum$D.call(b, prop))
1379
+ __defNormalProp$D(a, prop, b[prop]);
1382
1380
  }
1383
1381
  return a;
1384
1382
  };
1385
- var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
1383
+ var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
1386
1384
  function getTemplateProxyForField(field, frame, frames) {
1387
1385
  return new Proxy(
1388
1386
  {},
@@ -1398,7 +1396,7 @@ function getTemplateProxyForField(field, frame, frames) {
1398
1396
  if (!field.labels) {
1399
1397
  return "";
1400
1398
  }
1401
- return __spreadProps$s(__spreadValues$E({}, field.labels), {
1399
+ return __spreadProps$r(__spreadValues$D({}, field.labels), {
1402
1400
  __values: Object.values(field.labels).sort().join(", "),
1403
1401
  toString: () => {
1404
1402
  return data.formatLabels(field.labels, "", true);
@@ -2283,25 +2281,25 @@ function isExtraQueryProvider(obj) {
2283
2281
  return typeof obj === "object" && "getExtraQueries" in obj;
2284
2282
  }
2285
2283
 
2286
- var __defProp$D = Object.defineProperty;
2287
- var __defProps$r = Object.defineProperties;
2288
- var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
2289
- var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
2290
- var __hasOwnProp$D = Object.prototype.hasOwnProperty;
2291
- var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
2292
- var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2293
- var __spreadValues$D = (a, b) => {
2284
+ var __defProp$C = Object.defineProperty;
2285
+ var __defProps$q = Object.defineProperties;
2286
+ var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
2287
+ var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
2288
+ var __hasOwnProp$C = Object.prototype.hasOwnProperty;
2289
+ var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
2290
+ var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2291
+ var __spreadValues$C = (a, b) => {
2294
2292
  for (var prop in b || (b = {}))
2295
- if (__hasOwnProp$D.call(b, prop))
2296
- __defNormalProp$D(a, prop, b[prop]);
2297
- if (__getOwnPropSymbols$D)
2298
- for (var prop of __getOwnPropSymbols$D(b)) {
2299
- if (__propIsEnum$D.call(b, prop))
2300
- __defNormalProp$D(a, prop, b[prop]);
2293
+ if (__hasOwnProp$C.call(b, prop))
2294
+ __defNormalProp$C(a, prop, b[prop]);
2295
+ if (__getOwnPropSymbols$C)
2296
+ for (var prop of __getOwnPropSymbols$C(b)) {
2297
+ if (__propIsEnum$C.call(b, prop))
2298
+ __defNormalProp$C(a, prop, b[prop]);
2301
2299
  }
2302
2300
  return a;
2303
2301
  };
2304
- var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
2302
+ var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
2305
2303
  const passthroughProcessor = (_, secondary) => rxjs.of(secondary);
2306
2304
  const extraQueryProcessingOperator = (processors) => (data) => {
2307
2305
  return data.pipe(
@@ -2314,7 +2312,7 @@ const extraQueryProcessingOperator = (processors) => (data) => {
2314
2312
  }),
2315
2313
  rxjs.map(([primary, ...processedSecondaries]) => {
2316
2314
  var _a;
2317
- return __spreadProps$r(__spreadValues$D({}, primary), {
2315
+ return __spreadProps$q(__spreadValues$C({}, primary), {
2318
2316
  series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],
2319
2317
  annotations: [...(_a = primary.annotations) != null ? _a : [], ...processedSecondaries.flatMap((s) => {
2320
2318
  var _a2;
@@ -2325,25 +2323,25 @@ const extraQueryProcessingOperator = (processors) => (data) => {
2325
2323
  );
2326
2324
  };
2327
2325
 
2328
- var __defProp$C = Object.defineProperty;
2329
- var __defProps$q = Object.defineProperties;
2330
- var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
2331
- var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
2332
- var __hasOwnProp$C = Object.prototype.hasOwnProperty;
2333
- var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
2334
- var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2335
- var __spreadValues$C = (a, b) => {
2326
+ var __defProp$B = Object.defineProperty;
2327
+ var __defProps$p = Object.defineProperties;
2328
+ var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
2329
+ var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
2330
+ var __hasOwnProp$B = Object.prototype.hasOwnProperty;
2331
+ var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
2332
+ var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2333
+ var __spreadValues$B = (a, b) => {
2336
2334
  for (var prop in b || (b = {}))
2337
- if (__hasOwnProp$C.call(b, prop))
2338
- __defNormalProp$C(a, prop, b[prop]);
2339
- if (__getOwnPropSymbols$C)
2340
- for (var prop of __getOwnPropSymbols$C(b)) {
2341
- if (__propIsEnum$C.call(b, prop))
2342
- __defNormalProp$C(a, prop, b[prop]);
2335
+ if (__hasOwnProp$B.call(b, prop))
2336
+ __defNormalProp$B(a, prop, b[prop]);
2337
+ if (__getOwnPropSymbols$B)
2338
+ for (var prop of __getOwnPropSymbols$B(b)) {
2339
+ if (__propIsEnum$B.call(b, prop))
2340
+ __defNormalProp$B(a, prop, b[prop]);
2343
2341
  }
2344
2342
  return a;
2345
2343
  };
2346
- var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
2344
+ var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
2347
2345
  function filterAnnotations(data, filters) {
2348
2346
  var _a;
2349
2347
  if (!Array.isArray(data) || data.length === 0) {
@@ -2394,11 +2392,11 @@ function filterAnnotations(data, filters) {
2394
2392
  continue;
2395
2393
  }
2396
2394
  }
2397
- fields.push(__spreadProps$q(__spreadValues$C({}, field), {
2395
+ fields.push(__spreadProps$p(__spreadValues$B({}, field), {
2398
2396
  values: buffer
2399
2397
  }));
2400
2398
  }
2401
- processed.push(__spreadProps$q(__spreadValues$C({}, frame), {
2399
+ processed.push(__spreadProps$p(__spreadValues$B({}, frame), {
2402
2400
  fields,
2403
2401
  length: frameLength
2404
2402
  }));
@@ -2824,33 +2822,33 @@ function getOptionSearcher(options, includeAll) {
2824
2822
  };
2825
2823
  }
2826
2824
 
2827
- var __defProp$B = Object.defineProperty;
2828
- var __defProps$p = Object.defineProperties;
2829
- var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
2830
- var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
2831
- var __hasOwnProp$B = Object.prototype.hasOwnProperty;
2832
- var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
2833
- var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2834
- var __spreadValues$B = (a, b) => {
2825
+ var __defProp$A = Object.defineProperty;
2826
+ var __defProps$o = Object.defineProperties;
2827
+ var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
2828
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
2829
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
2830
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
2831
+ var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2832
+ var __spreadValues$A = (a, b) => {
2835
2833
  for (var prop in b || (b = {}))
2836
- if (__hasOwnProp$B.call(b, prop))
2837
- __defNormalProp$B(a, prop, b[prop]);
2838
- if (__getOwnPropSymbols$B)
2839
- for (var prop of __getOwnPropSymbols$B(b)) {
2840
- if (__propIsEnum$B.call(b, prop))
2841
- __defNormalProp$B(a, prop, b[prop]);
2834
+ if (__hasOwnProp$A.call(b, prop))
2835
+ __defNormalProp$A(a, prop, b[prop]);
2836
+ if (__getOwnPropSymbols$A)
2837
+ for (var prop of __getOwnPropSymbols$A(b)) {
2838
+ if (__propIsEnum$A.call(b, prop))
2839
+ __defNormalProp$A(a, prop, b[prop]);
2842
2840
  }
2843
2841
  return a;
2844
2842
  };
2845
- var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
2846
- var __objRest$4 = (source, exclude) => {
2843
+ var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
2844
+ var __objRest$3 = (source, exclude) => {
2847
2845
  var target = {};
2848
2846
  for (var prop in source)
2849
- if (__hasOwnProp$B.call(source, prop) && exclude.indexOf(prop) < 0)
2847
+ if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
2850
2848
  target[prop] = source[prop];
2851
- if (source != null && __getOwnPropSymbols$B)
2852
- for (var prop of __getOwnPropSymbols$B(source)) {
2853
- if (exclude.indexOf(prop) < 0 && __propIsEnum$B.call(source, prop))
2849
+ if (source != null && __getOwnPropSymbols$A)
2850
+ for (var prop of __getOwnPropSymbols$A(source)) {
2851
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
2854
2852
  target[prop] = source[prop];
2855
2853
  }
2856
2854
  return target;
@@ -2978,11 +2976,11 @@ const OptionWithCheckbox = ({
2978
2976
  renderOptionLabel
2979
2977
  }) => {
2980
2978
  var _b;
2981
- const _a = innerProps, rest = __objRest$4(_a, ["onMouseMove", "onMouseOver"]);
2979
+ const _a = innerProps, rest = __objRest$3(_a, ["onMouseMove", "onMouseOver"]);
2982
2980
  const theme = ui.useTheme2();
2983
2981
  const selectStyles = ui.getSelectStyles(theme);
2984
2982
  const optionStyles = ui.useStyles2(getOptionStyles);
2985
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$p(__spreadValues$B({
2983
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({
2986
2984
  ref: innerRef,
2987
2985
  className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
2988
2986
  }, rest), {
@@ -3084,28 +3082,28 @@ function getEnrichedFiltersRequest(sourceRunner) {
3084
3082
  return null;
3085
3083
  }
3086
3084
 
3087
- var __defProp$A = Object.defineProperty;
3088
- var __defProps$o = Object.defineProperties;
3089
- var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
3090
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
3091
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
3092
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
3093
- var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3094
- var __spreadValues$A = (a, b) => {
3085
+ var __defProp$z = Object.defineProperty;
3086
+ var __defProps$n = Object.defineProperties;
3087
+ var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
3088
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
3089
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
3090
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
3091
+ var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3092
+ var __spreadValues$z = (a, b) => {
3095
3093
  for (var prop in b || (b = {}))
3096
- if (__hasOwnProp$A.call(b, prop))
3097
- __defNormalProp$A(a, prop, b[prop]);
3098
- if (__getOwnPropSymbols$A)
3099
- for (var prop of __getOwnPropSymbols$A(b)) {
3100
- if (__propIsEnum$A.call(b, prop))
3101
- __defNormalProp$A(a, prop, b[prop]);
3094
+ if (__hasOwnProp$z.call(b, prop))
3095
+ __defNormalProp$z(a, prop, b[prop]);
3096
+ if (__getOwnPropSymbols$z)
3097
+ for (var prop of __getOwnPropSymbols$z(b)) {
3098
+ if (__propIsEnum$z.call(b, prop))
3099
+ __defNormalProp$z(a, prop, b[prop]);
3102
3100
  }
3103
3101
  return a;
3104
3102
  };
3105
- var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
3103
+ var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
3106
3104
  class GroupByVariable extends MultiValueVariable {
3107
3105
  constructor(initialState) {
3108
- super(__spreadProps$o(__spreadValues$A({
3106
+ super(__spreadProps$n(__spreadValues$z({
3109
3107
  isMulti: true,
3110
3108
  name: "",
3111
3109
  value: [],
@@ -3138,7 +3136,7 @@ class GroupByVariable extends MultiValueVariable {
3138
3136
  const queries = getQueriesForVariables(this);
3139
3137
  const otherFilters = this.state.baseFilters || [];
3140
3138
  const timeRange = sceneGraph.getTimeRange(this).state.value;
3141
- const response = await ds.getTagKeys(__spreadValues$A({ filters: otherFilters, queries, timeRange }, getEnrichedFiltersRequest(this)));
3139
+ const response = await ds.getTagKeys(__spreadValues$z({ filters: otherFilters, queries, timeRange }, getEnrichedFiltersRequest(this)));
3142
3140
  if (responseHasError(response)) {
3143
3141
  this.setState({ error: response.error.message });
3144
3142
  }
@@ -3483,7 +3481,10 @@ function AdHocFilterRenderer({ filter, model }) {
3483
3481
  const [valueHasCustomValue, setValueHasCustomValue] = React.useState(false);
3484
3482
  const keyValue = keyLabelToOption(filter.key, filter.keyLabel);
3485
3483
  const valueValue = keyLabelToOption(filter.value, filter.valueLabel);
3486
- const optionSearcher = React.useMemo(() => getAdhocOptionSearcher(values), [values]);
3484
+ const optionSearcher = React.useMemo(
3485
+ () => getAdhocOptionSearcher(values),
3486
+ [values]
3487
+ );
3487
3488
  const onValueInputChange = (value, { action }) => {
3488
3489
  if (action === "input-change") {
3489
3490
  setValueInputValue(value);
@@ -3751,440 +3752,6 @@ function isFilter(filter) {
3751
3752
  return filter !== null && typeof filter.key === "string" && typeof filter.value === "string";
3752
3753
  }
3753
3754
 
3754
- var __defProp$z = Object.defineProperty;
3755
- var __defProps$n = Object.defineProperties;
3756
- var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
3757
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
3758
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
3759
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
3760
- var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3761
- var __spreadValues$z = (a, b) => {
3762
- for (var prop in b || (b = {}))
3763
- if (__hasOwnProp$z.call(b, prop))
3764
- __defNormalProp$z(a, prop, b[prop]);
3765
- if (__getOwnPropSymbols$z)
3766
- for (var prop of __getOwnPropSymbols$z(b)) {
3767
- if (__propIsEnum$z.call(b, prop))
3768
- __defNormalProp$z(a, prop, b[prop]);
3769
- }
3770
- return a;
3771
- };
3772
- var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
3773
- var __objRest$3 = (source, exclude) => {
3774
- var target = {};
3775
- for (var prop in source)
3776
- if (__hasOwnProp$z.call(source, prop) && exclude.indexOf(prop) < 0)
3777
- target[prop] = source[prop];
3778
- if (source != null && __getOwnPropSymbols$z)
3779
- for (var prop of __getOwnPropSymbols$z(source)) {
3780
- if (exclude.indexOf(prop) < 0 && __propIsEnum$z.call(source, prop))
3781
- target[prop] = source[prop];
3782
- }
3783
- return target;
3784
- };
3785
- const Item = React.forwardRef(
3786
- (_a, ref) => {
3787
- var _b = _a, { children, active } = _b, rest = __objRest$3(_b, ["children", "active"]);
3788
- const theme = ui.useTheme2();
3789
- const selectStyles = ui.getSelectStyles(theme);
3790
- const id = react.useId();
3791
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$z({
3792
- ref,
3793
- role: "option",
3794
- id,
3795
- "aria-selected": active,
3796
- className: css.cx(selectStyles.option, active && selectStyles.optionFocused)
3797
- }, rest), /* @__PURE__ */ React__default["default"].createElement("div", {
3798
- className: selectStyles.optionBody,
3799
- "data-testid": `data-testid ad hoc filter option value ${children}`
3800
- }, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
3801
- }
3802
- );
3803
- const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model, wip, handleChangeViewMode }, parentRef) {
3804
- var _a;
3805
- const [open, setOpen] = React.useState(false);
3806
- const [options, setOptions] = React.useState([]);
3807
- const [inputValue, setInputValue] = React.useState("");
3808
- const [activeIndex, setActiveIndex] = React.useState(null);
3809
- const [inputType, setInputType] = React.useState(!wip ? "value" : "key");
3810
- const styles = ui.useStyles2(getStyles2);
3811
- const listRef = React.useRef([]);
3812
- const { _wip } = model.useState();
3813
- const filterToUse = filter || _wip;
3814
- const operatorIdentifier = `${(_a = filterToUse == null ? void 0 : filterToUse.key) != null ? _a : ""}-operator`;
3815
- const { refs, floatingStyles, context } = react.useFloating({
3816
- whileElementsMounted: react.autoUpdate,
3817
- open,
3818
- onOpenChange: (nextOpen, _, reason) => {
3819
- setOpen(nextOpen);
3820
- if (["outside-press", "escape-key"].includes(reason || "")) {
3821
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3822
- }
3823
- },
3824
- middleware: [
3825
- react.flip({ padding: 10 }),
3826
- react.size({
3827
- apply({ rects, availableHeight, elements }) {
3828
- Object.assign(elements.floating.style, {
3829
- width: `${rects.reference.width}px`,
3830
- maxHeight: `${availableHeight > 256 ? 256 : availableHeight}px`
3831
- });
3832
- },
3833
- padding: 10
3834
- })
3835
- ]
3836
- });
3837
- const role = react.useRole(context, { role: "listbox" });
3838
- const dismiss = react.useDismiss(context, {
3839
- outsidePress: (event) => {
3840
- return !event.currentTarget.classList.contains(
3841
- operatorIdentifier
3842
- );
3843
- }
3844
- });
3845
- const listNav = react.useListNavigation(context, {
3846
- listRef,
3847
- activeIndex,
3848
- onNavigate: setActiveIndex,
3849
- virtual: true,
3850
- loop: true
3851
- });
3852
- const { getReferenceProps, getFloatingProps, getItemProps } = react.useInteractions([role, dismiss, listNav]);
3853
- React.useImperativeHandle(parentRef, () => () => {
3854
- var _a2;
3855
- return (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3856
- }, [refs.domReference]);
3857
- function onChange(event) {
3858
- var _a2, _b;
3859
- if (inputType === "key") {
3860
- const lastChar = event.target.value.slice(-1);
3861
- if (["=", "!", "<", ">"].includes(lastChar)) {
3862
- const key = event.target.value.slice(0, -1);
3863
- const optionIndex = options.findIndex((option) => option.value === key);
3864
- if (optionIndex >= 0) {
3865
- model._updateFilter(filterToUse, inputType, options[optionIndex]);
3866
- setInputValue(lastChar);
3867
- }
3868
- reactDom.flushSync(() => {
3869
- setInputType("operator");
3870
- });
3871
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3872
- return;
3873
- }
3874
- }
3875
- if (inputType === "operator") {
3876
- const lastChar = event.target.value.slice(-1);
3877
- if (/\w/.test(lastChar)) {
3878
- const operator = event.target.value.slice(0, -1);
3879
- if (!/\w/.test(operator)) {
3880
- const optionIndex = options.findIndex((option) => option.value === operator);
3881
- if (optionIndex >= 0) {
3882
- model._updateFilter(filterToUse, inputType, options[optionIndex]);
3883
- setInputValue(lastChar);
3884
- }
3885
- reactDom.flushSync(() => {
3886
- setInputType("value");
3887
- });
3888
- (_b = refs.domReference.current) == null ? void 0 : _b.focus();
3889
- return;
3890
- }
3891
- }
3892
- }
3893
- const value = event.target.value;
3894
- setInputValue(value);
3895
- setActiveIndex(0);
3896
- }
3897
- const items = options.filter(
3898
- (item) => {
3899
- var _a2, _b;
3900
- return (_b = (_a2 = item.label) != null ? _a2 : item.value) == null ? void 0 : _b.toLocaleLowerCase().startsWith(inputValue.toLowerCase());
3901
- }
3902
- );
3903
- const flushInputType = React.useCallback((inputType2) => {
3904
- reactDom.flushSync(() => {
3905
- setInputType(inputType2);
3906
- });
3907
- }, []);
3908
- React.useEffect(() => {
3909
- if (wip && !_wip) {
3910
- model._addWip();
3911
- }
3912
- }, [_wip]);
3913
- React.useEffect(() => {
3914
- if (!wip && refs.domReference.current) {
3915
- setInputType("value");
3916
- setInputValue("");
3917
- refs.domReference.current.focus();
3918
- }
3919
- }, []);
3920
- const handleFetchOptions = React.useCallback(async () => {
3921
- let options2 = [];
3922
- if (inputType === "key") {
3923
- options2 = await model._getKeys(null);
3924
- } else if (inputType === "operator") {
3925
- options2 = model._getOperators();
3926
- } else if (inputType === "value") {
3927
- options2 = await model._getValuesFor(filterToUse);
3928
- }
3929
- setOptions(options2);
3930
- }, [filterToUse, inputType, model]);
3931
- const handleBackspaceInput = React.useCallback(
3932
- (event) => {
3933
- if (event.key === "Backspace" && !inputValue && inputType === "key") {
3934
- model._removeLastFilter();
3935
- setOpen(false);
3936
- }
3937
- },
3938
- [inputValue]
3939
- );
3940
- const handleShiftTabInput = React.useCallback((event) => {
3941
- if (event.key === "Tab" && !event.shiftKey) {
3942
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3943
- }
3944
- }, []);
3945
- const handleEnterInput = React.useCallback(
3946
- (event) => {
3947
- var _a2;
3948
- if (event.key === "Enter" && activeIndex != null && items[activeIndex]) {
3949
- model._updateFilter(filterToUse, inputType, items[activeIndex]);
3950
- setInputValue("");
3951
- if (inputType === "key") {
3952
- flushInputType("operator");
3953
- } else if (inputType === "operator") {
3954
- flushInputType("value");
3955
- } else if (inputType === "value") {
3956
- flushInputType("key");
3957
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3958
- }
3959
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3960
- }
3961
- },
3962
- [activeIndex, filterToUse, inputType, items, model]
3963
- );
3964
- React.useEffect(() => {
3965
- if (open) {
3966
- handleFetchOptions();
3967
- }
3968
- }, [open, inputType]);
3969
- return /* @__PURE__ */ React__default["default"].createElement("div", {
3970
- className: styles.comboboxWrapper
3971
- }, filterToUse ? /* @__PURE__ */ React__default["default"].createElement("div", {
3972
- className: styles.pillWrapper
3973
- }, (filterToUse == null ? void 0 : filterToUse.key) ? /* @__PURE__ */ React__default["default"].createElement("div", {
3974
- className: css.cx(styles.basePill, styles.keyPill)
3975
- }, filterToUse.key) : null, (filterToUse == null ? void 0 : filterToUse.key) && (filterToUse == null ? void 0 : filterToUse.operator) && inputType !== "operator" ? /* @__PURE__ */ React__default["default"].createElement("div", {
3976
- className: css.cx(styles.basePill, operatorIdentifier),
3977
- role: "button",
3978
- "aria-label": "Edit filter operator",
3979
- tabIndex: 0,
3980
- onClick: (event) => {
3981
- var _a2;
3982
- event.stopPropagation();
3983
- flushInputType("operator");
3984
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3985
- },
3986
- onKeyDown: (e) => {
3987
- var _a2;
3988
- if (e.key === "Enter") {
3989
- flushInputType("operator");
3990
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3991
- }
3992
- }
3993
- }, filterToUse.operator) : null, (filterToUse == null ? void 0 : filterToUse.key) && (filterToUse == null ? void 0 : filterToUse.operator) && (filterToUse == null ? void 0 : filterToUse.value) && !["operator", "value"].includes(inputType) ? /* @__PURE__ */ React__default["default"].createElement("div", {
3994
- className: css.cx(styles.basePill, styles.valuePill)
3995
- }, filterToUse.value) : null) : null, /* @__PURE__ */ React__default["default"].createElement("input", __spreadProps$n(__spreadValues$z({}, getReferenceProps({
3996
- ref: refs.setReference,
3997
- onChange,
3998
- value: inputValue,
3999
- placeholder: !wip ? inputType === "operator" ? `${filterToUse[inputType]} ${filterToUse.value || ""}` : filterToUse[inputType] : "Filter by label values",
4000
- "aria-autocomplete": "list",
4001
- onKeyDown(event) {
4002
- handleBackspaceInput(event);
4003
- handleShiftTabInput(event);
4004
- handleEnterInput(event);
4005
- }
4006
- })), {
4007
- className: styles.inputStyle,
4008
- onClick: (event) => {
4009
- event.stopPropagation();
4010
- setOpen(true);
4011
- },
4012
- onFocus: () => {
4013
- setActiveIndex(0);
4014
- setOpen(true);
4015
- }
4016
- })), /* @__PURE__ */ React__default["default"].createElement(react.FloatingPortal, null, open && /* @__PURE__ */ React__default["default"].createElement(react.FloatingFocusManager, {
4017
- context,
4018
- initialFocus: -1,
4019
- visuallyHiddenDismiss: true
4020
- }, /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$n(__spreadValues$z({}, getFloatingProps({
4021
- ref: refs.setFloating,
4022
- style: __spreadProps$n(__spreadValues$z({}, floatingStyles), {
4023
- overflowY: "auto"
4024
- })
4025
- })), {
4026
- className: styles.dropdownWrapper
4027
- }), items.map((item, index) => {
4028
- var _a2;
4029
- return /* @__PURE__ */ React__default["default"].createElement(Item, __spreadProps$n(__spreadValues$z({}, getItemProps({
4030
- key: item.value,
4031
- ref(node) {
4032
- listRef.current[index] = node;
4033
- },
4034
- onClick() {
4035
- var _a3;
4036
- model._updateFilter(filterToUse, inputType, item);
4037
- setInputValue("");
4038
- if (inputType === "key") {
4039
- flushInputType("operator");
4040
- } else if (inputType === "operator") {
4041
- flushInputType("value");
4042
- } else if (inputType === "value") {
4043
- flushInputType("key");
4044
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
4045
- }
4046
- (_a3 = refs.domReference.current) == null ? void 0 : _a3.focus();
4047
- }
4048
- })), {
4049
- active: activeIndex === index
4050
- }), (_a2 = item.label) != null ? _a2 : item.value);
4051
- })))));
4052
- });
4053
- const getStyles2 = (theme) => ({
4054
- comboboxWrapper: css.css({
4055
- display: "flex",
4056
- flexWrap: "nowrap"
4057
- }),
4058
- pillWrapper: css.css({
4059
- display: "flex",
4060
- alignItems: "center",
4061
- whiteSpace: "nowrap"
4062
- }),
4063
- basePill: css.css(__spreadProps$n(__spreadValues$z({
4064
- display: "flex",
4065
- alignItems: "center",
4066
- background: theme.colors.action.disabledBackground,
4067
- border: `1px solid ${theme.colors.border.weak}`,
4068
- padding: theme.spacing(0.125, 1, 0.125, 1),
4069
- color: theme.colors.text.primary,
4070
- overflow: "hidden",
4071
- whiteSpace: "nowrap",
4072
- minHeight: "22px"
4073
- }, theme.typography.bodySmall), {
4074
- cursor: "pointer"
4075
- })),
4076
- keyPill: css.css({
4077
- fontWeight: theme.typography.fontWeightBold,
4078
- cursor: "default"
4079
- }),
4080
- valuePill: css.css({
4081
- background: theme.colors.action.selected
4082
- }),
4083
- dropdownWrapper: css.css({
4084
- backgroundColor: theme.colors.background.primary,
4085
- color: theme.colors.text.primary,
4086
- boxShadow: theme.shadows.z2
4087
- }),
4088
- inputStyle: css.css({
4089
- paddingBlock: 0,
4090
- "&:focus": {
4091
- outline: "none"
4092
- }
4093
- })
4094
- });
4095
- function AdHocFilterEditSwitch({ filter, model }) {
4096
- const styles = ui.useStyles2(getStyles3);
4097
- const [viewMode, setViewMode] = React.useState(true);
4098
- const handleChangeViewMode = React.useCallback((event) => {
4099
- event == null ? void 0 : event.stopPropagation();
4100
- reactDom.flushSync(() => {
4101
- setViewMode((mode) => !mode);
4102
- });
4103
- }, []);
4104
- if (viewMode) {
4105
- return /* @__PURE__ */ React__default["default"].createElement("div", {
4106
- className: styles.combinedFilterPill,
4107
- onClick: handleChangeViewMode,
4108
- onKeyDown: (e) => {
4109
- if (e.key === "Enter") {
4110
- handleChangeViewMode();
4111
- }
4112
- },
4113
- role: "button",
4114
- "aria-label": "Edit filter",
4115
- tabIndex: 0
4116
- }, /* @__PURE__ */ React__default["default"].createElement("span", null, filter.key, " ", filter.operator, " ", filter.value), /* @__PURE__ */ React__default["default"].createElement(ui.IconButton, {
4117
- onClick: (e) => {
4118
- e.stopPropagation();
4119
- model._removeFilter(filter);
4120
- },
4121
- onKeyDownCapture: (e) => {
4122
- if (e.key === "Enter") {
4123
- e.preventDefault();
4124
- e.stopPropagation();
4125
- model._removeFilter(filter);
4126
- }
4127
- },
4128
- name: "times",
4129
- size: "md",
4130
- className: styles.removeButton,
4131
- tooltip: "Remove filter"
4132
- }));
4133
- }
4134
- return /* @__PURE__ */ React__default["default"].createElement(AdHocCombobox, {
4135
- filter,
4136
- model,
4137
- handleChangeViewMode
4138
- });
4139
- }
4140
- const getStyles3 = (theme) => ({
4141
- wrapper: css.css({
4142
- display: "flex",
4143
- flexWrap: "wrap",
4144
- alignItems: "center",
4145
- columnGap: theme.spacing(1),
4146
- rowGap: theme.spacing(1),
4147
- minHeight: theme.spacing(4),
4148
- backgroundColor: theme.components.input.background,
4149
- border: `1px solid ${theme.colors.border.strong}`,
4150
- borderRadius: theme.shape.radius.default,
4151
- paddingInline: theme.spacing(1),
4152
- "&:focus-within": {
4153
- outline: "2px dotted transparent",
4154
- outlineOffset: "2px",
4155
- boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,
4156
- transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,
4157
- transitionDuration: "0.2s",
4158
- transitionProperty: "outline, outline-offset, box-shadow"
4159
- }
4160
- }),
4161
- combinedFilterPill: css.css(__spreadProps$n(__spreadValues$z({
4162
- display: "flex",
4163
- alignItems: "center",
4164
- background: theme.colors.action.selected,
4165
- borderRadius: theme.shape.radius.default,
4166
- border: `1px solid ${theme.colors.border.weak}`,
4167
- padding: theme.spacing(0.125, 0, 0.125, 1),
4168
- color: theme.colors.text.primary,
4169
- overflow: "hidden",
4170
- whiteSpace: "nowrap",
4171
- minHeight: "22px"
4172
- }, theme.typography.bodySmall), {
4173
- fontWeight: theme.typography.fontWeightBold,
4174
- cursor: "pointer",
4175
- "&:hover": {
4176
- background: theme.colors.emphasize(theme.colors.background.secondary)
4177
- }
4178
- })),
4179
- removeButton: css.css({
4180
- marginInline: theme.spacing(0.5),
4181
- cursor: "pointer",
4182
- "&:hover": {
4183
- color: theme.colors.text.primary
4184
- }
4185
- })
4186
- });
4187
-
4188
3755
  var __defProp$y = Object.defineProperty;
4189
3756
  var __defProps$m = Object.defineProperties;
4190
3757
  var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
@@ -4270,12 +3837,6 @@ class AdHocFiltersVariable extends SceneObjectBase {
4270
3837
  }
4271
3838
  this.setState({ filters: this.state.filters.filter((f) => f !== filter) });
4272
3839
  }
4273
- _removeLastFilter() {
4274
- const filterToRemove = this.state.filters.at(-1);
4275
- if (filterToRemove) {
4276
- this._removeFilter(filterToRemove);
4277
- }
4278
- }
4279
3840
  async _getKeys(currentKey) {
4280
3841
  var _a, _b, _c;
4281
3842
  const override = await ((_b = (_a = this.state).getTagKeysProvider) == null ? void 0 : _b.call(_a, this, currentKey));
@@ -4292,11 +3853,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
4292
3853
  const otherFilters = this.state.filters.filter((f) => f.key !== currentKey).concat((_c = this.state.baseFilters) != null ? _c : []);
4293
3854
  const timeRange = sceneGraph.getTimeRange(this).state.value;
4294
3855
  const queries = this.state.useQueriesAsFilterForOptions ? getQueriesForVariables(this) : void 0;
4295
- const response = await ds.getTagKeys(__spreadValues$y({
4296
- filters: otherFilters,
4297
- queries,
4298
- timeRange
4299
- }, getEnrichedFiltersRequest(this)));
3856
+ const response = await ds.getTagKeys(__spreadValues$y({ filters: otherFilters, queries, timeRange }, getEnrichedFiltersRequest(this)));
4300
3857
  if (responseHasError(response)) {
4301
3858
  this.setState({ error: response.error.message });
4302
3859
  }
@@ -4357,28 +3914,6 @@ function renderExpression(builder, filters) {
4357
3914
  function AdHocFiltersVariableRenderer({ model }) {
4358
3915
  const { filters, readOnly, addFilterButtonText } = model.useState();
4359
3916
  const styles = ui.useStyles2(getStyles$8);
4360
- const focusOnInputRef = React.useRef();
4361
- if (model.state.layout === "combobox") {
4362
- return /* @__PURE__ */ React__default["default"].createElement("div", {
4363
- className: styles.comboboxWrapper,
4364
- onClick: () => {
4365
- var _a;
4366
- (_a = focusOnInputRef.current) == null ? void 0 : _a.call(focusOnInputRef);
4367
- }
4368
- }, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
4369
- name: "filter",
4370
- className: styles.filterIcon,
4371
- size: "lg"
4372
- }), filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(AdHocFilterEditSwitch, {
4373
- key: index,
4374
- filter,
4375
- model
4376
- })), /* @__PURE__ */ React__default["default"].createElement(AdHocCombobox, {
4377
- model,
4378
- wip: true,
4379
- ref: focusOnInputRef
4380
- }));
4381
- }
4382
3917
  return /* @__PURE__ */ React__default["default"].createElement("div", {
4383
3918
  className: styles.wrapper
4384
3919
  }, filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, {
@@ -4400,31 +3935,9 @@ const getStyles$8 = (theme) => ({
4400
3935
  columnGap: theme.spacing(2),
4401
3936
  rowGap: theme.spacing(1)
4402
3937
  }),
4403
- comboboxWrapper: css.css({
4404
- display: "flex",
4405
- flexWrap: "wrap",
4406
- alignItems: "center",
4407
- columnGap: theme.spacing(1),
4408
- rowGap: theme.spacing(0.5),
4409
- minHeight: theme.spacing(4),
4410
- backgroundColor: theme.components.input.background,
4411
- border: `1px solid ${theme.colors.border.strong}`,
4412
- borderRadius: theme.shape.radius.default,
4413
- paddingInline: theme.spacing(1),
4414
- paddingBlock: theme.spacing(0.5),
4415
- flexGrow: 1,
4416
- "&:focus-within": {
4417
- outline: "2px dotted transparent",
4418
- outlineOffset: "2px",
4419
- boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,
4420
- transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,
4421
- transitionDuration: "0.2s",
4422
- transitionProperty: "outline, outline-offset, box-shadow"
4423
- }
4424
- }),
4425
3938
  filterIcon: css.css({
4426
3939
  color: theme.colors.text.secondary,
4427
- alignSelf: "center"
3940
+ paddingRight: theme.spacing(0.5)
4428
3941
  })
4429
3942
  });
4430
3943
  function toSelectableValue(input) {
@@ -7878,7 +7391,7 @@ class QueryVariable extends MultiValueVariable {
7878
7391
  options: [],
7879
7392
  datasource: null,
7880
7393
  regex: "",
7881
- query: { refId: "A" },
7394
+ query: "",
7882
7395
  refresh: data.VariableRefresh.onDashboardLoad,
7883
7396
  sort: data.VariableSort.disabled
7884
7397
  }, initialState));