@splunk/visualizations-shared 25.7.2 → 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/dataSourceUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/dataSourceUtils.ts"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;AClFA,
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/dataSourceUtils.ts"],"names":["DataSourceState","exports","getDataSourceState","dataSource","NONEXISTENT","error","data","ERROR","LOADING","OK","getDataSourceStateInfo","dataSourceState","hasError","isMissing","isLoading"],"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,iCAA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tils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 55);\n","export enum DataSourceState {\n NONEXISTENT = 0,\n ERROR = 1,\n LOADING = 2,\n OK = 3,\n}\n\n/**\n * represents the data in a raw columnar format, resulting from a splunk\n * query request.\n */\nexport interface FieldEntry {\n name: string;\n type?: string;\n groupby_rank?: string; // eslint-disable-line\n splitby_field?: string; // eslint-disable-line\n splitby_value?: string; // eslint-disable-line\n data_source?: string; // eslint-disable-line\n}\n\nconst getDataSourceState = (dataSource): DataSourceState => {\n if (!dataSource) {\n return DataSourceState.NONEXISTENT;\n }\n const { error, data } = dataSource;\n if (dataSource.error) {\n return DataSourceState.ERROR;\n }\n if (error == null && data == null) {\n return DataSourceState.LOADING;\n }\n return DataSourceState.OK;\n};\n/**\n * A utility fn to return data source state info as an object of boolean flags\n * @param dataSource\n */\nexport const getDataSourceStateInfo = (\n dataSource\n): { hasError: boolean; isMissing: boolean; isLoading: boolean } => {\n const dataSourceState: DataSourceState = getDataSourceState(dataSource);\n return {\n hasError: dataSourceState === DataSourceState.ERROR,\n isMissing: dataSourceState === DataSourceState.NONEXISTENT,\n isLoading: dataSourceState === DataSourceState.LOADING,\n };\n};\n"],"sourceRoot":""}
|
package/domUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/memoize\"","webpack:///./src/domUtils.js"],"names":["computeTextSize","memoize","canvas","document","context","measure","window"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,2C;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"lodash/memoize\"","webpack:///./src/domUtils.js"],"names":["computeTextSize","memoize","text","font","canvas","document","createElement","context","getContext","measure","measureText","width","concat","getPropValue","element","property","window","getComputedStyle","getPropertyValue"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,2C;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAqC;AAE9B,IAAMA,eAAe,GAAGC,qDAAO,CAClC,UAACC,IAAI,EAAEC,IAAI,EAAK;EACZ,IAAMC,MAAM,GAAGC,QAAQ,CAACC,aAAa,CAAC,QAAQ,CAAC;EAC/C,IAAMC,OAAO,GAAGH,MAAM,CAACI,UAAU,CAAC,IAAI,CAAC;EACvCD,OAAO,CAACJ,IAAI,GAAGA,IAAI;EACnB,IAAMM,OAAO,GAAGF,OAAO,CAACG,WAAW,CAACR,IAAI,CAAC;EACzC,OAAOO,OAAO,CAACE,KAAK;AACxB,CAAC,EACD,UAACT,IAAI,EAAEC,IAAI;EAAA,UAAAS,MAAA,CAAQV,IAAI,EAAAU,MAAA,CAAGT,IAAI;AAAA,CAAE,CACnC;AAEM,SAASU,YAAYA,CAACC,OAAO,EAAEC,QAAQ,EAAE;EAC5C,OAAOC,MAAM,CAACC,gBAAgB,CAACH,OAAO,CAAC,CAACI,gBAAgB,CAACH,QAAQ,CAAC;AACtE,C","file":"domUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 56);\n","module.exports = require(\"lodash/memoize\");","import memoize from 'lodash/memoize';\n\nexport const computeTextSize = memoize(\n (text, font) => {\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n context.font = font;\n const measure = context.measureText(text);\n return measure.width;\n },\n (text, font) => `${text}${font}`\n);\n\nexport function getPropValue(element, property) {\n return window.getComputedStyle(element).getPropertyValue(property);\n}\n"],"sourceRoot":""}
|
package/hocUtils.js
CHANGED
|
@@ -127,12 +127,10 @@ exports.findClosestMatchFromDefaultList = void 0;
|
|
|
127
127
|
|
|
128
128
|
findClosestMatch(list, obj) -> returns index 1.
|
|
129
129
|
*/
|
|
130
|
-
|
|
131
130
|
var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
|
|
132
131
|
if (!Array.isArray(searchList) || searchList.length === 0) {
|
|
133
132
|
return -1;
|
|
134
133
|
}
|
|
135
|
-
|
|
136
134
|
var keys = Object.keys(inputObj);
|
|
137
135
|
var maxMatchCnt = 0;
|
|
138
136
|
var maxMatchIdx = 0;
|
|
@@ -143,7 +141,6 @@ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(s
|
|
|
143
141
|
matchCnt += 1;
|
|
144
142
|
}
|
|
145
143
|
});
|
|
146
|
-
|
|
147
144
|
if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
|
|
148
145
|
maxMatchCnt = matchCnt;
|
|
149
146
|
maxMatchIdx = idx;
|
|
@@ -151,7 +148,6 @@ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(s
|
|
|
151
148
|
});
|
|
152
149
|
return maxMatchIdx;
|
|
153
150
|
};
|
|
154
|
-
|
|
155
151
|
exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
|
|
156
152
|
|
|
157
153
|
/***/ }),
|
|
@@ -170,14 +166,11 @@ module.exports = require("lodash");
|
|
|
170
166
|
|
|
171
167
|
|
|
172
168
|
var _typeof = __webpack_require__(19);
|
|
173
|
-
|
|
174
169
|
Object.defineProperty(exports, "__esModule", {
|
|
175
170
|
value: true
|
|
176
171
|
});
|
|
177
172
|
exports.deepMergeWithArrayPrimitiveOverrides = void 0;
|
|
178
|
-
|
|
179
173
|
var lodash_1 = __webpack_require__(4);
|
|
180
|
-
|
|
181
174
|
var mapUtils_1 = __webpack_require__(28);
|
|
182
175
|
/**
|
|
183
176
|
* helper to deeply merge objects while preserving arrays in earlier source objects
|
|
@@ -192,21 +185,16 @@ var mapUtils_1 = __webpack_require__(28);
|
|
|
192
185
|
*
|
|
193
186
|
* @returns {Object}
|
|
194
187
|
*/
|
|
195
|
-
|
|
196
|
-
|
|
197
188
|
var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
|
|
198
189
|
var clone = lodash_1.cloneDeep(initial);
|
|
199
|
-
|
|
200
190
|
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
201
191
|
sources[_key - 1] = arguments[_key];
|
|
202
192
|
}
|
|
203
|
-
|
|
204
193
|
sources.forEach(function (sourceToApply) {
|
|
205
194
|
Object.keys(sourceToApply).forEach(function (sourceKey) {
|
|
206
195
|
if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
|
|
207
196
|
clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
|
|
208
197
|
}
|
|
209
|
-
|
|
210
198
|
if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
|
|
211
199
|
clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
|
|
212
200
|
} else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
|
|
@@ -214,7 +202,6 @@ var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveO
|
|
|
214
202
|
for (var i = 0; i < clone[sourceKey].length; i += 1) {
|
|
215
203
|
if (_typeof(clone[sourceKey][i]) === 'object') {
|
|
216
204
|
var closestMatchIdx = mapUtils_1.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
|
|
217
|
-
|
|
218
205
|
if (closestMatchIdx > -1) {
|
|
219
206
|
clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
|
|
220
207
|
}
|
|
@@ -225,7 +212,6 @@ var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveO
|
|
|
225
212
|
});
|
|
226
213
|
return clone;
|
|
227
214
|
};
|
|
228
|
-
|
|
229
215
|
exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
|
|
230
216
|
|
|
231
217
|
/***/ })
|
package/hocUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///./src/mapUtils.ts","webpack:///external \"lodash\"","webpack:///./src/hocUtils.ts"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,0D;;;;;;;;;;;;;;ACKA;;;;;;;;;;;;;;;;;AAiBG;;AACI,IAAM,+BAA+B,GAAG,SAAlC,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,oCAApC,C","file":"hocUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 57);\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","export interface GeoJsonDataType {\n type: string;\n coordinates: Array<Array<Array<[number, number]>>>;\n}\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n","module.exports = require(\"lodash\");","import { cloneDeep } from 'lodash';\nimport { findClosestMatchFromDefaultList } from './mapUtils';\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object\n * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).\n * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair\n * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.\n *\n * @method deepMergeWithArrayPrimitiveOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayPrimitiveOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey],\n sourceToApply[sourceKey]\n );\n } else if (\n Array.isArray(clone[sourceKey]) &&\n typeof clone[sourceKey][0] === 'object' &&\n !Array.isArray(clone[sourceKey][0])\n ) {\n // If option is an array of objects\n for (let i = 0; i < clone[sourceKey].length; i += 1) {\n if (typeof clone[sourceKey][i] === 'object') {\n const closestMatchIdx = findClosestMatchFromDefaultList(\n sourceToApply[sourceKey],\n clone[sourceKey][i]\n );\n if (closestMatchIdx > -1) {\n clone[sourceKey][i] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey][i],\n sourceToApply[sourceKey][closestMatchIdx]\n );\n }\n }\n }\n }\n });\n });\n return clone;\n};\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@babel/runtime/helpers/typeof\"","webpack:///./src/mapUtils.ts","webpack:///external \"lodash\"","webpack:///./src/hocUtils.ts"],"names":["findClosestMatchFromDefaultList","searchList","inputObj","Array","isArray","length","keys","Object","maxMatchCnt","maxMatchIdx","forEach","item","idx","matchCnt","key","Math","max","exports","lodash_1","require","mapUtils_1","deepMergeWithArrayPrimitiveOverrides","initial","clone","cloneDeep","_len","arguments","sources","_key","sourceToApply","sourceKey","prototype","hasOwnProperty","call","_typeof","i","closestMatchIdx"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,0D;;;;;;;;;;;;;;ACKA;;;;;;;;;;;;;;;;;;AAkBO,IAAMA,+BAA+B,GAAG,SAAlCA,+BAA+BA,CACxCC,UAA0C,EAC1CC,QAAiC,EACzB;EACR,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,IAAIA,UAAU,CAACI,MAAM,KAAK,CAAC,EAAE;IACvD,OAAO,CAAC,CAAC;;EAEb,IAAMC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACJ,QAAQ,CAAC;EAClC,IAAIM,WAAW,GAAG,CAAC;EACnB,IAAIC,WAAW,GAAG,CAAC;EAEnBR,UAAU,CAACS,OAAO,CAAC,UAACC,IAAI,EAAEC,GAAG,EAAI;IAC7B,IAAIC,QAAQ,GA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b,KAAK;AAChB,CAAC;AAzCYN,OAAA,CAAAI,oCAAoC,GAAAA,oCAAA,C","file":"hocUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 57);\n","module.exports = require(\"@babel/runtime/helpers/typeof\");","export interface GeoJsonDataType {\n type: string;\n coordinates: Array<Array<Array<[number, number]>>>;\n}\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n","module.exports = require(\"lodash\");","import { cloneDeep } from 'lodash';\nimport { findClosestMatchFromDefaultList } from './mapUtils';\n\n/**\n * helper to deeply merge objects while preserving arrays in earlier source objects\n * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object\n * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).\n * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair\n * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.\n *\n * @method deepMergeWithArrayPrimitiveOverrides\n * @param {Object} initial - target object to merge values into\n * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones\n *\n * @returns {Object}\n */\nexport const deepMergeWithArrayPrimitiveOverrides = (initial, ...sources) => {\n const clone = cloneDeep(initial);\n sources.forEach(sourceToApply => {\n Object.keys(sourceToApply).forEach(sourceKey => {\n if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {\n clone[sourceKey] = cloneDeep(sourceToApply[sourceKey]);\n }\n if (\n clone[sourceKey] &&\n typeof clone[sourceKey] === 'object' &&\n !Array.isArray(clone[sourceKey]) &&\n typeof sourceToApply[sourceKey] === 'object'\n ) {\n clone[sourceKey] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey],\n sourceToApply[sourceKey]\n );\n } else if (\n Array.isArray(clone[sourceKey]) &&\n typeof clone[sourceKey][0] === 'object' &&\n !Array.isArray(clone[sourceKey][0])\n ) {\n // If option is an array of objects\n for (let i = 0; i < clone[sourceKey].length; i += 1) {\n if (typeof clone[sourceKey][i] === 'object') {\n const closestMatchIdx = findClosestMatchFromDefaultList(\n sourceToApply[sourceKey],\n clone[sourceKey][i]\n );\n if (closestMatchIdx > -1) {\n clone[sourceKey][i] = deepMergeWithArrayPrimitiveOverrides(\n clone[sourceKey][i],\n sourceToApply[sourceKey][closestMatchIdx]\n );\n }\n }\n }\n }\n });\n });\n return clone;\n};\n"],"sourceRoot":""}
|
package/i18n.js
CHANGED
|
@@ -364,14 +364,12 @@ var setI18nFunctions = function setI18nFunctions(global) {
|
|
|
364
364
|
global.gettext = function (v) {
|
|
365
365
|
return v;
|
|
366
366
|
}; // eslint-disable-line no-param-reassign
|
|
367
|
-
|
|
368
367
|
}
|
|
369
368
|
|
|
370
369
|
if (!global.locale_name) {
|
|
371
370
|
global.locale_name = function () {
|
|
372
371
|
return 'en_US';
|
|
373
372
|
}; // eslint-disable-line no-param-reassign
|
|
374
|
-
|
|
375
373
|
}
|
|
376
374
|
|
|
377
375
|
return global;
|
package/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/moment\"","webpack:///external \"numeral\"","webpack:///./src/i18n.js"],"names":["quarters","days","months","narrowMonths","localeDefinition","date_formats","medium","pattern","format","long","short","full","wide","abbreviated","narrow","min_week_days","eras","percent_format","scientific_format","first_week_day","group_symbol","minus_sign","decimal_symbol","periods","am","pm","datetime_formats","null","exp_symbol","locale_name","number_format","plus_sign","time_formats","i18n","format_decimal","numeral","format_number","format_percent","format_scientific","format_date","moment","format_datetime","format_time","format_datetime_microseconds","format_time_microseconds","setI18nFunctions","Object","global"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,2C;;;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qB;AAClCD,yDAAM,CAANA,GAAM,CAANA,QACIpC,gBAAgB,CAAhBA,2BACMA,gBAAgB,CAAhBA,yBADNA,UADJoC;AAVK;AAgBTE,aAAW,EAAE;AAAA,WACTF,qDAAM,CAANA,GAAM,CAANA,QACIpC,gBAAgB,CAAhBA,uBAAwCA,gBAAgB,CAAhBA,qBAAxCA,UAFK,MACToC,CADS;AAhBJ;AAoBTG,8BAA4B,EAAE;AAAA,WAC1BH,qDAAM,CAANA,GAAM,CAANA,QACIpC,gBAAgB,CAAhBA,uBAAwCA,gBAAgB,CAAhBA,qBAAxCA,UAFsB,MAC1BoC,CAD0B;AApBrB;AAwBTI,0BAAwB,EAAE;AAAA,WACtBJ,qDAAM,CAANA,GAAM,CAANA,QACIpC,gBAAgB,CAAhBA,uBAAwCA,gBAAgB,CAAhBA,qBAAxCA,UAFkB,MACtBoC,CADsB;AAAA;AAxBjB,CAAb;AA8BO,IAAMK,gBAAgB,GAAG,SAAnBA,gBAAmB,SAAU;AACtCC,QAAM,CAANA,mBAA0B,aAAK;AAC3B,QAAI,CAACC,MAAM,CAAX,CAAW,CAAX,EAAgB;AACZA,YAAM,CAANA,CAAM,CAANA,GAAYd,IAAI,CADJ,CACI,CAAhBc,CADY,CACS;AACxB;AAHLD;;AAKA,MAAI,CAACC,MAAM,CAAX,SAAqB;AACjBA,UAAM,CAANA,UAAiB,aAAC;AAAA;AADD,KACjBA,CADiB,CACQ;;AAC5B;;AACD,MAAI,CAACA,MAAM,CAAX,aAAyB;AACrBA,UAAM,CAANA,cAAqB;AAAA;AADA,KACrBA,CADqB,CACe;;AACvC;;AACD;AAZG;AAcPF,gBAAgB,CAAhBA,MAAgB,CAAhBA,C","file":"i18n.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 58);\n","module.exports = require(\"@splunk/moment\");","module.exports = require(\"numeral\");","import numeral from 'numeral';\nimport moment from '@splunk/moment';\n/**\n * Fixme, this is a mock i18n file to workaround window dependency from @splunk/charting\n * We need to refactor @splunk/charting to make it independent from globals\n */\n\nconst quarters = {\n 1: '1st quarter',\n 2: '2nd quarter',\n 3: '3rd quarter',\n 4: '4th quarter',\n};\n\nconst days = {\n 0: 'Monday',\n 1: 'Tuesday',\n 2: 'Wednesday',\n 3: 'Thursday',\n 4: 'Friday',\n 5: 'Saturday',\n 6: 'Sunday',\n};\n\nconst months = {\n 1: 'January',\n 2: 'February',\n 3: 'March',\n 4: 'April',\n 5: 'May',\n 6: 'June',\n 7: 'July',\n 8: 'August',\n 9: 'September',\n 10: 'October',\n 11: 'November',\n 12: 'December',\n};\n\nconst narrowMonths = {\n 1: 'J',\n 2: 'F',\n 3: 'M',\n 4: 'A',\n 5: 'M',\n 6: 'J',\n 7: 'J',\n 8: 'A',\n 9: 'S',\n 10: 'O',\n 11: 'N',\n 12: 'D',\n};\n\nconst localeDefinition = {\n date_formats: {\n medium: { pattern: 'MMM d, yyyy', format: '%(MMM)s %(d)s, %(yyyy)s' },\n long: { pattern: 'MMMM d, yyyy', format: '%(MMMM)s %(d)s, %(yyyy)s' },\n short: { pattern: 'M/d/yy', format: '%(M)s/%(d)s/%(yy)s' },\n full: { pattern: 'EEEE, MMMM d, yyyy', format: '%(EEEE)s, %(MMMM)s %(d)s, %(yyyy)s' },\n },\n quarters: {\n 'stand-alone': {\n wide: quarters,\n abbreviated: quarters,\n narrow: { 1: '1', 2: '2', 3: '3', 4: '4' },\n },\n format: {\n wide: quarters,\n abbreviated: { 1: 'Q1', 2: 'Q2', 3: 'Q3', 4: 'Q4' },\n narrow: { 1: '1', 2: '2', 3: '3', 4: '4' },\n },\n },\n min_week_days: 1,\n days: {\n 'stand-alone': {\n wide: days,\n abbreviated: days,\n narrow: { 0: 'M', 1: 'T', 2: 'W', 3: 'T', 4: 'F', 5: 'S', 6: 'S' },\n },\n format: {\n wide: days,\n abbreviated: {\n 0: 'Mon',\n 1: 'Tue',\n 2: 'Wed',\n 3: 'Thu',\n 4: 'Fri',\n 5: 'Sat',\n 6: 'Sun',\n },\n narrow: { 0: 'M', 1: 'T', 2: 'W', 3: 'T', 4: 'F', 5: 'S', 6: 'S' },\n },\n },\n eras: {\n wide: { 0: 'Before Christ', 1: 'Anno Domini' },\n abbreviated: { 0: 'BC', 1: 'AD' },\n narrow: { 0: 'B', 1: 'A' },\n },\n percent_format: '#,##0%',\n scientific_format: '#E0',\n first_week_day: 6,\n group_symbol: ',',\n minus_sign: '-',\n months: {\n 'stand-alone': {\n wide: months,\n abbreviated: months,\n narrow: narrowMonths,\n },\n format: {\n wide: months,\n abbreviated: {\n 1: 'Jan',\n 2: 'Feb',\n 3: 'Mar',\n 4: 'Apr',\n 5: 'May',\n 6: 'Jun',\n 7: 'Jul',\n 8: 'Aug',\n 9: 'Sep',\n 10: 'Oct',\n 11: 'Nov',\n 12: 'Dec',\n },\n narrow: narrowMonths,\n },\n },\n decimal_symbol: '.',\n periods: { am: 'AM', pm: 'PM' },\n datetime_formats: { null: '{1} {0}' },\n exp_symbol: 'E',\n locale_name: 'en_US',\n number_format: '#,##0.###',\n plus_sign: '+',\n time_formats: {\n medium: { pattern: 'h:mm:ss a', format: '%(h)s:%(mm)s:%(ss)s %(a)s' },\n long: { pattern: 'h:mm:ss a z', format: '%(h)s:%(mm)s:%(ss)s %(a)s %(z)s' },\n short: { pattern: 'h:mm a', format: '%(h)s:%(mm)s %(a)s' },\n full: { pattern: 'h:mm:ss a v', format: '%(h)s:%(mm)s:%(ss)s %(a)s %(v)s' },\n },\n};\n\nconst i18n = {\n format_decimal: (num, format) => numeral(num).format(format),\n format_number: (num, format) => numeral(num).format(format),\n format_percent: num => numeral(num).format('0%'),\n format_scientific: num => numeral(num).format('0,0e+0'),\n format_date: (num, format) =>\n moment(num).format(\n localeDefinition.date_formats[format] ? localeDefinition.date_formats[format].pattern : format\n ),\n format_datetime: (num, dateFormat) => {\n moment(num).format(\n localeDefinition.time_formats[dateFormat]\n ? localeDefinition.time_formats[dateFormat].pattern\n : dateFormat\n );\n },\n format_time: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n format_datetime_microseconds: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n format_time_microseconds: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n};\n\nexport const setI18nFunctions = global => {\n Object.keys(i18n).forEach(k => {\n if (!global[k]) {\n global[k] = i18n[k]; // eslint-disable-line no-param-reassign\n }\n });\n if (!global.gettext) {\n global.gettext = v => v; // eslint-disable-line no-param-reassign\n }\n if (!global.locale_name) {\n global.locale_name = () => 'en_US'; // eslint-disable-line no-param-reassign\n }\n return global;\n};\nsetI18nFunctions(window);\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/moment\"","webpack:///external \"numeral\"","webpack:///./src/i18n.js"],"names":["quarters","days","months","narrowMonths","localeDefinition","date_formats","medium","pattern","format","long","short","full","wide","abbreviated","narrow","min_week_days","eras","percent_format","scientific_format","first_week_day","group_symbol","minus_sign","decimal_symbol","periods","am","pm","datetime_formats","null","exp_symbol","locale_name","number_format","plus_sign","time_formats","i18n","format_decimal","num","numeral","format_number","format_percent","format_scientific","format_date","moment","format_datetime","dateFormat","format_time","format_datetime_microseconds","format_time_microseconds","setI18nFunctions","global","Object","keys","forEach","k","gettext","v","window"],"mappings":";;;;;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;EAAA;EACLsC,wBAAwB,EAAE,SAAAA,yBAACX,GAAG,EAAE3B,MAAM;IAAA,OAClCiC,qDAAM,CAACN,GAAG,CAAC,CAAC3B,MAAM,CACdJ,gBAAgB,CAAC4B,YAAY,CAACxB,MAAM,CAAC,GAAGJ,gBAAgB,CAAC4B,YAAY,CAACxB,MAAM,CAAC,CAACD,OAAO,GAAGC,MAAM,CACjG;EAAA;AACT,CAAC;AAEM,IAAMuC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAGC,MAAM,EAAI;EACtCC,MAAM,CAACC,IAAI,CAACjB,IAAI,CAAC,CAACkB,OAAO,CAAC,UAAAC,CAAC,EAAI;IAC3B,IAAI,CAACJ,MAAM,CAACI,CAAC,CAAC,EAAE;MACZJ,MAAM,CAACI,CAAC,CAAC,GAAGnB,IAAI,CAACmB,CAAC,CAAC,CAAC,CAAC;IACzB;EACJ,CAAC,CAAC;;EACF,IAAI,CAACJ,MAAM,CAACK,OAAO,EAAE;IACjBL,MAAM,CAACK,OAAO,GAAG,UAAAC,CAAC;MAAA,OAAIA,CAAC;IAAA,EAAC,CAAC;EAC7B;;EACA,IAAI,CAACN,MAAM,CAACnB,WAAW,EAAE;IACrBmB,MAAM,CAACnB,WAAW,GAAG;MAAA,OAAM,OAAO;IAAA,EAAC,CAAC;EACxC;;EACA,OAAOmB,MAAM;AACjB,CAAC;AACDD,gBAAgB,CAACQ,MAAM,CAAC,C","file":"i18n.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 58);\n","module.exports = require(\"@splunk/moment\");","module.exports = require(\"numeral\");","import numeral from 'numeral';\nimport moment from '@splunk/moment';\n/**\n * Fixme, this is a mock i18n file to workaround window dependency from @splunk/charting\n * We need to refactor @splunk/charting to make it independent from globals\n */\n\nconst quarters = {\n 1: '1st quarter',\n 2: '2nd quarter',\n 3: '3rd quarter',\n 4: '4th quarter',\n};\n\nconst days = {\n 0: 'Monday',\n 1: 'Tuesday',\n 2: 'Wednesday',\n 3: 'Thursday',\n 4: 'Friday',\n 5: 'Saturday',\n 6: 'Sunday',\n};\n\nconst months = {\n 1: 'January',\n 2: 'February',\n 3: 'March',\n 4: 'April',\n 5: 'May',\n 6: 'June',\n 7: 'July',\n 8: 'August',\n 9: 'September',\n 10: 'October',\n 11: 'November',\n 12: 'December',\n};\n\nconst narrowMonths = {\n 1: 'J',\n 2: 'F',\n 3: 'M',\n 4: 'A',\n 5: 'M',\n 6: 'J',\n 7: 'J',\n 8: 'A',\n 9: 'S',\n 10: 'O',\n 11: 'N',\n 12: 'D',\n};\n\nconst localeDefinition = {\n date_formats: {\n medium: { pattern: 'MMM d, yyyy', format: '%(MMM)s %(d)s, %(yyyy)s' },\n long: { pattern: 'MMMM d, yyyy', format: '%(MMMM)s %(d)s, %(yyyy)s' },\n short: { pattern: 'M/d/yy', format: '%(M)s/%(d)s/%(yy)s' },\n full: { pattern: 'EEEE, MMMM d, yyyy', format: '%(EEEE)s, %(MMMM)s %(d)s, %(yyyy)s' },\n },\n quarters: {\n 'stand-alone': {\n wide: quarters,\n abbreviated: quarters,\n narrow: { 1: '1', 2: '2', 3: '3', 4: '4' },\n },\n format: {\n wide: quarters,\n abbreviated: { 1: 'Q1', 2: 'Q2', 3: 'Q3', 4: 'Q4' },\n narrow: { 1: '1', 2: '2', 3: '3', 4: '4' },\n },\n },\n min_week_days: 1,\n days: {\n 'stand-alone': {\n wide: days,\n abbreviated: days,\n narrow: { 0: 'M', 1: 'T', 2: 'W', 3: 'T', 4: 'F', 5: 'S', 6: 'S' },\n },\n format: {\n wide: days,\n abbreviated: {\n 0: 'Mon',\n 1: 'Tue',\n 2: 'Wed',\n 3: 'Thu',\n 4: 'Fri',\n 5: 'Sat',\n 6: 'Sun',\n },\n narrow: { 0: 'M', 1: 'T', 2: 'W', 3: 'T', 4: 'F', 5: 'S', 6: 'S' },\n },\n },\n eras: {\n wide: { 0: 'Before Christ', 1: 'Anno Domini' },\n abbreviated: { 0: 'BC', 1: 'AD' },\n narrow: { 0: 'B', 1: 'A' },\n },\n percent_format: '#,##0%',\n scientific_format: '#E0',\n first_week_day: 6,\n group_symbol: ',',\n minus_sign: '-',\n months: {\n 'stand-alone': {\n wide: months,\n abbreviated: months,\n narrow: narrowMonths,\n },\n format: {\n wide: months,\n abbreviated: {\n 1: 'Jan',\n 2: 'Feb',\n 3: 'Mar',\n 4: 'Apr',\n 5: 'May',\n 6: 'Jun',\n 7: 'Jul',\n 8: 'Aug',\n 9: 'Sep',\n 10: 'Oct',\n 11: 'Nov',\n 12: 'Dec',\n },\n narrow: narrowMonths,\n },\n },\n decimal_symbol: '.',\n periods: { am: 'AM', pm: 'PM' },\n datetime_formats: { null: '{1} {0}' },\n exp_symbol: 'E',\n locale_name: 'en_US',\n number_format: '#,##0.###',\n plus_sign: '+',\n time_formats: {\n medium: { pattern: 'h:mm:ss a', format: '%(h)s:%(mm)s:%(ss)s %(a)s' },\n long: { pattern: 'h:mm:ss a z', format: '%(h)s:%(mm)s:%(ss)s %(a)s %(z)s' },\n short: { pattern: 'h:mm a', format: '%(h)s:%(mm)s %(a)s' },\n full: { pattern: 'h:mm:ss a v', format: '%(h)s:%(mm)s:%(ss)s %(a)s %(v)s' },\n },\n};\n\nconst i18n = {\n format_decimal: (num, format) => numeral(num).format(format),\n format_number: (num, format) => numeral(num).format(format),\n format_percent: num => numeral(num).format('0%'),\n format_scientific: num => numeral(num).format('0,0e+0'),\n format_date: (num, format) =>\n moment(num).format(\n localeDefinition.date_formats[format] ? localeDefinition.date_formats[format].pattern : format\n ),\n format_datetime: (num, dateFormat) => {\n moment(num).format(\n localeDefinition.time_formats[dateFormat]\n ? localeDefinition.time_formats[dateFormat].pattern\n : dateFormat\n );\n },\n format_time: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n format_datetime_microseconds: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n format_time_microseconds: (num, format) =>\n moment(num).format(\n localeDefinition.time_formats[format] ? localeDefinition.time_formats[format].pattern : format\n ),\n};\n\nexport const setI18nFunctions = global => {\n Object.keys(i18n).forEach(k => {\n if (!global[k]) {\n global[k] = i18n[k]; // eslint-disable-line no-param-reassign\n }\n });\n if (!global.gettext) {\n global.gettext = v => v; // eslint-disable-line no-param-reassign\n }\n if (!global.locale_name) {\n global.locale_name = () => 'en_US'; // eslint-disable-line no-param-reassign\n }\n return global;\n};\nsetI18nFunctions(window);\n"],"sourceRoot":""}
|
package/iconUtils.js
CHANGED
|
@@ -110,15 +110,16 @@ var isRemoteIcon = function isRemoteIcon() {
|
|
|
110
110
|
var icon = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
111
111
|
return icon.indexOf('://') > -1;
|
|
112
112
|
};
|
|
113
|
+
|
|
113
114
|
/**
|
|
114
115
|
* check if an icon is a dataURI
|
|
115
116
|
* @param {*} icon
|
|
116
117
|
*/
|
|
117
|
-
|
|
118
118
|
var isDataURI = function isDataURI() {
|
|
119
119
|
var icon = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
120
120
|
return icon.startsWith('data:image/svg+xml;base64');
|
|
121
121
|
};
|
|
122
|
+
|
|
122
123
|
/*
|
|
123
124
|
* check whether need update fill for svg children elements
|
|
124
125
|
* @params {Object} style
|
|
@@ -129,17 +130,17 @@ var isDataURI = function isDataURI() {
|
|
|
129
130
|
* @returns {Boolean} true means need
|
|
130
131
|
* remove fill style and change the fill attribute <path fill="currentColor" />
|
|
131
132
|
*/
|
|
132
|
-
|
|
133
133
|
var shouldChangeFill = function shouldChangeFill(_ref) {
|
|
134
134
|
var fillAttr = _ref.fillAttr,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
fillStyle = _ref.fillStyle,
|
|
136
|
+
strokeAttr = _ref.strokeAttr,
|
|
137
|
+
strokeStyle = _ref.strokeStyle;
|
|
138
138
|
var noneFillAttr = !!fillAttr && (fillAttr === 'none' || fillAttr === 'transparent');
|
|
139
139
|
var noneFillStyle = !!fillStyle && (fillStyle === 'none' || fillStyle === 'transparent');
|
|
140
140
|
var noFillHasStroke = !fillAttr && !fillStyle && (!!strokeAttr || !!strokeStyle);
|
|
141
141
|
return !(noneFillAttr || noneFillStyle || noFillHasStroke);
|
|
142
142
|
};
|
|
143
|
+
|
|
143
144
|
/*
|
|
144
145
|
* check whether need update stroke for svg children elements
|
|
145
146
|
* @params {Object} style
|
|
@@ -150,26 +151,26 @@ var shouldChangeFill = function shouldChangeFill(_ref) {
|
|
|
150
151
|
* @returns {Boolean} true means need
|
|
151
152
|
* remove stroke style and change the stroke attribute <path stroke="currentColor" />
|
|
152
153
|
*/
|
|
153
|
-
|
|
154
154
|
var shouldChangeStroke = function shouldChangeStroke(_ref2) {
|
|
155
155
|
var fillAttr = _ref2.fillAttr,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
fillStyle = _ref2.fillStyle,
|
|
157
|
+
strokeAttr = _ref2.strokeAttr,
|
|
158
|
+
strokeStyle = _ref2.strokeStyle;
|
|
159
159
|
var noneStrokeAttr = !!strokeAttr && (strokeAttr === 'none' || strokeAttr === 'transparent');
|
|
160
160
|
var noneStrokeStyle = !!strokeStyle && (strokeStyle === 'none' || strokeStyle === 'transparent');
|
|
161
161
|
var hasFill = !!fillAttr || !!fillStyle;
|
|
162
162
|
var noStroke = !strokeAttr && !strokeStyle;
|
|
163
163
|
return !(noneStrokeAttr || noneStrokeStyle || hasFill || noStroke);
|
|
164
164
|
};
|
|
165
|
+
|
|
165
166
|
/*
|
|
166
167
|
* base64 encoding
|
|
167
168
|
* @param {String} str
|
|
168
169
|
* @return {Base64} string using based-64 encoding
|
|
169
170
|
*/
|
|
170
|
-
|
|
171
171
|
var b64EncodeUnicode = function b64EncodeUnicode(str) {
|
|
172
|
-
return (
|
|
172
|
+
return (
|
|
173
|
+
// first we use encodeURIComponent to get percent-encoded UTF-8,
|
|
173
174
|
// then we convert the percent encodings into raw bytes which
|
|
174
175
|
// can be fed into btoa.
|
|
175
176
|
btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
|
package/iconUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/iconUtils.js"],"names":["isRemoteIcon","icon","isDataURI","shouldChangeFill","fillAttr","fillStyle","strokeAttr","strokeStyle","noneFillAttr","noneFillStyle","noFillHasStroke","shouldChangeStroke","noneStrokeAttr","noneStrokeStyle","hasFill","noStroke","b64EncodeUnicode","btoa","String"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO,IAAMA,YAAY,GAAG,SAAfA,
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/iconUtils.js"],"names":["isRemoteIcon","icon","arguments","length","undefined","indexOf","isDataURI","startsWith","shouldChangeFill","_ref","fillAttr","fillStyle","strokeAttr","strokeStyle","noneFillAttr","noneFillStyle","noFillHasStroke","shouldChangeStroke","_ref2","noneStrokeAttr","noneStrokeStyle","hasFill","noStroke","b64EncodeUnicode","str","btoa","encodeURIComponent","replace","match","p1","String","fromCharCode","concat"],"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;AACA;AACA;AACA;AACO,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAA;EAAA,IAAIC,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,OAAKD,IAAI,CAACI,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAAA;;AAEnE;AACA;AACA;A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,UAAU,KAAK,aAAa,CAAC;EAC9F,IAAMQ,eAAe,GAAG,CAAC,CAACP,WAAW,KAAKA,WAAW,KAAK,MAAM,IAAIA,WAAW,KAAK,aAAa,CAAC;EAClG,IAAMQ,OAAO,GAAG,CAAC,CAACX,QAAQ,IAAI,CAAC,CAACC,SAAS;EACzC,IAAMW,QAAQ,GAAG,CAACV,UAAU,IAAI,CAACC,WAAW;EAC5C,OAAO,EAAEM,cAAc,IAAIC,eAAe,IAAIC,OAAO,IAAIC,QAAQ,CAAC;AACtE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAGC,GAAG;EAAA;IAC/B;IACA;IACA;IACAC,IAAI,CAACC,kBAAkB,CAACF,GAAG,CAAC,CAACG,OAAO,CAAC,iBAAiB,EAAE,UAACC,KAAK,EAAEC,EAAE;MAAA,OAAKC,MAAM,CAACC,YAAY,MAAAC,MAAA,CAAMH,EAAE,EAAG;IAAA,EAAC;EAAA;AAAC,E","file":"iconUtils.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 = 21);\n","/**\n * check if an icon is considered as remote icon\n * @param {*} icon\n */\nexport const isRemoteIcon = (icon = '') => icon.indexOf('://') > -1;\n\n/**\n * check if an icon is a dataURI\n * @param {*} icon\n */\nexport const isDataURI = (icon = '') => icon.startsWith('data:image/svg+xml;base64');\n\n/*\n * check whether need update fill for svg children elements\n * @params {Object} style\n * @params {String} style.fillAttr <path fill=\"red\" .../>\n * @params {String} style.fillStyle. <path style=\"fill: red;\" />\n * @params {String} style.strokeAttr. <path stroke=\"red\" .../>\n * @params {String} style.strokeStyle <path style=\"stroke: red;\" .../>\n * @returns {Boolean} true means need\n * remove fill style and change the fill attribute <path fill=\"currentColor\" />\n */\nexport const shouldChangeFill = ({ fillAttr, fillStyle, strokeAttr, strokeStyle }) => {\n const noneFillAttr = !!fillAttr && (fillAttr === 'none' || fillAttr === 'transparent');\n const noneFillStyle = !!fillStyle && (fillStyle === 'none' || fillStyle === 'transparent');\n const noFillHasStroke = !fillAttr && !fillStyle && (!!strokeAttr || !!strokeStyle);\n return !(noneFillAttr || noneFillStyle || noFillHasStroke);\n};\n\n/*\n * check whether need update stroke for svg children elements\n * @params {Object} style\n * @params {String} style.fillAttr <path fill=\"red\" .../>\n * @params {String} style.fillStyle. <path style=\"fill: red;\" />\n * @params {String} style.strokeAttr. <path stroke=\"red\" .../>\n * @params {String} style.strokeStyle <path style=\"stroke: red;\" .../>\n * @returns {Boolean} true means need\n * remove stroke style and change the stroke attribute <path stroke=\"currentColor\" />\n */\nexport const shouldChangeStroke = ({ fillAttr, fillStyle, strokeAttr, strokeStyle }) => {\n const noneStrokeAttr = !!strokeAttr && (strokeAttr === 'none' || strokeAttr === 'transparent');\n const noneStrokeStyle = !!strokeStyle && (strokeStyle === 'none' || strokeStyle === 'transparent');\n const hasFill = !!fillAttr || !!fillStyle;\n const noStroke = !strokeAttr && !strokeStyle;\n return !(noneStrokeAttr || noneStrokeStyle || hasFill || noStroke);\n};\n\n/*\n * base64 encoding\n * @param {String} str\n * @return {Base64} string using based-64 encoding\n */\nexport const b64EncodeUnicode = str =>\n // first we use encodeURIComponent to get percent-encoded UTF-8,\n // then we convert the percent encodings into raw bytes which\n // can be fed into btoa.\n btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => String.fromCharCode(`0x${p1}`)));\n"],"sourceRoot":""}
|
package/mapUtils.js
CHANGED
|
@@ -120,12 +120,10 @@ exports.findClosestMatchFromDefaultList = void 0;
|
|
|
120
120
|
|
|
121
121
|
findClosestMatch(list, obj) -> returns index 1.
|
|
122
122
|
*/
|
|
123
|
-
|
|
124
123
|
var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
|
|
125
124
|
if (!Array.isArray(searchList) || searchList.length === 0) {
|
|
126
125
|
return -1;
|
|
127
126
|
}
|
|
128
|
-
|
|
129
127
|
var keys = Object.keys(inputObj);
|
|
130
128
|
var maxMatchCnt = 0;
|
|
131
129
|
var maxMatchIdx = 0;
|
|
@@ -136,7 +134,6 @@ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(s
|
|
|
136
134
|
matchCnt += 1;
|
|
137
135
|
}
|
|
138
136
|
});
|
|
139
|
-
|
|
140
137
|
if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
|
|
141
138
|
maxMatchCnt = matchCnt;
|
|
142
139
|
maxMatchIdx = idx;
|
|
@@ -144,7 +141,6 @@ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(s
|
|
|
144
141
|
});
|
|
145
142
|
return maxMatchIdx;
|
|
146
143
|
};
|
|
147
|
-
|
|
148
144
|
exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
|
|
149
145
|
|
|
150
146
|
/***/ })
|
package/mapUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/mapUtils.ts"],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;AC7EA
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/mapUtils.ts"],"names":["findClosestMatchFromDefaultList","searchList","inputObj","Array","isArray","length","keys","Object","maxMatchCnt","maxMatchIdx","forEach","item","idx","matchCnt","key","Math","max","exports"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;AC7EA;;;;;;;;;;;;;;;;;;AAkBO,IAAMA,+BAA+B,GAAG,SAAlCA,+BAA+BA,CACxCC,UAA0C,EAC1CC,QAAiC,EACzB;EACR,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,IAAIA,UAAU,CAACI,MAAM,KAAK,CAAC,EAAE;IACvD,OAAO,CAAC,CAAC;;EAEb,IAAMC,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACJ,QAAQ,CAAC;EAClC,IAAIM,WAAW,GAAG,CAAC;EACnB,IAAIC,WAAW,GAAG,CAAC;EAEnBR,UAAU,CAACS,OAAO,CAAC,UAACC,IAAI,EAAEC,GAAG,EAAI;IAC7B,IAAIC,QAAQ,GAAG,CAAC;IAChBP,IAAI,CAACI,OAAO,CAAC,UAAAI,GAAG,EAAG;MACf,IAAIH,IAAI,CAACG,GAAG,CAAC,KAAKZ,QAAQ,CAACY,GAAG,CAAC,EAAE;QAC7BD,QAAQ,IAAI,CAAC;;IAErB,CAAC,CAAC;IACF,IAAIE,IAAI,CAACC,GAAG,CAACR,WAAW,EAAEK,QAAQ,CAAC,GAAGL,WAAW,EAAE;MAC/CA,WAAW,GAAGK,QAAQ;MACtBJ,WAAW,GAAGG,GAAG;;EAEzB,CAAC,CAAC;EACF,OAAOH,WAAW;AACtB,CAAC;AAxBYQ,OAAA,CAAAjB,+BAA+B,GAAAA,+BAAA,C","file":"mapUtils.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 28);\n","export interface GeoJsonDataType {\n type: string;\n coordinates: Array<Array<Array<[number, number]>>>;\n}\n\n/**\n * Finds the closest matching object from the list, which has the max same key value pairs.\n * Returns the index of match if found, or -1\n * For eg :- \n const list = [{\n type: \"marker\",\n lat: \"value1\"\n }, {\n type: \"bubble\",\n size: \"value2\"\n }];\n\n const obj = {\n type: 'bubble'\n };\n\n findClosestMatch(list, obj) -> returns index 1.\n */\nexport const findClosestMatchFromDefaultList = (\n searchList: Array<Record<string, unknown>>,\n inputObj: Record<string, unknown>\n): number => {\n if (!Array.isArray(searchList) || searchList.length === 0) {\n return -1;\n }\n const keys = Object.keys(inputObj);\n let maxMatchCnt = 0;\n let maxMatchIdx = 0;\n\n searchList.forEach((item, idx) => {\n let matchCnt = 0;\n keys.forEach(key => {\n if (item[key] === inputObj[key]) {\n matchCnt += 1;\n }\n });\n if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {\n maxMatchCnt = matchCnt;\n maxMatchIdx = idx;\n }\n });\n return maxMatchIdx;\n};\n"],"sourceRoot":""}
|
package/namedColors.js
CHANGED
|
@@ -100,8 +100,8 @@ module.exports =
|
|
|
100
100
|
|
|
101
101
|
Object.defineProperty(exports, "__esModule", {
|
|
102
102
|
value: true
|
|
103
|
-
});
|
|
104
|
-
|
|
103
|
+
});
|
|
104
|
+
// Reference - https://www.w3.org/TR/css-color-4/#named-colors
|
|
105
105
|
exports.default = ['transparent', 'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen'];
|
|
106
106
|
|
|
107
107
|
/***/ })
|
package/namedColors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/namedColors.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
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/namedColors.ts"],"names":["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;AACAA,OAAA,CAAAC,OAAA,GAAe,CACX,aAAa,EACb,WAAW,EACX,cAAc,EACd,MAAM,EACN,YAAY,EACZ,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,OAAO,EACP,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,MAAM,EACN,UAAU,EACV,UAAU,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,E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QAAQ,EACR,OAAO,EACP,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,aAAa,CAChB,C","file":"namedColors.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 23);\n","// Reference - https://www.w3.org/TR/css-color-4/#named-colors\nexport default [\n 'transparent',\n 'aliceblue',\n 'antiquewhite',\n 'aqua',\n 'aquamarine',\n 'azure',\n 'beige',\n 'bisque',\n 'black',\n 'blanchedalmond',\n 'blue',\n 'blueviolet',\n 'brown',\n 'burlywood',\n 'cadetblue',\n 'chartreuse',\n 'chocolate',\n 'coral',\n 'cornflowerblue',\n 'cornsilk',\n 'crimson',\n 'cyan',\n 'darkblue',\n 'darkcyan',\n 'darkgoldenrod',\n 'darkgray',\n 'darkgreen',\n 'darkgrey',\n 'darkkhaki',\n 'darkmagenta',\n 'darkolivegreen',\n 'darkorange',\n 'darkorchid',\n 'darkred',\n 'darksalmon',\n 'darkseagreen',\n 'darkslateblue',\n 'darkslategray',\n 'darkslategrey',\n 'darkturquoise',\n 'darkviolet',\n 'deeppink',\n 'deepskyblue',\n 'dimgray',\n 'dimgrey',\n 'dodgerblue',\n 'firebrick',\n 'floralwhite',\n 'forestgreen',\n 'fuchsia',\n 'gainsboro',\n 'ghostwhite',\n 'gold',\n 'goldenrod',\n 'gray',\n 'green',\n 'greenyellow',\n 'grey',\n 'honeydew',\n 'hotpink',\n 'indianred',\n 'indigo',\n 'ivory',\n 'khaki',\n 'lavender',\n 'lavenderblush',\n 'lawngreen',\n 'lemonchiffon',\n 'lightblue',\n 'lightcoral',\n 'lightcyan',\n 'lightgoldenrodyellow',\n 'lightgray',\n 'lightgreen',\n 'lightgrey',\n 'lightpink',\n 'lightsalmon',\n 'lightseagreen',\n 'lightskyblue',\n 'lightslategray',\n 'lightslategrey',\n 'lightsteelblue',\n 'lightyellow',\n 'lime',\n 'limegreen',\n 'linen',\n 'magenta',\n 'maroon',\n 'mediumaquamarine',\n 'mediumblue',\n 'mediumorchid',\n 'mediumpurple',\n 'mediumseagreen',\n 'mediumslateblue',\n 'mediumspringgreen',\n 'mediumturquoise',\n 'mediumvioletred',\n 'midnightblue',\n 'mintcream',\n 'mistyrose',\n 'moccasin',\n 'navajowhite',\n 'navy',\n 'oldlace',\n 'olive',\n 'olivedrab',\n 'orange',\n 'orangered',\n 'orchid',\n 'palegoldenrod',\n 'palegreen',\n 'paleturquoise',\n 'palevioletred',\n 'papayawhip',\n 'peachpuff',\n 'peru',\n 'pink',\n 'plum',\n 'powderblue',\n 'purple',\n 'rebeccapurple',\n 'red',\n 'rosybrown',\n 'royalblue',\n 'saddlebrown',\n 'salmon',\n 'sandybrown',\n 'seagreen',\n 'seashell',\n 'sienna',\n 'silver',\n 'skyblue',\n 'slateblue',\n 'slategray',\n 'slategrey',\n 'snow',\n 'springgreen',\n 'steelblue',\n 'tan',\n 'teal',\n 'thistle',\n 'tomato',\n 'turquoise',\n 'violet',\n 'wheat',\n 'white',\n 'whitesmoke',\n 'yellow',\n 'yellowgreen',\n];\n"],"sourceRoot":""}
|