@splunk/visualizations-shared 26.1.0 → 26.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Downloader.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/FileDownloader.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/Message.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/RemoteIcon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/RemoteImage.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/SanitizeProps.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/colorConstants.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/colorUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/configUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/console.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/domUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/hocUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/i18n.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/iconUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/mapUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/namedColors.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/numberUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Visualizations Shared Files",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "author": "Splunk",
6
- "version": "26.1.0",
6
+ "version": "26.1.2",
7
7
  "scripts": {
8
8
  "build": "export NODE_OPTIONS=--openssl-legacy-provider && NODE_ENV=production webpack --config ./webpack.config.js --bail",
9
9
  "build-storybook": "export NODE_OPTIONS=--openssl-legacy-provider && build-storybook -c .storybook -s fonts -o .storybook-bundle",
@@ -30,7 +30,7 @@
30
30
  "@splunk/moment": "^0.6.1",
31
31
  "@splunk/react-icons": "^4.0.1",
32
32
  "@splunk/react-ui": "^4.17.1",
33
- "@splunk/themes": "^0.18.0",
33
+ "@splunk/themes": "^0.19.0",
34
34
  "@splunk/ui-utils": "^1.2.1",
35
35
  "element-resize-detector": "^1.1.14",
36
36
  "lodash": "^4.17.21",
@@ -45,24 +45,18 @@
45
45
  "devDependencies": {
46
46
  "@babel/cli": "^7.13.0",
47
47
  "@babel/core": "^7.13.0",
48
- "@splunk/react-docs": "1.0.0-beta.13",
49
- "@splunk/visualization-build-tools": "^26.1.0",
50
- "@splunk/visualization-context": "^26.1.0",
48
+ "@splunk/react-docs": "1.0.0-beta.16",
49
+ "@splunk/visualization-build-tools": "^26.1.2",
50
+ "@splunk/visualization-context": "^26.1.2",
51
51
  "@storybook/addon-actions": "^6.4.0",
52
52
  "@storybook/addons": "^6.4.0",
53
53
  "@storybook/react": "^6.4.0",
54
54
  "ajv": "^6.5.4",
55
- "babel-jest": "^26.0.0",
56
- "jest": "^26.0.0",
57
- "jest-canvas-mock": "^2.2.0",
58
- "jest-junit": "^12.0.0",
59
- "jest-styled-components": "^7.0.3",
60
55
  "raf": "^3.4.0",
61
56
  "react": "^16.13.1",
62
57
  "react-dom": "^16.13.1",
63
58
  "styled-components": "^5.3.10",
64
59
  "text-encoding": "^0.7.0",
65
- "ts-jest": "^26.0.0",
66
60
  "webpack": "^4.29.6",
67
61
  "webpack-merge": "^4.2.1"
68
62
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/propUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -107,6 +107,7 @@ __webpack_require__.r(__webpack_exports__);
107
107
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertPropsToString", function() { return convertPropsToString; });
108
108
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatColor", function() { return formatColor; });
109
109
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToSCProperties", function() { return convertToSCProperties; });
110
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustOptionsToSchema", function() { return adjustOptionsToSchema; });
110
111
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
111
112
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
112
113
 
@@ -212,6 +213,23 @@ var convertToSCProperties = function convertToSCProperties(originalOptions, opti
212
213
  });
213
214
  return returnOptions;
214
215
  };
216
+ /**
217
+ * Helper for removing the option properties (and values) that are not part of schema
218
+ * @method adjustOptionsToSchema
219
+ * @param {Object} originalOptions
220
+ * @param {Object} optionsSchema
221
+ * @returns {Object}
222
+ */
223
+
224
+ var adjustOptionsToSchema = function adjustOptionsToSchema(originalOptions, optionsSchema) {
225
+ var returnOptions = {};
226
+ Object.keys(optionsSchema).forEach(function (key) {
227
+ if (Object.hasOwn(originalOptions, key)) {
228
+ returnOptions[key] = originalOptions[key];
229
+ }
230
+ });
231
+ return returnOptions;
232
+ };
215
233
 
216
234
  /***/ })
217
235
 
