@splunk/visualizations-shared 26.3.0 → 26.4.1
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/Downloader.js +2 -2
- package/Downloader.js.map +1 -1
- package/FileDownloader.js +6 -6
- package/FileDownloader.js.map +1 -1
- package/JSONSchemaUtils.js +4 -4
- package/JSONSchemaUtils.js.map +1 -1
- package/Message.js +4 -4
- package/Message.js.map +1 -1
- package/RemoteIcon.js +16 -18
- package/RemoteIcon.js.map +1 -1
- package/RemoteImage.js +16 -18
- package/RemoteImage.js.map +1 -1
- package/SanitizeProps.js +26 -82
- package/SanitizeProps.js.map +1 -1
- package/SizeAwareWrapper.js +4 -4
- package/SizeAwareWrapper.js.map +1 -1
- package/SizeAwareWrapperDeprecated.js +11 -11
- package/SizeAwareWrapperDeprecated.js.map +1 -1
- package/VisualizationDocPage.js +79 -60
- package/VisualizationDocPage.js.map +1 -1
- package/colorConstants.js +4 -4
- package/colorConstants.js.map +1 -1
- package/colorUtils.js +22 -78
- package/colorUtils.js.map +1 -1
- package/configUtils.js +2 -2
- package/configUtils.js.map +1 -1
- package/console.js +8 -8
- package/console.js.map +1 -1
- package/dataSourceUtils.js +2 -2
- package/dataSourceUtils.js.map +1 -1
- package/domUtils.js +4 -4
- package/domUtils.js.map +1 -1
- package/hocUtils.js +11 -120
- package/hocUtils.js.map +1 -1
- package/i18n.js +4 -4
- package/i18n.js.map +1 -1
- package/iconUtils.js +2 -2
- package/iconUtils.js.map +1 -1
- package/mapUtils.js +12 -40
- package/mapUtils.js.map +1 -1
- package/numberUtils.js +6 -6
- package/numberUtils.js.map +1 -1
- package/package.json +9 -8
- package/previewVizMessage.js +2 -2
- package/previewVizMessage.js.map +1 -1
- package/propUtils.js +4 -4
- package/propUtils.js.map +1 -1
- package/schemaUtils.js +10 -10
- package/schemaUtils.js.map +1 -1
- package/simpleXMLOptions.js +4 -4
- package/simpleXMLOptions.js.map +1 -1
- package/testHelper.js +2 -2
- package/testHelper.js.map +1 -1
- package/themeUtils.js +6 -6
- package/themeUtils.js.map +1 -1
- package/trellisUtils.js +4 -4
- package/trellisUtils.js.map +1 -1
- package/namedColors.js +0 -110
- package/namedColors.js.map +0 -1
package/iconUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/iconUtils.js"],"names":["isRemoteIcon","icon","isDataURI","shouldChangeFill","fillAttr","fillStyle","strokeAttr","strokeStyle","noneFillAttr","noneFillStyle","noFillHasStroke","shouldChangeStroke","noneStrokeAttr","noneStrokeStyle","hasFill","noStroke","b64EncodeUnicode","btoa","String"],"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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO,IAAMA,YAAY,GAAG,SAAfA,YAAe;AAAA,MAACC,IAAD;AAAA,SAAeA,IAAI,CAAJA,iBAAsB,CAArC;AAArB;AAEP;AACA;AACA;AACA;;AACO,IAAMC,SAAS,GAAG,SAAZA,SAAY;AAAA,MAACD,IAAD;AAAA,SAAeA,IAAI,CAAJA,WAAf,2BAA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gB,GAAG,SAAnBA,gBAAmB,MAAG;AAAA,SAC/B;AACA;AACA;AACAC,QAAI,CAAC,kBAAkB,CAAlB,GAAkB,CAAlB,4BAAmD;AAAA,aAAeC,MAAM,CAANA,yBAAf,EAAeA,EAAf;AAApD,KAAC,CAAD;AAJ2B;AAA5B,E","file":"iconUtils.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 =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/iconUtils.js"],"names":["isRemoteIcon","icon","isDataURI","shouldChangeFill","fillAttr","fillStyle","strokeAttr","strokeStyle","noneFillAttr","noneFillStyle","noFillHasStroke","shouldChangeStroke","noneStrokeAttr","noneStrokeStyle","hasFill","noStroke","b64EncodeUnicode","btoa","String"],"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,0BAA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AACpF,MAAMK,cAAc,GAAG,CAAC,CAAD,eAAiBN,UAAU,KAAVA,UAAyBA,UAAU,KAA3E,aAAuB,CAAvB;AACA,MAAMO,eAAe,GAAG,CAAC,CAAD,gBAAkBN,WAAW,KAAXA,UAA0BA,WAAW,KAA/E,aAAwB,CAAxB;AACA,MAAMO,OAAO,GAAG,CAAC,CAAD,YAAc,CAAC,CAA/B;AACA,MAAMC,QAAQ,GAAG,eAAe,CAAhC;AACA,SAAO,EAAEH,cAAc,IAAdA,8BAAT,QAAO,CAAP;AALG;AAQP;AACA;AACA;AACA;AACA;;AACO,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAmB,MAAG;AAAA,SAC/B;AACA;AACA;AACAC,QAAI,CAAC,kBAAkB,CAAlB,GAAkB,CAAlB,4BAAmD;AAAA,aAAeC,MAAM,CAANA,yBAAf,EAAeA,EAAf;AAApD,KAAC,CAAD;AAJ2B;AAA5B,E","file":"iconUtils.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 = 20);\n","/**\n * check if an icon is considered as remote icon\n * @param {*} icon\n */\nexport const isRemoteIcon = (icon = '') => icon.indexOf('://') > -1;\n\n/**\n * check if an icon is a dataURI\n * @param {*} icon\n */\nexport const isDataURI = (icon = '') => icon.startsWith('data:image/svg+xml;base64');\n\n/*\n * check whether need update fill for svg children elements\n * @params {Object} style\n * @params {String} style.fillAttr <path fill=\"red\" .../>\n * @params {String} style.fillStyle. <path style=\"fill: red;\" />\n * @params {String} style.strokeAttr. <path stroke=\"red\" .../>\n * @params {String} style.strokeStyle <path style=\"stroke: red;\" .../>\n * @returns {Boolean} true means need\n * remove fill style and change the fill attribute <path fill=\"currentColor\" />\n */\nexport const shouldChangeFill = ({ fillAttr, fillStyle, strokeAttr, strokeStyle }) => {\n const noneFillAttr = !!fillAttr && (fillAttr === 'none' || fillAttr === 'transparent');\n const noneFillStyle = !!fillStyle && (fillStyle === 'none' || fillStyle === 'transparent');\n const noFillHasStroke = !fillAttr && !fillStyle && (!!strokeAttr || !!strokeStyle);\n return !(noneFillAttr || noneFillStyle || noFillHasStroke);\n};\n\n/*\n * check whether need update stroke for svg children elements\n * @params {Object} style\n * @params {String} style.fillAttr <path fill=\"red\" .../>\n * @params {String} style.fillStyle. <path style=\"fill: red;\" />\n * @params {String} style.strokeAttr. <path stroke=\"red\" .../>\n * @params {String} style.strokeStyle <path style=\"stroke: red;\" .../>\n * @returns {Boolean} true means need\n * remove stroke style and change the stroke attribute <path stroke=\"currentColor\" />\n */\nexport const shouldChangeStroke = ({ fillAttr, fillStyle, strokeAttr, strokeStyle }) => {\n const noneStrokeAttr = !!strokeAttr && (strokeAttr === 'none' || strokeAttr === 'transparent');\n const noneStrokeStyle = !!strokeStyle && (strokeStyle === 'none' || strokeStyle === 'transparent');\n const hasFill = !!fillAttr || !!fillStyle;\n const noStroke = !strokeAttr && !strokeStyle;\n return !(noneStrokeAttr || noneStrokeStyle || hasFill || noStroke);\n};\n\n/*\n * base64 encoding\n * @param {String} str\n * @return {Base64} string using based-64 encoding\n */\nexport const b64EncodeUnicode = str =>\n // first we use encodeURIComponent to get percent-encoded UTF-8,\n // then we convert the percent encodings into raw bytes which\n // can be fed into btoa.\n btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => String.fromCharCode(`0x${p1}`)));\n"],"sourceRoot":""}
|
package/mapUtils.js
CHANGED
|
@@ -87,12 +87,12 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 58);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
94
94
|
|
|
95
|
-
/***/
|
|
95
|
+
/***/ 58:
|
|
96
96
|
/***/ (function(module, exports, __webpack_require__) {
|
|
97
97
|
|
|
98
98
|
"use strict";
|
|
@@ -102,50 +102,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
102
102
|
value: true
|
|
103
103
|
});
|
|
104
104
|
exports.findClosestMatchFromDefaultList = void 0;
|
|
105
|
-
/**
|
|
106
|
-
* Finds the closest matching object from the list, which has the max same key value pairs.
|
|
107
|
-
* Returns the index of match if found, or -1
|
|
108
|
-
* For eg :-
|
|
109
|
-
const list = [{
|
|
110
|
-
type: "marker",
|
|
111
|
-
lat: "value1"
|
|
112
|
-
}, {
|
|
113
|
-
type: "bubble",
|
|
114
|
-
size: "value2"
|
|
115
|
-
}];
|
|
116
105
|
|
|
117
|
-
|
|
118
|
-
type: 'bubble'
|
|
119
|
-
};
|
|
106
|
+
var findClosestMatchFromDefaultList_1 = __webpack_require__(59);
|
|
120
107
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (!Array.isArray(searchList) || searchList.length === 0) {
|
|
126
|
-
return -1;
|
|
108
|
+
Object.defineProperty(exports, "findClosestMatchFromDefaultList", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function get() {
|
|
111
|
+
return findClosestMatchFromDefaultList_1.findClosestMatchFromDefaultList;
|
|
127
112
|
}
|
|
113
|
+
});
|
|
128
114
|
|
|
129
|
-
|
|
130
|
-
var maxMatchCnt = 0;
|
|
131
|
-
var maxMatchIdx = 0;
|
|
132
|
-
searchList.forEach(function (item, idx) {
|
|
133
|
-
var matchCnt = 0;
|
|
134
|
-
keys.forEach(function (key) {
|
|
135
|
-
if (item[key] === inputObj[key]) {
|
|
136
|
-
matchCnt += 1;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
115
|
+
/***/ }),
|
|
139
116
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
maxMatchIdx = idx;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
return maxMatchIdx;
|
|
146
|
-
};
|
|
117
|
+
/***/ 59:
|
|
118
|
+
/***/ (function(module, exports) {
|
|
147
119
|
|
|
148
|
-
exports
|
|
120
|
+
module.exports = require("@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList");
|
|
149
121
|
|
|
150
122
|
/***/ })
|
|
151
123
|
|
package/mapUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/mapUtils.ts"],"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
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/mapUtils.ts","webpack:///external \"@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList\""],"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;;AAAS;AAAA;AAAA;AAAA;AAA+B;AAA/B,G;;;;;;;ACAT,iG","file":"mapUtils.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 = 58);\n","export { findClosestMatchFromDefaultList } from '@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList';\nexport type { GeoJsonDataType } from '@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList';\n","module.exports = require(\"@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList\");"],"sourceRoot":""}
|
package/numberUtils.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 60);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -99,21 +99,21 @@ module.exports = require("@splunk/moment");
|
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
102
|
-
/***/
|
|
102
|
+
/***/ 22:
|
|
103
103
|
/***/ (function(module, exports) {
|
|
104
104
|
|
|
105
105
|
module.exports = require("@babel/runtime/helpers/typeof");
|
|
106
106
|
|
|
107
107
|
/***/ }),
|
|
108
108
|
|
|
109
|
-
/***/
|
|
109
|
+
/***/ 4:
|
|
110
110
|
/***/ (function(module, exports) {
|
|
111
111
|
|
|
112
112
|
module.exports = require("lodash");
|
|
113
113
|
|
|
114
114
|
/***/ }),
|
|
115
115
|
|
|
116
|
-
/***/
|
|
116
|
+
/***/ 60:
|
|
117
117
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
118
118
|
|
|
119
119
|
"use strict";
|
|
@@ -123,11 +123,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
123
123
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseNumber", function() { return parseNumber; });
|
|
124
124
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithNumber", function() { return startsWithNumber; });
|
|
125
125
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatNumber", function() { return formatNumber; });
|
|
126
|
-
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
126
|
+
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
|
|
127
127
|
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
|
128
128
|
/* harmony import */ var _splunk_moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
|
|
129
129
|
/* harmony import */ var _splunk_moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_moment__WEBPACK_IMPORTED_MODULE_1__);
|
|
130
|
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
130
|
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
|
|
131
131
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
|
|
132
132
|
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9);
|
|
133
133
|
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_3__);
|
package/numberUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/moment\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"lodash\"","webpack:///./src/numberUtils.js","webpack:///external \"@splunk/ui-utils/i18n\""],"names":["DECIMAL_OR_SCIENTIFIC_REGEX","COMMA_SEPARATED_NUMBER_REGEX","STARTS_WITH_NUMBER_REGEX","isDecimalOrExpo","isCommaSeparatedNumber","isFinite","isString","isNumerialStr","parseFloat","value","getThousandSeparatorDecimalPrecisionFormatter","memoize","locale","options","Intl","JSON","formatOptions","precision","useThousandSeparators","moment","defaultPrecision","useTrendUnits","isInteger","p","trendUnit","units","letter","power","found","Math","unit","formatter","_"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAE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ACH;;AAEDA,eAAa,CAAbA,cAA4BE,qBAAqB,KAAjDF;AAEA,MAAIQ,SAAS,GAAb;AACA,MAAIf,KAAK,GAAT;AACA,MAAMgB,KAAK,GAAG,CACV;AAAEC,UAAM,EAAR;AAAeC,SAAK,EAAE;AAAtB,GADU,EAEV;AAAED,UAAM,EAAR;AAAeC,SAAK,EAAE;AAAtB,GAFU,EAGV;AAAED,UAAM,EAAR;AAAeC,SAAK,EAAE;AAAtB,GAHU,EAIV;AAAED,UAAM,EAAR;AAAeC,SAAK,EAAE;AAAtB,GAJU,CAAd;;AAOA,qBAAmB;AACf,QAAMC,KAAK,GAAG,KAAK,CAAL,KAAW,gBAAI;AAAA,aAAIC,IAAI,CAAJA,0BAAwBC,IAAI,CAAhC,KAAID,CAAJ;AAA7B,KAAc,CAAd;;AAEA,eAAW;AACPpB,WAAK,iBAAUmB,KAAK,CAApBnB,KAAK,CAALA;AACAe,eAAS,GAAGI,KAAK,CAAjBJ;AACAR,mBAAa,CAAbA;AACAA,mBAAa,CAAbA;AACH;AACJ;;AAED,MAAMe,SAAS,GAAGrB,6CAA6C,SAA/D,aAA+D,CAA/D;AAEA,mBAAUqB,SAAS,CAATA,OAAV,KAAUA,CAAV,SAAoCP,SAAS,GAAGQ,+DAAC,CAAJ,SAAI,CAAJ,GAA7C;AACH,C;;;;;;;ACtJD,kD","file":"numberUtils.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 = 59);\n","module.exports = require(\"@splunk/moment\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"lodash\");","import moment from '@splunk/moment';\nimport { isFinite, isString, isInteger, memoize } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\n\n// Todo: need break out this utils after breaking out all visualizations\n/**\n * @file\n * A set of number formatting function used in Table\n */\nconst DECIMAL_OR_SCIENTIFIC_REGEX = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i;\nconst COMMA_SEPARATED_NUMBER_REGEX = /(^[-+]?([0]|([1-9][0-9]{0,2})|(([1-9][0-9]{0,2}[,])([0-9]{3}[,])*[0-9]{3}))(([.][0-9]+)?)$)/;\nconst STARTS_WITH_NUMBER_REGEX = /^[-+]?\\d/;\nfunction isDecimalOrExpo(str) {\n return DECIMAL_OR_SCIENTIFIC_REGEX.test(str);\n}\nfunction isCommaSeparatedNumber(str) {\n return COMMA_SEPARATED_NUMBER_REGEX.test(str);\n}\n\n/**\n * Check if a string can be considered as numeric, this includes decimal, scientific number and number with comma separator\n *\n * Examples:\n * ```js\n * const { isNumerialStr } from '@splunk/react-visualizations/utils/numberUtils';\n * assert.ok(isNumerialStr('11.123'));\n * ```\n * @param {String} str input value\n * @return {Boolean}\n * @public\n */\nexport function isNumerialStr(str) {\n return isDecimalOrExpo(str) || isCommaSeparatedNumber(str);\n}\n\n/**\n * Check if a value can be considered as numeric\n *\n * Examples:\n * ```js\n * const { isNumerial } from '@splunk/react-visualizations/utils/numberUtils';\n * assert.equal(isNumerial('11.123') == 11.123);\n * ```\n * @param {any} value input value\n * @return {Boolean}\n * @public\n */\nexport function isNumerial(value) {\n return isFinite(value) || (isString(value) && isNumerialStr(value));\n}\n\n/**\n * Parse input value into number, return NaN for not numercial value\n * @param {*} value input value\n * @return {Number}\n * @public\n */\nexport function parseNumber(value) {\n if (isFinite(value) || (isString(value) && isDecimalOrExpo(value))) {\n // only parses the value consider as numeric.\n return parseFloat(value);\n }\n if (isString(value) && isCommaSeparatedNumber(value)) {\n return parseFloat(value.replace(/,/g, ''));\n }\n return NaN;\n}\n\n/**\n * Returns whether a string starts with a number.\n * @param {string} value\n * @returns boolean\n */\nexport function startsWithNumber(value) {\n return STARTS_WITH_NUMBER_REGEX.test(value);\n}\n\n/**\n *\n */\nconst getThousandSeparatorDecimalPrecisionFormatter = memoize(\n (locale = 'en', options = {}) => new Intl.NumberFormat(locale, options),\n (locale, options) => `${locale}${JSON.stringify(options)}`\n);\n\n/**\n- * Format number into string with precision and/or grouping\n- *\n- * Examples:\n- * ```js\n- * const { formatNumber } from '@splunk/react-visualizations/utils/numberUtils';\n- * assert.equal(formatNumber('1100’, 2, { useThousandSeparators: true }), '1,100.00’)\n- * ```\n- * @param {Number} number // value to format\n- * @param {Number} [precision] // number of digits after the decimal point\n- * @param {Object} [options]\n- * @param {Boolean} [options.useThousandSeparators=false] // flag to determine if grouping is desired\n- * @param {Object} [options.locale=moment.locale()] // Locale of the user for determinining how numbers are grouped\n- * @param {Number} [options.defaultPrecision=0] // The default precision to use if none is defined\n- * @param {Number} [options.useTrendUnits=false] // Add K, M, B, T to end of value, and divide by the appropriate order of magnitude\n- * @return {String}\n- * @public\n- */\nexport function formatNumber(number, precision, options = {}) {\n const formatOptions = {};\n\n // Precision is optional, so check if precision is an object, and use it as the options, otherwise load from options\n const {\n useThousandSeparators = false,\n locale = moment.locale(),\n defaultPrecision = 0,\n useTrendUnits = false,\n } = precision && typeof precision === 'object' ? precision : options;\n\n // Apply precision only when it is a positive integer\n if (isInteger(precision) && precision >= 0) {\n // Validate precision is within acceptable bounds\n const p = precision > 20 ? 20 : precision;\n\n formatOptions.minimumFractionDigits = p;\n formatOptions.maximumFractionDigits = p;\n } else {\n formatOptions.maximumFractionDigits = defaultPrecision;\n }\n\n formatOptions.useGrouping = useThousandSeparators === true;\n\n let trendUnit = '';\n let value = number;\n const units = [\n { letter: 'T', power: 12 },\n { letter: 'B', power: 9 },\n { letter: 'M', power: 6 },\n { letter: 'K', power: 3 },\n ];\n\n if (useTrendUnits) {\n const found = units.find(unit => Math.abs(value) > 10 ** unit.power);\n\n if (found) {\n value /= 10 ** found.power;\n trendUnit = found.letter;\n formatOptions.maximumFractionDigits = 2;\n formatOptions.minimumFractionDigits = 0;\n }\n }\n\n const formatter = getThousandSeparatorDecimalPrecisionFormatter(locale, formatOptions);\n\n return `${formatter.format(value)}${trendUnit ? _(trendUnit) : ''}`;\n}\n","module.exports = require(\"@splunk/ui-utils/i18n\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/moment\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"lodash\"","webpack:///./src/numberUtils.js","webpack:///external \"@splunk/ui-utils/i18n\""],"names":["DECIMAL_OR_SCIENTIFIC_REGEX","COMMA_SEPARATED_NUMBER_REGEX","STARTS_WITH_NUMBER_REGEX","isDecimalOrExpo","isCommaSeparatedNumber","isFinite","isString","isNumerialStr","parseFloat","value","getThousandSeparatorDecimalPrecisionFormatter","memoize","locale","options","Intl","JSON","formatOptions","precision","useThousandSeparators","moment","defaultPrecision","useTrendUnits","isInteger","p","trendUnit","units","letter","power","found","Math","unit","formatter","_"],"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,iC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AL,KAAW,gBAAI;AAAA,aAAIC,IAAI,CAAJA,0BAAwBC,IAAI,CAAhC,KAAID,CAAJ;AAA7B,KAAc,CAAd;;AAEA,eAAW;AACPpB,WAAK,iBAAUmB,KAAK,CAApBnB,KAAK,CAALA;AACAe,eAAS,GAAGI,KAAK,CAAjBJ;AACAR,mBAAa,CAAbA;AACAA,mBAAa,CAAbA;AACH;AACJ;;AAED,MAAMe,SAAS,GAAGrB,6CAA6C,SAA/D,aAA+D,CAA/D;AAEA,mBAAUqB,SAAS,CAATA,OAAV,KAAUA,CAAV,SAAoCP,SAAS,GAAGQ,+DAAC,CAAJ,SAAI,CAAJ,GAA7C;AACH,C;;;;;;;ACtJD,kD","file":"numberUtils.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 = 60);\n","module.exports = require(\"@splunk/moment\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"lodash\");","import moment from '@splunk/moment';\nimport { isFinite, isString, isInteger, memoize } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\n\n// Todo: need break out this utils after breaking out all visualizations\n/**\n * @file\n * A set of number formatting function used in Table\n */\nconst DECIMAL_OR_SCIENTIFIC_REGEX = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i;\nconst COMMA_SEPARATED_NUMBER_REGEX = /(^[-+]?([0]|([1-9][0-9]{0,2})|(([1-9][0-9]{0,2}[,])([0-9]{3}[,])*[0-9]{3}))(([.][0-9]+)?)$)/;\nconst STARTS_WITH_NUMBER_REGEX = /^[-+]?\\d/;\nfunction isDecimalOrExpo(str) {\n return DECIMAL_OR_SCIENTIFIC_REGEX.test(str);\n}\nfunction isCommaSeparatedNumber(str) {\n return COMMA_SEPARATED_NUMBER_REGEX.test(str);\n}\n\n/**\n * Check if a string can be considered as numeric, this includes decimal, scientific number and number with comma separator\n *\n * Examples:\n * ```js\n * const { isNumerialStr } from '@splunk/react-visualizations/utils/numberUtils';\n * assert.ok(isNumerialStr('11.123'));\n * ```\n * @param {String} str input value\n * @return {Boolean}\n * @public\n */\nexport function isNumerialStr(str) {\n return isDecimalOrExpo(str) || isCommaSeparatedNumber(str);\n}\n\n/**\n * Check if a value can be considered as numeric\n *\n * Examples:\n * ```js\n * const { isNumerial } from '@splunk/react-visualizations/utils/numberUtils';\n * assert.equal(isNumerial('11.123') == 11.123);\n * ```\n * @param {any} value input value\n * @return {Boolean}\n * @public\n */\nexport function isNumerial(value) {\n return isFinite(value) || (isString(value) && isNumerialStr(value));\n}\n\n/**\n * Parse input value into number, return NaN for not numercial value\n * @param {*} value input value\n * @return {Number}\n * @public\n */\nexport function parseNumber(value) {\n if (isFinite(value) || (isString(value) && isDecimalOrExpo(value))) {\n // only parses the value consider as numeric.\n return parseFloat(value);\n }\n if (isString(value) && isCommaSeparatedNumber(value)) {\n return parseFloat(value.replace(/,/g, ''));\n }\n return NaN;\n}\n\n/**\n * Returns whether a string starts with a number.\n * @param {string} value\n * @returns boolean\n */\nexport function startsWithNumber(value) {\n return STARTS_WITH_NUMBER_REGEX.test(value);\n}\n\n/**\n *\n */\nconst getThousandSeparatorDecimalPrecisionFormatter = memoize(\n (locale = 'en', options = {}) => new Intl.NumberFormat(locale, options),\n (locale, options) => `${locale}${JSON.stringify(options)}`\n);\n\n/**\n- * Format number into string with precision and/or grouping\n- *\n- * Examples:\n- * ```js\n- * const { formatNumber } from '@splunk/react-visualizations/utils/numberUtils';\n- * assert.equal(formatNumber('1100’, 2, { useThousandSeparators: true }), '1,100.00’)\n- * ```\n- * @param {Number} number // value to format\n- * @param {Number} [precision] // number of digits after the decimal point\n- * @param {Object} [options]\n- * @param {Boolean} [options.useThousandSeparators=false] // flag to determine if grouping is desired\n- * @param {Object} [options.locale=moment.locale()] // Locale of the user for determinining how numbers are grouped\n- * @param {Number} [options.defaultPrecision=0] // The default precision to use if none is defined\n- * @param {Number} [options.useTrendUnits=false] // Add K, M, B, T to end of value, and divide by the appropriate order of magnitude\n- * @return {String}\n- * @public\n- */\nexport function formatNumber(number, precision, options = {}) {\n const formatOptions = {};\n\n // Precision is optional, so check if precision is an object, and use it as the options, otherwise load from options\n const {\n useThousandSeparators = false,\n locale = moment.locale(),\n defaultPrecision = 0,\n useTrendUnits = false,\n } = precision && typeof precision === 'object' ? precision : options;\n\n // Apply precision only when it is a positive integer\n if (isInteger(precision) && precision >= 0) {\n // Validate precision is within acceptable bounds\n const p = precision > 20 ? 20 : precision;\n\n formatOptions.minimumFractionDigits = p;\n formatOptions.maximumFractionDigits = p;\n } else {\n formatOptions.maximumFractionDigits = defaultPrecision;\n }\n\n formatOptions.useGrouping = useThousandSeparators === true;\n\n let trendUnit = '';\n let value = number;\n const units = [\n { letter: 'T', power: 12 },\n { letter: 'B', power: 9 },\n { letter: 'M', power: 6 },\n { letter: 'K', power: 3 },\n ];\n\n if (useTrendUnits) {\n const found = units.find(unit => Math.abs(value) > 10 ** unit.power);\n\n if (found) {\n value /= 10 ** found.power;\n trendUnit = found.letter;\n formatOptions.maximumFractionDigits = 2;\n formatOptions.minimumFractionDigits = 0;\n }\n }\n\n const formatter = getThousandSeparatorDecimalPrecisionFormatter(locale, formatOptions);\n\n return `${formatter.format(value)}${trendUnit ? _(trendUnit) : ''}`;\n}\n","module.exports = require(\"@splunk/ui-utils/i18n\");"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Visualizations Shared Files",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"author": "Splunk",
|
|
6
|
-
"version": "26.
|
|
6
|
+
"version": "26.4.1",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "export NODE_OPTIONS=--openssl-legacy-provider && NODE_ENV=production webpack --config ./webpack.config.js --bail",
|
|
9
9
|
"build-storybook": "export NODE_OPTIONS=--openssl-legacy-provider && build-storybook -c .storybook -s fonts -o .storybook-bundle",
|
|
@@ -26,13 +26,14 @@
|
|
|
26
26
|
"test:visual:update": "yarn loki approve"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@babel/runtime": "^7.25.
|
|
29
|
+
"@babel/runtime": "^7.25.9",
|
|
30
30
|
"@splunk/moment": "^0.6.1",
|
|
31
|
-
"@splunk/react-icons": "^4.
|
|
32
|
-
"@splunk/react-ui": "^4.
|
|
33
|
-
"@splunk/themes": "^0.
|
|
31
|
+
"@splunk/react-icons": "^4.8.0",
|
|
32
|
+
"@splunk/react-ui": "^4.38.0",
|
|
33
|
+
"@splunk/themes": "^0.22.0",
|
|
34
34
|
"@splunk/ui-utils": "^1.7.1",
|
|
35
|
-
"@splunk/visualization-
|
|
35
|
+
"@splunk/visualization-encoding": "^26.4.1",
|
|
36
|
+
"@splunk/visualization-schemas": "^26.4.1",
|
|
36
37
|
"element-resize-detector": "^1.2.4",
|
|
37
38
|
"lodash": "^4.17.21",
|
|
38
39
|
"numeral": "^2.0.6",
|
|
@@ -47,8 +48,8 @@
|
|
|
47
48
|
"@babel/cli": "^7.13.0",
|
|
48
49
|
"@babel/core": "^7.13.0",
|
|
49
50
|
"@splunk/react-docs": "1.0.0-beta.18",
|
|
50
|
-
"@splunk/visualization-build-tools": "^26.
|
|
51
|
-
"@splunk/visualization-context": "^26.
|
|
51
|
+
"@splunk/visualization-build-tools": "^26.4.1",
|
|
52
|
+
"@splunk/visualization-context": "^26.4.1",
|
|
52
53
|
"@storybook/addon-actions": "^6.4.0",
|
|
53
54
|
"@storybook/addons": "^6.4.0",
|
|
54
55
|
"@storybook/react": "^6.5.16",
|
package/previewVizMessage.js
CHANGED
|
@@ -87,12 +87,12 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 61);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
94
94
|
|
|
95
|
-
/***/
|
|
95
|
+
/***/ 61:
|
|
96
96
|
/***/ (function(module, exports, __webpack_require__) {
|
|
97
97
|
|
|
98
98
|
"use strict";
|
package/previewVizMessage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/previewVizMessage.ts"],"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,IAAM,iBAAiB,GACnB,wGADJ;AAGA,kBAAe,iBAAf,C","file":"previewVizMessage.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 =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/previewVizMessage.ts"],"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,IAAM,iBAAiB,GACnB,wGADJ;AAGA,kBAAe,iBAAf,C","file":"previewVizMessage.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 = 61);\n","const previewVizMessage =\n '⚠️ This is a preview of a new visualization component. Minor updates and bug fixes should be expected.';\n\nexport default previewVizMessage;\n"],"sourceRoot":""}
|
package/propUtils.js
CHANGED
|
@@ -87,19 +87,19 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 62);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
94
94
|
|
|
95
|
-
/***/
|
|
95
|
+
/***/ 4:
|
|
96
96
|
/***/ (function(module, exports) {
|
|
97
97
|
|
|
98
98
|
module.exports = require("lodash");
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
102
|
-
/***/
|
|
102
|
+
/***/ 62:
|
|
103
103
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
104
104
|
|
|
105
105
|
"use strict";
|
|
@@ -108,7 +108,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
108
108
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatColor", function() { return formatColor; });
|
|
109
109
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToSCProperties", function() { return convertToSCProperties; });
|
|
110
110
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustOptionsToSchema", function() { return adjustOptionsToSchema; });
|
|
111
|
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
111
|
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
|
112
112
|
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
|
113
113
|
|
|
114
114
|
/**
|
package/propUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/propUtils.js"],"names":["convertPropsToString","vizProps","propNames","convertedVizProps","propValue","Array","isPlainObject","JSON","console","formatColor","color","convertToSCProperties","returnOptions","y2Fields","originalOptions","overlayFields","Object","newKey","optionsSCMapping","has","updatedValue","optionValuesSCMapping","isUndefined","field","stringValues","adjustOptionsToSchema"],"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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,OAAuC;AAAA,2BAApCC,QAAoC;AAAA,MAApCA,QAAoC,8BAAzB,EAAyB;AAAA,4BAArBC,SAAqB;AAAA,MAArBA,SAAqB,+BAAT,EAAS;AAC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Aa,CAAbA,GAAa,CAAbA;AACH;AACJ;AAjBJ,GAWDI,EAXC,CAoBD;;AACA,gBAAc;AACV,WAAOJ,aAAa,CAApB;AACAA,iBAAa,CAAbA,gBAAa,CAAbA;AACAA,iBAAa,CAAbA,eAAa,CAAbA,GAAiC,KAAK,CAAL,oBAC3B,QAAQ,CAAR,OAAgB,gBAAI;AAAA;AAApB,YAD2B,GAC3B,CAD2B,GAAjCA;AAxBH,IA6BD;;;AACA,qBAAmB;AACfA,iBAAa,CAAbA,gBAA8B,KAAK,CAAL,yBACxB,aAAa,CAAb,OACY,iBAAK;AAAA;AADjB,WAES,iBAAK;AAAA,aAAIW,KAAK,CAAT,IAAIA,EAAJ;AAFd,YADwB,GACxB,CADwB,GAA9BX;AA/BH,IAuCD;;;AACAY,cAAY,CAAZA,QAAqB,oBAAY;AAC7B,QAAMpB,SAAS,GAAGQ,aAAa,CAA/B,QAA+B,CAA/B;;AACA,QAAIP,KAAK,CAALA,sBAA4BC,4DAAa,CAA7C,SAA6C,CAA7C,EAA0D;AACtDM,mBAAa,CAAbA,QAAa,CAAbA,GAA0BL,IAAI,CAAJA,UAA1BK,SAA0BL,CAA1BK;AADJ,WAEO,IAAIR,SAAS,IAAI,qBAAjB,UAAgD;AACnD;AACAI,aAAO,CAAPA;AACH;AAPLgB;AASA;AAtDG;AAyDP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,iCAAoC;AACrE,MAAMb,aAAa,GAAnB;AACAI,QAAM,CAANA,4BAAmC,eAAO;AACtC,QAAIA,MAAM,CAANA,wBAAJ,GAAIA,CAAJ,EAAyC;AACrCJ,mBAAa,CAAbA,GAAa,CAAbA,GAAqBE,eAAe,CAApCF,GAAoC,CAApCA;AACH;AAHLI;AAKA;AAPG,E","file":"propUtils.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 = 61);\n","module.exports = require(\"lodash\");","import { isPlainObject, has, isUndefined } from 'lodash';\n\n/**\n * convert props of type 'array/object' to 'string', based on the list of props to be converted in vizProps\n * @method convertPropsToString\n * @param {Object} vizProps\n * @param {Array} propNames\n * @return {Object} convertedVizProps\n */\nexport const convertPropsToString = ({ vizProps = {}, propNames = [] }) => {\n const convertedVizProps = {};\n\n propNames.forEach(propName => {\n const propValue = vizProps[propName];\n if (Array.isArray(propValue) || isPlainObject(propValue)) {\n convertedVizProps[propName] = JSON.stringify(propValue);\n } else if (propValue && typeof propValue === 'string') {\n // eslint-disable-next-line no-console\n console.warn(`The option type 'string' for '${propName}' has been deprecated.`);\n }\n });\n\n return convertedVizProps;\n};\n\n/**\n * Convert a hex value to a color\n * @method formatColor\n * @param {String} color\n * @returns {String}\n */\nexport const formatColor = color => {\n if (!color || typeof color !== 'string') {\n return '';\n }\n\n return color.replace('0x', '#');\n};\n\n/**\n * Helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts\n * This is for options that has new key name and can not directly be mapped with SimpleXML or\n * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)\n * @method convertToAreaSCProperties\n * @param {Object} originalOptions\n * @param {Object} optionsSCMapping\n * @param {Object} optionValuesSCMapping\n * @param {Array} stringValues\n * @returns {Object}\n */\nexport const convertToSCProperties = (\n originalOptions,\n optionsSCMapping,\n optionValuesSCMapping,\n stringValues\n) => {\n const returnOptions = {};\n const { y2Fields, overlayFields } = originalOptions;\n\n // mapToOldKey\n Object.keys(originalOptions).forEach(key => {\n const newKey = optionsSCMapping[key] ? optionsSCMapping[key] : key;\n returnOptions[newKey] = originalOptions[key];\n });\n\n // mapToValues\n Object.keys(optionValuesSCMapping).forEach(key => {\n if (has(returnOptions, key)) {\n const updatedValue = optionValuesSCMapping[key][returnOptions[key]];\n if (!isUndefined(updatedValue)) {\n returnOptions[key] = updatedValue;\n }\n }\n });\n\n // convertY2AxisOptions\n if (y2Fields) {\n delete returnOptions.y2Fields;\n returnOptions['axisY2.enabled'] = true;\n returnOptions['axisY2.fields'] = Array.isArray(y2Fields)\n ? y2Fields.filter(name => name).join(',')\n : y2Fields;\n }\n\n // convertOverlayFields\n if (overlayFields) {\n returnOptions.overlayFields = Array.isArray(overlayFields)\n ? overlayFields\n .filter(field => field)\n .map(field => field.trim())\n .join(',')\n : overlayFields;\n }\n\n // convertToStringValues\n stringValues.forEach(propName => {\n const propValue = returnOptions[propName];\n if (Array.isArray(propValue) || isPlainObject(propValue)) {\n returnOptions[propName] = JSON.stringify(propValue);\n } else if (propValue && typeof propValue === 'string') {\n // eslint-disable-next-line no-console\n console.warn(`The option type 'string' for '${propName}' has been deprecated.`);\n }\n });\n return returnOptions;\n};\n\n/**\n * Helper for removing the option properties (and values) that are not part of schema\n * @method adjustOptionsToSchema\n * @param {Object} originalOptions\n * @param {Object} optionsSchema\n * @returns {Object}\n */\nexport const adjustOptionsToSchema = (originalOptions, optionsSchema) => {\n const returnOptions = {};\n Object.keys(optionsSchema).forEach(key => {\n if (Object.hasOwn(originalOptions, key)) {\n returnOptions[key] = originalOptions[key];\n }\n });\n return returnOptions;\n};\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/propUtils.js"],"names":["convertPropsToString","vizProps","propNames","convertedVizProps","propValue","Array","isPlainObject","JSON","console","formatColor","color","convertToSCProperties","returnOptions","y2Fields","originalOptions","overlayFields","Object","newKey","optionsSCMapping","has","updatedValue","optionValuesSCMapping","isUndefined","field","stringValues","adjustOptionsToSchema"],"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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,OAAuC;AAAA,2BAApCC,QAAoC;AAAA,MAApCA,QAAoC,8BAAzB,EAAyB;AAAA,4BAArBC,SAAqB;AAAA,MAArBA,SAAqB,+BAAT,EAAS;AACvE,MAAMC,iBAAiB,GAAvB;AAEAD,WAAS,CAATA,QAAkB,oBAAY;AAC1B,QAAME,SAAS,GAAGH,QAAQ,CAA1B,QAA0B,CAA1B;;AACA,QAAII,KAAK,CAALA,sBAA4BC,4DAAa,CAA7C,SAA6C,CAA7C,EAA0D;AACtDH,uBAAiB,CAAjBA,QAAiB,CAAjBA,GAA8BI,IAAI,CAAJA,UAA9BJ,SAA8BI,CAA9BJ;AADJ,WAEO,IAAIC,SAAS,IAAI,qBAAjB,UAAgD;AACnD;AACAI,aAAO,CAAPA;AACH;AAPLN;AAUA;AAbG;AAgBP;AACA;AACA;AACA;AACA;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AA,aAAIW,KAAK,CAAT,IAAIA,EAAJ;AAFd,YADwB,GACxB,CADwB,GAA9BX;AA/BH,IAuCD;;;AACAY,cAAY,CAAZA,QAAqB,oBAAY;AAC7B,QAAMpB,SAAS,GAAGQ,aAAa,CAA/B,QAA+B,CAA/B;;AACA,QAAIP,KAAK,CAALA,sBAA4BC,4DAAa,CAA7C,SAA6C,CAA7C,EAA0D;AACtDM,mBAAa,CAAbA,QAAa,CAAbA,GAA0BL,IAAI,CAAJA,UAA1BK,SAA0BL,CAA1BK;AADJ,WAEO,IAAIR,SAAS,IAAI,qBAAjB,UAAgD;AACnD;AACAI,aAAO,CAAPA;AACH;AAPLgB;AASA;AAtDG;AAyDP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,iCAAoC;AACrE,MAAMb,aAAa,GAAnB;AACAI,QAAM,CAANA,4BAAmC,eAAO;AACtC,QAAIA,MAAM,CAANA,wBAAJ,GAAIA,CAAJ,EAAyC;AACrCJ,mBAAa,CAAbA,GAAa,CAAbA,GAAqBE,eAAe,CAApCF,GAAoC,CAApCA;AACH;AAHLI;AAKA;AAPG,E","file":"propUtils.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 = 62);\n","module.exports = require(\"lodash\");","import { isPlainObject, has, isUndefined } from 'lodash';\n\n/**\n * convert props of type 'array/object' to 'string', based on the list of props to be converted in vizProps\n * @method convertPropsToString\n * @param {Object} vizProps\n * @param {Array} propNames\n * @return {Object} convertedVizProps\n */\nexport const convertPropsToString = ({ vizProps = {}, propNames = [] }) => {\n const convertedVizProps = {};\n\n propNames.forEach(propName => {\n const propValue = vizProps[propName];\n if (Array.isArray(propValue) || isPlainObject(propValue)) {\n convertedVizProps[propName] = JSON.stringify(propValue);\n } else if (propValue && typeof propValue === 'string') {\n // eslint-disable-next-line no-console\n console.warn(`The option type 'string' for '${propName}' has been deprecated.`);\n }\n });\n\n return convertedVizProps;\n};\n\n/**\n * Convert a hex value to a color\n * @method formatColor\n * @param {String} color\n * @returns {String}\n */\nexport const formatColor = color => {\n if (!color || typeof color !== 'string') {\n return '';\n }\n\n return color.replace('0x', '#');\n};\n\n/**\n * Helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts\n * This is for options that has new key name and can not directly be mapped with SimpleXML or\n * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)\n * @method convertToAreaSCProperties\n * @param {Object} originalOptions\n * @param {Object} optionsSCMapping\n * @param {Object} optionValuesSCMapping\n * @param {Array} stringValues\n * @returns {Object}\n */\nexport const convertToSCProperties = (\n originalOptions,\n optionsSCMapping,\n optionValuesSCMapping,\n stringValues\n) => {\n const returnOptions = {};\n const { y2Fields, overlayFields } = originalOptions;\n\n // mapToOldKey\n Object.keys(originalOptions).forEach(key => {\n const newKey = optionsSCMapping[key] ? optionsSCMapping[key] : key;\n returnOptions[newKey] = originalOptions[key];\n });\n\n // mapToValues\n Object.keys(optionValuesSCMapping).forEach(key => {\n if (has(returnOptions, key)) {\n const updatedValue = optionValuesSCMapping[key][returnOptions[key]];\n if (!isUndefined(updatedValue)) {\n returnOptions[key] = updatedValue;\n }\n }\n });\n\n // convertY2AxisOptions\n if (y2Fields) {\n delete returnOptions.y2Fields;\n returnOptions['axisY2.enabled'] = true;\n returnOptions['axisY2.fields'] = Array.isArray(y2Fields)\n ? y2Fields.filter(name => name).join(',')\n : y2Fields;\n }\n\n // convertOverlayFields\n if (overlayFields) {\n returnOptions.overlayFields = Array.isArray(overlayFields)\n ? overlayFields\n .filter(field => field)\n .map(field => field.trim())\n .join(',')\n : overlayFields;\n }\n\n // convertToStringValues\n stringValues.forEach(propName => {\n const propValue = returnOptions[propName];\n if (Array.isArray(propValue) || isPlainObject(propValue)) {\n returnOptions[propName] = JSON.stringify(propValue);\n } else if (propValue && typeof propValue === 'string') {\n // eslint-disable-next-line no-console\n console.warn(`The option type 'string' for '${propName}' has been deprecated.`);\n }\n });\n return returnOptions;\n};\n\n/**\n * Helper for removing the option properties (and values) that are not part of schema\n * @method adjustOptionsToSchema\n * @param {Object} originalOptions\n * @param {Object} optionsSchema\n * @returns {Object}\n */\nexport const adjustOptionsToSchema = (originalOptions, optionsSchema) => {\n const returnOptions = {};\n Object.keys(optionsSchema).forEach(key => {\n if (Object.hasOwn(originalOptions, key)) {\n returnOptions[key] = originalOptions[key];\n }\n });\n return returnOptions;\n};\n"],"sourceRoot":""}
|
package/schemaUtils.js
CHANGED
|
@@ -87,19 +87,12 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 63);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
94
94
|
|
|
95
|
-
/***/
|
|
96
|
-
/***/ (function(module, exports) {
|
|
97
|
-
|
|
98
|
-
module.exports = require("@splunk/visualization-schemas");
|
|
99
|
-
|
|
100
|
-
/***/ }),
|
|
101
|
-
|
|
102
|
-
/***/ 62:
|
|
95
|
+
/***/ 63:
|
|
103
96
|
/***/ (function(module, exports, __webpack_require__) {
|
|
104
97
|
|
|
105
98
|
"use strict";
|
|
@@ -110,7 +103,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
110
103
|
});
|
|
111
104
|
exports.getPattern = exports.DYNAMIC_OPTIONS_DSL_PATTERN = exports.COLOR_OR_TOKEN_PATTERN_WITH_RGBA = exports.COLOR_OR_TOKEN_PATTERN = exports.colorPatternWithRGBA = exports.colorPattern = exports.rgbaColorPattern = exports.rgbColorPattern = exports.TOKEN_PATTERN = exports.createTestSchema = exports.default = void 0; // Re-exported for backwards compatibility. Deprecate and remove in a future major release.
|
|
112
105
|
|
|
113
|
-
var visualization_schemas_1 = __webpack_require__(
|
|
106
|
+
var visualization_schemas_1 = __webpack_require__(64);
|
|
114
107
|
|
|
115
108
|
Object.defineProperty(exports, "default", {
|
|
116
109
|
enumerable: true,
|
|
@@ -179,6 +172,13 @@ Object.defineProperty(exports, "getPattern", {
|
|
|
179
172
|
}
|
|
180
173
|
});
|
|
181
174
|
|
|
175
|
+
/***/ }),
|
|
176
|
+
|
|
177
|
+
/***/ 64:
|
|
178
|
+
/***/ (function(module, exports) {
|
|
179
|
+
|
|
180
|
+
module.exports = require("@splunk/visualization-schemas");
|
|
181
|
+
|
|
182
182
|
/***/ })
|
|
183
183
|
|
|
184
184
|
/******/ });
|
package/schemaUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/visualization-schemas\""
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/schemaUtils.ts","webpack:///external \"@splunk/visualization-schemas\""],"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;;;;;;;;;;;;;;+TClFA;;AACA;;AACI;AAAA;AAAA;AAAA;AAAa;AAAb;AACA;AAAA;AAAA;AAAA;AAAgB;AAAhB;AACA;AAAA;AAAA;AAAA;AAAa;AAAb;AACA;AAAA;AAAA;AAAA;AAAe;AAAf;AACA;AAAA;AAAA;AAAA;AAAgB;AAAhB;AACA;AAAA;AAAA;AAAA;AAAY;AAAZ;AACA;AAAA;AAAA;AAAA;AAAoB;AAApB;AACA;AAAA;AAAA;AAAA;AAAsB;AAAtB;AACA;AAAA;AAAA;AAAA;AAAgC;AAAhC;AACA;AAAA;AAAA;AAAA;AAA2B;AAA3B;AACA;AAAA;AAAA;AAAA;AAAU;AAAV,G;;;;;;;ACZJ,0D","file":"schemaUtils.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 = 63);\n","// Re-exported for backwards compatibility. Deprecate and remove in a future major release.\nexport {\n schemaDraft07 as default,\n createTestSchema,\n TOKEN_PATTERN,\n rgbColorPattern,\n rgbaColorPattern,\n colorPattern,\n colorPatternWithRGBA,\n COLOR_OR_TOKEN_PATTERN,\n COLOR_OR_TOKEN_PATTERN_WITH_RGBA,\n DYNAMIC_OPTIONS_DSL_PATTERN,\n getPattern,\n} from '@splunk/visualization-schemas';\n","module.exports = require(\"@splunk/visualization-schemas\");"],"sourceRoot":""}
|
package/simpleXMLOptions.js
CHANGED
|
@@ -87,19 +87,19 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 65);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
94
94
|
|
|
95
|
-
/***/
|
|
95
|
+
/***/ 38:
|
|
96
96
|
/***/ (function(module, exports) {
|
|
97
97
|
|
|
98
98
|
module.exports = require("lodash/invert");
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
102
|
-
/***/
|
|
102
|
+
/***/ 65:
|
|
103
103
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
104
104
|
|
|
105
105
|
"use strict";
|
|
@@ -107,7 +107,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107
107
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceObjectKeysFromMap", function() { return replaceObjectKeysFromMap; });
|
|
108
108
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPropsForSimpleXMLOptions", function() { return getPropsForSimpleXMLOptions; });
|
|
109
109
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSimpleXMLOptionsForProps", function() { return getSimpleXMLOptionsForProps; });
|
|
110
|
-
/* harmony import */ var lodash_invert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
110
|
+
/* harmony import */ var lodash_invert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38);
|
|
111
111
|
/* harmony import */ var lodash_invert__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_invert__WEBPACK_IMPORTED_MODULE_0__);
|
|
112
112
|
|
|
113
113
|
var simpleXMLOptionsToPropsMap = {
|
package/simpleXMLOptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/invert\"","webpack:///./src/simpleXMLOptions.js"],"names":["simpleXMLOptionsToPropsMap","propsToSimpleXMLOptionsMap","invert","replaceObjectKeysFromMap","object","map","isValidKey","nuObject","Object","nuKey","getPropsForSimpleXMLOptions","options","value","getSimpleXMLOptionsForProps","props"],"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,0C;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAMA,0BAA0B,GAAG;AAC/B,+BAD+B;AAE/B,gCAF+B;AAG/B,gCAH+B;AAI/B,8BAJ+B;AAK/B,8BAL+B;AAM/B,+BAN+B;AAO/B,iCAP+B;AAQ/B,kCAR+B;AAS/B,kCAT+B;AAU/B,0CAV+B;AAW/B,sCAX+B;AAY/B,sCAZ+B;AAa/B,uCAb+B;AAc/B,+BAd+B;AAe/B,+BAf+B;AAgB/B,gCAhB+B;AAiB/B,+BAjB+B;A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AtFS,CAAnC;AAyFA,IAAMC,0BAA0B,GAAGC,oDAAM,CAAzC,0BAAyC,CAAzC,C,CAEA;;AACO,IAAMC,wBAAwB,GAAG,SAA3BA,wBAA2B,GAAoD;AAAA,MAAnDC,MAAmD,uEAA1C,EAA0C;AAAA,MAAtCC,GAAsC,uEAAhC,EAAgC;AAAA,MAA5BC,UAA4B,uEAAf;AAAA;AAAe;AACxF,MAAMC,QAAQ,GAAd;AACAC,QAAM,CAANA,qBAA4B,eAAO;AAC/B,QAAMC,KAAK,GAAGJ,GAAG,CAAjB,GAAiB,CAAjB;;AACA,QAAI,CAAJ,OAAY;AACR,UAAIC,UAAU,CAAd,GAAc,CAAd,EAAqB;AACjB;AACA;AACA;AACAC,gBAAQ,CAARA,GAAQ,CAARA,GAAgBH,MAAM,CAAtBG,GAAsB,CAAtBA;AACH;AANL,WAOO;AACHA,cAAQ,CAARA,KAAQ,CAARA,GAAkBH,MAAM,CAAxBG,GAAwB,CAAxBA;AACH;AAXLC;AAaA;AAfG;AAkBA,IAAME,2BAA2B,GAAG,SAA9BA,2BAA8B;AAAA,MAACC,OAAD;AAAA,SACvCR,wBAAwB,sCAAsC,iBAAK;AAAA,WAAIS,KAAK,CAALA,iBAAuB,CAA3B;AAD5B,GACf,CADe;AAApC;AAGA,IAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B;AAAA,MAACC,KAAD;AAAA,SACvCX,wBAAwB,QADe,0BACf,CADe;AAApC,E","file":"simpleXMLOptions.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 = 63);\n","module.exports = require(\"lodash/invert\");","import invert from 'lodash/invert';\n\nconst simpleXMLOptionsToPropsMap = {\n 'annotation.categoryColors': 'annotationColor',\n 'axisLabelsX.axisVisibility': 'xAxisVisibility',\n 'axisLabelsY.axisVisibility': 'yAxisVisibility',\n 'axisLabelsX.integerUnits': 'roundXAxisLabelsToInteger',\n 'axisLabelsY.integerUnits': 'roundYAxisLabelsToInteger',\n 'axisLabelsY2.integerUnits': 'roundY2AxisLabelsToInteger',\n 'axisLabelsY2.axisVisibility': 'y2AxisVisibility',\n 'axisLabelsX.extendsAxisRange': 'xAxisExtendsAxisRange',\n 'axisLabelsY.extendsAxisRange': 'yAxisExtendsAxisRange',\n 'axisLabelsX.majorLabelStyle.rotation': 'xAxisMajorLabelRotation',\n 'axisLabelsX.majorLabelVisibility': 'xAxisMajorLabelVisibility',\n 'axisLabelsY.majorLabelVisibility': 'yAxisMajorLabelVisibility',\n 'axisLabelsY2.majorLabelVisibility': 'y2AxisMajorLabelVisibility',\n 'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',\n 'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',\n 'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',\n 'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',\n 'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',\n 'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',\n 'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',\n 'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',\n 'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',\n 'axisLabelsX.majorUnit': 'xAxisMajorUnit',\n 'axisLabelsY.majorUnit': 'yAxisMajorUnit',\n 'axisLabelsY2.majorUnit': 'y2AxisMajorUnit',\n 'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',\n 'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',\n 'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',\n 'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',\n 'axisX.abbreviation': 'xAxisAbbreviation',\n 'axisY.abbreviation': 'yAxisAbbreviation',\n 'axisY2.abbreviation': 'y2AxisAbbreviation',\n 'axisX.includeZero': 'xAxisIncludeZero',\n 'axisY.includeZero': 'yAxisIncludeZero',\n 'axisY2.includeZero': 'y2AxisIncludeZero',\n 'axisX.maximumNumber': 'xAxisMax',\n 'axisY.maximumNumber': 'yAxisMax',\n 'axisY2.maximumNumber': 'y2AxisMax',\n 'axisX.minimumNumber': 'xAxisMin',\n 'axisY.minimumNumber': 'yAxisMin',\n 'axisY2.minimumNumber': 'y2AxisMin',\n 'axisX.scale': 'xAxisScale',\n 'axisY.scale': 'yAxisScale',\n 'axisY2.scale': 'y2AxisScale',\n 'axisTitleX.text': 'xAxisTitleText',\n 'axisTitleY.text': 'yAxisTitleText',\n 'axisTitleY2.text': 'y2AxisTitleText',\n 'axisTitleX.alignment': 'xAxisTitleAlignment',\n 'axisTitleY.alignment': 'yAxisTitleAlignment',\n 'axisTitleY2.alignment': 'y2AxisTitleAlignment',\n 'axisTitleX.visibility': 'xAxisTitleVisibility',\n 'axisTitleY.visibility': 'yAxisTitleVisibility',\n 'axisTitleY2.visibility': 'y2AxisTitleVisibility',\n 'chart.resultTruncationLimit': 'resultTruncationLimit',\n 'chart.overlayFields': 'overlayFields',\n 'axisY2.enabled': 'enableY2Axis',\n 'axisY2.fields': 'y2AxisField',\n 'chart.barSpacing': 'barSpacing',\n 'chart.columnSpacing': 'columnSpacing',\n 'chart.seriesSpacing': 'seriesSpacing',\n 'chart.nullValueMode': 'nullValueMode',\n 'chart.markerSize': 'markerSize',\n 'chart.showDataLabels': 'showDataLabels',\n 'chart.showLegend': 'showLegend',\n 'chart.showLines': 'showLines',\n 'chart.showMarkers': 'showMarkers',\n 'chart.stackMode': 'stackMode',\n 'data.fieldListMode': 'fieldListMode',\n 'data.fieldShowList': 'fieldShowList',\n 'data.fieldHideList': 'fieldHideList',\n 'gridLinesX.showMajorLines': 'showMajorXGridLines',\n 'gridLinesY.showMajorLines': 'showMajorYGridLines',\n 'gridLinesY2.showMajorLines': 'showMajorY2GridLines',\n 'gridLinesX.showMinorLines': 'showMinorXGridLines',\n 'gridLinesY.showMinorLines': 'showMinorYGridLines',\n 'gridLinesY2.showMinorLines': 'showMinorY2GridLines',\n 'layout.splitSeries': 'splitSeries',\n 'layout.splitSeries.allowIndependentYRanges': 'allowIndependentYRanges',\n 'legend.labels': 'legendLabels',\n 'legend.labelStyle.overflowMode': 'legendLabelOverflowMode',\n 'legend.masterLegend': 'masterLegend',\n 'legend.mode': 'legendMode',\n 'legend.placement': 'legendPlacement',\n 'chart.bubbleMaximumSize': 'bubbleMaxSize',\n 'chart.bubbleMinimumSize': 'bubbleMinSize',\n 'chart.bubbleSizeBy': 'bubbleSizeBy',\n};\n\nconst propsToSimpleXMLOptionsMap = invert(simpleXMLOptionsToPropsMap);\n\n// export to make it testable\nexport const replaceObjectKeysFromMap = (object = {}, map = {}, isValidKey = () => true) => {\n const nuObject = {};\n Object.keys(object).forEach(key => {\n const nuKey = map[key];\n if (!nuKey) {\n if (isValidKey(key)) {\n // @TODO(pwied):\n // get rid of this and ensure all known props are passed down to visualizations explicitly\n // captured here: SCP-14634\n nuObject[key] = object[key];\n }\n } else {\n nuObject[nuKey] = object[key];\n }\n });\n return nuObject;\n};\n\nexport const getPropsForSimpleXMLOptions = (options = {}) =>\n replaceObjectKeysFromMap(options, simpleXMLOptionsToPropsMap, value => value.indexOf('.') === -1);\n\nexport const getSimpleXMLOptionsForProps = (props = {}) =>\n replaceObjectKeysFromMap(props, propsToSimpleXMLOptionsMap);\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/invert\"","webpack:///./src/simpleXMLOptions.js"],"names":["simpleXMLOptionsToPropsMap","propsToSimpleXMLOptionsMap","invert","replaceObjectKeysFromMap","object","map","isValidKey","nuObject","Object","nuKey","getPropsForSimpleXMLOptions","options","value","getSimpleXMLOptionsForProps","props"],"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,0C;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAMA,0BAA0B,GAAG;AAC/B,+BAD+B;AAE/B,gCAF+B;AAG/B,gCAH+B;AAI/B,8BAJ+B;AAK/B,8BAL+B;AAM/B,+BAN+B;AAO/B,iCAP+B;AAQ/B,kCAR+B;AAS/B,kCAT+B;AAU/B,0CAV+B;AAW/B,sCAX+B;AAY/B,sCAZ+B;AAa/B,uCAb+B;AAc/B,+BAd+B;AAe/B,+BAf+B;AAgB/B,gCAhB+B;AAiB/B,+BAjB+B;AAkB/B,+BAlB+B;AAmB/B,gCAnB+B;AAoB/B,qCApB+B;AAqB/B,qCArB+B;AAsB/B,sCAtB+B;AAuB/B,2BAvB+B;AAwB/B,2BAxB+B;AAyB/B,4BAzB+B;AA0B/B,qCA1B+B;AA2B/B,qCA3B+B;AA4B/B,sCA5B+B;AA6B/B,+BA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;AAAA,MAA5BC,UAA4B,uEAAf;AAAA;AAAe;AACxF,MAAMC,QAAQ,GAAd;AACAC,QAAM,CAANA,qBAA4B,eAAO;AAC/B,QAAMC,KAAK,GAAGJ,GAAG,CAAjB,GAAiB,CAAjB;;AACA,QAAI,CAAJ,OAAY;AACR,UAAIC,UAAU,CAAd,GAAc,CAAd,EAAqB;AACjB;AACA;AACA;AACAC,gBAAQ,CAARA,GAAQ,CAARA,GAAgBH,MAAM,CAAtBG,GAAsB,CAAtBA;AACH;AANL,WAOO;AACHA,cAAQ,CAARA,KAAQ,CAARA,GAAkBH,MAAM,CAAxBG,GAAwB,CAAxBA;AACH;AAXLC;AAaA;AAfG;AAkBA,IAAME,2BAA2B,GAAG,SAA9BA,2BAA8B;AAAA,MAACC,OAAD;AAAA,SACvCR,wBAAwB,sCAAsC,iBAAK;AAAA,WAAIS,KAAK,CAALA,iBAAuB,CAA3B;AAD5B,GACf,CADe;AAApC;AAGA,IAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B;AAAA,MAACC,KAAD;AAAA,SACvCX,wBAAwB,QADe,0BACf,CADe;AAApC,E","file":"simpleXMLOptions.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 = 65);\n","module.exports = require(\"lodash/invert\");","import invert from 'lodash/invert';\n\nconst simpleXMLOptionsToPropsMap = {\n 'annotation.categoryColors': 'annotationColor',\n 'axisLabelsX.axisVisibility': 'xAxisVisibility',\n 'axisLabelsY.axisVisibility': 'yAxisVisibility',\n 'axisLabelsX.integerUnits': 'roundXAxisLabelsToInteger',\n 'axisLabelsY.integerUnits': 'roundYAxisLabelsToInteger',\n 'axisLabelsY2.integerUnits': 'roundY2AxisLabelsToInteger',\n 'axisLabelsY2.axisVisibility': 'y2AxisVisibility',\n 'axisLabelsX.extendsAxisRange': 'xAxisExtendsAxisRange',\n 'axisLabelsY.extendsAxisRange': 'yAxisExtendsAxisRange',\n 'axisLabelsX.majorLabelStyle.rotation': 'xAxisMajorLabelRotation',\n 'axisLabelsX.majorLabelVisibility': 'xAxisMajorLabelVisibility',\n 'axisLabelsY.majorLabelVisibility': 'yAxisMajorLabelVisibility',\n 'axisLabelsY2.majorLabelVisibility': 'y2AxisMajorLabelVisibility',\n 'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',\n 'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',\n 'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',\n 'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',\n 'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',\n 'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',\n 'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',\n 'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',\n 'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',\n 'axisLabelsX.majorUnit': 'xAxisMajorUnit',\n 'axisLabelsY.majorUnit': 'yAxisMajorUnit',\n 'axisLabelsY2.majorUnit': 'y2AxisMajorUnit',\n 'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',\n 'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',\n 'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',\n 'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',\n 'axisX.abbreviation': 'xAxisAbbreviation',\n 'axisY.abbreviation': 'yAxisAbbreviation',\n 'axisY2.abbreviation': 'y2AxisAbbreviation',\n 'axisX.includeZero': 'xAxisIncludeZero',\n 'axisY.includeZero': 'yAxisIncludeZero',\n 'axisY2.includeZero': 'y2AxisIncludeZero',\n 'axisX.maximumNumber': 'xAxisMax',\n 'axisY.maximumNumber': 'yAxisMax',\n 'axisY2.maximumNumber': 'y2AxisMax',\n 'axisX.minimumNumber': 'xAxisMin',\n 'axisY.minimumNumber': 'yAxisMin',\n 'axisY2.minimumNumber': 'y2AxisMin',\n 'axisX.scale': 'xAxisScale',\n 'axisY.scale': 'yAxisScale',\n 'axisY2.scale': 'y2AxisScale',\n 'axisTitleX.text': 'xAxisTitleText',\n 'axisTitleY.text': 'yAxisTitleText',\n 'axisTitleY2.text': 'y2AxisTitleText',\n 'axisTitleX.alignment': 'xAxisTitleAlignment',\n 'axisTitleY.alignment': 'yAxisTitleAlignment',\n 'axisTitleY2.alignment': 'y2AxisTitleAlignment',\n 'axisTitleX.visibility': 'xAxisTitleVisibility',\n 'axisTitleY.visibility': 'yAxisTitleVisibility',\n 'axisTitleY2.visibility': 'y2AxisTitleVisibility',\n 'chart.resultTruncationLimit': 'resultTruncationLimit',\n 'chart.overlayFields': 'overlayFields',\n 'axisY2.enabled': 'enableY2Axis',\n 'axisY2.fields': 'y2AxisField',\n 'chart.barSpacing': 'barSpacing',\n 'chart.columnSpacing': 'columnSpacing',\n 'chart.seriesSpacing': 'seriesSpacing',\n 'chart.nullValueMode': 'nullValueMode',\n 'chart.markerSize': 'markerSize',\n 'chart.showDataLabels': 'showDataLabels',\n 'chart.showLegend': 'showLegend',\n 'chart.showLines': 'showLines',\n 'chart.showMarkers': 'showMarkers',\n 'chart.stackMode': 'stackMode',\n 'data.fieldListMode': 'fieldListMode',\n 'data.fieldShowList': 'fieldShowList',\n 'data.fieldHideList': 'fieldHideList',\n 'gridLinesX.showMajorLines': 'showMajorXGridLines',\n 'gridLinesY.showMajorLines': 'showMajorYGridLines',\n 'gridLinesY2.showMajorLines': 'showMajorY2GridLines',\n 'gridLinesX.showMinorLines': 'showMinorXGridLines',\n 'gridLinesY.showMinorLines': 'showMinorYGridLines',\n 'gridLinesY2.showMinorLines': 'showMinorY2GridLines',\n 'layout.splitSeries': 'splitSeries',\n 'layout.splitSeries.allowIndependentYRanges': 'allowIndependentYRanges',\n 'legend.labels': 'legendLabels',\n 'legend.labelStyle.overflowMode': 'legendLabelOverflowMode',\n 'legend.masterLegend': 'masterLegend',\n 'legend.mode': 'legendMode',\n 'legend.placement': 'legendPlacement',\n 'chart.bubbleMaximumSize': 'bubbleMaxSize',\n 'chart.bubbleMinimumSize': 'bubbleMinSize',\n 'chart.bubbleSizeBy': 'bubbleSizeBy',\n};\n\nconst propsToSimpleXMLOptionsMap = invert(simpleXMLOptionsToPropsMap);\n\n// export to make it testable\nexport const replaceObjectKeysFromMap = (object = {}, map = {}, isValidKey = () => true) => {\n const nuObject = {};\n Object.keys(object).forEach(key => {\n const nuKey = map[key];\n if (!nuKey) {\n if (isValidKey(key)) {\n // @TODO(pwied):\n // get rid of this and ensure all known props are passed down to visualizations explicitly\n // captured here: SCP-14634\n nuObject[key] = object[key];\n }\n } else {\n nuObject[nuKey] = object[key];\n }\n });\n return nuObject;\n};\n\nexport const getPropsForSimpleXMLOptions = (options = {}) =>\n replaceObjectKeysFromMap(options, simpleXMLOptionsToPropsMap, value => value.indexOf('.') === -1);\n\nexport const getSimpleXMLOptionsForProps = (props = {}) =>\n replaceObjectKeysFromMap(props, propsToSimpleXMLOptionsMap);\n"],"sourceRoot":""}
|