@splunk/visualizations 25.1.0 → 25.2.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 (172) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Background_Color_Red.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Basic.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_Simulated_Instance.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_for_Numeric_Field_Simulated_Instance.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Dark.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Light.png +0 -0
  7. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Background_color_cyan.png +0 -0
  8. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_after_default.png +0 -0
  9. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_before.png +0 -0
  10. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Background_Color_white_Under_Label_and_Unit_specified.png +0 -0
  11. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Major_Value_is_null.png +0 -0
  12. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_after_default.png +0 -0
  13. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_before.png +0 -0
  14. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Events_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  32. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  33. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  34. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  35. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  36. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  37. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields_with_Highlight.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Show_Placeholder.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
  57. package/Area.config.js +14 -14
  58. package/Area.config.js.map +1 -1
  59. package/Area.js +171 -160
  60. package/Area.js.map +1 -1
  61. package/Bar.config.js +14 -14
  62. package/Bar.config.js.map +1 -1
  63. package/Bar.js +171 -160
  64. package/Bar.js.map +1 -1
  65. package/Bubble.config.js +18 -11
  66. package/Bubble.config.js.map +1 -1
  67. package/Bubble.js +173 -155
  68. package/Bubble.js.map +1 -1
  69. package/ChoroplethSvg.config.js +3 -3
  70. package/ChoroplethSvg.config.js.map +1 -1
  71. package/ChoroplethSvg.js +158 -148
  72. package/ChoroplethSvg.js.map +1 -1
  73. package/Column.config.js +14 -14
  74. package/Column.config.js.map +1 -1
  75. package/Column.js +170 -160
  76. package/Column.js.map +1 -1
  77. package/Ellipse.js +125 -115
  78. package/Ellipse.js.map +1 -1
  79. package/Events.config.js +668 -0
  80. package/Events.config.js.map +1 -0
  81. package/Events.js +3116 -0
  82. package/Events.js.map +1 -0
  83. package/FillerGauge.config.js +17 -16
  84. package/FillerGauge.config.js.map +1 -1
  85. package/FillerGauge.js +159 -142
  86. package/FillerGauge.js.map +1 -1
  87. package/Image.config.js +2 -2
  88. package/Image.config.js.map +1 -1
  89. package/Image.js +109 -109
  90. package/Image.js.map +1 -1
  91. package/Line.config.js +17 -16
  92. package/Line.config.js.map +1 -1
  93. package/Line.js +180 -163
  94. package/Line.js.map +1 -1
  95. package/LinkGraph.config.js +12 -5
  96. package/LinkGraph.config.js.map +1 -1
  97. package/LinkGraph.js +24318 -387
  98. package/LinkGraph.js.map +1 -1
  99. package/Map.config.js +27 -26
  100. package/Map.config.js.map +1 -1
  101. package/Map.js +3065 -3126
  102. package/Map.js.map +1 -1
  103. package/Markdown.config.js +6 -6
  104. package/Markdown.config.js.map +1 -1
  105. package/Markdown.js +332 -332
  106. package/Markdown.js.map +1 -1
  107. package/MarkerGauge.config.js +13 -13
  108. package/MarkerGauge.config.js.map +1 -1
  109. package/MarkerGauge.js +1147 -1147
  110. package/MarkerGauge.js.map +1 -1
  111. package/ParallelCoordinates.config.js +11 -11
  112. package/ParallelCoordinates.config.js.map +1 -1
  113. package/ParallelCoordinates.js +588 -695
  114. package/ParallelCoordinates.js.map +1 -1
  115. package/Pie.config.js +13 -13
  116. package/Pie.config.js.map +1 -1
  117. package/Pie.js +1164 -1164
  118. package/Pie.js.map +1 -1
  119. package/Punchcard.config.js +11 -11
  120. package/Punchcard.config.js.map +1 -1
  121. package/Punchcard.js +2628 -2744
  122. package/Punchcard.js.map +1 -1
  123. package/Rectangle.config.js +4 -4
  124. package/Rectangle.config.js.map +1 -1
  125. package/Rectangle.js +704 -704
  126. package/Rectangle.js.map +1 -1
  127. package/Sankey.config.js +15 -15
  128. package/Sankey.config.js.map +1 -1
  129. package/Sankey.js +3124 -3245
  130. package/Sankey.js.map +1 -1
  131. package/Scatter.config.js +21 -13
  132. package/Scatter.config.js.map +1 -1
  133. package/Scatter.js +1395 -1388
  134. package/Scatter.js.map +1 -1
  135. package/SingleValue.config.js +8 -7
  136. package/SingleValue.config.js.map +1 -1
  137. package/SingleValue.js +2136 -2136
  138. package/SingleValue.js.map +1 -1
  139. package/SingleValueBasic.js +28 -28
  140. package/SingleValueBasic.js.map +1 -1
  141. package/SingleValueIcon.config.js +8 -7
  142. package/SingleValueIcon.config.js.map +1 -1
  143. package/SingleValueIcon.js +1249 -1390
  144. package/SingleValueIcon.js.map +1 -1
  145. package/SingleValueRadial.config.js +8 -7
  146. package/SingleValueRadial.config.js.map +1 -1
  147. package/SingleValueRadial.js +1926 -1926
  148. package/SingleValueRadial.js.map +1 -1
  149. package/Table.config.js +4 -4
  150. package/Table.config.js.map +1 -1
  151. package/Table.js +2158 -2155
  152. package/Table.js.map +1 -1
  153. package/common/EventsDoc.js +15 -8
  154. package/common/EventsDoc.js.map +1 -1
  155. package/common/GaugeMajorTicks.js +2 -2
  156. package/common/GaugeValueMarker.js +2 -2
  157. package/common/OptionsDoc.js +9 -8
  158. package/common/OptionsDoc.js.map +1 -1
  159. package/common/ThemesDoc.js +2 -2
  160. package/common/utils/dataUtils.js +136 -0
  161. package/common/utils/dataUtils.js.map +1 -0
  162. package/common/utils/hocUtils.js +2 -2
  163. package/common/utils/hocUtils.js.map +1 -1
  164. package/common/utils/mapUtils.js +11 -10
  165. package/common/utils/mapUtils.js.map +1 -1
  166. package/common/utils/singleValueUtils.js +3 -2
  167. package/common/utils/singleValueUtils.js.map +1 -1
  168. package/common/utils/testHelper.js +8 -8
  169. package/common/utils/testHelper.js.map +1 -1
  170. package/common/withDashboardViz.js +2 -2
  171. package/common/withDashboardViz.js.map +1 -1
  172. package/package.json +14 -12
