@splunk/visualizations-shared 26.4.1 → 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/Message.js CHANGED
@@ -1,295 +1,130 @@
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 = 43);
91
- /******/ })
92
- /************************************************************************/
93
- /******/ ({
94
-
95
- /***/ 0:
96
- /***/ (function(module, exports) {
97
-
98
- module.exports = require("prop-types");
99
-
100
- /***/ }),
101
-
102
- /***/ 1:
103
- /***/ (function(module, exports) {
104
-
105
- module.exports = require("react");
106
-
107
- /***/ }),
108
-
109
- /***/ 13:
110
- /***/ (function(module, exports) {
111
-
112
- module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
113
-
114
- /***/ }),
115
-
116
- /***/ 14:
117
- /***/ (function(module, exports) {
118
-
119
- module.exports = require("styled-components");
120
-
121
- /***/ }),
122
-
123
- /***/ 17:
124
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
125
-
126
- "use strict";
127
- __webpack_require__.r(__webpack_exports__);
128
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toPx", function() { return toPx; });
129
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDimension", function() { return toDimension; });
130
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayToCSSProp", function() { return arrayToCSSProp; });
131
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toMargin", function() { return toMargin; });
132
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toPadding", function() { return toPadding; });
133
- /* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
134
- /* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isNumber__WEBPACK_IMPORTED_MODULE_0__);
135
-
136
- /**
137
- * convert number to px
138
- * @param {*} number
139
- */
140
-
141
- var toPx = function toPx(number) {
142
- var defaultNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
143
- return lodash_isNumber__WEBPACK_IMPORTED_MODULE_0___default()(number) ? "".concat(number, "px") : number || toPx(defaultNumber);
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 });
144
13
  };
145
- /**
146
- * generate width/height css properties
147
- * @param {*} param0
148
- */
149
-
150
- var toDimension = function toDimension(_ref) {
151
- var width = _ref.width,
152
- height = _ref.height;
153
- var css = '';
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 });
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/Message.jsx
34
+ var Message_exports2 = {};
35
+ __export(Message_exports2, {
36
+ default: () => Message_default2
37
+ });
38
+ module.exports = __toCommonJS(Message_exports2);
154
39
 
40
+ // esm-externals:react
41
+ var react_exports = {};
42
+ __export(react_exports, {
43
+ default: () => react_default
44
+ });
45
+ var defaultImport = __toESM(require("react"));
46
+ __reExport(react_exports, require("react"));
47
+ var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
48
+
49
+ // esm-externals:prop-types
50
+ var prop_types_exports = {};
51
+ __export(prop_types_exports, {
52
+ default: () => prop_types_default
53
+ });
54
+ var defaultImport2 = __toESM(require("prop-types"));
55
+ __reExport(prop_types_exports, require("prop-types"));
56
+ var prop_types_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
57
+
58
+ // esm-externals:styled-components
59
+ var styled_components_exports = {};
60
+ __export(styled_components_exports, {
61
+ default: () => styled_components_default
62
+ });
63
+ var defaultImport3 = __toESM(require("styled-components"));
64
+ __reExport(styled_components_exports, require("styled-components"));
65
+ var styled_components_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
66
+
67
+ // esm-externals:@splunk/react-ui/Message
68
+ var Message_exports = {};
69
+ __export(Message_exports, {
70
+ default: () => Message_default
71
+ });
72
+ var defaultImport4 = __toESM(require("@splunk/react-ui/Message"));
73
+ __reExport(Message_exports, require("@splunk/react-ui/Message"));
74
+ var Message_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
75
+
76
+ // esm-externals:lodash/isNumber
77
+ var isNumber_exports = {};
78
+ __export(isNumber_exports, {
79
+ default: () => isNumber_default
80
+ });
81
+ var defaultImport5 = __toESM(require("lodash/isNumber"));
82
+ __reExport(isNumber_exports, require("lodash/isNumber"));
83
+ var isNumber_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
84
+
85
+ // src/style.js
86
+ var toPx = (number, defaultNumber = 0) => isNumber_default(number) ? `${number}px` : number || toPx(defaultNumber);
87
+ var toDimension = ({ width, height }) => {
88
+ let css = "";
155
89
  if (width) {
156
- css = "width: ".concat(toPx(width), ";");
90
+ css = `width: ${toPx(width)};`;
157
91
  }
158
-
159
92
  if (height) {
160
- // only add a linebreak if width was also set
161
- css = "".concat(css).concat(width ? '\n' : '', "height: ").concat(toPx(height), ";");
93
+ css = `${css}${width ? "\n" : ""}height: ${toPx(height)};`;
162
94
  }
163
-
164
95
  return css;
165
96
  };
