@splunk/visualizations-shared 25.7.1 → 25.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Downloader.js +5 -60
- package/Downloader.js.map +1 -1
- package/FileDownloader.js +21 -95
- package/FileDownloader.js.map +1 -1
- package/JSONSchemaUtils.js +0 -5
- package/JSONSchemaUtils.js.map +1 -1
- package/Message.js +10 -21
- package/Message.js.map +1 -1
- package/RemoteIcon.js +33 -86
- package/RemoteIcon.js.map +1 -1
- package/RemoteImage.js +8 -44
- package/RemoteImage.js.map +1 -1
- package/SanitizeProps.js +14 -39
- package/SanitizeProps.js.map +1 -1
- package/SizeAwareWrapper.js +6 -34
- package/SizeAwareWrapper.js.map +1 -1
- package/VisualizationDocPage.js +18 -64
- package/VisualizationDocPage.js.map +1 -1
- package/colorConstants.js.map +1 -1
- package/colorUtils.js +14 -27
- package/colorUtils.js.map +1 -1
- package/configUtils.js +0 -2
- package/configUtils.js.map +1 -1
- package/console.js +0 -12
- package/console.js.map +1 -1
- package/dataSourceUtils.js +1 -10
- package/dataSourceUtils.js.map +1 -1
- package/domUtils.js.map +1 -1
- package/hocUtils.js +0 -14
- package/hocUtils.js.map +1 -1
- package/i18n.js +0 -2
- package/i18n.js.map +1 -1
- package/iconUtils.js +12 -11
- package/iconUtils.js.map +1 -1
- package/mapUtils.js +0 -4
- package/mapUtils.js.map +1 -1
- package/namedColors.js +2 -2
- package/namedColors.js.map +1 -1
- package/numberUtils.js +17 -27
- package/numberUtils.js.map +1 -1
- package/package.json +5 -5
- package/previewVizMessage.js.map +1 -1
- package/propUtils.js +5 -7
- package/propUtils.js.map +1 -1
- package/schemaUtils.js +10 -10
- package/schemaUtils.js.map +1 -1
- package/simpleXMLOptions.js +2 -2
- package/simpleXMLOptions.js.map +1 -1
- package/style.js +6 -11
- package/style.js.map +1 -1
- package/testHelper.js.map +1 -1
- package/themeUtils.js +7 -8
- package/themeUtils.js.map +1 -1
- package/trellisUtils.js +18 -62
- package/trellisUtils.js.map +1 -1
package/numberUtils.js
CHANGED
|
@@ -133,23 +133,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
// Todo: need break out this utils after breaking out all visualizations
|
|
137
136
|
|
|
137
|
+
|
|
138
|
+
// Todo: need break out this utils after breaking out all visualizations
|
|
138
139
|
/**
|
|
139
140
|
* @file
|
|
140
141
|
* A set of number formatting function used in Table
|
|
141
142
|
*/
|
|
142
|
-
|
|
143
143
|
var DECIMAL_OR_SCIENTIFIC_REGEX = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i;
|
|
144
144
|
var COMMA_SEPARATED_NUMBER_REGEX = /(^[-+]?([0]|([1-9][0-9]{0,2})|(([1-9][0-9]{0,2}[,])([0-9]{3}[,])*[0-9]{3}))(([.][0-9]+)?)$)/;
|
|
145
|
-
|
|
146
145
|
function isDecimalOrExpo(str) {
|
|
147
146
|
return DECIMAL_OR_SCIENTIFIC_REGEX.test(str);
|
|
148
147
|
}
|
|
149
|
-
|
|
150
148
|
function isCommaSeparatedNumber(str) {
|
|
151
149
|
return COMMA_SEPARATED_NUMBER_REGEX.test(str);
|
|
152
150
|
}
|
|
151
|
+
|
|
153
152
|
/**
|
|
154
153
|
* Check if a string can be considered as numeric, this includes decimal, scientific number and number with comma separator
|
|
155
154
|
*
|
|
@@ -162,11 +161,10 @@ function isCommaSeparatedNumber(str) {
|
|
|
162
161
|
* @return {Boolean}
|
|
163
162
|
* @public
|
|
164
163
|
*/
|
|
165
|
-
|
|
166
|
-
|
|
167
164
|
function isNumerialStr(str) {
|
|
168
165
|
return isDecimalOrExpo(str) || isCommaSeparatedNumber(str);
|
|
169
166
|
}
|
|
167
|
+
|
|
170
168
|
/**
|
|
171
169
|
* Check if a value can be considered as numeric
|
|
172
170
|
*
|
|
@@ -179,33 +177,30 @@ function isNumerialStr(str) {
|
|
|
179
177
|
* @return {Boolean}
|
|
180
178
|
* @public
|
|
181
179
|
*/
|
|
182
|
-
|
|
183
180
|
function isNumerial(value) {
|
|
184
181
|
return Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isFinite"])(value) || Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(value) && isNumerialStr(value);
|
|
185
182
|
}
|
|
183
|
+
|
|
186
184
|
/**
|
|
187
185
|
* Parse input value into number, return NaN for not numercial value
|
|
188
186
|
* @param {*} value input value
|
|
189
187
|
* @return {Number}
|
|
190
188
|
* @public
|
|
191
189
|
*/
|
|
192
|
-
|
|
193
190
|
function parseNumber(value) {
|
|
194
191
|
if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isFinite"])(value) || Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(value) && isDecimalOrExpo(value)) {
|
|
195
192
|
// only parses the value consider as numeric.
|
|
196
193
|
return parseFloat(value);
|
|
197
194
|
}
|
|
198
|
-
|
|
199
195
|
if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"])(value) && isCommaSeparatedNumber(value)) {
|
|
200
196
|
return parseFloat(value.replace(/,/g, ''));
|
|
201
197
|
}
|
|
202
|
-
|
|
203
198
|
return NaN;
|
|
204
199
|
}
|
|
200
|
+
|
|
205
201
|
/**
|
|
206
202
|
*
|
|
207
203
|
*/
|
|
208
|
-
|
|
209
204
|
var getThousandSeparatorDecimalPrecisionFormatter = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["memoize"])(function () {
|
|
210
205
|
var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
|
|
211
206
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -213,6 +208,7 @@ var getThousandSeparatorDecimalPrecisionFormatter = Object(lodash__WEBPACK_IMPOR
|
|
|
213
208
|
}, function (locale, options) {
|
|
214
209
|
return "".concat(locale).concat(JSON.stringify(options));
|
|
215
210
|
});
|
|
211
|
+
|
|
216
212
|
/**
|
|
217
213
|
- * Format number into string with precision and/or grouping
|
|
218
214
|
- *
|
|
@@ -231,22 +227,20 @@ var getThousandSeparatorDecimalPrecisionFormatter = Object(lodash__WEBPACK_IMPOR
|
|
|
231
227
|
- * @return {String}
|
|
232
228
|
- * @public
|
|
233
229
|
- */
|
|
234
|
-
|
|
235
230
|
function formatNumber(number, precision) {
|
|
236
231
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
237
|
-
var formatOptions = {};
|
|
232
|
+
var formatOptions = {};
|
|
238
233
|
|
|
234
|
+
// Precision is optional, so check if precision is an object, and use it as the options, otherwise load from options
|
|
239
235
|
var _ref = precision && _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(precision) === 'object' ? precision : options,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
236
|
+
_ref$useThousandSepar = _ref.useThousandSeparators,
|
|
237
|
+
useThousandSeparators = _ref$useThousandSepar === void 0 ? false : _ref$useThousandSepar,
|
|
238
|
+
_ref$locale = _ref.locale,
|
|
239
|
+
locale = _ref$locale === void 0 ? _splunk_moment__WEBPACK_IMPORTED_MODULE_1___default.a.locale() : _ref$locale,
|
|
240
|
+
_ref$defaultPrecision = _ref.defaultPrecision,
|
|
241
|
+
defaultPrecision = _ref$defaultPrecision === void 0 ? 0 : _ref$defaultPrecision,
|
|
242
|
+
_ref$useTrendUnits = _ref.useTrendUnits,
|
|
243
|
+
useTrendUnits = _ref$useTrendUnits === void 0 ? false : _ref$useTrendUnits; // Apply precision only when it is a positive integer
|
|
250
244
|
if (Object(lodash__WEBPACK_IMPORTED_MODULE_2__["isInteger"])(precision) && precision >= 0) {
|
|
251
245
|
// Validate precision is within acceptable bounds
|
|
252
246
|
var p = precision > 20 ? 20 : precision;
|
|
@@ -255,7 +249,6 @@ function formatNumber(number, precision) {
|
|
|
255
249
|
} else {
|
|
256
250
|
formatOptions.maximumFractionDigits = defaultPrecision;
|
|
257
251
|
}
|
|
258
|
-
|
|
259
252
|
formatOptions.useGrouping = useThousandSeparators === true;
|
|
260
253
|
var trendUnit = '';
|
|
261
254
|
var value = number;
|
|
@@ -272,12 +265,10 @@ function formatNumber(number, precision) {
|
|
|
272
265
|
letter: 'K',
|
|
273
266
|
power: 3
|
|
274
267
|
}];
|
|
275
|
-
|
|
276
268
|
if (useTrendUnits) {
|
|
277
269
|
var found = units.find(function (unit) {
|
|
278
270
|
return Math.abs(value) > Math.pow(10, unit.power);
|
|
279
271
|
});
|
|
280
|
-
|
|
281
272
|
if (found) {
|
|
282
273
|
value /= Math.pow(10, found.power);
|
|
283
274
|
trendUnit = found.letter;
|
|
@@ -285,7 +276,6 @@ function formatNumber(number, precision) {
|
|
|
285
276
|
formatOptions.minimumFractionDigits = 0;
|
|
286
277
|
}
|
|
287
278
|
}
|
|
288
|
-
|
|
289
279
|
var formatter = getThousandSeparatorDecimalPrecisionFormatter(locale, formatOptions);
|
|
290
280
|
return "".concat(formatter.format(value)).concat(trendUnit ? Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_3__["_"])(trendUnit) : '');
|
|
291
281
|
}
|
package/numberUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/moment\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"lodash\"","webpack:///./src/numberUtils.js","webpack:///external \"@splunk/ui-utils/i18n\""],"names":["DECIMAL_OR_SCIENTIFIC_REGEX","COMMA_SEPARATED_NUMBER_REGEX","isDecimalOrExpo","isCommaSeparatedNumber","isFinite","isString","isNumerialStr","parseFloat","value","getThousandSeparatorDecimalPrecisionFormatter","memoize","locale","options","Intl","JSON","formatOptions","precision","useThousandSeparators","moment","defaultPrecision","useTrendUnits","isInteger","p","trendUnit","units","letter","power","found","Math","unit","formatter","_"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,2C;;;;;;;ACAA,0D;;;;;;;ACAA,mC;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;CAGA;;AACA;AACA;AACA;AACA;;AACA,IAAMA,2BAA2B,GAAjC;AACA,IAAMC,4BAA4B,GAAlC;;AACA,8BAA8B;AAC1B,SAAOD,2BAA2B,CAA3BA,KAAP,GAAOA,CAAP;AACH;;AACD,qCAAqC;AACjC,SAAOC,4BAA4B,CAA5BA,KAAP,GAAOA,CAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,4BAA4B;AAC/B,SAAOC,eAAe,CAAfA,GAAe,CAAfA,IAAwBC,sBAAsB,CAArD,GAAqD,CAArD;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,2BAA2B;AAC9B,SAAOC,uDAAQ,CAARA,KAAQ,CAARA,IAAoBC,uDAAQ,CAARA,KAAQ,CAARA,IAAmBC,aAAa,CAA3D,KAA2D,CAA3D;AACH;AAED;AACA;AACA;A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;AAEA,MAAIQ,SAAS,GAAb;AACA,MAAIf,KAAK,GAAT;AACA,MAAMgB,KAAK,GAAG,CACV;AAAEC,UAAM,EAAR;AAAeC,SAAK,EAAE;AAAtB,GADU,EAEV;AAAED,UAAM,EAAR;AAAeC,SAAK,EAAE;AAAtB,GAFU,EAGV;AAAED,UAAM,EAAR;AAAeC,SAAK,EAAE;AAAtB,GAHU,EAIV;AAAED,UAAM,EAAR;AAAeC,SAAK,EAAE;AAAtB,GAJU,CAAd;;AAOA,qBAAmB;AACf,QAAMC,KAAK,GAAG,KAAK,CAAL,KAAW,gBAAI;AAAA,aAAIC,IAAI,CAAJA,0BAAwBC,IAAI,CAAhC,KAAID,CAAJ;AAA7B,KAAc,CAAd;;AAEA,eAAW;AACPpB,WAAK,iBAAUmB,KAAK,CAApBnB,KAAK,CAALA;AACAe,eAAS,GAAGI,KAAK,CAAjBJ;AACAR,mBAAa,CAAbA;AACAA,mBAAa,CAAbA;AACH;AACJ;;AAED,MAAMe,SAAS,GAAGrB,6CAA6C,SAA/D,aAA+D,CAA/D;AAEA,mBAAUqB,SAAS,CAATA,OAAV,KAAUA,CAAV,SAAoCP,SAAS,GAAGQ,+DAAC,CAAJ,SAAI,CAAJ,GAA7C;AACH,C;;;;;;;AC5ID,kD","file":"numberUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 59);\n","module.exports = require(\"@splunk/moment\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"lodash\");","import moment from '@splunk/moment';\nimport { isFinite, isString, isInteger, memoize } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\n\n// Todo: need break out this utils after breaking out all visualizations\n/**\n * @file\n * A set of number formatting function used in Table\n */\nconst DECIMAL_OR_SCIENTIFIC_REGEX = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i;\nconst COMMA_SEPARATED_NUMBER_REGEX = /(^[-+]?([0]|([1-9][0-9]{0,2})|(([1-9][0-9]{0,2}[,])([0-9]{3}[,])*[0-9]{3}))(([.][0-9]+)?)$)/;\nfunction isDecimalOrExpo(str) {\n return DECIMAL_OR_SCIENTIFIC_REGEX.test(str);\n}\nfunction isCommaSeparatedNumber(str) {\n return COMMA_SEPARATED_NUMBER_REGEX.test(str);\n}\n\n/**\n * Check if a string can be considered as numeric, this includes decimal, scientific number and number with comma separator\n *\n * Examples:\n * ```js\n * const { isNumerialStr } from '@splunk/react-visualizations/utils/numberUtils';\n * assert.ok(isNumerialStr('11.123'));\n * ```\n * @param {String} str input value\n * @return {Boolean}\n * @public\n */\nexport function isNumerialStr(str) {\n return isDecimalOrExpo(str) || isCommaSeparatedNumber(str);\n}\n\n/**\n * Check if a value can be considered as numeric\n *\n * Examples:\n * ```js\n * const { isNumerial } from '@splunk/react-visualizations/utils/numberUtils';\n * assert.equal(isNumerial('11.123') == 11.123);\n * ```\n * @param {any} value input value\n * @return {Boolean}\n * @public\n */\nexport function isNumerial(value) {\n return isFinite(value) || (isString(value) && isNumerialStr(value));\n}\n\n/**\n * Parse input value into number, return NaN for not numercial value\n * @param {*} value input value\n * @return {Number}\n * @public\n */\nexport function parseNumber(value) {\n if (isFinite(value) || (isString(value) && isDecimalOrExpo(value))) {\n // only parses the value consider as numeric.\n return parseFloat(value);\n }\n if (isString(value) && isCommaSeparatedNumber(value)) {\n return parseFloat(value.replace(/,/g, ''));\n }\n return NaN;\n}\n\n/**\n *\n */\nconst getThousandSeparatorDecimalPrecisionFormatter = memoize(\n (locale = 'en', options = {}) => new Intl.NumberFormat(locale, options),\n (locale, options) => `${locale}${JSON.stringify(options)}`\n);\n\n/**\n- * Format number into string with precision and/or grouping\n- *\n- * Examples:\n- * ```js\n- * const { formatNumber } from '@splunk/react-visualizations/utils/numberUtils';\n- * assert.equal(formatNumber('1100’, 2, { useThousandSeparators: true }), '1,100.00’)\n- * ```\n- * @param {Number} number // value to format\n- * @param {Number} [precision] // number of digits after the decimal point\n- * @param {Object} [options]\n- * @param {Boolean} [options.useThousandSeparators=false] // flag to determine if grouping is desired\n- * @param {Object} [options.locale=moment.locale()] // Locale of the user for determinining how numbers are grouped\n- * @param {Number} [options.defaultPrecision=0] // The default precision to use if none is defined\n- * @param {Number} [options.useTrendUnits=false] // Add K, M, B, T to end of value, and divide by the appropriate order of magnitude\n- * @return {String}\n- * @public\n- */\nexport function formatNumber(number, precision, options = {}) {\n const formatOptions = {};\n\n // Precision is optional, so check if precision is an object, and use it as the options, otherwise load from options\n const {\n useThousandSeparators = false,\n locale = moment.locale(),\n defaultPrecision = 0,\n useTrendUnits = false,\n } = precision && typeof precision === 'object' ? precision : options;\n\n // Apply precision only when it is a positive integer\n if (isInteger(precision) && precision >= 0) {\n // Validate precision is within acceptable bounds\n const p = precision > 20 ? 20 : precision;\n\n formatOptions.minimumFractionDigits = p;\n formatOptions.maximumFractionDigits = p;\n } else {\n formatOptions.maximumFractionDigits = defaultPrecision;\n }\n\n formatOptions.useGrouping = useThousandSeparators === true;\n\n let trendUnit = '';\n let value = number;\n const units = [\n { letter: 'T', power: 12 },\n { letter: 'B', power: 9 },\n { letter: 'M', power: 6 },\n { letter: 'K', power: 3 },\n ];\n\n if (useTrendUnits) {\n const found = units.find(unit => Math.abs(value) > 10 ** unit.power);\n\n if (found) {\n value /= 10 ** found.power;\n trendUnit = found.letter;\n formatOptions.maximumFractionDigits = 2;\n formatOptions.minimumFractionDigits = 0;\n }\n }\n\n const formatter = getThousandSeparatorDecimalPrecisionFormatter(locale, formatOptions);\n\n return `${formatter.format(value)}${trendUnit ? _(trendUnit) : ''}`;\n}\n","module.exports = require(\"@splunk/ui-utils/i18n\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/moment\"","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///external \"lodash\"","webpack:///./src/numberUtils.js","webpack:///external \"@splunk/ui-utils/i18n\""],"names":["DECIMAL_OR_SCIENTIFIC_REGEX","COMMA_SEPARATED_NUMBER_REGEX","isDecimalOrExpo","str","test","isCommaSeparatedNumber","isNumerialStr","isNumerial","value","isFinite","isString","parseNumber","parseFloat","replace","NaN","getThousandSeparatorDecimalPrecisionFormatter","memoize","locale","arguments","length","undefined","options","Intl","NumberFormat","concat","JSON","stringify","formatNumber","number","precision","formatOptions","_ref","_typeof","_ref$useThousandSepar","useThousandSeparators","_ref$locale","moment","_ref$defaultPrecision","defaultPrecision","_ref$useTrendUnits","useTrendUnits","isInteger","p","minimumFractionDigits","maximumFractionDigits","useGrouping","trendUnit","units","letter","power","found","find","unit","Math","abs","pow","formatter","format","_"],"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,+DA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MAAM,EAAEa,aAAa,CAAC;EAEtF,UAAAN,MAAA,CAAUgC,SAAS,CAACC,MAAM,CAACjD,KAAK,CAAC,EAAAgB,MAAA,CAAGsB,SAAS,GAAGY,+DAAC,CAACZ,SAAS,CAAC,GAAG,EAAE;AACrE,C;;;;;;;AC5IA,kD","file":"numberUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 59);\n","module.exports = require(\"@splunk/moment\");","module.exports = require(\"@babel/runtime/helpers/typeof\");","module.exports = require(\"lodash\");","import moment from '@splunk/moment';\nimport { isFinite, isString, isInteger, memoize } from 'lodash';\nimport { _ } from '@splunk/ui-utils/i18n';\n\n// Todo: need break out this utils after breaking out all visualizations\n/**\n * @file\n * A set of number formatting function used in Table\n */\nconst DECIMAL_OR_SCIENTIFIC_REGEX = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i;\nconst COMMA_SEPARATED_NUMBER_REGEX = /(^[-+]?([0]|([1-9][0-9]{0,2})|(([1-9][0-9]{0,2}[,])([0-9]{3}[,])*[0-9]{3}))(([.][0-9]+)?)$)/;\nfunction isDecimalOrExpo(str) {\n return DECIMAL_OR_SCIENTIFIC_REGEX.test(str);\n}\nfunction isCommaSeparatedNumber(str) {\n return COMMA_SEPARATED_NUMBER_REGEX.test(str);\n}\n\n/**\n * Check if a string can be considered as numeric, this includes decimal, scientific number and number with comma separator\n *\n * Examples:\n * ```js\n * const { isNumerialStr } from '@splunk/react-visualizations/utils/numberUtils';\n * assert.ok(isNumerialStr('11.123'));\n * ```\n * @param {String} str input value\n * @return {Boolean}\n * @public\n */\nexport function isNumerialStr(str) {\n return isDecimalOrExpo(str) || isCommaSeparatedNumber(str);\n}\n\n/**\n * Check if a value can be considered as numeric\n *\n * Examples:\n * ```js\n * const { isNumerial } from '@splunk/react-visualizations/utils/numberUtils';\n * assert.equal(isNumerial('11.123') == 11.123);\n * ```\n * @param {any} value input value\n * @return {Boolean}\n * @public\n */\nexport function isNumerial(value) {\n return isFinite(value) || (isString(value) && isNumerialStr(value));\n}\n\n/**\n * Parse input value into number, return NaN for not numercial value\n * @param {*} value input value\n * @return {Number}\n * @public\n */\nexport function parseNumber(value) {\n if (isFinite(value) || (isString(value) && isDecimalOrExpo(value))) {\n // only parses the value consider as numeric.\n return parseFloat(value);\n }\n if (isString(value) && isCommaSeparatedNumber(value)) {\n return parseFloat(value.replace(/,/g, ''));\n }\n return NaN;\n}\n\n/**\n *\n */\nconst getThousandSeparatorDecimalPrecisionFormatter = memoize(\n (locale = 'en', options = {}) => new Intl.NumberFormat(locale, options),\n (locale, options) => `${locale}${JSON.stringify(options)}`\n);\n\n/**\n- * Format number into string with precision and/or grouping\n- *\n- * Examples:\n- * ```js\n- * const { formatNumber } from '@splunk/react-visualizations/utils/numberUtils';\n- * assert.equal(formatNumber('1100’, 2, { useThousandSeparators: true }), '1,100.00’)\n- * ```\n- * @param {Number} number // value to format\n- * @param {Number} [precision] // number of digits after the decimal point\n- * @param {Object} [options]\n- * @param {Boolean} [options.useThousandSeparators=false] // flag to determine if grouping is desired\n- * @param {Object} [options.locale=moment.locale()] // Locale of the user for determinining how numbers are grouped\n- * @param {Number} [options.defaultPrecision=0] // The default precision to use if none is defined\n- * @param {Number} [options.useTrendUnits=false] // Add K, M, B, T to end of value, and divide by the appropriate order of magnitude\n- * @return {String}\n- * @public\n- */\nexport function formatNumber(number, precision, options = {}) {\n const formatOptions = {};\n\n // Precision is optional, so check if precision is an object, and use it as the options, otherwise load from options\n const {\n useThousandSeparators = false,\n locale = moment.locale(),\n defaultPrecision = 0,\n useTrendUnits = false,\n } = precision && typeof precision === 'object' ? precision : options;\n\n // Apply precision only when it is a positive integer\n if (isInteger(precision) && precision >= 0) {\n // Validate precision is within acceptable bounds\n const p = precision > 20 ? 20 : precision;\n\n formatOptions.minimumFractionDigits = p;\n formatOptions.maximumFractionDigits = p;\n } else {\n formatOptions.maximumFractionDigits = defaultPrecision;\n }\n\n formatOptions.useGrouping = useThousandSeparators === true;\n\n let trendUnit = '';\n let value = number;\n const units = [\n { letter: 'T', power: 12 },\n { letter: 'B', power: 9 },\n { letter: 'M', power: 6 },\n { letter: 'K', power: 3 },\n ];\n\n if (useTrendUnits) {\n const found = units.find(unit => Math.abs(value) > 10 ** unit.power);\n\n if (found) {\n value /= 10 ** found.power;\n trendUnit = found.letter;\n formatOptions.maximumFractionDigits = 2;\n formatOptions.minimumFractionDigits = 0;\n }\n }\n\n const formatter = getThousandSeparatorDecimalPrecisionFormatter(locale, formatOptions);\n\n return `${formatter.format(value)}${trendUnit ? _(trendUnit) : ''}`;\n}\n","module.exports = require(\"@splunk/ui-utils/i18n\");"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Visualizations Shared Files",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"author": "Splunk",
|
|
6
|
-
"version": "25.
|
|
6
|
+
"version": "25.8.0",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "NODE_ENV=production webpack --config ./webpack.config.js --bail",
|
|
9
9
|
"build-storybook": "build-storybook -c .storybook -s fonts -o .storybook-bundle",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.13.0",
|
|
31
|
-
"@splunk/moment": "^0.6.
|
|
31
|
+
"@splunk/moment": "^0.6.1",
|
|
32
32
|
"@splunk/react-icons": "^3.1.0",
|
|
33
33
|
"@splunk/react-ui": "^4.5.3",
|
|
34
|
-
"@splunk/themes": "^0.
|
|
34
|
+
"@splunk/themes": "^0.16.0",
|
|
35
35
|
"@splunk/ui-utils": "^1.2.1",
|
|
36
36
|
"element-resize-detector": "^1.1.14",
|
|
37
37
|
"lodash": "^4.17.4",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@babel/cli": "^7.13.0",
|
|
48
48
|
"@babel/core": "^7.13.0",
|
|
49
49
|
"@splunk/react-docs": "^0.11.0",
|
|
50
|
-
"@splunk/visualization-build-tools": "^25.
|
|
51
|
-
"@splunk/visualization-context": "^25.
|
|
50
|
+
"@splunk/visualization-build-tools": "^25.8.0",
|
|
51
|
+
"@splunk/visualization-context": "^25.8.0",
|
|
52
52
|
"@storybook/addon-actions": "^6.1.20",
|
|
53
53
|
"@storybook/addons": "^6.1.20",
|
|
54
54
|
"@storybook/react": "^6.1.20",
|
package/previewVizMessage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/previewVizMessage.ts"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;AClFA,
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/previewVizMessage.ts"],"names":["previewVizMessage","exports","default"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;AClFA,IAAMA,iBAAiB,GACnB,wGAAwG;AAE5GC,OAAA,CAAAC,OAAA,GAAeF,iBAAiB,C","file":"previewVizMessage.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 60);\n","const previewVizMessage =\n '⚠️ This is a preview of a new visualization component. Minor updates and bug fixes should be expected.';\n\nexport default previewVizMessage;\n"],"sourceRoot":""}
|
package/propUtils.js
CHANGED
|
@@ -109,6 +109,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
109
109
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40);
|
|
110
110
|
/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0__);
|
|
111
111
|
|
|
112
|
+
|
|
112
113
|
/**
|
|
113
114
|
* convert props of type 'array/object' to 'string', based on the list of props to be converted in vizProps
|
|
114
115
|
* @method convertPropsToString
|
|
@@ -116,16 +117,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
116
117
|
* @param {Array} propNames
|
|
117
118
|
* @return {Object} convertedVizProps
|
|
118
119
|
*/
|
|
119
|
-
|
|
120
120
|
var convertPropsToString = function convertPropsToString(_ref) {
|
|
121
121
|
var _ref$vizProps = _ref.vizProps,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
vizProps = _ref$vizProps === void 0 ? {} : _ref$vizProps,
|
|
123
|
+
_ref$propNames = _ref.propNames,
|
|
124
|
+
propNames = _ref$propNames === void 0 ? [] : _ref$propNames;
|
|
125
125
|
var convertedVizProps = {};
|
|
126
126
|
propNames.forEach(function (propName) {
|
|
127
127
|
var propValue = vizProps[propName];
|
|
128
|
-
|
|
129
128
|
if (Array.isArray(propValue) || lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(propValue)) {
|
|
130
129
|
convertedVizProps[propName] = JSON.stringify(propValue);
|
|
131
130
|
} else if (propValue && typeof propValue === 'string') {
|
|
@@ -135,18 +134,17 @@ var convertPropsToString = function convertPropsToString(_ref) {
|
|
|
135
134
|
});
|
|
136
135
|
return convertedVizProps;
|
|
137
136
|
};
|
|
137
|
+
|
|
138
138
|
/**
|
|
139
139
|
* Convert a hex value to a color
|
|
140
140
|
* @method formatColor
|
|
141
141
|
* @param {String} color
|
|
142
142
|
* @returns {String}
|
|
143
143
|
*/
|
|
144
|
-
|
|
145
144
|
var formatColor = function formatColor(color) {
|
|
146
145
|
if (!color || typeof color !== 'string') {
|
|
147
146
|
return '';
|
|
148
147
|
}
|
|
149
|
-
|
|
150
148
|
return color.replace('0x', '#');
|
|
151
149
|
};
|
|
152
150
|
|
package/propUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/isPlainObject\"","webpack:///./src/propUtils.js"],"names":["convertPropsToString","vizProps","propNames","convertedVizProps","propValue","Array","isPlainObject","JSON","console","formatColor","color"],"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,iD;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/isPlainObject\"","webpack:///./src/propUtils.js"],"names":["convertPropsToString","_ref","_ref$vizProps","vizProps","_ref$propNames","propNames","convertedVizProps","forEach","propName","propValue","Array","isArray","isPlainObject","JSON","stringify","console","warn","concat","formatColor","color","replace"],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S,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;MACnD;MACAM,OAAO,CAACC,IAAI,kCAAAC,MAAA,CAAkCT,QAAQ,4BAAyB;IACnF;EACJ,CAAC,CAAC;EAEF,OAAOF,iBAAiB;AAC5B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,IAAMY,WAAW,GAAG,SAAdA,WAAWA,CAAGC,KAAK,EAAI;EAChC,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACrC,OAAO,EAAE;EACb;EAEA,OAAOA,KAAK,CAACC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AACnC,CAAC,C","file":"propUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 61);\n","module.exports = require(\"lodash/isPlainObject\");","import isPlainObject from 'lodash/isPlainObject';\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"],"sourceRoot":""}
|
package/schemaUtils.js
CHANGED
|
@@ -334,32 +334,32 @@ var createTestSchema = function createTestSchema(optionsSchema) {
|
|
|
334
334
|
type: 'object',
|
|
335
335
|
properties: optionsSchema
|
|
336
336
|
};
|
|
337
|
-
};
|
|
337
|
+
};
|
|
338
338
|
|
|
339
|
-
|
|
339
|
+
// Below 2 regexs are copied from dashboard-framework/packages/dashboard-utils/src/token.jsc
|
|
340
|
+
var TOKEN_NAMESPACE_PREFIX_PATTERN = /(\w+:)?/.source;
|
|
341
|
+
// ex: token.name|suh (old-style filter chain)
|
|
340
342
|
// ex: token.name|lower|capitalize (new-style filter chain)
|
|
341
|
-
|
|
342
343
|
var TOKEN_NAME_CHARS_PATTERN = /([^$|:]+?)(\|[|\w]+)?/.source;
|
|
343
|
-
var TOKEN_PATTERN = /\$/.source + TOKEN_NAMESPACE_PREFIX_PATTERN + TOKEN_NAME_CHARS_PATTERN + /\$/.source;
|
|
344
|
+
var TOKEN_PATTERN = /\$/.source + TOKEN_NAMESPACE_PREFIX_PATTERN + TOKEN_NAME_CHARS_PATTERN + /\$/.source;
|
|
345
|
+
// rgb and rgba regexes were derived from:
|
|
344
346
|
// https://stackoverflow.com/questions/9585973/javascript-regular-expression-for-rgb-values/9586150
|
|
345
347
|
// https://github.com/regexhq/rgba-regex
|
|
346
348
|
// NOTE: this will incorrectly accept values like rgb(999,999,999), but may be overkill to specify a regex that limits values to <= 255
|
|
347
|
-
|
|
348
349
|
var rgbColorPattern = /^rgb\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/;
|
|
349
|
-
var rgbaColorPattern = /^rgba\(\s*(\d{1,3}%?),\s*(\d{1,3}%?),\s*(\d{1,3}%?),\s*(\d*(?:\.\d+)?)\)$/;
|
|
350
|
-
|
|
350
|
+
var rgbaColorPattern = /^rgba\(\s*(\d{1,3}%?),\s*(\d{1,3}%?),\s*(\d{1,3}%?),\s*(\d*(?:\.\d+)?)\)$/;
|
|
351
|
+
// todo: rename this to COLOR_PATTERN and replace all occurences.
|
|
351
352
|
var colorPattern = '^#[0-9a-fA-F]{6}$|transparent';
|
|
352
353
|
var colorPatternWithRGBA = "".concat(colorPattern, "|").concat(rgbColorPattern.source, "|").concat(rgbaColorPattern.source);
|
|
353
354
|
var COLOR_OR_TOKEN_PATTERN = "".concat(colorPattern, "|").concat(TOKEN_PATTERN);
|
|
354
|
-
var COLOR_OR_TOKEN_PATTERN_WITH_RGBA = "".concat(colorPatternWithRGBA, "|").concat(TOKEN_PATTERN);
|
|
355
|
-
|
|
355
|
+
var COLOR_OR_TOKEN_PATTERN_WITH_RGBA = "".concat(colorPatternWithRGBA, "|").concat(TOKEN_PATTERN);
|
|
356
|
+
// dynamic option DSL expressions always start with a >
|
|
356
357
|
var DYNAMIC_OPTIONS_DSL_PATTERN = /^>.*/.source;
|
|
357
358
|
/**
|
|
358
359
|
* Returns the regex string that matches each passed in value as well as tokens.
|
|
359
360
|
* @param {Array.<string>} values
|
|
360
361
|
* @returns {string}
|
|
361
362
|
*/
|
|
362
|
-
|
|
363
363
|
var getPattern = function getPattern(values) {
|
|
364
364
|
return values.reduce(function (accumulator, value) {
|
|
365
365
|
return "".concat(accumulator, "|^").concat(value, "$");
|
package/schemaUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/schemaUtils.js"],"names":["$schema","$id","title","definitions","schemaArray","type","minItems","items","$ref","nonNegativeInteger","minimum","nonNegativeIntegerDefault0","allOf","default","simpleTypes","enum","stringArray","uniqueItems","properties","format","$comment","description","readOnly","examples","multipleOf","exclusiveMinimum","maximum","exclusiveMaximum","maxLength","minLength","pattern","additionalItems","anyOf","maxItems","contains","maxProperties","minProperties","required","additionalProperties","patternProperties","propertyNames","dependencies","const","contentMediaType","contentEncoding","if","then","else","oneOf","not","createTestSchema","optionsSchema","TOKEN_NAMESPACE_PREFIX_PATTERN","TOKEN_NAME_CHARS_PATTERN","TOKEN_PATTERN","rgbColorPattern","rgbaColorPattern","colorPattern","colorPatternWithRGBA","COLOR_OR_TOKEN_PATTERN","COLOR_OR_TOKEN_PATTERN_WITH_RGBA","DYNAMIC_OPTIONS_DSL_PATTERN","getPattern"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAe;AACXA,SAAO,EADI;AAEXC,KAAG,EAFQ;AAGXC,OAAK,EAHM;AAIXC,aAAW,EAAE;AACTC,eAAW,EAAE;AACTC,UAAI,EADK;AAETC,cAAQ,EAFC;AAGTC,WAAK,EAAE;AAAEC,YAAI,EAAE;AAAR;AAHE,KADJ;AAMTC,sBAAkB,EAAE;AAChBJ,UAAI,EADY;AAEhBK,aAAO,EAAE;AAFO,KANX;AAUTC,8BAA0B,EAAE;AACxBC,WAAK,EAAE,CAAC;AAAEJ,YAAI,EAAE;AA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AAK,EAHyC;AAI9CmB,eAAW,EAJmC;AAK9ChB,QAAI,EAL0C;AAM9Ca,cAAU,EAAEiC;AANkC,GAAL;AAAtC,E,CASP;;AACA,IAAMC,8BAA8B,GAAG,UAAvC,O,CACA;AACA;;AACA,IAAMC,wBAAwB,GAAG,wBAAjC;AAEO,IAAMC,aAAa,GACtB,0EAA0E,KADvE,O,CAEP;AACA;AACA;AACA;;AACO,IAAMC,eAAe,GAArB;AACA,IAAMC,gBAAgB,GAAtB,4E,CACP;;AACO,IAAMC,YAAY,GAAlB;AACA,IAAMC,oBAAoB,uCAAsBH,eAAe,CAArC,oBAAgDC,gBAAgB,CAA1F,MAA0B,CAA1B;AACA,IAAMG,sBAAsB,uCAA5B,aAA4B,CAA5B;AACA,IAAMC,gCAAgC,+CAAtC,aAAsC,CAAtC,C,CACP;;AACO,IAAMC,2BAA2B,GAAG,OAApC;AACP;AACA;AACA;AACA;AACA;;AACO,IAAMC,UAAU,GAAG,SAAbA,UAAa,SAAM;AAAA,SAC5B,MAAM,CAAN,OAAc;AAAA;AAAd,KAD4B,aAC5B,CAD4B;AAAzB,E","file":"schemaUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n","export default {\n $schema: 'http://json-schema.org/draft-07/schema#',\n $id: 'http://json-schema.org/draft-07/schema#',\n title: 'Core schema meta-schema',\n definitions: {\n schemaArray: {\n type: 'array',\n minItems: 1,\n items: { $ref: '#' },\n },\n nonNegativeInteger: {\n type: 'integer',\n minimum: 0,\n },\n nonNegativeIntegerDefault0: {\n allOf: [{ $ref: '#/definitions/nonNegativeInteger' }, { default: 0 }],\n },\n simpleTypes: {\n enum: ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'],\n },\n stringArray: {\n type: 'array',\n items: { type: 'string' },\n uniqueItems: true,\n default: [],\n },\n },\n type: ['object', 'boolean'],\n properties: {\n $id: {\n type: 'string',\n format: 'uri-reference',\n },\n $schema: {\n type: 'string',\n format: 'uri',\n },\n $ref: {\n type: 'string',\n format: 'uri-reference',\n },\n $comment: {\n type: 'string',\n },\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n default: true,\n readOnly: {\n type: 'boolean',\n default: false,\n },\n examples: {\n type: 'array',\n items: true,\n },\n multipleOf: {\n type: 'number',\n exclusiveMinimum: 0,\n },\n maximum: {\n type: 'number',\n },\n exclusiveMaximum: {\n type: 'number',\n },\n minimum: {\n type: 'number',\n },\n exclusiveMinimum: {\n type: 'number',\n },\n maxLength: { $ref: '#/definitions/nonNegativeInteger' },\n minLength: { $ref: '#/definitions/nonNegativeIntegerDefault0' },\n pattern: {\n type: 'string',\n format: 'regex',\n },\n additionalItems: { $ref: '#' },\n items: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/schemaArray' }],\n default: true,\n },\n maxItems: { $ref: '#/definitions/nonNegativeInteger' },\n minItems: { $ref: '#/definitions/nonNegativeIntegerDefault0' },\n uniqueItems: {\n type: 'boolean',\n default: false,\n },\n contains: { $ref: '#' },\n maxProperties: { $ref: '#/definitions/nonNegativeInteger' },\n minProperties: { $ref: '#/definitions/nonNegativeIntegerDefault0' },\n required: { $ref: '#/definitions/stringArray' },\n additionalProperties: { $ref: '#' },\n definitions: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n properties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n patternProperties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n propertyNames: { format: 'regex' },\n default: {},\n },\n dependencies: {\n type: 'object',\n additionalProperties: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }],\n },\n },\n propertyNames: { $ref: '#' },\n const: true,\n enum: {\n type: 'array',\n items: true,\n minItems: 1,\n uniqueItems: true,\n },\n type: {\n anyOf: [\n { $ref: '#/definitions/simpleTypes' },\n {\n type: 'array',\n items: { $ref: '#/definitions/simpleTypes' },\n minItems: 1,\n uniqueItems: true,\n },\n ],\n },\n format: { type: 'string' },\n contentMediaType: { type: 'string' },\n contentEncoding: { type: 'string' },\n if: { $ref: '#' },\n then: { $ref: '#' },\n else: { $ref: '#' },\n allOf: { $ref: '#/definitions/schemaArray' },\n anyOf: { $ref: '#/definitions/schemaArray' },\n oneOf: { $ref: '#/definitions/schemaArray' },\n not: { $ref: '#' },\n },\n default: true,\n};\n\nexport const createTestSchema = optionsSchema => ({\n $schema: 'http://json-schema.org/draft-07/schema#',\n $id: 'http://www.splunk.com/dashboard.schema.json',\n title: 'Dashboard Definition',\n description: 'Dashboard Definition',\n type: 'object',\n properties: optionsSchema,\n});\n\n// Below 2 regexs are copied from dashboard-framework/packages/dashboard-utils/src/token.jsc\nconst TOKEN_NAMESPACE_PREFIX_PATTERN = /(\\w+:)?/.source;\n// ex: token.name|suh (old-style filter chain)\n// ex: token.name|lower|capitalize (new-style filter chain)\nconst TOKEN_NAME_CHARS_PATTERN = /([^$|:]+?)(\\|[|\\w]+)?/.source;\n\nexport const TOKEN_PATTERN =\n /\\$/.source + TOKEN_NAMESPACE_PREFIX_PATTERN + TOKEN_NAME_CHARS_PATTERN + /\\$/.source;\n// rgb and rgba regexes were derived from:\n// https://stackoverflow.com/questions/9585973/javascript-regular-expression-for-rgb-values/9586150\n// https://github.com/regexhq/rgba-regex\n// NOTE: this will incorrectly accept values like rgb(999,999,999), but may be overkill to specify a regex that limits values to <= 255\nexport const rgbColorPattern = /^rgb\\(\\s*(\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/;\nexport const rgbaColorPattern = /^rgba\\(\\s*(\\d{1,3}%?),\\s*(\\d{1,3}%?),\\s*(\\d{1,3}%?),\\s*(\\d*(?:\\.\\d+)?)\\)$/;\n// todo: rename this to COLOR_PATTERN and replace all occurences.\nexport const colorPattern = '^#[0-9a-fA-F]{6}$|transparent';\nexport const colorPatternWithRGBA = `${colorPattern}|${rgbColorPattern.source}|${rgbaColorPattern.source}`;\nexport const COLOR_OR_TOKEN_PATTERN = `${colorPattern}|${TOKEN_PATTERN}`;\nexport const COLOR_OR_TOKEN_PATTERN_WITH_RGBA = `${colorPatternWithRGBA}|${TOKEN_PATTERN}`;\n// dynamic option DSL expressions always start with a >\nexport const DYNAMIC_OPTIONS_DSL_PATTERN = /^>.*/.source;\n/**\n * Returns the regex string that matches each passed in value as well as tokens.\n * @param {Array.<string>} values\n * @returns {string}\n */\nexport const getPattern = values =>\n values.reduce((accumulator, value) => `${accumulator}|^${value}$`, TOKEN_PATTERN);\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/schemaUtils.js"],"names":["$schema","$id","title","definitions","schemaArray","type","minItems","items","$ref","nonNegativeInteger","minimum","nonNegativeIntegerDefault0","allOf","default","simpleTypes","enum","stringArray","uniqueItems","properties","format","$comment","description","readOnly","examples","multipleOf","exclusiveMinimum","maximum","exclusiveMaximum","maxLength","minLength","pattern","additionalItems","anyOf","maxItems","contains","maxProperties","minProperties","required","additionalProperties","patternProperties","propertyNames","dependencies","const","contentMediaType","contentEncoding","if","then","else","oneOf","not","createTestSchema","optionsSchema","TOKEN_NAMESPACE_PREFIX_PATTERN","source","TOKEN_NAME_CHARS_PATTERN","TOKEN_PATTERN","rgbColorPattern","rgbaColorPattern","colorPattern","colorPatternWithRGBA","concat","COLOR_OR_TOKEN_PATTERN","COLOR_OR_TOKEN_PATTERN_WITH_RGBA","DYNAMIC_OPTIONS_DSL_PATTERN","getPattern","values","reduce","accumulator","value"],"m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AEiC;EAChB,CAAC;AAAA,CAAC;;AAEF;AACA,IAAMC,8BAA8B,GAAG,SAAS,CAACC,MAAM;AACvD;AACA;AACA,IAAMC,wBAAwB,GAAG,uBAAuB,CAACD,MAAM;AAExD,IAAME,aAAa,GACtB,IAAI,CAACF,MAAM,GAAGD,8BAA8B,GAAGE,wBAAwB,GAAG,IAAI,CAACD,MAAM;AACzF;AACA;AACA;AACA;AACO,IAAMG,eAAe,GAAG,iDAAiD;AACzE,IAAMC,gBAAgB,GAAG,2EAA2E;AAC3G;AACO,IAAMC,YAAY,GAAG,+BAA+B;AACpD,IAAMC,oBAAoB,MAAAC,MAAA,CAAMF,YAAY,OAAAE,MAAA,CAAIJ,eAAe,CAACH,MAAM,OAAAO,MAAA,CAAIH,gBAAgB,CAACJ,MAAM,CAAE;AACnG,IAAMQ,sBAAsB,MAAAD,MAAA,CAAMF,YAAY,OAAAE,MAAA,CAAIL,aAAa,CAAE;AACjE,IAAMO,gCAAgC,MAAAF,MAAA,CAAMD,oBAAoB,OAAAC,MAAA,CAAIL,aAAa,CAAE;AAC1F;AACO,IAAMQ,2BAA2B,GAAG,MAAM,CAACV,MAAM;AACxD;AACA;AACA;AACA;AACA;AACO,IAAMW,UAAU,GAAG,SAAbA,UAAUA,CAAGC,MAAM;EAAA,OAC5BA,MAAM,CAACC,MAAM,CAAC,UAACC,WAAW,EAAEC,KAAK;IAAA,UAAAR,MAAA,CAAQO,WAAW,QAAAP,MAAA,CAAKQ,KAAK;EAAA,CAAG,EAAEb,aAAa,CAAC;AAAA,E","file":"schemaUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n","export default {\n $schema: 'http://json-schema.org/draft-07/schema#',\n $id: 'http://json-schema.org/draft-07/schema#',\n title: 'Core schema meta-schema',\n definitions: {\n schemaArray: {\n type: 'array',\n minItems: 1,\n items: { $ref: '#' },\n },\n nonNegativeInteger: {\n type: 'integer',\n minimum: 0,\n },\n nonNegativeIntegerDefault0: {\n allOf: [{ $ref: '#/definitions/nonNegativeInteger' }, { default: 0 }],\n },\n simpleTypes: {\n enum: ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'],\n },\n stringArray: {\n type: 'array',\n items: { type: 'string' },\n uniqueItems: true,\n default: [],\n },\n },\n type: ['object', 'boolean'],\n properties: {\n $id: {\n type: 'string',\n format: 'uri-reference',\n },\n $schema: {\n type: 'string',\n format: 'uri',\n },\n $ref: {\n type: 'string',\n format: 'uri-reference',\n },\n $comment: {\n type: 'string',\n },\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n default: true,\n readOnly: {\n type: 'boolean',\n default: false,\n },\n examples: {\n type: 'array',\n items: true,\n },\n multipleOf: {\n type: 'number',\n exclusiveMinimum: 0,\n },\n maximum: {\n type: 'number',\n },\n exclusiveMaximum: {\n type: 'number',\n },\n minimum: {\n type: 'number',\n },\n exclusiveMinimum: {\n type: 'number',\n },\n maxLength: { $ref: '#/definitions/nonNegativeInteger' },\n minLength: { $ref: '#/definitions/nonNegativeIntegerDefault0' },\n pattern: {\n type: 'string',\n format: 'regex',\n },\n additionalItems: { $ref: '#' },\n items: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/schemaArray' }],\n default: true,\n },\n maxItems: { $ref: '#/definitions/nonNegativeInteger' },\n minItems: { $ref: '#/definitions/nonNegativeIntegerDefault0' },\n uniqueItems: {\n type: 'boolean',\n default: false,\n },\n contains: { $ref: '#' },\n maxProperties: { $ref: '#/definitions/nonNegativeInteger' },\n minProperties: { $ref: '#/definitions/nonNegativeIntegerDefault0' },\n required: { $ref: '#/definitions/stringArray' },\n additionalProperties: { $ref: '#' },\n definitions: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n properties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n default: {},\n },\n patternProperties: {\n type: 'object',\n additionalProperties: { $ref: '#' },\n propertyNames: { format: 'regex' },\n default: {},\n },\n dependencies: {\n type: 'object',\n additionalProperties: {\n anyOf: [{ $ref: '#' }, { $ref: '#/definitions/stringArray' }],\n },\n },\n propertyNames: { $ref: '#' },\n const: true,\n enum: {\n type: 'array',\n items: true,\n minItems: 1,\n uniqueItems: true,\n },\n type: {\n anyOf: [\n { $ref: '#/definitions/simpleTypes' },\n {\n type: 'array',\n items: { $ref: '#/definitions/simpleTypes' },\n minItems: 1,\n uniqueItems: true,\n },\n ],\n },\n format: { type: 'string' },\n contentMediaType: { type: 'string' },\n contentEncoding: { type: 'string' },\n if: { $ref: '#' },\n then: { $ref: '#' },\n else: { $ref: '#' },\n allOf: { $ref: '#/definitions/schemaArray' },\n anyOf: { $ref: '#/definitions/schemaArray' },\n oneOf: { $ref: '#/definitions/schemaArray' },\n not: { $ref: '#' },\n },\n default: true,\n};\n\nexport const createTestSchema = optionsSchema => ({\n $schema: 'http://json-schema.org/draft-07/schema#',\n $id: 'http://www.splunk.com/dashboard.schema.json',\n title: 'Dashboard Definition',\n description: 'Dashboard Definition',\n type: 'object',\n properties: optionsSchema,\n});\n\n// Below 2 regexs are copied from dashboard-framework/packages/dashboard-utils/src/token.jsc\nconst TOKEN_NAMESPACE_PREFIX_PATTERN = /(\\w+:)?/.source;\n// ex: token.name|suh (old-style filter chain)\n// ex: token.name|lower|capitalize (new-style filter chain)\nconst TOKEN_NAME_CHARS_PATTERN = /([^$|:]+?)(\\|[|\\w]+)?/.source;\n\nexport const TOKEN_PATTERN =\n /\\$/.source + TOKEN_NAMESPACE_PREFIX_PATTERN + TOKEN_NAME_CHARS_PATTERN + /\\$/.source;\n// rgb and rgba regexes were derived from:\n// https://stackoverflow.com/questions/9585973/javascript-regular-expression-for-rgb-values/9586150\n// https://github.com/regexhq/rgba-regex\n// NOTE: this will incorrectly accept values like rgb(999,999,999), but may be overkill to specify a regex that limits values to <= 255\nexport const rgbColorPattern = /^rgb\\(\\s*(\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})\\)$/;\nexport const rgbaColorPattern = /^rgba\\(\\s*(\\d{1,3}%?),\\s*(\\d{1,3}%?),\\s*(\\d{1,3}%?),\\s*(\\d*(?:\\.\\d+)?)\\)$/;\n// todo: rename this to COLOR_PATTERN and replace all occurences.\nexport const colorPattern = '^#[0-9a-fA-F]{6}$|transparent';\nexport const colorPatternWithRGBA = `${colorPattern}|${rgbColorPattern.source}|${rgbaColorPattern.source}`;\nexport const COLOR_OR_TOKEN_PATTERN = `${colorPattern}|${TOKEN_PATTERN}`;\nexport const COLOR_OR_TOKEN_PATTERN_WITH_RGBA = `${colorPatternWithRGBA}|${TOKEN_PATTERN}`;\n// dynamic option DSL expressions always start with a >\nexport const DYNAMIC_OPTIONS_DSL_PATTERN = /^>.*/.source;\n/**\n * Returns the regex string that matches each passed in value as well as tokens.\n * @param {Array.<string>} values\n * @returns {string}\n */\nexport const getPattern = values =>\n values.reduce((accumulator, value) => `${accumulator}|^${value}$`, TOKEN_PATTERN);\n"],"sourceRoot":""}
|
package/simpleXMLOptions.js
CHANGED
|
@@ -198,8 +198,9 @@ var simpleXMLOptionsToPropsMap = {
|
|
|
198
198
|
'chart.bubbleMinimumSize': 'bubbleMinSize',
|
|
199
199
|
'chart.bubbleSizeBy': 'bubbleSizeBy'
|
|
200
200
|
};
|
|
201
|
-
var propsToSimpleXMLOptionsMap = lodash_invert__WEBPACK_IMPORTED_MODULE_0___default()(simpleXMLOptionsToPropsMap);
|
|
201
|
+
var propsToSimpleXMLOptionsMap = lodash_invert__WEBPACK_IMPORTED_MODULE_0___default()(simpleXMLOptionsToPropsMap);
|
|
202
202
|
|
|
203
|
+
// export to make it testable
|
|
203
204
|
var replaceObjectKeysFromMap = function replaceObjectKeysFromMap() {
|
|
204
205
|
var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
205
206
|
var map = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -209,7 +210,6 @@ var replaceObjectKeysFromMap = function replaceObjectKeysFromMap() {
|
|
|
209
210
|
var nuObject = {};
|
|
210
211
|
Object.keys(object).forEach(function (key) {
|
|
211
212
|
var nuKey = map[key];
|
|
212
|
-
|
|
213
213
|
if (!nuKey) {
|
|
214
214
|
if (isValidKey(key)) {
|
|
215
215
|
// @TODO(pwied):
|
package/simpleXMLOptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/invert\"","webpack:///./src/simpleXMLOptions.js"],"names":["simpleXMLOptionsToPropsMap","propsToSimpleXMLOptionsMap","invert","replaceObjectKeysFromMap","object","map","isValidKey","nuObject","Object","nuKey","getPropsForSimpleXMLOptions","options","value","getSimpleXMLOptionsForProps","props"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DA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,2BAA8B;AAAA,MAACC,KAAD;AAAA,SACvCX,wBAAwB,QADe,0BACf,CADe;AAApC,E","file":"simpleXMLOptions.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 62);\n","module.exports = require(\"lodash/invert\");","import invert from 'lodash/invert';\n\nconst simpleXMLOptionsToPropsMap = {\n 'annotation.categoryColors': 'annotationColor',\n 'axisLabelsX.axisVisibility': 'xAxisVisibility',\n 'axisLabelsY.axisVisibility': 'yAxisVisibility',\n 'axisLabelsX.integerUnits': 'roundXAxisLabelsToInteger',\n 'axisLabelsY.integerUnits': 'roundYAxisLabelsToInteger',\n 'axisLabelsY2.integerUnits': 'roundY2AxisLabelsToInteger',\n 'axisLabelsY2.axisVisibility': 'y2AxisVisibility',\n 'axisLabelsX.extendsAxisRange': 'xAxisExtendsAxisRange',\n 'axisLabelsY.extendsAxisRange': 'yAxisExtendsAxisRange',\n 'axisLabelsX.majorLabelStyle.rotation': 'xAxisMajorLabelRotation',\n 'axisLabelsX.majorLabelVisibility': 'xAxisMajorLabelVisibility',\n 'axisLabelsY.majorLabelVisibility': 'yAxisMajorLabelVisibility',\n 'axisLabelsY2.majorLabelVisibility': 'y2AxisMajorLabelVisibility',\n 'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',\n 'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',\n 'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',\n 'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',\n 'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',\n 'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',\n 'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',\n 'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',\n 'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',\n 'axisLabelsX.majorUnit': 'xAxisMajorUnit',\n 'axisLabelsY.majorUnit': 'yAxisMajorUnit',\n 'axisLabelsY2.majorUnit': 'y2AxisMajorUnit',\n 'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',\n 'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',\n 'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',\n 'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',\n 'axisX.abbreviation': 'xAxisAbbreviation',\n 'axisY.abbreviation': 'yAxisAbbreviation',\n 'axisY2.abbreviation': 'y2AxisAbbreviation',\n 'axisX.includeZero': 'xAxisIncludeZero',\n 'axisY.includeZero': 'yAxisIncludeZero',\n 'axisY2.includeZero': 'y2AxisIncludeZero',\n 'axisX.maximumNumber': 'xAxisMax',\n 'axisY.maximumNumber': 'yAxisMax',\n 'axisY2.maximumNumber': 'y2AxisMax',\n 'axisX.minimumNumber': 'xAxisMin',\n 'axisY.minimumNumber': 'yAxisMin',\n 'axisY2.minimumNumber': 'y2AxisMin',\n 'axisX.scale': 'xAxisScale',\n 'axisY.scale': 'yAxisScale',\n 'axisY2.scale': 'y2AxisScale',\n 'axisTitleX.text': 'xAxisTitleText',\n 'axisTitleY.text': 'yAxisTitleText',\n 'axisTitleY2.text': 'y2AxisTitleText',\n 'axisTitleX.alignment': 'xAxisTitleAlignment',\n 'axisTitleY.alignment': 'yAxisTitleAlignment',\n 'axisTitleY2.alignment': 'y2AxisTitleAlignment',\n 'axisTitleX.visibility': 'xAxisTitleVisibility',\n 'axisTitleY.visibility': 'yAxisTitleVisibility',\n 'axisTitleY2.visibility': 'y2AxisTitleVisibility',\n 'chart.resultTruncationLimit': 'resultTruncationLimit',\n 'chart.overlayFields': 'overlayFields',\n 'axisY2.enabled': 'enableY2Axis',\n 'axisY2.fields': 'y2AxisField',\n 'chart.barSpacing': 'barSpacing',\n 'chart.columnSpacing': 'columnSpacing',\n 'chart.seriesSpacing': 'seriesSpacing',\n 'chart.nullValueMode': 'nullValueMode',\n 'chart.markerSize': 'markerSize',\n 'chart.showDataLabels': 'showDataLabels',\n 'chart.showLegend': 'showLegend',\n 'chart.showLines': 'showLines',\n 'chart.showMarkers': 'showMarkers',\n 'chart.stackMode': 'stackMode',\n 'data.fieldListMode': 'fieldListMode',\n 'data.fieldShowList': 'fieldShowList',\n 'data.fieldHideList': 'fieldHideList',\n 'gridLinesX.showMajorLines': 'showMajorXGridLines',\n 'gridLinesY.showMajorLines': 'showMajorYGridLines',\n 'gridLinesY2.showMajorLines': 'showMajorY2GridLines',\n 'gridLinesX.showMinorLines': 'showMinorXGridLines',\n 'gridLinesY.showMinorLines': 'showMinorYGridLines',\n 'gridLinesY2.showMinorLines': 'showMinorY2GridLines',\n 'layout.splitSeries': 'splitSeries',\n 'layout.splitSeries.allowIndependentYRanges': 'allowIndependentYRanges',\n 'legend.labels': 'legendLabels',\n 'legend.labelStyle.overflowMode': 'legendLabelOverflowMode',\n 'legend.masterLegend': 'masterLegend',\n 'legend.mode': 'legendMode',\n 'legend.placement': 'legendPlacement',\n 'chart.bubbleMaximumSize': 'bubbleMaxSize',\n 'chart.bubbleMinimumSize': 'bubbleMinSize',\n 'chart.bubbleSizeBy': 'bubbleSizeBy',\n};\n\nconst propsToSimpleXMLOptionsMap = invert(simpleXMLOptionsToPropsMap);\n\n// export to make it testable\nexport const replaceObjectKeysFromMap = (object = {}, map = {}, isValidKey = () => true) => {\n const nuObject = {};\n Object.keys(object).forEach(key => {\n const nuKey = map[key];\n if (!nuKey) {\n if (isValidKey(key)) {\n // @TODO(pwied):\n // get rid of this and ensure all known props are passed down to visualizations explicitly\n // captured here: SCP-14634\n nuObject[key] = object[key];\n }\n } else {\n nuObject[nuKey] = object[key];\n }\n });\n return nuObject;\n};\n\nexport const getPropsForSimpleXMLOptions = (options = {}) =>\n replaceObjectKeysFromMap(options, simpleXMLOptionsToPropsMap, value => value.indexOf('.') === -1);\n\nexport const getSimpleXMLOptionsForProps = (props = {}) =>\n replaceObjectKeysFromMap(props, propsToSimpleXMLOptionsMap);\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/invert\"","webpack:///./src/simpleXMLOptions.js"],"names":["simpleXMLOptionsToPropsMap","propsToSimpleXMLOptionsMap","invert","replaceObjectKeysFromMap","object","arguments","length","undefined","map","isValidKey","nuObject","Object","keys","forEach","key","nuKey","getPropsForSimpleXMLOptions","options","value","indexOf","getSimpleXMLOptionsForProps","props"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,0C;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmC;AAEnC,IAAMA,0BAA0B,GAAG;EAC/B,2BAA2B,EAAE,iBAAiB;EAC9C,4BAA4B,EAA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AAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,OAClDF,wBAAwB,CAACkB,KAAK,EAAEpB,0BAA0B,CAAC;AAAA,E","file":"simpleXMLOptions.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 62);\n","module.exports = require(\"lodash/invert\");","import invert from 'lodash/invert';\n\nconst simpleXMLOptionsToPropsMap = {\n 'annotation.categoryColors': 'annotationColor',\n 'axisLabelsX.axisVisibility': 'xAxisVisibility',\n 'axisLabelsY.axisVisibility': 'yAxisVisibility',\n 'axisLabelsX.integerUnits': 'roundXAxisLabelsToInteger',\n 'axisLabelsY.integerUnits': 'roundYAxisLabelsToInteger',\n 'axisLabelsY2.integerUnits': 'roundY2AxisLabelsToInteger',\n 'axisLabelsY2.axisVisibility': 'y2AxisVisibility',\n 'axisLabelsX.extendsAxisRange': 'xAxisExtendsAxisRange',\n 'axisLabelsY.extendsAxisRange': 'yAxisExtendsAxisRange',\n 'axisLabelsX.majorLabelStyle.rotation': 'xAxisMajorLabelRotation',\n 'axisLabelsX.majorLabelVisibility': 'xAxisMajorLabelVisibility',\n 'axisLabelsY.majorLabelVisibility': 'yAxisMajorLabelVisibility',\n 'axisLabelsY2.majorLabelVisibility': 'y2AxisMajorLabelVisibility',\n 'axisLabelsX.majorTickSize': 'xAxisMajorTickSize',\n 'axisLabelsY.majorTickSize': 'yAxisMajorTickSize',\n 'axisLabelsY2.majorTickSize': 'y2AxisMajorTickSize',\n 'axisLabelsX.minorTickSize': 'xAxisMinorTickSize',\n 'axisLabelsY.minorTickSize': 'yAxisMinorTickSize',\n 'axisLabelsY2.minorTickSize': 'y2AxisMinorTickSize',\n 'axisLabelsX.majorTickVisibility': 'xAxisMajorTickVisibility',\n 'axisLabelsY.majorTickVisibility': 'yAxisMajorTickVisibility',\n 'axisLabelsY2.majorTickVisibility': 'y2AxisMajorTickVisibility',\n 'axisLabelsX.majorUnit': 'xAxisMajorUnit',\n 'axisLabelsY.majorUnit': 'yAxisMajorUnit',\n 'axisLabelsY2.majorUnit': 'y2AxisMajorUnit',\n 'axisLabelsX.minorTickVisibility': 'xAxisMinorTickVisibility',\n 'axisLabelsY.minorTickVisibility': 'yAxisMinorTickVisibility',\n 'axisLabelsY2.minorTickVisibility': 'y2AxisMinorTickVisibility',\n 'axisLabelsX.maxLabelParts': 'xAxisMaxLabelParts',\n 'axisX.abbreviation': 'xAxisAbbreviation',\n 'axisY.abbreviation': 'yAxisAbbreviation',\n 'axisY2.abbreviation': 'y2AxisAbbreviation',\n 'axisX.includeZero': 'xAxisIncludeZero',\n 'axisY.includeZero': 'yAxisIncludeZero',\n 'axisY2.includeZero': 'y2AxisIncludeZero',\n 'axisX.maximumNumber': 'xAxisMax',\n 'axisY.maximumNumber': 'yAxisMax',\n 'axisY2.maximumNumber': 'y2AxisMax',\n 'axisX.minimumNumber': 'xAxisMin',\n 'axisY.minimumNumber': 'yAxisMin',\n 'axisY2.minimumNumber': 'y2AxisMin',\n 'axisX.scale': 'xAxisScale',\n 'axisY.scale': 'yAxisScale',\n 'axisY2.scale': 'y2AxisScale',\n 'axisTitleX.text': 'xAxisTitleText',\n 'axisTitleY.text': 'yAxisTitleText',\n 'axisTitleY2.text': 'y2AxisTitleText',\n 'axisTitleX.alignment': 'xAxisTitleAlignment',\n 'axisTitleY.alignment': 'yAxisTitleAlignment',\n 'axisTitleY2.alignment': 'y2AxisTitleAlignment',\n 'axisTitleX.visibility': 'xAxisTitleVisibility',\n 'axisTitleY.visibility': 'yAxisTitleVisibility',\n 'axisTitleY2.visibility': 'y2AxisTitleVisibility',\n 'chart.resultTruncationLimit': 'resultTruncationLimit',\n 'chart.overlayFields': 'overlayFields',\n 'axisY2.enabled': 'enableY2Axis',\n 'axisY2.fields': 'y2AxisField',\n 'chart.barSpacing': 'barSpacing',\n 'chart.columnSpacing': 'columnSpacing',\n 'chart.seriesSpacing': 'seriesSpacing',\n 'chart.nullValueMode': 'nullValueMode',\n 'chart.markerSize': 'markerSize',\n 'chart.showDataLabels': 'showDataLabels',\n 'chart.showLegend': 'showLegend',\n 'chart.showLines': 'showLines',\n 'chart.showMarkers': 'showMarkers',\n 'chart.stackMode': 'stackMode',\n 'data.fieldListMode': 'fieldListMode',\n 'data.fieldShowList': 'fieldShowList',\n 'data.fieldHideList': 'fieldHideList',\n 'gridLinesX.showMajorLines': 'showMajorXGridLines',\n 'gridLinesY.showMajorLines': 'showMajorYGridLines',\n 'gridLinesY2.showMajorLines': 'showMajorY2GridLines',\n 'gridLinesX.showMinorLines': 'showMinorXGridLines',\n 'gridLinesY.showMinorLines': 'showMinorYGridLines',\n 'gridLinesY2.showMinorLines': 'showMinorY2GridLines',\n 'layout.splitSeries': 'splitSeries',\n 'layout.splitSeries.allowIndependentYRanges': 'allowIndependentYRanges',\n 'legend.labels': 'legendLabels',\n 'legend.labelStyle.overflowMode': 'legendLabelOverflowMode',\n 'legend.masterLegend': 'masterLegend',\n 'legend.mode': 'legendMode',\n 'legend.placement': 'legendPlacement',\n 'chart.bubbleMaximumSize': 'bubbleMaxSize',\n 'chart.bubbleMinimumSize': 'bubbleMinSize',\n 'chart.bubbleSizeBy': 'bubbleSizeBy',\n};\n\nconst propsToSimpleXMLOptionsMap = invert(simpleXMLOptionsToPropsMap);\n\n// export to make it testable\nexport const replaceObjectKeysFromMap = (object = {}, map = {}, isValidKey = () => true) => {\n const nuObject = {};\n Object.keys(object).forEach(key => {\n const nuKey = map[key];\n if (!nuKey) {\n if (isValidKey(key)) {\n // @TODO(pwied):\n // get rid of this and ensure all known props are passed down to visualizations explicitly\n // captured here: SCP-14634\n nuObject[key] = object[key];\n }\n } else {\n nuObject[nuKey] = object[key];\n }\n });\n return nuObject;\n};\n\nexport const getPropsForSimpleXMLOptions = (options = {}) =>\n replaceObjectKeysFromMap(options, simpleXMLOptionsToPropsMap, value => value.indexOf('.') === -1);\n\nexport const getSimpleXMLOptionsForProps = (props = {}) =>\n replaceObjectKeysFromMap(props, propsToSimpleXMLOptionsMap);\n"],"sourceRoot":""}
|