@splunk/visualizations-shared 25.5.0 → 25.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/Downloader.js +2 -2
  2. package/Downloader.js.map +1 -1
  3. package/FileDownloader.js +6 -6
  4. package/FileDownloader.js.map +1 -1
  5. package/JSONSchemaUtils.js +4 -4
  6. package/JSONSchemaUtils.js.map +1 -1
  7. package/LICENSE.md +444 -8
  8. package/Message.js +2 -2
  9. package/Message.js.map +1 -1
  10. package/RemoteIcon.js +5 -6
  11. package/RemoteIcon.js.map +1 -1
  12. package/RemoteImage.js +5 -6
  13. package/RemoteImage.js.map +1 -1
  14. package/SanitizeProps.js +8 -7
  15. package/SanitizeProps.js.map +1 -1
  16. package/SizeAwareWrapper.js +24 -32
  17. package/SizeAwareWrapper.js.map +1 -1
  18. package/VisualizationDocPage.js +12 -12
  19. package/VisualizationDocPage.js.map +1 -1
  20. package/colorConstants.js +4 -4
  21. package/colorConstants.js.map +1 -1
  22. package/colorUtils.js +2 -2
  23. package/colorUtils.js.map +1 -1
  24. package/configUtils.js +2 -2
  25. package/configUtils.js.map +1 -1
  26. package/console.js +4 -4
  27. package/console.js.map +1 -1
  28. package/dataSourceUtils.js +2 -2
  29. package/dataSourceUtils.js.map +1 -1
  30. package/domUtils.js +4 -4
  31. package/domUtils.js.map +1 -1
  32. package/hocUtils.js +6 -6
  33. package/hocUtils.js.map +1 -1
  34. package/i18n.js +4 -4
  35. package/i18n.js.map +1 -1
  36. package/mapUtils.js +2 -2
  37. package/mapUtils.js.map +1 -1
  38. package/numberUtils.js +4 -4
  39. package/numberUtils.js.map +1 -1
  40. package/package.json +4 -5
  41. package/previewVizMessage.js +2 -2
  42. package/previewVizMessage.js.map +1 -1
  43. package/propUtils.js +4 -4
  44. package/propUtils.js.map +1 -1
  45. package/simpleXMLOptions.js +4 -4
  46. package/simpleXMLOptions.js.map +1 -1
  47. package/testHelper.js +2 -2
  48. package/testHelper.js.map +1 -1
  49. package/themeUtils.js +6 -6
  50. package/themeUtils.js.map +1 -1
  51. package/trellisUtils.js +368 -0
  52. package/trellisUtils.js.map +1 -0
package/console.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 = 55);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 54);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -99,20 +99,20 @@ module.exports = require("@babel/runtime/helpers/typeof");
99
99
 
100
100
  /***/ }),
101
101
 
102
- /***/ 28:
102
+ /***/ 24:
103
103
  /***/ (function(module, exports) {
104
104
 
105
105
  module.exports = require("@babel/runtime/helpers/toConsumableArray");
106
106
 
107
107
  /***/ }),
108
108
 
109
- /***/ 55:
109
+ /***/ 54:
110
110
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
111
111
 
112
112
  "use strict";
113
113
  __webpack_require__.r(__webpack_exports__);
114
114
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logfmt", function() { return logfmt; });
115
- /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28);
115
+ /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
116
116
  /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
117
117
  /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
118
118
  /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);
