@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.
Files changed (152) hide show
  1. package/Area.config.js +1262 -1600
  2. package/Area.config.js.map +7 -1
  3. package/Area.js +3002 -4920
  4. package/Area.js.map +7 -1
  5. package/Bar.config.js +1247 -1574
  6. package/Bar.config.js.map +7 -1
  7. package/Bar.js +2924 -4836
  8. package/Bar.js.map +7 -1
  9. package/Bubble.config.js +896 -1213
  10. package/Bubble.config.js.map +7 -1
  11. package/Bubble.js +2520 -4476
  12. package/Bubble.js.map +7 -1
  13. package/ChoroplethSvg.config.js +282 -582
  14. package/ChoroplethSvg.config.js.map +7 -1
  15. package/ChoroplethSvg.js +2004 -3810
  16. package/ChoroplethSvg.js.map +7 -1
  17. package/Column.config.js +1208 -1541
  18. package/Column.config.js.map +7 -1
  19. package/Column.js +2933 -4879
  20. package/Column.js.map +7 -1
  21. package/Ellipse.config.js +443 -774
  22. package/Ellipse.config.js.map +7 -1
  23. package/Ellipse.js +1651 -3341
  24. package/Ellipse.js.map +7 -1
  25. package/Events.config.js +207 -492
  26. package/Events.config.js.map +7 -1
  27. package/Events.js +2615 -4649
  28. package/Events.js.map +7 -1
  29. package/FillerGauge.config.js +420 -775
  30. package/FillerGauge.config.js.map +7 -1
  31. package/FillerGauge.js +2137 -4578
  32. package/FillerGauge.js.map +7 -1
  33. package/Image.config.js +144 -411
  34. package/Image.config.js.map +7 -1
  35. package/Image.js +1395 -3048
  36. package/Image.js.map +7 -1
  37. package/Line.config.js +1278 -1625
  38. package/Line.config.js.map +7 -1
  39. package/Line.js +2957 -4919
  40. package/Line.js.map +7 -1
  41. package/LinkGraph.config.js +390 -632
  42. package/LinkGraph.config.js.map +7 -1
  43. package/LinkGraph.js +5243 -6190
  44. package/LinkGraph.js.map +7 -1
  45. package/MIGRATION.md +12 -0
  46. package/Map.config.js +501 -801
  47. package/Map.config.js.map +7 -1
  48. package/Map.js +3369 -5676
  49. package/Map.js.map +7 -1
  50. package/Markdown.config.js +232 -528
  51. package/Markdown.config.js.map +7 -1
  52. package/Markdown.js +1645 -3216
  53. package/Markdown.js.map +7 -1
  54. package/MarkerGauge.config.js +308 -613
  55. package/MarkerGauge.config.js.map +7 -1
  56. package/MarkerGauge.js +2189 -4535
  57. package/MarkerGauge.js.map +7 -1
  58. package/ParallelCoordinates.config.js +282 -581
  59. package/ParallelCoordinates.config.js.map +7 -1
  60. package/ParallelCoordinates.js +2023 -4720
  61. package/ParallelCoordinates.js.map +7 -1
  62. package/Pie.config.js +278 -547
  63. package/Pie.config.js.map +7 -1
  64. package/Pie.js +1998 -3982
  65. package/Pie.js.map +7 -1
  66. package/Punchcard.config.js +291 -578
  67. package/Punchcard.config.js.map +7 -1
  68. package/Punchcard.js +2709 -5042
  69. package/Punchcard.js.map +7 -1
  70. package/Rectangle.config.js +455 -770
  71. package/Rectangle.config.js.map +7 -1
  72. package/Rectangle.js +1638 -3262
  73. package/Rectangle.js.map +7 -1
  74. package/Sankey.config.js +291 -626
  75. package/Sankey.config.js.map +7 -1
  76. package/Sankey.js +2737 -4909
  77. package/Sankey.js.map +7 -1
  78. package/Scatter.config.js +876 -1194
  79. package/Scatter.config.js.map +7 -1
  80. package/Scatter.js +2532 -4470
  81. package/Scatter.js.map +7 -1
  82. package/SingleValue.config.js +819 -1251
  83. package/SingleValue.config.js.map +7 -1
  84. package/SingleValue.js +4203 -7413
  85. package/SingleValue.js.map +7 -1
  86. package/SingleValueBasic.js +382 -1527
  87. package/SingleValueBasic.js.map +7 -1
  88. package/SingleValueIcon.config.js +781 -1207
  89. package/SingleValueIcon.config.js.map +7 -1
  90. package/SingleValueIcon.js +3350 -6285
  91. package/SingleValueIcon.js.map +7 -1
  92. package/SingleValueRadial.config.js +708 -1119
  93. package/SingleValueRadial.config.js.map +7 -1
  94. package/SingleValueRadial.js +3808 -6965
  95. package/SingleValueRadial.js.map +7 -1
  96. package/SparkLine.js +439 -746
  97. package/SparkLine.js.map +7 -1
  98. package/Table.config.js +565 -887
  99. package/Table.config.js.map +7 -1
  100. package/Table.js +3277 -5386
  101. package/Table.js.map +7 -1
  102. package/common/Charting.js +484 -1462
  103. package/common/Charting.js.map +7 -1
  104. package/common/ChartingApi.js +46 -170
  105. package/common/ChartingApi.js.map +7 -1
  106. package/common/DocExampleWithVizSandbox.js +270 -473
  107. package/common/DocExampleWithVizSandbox.js.map +7 -1
  108. package/common/EventsDoc.js +172 -464
  109. package/common/EventsDoc.js.map +7 -1
  110. package/common/GaugeMajorTicks.js +249 -347
  111. package/common/GaugeMajorTicks.js.map +7 -1
  112. package/common/GaugeValueMarker.js +201 -311
  113. package/common/GaugeValueMarker.js.map +7 -1
  114. package/common/OptionsDoc.js +347 -912
  115. package/common/OptionsDoc.js.map +7 -1
  116. package/common/OverviewDoc.js +435 -769
  117. package/common/OverviewDoc.js.map +7 -1
  118. package/common/SplunkVisualization.js +116 -259
  119. package/common/SplunkVisualization.js.map +7 -1
  120. package/common/SplunkVisualizationApi.js +40 -156
  121. package/common/SplunkVisualizationApi.js.map +7 -1
  122. package/common/ThemesDoc.js +271 -420
  123. package/common/ThemesDoc.js.map +7 -1
  124. package/common/chartingUtils.js +140 -312
  125. package/common/chartingUtils.js.map +7 -1
  126. package/common/docUtils.js +148 -266
  127. package/common/docUtils.js.map +7 -1
  128. package/common/gaugeUtils.js +280 -808
  129. package/common/gaugeUtils.js.map +7 -1
  130. package/common/shapeUtils.js +106 -211
  131. package/common/shapeUtils.js.map +7 -1
  132. package/common/utils/configUtils.js +126 -252
  133. package/common/utils/configUtils.js.map +7 -1
  134. package/common/utils/dataUtils.js +217 -812
  135. package/common/utils/dataUtils.js.map +7 -1
  136. package/common/utils/featureFlagUtils.js +53 -133
  137. package/common/utils/featureFlagUtils.js.map +7 -1
  138. package/common/utils/hocUtils.js +32 -122
  139. package/common/utils/hocUtils.js.map +7 -1
  140. package/common/utils/mapUtils.js +502 -1337
  141. package/common/utils/mapUtils.js.map +7 -1
  142. package/common/utils/singleValueUtils.js +462 -1010
  143. package/common/utils/singleValueUtils.js.map +7 -1
  144. package/common/utils/testHelper.js +92 -146
  145. package/common/utils/testHelper.js.map +7 -1
  146. package/common/utils/trellisUtils.js +237 -489
  147. package/common/utils/trellisUtils.js.map +7 -1
  148. package/common/utils/urlUtils.js +28 -112
  149. package/common/utils/urlUtils.js.map +7 -1
  150. package/common/withDashboardViz.js +1168 -2438
  151. package/common/withDashboardViz.js.map +7 -1
  152. package/package.json +52 -43