package/propUtils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/propUtils.js"],"names":["convertPropsToString","vizProps","propNames","convertedVizProps","propValue","Array","isPlainObject","JSON","console","formatColor","color","convertToSCProperties","returnOptions","y2Fields","originalOptions","overlayFields","Object","newKey","optionsSCMapping","has","updatedValue","optionValuesSCMapping","isUndefined","field","stringValues"],"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;Q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G,E","file":"propUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 60);\n","module.exports = require(\"lodash\");","import { isPlainObject, has, isUndefined } from 'lodash';\n\n/**\n * convert props of type 'array/object' to 'string', based on the list of props to be converted in vizProps\n * @method convertPropsToString\n * @param {Object} vizProps\n * @param {Array} propNames\n * @return {Object} convertedVizProps\n */\nexport const convertPropsToString = ({ vizProps = {}, propNames = [] }) => {\n const convertedVizProps = {};\n\n propNames.forEach(propName => {\n const propValue = vizProps[propName];\n if (Array.isArray(propValue) || isPlainObject(propValue)) {\n convertedVizProps[propName] = JSON.stringify(propValue);\n } else if (propValue && typeof propValue === 'string') {\n // eslint-disable-next-line no-console\n console.warn(`The option type 'string' for '${propName}' has been deprecated.`);\n }\n });\n\n return convertedVizProps;\n};\n\n/**\n * Convert a hex value to a color\n * @method formatColor\n * @param {String} color\n * @returns {String}\n */\nexport const formatColor = color => {\n if (!color || typeof color !== 'string') {\n return '';\n }\n\n return color.replace('0x', '#');\n};\n\n/**\n * Helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts\n * This is for options that has new key name and can not directly be mapped with SimpleXML or\n * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)\n * @method convertToAreaSCProperties\n * @param {Object} originalOptions\n * @param {Object} optionsSCMapping\n * @param {Object} optionValuesSCMapping\n * @param {Array} stringValues\n * @returns {Object}\n */\nexport const convertToSCProperties = (\n originalOptions,\n optionsSCMapping,\n optionValuesSCMapping,\n stringValues\n) => {\n const returnOptions = {};\n const { y2Fields, overlayFields } = originalOptions;\n\n // mapToOldKey\n Object.keys(originalOptions).forEach(key => {\n const newKey = optionsSCMapping[key] ? optionsSCMapping[key] : key;\n returnOptions[newKey] = originalOptions[key];\n });\n\n // mapToValues\n Object.keys(optionValuesSCMapping).forEach(key => {\n if (has(returnOptions, key)) {\n const updatedValue = optionValuesSCMapping[key][returnOptions[key]];\n if (!isUndefined(updatedValue)) {\n returnOptions[key] = updatedValue;\n }\n }\n });\n\n // convertY2AxisOptions\n if (y2Fields) {\n delete returnOptions.y2Fields;\n returnOptions['axisY2.enabled'] = true;\n returnOptions['axisY2.fields'] = Array.isArray(y2Fields)\n ? y2Fields.filter(name => name).join(',')\n : y2Fields;\n }\n\n // convertOverlayFields\n if (overlayFields) {\n returnOptions.overlayFields = Array.isArray(overlayFields)\n ? overlayFields\n .filter(field => field)\n .map(field => field.trim())\n .join(',')\n : overlayFields;\n }\n\n // convertToStringValues\n stringValues.forEach(propName => {\n const propValue = returnOptions[propName];\n if (Array.isArray(propValue) || isPlainObject(propValue)) {\n returnOptions[propName] = JSON.stringify(propValue);\n } else if (propValue && typeof propValue === 'string') {\n // eslint-disable-next-line no-console\n console.warn(`The option type 'string' for '${propName}' has been deprecated.`);\n }\n });\n return returnOptions;\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash\"","webpack:///./src/propUtils.js"],"names":["convertPropsToString","vizProps","propNames","convertedVizProps","propValue","Array","isPlainObject","JSON","console","formatColor","color","convertToSCProperties","returnOptions","y2Fields","originalOptions","overlayFields","Object","newKey","optionsSCMapping","has","updatedValue","optionValuesSCMapping","isUndefined","field","stringValues","adjustOptionsToSchema"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QAC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,CAA/B,QAA+B,CAA/B;;AACA,QAAIP,KAAK,CAALA,sBAA4BC,4DAAa,CAA7C,SAA6C,CAA7C,EAA0D;AACtDM,mBAAa,CAAbA,QAAa,CAAbA,GAA0BL,IAAI,CAAJA,UAA1BK,SAA0BL,CAA1BK;AADJ,WAEO,IAAIR,SAAS,IAAI,qBAAjB,UAAgD;AACnD;AACAI,aAAO,CAAPA;AACH;AAPLgB;AASA;AAtDG;AAyDP;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAwB,iCAAoC;AACrE,MAAMb,aAAa,GAAnB;AACAI,QAAM,CAANA,4BAAmC,eAAO;AACtC,QAAIA,MAAM,CAANA,wBAAJ,GAAIA,CAAJ,EAAyC;AACrCJ,mBAAa,CAAbA,GAAa,CAAbA,GAAqBE,eAAe,CAApCF,GAAoC,CAApCA;AACH;AAHLI;AAKA;AAPG,E","file":"propUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 60);\n","module.exports = require(\"lodash\");","import { isPlainObject, has, isUndefined } from 'lodash';\n\n/**\n * convert props of type 'array/object' to 'string', based on the list of props to be converted in vizProps\n * @method convertPropsToString\n * @param {Object} vizProps\n * @param {Array} propNames\n * @return {Object} convertedVizProps\n */\nexport const convertPropsToString = ({ vizProps = {}, propNames = [] }) => {\n const convertedVizProps = {};\n\n propNames.forEach(propName => {\n const propValue = vizProps[propName];\n if (Array.isArray(propValue) || isPlainObject(propValue)) {\n convertedVizProps[propName] = JSON.stringify(propValue);\n } else if (propValue && typeof propValue === 'string') {\n // eslint-disable-next-line no-console\n console.warn(`The option type 'string' for '${propName}' has been deprecated.`);\n }\n });\n\n return convertedVizProps;\n};\n\n/**\n * Convert a hex value to a color\n * @method formatColor\n * @param {String} color\n * @returns {String}\n */\nexport const formatColor = color => {\n if (!color || typeof color !== 'string') {\n return '';\n }\n\n return color.replace('0x', '#');\n};\n\n/**\n * Helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts\n * This is for options that has new key name and can not directly be mapped with SimpleXML or\n * don't have a 1-1 mapping in SimpleXML (i.e. a straightforward name mapping where values are preserved)\n * @method convertToAreaSCProperties\n * @param {Object} originalOptions\n * @param {Object} optionsSCMapping\n * @param {Object} optionValuesSCMapping\n * @param {Array} stringValues\n * @returns {Object}\n */\nexport const convertToSCProperties = (\n originalOptions,\n optionsSCMapping,\n optionValuesSCMapping,\n stringValues\n) => {\n const returnOptions = {};\n const { y2Fields, overlayFields } = originalOptions;\n\n // mapToOldKey\n Object.keys(originalOptions).forEach(key => {\n const newKey = optionsSCMapping[key] ? optionsSCMapping[key] : key;\n returnOptions[newKey] = originalOptions[key];\n });\n\n // mapToValues\n Object.keys(optionValuesSCMapping).forEach(key => {\n if (has(returnOptions, key)) {\n const updatedValue = optionValuesSCMapping[key][returnOptions[key]];\n if (!isUndefined(updatedValue)) {\n returnOptions[key] = updatedValue;\n }\n }\n });\n\n // convertY2AxisOptions\n if (y2Fields) {\n delete returnOptions.y2Fields;\n returnOptions['axisY2.enabled'] = true;\n returnOptions['axisY2.fields'] = Array.isArray(y2Fields)\n ? y2Fields.filter(name => name).join(',')\n : y2Fields;\n }\n\n // convertOverlayFields\n if (overlayFields) {\n returnOptions.overlayFields = Array.isArray(overlayFields)\n ? overlayFields\n .filter(field => field)\n .map(field => field.trim())\n .join(',')\n : overlayFields;\n }\n\n // convertToStringValues\n stringValues.forEach(propName => {\n const propValue = returnOptions[propName];\n if (Array.isArray(propValue) || isPlainObject(propValue)) {\n returnOptions[propName] = JSON.stringify(propValue);\n } else if (propValue && typeof propValue === 'string') {\n // eslint-disable-next-line no-console\n console.warn(`The option type 'string' for '${propName}' has been deprecated.`);\n }\n });\n return returnOptions;\n};\n\n/**\n * Helper for removing the option properties (and values) that are not part of schema\n * @method adjustOptionsToSchema\n * @param {Object} originalOptions\n * @param {Object} optionsSchema\n * @returns {Object}\n */\nexport const adjustOptionsToSchema = (originalOptions, optionsSchema) => {\n const returnOptions = {};\n Object.keys(optionsSchema).forEach(key => {\n if (Object.hasOwn(originalOptions, key)) {\n returnOptions[key] = originalOptions[key];\n }\n });\n return returnOptions;\n};\n"],"sourceRoot":""}
package/schemaUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/style.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/testHelper.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/themeUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
package/trellisUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */