@splunk/visualizations 25.13.0 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +216 -216
- package/Area.config.js.map +1 -1
- package/Area.js +529 -561
- package/Area.js.map +1 -1
- package/Bar.config.js +213 -213
- package/Bar.config.js.map +1 -1
- package/Bar.js +394 -386
- package/Bar.js.map +1 -1
- package/Bubble.config.js +140 -140
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +313 -305
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +15 -15
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +149 -144
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +205 -205
- package/Column.config.js.map +1 -1
- package/Column.js +387 -379
- package/Column.js.map +1 -1
- package/Ellipse.config.js +45 -45
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +157 -144
- package/Ellipse.js.map +1 -1
- package/Events.config.js +11 -11
- package/Events.config.js.map +1 -1
- package/Events.js +274 -262
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +46 -46
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +267 -262
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +8 -8
- package/Image.config.js.map +1 -1
- package/Image.js +110 -104
- package/Image.js.map +1 -1
- package/Line.config.js +220 -220
- package/Line.config.js.map +1 -1
- package/Line.js +404 -396
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +27 -27
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +557 -548
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +71 -71
- package/Map.config.js.map +1 -1
- package/Map.js +472 -466
- package/Map.js.map +1 -1
- package/Markdown.config.js +23 -23
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +151 -145
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +84 -84
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +295 -289
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +23 -23
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +164 -162
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +24 -24
- package/Pie.config.js.map +1 -1
- package/Pie.js +233 -228
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +33 -33
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +278 -279
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +46 -46
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +154 -142
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +19 -19
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +281 -275
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +135 -135
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +304 -299
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +119 -119
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +359 -341
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +14 -14
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +117 -117
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +373 -371
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +157 -115
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1114 -540
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +50 -20
- package/SparkLine.js.map +1 -1
- package/Table.config.js +54 -54
- package/Table.config.js.map +1 -1
- package/Table.js +302 -286
- package/Table.js.map +1 -1
- package/common/Charting.js +41 -41
- package/common/Charting.js.map +1 -1
- package/common/EventsDoc.js +15 -14
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +2 -2
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +2 -2
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +22 -22
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +32 -27
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +4 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +2 -2
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +14 -14
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +12 -12
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +4 -4
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +112 -112
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +21 -15
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +10 -9
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +3 -3
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +2 -2
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +2 -2
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +84 -80
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +2 -2
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +27 -9
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +26 -26
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +2 -2
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +107 -104
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"prop-types\"","webpack:///./src/common/SplunkVisualization.tsx","webpack:///./src/common/interfaces/VizActionHandler.ts","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\""],"names":["T","require","lodash_1","VizActionHandler_1","exports","INITIAL_WIDTH","INITIAL_HEIGHT","SplunkVisualization","_classCallCheck","propTypes","mode","oneOf","isRequired","width","oneOfType","string","number","height","context","object","options","onOptionsChange","func","dataSources","objectOf","shape","requestParams","data","fields","array","columns","error","level","message","meta","onEventTrigger","hasEventHandlers","bool","onComputedProps","vizActionHandlerRef","loading","theme","onRequestParamsChange","defaultProps","DefaultVizActionHandler","noop","default","_createClass","key","value","focus","snapshot"],"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,uC;;;;;;;;;;;;;;;ACAA;AACA,IAAAA,CAAA,GAAAC,mBAAA;AACA,IAAAC,QAAA,GAAAD,mBAAA;AAEA,IAAAE,kBAAA,GAAAF,mBAAA;AAEA;AACaG,OAAA,CAAAC,aAAa,GAAG,GAAG;AACnBD,OAAA,CAAAE,cAAc,GAAG,GAAG;AAEjC;;;AAAA,IAGMC,mBAAmB,YAAAA,oBAAA;EAAAC,eAAA,OAAAD,mBAAA;AAAA;AACdA,mBAAA,CAAAE,SAAS,GAAsD;EAClE;;;EAGAC,IAAI,EAAEV,CAAC,CAACW,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAACC,U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,mBAAA,CAAAoC,YAAY,GAAsB;EACrC;EACA9B,KAAK,EAAE,MAAM;EACbI,MAAM,EAAEb,OAAA,CAAAE,cAAc;EACtBiB,WAAW,EAAE,EAAE;EACfY,cAAc,EAAE,SAAAA,eAAA;IAAA,OAAgC,EAAE;EAAA,CAAC;EACnDzB,IAAI,EAAE,MAAM;EACZ0B,gBAAgB,EAAE,KAAK;EACvBhB,OAAO,EAAE,EAAE;EACXF,OAAO,EAAE,EAAE;EACXG,eAAe,EAAE,SAAAA,gBAAA;IAAA,OAAgC,EAAE;EAAA,CAAC;EACpDkB,mBAAmB,EAAE,SAAAA,oBAAA;IAAA,OAA+B,IAAIpC,kBAAA,CAAAyC,uBAAuB,EAAE;EAAA;EACjFN,eAAe,EAAE,SAAAA,gBAAA;IAAA,OAAgC,EAAE;EAAA,CAAC;EACpDE,OAAO,EAAE,KAAK;EACdE,qBAAqB,EAAExC,QAAA,CAAA2C;CAC1B;AAGLzC,OAAA,CAAA0C,OAAA,GAAevC,mBAAmB,C;;;;;;;;;;;;;;;;ICrGrBqC,uBAAuB;EAAA,SAAAA,wBAAA;IAAApC,eAAA,OAAAoC,uBAAA;EAAA;EAAAG,YAAA,CAAAH,uBAAA;IAAAI,GAAA;IAAAC,KAAA,EAChC,SAAAC,MAAA,EAAK;MACD;IAAA;EACH;IAAAF,GAAA;IAAAC,KAAA,EAED,SAAAE,SAAA,EAAQ;MACJ,OAAO,IAAI,CAAC,CAAC;IACjB;EAAC;EAAA,OAAAP,uBAAA;AAAA;AAPLxC,OAAA,CAAAwC,uBAAA,GAAAA,uBAAA,C;;;;;;;ACbA,mC;;;;;;;ACAA,kE;;;;;;;ACAA,+D","file":"SplunkVisualization.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 = 23);\n","module.exports = require(\"prop-types\");","/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */\nimport * as T from 'prop-types';\nimport { noop } from 'lodash';\nimport { DashboardVizProps } from './interfaces/DashboardVizProps';\nimport { DefaultVizActionHandler } from './interfaces/VizActionHandler';\n\n// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations\nexport const INITIAL_WIDTH = 250;\nexport const INITIAL_HEIGHT = 250;\n\n/**\n * A Splunk visualization\n */\nclass SplunkVisualization {\n static propTypes: Record<keyof DashboardVizProps, T.Validator<any>> = {\n /**\n * display mode\n */\n mode: T.oneOf(['view', 'edit', 'export']).isRequired,\n /**\n * width in pixel or string, defaults to 100%\n */\n width: T.oneOfType([T.string, T.number]).isRequired,\n /**\n * height in pixel or string\n */\n height: T.oneOfType([T.string, T.number]).isRequired,\n /**\n * visualization context used for dynamic option evaluation\n */\n context: T.object,\n /**\n * visualization formatting options\n */\n options: T.object,\n /**\n * A callback to update formatting options\n */\n onOptionsChange: T.func,\n /**\n * datasource state which include data and request params, object key indicate the datasource type.\n */\n dataSources: T.objectOf(\n T.shape({\n /**\n * current request params\n */\n requestParams: T.object,\n /**\n * current dataset\n */\n data: T.shape({\n fields: T.array,\n columns: T.array,\n }),\n /**\n * error\n */\n error: T.shape({\n level: T.string,\n message: T.string,\n }),\n /**\n * meta data that came with the dataset\n */\n meta: T.object,\n })\n ),\n /**\n * A callback to trigger event\n */\n onEventTrigger: T.func,\n /**\n * Inform viz if there are handlers listening to events\n */\n hasEventHandlers: T.bool,\n /**\n * A callback to communicate computed props to a consumer\n */\n onComputedProps: T.func,\n /**\n * A callback to obtain visualization api\n */\n vizActionHandlerRef: T.func,\n\n loading: T.bool,\n theme: T.object,\n /**\n * A callback to request new data with updated request params\n */\n onRequestParamsChange: T.func,\n };\n\n /**\n *\n */\n static defaultProps: DashboardVizProps = {\n // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height\n width: '100%',\n height: INITIAL_HEIGHT,\n dataSources: {},\n onEventTrigger: (): Record<string, unknown> => ({}),\n mode: 'view',\n hasEventHandlers: false,\n options: {},\n context: {},\n onOptionsChange: (): Record<string, unknown> => ({}),\n vizActionHandlerRef: (): DefaultVizActionHandler => new DefaultVizActionHandler(),\n onComputedProps: (): Record<string, unknown> => ({}),\n loading: false,\n onRequestParamsChange: noop,\n };\n}\n\nexport default SplunkVisualization;\n","/* eslint-disable class-methods-use-this */\nexport interface VizActionHandler {\n /**\n * put focus on the visualization\n */\n focus(): void;\n\n /**\n * compute snapshot of this visualization\n */\n snapshot(): Record<string, unknown>; // (This is for pdf export)\n}\n\nexport class DefaultVizActionHandler {\n focus(): void {\n // noop\n }\n\n snapshot(): Record<string, unknown> {\n return null; // noop\n }\n}\n","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"prop-types\"","webpack:///./src/common/SplunkVisualization.tsx","webpack:///./src/common/interfaces/VizActionHandler.ts","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\""],"names":["T","require","lodash_1","VizActionHandler_1","exports","INITIAL_WIDTH","INITIAL_HEIGHT","SplunkVisualization","_classCallCheck","propTypes","mode","oneOf","isRequired","width","oneOfType","string","number","height","context","object","options","onOptionsChange","func","dataSources","objectOf","shape","requestParams","data","fields","array","columns","error","level","message","meta","onEventTrigger","hasEventHandlers","bool","onComputedProps","vizActionHandlerRef","loading","theme","onRequestParamsChange","defaultProps","DefaultVizActionHandler","noop","default","_create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KAAK;EACvBhB,OAAO,EAAE,EAAE;EACXF,OAAO,EAAE,EAAE;EACXG,eAAe,EAAE,SAAAA,gBAAA;IAAA,OAAgC,EAAE;EAAA,CAAC;EACpDkB,mBAAmB,EAAE,SAAAA,oBAAA;IAAA,OAA+B,IAAIpC,kBAAA,CAAAyC,uBAAuB,EAAE;EAAA;EACjFN,eAAe,EAAE,SAAAA,gBAAA;IAAA,OAAgC,EAAE;EAAA,CAAC;EACpDE,OAAO,EAAE,KAAK;EACdE,qBAAqB,EAAExC,QAAA,CAAA2C;CAC1B;AAGLzC,OAAA,CAAA0C,OAAA,GAAevC,mBAAmB,C;;;;;;;;;;;;;;;;ICrGrBqC,uBAAuB;EAAA,SAAAA,wBAAA;IAAApC,eAAA,OAAAoC,uBAAA;EAAA;EAAAG,YAAA,CAAAH,uBAAA;IAAAI,GAAA;IAAAC,KAAA,EAChC,SAAAC,MAAA,EAAK;MACD;IAAA;EACH;IAAAF,GAAA;IAAAC,KAAA,EAED,SAAAE,SAAA,EAAQ;MACJ,OAAO,IAAI,CAAC,CAAC;IACjB;EAAC;EAAA,OAAAP,uBAAA;AAAA;AAPLxC,OAAA,CAAAwC,uBAAA,GAAAA,uBAAA,C;;;;;;;ACbA,mC;;;;;;;ACAA,kE;;;;;;;ACAA,+D","file":"SplunkVisualization.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 = 24);\n","module.exports = require(\"prop-types\");","/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */\nimport * as T from 'prop-types';\nimport { noop } from 'lodash';\nimport { DashboardVizProps } from './interfaces/DashboardVizProps';\nimport { DefaultVizActionHandler } from './interfaces/VizActionHandler';\n\n// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations\nexport const INITIAL_WIDTH = 250;\nexport const INITIAL_HEIGHT = 250;\n\n/**\n * A Splunk visualization\n */\nclass SplunkVisualization {\n static propTypes: Record<keyof DashboardVizProps, T.Validator<any>> = {\n /**\n * display mode\n */\n mode: T.oneOf(['view', 'edit', 'export']).isRequired,\n /**\n * width in pixel or string, defaults to 100%\n */\n width: T.oneOfType([T.string, T.number]).isRequired,\n /**\n * height in pixel or string\n */\n height: T.oneOfType([T.string, T.number]).isRequired,\n /**\n * visualization context used for dynamic option evaluation\n */\n context: T.object,\n /**\n * visualization formatting options\n */\n options: T.object,\n /**\n * A callback to update formatting options\n */\n onOptionsChange: T.func,\n /**\n * datasource state which include data and request params, object key indicate the datasource type.\n */\n dataSources: T.objectOf(\n T.shape({\n /**\n * current request params\n */\n requestParams: T.object,\n /**\n * current dataset\n */\n data: T.shape({\n fields: T.array,\n columns: T.array,\n }),\n /**\n * error\n */\n error: T.shape({\n level: T.string,\n message: T.string,\n }),\n /**\n * meta data that came with the dataset\n */\n meta: T.object,\n })\n ),\n /**\n * A callback to trigger event\n */\n onEventTrigger: T.func,\n /**\n * Inform viz if there are handlers listening to events\n */\n hasEventHandlers: T.bool,\n /**\n * A callback to communicate computed props to a consumer\n */\n onComputedProps: T.func,\n /**\n * A callback to obtain visualization api\n */\n vizActionHandlerRef: T.func,\n\n loading: T.bool,\n theme: T.object,\n /**\n * A callback to request new data with updated request params\n */\n onRequestParamsChange: T.func,\n };\n\n /**\n *\n */\n static defaultProps: DashboardVizProps = {\n // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height\n width: '100%',\n height: INITIAL_HEIGHT,\n dataSources: {},\n onEventTrigger: (): Record<string, unknown> => ({}),\n mode: 'view',\n hasEventHandlers: false,\n options: {},\n context: {},\n onOptionsChange: (): Record<string, unknown> => ({}),\n vizActionHandlerRef: (): DefaultVizActionHandler => new DefaultVizActionHandler(),\n onComputedProps: (): Record<string, unknown> => ({}),\n loading: false,\n onRequestParamsChange: noop,\n };\n}\n\nexport default SplunkVisualization;\n","/* eslint-disable class-methods-use-this */\nexport interface VizActionHandler {\n /**\n * put focus on the visualization\n */\n focus(): void;\n\n /**\n * compute snapshot of this visualization\n */\n snapshot(): Record<string, unknown>; // (This is for pdf export)\n}\n\nexport class DefaultVizActionHandler {\n focus(): void {\n // noop\n }\n\n snapshot(): Record<string, unknown> {\n return null; // noop\n }\n}\n","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");"],"sourceRoot":""}
|
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 65);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -106,7 +106,7 @@ module.exports = require("@babel/runtime/helpers/createClass");
|
|
|
106
106
|
|
|
107
107
|
/***/ }),
|
|
108
108
|
|
|
109
|
-
/***/
|
|
109
|
+
/***/ 65:
|
|
110
110
|
/***/ (function(module, exports, __webpack_require__) {
|
|
111
111
|
|
|
112
112
|
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///./src/common/SplunkVisualizationApi.ts"],"names":["DashboardVisualizationApi","_classCallCheck","_createClass","key","value","focus","snapshot","exports","default"],"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,kE;;;;;;;ACAA,+D;;;;;;;;;;;;;;;ACGA;;;AAAA,IAGMA,yBAAyB;EAAA,SAAAA,0BAAA;IAAAC,eAAA,OAAAD,yBAAA;EAAA;EAAAE,YAAA,CAAAF,yBAAA;IAAAG,GAAA;IAAAC,KAAA;IAC3B;;;IAGA,SAAAC,MAAA,EAAK;MACD;IAAA;IAGJ;;;EAAA;IAAAF,GAAA;IAAAC,KAAA,EAGA,SAAAE,SAAA,EAAQ;MACJ,OAAO,EAAE;IACb;EAAC;EAAA,OAAAN,yBAAA;AAAA;AAGLO,OAAA,CAAAC,OAAA,GAAeR,yBAAyB,C","file":"SplunkVisualizationApi.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///./src/common/SplunkVisualizationApi.ts"],"names":["DashboardVisualizationApi","_classCallCheck","_createClass","key","value","focus","snapshot","exports","default"],"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,kE;;;;;;;ACAA,+D;;;;;;;;;;;;;;;ACGA;;;AAAA,IAGMA,yBAAyB;EAAA,SAAAA,0BAAA;IAAAC,eAAA,OAAAD,yBAAA;EAAA;EAAAE,YAAA,CAAAF,yBAAA;IAAAG,GAAA;IAAAC,KAAA;IAC3B;;;IAGA,SAAAC,MAAA,EAAK;MACD;IAAA;IAGJ;;;EAAA;IAAAF,GAAA;IAAAC,KAAA,EAGA,SAAAE,SAAA,EAAQ;MACJ,OAAO,EAAE;IACb;EAAC;EAAA,OAAAN,yBAAA;AAAA;AAGLO,OAAA,CAAAC,OAAA,GAAeR,yBAAyB,C","file":"SplunkVisualizationApi.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 65);\n","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","/* eslint-disable class-methods-use-this */\nimport { VizActionHandler } from './interfaces/VizActionHandler';\n\n/**\n *\n */\nclass DashboardVisualizationApi implements VizActionHandler {\n /**\n * put focus on the visualization\n */\n focus() {\n // do nothing\n }\n\n /**\n * compute snapshot of this visualization\n */\n snapshot() {\n return {};\n }\n}\n\nexport default DashboardVisualizationApi;\n"],"sourceRoot":""}
|
package/common/ThemesDoc.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 66);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -148,42 +148,42 @@ module.exports = require("styled-components");
|
|
|
148
148
|
|
|
149
149
|
/***/ }),
|
|
150
150
|
|
|
151
|
-
/***/
|
|
151
|
+
/***/ 30:
|
|
152
152
|
/***/ (function(module, exports) {
|
|
153
153
|
|
|
154
154
|
module.exports = require("@splunk/react-ui/Select");
|
|
155
155
|
|
|
156
156
|
/***/ }),
|
|
157
157
|
|
|
158
|
-
/***/
|
|
158
|
+
/***/ 37:
|
|
159
159
|
/***/ (function(module, exports) {
|
|
160
160
|
|
|
161
161
|
module.exports = require("lodash/omit");
|
|
162
162
|
|
|
163
163
|
/***/ }),
|
|
164
164
|
|
|
165
|
-
/***/
|
|
165
|
+
/***/ 38:
|
|
166
166
|
/***/ (function(module, exports) {
|
|
167
167
|
|
|
168
168
|
module.exports = require("lodash/cloneDeep");
|
|
169
169
|
|
|
170
170
|
/***/ }),
|
|
171
171
|
|
|
172
|
-
/***/
|
|
172
|
+
/***/ 39:
|
|
173
173
|
/***/ (function(module, exports) {
|
|
174
174
|
|
|
175
175
|
module.exports = require("@splunk/react-ui/Message");
|
|
176
176
|
|
|
177
177
|
/***/ }),
|
|
178
178
|
|
|
179
|
-
/***/
|
|
179
|
+
/***/ 40:
|
|
180
180
|
/***/ (function(module, exports) {
|
|
181
181
|
|
|
182
182
|
module.exports = require("@splunk/react-ui/Tooltip");
|
|
183
183
|
|
|
184
184
|
/***/ }),
|
|
185
185
|
|
|
186
|
-
/***/
|
|
186
|
+
/***/ 41:
|
|
187
187
|
/***/ (function(module, exports) {
|
|
188
188
|
|
|
189
189
|
module.exports = require("@splunk/themes/SplunkThemeProvider");
|
|
@@ -197,7 +197,7 @@ module.exports = require("@splunk/react-ui/Heading");
|
|
|
197
197
|
|
|
198
198
|
/***/ }),
|
|
199
199
|
|
|
200
|
-
/***/
|
|
200
|
+
/***/ 66:
|
|
201
201
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
202
202
|
|
|
203
203
|
"use strict";
|
|
@@ -214,19 +214,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
214
214
|
/* harmony import */ var _splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Heading__WEBPACK_IMPORTED_MODULE_4__);
|
|
215
215
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2);
|
|
216
216
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_5__);
|
|
217
|
-
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
217
|
+
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37);
|
|
218
218
|
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_6__);
|
|
219
|
-
/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
219
|
+
/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38);
|
|
220
220
|
/* harmony import */ var lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_7__);
|
|
221
221
|
/* harmony import */ var _splunk_react_ui_ColumnLayout__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12);
|
|
222
222
|
/* harmony import */ var _splunk_react_ui_ColumnLayout__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_ColumnLayout__WEBPACK_IMPORTED_MODULE_8__);
|
|
223
|
-
/* harmony import */ var _splunk_react_ui_Select__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
|
|
223
|
+
/* harmony import */ var _splunk_react_ui_Select__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(30);
|
|
224
224
|
/* harmony import */ var _splunk_react_ui_Select__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Select__WEBPACK_IMPORTED_MODULE_9__);
|
|
225
|
-
/* harmony import */ var _splunk_react_ui_Message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
|
|
225
|
+
/* harmony import */ var _splunk_react_ui_Message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(39);
|
|
226
226
|
/* harmony import */ var _splunk_react_ui_Message__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Message__WEBPACK_IMPORTED_MODULE_10__);
|
|
227
|
-
/* harmony import */ var _splunk_react_ui_Tooltip__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
|
|
227
|
+
/* harmony import */ var _splunk_react_ui_Tooltip__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(40);
|
|
228
228
|
/* harmony import */ var _splunk_react_ui_Tooltip__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Tooltip__WEBPACK_IMPORTED_MODULE_11__);
|
|
229
|
-
/* harmony import */ var _splunk_themes_SplunkThemeProvider__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
|
|
229
|
+
/* harmony import */ var _splunk_themes_SplunkThemeProvider__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(41);
|
|
230
230
|
/* harmony import */ var _splunk_themes_SplunkThemeProvider__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_splunk_themes_SplunkThemeProvider__WEBPACK_IMPORTED_MODULE_12__);
|
|
231
231
|
/* harmony import */ var _splunk_visualizations_shared_colorUtils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(14);
|
|
232
232
|
/* harmony import */ var _splunk_visualizations_shared_colorUtils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_colorUtils__WEBPACK_IMPORTED_MODULE_13__);
|
package/common/ThemesDoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"@splunk/react-ui/ColumnLayout\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"@splunk/visualizations-shared/colorUtils\"","webpack:///external \"@splunk/visualization-themes/variables\"","webpack:///external \"styled-components\"","webpack:///external \"@splunk/react-ui/Select\"","webpack:///external \"lodash/omit\"","webpack:///external \"lodash/cloneDeep\"","webpack:///external \"@splunk/react-ui/Message\"","webpack:///external \"@splunk/react-ui/Tooltip\"","webpack:///external \"@splunk/themes/SplunkThemeProvider\"","webpack:///external \"@splunk/react-ui/Heading\"","webpack:///./src/common/ThemesDoc.jsx"],"names":["ThemeVar","styled","div","withConfig","displayName","componentId","ThemeVarName","props","highlighted","PairContainer","PairTitle","span","ColorPreview","color","Pair","_ref","title","text","React","createElement","concat","isColor","propTypes","T","string","themeFamilyMapping","enterprise","colorScheme","dark","light","prisma","themeIdToVariant","enterpriseLightComfortable","density","family","label","enterpriseLightCompact","enterpriseDarkComfortable","enterpriseDarkCompact","prismaLightComfortable","prismaLightCompact","prismaDarkComfortable","prismaDarkCompact","ThemesDoc","renderVisualization","themeVars","themes","_useState","useState","_useState2","_slicedToArray","highlightedThemeVariable","setHighlightedThemeVariable","_useState3","_useState4","selectedTheme","setSelectedTheme","previewTheme","cloneDeep","ColumnLayout","style","marginTop","Row","Column","Heading","level","Select","value","onChange","e","_ref2","Object","keys","map","themeId","Option","key","colStyle","padding","SplunkThemeProvider","Message","type","varKey","_sharedThemeVariables","_themeFamilyMapping$s","themeValue","theme","splunkThemeV1","omit","isFromSharedVariables","sharedThemeVariables","isJSON","_typeof","JSON","parse","onMouseOver","onMouseOut","Tooltip","content","object","isRequired","func"],"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;;QA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;IACvD,CAAC,CAAC,OAAOhB,CAAC,EAAE,CAAC,CAAC,CAAC;IACf,OACI,CAACsB,MAAM,iBACHzE,4CAAA,CAAAC,aAAA,CAACnB,QAAQ;MACL4E,GAAG,EAAEM,MAAO;MACZa,WAAW,EAAE,SAAAA,YAAA;QAAA,OAAM3C,2BAA2B,CAAC8B,MAAM,CAAC;MAAA,CAAC;MACvDc,UAAU,EAAE,SAAAA,WAAA;QAAA,OAAM5C,2BAA2B,CAAC,EAAE,CAAC;MAAA;IAAC,gBAElDlC,4CAAA,CAAAC,aAAA,CAACb,YAAY;MACTE,WAAW,EAAE0E,MAAM,KAAK/B;IAAyB,MAAA/B,MAAA,CAChD8D,MAAM,EAAkB,EAC5BO,qBAAqB,iBAClBvE,4CAAA,CAAAC,aAAA,CAAC8E,gEAAO;MAACC,OAAO,EAAC;IAAmE,EACvF,eACDhF,4CAAA,CAAAC,aAAA,CAACL,IAAI;MAACE,KAAK,EAAC,OAAO;MAACC,IAAI,EAAEoE;IAAW,EAAG,CAE/C;EAET,CAAC,CAAC,CACgB,CACP,CACR;AAEvB,CAAC;AAED1C,SAAS,CAACrB,SAAS,GAAG;EAClBwB,MAAM,EAAEvB,iDAAC,CAAC4E,MAAM,CAACC,UAAU;EAAE;EAC7BxD,mBAAmB,EAAErB,iDAAC,CAAC8E,IAAI,CAACD;AAChC,CAAC;AAEczD,wEAAS,E","file":"ThemesDoc.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 65);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"@splunk/react-ui/ColumnLayout\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"@splunk/visualization-themes/variables\");","module.exports = require(\"styled-components\");","module.exports = require(\"@splunk/react-ui/Select\");","module.exports = require(\"lodash/omit\");","module.exports = require(\"lodash/cloneDeep\");","module.exports = require(\"@splunk/react-ui/Message\");","module.exports = require(\"@splunk/react-ui/Tooltip\");","module.exports = require(\"@splunk/themes/SplunkThemeProvider\");","module.exports = require(\"@splunk/react-ui/Heading\");","/* eslint-disable react/no-multi-comp */\nimport React, { useState } from 'react';\nimport T from 'prop-types';\nimport Heading from '@splunk/react-ui/Heading';\nimport styled from 'styled-components';\nimport omit from 'lodash/omit';\nimport cloneDeep from 'lodash/cloneDeep';\nimport ColumnLayout from '@splunk/react-ui/ColumnLayout';\nimport Select from '@splunk/react-ui/Select';\nimport Message from '@splunk/react-ui/Message';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport SplunkThemeProvider from '@splunk/themes/SplunkThemeProvider';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport * as sharedThemeVariables from '@splunk/visualization-themes/variables';\n\nconst ThemeVar = styled.div`\n margin-top: 20px;\n cursor: pointer;\n`;\nconst ThemeVarName = styled.div`\n color: #5ca300;\n padding-bottom: 5px;\n display: inline-block;\n padding-right: 5px;\n font-weight: ${props => (props.highlighted ? 'bold' : 'normal')};\n`;\nconst PairContainer = styled.div`\n margin-left: 40px;\n margin-top: 10px;\n`;\nconst PairTitle = styled.span`\n display: inline-block;\n color: #8293a7;\n width: 80px;\n`;\nconst ColorPreview = styled.div`\n width: 20px;\n height: 20px;\n background: ${props => props.color};\n display: inline-block;\n vertical-align: bottom;\n margin-right: 5px;\n border: 1px solid rgba(0, 0, 0, 0.3);\n border-radius: 5px;\n`;\n\nconst Pair = ({ title, text }) => (\n <PairContainer>\n <PairTitle>{`${title}:`}</PairTitle>\n {isColor(text) && <ColorPreview color={text} />}\n <samp>{text}</samp>\n </PairContainer>\n);\nPair.propTypes = {\n title: T.string,\n text: T.string,\n};\n\nconst themeFamilyMapping = {\n enterprise: {\n colorScheme: {\n dark: 'enterpriseDark',\n light: 'enterprise',\n },\n },\n prisma: {\n colorScheme: {\n dark: 'scp',\n light: 'enterprise',\n },\n },\n};\n\nconst themeIdToVariant = {\n enterpriseLightComfortable: {\n colorScheme: 'light',\n density: 'comfortable',\n family: 'enterprise',\n label: 'Enterprise Light Comfortable',\n },\n enterpriseLightCompact: {\n colorScheme: 'light',\n density: 'compact',\n family: 'enterprise',\n label: 'Enterprise Light Compact',\n },\n enterpriseDarkComfortable: {\n colorScheme: 'dark',\n density: 'comfortable',\n family: 'enterprise',\n label: 'Enterprise Dark Comfortable',\n },\n enterpriseDarkCompact: {\n colorScheme: 'dark',\n density: 'compact',\n family: 'enterprise',\n label: 'Enterprise Dark Compact',\n },\n prismaLightComfortable: {\n colorScheme: 'light',\n density: 'comfortable',\n family: 'prisma',\n label: 'Prisma Light Comfortable',\n },\n prismaLightCompact: {\n colorScheme: 'light',\n density: 'compact',\n family: 'prisma',\n label: 'Prisma Light Compact',\n },\n prismaDarkComfortable: {\n colorScheme: 'dark',\n density: 'comfortable',\n family: 'prisma',\n label: 'Prisma Dark Comfortable',\n },\n prismaDarkCompact: {\n colorScheme: 'dark',\n density: 'compact',\n family: 'prisma',\n label: 'Prisma Dark Compact',\n },\n};\n\nconst ThemesDoc = props => {\n const { renderVisualization, themes: themeVars } = props;\n const [highlightedThemeVariable, setHighlightedThemeVariable] = useState('');\n const [selectedTheme, setSelectedTheme] = useState(themeIdToVariant.enterpriseLightComfortable);\n const previewTheme = cloneDeep(themeVars);\n // if the highlighted theme variable is a color, color it red\n // TODO(fkurniawan): fix red highlighting. this broke ~v20.7.0, and approach needs to be modified again owing to SUI upgrade\n if (isColor(themeVars[highlightedThemeVariable])) {\n previewTheme[highlightedThemeVariable] = () => 'red';\n }\n return (\n <ColumnLayout style={{ marginTop: -20 }}>\n <ColumnLayout.Row>\n <ColumnLayout.Column span={12}>\n <Heading level={4}>Theme</Heading>\n <Select value={selectedTheme} onChange={(e, { value }) => setSelectedTheme(value)}>\n {Object.keys(themeIdToVariant).map(themeId => (\n <Select.Option\n key={themeId}\n label={themeIdToVariant[themeId].label}\n value={themeIdToVariant[themeId]}\n />\n ))}\n </Select>\n </ColumnLayout.Column>\n </ColumnLayout.Row>\n <ColumnLayout.Row>\n <ColumnLayout.Column colStyle={{ padding: 10 }} span={4}>\n <Heading level={4}>Preview</Heading>\n <SplunkThemeProvider\n family={selectedTheme.family}\n colorScheme={selectedTheme.colorScheme}\n density={selectedTheme.density}\n >\n {renderVisualization()}\n </SplunkThemeProvider>\n <Message type=\"info\">\n This preview may differ from the visualization's default look and feel. <br />\n It exists to show areas affected by theme variables.\n </Message>\n </ColumnLayout.Column>\n <ColumnLayout.Column colStyle={{ padding: 10 }} span={8}>\n <Heading level={4}>Variables</Heading>\n {Object.keys(previewTheme).map(varKey => {\n const themeValue = previewTheme[varKey]({\n theme: { splunkThemeV1: omit(selectedTheme, ['label']) },\n });\n // if a theme variable is in @splunk/visualization-themes and it has the same value\n // we assume we used the shared variable.\n const isFromSharedVariables =\n sharedThemeVariables?.[\n themeFamilyMapping?.[selectedTheme.family]?.[selectedTheme.colorScheme]\n ]?.[varKey] === themeValue;\n // for now we only show simple theme values (nested theme objects shouldn't have been introduced in the first place)\n let isJSON;\n try {\n isJSON = typeof JSON.parse(themeValue) === 'object';\n } catch (e) {} // eslint-disable-line no-empty\n return (\n !isJSON && (\n <ThemeVar\n key={varKey}\n onMouseOver={() => setHighlightedThemeVariable(varKey)}\n onMouseOut={() => setHighlightedThemeVariable('')}\n >\n <ThemeVarName\n highlighted={varKey === highlightedThemeVariable}\n >{`${varKey}`}</ThemeVarName>\n {isFromSharedVariables && (\n <Tooltip content=\"This is a shared theme variable from @splunk/visualization-themes\" />\n )}\n <Pair title=\"Value\" text={themeValue} />\n </ThemeVar>\n )\n );\n })}\n </ColumnLayout.Column>\n </ColumnLayout.Row>\n </ColumnLayout>\n );\n};\n\nThemesDoc.propTypes = {\n themes: T.object.isRequired, // @TODO: replace with themes object from viz config when we add docs/descs to theme vars\n renderVisualization: T.func.isRequired,\n};\n\nexport default ThemesDoc;\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"@splunk/react-ui/ColumnLayout\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"@splunk/visualizations-shared/colorUtils\"","webpack:///external \"@splunk/visualization-themes/variables\"","webpack:///external \"styled-components\"","webpack:///external \"@splunk/react-ui/Select\"","webpack:///external \"lodash/omit\"","webpack:///external \"lodash/cloneDeep\"","webpack:///external \"@splunk/react-ui/Message\"","webpack:///external \"@splunk/react-ui/Tooltip\"","webpack:///external \"@splunk/themes/SplunkThemeProvider\"","webpack:///external \"@splunk/react-ui/Heading\"","webpack:///./src/common/ThemesDoc.jsx"],"names":["ThemeVar","styled","div","withConfig","displayName","componentId","ThemeVarName","props","highlighted","PairContainer","PairTitle","span","ColorPreview","color","Pair","_ref","title","text","React","createElement","concat","isColor","propTypes","T","string","themeFamilyMapping","enterprise","colorScheme","dark","light","prisma","themeIdToVariant","enterpriseLightComfortable","density","family","label","enterpriseLightCompact","enterpriseDarkComfortable","enterpriseDarkCompact","prismaLightComfortable","prismaLightCompact","prismaDarkComfortable","prismaDarkCompact","ThemesDoc","renderVisualization","themeVars","themes","_useState","useState","_useState2","_slicedToArray","highlightedThemeVariable","setHighlightedThemeVariable","_useState3","_useState4","selectedTheme","setSelectedTheme","previewTheme","cloneDeep","ColumnLayout","style","marginTop","Row","Column","Heading","level","Select","value","onChange","e","_ref2","Object","keys","map","themeId","Option","key","colStyle","padding","SplunkThemeProvider","Message","type","varKey","_sharedThemeVariables","_themeFamilyMapping$s","themeValue","theme","splunkThemeV1","omit","isFromSharedVariables","sharedThemeVariables","isJSON","_typeof","JSON","parse","onMouseOver","onMouseOut","Tooltip","content","object","isRequired","func"],"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,kC;;;;;;;ACAA,uC;;;;;;;ACAA,iE;;;;;;;ACAA,0D;;;;;;;ACAA,0D;;;;;;;ACAA,qE;;;;;;;ACAA,mE;;;;;;;ACAA,8C;;;;;;;ACAA,oD;;;;;;;ACAA,wC;;;;;;;ACAA,6C;;;;;;;ACAA,qD;;;;;;;ACAA,qD;;;;;;;ACAA,+D;;;;;;;ACAA,qD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACwC;AACb;AACoB;AACR;AACR;AACU;AACgB;AACZ;AACE;AACA;AACsB;AACF;AACY;AAE/E,IAAMA,QAAQ,GAAGC,wDAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,uCAG1B;AACD,IAAMC,YAAY,GAAGL,wDAAM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AAM,CAACC,UAAU;EAAE;EAC7BxD,mBAAmB,EAAErB,iDAAC,CAAC8E,IAAI,CAACD;AAChC,CAAC;AAEczD,wEAAS,E","file":"ThemesDoc.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 = 66);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"@splunk/react-ui/ColumnLayout\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"@splunk/visualization-themes/variables\");","module.exports = require(\"styled-components\");","module.exports = require(\"@splunk/react-ui/Select\");","module.exports = require(\"lodash/omit\");","module.exports = require(\"lodash/cloneDeep\");","module.exports = require(\"@splunk/react-ui/Message\");","module.exports = require(\"@splunk/react-ui/Tooltip\");","module.exports = require(\"@splunk/themes/SplunkThemeProvider\");","module.exports = require(\"@splunk/react-ui/Heading\");","/* eslint-disable react/no-multi-comp */\nimport React, { useState } from 'react';\nimport T from 'prop-types';\nimport Heading from '@splunk/react-ui/Heading';\nimport styled from 'styled-components';\nimport omit from 'lodash/omit';\nimport cloneDeep from 'lodash/cloneDeep';\nimport ColumnLayout from '@splunk/react-ui/ColumnLayout';\nimport Select from '@splunk/react-ui/Select';\nimport Message from '@splunk/react-ui/Message';\nimport Tooltip from '@splunk/react-ui/Tooltip';\nimport SplunkThemeProvider from '@splunk/themes/SplunkThemeProvider';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport * as sharedThemeVariables from '@splunk/visualization-themes/variables';\n\nconst ThemeVar = styled.div`\n margin-top: 20px;\n cursor: pointer;\n`;\nconst ThemeVarName = styled.div`\n color: #5ca300;\n padding-bottom: 5px;\n display: inline-block;\n padding-right: 5px;\n font-weight: ${props => (props.highlighted ? 'bold' : 'normal')};\n`;\nconst PairContainer = styled.div`\n margin-left: 40px;\n margin-top: 10px;\n`;\nconst PairTitle = styled.span`\n display: inline-block;\n color: #8293a7;\n width: 80px;\n`;\nconst ColorPreview = styled.div`\n width: 20px;\n height: 20px;\n background: ${props => props.color};\n display: inline-block;\n vertical-align: bottom;\n margin-right: 5px;\n border: 1px solid rgba(0, 0, 0, 0.3);\n border-radius: 5px;\n`;\n\nconst Pair = ({ title, text }) => (\n <PairContainer>\n <PairTitle>{`${title}:`}</PairTitle>\n {isColor(text) && <ColorPreview color={text} />}\n <samp>{text}</samp>\n </PairContainer>\n);\nPair.propTypes = {\n title: T.string,\n text: T.string,\n};\n\nconst themeFamilyMapping = {\n enterprise: {\n colorScheme: {\n dark: 'enterpriseDark',\n light: 'enterprise',\n },\n },\n prisma: {\n colorScheme: {\n dark: 'scp',\n light: 'enterprise',\n },\n },\n};\n\nconst themeIdToVariant = {\n enterpriseLightComfortable: {\n colorScheme: 'light',\n density: 'comfortable',\n family: 'enterprise',\n label: 'Enterprise Light Comfortable',\n },\n enterpriseLightCompact: {\n colorScheme: 'light',\n density: 'compact',\n family: 'enterprise',\n label: 'Enterprise Light Compact',\n },\n enterpriseDarkComfortable: {\n colorScheme: 'dark',\n density: 'comfortable',\n family: 'enterprise',\n label: 'Enterprise Dark Comfortable',\n },\n enterpriseDarkCompact: {\n colorScheme: 'dark',\n density: 'compact',\n family: 'enterprise',\n label: 'Enterprise Dark Compact',\n },\n prismaLightComfortable: {\n colorScheme: 'light',\n density: 'comfortable',\n family: 'prisma',\n label: 'Prisma Light Comfortable',\n },\n prismaLightCompact: {\n colorScheme: 'light',\n density: 'compact',\n family: 'prisma',\n label: 'Prisma Light Compact',\n },\n prismaDarkComfortable: {\n colorScheme: 'dark',\n density: 'comfortable',\n family: 'prisma',\n label: 'Prisma Dark Comfortable',\n },\n prismaDarkCompact: {\n colorScheme: 'dark',\n density: 'compact',\n family: 'prisma',\n label: 'Prisma Dark Compact',\n },\n};\n\nconst ThemesDoc = props => {\n const { renderVisualization, themes: themeVars } = props;\n const [highlightedThemeVariable, setHighlightedThemeVariable] = useState('');\n const [selectedTheme, setSelectedTheme] = useState(themeIdToVariant.enterpriseLightComfortable);\n const previewTheme = cloneDeep(themeVars);\n // if the highlighted theme variable is a color, color it red\n // TODO(fkurniawan): fix red highlighting. this broke ~v20.7.0, and approach needs to be modified again owing to SUI upgrade\n if (isColor(themeVars[highlightedThemeVariable])) {\n previewTheme[highlightedThemeVariable] = () => 'red';\n }\n return (\n <ColumnLayout style={{ marginTop: -20 }}>\n <ColumnLayout.Row>\n <ColumnLayout.Column span={12}>\n <Heading level={4}>Theme</Heading>\n <Select value={selectedTheme} onChange={(e, { value }) => setSelectedTheme(value)}>\n {Object.keys(themeIdToVariant).map(themeId => (\n <Select.Option\n key={themeId}\n label={themeIdToVariant[themeId].label}\n value={themeIdToVariant[themeId]}\n />\n ))}\n </Select>\n </ColumnLayout.Column>\n </ColumnLayout.Row>\n <ColumnLayout.Row>\n <ColumnLayout.Column colStyle={{ padding: 10 }} span={4}>\n <Heading level={4}>Preview</Heading>\n <SplunkThemeProvider\n family={selectedTheme.family}\n colorScheme={selectedTheme.colorScheme}\n density={selectedTheme.density}\n >\n {renderVisualization()}\n </SplunkThemeProvider>\n <Message type=\"info\">\n This preview may differ from the visualization's default look and feel. <br />\n It exists to show areas affected by theme variables.\n </Message>\n </ColumnLayout.Column>\n <ColumnLayout.Column colStyle={{ padding: 10 }} span={8}>\n <Heading level={4}>Variables</Heading>\n {Object.keys(previewTheme).map(varKey => {\n const themeValue = previewTheme[varKey]({\n theme: { splunkThemeV1: omit(selectedTheme, ['label']) },\n });\n // if a theme variable is in @splunk/visualization-themes and it has the same value\n // we assume we used the shared variable.\n const isFromSharedVariables =\n sharedThemeVariables?.[\n themeFamilyMapping?.[selectedTheme.family]?.[selectedTheme.colorScheme]\n ]?.[varKey] === themeValue;\n // for now we only show simple theme values (nested theme objects shouldn't have been introduced in the first place)\n let isJSON;\n try {\n isJSON = typeof JSON.parse(themeValue) === 'object';\n } catch (e) {} // eslint-disable-line no-empty\n return (\n !isJSON && (\n <ThemeVar\n key={varKey}\n onMouseOver={() => setHighlightedThemeVariable(varKey)}\n onMouseOut={() => setHighlightedThemeVariable('')}\n >\n <ThemeVarName\n highlighted={varKey === highlightedThemeVariable}\n >{`${varKey}`}</ThemeVarName>\n {isFromSharedVariables && (\n <Tooltip content=\"This is a shared theme variable from @splunk/visualization-themes\" />\n )}\n <Pair title=\"Value\" text={themeValue} />\n </ThemeVar>\n )\n );\n })}\n </ColumnLayout.Column>\n </ColumnLayout.Row>\n </ColumnLayout>\n );\n};\n\nThemesDoc.propTypes = {\n themes: T.object.isRequired, // @TODO: replace with themes object from viz config when we add docs/descs to theme vars\n renderVisualization: T.func.isRequired,\n};\n\nexport default ThemesDoc;\n"],"sourceRoot":""}
|
package/common/chartingUtils.js
CHANGED
|
@@ -87,12 +87,12 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 67);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
94
94
|
|
|
95
|
-
/***/
|
|
95
|
+
/***/ 26:
|
|
96
96
|
/***/ (function(module, exports) {
|
|
97
97
|
|
|
98
98
|
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
@@ -106,13 +106,13 @@ module.exports = require("lodash");
|
|
|
106
106
|
|
|
107
107
|
/***/ }),
|
|
108
108
|
|
|
109
|
-
/***/
|
|
109
|
+
/***/ 67:
|
|
110
110
|
/***/ (function(module, exports, __webpack_require__) {
|
|
111
111
|
|
|
112
112
|
"use strict";
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
var _toConsumableArray = __webpack_require__(
|
|
115
|
+
var _toConsumableArray = __webpack_require__(26);
|
|
116
116
|
var __rest = this && this.__rest || function (s, e) {
|
|
117
117
|
var t = {};
|
|
118
118
|
for (var p in s) {
|
|
@@ -182,9 +182,9 @@ var mapToValues = function mapToValues(optionValuesSCMapping) {
|
|
|
182
182
|
return function (options) {
|
|
183
183
|
var convertedOptions = Object.assign({}, options);
|
|
184
184
|
Object.keys(optionValuesSCMapping).forEach(function (key) {
|
|
185
|
-
if (lodash_1.has(options, key)) {
|
|
185
|
+
if ((0, lodash_1.has)(options, key)) {
|
|
186
186
|
var updatedValue = optionValuesSCMapping[key][options[key]];
|
|
187
|
-
if (!lodash_1.isUndefined(updatedValue)) {
|
|
187
|
+
if (!(0, lodash_1.isUndefined)(updatedValue)) {
|
|
188
188
|
convertedOptions[key] = updatedValue;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -205,7 +205,7 @@ var convertY2AxisOptions = function convertY2AxisOptions(_a) {
|
|
|
205
205
|
var convertedOptions = Object.assign({}, originalOptions);
|
|
206
206
|
if (y2Fields) {
|
|
207
207
|
convertedOptions['axisY2.enabled'] = true;
|
|
208
|
-
convertedOptions['axisY2.fields'] = lodash_1.isArray(y2Fields) ? y2Fields.filter(function (name) {
|
|
208
|
+
convertedOptions['axisY2.fields'] = (0, lodash_1.isArray)(y2Fields) ? y2Fields.filter(function (name) {
|
|
209
209
|
return name;
|
|
210
210
|
}).join(',') : y2Fields;
|
|
211
211
|
}
|
|
@@ -247,7 +247,7 @@ exports.isMultiSeriesData = isMultiSeriesData;
|
|
|
247
247
|
* @return {array}
|
|
248
248
|
*/
|
|
249
249
|
var toArrayForSeries = function toArrayForSeries(data, value) {
|
|
250
|
-
return exports.isMultiSeriesData(data) ? value : [value];
|
|
250
|
+
return (0, exports.isMultiSeriesData)(data) ? value : [value];
|
|
251
251
|
};
|
|
252
252
|
exports.toArrayForSeries = toArrayForSeries;
|
|
253
253
|
var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
|
|
@@ -259,10 +259,10 @@ var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
|
|
|
259
259
|
yFields = _ref2.yFields,
|
|
260
260
|
y2 = _ref2.y2,
|
|
261
261
|
y2Fields = _ref2.y2Fields;
|
|
262
|
-
var columns = [x.map(String)].concat(_toConsumableArray(exports.toArrayForSeries(y, y).map(function (series) {
|
|
262
|
+
var columns = [x.map(String)].concat(_toConsumableArray((0, exports.toArrayForSeries)(y, y).map(function (series) {
|
|
263
263
|
return series.map(String);
|
|
264
264
|
})));
|
|
265
|
-
var yFieldsArray = exports.toArrayForSeries(y, yFields);
|
|
265
|
+
var yFieldsArray = (0, exports.toArrayForSeries)(y, yFields);
|
|
266
266
|
var fields = [{
|
|
267
267
|
name: xField
|
|
268
268
|
}].concat(_toConsumableArray(yFieldsArray.map(function (field) {
|
|
@@ -274,8 +274,8 @@ var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
|
|
|
274
274
|
// when y & y2 options are configured with different (mutually exclusive) series
|
|
275
275
|
// y2 columns need to be added to columns
|
|
276
276
|
if (y2Fields) {
|
|
277
|
-
var y2FieldsArray = exports.toArrayForSeries(y2, y2Fields);
|
|
278
|
-
var y2AsArray = exports.toArrayForSeries(y2, y2).map(function (series) {
|
|
277
|
+
var y2FieldsArray = (0, exports.toArrayForSeries)(y2, y2Fields);
|
|
278
|
+
var y2AsArray = (0, exports.toArrayForSeries)(y2, y2).map(function (series) {
|
|
279
279
|
return series === null || series === void 0 ? void 0 : series.map(String);
|
|
280
280
|
});
|
|
281
281
|
y2FieldsArray.forEach(function (y2Field, index) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"lodash\"","webpack:///./src/common/chartingUtils.ts"],"names":["lodash_1","require","getAnnotations","_ref","annotationX","annotationColor","annotationLabel","length","map","timestamp","i","color","label","time","exports","truncateData","dataSet","truncationLimit","limit","parseInt","truncatedData","Object","assign","columns","columnData","Array","isArray","slice","mapToValues","optionValuesSCMapping","options","convertedOptions","keys","forEach","key","has","updatedValue","isUndefined","convertY2AxisOptions","_a","y2Fields","originalOptions","__rest","filter","name","join","convertOverlayFields","overlayFields","field","trim","isMultiSeriesData","data","toArrayForSeries","value","constructFieldsAndColumns","_ref2","_ref2$x","x","_ref2$y","y","xField","yFields","y2","String","concat","_toConsumableArray","series","yFieldsArray","fields","y2FieldsArray","y2AsArray","y2Field","index","indexOf","push"],"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,qE;;;;;;;ACAA,mC;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,IAAAA,QAAA,GAAAC,mBAAA;AAOA;;;;;;;;;AASO,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA;EAAA,IAAMC,WAAW,GA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mD,IAAI,CAACJ,SAAS,CAACE,KAAK,CAAC,CAAC;;IAEtC,CAAC,CAAC;;EAEN,OAAO;IACHjD,OAAO,EAAPA,OAAO;IACP6C,MAAM,EAANA;GACH;AACL,CAAC;AA9BYtD,OAAA,CAAAwC,yBAAyB,GAAAA,yBAAA,C","file":"chartingUtils.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 = 66);\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"lodash\");","import { has, isArray, isUndefined } from 'lodash';\nimport type { JsonColumnData } from './interfaces/DataSource';\n\ninterface ChartOptions {\n [key: string]: any;\n}\n\n/**\n * Get formatted annotations\n * @method getAnnotations\n * @param {Object} options\n * @param {Array} options.annotationX\n * @param {Array} options.annotationColor\n * @param {Array} options.annotationLabel\n * @returns {Array}\n */\nexport const getAnnotations = ({ annotationX, annotationColor, annotationLabel }) =>\n annotationX && annotationX.length\n ? annotationX.map((timestamp, i) => ({\n color: annotationColor && annotationColor[i],\n label: annotationLabel && annotationLabel[i],\n time: timestamp,\n }))\n : [];\n\n/**\n * Truncate the result set to given limit\n * @method truncateData\n * @param {Object} dataSet - dataSources.primary.data\n * @param {Number|String} truncationLimit - options['chart.resultTruncationLimit']\n * @returns {Object}\n */\nexport const truncateData = (dataSet, truncationLimit): Record<string, any[]> => {\n if (!dataSet) {\n return null;\n }\n\n const limit = parseInt(truncationLimit, 10);\n if (!limit || limit <= 0) {\n return dataSet;\n }\n\n const truncatedData: Record<string, Array<string[] | number[]>> = { ...dataSet };\n truncatedData.columns = truncatedData.columns.map(columnData =>\n columnData && Array.isArray(columnData) ? columnData.slice(0, limit) : columnData\n );\n return truncatedData;\n};\n\n/**\n * Helper method to update the option values into the values that SC accepts\n * @method mapToValues\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToValues = (optionValuesSCMapping: Record<string, any>) => options => {\n const convertedOptions: Record<string, any> = { ...options };\n Object.keys(optionValuesSCMapping).forEach(key => {\n if (has(options, key)) {\n const updatedValue = optionValuesSCMapping[key][options[key]];\n if (!isUndefined(updatedValue)) {\n convertedOptions[key] = updatedValue;\n }\n }\n });\n return convertedOptions;\n};\n\ninterface y2AxisOptions extends ChartOptions {\n y2Fields?: string | string[];\n}\n\n/**\n * Helper method to process options related to y2Fields\n * @method convertY2AxisOptions\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertY2AxisOptions = ({\n y2Fields,\n ...originalOptions\n}: y2AxisOptions): Record<string, any> => {\n const convertedOptions: Record<string, any> = {\n ...originalOptions,\n };\n if (y2Fields) {\n convertedOptions['axisY2.enabled'] = true;\n convertedOptions['axisY2.fields'] = isArray(y2Fields)\n ? y2Fields.filter(name => name).join(',')\n : y2Fields;\n }\n return convertedOptions;\n};\n\n/**\n * Helper method to format value for overlayFields\n * @method convertOverlayFields\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertOverlayFields = (originalOptions: ChartOptions): ChartOptions => {\n const convertedOptions: ChartOptions = {\n ...originalOptions,\n };\n const { overlayFields } = originalOptions;\n if (overlayFields) {\n convertedOptions.overlayFields = Array.isArray(overlayFields)\n ? overlayFields\n .filter(field => field)\n .map(field => field.trim())\n .join(',')\n : overlayFields;\n }\n return convertedOptions;\n};\n\n/**\n * checks whether data is multi series data\n * @param {array} data array\n * @return {Boolean}\n */\nexport const isMultiSeriesData = (data: string[] | string[][]): boolean =>\n Array.isArray(data) && Array.isArray(data[0]);\n/**\n * checks whether data is multi series data and returns value as array\n * @param {array} data array\n * @param {*} value to return as array\n * @return {array}\n */\nexport const toArrayForSeries = (data, value): any[] => (isMultiSeriesData(data) ? value : [value]);\n\ninterface ConstructFieldsAndColumnsParams {\n x: string[];\n y: string[] | string[][];\n xField: string;\n yFields: string | string[];\n y2?: string[] | string[][];\n y2Fields?: string | string[];\n}\nexport const constructFieldsAndColumns = ({\n x = [],\n y = [],\n xField,\n yFields,\n y2,\n y2Fields,\n}: ConstructFieldsAndColumnsParams): JsonColumnData => {\n const columns = [x.map(String), ...toArrayForSeries(y, y).map(series => series.map(String))];\n const yFieldsArray = toArrayForSeries(y, yFields);\n const fields = [{ name: xField }, ...yFieldsArray.map(field => ({ name: field }))];\n // splunk-charting requires y2 to be part of columns\n // when y & y2 options are configured with different (mutually exclusive) series\n // y2 columns need to be added to columns\n if (y2Fields) {\n const y2FieldsArray = toArrayForSeries(y2, y2Fields);\n const y2AsArray = toArrayForSeries(y2, y2).map(series => series?.map(String));\n y2FieldsArray.forEach((y2Field, index) => {\n if (yFieldsArray.indexOf(y2Field) === -1 && y2AsArray[index]) {\n fields.push({\n name: y2Field,\n });\n columns.push(y2AsArray[index]);\n }\n });\n }\n return {\n columns,\n fields,\n };\n};\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"lodash\"","webpack:///./src/common/chartingUtils.ts"],"names":["lodash_1","require","getAnnotations","_ref","annotationX","annotationColor","annotationLabel","length","map","timestamp","i","color","label","time","exports","truncateData","dataSet","truncationLimit","limit","parseInt","truncatedData","Object","assign","columns","columnData","Array","isArray","slice","mapToValues","optionValuesSCMapping","options","convertedOptions","keys","forEach","key","has","updatedValue","isUndefined","convertY2AxisOptions","_a","y2Fields","originalOptions","__rest","filter","name","join","convertOverlayFields","overlayFields","field","trim","isMultiSeriesData","data","toArrayForSeries","value","constructFieldsAndColumns","_ref2","_ref2$x","x","_ref2$y","y","xField","yFields","y2","String","concat","_toConsumableArray","series","yFieldsArray","fields","y2FieldsArray","y2AsArray","y2Field","index","indexOf","push"],"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,qE;;;;;;;ACAA,mC;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,IAAAA,QAAA,GAAAC,mBAAA;AAOA;;;;;;;;;AASO,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA;EAAA,IAAMC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,eAAe,GAAAF,IAAA,CAAfE,eAAe;IAAEC,eAAe,GAAAH,IAAA,CAAfG,eAAe;EAAA,OAC1EF,WAAW,IAAIA,WAAW,CAACG,MAAM,GAC3BH,WAAW,CAACI,GAAG,CAAC,UAACC,SAAS,EAAEC,CAAC;IAAA,OAAM;MAC/BC,KAAK,EAAEN,eAAe,IAAIA,eAAe,CAACK,CAAC,CAAC;MAC5CE,KAAK,EAAEN,eAAe,IAAIA,eAAe,CAACI,CAAC,CAAC;MAC5CG,IAAI,EAAEJ;KACT;EAAA,CAAC,CAAC,GACH,EAAE;AAAA;AAPCK,OAAA,CAAAZ,cAAc,GAAAA,c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AsC,gBAAgB,EAACO,CAAC,EAAEE,OAAO,CAAC;EACjD,IAAMO,MAAM,IAAI;IAAExB,IAAI,EAAEgB;EAAM,CAAE,EAAAI,MAAA,CAAAC,kBAAA,CAAKE,YAAY,CAAC3D,GAAG,CAAC,UAAAwC,KAAK;IAAA,OAAK;MAAEJ,IAAI,EAAEI;IAAK,CAAE;EAAA,CAAC,CAAC,EAAC;EAClF;EACA;EACA;EACA,IAAIR,QAAQ,EAAE;IACV,IAAM6B,aAAa,GAAG,IAAAvD,OAAA,CAAAsC,gBAAgB,EAACU,EAAE,EAAEtB,QAAQ,CAAC;IACpD,IAAM8B,SAAS,GAAG,IAAAxD,OAAA,CAAAsC,gBAAgB,EAACU,EAAE,EAAEA,EAAE,CAAC,CAACtD,GAAG,CAAC,UAAA0D,MAAM;MAAA,OAAIA,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAE1D,GAAG,CAACuD,MAAM,CAAC;IAAA,EAAC;IAC7EM,aAAa,CAACpC,OAAO,CAAC,UAACsC,OAAO,EAAEC,KAAK,EAAI;MACrC,IAAIL,YAAY,CAACM,OAAO,CAACF,OAAO,CAAC,KAAK,CAAC,CAAC,IAAID,SAAS,CAACE,KAAK,CAAC,EAAE;QAC1DJ,MAAM,CAACM,IAAI,CAAC;UACR9B,IAAI,EAAE2B;SACT,CAAC;QACFhD,OAAO,CAACmD,IAAI,CAACJ,SAAS,CAACE,KAAK,CAAC,CAAC;;IAEtC,CAAC,CAAC;;EAEN,OAAO;IACHjD,OAAO,EAAPA,OAAO;IACP6C,MAAM,EAANA;GACH;AACL,CAAC;AA9BYtD,OAAA,CAAAwC,yBAAyB,GAAAA,yBAAA,C","file":"chartingUtils.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 = 67);\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"lodash\");","import { has, isArray, isUndefined } from 'lodash';\nimport type { JsonColumnData } from './interfaces/DataSource';\n\ninterface ChartOptions {\n [key: string]: any;\n}\n\n/**\n * Get formatted annotations\n * @method getAnnotations\n * @param {Object} options\n * @param {Array} options.annotationX\n * @param {Array} options.annotationColor\n * @param {Array} options.annotationLabel\n * @returns {Array}\n */\nexport const getAnnotations = ({ annotationX, annotationColor, annotationLabel }) =>\n annotationX && annotationX.length\n ? annotationX.map((timestamp, i) => ({\n color: annotationColor && annotationColor[i],\n label: annotationLabel && annotationLabel[i],\n time: timestamp,\n }))\n : [];\n\n/**\n * Truncate the result set to given limit\n * @method truncateData\n * @param {Object} dataSet - dataSources.primary.data\n * @param {Number|String} truncationLimit - options['chart.resultTruncationLimit']\n * @returns {Object}\n */\nexport const truncateData = (dataSet, truncationLimit): Record<string, any[]> => {\n if (!dataSet) {\n return null;\n }\n\n const limit = parseInt(truncationLimit, 10);\n if (!limit || limit <= 0) {\n return dataSet;\n }\n\n const truncatedData: Record<string, Array<string[] | number[]>> = { ...dataSet };\n truncatedData.columns = truncatedData.columns.map(columnData =>\n columnData && Array.isArray(columnData) ? columnData.slice(0, limit) : columnData\n );\n return truncatedData;\n};\n\n/**\n * Helper method to update the option values into the values that SC accepts\n * @method mapToValues\n * @param {Object} options\n * @returns {Object}\n */\nexport const mapToValues = (optionValuesSCMapping: Record<string, any>) => options => {\n const convertedOptions: Record<string, any> = { ...options };\n Object.keys(optionValuesSCMapping).forEach(key => {\n if (has(options, key)) {\n const updatedValue = optionValuesSCMapping[key][options[key]];\n if (!isUndefined(updatedValue)) {\n convertedOptions[key] = updatedValue;\n }\n }\n });\n return convertedOptions;\n};\n\ninterface y2AxisOptions extends ChartOptions {\n y2Fields?: string | string[];\n}\n\n/**\n * Helper method to process options related to y2Fields\n * @method convertY2AxisOptions\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertY2AxisOptions = ({\n y2Fields,\n ...originalOptions\n}: y2AxisOptions): Record<string, any> => {\n const convertedOptions: Record<string, any> = {\n ...originalOptions,\n };\n if (y2Fields) {\n convertedOptions['axisY2.enabled'] = true;\n convertedOptions['axisY2.fields'] = isArray(y2Fields)\n ? y2Fields.filter(name => name).join(',')\n : y2Fields;\n }\n return convertedOptions;\n};\n\n/**\n * Helper method to format value for overlayFields\n * @method convertOverlayFields\n * @param {Object} originalOptions\n * @returns {Object}\n */\nexport const convertOverlayFields = (originalOptions: ChartOptions): ChartOptions => {\n const convertedOptions: ChartOptions = {\n ...originalOptions,\n };\n const { overlayFields } = originalOptions;\n if (overlayFields) {\n convertedOptions.overlayFields = Array.isArray(overlayFields)\n ? overlayFields\n .filter(field => field)\n .map(field => field.trim())\n .join(',')\n : overlayFields;\n }\n return convertedOptions;\n};\n\n/**\n * checks whether data is multi series data\n * @param {array} data array\n * @return {Boolean}\n */\nexport const isMultiSeriesData = (data: string[] | string[][]): boolean =>\n Array.isArray(data) && Array.isArray(data[0]);\n/**\n * checks whether data is multi series data and returns value as array\n * @param {array} data array\n * @param {*} value to return as array\n * @return {array}\n */\nexport const toArrayForSeries = (data, value): any[] => (isMultiSeriesData(data) ? value : [value]);\n\ninterface ConstructFieldsAndColumnsParams {\n x: string[];\n y: string[] | string[][];\n xField: string;\n yFields: string | string[];\n y2?: string[] | string[][];\n y2Fields?: string | string[];\n}\nexport const constructFieldsAndColumns = ({\n x = [],\n y = [],\n xField,\n yFields,\n y2,\n y2Fields,\n}: ConstructFieldsAndColumnsParams): JsonColumnData => {\n const columns = [x.map(String), ...toArrayForSeries(y, y).map(series => series.map(String))];\n const yFieldsArray = toArrayForSeries(y, yFields);\n const fields = [{ name: xField }, ...yFieldsArray.map(field => ({ name: field }))];\n // splunk-charting requires y2 to be part of columns\n // when y & y2 options are configured with different (mutually exclusive) series\n // y2 columns need to be added to columns\n if (y2Fields) {\n const y2FieldsArray = toArrayForSeries(y2, y2Fields);\n const y2AsArray = toArrayForSeries(y2, y2).map(series => series?.map(String));\n y2FieldsArray.forEach((y2Field, index) => {\n if (yFieldsArray.indexOf(y2Field) === -1 && y2AsArray[index]) {\n fields.push({\n name: y2Field,\n });\n columns.push(y2AsArray[index]);\n }\n });\n }\n return {\n columns,\n fields,\n };\n};\n"],"sourceRoot":""}
|
package/common/docUtils.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 68);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -99,7 +99,7 @@ module.exports = require("react");
|
|
|
99
99
|
|
|
100
100
|
/***/ }),
|
|
101
101
|
|
|
102
|
-
/***/
|
|
102
|
+
/***/ 68:
|
|
103
103
|
/***/ (function(module, exports, __webpack_require__) {
|
|
104
104
|
|
|
105
105
|
"use strict";
|
|
@@ -110,7 +110,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
110
110
|
});
|
|
111
111
|
exports.extractDocItems = exports.getFormatterClassdesc = void 0;
|
|
112
112
|
var React = __webpack_require__(0);
|
|
113
|
-
var UtilPage_1 = __webpack_require__(
|
|
113
|
+
var UtilPage_1 = __webpack_require__(69);
|
|
114
114
|
var sharedSelectors = ['getField', 'getType', 'min', 'max'];
|
|
115
115
|
var formatSidebarItemName = function formatSidebarItemName(name, className) {
|
|
116
116
|
return sharedSelectors.find(function (sharedSelector) {
|
|
@@ -165,7 +165,7 @@ exports.extractDocItems = extractDocItems;
|
|
|
165
165
|
|
|
166
166
|
/***/ }),
|
|
167
167
|
|
|
168
|
-
/***/
|
|
168
|
+
/***/ 69:
|
|
169
169
|
/***/ (function(module, exports) {
|
|
170
170
|
|
|
171
171
|
module.exports = require("@splunk/react-docs/UtilPage");
|
package/common/docUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///./src/common/docUtils.tsx","webpack:///external \"@splunk/react-docs/UtilPage\""],"names":["React","require","UtilPage_1","sharedSelectors","formatSidebarItemName","name","className","find","sharedSelector","concat","removePrependedClassName","longname","arguments","length","undefined","slice","indexOf","formatDSLSelectorDocs","docs","map","doc","Object","assign","getFormatterClassdesc","formatterDocs","markdown","kind","classdesc","exports","extractDocItems","classHeaderDoc","fileDoc","filteredDocs","filter","_ref","access","comment","component","UtilDoc","createElement","default","title","status","sort","a","b","localeCompare"],"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,kC;;;;;;;;;;;;;;ACAA,IAAAA,KAAA,GAAAC,mBAAA;AACA,IAAAC,UAAA,GAAAD,mBAAA;AAeA,IAAME,eAAe,GA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e,GAAG,SAAlBA,eAAeA,CACxBX,IAAa,EACbZ,SAAiB,EACuC;EACxD,IAAMwB,cAAc,GAAGZ,IAAI,CAAC,CAAC,CAAC;EAC9B,IAAMa,OAAO,GAAGb,IAAI,CAACA,IAAI,CAACL,MAAM,GAAG,CAAC,CAAC;EACrC,IAAMmB,YAAY,GAAGf,qBAAqB,CAACC,IAAI,CAAC,CAACe,MAAM,CACnD,UAAAC,IAAA;IAAA,IAAGC,MAAM,GAAAD,IAAA,CAANC,MAAM;MAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAA,OAAOD,MAAM,KAAK,QAAQ,IAAIC,OAAO;EAAA,EAC1D;EAED,OAAOJ,YAAY,CACdb,GAAG,CAAC,UAAAC,GAAG;IAAA,OAAK;MACTf,IAAI,EAAED,qBAAqB,CAACgB,GAAG,CAACf,IAAI,EAAEC,SAAS,CAAC;MAChD+B,SAAS,EAAE,SAASC,OAAOA,CAAA;QACvB;QACA,OACItC,KAAA,CAAAuC,aAAA,CAACrC,UAAA,CAAAsC,OAAQ;UACLC,KAAK,KAAAhC,MAAA,CAAKH,SAAS,OAAAG,MAAA,CAAIW,GAAG,CAACf,IAAI,CAAE;UACjCqC,MAAM,EAAE,CAAC;UACTxB,IAAI,EAAE,CAACY,cAAc,EAAEV,GAAG,EAAEW,OAAO;QAAC,EACtC;MAEV;KACH;EAAA,CAAC,CAAC,CACFY,IAAI,CAAC,UAACC,CAAC,EAAEC,CAAC;IAAA,OAAKD,CAAC,CAACvC,IAAI,CAACyC,aAAa,CAACD,CAAC,CAACxC,IAAI,CAAC;EAAA,EAAC;AACrD,CAAC;AAzBYuB,OAAA,CAAAC,eAAe,GAAAA,eAAA,C;;;;;;;ACtC5B,wD","file":"docUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s =
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///./src/common/docUtils.tsx","webpack:///external \"@splunk/react-docs/UtilPage\""],"names":["React","require","UtilPage_1","sharedSelectors","formatSidebarItemName","name","className","find","sharedSelector","concat","removePrependedClassName","longname","arguments","length","undefined","slice","indexOf","formatDSLSelectorDocs","docs","map","doc","Object","assign","getFormatterClassdesc","formatterDocs","markdown","kind","classdesc","exports","extractDocItems","classHeaderDoc","fileDoc","filteredDocs","filter","_ref","access","comment","component","UtilDoc","createElement","default","title","status","sort","a","b","localeCompare"],"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,kC;;;;;;;;;;;;;;ACAA,IAAAA,KAAA,GAAAC,mBAAA;AACA,IAAAC,UAAA,GAAAD,mBAAA;AAeA,IAAME,eAAe,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AAe,GAAG,SAAlBA,eAAeA,CACxBX,IAAa,EACbZ,SAAiB,EACuC;EACxD,IAAMwB,cAAc,GAAGZ,IAAI,CAAC,CAAC,CAAC;EAC9B,IAAMa,OAAO,GAAGb,IAAI,CAACA,IAAI,CAACL,MAAM,GAAG,CAAC,CAAC;EACrC,IAAMmB,YAAY,GAAGf,qBAAqB,CAACC,IAAI,CAAC,CAACe,MAAM,CACnD,UAAAC,IAAA;IAAA,IAAGC,MAAM,GAAAD,IAAA,CAANC,MAAM;MAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAA,OAAOD,MAAM,KAAK,QAAQ,IAAIC,OAAO;EAAA,EAC1D;EAED,OAAOJ,YAAY,CACdb,GAAG,CAAC,UAAAC,GAAG;IAAA,OAAK;MACTf,IAAI,EAAED,qBAAqB,CAACgB,GAAG,CAACf,IAAI,EAAEC,SAAS,CAAC;MAChD+B,SAAS,EAAE,SAASC,OAAOA,CAAA;QACvB;QACA,OACItC,KAAA,CAAAuC,aAAA,CAACrC,UAAA,CAAAsC,OAAQ;UACLC,KAAK,KAAAhC,MAAA,CAAKH,SAAS,OAAAG,MAAA,CAAIW,GAAG,CAACf,IAAI,CAAE;UACjCqC,MAAM,EAAE,CAAC;UACTxB,IAAI,EAAE,CAACY,cAAc,EAAEV,GAAG,EAAEW,OAAO;QAAC,EACtC;MAEV;KACH;EAAA,CAAC,CAAC,CACFY,IAAI,CAAC,UAACC,CAAC,EAAEC,CAAC;IAAA,OAAKD,CAAC,CAACvC,IAAI,CAACyC,aAAa,CAACD,CAAC,CAACxC,IAAI,CAAC;EAAA,EAAC;AACrD,CAAC;AAzBYuB,OAAA,CAAAC,eAAe,GAAAA,eAAA,C;;;;;;;ACtC5B,wD","file":"docUtils.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 = 68);\n","module.exports = require(\"react\");","import * as React from 'react';\nimport UtilPage from '@splunk/react-docs/UtilPage';\n\n// https://github.com/jsdoc2md/jsdoc-api#synopsis\ninterface JsDoc {\n access?: string;\n classdesc?: string;\n comment: string;\n kind: string;\n longname: string;\n meta: Record<string, unknown>;\n member: string;\n name: string;\n scope: string;\n}\n\nconst sharedSelectors = ['getField', 'getType', 'min', 'max'];\n\nconst formatSidebarItemName = (name: string, className: string): string => {\n return sharedSelectors.find(sharedSelector => name === sharedSelector) ? `${className}#${name}` : name;\n};\n\nconst removePrependedClassName = (longname = ''): string => longname.slice(longname.indexOf('#') + 1);\n\nconst formatDSLSelectorDocs = (docs: JsDoc[]): JsDoc[] =>\n docs.map(doc => ({\n ...doc,\n longname: removePrependedClassName(doc.longname),\n }));\n\nexport const getFormatterClassdesc = (\n formatterDocs: JsDoc[],\n name: string\n): { name: string; markdown: string } => ({\n name,\n markdown: `# ${name}\\n ${formatterDocs.find(doc => doc.name === name && doc.kind === 'class').classdesc}`,\n});\n\nexport const extractDocItems = (\n docs: JsDoc[],\n className: string\n): { name: string; component: (...args: any[]) => any }[] => {\n const classHeaderDoc = docs[0];\n const fileDoc = docs[docs.length - 1];\n const filteredDocs = formatDSLSelectorDocs(docs).filter(\n ({ access, comment }) => access === 'public' && comment\n );\n\n return filteredDocs\n .map(doc => ({\n name: formatSidebarItemName(doc.name, className),\n component: function UtilDoc() {\n // named function so linter doesnt raise react/display-name error\n return (\n <UtilPage\n title={`${className}#${doc.name}`}\n status={1}\n docs={[classHeaderDoc, doc, fileDoc]}\n />\n );\n },\n }))\n .sort((a, b) => a.name.localeCompare(b.name));\n};\n","module.exports = require(\"@splunk/react-docs/UtilPage\");"],"sourceRoot":""}
|