package/console.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///./src/console.js"],"names":["hasWindowConsole","hasConsoleMethod","window","noop","console","log","debug","info","warn","error","group","groupCollapsed","groupEnd","logWithDetails","lines","Array","values","strings"],"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,0D;;;;;;;ACAA,qE;;;;;;;;;;;;;;;;ACAA,IAAMA,gBAAgB,GAAG,6IAA8B,aAAvD;;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,SAAM;AAAA,SAAID,gBAAgB,IAAI,OAAOE,MAAM,CAANA,QAAP,MAAOA,CAAP,KAAxB;AAA/B;;AACA,IAAMC,IAAI,GAAG,SAAPA,IAAO,GAAM,CAAnB;;AAEA,IAAMC,OAAO,GAAG;AACZC,KAAG,EAAE,gBAAgB,CAAhB,KAAgB,CAAhB,GAA0B;AAAA;;AAAA,WAAa,yBAAM,CAAN,oCAAb,SAAa,CAAb;AAA1B,MADO;AAEZC,OAAK,EAAE,gBAAgB,CAAhB,OAAgB,CAAhB,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\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 = 55);\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","const hasWindowConsole = typeof window === 'object' && 'console' in window;\nconst hasConsoleMethod = method => hasWindowConsole && typeof window.console[method] === 'function';\nconst noop = () => {};\n\nconst console = {\n log: hasConsoleMethod('log') ? (...args) => window.console.log(...args) : noop,\n debug: hasConsoleMethod('debug') ? (...args) => window.console.debug(...args) : noop,\n info: hasConsoleMethod('info') ? (...args) => window.console.info(...args) : noop,\n warn: hasConsoleMethod('warn') ? (...args) => window.console.warn(...args) : noop,\n error: hasConsoleMethod('error') ? (...args) => window.console.error(...args) : noop,\n group: hasConsoleMethod('group') ? (...args) => window.console.group(...args) : noop,\n groupCollapsed: hasConsoleMethod('groupCollapsed')\n ? (...args) => window.console.groupCollapsed(...args)\n : noop,\n groupEnd: hasConsoleMethod('groupEnd') ? (...args) => window.console.groupEnd(...args) : noop,\n\n logWithDetails(message, lines) {\n console.groupCollapsed(message);\n lines.forEach(line => (Array.isArray(line) ? console.log(...line) : console.log(line)));\n console.groupEnd();\n },\n};\n\nexport default console;\n\nexport function logfmt(strings, ...values) {\n return [strings.join('%o'), ...(values || [])];\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///./src/console.js"],"names":["hasWindowConsole","hasConsoleMethod","window","noop","console","log","debug","info","warn","error","group","groupCollapsed","groupEnd","logWithDetails","lines","Array","values","strings"],"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,0D;;;;;;;ACAA,qE;;;;;;;;;;;;;;;;ACAA,IAAMA,gBAAgB,GAAG,6IAA8B,aAAvD;;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,SAAM;AAAA,SAAID,gBAAgB,IAAI,OAAOE,MAAM,CAANA,QAAP,MAAOA,CAAP,KAAxB;AAA/B;;AACA,IAAMC,IAAI,GAAG,SAAPA,IAAO,GAAM,CAAnB;;AAEA,IAAMC,OAAO,GAAG;AACZC,KAAG,EAAE,gBAAgB,CAAhB,KAAgB,CAAhB,GAA0B;AAAA;;AAAA,WAAa,yBAAM,CAAN,oCAAb,SAAa,CAAb;AAA1B,MADO;AAEZC,OAAK,EAAE,gBAAgB,CAAhB,OAAgB,CAAhB,GAA4B;AAAA;;AAAA,WAAa,0BAAM,CAAN,uCAAb,SAAa,CAAb;AAA5B,MAFK;AAGZC,MAAI,EAAE,gBAAgB,CAAhB,MAAgB,CAAhB,GAA2B;AAAA;;AAAA,WAAa,0BAAM,CAAN,sCAAb,SAAa,CAAb;AAA3B,MAHM;AAIZC,MAAI,EAAE,gBAAgB,CAAhB,MAAgB,CAAhB,GAA2B;AAAA;;AAAA,WAAa,0BAAM,CAAN,sCAAb,SAAa,CAAb;AAA3B,MAJM;AAKZC,OAAK,EAAE,gBAAgB,CAAhB,OAAgB,CAAhB,GAA4B;AAAA;;AAAA,WAAa,0BAAM,CAAN,uCAAb,SAAa,CAAb;AAA5B,MALK;AAMZC,OAAK,EAAE,gBAAgB,CAAhB,OAAgB,CAAhB,GAA4B;AAAA;;AAAA,WAAa,0BAAM,CAAN,uCAAb,SAAa,CAAb;AAA5B,MANK;AAOZC,gBAAc,EAAE,gBAAgB,CAAhB,gBAAgB,CAAhB,GACV;AAAA;;AAAA,WAAa,0BAAM,CAAN,gDAAb,SAAa,CAAb;AADU,MAPJ;AAUZC,UAAQ,EAAE,gBAAgB,CAAhB,UAAgB,CAAhB,GAA+B;AAAA;;AAAA,WAAa,0BAAM,CAAN,0CAAb,SAAa,CAAb;AAA/B,MAVE;AAYZC,gBAZY,0CAYmB;AAC3BT,WAAO,CAAPA;AACAU,SAAK,CAALA,QAAc,gBAAI;AAAA,aAAKC,KAAK,CAALA,gBAAsBX,OAAO,CAAPA,mBAAO,gFAA7BW,IAA6B,CAAPX,CAAtBW,GAA6CX,OAAO,CAAPA,IAAlD,IAAkDA,CAAlD;AAAlBU;AACAV,WAAO,CAAPA;AACH;AAhBW,CAAhB;AAmBA;AAEO,yBAAoC;AAAA,oCAARY,MAAQ;AAARA,UAAQ,UAARA,GAAQ,eAARA;AAAQ;;AACvC,UAAQC,OAAO,CAAPA,KAAR,IAAQA,CAAR,yFAAgCD,MAAM,IAAtC;AACH,C","file":"console.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 = 54);\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","const hasWindowConsole = typeof window === 'object' && 'console' in window;\nconst hasConsoleMethod = method => hasWindowConsole && typeof window.console[method] === 'function';\nconst noop = () => {};\n\nconst console = {\n log: hasConsoleMethod('log') ? (...args) => window.console.log(...args) : noop,\n debug: hasConsoleMethod('debug') ? (...args) => window.console.debug(...args) : noop,\n info: hasConsoleMethod('info') ? (...args) => window.console.info(...args) : noop,\n warn: hasConsoleMethod('warn') ? (...args) => window.console.warn(...args) : noop,\n error: hasConsoleMethod('error') ? (...args) => window.console.error(...args) : noop,\n group: hasConsoleMethod('group') ? (...args) => window.console.group(...args) : noop,\n groupCollapsed: hasConsoleMethod('groupCollapsed')\n ? (...args) => window.console.groupCollapsed(...args)\n : noop,\n groupEnd: hasConsoleMethod('groupEnd') ? (...args) => window.console.groupEnd(...args) : noop,\n\n logWithDetails(message, lines) {\n console.groupCollapsed(message);\n lines.forEach(line => (Array.isArray(line) ? console.log(...line) : console.log(line)));\n console.groupEnd();\n },\n};\n\nexport default console;\n\nexport function logfmt(strings, ...values) {\n return [strings.join('%o'), ...(values || [])];\n}\n"],"sourceRoot":""}
@@ -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 = 56);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 55);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 56:
95
+ /***/ 55:
96
96
  /***/ (function(module, exports, __webpack_require__) {
97
97
 
98
98
  "use strict";
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/dataSourceUtils.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,IAAY,eAAZ;;AAAA,WAAY,eAAZ,EAA2B;AACvB;AACA;AACA;AACA;AACH,CALD,EAAY,eAAe,GAAf,sDAAe,EAAf,CAAZ;;AAOA,IAAM,kBAAkB,GAAG,SAArB,kBAAqB,CAAC,UAAD,EAAgC;AACvD,MAAI,CAAC,UAAL,EAAiB;AACb,WAAO,eAAe,CAAC,WAAvB;AACH;;AAHsD,MAI/C,KAJ+C,GAI/B,UAJ+B,CAI/C,KAJ+C;AAAA,MAIxC,IAJwC,GAI/B,UAJ+B,CAIxC,IAJwC;;AAKvD,MAAI,UAAU,CAAC,KAAf,EAAsB;AAClB,WAAO,eAAe,CAAC,KAAvB;AACH;;AACD,MAAI,KAAK,IAAI,IAAT,IAAiB,IAAI,IAAI,IAA7B,EAAmC;AAC/B,WAAO,eAAe,CAAC,OAAvB;AACH;;AACD,SAAO,eAAe,CAAC,EAAvB;AACH,CAZD;AAaA;;;AAGG;;;AACI,IAAM,sBAAsB,GAAG,SAAzB,sBAAyB,CAClC,UADkC,EAE6B;AAC/D,MAAM,eAAe,GAAoB,kBAAkB,CAAC,UAAD,CAA3D;AACA,SAAO;AACH,YAAQ,EAAE,eAAe,KAAK,eAAe,CAAC,KAD3C;AAEH,aAAS,EAAE,eAAe,KAAK,eAAe,CAAC,WAF5C;AAGH,aAAS,EAAE,eAAe,KAAK,eAAe,CAAC;AAH5C,GAAP;AAKH,CATM;;AAAM,iCAAsB,sBAAtB,C","file":"dataSourceUtils.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 = 56);\n","export enum DataSourceState {\n NONEXISTENT = 0,\n ERROR = 1,\n LOADING = 2,\n OK = 3,\n}\n\nconst getDataSourceState = (dataSource): DataSourceState => {\n if (!dataSource) {\n return DataSourceState.NONEXISTENT;\n }\n const { error, data } = dataSource;\n if (dataSource.error) {\n return DataSourceState.ERROR;\n }\n if (error == null && data == null) {\n return DataSourceState.LOADING;\n }\n return DataSourceState.OK;\n};\n/**\n * A utility fn to return data source state info as an object of boolean flags\n * @param dataSource\n */\nexport const getDataSourceStateInfo = (\n dataSource\n): { hasError: boolean; isMissing: boolean; isLoading: boolean } => {\n const dataSourceState: DataSourceState = getDataSourceState(dataSource);\n return {\n hasError: dataSourceState === DataSourceState.ERROR,\n isMissing: dataSourceState === DataSourceState.NONEXISTENT,\n isLoading: dataSourceState === DataSourceState.LOADING,\n };\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/dataSourceUtils.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,IAAY,eAAZ;;AAAA,WAAY,eAAZ,EAA2B;AACvB;AACA;AACA;AACA;AACH,CALD,EAAY,eAAe,GAAf,sDAAe,EAAf,CAAZ;;AAoBA,IAAM,kBAAkB,GAAG,SAArB,kBAAqB,CAAC,UAAD,EAAgC;AACvD,MAAI,CAAC,UAAL,EAAiB;AACb,WAAO,eAAe,CAAC,WAAvB;AACH;;AAHsD,MAI/C,KAJ+C,GAI/B,UAJ+B,CAI/C,KAJ+C;AAAA,MAIxC,IAJwC,GAI/B,UAJ+B,CAIxC,IAJwC;;AAKvD,MAAI,UAAU,CAAC,KAAf,EAAsB;AAClB,WAAO,eAAe,CAAC,KAAvB;AACH;;AACD,MAAI,KAAK,IAAI,IAAT,IAAiB,IAAI,IAAI,IAA7B,EAAmC;AAC/B,WAAO,eAAe,CAAC,OAAvB;AACH;;AACD,SAAO,eAAe,CAAC,EAAvB;AACH,CAZD;AAaA;;;AAGG;;;AACI,IAAM,sBAAsB,GAAG,SAAzB,sBAAyB,CAClC,UADkC,EAE6B;AAC/D,MAAM,eAAe,GAAoB,kBAAkB,CAAC,UAAD,CAA3D;AACA,SAAO;AACH,YAAQ,EAAE,eAAe,KAAK,eAAe,CAAC,KAD3C;AAEH,aAAS,EAAE,eAAe,KAAK,eAAe,CAAC,WAF5C;AAGH,aAAS,EAAE,eAAe,KAAK,eAAe,CAAC;AAH5C,GAAP;AAKH,CATM;;AAAM,iCAAsB,sBAAtB,C","file":"dataSourceUtils.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 = 55);\n","export enum DataSourceState {\n NONEXISTENT = 0,\n ERROR = 1,\n LOADING = 2,\n OK = 3,\n}\n\n/**\n * represents the data in a raw columnar format, resulting from a splunk\n * query request.\n */\nexport interface FieldEntry {\n name: string;\n type?: string;\n groupby_rank?: string; // eslint-disable-line\n splitby_field?: string; // eslint-disable-line\n splitby_value?: string; // eslint-disable-line\n data_source?: string; // eslint-disable-line\n}\n\nconst getDataSourceState = (dataSource): DataSourceState => {\n if (!dataSource) {\n return DataSourceState.NONEXISTENT;\n }\n const { error, data } = dataSource;\n if (dataSource.error) {\n return DataSourceState.ERROR;\n }\n if (error == null && data == null) {\n return DataSourceState.LOADING;\n }\n return DataSourceState.OK;\n};\n/**\n * A utility fn to return data source state info as an object of boolean flags\n * @param dataSource\n */\nexport const getDataSourceStateInfo = (\n dataSource\n): { hasError: boolean; isMissing: boolean; isLoading: boolean } => {\n const dataSourceState: DataSourceState = getDataSourceState(dataSource);\n return {\n hasError: dataSourceState === DataSourceState.ERROR,\n isMissing: dataSourceState === DataSourceState.NONEXISTENT,\n isLoading: dataSourceState === DataSourceState.LOADING,\n };\n};\n"],"sourceRoot":""}
package/domUtils.js CHANGED
@@ -87,26 +87,26 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 57);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 56);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 40:
95
+ /***/ 39:
96
96
  /***/ (function(module, exports) {
97
97
 
98
98
  module.exports = require("lodash/memoize");
99
99
 
100
100
  /***/ }),