@@ -1,921 +1,519 @@
1
- /*!
2
- * Copyright © 2024 Splunk Inc.
3
- * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
- * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
- */
6
- module.exports =
7
- /******/ (function(modules) { // webpackBootstrap
8
- /******/ // The module cache
9
- /******/ var installedModules = {};
10
- /******/
11
- /******/ // The require function
12
- /******/ function __webpack_require__(moduleId) {
13
- /******/
14
- /******/ // Check if module is in cache
15
- /******/ if(installedModules[moduleId]) {
16
- /******/ return installedModules[moduleId].exports;
17
- /******/ }
18
- /******/ // Create a new module (and put it into the cache)
19
- /******/ var module = installedModules[moduleId] = {
20
- /******/ i: moduleId,
21
- /******/ l: false,
22
- /******/ exports: {}
23
- /******/ };
24
- /******/
25
- /******/ // Execute the module function
26
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
27
- /******/
28
- /******/ // Flag the module as loaded
29
- /******/ module.l = true;
30
- /******/
31
- /******/ // Return the exports of the module
32
- /******/ return module.exports;
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 = 66);
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
- exports.insertLayout = insertLayout;
266
-
267
- /***/ }),
268
- /* 4 */
269
- /***/ (function(module, exports) {
270
-
271
- module.exports = require("@splunk/visualizations-shared/configUtils");
272
-
273
- /***/ }),
274
- /* 5 */
275
- /***/ (function(module, exports) {
276
-
277
- module.exports = require("lodash");
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/SingleValue/config.ts
51
+ var config_exports = {};
52
+ __export(config_exports, {
53
+ default: () => config_default
288
54
  });
289
- exports.VizBehavior = void 0;
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__) {
321
-
322
- "use strict";
323
-
55
+ module.exports = __toCommonJS(config_exports);
324
56
 
325
- Object.defineProperty(exports, "__esModule", {
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
- exports.VizCategory = void 0;
329
- var VizCategory;
330
-
331
- (function (VizCategory) {
332
- VizCategory["SINGLE_VALUE"] = "Single Value";
333
- VizCategory["TRENDS"] = "Trends";
334
- VizCategory["COMPARISONS"] = "Comparisons";
335
- VizCategory["TABLE"] = "Table";
336
- VizCategory["GAUGE"] = "Gauge";
337
- VizCategory["DISTRIBUTIONS"] = "Distributions";
338
- VizCategory["CHOROPLETH"] = "Choropleth Maps";
339
- VizCategory["SHAPES"] = "Shapes";
340
- VizCategory["MISC"] = "misc";
341
- VizCategory["FLOW"] = "Flow";
342
- VizCategory["CORRELATION"] = "Correlation";
343
- VizCategory["SPATIAL"] = "Spatial";
344
- })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
345
-
346
- /***/ }),
347
- /* 8 */
348
- /***/ (function(module, exports) {
349
-
350
- module.exports = require("@splunk/themes/pick");
351
-
352
- /***/ }),
353
- /* 9 */
354
- /***/ (function(module, exports) {
355
-
356
- module.exports = require("@splunk/themes/variables");
357
-
358
- /***/ }),
359
- /* 10 */
360
- /***/ (function(module, exports) {
361
-
362
- module.exports = require("@splunk/visualization-icons/placeholders");
363
-
364
- /***/ }),
365
- /* 11 */
366
- /***/ (function(module, exports) {
367
-
368
- module.exports = require("@splunk/visualization-icons");
369
-
370
- /***/ }),
371
- /* 12 */,
372
- /* 13 */
373
- /***/ (function(module, exports) {
374
-
375
- module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
376
-
377
- /***/ }),
378
- /* 14 */,
379
- /* 15 */,
380
- /* 16 */,
381
- /* 17 */,
382
- /* 18 */,
383
- /* 19 */,
384
- /* 20 */,
385
- /* 21 */,
386
- /* 22 */
387
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
388
-
389
- "use strict";
390
- __webpack_require__.r(__webpack_exports__);
391
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
392
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
393
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
394
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
395
-
396
-
397
- var StaticBackgroundColorEditor = {
398
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Background color'),
399
- option: 'backgroundColor',
400
- editor: 'editor.color',
401
- showEditor: function showEditor(_ref) {
402
- var options = _ref.options;
403
- return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
404
- }
405
- };
406
- /* harmony default export */ __webpack_exports__["default"] = (StaticBackgroundColorEditor);
407
-
408
- /***/ }),
409
- /* 23 */,
410
- /* 24 */
411
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
412
-
413
- "use strict";
414
- __webpack_require__.r(__webpack_exports__);
415
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicTrendColorEditor", function() { return getDynamicTrendColorEditor; });
416
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
417
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
418
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
419
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
420
-
421
-
422
- var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
423
- var defaultContext = _ref.defaultContext,
424
- defaultPalettesConfig = _ref.defaultPalettesConfig;
425
- return {
426
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
427
- option: 'trendColor',
428
- context: 'trendColorEditorConfig',
429
- editor: 'editor.dynamicColor',
430
- showEditor: function showEditor(_ref2) {
431
- var options = _ref2.options;
432
- 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/visualization-themes/variables
85
+ var variables_exports = {};
86
+ __export(variables_exports, {
87
+ default: () => variables_default
88
+ });
89
+ var defaultImport4 = __toESM(require("@splunk/visualization-themes/variables"));
90
+ __reExport(variables_exports, require("@splunk/visualization-themes/variables"));
91
+ var variables_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
92
+
93
+ // esm-externals:@splunk/themes/pick
94
+ var pick_exports = {};
95
+ __export(pick_exports, {
96
+ default: () => pick_default
97
+ });
98
+ var defaultImport5 = __toESM(require("@splunk/themes/pick"));
99
+ __reExport(pick_exports, require("@splunk/themes/pick"));
100
+ var pick_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
101
+
102
+ // esm-externals:@splunk/themes/variables
103
+ var variables_exports2 = {};
104
+ __export(variables_exports2, {
105
+ default: () => variables_default2
106
+ });
107
+ var defaultImport6 = __toESM(require("@splunk/themes/variables"));
108
+ __reExport(variables_exports2, require("@splunk/themes/variables"));
109
+ var variables_default2 = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
110
+
111
+ // esm-externals:@splunk/visualization-icons
112
+ var visualization_icons_exports = {};
113
+ __export(visualization_icons_exports, {
114
+ default: () => visualization_icons_default
115
+ });
116
+ var defaultImport7 = __toESM(require("@splunk/visualization-icons"));
117
+ __reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
118
+ var visualization_icons_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
119
+
120
+ // esm-externals:@splunk/visualization-icons/placeholders
121
+ var placeholders_exports = {};
122
+ __export(placeholders_exports, {
123
+ default: () => placeholders_default
124
+ });
125
+ var defaultImport8 = __toESM(require("@splunk/visualization-icons/placeholders"));
126
+ __reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
127
+ var placeholders_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
128
+
129
+ // src/common/configContext/singleValueContext.ts
130
+ var defaultContext = {
131
+ trendColorConfig: [
132
+ {
133
+ to: 0,
134
+ value: "#9E2520"
433
135
  },
434
- editorProps: {
435
- labelPosition: 'top',
436
- flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: trend value'),
437
- formatters: [{
438
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
439
- value: 'rangeValue',
440
- defaults: {
441
- trendValue: defaultContext.trendColorConfig
442
- }
443
- }],
444
- dataSelectors: [{
445
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
446
- value: 'trendValue'
447
- }],
448
- defaultPalettesConfig: defaultPalettesConfig
136
+ {
137
+ from: 0,
138
+ value: "#1C6B2D"
449
139
  }
450
- };
140
+ ],
141
+ majorColorConfig: [
142
+ { to: 20, value: "#D41F1F" },
143
+ { from: 20, to: 40, value: "#D94E17" },
144
+ { from: 40, to: 60, value: "#CBA700" },
145
+ { from: 60, to: 80, value: "#669922" },
146
+ { from: 80, value: "#118832" }
147
+ ],
148
+ majorColorMatchConfig: [{ match: "", value: "#5C33FF" }]
451
149
  };
452
150
 
453
- /***/ }),
454
- /* 25 */
455
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
456
-
457
- "use strict";
458
- __webpack_require__.r(__webpack_exports__);
459
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicBackgroundColorEditor", function() { return getDynamicBackgroundColorEditor; });
460
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
461
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
462
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
463
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
464
-
465
-
466
- var getDynamicBackgroundColorEditor = function getDynamicBackgroundColorEditor(_ref) {
467
- var defaultContext = _ref.defaultContext,
468
- defaultPalettesConfig = _ref.defaultPalettesConfig;
469
- return {
470
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Background color'),
471
- option: 'backgroundColor',
472
- context: 'backgroundColorEditorConfig',
473
- editor: 'editor.dynamicColor',
474
- showEditor: function showEditor(_ref2) {
475
- var options = _ref2.options;
476
- return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
477
- },
478
- editorProps: {
479
- labelPosition: 'top',
480
- flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: background'),
481
- formatters: [{
482
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
483
- value: 'rangeValue',
151
+ // esm-externals:@splunk/visualizations-shared/configUtils
152
+ var configUtils_exports = {};
153
+ __export(configUtils_exports, {
154
+ default: () => configUtils_default
155
+ });
156
+ var defaultImport9 = __toESM(require("@splunk/visualizations-shared/configUtils"));
157
+ __reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
158
+ var configUtils_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
159
+
160
+ // src/common/editorConfig/DynamicMajorColorEditor.js
161
+ var getDynamicMajorColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
162
+ label: (0, i18n_exports._)("Major value"),
163
+ option: "majorColor",
164
+ context: "majorColorEditorConfig",
165
+ editor: "editor.dynamicColor",
166
+ showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.majorColor),
167
+ editorProps: {
168
+ labelPosition: "top",
169
+ flyoutTitle: (0, i18n_exports._)("Dynamic coloring: major value"),
170
+ formatters: [
171
+ {
172
+ label: (0, i18n_exports._)("Ranges"),
173
+ value: "rangeValue",
484
174
  defaults: {
485
- majorValue: defaultContext.majorColorConfig,
486
- trendValue: defaultContext.trendColorConfig
175
+ majorValue: defaultContext2.majorColorConfig
487
176
  }
488
- }, {
489
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Matches'),
490
- value: 'matchValue',
177
+ },
178
+ {
179
+ label: (0, i18n_exports._)("Matches"),
180
+ value: "matchValue",
491
181
  defaults: {
492
- majorValue: defaultContext.majorColorMatchConfig
182
+ majorValue: defaultContext2.majorColorMatchConfig
493
183
  }
494
- }],
495
- dataSelectors: [{
496
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major Value'),
497
- value: 'majorValue'
498
- }, {
499
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend'),
500
- value: 'trendValue'
501
- }],
502
- defaultPalettesConfig: defaultPalettesConfig
503
- }
504
- };
505
- };
506
-
507
- /***/ }),
508
- /* 26 */
509
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
510
-
511
- "use strict";
512
- __webpack_require__.r(__webpack_exports__);
513
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
514
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
184
+ }
185
+ ],
186
+ dataSelectors: [
187
+ {
188
+ label: (0, i18n_exports._)("Major value"),
189
+ value: "majorValue"
190
+ }
191
+ ],
192
+ defaultPalettesConfig: defaultPalettesConfig2
193
+ }
194
+ });
515
195
 
