@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
@@ -1,330 +1,132 @@
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 = 47);
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
- /***/ 11:
110
- /***/ (function(module, exports) {
111
-
112
- module.exports = require("@babel/runtime/helpers/assertThisInitialized");
113
-
114
- /***/ }),
115
-
116
- /***/ 2:
117
- /***/ (function(module, exports) {
118
-
119
- module.exports = require("@babel/runtime/helpers/defineProperty");
120
-
121
- /***/ }),
122
-
123
- /***/ 3:
124
- /***/ (function(module, exports) {
125
-
126
- module.exports = require("@babel/runtime/helpers/getPrototypeOf");
127
-
128
- /***/ }),
129
-
130
- /***/ 47:
131
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
132
-
133
- "use strict";
134
- __webpack_require__.r(__webpack_exports__);
135
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
136
- /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
137
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
138
- /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
139
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11);
140
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);
141
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
142
- /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);
143
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
144
- /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
145
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3);
146
- /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
147
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
148
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6__);
149
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1);
150
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
151
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(0);
152
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
- function _createSuper(Derived) {
162
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
163
-
164
- return function _createSuperInternal() {
165
- var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived),
166
- result;
167
-
168
- if (hasNativeReflectConstruct) {
169
- var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor;
170
-
171
- result = Reflect.construct(Super, arguments, NewTarget);
172
- } else {
173
- result = Super.apply(this, arguments);
174
- }
175
-
176
- return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result);
177
- };
178
- }
179
-
180
- function _isNativeReflectConstruct() {
181
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
182
- if (Reflect.construct.sham) return false;
183
- if (typeof Proxy === "function") return true;
184
-
185
- try {
186
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
187
- return true;
188
- } catch (e) {
189
- return false;
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 __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
190
20
  }
191
- }
192
-
193
-
194
-
21
+ return to;
22
+ };
23
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
+
35
+ // src/SizeAwareWrapper.jsx
36
+ var SizeAwareWrapper_exports = {};
37
+ __export(SizeAwareWrapper_exports, {
38
+ default: () => SizeAwareWrapper_default
39
+ });
40
+ module.exports = __toCommonJS(SizeAwareWrapper_exports);
41
+
42
+ // esm-externals:react
43
+ var react_exports = {};
44
+ __export(react_exports, {
45
+ default: () => react_default
46
+ });
47
+ var defaultImport = __toESM(require("react"));
48
+ __reExport(react_exports, require("react"));
49
+ var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
50
+
51
+ // esm-externals:prop-types
52
+ var prop_types_exports = {};
53
+ __export(prop_types_exports, {
54
+ default: () => prop_types_default
55
+ });
56
+ var defaultImport2 = __toESM(require("prop-types"));
57
+ __reExport(prop_types_exports, require("prop-types"));
58
+ var prop_types_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
59
+
60
+ // src/SizeAwareWrapper.jsx
195
61
  var styles = {
196
- position: 'absolute',
62
+ position: "absolute",
197
63
  width: 0,
198
64
  height: 0,
199
- visibility: 'hidden',
200
- display: 'none'
65
+ visibility: "hidden",
66
+ display: "none"
201
67
  };