101
101
 
102
- /***/ 57:
102
+ /***/ 56:
103
103
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
104
104
 
105
105
  "use strict";
106
106
  __webpack_require__.r(__webpack_exports__);
107
107
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeTextSize", function() { return computeTextSize; });
108
108
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPropValue", function() { return getPropValue; });
109
- /* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40);
109
+ /* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39);
110
110
  /* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_0__);
111
111
 
112
112
  var computeTextSize = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function (text, font) {
package/domUtils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/memoize\"","webpack:///./src/domUtils.js"],"names":["computeTextSize","memoize","canvas","document","context","measure","window"],"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,2C;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAMA,eAAe,GAAGC,qDAAO,CAClC,sBAAgB;AACZ,MAAMC,MAAM,GAAGC,QAAQ,CAARA,cAAf,QAAeA,CAAf;AACA,MAAMC,OAAO,GAAGF,MAAM,CAANA,WAAhB,IAAgBA,CAAhB;AACAE,SAAO,CAAPA;AACA,MAAMC,OAAO,GAAGD,OAAO,CAAPA,YAAhB,IAAgBA,CAAhB;AACA,SAAOC,OAAO,CAAd;AAN8B,GAQlC;AAAA;AARG,CAA+B,CAA/B;AAWA,yCAAyC;AAC5C,SAAOC,MAAM,CAANA,2CAAP,QAAOA,CAAP;AACH,C","file":"domUtils.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 = 57);\n","module.exports = require(\"lodash/memoize\");","import memoize from 'lodash/memoize';\n\nexport const computeTextSize = memoize(\n (text, font) => {\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n context.font = font;\n const measure = context.measureText(text);\n return measure.width;\n },\n (text, font) => `${text}${font}`\n);\n\nexport function getPropValue(element, property) {\n return window.getComputedStyle(element).getPropertyValue(property);\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/memoize\"","webpack:///./src/domUtils.js"],"names":["computeTextSize","memoize","canvas","document","context","measure","window"],"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,2C;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAMA,eAAe,GAAGC,qDAAO,CAClC,sBAAgB;AACZ,MAAMC,MAAM,GAAGC,QAAQ,CAARA,cAAf,QAAeA,CAAf;AACA,MAAMC,OAAO,GAAGF,MAAM,CAANA,WAAhB,IAAgBA,CAAhB;AACAE,SAAO,CAAPA;AACA,MAAMC,OAAO,GAAGD,OAAO,CAAPA,YAAhB,IAAgBA,CAAhB;AACA,SAAOC,OAAO,CAAd;AAN8B,GAQlC;AAAA;AARG,CAA+B,CAA/B;AAWA,yCAAyC;AAC5C,SAAOC,MAAM,CAANA,2CAAP,QAAOA,CAAP;AACH,C","file":"domUtils.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 = 56);\n","module.exports = require(\"lodash/memoize\");","import memoize from 'lodash/memoize';\n\nexport const computeTextSize = memoize(\n (text, font) => {\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n context.font = font;\n const measure = context.measureText(text);\n return measure.width;\n },\n (text, font) => `${text}${font}`\n);\n\nexport function getPropValue(element, property) {\n return window.getComputedStyle(element).getPropertyValue(property);\n}\n"],"sourceRoot":""}
package/hocUtils.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 = 58);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 57);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -99,7 +99,7 @@ module.exports = require("@babel/runtime/helpers/typeof");
99
99
 
100
100
  /***/ }),
