@splunk/visualizations-shared 26.4.0 → 27.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/.loki/reference/chrome_docker_SizeAwareWrapper_50_parent.png +0 -0
  2. package/.loki/reference/chrome_docker_SizeAwareWrapper_Fix_size_container.png +0 -0
  3. package/.loki/reference/chrome_docker_SizeAwareWrapper_Flex_layout_container.png +0 -0
  4. package/.loki/reference/chrome_docker_SizeAwareWrapper_Flex_layout_container_with_extra_wrapper.png +0 -0
  5. package/Downloader.js +164 -403
  6. package/Downloader.js.map +7 -1
  7. package/FileDownloader.js +121 -557
  8. package/FileDownloader.js.map +7 -1
  9. package/JSONSchemaUtils.js +58 -134
  10. package/JSONSchemaUtils.js.map +7 -1
  11. package/Message.js +105 -270
  12. package/Message.js.map +7 -1
  13. package/RemoteIcon.js +272 -736
  14. package/RemoteIcon.js.map +7 -1
  15. package/RemoteImage.js +190 -458
  16. package/RemoteImage.js.map +7 -1
  17. package/SanitizeProps.js +117 -238
  18. package/SanitizeProps.js.map +7 -1
  19. package/SizeAwareWrapper.js +108 -306
  20. package/SizeAwareWrapper.js.map +7 -1
  21. package/SizeAwareWrapperDeprecated.js +117 -326
  22. package/SizeAwareWrapperDeprecated.js.map +7 -1
  23. package/VisualizationDocPage.js +212 -461
  24. package/VisualizationDocPage.js.map +7 -1
  25. package/colorConstants.js +81 -132
  26. package/colorConstants.js.map +7 -1
  27. package/colorUtils.js +47 -134
  28. package/colorUtils.js.map +7 -1
  29. package/configUtils.js +28 -112
  30. package/configUtils.js.map +7 -1
  31. package/console.js +45 -183
  32. package/console.js.map +7 -1
  33. package/dataSourceUtils.js +45 -140
  34. package/dataSourceUtils.js.map +7 -1
  35. package/domUtils.js +58 -122
  36. package/domUtils.js.map +7 -1
  37. package/hocUtils.js +45 -122
  38. package/hocUtils.js.map +7 -1
  39. package/i18n.js +168 -323
  40. package/i18n.js.map +7 -1
  41. package/iconUtils.js +47 -178
  42. package/iconUtils.js.map +7 -1
  43. package/mapUtils.js +45 -122
  44. package/mapUtils.js.map +7 -1
  45. package/numberUtils.js +101 -275
  46. package/numberUtils.js.map +7 -1
  47. package/package.json +18 -22
  48. package/previewVizMessage.js +28 -108
  49. package/previewVizMessage.js.map +7 -1
  50. package/propUtils.js +88 -212
  51. package/propUtils.js.map +7 -1
  52. package/schemaUtils.js +58 -185
  53. package/schemaUtils.js.map +7 -1
  54. package/simpleXMLOptions.js +142 -225
  55. package/simpleXMLOptions.js.map +7 -1
  56. package/style.js +65 -168
  57. package/style.js.map +7 -1
  58. package/testHelper.js +247 -303
  59. package/testHelper.js.map +7 -1
  60. package/themeUtils.js +63 -142
  61. package/themeUtils.js.map +7 -1
  62. package/trellisUtils.js +108 -276
  63. package/trellisUtils.js.map +7 -1
