@splunk/visualizations 26.4.0 → 27.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +1262 -1600
- package/Area.config.js.map +7 -1
- package/Area.js +3002 -4920
- package/Area.js.map +7 -1
- package/Bar.config.js +1247 -1574
- package/Bar.config.js.map +7 -1
- package/Bar.js +2924 -4836
- package/Bar.js.map +7 -1
- package/Bubble.config.js +896 -1213
- package/Bubble.config.js.map +7 -1
- package/Bubble.js +2520 -4476
- package/Bubble.js.map +7 -1
- package/ChoroplethSvg.config.js +282 -582
- package/ChoroplethSvg.config.js.map +7 -1
- package/ChoroplethSvg.js +2004 -3810
- package/ChoroplethSvg.js.map +7 -1
- package/Column.config.js +1208 -1541
- package/Column.config.js.map +7 -1
- package/Column.js +2933 -4879
- package/Column.js.map +7 -1
- package/Ellipse.config.js +443 -774
- package/Ellipse.config.js.map +7 -1
- package/Ellipse.js +1651 -3341
- package/Ellipse.js.map +7 -1
- package/Events.config.js +207 -492
- package/Events.config.js.map +7 -1
- package/Events.js +2615 -4649
- package/Events.js.map +7 -1
- package/FillerGauge.config.js +420 -775
- package/FillerGauge.config.js.map +7 -1
- package/FillerGauge.js +2137 -4578
- package/FillerGauge.js.map +7 -1
- package/Image.config.js +144 -411
- package/Image.config.js.map +7 -1
- package/Image.js +1395 -3048
- package/Image.js.map +7 -1
- package/Line.config.js +1278 -1625
- package/Line.config.js.map +7 -1
- package/Line.js +2957 -4919
- package/Line.js.map +7 -1
- package/LinkGraph.config.js +390 -632
- package/LinkGraph.config.js.map +7 -1
- package/LinkGraph.js +5243 -6190
- package/LinkGraph.js.map +7 -1
- package/MIGRATION.md +12 -0
- package/Map.config.js +501 -801
- package/Map.config.js.map +7 -1
- package/Map.js +3369 -5676
- package/Map.js.map +7 -1
- package/Markdown.config.js +232 -528
- package/Markdown.config.js.map +7 -1
- package/Markdown.js +1645 -3216
- package/Markdown.js.map +7 -1
- package/MarkerGauge.config.js +308 -613
- package/MarkerGauge.config.js.map +7 -1
- package/MarkerGauge.js +2189 -4535
- package/MarkerGauge.js.map +7 -1
- package/ParallelCoordinates.config.js +282 -581
- package/ParallelCoordinates.config.js.map +7 -1
- package/ParallelCoordinates.js +2023 -4720
- package/ParallelCoordinates.js.map +7 -1
- package/Pie.config.js +278 -547
- package/Pie.config.js.map +7 -1
- package/Pie.js +1998 -3982
- package/Pie.js.map +7 -1
- package/Punchcard.config.js +291 -578
- package/Punchcard.config.js.map +7 -1
- package/Punchcard.js +2709 -5042
- package/Punchcard.js.map +7 -1
- package/Rectangle.config.js +455 -770
- package/Rectangle.config.js.map +7 -1
- package/Rectangle.js +1638 -3262
- package/Rectangle.js.map +7 -1
- package/Sankey.config.js +291 -626
- package/Sankey.config.js.map +7 -1
- package/Sankey.js +2737 -4909
- package/Sankey.js.map +7 -1
- package/Scatter.config.js +876 -1194
- package/Scatter.config.js.map +7 -1
- package/Scatter.js +2532 -4470
- package/Scatter.js.map +7 -1
- package/SingleValue.config.js +819 -1251
- package/SingleValue.config.js.map +7 -1
- package/SingleValue.js +4203 -7413
- package/SingleValue.js.map +7 -1
- package/SingleValueBasic.js +382 -1527
- package/SingleValueBasic.js.map +7 -1
- package/SingleValueIcon.config.js +781 -1207
- package/SingleValueIcon.config.js.map +7 -1
- package/SingleValueIcon.js +3350 -6285
- package/SingleValueIcon.js.map +7 -1
- package/SingleValueRadial.config.js +708 -1119
- package/SingleValueRadial.config.js.map +7 -1
- package/SingleValueRadial.js +3808 -6965
- package/SingleValueRadial.js.map +7 -1
- package/SparkLine.js +439 -746
- package/SparkLine.js.map +7 -1
- package/Table.config.js +565 -887
- package/Table.config.js.map +7 -1
- package/Table.js +3277 -5386
- package/Table.js.map +7 -1
- package/common/Charting.js +484 -1462
- package/common/Charting.js.map +7 -1
- package/common/ChartingApi.js +46 -170
- package/common/ChartingApi.js.map +7 -1
- package/common/DocExampleWithVizSandbox.js +270 -473
- package/common/DocExampleWithVizSandbox.js.map +7 -1
- package/common/EventsDoc.js +172 -464
- package/common/EventsDoc.js.map +7 -1
- package/common/GaugeMajorTicks.js +249 -347
- package/common/GaugeMajorTicks.js.map +7 -1
- package/common/GaugeValueMarker.js +201 -311
- package/common/GaugeValueMarker.js.map +7 -1
- package/common/OptionsDoc.js +347 -912
- package/common/OptionsDoc.js.map +7 -1
- package/common/OverviewDoc.js +435 -769
- package/common/OverviewDoc.js.map +7 -1
- package/common/SplunkVisualization.js +116 -259
- package/common/SplunkVisualization.js.map +7 -1
- package/common/SplunkVisualizationApi.js +40 -156
- package/common/SplunkVisualizationApi.js.map +7 -1
- package/common/ThemesDoc.js +271 -420
- package/common/ThemesDoc.js.map +7 -1
- package/common/chartingUtils.js +140 -312
- package/common/chartingUtils.js.map +7 -1
- package/common/docUtils.js +148 -266
- package/common/docUtils.js.map +7 -1
- package/common/gaugeUtils.js +280 -808
- package/common/gaugeUtils.js.map +7 -1
- package/common/shapeUtils.js +106 -211
- package/common/shapeUtils.js.map +7 -1
- package/common/utils/configUtils.js +126 -252
- package/common/utils/configUtils.js.map +7 -1
- package/common/utils/dataUtils.js +217 -812
- package/common/utils/dataUtils.js.map +7 -1
- package/common/utils/featureFlagUtils.js +53 -133
- package/common/utils/featureFlagUtils.js.map +7 -1
- package/common/utils/hocUtils.js +32 -122
- package/common/utils/hocUtils.js.map +7 -1
- package/common/utils/mapUtils.js +502 -1337
- package/common/utils/mapUtils.js.map +7 -1
- package/common/utils/singleValueUtils.js +462 -1010
- package/common/utils/singleValueUtils.js.map +7 -1
- package/common/utils/testHelper.js +92 -146
- package/common/utils/testHelper.js.map +7 -1
- package/common/utils/trellisUtils.js +237 -489
- package/common/utils/trellisUtils.js.map +7 -1
- package/common/utils/urlUtils.js +28 -112
- package/common/utils/urlUtils.js.map +7 -1
- package/common/withDashboardViz.js +1168 -2438
- package/common/withDashboardViz.js.map +7 -1
- package/package.json +52 -43
|
@@ -1,272 +1,211 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/******/ // 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 = 47);
|
|
91
|
-
/******/ })
|
|
92
|
-
/************************************************************************/
|
|
93
|
-
/******/ ({
|
|
94
|
-
|
|
95
|
-
/***/ 0:
|
|
96
|
-
/***/ (function(module, exports) {
|
|
97
|
-
|
|
98
|
-
module.exports = require("react");
|
|
99
|
-
|
|
100
|
-
/***/ }),
|
|
101
|
-
|
|
102
|
-
/***/ 1:
|
|
103
|
-
/***/ (function(module, exports) {
|
|
104
|
-
|
|
105
|
-
module.exports = require("prop-types");
|
|
106
|
-
|
|
107
|
-
/***/ }),
|
|
108
|
-
|
|
109
|
-
/***/ 20:
|
|
110
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
111
|
-
|
|
112
|
-
"use strict";
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Object.defineProperty(exports, "__esModule", {
|
|
116
|
-
value: true
|
|
117
|
-
});
|
|
118
|
-
exports.convertToDashboardJSON = exports.extractDataFromReactCode = exports.formatCodeStringToObject = exports.extractDocItems = exports.getFormatterClassdesc = void 0;
|
|
119
|
-
|
|
120
|
-
var React = __webpack_require__(0);
|
|
121
|
-
|
|
122
|
-
var UtilPage_1 = __webpack_require__(21);
|
|
123
|
-
|
|
124
|
-
var sharedSelectors = ['getField', 'getType', 'min', 'max'];
|
|
125
|
-
|
|
126
|
-
var formatSidebarItemName = function formatSidebarItemName(name, className) {
|
|
127
|
-
return sharedSelectors.find(function (sharedSelector) {
|
|
128
|
-
return name === sharedSelector;
|
|
129
|
-
}) ? "".concat(className, "#").concat(name) : name;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
var removePrependedClassName = function removePrependedClassName() {
|
|
133
|
-
var longname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
134
|
-
return longname.slice(longname.indexOf('#') + 1);
|
|
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;
|
|
135
25
|
};
|
|
136
|
-
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
longname: removePrependedClassName(doc.longname)
|
|
141
|
-
});
|
|
142
|
-
});
|
|
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 });
|
|
143
30
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
exports.getFormatterClassdesc = getFormatterClassdesc;
|
|
155
|
-
|
|
156
|
-
var extractDocItems = function extractDocItems(docs, className) {
|
|
157
|
-
var classHeaderDoc = docs[0];
|
|
158
|
-
var fileDoc = docs[docs.length - 1];
|
|
159
|
-
var filteredDocs = formatDSLSelectorDocs(docs).filter(function (_ref) {
|
|
160
|
-
var access = _ref.access,
|
|
161
|
-
comment = _ref.comment;
|
|
162
|
-
return access === 'public' && comment;
|
|
163
|
-
});
|
|
164
|
-
return filteredDocs.map(function (doc) {
|
|
165
|
-
return {
|
|
166
|
-
name: formatSidebarItemName(doc.name, className),
|
|
167
|
-
component: function UtilDoc() {
|
|
168
|
-
// named function so linter doesnt raise react/display-name error
|
|
169
|
-
return React.createElement(UtilPage_1.default, {
|
|
170
|
-
title: "".concat(className, "#").concat(doc.name),
|
|
171
|
-
status: 1,
|
|
172
|
-
docs: [classHeaderDoc, doc, fileDoc]
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
}).sort(function (a, b) {
|
|
177
|
-
return a.name.localeCompare(b.name);
|
|
178
|
-
});
|
|
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 });
|
|
36
|
+
}
|
|
37
|
+
return to;
|
|
179
38
|
};
|
|
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/common/DocExampleWithVizSandbox.tsx
|
|
51
|
+
var DocExampleWithVizSandbox_exports = {};
|
|
52
|
+
__export(DocExampleWithVizSandbox_exports, {
|
|
53
|
+
default: () => DocExampleWithVizSandbox_default
|
|
54
|
+
});
|
|
55
|
+
module.exports = __toCommonJS(DocExampleWithVizSandbox_exports);
|
|
180
56
|
|
|
181
|
-
|
|
57
|
+
// esm-externals:react
|
|
58
|
+
var react_exports = {};
|
|
59
|
+
__export(react_exports, {
|
|
60
|
+
default: () => react_default
|
|
61
|
+
});
|
|
62
|
+
var defaultImport = __toESM(require("react"));
|
|
63
|
+
__reExport(react_exports, require("react"));
|
|
64
|
+
var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
65
|
+
|
|
66
|
+
// esm-externals:@splunk/react-docs/DocExample
|
|
67
|
+
var DocExample_exports = {};
|
|
68
|
+
__export(DocExample_exports, {
|
|
69
|
+
default: () => DocExample_default
|
|
70
|
+
});
|
|
71
|
+
var defaultImport2 = __toESM(require("@splunk/react-docs/DocExample"));
|
|
72
|
+
__reExport(DocExample_exports, require("@splunk/react-docs/DocExample"));
|
|
73
|
+
var DocExample_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
74
|
+
|
|
75
|
+
// esm-externals:@splunk/react-ui/Button
|
|
76
|
+
var Button_exports = {};
|
|
77
|
+
__export(Button_exports, {
|
|
78
|
+
default: () => Button_default
|
|
79
|
+
});
|
|
80
|
+
var defaultImport3 = __toESM(require("@splunk/react-ui/Button"));
|
|
81
|
+
__reExport(Button_exports, require("@splunk/react-ui/Button"));
|
|
82
|
+
var Button_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
83
|
+
|
|
84
|
+
// esm-externals:@splunk/react-ui/Code
|
|
85
|
+
var Code_exports = {};
|
|
86
|
+
__export(Code_exports, {
|
|
87
|
+
default: () => Code_default
|
|
88
|
+
});
|
|
89
|
+
var defaultImport4 = __toESM(require("@splunk/react-ui/Code"));
|
|
90
|
+
__reExport(Code_exports, require("@splunk/react-ui/Code"));
|
|
91
|
+
var Code_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
92
|
+
|
|
93
|
+
// esm-externals:@splunk/react-ui/TransitionOpen
|
|
94
|
+
var TransitionOpen_exports = {};
|
|
95
|
+
__export(TransitionOpen_exports, {
|
|
96
|
+
default: () => TransitionOpen_default
|
|
97
|
+
});
|
|
98
|
+
var defaultImport5 = __toESM(require("@splunk/react-ui/TransitionOpen"));
|
|
99
|
+
__reExport(TransitionOpen_exports, require("@splunk/react-ui/TransitionOpen"));
|
|
100
|
+
var TransitionOpen_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
101
|
+
|
|
102
|
+
// esm-externals:@splunk/react-icons/SquaresLayered
|
|
103
|
+
var SquaresLayered_exports = {};
|
|
104
|
+
__export(SquaresLayered_exports, {
|
|
105
|
+
default: () => SquaresLayered_default
|
|
106
|
+
});
|
|
107
|
+
var defaultImport6 = __toESM(require("@splunk/react-icons/SquaresLayered"));
|
|
108
|
+
__reExport(SquaresLayered_exports, require("@splunk/react-icons/SquaresLayered"));
|
|
109
|
+
var SquaresLayered_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
110
|
+
|
|
111
|
+
// esm-externals:@splunk/react-icons/Checkmark
|
|
112
|
+
var Checkmark_exports = {};
|
|
113
|
+
__export(Checkmark_exports, {
|
|
114
|
+
default: () => Checkmark_default
|
|
115
|
+
});
|
|
116
|
+
var defaultImport7 = __toESM(require("@splunk/react-icons/Checkmark"));
|
|
117
|
+
__reExport(Checkmark_exports, require("@splunk/react-icons/Checkmark"));
|
|
118
|
+
var Checkmark_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
119
|
+
|
|
120
|
+
// esm-externals:@splunk/react-icons/EyeSlashed
|
|
121
|
+
var EyeSlashed_exports = {};
|
|
122
|
+
__export(EyeSlashed_exports, {
|
|
123
|
+
default: () => EyeSlashed_default
|
|
124
|
+
});
|
|
125
|
+
var defaultImport8 = __toESM(require("@splunk/react-icons/EyeSlashed"));
|
|
126
|
+
__reExport(EyeSlashed_exports, require("@splunk/react-icons/EyeSlashed"));
|
|
127
|
+
var EyeSlashed_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
128
|
+
|
|
129
|
+
// esm-externals:@splunk/react-icons/WindowChevronsSlash
|
|
130
|
+
var WindowChevronsSlash_exports = {};
|
|
131
|
+
__export(WindowChevronsSlash_exports, {
|
|
132
|
+
default: () => WindowChevronsSlash_default
|
|
133
|
+
});
|
|
134
|
+
var defaultImport9 = __toESM(require("@splunk/react-icons/WindowChevronsSlash"));
|
|
135
|
+
__reExport(WindowChevronsSlash_exports, require("@splunk/react-icons/WindowChevronsSlash"));
|
|
136
|
+
var WindowChevronsSlash_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
137
|
+
|
|
138
|
+
// esm-externals:@splunk/ui-utils/i18n
|
|
139
|
+
var i18n_exports = {};
|
|
140
|
+
__export(i18n_exports, {
|
|
141
|
+
default: () => i18n_default
|
|
142
|
+
});
|
|
143
|
+
var defaultImport10 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
144
|
+
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
145
|
+
var i18n_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
|
|
146
|
+
|
|
147
|
+
// esm-externals:prop-types
|
|
148
|
+
var prop_types_exports = {};
|
|
149
|
+
__export(prop_types_exports, {
|
|
150
|
+
default: () => prop_types_default
|
|
151
|
+
});
|
|
152
|
+
var defaultImport11 = __toESM(require("prop-types"));
|
|
153
|
+
__reExport(prop_types_exports, require("prop-types"));
|
|
154
|
+
var prop_types_default = "default" in defaultImport11 ? defaultImport11.default : defaultImport11;
|
|
155
|
+
|
|
156
|
+
// esm-externals:@splunk/react-docs/UtilPage
|
|
157
|
+
var UtilPage_exports = {};
|
|
158
|
+
__export(UtilPage_exports, {
|
|
159
|
+
default: () => UtilPage_default
|
|
160
|
+
});
|
|
161
|
+
var defaultImport12 = __toESM(require("@splunk/react-docs/UtilPage"));
|
|
162
|
+
__reExport(UtilPage_exports, require("@splunk/react-docs/UtilPage"));
|
|
163
|
+
var UtilPage_default = "default" in defaultImport12 ? defaultImport12.default : defaultImport12;
|
|
182
164
|
|
|
183
|
-
|
|
184
|
-
|
|
165
|
+
// src/common/docUtils.tsx
|
|
166
|
+
var formatCodeStringToObject = (codeString, regexMatch) => {
|
|
167
|
+
const match = regexMatch.exec(codeString);
|
|
185
168
|
if (!match) return null;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
var singleQuotes = doubleQuotes.replace(/`/g, "'"); // add quotes around keys
|
|
195
|
-
|
|
196
|
-
var quotesAroundKeys = singleQuotes.replace(/\b(\w+)\s*:(?=\s)/g, '"$1":');
|
|
197
|
-
var retval = null;
|
|
198
|
-
|
|
169
|
+
const stringToParse = `{${match[1]}}`;
|
|
170
|
+
const removedCommas = stringToParse.replace(/,(?!\s*?[-{["'\w])/g, "");
|
|
171
|
+
const backQuotes = removedCommas.replace(/"/g, "`");
|
|
172
|
+
const doubleQuotes = backQuotes.replace(/'/g, '"');
|
|
173
|
+
const singleQuotes = doubleQuotes.replace(/`/g, "'");
|
|
174
|
+
const quotesAroundKeys = singleQuotes.replace(/\b(\w+)\s*:(?=\s)/g, '"$1":');
|
|
175
|
+
let retval = null;
|
|
199
176
|
try {
|
|
200
177
|
retval = JSON.parse(quotesAroundKeys);
|
|
201
178
|
} catch (e) {
|
|
202
|
-
// eslint-disable-next-line no-console
|
|
203
179
|
console.error(e);
|
|
204
180
|
}
|
|
205
|
-
|
|
206
181
|
return retval;
|
|
207
182
|
};
|
|
208
|
-
|
|
209
|
-
exports.formatCodeStringToObject = formatCodeStringToObject;
|
|
210
|
-
|
|
211
|
-
var extractDataFromReactCode = function extractDataFromReactCode(codeString) {
|
|
183
|
+
var extractDataFromReactCode = (codeString) => {
|
|
212
184
|
var _a;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
var options = (0, exports.formatCodeStringToObject)(codeString, optionsRegex);
|
|
221
|
-
var contextRegex = /context={{([\s\S]*?)}}/;
|
|
222
|
-
var context = (0, exports.formatCodeStringToObject)(codeString, contextRegex);
|
|
223
|
-
return {
|
|
224
|
-
primary: primary,
|
|
225
|
-
options: options,
|
|
226
|
-
context: context
|
|
227
|
-
};
|
|
185
|
+
const primaryRegex = /dataSources={{([\s\S]*?primary:[\s\S]*?)}}/;
|
|
186
|
+
const { primary } = (_a = formatCodeStringToObject(codeString, primaryRegex)) != null ? _a : {};
|
|
187
|
+
const optionsRegex = /options={{([\s\S]*?)}}/;
|
|
188
|
+
const options = formatCodeStringToObject(codeString, optionsRegex);
|
|
189
|
+
const contextRegex = /context={{([\s\S]*?)}}/;
|
|
190
|
+
const context = formatCodeStringToObject(codeString, contextRegex);
|
|
191
|
+
return { primary, options, context };
|
|
228
192
|
};
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
// e.g. codeString: '<Area dataSources={{}} options={{}} />'
|
|
233
|
-
// type: 'splunk.area'
|
|
234
|
-
|
|
235
|
-
var convertToDashboardJSON = function convertToDashboardJSON(codeString, type) {
|
|
236
|
-
var _ref3 = (0, exports.extractDataFromReactCode)(codeString),
|
|
237
|
-
options = _ref3.options,
|
|
238
|
-
primary = _ref3.primary,
|
|
239
|
-
context = _ref3.context;
|
|
240
|
-
|
|
241
|
-
return Object.assign(Object.assign({
|
|
193
|
+
var convertToDashboardJSON = (codeString, type) => {
|
|
194
|
+
const { options, primary, context } = extractDataFromReactCode(codeString);
|
|
195
|
+
return __spreadProps(__spreadValues({
|
|
242
196
|
visualizations: {
|
|
243
|
-
test_viz:
|
|
244
|
-
type
|
|
245
|
-
}, options ? {
|
|
246
|
-
options: options
|
|
247
|
-
} : {}), primary ? {
|
|
248
|
-
dataSources: {
|
|
249
|
-
primary: 'primary'
|
|
250
|
-
}
|
|
251
|
-
} : {}), context ? {
|
|
252
|
-
context: context
|
|
253
|
-
} : {})
|
|
197
|
+
test_viz: __spreadValues(__spreadValues(__spreadValues({
|
|
198
|
+
type
|
|
199
|
+
}, options ? { options } : {}), primary ? { dataSources: { primary: "primary" } } : {}), context ? { context } : {})
|
|
254
200
|
}
|
|
255
|
-
}, primary ? {
|
|
256
|
-
dataSources: {
|
|
257
|
-
primary: {
|
|
258
|
-
type: 'ds.test',
|
|
259
|
-
options: primary
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
} : {}), {
|
|
201
|
+
}, primary ? { dataSources: { primary: { type: "ds.test", options: primary } } } : {}), {
|
|
263
202
|
defaults: {
|
|
264
203
|
dataSources: {
|
|
265
204
|
global: {
|
|
266
205
|
options: {
|
|
267
206
|
queryParameters: {
|
|
268
|
-
latest:
|
|
269
|
-
earliest:
|
|
207
|
+
latest: "$global_time.latest$",
|
|
208
|
+
earliest: "$global_time.earliest$"
|
|
270
209
|
}
|
|
271
210
|
}
|
|
272
211
|
}
|
|
@@ -274,254 +213,112 @@ var convertToDashboardJSON = function convertToDashboardJSON(codeString, type) {
|
|
|
274
213
|
},
|
|
275
214
|
inputs: {
|
|
276
215
|
input_global_trp: {
|
|
277
|
-
type:
|
|
216
|
+
type: "input.timerange",
|
|
278
217
|
options: {
|
|
279
|
-
token:
|
|
280
|
-
defaultValue:
|
|
218
|
+
token: "global_time",
|
|
219
|
+
defaultValue: "-24h@h,now"
|
|
281
220
|
},
|
|
282
|
-
title:
|
|
221
|
+
title: "Global Time Range"
|
|
283
222
|
}
|
|
284
223
|
},
|
|
285
224
|
layout: {
|
|
286
|
-
type:
|
|
225
|
+
type: "absolute",
|
|
287
226
|
options: {},
|
|
288
|
-
structure: [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
227
|
+
structure: [
|
|
228
|
+
{
|
|
229
|
+
item: "test_viz",
|
|
230
|
+
type: "block",
|
|
231
|
+
position: {
|
|
232
|
+
x: 0,
|
|
233
|
+
y: 0,
|
|
234
|
+
w: 800,
|
|
235
|
+
h: 500
|
|
236
|
+
}
|
|
296
237
|
}
|
|
297
|
-
|
|
298
|
-
globalInputs: [
|
|
238
|
+
],
|
|
239
|
+
globalInputs: ["input_global_trp"]
|
|
299
240
|
}
|
|
300
241
|
});
|
|
301
242
|
};
|
|
302
243
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
/***/ }),
|
|
313
|
-
|
|
314
|
-
/***/ 47:
|
|
315
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
316
|
-
|
|
317
|
-
"use strict";
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
var _slicedToArray = __webpack_require__(8);
|
|
321
|
-
|
|
322
|
-
Object.defineProperty(exports, "__esModule", {
|
|
323
|
-
value: true
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
var React = __webpack_require__(0);
|
|
327
|
-
|
|
328
|
-
var DocExample_1 = __webpack_require__(48);
|
|
329
|
-
|
|
330
|
-
var Button_1 = __webpack_require__(49);
|
|
331
|
-
|
|
332
|
-
var Code_1 = __webpack_require__(50);
|
|
333
|
-
|
|
334
|
-
var TransitionOpen_1 = __webpack_require__(51);
|
|
335
|
-
|
|
336
|
-
var SquaresLayered_1 = __webpack_require__(52);
|
|
337
|
-
|
|
338
|
-
var Checkmark_1 = __webpack_require__(53);
|
|
339
|
-
|
|
340
|
-
var EyeSlashed_1 = __webpack_require__(54);
|
|
341
|
-
|
|
342
|
-
var WindowChevronsSlash_1 = __webpack_require__(55);
|
|
343
|
-
|
|
344
|
-
var i18n_1 = __webpack_require__(5);
|
|
345
|
-
|
|
346
|
-
var T = __webpack_require__(1);
|
|
347
|
-
|
|
348
|
-
var docUtils_1 = __webpack_require__(20);
|
|
349
|
-
|
|
350
|
-
var DocExampleWithVizSandbox = function DocExampleWithVizSandbox(props) {
|
|
351
|
-
var type = props.type,
|
|
352
|
-
title = props.title,
|
|
353
|
-
code = props.code,
|
|
354
|
-
example = props.example,
|
|
355
|
-
_props$hideSandbox = props.hideSandbox,
|
|
356
|
-
hideSandbox = _props$hideSandbox === void 0 ? false : _props$hideSandbox,
|
|
357
|
-
description = props.description;
|
|
358
|
-
|
|
359
|
-
var _React$useState = React.useState(false),
|
|
360
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
361
|
-
isCopied = _React$useState2[0],
|
|
362
|
-
setIsCopied = _React$useState2[1];
|
|
363
|
-
|
|
364
|
-
var _React$useState3 = React.useState(false),
|
|
365
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
366
|
-
showCode = _React$useState4[0],
|
|
367
|
-
setShowCode = _React$useState4[1];
|
|
368
|
-
|
|
369
|
-
var isMounted = React.useRef(true);
|
|
370
|
-
var toggleShowCode = React.useCallback(function () {
|
|
371
|
-
setShowCode(function (state) {
|
|
372
|
-
return !state;
|
|
373
|
-
});
|
|
244
|
+
// src/common/DocExampleWithVizSandbox.tsx
|
|
245
|
+
var DocExampleWithVizSandbox = (props) => {
|
|
246
|
+
const { type, title, code, example, hideSandbox = false, description } = props;
|
|
247
|
+
const [isCopied, setIsCopied] = react_exports.useState(false);
|
|
248
|
+
const [showCode, setShowCode] = react_exports.useState(false);
|
|
249
|
+
const isMounted = react_exports.useRef(true);
|
|
250
|
+
const toggleShowCode = react_exports.useCallback(() => {
|
|
251
|
+
setShowCode((state) => !state);
|
|
374
252
|
}, []);
|
|
375
|
-
|
|
376
|
-
return
|
|
253
|
+
react_exports.useEffect(() => {
|
|
254
|
+
return () => {
|
|
377
255
|
isMounted.current = false;
|
|
378
256
|
setIsCopied(false);
|
|
379
|
-
};
|
|
257
|
+
};
|
|
380
258
|
}, []);
|
|
381
|
-
if (hideSandbox) return
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
var objDefn = (0, docUtils_1.convertToDashboardJSON)(code, type); // set spacing level to 4
|
|
387
|
-
|
|
388
|
-
var prettyJson = JSON.stringify(objDefn, null, 4);
|
|
389
|
-
|
|
390
|
-
var copyToClipBoard = function copyToClipBoard() {
|
|
391
|
-
if ('clipboard' in navigator) {
|
|
259
|
+
if (hideSandbox) return /* @__PURE__ */ react_exports.createElement(DocExample_default, { title, code, example });
|
|
260
|
+
const objDefn = convertToDashboardJSON(code, type);
|
|
261
|
+
const prettyJson = JSON.stringify(objDefn, null, 4);
|
|
262
|
+
const copyToClipBoard = () => {
|
|
263
|
+
if ("clipboard" in navigator) {
|
|
392
264
|
navigator.clipboard.writeText(prettyJson);
|
|
393
265
|
setIsCopied(true);
|
|
394
266
|
}
|
|
395
|
-
|
|
396
|
-
setTimeout(function () {
|
|
267
|
+
setTimeout(() => {
|
|
397
268
|
if (isMounted.current) {
|
|
398
269
|
setIsCopied(false);
|
|
399
270
|
}
|
|
400
|
-
},
|
|
271
|
+
}, 5e3);
|
|
401
272
|
};
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
273
|
+
const renderAdditionalActions = () => [
|
|
274
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
275
|
+
Button_default,
|
|
276
|
+
{
|
|
277
|
+
key: "show-dashboard-definition",
|
|
278
|
+
appearance: "toggle",
|
|
279
|
+
onClick: toggleShowCode,
|
|
280
|
+
icon: showCode ? /* @__PURE__ */ react_exports.createElement(EyeSlashed_default, null) : /* @__PURE__ */ react_exports.createElement(WindowChevronsSlash_default, null),
|
|
281
|
+
label: showCode ? (0, i18n_exports._)("Hide dashboard definition") : (0, i18n_exports._)("Show dashboard definition")
|
|
282
|
+
}
|
|
283
|
+
)
|
|
284
|
+
];
|
|
285
|
+
return /* @__PURE__ */ react_exports.createElement(
|
|
286
|
+
DocExample_default,
|
|
287
|
+
{
|
|
288
|
+
renderAdditionalActions,
|
|
289
|
+
title,
|
|
290
|
+
code,
|
|
291
|
+
example,
|
|
292
|
+
description
|
|
293
|
+
},
|
|
294
|
+
/* @__PURE__ */ react_exports.createElement(
|
|
295
|
+
TransitionOpen_default,
|
|
296
|
+
{
|
|
297
|
+
animation: "slideFromTop",
|
|
298
|
+
open: showCode,
|
|
299
|
+
retainFocus: false,
|
|
300
|
+
takeFocus: false,
|
|
301
|
+
renderChildrenWhenCollapsed: false,
|
|
302
|
+
animateOnMount: false
|
|
303
|
+
},
|
|
304
|
+
/* @__PURE__ */ react_exports.createElement("div", { style: { display: "flex", justifyContent: "space-between" } }, /* @__PURE__ */ react_exports.createElement(Code_default, { value: prettyJson, language: "json" }), /* @__PURE__ */ react_exports.createElement(
|
|
305
|
+
Button_default,
|
|
306
|
+
{
|
|
307
|
+
onClick: copyToClipBoard,
|
|
308
|
+
icon: isCopied ? /* @__PURE__ */ react_exports.createElement(Checkmark_default, null) : /* @__PURE__ */ react_exports.createElement(SquaresLayered_default, null),
|
|
309
|
+
label: isCopied ? (0, i18n_exports._)("Copied") : (0, i18n_exports._)("Copy to clipboard"),
|
|
310
|
+
style: { height: "30px", maxWidth: "164px" }
|
|
311
|
+
}
|
|
312
|
+
))
|
|
313
|
+
)
|
|
314
|
+
);
|
|
443
315
|
};
|
|
444
|
-
|
|
445
316
|
DocExampleWithVizSandbox.propTypes = {
|
|
446
|
-
type:
|
|
447
|
-
title:
|
|
448
|
-
code:
|
|
449
|
-
example:
|
|
450
|
-
hideSandbox:
|
|
317
|
+
type: prop_types_exports.string,
|
|
318
|
+
title: prop_types_exports.string,
|
|
319
|
+
code: prop_types_exports.string,
|
|
320
|
+
example: prop_types_exports.func,
|
|
321
|
+
hideSandbox: prop_types_exports.bool
|
|
451
322
|
};
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
/***/ }),
|
|
455
|
-
|
|
456
|
-
/***/ 48:
|
|
457
|
-
/***/ (function(module, exports) {
|
|
458
|
-
|
|
459
|
-
module.exports = require("@splunk/react-docs/DocExample");
|
|
460
|
-
|
|
461
|
-
/***/ }),
|
|
462
|
-
|
|
463
|
-
/***/ 49:
|
|
464
|
-
/***/ (function(module, exports) {
|
|
465
|
-
|
|
466
|
-
module.exports = require("@splunk/react-ui/Button");
|
|
467
|
-
|
|
468
|
-
/***/ }),
|
|
469
|
-
|
|
470
|
-
/***/ 5:
|
|
471
|
-
/***/ (function(module, exports) {
|
|
472
|
-
|
|
473
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
474
|
-
|
|
475
|
-
/***/ }),
|
|
476
|
-
|
|
477
|
-
/***/ 50:
|
|
478
|
-
/***/ (function(module, exports) {
|
|
479
|
-
|
|
480
|
-
module.exports = require("@splunk/react-ui/Code");
|
|
481
|
-
|
|
482
|
-
/***/ }),
|
|
483
|
-
|
|
484
|
-
/***/ 51:
|
|
485
|
-
/***/ (function(module, exports) {
|
|
486
|
-
|
|
487
|
-
module.exports = require("@splunk/react-ui/TransitionOpen");
|
|
488
|
-
|
|
489
|
-
/***/ }),
|
|
490
|
-
|
|
491
|
-
/***/ 52:
|
|
492
|
-
/***/ (function(module, exports) {
|
|
493
|
-
|
|
494
|
-
module.exports = require("@splunk/react-icons/SquaresLayered");
|
|
495
|
-
|
|
496
|
-
/***/ }),
|
|
497
|
-
|
|
498
|
-
/***/ 53:
|
|
499
|
-
/***/ (function(module, exports) {
|
|
500
|
-
|
|
501
|
-
module.exports = require("@splunk/react-icons/Checkmark");
|
|
502
|
-
|
|
503
|
-
/***/ }),
|
|
504
|
-
|
|
505
|
-
/***/ 54:
|
|
506
|
-
/***/ (function(module, exports) {
|
|
507
|
-
|
|
508
|
-
module.exports = require("@splunk/react-icons/EyeSlashed");
|
|
509
|
-
|
|
510
|
-
/***/ }),
|
|
511
|
-
|
|
512
|
-
/***/ 55:
|
|
513
|
-
/***/ (function(module, exports) {
|
|
514
|
-
|
|
515
|
-
module.exports = require("@splunk/react-icons/WindowChevronsSlash");
|
|
516
|
-
|
|
517
|
-
/***/ }),
|
|
518
|
-
|
|
519
|
-
/***/ 8:
|
|
520
|
-
/***/ (function(module, exports) {
|
|
521
|
-
|
|
522
|
-
module.exports = require("@babel/runtime/helpers/slicedToArray");
|
|
523
|
-
|
|
524
|
-
/***/ })
|
|
525
|
-
|
|
526
|
-
/******/ });
|
|
527
|
-
//# sourceMappingURL=DocExampleWithVizSandbox.js.map
|
|
323
|
+
var DocExampleWithVizSandbox_default = DocExampleWithVizSandbox;
|
|
324
|
+
//# sourceMappingURL=DocExampleWithVizSandbox.js.map
|