101
101
 
102
- /***/ 27:
102
+ /***/ 28:
103
103
  /***/ (function(module, exports, __webpack_require__) {
104
104
 
105
105
  "use strict";
@@ -156,14 +156,14 @@ exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
156
156
 
157
157
  /***/ }),
158
158
 
159
- /***/ 3:
159
+ /***/ 4:
160
160
  /***/ (function(module, exports) {
161
161
 
162
162
  module.exports = require("lodash");
163
163
 
164
164
  /***/ }),
165
165
 
166
- /***/ 58:
166
+ /***/ 57:
167
167
  /***/ (function(module, exports, __webpack_require__) {
168
168
 
169
169
  "use strict";
@@ -176,9 +176,9 @@ Object.defineProperty(exports, "__esModule", {
176
176
  });
177
177
  exports.deepMergeWithArrayPrimitiveOverrides = void 0;
178
178
 
179
- var lodash_1 = __webpack_require__(3);
179
+ var lodash_1 = __webpack_require__(4);
180
180
 
181
- var mapUtils_1 = __webpack_require__(27);
181
+ var mapUtils_1 = __webpack_require__(28);
182
182
  /**
183
183
  * helper to deeply merge objects while preserving arrays in earlier source objects
184
184
  * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object
package/hocUtils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///./src/mapUtils.ts","webpack:///external \"lodash\"","webpack:///./src/hocUtils.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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zB,CAFkB,CAAtB;AAIH;AACJ;AACJ;AACJ;AACJ,KAnCD;AAoCH,GArCD;AAsCA,SAAO,KAAP;AACH,CAzCM;;AAAM,+CAAoC,oCAApC,C","file":"hocUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 58);\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","export interface GeoJsonDataType {\n type: string;\n coordinates: Array<Array<Array<[number, number]>>>;\n}\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n","module.exports = require(\"lodash\");","import { cloneDeep } from 'lodash';\nimport { findClosestMatchFromDefaultList } from './mapUtils';\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object\n * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).\n * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair\n * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.\n *\n * @method deepMergeWithArrayPrimitiveOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayPrimitiveOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey],\n sourceToApply[sourceKey]\n );\n } else if (\n Array.isArray(clone[sourceKey]) &&\n typeof clone[sourceKey][0] === 'object' &&\n !Array.isArray(clone[sourceKey][0])\n ) {\n // If option is an array of objects\n for (let i = 0; i < clone[sourceKey].length; i += 1) {\n if (typeof clone[sourceKey][i] === 'object') {\n const closestMatchIdx = findClosestMatchFromDefaultList(\n sourceToApply[sourceKey],\n clone[sourceKey][i]\n );\n if (closestMatchIdx > -1) {\n clone[sourceKey][i] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey][i],\n sourceToApply[sourceKey][closestMatchIdx]\n );\n }\n }\n }\n }\n });\n });\n return clone;\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///./src/mapUtils.ts","webpack:///external \"lodash\"","webpack:///./src/hocUtils.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,0D;;;;;;;;;;;;;;ACKA;;;;;;;;;;;;;;;;;AAiBG;;AACI,IAAM,+BAA+B,GAAG,SAAlC,+BAAkC,CAC3C,UAD2C,EAE3C,QAF2C,EAGnC;AACR,MAAI,CAAC,KAAK,CAAC,OAAN,CAAc,UAAd,CAAD,IAA8B,UAAU,CAAC,MAAX,KAAsB,CAAxD,EAA2D;AACvD,WAAO,CAAC,CAAR;AACH;;AACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAP,CAAY,QAAZ,CAAb;AACA,MAAI,WAAW,GAAG,CAAlB;AACA,MAAI,WAAW,GAAG,CAAlB;AAEA,YAAU,CAAC,OAAX,CAAmB,UAAC,IAAD,EAAO,GAAP,EAAc;AAC7B,QAAI,QAAQ,GAAG,CAAf;AACA,QAAI,CAAC,OAAL,CAAa,aAAG,EAAG;AACf,UAAI,IAAI,CAAC,GAAD,CAAJ,KAAc,QAAQ,CAAC,GAAD,CAA1B,EA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B,IAEA,CAAC,KAAK,CAAC,OAAN,CAAc,KAAK,CAAC,SAAD,CAAL,CAAiB,CAAjB,CAAd,CAHE,EAIL;AACE;AACA,aAAK,IAAI,CAAC,GAAG,CAAb,EAAgB,CAAC,GAAG,KAAK,CAAC,SAAD,CAAL,CAAiB,MAArC,EAA6C,CAAC,IAAI,CAAlD,EAAqD;AACjD,cAAI,QAAO,KAAK,CAAC,SAAD,CAAL,CAAiB,CAAjB,CAAP,MAA+B,QAAnC,EAA6C;AACzC,gBAAM,eAAe,GAAG,2CACpB,aAAa,CAAC,SAAD,CADO,EAEpB,KAAK,CAAC,SAAD,CAAL,CAAiB,CAAjB,CAFoB,CAAxB;;AAIA,gBAAI,eAAe,GAAG,CAAC,CAAvB,EAA0B;AACtB,mBAAK,CAAC,SAAD,CAAL,CAAiB,CAAjB,IAAsB,6CAClB,KAAK,CAAC,SAAD,CAAL,CAAiB,CAAjB,CADkB,EAElB,aAAa,CAAC,SAAD,CAAb,CAAyB,eAAzB,CAFkB,CAAtB;AAIH;AACJ;AACJ;AACJ;AACJ,KAnCD;AAoCH,GArCD;AAsCA,SAAO,KAAP;AACH,CAzCM;;AAAM,+CAAoC,oCAApC,C","file":"hocUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 57);\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","export interface GeoJsonDataType {\n type: string;\n coordinates: Array<Array<Array<[number, number]>>>;\n}\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n","module.exports = require(\"lodash\");","import { cloneDeep } from 'lodash';\nimport { findClosestMatchFromDefaultList } from './mapUtils';\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object\n * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).\n * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair\n * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.\n *\n * @method deepMergeWithArrayPrimitiveOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayPrimitiveOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey],\n sourceToApply[sourceKey]\n );\n } else if (\n Array.isArray(clone[sourceKey]) &&\n typeof clone[sourceKey][0] === 'object' &&\n !Array.isArray(clone[sourceKey][0])\n ) {\n // If option is an array of objects\n for (let i = 0; i < clone[sourceKey].length; i += 1) {\n if (typeof clone[sourceKey][i] === 'object') {\n const closestMatchIdx = findClosestMatchFromDefaultList(\n sourceToApply[sourceKey],\n clone[sourceKey][i]\n );\n if (closestMatchIdx > -1) {\n clone[sourceKey][i] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey][i],\n sourceToApply[sourceKey][closestMatchIdx]\n );\n }\n }\n }\n }\n });\n });\n return clone;\n};\n"],"sourceRoot":""}
package/i18n.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 = 59);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 58);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -99,20 +99,20 @@ module.exports = require("@splunk/moment");
99
99
 
100
100
  /***/ }),