202
-
203
- var SizeAwareWrapper = /*#__PURE__*/function (_PureComponent) {
204
- _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(SizeAwareWrapper, _PureComponent);
205
-
206
- var _super = _createSuper(SizeAwareWrapper);
207
-
208
- function SizeAwareWrapper() {
209
- var _this;
210
-
211
- _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SizeAwareWrapper);
212
-
213
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
214
- args[_key] = arguments[_key];
215
- }
216
-
217
- _this = _super.call.apply(_super, [this].concat(args));
218
-
219
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getElement", function () {
220
- var parentElement = _this.el && _this.el.parentElement;
68
+ var SizeAwareWrapper = class extends react_exports.PureComponent {
69
+ constructor() {
70
+ super(...arguments);
71
+ __publicField(this, "getElement", () => {
72
+ const parentElement = this.el && this.el.parentElement;
221
73
  return parentElement;
222
74
  });
223
-
224
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "handleResize", function (entries) {
225
- entries.forEach(function (entry) {
226
- var _entry$contentRect = entry.contentRect,
227
- width = _entry$contentRect.width,
228
- height = _entry$contentRect.height;
229
-
230
- _this.props.onResize(width, height);
75
+ __publicField(this, "handleResize", (entries) => {
76
+ entries.forEach((entry) => {
77
+ const { width, height } = entry.contentRect;
78
+ this.props.onResize(width, height);
231
79
  });
232
80
  });
233
-
234
- return _this;
235
81
  }
236
-
237
- _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(SizeAwareWrapper, [{
238
- key: "componentDidMount",
239
- value: function componentDidMount() {
240
- var resizableElement = this.getElement();
241
-
242
- if (resizableElement) {
243
- this.ro = this.getResizeObserver();
244
- this.ro.observe(resizableElement);
245
- }
82
+ componentDidMount() {
83
+ const resizableElement = this.getElement();
84
+ if (resizableElement) {
85
+ this.ro = this.getResizeObserver();
86
+ this.ro.observe(resizableElement);
246
87
  }
247
- }, {
248
- key: "componentWillUnmount",
249
- value: function componentWillUnmount() {
250
- var resizableElement = this.getElement();
251
-
252
- if (resizableElement && this.ro) {
253
- this.ro.unobserve(resizableElement);
254
- }
88
+ }
89
+ componentWillUnmount() {
90
+ const resizableElement = this.getElement();
91
+ if (resizableElement && this.ro) {
92
+ this.ro.unobserve(resizableElement);
255
93
  }
256
- }, {
257
- key: "getResizeObserver",
258
- value: function getResizeObserver() {
259
- if (typeof ResizeObserver !== 'function') {
260
- return {
261
- observe: function observe() {},
262
- unobserve: function unobserve() {}
263
- };
264
- }
265
-
266
- return new ResizeObserver(this.handleResize);
94
+ }
95
+ getResizeObserver() {
96
+ if (typeof ResizeObserver !== "function") {
97
+ return {
98
+ observe() {
99
+ },
100
+ unobserve() {
101
+ }
102
+ };
267
103
  }
268
- }, {
269
- key: "render",
270
- value: function render() {
271
- var _this2 = this;
272
-
273
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement("div", {
104
+ return new ResizeObserver(this.handleResize);
105
+ }
106
+ render() {
107
+ return /* @__PURE__ */ react_default.createElement(
108
+ "div",
109
+ {
274
110
  key: "resize-detector",
275
111
  style: styles,
276
- ref: function ref(el) {
277
- _this2.el = el;
112
+ ref: (el) => {
113
+ this.el = el;
278
114
  }
279
- });
280
- }
281
- }]);
282
-
283
- return SizeAwareWrapper;
284
- }(react__WEBPACK_IMPORTED_MODULE_7__["PureComponent"]);
285
-
115
+ }
116
+ );
117
+ }
118
+ };
286
119
  SizeAwareWrapper.propTypes = {
287
- onResize: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.func // This was to use width and height as props and then check to see if the values have changed inside the handleResize function
120
+ onResize: prop_types_default.func
121
+ // This was to use width and height as props and then check to see if the values have changed inside the handleResize function
288
122
  // Some components need a double render to 'settle' and are using this so no check is needed.
289
123
  // However until that is fixed unit tests rely on these props so keeping as optional.
290
124
  // width: T.arrayOf(T.number, T.string),
291
125
  // height: T.arrayOf(T.number, T.string),
292
-
293
126
  };
294
127
  SizeAwareWrapper.defaultProps = {
295
- onResize: function onResize() {}
128
+ onResize: () => {
129
+ }
296
130
  };
297
- /* harmony default export */ __webpack_exports__["default"] = (SizeAwareWrapper);
298
-
299
- /***/ }),
300
-
301
- /***/ 5:
302
- /***/ (function(module, exports) {
303
-
304
- module.exports = require("@babel/runtime/helpers/classCallCheck");
305
-
306
- /***/ }),
307
-
308
- /***/ 6:
309
- /***/ (function(module, exports) {
310
-
311
- module.exports = require("@babel/runtime/helpers/createClass");
312
-
313
- /***/ }),
314
-
315
- /***/ 7:
316
- /***/ (function(module, exports) {
317
-
318
- module.exports = require("@babel/runtime/helpers/inherits");
319
-
320
- /***/ }),
321
-
322
- /***/ 8:
323
- /***/ (function(module, exports) {
324
-
325
- module.exports = require("@babel/runtime/helpers/possibleConstructorReturn");
326
-
327
- /***/ })
328
-
329
- /******/ });
330
- //# sourceMappingURL=SizeAwareWrapper.js.map
131
+ var SizeAwareWrapper_default = SizeAwareWrapper;
132
+ //# sourceMappingURL=SizeAwareWrapper.js.map
@@ -1 +1,7 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"prop-types\"","webpack:///external \"react\"","webpack:///external \"@babel/runtime/helpers/assertThisInitialized\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///external \"@babel/runtime/helpers/getPrototypeOf\"","webpack:///./src/SizeAwareWrapper.jsx","webpack:///external \"@babel/runtime/helpers/classCallCheck\"","webpack:///external \"@babel/runtime/helpers/createClass\"","webpack:///external \"@babel/runtime/helpers/inherits\"","webpack:///external \"@babel/runtime/helpers/possibleConstructorReturn\""],"names":["styles","position","width","height","visibility","display","SizeAwareWrapper","parentElement","entries","entry","resizableElement","observe","unobserve","PureComponent","onResize","T"],"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,uC;;;;;;;ACAA,kC;;;;;;;ACAA,yE;;;;;;;ACAA,kE;;;;;;;ACAA,kE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AAEA,IAAMA,MAAM,GAAG;AACXC,UAAQ,EADG;AAEXC,OAAK,EAFM;AAGXC,QAAM,EAHK;AAIXC,YAAU,EAJC;AAKXC,SAAO,EAAE;AALE,CAAf;;IAQMC,gB;;;;;;;;;;;;;;;;2LAgBW,YAAM;AACf,UAAMC,aAAa,GAAG,YAAW,SAAjC;AACA;;;6LAaW,mBAAW;AACtBC,aAAO,CAAPA,QAAgB,iBAAS;AAAA,iCACKC,KAAK,CADV;AAAA,YACbP,KADa;AAAA,YACNC,MADM;;AAErB;AAFJK;;;;;;;;WA/BJ,6BAAoB;AAChB,UAAME,gBAAgB,GAAG,KAAzB,UAAyB,EAAzB;;AACA,4BAAsB;AAClB,kBAAU,KAAV,iBAAU,EAAV;AACA;AACH;AACJ;;;WAED,gCAAuB;AACnB,UAAMA,gBAAgB,GAAG,KAAzB,UAAyB,EAAzB;;AACA,UAAIA,gBAAgB,IAAI,KAAxB,IAAiC;AAC7B;AACH;AACJ;;;WAOD,6BAAoB;AAChB,UAAI,0BAAJ,YAA0C;AACtC,eAAO;AACHC,iBADG,qBACO,CADP;AAEHC,mBAFG,uBAES,CAAE;AAFX,SAAP;AAIH;;AACD,aAAO,mBAAmB,KAA1B,YAAO,CAAP;AACH;;;WASD,kBAAS;AAAA;;AACL,0BACI;AACI,WAAG,EADP;AAEI,aAAK,EAFT;AAGI,WAAG,EAAE,iBAAM;AACP,gBAAI,CAAJ;AACH;AALL,QADJ;AASH;;;;EAhD0BC,mD;;AAmD/BP,gBAAgB,CAAhBA,YAA6B;AACzBQ,UAAQ,EAAEC,iDAAC,CADc,KAEzB;AACA;AACA;AACA;AACA;;AANyB,CAA7BT;AASAA,gBAAgB,CAAhBA,eAAgC;AAC5BQ,UAAQ,EAAE,oBAAM,CAAE;AADU,CAAhCR;AAIA,iF;;;;;;;AC3EA,kE;;;;;;;ACAA,+D;;;;;;;ACAA,4D;;;;;;;ACAA,6E","file":"SizeAwareWrapper.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 = 47);\n","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"@babel/runtime/helpers/assertThisInitialized\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/getPrototypeOf\");","import React, { PureComponent } from 'react';\nimport T from 'prop-types';\n\nconst styles = {\n position: 'absolute',\n width: 0,\n height: 0,\n visibility: 'hidden',\n display: 'none',\n};\n\nclass SizeAwareWrapper extends PureComponent {\n componentDidMount() {\n const resizableElement = this.getElement();\n if (resizableElement) {\n this.ro = this.getResizeObserver();\n this.ro.observe(resizableElement);\n }\n }\n\n componentWillUnmount() {\n const resizableElement = this.getElement();\n if (resizableElement && this.ro) {\n this.ro.unobserve(resizableElement);\n }\n }\n\n getElement = () => {\n const parentElement = this.el && this.el.parentElement;\n return parentElement;\n };\n\n getResizeObserver() {\n if (typeof ResizeObserver !== 'function') {\n return {\n observe() {},\n unobserve() {},\n };\n }\n return new ResizeObserver(this.handleResize);\n }\n\n handleResize = entries => {\n entries.forEach(entry => {\n const { width, height } = entry.contentRect;\n this.props.onResize(width, height);\n });\n };\n\n render() {\n return (\n <div\n key=\"resize-detector\"\n style={styles}\n ref={el => {\n this.el = el;\n }}\n />\n );\n }\n}\n\nSizeAwareWrapper.propTypes = {\n onResize: T.func,\n // This was to use width and height as props and then check to see if the values have changed inside the handleResize function\n // Some components need a double render to 'settle' and are using this so no check is needed.\n // However until that is fixed unit tests rely on these props so keeping as optional.\n // width: T.arrayOf(T.number, T.string),\n // height: T.arrayOf(T.number, T.string),\n};\n\nSizeAwareWrapper.defaultProps = {\n onResize: () => {},\n};\n\nexport default SizeAwareWrapper;\n","module.exports = require(\"@babel/runtime/helpers/classCallCheck\");","module.exports = require(\"@babel/runtime/helpers/createClass\");","module.exports = require(\"@babel/runtime/helpers/inherits\");","module.exports = require(\"@babel/runtime/helpers/possibleConstructorReturn\");"],"sourceRoot":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/SizeAwareWrapper.jsx", "esm-externals:react", "esm-externals:prop-types"],
4
+ "sourcesContent": ["import React, { PureComponent } from 'react';\nimport T from 'prop-types';\n\nconst styles = {\n position: 'absolute',\n width: 0,\n height: 0,\n visibility: 'hidden',\n display: 'none',\n};\n\nclass SizeAwareWrapper extends PureComponent {\n componentDidMount() {\n const resizableElement = this.getElement();\n if (resizableElement) {\n this.ro = this.getResizeObserver();\n this.ro.observe(resizableElement);\n }\n }\n\n componentWillUnmount() {\n const resizableElement = this.getElement();\n if (resizableElement && this.ro) {\n this.ro.unobserve(resizableElement);\n }\n }\n\n getElement = () => {\n const parentElement = this.el && this.el.parentElement;\n return parentElement;\n };\n\n getResizeObserver() {\n if (typeof ResizeObserver !== 'function') {\n return {\n observe() {},\n unobserve() {},\n };\n }\n return new ResizeObserver(this.handleResize);\n }\n\n handleResize = entries => {\n entries.forEach(entry => {\n const { width, height } = entry.contentRect;\n this.props.onResize(width, height);\n });\n };\n\n render() {\n return (\n <div\n key=\"resize-detector\"\n style={styles}\n ref={el => {\n this.el = el;\n }}\n />\n );\n }\n}\n\nSizeAwareWrapper.propTypes = {\n onResize: T.func,\n // This was to use width and height as props and then check to see if the values have changed inside the handleResize function\n // Some components need a double render to 'settle' and are using this so no check is needed.\n // However until that is fixed unit tests rely on these props so keeping as optional.\n // width: T.arrayOf(T.number, T.string),\n // height: T.arrayOf(T.number, T.string),\n};\n\nSizeAwareWrapper.defaultProps = {\n onResize: () => {},\n};\n\nexport default SizeAwareWrapper;\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AACA,oBAA+B;AAC/B,0BAAc;AACd,IAAO,gBAAS,aAAa,gBAA8B,wBAAU;;;ACHrE;AAAA;AAAA;AAAA;AACA,IAAAA,iBAA+B;AAC/B,+BAAc;AACd,IAAO,qBAAS,aAAaA,iBAA8B,yBAAUA;;;AFArE,IAAM,SAAS;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,SAAS;AACb;AAEA,IAAM,mBAAN,cAA+B,4BAAc;AAAA,EAA7C;AAAA;AAgBI,sCAAa,MAAM;AACf,YAAM,gBAAgB,KAAK,MAAM,KAAK,GAAG;AACzC,aAAO;AAAA,IACX;AAYA,wCAAe,aAAW;AACtB,cAAQ,QAAQ,WAAS;AACrB,cAAM,EAAE,OAAO,OAAO,IAAI,MAAM;AAChC,aAAK,MAAM,SAAS,OAAO,MAAM;AAAA,MACrC,CAAC;AAAA,IACL;AAAA;AAAA,EAnCA,oBAAoB;AAChB,UAAM,mBAAmB,KAAK,WAAW;AACzC,QAAI,kBAAkB;AAClB,WAAK,KAAK,KAAK,kBAAkB;AACjC,WAAK,GAAG,QAAQ,gBAAgB;AAAA,IACpC;AAAA,EACJ;AAAA,EAEA,uBAAuB;AACnB,UAAM,mBAAmB,KAAK,WAAW;AACzC,QAAI,oBAAoB,KAAK,IAAI;AAC7B,WAAK,GAAG,UAAU,gBAAgB;AAAA,IACtC;AAAA,EACJ;AAAA,EAOA,oBAAoB;AAChB,QAAI,OAAO,mBAAmB,YAAY;AACtC,aAAO;AAAA,QACH,UAAU;AAAA,QAAC;AAAA,QACX,YAAY;AAAA,QAAC;AAAA,MACjB;AAAA,IACJ;AACA,WAAO,IAAI,eAAe,KAAK,YAAY;AAAA,EAC/C;AAAA,EASA,SAAS;AACL,WACI;AAAA,MAAC;AAAA;AAAA,QACG,KAAI;AAAA,QACJ,OAAO;AAAA,QACP,KAAK,QAAM;AACP,eAAK,KAAK;AAAA,QACd;AAAA;AAAA,IACJ;AAAA,EAER;AACJ;AAEA,iBAAiB,YAAY;AAAA,EACzB,UAAU,mBAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAMhB;AAEA,iBAAiB,eAAe;AAAA,EAC5B,UAAU,MAAM;AAAA,EAAC;AACrB;AAEA,IAAO,2BAAQ;",
6
+ "names": ["defaultImport"]
7
+ }