@@ -0,0 +1,668 @@
1
+ /*!
2
+ * Copyright © 2018 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 = 44);
91
+ /******/ })
92
+ /************************************************************************/
93
+ /******/ ({
94
+
95
+ /***/ 0:
96
+ /***/ (function(module, exports) {
97
+
98
+ module.exports = require("@splunk/ui-utils/i18n");
99
+
100
+ /***/ }),
101
+
102
+ /***/ 1:
103
+ /***/ (function(module, exports) {
104
+
105
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
106
+
107
+ /***/ }),
108
+
109
+ /***/ 11:
110
+ /***/ (function(module, exports) {
111
+
112
+ module.exports = require("@splunk/visualization-icons/placeholders");
113
+
114
+ /***/ }),
115
+
116
+ /***/ 12:
117
+ /***/ (function(module, exports) {
118
+
119
+ module.exports = require("@splunk/visualization-icons");
120
+
121
+ /***/ }),
122
+
123
+ /***/ 13:
124
+ /***/ (function(module, exports, __webpack_require__) {
125
+
126
+ "use strict";
127
+
128
+
129
+ Object.defineProperty(exports, "__esModule", {
130
+ value: true
131
+ });
132
+
133
+ var i18n_1 = __webpack_require__(0);
134
+
135
+ var background = function background(_ref) {
136
+ var label = _ref.label,
137
+ themes = _ref.themes,
138
+ labelPosition = _ref.labelPosition;
139
+ return [{
140
+ label: i18n_1._(label || 'Background'),
141
+ option: 'backgroundColor',
142
+ editor: 'editor.color',
143
+ editorProps: {
144
+ labelPosition: labelPosition || 'top',
145
+ themes: themes
146
+ }
147
+ }];
148
+ };
149
+
150
+ exports.default = background;
151
+
152
+ /***/ }),
153
+
154
+ /***/ 2:
155
+ /***/ (function(module, exports, __webpack_require__) {
156
+
157
+ "use strict";
158
+
159
+
160
+ Object.defineProperty(exports, "__esModule", {
161
+ value: true
162
+ });
163
+ exports.VizBehavior = void 0;
164
+ var VizBehavior;
165
+
166
+ (function (VizBehavior) {
167
+ /**
168
+ * Dynamic Options Behavior.
169
+ * This allows visualization options to be powered by data
170
+ *
171
+ * **Example**
172
+ *
173
+ * sparklineValues: ">primary|seriesByIndex(0)"
174
+ * would configure sparklineValues with an array of data points
175
+ * coming from the first series in the primary datasource
176
+ *
177
+ */
178
+ VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
179
+ VizBehavior["EVENTS"] = "events";
180
+ /**
181
+ * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
182
+ * missing.
183
+ * @type {string}
184
+ */
185
+
186
+ VizBehavior["PLACEHOLDER"] = "placeholder";
187
+ VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
188
+ })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
189
+
190
+ /***/ }),
191
+
192
+ /***/ 21:
193
+ /***/ (function(module, exports) {
194
+
195
+ module.exports = require("@splunk/themes");
196
+
197
+ /***/ }),
198
+
199
+ /***/ 3:
200
+ /***/ (function(module, exports) {
201
+
202
+ module.exports = require("@splunk/visualizations-shared/schemaUtils");
203
+
204
+ /***/ }),
205
+
206
+ /***/ 4:
207
+ /***/ (function(module, exports, __webpack_require__) {
208
+
209
+ "use strict";
210
+
211
+
212
+ var _toConsumableArray = __webpack_require__(1);
213
+
214
+ var _defineProperty = __webpack_require__(7);
215
+
216
+ var __rest = this && this.__rest || function (s, e) {
217
+ var t = {};
218
+
219
+ for (var p in s) {
220
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
221
+ }
222
+
223
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
224
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
225
+ }
226
+ return t;
227
+ };
228
+
229
+ Object.defineProperty(exports, "__esModule", {
230
+ value: true
231
+ });
232
+ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
233
+
234
+ var lodash_1 = __webpack_require__(6);
235
+
236
+ var schemaUtils_1 = __webpack_require__(3);
237
+
238
+ var VizBehavior_1 = __webpack_require__(2);
239
+
240
+ var dynamicOptionsDSLType = {
241
+ type: 'string',
242
+ pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
243
+ };
244
+ /**
245
+ * Helper function to extend an options schema with dynamic options DSL
246
+ * @param optionsSchema a visualization's options schema
247
+ * @returns an updated options schema that additionally allows strings starting with > for each option
248
+ */
249
+
250
+ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
251
+ var enhancedOptionsSchema = {};
252
+ Object.keys(optionsSchema).forEach(function (key) {
253
+ var _a = optionsSchema[key],
254
+ title = _a.title,
255
+ description = _a.description,
256
+ readOnly = _a.readOnly,
257
+ writeOnly = _a.writeOnly,
258
+ examples = _a.examples,
259
+ defaultValue = _a.default,
260
+ type = _a.type,
261
+ properties = _a.properties,
262
+ patternProperties = _a.patternProperties,
263
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
264
+
265
+ var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
266
+ title: title
267
+ }), description !== undefined && {
268
+ description: description
269
+ }), readOnly !== undefined && {
270
+ readOnly: readOnly
271
+ }), writeOnly !== undefined && {
272
+ writeOnly: writeOnly
273
+ }), examples !== undefined && {
274
+ examples: examples
275
+ }), defaultValue !== undefined && {
276
+ default: defaultValue
277
+ });
278
+
279
+ if (type === 'object') {
280
+ enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
281
+ type: type
282
+ }), properties && {
283
+ properties: enhanceOptionsSchemaWithDynamicOptions(properties)
284
+ });
285
+
286
+ if (patternProperties) {
287
+ var enhancedPatternProperties = {};
288
+ Object.keys(patternProperties).forEach(function (opt) {
289
+ enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
290
+ });
291
+ enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
292
+ }
293
+ } else {
294
+ enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
295
+ anyOf: [Object.assign(Object.assign({}, type !== undefined && {
296
+ type: type
297
+ }), remainingSchemaEntry), dynamicOptionsDSLType]
298
+ });
299
+ }
300
+ });
301
+ return enhancedOptionsSchema;
302
+ }
303
+
304
+ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
305
+ /**
306
+ * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
307
+ * this function also collapse all editor panels
308
+ * @param vizConfig a Visualization Config
309
+ * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
310
+ * and containing `open: false` for all editor panels in editorConfig
311
+ */
312
+
313
+ function enhanceConfig(vizConfig) {
314
+ var enhancedConfig = vizConfig;
315
+
316
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
317
+ enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
318
+ }
319
+
320
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
321
+ return Object.assign(Object.assign({}, config), {
322
+ open: false
323
+ });
324
+ });
325
+ return enhancedConfig;
326
+ }
327
+
328
+ exports.enhanceConfig = enhanceConfig;
329
+ /**
330
+ * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
331
+ * Created for editor unit tests
332
+ * @param vizConfig a Visualization Config
333
+ * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
334
+ */
335
+
336
+ function uncollapseEditorConfig(vizConfig) {
337
+ var editorPanelUncollapsedConfig = vizConfig;
338
+ editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
339
+ return Object.assign(Object.assign({}, config), {
340
+ open: true
341
+ });
342
+ });
343
+ return editorPanelUncollapsedConfig;
344
+ }
345
+
346
+ exports.uncollapseEditorConfig = uncollapseEditorConfig;
347
+
348
+ function isDynamicOption(option) {
349
+ return option && typeof option === 'string' && option.trim().startsWith('>') || false;
350
+ }
351
+
352
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
353
+ // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
354
+
355
+ /**
356
+ * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
357
+ * 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
358
+ * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
359
+ * 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
360
+ *
361
+ * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
362
+ */
363
+
364
+ function hasCompatibleContexts(vizContext, presetContext) {
365
+ var presetContextKeys = Object.keys(presetContext);
366
+ return presetContextKeys.every(function (contextKey) {
367
+ return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
368
+ });
369
+ }
370
+ /**
371
+ * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
372
+ */
373
+
374
+
375
+ function hasCompatibleOptions(vizOptions, presetOptions) {
376
+ var presetOptionKeys = Object.keys(presetOptions);
377
+ return presetOptionKeys.every(function (optionKey) {
378
+ return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
379
+ });
380
+ }
381
+ /**
382
+ * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
383
+ * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
384
+ *
385
+ * @param {Object} vizContext - the current vizContext definition
386
+ * @param {Object} vizOptions - the current vizOptions definition
387
+ * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
388
+ */
389
+
390
+
391
+ function getInitialPreset(vizContext, vizOptions, presets) {
392
+ return presets.find(function (preset) {
393
+ var presetContext = lodash_1.get(preset, ['value', 'context'], {});
394
+ var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
395
+ var presetContextKeys = Object.keys(presetContext);
396
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
397
+ // if not, then the preset is invalid in config.ts
398
+
399
+ if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
400
+ return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
401
+ });
402
+ }
403
+
404
+ exports.getInitialPreset = getInitialPreset;
405
+ /**
406
+ * generates number precision values for a Select editor
407
+ *
408
+ * @param {Number} numPrecisionValues - number of integer precision values to generate
409
+ * @returns {{ label: string; value; string }[]} array of { label, value } tuples
410
+ */
411
+
412
+ function generatePrecisionValues(numPrecisionValues) {
413
+ return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
414
+ return {
415
+ label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
416
+ value: i
417
+ };
418
+ });
419
+ }
420
+
421
+ exports.generatePrecisionValues = generatePrecisionValues;
422
+ /**
423
+ * insert layout in layout array, return a new layout array instead of updating the original
424
+ *
425
+ * @param {EditorLayoutConfig[][]} layout - editor layout
426
+ * @param {Number} index - the index to insert layout item(s)
427
+ * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
428
+ * @returns {EditorLayoutConfig[][]} new editor layout with insertion
429
+ */
430
+
431
+ var insertLayout = function insertLayout(layout, index) {
432
+ for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
433
+ layoutItems[_key - 2] = arguments[_key];
434
+ }
435
+
436
+ return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
437
+ };
438
+
439
+ exports.insertLayout = insertLayout;
440
+
441
+ /***/ }),
442
+
443
+ /***/ 44:
444
+ /***/ (function(module, exports, __webpack_require__) {
445
+
446
+ "use strict";
447
+
448
+
449
+ Object.defineProperty(exports, "__esModule", {
450
+ value: true
451
+ });
452
+
453
+ var visualization_icons_1 = __webpack_require__(12);
454
+
455
+ var placeholders_1 = __webpack_require__(11);
456
+
457
+ var schemaUtils_1 = __webpack_require__(3);
458
+
459
+ var themes_1 = __webpack_require__(21);
460
+
461
+ var i18n_1 = __webpack_require__(0);
462
+
463
+ var VizBehavior_1 = __webpack_require__(2);
464
+
465
+ var VizCategory_1 = __webpack_require__(8);
466
+
467
+ var configUtils_1 = __webpack_require__(4);
468
+
469
+ var BackgroundColor_1 = __webpack_require__(13);
470
+
471
+ var defaultContext = {};
472
+ var dataContract = {
473
+ requiredDataSources: [{
474
+ name: 'primary',
475
+ description: 'DataSource that powers the visualization'
476
+ }],
477
+ optionalDataSources: [{
478
+ name: 'fieldsummary',
479
+ description: 'DataSource that powers the field summary popover on field click'
480
+ }],
481
+ initialRequestParams: {
482
+ primary: function primary() {
483
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
484
+ return {
485
+ offset: 0,
486
+ count: options.count ? options.count : 10,
487
+ requestTotalCount: true
488
+ };
489
+ }
490
+ }
491
+ };
492
+ var size = {
493
+ initialWidth: 800,
494
+ initialHeight: 500
495
+ };
496
+ var optionsSchema = {
497
+ backgroundColor: {
498
+ default: '> themes.defaultBackgroundColor',
499
+ description: 'Specify the color used for the background by using a hexadecimal code. For example, #0000FF.',
500
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
501
+ type: 'string'
502
+ },
503
+ eventActions: {
504
+ default: [],
505
+ description: 'Specify the available actions to take for an event. For example, `[{ "eventType": "eventAction.buildEventType.click, "label": "Build Event Type" }]`. Event types should end in `.click` if utilizing event handlers.',
506
+ type: 'array',
507
+ items: {
508
+ type: 'object',
509
+ properties: {
510
+ eventType: {
511
+ description: 'The distinct type for the event emitted upon event action click.',
512
+ type: 'string',
513
+ pattern: '.click$',
514
+ default: ''
515
+ },
516
+ label: {
517
+ description: 'The label for the event action.',
518
+ type: 'string',
519
+ default: ''
520
+ }
521
+ },
522
+ required: ['eventType', 'label']
523
+ }
524
+ },
525
+ fieldActions: {
526
+ description: 'Specify the available actions for this field. For example, `{ default: [{ "eventType": "fieldAction.sharedAction1.click, "label": "Shared Action 1" }] }`. Event types should end in `.click` if utilizing event handlers. Actions under the `default` key are shared across all field dropdowns.',
527
+ type: 'object'
528
+ },
529
+ showFieldSummary: {
530
+ description: 'Specify that a field summary popup appears when a field is selected. To show field summaries for a search, configure an additional datasource called `fieldsummary` using the original search followed by the `... | fieldsummary maxvals=10` SPL command.',
531
+ type: 'boolean',
532
+ default: true
533
+ },
534
+ footerFields: {
535
+ description: 'Specify field(s) that should be displayed in the footer component. Specify one or more fields to display in the footer component. For example, specify ["source", "dest"] to display the source and destination fields.',
536
+ type: 'array',
537
+ items: {
538
+ type: 'string'
539
+ },
540
+ default: []
541
+ } // footerFieldsHighlighted: {
542
+ // description: 'Specify values to be highlighted in the footer component',
543
+ // type: 'array',
544
+ // items: {
545
+ // type: 'string',
546
+ // },
547
+ // default: [],
548
+ // },
549
+
550
+ };
551
+ var themes = {
552
+ defaultBackgroundColor: function defaultBackgroundColor(props) {
553
+ return themes_1.pick({
554
+ enterprise: {
555
+ dark: themes_1.variables.black(props),
556
+ light: themes_1.variables.backgroundColor(props)
557
+ },
558
+ prisma: themes_1.variables.backgroundColorSidebar(props)
559
+ })(props);
560
+ }
561
+ };
562
+ var editorConfig = [{
563
+ label: i18n_1._('Color and style'),
564
+ layout: [BackgroundColor_1.default({
565
+ themes: themes
566
+ })]
567
+ }, {
568
+ label: i18n_1._('Data display'),
569
+ layout: [[{
570
+ label: i18n_1._('Show field summary'),
571
+ option: 'showFieldSummary',
572
+ editor: 'editor.checkbox',
573
+ editorProps: {
574
+ labelPosition: 'right'
575
+ }
576
+ }]]
577
+ }];
578
+ /**
579
+ * visualization configuration
580
+ */
581
+
582
+ var config = {
583
+ /**
584
+ * unique viz key
585
+ */
586
+ key: 'splunk.events',
587
+
588
+ /**
589
+ * viz name
590
+ */
591
+ name: 'Events',
592
+ category: VizCategory_1.VizCategory.TABLE,
593
+ status: 'preview',
594
+
595
+ /**
596
+ * viz icon
597
+ */
598
+ icon: visualization_icons_1.Events,
599
+ placeholderIcon: placeholders_1.Events,
600
+ dataContract: dataContract,
601
+ size: size,
602
+ defaultContext: defaultContext,
603
+ optionsSchema: optionsSchema,
604
+ editorConfig: editorConfig,
605
+ events: {
606
+ 'eventAction.<actionName>.click': {
607
+ description: 'Triggered when a user selects the Event Actions button within an event. An application developer can configure workflow action retrieval and event handling, as described in the Concepts tab.'
608
+ },
609
+ 'fieldAction.<actionName>.click': {
610
+ description: 'Triggered when a user selects an arrow under the Actions column heading. Application developers can configure workflow action retrieval and event handling. For more information, see the Concepts tab.'
611
+ },
612
+ 'events.search.<fieldSummaryReportActionName>': {
613
+ description: 'Triggered when a user selects a report action in the field summary of an event. Application developers must pass context and handle events in their applications. For more information, see the Concepts tab.'
614
+ }
615
+ },
616
+ supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER],
617
+ themes: themes,
618
+ requiredProps: []
619
+ };
620
+ exports.default = configUtils_1.enhanceConfig(config);
621
+
622
+ /***/ }),
623
+
624
+ /***/ 6:
625
+ /***/ (function(module, exports) {
626
+
627
+ module.exports = require("lodash");
628
+
629
+ /***/ }),
630
+
631
+ /***/ 7:
632
+ /***/ (function(module, exports) {
633
+
634
+ module.exports = require("@babel/runtime/helpers/defineProperty");
635
+
636
+ /***/ }),
637
+
638
+ /***/ 8:
639
+ /***/ (function(module, exports, __webpack_require__) {
640
+
641
+ "use strict";
642
+
643
+
644
+ Object.defineProperty(exports, "__esModule", {
645
+ value: true
646
+ });
647
+ exports.VizCategory = void 0;
648
+ var VizCategory;
649
+
650
+ (function (VizCategory) {
651
+ VizCategory["SINGLE_VALUE"] = "Single Value";
652
+ VizCategory["TRENDS"] = "Trends";
653
+ VizCategory["COMPARISONS"] = "Comparisons";
654
+ VizCategory["TABLE"] = "Table";
655
+ VizCategory["GAUGE"] = "Gauge";
656
+ VizCategory["DISTRIBUTIONS"] = "Distributions";
657
+ VizCategory["CHOROPLETH"] = "Choropleth Maps";
658
+ VizCategory["SHAPES"] = "Shapes";
659
+ VizCategory["MISC"] = "misc";
660
+ VizCategory["FLOW"] = "Flow";
661
+ VizCategory["CORRELATION"] = "Correlation";
662
+ VizCategory["SPATIAL"] = "Spatial";
663
+ })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
664
+
665
+ /***/ })
666
+
667
+ /******/ });
668
+ //# sourceMappingURL=Events.config.js.map