101
101
 
102
- /***/ 24:
102
+ /***/ 25:
103
103
  /***/ (function(module, exports) {
104
104
 
105
105
  module.exports = require("numeral");
106
106
 
107
107
  /***/ }),
108
108
 
109
- /***/ 59:
109
+ /***/ 58:
110
110
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
111
111
 
112
112
  "use strict";
113
113
  __webpack_require__.r(__webpack_exports__);
114
114
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setI18nFunctions", function() { return setI18nFunctions; });
115
- /* harmony import */ var numeral__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
115
+ /* harmony import */ var numeral__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
116
116
  /* harmony import */ var numeral__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(numeral__WEBPACK_IMPORTED_MODULE_0__);
117
117
  /* harmony import */ var _splunk_moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
118
118
  /* harmony import */ var _splunk_moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_moment__WEBPACK_IMPORTED_MODULE_1__);
package/i18n.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/moment\"","webpack:///external \"numeral\"","webpack:///./src/i18n.js"],"names":["quarters","days","months","narrowMonths","localeDefinition","date_formats","medium","pattern","format","long","short","full","wide","abbreviated","narrow","min_week_days","eras","percent_format","scientific_format","first_week_day","group_symbol","minus_sign","decimal_symbol","periods","am","pm","datetime_formats","null","exp_symbol","locale_name","number_format","plus_sign","time_formats","i18n","format_decimal","numeral","format_number","format_percent","format_scientific","format_date","moment","format_datetime","format_time","format_datetime_microseconds","format_time_microseconds","setI18nFunctions","Object","global"],"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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BAAxCA,UAFK,MACToC,CADS;AALJ;AASTC,iBAAe,EAAE,0CAAqB;AAClCD,yDAAM,CAANA,GAAM,CAANA,QACIpC,gBAAgB,CAAhBA,2BACMA,gBAAgB,CAAhBA,yBADNA,UADJoC;AAVK;AAgBTE,aAAW,EAAE;AAAA,WACTF,qDAAM,CAANA,GAAM,CAANA,QACIpC,gBAAgB,CAAhBA,uBAAwCA,gBAAgB,CAAhBA,qBAAxCA,UAFK,MACToC,CADS;AAhBJ;AAoBTG,8BAA4B,EAAE;AAAA,WAC1BH,qDAAM,CAANA,GAAM,CAANA,QACIpC,gBAAgB,CAAhBA,uBAAwCA,gBAAgB,CAAhBA,qBAAxCA,UAFsB,MAC1BoC,CAD0B;AApBrB;AAwBTI,0BAAwB,EAAE;AAAA,WACtBJ,qDAAM,CAANA,GAAM,CAANA,QACIpC,gBAAgB,CAAhBA,uBAAwCA,gBAAgB,CAAhBA,qBAAxCA,UAFkB,MACtBoC,CADsB;AAAA;AAxBjB,CAAb;AA8BO,IAAMK,gBAAgB,GAAG,SAAnBA,gBAAmB,SAAU;AACtCC,QAAM,CAANA,mBAA0B,aAAK;AAC3B,QAAI,CAACC,MAAM,CAAX,CAAW,CAAX,EAAgB;AACZA,YAAM,CAANA,CAAM,CAANA,GAAYd,IAAI,CADJ,CACI,CAAhBc,CADY,CACS;AACxB;AAHLD;;AAKA,MAAI,CAACC,MAAM,CAAX,SAAqB;AACjBA,UAAM,CAANA,UAAiB,aAAC;AAAA;AADD,KACjBA,CADiB,CACQ;;AAC5B;;AACD,MAAI,CAACA,MAAM,CAAX,aAAyB;AACrBA,UAAM,CAANA,cAAqB;AAAA;AADA,KACrBA,CADqB,CACe;;AACvC;;AACD;AAZG;AAcPF,gBAAgB,CAAhBA,MAAgB,CAAhBA,C","file":"i18n.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(\"numeral\");","import numeral from 'numeral';\nimport moment from '@splunk/moment';\n/**\n * Fixme, this is a mock i18n file to workaround window dependency from @splunk/charting\n * We need to refactor @splunk/charting to make it independent from globals\n */\n\nconst quarters = {\n 1: '1st quarter',\n 2: '2nd quarter',\n 3: '3rd quarter',\n 4: '4th quarter',\n};\n\nconst days = {\n 0: 'Monday',\n 1: 'Tuesday',\n 2: 'Wednesday',\n 3: 'Thursday',\n 4: 'Friday',\n 5: 'Saturday',\n 6: 'Sunday',\n};\n\nconst months = {\n 1: 'January',\n 2: 'February',\n 3: 'March',\n 4: 'April',\n 5: 'May',\n 6: 'June',\n 7: 'July',\n 8: 'August',\n 9: 'September',\n 10: 'October',\n 11: 'November',\n 12: 'December',\n};\n\nconst narrowMonths = {\n 1: 'J',\n 2: 'F',\n 3: 'M',\n 4: 'A',\n 5: 'M',\n 6: 'J',\n 7: 'J',\n 8: 'A',\n 9: 'S',\n 10: 'O',\n 11: 'N',\n 12: 'D',\n};\n\nconst localeDefinition = {\n date_formats: {\n medium: { pattern: 'MMM d, yyyy', format: '%(MMM)s %(d)s, %(yyyy)s' },\n long: { pattern: 'MMMM d, yyyy', format: '%(MMMM)s %(d)s, %(yyyy)s' },\n short: { pattern: 'M/d/yy', format: '%(M)s/%(d)s/%(yy)s' },\n full: { pattern: 'EEEE, MMMM d, yyyy', format: '%(EEEE)s, %(MMMM)s %(d)s, %(yyyy)s' },\n },\n quarters: {\n 'stand-alone': {\n wide: quarters,\n abbreviated: quarters,\n narrow: { 1: '1', 2: '2', 3: '3', 4: '4' },\n },\n format: {\n wide: quarters,\n abbreviated: { 1: 'Q1', 2: 'Q2', 3: 'Q3', 4: 'Q4' },\n narrow: { 1: '1', 2: '2', 3: '3', 4: '4' },\n },\n },\n min_week_days: 1,\n days: {\n 'stand-alone': {\n wide: days,\n abbreviated: days,\n narrow: { 0: 'M', 1: 'T', 2: 'W', 3: 'T', 4: 'F', 5: 'S', 6: 'S' },\n },\n format: {\n wide: days,\n abbreviated: {\n 0: 'Mon',\n 1: 'Tue',\n 2: 'Wed',\n 3: 'Thu',\n 4: 'Fri',\n 5: 'Sat',\n 6: 'Sun',\n },\n narrow: { 0: 'M', 1: 'T', 2: 'W', 3: 'T', 4: 'F', 5: 'S', 6: 'S' },\n },\n },\n eras: {\n wide: { 0: 'Before Christ', 1: 'Anno Domini' },\n abbreviated: { 0: 'BC', 1: 'AD' },\n narrow: { 0: 'B', 1: 'A' },\n },\n percent_format: '#,##0%',\n scientific_format: '#E0',\n first_week_day: 6,\n group_symbol: ',',\n minus_sign: '-',\n months: {\n 'stand-alone': {\n wide: months,\n abbreviated: months,\n narrow: narrowMonths,\n },\n format: {\n wide: months,\n abbreviated: {\n 1: 'Jan',\n 2: 'Feb',\n 3: 'Mar',\n 4: 'Apr',\n 5: 'May',\n 6: 'Jun',\n 7: 'Jul',\n 8: 'Aug',\n 9: 'Sep',\n 10: 'Oct',\n 11: 'Nov',\n 12: 'Dec',\n },\n narrow: narrowMonths,\n },\n },\n decimal_symbol: '.',\n periods: { am: 'AM', pm: 'PM' },\n datetime_formats: { null: '{1} {0}' },\n exp_symbol: 'E',\n locale_name: 'en_US',\n number_format: '#,##0.###',\n plus_sign: '+',\n time_formats: {\n medium: { pattern: 'h:mm:ss a', format: '%(h)s:%(mm)s:%(ss)s %(a)s' },\n long: { pattern: 'h:mm:ss a z', format: '%(h)s:%(mm)s:%(ss)s %(a)s %(z)s' },\n short: { pattern: 'h:mm a', format: '%(h)s:%(mm)s %(a)s' },\n full: { pattern: 'h:mm:ss a v', format: '%(h)s:%(mm)s:%(ss)s %(a)s %(v)s' },\n },\n};\n\nconst i18n = {\n format_decimal: (num, format) => numeral(num).format(format),\n format_number: (num, format) => numeral(num).format(format),\n format_percent: num => numeral(num).format('0%'),\n format_scientific: num => numeral(num).format('0,0e+0'),\n format_date: (num, format) =>\n moment(num).format(\n localeDefinition.date_formats[format] ? localeDefinition.date_formats[format].pattern : format\n ),\n format_datetime: (num, dateFormat) => {\n moment(num).format(\n localeDefinition.time_formats[dateFormat]\n ? localeDefinition.time_formats[dateFormat].pattern\n : dateFormat\n );\n },\n format_time: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n format_datetime_microseconds: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n format_time_microseconds: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n};\n\nexport const setI18nFunctions = global => {\n Object.keys(i18n).forEach(k => {\n if (!global[k]) {\n global[k] = i18n[k]; // eslint-disable-line no-param-reassign\n }\n });\n if (!global.gettext) {\n global.gettext = v => v; // eslint-disable-line no-param-reassign\n }\n if (!global.locale_name) {\n global.locale_name = () => 'en_US'; // eslint-disable-line no-param-reassign\n }\n return global;\n};\nsetI18nFunctions(window);\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/moment\"","webpack:///external \"numeral\"","webpack:///./src/i18n.js"],"names":["quarters","days","months","narrowMonths","localeDefinition","date_formats","medium","pattern","format","long","short","full","wide","abbreviated","narrow","min_week_days","eras","percent_format","scientific_format","first_week_day","group_symbol","minus_sign","decimal_symbol","periods","am","pm","datetime_formats","null","exp_symbol","locale_name","number_format","plus_sign","time_formats","i18n","format_decimal","numeral","format_number","format_percent","format_scientific","format_date","moment","format_datetime","format_time","format_datetime_microseconds","format_time_microseconds","setI18nFunctions","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,CAAX,CAAW,CAAX,EAAgB;AACZA,YAAM,CAANA,CAAM,CAANA,GAAYd,IAAI,CADJ,CACI,CAAhBc,CADY,CACS;AACxB;AAHLD;;AAKA,MAAI,CAACC,MAAM,CAAX,SAAqB;AACjBA,UAAM,CAANA,UAAiB,aAAC;AAAA;AADD,KACjBA,CADiB,CACQ;;AAC5B;;AACD,MAAI,CAACA,MAAM,CAAX,aAAyB;AACrBA,UAAM,CAANA,cAAqB;AAAA;AADA,KACrBA,CADqB,CACe;;AACvC;;AACD;AAZG;AAcPF,gBAAgB,CAAhBA,MAAgB,CAAhBA,C","file":"i18n.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","module.exports = require(\"@splunk/moment\");","module.exports = require(\"numeral\");","import numeral from 'numeral';\nimport moment from '@splunk/moment';\n/**\n * Fixme, this is a mock i18n file to workaround window dependency from @splunk/charting\n * We need to refactor @splunk/charting to make it independent from globals\n */\n\nconst quarters = {\n 1: '1st quarter',\n 2: '2nd quarter',\n 3: '3rd quarter',\n 4: '4th quarter',\n};\n\nconst days = {\n 0: 'Monday',\n 1: 'Tuesday',\n 2: 'Wednesday',\n 3: 'Thursday',\n 4: 'Friday',\n 5: 'Saturday',\n 6: 'Sunday',\n};\n\nconst months = {\n 1: 'January',\n 2: 'February',\n 3: 'March',\n 4: 'April',\n 5: 'May',\n 6: 'June',\n 7: 'July',\n 8: 'August',\n 9: 'September',\n 10: 'October',\n 11: 'November',\n 12: 'December',\n};\n\nconst narrowMonths = {\n 1: 'J',\n 2: 'F',\n 3: 'M',\n 4: 'A',\n 5: 'M',\n 6: 'J',\n 7: 'J',\n 8: 'A',\n 9: 'S',\n 10: 'O',\n 11: 'N',\n 12: 'D',\n};\n\nconst localeDefinition = {\n date_formats: {\n medium: { pattern: 'MMM d, yyyy', format: '%(MMM)s %(d)s, %(yyyy)s' },\n long: { pattern: 'MMMM d, yyyy', format: '%(MMMM)s %(d)s, %(yyyy)s' },\n short: { pattern: 'M/d/yy', format: '%(M)s/%(d)s/%(yy)s' },\n full: { pattern: 'EEEE, MMMM d, yyyy', format: '%(EEEE)s, %(MMMM)s %(d)s, %(yyyy)s' },\n },\n quarters: {\n 'stand-alone': {\n wide: quarters,\n abbreviated: quarters,\n narrow: { 1: '1', 2: '2', 3: '3', 4: '4' },\n },\n format: {\n wide: quarters,\n abbreviated: { 1: 'Q1', 2: 'Q2', 3: 'Q3', 4: 'Q4' },\n narrow: { 1: '1', 2: '2', 3: '3', 4: '4' },\n },\n },\n min_week_days: 1,\n days: {\n 'stand-alone': {\n wide: days,\n abbreviated: days,\n narrow: { 0: 'M', 1: 'T', 2: 'W', 3: 'T', 4: 'F', 5: 'S', 6: 'S' },\n },\n format: {\n wide: days,\n abbreviated: {\n 0: 'Mon',\n 1: 'Tue',\n 2: 'Wed',\n 3: 'Thu',\n 4: 'Fri',\n 5: 'Sat',\n 6: 'Sun',\n },\n narrow: { 0: 'M', 1: 'T', 2: 'W', 3: 'T', 4: 'F', 5: 'S', 6: 'S' },\n },\n },\n eras: {\n wide: { 0: 'Before Christ', 1: 'Anno Domini' },\n abbreviated: { 0: 'BC', 1: 'AD' },\n narrow: { 0: 'B', 1: 'A' },\n },\n percent_format: '#,##0%',\n scientific_format: '#E0',\n first_week_day: 6,\n group_symbol: ',',\n minus_sign: '-',\n months: {\n 'stand-alone': {\n wide: months,\n abbreviated: months,\n narrow: narrowMonths,\n },\n format: {\n wide: months,\n abbreviated: {\n 1: 'Jan',\n 2: 'Feb',\n 3: 'Mar',\n 4: 'Apr',\n 5: 'May',\n 6: 'Jun',\n 7: 'Jul',\n 8: 'Aug',\n 9: 'Sep',\n 10: 'Oct',\n 11: 'Nov',\n 12: 'Dec',\n },\n narrow: narrowMonths,\n },\n },\n decimal_symbol: '.',\n periods: { am: 'AM', pm: 'PM' },\n datetime_formats: { null: '{1} {0}' },\n exp_symbol: 'E',\n locale_name: 'en_US',\n number_format: '#,##0.###',\n plus_sign: '+',\n time_formats: {\n medium: { pattern: 'h:mm:ss a', format: '%(h)s:%(mm)s:%(ss)s %(a)s' },\n long: { pattern: 'h:mm:ss a z', format: '%(h)s:%(mm)s:%(ss)s %(a)s %(z)s' },\n short: { pattern: 'h:mm a', format: '%(h)s:%(mm)s %(a)s' },\n full: { pattern: 'h:mm:ss a v', format: '%(h)s:%(mm)s:%(ss)s %(a)s %(v)s' },\n },\n};\n\nconst i18n = {\n format_decimal: (num, format) => numeral(num).format(format),\n format_number: (num, format) => numeral(num).format(format),\n format_percent: num => numeral(num).format('0%'),\n format_scientific: num => numeral(num).format('0,0e+0'),\n format_date: (num, format) =>\n moment(num).format(\n localeDefinition.date_formats[format] ? localeDefinition.date_formats[format].pattern : format\n ),\n format_datetime: (num, dateFormat) => {\n moment(num).format(\n localeDefinition.time_formats[dateFormat]\n ? localeDefinition.time_formats[dateFormat].pattern\n : dateFormat\n );\n },\n format_time: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n format_datetime_microseconds: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n format_time_microseconds: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n};\n\nexport const setI18nFunctions = global => {\n Object.keys(i18n).forEach(k => {\n if (!global[k]) {\n global[k] = i18n[k]; // eslint-disable-line no-param-reassign\n }\n });\n if (!global.gettext) {\n global.gettext = v => v; // eslint-disable-line no-param-reassign\n }\n if (!global.locale_name) {\n global.locale_name = () => 'en_US'; // eslint-disable-line no-param-reassign\n }\n return global;\n};\nsetI18nFunctions(window);\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 = 27);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 28);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 27:
95
+ /***/ 28:
96
96
  /***/ (function(module, exports, __webpack_require__) {
97
97
 
98
98
  "use strict";
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;;;;;;;;;;;;;;;AC7EA;;;;;;;;;;;;;;;;;AAiBG;;AACI,IAAM,+BAA+B,GAAG,SAAlC,+BAAkC,CAC3C,UAD2C,EAE3C,QAF2C,EAGnC;AACR,MAAI,CAAC,KAAK,CAAC,OAAN,CAAc,UAAd,CAAD,IAA8B,UAAU,CAAC,MAAX,KAAsB,CAAxD,EAA2D;AACvD,WAAO,CAAC,CAAR;AACH;;AACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAP,CAAY,QAAZ,CAAb;AACA,MAAI,WAAW,GAAG,CAAlB;AACA,MAAI,WAAW,GAAG,CAAlB;AAEA,YAAU,CAAC,OAAX,CAAmB,UAAC,IAAD,EAAO,GAAP,EAAc;AAC7B,QAAI,QAAQ,GAAG,CAAf;AACA,QAAI,CAAC,OAAL,CAAa,aAAG,EAAG;AACf,UAAI,IAAI,CAAC,GAAD,CAAJ,KAAc,QAAQ,CAAC,GAAD,CAA1B,EAAiC;AAC7B,gBAAQ,IAAI,CAAZ;AACH;AACJ,KAJD;;AAKA,QAAI,IAAI,CAAC,GAAL,CAAS,WAAT,EAAsB,QAAtB,IAAkC,WAAtC,EAAmD;AAC/C,iBAAW,GAAG,QAAd;AACA,iBAAW,GAAG,GAAd;AACH;AACJ,GAXD;AAYA,SAAO,WAAP;AACH,CAxBM;;AAAM,0CAA+B,+BAA/B,C","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 = 27);\n","export interface GeoJsonDataType {\n type: string;\n coordinates: Array<Array<Array<[number, number]>>>;\n}\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n"],"sourceRoot":""}
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;;;;;;;;;;;;;;;AC7EA;;;;;;;;;;;;;;;;;AAiBG;;AACI,IAAM,+BAA+B,GAAG,SAAlC,+BAAkC,CAC3C,UAD2C,EAE3C,QAF2C,EAGnC;AACR,MAAI,CAAC,KAAK,CAAC,OAAN,CAAc,UAAd,CAAD,IAA8B,UAAU,CAAC,MAAX,KAAsB,CAAxD,EAA2D;AACvD,WAAO,CAAC,CAAR;AACH;;AACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAP,CAAY,QAAZ,CAAb;AACA,MAAI,WAAW,GAAG,CAAlB;AACA,MAAI,WAAW,GAAG,CAAlB;AAEA,YAAU,CAAC,OAAX,CAAmB,UAAC,IAAD,EAAO,GAAP,EAAc;AAC7B,QAAI,QAAQ,GAAG,CAAf;AACA,QAAI,CAAC,OAAL,CAAa,aAAG,EAAG;AACf,UAAI,IAAI,CAAC,GAAD,CAAJ,KAAc,QAAQ,CAAC,GAAD,CAA1B,EAAiC;AAC7B,gBAAQ,IAAI,CAAZ;AACH;AACJ,KAJD;;AAKA,QAAI,IAAI,CAAC,GAAL,CAAS,WAAT,EAAsB,QAAtB,IAAkC,WAAtC,EAAmD;AAC/C,iBAAW,GAAG,QAAd;AACA,iBAAW,GAAG,GAAd;AACH;AACJ,GAXD;AAYA,SAAO,WAAP;AACH,CAxBM;;AAAM,0CAA+B,+BAA/B,C","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 = 28);\n","export interface GeoJsonDataType {\n type: string;\n coordinates: Array<Array<Array<[number, number]>>>;\n}\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n"],"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 = 60);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 59);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -106,14 +106,14 @@ module.exports = require("@babel/runtime/helpers/typeof");
106
106
 
