@grafana/scenes 5.23.0--canary.954.11668840775.0 → 5.23.1--canary.955.11689118589.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +24 -0
- package/dist/esm/core/SceneTimeRange.js +1 -4
- package/dist/esm/core/SceneTimeRange.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFilterPill.js +14 -2
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFilterPill.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +46 -58
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/MultiValuePill.js +114 -0
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/MultiValuePill.js.map +1 -0
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/utils.js +14 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/utils.js.map +1 -1
- package/dist/esm/variables/macros/timeMacros.js +3 -0
- package/dist/esm/variables/macros/timeMacros.js.map +1 -1
- package/dist/index.js +406 -286
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
@@ -41,19 +41,19 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
41
|
var uFuzzy__default = /*#__PURE__*/_interopDefaultLegacy(uFuzzy);
|
42
42
|
var ReactGridLayout__default = /*#__PURE__*/_interopDefaultLegacy(ReactGridLayout);
|
43
43
|
|
44
|
-
var __defProp$
|
45
|
-
var __getOwnPropSymbols$
|
46
|
-
var __hasOwnProp$
|
47
|
-
var __propIsEnum$
|
48
|
-
var __defNormalProp$
|
49
|
-
var __spreadValues$
|
44
|
+
var __defProp$P = Object.defineProperty;
|
45
|
+
var __getOwnPropSymbols$P = Object.getOwnPropertySymbols;
|
46
|
+
var __hasOwnProp$P = Object.prototype.hasOwnProperty;
|
47
|
+
var __propIsEnum$P = Object.prototype.propertyIsEnumerable;
|
48
|
+
var __defNormalProp$P = (obj, key, value) => key in obj ? __defProp$P(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
49
|
+
var __spreadValues$P = (a, b) => {
|
50
50
|
for (var prop in b || (b = {}))
|
51
|
-
if (__hasOwnProp$
|
52
|
-
__defNormalProp$
|
53
|
-
if (__getOwnPropSymbols$
|
54
|
-
for (var prop of __getOwnPropSymbols$
|
55
|
-
if (__propIsEnum$
|
56
|
-
__defNormalProp$
|
51
|
+
if (__hasOwnProp$P.call(b, prop))
|
52
|
+
__defNormalProp$P(a, prop, b[prop]);
|
53
|
+
if (__getOwnPropSymbols$P)
|
54
|
+
for (var prop of __getOwnPropSymbols$P(b)) {
|
55
|
+
if (__propIsEnum$P.call(b, prop))
|
56
|
+
__defNormalProp$P(a, prop, b[prop]);
|
57
57
|
}
|
58
58
|
return a;
|
59
59
|
};
|
@@ -62,7 +62,7 @@ function useAppQueryParams() {
|
|
62
62
|
return runtime.locationSearchToObject(location.search || "");
|
63
63
|
}
|
64
64
|
function getUrlWithAppState(path, searchObject, preserveParams) {
|
65
|
-
const paramsCopy = __spreadValues$
|
65
|
+
const paramsCopy = __spreadValues$P({}, searchObject);
|
66
66
|
if (preserveParams) {
|
67
67
|
for (const key of Object.keys(paramsCopy)) {
|
68
68
|
if (!preserveParams.includes(key)) {
|
@@ -76,31 +76,31 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
|
|
76
76
|
return React__default["default"].createElement(sceneObject.Component, { model: sceneObject, routeProps });
|
77
77
|
}
|
78
78
|
|
79
|
-
var __defProp$
|
80
|
-
var __defProps$
|
81
|
-
var __getOwnPropDescs$
|
82
|
-
var __getOwnPropSymbols$
|
83
|
-
var __hasOwnProp$
|
84
|
-
var __propIsEnum$
|
85
|
-
var __defNormalProp$
|
86
|
-
var __spreadValues$
|
79
|
+
var __defProp$O = Object.defineProperty;
|
80
|
+
var __defProps$w = Object.defineProperties;
|
81
|
+
var __getOwnPropDescs$w = Object.getOwnPropertyDescriptors;
|
82
|
+
var __getOwnPropSymbols$O = Object.getOwnPropertySymbols;
|
83
|
+
var __hasOwnProp$O = Object.prototype.hasOwnProperty;
|
84
|
+
var __propIsEnum$O = Object.prototype.propertyIsEnumerable;
|
85
|
+
var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
86
|
+
var __spreadValues$O = (a, b) => {
|
87
87
|
for (var prop in b || (b = {}))
|
88
|
-
if (__hasOwnProp$
|
89
|
-
__defNormalProp$
|
90
|
-
if (__getOwnPropSymbols$
|
91
|
-
for (var prop of __getOwnPropSymbols$
|
92
|
-
if (__propIsEnum$
|
93
|
-
__defNormalProp$
|
88
|
+
if (__hasOwnProp$O.call(b, prop))
|
89
|
+
__defNormalProp$O(a, prop, b[prop]);
|
90
|
+
if (__getOwnPropSymbols$O)
|
91
|
+
for (var prop of __getOwnPropSymbols$O(b)) {
|
92
|
+
if (__propIsEnum$O.call(b, prop))
|
93
|
+
__defNormalProp$O(a, prop, b[prop]);
|
94
94
|
}
|
95
95
|
return a;
|
96
96
|
};
|
97
|
-
var __spreadProps$
|
97
|
+
var __spreadProps$w = (a, b) => __defProps$w(a, __getOwnPropDescs$w(b));
|
98
98
|
const runtimePanelPlugins = /* @__PURE__ */ new Map();
|
99
99
|
function registerRuntimePanelPlugin({ pluginId, plugin }) {
|
100
100
|
if (runtimePanelPlugins.has(pluginId)) {
|
101
101
|
throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);
|
102
102
|
}
|
103
|
-
plugin.meta = __spreadProps$
|
103
|
+
plugin.meta = __spreadProps$w(__spreadValues$O({}, plugin.meta), {
|
104
104
|
id: pluginId,
|
105
105
|
name: pluginId,
|
106
106
|
module: "runtime plugin",
|
@@ -128,33 +128,33 @@ function loadPanelPluginSync(pluginId) {
|
|
128
128
|
return (_a = getPanelPluginFromCache(pluginId)) != null ? _a : runtimePanelPlugins.get(pluginId);
|
129
129
|
}
|
130
130
|
|
131
|
-
var __defProp$
|
132
|
-
var __defProps$
|
133
|
-
var __getOwnPropDescs$
|
134
|
-
var __getOwnPropSymbols$
|
135
|
-
var __hasOwnProp$
|
136
|
-
var __propIsEnum$
|
137
|
-
var __defNormalProp$
|
138
|
-
var __spreadValues$
|
131
|
+
var __defProp$N = Object.defineProperty;
|
132
|
+
var __defProps$v = Object.defineProperties;
|
133
|
+
var __getOwnPropDescs$v = Object.getOwnPropertyDescriptors;
|
134
|
+
var __getOwnPropSymbols$N = Object.getOwnPropertySymbols;
|
135
|
+
var __hasOwnProp$N = Object.prototype.hasOwnProperty;
|
136
|
+
var __propIsEnum$N = Object.prototype.propertyIsEnumerable;
|
137
|
+
var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
138
|
+
var __spreadValues$N = (a, b) => {
|
139
139
|
for (var prop in b || (b = {}))
|
140
|
-
if (__hasOwnProp$
|
141
|
-
__defNormalProp$
|
142
|
-
if (__getOwnPropSymbols$
|
143
|
-
for (var prop of __getOwnPropSymbols$
|
144
|
-
if (__propIsEnum$
|
145
|
-
__defNormalProp$
|
140
|
+
if (__hasOwnProp$N.call(b, prop))
|
141
|
+
__defNormalProp$N(a, prop, b[prop]);
|
142
|
+
if (__getOwnPropSymbols$N)
|
143
|
+
for (var prop of __getOwnPropSymbols$N(b)) {
|
144
|
+
if (__propIsEnum$N.call(b, prop))
|
145
|
+
__defNormalProp$N(a, prop, b[prop]);
|
146
146
|
}
|
147
147
|
return a;
|
148
148
|
};
|
149
|
-
var __spreadProps$
|
149
|
+
var __spreadProps$v = (a, b) => __defProps$v(a, __getOwnPropDescs$v(b));
|
150
150
|
var __objRest$5 = (source, exclude) => {
|
151
151
|
var target = {};
|
152
152
|
for (var prop in source)
|
153
|
-
if (__hasOwnProp$
|
153
|
+
if (__hasOwnProp$N.call(source, prop) && exclude.indexOf(prop) < 0)
|
154
154
|
target[prop] = source[prop];
|
155
|
-
if (source != null && __getOwnPropSymbols$
|
156
|
-
for (var prop of __getOwnPropSymbols$
|
157
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
155
|
+
if (source != null && __getOwnPropSymbols$N)
|
156
|
+
for (var prop of __getOwnPropSymbols$N(source)) {
|
157
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$N.call(source, prop))
|
158
158
|
target[prop] = source[prop];
|
159
159
|
}
|
160
160
|
return target;
|
@@ -172,7 +172,7 @@ function SceneComponentWrapperWithoutMemo(_a) {
|
|
172
172
|
if (!model.isActive) {
|
173
173
|
return null;
|
174
174
|
}
|
175
|
-
return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$
|
175
|
+
return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$v(__spreadValues$N({}, otherProps), {
|
176
176
|
model
|
177
177
|
}));
|
178
178
|
}
|
@@ -218,19 +218,19 @@ class SceneObjectRef {
|
|
218
218
|
}
|
219
219
|
_ref = new WeakMap();
|
220
220
|
|
221
|
-
var __defProp$
|
222
|
-
var __getOwnPropSymbols$
|
223
|
-
var __hasOwnProp$
|
224
|
-
var __propIsEnum$
|
225
|
-
var __defNormalProp$
|
226
|
-
var __spreadValues$
|
221
|
+
var __defProp$M = Object.defineProperty;
|
222
|
+
var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
|
223
|
+
var __hasOwnProp$M = Object.prototype.hasOwnProperty;
|
224
|
+
var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
|
225
|
+
var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
226
|
+
var __spreadValues$M = (a, b) => {
|
227
227
|
for (var prop in b || (b = {}))
|
228
|
-
if (__hasOwnProp$
|
229
|
-
__defNormalProp$
|
230
|
-
if (__getOwnPropSymbols$
|
231
|
-
for (var prop of __getOwnPropSymbols$
|
232
|
-
if (__propIsEnum$
|
233
|
-
__defNormalProp$
|
228
|
+
if (__hasOwnProp$M.call(b, prop))
|
229
|
+
__defNormalProp$M(a, prop, b[prop]);
|
230
|
+
if (__getOwnPropSymbols$M)
|
231
|
+
for (var prop of __getOwnPropSymbols$M(b)) {
|
232
|
+
if (__propIsEnum$M.call(b, prop))
|
233
|
+
__defNormalProp$M(a, prop, b[prop]);
|
234
234
|
}
|
235
235
|
return a;
|
236
236
|
};
|
@@ -293,7 +293,7 @@ class SceneObjectBase {
|
|
293
293
|
}
|
294
294
|
setState(update) {
|
295
295
|
const prevState = this._state;
|
296
|
-
const newState = __spreadValues$
|
296
|
+
const newState = __spreadValues$M(__spreadValues$M({}, this._state), update);
|
297
297
|
this._state = Object.freeze(newState);
|
298
298
|
this._setParent(update);
|
299
299
|
this._handleActivationOfChangedStateProps(prevState, newState);
|
@@ -489,19 +489,19 @@ function forEachChild(state, callback) {
|
|
489
489
|
}
|
490
490
|
}
|
491
491
|
|
492
|
-
var __defProp$
|
493
|
-
var __getOwnPropSymbols$
|
494
|
-
var __hasOwnProp$
|
495
|
-
var __propIsEnum$
|
496
|
-
var __defNormalProp$
|
497
|
-
var __spreadValues$
|
492
|
+
var __defProp$L = Object.defineProperty;
|
493
|
+
var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
|
494
|
+
var __hasOwnProp$L = Object.prototype.hasOwnProperty;
|
495
|
+
var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
|
496
|
+
var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
497
|
+
var __spreadValues$L = (a, b) => {
|
498
498
|
for (var prop in b || (b = {}))
|
499
|
-
if (__hasOwnProp$
|
500
|
-
__defNormalProp$
|
501
|
-
if (__getOwnPropSymbols$
|
502
|
-
for (var prop of __getOwnPropSymbols$
|
503
|
-
if (__propIsEnum$
|
504
|
-
__defNormalProp$
|
499
|
+
if (__hasOwnProp$L.call(b, prop))
|
500
|
+
__defNormalProp$L(a, prop, b[prop]);
|
501
|
+
if (__getOwnPropSymbols$L)
|
502
|
+
for (var prop of __getOwnPropSymbols$L(b)) {
|
503
|
+
if (__propIsEnum$L.call(b, prop))
|
504
|
+
__defNormalProp$L(a, prop, b[prop]);
|
505
505
|
}
|
506
506
|
return a;
|
507
507
|
};
|
@@ -510,7 +510,7 @@ function cloneSceneObject(sceneObject, withState) {
|
|
510
510
|
return new sceneObject.constructor(clonedState);
|
511
511
|
}
|
512
512
|
function cloneSceneObjectState(sceneState, withState) {
|
513
|
-
const clonedState = __spreadValues$
|
513
|
+
const clonedState = __spreadValues$L({}, sceneState);
|
514
514
|
Object.assign(clonedState, withState);
|
515
515
|
for (const key in clonedState) {
|
516
516
|
if (withState && withState[key] !== void 0) {
|
@@ -611,25 +611,25 @@ function lookupVariable(name, sceneObject) {
|
|
611
611
|
return null;
|
612
612
|
}
|
613
613
|
|
614
|
-
var __defProp$
|
615
|
-
var __getOwnPropSymbols$
|
616
|
-
var __hasOwnProp$
|
617
|
-
var __propIsEnum$
|
618
|
-
var __defNormalProp$
|
619
|
-
var __spreadValues$
|
614
|
+
var __defProp$K = Object.defineProperty;
|
615
|
+
var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
|
616
|
+
var __hasOwnProp$K = Object.prototype.hasOwnProperty;
|
617
|
+
var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
|
618
|
+
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
619
|
+
var __spreadValues$K = (a, b) => {
|
620
620
|
for (var prop in b || (b = {}))
|
621
|
-
if (__hasOwnProp$
|
622
|
-
__defNormalProp$
|
623
|
-
if (__getOwnPropSymbols$
|
624
|
-
for (var prop of __getOwnPropSymbols$
|
625
|
-
if (__propIsEnum$
|
626
|
-
__defNormalProp$
|
621
|
+
if (__hasOwnProp$K.call(b, prop))
|
622
|
+
__defNormalProp$K(a, prop, b[prop]);
|
623
|
+
if (__getOwnPropSymbols$K)
|
624
|
+
for (var prop of __getOwnPropSymbols$K(b)) {
|
625
|
+
if (__propIsEnum$K.call(b, prop))
|
626
|
+
__defNormalProp$K(a, prop, b[prop]);
|
627
627
|
}
|
628
628
|
return a;
|
629
629
|
};
|
630
630
|
class SceneDataNode extends SceneObjectBase {
|
631
631
|
constructor(state) {
|
632
|
-
super(__spreadValues$
|
632
|
+
super(__spreadValues$K({
|
633
633
|
data: emptyPanelData
|
634
634
|
}, state));
|
635
635
|
}
|
@@ -735,19 +735,19 @@ function isValid$1(value, roundUp, timeZone) {
|
|
735
735
|
return parsed.isValid();
|
736
736
|
}
|
737
737
|
|
738
|
-
var __defProp$
|
739
|
-
var __getOwnPropSymbols$
|
740
|
-
var __hasOwnProp$
|
741
|
-
var __propIsEnum$
|
742
|
-
var __defNormalProp$
|
743
|
-
var __spreadValues$
|
738
|
+
var __defProp$J = Object.defineProperty;
|
739
|
+
var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
|
740
|
+
var __hasOwnProp$J = Object.prototype.hasOwnProperty;
|
741
|
+
var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
|
742
|
+
var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
743
|
+
var __spreadValues$J = (a, b) => {
|
744
744
|
for (var prop in b || (b = {}))
|
745
|
-
if (__hasOwnProp$
|
746
|
-
__defNormalProp$
|
747
|
-
if (__getOwnPropSymbols$
|
748
|
-
for (var prop of __getOwnPropSymbols$
|
749
|
-
if (__propIsEnum$
|
750
|
-
__defNormalProp$
|
745
|
+
if (__hasOwnProp$J.call(b, prop))
|
746
|
+
__defNormalProp$J(a, prop, b[prop]);
|
747
|
+
if (__getOwnPropSymbols$J)
|
748
|
+
for (var prop of __getOwnPropSymbols$J(b)) {
|
749
|
+
if (__propIsEnum$J.call(b, prop))
|
750
|
+
__defNormalProp$J(a, prop, b[prop]);
|
751
751
|
}
|
752
752
|
return a;
|
753
753
|
};
|
@@ -765,7 +765,7 @@ class SceneTimeRange extends SceneObjectBase {
|
|
765
765
|
state.UNSAFE_nowDelay
|
766
766
|
);
|
767
767
|
const refreshOnActivate = (_a = state.refreshOnActivate) != null ? _a : { percent: 10 };
|
768
|
-
super(__spreadValues$
|
768
|
+
super(__spreadValues$J({ from, to, timeZone, value, refreshOnActivate }, state));
|
769
769
|
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["from", "to", "timezone", "time", "time.window"] });
|
770
770
|
this.onTimeRangeChange = (timeRange) => {
|
771
771
|
const update = {};
|
@@ -896,10 +896,7 @@ class SceneTimeRange extends SceneObjectBase {
|
|
896
896
|
}
|
897
897
|
getUrlState() {
|
898
898
|
const params = runtime.locationService.getSearchObject();
|
899
|
-
const urlValues = { from: this.state.from, to: this.state.to };
|
900
|
-
if (this.state.timeZone) {
|
901
|
-
urlValues.timezone = this.state.timeZone;
|
902
|
-
}
|
899
|
+
const urlValues = { from: this.state.from, to: this.state.to, timezone: this.getTimeZone() };
|
903
900
|
if (params.time && params["time.window"]) {
|
904
901
|
urlValues.time = null;
|
905
902
|
urlValues["time.window"] = null;
|
@@ -1345,6 +1342,9 @@ class UrlTimeRangeMacro {
|
|
1345
1342
|
var _a;
|
1346
1343
|
const timeRange = getTimeRange(this._sceneObject);
|
1347
1344
|
const urlState = (_a = timeRange.urlSync) == null ? void 0 : _a.getUrlState();
|
1345
|
+
if ((urlState == null ? void 0 : urlState.timezone) === "browser") {
|
1346
|
+
urlState.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
1347
|
+
}
|
1348
1348
|
return new SkipFormattingValue(data.urlUtil.toUrlParams(urlState));
|
1349
1349
|
}
|
1350
1350
|
getValueText() {
|
@@ -1749,25 +1749,25 @@ function collectAllVariables(sceneObject, record = {}) {
|
|
1749
1749
|
return record;
|
1750
1750
|
}
|
1751
1751
|
|
1752
|
-
var __defProp$
|
1753
|
-
var __defProps$
|
1754
|
-
var __getOwnPropDescs$
|
1755
|
-
var __getOwnPropSymbols$
|
1756
|
-
var __hasOwnProp$
|
1757
|
-
var __propIsEnum$
|
1758
|
-
var __defNormalProp$
|
1759
|
-
var __spreadValues$
|
1752
|
+
var __defProp$I = Object.defineProperty;
|
1753
|
+
var __defProps$u = Object.defineProperties;
|
1754
|
+
var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
|
1755
|
+
var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
|
1756
|
+
var __hasOwnProp$I = Object.prototype.hasOwnProperty;
|
1757
|
+
var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
|
1758
|
+
var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
1759
|
+
var __spreadValues$I = (a, b) => {
|
1760
1760
|
for (var prop in b || (b = {}))
|
1761
|
-
if (__hasOwnProp$
|
1762
|
-
__defNormalProp$
|
1763
|
-
if (__getOwnPropSymbols$
|
1764
|
-
for (var prop of __getOwnPropSymbols$
|
1765
|
-
if (__propIsEnum$
|
1766
|
-
__defNormalProp$
|
1761
|
+
if (__hasOwnProp$I.call(b, prop))
|
1762
|
+
__defNormalProp$I(a, prop, b[prop]);
|
1763
|
+
if (__getOwnPropSymbols$I)
|
1764
|
+
for (var prop of __getOwnPropSymbols$I(b)) {
|
1765
|
+
if (__propIsEnum$I.call(b, prop))
|
1766
|
+
__defNormalProp$I(a, prop, b[prop]);
|
1767
1767
|
}
|
1768
1768
|
return a;
|
1769
1769
|
};
|
1770
|
-
var __spreadProps$
|
1770
|
+
var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
|
1771
1771
|
function getTemplateProxyForField(field, frame, frames) {
|
1772
1772
|
return new Proxy(
|
1773
1773
|
{},
|
@@ -1783,7 +1783,7 @@ function getTemplateProxyForField(field, frame, frames) {
|
|
1783
1783
|
if (!field.labels) {
|
1784
1784
|
return "";
|
1785
1785
|
}
|
1786
|
-
return __spreadProps$
|
1786
|
+
return __spreadProps$u(__spreadValues$I({}, field.labels), {
|
1787
1787
|
__values: Object.values(field.labels).sort().join(", "),
|
1788
1788
|
toString: () => {
|
1789
1789
|
return data.formatLabels(field.labels, "", true);
|
@@ -2280,25 +2280,25 @@ function isExtraQueryProvider(obj) {
|
|
2280
2280
|
return typeof obj === "object" && "getExtraQueries" in obj;
|
2281
2281
|
}
|
2282
2282
|
|
2283
|
-
var __defProp$
|
2284
|
-
var __defProps$
|
2285
|
-
var __getOwnPropDescs$
|
2286
|
-
var __getOwnPropSymbols$
|
2287
|
-
var __hasOwnProp$
|
2288
|
-
var __propIsEnum$
|
2289
|
-
var __defNormalProp$
|
2290
|
-
var __spreadValues$
|
2283
|
+
var __defProp$H = Object.defineProperty;
|
2284
|
+
var __defProps$t = Object.defineProperties;
|
2285
|
+
var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
|
2286
|
+
var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
|
2287
|
+
var __hasOwnProp$H = Object.prototype.hasOwnProperty;
|
2288
|
+
var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
|
2289
|
+
var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
2290
|
+
var __spreadValues$H = (a, b) => {
|
2291
2291
|
for (var prop in b || (b = {}))
|
2292
|
-
if (__hasOwnProp$
|
2293
|
-
__defNormalProp$
|
2294
|
-
if (__getOwnPropSymbols$
|
2295
|
-
for (var prop of __getOwnPropSymbols$
|
2296
|
-
if (__propIsEnum$
|
2297
|
-
__defNormalProp$
|
2292
|
+
if (__hasOwnProp$H.call(b, prop))
|
2293
|
+
__defNormalProp$H(a, prop, b[prop]);
|
2294
|
+
if (__getOwnPropSymbols$H)
|
2295
|
+
for (var prop of __getOwnPropSymbols$H(b)) {
|
2296
|
+
if (__propIsEnum$H.call(b, prop))
|
2297
|
+
__defNormalProp$H(a, prop, b[prop]);
|
2298
2298
|
}
|
2299
2299
|
return a;
|
2300
2300
|
};
|
2301
|
-
var __spreadProps$
|
2301
|
+
var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
|
2302
2302
|
const passthroughProcessor = (_, secondary) => rxjs.of(secondary);
|
2303
2303
|
const extraQueryProcessingOperator = (processors) => (data) => {
|
2304
2304
|
return data.pipe(
|
@@ -2311,7 +2311,7 @@ const extraQueryProcessingOperator = (processors) => (data) => {
|
|
2311
2311
|
}),
|
2312
2312
|
rxjs.map(([primary, ...processedSecondaries]) => {
|
2313
2313
|
var _a;
|
2314
|
-
return __spreadProps$
|
2314
|
+
return __spreadProps$t(__spreadValues$H({}, primary), {
|
2315
2315
|
series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],
|
2316
2316
|
annotations: [...(_a = primary.annotations) != null ? _a : [], ...processedSecondaries.flatMap((s) => {
|
2317
2317
|
var _a2;
|
@@ -2322,25 +2322,25 @@ const extraQueryProcessingOperator = (processors) => (data) => {
|
|
2322
2322
|
);
|
2323
2323
|
};
|
2324
2324
|
|
2325
|
-
var __defProp$
|
2326
|
-
var __defProps$
|
2327
|
-
var __getOwnPropDescs$
|
2328
|
-
var __getOwnPropSymbols$
|
2329
|
-
var __hasOwnProp$
|
2330
|
-
var __propIsEnum$
|
2331
|
-
var __defNormalProp$
|
2332
|
-
var __spreadValues$
|
2325
|
+
var __defProp$G = Object.defineProperty;
|
2326
|
+
var __defProps$s = Object.defineProperties;
|
2327
|
+
var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
|
2328
|
+
var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
|
2329
|
+
var __hasOwnProp$G = Object.prototype.hasOwnProperty;
|
2330
|
+
var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
|
2331
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
2332
|
+
var __spreadValues$G = (a, b) => {
|
2333
2333
|
for (var prop in b || (b = {}))
|
2334
|
-
if (__hasOwnProp$
|
2335
|
-
__defNormalProp$
|
2336
|
-
if (__getOwnPropSymbols$
|
2337
|
-
for (var prop of __getOwnPropSymbols$
|
2338
|
-
if (__propIsEnum$
|
2339
|
-
__defNormalProp$
|
2334
|
+
if (__hasOwnProp$G.call(b, prop))
|
2335
|
+
__defNormalProp$G(a, prop, b[prop]);
|
2336
|
+
if (__getOwnPropSymbols$G)
|
2337
|
+
for (var prop of __getOwnPropSymbols$G(b)) {
|
2338
|
+
if (__propIsEnum$G.call(b, prop))
|
2339
|
+
__defNormalProp$G(a, prop, b[prop]);
|
2340
2340
|
}
|
2341
2341
|
return a;
|
2342
2342
|
};
|
2343
|
-
var __spreadProps$
|
2343
|
+
var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
|
2344
2344
|
function filterAnnotations(data, filters) {
|
2345
2345
|
var _a;
|
2346
2346
|
if (!Array.isArray(data) || data.length === 0) {
|
@@ -2391,11 +2391,11 @@ function filterAnnotations(data, filters) {
|
|
2391
2391
|
continue;
|
2392
2392
|
}
|
2393
2393
|
}
|
2394
|
-
fields.push(__spreadProps$
|
2394
|
+
fields.push(__spreadProps$s(__spreadValues$G({}, field), {
|
2395
2395
|
values: buffer
|
2396
2396
|
}));
|
2397
2397
|
}
|
2398
|
-
processed.push(__spreadProps$
|
2398
|
+
processed.push(__spreadProps$s(__spreadValues$G({}, frame), {
|
2399
2399
|
fields,
|
2400
2400
|
length: frameLength
|
2401
2401
|
}));
|
@@ -2545,33 +2545,33 @@ function getOptionSearcher(options, includeAll) {
|
|
2545
2545
|
};
|
2546
2546
|
}
|
2547
2547
|
|
2548
|
-
var __defProp$
|
2549
|
-
var __defProps$
|
2550
|
-
var __getOwnPropDescs$
|
2551
|
-
var __getOwnPropSymbols$
|
2552
|
-
var __hasOwnProp$
|
2553
|
-
var __propIsEnum$
|
2554
|
-
var __defNormalProp$
|
2555
|
-
var __spreadValues$
|
2548
|
+
var __defProp$F = Object.defineProperty;
|
2549
|
+
var __defProps$r = Object.defineProperties;
|
2550
|
+
var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
|
2551
|
+
var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
|
2552
|
+
var __hasOwnProp$F = Object.prototype.hasOwnProperty;
|
2553
|
+
var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
|
2554
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
2555
|
+
var __spreadValues$F = (a, b) => {
|
2556
2556
|
for (var prop in b || (b = {}))
|
2557
|
-
if (__hasOwnProp$
|
2558
|
-
__defNormalProp$
|
2559
|
-
if (__getOwnPropSymbols$
|
2560
|
-
for (var prop of __getOwnPropSymbols$
|
2561
|
-
if (__propIsEnum$
|
2562
|
-
__defNormalProp$
|
2557
|
+
if (__hasOwnProp$F.call(b, prop))
|
2558
|
+
__defNormalProp$F(a, prop, b[prop]);
|
2559
|
+
if (__getOwnPropSymbols$F)
|
2560
|
+
for (var prop of __getOwnPropSymbols$F(b)) {
|
2561
|
+
if (__propIsEnum$F.call(b, prop))
|
2562
|
+
__defNormalProp$F(a, prop, b[prop]);
|
2563
2563
|
}
|
2564
2564
|
return a;
|
2565
2565
|
};
|
2566
|
-
var __spreadProps$
|
2566
|
+
var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
|
2567
2567
|
var __objRest$4 = (source, exclude) => {
|
2568
2568
|
var target = {};
|
2569
2569
|
for (var prop in source)
|
2570
|
-
if (__hasOwnProp$
|
2570
|
+
if (__hasOwnProp$F.call(source, prop) && exclude.indexOf(prop) < 0)
|
2571
2571
|
target[prop] = source[prop];
|
2572
|
-
if (source != null && __getOwnPropSymbols$
|
2573
|
-
for (var prop of __getOwnPropSymbols$
|
2574
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
2572
|
+
if (source != null && __getOwnPropSymbols$F)
|
2573
|
+
for (var prop of __getOwnPropSymbols$F(source)) {
|
2574
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$F.call(source, prop))
|
2575
2575
|
target[prop] = source[prop];
|
2576
2576
|
}
|
2577
2577
|
return target;
|
@@ -2719,7 +2719,7 @@ const OptionWithCheckbox = ({
|
|
2719
2719
|
const theme = ui.useTheme2();
|
2720
2720
|
const selectStyles = ui.getSelectStyles(theme);
|
2721
2721
|
const optionStyles = ui.useStyles2(getOptionStyles);
|
2722
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$
|
2722
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$r(__spreadValues$F({
|
2723
2723
|
ref: innerRef,
|
2724
2724
|
className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
|
2725
2725
|
}, rest), {
|
@@ -2884,28 +2884,28 @@ function wrapInSafeSerializableSceneObject(sceneObject) {
|
|
2884
2884
|
return { value: sceneObject, text: "__sceneObject" };
|
2885
2885
|
}
|
2886
2886
|
|
2887
|
-
var __defProp$
|
2888
|
-
var __defProps$
|
2889
|
-
var __getOwnPropDescs$
|
2890
|
-
var __getOwnPropSymbols$
|
2891
|
-
var __hasOwnProp$
|
2892
|
-
var __propIsEnum$
|
2893
|
-
var __defNormalProp$
|
2894
|
-
var __spreadValues$
|
2887
|
+
var __defProp$E = Object.defineProperty;
|
2888
|
+
var __defProps$q = Object.defineProperties;
|
2889
|
+
var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
|
2890
|
+
var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
|
2891
|
+
var __hasOwnProp$E = Object.prototype.hasOwnProperty;
|
2892
|
+
var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
|
2893
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
2894
|
+
var __spreadValues$E = (a, b) => {
|
2895
2895
|
for (var prop in b || (b = {}))
|
2896
|
-
if (__hasOwnProp$
|
2897
|
-
__defNormalProp$
|
2898
|
-
if (__getOwnPropSymbols$
|
2899
|
-
for (var prop of __getOwnPropSymbols$
|
2900
|
-
if (__propIsEnum$
|
2901
|
-
__defNormalProp$
|
2896
|
+
if (__hasOwnProp$E.call(b, prop))
|
2897
|
+
__defNormalProp$E(a, prop, b[prop]);
|
2898
|
+
if (__getOwnPropSymbols$E)
|
2899
|
+
for (var prop of __getOwnPropSymbols$E(b)) {
|
2900
|
+
if (__propIsEnum$E.call(b, prop))
|
2901
|
+
__defNormalProp$E(a, prop, b[prop]);
|
2902
2902
|
}
|
2903
2903
|
return a;
|
2904
2904
|
};
|
2905
|
-
var __spreadProps$
|
2905
|
+
var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
|
2906
2906
|
class GroupByVariable extends MultiValueVariable {
|
2907
2907
|
constructor(initialState) {
|
2908
|
-
super(__spreadProps$
|
2908
|
+
super(__spreadProps$q(__spreadValues$E({
|
2909
2909
|
isMulti: true,
|
2910
2910
|
name: "",
|
2911
2911
|
value: [],
|
@@ -2936,7 +2936,7 @@ class GroupByVariable extends MultiValueVariable {
|
|
2936
2936
|
const queries = getQueriesForVariables(this);
|
2937
2937
|
const otherFilters = this.state.baseFilters || [];
|
2938
2938
|
const timeRange = sceneGraph.getTimeRange(this).state.value;
|
2939
|
-
const response = await ds.getTagKeys(__spreadValues$
|
2939
|
+
const response = await ds.getTagKeys(__spreadValues$E({
|
2940
2940
|
filters: otherFilters,
|
2941
2941
|
queries,
|
2942
2942
|
timeRange
|
@@ -3131,7 +3131,7 @@ function LoadingIndicator(props) {
|
|
3131
3131
|
}
|
3132
3132
|
|
3133
3133
|
function ControlsLabel(props) {
|
3134
|
-
const styles = ui.useStyles2(getStyles$
|
3134
|
+
const styles = ui.useStyles2(getStyles$f);
|
3135
3135
|
const theme = ui.useTheme2();
|
3136
3136
|
const isVertical = props.layout === "vertical";
|
3137
3137
|
const loadingIndicator = Boolean(props.isLoading) ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
@@ -3194,7 +3194,7 @@ function ControlsLabel(props) {
|
|
3194
3194
|
}
|
3195
3195
|
return labelElement;
|
3196
3196
|
}
|
3197
|
-
const getStyles$
|
3197
|
+
const getStyles$f = (theme) => ({
|
3198
3198
|
horizontalLabel: css.css({
|
3199
3199
|
background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,
|
3200
3200
|
display: `flex`,
|
@@ -3270,19 +3270,19 @@ function getAdhocOptionSearcher(options) {
|
|
3270
3270
|
};
|
3271
3271
|
}
|
3272
3272
|
|
3273
|
-
var __defProp$
|
3274
|
-
var __getOwnPropSymbols$
|
3275
|
-
var __hasOwnProp$
|
3276
|
-
var __propIsEnum$
|
3277
|
-
var __defNormalProp$
|
3278
|
-
var __spreadValues$
|
3273
|
+
var __defProp$D = Object.defineProperty;
|
3274
|
+
var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
|
3275
|
+
var __hasOwnProp$D = Object.prototype.hasOwnProperty;
|
3276
|
+
var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
|
3277
|
+
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3278
|
+
var __spreadValues$D = (a, b) => {
|
3279
3279
|
for (var prop in b || (b = {}))
|
3280
|
-
if (__hasOwnProp$
|
3281
|
-
__defNormalProp$
|
3282
|
-
if (__getOwnPropSymbols$
|
3283
|
-
for (var prop of __getOwnPropSymbols$
|
3284
|
-
if (__propIsEnum$
|
3285
|
-
__defNormalProp$
|
3280
|
+
if (__hasOwnProp$D.call(b, prop))
|
3281
|
+
__defNormalProp$D(a, prop, b[prop]);
|
3282
|
+
if (__getOwnPropSymbols$D)
|
3283
|
+
for (var prop of __getOwnPropSymbols$D(b)) {
|
3284
|
+
if (__propIsEnum$D.call(b, prop))
|
3285
|
+
__defNormalProp$D(a, prop, b[prop]);
|
3286
3286
|
}
|
3287
3287
|
return a;
|
3288
3288
|
};
|
@@ -3295,7 +3295,7 @@ function keyLabelToOption(key, label) {
|
|
3295
3295
|
const filterNoOp = () => true;
|
3296
3296
|
function AdHocFilterRenderer({ filter, model }) {
|
3297
3297
|
var _a, _b, _c;
|
3298
|
-
const styles = ui.useStyles2(getStyles$
|
3298
|
+
const styles = ui.useStyles2(getStyles$e);
|
3299
3299
|
const [keys, setKeys] = React.useState([]);
|
3300
3300
|
const [values, setValues] = React.useState([]);
|
3301
3301
|
const [isKeysLoading, setIsKeysLoading] = React.useState(false);
|
@@ -3366,7 +3366,7 @@ function AdHocFilterRenderer({ filter, model }) {
|
|
3366
3366
|
});
|
3367
3367
|
}
|
3368
3368
|
};
|
3369
|
-
const valueSelect = /* @__PURE__ */ React__default["default"].createElement(ui.Select, __spreadValues$
|
3369
|
+
const valueSelect = /* @__PURE__ */ React__default["default"].createElement(ui.Select, __spreadValues$D({
|
3370
3370
|
virtualized: true,
|
3371
3371
|
allowCustomValue: true,
|
3372
3372
|
isValidNewOption: (inputValue) => inputValue.trim().length > 0,
|
@@ -3498,7 +3498,7 @@ function AdHocFilterRenderer({ filter, model }) {
|
|
3498
3498
|
onClick: () => model._removeFilter(filter)
|
3499
3499
|
}));
|
3500
3500
|
}
|
3501
|
-
const getStyles$
|
3501
|
+
const getStyles$e = (theme) => ({
|
3502
3502
|
field: css.css({
|
3503
3503
|
marginBottom: 0
|
3504
3504
|
}),
|
@@ -3650,30 +3650,30 @@ function isFilter(filter) {
|
|
3650
3650
|
return filter !== null && typeof filter.key === "string" && typeof filter.value === "string";
|
3651
3651
|
}
|
3652
3652
|
|
3653
|
-
var __defProp$
|
3654
|
-
var __getOwnPropSymbols$
|
3655
|
-
var __hasOwnProp$
|
3656
|
-
var __propIsEnum$
|
3657
|
-
var __defNormalProp$
|
3658
|
-
var __spreadValues$
|
3653
|
+
var __defProp$C = Object.defineProperty;
|
3654
|
+
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
3655
|
+
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
3656
|
+
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
3657
|
+
var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3658
|
+
var __spreadValues$C = (a, b) => {
|
3659
3659
|
for (var prop in b || (b = {}))
|
3660
|
-
if (__hasOwnProp$
|
3661
|
-
__defNormalProp$
|
3662
|
-
if (__getOwnPropSymbols$
|
3663
|
-
for (var prop of __getOwnPropSymbols$
|
3664
|
-
if (__propIsEnum$
|
3665
|
-
__defNormalProp$
|
3660
|
+
if (__hasOwnProp$C.call(b, prop))
|
3661
|
+
__defNormalProp$C(a, prop, b[prop]);
|
3662
|
+
if (__getOwnPropSymbols$C)
|
3663
|
+
for (var prop of __getOwnPropSymbols$C(b)) {
|
3664
|
+
if (__propIsEnum$C.call(b, prop))
|
3665
|
+
__defNormalProp$C(a, prop, b[prop]);
|
3666
3666
|
}
|
3667
3667
|
return a;
|
3668
3668
|
};
|
3669
3669
|
var __objRest$3 = (source, exclude) => {
|
3670
3670
|
var target = {};
|
3671
3671
|
for (var prop in source)
|
3672
|
-
if (__hasOwnProp$
|
3672
|
+
if (__hasOwnProp$C.call(source, prop) && exclude.indexOf(prop) < 0)
|
3673
3673
|
target[prop] = source[prop];
|
3674
|
-
if (source != null && __getOwnPropSymbols$
|
3675
|
-
for (var prop of __getOwnPropSymbols$
|
3676
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
3674
|
+
if (source != null && __getOwnPropSymbols$C)
|
3675
|
+
for (var prop of __getOwnPropSymbols$C(source)) {
|
3676
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$C.call(source, prop))
|
3677
3677
|
target[prop] = source[prop];
|
3678
3678
|
}
|
3679
3679
|
return target;
|
@@ -3681,9 +3681,9 @@ var __objRest$3 = (source, exclude) => {
|
|
3681
3681
|
const DropdownItem = React.forwardRef(
|
3682
3682
|
function DropdownItem2(_a, ref) {
|
3683
3683
|
var _b = _a, { children, active, addGroupBottomBorder, isMultiValueEdit, checked } = _b, rest = __objRest$3(_b, ["children", "active", "addGroupBottomBorder", "isMultiValueEdit", "checked"]);
|
3684
|
-
const styles = ui.useStyles2(getStyles$
|
3684
|
+
const styles = ui.useStyles2(getStyles$d);
|
3685
3685
|
const id = React.useId();
|
3686
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$
|
3686
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$C({
|
3687
3687
|
ref,
|
3688
3688
|
role: "option",
|
3689
3689
|
id,
|
@@ -3699,7 +3699,7 @@ const DropdownItem = React.forwardRef(
|
|
3699
3699
|
}) : null, children)));
|
3700
3700
|
}
|
3701
3701
|
);
|
3702
|
-
const getStyles$
|
3702
|
+
const getStyles$d = (theme) => ({
|
3703
3703
|
option: css.css({
|
3704
3704
|
label: "grafana-select-option",
|
3705
3705
|
top: 0,
|
@@ -3770,7 +3770,7 @@ const OptionsErrorPlaceholder = ({ handleFetchOptions }) => {
|
|
3770
3770
|
}, "An error has occurred fetching labels. Click to retry");
|
3771
3771
|
};
|
3772
3772
|
const MultiValueApplyButton = ({ onApply, floatingElement, maxOptionWidth, menuHeight }) => {
|
3773
|
-
const styles = ui.useStyles2(getStyles$
|
3773
|
+
const styles = ui.useStyles2(getStyles$d);
|
3774
3774
|
const floatingElementRect = floatingElement == null ? void 0 : floatingElement.getBoundingClientRect();
|
3775
3775
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
3776
3776
|
className: styles.multiValueApplyWrapper,
|
@@ -3951,6 +3951,19 @@ const generatePlaceholder = (filter, filterInputType, isMultiValueEdit, isAlways
|
|
3951
3951
|
}
|
3952
3952
|
return filter[filterInputType] && !isAlwaysWip ? `${filter[filterInputType]}` : INPUT_PLACEHOLDER;
|
3953
3953
|
};
|
3954
|
+
const populateInputValueOnInputTypeSwitch = ({
|
3955
|
+
populateInputOnEdit,
|
3956
|
+
item,
|
3957
|
+
filterInputType,
|
3958
|
+
setInputValue,
|
3959
|
+
filter
|
3960
|
+
}) => {
|
3961
|
+
if (populateInputOnEdit && !isMultiValueOperator(item.value || "") && nextInputTypeMap[filterInputType] === "value") {
|
3962
|
+
setInputValue((filter == null ? void 0 : filter.value) || "");
|
3963
|
+
} else {
|
3964
|
+
setInputValue("");
|
3965
|
+
}
|
3966
|
+
};
|
3954
3967
|
|
3955
3968
|
const MAX_MENU_HEIGHT = 300;
|
3956
3969
|
const useFloatingInteractions = ({
|
@@ -4016,6 +4029,114 @@ const useFloatingInteractions = ({
|
|
4016
4029
|
};
|
4017
4030
|
};
|
4018
4031
|
|
4032
|
+
var __defProp$B = Object.defineProperty;
|
4033
|
+
var __defProps$p = Object.defineProperties;
|
4034
|
+
var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
|
4035
|
+
var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
|
4036
|
+
var __hasOwnProp$B = Object.prototype.hasOwnProperty;
|
4037
|
+
var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
|
4038
|
+
var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4039
|
+
var __spreadValues$B = (a, b) => {
|
4040
|
+
for (var prop in b || (b = {}))
|
4041
|
+
if (__hasOwnProp$B.call(b, prop))
|
4042
|
+
__defNormalProp$B(a, prop, b[prop]);
|
4043
|
+
if (__getOwnPropSymbols$B)
|
4044
|
+
for (var prop of __getOwnPropSymbols$B(b)) {
|
4045
|
+
if (__propIsEnum$B.call(b, prop))
|
4046
|
+
__defNormalProp$B(a, prop, b[prop]);
|
4047
|
+
}
|
4048
|
+
return a;
|
4049
|
+
};
|
4050
|
+
var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
|
4051
|
+
const MultiValuePill = ({
|
4052
|
+
item,
|
4053
|
+
handleRemoveMultiValue,
|
4054
|
+
index,
|
4055
|
+
handleEditMultiValuePill
|
4056
|
+
}) => {
|
4057
|
+
var _a, _b;
|
4058
|
+
const styles = ui.useStyles2(getStyles$c);
|
4059
|
+
const editMultiValuePill = React.useCallback(
|
4060
|
+
(e) => {
|
4061
|
+
e.stopPropagation();
|
4062
|
+
e.preventDefault();
|
4063
|
+
handleEditMultiValuePill(item);
|
4064
|
+
},
|
4065
|
+
[handleEditMultiValuePill, item]
|
4066
|
+
);
|
4067
|
+
const editMultiValuePillWithKeyboard = React.useCallback(
|
4068
|
+
(e) => {
|
4069
|
+
if (e.key === "Enter") {
|
4070
|
+
editMultiValuePill(e);
|
4071
|
+
}
|
4072
|
+
},
|
4073
|
+
[editMultiValuePill]
|
4074
|
+
);
|
4075
|
+
const removePillHandler = React.useCallback(
|
4076
|
+
(e) => {
|
4077
|
+
e.stopPropagation();
|
4078
|
+
e.preventDefault();
|
4079
|
+
handleRemoveMultiValue(item);
|
4080
|
+
},
|
4081
|
+
[handleRemoveMultiValue, item]
|
4082
|
+
);
|
4083
|
+
const removePillHandlerWithKeyboard = React.useCallback(
|
4084
|
+
(e) => {
|
4085
|
+
if (e.key === "Enter") {
|
4086
|
+
removePillHandler(e);
|
4087
|
+
}
|
4088
|
+
},
|
4089
|
+
[removePillHandler]
|
4090
|
+
);
|
4091
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
4092
|
+
className: css.cx(styles.basePill, styles.valuePill),
|
4093
|
+
onClick: editMultiValuePill,
|
4094
|
+
onKeyDown: editMultiValuePillWithKeyboard,
|
4095
|
+
tabIndex: 0,
|
4096
|
+
id: `${item.value}-${index}`
|
4097
|
+
}, (_a = item.label) != null ? _a : item.value, /* @__PURE__ */ React__default["default"].createElement(ui.Button, {
|
4098
|
+
onClick: removePillHandler,
|
4099
|
+
onKeyDownCapture: removePillHandlerWithKeyboard,
|
4100
|
+
fill: "text",
|
4101
|
+
size: "sm",
|
4102
|
+
variant: "secondary",
|
4103
|
+
className: styles.removeButton,
|
4104
|
+
tooltip: `Remove filter value - ${(_b = item.label) != null ? _b : item.value}`
|
4105
|
+
}, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
|
4106
|
+
name: "times",
|
4107
|
+
size: "md",
|
4108
|
+
id: `${item.value}-${index}-close-icon`
|
4109
|
+
})));
|
4110
|
+
};
|
4111
|
+
const getStyles$c = (theme) => ({
|
4112
|
+
basePill: css.css(__spreadProps$p(__spreadValues$B({
|
4113
|
+
display: "flex",
|
4114
|
+
alignItems: "center",
|
4115
|
+
background: theme.colors.action.disabledBackground,
|
4116
|
+
border: `1px solid ${theme.colors.border.weak}`,
|
4117
|
+
padding: theme.spacing(0.125, 1, 0.125, 1),
|
4118
|
+
color: theme.colors.text.primary,
|
4119
|
+
overflow: "hidden",
|
4120
|
+
whiteSpace: "nowrap",
|
4121
|
+
minHeight: theme.spacing(2.75)
|
4122
|
+
}, theme.typography.bodySmall), {
|
4123
|
+
cursor: "pointer"
|
4124
|
+
})),
|
4125
|
+
valuePill: css.css({
|
4126
|
+
background: theme.colors.action.selected,
|
4127
|
+
padding: theme.spacing(0.125, 0, 0.125, 1)
|
4128
|
+
}),
|
4129
|
+
removeButton: css.css({
|
4130
|
+
marginInline: theme.spacing(0.5),
|
4131
|
+
height: "100%",
|
4132
|
+
padding: 0,
|
4133
|
+
cursor: "pointer",
|
4134
|
+
"&:hover": {
|
4135
|
+
color: theme.colors.text.primary
|
4136
|
+
}
|
4137
|
+
})
|
4138
|
+
});
|
4139
|
+
|
4019
4140
|
var __defProp$A = Object.defineProperty;
|
4020
4141
|
var __defProps$o = Object.defineProperties;
|
4021
4142
|
var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
|
@@ -4035,7 +4156,7 @@ var __spreadValues$A = (a, b) => {
|
|
4035
4156
|
return a;
|
4036
4157
|
};
|
4037
4158
|
var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
|
4038
|
-
const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model, isAlwaysWip, handleChangeViewMode, focusOnWipInputRef }, parentRef) {
|
4159
|
+
const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model, isAlwaysWip, handleChangeViewMode, focusOnWipInputRef, populateInputOnEdit }, parentRef) {
|
4039
4160
|
var _a, _b, _c;
|
4040
4161
|
const [open, setOpen] = React.useState(false);
|
4041
4162
|
const [options, setOptions] = React.useState([]);
|
@@ -4122,7 +4243,13 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4122
4243
|
]
|
4123
4244
|
);
|
4124
4245
|
const outsidePressIdsToIgnore = React.useMemo(() => {
|
4125
|
-
return [
|
4246
|
+
return [
|
4247
|
+
operatorIdentifier,
|
4248
|
+
...filterMultiValues.reduce(
|
4249
|
+
(acc, item, i) => [...acc, `${item.value}-${i}`, `${item.value}-${i}-close-icon`],
|
4250
|
+
[]
|
4251
|
+
)
|
4252
|
+
];
|
4126
4253
|
}, [operatorIdentifier, filterMultiValues]);
|
4127
4254
|
const { refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps } = useFloatingInteractions({
|
4128
4255
|
open,
|
@@ -4275,6 +4402,7 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4275
4402
|
const selectedItem = filteredDropDownItems[activeIndex];
|
4276
4403
|
if (multiValueEdit) {
|
4277
4404
|
handleLocalMultiValueChange(selectedItem);
|
4405
|
+
setInputValue("");
|
4278
4406
|
} else {
|
4279
4407
|
model._updateFilter(
|
4280
4408
|
filter,
|
@@ -4285,6 +4413,13 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4285
4413
|
setFilterMultiValues
|
4286
4414
|
})
|
4287
4415
|
);
|
4416
|
+
populateInputValueOnInputTypeSwitch({
|
4417
|
+
populateInputOnEdit,
|
4418
|
+
item: selectedItem,
|
4419
|
+
filterInputType,
|
4420
|
+
setInputValue,
|
4421
|
+
filter
|
4422
|
+
});
|
4288
4423
|
switchToNextInputType(
|
4289
4424
|
filterInputType,
|
4290
4425
|
setInputType,
|
@@ -4297,7 +4432,6 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4297
4432
|
focusOnWipInputRef == null ? void 0 : focusOnWipInputRef();
|
4298
4433
|
}
|
4299
4434
|
}
|
4300
|
-
setInputValue("");
|
4301
4435
|
}
|
4302
4436
|
},
|
4303
4437
|
[
|
@@ -4307,12 +4441,23 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4307
4441
|
model,
|
4308
4442
|
filter,
|
4309
4443
|
filterInputType,
|
4444
|
+
populateInputOnEdit,
|
4310
4445
|
handleChangeViewMode,
|
4311
4446
|
refs.domReference,
|
4312
4447
|
isLastFilter,
|
4313
4448
|
focusOnWipInputRef
|
4314
4449
|
]
|
4315
4450
|
);
|
4451
|
+
const handleEditMultiValuePill = React.useCallback(
|
4452
|
+
(value) => {
|
4453
|
+
var _a2;
|
4454
|
+
const valueLabel = value.label || value.value;
|
4455
|
+
setFilterMultiValues((prev) => prev.filter((item) => item.value !== value.value));
|
4456
|
+
setInputValue(valueLabel);
|
4457
|
+
(_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
|
4458
|
+
},
|
4459
|
+
[refs.domReference]
|
4460
|
+
);
|
4316
4461
|
React.useEffect(() => {
|
4317
4462
|
if (open) {
|
4318
4463
|
handleFetchOptions(filterInputType);
|
@@ -4321,8 +4466,6 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4321
4466
|
React.useEffect(() => {
|
4322
4467
|
var _a2, _b2;
|
4323
4468
|
if (!isAlwaysWip) {
|
4324
|
-
setInputType("value");
|
4325
|
-
setInputValue("");
|
4326
4469
|
if (hasMultiValueOperator && ((_a2 = filter == null ? void 0 : filter.values) == null ? void 0 : _a2.length)) {
|
4327
4470
|
const multiValueOptions = filter.values.reduce(
|
4328
4471
|
(acc, value, i) => {
|
@@ -4339,6 +4482,9 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4339
4482
|
);
|
4340
4483
|
setFilterMultiValues(multiValueOptions);
|
4341
4484
|
}
|
4485
|
+
if (!hasMultiValueOperator && populateInputOnEdit) {
|
4486
|
+
setInputValue((filter == null ? void 0 : filter.value) || "");
|
4487
|
+
}
|
4342
4488
|
(_b2 = refs.domReference.current) == null ? void 0 : _b2.focus();
|
4343
4489
|
}
|
4344
4490
|
}, []);
|
@@ -4368,11 +4514,13 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4368
4514
|
tabIndex: 0,
|
4369
4515
|
onClick: (event) => {
|
4370
4516
|
event.stopPropagation();
|
4517
|
+
setInputValue("");
|
4371
4518
|
switchInputType("operator", setInputType, void 0, refs.domReference.current);
|
4372
4519
|
},
|
4373
4520
|
onKeyDown: (event) => {
|
4374
4521
|
handleShiftTabInput(event, hasMultiValueOperator);
|
4375
4522
|
if (event.key === "Enter") {
|
4523
|
+
setInputValue("");
|
4376
4524
|
switchInputType("operator", setInputType, void 0, refs.domReference.current);
|
4377
4525
|
}
|
4378
4526
|
}
|
@@ -4382,7 +4530,8 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4382
4530
|
key: `${item.value}-${i}`,
|
4383
4531
|
item,
|
4384
4532
|
index: i,
|
4385
|
-
handleRemoveMultiValue
|
4533
|
+
handleRemoveMultiValue,
|
4534
|
+
handleEditMultiValuePill
|
4386
4535
|
})) : null) : null, /* @__PURE__ */ React__default["default"].createElement("input", __spreadProps$o(__spreadValues$A({}, getReferenceProps({
|
4387
4536
|
ref: refs.setReference,
|
4388
4537
|
onChange,
|
@@ -4469,6 +4618,7 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4469
4618
|
event.preventDefault();
|
4470
4619
|
event.stopPropagation();
|
4471
4620
|
handleLocalMultiValueChange(item);
|
4621
|
+
setInputValue("");
|
4472
4622
|
(_a3 = refs.domReference.current) == null ? void 0 : _a3.focus();
|
4473
4623
|
} else {
|
4474
4624
|
model._updateFilter(
|
@@ -4480,7 +4630,13 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4480
4630
|
setFilterMultiValues
|
4481
4631
|
})
|
4482
4632
|
);
|
4483
|
-
|
4633
|
+
populateInputValueOnInputTypeSwitch({
|
4634
|
+
populateInputOnEdit,
|
4635
|
+
item,
|
4636
|
+
filterInputType,
|
4637
|
+
setInputValue,
|
4638
|
+
filter
|
4639
|
+
});
|
4484
4640
|
switchToNextInputType(
|
4485
4641
|
filterInputType,
|
4486
4642
|
setInputType,
|
@@ -4513,35 +4669,6 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
4513
4669
|
menuHeight: Math.min(rowVirtualizer.getTotalSize(), MAX_MENU_HEIGHT)
|
4514
4670
|
}) : null))));
|
4515
4671
|
});
|
4516
|
-
const MultiValuePill = ({ item, handleRemoveMultiValue, index }) => {
|
4517
|
-
var _a, _b;
|
4518
|
-
const styles = ui.useStyles2(getStyles$b);
|
4519
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
4520
|
-
className: css.cx(styles.basePill, styles.valuePill)
|
4521
|
-
}, /* @__PURE__ */ React__default["default"].createElement("span", null, " ", (_a = item.label) != null ? _a : item.value), /* @__PURE__ */ React__default["default"].createElement(ui.Button, {
|
4522
|
-
onClick: (e) => {
|
4523
|
-
e.stopPropagation();
|
4524
|
-
e.preventDefault();
|
4525
|
-
handleRemoveMultiValue(item);
|
4526
|
-
},
|
4527
|
-
onKeyDownCapture: (e) => {
|
4528
|
-
if (e.key === "Enter") {
|
4529
|
-
e.preventDefault();
|
4530
|
-
e.stopPropagation();
|
4531
|
-
handleRemoveMultiValue(item);
|
4532
|
-
}
|
4533
|
-
},
|
4534
|
-
fill: "text",
|
4535
|
-
size: "sm",
|
4536
|
-
variant: "secondary",
|
4537
|
-
className: styles.removeButton,
|
4538
|
-
tooltip: `Remove filter value - ${(_b = item.label) != null ? _b : item.value}`
|
4539
|
-
}, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
|
4540
|
-
name: "times",
|
4541
|
-
size: "md",
|
4542
|
-
id: `${item.value}-${index}`
|
4543
|
-
})));
|
4544
|
-
};
|
4545
4672
|
const getStyles$b = (theme) => ({
|
4546
4673
|
comboboxWrapper: css.css({
|
4547
4674
|
display: "flex",
|
@@ -4574,10 +4701,6 @@ const getStyles$b = (theme) => ({
|
|
4574
4701
|
background: theme.colors.action.hover
|
4575
4702
|
}
|
4576
4703
|
}),
|
4577
|
-
valuePill: css.css({
|
4578
|
-
background: theme.colors.action.selected,
|
4579
|
-
padding: theme.spacing(0.125, 0, 0.125, 1)
|
4580
|
-
}),
|
4581
4704
|
dropdownWrapper: css.css({
|
4582
4705
|
backgroundColor: theme.colors.background.primary,
|
4583
4706
|
color: theme.colors.text.primary,
|
@@ -4610,25 +4733,10 @@ const getStyles$b = (theme) => ({
|
|
4610
4733
|
borderTop: `1px solid ${theme.colors.border.weak}`
|
4611
4734
|
}
|
4612
4735
|
}),
|
4613
|
-
removeButton: css.css({
|
4614
|
-
marginInline: theme.spacing(0.5),
|
4615
|
-
height: "100%",
|
4616
|
-
padding: 0,
|
4617
|
-
cursor: "pointer",
|
4618
|
-
"&:hover": {
|
4619
|
-
color: theme.colors.text.primary
|
4620
|
-
}
|
4621
|
-
}),
|
4622
4736
|
descriptionText: css.css(__spreadProps$o(__spreadValues$A({}, theme.typography.bodySmall), {
|
4623
4737
|
color: theme.colors.text.secondary,
|
4624
4738
|
paddingTop: theme.spacing(0.5)
|
4625
|
-
}))
|
4626
|
-
multiValueApply: css.css({
|
4627
|
-
position: "absolute",
|
4628
|
-
top: 0,
|
4629
|
-
left: 0,
|
4630
|
-
display: "flex"
|
4631
|
-
})
|
4739
|
+
}))
|
4632
4740
|
});
|
4633
4741
|
|
4634
4742
|
var __defProp$z = Object.defineProperty;
|
@@ -4656,6 +4764,7 @@ function AdHocFilterPill({ filter, model, readOnly, focusOnWipInputRef }) {
|
|
4656
4764
|
const [viewMode, setViewMode] = React.useState(true);
|
4657
4765
|
const [shouldFocusOnPillWrapper, setShouldFocusOnPillWrapper] = React.useState(false);
|
4658
4766
|
const pillWrapperRef = React.useRef(null);
|
4767
|
+
const [populateInputOnEdit, setPopulateInputOnEdit] = React.useState(false);
|
4659
4768
|
const keyLabel = (_a = filter.keyLabel) != null ? _a : filter.key;
|
4660
4769
|
const valueLabel = ((_b = filter.valueLabels) == null ? void 0 : _b.join(", ")) || ((_c = filter.values) == null ? void 0 : _c.join(", ")) || filter.value;
|
4661
4770
|
const handleChangeViewMode = React.useCallback(
|
@@ -4682,15 +4791,25 @@ function AdHocFilterPill({ filter, model, readOnly, focusOnWipInputRef }) {
|
|
4682
4791
|
model._updateFilter(filter, { forceEdit: void 0 });
|
4683
4792
|
}
|
4684
4793
|
}, [filter, model, viewMode]);
|
4794
|
+
React.useEffect(() => {
|
4795
|
+
if (populateInputOnEdit && viewMode) {
|
4796
|
+
setPopulateInputOnEdit(false);
|
4797
|
+
}
|
4798
|
+
}, [viewMode]);
|
4685
4799
|
if (viewMode) {
|
4686
4800
|
const pillText = /* @__PURE__ */ React__default["default"].createElement("span", {
|
4687
4801
|
className: styles.pillText
|
4688
4802
|
}, keyLabel, " ", filter.operator, " ", valueLabel);
|
4689
4803
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
4690
4804
|
className: css.cx(styles.combinedFilterPill, { [styles.readOnlyCombinedFilter]: readOnly }),
|
4691
|
-
onClick:
|
4805
|
+
onClick: (e) => {
|
4806
|
+
e.stopPropagation();
|
4807
|
+
setPopulateInputOnEdit(true);
|
4808
|
+
handleChangeViewMode();
|
4809
|
+
},
|
4692
4810
|
onKeyDown: (e) => {
|
4693
4811
|
if (e.key === "Enter") {
|
4812
|
+
setPopulateInputOnEdit(true);
|
4694
4813
|
handleChangeViewMode();
|
4695
4814
|
}
|
4696
4815
|
},
|
@@ -4727,7 +4846,8 @@ function AdHocFilterPill({ filter, model, readOnly, focusOnWipInputRef }) {
|
|
4727
4846
|
filter,
|
4728
4847
|
model,
|
4729
4848
|
handleChangeViewMode,
|
4730
|
-
focusOnWipInputRef
|
4849
|
+
focusOnWipInputRef,
|
4850
|
+
populateInputOnEdit
|
4731
4851
|
});
|
4732
4852
|
}
|
4733
4853
|
const getStyles$a = (theme) => ({
|