516
- var StaticMajorAndTrendLayout = [[{
517
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Unit position'),
518
- // todo: we need a new editor combining unit and position
519
- option: 'unitPosition',
520
- editor: 'editor.select',
196
+ // src/common/editorConfig/DynamicTrendColorEditor.js
197
+ var getDynamicTrendColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
198
+ label: (0, i18n_exports._)("Trend value"),
199
+ option: "trendColor",
200
+ context: "trendColorEditorConfig",
201
+ editor: "editor.dynamicColor",
202
+ showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.trendColor),
521
203
  editorProps: {
522
- values: [{
523
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Before'),
524
- value: 'before'
525
- }, {
526
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('After'),
527
- value: 'after'
528
- }]
529
- },
530
- showEditor: function showEditor(_ref) {
531
- var options = _ref.options;
532
- return options.showValue || options.showValue === undefined;
533
- }
534
- }, {
535
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Unit label'),
536
- option: 'unit',
537
- editor: 'editor.text',
538
- showEditor: function showEditor(_ref2) {
539
- var options = _ref2.options;
540
- return options.showValue || options.showValue === undefined;
204
+ labelPosition: "top",
205
+ flyoutTitle: (0, i18n_exports._)("Dynamic coloring: trend value"),
206
+ formatters: [
207
+ {
208
+ label: (0, i18n_exports._)("Ranges"),
209
+ value: "rangeValue",
210
+ defaults: {
211
+ trendValue: defaultContext2.trendColorConfig
212
+ }
213
+ }
214
+ ],
215
+ dataSelectors: [
216
+ {
217
+ label: (0, i18n_exports._)("Trend value"),
218
+ value: "trendValue"
219
+ }
220
+ ],
221
+ defaultPalettesConfig: defaultPalettesConfig2
541
222
  }
542
- }], [{
543
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Precision'),
544
- option: 'numberPrecision',
545
- editor: 'editor.number',
223
+ });
224
+
225
+ // src/common/editorConfig/DynamicBackgroundColorEditor.js
226
+ var getDynamicBackgroundColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
227
+ label: (0, i18n_exports._)("Background color"),
228
+ option: "backgroundColor",
229
+ context: "backgroundColorEditorConfig",
230
+ editor: "editor.dynamicColor",
231
+ showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.backgroundColor),
546
232
  editorProps: {
547
- min: 0,
548
- max: 20
549
- },
550
- showEditor: function showEditor(_ref3) {
551
- var options = _ref3.options;
552
- return options.showValue || options.showValue === undefined;
233
+ labelPosition: "top",
234
+ flyoutTitle: (0, i18n_exports._)("Dynamic coloring: background"),
235
+ formatters: [
236
+ {
237
+ label: (0, i18n_exports._)("Ranges"),
238
+ value: "rangeValue",
239
+ defaults: {
240
+ majorValue: defaultContext2.majorColorConfig,
241
+ trendValue: defaultContext2.trendColorConfig
242
+ }
243
+ },
244
+ {
245
+ label: (0, i18n_exports._)("Matches"),
246
+ value: "matchValue",
247
+ defaults: {
248
+ majorValue: defaultContext2.majorColorMatchConfig
249
+ }
250
+ }
251
+ ],
252
+ dataSelectors: [
253
+ {
254
+ label: (0, i18n_exports._)("Major Value"),
255
+ value: "majorValue"
256
+ },
257
+ {
258
+ label: (0, i18n_exports._)("Trend"),
259
+ value: "trendValue"
260
+ }
261
+ ],
262
+ defaultPalettesConfig: defaultPalettesConfig2
553
263
  }
554
- }]];
555
- /* harmony default export */ __webpack_exports__["default"] = (StaticMajorAndTrendLayout);
556
-
557
- /***/ }),
558
- /* 27 */
559
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
560
-
561
- "use strict";
562
- __webpack_require__.r(__webpack_exports__);
563
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
564
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
565
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
566
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
264
+ });
567
265
 
266
+ // src/common/editorConfig/StaticMajorAndTrendLayout.js
267
+ var StaticMajorAndTrendLayout = [
268
+ [
269
+ {
270
+ label: (0, i18n_exports._)("Unit position"),
271
+ // todo: we need a new editor combining unit and position
272
+ option: "unitPosition",
273
+ editor: "editor.select",
274
+ editorProps: {
275
+ values: [
276
+ { label: (0, i18n_exports._)("Before"), value: "before" },
277
+ { label: (0, i18n_exports._)("After"), value: "after" }
278
+ ]
279
+ },
280
+ showEditor: ({ options }) => options.showValue || options.showValue === void 0
281
+ },
282
+ {
283
+ label: (0, i18n_exports._)("Unit label"),
284
+ option: "unit",
285
+ editor: "editor.text",
286
+ showEditor: ({ options }) => options.showValue || options.showValue === void 0
287
+ }
288
+ ],
289
+ [
290
+ {
291
+ label: (0, i18n_exports._)("Precision"),
292
+ option: "numberPrecision",
293
+ editor: "editor.number",
294
+ editorProps: {
295
+ min: 0,
296
+ max: 20
297
+ },
298
+ showEditor: ({ options }) => options.showValue || options.showValue === void 0
299
+ }
300
+ ]
301
+ ];
302
+ var StaticMajorAndTrendLayout_default = StaticMajorAndTrendLayout;
568
303
 
304
+ // src/common/editorConfig/StaticMajorColorEditor.js
569
305
  var StaticMajorColorEditor = {
570
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
571
- option: 'majorColor',
572
- editor: 'editor.color',
573
- showEditor: function showEditor(_ref) {
574
- var options = _ref.options;
575
- return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
576
- }
306
+ label: (0, i18n_exports._)("Major value"),
307
+ option: "majorColor",
308
+ editor: "editor.color",
309
+ showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.majorColor)
577
310
  };
578
- /* harmony default export */ __webpack_exports__["default"] = (StaticMajorColorEditor);
579
-
580
- /***/ }),
581
- /* 28 */
582
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
583
-
584
- "use strict";
585
- __webpack_require__.r(__webpack_exports__);
586
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
587
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
588
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
589
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
590
-
311
+ var StaticMajorColorEditor_default = StaticMajorColorEditor;
591
312
 
313
+ // src/common/editorConfig/StaticTrendColorEditor.js
592
314
  var StaticTrendColorEditor = {
593
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
594
- option: 'trendColor',
595
- editor: 'editor.color',
596
- showEditor: function showEditor(_ref) {
597
- var options = _ref.options;
598
- return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.trendColor);
599
- },
600
- isDisabled: function isDisabled(_ref2) {
601
- var options = _ref2.options;
602
- return options.trendDisplay === 'off';
603
- }
315
+ label: (0, i18n_exports._)("Trend value"),
316
+ option: "trendColor",
317
+ editor: "editor.color",
318
+ showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.trendColor),
319
+ isDisabled: ({ options }) => options.trendDisplay === "off"
604
320
  };