107
107
  /***/ }),
108
108
 
109
- /***/ 3:
109
+ /***/ 4:
110
110
  /***/ (function(module, exports) {
111
111
 
112
112
  module.exports = require("lodash");
113
113
 
114
114
  /***/ }),
115
115
 
116
- /***/ 60:
116
+ /***/ 59:
117
117
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
118
118
 
119
119
  "use strict";
@@ -126,7 +126,7 @@ __webpack_require__.r(__webpack_exports__);
126
126
  /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
127
127
  /* harmony import */ var _splunk_moment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
128
128
  /* harmony import */ var _splunk_moment__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_moment__WEBPACK_IMPORTED_MODULE_1__);
129
- /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
129
+ /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
130
130
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
131
131
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
132
132
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_3__);
@@ -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","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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C,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;;;;;;;AC5ID,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]+)?)$)/;\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 *\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","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,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,2C;;;;;;;ACAA,0D;;;;;;;ACAA,mC;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;CAGA;;AACA;AACA;AACA;AACA;;AACA,IAAMA,2BAA2B,GAAjC;AACA,IAAMC,4BAA4B,GAAlC;;AACA,8BAA8B;AAC1B,SAAOD,2BAA2B,CAA3BA,KAAP,GAAOA,CAAP;AACH;;AACD,qCAAqC;AACjC,SAAOC,4BAA4B,CAA5BA,KAAP,GAAOA,CAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,4BAA4B;AAC/B,SAAOC,eAAe,CAAfA,GAAe,CAAfA,IAAwBC,sBAAsB,CAArD,GAAqD,CAArD;AACH;AAED;AACA;AACA;AACA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,IAArC,GAA4C;AACxC;AACA,QAAMM,CAAC,GAAGN,SAAS,GAATA,UAAV;AAEAD,iBAAa,CAAbA;AACAA,iBAAa,CAAbA;AALJ,SAMO;AACHA,iBAAa,CAAbA;AACH;;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;;;;;;;AC5ID,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]+)?)$)/;\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 *\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": "25.5.0",
6
+ "version": "25.7.0",
7
7
  "scripts": {
8
8
  "build": "NODE_ENV=production webpack --config ./webpack.config.js --bail",
9
9
  "build-storybook": "build-storybook -c .storybook -s fonts -o .storybook-bundle",
@@ -31,12 +31,11 @@
31
31
  "@splunk/moment": "^0.6.0",
32
32
  "@splunk/react-icons": "^3.1.0",
33
33
  "@splunk/react-ui": "^4.5.3",
34
- "@splunk/themes": "^0.14.0",
34
+ "@splunk/themes": "^0.15.0",
35
35
  "@splunk/ui-utils": "^1.2.1",
36
36
  "element-resize-detector": "^1.1.14",
37
37
  "lodash": "^4.17.4",
38
38
  "numeral": "^2.0.6",
39
- "resize-observer-polyfill": "^1.5.1",
40
39
  "xmlserializer": "^0.6.1"
41
40
  },
42
41
  "peerDependencies": {
@@ -48,8 +47,8 @@
48
47
  "@babel/cli": "^7.13.0",
49
48
  "@babel/core": "^7.13.0",
50
49
  "@splunk/react-docs": "^0.11.0",
51
- "@splunk/visualization-build-tools": "^25.5.0",
52
- "@splunk/visualization-context": "^25.5.0",
50
+ "@splunk/visualization-build-tools": "^25.7.0",
51
+ "@splunk/visualization-context": "^25.7.0",
53
52
  "@storybook/addon-actions": "^6.1.20",
54
53
  "@storybook/addons": "^6.1.20",
55
54
  "@storybook/react": "^6.1.20",
@@ -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 = 61);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 60);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 61:
95
+ /***/ 60:
96
96
  /***/ (function(module, exports, __webpack_require__) {
97
97
 
98
98
  "use strict";