@splunk/visualizations 25.0.0 → 25.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_basic.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_dynamic_color.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_static_color.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_static_color_with_no_seriesColors.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_off.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_unit_metric.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Basic_Map.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET_Dynamic_Coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Static_Coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_Dynamic_Coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Dynamic_coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Result_Limit_Set_To_3.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Restricted_Zoom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Set_Map_tiles.png +0 -0
- package/Area.config.js +26 -1
- package/Area.config.js.map +1 -1
- package/Area.js +49 -23
- package/Area.js.map +1 -1
- package/Bar.config.js +26 -1
- package/Bar.config.js.map +1 -1
- package/Bar.js +49 -23
- package/Bar.js.map +1 -1
- package/Bubble.config.js +26 -1
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +49 -23
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +27 -3
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +73 -48
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +26 -1
- package/Column.config.js.map +1 -1
- package/Column.js +49 -23
- package/Column.js.map +1 -1
- package/Ellipse.config.js +26 -1
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +58 -32
- package/Ellipse.js.map +1 -1
- package/FillerGauge.config.js +27 -2
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +60 -34
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +27 -3
- package/Image.config.js.map +1 -1
- package/Image.js +58 -34
- package/Image.js.map +1 -1
- package/Line.config.js +26 -1
- package/Line.config.js.map +1 -1
- package/Line.js +49 -23
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +26 -1
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +87 -61
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +42 -5
- package/Map.config.js.map +1 -1
- package/Map.js +100 -60
- package/Map.js.map +1 -1
- package/Markdown.config.js +28 -5
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +58 -35
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +31 -7
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +2939 -3022
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +35 -10
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +61 -35
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +32 -8
- package/Pie.config.js.map +1 -1
- package/Pie.js +2242 -2330
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +28 -5
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +72 -48
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +28 -3
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +155 -130
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +30 -5
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +107 -82
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +29 -3
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +47 -22
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +33 -7
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +63 -38
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +2 -2
- package/SingleValueIcon.config.js +31 -5
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +71 -45
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +160 -165
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +112 -87
- package/SingleValueRadial.js.map +1 -1
- package/Table.config.js +31 -6
- package/Table.config.js.map +1 -1
- package/Table.js +249 -224
- package/Table.js.map +1 -1
- package/common/OptionsDoc.js +26 -1
- package/common/OptionsDoc.js.map +1 -1
- package/common/utils/configUtils.js +26 -1
- package/common/utils/configUtils.js.map +1 -1
- package/common/withDashboardViz.js +2 -2
- package/package.json +10 -10
package/common/OptionsDoc.js
CHANGED
|
@@ -1083,7 +1083,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
1083
1083
|
Object.defineProperty(exports, "__esModule", {
|
|
1084
1084
|
value: true
|
|
1085
1085
|
});
|
|
1086
|
-
exports.insertLayout = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
1086
|
+
exports.insertLayout = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
1087
1087
|
|
|
1088
1088
|
var lodash_1 = __webpack_require__(3);
|
|
1089
1089
|
|
|
@@ -1158,8 +1158,10 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
1158
1158
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
1159
1159
|
/**
|
|
1160
1160
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
1161
|
+
* this function also collapse all editor panels
|
|
1161
1162
|
* @param vizConfig a Visualization Config
|
|
1162
1163
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
1164
|
+
* and containing `open: false` for all editor panels in editorConfig
|
|
1163
1165
|
*/
|
|
1164
1166
|
|
|
1165
1167
|
function enhanceConfig(vizConfig) {
|
|
@@ -1169,10 +1171,33 @@ function enhanceConfig(vizConfig) {
|
|
|
1169
1171
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
1170
1172
|
}
|
|
1171
1173
|
|
|
1174
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
1175
|
+
return Object.assign(Object.assign({}, config), {
|
|
1176
|
+
open: false
|
|
1177
|
+
});
|
|
1178
|
+
});
|
|
1172
1179
|
return enhancedConfig;
|
|
1173
1180
|
}
|
|
1174
1181
|
|
|
1175
1182
|
exports.enhanceConfig = enhanceConfig;
|
|
1183
|
+
/**
|
|
1184
|
+
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
1185
|
+
* Created for editor unit tests
|
|
1186
|
+
* @param vizConfig a Visualization Config
|
|
1187
|
+
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
1188
|
+
*/
|
|
1189
|
+
|
|
1190
|
+
function uncollapseEditorConfig(vizConfig) {
|
|
1191
|
+
var editorPanelUncollapsedConfig = vizConfig;
|
|
1192
|
+
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
1193
|
+
return Object.assign(Object.assign({}, config), {
|
|
1194
|
+
open: true
|
|
1195
|
+
});
|
|
1196
|
+
});
|
|
1197
|
+
return editorPanelUncollapsedConfig;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
1176
1201
|
|
|
1177
1202
|
function isDynamicOption(option) {
|
|
1178
1203
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
package/common/OptionsDoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"styled-components\"","webpack:///external \"lodash\"","webpack:///external \"@splunk/react-ui/Heading\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///./.storybook/utils/storybookUtils.ts","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"@splunk/react-ui/Markdown\"","webpack:///external \"lodash/isEmpty\"","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///./src/common/OptionsDoc.jsx","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\""],"names":["Option","styled","OptionName","PairContainer","PairTitle","PairValue","PairValueJSON","PropertiesWrapper","props","PropertiesContainer","PropertiesContent","isOneOfJsonSchema","item","Array","getOrType","res","one","getArrayType","isEmpty","itemType","getType","values","getDefaultValue","defaultValue","JSON","Pair","title","content","T","PropertyItems","isPatternProperty","propsItems","_","array","OptionItem","name","type","desc","enumerable","PropertiesSection","marginLeft","element","PropertiesItem","getPropertiesSection","allProperties","Object","propsInPattern","patternProperties","allPropsItems","p","pType","getOptionDisplayType","enum","pDefault","pEnumerable","getPatternOptions","OptionsDoc","options","description","key","option","mergedOptions","merge","properties","string"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,kC;;;;;;ACAA,uC;;;;;;ACAA,8C;;;;;;ACAA,mC;;;;;;;ACAA,qD;;;;;;;ACAA,kD;;;;;;ACAA,kE;;;;;;ACAA,0D;;;;;;;;;;;;;;;;;ACAA;;AAEA;AA+BA;;;;;;;;;;AAUG;;;AACI,IAAM,iBAAiB,GAAG,SAApB,iBAAoB,CAAC,aAAD;AAAA,SAC7B,aAAa,CAAC,OAAd,CAAsB,KAAtB,EAA6B,EAA7B,EAAiC,KAAjC,CAAuC,IAAvC,EAA6C,KAA7C,CAAmD,CAAnD,CAD6B;AAAA,CAA1B;;AAAM,4BAAiB,iBAAjB;AAGb;;;;AAIG;;AACI,IAAM,oBAAoB,GAAG,SAAvB,oBAA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;AAAA,CAArB;;AAAM,uBAAY,YAAZ,C;;;;;;AC/Mb,sE","file":"OptionsDoc.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 = 51);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"styled-components\");","module.exports = require(\"lodash\");","module.exports = require(\"@splunk/react-ui/Heading\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","import { get, omit, reduce, toNumber, isString } from 'lodash';\nimport { OptionsSchema } from '../../src/common/interfaces/OptionsSchema';\nimport { isDynamicOption } from '../../src/common/utils/configUtils';\n\ninterface ArgTypeControl {\n type: string;\n options?: string[];\n min?: number;\n max?: number;\n}\n\ninterface ArgTypeEntry {\n description?: string;\n control: ArgTypeControl;\n name: string;\n defaultValue?: any;\n type: { required: boolean };\n optionType: string;\n table: {\n type: { summary: string };\n defaultValue?: { summary: any };\n category?: string;\n subcategory?: string;\n disable?: boolean;\n };\n}\n\nexport interface ArgTypes {\n [key: string]: ArgTypeEntry;\n}\n\ntype StoriesList = RegExp | string[];\n\n/**\n * Returns type options from pattern\n * @example\n * // returns ['fixed', 'absolute', 'off']\n * getPatternOptions('\\$(\\w+:)?([^$|:]+?)(\\|[|\\w]+)?\\$|^fixed$|^absolute$|^off$')\n * @example\n * // returns []\n * getPatternOptions('^>.*')\n * @param {string} patternString - visualization option type pattern\n * @return {string[]} array of type options\n */\nexport const getPatternOptions = (patternString): string[] =>\n patternString.replace(/\\$/g, '').split('|^').slice(1);\n\n/**\n * Returns Storybook display type for an option\n * @param {object} option - visualization option\n * @return {string} Storybook display type\n */\nexport const getOptionDisplayType = (option): string => {\n const { oneOf, anyOf, type, enum: en, pattern, items } = option;\n let displayTypes: string[] = [];\n\n // wrap values in quotes only if enum or pattern is string\n const conditionalQuote = type === 'string' ? '\"' : '';\n if (en && Array.isArray(en)) {\n displayTypes = en.map(e => {\n const enumQuote = typeof e === 'string' ? '\"' : '';\n return `${enumQuote}${e}${enumQuote}`;\n });\n } else if (type === 'array' && items) {\n return `${getOptionDisplayType(items)}[]`;\n } else if (anyOf && Array.isArray(anyOf)) {\n return getOptionDisplayType(anyOf[0]);\n } else if (oneOf && Array.isArray(oneOf)) {\n displayTypes = oneOf.map(item => getOptionDisplayType(item));\n } else if (Array.isArray(type)) {\n displayTypes = type;\n } else if (pattern) {\n displayTypes = getPatternOptions(pattern).map(p => `${conditionalQuote}${p}${conditionalQuote}`);\n }\n\n if (displayTypes.length > 0) {\n return `(${displayTypes.join(' | ')})`;\n }\n return type;\n};\n\n/**\n * Returns Storybook control type for an option\n * @param {object} option - visualization option\n * @param {string} optionKey - visualization option key\n * @return {ArgTypeControl} Storybook control object\n */\nexport const getOptionControl = (option, optionKey): ArgTypeControl => {\n const { anyOf } = option;\n const schema = Array.isArray(anyOf) && anyOf.length ? anyOf[0] : option;\n\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n const { maximum, minimum, enum: en } = schema;\n\n const isColorOption = new RegExp(/color/, 'i').test(optionKey) && type !== 'array';\n\n if (isColorOption) {\n return { type: 'color' };\n } else if (en && Array.isArray(en)) {\n return { type: 'select', options: en };\n } else if (anyOf && type === 'string' && anyOf[0].pattern) {\n return { type: 'select', options: getPatternOptions(anyOf[0].pattern) };\n } else if (type === 'number' && (minimum || maximum)) {\n return {\n type: 'range',\n ...(typeof minimum === 'number' && { min: minimum }),\n ...(typeof maximum === 'number' && { max: maximum }),\n };\n } else if (type === 'string') {\n return { type: 'text' };\n }\n\n return { type };\n};\n\n/**\n * platform specific visualization option argTypes\n */\nconst objectTableControl = { control: { type: 'object' } };\nconst disableTableControl = { table: { disable: true } };\nexport const platformOptionArgTypes = {\n context: objectTableControl,\n dataSources: objectTableControl,\n dataSource: disableTableControl,\n options: disableTableControl,\n onEventTrigger: { action: 'eventTrigger', ...disableTableControl },\n hasEventHandlers: disableTableControl,\n};\n\n/**\n * Returns formatted Storybook argTypes for a visualization from its options schema\n * @param {OptionsSchema} options - visualization options\n * @param {string[]} requiredProps - required visualization props\n * @param {boolean} isPlatformViz - indicates if pure or platform visualization\n * @param {string} subcategory - nested property parent option name\n * @return {ArgTypes} Storybook argTypes\n */\nexport const optionsSchemaToArgTypes = ({\n options = {},\n requiredProps = [],\n isPlatformViz = false,\n subcategory = null,\n}: {\n options: OptionsSchema;\n requiredProps: string[];\n isPlatformViz?: boolean;\n subcategory?: string;\n}): ArgTypes => {\n const validObjectTypeOptions = ['lineDashStylesByField', 'seriesColorsByField'];\n let argTypes: ArgTypes = {};\n Object.keys(options).forEach(optionKey => {\n const option = get(options, optionKey);\n if (option.type === 'object' && !validObjectTypeOptions.includes(optionKey)) {\n // do not support controls for patternProperties, only nested properties\n if (option.properties) {\n argTypes = {\n ...argTypes,\n ...optionsSchemaToArgTypes({\n options: option.properties as OptionsSchema,\n isPlatformViz,\n requiredProps,\n subcategory: optionKey,\n }),\n };\n }\n } else {\n const { description, default: optionDefault } = option;\n const optionControl = getOptionControl(option, optionKey);\n const control = isPlatformViz ? { type: 'text' } : optionControl;\n const required = requiredProps.includes(optionKey);\n\n let defaultValue = optionDefault;\n if (!isPlatformViz && isDynamicOption(optionDefault as string)) {\n defaultValue = null;\n }\n\n argTypes[optionKey] = {\n description,\n control,\n name: optionKey,\n defaultValue,\n type: { required },\n optionType: optionControl.type,\n table: {\n type: { summary: getOptionDisplayType(option) },\n defaultValue: { summary: defaultValue },\n ...(subcategory && {\n category: 'Nested Options',\n subcategory,\n }),\n },\n };\n }\n });\n\n if (isPlatformViz) {\n Object.assign(argTypes, platformOptionArgTypes);\n }\n return argTypes;\n};\n\n/**\n * Helper which converts string visualization options to their required type\n * @param {any} value - option values\n * @param {string} expectedType - expected option type\n * @return {any} correctly typed option value\n */\nexport const transformOptionType = (value, expectedType = 'string'): any => {\n const isStringValue = !isDynamicOption(value) && isString(value);\n if (isStringValue && expectedType === 'boolean') return value == 'true';\n else if (isStringValue && expectedType === 'number') return toNumber(value);\n return value;\n};\n\n// stringify these fields for storybook controls' support\nconst FieldsToStringify = [\n 'layers',\n 'center',\n 'legendLabels',\n 'lineDashStylesByField',\n 'seriesColors',\n 'seriesColorsByField',\n];\n\n/**\n * Helper which returns platform visualization options from Storybook controls\n * Utilizes argTypes to determine valid and nested options\n * @param {object} args - visualization story args\n * @param {ArgTypes} argTypes - visualization argTypes\n * @return {object} visualization options\n */\nexport const getOptionsFromArgTypes = (args: Record<string, any>, argTypes: ArgTypes): Record<string, any> =>\n reduce(\n argTypes,\n (accum, val, option) => {\n const subcategory = get(val, 'table.subcategory');\n const { optionType, defaultValue } = argTypes[option];\n let controlledOption = transformOptionType(get(args, option), optionType);\n // filter options from react & json if set to default value or is undefined\n if (optionType && controlledOption != null && controlledOption !== defaultValue) {\n // parse the value if option is stringified as part of flattenVizOptions\n if (FieldsToStringify.includes(option)) {\n try {\n controlledOption = JSON.parse(controlledOption);\n } catch (e) {\n controlledOption = null;\n }\n }\n if (subcategory) {\n if (!accum[subcategory]) accum[subcategory] = {};\n accum[subcategory][option] = controlledOption;\n } else accum[option] = controlledOption;\n }\n return accum;\n },\n { ...omit(args.options, Object.keys(argTypes)) }\n );\n\n/**\n * Helper which flattens objects single depth level\n * @param {object} options - visualization options object\n * @return {object} flattened visualization options\n */\nexport const flattenVizOptions = (options: Record<string, any>): Record<string, any> => {\n const nonFlattenOptions = new Set(['y2Fields', 'overlayFields', 'gaugeRanges']);\n\n return reduce(\n options,\n (accum, val, option) => {\n if (!platformOptionArgTypes[option]) {\n if (typeof val === 'object' && FieldsToStringify.includes(option))\n accum[option] = JSON.stringify(val);\n else if (typeof val === 'object' && !nonFlattenOptions.has(option))\n accum = { ...accum, ...val };\n else accum[option] = val;\n }\n return accum;\n },\n {}\n );\n};\n/**\n * Returns value based on Storybook publishing status\n * @param {T} publishedStories - stories to include in published Storybook\n * @param {T} localStories - stories to include in local Storybook\n * @return {T} one of the two params\n */\nexport const getStoriesToInclude = <T>(publishedStories: T, localStories: T): T =>\n process.env.STORYBOOK_PUBLISH ? publishedStories : localStories;\n\n/**\n * Returns component level stories to include, defaults to innclude all stories\n * @param {StoriesList} stories - stories to include in published Storybook\n * @return {object} CSF includeStories config\n */\nexport const componentStoriesToInclude = (stories: StoriesList): object =>\n getStoriesToInclude({ includeStories: stories }, {});\n","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"@splunk/react-ui/Markdown\");","module.exports = require(\"lodash/isEmpty\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n","import React from 'react';\nimport T from 'prop-types';\nimport isEmpty from 'lodash/isEmpty';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Heading from '@splunk/react-ui/Heading';\nimport Markdown from '@splunk/react-ui/Markdown';\nimport styled from 'styled-components';\nimport { merge } from 'lodash';\nimport { getOptionDisplayType, getPatternOptions } from '../../.storybook/utils/storybookUtils';\n\nconst Option = styled.div`\n margin-top: 20px;\n`;\nconst OptionName = styled.div`\n color: #5ca300;\n padding-bottom: 5px;\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`;\n\nconst PairValue = styled.span`\n font-family: 'Splunk Platform Mono', 'monospace';\n white-space: pre;\n`;\n\nconst PairValueJSON = styled.div`\n margin-left: 80px;\n pre {\n margin: 0;\n }\n code {\n font-size: 12px;\n font-family: 'Splunk Platform Mono', 'monospace';\n }\n`;\n\nconst PropertiesWrapper = styled.div`\n margin-left: ${props => (props.isPatternProperty ? 0 : 40)}px;\n margin-top: 20px;\n`;\n\nconst PropertiesContainer = styled.div`\n margin-left: ${props => (props.isPatternProperty ? 40 : 0)}px;\n margin-top: 10px;\n`;\n\nconst PropertiesContent = styled.div`\n margin-left: ${props => (props.isPatternProperty ? 40 : 0)}px;\n`;\n\n/**\n * @method isOneOfJsonSchema\n * @param {object} item\n * @returns {boolean}\n */\nconst isOneOfJsonSchema = item => item.oneOf && Array.isArray(item.oneOf);\n\n/**\n * get Or type as string\n * @method getOrType\n * @param {object} item\n * @param {string} res\n * @returns {string} res eg: (string | number)\n */\nconst getOrType = item => {\n let res = '';\n\n if (isOneOfJsonSchema(item)) {\n res = item.oneOf\n .map(one => {\n if (one.type !== 'array') {\n return one.type;\n }\n // eslint-disable-next-line no-use-before-define\n return getArrayType(one, '');\n })\n .join(' | ');\n } else if (Array.isArray(item.type)) {\n if (isEmpty(item.default)) {\n return item.type.join(' | ');\n }\n\n res = item.type.filter(itemType => itemType !== 'string').join(' | ');\n res += ' | ';\n res += `\"${item.default}\"`;\n }\n\n return res;\n};\n\n/**\n * get the array type as string\n * @method getArrayType\n * @param {object} item\n * @param {string} res\n * @returns {string} res eg: arrayOf(arrayOf(string | number | arrayOf(string | number)))\n */\nconst getArrayType = (item, res = '') => {\n if (item.type !== 'array') {\n if (Array.isArray(item.type) || isOneOfJsonSchema(item)) {\n return getOrType(item);\n }\n\n return item.type;\n }\n\n if (item.type === 'array') {\n res += 'arrayOf('; // eslint-disable-line no-param-reassign\n }\n res += getArrayType(item.items, ''); // eslint-disable-line no-param-reassign\n res += ')'; // eslint-disable-line no-param-reassign\n return res;\n};\n\n/**\n * get the type of this option item\n * @method getType\n * @param {ojbect} item option item\n * @returns {string} type\n */\nexport const getType = item => {\n if (isOneOfJsonSchema(item)) {\n return `oneOf(${getOrType(item)})`;\n }\n if (item.enum && Array.isArray(item.enum)) {\n const values =\n !isEmpty(item.enum) && typeof item.enum[0] === 'string'\n ? item.enum.map(v => `\"${v}\"`).join(', ')\n : item.enum.join(', ');\n\n return `oneOf([${values}])`;\n }\n\n if (Array.isArray(item.type)) {\n return getOrType(item);\n }\n\n if (item.type === 'array') {\n if ('items' in item) {\n return `arrayOf(${getType(item.items)})`;\n }\n return 'array';\n }\n return item.type;\n};\n\n/**\n * get the default value as string\n * @method getDefaultValue\n * @param {object | boolean | number | string} defaultValue\n * @returns {string | object[]} default value\n */\nconst getDefaultValue = defaultValue => {\n if (typeof defaultValue === 'boolean' || typeof defaultValue === 'number') {\n return defaultValue.toString();\n }\n if (Array.isArray(defaultValue)) {\n if (defaultValue.length > 1 && typeof defaultValue[0] === 'object') {\n // return the array only if the defaultValue is an object array\n return defaultValue;\n }\n const values = defaultValue.map(v => JSON.stringify(v)).join(', ');\n return `[${values}]`;\n }\n return defaultValue;\n};\n\nconst Pair = ({ title, content }) => (\n <PairContainer>\n <PairTitle>{`${title}:`}</PairTitle>\n {Array.isArray(content) ? (\n <PairValueJSON>\n <pre>\n <code>{JSON.stringify(content, null, 2)}</code>\n </pre>\n </PairValueJSON>\n ) : (\n <PairValue>{content}</PairValue>\n )}\n </PairContainer>\n);\n\nPair.propTypes = {\n title: T.string,\n content: T.oneOfType([T.string, T.arrayOf(T.object)]),\n};\n\nconst PropertyItems = ({ isPatternProperty = false, propsItems }) => (\n <PropertiesContainer isPatternProperty={isPatternProperty}>\n {isPatternProperty ? <PairTitle>{_('[fieldName]:')}</PairTitle> : null}\n <PropertiesContent isPatternProperty={isPatternProperty}>{propsItems}</PropertiesContent>\n </PropertiesContainer>\n);\n\nPropertyItems.propTypes = {\n isPatternProperty: T.bool,\n propsItems: T.array,\n};\n\nconst OptionItem = ({ name, type, desc, defaultValue, enumerable, PropertiesSection }) => (\n <Option>\n <OptionName>{name}</OptionName>\n {desc ? <Markdown style={{ marginLeft: 40 }} text={desc} /> : null}\n <Pair title={_('Type')} content={type} />\n {enumerable?.length > 0 && (\n <Pair\n title={_('oneOf')}\n content={`(${enumerable\n .map(\n entry =>\n `${typeof entry === 'string' ? '\"' : ''}${entry}${\n typeof entry === 'string' ? '\"' : ''\n }`\n )\n .join(' | ')})`}\n />\n )}\n {defaultValue && <Pair title={_('Default')} content={defaultValue} />}\n {PropertiesSection}\n </Option>\n);\n\nOptionItem.propTypes = {\n name: T.string,\n type: T.string,\n desc: T.string,\n enumerable: T.arrayOf(T.oneOfType([T.string, T.number])),\n defaultValue: T.oneOfType([T.string, T.arrayOf(T.object)]),\n PropertiesSection: T.element,\n};\n\nOptionItem.default = {\n PropertiesItem: null,\n};\n\nconst getPropertiesSection = (properties, patternProperties) => {\n let allProperties = [];\n let isPatternProperty = false;\n\n // the properties either comes from property field of the option schema item\n // or from the property field of each patternProperties of the option schema item\n // can check table tableFormat and columnFormat as examples\n if (!isEmpty(properties)) {\n allProperties = [properties];\n } else if (!isEmpty(patternProperties)) {\n Object.keys(patternProperties).forEach(patternKey => {\n const propsInPattern = patternProperties[patternKey].properties;\n if (propsInPattern) {\n allProperties.push(propsInPattern);\n }\n });\n\n isPatternProperty = true;\n }\n\n if (allProperties.length) {\n const allPropsItems = allProperties.map(props => {\n const propsItems = Object.keys(props).map(pKey => {\n const p = props[pKey];\n let pType = p.anyOf?.[0]\n ? getOptionDisplayType({ ...p.anyOf?.[0], enum: p.enum })\n : getOptionDisplayType({ ...p, enum: p.enum });\n const pDefault = getDefaultValue(p.default);\n\n let pEnumerable;\n // get nested oneOf property listing\n if (typeof p.anyOf?.[0]?.pattern === 'string') {\n pEnumerable = getPatternOptions(p.anyOf[0].pattern);\n } else if (p.anyOf?.[0]?.items?.enum?.length > 0) {\n // quick fix for nested `columnFormat` enumerables that replaces enums within brackets with raw JS types\n pType = pType.replace(/\\((.+?)\\)/g, 'string');\n pEnumerable = p.anyOf[0].items.enum;\n } else if (p.anyOf?.[0]?.items?.items?.enum?.length > 0) {\n // quick fix for nested `tableFormat` enumerables that replaces enums within brackets with raw JS types\n pType = pType.replace(/\\((.+?)\\)/g, 'string');\n pEnumerable = p.anyOf[0].items.items.enum;\n } else if (p.enum) {\n pEnumerable = p.enum;\n }\n\n // use the JS types (e.g. string, number) of the nested property if the nested property is an enumerable\n if (pEnumerable?.length) {\n pType = p.anyOf?.[0]?.type !== 'array' ? p.anyOf?.[0]?.type : pType;\n if (Array.isArray(pType)) {\n pType = pType.join(' | ');\n }\n }\n\n return (\n <OptionItem\n key={pKey}\n name={pKey}\n type={pType}\n enumerable={pEnumerable}\n desc={p.description}\n defaultValue={pDefault}\n />\n );\n });\n return (\n <PropertyItems\n key={propsItems}\n isPatternProperty={isPatternProperty}\n propsItems={propsItems}\n />\n );\n });\n\n return <PropertiesWrapper isPatternProperty={isPatternProperty}>{allPropsItems}</PropertiesWrapper>;\n }\n return null;\n};\n\nconst OptionsDoc = ({ options, description }) => (\n <div>\n {options.length === 0 ? (\n <Heading level={4}> No Options</Heading>\n ) : (\n <Heading level={4}>Options</Heading>\n )}\n {description && <div>{description}</div>}\n {Object.entries(options).map(([key, item]) => {\n let type;\n let enumerable = [];\n let PropertiesSection = null;\n\n // get oneOf property listing\n if (typeof item.anyOf?.[0]?.pattern === 'string') {\n enumerable = getPatternOptions(item.anyOf[0].pattern);\n } else if (item.enum) {\n enumerable = item.enum;\n }\n\n // get the nested options inside {option}.items.anyof. e.g. 'layers' in Map\n if (item.anyOf?.[0]?.type === 'array' && 'anyOf' in item.anyOf?.[0]?.items) {\n type = getOptionDisplayType(item);\n const { patternProperties } = item;\n // merge the 3 objects together instead of showing the longest options in the array\n const option = item.anyOf?.[0]?.items?.anyOf;\n const mergedOptions = option.reduce((prev, next) => merge(prev, next), {});\n const { properties } = mergedOptions;\n PropertiesSection = getPropertiesSection(properties, patternProperties);\n return (\n <OptionItem\n key={key}\n name={key}\n type={type}\n enumerable={enumerable}\n desc={item.description}\n PropertiesSection={PropertiesSection}\n />\n );\n }\n\n if (item.type === 'object') {\n // get properties for object type\n type = item.type;\n const { properties } = item;\n const { patternProperties } = item;\n PropertiesSection = getPropertiesSection(properties, patternProperties);\n } else if (enumerable?.length) {\n // use the JS types (e.g. string, number) of the property if the property is an enumerable\n type = item.anyOf?.[0]?.type;\n if (Array.isArray(type)) {\n type = type.join(' | ');\n }\n } else {\n type = getOptionDisplayType({ ...item.anyOf[0], enum: item.enum });\n }\n\n return (\n <OptionItem\n key={key}\n name={key}\n // item.anyOf in the config.ts is a tuple which holds [{ type, pattern, items }, { type, pattern: DYNAMIC_OPTIONS_PATTERN }]\n type={type}\n enumerable={enumerable}\n desc={item.description}\n defaultValue={getDefaultValue(item.default)}\n PropertiesSection={PropertiesSection}\n />\n );\n })}\n </div>\n);\n\nOptionsDoc.propTypes = {\n options: T.object.isRequired,\n description: T.string,\n};\n\nexport default OptionsDoc;\n","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig } from '../interfaces/Editor';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = vizConfig;\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n return enhancedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n isDynamicOption,\n getInitialPreset,\n generatePrecisionValues,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"prop-types\"","webpack:///external \"styled-components\"","webpack:///external \"lodash\"","webpack:///external \"@splunk/react-ui/Heading\"","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///./.storybook/utils/storybookUtils.ts","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"@splunk/react-ui/Markdown\"","webpack:///external \"lodash/isEmpty\"","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///./src/common/OptionsDoc.jsx","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\""],"names":["Option","styled","OptionName","PairContainer","PairTitle","PairValue","PairValueJSON","PropertiesWrapper","props","PropertiesContainer","PropertiesContent","isOneOfJsonSchema","item","Array","getOrType","res","one","getArrayType","isEmpty","itemType","getType","values","getDefaultValue","defaultValue","JSON","Pair","title","content","T","PropertyItems","isPatternProperty","propsItems","_","array","OptionItem","name","type","desc","enumerable","PropertiesSection","marginLeft","element","PropertiesItem","getPropertiesSection","allProperties","Object","propsInPattern","patternProperties","allPropsItems","p","pType","getOptionDisplayType","enum","pDefault","pEnumerable","getPatternOptions","OptionsDoc","options","description","key","option","mergedOptions","merge","properties","string"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QA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ptionsDoc.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 = 51);\n","module.exports = require(\"react\");","module.exports = require(\"prop-types\");","module.exports = require(\"styled-components\");","module.exports = require(\"lodash\");","module.exports = require(\"@splunk/react-ui/Heading\");","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","import { get, omit, reduce, toNumber, isString } from 'lodash';\nimport { OptionsSchema } from '../../src/common/interfaces/OptionsSchema';\nimport { isDynamicOption } from '../../src/common/utils/configUtils';\n\ninterface ArgTypeControl {\n type: string;\n options?: string[];\n min?: number;\n max?: number;\n}\n\ninterface ArgTypeEntry {\n description?: string;\n control: ArgTypeControl;\n name: string;\n defaultValue?: any;\n type: { required: boolean };\n optionType: string;\n table: {\n type: { summary: string };\n defaultValue?: { summary: any };\n category?: string;\n subcategory?: string;\n disable?: boolean;\n };\n}\n\nexport interface ArgTypes {\n [key: string]: ArgTypeEntry;\n}\n\ntype StoriesList = RegExp | string[];\n\n/**\n * Returns type options from pattern\n * @example\n * // returns ['fixed', 'absolute', 'off']\n * getPatternOptions('\\$(\\w+:)?([^$|:]+?)(\\|[|\\w]+)?\\$|^fixed$|^absolute$|^off$')\n * @example\n * // returns []\n * getPatternOptions('^>.*')\n * @param {string} patternString - visualization option type pattern\n * @return {string[]} array of type options\n */\nexport const getPatternOptions = (patternString): string[] =>\n patternString.replace(/\\$/g, '').split('|^').slice(1);\n\n/**\n * Returns Storybook display type for an option\n * @param {object} option - visualization option\n * @return {string} Storybook display type\n */\nexport const getOptionDisplayType = (option): string => {\n const { oneOf, anyOf, type, enum: en, pattern, items } = option;\n let displayTypes: string[] = [];\n\n // wrap values in quotes only if enum or pattern is string\n const conditionalQuote = type === 'string' ? '\"' : '';\n if (en && Array.isArray(en)) {\n displayTypes = en.map(e => {\n const enumQuote = typeof e === 'string' ? '\"' : '';\n return `${enumQuote}${e}${enumQuote}`;\n });\n } else if (type === 'array' && items) {\n return `${getOptionDisplayType(items)}[]`;\n } else if (anyOf && Array.isArray(anyOf)) {\n return getOptionDisplayType(anyOf[0]);\n } else if (oneOf && Array.isArray(oneOf)) {\n displayTypes = oneOf.map(item => getOptionDisplayType(item));\n } else if (Array.isArray(type)) {\n displayTypes = type;\n } else if (pattern) {\n displayTypes = getPatternOptions(pattern).map(p => `${conditionalQuote}${p}${conditionalQuote}`);\n }\n\n if (displayTypes.length > 0) {\n return `(${displayTypes.join(' | ')})`;\n }\n return type;\n};\n\n/**\n * Returns Storybook control type for an option\n * @param {object} option - visualization option\n * @param {string} optionKey - visualization option key\n * @return {ArgTypeControl} Storybook control object\n */\nexport const getOptionControl = (option, optionKey): ArgTypeControl => {\n const { anyOf } = option;\n const schema = Array.isArray(anyOf) && anyOf.length ? anyOf[0] : option;\n\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;\n const { maximum, minimum, enum: en } = schema;\n\n const isColorOption = new RegExp(/color/, 'i').test(optionKey) && type !== 'array';\n\n if (isColorOption) {\n return { type: 'color' };\n } else if (en && Array.isArray(en)) {\n return { type: 'select', options: en };\n } else if (anyOf && type === 'string' && anyOf[0].pattern) {\n return { type: 'select', options: getPatternOptions(anyOf[0].pattern) };\n } else if (type === 'number' && (minimum || maximum)) {\n return {\n type: 'range',\n ...(typeof minimum === 'number' && { min: minimum }),\n ...(typeof maximum === 'number' && { max: maximum }),\n };\n } else if (type === 'string') {\n return { type: 'text' };\n }\n\n return { type };\n};\n\n/**\n * platform specific visualization option argTypes\n */\nconst objectTableControl = { control: { type: 'object' } };\nconst disableTableControl = { table: { disable: true } };\nexport const platformOptionArgTypes = {\n context: objectTableControl,\n dataSources: objectTableControl,\n dataSource: disableTableControl,\n options: disableTableControl,\n onEventTrigger: { action: 'eventTrigger', ...disableTableControl },\n hasEventHandlers: disableTableControl,\n};\n\n/**\n * Returns formatted Storybook argTypes for a visualization from its options schema\n * @param {OptionsSchema} options - visualization options\n * @param {string[]} requiredProps - required visualization props\n * @param {boolean} isPlatformViz - indicates if pure or platform visualization\n * @param {string} subcategory - nested property parent option name\n * @return {ArgTypes} Storybook argTypes\n */\nexport const optionsSchemaToArgTypes = ({\n options = {},\n requiredProps = [],\n isPlatformViz = false,\n subcategory = null,\n}: {\n options: OptionsSchema;\n requiredProps: string[];\n isPlatformViz?: boolean;\n subcategory?: string;\n}): ArgTypes => {\n const validObjectTypeOptions = ['lineDashStylesByField', 'seriesColorsByField'];\n let argTypes: ArgTypes = {};\n Object.keys(options).forEach(optionKey => {\n const option = get(options, optionKey);\n if (option.type === 'object' && !validObjectTypeOptions.includes(optionKey)) {\n // do not support controls for patternProperties, only nested properties\n if (option.properties) {\n argTypes = {\n ...argTypes,\n ...optionsSchemaToArgTypes({\n options: option.properties as OptionsSchema,\n isPlatformViz,\n requiredProps,\n subcategory: optionKey,\n }),\n };\n }\n } else {\n const { description, default: optionDefault } = option;\n const optionControl = getOptionControl(option, optionKey);\n const control = isPlatformViz ? { type: 'text' } : optionControl;\n const required = requiredProps.includes(optionKey);\n\n let defaultValue = optionDefault;\n if (!isPlatformViz && isDynamicOption(optionDefault as string)) {\n defaultValue = null;\n }\n\n argTypes[optionKey] = {\n description,\n control,\n name: optionKey,\n defaultValue,\n type: { required },\n optionType: optionControl.type,\n table: {\n type: { summary: getOptionDisplayType(option) },\n defaultValue: { summary: defaultValue },\n ...(subcategory && {\n category: 'Nested Options',\n subcategory,\n }),\n },\n };\n }\n });\n\n if (isPlatformViz) {\n Object.assign(argTypes, platformOptionArgTypes);\n }\n return argTypes;\n};\n\n/**\n * Helper which converts string visualization options to their required type\n * @param {any} value - option values\n * @param {string} expectedType - expected option type\n * @return {any} correctly typed option value\n */\nexport const transformOptionType = (value, expectedType = 'string'): any => {\n const isStringValue = !isDynamicOption(value) && isString(value);\n if (isStringValue && expectedType === 'boolean') return value == 'true';\n else if (isStringValue && expectedType === 'number') return toNumber(value);\n return value;\n};\n\n// stringify these fields for storybook controls' support\nconst FieldsToStringify = [\n 'layers',\n 'center',\n 'legendLabels',\n 'lineDashStylesByField',\n 'seriesColors',\n 'seriesColorsByField',\n];\n\n/**\n * Helper which returns platform visualization options from Storybook controls\n * Utilizes argTypes to determine valid and nested options\n * @param {object} args - visualization story args\n * @param {ArgTypes} argTypes - visualization argTypes\n * @return {object} visualization options\n */\nexport const getOptionsFromArgTypes = (args: Record<string, any>, argTypes: ArgTypes): Record<string, any> =>\n reduce(\n argTypes,\n (accum, val, option) => {\n const subcategory = get(val, 'table.subcategory');\n const { optionType, defaultValue } = argTypes[option];\n let controlledOption = transformOptionType(get(args, option), optionType);\n // filter options from react & json if set to default value or is undefined\n if (optionType && controlledOption != null && controlledOption !== defaultValue) {\n // parse the value if option is stringified as part of flattenVizOptions\n if (FieldsToStringify.includes(option)) {\n try {\n controlledOption = JSON.parse(controlledOption);\n } catch (e) {\n controlledOption = null;\n }\n }\n if (subcategory) {\n if (!accum[subcategory]) accum[subcategory] = {};\n accum[subcategory][option] = controlledOption;\n } else accum[option] = controlledOption;\n }\n return accum;\n },\n { ...omit(args.options, Object.keys(argTypes)) }\n );\n\n/**\n * Helper which flattens objects single depth level\n * @param {object} options - visualization options object\n * @return {object} flattened visualization options\n */\nexport const flattenVizOptions = (options: Record<string, any>): Record<string, any> => {\n const nonFlattenOptions = new Set(['y2Fields', 'overlayFields', 'gaugeRanges']);\n\n return reduce(\n options,\n (accum, val, option) => {\n if (!platformOptionArgTypes[option]) {\n if (typeof val === 'object' && FieldsToStringify.includes(option))\n accum[option] = JSON.stringify(val);\n else if (typeof val === 'object' && !nonFlattenOptions.has(option))\n accum = { ...accum, ...val };\n else accum[option] = val;\n }\n return accum;\n },\n {}\n );\n};\n/**\n * Returns value based on Storybook publishing status\n * @param {T} publishedStories - stories to include in published Storybook\n * @param {T} localStories - stories to include in local Storybook\n * @return {T} one of the two params\n */\nexport const getStoriesToInclude = <T>(publishedStories: T, localStories: T): T =>\n process.env.STORYBOOK_PUBLISH ? publishedStories : localStories;\n\n/**\n * Returns component level stories to include, defaults to innclude all stories\n * @param {StoriesList} stories - stories to include in published Storybook\n * @return {object} CSF includeStories config\n */\nexport const componentStoriesToInclude = (stories: StoriesList): object =>\n getStoriesToInclude({ includeStories: stories }, {});\n","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"@splunk/react-ui/Markdown\");","module.exports = require(\"lodash/isEmpty\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n","import React from 'react';\nimport T from 'prop-types';\nimport isEmpty from 'lodash/isEmpty';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport Heading from '@splunk/react-ui/Heading';\nimport Markdown from '@splunk/react-ui/Markdown';\nimport styled from 'styled-components';\nimport { merge } from 'lodash';\nimport { getOptionDisplayType, getPatternOptions } from '../../.storybook/utils/storybookUtils';\n\nconst Option = styled.div`\n margin-top: 20px;\n`;\nconst OptionName = styled.div`\n color: #5ca300;\n padding-bottom: 5px;\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`;\n\nconst PairValue = styled.span`\n font-family: 'Splunk Platform Mono', 'monospace';\n white-space: pre;\n`;\n\nconst PairValueJSON = styled.div`\n margin-left: 80px;\n pre {\n margin: 0;\n }\n code {\n font-size: 12px;\n font-family: 'Splunk Platform Mono', 'monospace';\n }\n`;\n\nconst PropertiesWrapper = styled.div`\n margin-left: ${props => (props.isPatternProperty ? 0 : 40)}px;\n margin-top: 20px;\n`;\n\nconst PropertiesContainer = styled.div`\n margin-left: ${props => (props.isPatternProperty ? 40 : 0)}px;\n margin-top: 10px;\n`;\n\nconst PropertiesContent = styled.div`\n margin-left: ${props => (props.isPatternProperty ? 40 : 0)}px;\n`;\n\n/**\n * @method isOneOfJsonSchema\n * @param {object} item\n * @returns {boolean}\n */\nconst isOneOfJsonSchema = item => item.oneOf && Array.isArray(item.oneOf);\n\n/**\n * get Or type as string\n * @method getOrType\n * @param {object} item\n * @param {string} res\n * @returns {string} res eg: (string | number)\n */\nconst getOrType = item => {\n let res = '';\n\n if (isOneOfJsonSchema(item)) {\n res = item.oneOf\n .map(one => {\n if (one.type !== 'array') {\n return one.type;\n }\n // eslint-disable-next-line no-use-before-define\n return getArrayType(one, '');\n })\n .join(' | ');\n } else if (Array.isArray(item.type)) {\n if (isEmpty(item.default)) {\n return item.type.join(' | ');\n }\n\n res = item.type.filter(itemType => itemType !== 'string').join(' | ');\n res += ' | ';\n res += `\"${item.default}\"`;\n }\n\n return res;\n};\n\n/**\n * get the array type as string\n * @method getArrayType\n * @param {object} item\n * @param {string} res\n * @returns {string} res eg: arrayOf(arrayOf(string | number | arrayOf(string | number)))\n */\nconst getArrayType = (item, res = '') => {\n if (item.type !== 'array') {\n if (Array.isArray(item.type) || isOneOfJsonSchema(item)) {\n return getOrType(item);\n }\n\n return item.type;\n }\n\n if (item.type === 'array') {\n res += 'arrayOf('; // eslint-disable-line no-param-reassign\n }\n res += getArrayType(item.items, ''); // eslint-disable-line no-param-reassign\n res += ')'; // eslint-disable-line no-param-reassign\n return res;\n};\n\n/**\n * get the type of this option item\n * @method getType\n * @param {ojbect} item option item\n * @returns {string} type\n */\nexport const getType = item => {\n if (isOneOfJsonSchema(item)) {\n return `oneOf(${getOrType(item)})`;\n }\n if (item.enum && Array.isArray(item.enum)) {\n const values =\n !isEmpty(item.enum) && typeof item.enum[0] === 'string'\n ? item.enum.map(v => `\"${v}\"`).join(', ')\n : item.enum.join(', ');\n\n return `oneOf([${values}])`;\n }\n\n if (Array.isArray(item.type)) {\n return getOrType(item);\n }\n\n if (item.type === 'array') {\n if ('items' in item) {\n return `arrayOf(${getType(item.items)})`;\n }\n return 'array';\n }\n return item.type;\n};\n\n/**\n * get the default value as string\n * @method getDefaultValue\n * @param {object | boolean | number | string} defaultValue\n * @returns {string | object[]} default value\n */\nconst getDefaultValue = defaultValue => {\n if (typeof defaultValue === 'boolean' || typeof defaultValue === 'number') {\n return defaultValue.toString();\n }\n if (Array.isArray(defaultValue)) {\n if (defaultValue.length > 1 && typeof defaultValue[0] === 'object') {\n // return the array only if the defaultValue is an object array\n return defaultValue;\n }\n const values = defaultValue.map(v => JSON.stringify(v)).join(', ');\n return `[${values}]`;\n }\n return defaultValue;\n};\n\nconst Pair = ({ title, content }) => (\n <PairContainer>\n <PairTitle>{`${title}:`}</PairTitle>\n {Array.isArray(content) ? (\n <PairValueJSON>\n <pre>\n <code>{JSON.stringify(content, null, 2)}</code>\n </pre>\n </PairValueJSON>\n ) : (\n <PairValue>{content}</PairValue>\n )}\n </PairContainer>\n);\n\nPair.propTypes = {\n title: T.string,\n content: T.oneOfType([T.string, T.arrayOf(T.object)]),\n};\n\nconst PropertyItems = ({ isPatternProperty = false, propsItems }) => (\n <PropertiesContainer isPatternProperty={isPatternProperty}>\n {isPatternProperty ? <PairTitle>{_('[fieldName]:')}</PairTitle> : null}\n <PropertiesContent isPatternProperty={isPatternProperty}>{propsItems}</PropertiesContent>\n </PropertiesContainer>\n);\n\nPropertyItems.propTypes = {\n isPatternProperty: T.bool,\n propsItems: T.array,\n};\n\nconst OptionItem = ({ name, type, desc, defaultValue, enumerable, PropertiesSection }) => (\n <Option>\n <OptionName>{name}</OptionName>\n {desc ? <Markdown style={{ marginLeft: 40 }} text={desc} /> : null}\n <Pair title={_('Type')} content={type} />\n {enumerable?.length > 0 && (\n <Pair\n title={_('oneOf')}\n content={`(${enumerable\n .map(\n entry =>\n `${typeof entry === 'string' ? '\"' : ''}${entry}${\n typeof entry === 'string' ? '\"' : ''\n }`\n )\n .join(' | ')})`}\n />\n )}\n {defaultValue && <Pair title={_('Default')} content={defaultValue} />}\n {PropertiesSection}\n </Option>\n);\n\nOptionItem.propTypes = {\n name: T.string,\n type: T.string,\n desc: T.string,\n enumerable: T.arrayOf(T.oneOfType([T.string, T.number])),\n defaultValue: T.oneOfType([T.string, T.arrayOf(T.object)]),\n PropertiesSection: T.element,\n};\n\nOptionItem.default = {\n PropertiesItem: null,\n};\n\nconst getPropertiesSection = (properties, patternProperties) => {\n let allProperties = [];\n let isPatternProperty = false;\n\n // the properties either comes from property field of the option schema item\n // or from the property field of each patternProperties of the option schema item\n // can check table tableFormat and columnFormat as examples\n if (!isEmpty(properties)) {\n allProperties = [properties];\n } else if (!isEmpty(patternProperties)) {\n Object.keys(patternProperties).forEach(patternKey => {\n const propsInPattern = patternProperties[patternKey].properties;\n if (propsInPattern) {\n allProperties.push(propsInPattern);\n }\n });\n\n isPatternProperty = true;\n }\n\n if (allProperties.length) {\n const allPropsItems = allProperties.map(props => {\n const propsItems = Object.keys(props).map(pKey => {\n const p = props[pKey];\n let pType = p.anyOf?.[0]\n ? getOptionDisplayType({ ...p.anyOf?.[0], enum: p.enum })\n : getOptionDisplayType({ ...p, enum: p.enum });\n const pDefault = getDefaultValue(p.default);\n\n let pEnumerable;\n // get nested oneOf property listing\n if (typeof p.anyOf?.[0]?.pattern === 'string') {\n pEnumerable = getPatternOptions(p.anyOf[0].pattern);\n } else if (p.anyOf?.[0]?.items?.enum?.length > 0) {\n // quick fix for nested `columnFormat` enumerables that replaces enums within brackets with raw JS types\n pType = pType.replace(/\\((.+?)\\)/g, 'string');\n pEnumerable = p.anyOf[0].items.enum;\n } else if (p.anyOf?.[0]?.items?.items?.enum?.length > 0) {\n // quick fix for nested `tableFormat` enumerables that replaces enums within brackets with raw JS types\n pType = pType.replace(/\\((.+?)\\)/g, 'string');\n pEnumerable = p.anyOf[0].items.items.enum;\n } else if (p.enum) {\n pEnumerable = p.enum;\n }\n\n // use the JS types (e.g. string, number) of the nested property if the nested property is an enumerable\n if (pEnumerable?.length) {\n pType = p.anyOf?.[0]?.type !== 'array' ? p.anyOf?.[0]?.type : pType;\n if (Array.isArray(pType)) {\n pType = pType.join(' | ');\n }\n }\n\n return (\n <OptionItem\n key={pKey}\n name={pKey}\n type={pType}\n enumerable={pEnumerable}\n desc={p.description}\n defaultValue={pDefault}\n />\n );\n });\n return (\n <PropertyItems\n key={propsItems}\n isPatternProperty={isPatternProperty}\n propsItems={propsItems}\n />\n );\n });\n\n return <PropertiesWrapper isPatternProperty={isPatternProperty}>{allPropsItems}</PropertiesWrapper>;\n }\n return null;\n};\n\nconst OptionsDoc = ({ options, description }) => (\n <div>\n {options.length === 0 ? (\n <Heading level={4}> No Options</Heading>\n ) : (\n <Heading level={4}>Options</Heading>\n )}\n {description && <div>{description}</div>}\n {Object.entries(options).map(([key, item]) => {\n let type;\n let enumerable = [];\n let PropertiesSection = null;\n\n // get oneOf property listing\n if (typeof item.anyOf?.[0]?.pattern === 'string') {\n enumerable = getPatternOptions(item.anyOf[0].pattern);\n } else if (item.enum) {\n enumerable = item.enum;\n }\n\n // get the nested options inside {option}.items.anyof. e.g. 'layers' in Map\n if (item.anyOf?.[0]?.type === 'array' && 'anyOf' in item.anyOf?.[0]?.items) {\n type = getOptionDisplayType(item);\n const { patternProperties } = item;\n // merge the 3 objects together instead of showing the longest options in the array\n const option = item.anyOf?.[0]?.items?.anyOf;\n const mergedOptions = option.reduce((prev, next) => merge(prev, next), {});\n const { properties } = mergedOptions;\n PropertiesSection = getPropertiesSection(properties, patternProperties);\n return (\n <OptionItem\n key={key}\n name={key}\n type={type}\n enumerable={enumerable}\n desc={item.description}\n PropertiesSection={PropertiesSection}\n />\n );\n }\n\n if (item.type === 'object') {\n // get properties for object type\n type = item.type;\n const { properties } = item;\n const { patternProperties } = item;\n PropertiesSection = getPropertiesSection(properties, patternProperties);\n } else if (enumerable?.length) {\n // use the JS types (e.g. string, number) of the property if the property is an enumerable\n type = item.anyOf?.[0]?.type;\n if (Array.isArray(type)) {\n type = type.join(' | ');\n }\n } else {\n type = getOptionDisplayType({ ...item.anyOf[0], enum: item.enum });\n }\n\n return (\n <OptionItem\n key={key}\n name={key}\n // item.anyOf in the config.ts is a tuple which holds [{ type, pattern, items }, { type, pattern: DYNAMIC_OPTIONS_PATTERN }]\n type={type}\n enumerable={enumerable}\n desc={item.description}\n defaultValue={getDefaultValue(item.default)}\n PropertiesSection={PropertiesSection}\n />\n );\n })}\n </div>\n);\n\nOptionsDoc.propTypes = {\n options: T.object.isRequired,\n description: T.string,\n};\n\nexport default OptionsDoc;\n","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = vizConfig;\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = vizConfig;\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n isDynamicOption,\n getInitialPreset,\n generatePrecisionValues,\n uncollapseEditorConfig,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");"],"sourceRoot":""}
|
|
@@ -134,7 +134,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
134
134
|
Object.defineProperty(exports, "__esModule", {
|
|
135
135
|
value: true
|
|
136
136
|
});
|
|
137
|
-
exports.insertLayout = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
137
|
+
exports.insertLayout = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
138
138
|
|
|
139
139
|
var lodash_1 = __webpack_require__(0);
|
|
140
140
|
|
|
@@ -209,8 +209,10 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
209
209
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
210
210
|
/**
|
|
211
211
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
212
|
+
* this function also collapse all editor panels
|
|
212
213
|
* @param vizConfig a Visualization Config
|
|
213
214
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
215
|
+
* and containing `open: false` for all editor panels in editorConfig
|
|
214
216
|
*/
|
|
215
217
|
|
|
216
218
|
function enhanceConfig(vizConfig) {
|
|
@@ -220,10 +222,33 @@ function enhanceConfig(vizConfig) {
|
|
|
220
222
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
221
223
|
}
|
|
222
224
|
|
|
225
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
226
|
+
return Object.assign(Object.assign({}, config), {
|
|
227
|
+
open: false
|
|
228
|
+
});
|
|
229
|
+
});
|
|
223
230
|
return enhancedConfig;
|
|
224
231
|
}
|
|
225
232
|
|
|
226
233
|
exports.enhanceConfig = enhanceConfig;
|
|
234
|
+
/**
|
|
235
|
+
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
236
|
+
* Created for editor unit tests
|
|
237
|
+
* @param vizConfig a Visualization Config
|
|
238
|
+
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
239
|
+
*/
|
|
240
|
+
|
|
241
|
+
function uncollapseEditorConfig(vizConfig) {
|
|
242
|
+
var editorPanelUncollapsedConfig = vizConfig;
|
|
243
|
+
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
244
|
+
return Object.assign(Object.assign({}, config), {
|
|
245
|
+
open: true
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
return editorPanelUncollapsedConfig;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
227
252
|
|
|
228
253
|
function isDynamicOption(option) {
|
|
229
254
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","webpack:///./src/common/interfaces/VizBehavior.ts"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,mC;;;;;;ACAA,kE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AACA;;AAEA;;AAWA,IAAM,qBAAqB,GAAG;AAC1B,MAAI,EAAE,QADoB;AAE1B,SAAO,EAAE;AAFiB,CAA9B;AAKA;;;;AAIG;;AACH,SAAS,sCAAT,CACI,aADJ,EACwD;AAEpD,MAAM,qBAAqB,GAAkB,EAA7C;AACA,QAAM,CAAC,IAAP,CAAY,aAAZ,EAA2B,OAA3B,CAAmC,UAAC,GAAD,EAAc;AACvC,aAgBF,aAAa,CAhBX,GAgBW,CAhBX;AAAA,QAIF,KAJE,GAae,EAbf,CAIF,KAJE;AAAA,QAKF,WALE,GAae,EAbf,CAKF,WALE;AAAA,QAMF,QANE,GAae,EAbf,CAMF,QANE;AAAA,QAOF,SAPE,GAae,EAbf,CAOF,SAPE;AAAA,QAQF,QARE,GAae,EAbf,CAQF,QARE;AAAA,QASO,YATP,GAae,EAbf,CASF,OATE;AAAA,QAWF,IA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wB;AAAA,oCAGrB,WAHqB;AAGrB,eAHqB;AAAA;;AAAA,sCAMrB,MAAM,CAAC,KAAP,CAAa,CAAb,EAAgB,KAAhB,CANqB,GAQrB,WARqB,qBAUrB,MAAM,CAAC,KAAP,CAAa,KAAb,CAVqB;AAAA,CAArB;;AAAM,uBAAY,YAAZ,C;;;;;;AC/Mb,qE;;;;;;ACAA,sE;;;;;;;;;;;;;ACAA,IAAY,WAAZ;;AAAA,WAAY,WAAZ,EAAuB;AACnB;;;;;;;;;;AAUG;AACH;AACA;AACA;;;;AAIG;;AACH;AACA;AACH,CArBD,EAAY,WAAW,GAAX,8CAAW,EAAX,CAAZ,E","file":"configUtils.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 = 7);\n","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig } from '../interfaces/Editor';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = vizConfig;\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n return enhancedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n isDynamicOption,\n getInitialPreset,\n generatePrecisionValues,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","webpack:///./src/common/interfaces/VizBehavior.ts"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,mC;;;;;;ACAA,k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b,CAVqB;AAAA,CAArB;;AAAM,uBAAY,YAAZ,C;;;;;;ACvOb,qE;;;;;;ACAA,sE;;;;;;;;;;;;;ACAA,IAAY,WAAZ;;AAAA,WAAY,WAAZ,EAAuB;AACnB;;;;;;;;;;AAUG;AACH;AACA;AACA;;;;AAIG;;AACH;AACA;AACH,CArBD,EAAY,WAAW,GAAX,8CAAW,EAAX,CAAZ,E","file":"configUtils.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 = 7);\n","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = vizConfig;\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = vizConfig;\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n isDynamicOption,\n getInitialPreset,\n generatePrecisionValues,\n uncollapseEditorConfig,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n"],"sourceRoot":""}
|
|
@@ -575,7 +575,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
575
575
|
|
|
576
576
|
return React.createElement(FixSizeItem, {
|
|
577
577
|
"data-test": "fix-size-item",
|
|
578
|
-
"data-splunk-visualization-version": "25.0.
|
|
578
|
+
"data-splunk-visualization-version": "25.0.1 - de10ad954",
|
|
579
579
|
width: width,
|
|
580
580
|
height: height,
|
|
581
581
|
backgroundColor: backgroundColor
|
|
@@ -1239,7 +1239,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1239
1239
|
componentId: "sc-1gsbnxb-0"
|
|
1240
1240
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1241
1241
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1242
|
-
'data-splunk-visualization-version': "25.0.
|
|
1242
|
+
'data-splunk-visualization-version': "25.0.1 - de10ad954"
|
|
1243
1243
|
}).withConfig({
|
|
1244
1244
|
displayName: "withEditModeCover__Blocker",
|
|
1245
1245
|
componentId: "sc-1gsbnxb-1"
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@splunk/visualizations",
|
|
3
3
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
4
4
|
"author": "Splunk",
|
|
5
|
-
"version": "25.0.
|
|
5
|
+
"version": "25.0.1",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "NODE_ENV=production webpack --config ./webpack.config.js --bail",
|
|
8
8
|
"build-storybook": "build-storybook -c .storybook -s fonts -o .storybook-bundle",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.13.0",
|
|
37
37
|
"@mdhnpm/rgb-hex-converter": "^1.0.3",
|
|
38
|
-
"@splunk/charting-bundle": "^25.0.
|
|
38
|
+
"@splunk/charting-bundle": "^25.0.1",
|
|
39
39
|
"@splunk/moment": "^0.6.0",
|
|
40
40
|
"@splunk/react-icons": "^3.1.0",
|
|
41
41
|
"@splunk/react-sparkline": "^0.6.0",
|
|
42
42
|
"@splunk/react-ui": "^4.5.3",
|
|
43
43
|
"@splunk/themes": "^0.12.0",
|
|
44
44
|
"@splunk/ui-utils": "^1.2.1",
|
|
45
|
-
"@splunk/visualization-color-palettes": "^25.0.
|
|
46
|
-
"@splunk/visualization-encoding": "^25.0.
|
|
47
|
-
"@splunk/visualization-icons": "^25.0.
|
|
48
|
-
"@splunk/visualization-themes": "^25.0.
|
|
49
|
-
"@splunk/visualizations-shared": "^25.0.
|
|
45
|
+
"@splunk/visualization-color-palettes": "^25.0.1",
|
|
46
|
+
"@splunk/visualization-encoding": "^25.0.1",
|
|
47
|
+
"@splunk/visualization-icons": "^25.0.1",
|
|
48
|
+
"@splunk/visualization-themes": "^25.0.1",
|
|
49
|
+
"@splunk/visualizations-shared": "^25.0.1",
|
|
50
50
|
"@xmldom/xmldom": "^0.7.2",
|
|
51
51
|
"cssesc": "3.0.0",
|
|
52
52
|
"d3-array": "^2.12.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"xpath": "^0.0.32"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@splunk/visualization-context": "^25.0.
|
|
69
|
+
"@splunk/visualization-context": "^25.0.1",
|
|
70
70
|
"react": "^16.11.0",
|
|
71
71
|
"react-dom": "^16.11.0",
|
|
72
72
|
"styled-components": "5.1.1"
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"@babel/cli": "^7.13.0",
|
|
76
76
|
"@babel/core": "^7.13.0",
|
|
77
77
|
"@splunk/docs-gen": "^0.11.1",
|
|
78
|
-
"@splunk/dynamic-editors": "^0.
|
|
78
|
+
"@splunk/dynamic-editors": "^0.20.5",
|
|
79
79
|
"@splunk/jsdoc-loader": "^3.0.0",
|
|
80
80
|
"@splunk/react-docs": "^0.11.0",
|
|
81
|
-
"@splunk/visualization-build-tools": "^25.0.
|
|
81
|
+
"@splunk/visualization-build-tools": "^25.0.1",
|
|
82
82
|
"@splunk/webpack-configs": "^4.0.0",
|
|
83
83
|
"@storybook/addon-actions": "^6.1.20",
|
|
84
84
|
"@storybook/addon-docs": "^6.1.20",
|