605
- /* harmony default export */ __webpack_exports__["default"] = (StaticTrendColorEditor);
606
-
607
- /***/ }),
608
- /* 29 */
609
- /***/ (function(module, exports, __webpack_require__) {
610
-
611
- "use strict";
612
-
613
-
614
- Object.defineProperty(exports, "__esModule", {
615
- value: true
616
- });
617
- exports.TrellisBackgroundColorEditor = exports.TrellisEditorConfig = void 0;
618
-
619
- var React = __webpack_require__(30);
620
-
621
- var i18n_1 = __webpack_require__(0);
622
-
623
- var FeatureFlagContext_1 = __webpack_require__(31);
624
-
625
- var visualization_schemas_1 = __webpack_require__(2);
626
- /* eslint-disable react-hooks/rules-of-hooks */
321
+ var StaticTrendColorEditor_default = StaticTrendColorEditor;
627
322
 
628
-
629
- exports.TrellisEditorConfig = [[{
630
- label: (0, i18n_1._)('Trellis layout'),
631
- option: 'splitByLayout',
632
- editor: 'editor.toggle',
633
- showEditor: function showEditor() {
634
- var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
635
- var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
636
- return isTrellisFeatureFlagOn;
637
- }
638
- }], [{
639
- label: (0, i18n_1._)('Split by'),
640
- option: 'trellisSplitBy',
641
- editor: 'editor.trellisSplitBy',
642
- editorProps: {
643
- dataSourceKey: 'primary'
644
- },
645
- showEditor: function showEditor(_ref) {
646
- var options = _ref.options;
647
- var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
648
- var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
649
- return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
650
- }
651
- }], [{
652
- label: (0, i18n_1._)('Number of columns'),
653
- option: 'trellisColumns',
654
- editor: 'editor.number',
655
- editorProps: {
656
- min: 1
657
- },
658
- placeholder: (0, i18n_1._)('Auto'),
659
- showEditor: function showEditor(_ref2) {
660
- var options = _ref2.options;
661
- var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
662
- var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
663
- return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
664
- }
665
- }], [{
666
- label: (0, i18n_1._)('Min column width'),
667
- option: 'trellisMinColumnWidth',
668
- editor: 'editor.number',
669
- editorProps: {
670
- min: 1
671
- },
672
- showEditor: function showEditor(_ref3) {
673
- var options = _ref3.options;
674
- var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
675
- var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
676
- return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
677
- }
678
- }, {
679
- label: (0, i18n_1._)('Row height'),
680
- option: 'trellisRowHeight',
681
- editor: 'editor.number',
682
- editorProps: {
683
- min: 1
684
- },
685
- showEditor: function showEditor(_ref4) {
686
- var options = _ref4.options;
687
- var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
688
- var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
689
- return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
690
- }
691
- }], [{
692
- label: (0, i18n_1._)('Max number of components per page'),
693
- option: 'trellisPageCount',
694
- editor: 'editor.number',
695
- editorProps: {
696
- min: 1
697
- },
698
- showEditor: function showEditor(_ref5) {
699
- var options = _ref5.options;
700
- var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
701
- var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
702
- return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
703
- }
704
- }]];
705
- exports.TrellisBackgroundColorEditor = {
706
- label: (0, i18n_1._)('Trellis background'),
707
- option: 'trellisBackgroundColor',
708
- editor: 'editor.color',
709
- showEditor: function showEditor(_ref6) {
710
- var options = _ref6.options;
711
- var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
712
- var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
713
- return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
714
- }
323
+ // src/common/editorConfig/StaticBackgroundColorEditor.js
324
+ var StaticBackgroundColorEditor = {
325
+ label: (0, i18n_exports._)("Background color"),
326
+ option: "backgroundColor",
327
+ editor: "editor.color",
328
+ showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.backgroundColor)
715
329
  };
330
+ var StaticBackgroundColorEditor_default = StaticBackgroundColorEditor;
716
331
 
717
- /***/ }),
718
- /* 30 */
719
- /***/ (function(module, exports) {
720
-
721
- module.exports = require("react");
722
-
723
- /***/ }),
724
- /* 31 */
725
- /***/ (function(module, exports) {
726
-
727
- module.exports = require("@splunk/visualization-context/FeatureFlagContext");
728
-
729
- /***/ }),
730
- /* 32 */,
731
- /* 33 */,
732
- /* 34 */,
733
- /* 35 */,
734
- /* 36 */,
735
- /* 37 */
736
- /***/ (function(module, exports, __webpack_require__) {
737
-
738
- "use strict";
739
-
740
-
741
- Object.defineProperty(exports, "__esModule", {
742
- value: true
332
+ // esm-externals:lodash
333
+ var lodash_exports = {};
334
+ __export(lodash_exports, {
335
+ default: () => lodash_default
743
336
  });
744
- exports.defaultContext = void 0;
745
- exports.defaultContext = {
746
- trendColorConfig: [{
747
- to: 0,
748
- value: '#9E2520'
749
- }, {
750
- from: 0,
751
- value: '#1C6B2D'
752
- }],
753
- majorColorConfig: [{
754
- to: 20,
755
- value: '#D41F1F'
756
- }, {
757
- from: 20,
758
- to: 40,
759
- value: '#D94E17'
760
- }, {
761
- from: 40,
762
- to: 60,
763
- value: '#CBA700'
764
- }, {
765
- from: 60,
766
- to: 80,
767
- value: '#669922'
768
- }, {
769
- from: 80,
770
- value: '#118832'
771
- }],
772
- majorColorMatchConfig: [{
773
- match: '',
774
- value: '#5C33FF'
775
- }]
776
- };
777
-
778
- /***/ }),
779
- /* 38 */
780
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
781
-
782
- "use strict";
783
- __webpack_require__.r(__webpack_exports__);
784
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicMajorColorEditor", function() { return getDynamicMajorColorEditor; });
785
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
786
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
787
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
788
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
337
+ var defaultImport10 = __toESM(require("lodash"));
338
+ __reExport(lodash_exports, require("lodash"));
339
+ var lodash_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
789
340
 
341
+ // src/common/utils/configUtils.ts
342
+ function enhanceConfig(vizConfig) {
343
+ const enhancedConfig = __spreadValues({}, vizConfig);
344
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(
345
+ (config2) => {
346
+ return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
347
+ }
348
+ );
349
+ return enhancedConfig;
350
+ }
351
+ function hasCompatibleContexts(vizContext, presetContext) {
352
+ const presetContextKeys = Object.keys(presetContext);
353
+ return presetContextKeys.every(
354
+ (contextKey) => presetContext[contextKey] === void 0 && vizContext[contextKey] === void 0 || presetContext[contextKey] !== void 0 && vizContext[contextKey] !== void 0
355
+ );
356
+ }
357
+ function hasCompatibleOptions(vizOptions, presetOptions) {
358
+ const presetOptionKeys = Object.keys(presetOptions);
359
+ return presetOptionKeys.every(
360
+ (optionKey) => (0, configUtils_exports.isDynamicOption)(presetOptions[optionKey]) === (0, configUtils_exports.isDynamicOption)(vizOptions[optionKey])
361
+ );
362
+ }
363
+ function getInitialPreset(vizContext, vizOptions, presets2) {
364
+ return presets2.find((preset) => {
365
+ const presetContext = (0, lodash_exports.get)(preset, ["value", "context"], {});
366
+ const presetOptions = (0, lodash_exports.get)(preset, ["value", "options"], {});
367
+ const presetContextKeys = Object.keys(presetContext);
368
+ const presetOptionKeys = Object.keys(presetOptions);
369
+ if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
370
+ return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
371
+ });
372
+ }
790
373
 
791
- var getDynamicMajorColorEditor = function getDynamicMajorColorEditor(_ref) {
792
- var defaultContext = _ref.defaultContext,
793
- defaultPalettesConfig = _ref.defaultPalettesConfig;
794
- return {
795
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
796
- option: 'majorColor',
797
- context: 'majorColorEditorConfig',
798
- editor: 'editor.dynamicColor',
799
- showEditor: function showEditor(_ref2) {
800
- var options = _ref2.options;
801
- return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
374
+ // esm-externals:react
375
+ var react_exports = {};
376
+ __export(react_exports, {
377
+ default: () => react_default
378
+ });
379
+ var defaultImport11 = __toESM(require("react"));
380
+ __reExport(react_exports, require("react"));
381
+ var react_default = "default" in defaultImport11 ? defaultImport11.default : defaultImport11;
382
+
383
+ // esm-externals:@splunk/visualization-context/FeatureFlagContext
384
+ var FeatureFlagContext_exports = {};
385
+ __export(FeatureFlagContext_exports, {
386
+ default: () => FeatureFlagContext_default
387
+ });
388
+ var defaultImport12 = __toESM(require("@splunk/visualization-context/FeatureFlagContext"));
389
+ __reExport(FeatureFlagContext_exports, require("@splunk/visualization-context/FeatureFlagContext"));
390
+ var FeatureFlagContext_default = "default" in defaultImport12 ? defaultImport12.default : defaultImport12;
391
+
392
+ // src/common/editorConfig/TrellisEditors.ts
393
+ var TrellisEditorConfig = [
394
+ [
395
+ {
396
+ label: (0, i18n_exports._)("Trellis layout"),
397
+ option: "splitByLayout",
398
+ editor: "editor.toggle",
399
+ showEditor: () => {
400
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
401
+ const isTrellisFeatureFlagOn = Boolean(
402
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
403
+ );
404
+ return isTrellisFeatureFlagOn;
405
+ }
406
+ }
407
+ ],
408
+ [
409
+ {
410
+ label: (0, i18n_exports._)("Split by"),
411
+ option: "trellisSplitBy",
412
+ editor: "editor.trellisSplitBy",
413
+ editorProps: {
414
+ dataSourceKey: "primary"
415
+ },
416
+ showEditor: ({ options }) => {
417
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
418
+ const isTrellisFeatureFlagOn = Boolean(
419
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
420
+ );
421
+ return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
422
+ }
423
+ }
424
+ ],
425
+ [
426
+ {
427
+ label: (0, i18n_exports._)("Number of columns"),
428
+ option: "trellisColumns",
429
+ editor: "editor.number",
430
+ editorProps: {
431
+ min: 1
432
+ },
433
+ placeholder: (0, i18n_exports._)("Auto"),
434
+ showEditor: ({ options }) => {
435
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
436
+ const isTrellisFeatureFlagOn = Boolean(
437
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
438
+ );
439
+ return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
440
+ }
441
+ }
442
+ ],
443
+ [
444
+ {
445
+ label: (0, i18n_exports._)("Min column width"),
446
+ option: "trellisMinColumnWidth",
447
+ editor: "editor.number",
448
+ editorProps: {
449
+ min: 1
450
+ },
451
+ showEditor: ({ options }) => {
452
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
453
+ const isTrellisFeatureFlagOn = Boolean(
454
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
455
+ );
456
+ return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
457
+ }
802
458
  },
803
- editorProps: {
804
- labelPosition: 'top',
805
- flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: major value'),
806
- formatters: [{
807
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
808
- value: 'rangeValue',
809
- defaults: {
810
- majorValue: defaultContext.majorColorConfig
811
- }
812
- }, {
813
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Matches'),
814
- value: 'matchValue',
815
- defaults: {
816
- majorValue: defaultContext.majorColorMatchConfig
817
- }
818
- }],
819
- dataSelectors: [{
820
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
821
- value: 'majorValue'
822
- }],
823
- defaultPalettesConfig: defaultPalettesConfig
459
+ {
460
+ label: (0, i18n_exports._)("Row height"),
461
+ option: "trellisRowHeight",
462
+ editor: "editor.number",
463
+ editorProps: {
464
+ min: 1
465
+ },
466
+ showEditor: ({ options }) => {
467
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
468
+ const isTrellisFeatureFlagOn = Boolean(
469
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
470
+ );
471
+ return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
472
+ }
473
+ }
474
+ ],
475
+ [
476
+ {
477
+ label: (0, i18n_exports._)("Max number of components per page"),
478
+ option: "trellisPageCount",
479
+ editor: "editor.number",
480
+ editorProps: {
481
+ min: 1
482
+ },
483
+ showEditor: ({ options }) => {
484
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
485
+ const isTrellisFeatureFlagOn = Boolean(
486
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
487
+ );
488
+ return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
489
+ }
824
490
  }
825
- };
491
+ ]
492
+ ];
493
+ var TrellisBackgroundColorEditor = {
494
+ label: (0, i18n_exports._)("Trellis background"),
495
+ option: "trellisBackgroundColor",
496
+ editor: "editor.color",
497
+ showEditor: ({ options }) => {
498
+ const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
499
+ const isTrellisFeatureFlagOn = Boolean(
500
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
501
+ );
502
+ return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
503
+ }
826
504
  };
827
505
 
828
- /***/ }),
829
- /* 39 */,
830
- /* 40 */,
831
- /* 41 */,
832
- /* 42 */,
833
- /* 43 */,
834
- /* 44 */,
835
- /* 45 */,
836
- /* 46 */,
837
- /* 47 */,
838
- /* 48 */,
839
- /* 49 */,
840
- /* 50 */,
841
- /* 51 */,
842
- /* 52 */,
843
- /* 53 */,
844
- /* 54 */,
845
- /* 55 */,
846
- /* 56 */,
847
- /* 57 */,
848
- /* 58 */,
849
- /* 59 */,
850
- /* 60 */,
851
- /* 61 */,
852
- /* 62 */,
853
- /* 63 */,
854
- /* 64 */,
855
- /* 65 */,
856
- /* 66 */
857
- /***/ (function(module, exports, __webpack_require__) {
858
-
859
- "use strict";
860
-
861
-
862
- var _toConsumableArray = __webpack_require__(1);
863
-
864
- Object.defineProperty(exports, "__esModule", {
865
- value: true
866
- });
867
-
868
- var i18n_1 = __webpack_require__(0);
869
-
870
- var visualization_schemas_1 = __webpack_require__(2);
871
-
872
- var PresetPalettes_1 = __webpack_require__(13);
873
-
874
- var variables_1 = __webpack_require__(67);
875
-
876
- var pick_1 = __webpack_require__(8);
877
-
878
- var variables_2 = __webpack_require__(9);
879
-
880
- var visualization_icons_1 = __webpack_require__(11);
881
-
882
- var placeholders_1 = __webpack_require__(10);
883
-
884
- var singleValueContext_1 = __webpack_require__(37);
885
-
886
- var VizBehavior_1 = __webpack_require__(6);
887
-
888
- var DynamicMajorColorEditor_1 = __webpack_require__(38);
889
-
890
- var DynamicTrendColorEditor_1 = __webpack_require__(24);
891
-
892
- var DynamicBackgroundColorEditor_1 = __webpack_require__(25);
893
-
894
- var StaticMajorAndTrendLayout_1 = __webpack_require__(26);
895
-
896
- var StaticMajorColorEditor_1 = __webpack_require__(27);
897
-
898
- var StaticTrendColorEditor_1 = __webpack_require__(28);
899
-
900
- var StaticBackgroundColorEditor_1 = __webpack_require__(22);
901
-
902
- var configUtils_1 = __webpack_require__(3);
903
-
904
- var TrellisEditors_1 = __webpack_require__(29);
905
-
906
- var VizCategory_1 = __webpack_require__(7);
907
-
506
+ // src/SingleValue/config.ts
908
507
  var dataContract = {
909
- requiredDataSources: [{
910
- name: 'primary',
911
- description: 'DataSource that powers the visualization'
912
- }],
508
+ requiredDataSources: [
509
+ {
510
+ name: "primary",
511
+ description: "DataSource that powers the visualization"
512
+ }
513
+ ],
913
514
  optionalDataSources: [],
914
515
  initialRequestParams: {
915
- primary: {
916
- offset: 0,
917
- count: 10000
918
- }
516
+ primary: { offset: 0, count: 1e4 }
919
517
  }
920
518
  };
921
519
  var size = {
@@ -923,412 +521,382 @@ var size = {
923
521
  initialHeight: 250
924
522
  };
925
523
  var basePresetContext = {
926
- majorColorEditorConfig: undefined,
927
- trendColorEditorConfig: undefined,
928
- backgroundColorEditorConfig: undefined
524
+ majorColorEditorConfig: void 0,
525
+ trendColorEditorConfig: void 0,
526
+ backgroundColorEditorConfig: void 0
929
527
  };
930
528
  var basePresetOptions = {
931
- majorColor: undefined,
932
- trendColor: undefined,
933
- backgroundColor: undefined
529
+ majorColor: void 0,
530
+ trendColor: void 0,
531
+ backgroundColor: void 0
934
532
  };
935
- var presets = [{
936
- // dummy context variables to allow for resetting of unused context states
937
- label: (0, i18n_1._)('None'),
938
- name: 'singleValue.none',
939
- value: {
940
- context: Object.assign({}, basePresetContext),
941
- options: Object.assign({}, basePresetOptions)
942
- }
943
- }, {
944
- label: (0, i18n_1._)('Major value'),
945
- name: 'singleValue.majorValue',
946
- value: {
947
- context: Object.assign(Object.assign({}, basePresetContext), {
948
- majorColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
949
- }),
950
- options: Object.assign(Object.assign({}, basePresetOptions), {
951
- majorColor: '> majorValue | rangeValue(majorColorEditorConfig)'
952
- })
953
- }
954
- }, {
955
- label: (0, i18n_1._)('Trend value'),
956
- name: 'singleValue.trend',
957
- value: {
958
- context: Object.assign(Object.assign({}, basePresetContext), {
959
- trendColorEditorConfig: singleValueContext_1.defaultContext.trendColorConfig
960
- }),
961
- options: Object.assign(Object.assign({}, basePresetOptions), {
962
- trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
963
- })
964
- }
965
- }, {
966
- label: (0, i18n_1._)('Major value and Trend value'),
967
- name: 'singleValue.majorValueAndTrend',
968
- value: {
969
- context: Object.assign(Object.assign({}, basePresetContext), {
970
- majorColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig,
971
- trendColorEditorConfig: singleValueContext_1.defaultContext.trendColorConfig
972
- }),
973
- options: Object.assign(Object.assign({}, basePresetOptions), {
974
- majorColor: '> majorValue | rangeValue(majorColorEditorConfig)',
975
- trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
976
- })
977
- }
978
- }, {
979
- label: (0, i18n_1._)('Background'),
980
- name: 'singleValue.background',
981
- value: {
982
- context: Object.assign(Object.assign({}, basePresetContext), {
983
- backgroundColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
984
- }),
985
- options: Object.assign(Object.assign({}, basePresetOptions), {
986
- backgroundColor: '> majorValue | rangeValue(backgroundColorEditorConfig)'
987
- })
988
- }
989
- }]; // @TODO(pwied):
990
- // remove once react-visualizations/SV was deprecated
991
- // including unused sparklineFillColor
992
-
993
- var LIGHTMODE_SPARKLINE_AREA_COLOR = '#171D21';
994
- var DARKMODE_SPARKLINE_AREA_COLOR = '#FFFFFF';
995
- var themes = {
996
- defaultFontColor: function defaultFontColor(props) {
997
- return (0, pick_1.default)({
998
- enterprise: {
999
- dark: variables_2.default.textColor(props),
1000
- light: variables_2.default.gray20(props)
1001
- },
1002
- prisma: variables_2.default.contentColorActive(props)
1003
- })(props);
533
+ var presets = [
534
+ {
535
+ // dummy context variables to allow for resetting of unused context states
536
+ label: (0, i18n_exports._)("None"),
537
+ name: "singleValue.none",
538
+ value: {
539
+ context: __spreadValues({}, basePresetContext),
540
+ options: __spreadValues({}, basePresetOptions)
541
+ }
1004
542
  },
1005
- defaultBlockFontColor: function defaultBlockFontColor(props) {
1006
- return (0, pick_1.default)({
1007
- enterprise: variables_2.default.white(props),
1008
- prisma: variables_2.default.contentColorActive(props)
1009
- })(props);
543
+ {
544
+ label: (0, i18n_exports._)("Major value"),
545
+ name: "singleValue.majorValue",
546
+ value: {
547
+ context: __spreadProps(__spreadValues({}, basePresetContext), {
548
+ majorColorEditorConfig: defaultContext.majorColorConfig
549
+ }),
550
+ options: __spreadProps(__spreadValues({}, basePresetOptions), {
551
+ majorColor: "> majorValue | rangeValue(majorColorEditorConfig)"
552
+ })
553
+ }
1010
554
  },
1011
- defaultBackgroundColor: function defaultBackgroundColor(props) {
1012
- return (0, pick_1.default)({
1013
- enterprise: {
1014
- dark: variables_2.default.black(props),
1015
- light: variables_2.default.backgroundColor(props)
1016
- },
1017
- prisma: variables_2.default.backgroundColorSidebar(props)
1018
- })(props);
555
+ {
556
+ label: (0, i18n_exports._)("Trend value"),
557
+ name: "singleValue.trend",
558
+ value: {
559
+ context: __spreadProps(__spreadValues({}, basePresetContext), {
560
+ trendColorEditorConfig: defaultContext.trendColorConfig
561
+ }),
562
+ options: __spreadProps(__spreadValues({}, basePresetOptions), {
563
+ trendColor: "> trendValue | rangeValue(trendColorEditorConfig)"
564
+ })
565
+ }
1019
566
  },
1020
- defaultSparklineStrokeColor: function defaultSparklineStrokeColor(props) {
1021
- return (0, pick_1.default)({
1022
- enterprise: variables_2.default.textColor(props),
1023
- prisma: variables_2.default.contentColorActive(props)
1024
- })(props);
567
+ {
568
+ label: (0, i18n_exports._)("Major value and Trend value"),
569
+ name: "singleValue.majorValueAndTrend",
570
+ value: {
571
+ context: __spreadProps(__spreadValues({}, basePresetContext), {
572
+ majorColorEditorConfig: defaultContext.majorColorConfig,
573
+ trendColorEditorConfig: defaultContext.trendColorConfig
574
+ }),
575
+ options: __spreadProps(__spreadValues({}, basePresetOptions), {
576
+ majorColor: "> majorValue | rangeValue(majorColorEditorConfig)",
577
+ trendColor: "> trendValue | rangeValue(trendColorEditorConfig)"
578
+ })
579
+ }
1025
580
  },
581
+ {
582
+ label: (0, i18n_exports._)("Background"),
583
+ name: "singleValue.background",
584
+ value: {
585
+ context: __spreadProps(__spreadValues({}, basePresetContext), {
586
+ backgroundColorEditorConfig: defaultContext.majorColorConfig
587
+ }),
588
+ options: __spreadProps(__spreadValues({}, basePresetOptions), {
589
+ backgroundColor: "> majorValue | rangeValue(backgroundColorEditorConfig)"
590
+ })
591
+ }
592
+ }
593
+ ];
594
+ var themes = {
595
+ defaultFontColor: (props) => pick_default({
596
+ enterprise: {
597
+ dark: variables_default2.textColor(props),
598
+ light: variables_default2.gray20(props)
599
+ },
600
+ prisma: variables_default2.contentColorActive(props)
601
+ })(props),
602
+ defaultBlockFontColor: (props) => pick_default({
603
+ enterprise: variables_default2.white(props),
604
+ prisma: variables_default2.contentColorActive(props)
605
+ })(props),
606
+ defaultBackgroundColor: (props) => pick_default({
607
+ enterprise: {
608
+ dark: variables_default2.black(props),
609
+ light: variables_default2.backgroundColor(props)
610
+ },
611
+ prisma: variables_default2.backgroundColorSidebar(props)
612
+ })(props),
613
+ defaultSparklineStrokeColor: (props) => pick_default({
614
+ enterprise: variables_default2.textColor(props),
615
+ prisma: variables_default2.contentColorActive(props)
616
+ })(props),
1026
617
  // TODO(fkurniawan): update with SCP-36839
1027
- sparklineSeverityColors: function sparklineSeverityColors(props) {
1028
- return (0, pick_1.default)({
1029
- enterprise: {
1030
- dark: JSON.stringify({
1031
- none: {
1032
- background: variables_1.enterpriseDark.gray60,
1033
- stroke: variables_1.enterpriseDark.white
1034
- },
1035
- low: {
1036
- background: variables_1.enterpriseDark.successColorD50,
1037
- stroke: variables_1.enterpriseDark.white
1038
- },
1039
- guarded: {
1040
- background: variables_1.enterpriseDark.infoColorD50,
1041
- stroke: variables_1.enterpriseDark.white
1042
- },
1043
- elevated: {
1044
- background: variables_1.enterpriseDark.warningColorD50,
1045
- stroke: variables_1.enterpriseDark.white
1046
- },
1047
- high: {
1048
- background: variables_1.enterpriseDark.alertColorD50,
1049
- stroke: variables_1.enterpriseDark.white
1050
- },
1051
- severe: {
1052
- background: variables_1.enterpriseDark.errorColorD50,
1053
- stroke: variables_1.enterpriseDark.white
1054
- }
1055
- }),
1056
- light: JSON.stringify({
1057
- none: {
1058
- background: variables_1.enterprise.gray60,
1059
- stroke: variables_1.enterprise.gray20
1060
- },
1061
- low: {
1062
- background: variables_1.enterprise.successColorD50,
1063
- stroke: variables_1.enterprise.white
1064
- },
1065
- guarded: {
1066
- background: variables_1.enterprise.infoColorD50,
1067
- stroke: variables_1.enterprise.white
1068
- },
1069
- elevated: {
1070
- background: variables_1.enterprise.warningColorD50,
1071
- stroke: variables_1.enterprise.white
1072
- },
1073
- high: {
1074
- background: variables_1.enterprise.alertColorD50,
1075
- stroke: variables_1.enterprise.white
1076
- },
1077
- severe: {
1078
- background: variables_1.enterprise.errorColorD50,
1079
- stroke: variables_1.enterprise.white
1080
- }
1081
- })
1082
- },
1083
- prisma: JSON.stringify({
618
+ sparklineSeverityColors: (props) => pick_default({
619
+ enterprise: {
620
+ dark: JSON.stringify({
621
+ none: {
622
+ background: variables_exports.enterpriseDark.gray60,
623
+ // note: may need update later
624
+ stroke: variables_exports.enterpriseDark.white
625
+ },
626
+ low: {
627
+ background: variables_exports.enterpriseDark.successColorD50,
628
+ stroke: variables_exports.enterpriseDark.white
629
+ },
630
+ guarded: {
631
+ background: variables_exports.enterpriseDark.infoColorD50,
632
+ stroke: variables_exports.enterpriseDark.white
633
+ },
634
+ elevated: {
635
+ background: variables_exports.enterpriseDark.warningColorD50,
636
+ stroke: variables_exports.enterpriseDark.white
637
+ },
638
+ high: {
639
+ background: variables_exports.enterpriseDark.alertColorD50,
640
+ stroke: variables_exports.enterpriseDark.white
641
+ },
642
+ severe: {
643
+ background: variables_exports.enterpriseDark.errorColorD50,
644
+ stroke: variables_exports.enterpriseDark.white
645
+ }
646
+ }),
647
+ light: JSON.stringify({
1084
648
  none: {
1085
- background: variables_1.scp.gray52,
1086
- stroke: variables_1.scp.white
649
+ background: variables_exports.enterprise.gray60,
650
+ stroke: variables_exports.enterprise.gray20
1087
651
  },
1088
652
  low: {
1089
- background: variables_1.scp.successColorD50,
1090
- stroke: variables_1.scp.white
653
+ background: variables_exports.enterprise.successColorD50,
654
+ stroke: variables_exports.enterprise.white
1091
655
  },
1092
656
  guarded: {
1093
- background: variables_1.scp.infoColorD50,
1094
- stroke: variables_1.scp.white
657
+ background: variables_exports.enterprise.infoColorD50,
658
+ stroke: variables_exports.enterprise.white
1095
659
  },
1096
660
  elevated: {
1097
- background: variables_1.scp.warningColorD50,
1098
- stroke: variables_1.scp.white
661
+ background: variables_exports.enterprise.warningColorD50,
662
+ stroke: variables_exports.enterprise.white
1099
663
  },
1100
664
  high: {
1101
- background: variables_1.scp.alertColorD50,
1102
- stroke: variables_1.scp.white
665
+ background: variables_exports.enterprise.alertColorD50,
666
+ stroke: variables_exports.enterprise.white
1103
667
  },
1104
668
  severe: {
1105
- background: variables_1.scp.errorColorD50,
1106
- stroke: variables_1.scp.white
669
+ background: variables_exports.enterprise.errorColorD50,
670
+ stroke: variables_exports.enterprise.white
1107
671
  }
1108
672
  })
1109
- })(props);
1110
- },
1111
- // TODO(fkurniawan): update with SCP-36839
1112
- sparklineFillColor: function sparklineFillColor(props) {
1113
- return (0, pick_1.default)({
1114
- enterprise: {
1115
- light: LIGHTMODE_SPARKLINE_AREA_COLOR,
1116
- dark: DARKMODE_SPARKLINE_AREA_COLOR
673
+ },
674
+ prisma: JSON.stringify({
675
+ none: {
676
+ background: variables_exports.scp.gray52,
677
+ stroke: variables_exports.scp.white
1117
678
  },
1118
- prisma: DARKMODE_SPARKLINE_AREA_COLOR
1119
- })(props);
1120
- }
679
+ low: {
680
+ background: variables_exports.scp.successColorD50,
681
+ stroke: variables_exports.scp.white
682
+ },
683
+ guarded: {
684
+ background: variables_exports.scp.infoColorD50,
685
+ stroke: variables_exports.scp.white
686
+ },
687
+ elevated: {
688
+ background: variables_exports.scp.warningColorD50,
689
+ stroke: variables_exports.scp.white
690
+ },
691
+ high: {
692
+ background: variables_exports.scp.alertColorD50,
693
+ stroke: variables_exports.scp.white
694
+ },
695
+ severe: {
696
+ background: variables_exports.scp.errorColorD50,
697
+ stroke: variables_exports.scp.white
698
+ }
699
+ })
700
+ })(props)
1121
701
  };
1122
- var editorConfig = [{
1123
- label: (0, i18n_1._)('Data configurations'),
1124
- layout: [[{
1125
- label: (0, i18n_1._)('Value'),
1126
- editor: 'editor.columnSelector',
1127
- option: 'sparklineValues',
1128
- context: 'sparklineValuesContext',
1129
- editorProps: {
1130
- dataSourceKey: 'primary',
1131
- prepareValue: function prepareValue(definition) {
1132
- var sparklineValues = definition.options.sparklineValues;
1133
- return {
1134
- context: {},
1135
- options: {
1136
- majorValue: "> sparklineValues | lastPoint()",
1137
- trendValue: "> sparklineValues | delta(-2)",
1138
- sparklineValues: sparklineValues
702
+ var editorConfig = [
703
+ {
704
+ label: (0, i18n_exports._)("Data configurations"),
705
+ layout: [
706
+ [
707
+ {
708
+ label: (0, i18n_exports._)("Value"),
709
+ editor: "editor.columnSelector",
710
+ option: "sparklineValues",
711
+ context: "sparklineValuesContext",
712
+ editorProps: {
713
+ dataSourceKey: "primary",
714
+ prepareValue: (definition) => {
715
+ const {
716
+ options: { sparklineValues }
717
+ } = definition;
718
+ return {
719
+ context: {},
720
+ options: {
721
+ majorValue: `> sparklineValues | lastPoint()`,
722
+ trendValue: `> sparklineValues | delta(-2)`,
723
+ sparklineValues
724
+ }
725
+ };
726
+ }
727
+ },
728
+ isDisabled: ({ options }) => options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis
729
+ }
730
+ ]
731
+ ]
732
+ },
733
+ {
734
+ label: (0, i18n_exports._)("Data display"),
735
+ layout: [
736
+ ...StaticMajorAndTrendLayout_default,
737
+ [
738
+ {
739
+ label: (0, i18n_exports._)("Trend display"),
740
+ option: "trendDisplay",
741
+ editor: "editor.select",
742
+ editorProps: {
743
+ values: [
744
+ { label: (0, i18n_exports._)("Percent"), value: "percent" },
745
+ { label: (0, i18n_exports._)("Absolute"), value: "absolute" },
746
+ { label: (0, i18n_exports._)("Off"), value: "off" }
747
+ ]
748
+ },
749
+ showEditor: ({ options }) => options.showValue || options.showValue === void 0
750
+ },
751
+ {
752
+ label: (0, i18n_exports._)("Sparkline display"),
753
+ option: "sparklineDisplay",
754
+ editor: "editor.select",
755
+ editorProps: {
756
+ values: [
757
+ { label: (0, i18n_exports._)("Off"), value: "off" },
758
+ { label: (0, i18n_exports._)("Before"), value: "before" },
759
+ { label: (0, i18n_exports._)("Below"), value: "below" },
760
+ { label: (0, i18n_exports._)("After"), value: "after" }
761
+ ]
1139
762
  }
1140
- };
1141
- }
1142
- },
1143
- isDisabled: function isDisabled(_ref) {
1144
- var options = _ref.options;
1145
- return options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
1146
- }
1147
- }]]
1148
- }, {
1149
- label: (0, i18n_1._)('Data display'),
1150
- layout: [].concat(_toConsumableArray(StaticMajorAndTrendLayout_1.default), [[{
1151
- label: (0, i18n_1._)('Trend display'),
1152
- option: 'trendDisplay',
1153
- editor: 'editor.select',
1154
- editorProps: {
1155
- values: [{
1156
- label: (0, i18n_1._)('Percent'),
1157
- value: 'percent'
1158
- }, {
1159
- label: (0, i18n_1._)('Absolute'),
1160
- value: 'absolute'
1161
- }, {
1162
- label: (0, i18n_1._)('Off'),
1163
- value: 'off'
1164
- }]
1165
- },
1166
- showEditor: function showEditor(_ref2) {
1167
- var options = _ref2.options;
1168
- return options.showValue || options.showValue === undefined;
1169
- }
1170
- }, {
1171
- label: (0, i18n_1._)('Sparkline display'),
1172
- option: 'sparklineDisplay',
1173
- editor: 'editor.select',
1174
- editorProps: {
1175
- values: [{
1176
- label: (0, i18n_1._)('Off'),
1177
- value: 'off'
1178
- }, {
1179
- label: (0, i18n_1._)('Before'),
1180
- value: 'before'
1181
- }, {
1182
- label: (0, i18n_1._)('Below'),
1183
- value: 'below'
1184
- }, {
1185
- label: (0, i18n_1._)('After'),
1186
- value: 'after'
1187
- }]
1188
- }
1189
- }]], _toConsumableArray(TrellisEditors_1.TrellisEditorConfig))
1190
- }, {
1191
- label: (0, i18n_1._)('Color and style'),
1192
- layout: [[{
1193
- label: (0, i18n_1._)('Dynamic elements'),
1194
- key: 'presetSelector',
1195
- editor: 'editor.presetSelector',
1196
- editorProps: {
1197
- presets: presets,
1198
- value: function value(_ref3) {
1199
- var context = _ref3.context,
1200
- options = _ref3.options;
1201
- var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
1202
- return initialPreset && initialPreset.label || null;
1203
- }
1204
- }
1205
- }], [Object.assign(Object.assign({}, StaticMajorColorEditor_1.default), {
1206
- editorProps: {
1207
- themes: themes
1208
- }
1209
- })], [(0, DynamicMajorColorEditor_1.getDynamicMajorColorEditor)({
1210
- defaultContext: singleValueContext_1.defaultContext,
1211
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
1212
- })], [Object.assign(Object.assign({}, StaticTrendColorEditor_1.default), {
1213
- editorProps: {
1214
- themes: themes
1215
- }
1216
- })], [(0, DynamicTrendColorEditor_1.getDynamicTrendColorEditor)({
1217
- defaultContext: singleValueContext_1.defaultContext,
1218
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
1219
- })], [Object.assign(Object.assign({}, StaticBackgroundColorEditor_1.default), {
1220
- editorProps: {
1221
- themes: themes
1222
- }
1223
- })], [Object.assign(Object.assign({}, TrellisEditors_1.TrellisBackgroundColorEditor), {
1224
- editorProps: {
1225
- themes: themes
1226
- }
1227
- })], [(0, DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor)({
1228
- defaultContext: singleValueContext_1.defaultContext,
1229
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
1230
- })], [{
1231
- label: (0, i18n_1._)('Major value size (px)'),
1232
- option: 'majorFontSize',
1233
- editor: 'editor.number',
1234
- editorProps: {
1235
- min: 1
1236
- },
1237
- placeholder: (0, i18n_1._)('Auto'),
1238
- showEditor: function showEditor(_ref4) {
1239
- var options = _ref4.options;
1240
- return options.showValue || options.showValue === undefined;
1241
- }
1242
- }, {
1243
- label: (0, i18n_1._)('Trend value size (px)'),
1244
- option: 'trendFontSize',
1245
- editor: 'editor.number',
1246
- editorProps: {
1247
- min: 1
1248
- },
1249
- placeholder: (0, i18n_1._)('Auto'),
1250
- showEditor: function showEditor(_ref5) {
1251
- var options = _ref5.options;
1252
- return options.showValue || options.showValue === undefined;
1253
- },
1254
- isDisabled: function isDisabled(_ref6) {
1255
- var options = _ref6.options;
1256
- return options.trendDisplay === 'off';
1257
- }
1258
- }], [{
1259
- label: (0, i18n_1._)('Major value abbreviation'),
1260
- option: 'shouldAbbreviateMajorValue',
1261
- editor: 'editor.checkbox'
1262
- }], [{
1263
- label: (0, i18n_1._)('Trend value abbreviation'),
1264
- option: 'shouldAbbreviateTrendValue',
1265
- editor: 'editor.checkbox'
1266
- }], [{
1267
- label: (0, i18n_1._)('Alignment'),
1268
- editor: 'editor.radioBar',
1269
- option: 'align',
1270
- editorProps: {
1271
- values: [{
1272
- label: (0, i18n_1._)('Left'),
1273
- value: 'left'
1274
- }, {
1275
- label: (0, i18n_1._)('Center'),
1276
- value: 'center'
1277
- }, {
1278
- label: (0, i18n_1._)('Right'),
1279
- value: 'right'
1280
- }]
1281
- },
1282
- showEditor: function showEditor(_ref7) {
1283
- var options = _ref7.options;
1284
- return options.showValue || options.showValue === undefined;
1285
- }
1286
- }]]
1287
- }];
1288
- /**
1289
- * visualization configuration
1290
- */
1291
-
763
+ }
764
+ ],
765
+ ...TrellisEditorConfig
766
+ ]
767
+ },
768
+ {
769
+ label: (0, i18n_exports._)("Color and style"),
770
+ layout: [
771
+ [
772
+ {
773
+ label: (0, i18n_exports._)("Dynamic elements"),
774
+ key: "presetSelector",
775
+ editor: "editor.presetSelector",
776
+ editorProps: {
777
+ presets,
778
+ value: ({ context, options }) => {
779
+ const initialPreset = getInitialPreset(context, options, presets);
780
+ return initialPreset && initialPreset.label || null;
781
+ }
782
+ }
783
+ }
784
+ ],
785
+ [
786
+ __spreadProps(__spreadValues({}, StaticMajorColorEditor_default), {
787
+ editorProps: {
788
+ themes
789
+ }
790
+ })
791
+ ],
792
+ [getDynamicMajorColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
793
+ [
794
+ __spreadProps(__spreadValues({}, StaticTrendColorEditor_default), {
795
+ editorProps: {
796
+ themes
797
+ }
798
+ })
799
+ ],
800
+ [getDynamicTrendColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
801
+ [
802
+ __spreadProps(__spreadValues({}, StaticBackgroundColorEditor_default), {
803
+ editorProps: {
804
+ themes
805
+ }
806
+ })
807
+ ],
808
+ [
809
+ __spreadProps(__spreadValues({}, TrellisBackgroundColorEditor), {
810
+ editorProps: {
811
+ themes
812
+ }
813
+ })
814
+ ],
815
+ [getDynamicBackgroundColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
816
+ [
817
+ {
818
+ label: (0, i18n_exports._)("Major value size (px)"),
819
+ option: "majorFontSize",
820
+ editor: "editor.number",
821
+ editorProps: {
822
+ min: 1
823
+ },
824
+ placeholder: (0, i18n_exports._)("Auto"),
825
+ showEditor: ({ options }) => options.showValue || options.showValue === void 0
826
+ },
827
+ {
828
+ label: (0, i18n_exports._)("Trend value size (px)"),
829
+ option: "trendFontSize",
830
+ editor: "editor.number",
831
+ editorProps: {
832
+ min: 1
833
+ },
834
+ placeholder: (0, i18n_exports._)("Auto"),
835
+ showEditor: ({ options }) => options.showValue || options.showValue === void 0,
836
+ isDisabled: ({ options }) => options.trendDisplay === "off"
837
+ }
838
+ ],
839
+ [
840
+ {
841
+ label: (0, i18n_exports._)("Major value abbreviation"),
842
+ option: "shouldAbbreviateMajorValue",
843
+ editor: "editor.checkbox"
844
+ }
845
+ ],
846
+ [
847
+ {
848
+ label: (0, i18n_exports._)("Trend value abbreviation"),
849
+ option: "shouldAbbreviateTrendValue",
850
+ editor: "editor.checkbox"
851
+ }
852
+ ],
853
+ [
854
+ {
855
+ label: (0, i18n_exports._)("Alignment"),
856
+ editor: "editor.radioBar",
857
+ option: "align",
858
+ editorProps: {
859
+ values: [
860
+ { label: (0, i18n_exports._)("Left"), value: "left" },
861
+ { label: (0, i18n_exports._)("Center"), value: "center" },
862
+ { label: (0, i18n_exports._)("Right"), value: "right" }
863
+ ]
864
+ },
865
+ showEditor: ({ options }) => options.showValue || options.showValue === void 0
866
+ }
867
+ ]
868
+ ]
869
+ }
870
+ ];
1292
871
  var config = {
1293
872
  /**
1294
873
  * unique viz key
1295
874
  */
1296
- key: 'splunk.singlevalue',
1297
-
875
+ key: "splunk.singlevalue",
1298
876
  /**
1299
877
  * viz name
1300
878
  */
1301
- name: (0, i18n_1._)('Single value'),
1302
- category: VizCategory_1.VizCategory.SINGLE_VALUE,
1303
-
879
+ name: (0, i18n_exports._)("Single value"),
880
+ category: "Single Value" /* SINGLE_VALUE */,
1304
881
  /**
1305
882
  * viz icon
1306
883
  */
1307
- icon: visualization_icons_1.SingleValue,
1308
- placeholderIcon: placeholders_1.SingleValue,
1309
- dataContract: dataContract,
1310
- size: size,
1311
- defaultContext: singleValueContext_1.defaultContext,
1312
- optionsSchema: visualization_schemas_1.singleValueOptionsSchema,
1313
- editorConfig: editorConfig,
884
+ icon: visualization_icons_exports.SingleValue,
885
+ placeholderIcon: placeholders_exports.SingleValue,
886
+ dataContract,
887
+ size,
888
+ defaultContext,
889
+ optionsSchema: visualization_schemas_exports.singleValueOptionsSchema,
890
+ editorConfig,
1314
891
  events: {
1315
- 'value.click': {
1316
- description: 'trigger when user clicks major value',
1317
- payloadKeys: ['majorValue', 'trendValue']
892
+ "value.click": {
893
+ description: "trigger when user clicks major value",
894
+ payloadKeys: ["majorValue", "trendValue"]
1318
895
  }
1319
896
  },
1320
- supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER, VizBehavior_1.VizBehavior.TRELLIS],
1321
- themes: themes,
1322
- requiredProps: ['majorValue']
897
+ supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "events" /* EVENTS */, "placeholder" /* PLACEHOLDER */, "trellis" /* TRELLIS */],
898
+ themes,
899
+ requiredProps: ["majorValue"]
1323
900
  };
1324
- exports.default = (0, configUtils_1.enhanceConfig)(config);
1325
-
1326
- /***/ }),
1327
- /* 67 */
1328
- /***/ (function(module, exports) {
1329
-
1330
- module.exports = require("@splunk/visualization-themes/variables");
1331
-
1332
- /***/ })
1333
- /******/ ]);
1334
- //# sourceMappingURL=SingleValue.config.js.map
901
+ var config_default = enhanceConfig(config);
902
+ //# sourceMappingURL=SingleValue.config.js.map