166
- /**
167
- * generate margin css property
168
- */
169
-
170
- var arrayToCSSProp = function arrayToCSSProp(prop) {
171
- var vals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0, 0];
172
-
173
- if (Array.isArray(vals)) {
174
- return "\n ".concat(prop, ": ").concat(toPx(vals[0]), " ").concat(toPx(vals[1]), " ").concat(toPx(vals[2]), " ").concat(toPx(vals[3]), ";\n ");
175
- }
176
-
177
- return "".concat(prop, ": ").concat(toPx(vals), ";");
178
- };
179
- /**
180
- * generate margin css property
181
- */
182
-
183
- var toMargin = function toMargin() {
184
- var margins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [0, 0, 0, 0];
185
- return arrayToCSSProp('margin', margins);
186
- };
187
- /**
188
- * generate padding css property
189
- */
190
-
191
- var toPadding = function toPadding() {
192
- var paddings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [0, 0, 0, 0];
193
- return arrayToCSSProp('padding', paddings);
194
- };
195
-
196
- /***/ }),
197
-
198
- /***/ 18:
199
- /***/ (function(module, exports) {
200
-
201
- module.exports = require("lodash/isNumber");
202
-
203
- /***/ }),
204
-
205
- /***/ 27:
206
- /***/ (function(module, exports) {
207
-
208
- module.exports = require("@splunk/react-ui/Message");
209
-
210
- /***/ }),
211
-
212
- /***/ 43:
213
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
214
-
215
- "use strict";
216
- __webpack_require__.r(__webpack_exports__);
217
- /* harmony import */ var _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13);
218
- /* harmony import */ var _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0__);
219
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
220
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
221
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
222
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
223
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14);
224
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
225
- /* harmony import */ var _splunk_react_ui_Message__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27);
226
- /* harmony import */ var _splunk_react_ui_Message__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_ui_Message__WEBPACK_IMPORTED_MODULE_4__);
227
- /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(17);
228
-
229
-
230
- var _templateObject;
231
-
232
-
233
-
234
-
235
-
236
-
237
- var MessageContainer = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.div(_templateObject || (_templateObject = _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0___default()(["\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n ", ";\n"])), function (p) {
238
- return Object(_style__WEBPACK_IMPORTED_MODULE_5__["toDimension"])({
239
- width: p.width,
240
- height: p.height
241
- });
242
- });
243
- /**
244
- * A component that display message
245
- *
246
- */
247
-
248
- var Message = function Message(_ref) {
249
- var width = _ref.width,
250
- height = _ref.height,
251
- level = _ref.level,
252
- message = _ref.message;
253
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MessageContainer, {
254
- width: width,
255
- height: height,
256
- "data-test": "visualization-message"
257
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_splunk_react_ui_Message__WEBPACK_IMPORTED_MODULE_4___default.a, {
258
- type: level,
259
- style: {
260
- maxWidth: '100%'
261
- }
262
- }, message));
263
- };
264
97
 
