@splunk/visualizations 24.3.2 → 24.3.3
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/.loki/reference/chrome_docker_PureVisualizations_PureMap_Tooltip_Dark.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_basic.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_bubble_layer_geostats_by.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_off.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_unit_metric.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Additional_Cases.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Mostly_null.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Restricted_Zoom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Set_Map_tiles.png +0 -0
- package/Area.js +121 -65
- package/Area.js.map +1 -1
- package/Bar.js +121 -65
- package/Bar.js.map +1 -1
- package/Bubble.js +121 -65
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.js +142 -73
- package/ChoroplethSvg.js.map +1 -1
- package/Column.js +121 -65
- package/Column.js.map +1 -1
- package/Ellipse.js +121 -65
- package/Ellipse.js.map +1 -1
- package/FillerGauge.js +121 -65
- package/FillerGauge.js.map +1 -1
- package/Image.js +125 -69
- package/Image.js.map +1 -1
- package/Line.js +121 -65
- package/Line.js.map +1 -1
- package/LinkGraph.js +121 -65
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +16 -6
- package/Map.config.js.map +1 -1
- package/Map.js +430 -126
- package/Map.js.map +1 -1
- package/Markdown.js +131 -75
- package/Markdown.js.map +1 -1
- package/MarkerGauge.js +135 -79
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.js +140 -83
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.js +133 -77
- package/Pie.js.map +1 -1
- package/Punchcard.js +144 -87
- package/Punchcard.js.map +1 -1
- package/Rectangle.js +129 -73
- package/Rectangle.js.map +1 -1
- package/Sankey.js +204 -148
- package/Sankey.js.map +1 -1
- package/Scatter.js +131 -75
- package/Scatter.js.map +1 -1
- package/SingleValue.js +160 -104
- package/SingleValue.js.map +1 -1
- package/SingleValueIcon.js +135 -78
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.js +202 -146
- package/SingleValueRadial.js.map +1 -1
- package/Table.js +236 -180
- package/Table.js.map +1 -1
- package/common/utils/hocUtils.js +65 -9
- package/common/utils/hocUtils.js.map +1 -1
- package/common/withDashboardViz.js +68 -12
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +9 -9
package/common/utils/hocUtils.js
CHANGED
|
@@ -110,7 +110,7 @@ var _typeof = __webpack_require__(11);
|
|
|
110
110
|
Object.defineProperty(exports, "__esModule", {
|
|
111
111
|
value: true
|
|
112
112
|
});
|
|
113
|
-
exports.
|
|
113
|
+
exports.findClosestMatchFromDefaultList = exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
|
|
114
114
|
|
|
115
115
|
var lodash_1 = __webpack_require__(0);
|
|
116
116
|
/**
|
|
@@ -136,17 +136,19 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
136
136
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
137
137
|
/**
|
|
138
138
|
* helper to deeply merge objects while preserving arrays in earlier source objects
|
|
139
|
-
* deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays will be preserved if already present in the resultant merged object
|
|
140
|
-
* this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)
|
|
139
|
+
* deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object
|
|
140
|
+
* this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).
|
|
141
|
+
* Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair
|
|
142
|
+
* will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.
|
|
141
143
|
*
|
|
142
|
-
* @method
|
|
144
|
+
* @method deepMergeWithArrayPrimitiveOverrides
|
|
143
145
|
* @param {Object} initial - target object to merge values into
|
|
144
146
|
* @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones
|
|
145
147
|
*
|
|
146
148
|
* @returns {Object}
|
|
147
149
|
*/
|
|
148
150
|
|
|
149
|
-
var
|
|
151
|
+
var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
|
|
150
152
|
var clone = lodash_1.cloneDeep(initial);
|
|
151
153
|
|
|
152
154
|
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -157,18 +159,72 @@ var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial)
|
|
|
157
159
|
Object.keys(sourceToApply).forEach(function (sourceKey) {
|
|
158
160
|
if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
|
|
159
161
|
clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
+
}
|
|
162
163
|
|
|
163
164
|
if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
|
|
164
|
-
clone[sourceKey] = exports.
|
|
165
|
+
clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
|
|
166
|
+
} else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
|
|
167
|
+
// If option is an array of objects
|
|
168
|
+
for (var i = 0; i < clone[sourceKey].length; i += 1) {
|
|
169
|
+
if (_typeof(clone[sourceKey][i]) === 'object') {
|
|
170
|
+
var closestMatchIdx = exports.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
|
|
171
|
+
|
|
172
|
+
if (closestMatchIdx > -1) {
|
|
173
|
+
clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
165
177
|
}
|
|
166
178
|
});
|
|
167
179
|
});
|
|
168
180
|
return clone;
|
|
169
181
|
};
|
|
170
182
|
|
|
171
|
-
exports.
|
|
183
|
+
exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
|
|
184
|
+
/**
|
|
185
|
+
* Finds the closest matching object from the list, which has the max same key value pairs.
|
|
186
|
+
* Returns the index of match if found, or -1
|
|
187
|
+
* For eg :-
|
|
188
|
+
const list = [{
|
|
189
|
+
type: "marker",
|
|
190
|
+
lat: "value1"
|
|
191
|
+
}, {
|
|
192
|
+
type: "bubble",
|
|
193
|
+
size: "value2"
|
|
194
|
+
}];
|
|
195
|
+
|
|
196
|
+
const obj = {
|
|
197
|
+
type: 'bubble'
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
findClosestMatch(list, obj) -> returns index 1.
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
|
|
204
|
+
if (!Array.isArray(searchList) || searchList.length === 0) {
|
|
205
|
+
return -1;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
var keys = Object.keys(inputObj);
|
|
209
|
+
var maxMatchCnt = 0;
|
|
210
|
+
var maxMatchIdx = 0;
|
|
211
|
+
searchList.forEach(function (item, idx) {
|
|
212
|
+
var matchCnt = 0;
|
|
213
|
+
keys.forEach(function (key) {
|
|
214
|
+
if (item[key] === inputObj[key]) {
|
|
215
|
+
matchCnt += 1;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
|
|
220
|
+
maxMatchCnt = matchCnt;
|
|
221
|
+
maxMatchIdx = idx;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
return maxMatchIdx;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
|
|
172
228
|
|
|
173
229
|
/***/ }),
|
|
174
230
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/common/utils/hocUtils.ts","webpack:///external \"@babel/runtime/helpers/typeof\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,mC;;;;;;;;;;;;;;;;;ACAA;AAKA;;;;;AAKG;;;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GAfD;AAgBA,SAAO,KAAP;AACH,CAnBM;;AAAM,sCAA2B,2BAA3B,C;;;;;;;ACrCb,0D","file":"hocUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = require(\"lodash\");","import { cloneDeep } from 'lodash';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\n\nexport type DashboardVizType = React.ComponentType<DashboardVizProps>;\n\n/**\n * @method extendStaticWrapperProps\n * @param {Object} props\n * @param {DashboardVizType} props.Wrapper\n * @param {DashboardVizType} props.Visualization\n */\nexport const extendStaticWrapperProps = ({\n Wrapper,\n Visualization,\n}: {\n [key: string]: DashboardVizType;\n}): void => {\n const extendProperties = ['propTypes', 'defaultProps', 'config'];\n extendProperties.forEach((prop: string): void => {\n if (Visualization[prop]) {\n // eslint-disable-next-line no-param-reassign\n Wrapper[prop] = Visualization[prop];\n }\n });\n};\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays will be preserved if already present in the resultant merged object\n * this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)\n *\n * @method deepMergeWithArrayOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n // object merging excluding arrays\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayOverrides(clone[sourceKey], sourceToApply[sourceKey]);\n }\n });\n });\n return clone;\n};\n","module.exports = require(\"@babel/runtime/helpers/typeof\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/common/utils/hocUtils.ts","webpack:///external \"@babel/runtime/helpers/typeof\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,mC;;;;;;;;;;;;;;;;;ACAA;AAKA;;;;;AAKG;;;AACI,IAAM,wBAAwB,GAAG,SAA3B,wBAA2B,OAK7B;AAAA,MAJP,OAIO,QAJP,OAIO;AAAA,MAHP,aAGO,QAHP,aAGO;AACP,MAAM,gBAAgB,GAAG,CA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AAc,QAAQ,CAAC,GAAD,CAA1B,EAAiC;AAC7B,gBAAQ,IAAI,CAAZ;AACH;AACJ,KAJD;;AAKA,QAAI,IAAI,CAAC,GAAL,CAAS,WAAT,EAAsB,QAAtB,IAAkC,WAAtC,EAAmD;AAC/C,iBAAW,GAAG,QAAd;AACA,iBAAW,GAAG,GAAd;AACH;AACJ,GAXD;AAYA,SAAO,WAAP;AACH,CAxBM;;AAAM,0CAA+B,+BAA/B,C;;;;;;;ACpGb,0D","file":"hocUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = require(\"lodash\");","import { cloneDeep } from 'lodash';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\n\nexport type DashboardVizType = React.ComponentType<DashboardVizProps>;\n\n/**\n * @method extendStaticWrapperProps\n * @param {Object} props\n * @param {DashboardVizType} props.Wrapper\n * @param {DashboardVizType} props.Visualization\n */\nexport const extendStaticWrapperProps = ({\n Wrapper,\n Visualization,\n}: {\n [key: string]: DashboardVizType;\n}): void => {\n const extendProperties = ['propTypes', 'defaultProps', 'config'];\n extendProperties.forEach((prop: string): void => {\n if (Visualization[prop]) {\n // eslint-disable-next-line no-param-reassign\n Wrapper[prop] = Visualization[prop];\n }\n });\n};\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object\n * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).\n * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair\n * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.\n *\n * @method deepMergeWithArrayPrimitiveOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayPrimitiveOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey],\n sourceToApply[sourceKey]\n );\n } else if (\n Array.isArray(clone[sourceKey]) &&\n typeof clone[sourceKey][0] === 'object' &&\n !Array.isArray(clone[sourceKey][0])\n ) {\n // If option is an array of objects\n for (let i = 0; i < clone[sourceKey].length; i += 1) {\n if (typeof clone[sourceKey][i] === 'object') {\n const closestMatchIdx = findClosestMatchFromDefaultList(\n sourceToApply[sourceKey],\n clone[sourceKey][i]\n );\n if (closestMatchIdx > -1) {\n clone[sourceKey][i] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey][i],\n sourceToApply[sourceKey][closestMatchIdx]\n );\n }\n }\n }\n }\n });\n });\n return clone;\n};\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n","module.exports = require(\"@babel/runtime/helpers/typeof\");"],"sourceRoot":""}
|
|
@@ -410,7 +410,7 @@ var _typeof = __webpack_require__(11);
|
|
|
410
410
|
Object.defineProperty(exports, "__esModule", {
|
|
411
411
|
value: true
|
|
412
412
|
});
|
|
413
|
-
exports.
|
|
413
|
+
exports.findClosestMatchFromDefaultList = exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
|
|
414
414
|
|
|
415
415
|
var lodash_1 = __webpack_require__(3);
|
|
416
416
|
/**
|
|
@@ -436,17 +436,19 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
436
436
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
437
437
|
/**
|
|
438
438
|
* helper to deeply merge objects while preserving arrays in earlier source objects
|
|
439
|
-
* deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays will be preserved if already present in the resultant merged object
|
|
440
|
-
* this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)
|
|
439
|
+
* deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object
|
|
440
|
+
* this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).
|
|
441
|
+
* Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair
|
|
442
|
+
* will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.
|
|
441
443
|
*
|
|
442
|
-
* @method
|
|
444
|
+
* @method deepMergeWithArrayPrimitiveOverrides
|
|
443
445
|
* @param {Object} initial - target object to merge values into
|
|
444
446
|
* @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones
|
|
445
447
|
*
|
|
446
448
|
* @returns {Object}
|
|
447
449
|
*/
|
|
448
450
|
|
|
449
|
-
var
|
|
451
|
+
var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
|
|
450
452
|
var clone = lodash_1.cloneDeep(initial);
|
|
451
453
|
|
|
452
454
|
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -457,18 +459,72 @@ var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial)
|
|
|
457
459
|
Object.keys(sourceToApply).forEach(function (sourceKey) {
|
|
458
460
|
if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
|
|
459
461
|
clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
+
}
|
|
462
463
|
|
|
463
464
|
if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
|
|
464
|
-
clone[sourceKey] = exports.
|
|
465
|
+
clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
|
|
466
|
+
} else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
|
|
467
|
+
// If option is an array of objects
|
|
468
|
+
for (var i = 0; i < clone[sourceKey].length; i += 1) {
|
|
469
|
+
if (_typeof(clone[sourceKey][i]) === 'object') {
|
|
470
|
+
var closestMatchIdx = exports.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
|
|
471
|
+
|
|
472
|
+
if (closestMatchIdx > -1) {
|
|
473
|
+
clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
465
477
|
}
|
|
466
478
|
});
|
|
467
479
|
});
|
|
468
480
|
return clone;
|
|
469
481
|
};
|
|
470
482
|
|
|
471
|
-
exports.
|
|
483
|
+
exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
|
|
484
|
+
/**
|
|
485
|
+
* Finds the closest matching object from the list, which has the max same key value pairs.
|
|
486
|
+
* Returns the index of match if found, or -1
|
|
487
|
+
* For eg :-
|
|
488
|
+
const list = [{
|
|
489
|
+
type: "marker",
|
|
490
|
+
lat: "value1"
|
|
491
|
+
}, {
|
|
492
|
+
type: "bubble",
|
|
493
|
+
size: "value2"
|
|
494
|
+
}];
|
|
495
|
+
|
|
496
|
+
const obj = {
|
|
497
|
+
type: 'bubble'
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
findClosestMatch(list, obj) -> returns index 1.
|
|
501
|
+
*/
|
|
502
|
+
|
|
503
|
+
var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
|
|
504
|
+
if (!Array.isArray(searchList) || searchList.length === 0) {
|
|
505
|
+
return -1;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
var keys = Object.keys(inputObj);
|
|
509
|
+
var maxMatchCnt = 0;
|
|
510
|
+
var maxMatchIdx = 0;
|
|
511
|
+
searchList.forEach(function (item, idx) {
|
|
512
|
+
var matchCnt = 0;
|
|
513
|
+
keys.forEach(function (key) {
|
|
514
|
+
if (item[key] === inputObj[key]) {
|
|
515
|
+
matchCnt += 1;
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
|
|
520
|
+
maxMatchCnt = matchCnt;
|
|
521
|
+
maxMatchIdx = idx;
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
return maxMatchIdx;
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
|
|
472
528
|
|
|
473
529
|
/***/ }),
|
|
474
530
|
/* 27 */,
|
|
@@ -549,7 +605,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
549
605
|
|
|
550
606
|
return React.createElement(FixSizeItem, {
|
|
551
607
|
"data-test": "fix-size-item",
|
|
552
|
-
"data-splunk-visualization-version": "24.3.
|
|
608
|
+
"data-splunk-visualization-version": "24.3.3 - 8d441d88c",
|
|
553
609
|
width: width,
|
|
554
610
|
height: height,
|
|
555
611
|
backgroundColor: backgroundColor
|
|
@@ -708,7 +764,7 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
708
764
|
try {
|
|
709
765
|
return Options_1.Options.evaluate({
|
|
710
766
|
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
711
|
-
options: hocUtils_1.
|
|
767
|
+
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
712
768
|
}, dataSources, themeFunc);
|
|
713
769
|
} catch (e) {
|
|
714
770
|
// eslint-disable-next-line no-console
|
|
@@ -1188,7 +1244,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1188
1244
|
componentId: "sc-1gsbnxb-0"
|
|
1189
1245
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1190
1246
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1191
|
-
'data-splunk-visualization-version': "24.3.
|
|
1247
|
+
'data-splunk-visualization-version': "24.3.3 - 8d441d88c"
|
|
1192
1248
|
}).withConfig({
|
|
1193
1249
|
displayName: "withEditModeCover__Blocker",
|
|
1194
1250
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"styled-components\"","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"@splunk/visualizations-shared/colorUtils\"","webpack:///external \"@splunk/visualizations-shared/Message\"","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///external \"@splunk/visualizations-shared/style\"","webpack:///./src/common/SplunkVisualization.tsx","webpack:///./src/common/interfaces/VizActionHandler.ts","webpack:///./src/common/utils/hocUtils.ts","webpack:///./src/common/hocs/FixedSizeContainer.tsx","webpack:///./src/common/withDashboardViz.tsx","webpack:///external \"@splunk/themes/getSettingsFromThemedProps\"","webpack:///external \"@splunk/visualization-encoding/Options\"","webpack:///external \"@splunk/visualizations-shared/SanitizeProps\"","webpack:///./src/common/hooks/getSorting.ts","webpack:///./src/common/interfaces/DataSource.ts","webpack:///./src/common/hooks/getPagination.ts","webpack:///./src/common/hooks/useDeepMemo.ts","webpack:///./src/common/utils/JSONSchemaUtils.ts","webpack:///./src/common/components/MissingPropsMessage.tsx","webpack:///external \"@splunk/visualizations-shared/SizeAwareWrapper\"","webpack:///./src/common/hocs/withEditModeCover.tsx","webpack:///./src/common/hocs/withPlaceholder.tsx","webpack:///./src/common/components/IconPlaceholder.tsx"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QA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IH,gBAAQ,EAAE,UAJP;AAKH,iBAAS,EAAE;AALR,OADsB;AAQ7B,WAAK,EAAE,KARsB;AAS7B,YAAM,EAAE;AATqB,KAA1B,CAAP;AAWH;;AAED,SAAO,oBAAC,iBAAD,EAAQ;AAAC,SAAK,EAAE,KAAR;AAAe,UAAM,EAAE,MAAvB;AAA+B,SAAK,EAAC,SAArC;AAA+C,WAAO,EAAE,SAAE,yBAAF;AAAxD,GAAR,CAAP;AACH,CAjBD;;AAmBA,eAAe,CAAC,SAAhB,GAA4B,SAA5B;AACA,eAAe,CAAC,YAAhB,GAA+B;AAC3B,OAAK,EAAE,MADoB;AAE3B,QAAM,EAAE;AAFmB,CAA/B;AAKA,kBAAe,6BAAuB,eAAvB,CAAf,C","file":"withDashboardViz.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 75);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"styled-components\");","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"@splunk/visualizations-shared/Message\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n","module.exports = require(\"@splunk/visualizations-shared/style\");","/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */\nimport * as T from 'prop-types';\nimport { noop } from 'lodash';\nimport { DashboardVizProps } from './interfaces/DashboardVizProps';\nimport { DefaultVizActionHandler } from './interfaces/VizActionHandler';\n\n// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations\nexport const INITIAL_WIDTH = 250;\nexport const INITIAL_HEIGHT = 250;\n\n/**\n * A Splunk visualization\n */\nclass SplunkVisualization {\n static propTypes: Record<keyof DashboardVizProps, T.Validator<any>> = {\n /**\n * display mode\n */\n mode: T.oneOf(['view', 'edit', 'export']).isRequired,\n /**\n * width in pixel or string, defaults to 100%\n */\n width: T.oneOfType([T.string, T.number]).isRequired,\n /**\n * height in pixel or string\n */\n height: T.oneOfType([T.string, T.number]).isRequired,\n /**\n * visualization context used for dynamic option evaluation\n */\n context: T.object,\n /**\n * visualization formatting options\n */\n options: T.object,\n /**\n * A callback to update formatting options\n */\n onOptionsChange: T.func,\n /**\n * datasource state which include data and request params, object key indicate the datasource type.\n */\n dataSources: T.objectOf(\n T.shape({\n /**\n * current request params\n */\n requestParams: T.object,\n /**\n * current dataset\n */\n data: T.shape({\n fields: T.array,\n columns: T.array,\n }),\n /**\n * error\n */\n error: T.shape({\n level: T.string,\n message: T.string,\n }),\n /**\n * meta data that came with the dataset\n */\n meta: T.object,\n })\n ),\n /**\n * A callback to trigger event\n */\n onEventTrigger: T.func,\n /**\n * Inform viz if there are handlers listening to events\n */\n hasEventHandlers: T.bool,\n /**\n * A callback to communicate computed props to a consumer\n */\n onComputedProps: T.func,\n /**\n * A callback to obtain visualization api\n */\n vizActionHandlerRef: T.func,\n\n loading: T.bool,\n theme: T.object,\n /**\n * A callback to request new data with updated request params\n */\n onRequestParamsChange: T.func,\n };\n\n /**\n *\n */\n static defaultProps: DashboardVizProps = {\n // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height\n width: '100%',\n height: INITIAL_HEIGHT,\n dataSources: {},\n onEventTrigger: (): Record<string, unknown> => ({}),\n mode: 'view',\n hasEventHandlers: false,\n options: {},\n context: {},\n onOptionsChange: (): Record<string, unknown> => ({}),\n vizActionHandlerRef: (): DefaultVizActionHandler => new DefaultVizActionHandler(),\n onComputedProps: (): Record<string, unknown> => ({}),\n loading: false,\n onRequestParamsChange: noop,\n };\n}\n\nexport default SplunkVisualization;\n","/* eslint-disable class-methods-use-this */\nexport interface VizActionHandler {\n /**\n * put focus on the visualization\n */\n focus(): void;\n\n /**\n * compute snapshot of this visualization\n */\n snapshot(): Record<string, unknown>; // (This is for pdf export)\n}\n\nexport class DefaultVizActionHandler {\n focus(): void {\n // noop\n }\n\n snapshot(): Record<string, unknown> {\n return null; // noop\n }\n}\n","import { cloneDeep } from 'lodash';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\n\nexport type DashboardVizType = React.ComponentType<DashboardVizProps>;\n\n/**\n * @method extendStaticWrapperProps\n * @param {Object} props\n * @param {DashboardVizType} props.Wrapper\n * @param {DashboardVizType} props.Visualization\n */\nexport const extendStaticWrapperProps = ({\n Wrapper,\n Visualization,\n}: {\n [key: string]: DashboardVizType;\n}): void => {\n const extendProperties = ['propTypes', 'defaultProps', 'config'];\n extendProperties.forEach((prop: string): void => {\n if (Visualization[prop]) {\n // eslint-disable-next-line no-param-reassign\n Wrapper[prop] = Visualization[prop];\n }\n });\n};\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays will be preserved if already present in the resultant merged object\n * this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)\n *\n * @method deepMergeWithArrayOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n // object merging excluding arrays\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayOverrides(clone[sourceKey], sourceToApply[sourceKey]);\n }\n });\n });\n return clone;\n};\n","import * as React from 'react';\nimport styled from 'styled-components';\nimport SizeAwareWrapper from '@splunk/visualizations-shared/SizeAwareWrapper';\nimport { toPx } from '@splunk/visualizations-shared/style';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\n\n// Global provided via webpack\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __VISION_VERSION__: string;\n\ninterface ItemProps {\n backgroundColor?: string;\n width?: string | number;\n}\n\nconst Item = styled.div.attrs<ItemProps>(({ width }) => ({\n style: {\n width: toPx(width),\n },\n}))<ItemProps>`\n position: relative;\n background-color: ${(props): string =>\n (isColor(props.backgroundColor) && props.backgroundColor) || props.theme.defaultBackgroundColor}};\n`;\n\ninterface FixSizeItemProps {\n backgroundColor?: string;\n height?: string | number;\n width?: string | number;\n}\n\n// Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291\nconst FixSizeItem = styled.div.attrs<FixSizeItemProps>(({ width, height }): {\n style: { width?: string; height?: string };\n} => ({\n style: {\n ...(width && { width: toPx(width) }),\n ...(height && { height: toPx(height) }),\n },\n}))<FixSizeItemProps>`\n position: relative;\n flex-direction: column;\n flex: 1;\n display: flex;\n background-color: ${(props): string =>\n (isColor(props.backgroundColor) && props.backgroundColor) || props.theme.defaultBackgroundColor}};\n`;\n\nconst ItemContent = styled.div`\n position: relative;\n min-height: 100px;\n width: 100%;\n`;\n\nconst FixSizeItemContent = styled.div`\n min-height: 0px;\n flex: 1;\n position: relative;\n box-sizing: border-box;\n`;\n\ninterface HeightAndWidthProps {\n width?: string | number;\n height?: string | number;\n backgroundColor?: string;\n}\n\nconst withFixedSizeContainer = <P extends HeightAndWidthProps>(\n Viz: React.ComponentType<P>\n): React.ComponentType<P> => {\n const FixedSizeContainer = (props: P): React.ReactElement => {\n const { width, height, backgroundColor } = props;\n\n if (!height) {\n return (\n <Item data-test=\"item\" width={width} backgroundColor={backgroundColor}>\n <ItemContent>\n <Viz {...props} />\n </ItemContent>\n </Item>\n );\n }\n return (\n <FixSizeItem\n data-test=\"fix-size-item\"\n data-splunk-visualization-version={__VISION_VERSION__}\n width={width}\n height={height}\n backgroundColor={backgroundColor}\n >\n <FixSizeItemContent>\n <SizeAwareWrapper>\n {({ width: newWidth, height: newHeight }): React.ReactElement => (\n <Viz {...props} width={newWidth} height={newHeight} />\n )}\n </SizeAwareWrapper>\n </FixSizeItemContent>\n </FixSizeItem>\n );\n };\n FixedSizeContainer.displayName = 'withFixedSizeContainer';\n return FixedSizeContainer;\n};\n\nexport default withFixedSizeContainer;\n","import * as React from 'react';\nimport { camelCase, has, get, defaultsDeep } from 'lodash';\nimport getSettingsFromThemedProps from '@splunk/themes/getSettingsFromThemedProps';\nimport { Options as Opts } from '@splunk/visualization-encoding/Options';\nimport { withSanitizedProps } from '@splunk/visualizations-shared/SanitizeProps';\n\nimport { withTheme } from 'styled-components';\nimport SplunkVisualization from './SplunkVisualization';\nimport { DashboardVizProps } from './interfaces/DashboardVizProps';\nimport { VizConfig } from './interfaces/VizConfig';\nimport { VizProps } from './interfaces/VizProps';\nimport { VizBehavior } from './interfaces/VizBehavior';\nimport { DataSource } from './interfaces/DataSource';\nimport { getSortingParams } from './hooks/getSorting';\nimport { getPaginationParams } from './hooks/getPagination';\nimport { useDeepMemo } from './hooks/useDeepMemo';\nimport { pickFieldFromJSONSchema } from './utils/JSONSchemaUtils';\nimport MissingPropsMessage, { missingKeys } from './components/MissingPropsMessage';\nimport withEditModeCover from './hocs/withEditModeCover';\nimport withPlaceholder from './hocs/withPlaceholder';\nimport { ChartingProps } from './Charting';\nimport { deepMergeWithArrayOverrides } from './utils/hocUtils';\n\ntype HOC = (props: DashboardVizProps) => React.ReactElement<DashboardVizProps>;\nexport interface DashboardVizOpts {\n ReactViz: React.ComponentType<ChartingProps | VizProps>; // we will wrap this in DashboardViz (see const DashboardViz = ...)\n vizConfig: VizConfig;\n computeVizProps?: (props) => any;\n disableEditModeCover?: boolean;\n useIconPlaceholder?: (\n dataSources: { [name: string]: DataSource },\n loading: boolean,\n options: Record<string, unknown>\n ) => boolean;\n}\n\n/**\n * hoc that wraps a pure react visualization in a Dashboard visualization\n * @param {DashboardVizOpts} opts\n * @returns {HOC}\n */\nconst withDashboardViz = (opts: DashboardVizOpts): HOC => {\n const {\n ReactViz,\n vizConfig,\n computeVizProps = () => {},\n disableEditModeCover,\n useIconPlaceholder,\n } = opts;\n\n // sanitizing props before sending them to reactviz.\n const SanitizedReactViz = withSanitizedProps(ReactViz);\n const defaultOptions = pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');\n\n const DashboardViz = (props: DashboardVizProps): React.ReactElement<DashboardVizProps> => {\n const {\n mode,\n hasEventHandlers,\n dataSources, // type of { [key: string]: DataSource }\n options,\n context = {},\n width,\n height,\n onComputedProps,\n onEventTrigger,\n theme,\n onRequestParamsChange,\n } = props;\n\n const themeFunc = themeVar => vizConfig.themes[themeVar]?.(props);\n const bgColorFromTheme = themeFunc('defaultBackgroundColor');\n const {\n family: currentThemeFamily,\n colorScheme: currentThemeColorScheme,\n density: currentThemeDensity,\n } = getSettingsFromThemedProps({ theme });\n\n let evaluatedOptions: Opts = {}; // evaluatedOptions need to be initialized as an empty object\n evaluatedOptions = useDeepMemo((): Record<string, unknown> => {\n try {\n return Opts.evaluate(\n {\n context: defaultsDeep({}, context, vizConfig.defaultContext),\n options: deepMergeWithArrayOverrides({}, options, defaultOptions),\n },\n dataSources,\n themeFunc\n );\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`unexpected error evaluating options: + ${e.message}`);\n return {};\n }\n }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources]);\n\n // useEffect hook needs to be initialized before any early returns\n // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation\n React.useEffect((): void => {\n onComputedProps(evaluatedOptions);\n });\n\n // present warning message if any required props are missing\n const { requiredProps = [], supports } = vizConfig;\n const missing = missingKeys(requiredProps, evaluatedOptions);\n if (missing.length > 0 && supports.includes(VizBehavior.PLACEHOLDER)) {\n return (\n <MissingPropsMessage\n data-test=\"missing-props-message\"\n width={width}\n height={height}\n missingProps={missing}\n backgroundColor={bgColorFromTheme}\n />\n );\n }\n\n // events\n const eventCallbackProps = {};\n if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior.EVENTS) > -1) {\n const supportedEvents = vizConfig.events;\n Object.keys(supportedEvents).forEach((eventName): void => {\n const eventCallbackPropName = camelCase(`on.${eventName}`);\n eventCallbackProps[eventCallbackPropName] = null;\n // todo: refactor single value and single value icon to send payload from viz\n // then remove these lines\n const { payloadKeys } = supportedEvents[eventName];\n let payload = {};\n if (Array.isArray(payloadKeys) && payloadKeys.length) {\n payloadKeys.forEach(p => {\n payload[p] = evaluatedOptions[p];\n });\n }\n\n eventCallbackProps[eventCallbackPropName] = (ev): Record<string, unknown> => {\n if (ev && ev.payload) {\n payload = ev.payload;\n }\n\n return onEventTrigger({ originalEvent: ev, payload, type: eventName });\n };\n });\n }\n // compute pure viz props which are not from options\n const computedVizProps = computeVizProps({\n ...props,\n ...evaluatedOptions,\n ...eventCallbackProps,\n themeFunc,\n });\n\n /**\n * PAGE_AND_SORT behavior\n *\n * Some visualizations, like table, requires metadata about the datasource,\n * like total number of results, current count, offset, and sort, for rendering\n * paginator and sorting direction. In this approach, the visualization\n * allow users to set 'paginateDataSourceKey' to select which datasource\n * should the visualization extract the metadata from. It defaults to 'primary' datasource.\n * The visualization config should set the PAGE_AND_SORT behavior to receive\n * 'requestParams', 'meta' and onRequestParams callback as props.\n *\n * In future, we could automatically detect which all datasources are being used\n * and bind those magically to pagination/sorting behavior.\n */\n let dataSourceMetadata = {};\n const OptionKey = 'paginateDataSourceKey';\n const paginateDataSourceKey =\n (has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey]) || 'primary';\n if (\n vizConfig.supports.indexOf(VizBehavior.PAGE_AND_SORT) > -1 &&\n has(dataSources, paginateDataSourceKey)\n ) {\n const requestParams = get(dataSources, [paginateDataSourceKey, 'requestParams'], {});\n const meta = get(dataSources, [paginateDataSourceKey, 'meta'], {});\n const handleRequestParamsChange = (payload: Record<string, unknown>): void =>\n onRequestParamsChange(paginateDataSourceKey, payload);\n\n const sortParams = getSortingParams({\n requestParams,\n meta,\n onRequestParamsChange: handleRequestParamsChange,\n });\n\n const paginatorParams = getPaginationParams({\n requestParams,\n meta,\n onRequestParamsChange: handleRequestParamsChange,\n });\n\n dataSourceMetadata = {\n sortParams,\n paginatorParams,\n };\n }\n\n return (\n <SanitizedReactViz\n mode={mode}\n width={width}\n height={height}\n {...evaluatedOptions}\n {...computedVizProps}\n {...eventCallbackProps}\n {...dataSourceMetadata}\n />\n );\n };\n\n DashboardViz.propTypes = {\n ...SplunkVisualization.propTypes,\n ...ReactViz.propTypes,\n };\n\n DashboardViz.defaultProps = {\n ...SplunkVisualization.defaultProps,\n ...ReactViz.defaultProps,\n // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.\n theme: {},\n };\n // attach viz config\n DashboardViz.config = vizConfig;\n\n // @ts-ignore: TODO fix sc upgrade TS issues\n return withTheme(\n withPlaceholder(withEditModeCover(DashboardViz, disableEditModeCover), useIconPlaceholder)\n );\n};\n\nexport default withDashboardViz;\n","module.exports = require(\"@splunk/themes/getSettingsFromThemedProps\");","module.exports = require(\"@splunk/visualization-encoding/Options\");","module.exports = require(\"@splunk/visualizations-shared/SanitizeProps\");","import * as T from 'prop-types';\nimport { has, isFunction } from 'lodash';\nimport { DataSourceMeta, SortDirType, validSortDirs } from '../interfaces/DataSource';\n\nexport interface SortParams {\n currentSortKey?: undefined | string;\n currentSortDir?: undefined | SortDirType;\n onSort?: (e: MouseEvent, { sortKey, sortDir }: { sortKey: string; sortDir: SortDirType }) => void;\n}\n\nexport const SortParamsPropTypes = T.shape({\n currentSortKey: T.string,\n currentSortDir: T.oneOf(validSortDirs),\n onSort: T.func,\n});\n\nexport const getSortingParams = ({ requestParams, onRequestParamsChange }: DataSourceMeta): SortParams => {\n let currentSortKey;\n let currentSortDir;\n\n const nextSortDirMap = {\n asc: 'desc',\n desc: 'asc',\n none: 'asc',\n };\n\n let onSort;\n if (isFunction(onRequestParamsChange)) {\n if (requestParams && has(requestParams, 'sort')) {\n currentSortKey = Object.keys(requestParams.sort).shift();\n currentSortDir = requestParams.sort[currentSortKey];\n }\n\n // undid memoization since there is a dependency on requestParams, which is a deeply nested object\n onSort = (e, { sortKey, sortDir }): void => {\n if (typeof sortKey === 'string') {\n const nextSortDir = has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';\n onRequestParamsChange({\n ...requestParams,\n ...{ offset: 0, sort: { [sortKey]: nextSortDir } },\n });\n } else {\n onRequestParamsChange(requestParams);\n }\n };\n }\n\n return {\n currentSortKey,\n currentSortDir,\n onSort,\n };\n};\n","/**\n * represents the data in a raw columnar format, resulting from a splunk\n * query request.\n */\ninterface FieldEntry {\n name: string;\n}\n\nexport interface JsonColumnData {\n fields: FieldEntry[] | string[];\n columns: string[][];\n}\nexport interface Meta {\n totalCount: number;\n}\n\nexport const validSortDirs = ['asc', 'desc', 'none'] as const;\nexport type SortDirType = typeof validSortDirs[number];\n\nexport interface RequestParams {\n count?: number;\n offset?: number;\n sort?: {\n [sortKey: string]: SortDirType;\n };\n}\n\nexport interface DataSource {\n requestParams: Partial<RequestParams>;\n onRequestParamsChange?: (p: Record<string, unknown>) => void;\n data: JsonColumnData;\n error?: { level: string; message: string };\n meta: Partial<Meta>;\n}\n\nexport interface DataSourceMeta {\n requestParams: Partial<RequestParams>;\n meta: Partial<Meta>;\n onRequestParamsChange: (payload: RequestParams) => void;\n}\n","import * as T from 'prop-types';\nimport { cloneDeep, isFunction, noop } from 'lodash';\nimport { DataSourceMeta, RequestParams } from '../interfaces/DataSource';\n\nexport interface OnChangeParams {\n page?: number;\n count?: number;\n}\nexport interface PaginatorParams {\n isPaging?: boolean;\n current?: number;\n totalPages?: number;\n onChange?: (e: MouseEvent, x: OnChangeParams) => void;\n}\n\nexport const PaginatorParamsPropTypes = T.shape({\n isPaging: T.bool,\n current: T.number,\n totalPages: T.number,\n onChange: T.func,\n});\n\nexport const getPaginationParams = ({\n requestParams,\n meta,\n onRequestParamsChange,\n}: DataSourceMeta): PaginatorParams => {\n const totalCount = (meta && meta.totalCount) || 0;\n const offset = (requestParams && requestParams.offset) || 0;\n const count = requestParams && requestParams.count;\n const totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;\n const current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;\n const isPaging = totalPages > 1 && isFunction(onRequestParamsChange);\n\n const onChangeHandler = (e, { page, count: countArg }: OnChangeParams): void => {\n const newParams: RequestParams = cloneDeep(requestParams);\n\n if (typeof countArg === 'number') {\n newParams.count = countArg;\n newParams.offset = 0;\n }\n\n const pageCount = typeof newParams.count === 'number' ? newParams.count : 10;\n if (typeof page === 'number' && page > 0) {\n newParams.count = pageCount;\n newParams.offset = (page - 1) * pageCount;\n }\n\n onRequestParamsChange(newParams);\n };\n\n return {\n isPaging,\n current,\n totalPages,\n onChange: isFunction(onRequestParamsChange) ? onChangeHandler : noop,\n };\n};\n","import { useRef } from 'react';\nimport { isEqual } from 'lodash';\n\n/**\n * This hook evaluates and stores the result of a passed function and only\n * re-evaluates the function when passed dependencies change.\n *\n * It is different from the internal React useMemo in the following aspects:\n * - it only stores the last evaluated result\n * - it uses a deep equality check to determine if dependencies have changed\n *\n * Inspired by apollo-client's useDeepMemo\n *\n * @param fn the function to be executed and\n * @param dependencies an array of dependencies\n */\nexport const useDeepMemo = <FnReturnType, DepType>(\n fn: () => FnReturnType,\n dependencies: DepType\n): FnReturnType => {\n const ref = useRef<{ dependencies: DepType; value: FnReturnType }>();\n if (!ref.current || !isEqual(dependencies, ref.current.dependencies)) {\n ref.current = {\n dependencies,\n value: fn(),\n };\n }\n return ref.current.value;\n};\n","/* eslint-disable no-param-reassign */\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { has, isEmpty, get } from 'lodash';\nimport { KV } from '../interfaces/Object';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\n\nexport const pickFieldFromJSONSchema = (\n optionsSchema: OptionsSchema | JSONSchema7Definition,\n fieldName = 'default'\n): KV =>\n Object.keys(optionsSchema).reduce((accum: Record<string, unknown>, k): Record<string, unknown> => {\n if (has(optionsSchema[k], fieldName)) {\n accum[k] = optionsSchema[k][fieldName];\n } else if (get(optionsSchema, [k, 'type']) === 'object' && has(optionsSchema[k], 'properties')) {\n const nestedSchema = pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);\n if (!isEmpty(nestedSchema)) {\n accum[k] = nestedSchema;\n }\n }\n return accum;\n }, {});\n","import * as React from 'react';\nimport * as T from 'prop-types';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Message from '@splunk/visualizations-shared/Message';\nimport withFixedSizeContainer from '../hocs/FixedSizeContainer';\n\n/**\n * @method isMissing\n * @param {any} v\n * @returns {boolean} true if the input value === null or undefined\n */\nexport const isMissing = (v): boolean => {\n return v === null || v === undefined;\n};\n\n/**\n * @method misskingKeys\n * @param {string[]} keys\n * @param {object} target\n * @returns {string[]} the keys of missing required props\n */\nexport const missingKeys = (keys: string[], target: Record<string, unknown>): string[] =>\n keys.filter(k => isMissing(target[k]));\n\nexport interface MissingPropsProps {\n width?: string | number;\n height?: string | number;\n missingProps: string[];\n backgroundColor?: string;\n}\n\nconst propTypes: Record<keyof MissingPropsProps, T.Validator<any>> = {\n width: T.oneOfType([T.string, T.number]),\n height: T.oneOfType([T.string, T.number]),\n // eslint-disable-next-line react/no-unused-prop-types\n backgroundColor: T.string,\n missingProps: T.arrayOf(T.string),\n};\n\n/**\n * @method MissingPropsMessage\n * @param {MissingPropsProps} props\n * @returns {React.ReactElement}\n */\nexport const MissingPropsMessage = (props: MissingPropsProps): React.ReactElement => {\n const { width, height, missingProps } = props;\n return (\n <Message\n data-test=\"message\"\n width={width}\n height={height}\n message={_(`Missing property: ${missingProps.join(', ')}`)}\n />\n );\n};\n\nMissingPropsMessage.propTypes = propTypes;\nMissingPropsMessage.defaultProps = {\n width: '100%',\n height: 250,\n};\nexport default withFixedSizeContainer(MissingPropsMessage);\n","module.exports = require(\"@splunk/visualizations-shared/SizeAwareWrapper\");","import * as React from 'react';\nimport styled from 'styled-components';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\nimport { ExtendedDashViz } from '../interfaces/ExtendedDashViz';\nimport { extendStaticWrapperProps } from '../utils/hocUtils';\n\n// Global provided via webpack\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __VISION_VERSION__: string;\n\nconst Cover = styled.div`\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n`;\n\nconst Blocker = styled.div.attrs({\n 'data-splunk-visualization-version': __VISION_VERSION__,\n})`\n position: relative;\n width: 100%;\n height: 100%;\n`;\n\n/**\n * HOC that renders a cover layer in edit mode\n * @method withEditModeCover\n * @param {ExtendedDashViz} Visualization\n * @returns {ExtendedDashViz} Wrapper\n */\nconst withEditModeCover = (\n Visualization: ExtendedDashViz,\n disableEditModeCover?: boolean\n): ExtendedDashViz => {\n const Wrapper = (props: DashboardVizProps): React.ReactElement<DashboardVizProps> => {\n const { mode } = props;\n const showEditCover = mode === 'edit' && !disableEditModeCover;\n\n return (\n <Blocker>\n <Visualization {...props} />\n {showEditCover && <Cover data-test=\"edit-mode-cover\" />}\n </Blocker>\n );\n };\n extendStaticWrapperProps({ Wrapper, Visualization });\n return Wrapper as ExtendedDashViz;\n};\n\nexport default withEditModeCover;\n","import * as React from 'react';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport IconPlaceholder, { shouldShowIconPlaceholder } from '../components/IconPlaceholder';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\nimport { DataSource } from '../interfaces/DataSource';\nimport { ExtendedDashViz } from '../interfaces/ExtendedDashViz';\nimport { extendStaticWrapperProps } from '../utils/hocUtils';\n\ntype useIconPlaceholderType = (\n dataSources: { [name: string]: DataSource },\n loading: boolean,\n options: Record<string, unknown>\n) => boolean;\n\nconst withPlaceholder = (\n Visualization: ExtendedDashViz,\n useIconPlaceholder: useIconPlaceholderType = shouldShowIconPlaceholder\n): ExtendedDashViz => {\n const { config } = Visualization;\n const { themes } = config;\n\n const Wrapper = (props: DashboardVizProps): React.ReactElement<DashboardVizProps> => {\n const { dataSources, loading, options, height, width } = props;\n\n const showPlaceholder = useIconPlaceholder(dataSources, loading, options);\n const bgColorFromTheme = isColor(options?.backgroundColor)\n ? options?.backgroundColor\n : themes?.defaultBackgroundColor?.(props);\n\n if (config.supports.includes(VizBehavior.PLACEHOLDER) && showPlaceholder) {\n return (\n <IconPlaceholder\n data-test=\"icon-placeholder\"\n icon={config.icon}\n width={width}\n height={height}\n backgroundColor={bgColorFromTheme}\n />\n );\n }\n\n return <Visualization {...props} />;\n };\n extendStaticWrapperProps({ Wrapper, Visualization });\n return Wrapper as ExtendedDashViz;\n};\n\nexport default withPlaceholder;\n","import * as React from 'react';\nimport * as T from 'prop-types';\nimport { get } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Message from '@splunk/visualizations-shared/Message';\nimport { DataSource } from '../interfaces/DataSource';\nimport withFixedSizeContainer from '../hocs/FixedSizeContainer';\n\n/**\n * @method shouldShowIconPlaceholder\n * @param {object} dataSources\n * @param {boolean} loading\n * @returns {boolean}\n */\nexport const shouldShowIconPlaceholder = (\n dataSources: { [name: string]: DataSource },\n loading = false\n): boolean => {\n const data = get(dataSources, 'primary.data.columns[0]', undefined);\n const noData = data === undefined;\n const fields = get(dataSources, 'primary.data.fields[0]', undefined);\n const noFields = fields === undefined;\n return loading || noData || noFields;\n};\n\nexport interface IconPlaceholderProps {\n icon?: React.ComponentClass<any>;\n width?: string | number;\n height?: string | number;\n backgroundColor?: string;\n}\n\nconst propTypes: Record<keyof IconPlaceholderProps, T.Validator<any>> = {\n icon: T.func,\n width: T.oneOfType([T.string, T.number]),\n height: T.oneOfType([T.string, T.number]),\n // eslint-disable-next-line react/no-unused-prop-types\n backgroundColor: T.string,\n};\n\n/**\n * @method IconPlaceholder\n * @param {IconPlaceholderProps} props\n * @returns {React.ReactElement}\n */\nconst IconPlaceholder = (props: IconPlaceholderProps): React.ReactElement => {\n const { width, height, icon } = props;\n if (icon) {\n return React.createElement(icon, {\n style: {\n left: '50%',\n top: '50%',\n color: 'grey',\n position: 'absolute',\n transform: 'translate(-50%, -50%)',\n },\n width: '50%',\n height: '50%',\n });\n }\n\n return <Message width={width} height={height} level=\"warning\" message={_('No DataSource Connected')} />;\n};\n\nIconPlaceholder.propTypes = propTypes;\nIconPlaceholder.defaultProps = {\n width: '100%',\n height: 250,\n};\n\nexport default withFixedSizeContainer(IconPlaceholder);\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"styled-components\"","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"@splunk/visualizations-shared/colorUtils\"","webpack:///external \"@splunk/visualizations-shared/Message\"","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///external \"@splunk/visualizations-shared/style\"","webpack:///./src/common/SplunkVisualization.tsx","webpack:///./src/common/interfaces/VizActionHandler.ts","webpack:///./src/common/utils/hocUtils.ts","webpack:///./src/common/hocs/FixedSizeContainer.tsx","webpack:///./src/common/withDashboardViz.tsx","webpack:///external \"@splunk/themes/getSettingsFromThemedProps\"","webpack:///external \"@splunk/visualization-encoding/Options\"","webpack:///external \"@splunk/visualizations-shared/SanitizeProps\"","webpack:///./src/common/hooks/getSorting.ts","webpack:///./src/common/interfaces/DataSource.ts","webpack:///./src/common/hooks/getPagination.ts","webpack:///./src/common/hooks/useDeepMemo.ts","webpack:///./src/common/utils/JSONSchemaUtils.ts","webpack:///./src/common/components/MissingPropsMessage.tsx","webpack:///external \"@splunk/visualizations-shared/SizeAwareWrapper\"","webpack:///./src/common/hocs/withEditModeCover.tsx","webpack:///./src/common/hocs/withPlaceholder.tsx","webpack:///./src/common/components/IconPlaceholder.tsx"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;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AACN,WAAO,KAAK,CAAC,aAAN,CAAoB,IAApB,EAA0B;AAC7B,WAAK,EAAE;AACH,YAAI,EAAE,KADH;AAEH,WAAG,EAAE,KAFF;AAGH,aAAK,EAAE,MAHJ;AAIH,gBAAQ,EAAE,UAJP;AAKH,iBAAS,EAAE;AALR,OADsB;AAQ7B,WAAK,EAAE,KARsB;AAS7B,YAAM,EAAE;AATqB,KAA1B,CAAP;AAWH;;AAED,SAAO,oBAAC,iBAAD,EAAQ;AAAC,SAAK,EAAE,KAAR;AAAe,UAAM,EAAE,MAAvB;AAA+B,SAAK,EAAC,SAArC;AAA+C,WAAO,EAAE,SAAE,yBAAF;AAAxD,GAAR,CAAP;AACH,CAjBD;;AAmBA,eAAe,CAAC,SAAhB,GAA4B,SAA5B;AACA,eAAe,CAAC,YAAhB,GAA+B;AAC3B,OAAK,EAAE,MADoB;AAE3B,QAAM,EAAE;AAFmB,CAA/B;AAKA,kBAAe,6BAAuB,eAAvB,CAAf,C","file":"withDashboardViz.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 75);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"styled-components\");","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"@splunk/visualizations-shared/Message\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n","module.exports = require(\"@splunk/visualizations-shared/style\");","/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */\nimport * as T from 'prop-types';\nimport { noop } from 'lodash';\nimport { DashboardVizProps } from './interfaces/DashboardVizProps';\nimport { DefaultVizActionHandler } from './interfaces/VizActionHandler';\n\n// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations\nexport const INITIAL_WIDTH = 250;\nexport const INITIAL_HEIGHT = 250;\n\n/**\n * A Splunk visualization\n */\nclass SplunkVisualization {\n static propTypes: Record<keyof DashboardVizProps, T.Validator<any>> = {\n /**\n * display mode\n */\n mode: T.oneOf(['view', 'edit', 'export']).isRequired,\n /**\n * width in pixel or string, defaults to 100%\n */\n width: T.oneOfType([T.string, T.number]).isRequired,\n /**\n * height in pixel or string\n */\n height: T.oneOfType([T.string, T.number]).isRequired,\n /**\n * visualization context used for dynamic option evaluation\n */\n context: T.object,\n /**\n * visualization formatting options\n */\n options: T.object,\n /**\n * A callback to update formatting options\n */\n onOptionsChange: T.func,\n /**\n * datasource state which include data and request params, object key indicate the datasource type.\n */\n dataSources: T.objectOf(\n T.shape({\n /**\n * current request params\n */\n requestParams: T.object,\n /**\n * current dataset\n */\n data: T.shape({\n fields: T.array,\n columns: T.array,\n }),\n /**\n * error\n */\n error: T.shape({\n level: T.string,\n message: T.string,\n }),\n /**\n * meta data that came with the dataset\n */\n meta: T.object,\n })\n ),\n /**\n * A callback to trigger event\n */\n onEventTrigger: T.func,\n /**\n * Inform viz if there are handlers listening to events\n */\n hasEventHandlers: T.bool,\n /**\n * A callback to communicate computed props to a consumer\n */\n onComputedProps: T.func,\n /**\n * A callback to obtain visualization api\n */\n vizActionHandlerRef: T.func,\n\n loading: T.bool,\n theme: T.object,\n /**\n * A callback to request new data with updated request params\n */\n onRequestParamsChange: T.func,\n };\n\n /**\n *\n */\n static defaultProps: DashboardVizProps = {\n // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height\n width: '100%',\n height: INITIAL_HEIGHT,\n dataSources: {},\n onEventTrigger: (): Record<string, unknown> => ({}),\n mode: 'view',\n hasEventHandlers: false,\n options: {},\n context: {},\n onOptionsChange: (): Record<string, unknown> => ({}),\n vizActionHandlerRef: (): DefaultVizActionHandler => new DefaultVizActionHandler(),\n onComputedProps: (): Record<string, unknown> => ({}),\n loading: false,\n onRequestParamsChange: noop,\n };\n}\n\nexport default SplunkVisualization;\n","/* eslint-disable class-methods-use-this */\nexport interface VizActionHandler {\n /**\n * put focus on the visualization\n */\n focus(): void;\n\n /**\n * compute snapshot of this visualization\n */\n snapshot(): Record<string, unknown>; // (This is for pdf export)\n}\n\nexport class DefaultVizActionHandler {\n focus(): void {\n // noop\n }\n\n snapshot(): Record<string, unknown> {\n return null; // noop\n }\n}\n","import { cloneDeep } from 'lodash';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\n\nexport type DashboardVizType = React.ComponentType<DashboardVizProps>;\n\n/**\n * @method extendStaticWrapperProps\n * @param {Object} props\n * @param {DashboardVizType} props.Wrapper\n * @param {DashboardVizType} props.Visualization\n */\nexport const extendStaticWrapperProps = ({\n Wrapper,\n Visualization,\n}: {\n [key: string]: DashboardVizType;\n}): void => {\n const extendProperties = ['propTypes', 'defaultProps', 'config'];\n extendProperties.forEach((prop: string): void => {\n if (Visualization[prop]) {\n // eslint-disable-next-line no-param-reassign\n Wrapper[prop] = Visualization[prop];\n }\n });\n};\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object\n * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).\n * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair\n * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.\n *\n * @method deepMergeWithArrayPrimitiveOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayPrimitiveOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey],\n sourceToApply[sourceKey]\n );\n } else if (\n Array.isArray(clone[sourceKey]) &&\n typeof clone[sourceKey][0] === 'object' &&\n !Array.isArray(clone[sourceKey][0])\n ) {\n // If option is an array of objects\n for (let i = 0; i < clone[sourceKey].length; i += 1) {\n if (typeof clone[sourceKey][i] === 'object') {\n const closestMatchIdx = findClosestMatchFromDefaultList(\n sourceToApply[sourceKey],\n clone[sourceKey][i]\n );\n if (closestMatchIdx > -1) {\n clone[sourceKey][i] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey][i],\n sourceToApply[sourceKey][closestMatchIdx]\n );\n }\n }\n }\n }\n });\n });\n return clone;\n};\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n","import * as React from 'react';\nimport styled from 'styled-components';\nimport SizeAwareWrapper from '@splunk/visualizations-shared/SizeAwareWrapper';\nimport { toPx } from '@splunk/visualizations-shared/style';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\n\n// Global provided via webpack\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __VISION_VERSION__: string;\n\ninterface ItemProps {\n backgroundColor?: string;\n width?: string | number;\n}\n\nconst Item = styled.div.attrs<ItemProps>(({ width }) => ({\n style: {\n width: toPx(width),\n },\n}))<ItemProps>`\n position: relative;\n background-color: ${(props): string =>\n (isColor(props.backgroundColor) && props.backgroundColor) || props.theme.defaultBackgroundColor}};\n`;\n\ninterface FixSizeItemProps {\n backgroundColor?: string;\n height?: string | number;\n width?: string | number;\n}\n\n// Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291\nconst FixSizeItem = styled.div.attrs<FixSizeItemProps>(({ width, height }): {\n style: { width?: string; height?: string };\n} => ({\n style: {\n ...(width && { width: toPx(width) }),\n ...(height && { height: toPx(height) }),\n },\n}))<FixSizeItemProps>`\n position: relative;\n flex-direction: column;\n flex: 1;\n display: flex;\n background-color: ${(props): string =>\n (isColor(props.backgroundColor) && props.backgroundColor) || props.theme.defaultBackgroundColor}};\n`;\n\nconst ItemContent = styled.div`\n position: relative;\n min-height: 100px;\n width: 100%;\n`;\n\nconst FixSizeItemContent = styled.div`\n min-height: 0px;\n flex: 1;\n position: relative;\n box-sizing: border-box;\n`;\n\ninterface HeightAndWidthProps {\n width?: string | number;\n height?: string | number;\n backgroundColor?: string;\n}\n\nconst withFixedSizeContainer = <P extends HeightAndWidthProps>(\n Viz: React.ComponentType<P>\n): React.ComponentType<P> => {\n const FixedSizeContainer = (props: P): React.ReactElement => {\n const { width, height, backgroundColor } = props;\n\n if (!height) {\n return (\n <Item data-test=\"item\" width={width} backgroundColor={backgroundColor}>\n <ItemContent>\n <Viz {...props} />\n </ItemContent>\n </Item>\n );\n }\n return (\n <FixSizeItem\n data-test=\"fix-size-item\"\n data-splunk-visualization-version={__VISION_VERSION__}\n width={width}\n height={height}\n backgroundColor={backgroundColor}\n >\n <FixSizeItemContent>\n <SizeAwareWrapper>\n {({ width: newWidth, height: newHeight }): React.ReactElement => (\n <Viz {...props} width={newWidth} height={newHeight} />\n )}\n </SizeAwareWrapper>\n </FixSizeItemContent>\n </FixSizeItem>\n );\n };\n FixedSizeContainer.displayName = 'withFixedSizeContainer';\n return FixedSizeContainer;\n};\n\nexport default withFixedSizeContainer;\n","import * as React from 'react';\nimport { camelCase, has, get, defaultsDeep } from 'lodash';\nimport getSettingsFromThemedProps from '@splunk/themes/getSettingsFromThemedProps';\nimport { Options as Opts } from '@splunk/visualization-encoding/Options';\nimport { withSanitizedProps } from '@splunk/visualizations-shared/SanitizeProps';\n\nimport { withTheme } from 'styled-components';\nimport SplunkVisualization from './SplunkVisualization';\nimport { DashboardVizProps } from './interfaces/DashboardVizProps';\nimport { VizConfig } from './interfaces/VizConfig';\nimport { VizProps } from './interfaces/VizProps';\nimport { VizBehavior } from './interfaces/VizBehavior';\nimport { DataSource } from './interfaces/DataSource';\nimport { getSortingParams } from './hooks/getSorting';\nimport { getPaginationParams } from './hooks/getPagination';\nimport { useDeepMemo } from './hooks/useDeepMemo';\nimport { pickFieldFromJSONSchema } from './utils/JSONSchemaUtils';\nimport MissingPropsMessage, { missingKeys } from './components/MissingPropsMessage';\nimport withEditModeCover from './hocs/withEditModeCover';\nimport withPlaceholder from './hocs/withPlaceholder';\nimport { ChartingProps } from './Charting';\nimport { deepMergeWithArrayPrimitiveOverrides } from './utils/hocUtils';\n\ntype HOC = (props: DashboardVizProps) => React.ReactElement<DashboardVizProps>;\nexport interface DashboardVizOpts {\n ReactViz: React.ComponentType<ChartingProps | VizProps>; // we will wrap this in DashboardViz (see const DashboardViz = ...)\n vizConfig: VizConfig;\n computeVizProps?: (props) => any;\n disableEditModeCover?: boolean;\n useIconPlaceholder?: (\n dataSources: { [name: string]: DataSource },\n loading: boolean,\n options: Record<string, unknown>\n ) => boolean;\n}\n\n/**\n * hoc that wraps a pure react visualization in a Dashboard visualization\n * @param {DashboardVizOpts} opts\n * @returns {HOC}\n */\nconst withDashboardViz = (opts: DashboardVizOpts): HOC => {\n const {\n ReactViz,\n vizConfig,\n computeVizProps = () => {},\n disableEditModeCover,\n useIconPlaceholder,\n } = opts;\n\n // sanitizing props before sending them to reactviz.\n const SanitizedReactViz = withSanitizedProps(ReactViz);\n const defaultOptions = pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');\n\n const DashboardViz = (props: DashboardVizProps): React.ReactElement<DashboardVizProps> => {\n const {\n mode,\n hasEventHandlers,\n dataSources, // type of { [key: string]: DataSource }\n options,\n context = {},\n width,\n height,\n onComputedProps,\n onEventTrigger,\n theme,\n onRequestParamsChange,\n } = props;\n\n const themeFunc = themeVar => vizConfig.themes[themeVar]?.(props);\n const bgColorFromTheme = themeFunc('defaultBackgroundColor');\n const {\n family: currentThemeFamily,\n colorScheme: currentThemeColorScheme,\n density: currentThemeDensity,\n } = getSettingsFromThemedProps({ theme });\n\n let evaluatedOptions: Opts = {}; // evaluatedOptions need to be initialized as an empty object\n evaluatedOptions = useDeepMemo((): Record<string, unknown> => {\n try {\n return Opts.evaluate(\n {\n context: defaultsDeep({}, context, vizConfig.defaultContext),\n options: deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions),\n },\n dataSources,\n themeFunc\n );\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(`unexpected error evaluating options: + ${e.message}`);\n return {};\n }\n }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources]);\n\n // useEffect hook needs to be initialized before any early returns\n // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation\n React.useEffect((): void => {\n onComputedProps(evaluatedOptions);\n });\n\n // present warning message if any required props are missing\n const { requiredProps = [], supports } = vizConfig;\n const missing = missingKeys(requiredProps, evaluatedOptions);\n if (missing.length > 0 && supports.includes(VizBehavior.PLACEHOLDER)) {\n return (\n <MissingPropsMessage\n data-test=\"missing-props-message\"\n width={width}\n height={height}\n missingProps={missing}\n backgroundColor={bgColorFromTheme}\n />\n );\n }\n\n // events\n const eventCallbackProps = {};\n if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior.EVENTS) > -1) {\n const supportedEvents = vizConfig.events;\n Object.keys(supportedEvents).forEach((eventName): void => {\n const eventCallbackPropName = camelCase(`on.${eventName}`);\n eventCallbackProps[eventCallbackPropName] = null;\n // todo: refactor single value and single value icon to send payload from viz\n // then remove these lines\n const { payloadKeys } = supportedEvents[eventName];\n let payload = {};\n if (Array.isArray(payloadKeys) && payloadKeys.length) {\n payloadKeys.forEach(p => {\n payload[p] = evaluatedOptions[p];\n });\n }\n\n eventCallbackProps[eventCallbackPropName] = (ev): Record<string, unknown> => {\n if (ev && ev.payload) {\n payload = ev.payload;\n }\n\n return onEventTrigger({ originalEvent: ev, payload, type: eventName });\n };\n });\n }\n // compute pure viz props which are not from options\n const computedVizProps = computeVizProps({\n ...props,\n ...evaluatedOptions,\n ...eventCallbackProps,\n themeFunc,\n });\n\n /**\n * PAGE_AND_SORT behavior\n *\n * Some visualizations, like table, requires metadata about the datasource,\n * like total number of results, current count, offset, and sort, for rendering\n * paginator and sorting direction. In this approach, the visualization\n * allow users to set 'paginateDataSourceKey' to select which datasource\n * should the visualization extract the metadata from. It defaults to 'primary' datasource.\n * The visualization config should set the PAGE_AND_SORT behavior to receive\n * 'requestParams', 'meta' and onRequestParams callback as props.\n *\n * In future, we could automatically detect which all datasources are being used\n * and bind those magically to pagination/sorting behavior.\n */\n let dataSourceMetadata = {};\n const OptionKey = 'paginateDataSourceKey';\n const paginateDataSourceKey =\n (has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey]) || 'primary';\n if (\n vizConfig.supports.indexOf(VizBehavior.PAGE_AND_SORT) > -1 &&\n has(dataSources, paginateDataSourceKey)\n ) {\n const requestParams = get(dataSources, [paginateDataSourceKey, 'requestParams'], {});\n const meta = get(dataSources, [paginateDataSourceKey, 'meta'], {});\n const handleRequestParamsChange = (payload: Record<string, unknown>): void =>\n onRequestParamsChange(paginateDataSourceKey, payload);\n\n const sortParams = getSortingParams({\n requestParams,\n meta,\n onRequestParamsChange: handleRequestParamsChange,\n });\n\n const paginatorParams = getPaginationParams({\n requestParams,\n meta,\n onRequestParamsChange: handleRequestParamsChange,\n });\n\n dataSourceMetadata = {\n sortParams,\n paginatorParams,\n };\n }\n\n return (\n <SanitizedReactViz\n mode={mode}\n width={width}\n height={height}\n {...evaluatedOptions}\n {...computedVizProps}\n {...eventCallbackProps}\n {...dataSourceMetadata}\n />\n );\n };\n\n DashboardViz.propTypes = {\n ...SplunkVisualization.propTypes,\n ...ReactViz.propTypes,\n };\n\n DashboardViz.defaultProps = {\n ...SplunkVisualization.defaultProps,\n ...ReactViz.defaultProps,\n // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.\n theme: {},\n };\n // attach viz config\n DashboardViz.config = vizConfig;\n\n // @ts-ignore: TODO fix sc upgrade TS issues\n return withTheme(\n withPlaceholder(withEditModeCover(DashboardViz, disableEditModeCover), useIconPlaceholder)\n );\n};\n\nexport default withDashboardViz;\n","module.exports = require(\"@splunk/themes/getSettingsFromThemedProps\");","module.exports = require(\"@splunk/visualization-encoding/Options\");","module.exports = require(\"@splunk/visualizations-shared/SanitizeProps\");","import * as T from 'prop-types';\nimport { has, isFunction } from 'lodash';\nimport { DataSourceMeta, SortDirType, validSortDirs } from '../interfaces/DataSource';\n\nexport interface SortParams {\n currentSortKey?: undefined | string;\n currentSortDir?: undefined | SortDirType;\n onSort?: (e: MouseEvent, { sortKey, sortDir }: { sortKey: string; sortDir: SortDirType }) => void;\n}\n\nexport const SortParamsPropTypes = T.shape({\n currentSortKey: T.string,\n currentSortDir: T.oneOf(validSortDirs),\n onSort: T.func,\n});\n\nexport const getSortingParams = ({ requestParams, onRequestParamsChange }: DataSourceMeta): SortParams => {\n let currentSortKey;\n let currentSortDir;\n\n const nextSortDirMap = {\n asc: 'desc',\n desc: 'asc',\n none: 'asc',\n };\n\n let onSort;\n if (isFunction(onRequestParamsChange)) {\n if (requestParams && has(requestParams, 'sort')) {\n currentSortKey = Object.keys(requestParams.sort).shift();\n currentSortDir = requestParams.sort[currentSortKey];\n }\n\n // undid memoization since there is a dependency on requestParams, which is a deeply nested object\n onSort = (e, { sortKey, sortDir }): void => {\n if (typeof sortKey === 'string') {\n const nextSortDir = has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';\n onRequestParamsChange({\n ...requestParams,\n ...{ offset: 0, sort: { [sortKey]: nextSortDir } },\n });\n } else {\n onRequestParamsChange(requestParams);\n }\n };\n }\n\n return {\n currentSortKey,\n currentSortDir,\n onSort,\n };\n};\n","/**\n * represents the data in a raw columnar format, resulting from a splunk\n * query request.\n */\ninterface FieldEntry {\n name: string;\n}\n\nexport interface JsonColumnData {\n fields: FieldEntry[] | string[];\n columns: string[][];\n}\nexport interface Meta {\n totalCount: number;\n}\n\nexport const validSortDirs = ['asc', 'desc', 'none'] as const;\nexport type SortDirType = typeof validSortDirs[number];\n\nexport interface RequestParams {\n count?: number;\n offset?: number;\n sort?: {\n [sortKey: string]: SortDirType;\n };\n}\n\nexport interface DataSource {\n requestParams: Partial<RequestParams>;\n onRequestParamsChange?: (p: Record<string, unknown>) => void;\n data: JsonColumnData;\n error?: { level: string; message: string };\n meta: Partial<Meta>;\n}\n\nexport interface DataSourceMeta {\n requestParams: Partial<RequestParams>;\n meta: Partial<Meta>;\n onRequestParamsChange: (payload: RequestParams) => void;\n}\n","import * as T from 'prop-types';\nimport { cloneDeep, isFunction, noop } from 'lodash';\nimport { DataSourceMeta, RequestParams } from '../interfaces/DataSource';\n\nexport interface OnChangeParams {\n page?: number;\n count?: number;\n}\nexport interface PaginatorParams {\n isPaging?: boolean;\n current?: number;\n totalPages?: number;\n onChange?: (e: MouseEvent, x: OnChangeParams) => void;\n}\n\nexport const PaginatorParamsPropTypes = T.shape({\n isPaging: T.bool,\n current: T.number,\n totalPages: T.number,\n onChange: T.func,\n});\n\nexport const getPaginationParams = ({\n requestParams,\n meta,\n onRequestParamsChange,\n}: DataSourceMeta): PaginatorParams => {\n const totalCount = (meta && meta.totalCount) || 0;\n const offset = (requestParams && requestParams.offset) || 0;\n const count = requestParams && requestParams.count;\n const totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;\n const current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;\n const isPaging = totalPages > 1 && isFunction(onRequestParamsChange);\n\n const onChangeHandler = (e, { page, count: countArg }: OnChangeParams): void => {\n const newParams: RequestParams = cloneDeep(requestParams);\n\n if (typeof countArg === 'number') {\n newParams.count = countArg;\n newParams.offset = 0;\n }\n\n const pageCount = typeof newParams.count === 'number' ? newParams.count : 10;\n if (typeof page === 'number' && page > 0) {\n newParams.count = pageCount;\n newParams.offset = (page - 1) * pageCount;\n }\n\n onRequestParamsChange(newParams);\n };\n\n return {\n isPaging,\n current,\n totalPages,\n onChange: isFunction(onRequestParamsChange) ? onChangeHandler : noop,\n };\n};\n","import { useRef } from 'react';\nimport { isEqual } from 'lodash';\n\n/**\n * This hook evaluates and stores the result of a passed function and only\n * re-evaluates the function when passed dependencies change.\n *\n * It is different from the internal React useMemo in the following aspects:\n * - it only stores the last evaluated result\n * - it uses a deep equality check to determine if dependencies have changed\n *\n * Inspired by apollo-client's useDeepMemo\n *\n * @param fn the function to be executed and\n * @param dependencies an array of dependencies\n */\nexport const useDeepMemo = <FnReturnType, DepType>(\n fn: () => FnReturnType,\n dependencies: DepType\n): FnReturnType => {\n const ref = useRef<{ dependencies: DepType; value: FnReturnType }>();\n if (!ref.current || !isEqual(dependencies, ref.current.dependencies)) {\n ref.current = {\n dependencies,\n value: fn(),\n };\n }\n return ref.current.value;\n};\n","/* eslint-disable no-param-reassign */\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { has, isEmpty, get } from 'lodash';\nimport { KV } from '../interfaces/Object';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\n\nexport const pickFieldFromJSONSchema = (\n optionsSchema: OptionsSchema | JSONSchema7Definition,\n fieldName = 'default'\n): KV =>\n Object.keys(optionsSchema).reduce((accum: Record<string, unknown>, k): Record<string, unknown> => {\n if (has(optionsSchema[k], fieldName)) {\n accum[k] = optionsSchema[k][fieldName];\n } else if (get(optionsSchema, [k, 'type']) === 'object' && has(optionsSchema[k], 'properties')) {\n const nestedSchema = pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);\n if (!isEmpty(nestedSchema)) {\n accum[k] = nestedSchema;\n }\n }\n return accum;\n }, {});\n","import * as React from 'react';\nimport * as T from 'prop-types';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Message from '@splunk/visualizations-shared/Message';\nimport withFixedSizeContainer from '../hocs/FixedSizeContainer';\n\n/**\n * @method isMissing\n * @param {any} v\n * @returns {boolean} true if the input value === null or undefined\n */\nexport const isMissing = (v): boolean => {\n return v === null || v === undefined;\n};\n\n/**\n * @method misskingKeys\n * @param {string[]} keys\n * @param {object} target\n * @returns {string[]} the keys of missing required props\n */\nexport const missingKeys = (keys: string[], target: Record<string, unknown>): string[] =>\n keys.filter(k => isMissing(target[k]));\n\nexport interface MissingPropsProps {\n width?: string | number;\n height?: string | number;\n missingProps: string[];\n backgroundColor?: string;\n}\n\nconst propTypes: Record<keyof MissingPropsProps, T.Validator<any>> = {\n width: T.oneOfType([T.string, T.number]),\n height: T.oneOfType([T.string, T.number]),\n // eslint-disable-next-line react/no-unused-prop-types\n backgroundColor: T.string,\n missingProps: T.arrayOf(T.string),\n};\n\n/**\n * @method MissingPropsMessage\n * @param {MissingPropsProps} props\n * @returns {React.ReactElement}\n */\nexport const MissingPropsMessage = (props: MissingPropsProps): React.ReactElement => {\n const { width, height, missingProps } = props;\n return (\n <Message\n data-test=\"message\"\n width={width}\n height={height}\n message={_(`Missing property: ${missingProps.join(', ')}`)}\n />\n );\n};\n\nMissingPropsMessage.propTypes = propTypes;\nMissingPropsMessage.defaultProps = {\n width: '100%',\n height: 250,\n};\nexport default withFixedSizeContainer(MissingPropsMessage);\n","module.exports = require(\"@splunk/visualizations-shared/SizeAwareWrapper\");","import * as React from 'react';\nimport styled from 'styled-components';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\nimport { ExtendedDashViz } from '../interfaces/ExtendedDashViz';\nimport { extendStaticWrapperProps } from '../utils/hocUtils';\n\n// Global provided via webpack\n// eslint-disable-next-line no-underscore-dangle\ndeclare const __VISION_VERSION__: string;\n\nconst Cover = styled.div`\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n`;\n\nconst Blocker = styled.div.attrs({\n 'data-splunk-visualization-version': __VISION_VERSION__,\n})`\n position: relative;\n width: 100%;\n height: 100%;\n`;\n\n/**\n * HOC that renders a cover layer in edit mode\n * @method withEditModeCover\n * @param {ExtendedDashViz} Visualization\n * @returns {ExtendedDashViz} Wrapper\n */\nconst withEditModeCover = (\n Visualization: ExtendedDashViz,\n disableEditModeCover?: boolean\n): ExtendedDashViz => {\n const Wrapper = (props: DashboardVizProps): React.ReactElement<DashboardVizProps> => {\n const { mode } = props;\n const showEditCover = mode === 'edit' && !disableEditModeCover;\n\n return (\n <Blocker>\n <Visualization {...props} />\n {showEditCover && <Cover data-test=\"edit-mode-cover\" />}\n </Blocker>\n );\n };\n extendStaticWrapperProps({ Wrapper, Visualization });\n return Wrapper as ExtendedDashViz;\n};\n\nexport default withEditModeCover;\n","import * as React from 'react';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport IconPlaceholder, { shouldShowIconPlaceholder } from '../components/IconPlaceholder';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { DashboardVizProps } from '../interfaces/DashboardVizProps';\nimport { DataSource } from '../interfaces/DataSource';\nimport { ExtendedDashViz } from '../interfaces/ExtendedDashViz';\nimport { extendStaticWrapperProps } from '../utils/hocUtils';\n\ntype useIconPlaceholderType = (\n dataSources: { [name: string]: DataSource },\n loading: boolean,\n options: Record<string, unknown>\n) => boolean;\n\nconst withPlaceholder = (\n Visualization: ExtendedDashViz,\n useIconPlaceholder: useIconPlaceholderType = shouldShowIconPlaceholder\n): ExtendedDashViz => {\n const { config } = Visualization;\n const { themes } = config;\n\n const Wrapper = (props: DashboardVizProps): React.ReactElement<DashboardVizProps> => {\n const { dataSources, loading, options, height, width } = props;\n\n const showPlaceholder = useIconPlaceholder(dataSources, loading, options);\n const bgColorFromTheme = isColor(options?.backgroundColor)\n ? options?.backgroundColor\n : themes?.defaultBackgroundColor?.(props);\n\n if (config.supports.includes(VizBehavior.PLACEHOLDER) && showPlaceholder) {\n return (\n <IconPlaceholder\n data-test=\"icon-placeholder\"\n icon={config.icon}\n width={width}\n height={height}\n backgroundColor={bgColorFromTheme}\n />\n );\n }\n\n return <Visualization {...props} />;\n };\n extendStaticWrapperProps({ Wrapper, Visualization });\n return Wrapper as ExtendedDashViz;\n};\n\nexport default withPlaceholder;\n","import * as React from 'react';\nimport * as T from 'prop-types';\nimport { get } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Message from '@splunk/visualizations-shared/Message';\nimport { DataSource } from '../interfaces/DataSource';\nimport withFixedSizeContainer from '../hocs/FixedSizeContainer';\n\n/**\n * @method shouldShowIconPlaceholder\n * @param {object} dataSources\n * @param {boolean} loading\n * @returns {boolean}\n */\nexport const shouldShowIconPlaceholder = (\n dataSources: { [name: string]: DataSource },\n loading = false\n): boolean => {\n const data = get(dataSources, 'primary.data.columns[0]', undefined);\n const noData = data === undefined;\n const fields = get(dataSources, 'primary.data.fields[0]', undefined);\n const noFields = fields === undefined;\n return loading || noData || noFields;\n};\n\nexport interface IconPlaceholderProps {\n icon?: React.ComponentClass<any>;\n width?: string | number;\n height?: string | number;\n backgroundColor?: string;\n}\n\nconst propTypes: Record<keyof IconPlaceholderProps, T.Validator<any>> = {\n icon: T.func,\n width: T.oneOfType([T.string, T.number]),\n height: T.oneOfType([T.string, T.number]),\n // eslint-disable-next-line react/no-unused-prop-types\n backgroundColor: T.string,\n};\n\n/**\n * @method IconPlaceholder\n * @param {IconPlaceholderProps} props\n * @returns {React.ReactElement}\n */\nconst IconPlaceholder = (props: IconPlaceholderProps): React.ReactElement => {\n const { width, height, icon } = props;\n if (icon) {\n return React.createElement(icon, {\n style: {\n left: '50%',\n top: '50%',\n color: 'grey',\n position: 'absolute',\n transform: 'translate(-50%, -50%)',\n },\n width: '50%',\n height: '50%',\n });\n }\n\n return <Message width={width} height={height} level=\"warning\" message={_('No DataSource Connected')} />;\n};\n\nIconPlaceholder.propTypes = propTypes;\nIconPlaceholder.defaultProps = {\n width: '100%',\n height: 250,\n};\n\nexport default withFixedSizeContainer(IconPlaceholder);\n"],"sourceRoot":""}
|