package/iconUtils.js CHANGED
@@ -1,184 +1,53 @@
1
- /*!
2
- * Copyright © 2024 Splunk Inc.
3
- * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
- * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
- */
6
- module.exports =
7
- /******/ (function(modules) { // webpackBootstrap
8
- /******/ // The module cache
9
- /******/ var installedModules = {};
10
- /******/
11
- /******/ // The require function
12
- /******/ function __webpack_require__(moduleId) {
13
- /******/
14
- /******/ // Check if module is in cache
15
- /******/ if(installedModules[moduleId]) {
16
- /******/ return installedModules[moduleId].exports;
17
- /******/ }
18
- /******/ // Create a new module (and put it into the cache)
19
- /******/ var module = installedModules[moduleId] = {
20
- /******/ i: moduleId,
21
- /******/ l: false,
22
- /******/ exports: {}
23
- /******/ };
24
- /******/
25
- /******/ // Execute the module function
26
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
27
- /******/
28
- /******/ // Flag the module as loaded
29
- /******/ module.l = true;
30
- /******/
31
- /******/ // Return the exports of the module
32
- /******/ return module.exports;
33
- /******/ }
34
- /******/
35
- /******/
36
- /******/ // expose the modules object (__webpack_modules__)
37
- /******/ __webpack_require__.m = modules;
38
- /******/
39
- /******/ // expose the module cache
40
- /******/ __webpack_require__.c = installedModules;
41
- /******/
42
- /******/ // define getter function for harmony exports
43
- /******/ __webpack_require__.d = function(exports, name, getter) {
44
- /******/ if(!__webpack_require__.o(exports, name)) {
45
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
46
- /******/ }
47
- /******/ };
48
- /******/
49
- /******/ // define __esModule on exports
50
- /******/ __webpack_require__.r = function(exports) {
51
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
52
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
53
- /******/ }
54
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
55
- /******/ };
56
- /******/
57
- /******/ // create a fake namespace object
58
- /******/ // mode & 1: value is a module id, require it
59
- /******/ // mode & 2: merge all properties of value into the ns
60
- /******/ // mode & 4: return value when already ns object
61
- /******/ // mode & 8|1: behave like require
62
- /******/ __webpack_require__.t = function(value, mode) {
63
- /******/ if(mode & 1) value = __webpack_require__(value);
64
- /******/ if(mode & 8) return value;
65
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
66
- /******/ var ns = Object.create(null);
67
- /******/ __webpack_require__.r(ns);
68
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
69
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
70
- /******/ return ns;
71
- /******/ };
72
- /******/
73
- /******/ // getDefaultExport function for compatibility with non-harmony modules
74
- /******/ __webpack_require__.n = function(module) {
75
- /******/ var getter = module && module.__esModule ?
76
- /******/ function getDefault() { return module['default']; } :
77
- /******/ function getModuleExports() { return module; };
78
- /******/ __webpack_require__.d(getter, 'a', getter);
79
- /******/ return getter;
80
- /******/ };
81
- /******/
82
- /******/ // Object.prototype.hasOwnProperty.call
83
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
84
- /******/
85
- /******/ // __webpack_public_path__
86
- /******/ __webpack_require__.p = "";
87
- /******/
88
- /******/
89
- /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 20);
91
- /******/ })
92
- /************************************************************************/
93
- /******/ ({
94
-
95
- /***/ 20:
96
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
97
-
98
- "use strict";
99
- __webpack_require__.r(__webpack_exports__);
100
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRemoteIcon", function() { return isRemoteIcon; });
101
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDataURI", function() { return isDataURI; });
102
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldChangeFill", function() { return shouldChangeFill; });
103
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shouldChangeStroke", function() { return shouldChangeStroke; });
104
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b64EncodeUnicode", function() { return b64EncodeUnicode; });
105
- /**
106
- * check if an icon is considered as remote icon
107
- * @param {*} icon
108
- */
109
- var isRemoteIcon = function isRemoteIcon() {
110
- var icon = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
111
- return icon.indexOf('://') > -1;
1
+ /* Copyright © 2020 Splunk Inc.
2
+ SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
3
+ in part without a valid written license from Splunk Inc. is PROHIBITED. */
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
112
11
  };
113
- /**
114
- * check if an icon is a dataURI
115
- * @param {*} icon
116
- */
117
-
118
- var isDataURI = function isDataURI() {
119
- var icon = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
120
- return icon.startsWith('data:image/svg+xml;base64');
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
121
19
  };
122
- /*
123
- * check whether need update fill for svg children elements
124
- * @params {Object} style
125
- * @params {String} style.fillAttr <path fill="red" .../>
126
- * @params {String} style.fillStyle. <path style="fill: red;" />
127
- * @params {String} style.strokeAttr. <path stroke="red" .../>
128
- * @params {String} style.strokeStyle <path style="stroke: red;" .../>
129
- * @returns {Boolean} true means need
130
- * remove fill style and change the fill attribute <path fill="currentColor" />
131
- */
132
-
133
- var shouldChangeFill = function shouldChangeFill(_ref) {
134
- var fillAttr = _ref.fillAttr,
135
- fillStyle = _ref.fillStyle,
136
- strokeAttr = _ref.strokeAttr,
137
- strokeStyle = _ref.strokeStyle;
138
- var noneFillAttr = !!fillAttr && (fillAttr === 'none' || fillAttr === 'transparent');
139
- var noneFillStyle = !!fillStyle && (fillStyle === 'none' || fillStyle === 'transparent');
140
- var noFillHasStroke = !fillAttr && !fillStyle && (!!strokeAttr || !!strokeStyle);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/iconUtils.js
23
+ var iconUtils_exports = {};
24
+ __export(iconUtils_exports, {
25
+ b64EncodeUnicode: () => b64EncodeUnicode,
26
+ isDataURI: () => isDataURI,
27
+ isRemoteIcon: () => isRemoteIcon,
28
+ shouldChangeFill: () => shouldChangeFill,
29
+ shouldChangeStroke: () => shouldChangeStroke
30
+ });
31
+ module.exports = __toCommonJS(iconUtils_exports);
32
+ var isRemoteIcon = (icon = "") => icon.indexOf("://") > -1;
33
+ var isDataURI = (icon = "") => icon.startsWith("data:image/svg+xml;base64");
34
+ var shouldChangeFill = ({ fillAttr, fillStyle, strokeAttr, strokeStyle }) => {
35
+ const noneFillAttr = !!fillAttr && (fillAttr === "none" || fillAttr === "transparent");
36
+ const noneFillStyle = !!fillStyle && (fillStyle === "none" || fillStyle === "transparent");
37
+ const noFillHasStroke = !fillAttr && !fillStyle && (!!strokeAttr || !!strokeStyle);
141
38
  return !(noneFillAttr || noneFillStyle || noFillHasStroke);
142
39
  };
143
- /*
144
- * check whether need update stroke for svg children elements
145
- * @params {Object} style
146
- * @params {String} style.fillAttr <path fill="red" .../>
147
- * @params {String} style.fillStyle. <path style="fill: red;" />
148
- * @params {String} style.strokeAttr. <path stroke="red" .../>
149
- * @params {String} style.strokeStyle <path style="stroke: red;" .../>
150
- * @returns {Boolean} true means need
151
- * remove stroke style and change the stroke attribute <path stroke="currentColor" />
152
- */
153
-
154
- var shouldChangeStroke = function shouldChangeStroke(_ref2) {
155
- var fillAttr = _ref2.fillAttr,
156
- fillStyle = _ref2.fillStyle,
157
- strokeAttr = _ref2.strokeAttr,
158
- strokeStyle = _ref2.strokeStyle;
159
- var noneStrokeAttr = !!strokeAttr && (strokeAttr === 'none' || strokeAttr === 'transparent');
160
- var noneStrokeStyle = !!strokeStyle && (strokeStyle === 'none' || strokeStyle === 'transparent');
161
- var hasFill = !!fillAttr || !!fillStyle;
162
- var noStroke = !strokeAttr && !strokeStyle;
40
+ var shouldChangeStroke = ({ fillAttr, fillStyle, strokeAttr, strokeStyle }) => {
41
+ const noneStrokeAttr = !!strokeAttr && (strokeAttr === "none" || strokeAttr === "transparent");
42
+ const noneStrokeStyle = !!strokeStyle && (strokeStyle === "none" || strokeStyle === "transparent");
43
+ const hasFill = !!fillAttr || !!fillStyle;
44
+ const noStroke = !strokeAttr && !strokeStyle;
163
45
  return !(noneStrokeAttr || noneStrokeStyle || hasFill || noStroke);
164
46
  };
165
- /*
166
- * base64 encoding
167
- * @param {String} str
168
- * @return {Base64} string using based-64 encoding
169
- */
170
-
171
- var b64EncodeUnicode = function b64EncodeUnicode(str) {
172
- return (// first we use encodeURIComponent to get percent-encoded UTF-8,
173
- // then we convert the percent encodings into raw bytes which
174
- // can be fed into btoa.
175
- btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
176
- return String.fromCharCode("0x".concat(p1));
177
- }))
178
- );
179
- };
180
-
181
- /***/ })
182
-
183
- /******/ });
184
- //# sourceMappingURL=iconUtils.js.map
47
+ var b64EncodeUnicode = (str) => (
48
+ // first we use encodeURIComponent to get percent-encoded UTF-8,
49
+ // then we convert the percent encodings into raw bytes which
50
+ // can be fed into btoa.
51
+ btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) => String.fromCharCode(`0x${p1}`)))
52
+ );
53
+ //# sourceMappingURL=iconUtils.js.map
package/iconUtils.js.map CHANGED
@@ -1 +1,7 @@
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,YAAe;AAAA,MAACC,IAAD;AAAA,SAAeA,IAAI,CAAJA,iBAAsB,CAArC;AAArB;AAEP;AACA;AACA;AACA;;AACO,IAAMC,SAAS,GAAG,SAAZA,SAAY;AAAA,MAACD,IAAD;AAAA,SAAeA,IAAI,CAAJA,WAAf,2BAAeA,CAAf;AAAlB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAME,gBAAgB,GAAG,SAAnBA,gBAAmB,OAAsD;AAAA,MAAnDC,QAAmD,QAAnDA,QAAmD;AAAA,MAAzCC,SAAyC,QAAzCA,SAAyC;AAAA,MAA9BC,UAA8B,QAA9BA,UAA8B;AAAA,MAAlBC,WAAkB,QAAlBA,WAAkB;AAClF,MAAMC,YAAY,GAAG,CAAC,CAAD,aAAeJ,QAAQ,KAARA,UAAuBA,QAAQ,KAAnE,aAAqB,CAArB;AACA,MAAMK,aAAa,GAAG,CAAC,CAAD,cAAgBJ,SAAS,KAATA,UAAwBA,SAAS,KAAvE,aAAsB,CAAtB;AACA,MAAMK,eAAe,GAAG,aAAa,CAAb,cAA4B,CAAC,CAAD,cAAgB,CAAC,CAArE,WAAwB,CAAxB;AACA,SAAO,EAAEF,YAAY,IAAZA,iBAAT,eAAO,CAAP;AAJG;AAOP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMG,kBAAkB,GAAG,SAArBA,kBAAqB,QAAsD;AAAA,MAAnDP,QAAmD,SAAnDA,QAAmD;AAAA,MAAzCC,SAAyC,SAAzCA,SAAyC;AAAA,MAA9BC,UAA8B,SAA9BA,UAA8B;AAAA,MAAlBC,WAAkB,SAAlBA,WAAkB;AACpF,MAAMK,cAAc,GAAG,CAAC,CAAD,eAAiBN,UAAU,KAAVA,UAAyBA,UAAU,KAA3E,aAAuB,CAAvB;AACA,MAAMO,eAAe,GAAG,CAAC,CAAD,gBAAkBN,WAAW,KAAXA,UAA0BA,WAAW,KAA/E,aAAwB,CAAxB;AACA,MAAMO,OAAO,GAAG,CAAC,CAAD,YAAc,CAAC,CAA/B;AACA,MAAMC,QAAQ,GAAG,eAAe,CAAhC;AACA,SAAO,EAAEH,cAAc,IAAdA,8BAAT,QAAO,CAAP;AALG;AAQP;AACA;AACA;AACA;AACA;;AACO,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAmB,MAAG;AAAA,SAC/B;AACA;AACA;AACAC,QAAI,CAAC,kBAAkB,CAAlB,GAAkB,CAAlB,4BAAmD;AAAA,aAAeC,MAAM,CAANA,yBAAf,EAAeA,EAAf;AAApD,KAAC,CAAD;AAJ2B;AAA5B,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 = 20);\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":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/iconUtils.js"],
4
+ "sourcesContent": ["/**\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,eAAe,CAAC,OAAO,OAAO,KAAK,QAAQ,KAAK,IAAI;AAM1D,IAAM,YAAY,CAAC,OAAO,OAAO,KAAK,WAAW,2BAA2B;AAY5E,IAAM,mBAAmB,CAAC,EAAE,UAAU,WAAW,YAAY,YAAY,MAAM;AAClF,QAAM,eAAe,CAAC,CAAC,aAAa,aAAa,UAAU,aAAa;AACxE,QAAM,gBAAgB,CAAC,CAAC,cAAc,cAAc,UAAU,cAAc;AAC5E,QAAM,kBAAkB,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,CAAC;AACtE,SAAO,EAAE,gBAAgB,iBAAiB;AAC9C;AAYO,IAAM,qBAAqB,CAAC,EAAE,UAAU,WAAW,YAAY,YAAY,MAAM;AACpF,QAAM,iBAAiB,CAAC,CAAC,eAAe,eAAe,UAAU,eAAe;AAChF,QAAM,kBAAkB,CAAC,CAAC,gBAAgB,gBAAgB,UAAU,gBAAgB;AACpF,QAAM,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC;AAChC,QAAM,WAAW,CAAC,cAAc,CAAC;AACjC,SAAO,EAAE,kBAAkB,mBAAmB,WAAW;AAC7D;AAOO,IAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA,EAI5B,KAAK,mBAAmB,GAAG,EAAE,QAAQ,mBAAmB,CAAC,OAAO,OAAO,OAAO,aAAa,KAAK,EAAE,EAAE,CAAC,CAAC;AAAA;",
6
+ "names": []
7
+ }
package/mapUtils.js CHANGED
@@ -1,125 +1,48 @@
1
- /*!
2
- * Copyright © 2024 Splunk Inc.
3
- * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
- * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
- */
6
- module.exports =
7
- /******/ (function(modules) { // webpackBootstrap
8
- /******/ // The module cache
9
- /******/ var installedModules = {};
10
- /******/
11
- /******/ // The require function
12
- /******/ function __webpack_require__(moduleId) {
13
- /******/
14
- /******/ // Check if module is in cache
15
- /******/ if(installedModules[moduleId]) {
16
- /******/ return installedModules[moduleId].exports;
17
- /******/ }
18
- /******/ // Create a new module (and put it into the cache)
19
- /******/ var module = installedModules[moduleId] = {
20
- /******/ i: moduleId,
21
- /******/ l: false,
22
- /******/ exports: {}
23
- /******/ };
24
- /******/
25
- /******/ // Execute the module function
26
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
27
- /******/
28
- /******/ // Flag the module as loaded
29
- /******/ module.l = true;
30
- /******/
31
- /******/ // Return the exports of the module
32
- /******/ return module.exports;
33
- /******/ }
34
- /******/
35
- /******/
36
- /******/ // expose the modules object (__webpack_modules__)
37
- /******/ __webpack_require__.m = modules;
38
- /******/
39
- /******/ // expose the module cache
40
- /******/ __webpack_require__.c = installedModules;
41
- /******/
42
- /******/ // define getter function for harmony exports
43
- /******/ __webpack_require__.d = function(exports, name, getter) {
44
- /******/ if(!__webpack_require__.o(exports, name)) {
45
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
46
- /******/ }
47
- /******/ };
48
- /******/
49
- /******/ // define __esModule on exports
50
- /******/ __webpack_require__.r = function(exports) {
51
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
52
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
53
- /******/ }
54
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
55
- /******/ };
56
- /******/
57
- /******/ // create a fake namespace object
58
- /******/ // mode & 1: value is a module id, require it
59
- /******/ // mode & 2: merge all properties of value into the ns
60
- /******/ // mode & 4: return value when already ns object
61
- /******/ // mode & 8|1: behave like require
62
- /******/ __webpack_require__.t = function(value, mode) {
63
- /******/ if(mode & 1) value = __webpack_require__(value);
64
- /******/ if(mode & 8) return value;
65
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
66
- /******/ var ns = Object.create(null);
67
- /******/ __webpack_require__.r(ns);
68
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
69
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
70
- /******/ return ns;
71
- /******/ };
72
- /******/
73
- /******/ // getDefaultExport function for compatibility with non-harmony modules
74
- /******/ __webpack_require__.n = function(module) {
75
- /******/ var getter = module && module.__esModule ?
76
- /******/ function getDefault() { return module['default']; } :
77
- /******/ function getModuleExports() { return module; };
78
- /******/ __webpack_require__.d(getter, 'a', getter);
79
- /******/ return getter;
80
- /******/ };
81
- /******/
82
- /******/ // Object.prototype.hasOwnProperty.call
83
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
84
- /******/
85
- /******/ // __webpack_public_path__
86
- /******/ __webpack_require__.p = "";
87
- /******/
88
- /******/
89
- /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 58);
91
- /******/ })
92
- /************************************************************************/
93
- /******/ ({
94
-
95
- /***/ 58:
96
- /***/ (function(module, exports, __webpack_require__) {
97
-
98
- "use strict";
99
-
100
-
101
- Object.defineProperty(exports, "__esModule", {
102
- value: true
103
- });
104
- exports.findClosestMatchFromDefaultList = void 0;
105
-
106
- var findClosestMatchFromDefaultList_1 = __webpack_require__(59);
107
-
108
- Object.defineProperty(exports, "findClosestMatchFromDefaultList", {
109
- enumerable: true,
110
- get: function get() {
111
- return findClosestMatchFromDefaultList_1.findClosestMatchFromDefaultList;
1
+ /* Copyright © 2020 Splunk Inc.
2
+ SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
3
+ in part without a valid written license from Splunk Inc. is PROHIBITED. */
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
112
19
  }
20
+ return to;
21
+ };
22
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+
33
+ // src/mapUtils.ts
34
+ var mapUtils_exports = {};
35
+ __export(mapUtils_exports, {
36
+ findClosestMatchFromDefaultList: () => findClosestMatchFromDefaultList_exports.findClosestMatchFromDefaultList
113
37
  });
38
+ module.exports = __toCommonJS(mapUtils_exports);
114
39
 
115
- /***/ }),
116
-
117
- /***/ 59:
118
- /***/ (function(module, exports) {
119
-
120
- module.exports = require("@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList");
121
-
122
- /***/ })
123
-
124
- /******/ });
125
- //# sourceMappingURL=mapUtils.js.map
40
+ // esm-externals:@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList
41
+ var findClosestMatchFromDefaultList_exports = {};
42
+ __export(findClosestMatchFromDefaultList_exports, {
43
+ default: () => findClosestMatchFromDefaultList_default
44
+ });
45
+ var defaultImport = __toESM(require("@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList"));
46
+ __reExport(findClosestMatchFromDefaultList_exports, require("@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList"));
47
+ var findClosestMatchFromDefaultList_default = "default" in defaultImport ? defaultImport.default : defaultImport;
48
+ //# sourceMappingURL=mapUtils.js.map
package/mapUtils.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/mapUtils.ts","webpack:///external \"@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList\""],"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;;AAAS;AAAA;AAAA;AAAA;AAA+B;AAA/B,G;;;;;;;ACAT,iG","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 = 58);\n","export { findClosestMatchFromDefaultList } from '@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList';\nexport type { GeoJsonDataType } from '@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList';\n","module.exports = require(\"@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList\");"],"sourceRoot":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/mapUtils.ts", "esm-externals:@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList"],
4
+ "sourcesContent": ["export { findClosestMatchFromDefaultList } from '@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList';\nexport type { GeoJsonDataType } from '@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList';\n", "\nimport * as defaultImport from \"@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList\";\nexport * from \"@splunk/visualization-encoding/utils/findClosestMatchFromDefaultList\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,oDAAc;AACd,IAAO,0CAAS,aAAa,gBAA8B,wBAAU;",
6
+ "names": []
7
+ }