98
+ // src/Message.jsx
99
+ var MessageContainer = styled_components_default.div`
100
+ overflow: hidden;
101
+ display: flex;
102
+ justify-content: center;
103
+ align-items: center;
104
+ ${(p) => toDimension({ width: p.width, height: p.height })};
105
+ `;
106
+ var Message = ({ width, height, level, message }) => /* @__PURE__ */ react_default.createElement(MessageContainer, { width, height, "data-test": "visualization-message" }, /* @__PURE__ */ react_default.createElement(Message_default, { type: level, style: { maxWidth: "100%" } }, message));
265
107
  Message.propTypes = {
266
108
  /**
267
109
  * width in pixel or string, defaults to 100%
268
110
  */
269
- width: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]),
270
-
111
+ width: prop_types_default.oneOfType([prop_types_default.string, prop_types_default.number]),
271
112
  /**
272
113
  * height in pixel or string
273
114
  */
274
- height: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]),
275
-
115
+ height: prop_types_default.oneOfType([prop_types_default.string, prop_types_default.number]),
276
116
  /**
277
117
  * message text
278
118
  */
279
- message: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
280
-
119
+ message: prop_types_default.string,
281
120
  /**
282
121
  * message level
283
122
  */
284
- level: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOf(['info', 'warning', 'error'])
123
+ level: prop_types_default.oneOf(["info", "warning", "error"])
285
124
  };
286
125
  Message.defaultProps = {
287
- level: 'info',
288
- message: ''
126
+ level: "info",
127
+ message: ""
289
128
  };
