@splunk/visualizations 26.4.0 → 27.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +1262 -1600
- package/Area.config.js.map +7 -1
- package/Area.js +3002 -4920
- package/Area.js.map +7 -1
- package/Bar.config.js +1247 -1574
- package/Bar.config.js.map +7 -1
- package/Bar.js +2924 -4836
- package/Bar.js.map +7 -1
- package/Bubble.config.js +896 -1213
- package/Bubble.config.js.map +7 -1
- package/Bubble.js +2520 -4476
- package/Bubble.js.map +7 -1
- package/ChoroplethSvg.config.js +282 -582
- package/ChoroplethSvg.config.js.map +7 -1
- package/ChoroplethSvg.js +2004 -3810
- package/ChoroplethSvg.js.map +7 -1
- package/Column.config.js +1208 -1541
- package/Column.config.js.map +7 -1
- package/Column.js +2933 -4879
- package/Column.js.map +7 -1
- package/Ellipse.config.js +443 -774
- package/Ellipse.config.js.map +7 -1
- package/Ellipse.js +1651 -3341
- package/Ellipse.js.map +7 -1
- package/Events.config.js +207 -492
- package/Events.config.js.map +7 -1
- package/Events.js +2615 -4649
- package/Events.js.map +7 -1
- package/FillerGauge.config.js +420 -775
- package/FillerGauge.config.js.map +7 -1
- package/FillerGauge.js +2137 -4578
- package/FillerGauge.js.map +7 -1
- package/Image.config.js +144 -411
- package/Image.config.js.map +7 -1
- package/Image.js +1395 -3048
- package/Image.js.map +7 -1
- package/Line.config.js +1278 -1625
- package/Line.config.js.map +7 -1
- package/Line.js +2957 -4919
- package/Line.js.map +7 -1
- package/LinkGraph.config.js +390 -632
- package/LinkGraph.config.js.map +7 -1
- package/LinkGraph.js +5243 -6190
- package/LinkGraph.js.map +7 -1
- package/MIGRATION.md +12 -0
- package/Map.config.js +501 -801
- package/Map.config.js.map +7 -1
- package/Map.js +3369 -5676
- package/Map.js.map +7 -1
- package/Markdown.config.js +232 -528
- package/Markdown.config.js.map +7 -1
- package/Markdown.js +1645 -3216
- package/Markdown.js.map +7 -1
- package/MarkerGauge.config.js +308 -613
- package/MarkerGauge.config.js.map +7 -1
- package/MarkerGauge.js +2189 -4535
- package/MarkerGauge.js.map +7 -1
- package/ParallelCoordinates.config.js +282 -581
- package/ParallelCoordinates.config.js.map +7 -1
- package/ParallelCoordinates.js +2023 -4720
- package/ParallelCoordinates.js.map +7 -1
- package/Pie.config.js +278 -547
- package/Pie.config.js.map +7 -1
- package/Pie.js +1998 -3982
- package/Pie.js.map +7 -1
- package/Punchcard.config.js +291 -578
- package/Punchcard.config.js.map +7 -1
- package/Punchcard.js +2709 -5042
- package/Punchcard.js.map +7 -1
- package/Rectangle.config.js +455 -770
- package/Rectangle.config.js.map +7 -1
- package/Rectangle.js +1638 -3262
- package/Rectangle.js.map +7 -1
- package/Sankey.config.js +291 -626
- package/Sankey.config.js.map +7 -1
- package/Sankey.js +2737 -4909
- package/Sankey.js.map +7 -1
- package/Scatter.config.js +876 -1194
- package/Scatter.config.js.map +7 -1
- package/Scatter.js +2532 -4470
- package/Scatter.js.map +7 -1
- package/SingleValue.config.js +819 -1251
- package/SingleValue.config.js.map +7 -1
- package/SingleValue.js +4203 -7413
- package/SingleValue.js.map +7 -1
- package/SingleValueBasic.js +382 -1527
- package/SingleValueBasic.js.map +7 -1
- package/SingleValueIcon.config.js +781 -1207
- package/SingleValueIcon.config.js.map +7 -1
- package/SingleValueIcon.js +3350 -6285
- package/SingleValueIcon.js.map +7 -1
- package/SingleValueRadial.config.js +708 -1119
- package/SingleValueRadial.config.js.map +7 -1
- package/SingleValueRadial.js +3808 -6965
- package/SingleValueRadial.js.map +7 -1
- package/SparkLine.js +439 -746
- package/SparkLine.js.map +7 -1
- package/Table.config.js +565 -887
- package/Table.config.js.map +7 -1
- package/Table.js +3277 -5386
- package/Table.js.map +7 -1
- package/common/Charting.js +484 -1462
- package/common/Charting.js.map +7 -1
- package/common/ChartingApi.js +46 -170
- package/common/ChartingApi.js.map +7 -1
- package/common/DocExampleWithVizSandbox.js +270 -473
- package/common/DocExampleWithVizSandbox.js.map +7 -1
- package/common/EventsDoc.js +172 -464
- package/common/EventsDoc.js.map +7 -1
- package/common/GaugeMajorTicks.js +249 -347
- package/common/GaugeMajorTicks.js.map +7 -1
- package/common/GaugeValueMarker.js +201 -311
- package/common/GaugeValueMarker.js.map +7 -1
- package/common/OptionsDoc.js +347 -912
- package/common/OptionsDoc.js.map +7 -1
- package/common/OverviewDoc.js +435 -769
- package/common/OverviewDoc.js.map +7 -1
- package/common/SplunkVisualization.js +116 -259
- package/common/SplunkVisualization.js.map +7 -1
- package/common/SplunkVisualizationApi.js +40 -156
- package/common/SplunkVisualizationApi.js.map +7 -1
- package/common/ThemesDoc.js +271 -420
- package/common/ThemesDoc.js.map +7 -1
- package/common/chartingUtils.js +140 -312
- package/common/chartingUtils.js.map +7 -1
- package/common/docUtils.js +148 -266
- package/common/docUtils.js.map +7 -1
- package/common/gaugeUtils.js +280 -808
- package/common/gaugeUtils.js.map +7 -1
- package/common/shapeUtils.js +106 -211
- package/common/shapeUtils.js.map +7 -1
- package/common/utils/configUtils.js +126 -252
- package/common/utils/configUtils.js.map +7 -1
- package/common/utils/dataUtils.js +217 -812
- package/common/utils/dataUtils.js.map +7 -1
- package/common/utils/featureFlagUtils.js +53 -133
- package/common/utils/featureFlagUtils.js.map +7 -1
- package/common/utils/hocUtils.js +32 -122
- package/common/utils/hocUtils.js.map +7 -1
- package/common/utils/mapUtils.js +502 -1337
- package/common/utils/mapUtils.js.map +7 -1
- package/common/utils/singleValueUtils.js +462 -1010
- package/common/utils/singleValueUtils.js.map +7 -1
- package/common/utils/testHelper.js +92 -146
- package/common/utils/testHelper.js.map +7 -1
- package/common/utils/trellisUtils.js +237 -489
- package/common/utils/trellisUtils.js.map +7 -1
- package/common/utils/urlUtils.js +28 -112
- package/common/utils/urlUtils.js.map +7 -1
- package/common/withDashboardViz.js +1168 -2438
- package/common/withDashboardViz.js.map +7 -1
- package/package.json +52 -43
|
@@ -1,916 +1,517 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
37
|
-
/******/ __webpack_require__.m = modules;
|
|
38
|
-
/******/
|
|
39
|
-
/******/ // expose the module cache
|
|
40
|
-
/******/ __webpack_require__.c = installedModules;
|
|
41
|
-
/******/
|
|
42
|
-
/******/ // define getter function for harmony exports
|
|
43
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
44
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
45
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
46
|
-
/******/ }
|
|
47
|
-
/******/ };
|
|
48
|
-
/******/
|
|
49
|
-
/******/ // define __esModule on exports
|
|
50
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
51
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
52
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
53
|
-
/******/ }
|
|
54
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
55
|
-
/******/ };
|
|
56
|
-
/******/
|
|
57
|
-
/******/ // create a fake namespace object
|
|
58
|
-
/******/ // mode & 1: value is a module id, require it
|
|
59
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
60
|
-
/******/ // mode & 4: return value when already ns object
|
|
61
|
-
/******/ // mode & 8|1: behave like require
|
|
62
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
63
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
64
|
-
/******/ if(mode & 8) return value;
|
|
65
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
66
|
-
/******/ var ns = Object.create(null);
|
|
67
|
-
/******/ __webpack_require__.r(ns);
|
|
68
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
69
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
70
|
-
/******/ return ns;
|
|
71
|
-
/******/ };
|
|
72
|
-
/******/
|
|
73
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
74
|
-
/******/ __webpack_require__.n = function(module) {
|
|
75
|
-
/******/ var getter = module && module.__esModule ?
|
|
76
|
-
/******/ function getDefault() { return module['default']; } :
|
|
77
|
-
/******/ function getModuleExports() { return module; };
|
|
78
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
79
|
-
/******/ return getter;
|
|
80
|
-
/******/ };
|
|
81
|
-
/******/
|
|
82
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
83
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
84
|
-
/******/
|
|
85
|
-
/******/ // __webpack_public_path__
|
|
86
|
-
/******/ __webpack_require__.p = "";
|
|
87
|
-
/******/
|
|
88
|
-
/******/
|
|
89
|
-
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s = 68);
|
|
91
|
-
/******/ })
|
|
92
|
-
/************************************************************************/
|
|
93
|
-
/******/ ([
|
|
94
|
-
/* 0 */
|
|
95
|
-
/***/ (function(module, exports) {
|
|
96
|
-
|
|
97
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
98
|
-
|
|
99
|
-
/***/ }),
|
|
100
|
-
/* 1 */
|
|
101
|
-
/***/ (function(module, exports) {
|
|
102
|
-
|
|
103
|
-
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
104
|
-
|
|
105
|
-
/***/ }),
|
|
106
|
-
/* 2 */
|
|
107
|
-
/***/ (function(module, exports) {
|
|
108
|
-
|
|
109
|
-
module.exports = require("@splunk/visualization-schemas");
|
|
110
|
-
|
|
111
|
-
/***/ }),
|
|
112
|
-
/* 3 */
|
|
113
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
114
|
-
|
|
115
|
-
"use strict";
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var _toConsumableArray = __webpack_require__(1);
|
|
119
|
-
|
|
120
|
-
Object.defineProperty(exports, "__esModule", {
|
|
121
|
-
value: true
|
|
122
|
-
});
|
|
123
|
-
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceConfig = exports.enhanceOptionsSchemaWithDynamicOptions = void 0;
|
|
124
|
-
|
|
125
|
-
var lodash_1 = __webpack_require__(5); // included for backwards compatibility
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var visualization_schemas_1 = __webpack_require__(2);
|
|
129
|
-
|
|
130
|
-
Object.defineProperty(exports, "enhanceOptionsSchemaWithDynamicOptions", {
|
|
131
|
-
enumerable: true,
|
|
132
|
-
get: function get() {
|
|
133
|
-
return visualization_schemas_1.enhanceOptionsSchemaWithDynamicOptions;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
/**
|
|
137
|
-
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
138
|
-
* this function also collapse all editor panels
|
|
139
|
-
* @param vizConfig a Visualization Config
|
|
140
|
-
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
141
|
-
* and containing `open: false` for all editor panels in editorConfig
|
|
142
|
-
*/
|
|
143
|
-
|
|
144
|
-
function enhanceConfig(vizConfig) {
|
|
145
|
-
var enhancedConfig = Object.assign({}, vizConfig);
|
|
146
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
147
|
-
return Object.assign(Object.assign({}, config), {
|
|
148
|
-
open: config.open || false
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
return enhancedConfig;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
exports.enhanceConfig = enhanceConfig;
|
|
155
|
-
/**
|
|
156
|
-
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
157
|
-
* Created for editor unit tests
|
|
158
|
-
* @param vizConfig a Visualization Config
|
|
159
|
-
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
160
|
-
*/
|
|
161
|
-
|
|
162
|
-
function uncollapseEditorConfig(vizConfig) {
|
|
163
|
-
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
164
|
-
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
165
|
-
return Object.assign(Object.assign({}, config), {
|
|
166
|
-
open: true
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
return editorPanelUncollapsedConfig;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
173
|
-
|
|
174
|
-
function isDynamicOption(option) {
|
|
175
|
-
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
179
|
-
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
183
|
-
* if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
|
|
184
|
-
* the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
|
|
185
|
-
* the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
|
|
186
|
-
*
|
|
187
|
-
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
188
|
-
*/
|
|
189
|
-
|
|
190
|
-
function hasCompatibleContexts(vizContext, presetContext) {
|
|
191
|
-
var presetContextKeys = Object.keys(presetContext);
|
|
192
|
-
return presetContextKeys.every(function (contextKey) {
|
|
193
|
-
return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
198
|
-
*/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
202
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
203
|
-
return presetOptionKeys.every(function (optionKey) {
|
|
204
|
-
return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
|
|
209
|
-
* This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
|
|
210
|
-
*
|
|
211
|
-
* @param {Object} vizContext - the current vizContext definition
|
|
212
|
-
* @param {Object} vizOptions - the current vizOptions definition
|
|
213
|
-
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
214
|
-
*/
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
218
|
-
return presets.find(function (preset) {
|
|
219
|
-
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
220
|
-
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
221
|
-
var presetContextKeys = Object.keys(presetContext);
|
|
222
|
-
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
223
|
-
// if not, then the preset is invalid in config.ts
|
|
224
|
-
|
|
225
|
-
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
226
|
-
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
exports.getInitialPreset = getInitialPreset;
|
|
231
|
-
/**
|
|
232
|
-
* generates number precision values for a Select editor
|
|
233
|
-
*
|
|
234
|
-
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
235
|
-
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
function generatePrecisionValues(numPrecisionValues) {
|
|
239
|
-
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
240
|
-
return {
|
|
241
|
-
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
242
|
-
value: i
|
|
243
|
-
};
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
exports.generatePrecisionValues = generatePrecisionValues;
|
|
248
|
-
/**
|
|
249
|
-
* insert layout in layout array, return a new layout array instead of updating the original
|
|
250
|
-
*
|
|
251
|
-
* @param {EditorLayoutConfig[][]} layout - editor layout
|
|
252
|
-
* @param {Number} index - the index to insert layout item(s)
|
|
253
|
-
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
254
|
-
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
255
|
-
*/
|
|
256
|
-
|
|
257
|
-
var insertLayout = function insertLayout(layout, index) {
|
|
258
|
-
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
259
|
-
layoutItems[_key - 2] = arguments[_key];
|
|
1
|
+
/* Copyright © 2020 Splunk Inc.
|
|
2
|
+
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
|
+
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
+
var __export = (target, all) => {
|
|
28
|
+
for (var name in all)
|
|
29
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
30
|
+
};
|
|
31
|
+
var __copyProps = (to, from, except, desc) => {
|
|
32
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
33
|
+
for (let key of __getOwnPropNames(from))
|
|
34
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
35
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
260
36
|
}
|
|
261
|
-
|
|
262
|
-
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
37
|
+
return to;
|
|
263
38
|
};
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
/***/ }),
|
|
280
|
-
/* 6 */
|
|
281
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
282
|
-
|
|
283
|
-
"use strict";
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
Object.defineProperty(exports, "__esModule", {
|
|
287
|
-
value: true
|
|
39
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
40
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
41
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
42
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
43
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
44
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
45
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
46
|
+
mod
|
|
47
|
+
));
|
|
48
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
49
|
+
|
|
50
|
+
// src/SingleValueIcon/config.ts
|
|
51
|
+
var config_exports = {};
|
|
52
|
+
__export(config_exports, {
|
|
53
|
+
default: () => config_default
|
|
288
54
|
});
|
|
289
|
-
exports
|
|
290
|
-
var VizBehavior;
|
|
291
|
-
|
|
292
|
-
(function (VizBehavior) {
|
|
293
|
-
/**
|
|
294
|
-
* Dynamic Options Behavior.
|
|
295
|
-
* This allows visualization options to be powered by data
|
|
296
|
-
*
|
|
297
|
-
* **Example**
|
|
298
|
-
*
|
|
299
|
-
* sparklineValues: ">primary|seriesByIndex(0)"
|
|
300
|
-
* would configure sparklineValues with an array of data points
|
|
301
|
-
* coming from the first series in the primary datasource
|
|
302
|
-
*
|
|
303
|
-
*/
|
|
304
|
-
VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
|
|
305
|
-
VizBehavior["EVENTS"] = "events";
|
|
306
|
-
VizBehavior["DOWNSAMPLING"] = "downsampling";
|
|
307
|
-
/**
|
|
308
|
-
* Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
|
|
309
|
-
* missing.
|
|
310
|
-
* @type {string}
|
|
311
|
-
*/
|
|
312
|
-
|
|
313
|
-
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
314
|
-
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
315
|
-
VizBehavior["TRELLIS"] = "trellis";
|
|
316
|
-
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
317
|
-
|
|
318
|
-
/***/ }),
|
|
319
|
-
/* 7 */
|
|
320
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
55
|
+
module.exports = __toCommonJS(config_exports);
|
|
321
56
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
value: true
|
|
57
|
+
// esm-externals:@splunk/ui-utils/i18n
|
|
58
|
+
var i18n_exports = {};
|
|
59
|
+
__export(i18n_exports, {
|
|
60
|
+
default: () => i18n_default
|
|
327
61
|
});
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
384
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
var StaticBackgroundColorEditor = {
|
|
388
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Background color'),
|
|
389
|
-
option: 'backgroundColor',
|
|
390
|
-
editor: 'editor.color',
|
|
391
|
-
showEditor: function showEditor(_ref) {
|
|
392
|
-
var options = _ref.options;
|
|
393
|
-
return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
/* harmony default export */ __webpack_exports__["default"] = (StaticBackgroundColorEditor);
|
|
397
|
-
|
|
398
|
-
/***/ }),
|
|
399
|
-
/* 23 */
|
|
400
|
-
/***/ (function(module, exports) {
|
|
401
|
-
|
|
402
|
-
module.exports = require("@splunk/visualizations-shared/colorConstants");
|
|
403
|
-
|
|
404
|
-
/***/ }),
|
|
405
|
-
/* 24 */
|
|
406
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
407
|
-
|
|
408
|
-
"use strict";
|
|
409
|
-
__webpack_require__.r(__webpack_exports__);
|
|
410
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicTrendColorEditor", function() { return getDynamicTrendColorEditor; });
|
|
411
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
412
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
413
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
414
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
|
|
418
|
-
var defaultContext = _ref.defaultContext,
|
|
419
|
-
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
420
|
-
return {
|
|
421
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
|
|
422
|
-
option: 'trendColor',
|
|
423
|
-
context: 'trendColorEditorConfig',
|
|
424
|
-
editor: 'editor.dynamicColor',
|
|
425
|
-
showEditor: function showEditor(_ref2) {
|
|
426
|
-
var options = _ref2.options;
|
|
427
|
-
return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.trendColor);
|
|
62
|
+
var defaultImport = __toESM(require("@splunk/ui-utils/i18n"));
|
|
63
|
+
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
64
|
+
var i18n_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
65
|
+
|
|
66
|
+
// esm-externals:@splunk/visualization-schemas
|
|
67
|
+
var visualization_schemas_exports = {};
|
|
68
|
+
__export(visualization_schemas_exports, {
|
|
69
|
+
default: () => visualization_schemas_default
|
|
70
|
+
});
|
|
71
|
+
var defaultImport2 = __toESM(require("@splunk/visualization-schemas"));
|
|
72
|
+
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
73
|
+
var visualization_schemas_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
74
|
+
|
|
75
|
+
// esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
|
|
76
|
+
var PresetPalettes_exports = {};
|
|
77
|
+
__export(PresetPalettes_exports, {
|
|
78
|
+
default: () => PresetPalettes_default
|
|
79
|
+
});
|
|
80
|
+
var defaultImport3 = __toESM(require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
81
|
+
__reExport(PresetPalettes_exports, require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
82
|
+
var PresetPalettes_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
83
|
+
|
|
84
|
+
// esm-externals:@splunk/themes/pick
|
|
85
|
+
var pick_exports = {};
|
|
86
|
+
__export(pick_exports, {
|
|
87
|
+
default: () => pick_default
|
|
88
|
+
});
|
|
89
|
+
var defaultImport4 = __toESM(require("@splunk/themes/pick"));
|
|
90
|
+
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
91
|
+
var pick_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
92
|
+
|
|
93
|
+
// esm-externals:@splunk/themes/variables
|
|
94
|
+
var variables_exports = {};
|
|
95
|
+
__export(variables_exports, {
|
|
96
|
+
default: () => variables_default
|
|
97
|
+
});
|
|
98
|
+
var defaultImport5 = __toESM(require("@splunk/themes/variables"));
|
|
99
|
+
__reExport(variables_exports, require("@splunk/themes/variables"));
|
|
100
|
+
var variables_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
101
|
+
|
|
102
|
+
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
103
|
+
var configUtils_exports = {};
|
|
104
|
+
__export(configUtils_exports, {
|
|
105
|
+
default: () => configUtils_default
|
|
106
|
+
});
|
|
107
|
+
var defaultImport6 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
108
|
+
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
109
|
+
var configUtils_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
110
|
+
|
|
111
|
+
// src/common/configContext/singleValueContext.ts
|
|
112
|
+
var defaultContext = {
|
|
113
|
+
trendColorConfig: [
|
|
114
|
+
{
|
|
115
|
+
to: 0,
|
|
116
|
+
value: "#9E2520"
|
|
428
117
|
},
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
formatters: [{
|
|
433
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
|
|
434
|
-
value: 'rangeValue',
|
|
435
|
-
defaults: {
|
|
436
|
-
trendValue: defaultContext.trendColorConfig
|
|
437
|
-
}
|
|
438
|
-
}],
|
|
439
|
-
dataSelectors: [{
|
|
440
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
|
|
441
|
-
value: 'trendValue'
|
|
442
|
-
}],
|
|
443
|
-
defaultPalettesConfig: defaultPalettesConfig
|
|
118
|
+
{
|
|
119
|
+
from: 0,
|
|
120
|
+
value: "#1C6B2D"
|
|
444
121
|
}
|
|
445
|
-
|
|
122
|
+
],
|
|
123
|
+
majorColorConfig: [
|
|
124
|
+
{ to: 20, value: "#D41F1F" },
|
|
125
|
+
{ from: 20, to: 40, value: "#D94E17" },
|
|
126
|
+
{ from: 40, to: 60, value: "#CBA700" },
|
|
127
|
+
{ from: 60, to: 80, value: "#669922" },
|
|
128
|
+
{ from: 80, value: "#118832" }
|
|
129
|
+
],
|
|
130
|
+
majorColorMatchConfig: [{ match: "", value: "#5C33FF" }]
|
|
446
131
|
};
|
|
447
132
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
"
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
464
|
-
return {
|
|
465
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Background color'),
|
|
466
|
-
option: 'backgroundColor',
|
|
467
|
-
context: 'backgroundColorEditorConfig',
|
|
468
|
-
editor: 'editor.dynamicColor',
|
|
469
|
-
showEditor: function showEditor(_ref2) {
|
|
470
|
-
var options = _ref2.options;
|
|
471
|
-
return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
|
|
133
|
+
// src/common/editorConfig/StaticMajorAndTrendLayout.js
|
|
134
|
+
var StaticMajorAndTrendLayout = [
|
|
135
|
+
[
|
|
136
|
+
{
|
|
137
|
+
label: (0, i18n_exports._)("Unit position"),
|
|
138
|
+
// todo: we need a new editor combining unit and position
|
|
139
|
+
option: "unitPosition",
|
|
140
|
+
editor: "editor.select",
|
|
141
|
+
editorProps: {
|
|
142
|
+
values: [
|
|
143
|
+
{ label: (0, i18n_exports._)("Before"), value: "before" },
|
|
144
|
+
{ label: (0, i18n_exports._)("After"), value: "after" }
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
472
148
|
},
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
value: 'rangeValue',
|
|
479
|
-
defaults: {
|
|
480
|
-
majorValue: defaultContext.majorColorConfig,
|
|
481
|
-
trendValue: defaultContext.trendColorConfig
|
|
482
|
-
}
|
|
483
|
-
}, {
|
|
484
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Matches'),
|
|
485
|
-
value: 'matchValue',
|
|
486
|
-
defaults: {
|
|
487
|
-
majorValue: defaultContext.majorColorMatchConfig
|
|
488
|
-
}
|
|
489
|
-
}],
|
|
490
|
-
dataSelectors: [{
|
|
491
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major Value'),
|
|
492
|
-
value: 'majorValue'
|
|
493
|
-
}, {
|
|
494
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend'),
|
|
495
|
-
value: 'trendValue'
|
|
496
|
-
}],
|
|
497
|
-
defaultPalettesConfig: defaultPalettesConfig
|
|
149
|
+
{
|
|
150
|
+
label: (0, i18n_exports._)("Unit label"),
|
|
151
|
+
option: "unit",
|
|
152
|
+
editor: "editor.text",
|
|
153
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
498
154
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
155
|
+
],
|
|
156
|
+
[
|
|
157
|
+
{
|
|
158
|
+
label: (0, i18n_exports._)("Precision"),
|
|
159
|
+
option: "numberPrecision",
|
|
160
|
+
editor: "editor.number",
|
|
161
|
+
editorProps: {
|
|
162
|
+
min: 0,
|
|
163
|
+
max: 20
|
|
164
|
+
},
|
|
165
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
];
|
|
169
|
+
var StaticMajorAndTrendLayout_default = StaticMajorAndTrendLayout;
|
|
505
170
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
171
|
+
// src/common/editorConfig/StaticBackgroundColorEditor.js
|
|
172
|
+
var StaticBackgroundColorEditor = {
|
|
173
|
+
label: (0, i18n_exports._)("Background color"),
|
|
174
|
+
option: "backgroundColor",
|
|
175
|
+
editor: "editor.color",
|
|
176
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.backgroundColor)
|
|
177
|
+
};
|
|
178
|
+
var StaticBackgroundColorEditor_default = StaticBackgroundColorEditor;
|
|
510
179
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
editor: 'editor.text',
|
|
533
|
-
showEditor: function showEditor(_ref2) {
|
|
534
|
-
var options = _ref2.options;
|
|
535
|
-
return options.showValue || options.showValue === undefined;
|
|
536
|
-
}
|
|
537
|
-
}], [{
|
|
538
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Precision'),
|
|
539
|
-
option: 'numberPrecision',
|
|
540
|
-
editor: 'editor.number',
|
|
541
|
-
editorProps: {
|
|
542
|
-
min: 0,
|
|
543
|
-
max: 20
|
|
544
|
-
},
|
|
545
|
-
showEditor: function showEditor(_ref3) {
|
|
546
|
-
var options = _ref3.options;
|
|
547
|
-
return options.showValue || options.showValue === undefined;
|
|
180
|
+
// esm-externals:@splunk/visualizations-shared/colorConstants
|
|
181
|
+
var colorConstants_exports = {};
|
|
182
|
+
__export(colorConstants_exports, {
|
|
183
|
+
default: () => colorConstants_default
|
|
184
|
+
});
|
|
185
|
+
var defaultImport7 = __toESM(require("@splunk/visualizations-shared/colorConstants"));
|
|
186
|
+
__reExport(colorConstants_exports, require("@splunk/visualizations-shared/colorConstants"));
|
|
187
|
+
var colorConstants_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
188
|
+
|
|
189
|
+
// src/common/editorConfig/StaticIconColorEditor.js
|
|
190
|
+
var StaticIconColorEditor = [
|
|
191
|
+
{
|
|
192
|
+
label: (0, i18n_exports._)("Icon"),
|
|
193
|
+
option: "iconColor",
|
|
194
|
+
editor: "editor.color",
|
|
195
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.iconColor),
|
|
196
|
+
editorProps: {
|
|
197
|
+
labelPosition: "top",
|
|
198
|
+
value: null,
|
|
199
|
+
palette: [null, ...colorConstants_exports.COLOR_EDITOR_PALETTE]
|
|
200
|
+
}
|
|
548
201
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
/***/ }),
|
|
553
|
-
/* 27 */
|
|
554
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
555
|
-
|
|
556
|
-
"use strict";
|
|
557
|
-
__webpack_require__.r(__webpack_exports__);
|
|
558
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
559
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
560
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
561
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
562
|
-
|
|
202
|
+
];
|
|
203
|
+
var StaticIconColorEditor_default = StaticIconColorEditor;
|
|
563
204
|
|
|
205
|
+
// src/common/editorConfig/StaticMajorColorEditor.js
|
|
564
206
|
var StaticMajorColorEditor = {
|
|
565
|
-
label:
|
|
566
|
-
option:
|
|
567
|
-
editor:
|
|
568
|
-
showEditor:
|
|
569
|
-
var options = _ref.options;
|
|
570
|
-
return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
|
|
571
|
-
}
|
|
207
|
+
label: (0, i18n_exports._)("Major value"),
|
|
208
|
+
option: "majorColor",
|
|
209
|
+
editor: "editor.color",
|
|
210
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.majorColor)
|
|
572
211
|
};
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
/***/ }),
|
|
576
|
-
/* 28 */
|
|
577
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
578
|
-
|
|
579
|
-
"use strict";
|
|
580
|
-
__webpack_require__.r(__webpack_exports__);
|
|
581
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
582
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
583
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
584
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
585
|
-
|
|
212
|
+
var StaticMajorColorEditor_default = StaticMajorColorEditor;
|
|
586
213
|
|
|
214
|
+
// src/common/editorConfig/StaticTrendColorEditor.js
|
|
587
215
|
var StaticTrendColorEditor = {
|
|
588
|
-
label:
|
|
589
|
-
option:
|
|
590
|
-
editor:
|
|
591
|
-
showEditor:
|
|
592
|
-
|
|
593
|
-
return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.trendColor);
|
|
594
|
-
},
|
|
595
|
-
isDisabled: function isDisabled(_ref2) {
|
|
596
|
-
var options = _ref2.options;
|
|
597
|
-
return options.trendDisplay === 'off';
|
|
598
|
-
}
|
|
216
|
+
label: (0, i18n_exports._)("Trend value"),
|
|
217
|
+
option: "trendColor",
|
|
218
|
+
editor: "editor.color",
|
|
219
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.trendColor),
|
|
220
|
+
isDisabled: ({ options }) => options.trendDisplay === "off"
|
|
599
221
|
};
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
Object.defineProperty(exports, "__esModule", {
|
|
610
|
-
value: true
|
|
611
|
-
});
|
|
612
|
-
exports.TrellisBackgroundColorEditor = exports.TrellisEditorConfig = void 0;
|
|
613
|
-
|
|
614
|
-
var React = __webpack_require__(30);
|
|
615
|
-
|
|
616
|
-
var i18n_1 = __webpack_require__(0);
|
|
617
|
-
|
|
618
|
-
var FeatureFlagContext_1 = __webpack_require__(31);
|
|
619
|
-
|
|
620
|
-
var visualization_schemas_1 = __webpack_require__(2);
|
|
621
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
exports.TrellisEditorConfig = [[{
|
|
625
|
-
label: (0, i18n_1._)('Trellis layout'),
|
|
626
|
-
option: 'splitByLayout',
|
|
627
|
-
editor: 'editor.toggle',
|
|
628
|
-
showEditor: function showEditor() {
|
|
629
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
630
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
631
|
-
return isTrellisFeatureFlagOn;
|
|
632
|
-
}
|
|
633
|
-
}], [{
|
|
634
|
-
label: (0, i18n_1._)('Split by'),
|
|
635
|
-
option: 'trellisSplitBy',
|
|
636
|
-
editor: 'editor.trellisSplitBy',
|
|
637
|
-
editorProps: {
|
|
638
|
-
dataSourceKey: 'primary'
|
|
639
|
-
},
|
|
640
|
-
showEditor: function showEditor(_ref) {
|
|
641
|
-
var options = _ref.options;
|
|
642
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
643
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
644
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
645
|
-
}
|
|
646
|
-
}], [{
|
|
647
|
-
label: (0, i18n_1._)('Number of columns'),
|
|
648
|
-
option: 'trellisColumns',
|
|
649
|
-
editor: 'editor.number',
|
|
650
|
-
editorProps: {
|
|
651
|
-
min: 1
|
|
652
|
-
},
|
|
653
|
-
placeholder: (0, i18n_1._)('Auto'),
|
|
654
|
-
showEditor: function showEditor(_ref2) {
|
|
655
|
-
var options = _ref2.options;
|
|
656
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
657
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
658
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
659
|
-
}
|
|
660
|
-
}], [{
|
|
661
|
-
label: (0, i18n_1._)('Min column width'),
|
|
662
|
-
option: 'trellisMinColumnWidth',
|
|
663
|
-
editor: 'editor.number',
|
|
664
|
-
editorProps: {
|
|
665
|
-
min: 1
|
|
666
|
-
},
|
|
667
|
-
showEditor: function showEditor(_ref3) {
|
|
668
|
-
var options = _ref3.options;
|
|
669
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
670
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
671
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
672
|
-
}
|
|
673
|
-
}, {
|
|
674
|
-
label: (0, i18n_1._)('Row height'),
|
|
675
|
-
option: 'trellisRowHeight',
|
|
676
|
-
editor: 'editor.number',
|
|
222
|
+
var StaticTrendColorEditor_default = StaticTrendColorEditor;
|
|
223
|
+
|
|
224
|
+
// src/common/editorConfig/DynamicMajorColorEditor.js
|
|
225
|
+
var getDynamicMajorColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
|
|
226
|
+
label: (0, i18n_exports._)("Major value"),
|
|
227
|
+
option: "majorColor",
|
|
228
|
+
context: "majorColorEditorConfig",
|
|
229
|
+
editor: "editor.dynamicColor",
|
|
230
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.majorColor),
|
|
677
231
|
editorProps: {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
232
|
+
labelPosition: "top",
|
|
233
|
+
flyoutTitle: (0, i18n_exports._)("Dynamic coloring: major value"),
|
|
234
|
+
formatters: [
|
|
235
|
+
{
|
|
236
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
237
|
+
value: "rangeValue",
|
|
238
|
+
defaults: {
|
|
239
|
+
majorValue: defaultContext2.majorColorConfig
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
label: (0, i18n_exports._)("Matches"),
|
|
244
|
+
value: "matchValue",
|
|
245
|
+
defaults: {
|
|
246
|
+
majorValue: defaultContext2.majorColorMatchConfig
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
dataSelectors: [
|
|
251
|
+
{
|
|
252
|
+
label: (0, i18n_exports._)("Major value"),
|
|
253
|
+
value: "majorValue"
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
defaultPalettesConfig: defaultPalettesConfig2
|
|
685
257
|
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// src/common/editorConfig/DynamicTrendColorEditor.js
|
|
261
|
+
var getDynamicTrendColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
|
|
262
|
+
label: (0, i18n_exports._)("Trend value"),
|
|
263
|
+
option: "trendColor",
|
|
264
|
+
context: "trendColorEditorConfig",
|
|
265
|
+
editor: "editor.dynamicColor",
|
|
266
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.trendColor),
|
|
690
267
|
editorProps: {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
268
|
+
labelPosition: "top",
|
|
269
|
+
flyoutTitle: (0, i18n_exports._)("Dynamic coloring: trend value"),
|
|
270
|
+
formatters: [
|
|
271
|
+
{
|
|
272
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
273
|
+
value: "rangeValue",
|
|
274
|
+
defaults: {
|
|
275
|
+
trendValue: defaultContext2.trendColorConfig
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
dataSelectors: [
|
|
280
|
+
{
|
|
281
|
+
label: (0, i18n_exports._)("Trend value"),
|
|
282
|
+
value: "trendValue"
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
defaultPalettesConfig: defaultPalettesConfig2
|
|
709
286
|
}
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
/***/ }),
|
|
713
|
-
/* 30 */
|
|
714
|
-
/***/ (function(module, exports) {
|
|
715
|
-
|
|
716
|
-
module.exports = require("react");
|
|
717
|
-
|
|
718
|
-
/***/ }),
|
|
719
|
-
/* 31 */
|
|
720
|
-
/***/ (function(module, exports) {
|
|
721
|
-
|
|
722
|
-
module.exports = require("@splunk/visualization-context/FeatureFlagContext");
|
|
723
|
-
|
|
724
|
-
/***/ }),
|
|
725
|
-
/* 32 */,
|
|
726
|
-
/* 33 */,
|
|
727
|
-
/* 34 */,
|
|
728
|
-
/* 35 */,
|
|
729
|
-
/* 36 */,
|
|
730
|
-
/* 37 */
|
|
731
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
732
|
-
|
|
733
|
-
"use strict";
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
Object.defineProperty(exports, "__esModule", {
|
|
737
|
-
value: true
|
|
738
287
|
});
|
|
739
|
-
exports.defaultContext = void 0;
|
|
740
|
-
exports.defaultContext = {
|
|
741
|
-
trendColorConfig: [{
|
|
742
|
-
to: 0,
|
|
743
|
-
value: '#9E2520'
|
|
744
|
-
}, {
|
|
745
|
-
from: 0,
|
|
746
|
-
value: '#1C6B2D'
|
|
747
|
-
}],
|
|
748
|
-
majorColorConfig: [{
|
|
749
|
-
to: 20,
|
|
750
|
-
value: '#D41F1F'
|
|
751
|
-
}, {
|
|
752
|
-
from: 20,
|
|
753
|
-
to: 40,
|
|
754
|
-
value: '#D94E17'
|
|
755
|
-
}, {
|
|
756
|
-
from: 40,
|
|
757
|
-
to: 60,
|
|
758
|
-
value: '#CBA700'
|
|
759
|
-
}, {
|
|
760
|
-
from: 60,
|
|
761
|
-
to: 80,
|
|
762
|
-
value: '#669922'
|
|
763
|
-
}, {
|
|
764
|
-
from: 80,
|
|
765
|
-
value: '#118832'
|
|
766
|
-
}],
|
|
767
|
-
majorColorMatchConfig: [{
|
|
768
|
-
match: '',
|
|
769
|
-
value: '#5C33FF'
|
|
770
|
-
}]
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
/***/ }),
|
|
774
|
-
/* 38 */
|
|
775
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
776
|
-
|
|
777
|
-
"use strict";
|
|
778
|
-
__webpack_require__.r(__webpack_exports__);
|
|
779
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicMajorColorEditor", function() { return getDynamicMajorColorEditor; });
|
|
780
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
781
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
782
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
783
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
784
288
|
|
|
785
|
-
|
|
786
|
-
var
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
labelPosition: 'top',
|
|
800
|
-
flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: major value'),
|
|
801
|
-
formatters: [{
|
|
802
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
|
|
803
|
-
value: 'rangeValue',
|
|
289
|
+
// src/common/editorConfig/DynamicBackgroundColorEditor.js
|
|
290
|
+
var getDynamicBackgroundColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
|
|
291
|
+
label: (0, i18n_exports._)("Background color"),
|
|
292
|
+
option: "backgroundColor",
|
|
293
|
+
context: "backgroundColorEditorConfig",
|
|
294
|
+
editor: "editor.dynamicColor",
|
|
295
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.backgroundColor),
|
|
296
|
+
editorProps: {
|
|
297
|
+
labelPosition: "top",
|
|
298
|
+
flyoutTitle: (0, i18n_exports._)("Dynamic coloring: background"),
|
|
299
|
+
formatters: [
|
|
300
|
+
{
|
|
301
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
302
|
+
value: "rangeValue",
|
|
804
303
|
defaults: {
|
|
805
|
-
majorValue:
|
|
304
|
+
majorValue: defaultContext2.majorColorConfig,
|
|
305
|
+
trendValue: defaultContext2.trendColorConfig
|
|
806
306
|
}
|
|
807
|
-
},
|
|
808
|
-
|
|
809
|
-
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
label: (0, i18n_exports._)("Matches"),
|
|
310
|
+
value: "matchValue",
|
|
810
311
|
defaults: {
|
|
811
|
-
majorValue:
|
|
312
|
+
majorValue: defaultContext2.majorColorMatchConfig
|
|
812
313
|
}
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
dataSelectors: [
|
|
317
|
+
{
|
|
318
|
+
label: (0, i18n_exports._)("Major Value"),
|
|
319
|
+
value: "majorValue"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
label: (0, i18n_exports._)("Trend"),
|
|
323
|
+
value: "trendValue"
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
defaultPalettesConfig: defaultPalettesConfig2
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
// esm-externals:react
|
|
331
|
+
var react_exports = {};
|
|
332
|
+
__export(react_exports, {
|
|
333
|
+
default: () => react_default
|
|
334
|
+
});
|
|
335
|
+
var defaultImport8 = __toESM(require("react"));
|
|
336
|
+
__reExport(react_exports, require("react"));
|
|
337
|
+
var react_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
338
|
+
|
|
339
|
+
// esm-externals:@splunk/visualization-context/FeatureFlagContext
|
|
340
|
+
var FeatureFlagContext_exports = {};
|
|
341
|
+
__export(FeatureFlagContext_exports, {
|
|
342
|
+
default: () => FeatureFlagContext_default
|
|
343
|
+
});
|
|
344
|
+
var defaultImport9 = __toESM(require("@splunk/visualization-context/FeatureFlagContext"));
|
|
345
|
+
__reExport(FeatureFlagContext_exports, require("@splunk/visualization-context/FeatureFlagContext"));
|
|
346
|
+
var FeatureFlagContext_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
347
|
+
|
|
348
|
+
// src/common/editorConfig/TrellisEditors.ts
|
|
349
|
+
var TrellisEditorConfig = [
|
|
350
|
+
[
|
|
351
|
+
{
|
|
352
|
+
label: (0, i18n_exports._)("Trellis layout"),
|
|
353
|
+
option: "splitByLayout",
|
|
354
|
+
editor: "editor.toggle",
|
|
355
|
+
showEditor: () => {
|
|
356
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
357
|
+
const isTrellisFeatureFlagOn = Boolean(
|
|
358
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
359
|
+
);
|
|
360
|
+
return isTrellisFeatureFlagOn;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
[
|
|
365
|
+
{
|
|
366
|
+
label: (0, i18n_exports._)("Split by"),
|
|
367
|
+
option: "trellisSplitBy",
|
|
368
|
+
editor: "editor.trellisSplitBy",
|
|
369
|
+
editorProps: {
|
|
370
|
+
dataSourceKey: "primary"
|
|
371
|
+
},
|
|
372
|
+
showEditor: ({ options }) => {
|
|
373
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
374
|
+
const isTrellisFeatureFlagOn = Boolean(
|
|
375
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
376
|
+
);
|
|
377
|
+
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
],
|
|
381
|
+
[
|
|
382
|
+
{
|
|
383
|
+
label: (0, i18n_exports._)("Number of columns"),
|
|
384
|
+
option: "trellisColumns",
|
|
385
|
+
editor: "editor.number",
|
|
386
|
+
editorProps: {
|
|
387
|
+
min: 1
|
|
388
|
+
},
|
|
389
|
+
placeholder: (0, i18n_exports._)("Auto"),
|
|
390
|
+
showEditor: ({ options }) => {
|
|
391
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
392
|
+
const isTrellisFeatureFlagOn = Boolean(
|
|
393
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
394
|
+
);
|
|
395
|
+
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
396
|
+
}
|
|
819
397
|
}
|
|
820
|
-
|
|
398
|
+
],
|
|
399
|
+
[
|
|
400
|
+
{
|
|
401
|
+
label: (0, i18n_exports._)("Min column width"),
|
|
402
|
+
option: "trellisMinColumnWidth",
|
|
403
|
+
editor: "editor.number",
|
|
404
|
+
editorProps: {
|
|
405
|
+
min: 1
|
|
406
|
+
},
|
|
407
|
+
showEditor: ({ options }) => {
|
|
408
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
409
|
+
const isTrellisFeatureFlagOn = Boolean(
|
|
410
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
411
|
+
);
|
|
412
|
+
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
label: (0, i18n_exports._)("Row height"),
|
|
417
|
+
option: "trellisRowHeight",
|
|
418
|
+
editor: "editor.number",
|
|
419
|
+
editorProps: {
|
|
420
|
+
min: 1
|
|
421
|
+
},
|
|
422
|
+
showEditor: ({ options }) => {
|
|
423
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
424
|
+
const isTrellisFeatureFlagOn = Boolean(
|
|
425
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
426
|
+
);
|
|
427
|
+
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
],
|
|
431
|
+
[
|
|
432
|
+
{
|
|
433
|
+
label: (0, i18n_exports._)("Max number of components per page"),
|
|
434
|
+
option: "trellisPageCount",
|
|
435
|
+
editor: "editor.number",
|
|
436
|
+
editorProps: {
|
|
437
|
+
min: 1
|
|
438
|
+
},
|
|
439
|
+
showEditor: ({ options }) => {
|
|
440
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
441
|
+
const isTrellisFeatureFlagOn = Boolean(
|
|
442
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
443
|
+
);
|
|
444
|
+
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
];
|
|
449
|
+
var TrellisBackgroundColorEditor = {
|
|
450
|
+
label: (0, i18n_exports._)("Trellis background"),
|
|
451
|
+
option: "trellisBackgroundColor",
|
|
452
|
+
editor: "editor.color",
|
|
453
|
+
showEditor: ({ options }) => {
|
|
454
|
+
const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
|
|
455
|
+
const isTrellisFeatureFlagOn = Boolean(
|
|
456
|
+
featureFlagContext && featureFlagContext.visualizations_enableTrellis
|
|
457
|
+
);
|
|
458
|
+
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
459
|
+
}
|
|
821
460
|
};
|
|
822
461
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
/* 42 */,
|
|
828
|
-
/* 43 */,
|
|
829
|
-
/* 44 */,
|
|
830
|
-
/* 45 */,
|
|
831
|
-
/* 46 */,
|
|
832
|
-
/* 47 */,
|
|
833
|
-
/* 48 */,
|
|
834
|
-
/* 49 */,
|
|
835
|
-
/* 50 */,
|
|
836
|
-
/* 51 */,
|
|
837
|
-
/* 52 */,
|
|
838
|
-
/* 53 */,
|
|
839
|
-
/* 54 */,
|
|
840
|
-
/* 55 */,
|
|
841
|
-
/* 56 */,
|
|
842
|
-
/* 57 */,
|
|
843
|
-
/* 58 */,
|
|
844
|
-
/* 59 */,
|
|
845
|
-
/* 60 */,
|
|
846
|
-
/* 61 */,
|
|
847
|
-
/* 62 */,
|
|
848
|
-
/* 63 */,
|
|
849
|
-
/* 64 */,
|
|
850
|
-
/* 65 */,
|
|
851
|
-
/* 66 */,
|
|
852
|
-
/* 67 */,
|
|
853
|
-
/* 68 */
|
|
854
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
855
|
-
|
|
856
|
-
"use strict";
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
var _toConsumableArray = __webpack_require__(1);
|
|
860
|
-
|
|
861
|
-
Object.defineProperty(exports, "__esModule", {
|
|
862
|
-
value: true
|
|
462
|
+
// esm-externals:lodash
|
|
463
|
+
var lodash_exports = {};
|
|
464
|
+
__export(lodash_exports, {
|
|
465
|
+
default: () => lodash_default
|
|
863
466
|
});
|
|
467
|
+
var defaultImport10 = __toESM(require("lodash"));
|
|
468
|
+
__reExport(lodash_exports, require("lodash"));
|
|
469
|
+
var lodash_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
|
|
864
470
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
var VizBehavior_1 = __webpack_require__(6);
|
|
898
|
-
|
|
899
|
-
var configUtils_2 = __webpack_require__(3);
|
|
900
|
-
|
|
901
|
-
var VizCategory_1 = __webpack_require__(7);
|
|
471
|
+
// src/common/utils/configUtils.ts
|
|
472
|
+
function enhanceConfig(vizConfig) {
|
|
473
|
+
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
474
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
475
|
+
(config2) => {
|
|
476
|
+
return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
return enhancedConfig;
|
|
480
|
+
}
|
|
481
|
+
function hasCompatibleContexts(vizContext, presetContext) {
|
|
482
|
+
const presetContextKeys = Object.keys(presetContext);
|
|
483
|
+
return presetContextKeys.every(
|
|
484
|
+
(contextKey) => presetContext[contextKey] === void 0 && vizContext[contextKey] === void 0 || presetContext[contextKey] !== void 0 && vizContext[contextKey] !== void 0
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
488
|
+
const presetOptionKeys = Object.keys(presetOptions);
|
|
489
|
+
return presetOptionKeys.every(
|
|
490
|
+
(optionKey) => (0, configUtils_exports.isDynamicOption)(presetOptions[optionKey]) === (0, configUtils_exports.isDynamicOption)(vizOptions[optionKey])
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
function getInitialPreset(vizContext, vizOptions, presets2) {
|
|
494
|
+
return presets2.find((preset) => {
|
|
495
|
+
const presetContext = (0, lodash_exports.get)(preset, ["value", "context"], {});
|
|
496
|
+
const presetOptions = (0, lodash_exports.get)(preset, ["value", "options"], {});
|
|
497
|
+
const presetContextKeys = Object.keys(presetContext);
|
|
498
|
+
const presetOptionKeys = Object.keys(presetOptions);
|
|
499
|
+
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
500
|
+
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
902
503
|
|
|
504
|
+
// src/SingleValueIcon/config.ts
|
|
903
505
|
var dataContract = {
|
|
904
|
-
requiredDataSources: [
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
506
|
+
requiredDataSources: [
|
|
507
|
+
{
|
|
508
|
+
name: "primary",
|
|
509
|
+
description: "DataSource that powers the visualization"
|
|
510
|
+
}
|
|
511
|
+
],
|
|
908
512
|
optionalDataSources: [],
|
|
909
513
|
initialRequestParams: {
|
|
910
|
-
primary: {
|
|
911
|
-
offset: 0,
|
|
912
|
-
count: 10000
|
|
913
|
-
}
|
|
514
|
+
primary: { offset: 0, count: 1e4 }
|
|
914
515
|
}
|
|
915
516
|
};
|
|
916
517
|
var size = {
|
|
@@ -918,361 +519,334 @@ var size = {
|
|
|
918
519
|
initialHeight: 250
|
|
919
520
|
};
|
|
920
521
|
var basePresetContext = {
|
|
921
|
-
iconColorEditorConfig:
|
|
922
|
-
majorColorEditorConfig:
|
|
923
|
-
trendColorEditorConfig:
|
|
924
|
-
backgroundColorEditorConfig:
|
|
522
|
+
iconColorEditorConfig: void 0,
|
|
523
|
+
majorColorEditorConfig: void 0,
|
|
524
|
+
trendColorEditorConfig: void 0,
|
|
525
|
+
backgroundColorEditorConfig: void 0
|
|
925
526
|
};
|
|
926
527
|
var basePresetOptions = {
|
|
927
|
-
iconColor:
|
|
928
|
-
majorColor:
|
|
929
|
-
trendColor:
|
|
930
|
-
backgroundColor:
|
|
528
|
+
iconColor: void 0,
|
|
529
|
+
majorColor: void 0,
|
|
530
|
+
trendColor: void 0,
|
|
531
|
+
backgroundColor: void 0
|
|
931
532
|
};
|
|
932
|
-
var presets = [
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
}, {
|
|
941
|
-
label: (0, i18n_1._)('Icon'),
|
|
942
|
-
name: 'singleValueIcon.icon',
|
|
943
|
-
value: {
|
|
944
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
945
|
-
iconColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
|
|
946
|
-
}),
|
|
947
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
948
|
-
iconColor: '> majorValue | rangeValue(iconColorEditorConfig)'
|
|
949
|
-
})
|
|
950
|
-
}
|
|
951
|
-
}, {
|
|
952
|
-
label: (0, i18n_1._)('Major value'),
|
|
953
|
-
name: 'singleValueIcon.majorValue',
|
|
954
|
-
value: {
|
|
955
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
956
|
-
majorColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
|
|
957
|
-
}),
|
|
958
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
959
|
-
majorColor: '> majorValue | rangeValue(majorColorEditorConfig)'
|
|
960
|
-
})
|
|
961
|
-
}
|
|
962
|
-
}, {
|
|
963
|
-
label: (0, i18n_1._)('Trend value'),
|
|
964
|
-
name: 'singleValueIcon.trend',
|
|
965
|
-
value: {
|
|
966
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
967
|
-
trendColorEditorConfig: singleValueContext_1.defaultContext.trendColorConfig
|
|
968
|
-
}),
|
|
969
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
970
|
-
trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
|
|
971
|
-
})
|
|
972
|
-
}
|
|
973
|
-
}, {
|
|
974
|
-
label: (0, i18n_1._)('Icon and Major value'),
|
|
975
|
-
name: 'singleValueIcon.iconAndMajorValue',
|
|
976
|
-
value: {
|
|
977
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
978
|
-
iconColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig,
|
|
979
|
-
majorColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
|
|
980
|
-
}),
|
|
981
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
982
|
-
iconColor: '> majorValue | rangeValue(iconColorEditorConfig)',
|
|
983
|
-
majorColor: '> majorValue | rangeValue(majorColorEditorConfig)'
|
|
984
|
-
})
|
|
985
|
-
}
|
|
986
|
-
}, {
|
|
987
|
-
label: (0, i18n_1._)('Background'),
|
|
988
|
-
name: 'singleValueIcon.background',
|
|
989
|
-
value: {
|
|
990
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
991
|
-
backgroundColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
|
|
992
|
-
}),
|
|
993
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
994
|
-
backgroundColor: '> majorValue | rangeValue(backgroundColorEditorConfig)'
|
|
995
|
-
})
|
|
996
|
-
}
|
|
997
|
-
}];
|
|
998
|
-
/**
|
|
999
|
-
* TODO
|
|
1000
|
-
* common theme variables such as enterprise.defaultFontColor
|
|
1001
|
-
* that are repeated in multiple viz config themes should be DRYd up.
|
|
1002
|
-
*/
|
|
1003
|
-
|
|
1004
|
-
var themes = {
|
|
1005
|
-
defaultFontColor: function defaultFontColor(props) {
|
|
1006
|
-
return (0, pick_1.default)({
|
|
1007
|
-
enterprise: {
|
|
1008
|
-
dark: variables_1.default.textColor(props),
|
|
1009
|
-
light: variables_1.default.gray20(props)
|
|
1010
|
-
},
|
|
1011
|
-
prisma: variables_1.default.contentColorActive(props)
|
|
1012
|
-
})(props);
|
|
1013
|
-
},
|
|
1014
|
-
defaultBlockFontColor: function defaultBlockFontColor(props) {
|
|
1015
|
-
return (0, pick_1.default)({
|
|
1016
|
-
enterprise: variables_1.default.white(props),
|
|
1017
|
-
prisma: variables_1.default.contentColorActive(props)
|
|
1018
|
-
})(props);
|
|
1019
|
-
}
|
|
1020
|
-
};
|
|
1021
|
-
var editorConfig = [{
|
|
1022
|
-
label: (0, i18n_1._)('Data configurations'),
|
|
1023
|
-
layout: [[{
|
|
1024
|
-
label: (0, i18n_1._)('Value'),
|
|
1025
|
-
editor: 'editor.columnSelector',
|
|
1026
|
-
option: 'majorValue',
|
|
1027
|
-
context: 'valuesContext',
|
|
1028
|
-
editorProps: {
|
|
1029
|
-
dataSourceKey: 'primary',
|
|
1030
|
-
prepareValue: function prepareValue(definition) {
|
|
1031
|
-
var baseSPL = definition.options.majorValue;
|
|
1032
|
-
return {
|
|
1033
|
-
context: {},
|
|
1034
|
-
options: {
|
|
1035
|
-
majorValue: "".concat(baseSPL, " | lastPoint()"),
|
|
1036
|
-
trendValue: "".concat(baseSPL, " | delta(-2)")
|
|
1037
|
-
}
|
|
1038
|
-
};
|
|
1039
|
-
}
|
|
1040
|
-
},
|
|
1041
|
-
isDisabled: function isDisabled(_ref) {
|
|
1042
|
-
var options = _ref.options;
|
|
1043
|
-
return options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
1044
|
-
}
|
|
1045
|
-
}]]
|
|
1046
|
-
}, {
|
|
1047
|
-
label: (0, i18n_1._)('Data display'),
|
|
1048
|
-
layout: [[{
|
|
1049
|
-
label: (0, i18n_1._)('Show major and trend value'),
|
|
1050
|
-
option: 'showValue',
|
|
1051
|
-
editor: 'editor.toggle'
|
|
1052
|
-
}]].concat(_toConsumableArray(StaticMajorAndTrendLayout_1.default), [[{
|
|
1053
|
-
label: (0, i18n_1._)('Trend display'),
|
|
1054
|
-
option: 'trendDisplay',
|
|
1055
|
-
editor: 'editor.select',
|
|
1056
|
-
editorProps: {
|
|
1057
|
-
values: [{
|
|
1058
|
-
label: (0, i18n_1._)('Percent'),
|
|
1059
|
-
value: 'percent'
|
|
1060
|
-
}, {
|
|
1061
|
-
label: (0, i18n_1._)('Absolute'),
|
|
1062
|
-
value: 'absolute'
|
|
1063
|
-
}, {
|
|
1064
|
-
label: (0, i18n_1._)('Off'),
|
|
1065
|
-
value: 'off'
|
|
1066
|
-
}]
|
|
1067
|
-
},
|
|
1068
|
-
showEditor: function showEditor(_ref2) {
|
|
1069
|
-
var options = _ref2.options;
|
|
1070
|
-
return options.showValue || options.showValue === undefined;
|
|
533
|
+
var presets = [
|
|
534
|
+
{
|
|
535
|
+
// dummy context variables to allow for resetting of unused context states
|
|
536
|
+
label: (0, i18n_exports._)("None"),
|
|
537
|
+
name: "singleValueIcon.none",
|
|
538
|
+
value: {
|
|
539
|
+
context: __spreadValues({}, basePresetContext),
|
|
540
|
+
options: __spreadValues({}, basePresetOptions)
|
|
1071
541
|
}
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
options = _ref3.options;
|
|
1084
|
-
var initialPreset = (0, configUtils_2.getInitialPreset)(context, options, presets);
|
|
1085
|
-
return initialPreset && initialPreset.label || null;
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
}], StaticIconColorEditor_1.default, [{
|
|
1089
|
-
label: (0, i18n_1._)('Icon'),
|
|
1090
|
-
option: 'iconColor',
|
|
1091
|
-
context: 'iconColorEditorConfig',
|
|
1092
|
-
editor: 'editor.dynamicColor',
|
|
1093
|
-
showEditor: function showEditor(_ref4) {
|
|
1094
|
-
var options = _ref4.options;
|
|
1095
|
-
return (0, configUtils_1.isDynamicOption)(options.iconColor);
|
|
1096
|
-
},
|
|
1097
|
-
editorProps: {
|
|
1098
|
-
labelPosition: 'top',
|
|
1099
|
-
flyoutTitle: 'Dynamic coloring: icon',
|
|
1100
|
-
formatters: [{
|
|
1101
|
-
label: (0, i18n_1._)('Ranges'),
|
|
1102
|
-
value: 'rangeValue',
|
|
1103
|
-
defaults: {
|
|
1104
|
-
trendValue: singleValueContext_1.defaultContext.trendColorConfig,
|
|
1105
|
-
majorValue: singleValueContext_1.defaultContext.majorColorConfig
|
|
1106
|
-
}
|
|
1107
|
-
}, {
|
|
1108
|
-
label: (0, i18n_1._)('Matches'),
|
|
1109
|
-
value: 'matchValue',
|
|
1110
|
-
defaults: {
|
|
1111
|
-
majorValue: singleValueContext_1.defaultContext.majorColorMatchConfig
|
|
1112
|
-
}
|
|
1113
|
-
}],
|
|
1114
|
-
dataSelectors: [{
|
|
1115
|
-
label: (0, i18n_1._)('Major value'),
|
|
1116
|
-
value: 'majorValue'
|
|
1117
|
-
}, {
|
|
1118
|
-
label: (0, i18n_1._)('Trend'),
|
|
1119
|
-
value: 'trendValue'
|
|
1120
|
-
}],
|
|
1121
|
-
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
1122
|
-
}
|
|
1123
|
-
}], [Object.assign(Object.assign({}, StaticMajorColorEditor_1.default), {
|
|
1124
|
-
editorProps: {
|
|
1125
|
-
themes: themes
|
|
1126
|
-
}
|
|
1127
|
-
})], [(0, DynamicMajorColorEditor_1.getDynamicMajorColorEditor)({
|
|
1128
|
-
defaultContext: singleValueContext_1.defaultContext,
|
|
1129
|
-
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
1130
|
-
})], [Object.assign(Object.assign({}, StaticTrendColorEditor_1.default), {
|
|
1131
|
-
editorProps: {
|
|
1132
|
-
themes: themes
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
label: (0, i18n_exports._)("Icon"),
|
|
545
|
+
name: "singleValueIcon.icon",
|
|
546
|
+
value: {
|
|
547
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
548
|
+
iconColorEditorConfig: defaultContext.majorColorConfig
|
|
549
|
+
}),
|
|
550
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
551
|
+
iconColor: "> majorValue | rangeValue(iconColorEditorConfig)"
|
|
552
|
+
})
|
|
1133
553
|
}
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
label: (0, i18n_exports._)("Major value"),
|
|
557
|
+
name: "singleValueIcon.majorValue",
|
|
558
|
+
value: {
|
|
559
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
560
|
+
majorColorEditorConfig: defaultContext.majorColorConfig
|
|
561
|
+
}),
|
|
562
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
563
|
+
majorColor: "> majorValue | rangeValue(majorColorEditorConfig)"
|
|
564
|
+
})
|
|
1140
565
|
}
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
label: (0, i18n_exports._)("Trend value"),
|
|
569
|
+
name: "singleValueIcon.trend",
|
|
570
|
+
value: {
|
|
571
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
572
|
+
trendColorEditorConfig: defaultContext.trendColorConfig
|
|
573
|
+
}),
|
|
574
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
575
|
+
trendColor: "> trendValue | rangeValue(trendColorEditorConfig)"
|
|
576
|
+
})
|
|
1144
577
|
}
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
return options.showValue || options.showValue === undefined;
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
label: (0, i18n_exports._)("Icon and Major value"),
|
|
581
|
+
name: "singleValueIcon.iconAndMajorValue",
|
|
582
|
+
value: {
|
|
583
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
584
|
+
iconColorEditorConfig: defaultContext.majorColorConfig,
|
|
585
|
+
majorColorEditorConfig: defaultContext.majorColorConfig
|
|
586
|
+
}),
|
|
587
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
588
|
+
iconColor: "> majorValue | rangeValue(iconColorEditorConfig)",
|
|
589
|
+
majorColor: "> majorValue | rangeValue(majorColorEditorConfig)"
|
|
590
|
+
})
|
|
1159
591
|
}
|
|
1160
|
-
},
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
},
|
|
1172
|
-
isDisabled: function isDisabled(_ref7) {
|
|
1173
|
-
var options = _ref7.options;
|
|
1174
|
-
return options.trendDisplay === 'off';
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
label: (0, i18n_exports._)("Background"),
|
|
595
|
+
name: "singleValueIcon.background",
|
|
596
|
+
value: {
|
|
597
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
598
|
+
backgroundColorEditorConfig: defaultContext.majorColorConfig
|
|
599
|
+
}),
|
|
600
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
601
|
+
backgroundColor: "> majorValue | rangeValue(backgroundColorEditorConfig)"
|
|
602
|
+
})
|
|
1175
603
|
}
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
editor: 'editor.checkbox'
|
|
1184
|
-
}], [{
|
|
1185
|
-
label: (0, i18n_1._)('Alignment'),
|
|
1186
|
-
editor: 'editor.radioBar',
|
|
1187
|
-
option: 'align',
|
|
1188
|
-
editorProps: {
|
|
1189
|
-
values: [{
|
|
1190
|
-
label: (0, i18n_1._)('Left'),
|
|
1191
|
-
value: 'left'
|
|
1192
|
-
}, {
|
|
1193
|
-
label: (0, i18n_1._)('Center'),
|
|
1194
|
-
value: 'center'
|
|
1195
|
-
}, {
|
|
1196
|
-
label: (0, i18n_1._)('Right'),
|
|
1197
|
-
value: 'right'
|
|
1198
|
-
}]
|
|
604
|
+
}
|
|
605
|
+
];
|
|
606
|
+
var themes = {
|
|
607
|
+
defaultFontColor: (props) => pick_default({
|
|
608
|
+
enterprise: {
|
|
609
|
+
dark: variables_default.textColor(props),
|
|
610
|
+
light: variables_default.gray20(props)
|
|
1199
611
|
},
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
612
|
+
prisma: variables_default.contentColorActive(props)
|
|
613
|
+
})(props),
|
|
614
|
+
defaultBlockFontColor: (props) => pick_default({
|
|
615
|
+
enterprise: variables_default.white(props),
|
|
616
|
+
prisma: variables_default.contentColorActive(props)
|
|
617
|
+
})(props)
|
|
618
|
+
};
|
|
619
|
+
var editorConfig = [
|
|
620
|
+
{
|
|
621
|
+
label: (0, i18n_exports._)("Data configurations"),
|
|
622
|
+
layout: [
|
|
623
|
+
[
|
|
624
|
+
{
|
|
625
|
+
label: (0, i18n_exports._)("Value"),
|
|
626
|
+
editor: "editor.columnSelector",
|
|
627
|
+
option: "majorValue",
|
|
628
|
+
context: "valuesContext",
|
|
629
|
+
editorProps: {
|
|
630
|
+
dataSourceKey: "primary",
|
|
631
|
+
prepareValue: (definition) => {
|
|
632
|
+
const {
|
|
633
|
+
options: { majorValue: baseSPL }
|
|
634
|
+
} = definition;
|
|
635
|
+
return {
|
|
636
|
+
context: {},
|
|
637
|
+
options: {
|
|
638
|
+
majorValue: `${baseSPL} | lastPoint()`,
|
|
639
|
+
trendValue: `${baseSPL} | delta(-2)`
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
isDisabled: ({ options }) => options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis
|
|
645
|
+
}
|
|
646
|
+
]
|
|
647
|
+
]
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
label: (0, i18n_exports._)("Data display"),
|
|
651
|
+
layout: [
|
|
652
|
+
[
|
|
653
|
+
{
|
|
654
|
+
label: (0, i18n_exports._)("Show major and trend value"),
|
|
655
|
+
option: "showValue",
|
|
656
|
+
editor: "editor.toggle"
|
|
657
|
+
}
|
|
658
|
+
],
|
|
659
|
+
...StaticMajorAndTrendLayout_default,
|
|
660
|
+
[
|
|
661
|
+
{
|
|
662
|
+
label: (0, i18n_exports._)("Trend display"),
|
|
663
|
+
option: "trendDisplay",
|
|
664
|
+
editor: "editor.select",
|
|
665
|
+
editorProps: {
|
|
666
|
+
values: [
|
|
667
|
+
{ label: (0, i18n_exports._)("Percent"), value: "percent" },
|
|
668
|
+
{ label: (0, i18n_exports._)("Absolute"), value: "absolute" },
|
|
669
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" }
|
|
670
|
+
]
|
|
671
|
+
},
|
|
672
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
...TrellisEditorConfig
|
|
676
|
+
]
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
label: (0, i18n_exports._)("Color and style"),
|
|
680
|
+
layout: [
|
|
681
|
+
[
|
|
682
|
+
{
|
|
683
|
+
label: (0, i18n_exports._)("Dynamic elements"),
|
|
684
|
+
key: "presetSelector",
|
|
685
|
+
editor: "editor.presetSelector",
|
|
686
|
+
editorProps: {
|
|
687
|
+
presets,
|
|
688
|
+
value: ({ context, options }) => {
|
|
689
|
+
const initialPreset = getInitialPreset(context, options, presets);
|
|
690
|
+
return initialPreset && initialPreset.label || null;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
],
|
|
695
|
+
StaticIconColorEditor_default,
|
|
696
|
+
[
|
|
697
|
+
{
|
|
698
|
+
label: (0, i18n_exports._)("Icon"),
|
|
699
|
+
option: "iconColor",
|
|
700
|
+
context: "iconColorEditorConfig",
|
|
701
|
+
editor: "editor.dynamicColor",
|
|
702
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.iconColor),
|
|
703
|
+
editorProps: {
|
|
704
|
+
labelPosition: "top",
|
|
705
|
+
flyoutTitle: "Dynamic coloring: icon",
|
|
706
|
+
formatters: [
|
|
707
|
+
{
|
|
708
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
709
|
+
value: "rangeValue",
|
|
710
|
+
defaults: {
|
|
711
|
+
trendValue: defaultContext.trendColorConfig,
|
|
712
|
+
majorValue: defaultContext.majorColorConfig
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
label: (0, i18n_exports._)("Matches"),
|
|
717
|
+
value: "matchValue",
|
|
718
|
+
defaults: {
|
|
719
|
+
majorValue: defaultContext.majorColorMatchConfig
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
],
|
|
723
|
+
dataSelectors: [
|
|
724
|
+
{
|
|
725
|
+
label: (0, i18n_exports._)("Major value"),
|
|
726
|
+
value: "majorValue"
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
label: (0, i18n_exports._)("Trend"),
|
|
730
|
+
value: "trendValue"
|
|
731
|
+
}
|
|
732
|
+
],
|
|
733
|
+
defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
],
|
|
737
|
+
[
|
|
738
|
+
__spreadProps(__spreadValues({}, StaticMajorColorEditor_default), {
|
|
739
|
+
editorProps: {
|
|
740
|
+
themes
|
|
741
|
+
}
|
|
742
|
+
})
|
|
743
|
+
],
|
|
744
|
+
[getDynamicMajorColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
|
|
745
|
+
[
|
|
746
|
+
__spreadProps(__spreadValues({}, StaticTrendColorEditor_default), {
|
|
747
|
+
editorProps: {
|
|
748
|
+
themes
|
|
749
|
+
}
|
|
750
|
+
})
|
|
751
|
+
],
|
|
752
|
+
[getDynamicTrendColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
|
|
753
|
+
[
|
|
754
|
+
__spreadProps(__spreadValues({}, StaticBackgroundColorEditor_default), {
|
|
755
|
+
editorProps: {
|
|
756
|
+
themes
|
|
757
|
+
}
|
|
758
|
+
})
|
|
759
|
+
],
|
|
760
|
+
[
|
|
761
|
+
__spreadProps(__spreadValues({}, TrellisBackgroundColorEditor), {
|
|
762
|
+
editorProps: {
|
|
763
|
+
themes
|
|
764
|
+
}
|
|
765
|
+
})
|
|
766
|
+
],
|
|
767
|
+
[getDynamicBackgroundColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
|
|
768
|
+
[
|
|
769
|
+
{
|
|
770
|
+
label: (0, i18n_exports._)("Major value size (px)"),
|
|
771
|
+
option: "majorFontSize",
|
|
772
|
+
editor: "editor.number",
|
|
773
|
+
editorProps: {
|
|
774
|
+
min: 1
|
|
775
|
+
},
|
|
776
|
+
placeholder: (0, i18n_exports._)("Auto"),
|
|
777
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
label: (0, i18n_exports._)("Trend value size (px)"),
|
|
781
|
+
option: "trendFontSize",
|
|
782
|
+
editor: "editor.number",
|
|
783
|
+
editorProps: {
|
|
784
|
+
min: 1
|
|
785
|
+
},
|
|
786
|
+
placeholder: (0, i18n_exports._)("Auto"),
|
|
787
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0,
|
|
788
|
+
isDisabled: ({ options }) => options.trendDisplay === "off"
|
|
789
|
+
}
|
|
790
|
+
],
|
|
791
|
+
[
|
|
792
|
+
{
|
|
793
|
+
label: (0, i18n_exports._)("Major value abbreviation"),
|
|
794
|
+
option: "shouldAbbreviateMajorValue",
|
|
795
|
+
editor: "editor.checkbox"
|
|
796
|
+
}
|
|
797
|
+
],
|
|
798
|
+
[
|
|
799
|
+
{
|
|
800
|
+
label: (0, i18n_exports._)("Trend value abbreviation"),
|
|
801
|
+
option: "shouldAbbreviateTrendValue",
|
|
802
|
+
editor: "editor.checkbox"
|
|
803
|
+
}
|
|
804
|
+
],
|
|
805
|
+
[
|
|
806
|
+
{
|
|
807
|
+
label: (0, i18n_exports._)("Alignment"),
|
|
808
|
+
editor: "editor.radioBar",
|
|
809
|
+
option: "align",
|
|
810
|
+
editorProps: {
|
|
811
|
+
values: [
|
|
812
|
+
{ label: (0, i18n_exports._)("Left"), value: "left" },
|
|
813
|
+
{ label: (0, i18n_exports._)("Center"), value: "center" },
|
|
814
|
+
{ label: (0, i18n_exports._)("Right"), value: "right" }
|
|
815
|
+
]
|
|
816
|
+
},
|
|
817
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
818
|
+
}
|
|
819
|
+
]
|
|
820
|
+
]
|
|
821
|
+
}
|
|
822
|
+
];
|
|
1210
823
|
var config = {
|
|
1211
824
|
/**
|
|
1212
825
|
* unique viz key
|
|
1213
826
|
*/
|
|
1214
|
-
key:
|
|
1215
|
-
|
|
827
|
+
key: "splunk.singlevalueicon",
|
|
1216
828
|
/**
|
|
1217
829
|
* viz name
|
|
1218
830
|
*/
|
|
1219
|
-
name: (0,
|
|
1220
|
-
category:
|
|
1221
|
-
|
|
831
|
+
name: (0, i18n_exports._)("Single value icon"),
|
|
832
|
+
category: "Single Value" /* SINGLE_VALUE */,
|
|
1222
833
|
/**
|
|
1223
834
|
* viz icon
|
|
1224
835
|
*/
|
|
1225
836
|
icon: null,
|
|
1226
|
-
dataContract
|
|
1227
|
-
size
|
|
1228
|
-
defaultContext
|
|
1229
|
-
optionsSchema:
|
|
1230
|
-
editorConfig
|
|
837
|
+
dataContract,
|
|
838
|
+
size,
|
|
839
|
+
defaultContext,
|
|
840
|
+
optionsSchema: visualization_schemas_exports.singleValueIconOptionsSchema,
|
|
841
|
+
editorConfig,
|
|
1231
842
|
events: {
|
|
1232
|
-
|
|
1233
|
-
description:
|
|
1234
|
-
payloadKeys: [
|
|
843
|
+
"value.click": {
|
|
844
|
+
description: "trigger when user clicks major value or icon",
|
|
845
|
+
payloadKeys: ["majorValue", "trendValue", "icon"]
|
|
1235
846
|
}
|
|
1236
847
|
},
|
|
1237
|
-
supports: [
|
|
1238
|
-
themes
|
|
848
|
+
supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "events" /* EVENTS */, "trellis" /* TRELLIS */],
|
|
849
|
+
themes
|
|
1239
850
|
};
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
/***/ }),
|
|
1243
|
-
/* 69 */
|
|
1244
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1245
|
-
|
|
1246
|
-
"use strict";
|
|
1247
|
-
__webpack_require__.r(__webpack_exports__);
|
|
1248
|
-
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
|
1249
|
-
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
|
|
1250
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
|
|
1251
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
|
1252
|
-
/* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23);
|
|
1253
|
-
/* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_2__);
|
|
1254
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
1255
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_3__);
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
var StaticIconColorEditor = [{
|
|
1261
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_1__["_"])('Icon'),
|
|
1262
|
-
option: 'iconColor',
|
|
1263
|
-
editor: 'editor.color',
|
|
1264
|
-
showEditor: function showEditor(_ref) {
|
|
1265
|
-
var options = _ref.options;
|
|
1266
|
-
return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_3__["isDynamicOption"])(options.iconColor);
|
|
1267
|
-
},
|
|
1268
|
-
editorProps: {
|
|
1269
|
-
labelPosition: 'top',
|
|
1270
|
-
value: null,
|
|
1271
|
-
palette: [null].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(_splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_2__["COLOR_EDITOR_PALETTE"]))
|
|
1272
|
-
}
|
|
1273
|
-
}];
|
|
1274
|
-
/* harmony default export */ __webpack_exports__["default"] = (StaticIconColorEditor);
|
|
1275
|
-
|
|
1276
|
-
/***/ })
|
|
1277
|
-
/******/ ]);
|
|
1278
|
-
//# sourceMappingURL=SingleValueIcon.config.js.map
|
|
851
|
+
var config_default = enhanceConfig(config);
|
|
852
|
+
//# sourceMappingURL=SingleValueIcon.config.js.map
|