290
- /* harmony default export */ __webpack_exports__["default"] = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.memo(Message));
291
-
292
- /***/ })
293
-
294
- /******/ });
295
- //# sourceMappingURL=Message.js.map
129
+ var Message_default2 = react_default.memo(Message);
130
+ //# sourceMappingURL=Message.js.map
package/Message.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"prop-types\"","webpack:///external \"react\"","webpack:///external \"@babel/runtime/helpers/taggedTemplateLiteral\"","webpack:///external \"styled-components\"","webpack:///./src/style.js","webpack:///external \"lodash/isNumber\"","webpack:///external \"@splunk/react-ui/Message\"","webpack:///./src/Message.jsx"],"names":["toPx","defaultNumber","isNumber","number","toDimension","width","height","css","arrayToCSSProp","vals","Array","toMargin","margins","toPadding","paddings","MessageContainer","styled","p","Message","level","message","maxWidth","T","React"],"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;;;QAG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OAAK,EADc;AAEnBC,SAAO,EAAE;AAFU,CAAvBF;AAIeK,wHAAK,CAALA,KAAf,OAAeA,CAAf,E","file":"Message.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 = 43);\n","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"@babel/runtime/helpers/taggedTemplateLiteral\");","module.exports = require(\"styled-components\");","import isNumber from 'lodash/isNumber';\n\n/**\n * convert number to px\n * @param {*} number\n */\nexport const toPx = (number, defaultNumber = 0) =>\n isNumber(number) ? `${number}px` : number || toPx(defaultNumber);\n\n/**\n * generate width/height css properties\n * @param {*} param0\n */\nexport const toDimension = ({ width, height }) => {\n let css = '';\n if (width) {\n css = `width: ${toPx(width)};`;\n }\n if (height) {\n // only add a linebreak if width was also set\n css = `${css}${width ? '\\n' : ''}height: ${toPx(height)};`;\n }\n return css;\n};\n\n/**\n * generate margin css property\n */\nexport const arrayToCSSProp = (prop, vals = [0, 0, 0, 0]) => {\n if (Array.isArray(vals)) {\n return `\n ${prop}: ${toPx(vals[0])} ${toPx(vals[1])} ${toPx(vals[2])} ${toPx(vals[3])};\n `;\n }\n\n return `${prop}: ${toPx(vals)};`;\n};\n\n/**\n * generate margin css property\n */\nexport const toMargin = (margins = [0, 0, 0, 0]) => arrayToCSSProp('margin', margins);\n\n/**\n * generate padding css property\n */\nexport const toPadding = (paddings = [0, 0, 0, 0]) => arrayToCSSProp('padding', paddings);\n","module.exports = require(\"lodash/isNumber\");","module.exports = require(\"@splunk/react-ui/Message\");","import React from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport SplunkUIMessage from '@splunk/react-ui/Message';\nimport { toDimension } from './style';\n\nconst MessageContainer = styled.div`\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n ${p => toDimension({ width: p.width, height: p.height })};\n`;\n\n/**\n * A component that display message\n *\n */\nconst Message = ({ width, height, level, message }) => (\n <MessageContainer width={width} height={height} data-test=\"visualization-message\">\n <SplunkUIMessage type={level} style={{ maxWidth: '100%' }}>\n {message}\n </SplunkUIMessage>\n </MessageContainer>\n);\n\nMessage.propTypes = {\n /**\n * width in pixel or string, defaults to 100%\n */\n width: T.oneOfType([T.string, T.number]),\n /**\n * height in pixel or string\n */\n height: T.oneOfType([T.string, T.number]),\n /**\n * message text\n */\n message: T.string,\n /**\n * message level\n */\n level: T.oneOf(['info', 'warning', 'error']),\n};\n\nMessage.defaultProps = {\n level: 'info',\n message: '',\n};\nexport default React.memo(Message);\n"],"sourceRoot":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/Message.jsx", "esm-externals:react", "esm-externals:prop-types", "esm-externals:styled-components", "esm-externals:@splunk/react-ui/Message", "esm-externals:lodash/isNumber", "src/style.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport T from 'prop-types';\nimport styled from 'styled-components';\nimport SplunkUIMessage from '@splunk/react-ui/Message';\nimport { toDimension } from './style';\n\nconst MessageContainer = styled.div`\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n ${p => toDimension({ width: p.width, height: p.height })};\n`;\n\n/**\n * A component that display message\n *\n */\nconst Message = ({ width, height, level, message }) => (\n <MessageContainer width={width} height={height} data-test=\"visualization-message\">\n <SplunkUIMessage type={level} style={{ maxWidth: '100%' }}>\n {message}\n </SplunkUIMessage>\n </MessageContainer>\n);\n\nMessage.propTypes = {\n /**\n * width in pixel or string, defaults to 100%\n */\n width: T.oneOfType([T.string, T.number]),\n /**\n * height in pixel or string\n */\n height: T.oneOfType([T.string, T.number]),\n /**\n * message text\n */\n message: T.string,\n /**\n * message level\n */\n level: T.oneOf(['info', 'warning', 'error']),\n};\n\nMessage.defaultProps = {\n level: 'info',\n message: '',\n};\nexport default React.memo(Message);\n", "\nimport * as defaultImport from \"react\";\nexport * from \"react\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"prop-types\";\nexport * from \"prop-types\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"styled-components\";\nexport * from \"styled-components\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"@splunk/react-ui/Message\";\nexport * from \"@splunk/react-ui/Message\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "\nimport * as defaultImport from \"lodash/isNumber\";\nexport * from \"lodash/isNumber\";\nexport default ('default' in defaultImport ? defaultImport.default : defaultImport);\n", "import isNumber from 'lodash/isNumber';\n\n/**\n * convert number to px\n * @param {*} number\n */\nexport const toPx = (number, defaultNumber = 0) =>\n isNumber(number) ? `${number}px` : number || toPx(defaultNumber);\n\n/**\n * generate width/height css properties\n * @param {*} param0\n */\nexport const toDimension = ({ width, height }) => {\n let css = '';\n if (width) {\n css = `width: ${toPx(width)};`;\n }\n if (height) {\n // only add a linebreak if width was also set\n css = `${css}${width ? '\\n' : ''}height: ${toPx(height)};`;\n }\n return css;\n};\n\n/**\n * generate margin css property\n */\nexport const arrayToCSSProp = (prop, vals = [0, 0, 0, 0]) => {\n if (Array.isArray(vals)) {\n return `\n ${prop}: ${toPx(vals[0])} ${toPx(vals[1])} ${toPx(vals[2])} ${toPx(vals[3])};\n `;\n }\n\n return `${prop}: ${toPx(vals)};`;\n};\n\n/**\n * generate margin css property\n */\nexport const toMargin = (margins = [0, 0, 0, 0]) => arrayToCSSProp('margin', margins);\n\n/**\n * generate padding css property\n */\nexport const toPadding = (paddings = [0, 0, 0, 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