@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.
- package/.loki/reference/chrome_docker_SizeAwareWrapper_50_parent.png +0 -0
- package/.loki/reference/chrome_docker_SizeAwareWrapper_Fix_size_container.png +0 -0
- package/.loki/reference/chrome_docker_SizeAwareWrapper_Flex_layout_container.png +0 -0
- package/.loki/reference/chrome_docker_SizeAwareWrapper_Flex_layout_container_with_extra_wrapper.png +0 -0
- package/Downloader.js +164 -403
- package/Downloader.js.map +7 -1
- package/FileDownloader.js +121 -557
- package/FileDownloader.js.map +7 -1
- package/JSONSchemaUtils.js +58 -134
- package/JSONSchemaUtils.js.map +7 -1
- package/Message.js +105 -270
- package/Message.js.map +7 -1
- package/RemoteIcon.js +272 -736
- package/RemoteIcon.js.map +7 -1
- package/RemoteImage.js +190 -458
- package/RemoteImage.js.map +7 -1
- package/SanitizeProps.js +117 -238
- package/SanitizeProps.js.map +7 -1
- package/SizeAwareWrapper.js +108 -306
- package/SizeAwareWrapper.js.map +7 -1
- package/SizeAwareWrapperDeprecated.js +117 -326
- package/SizeAwareWrapperDeprecated.js.map +7 -1
- package/VisualizationDocPage.js +212 -461
- package/VisualizationDocPage.js.map +7 -1
- package/colorConstants.js +81 -132
- package/colorConstants.js.map +7 -1
- package/colorUtils.js +47 -134
- package/colorUtils.js.map +7 -1
- package/configUtils.js +28 -112
- package/configUtils.js.map +7 -1
- package/console.js +45 -183
- package/console.js.map +7 -1
- package/dataSourceUtils.js +45 -140
- package/dataSourceUtils.js.map +7 -1
- package/domUtils.js +58 -122
- package/domUtils.js.map +7 -1
- package/hocUtils.js +45 -122
- package/hocUtils.js.map +7 -1
- package/i18n.js +168 -323
- package/i18n.js.map +7 -1
- package/iconUtils.js +47 -178
- package/iconUtils.js.map +7 -1
- package/mapUtils.js +45 -122
- package/mapUtils.js.map +7 -1
- package/numberUtils.js +101 -275
- package/numberUtils.js.map +7 -1
- package/package.json +18 -22
- package/previewVizMessage.js +28 -108
- package/previewVizMessage.js.map +7 -1
- package/propUtils.js +88 -212
- package/propUtils.js.map +7 -1
- package/schemaUtils.js +58 -185
- package/schemaUtils.js.map +7 -1
- package/simpleXMLOptions.js +142 -225
- package/simpleXMLOptions.js.map +7 -1
- package/style.js +65 -168
- package/style.js.map +7 -1
- package/testHelper.js +247 -303
- package/testHelper.js.map +7 -1
- package/themeUtils.js +63 -142
- package/themeUtils.js.map +7 -1
- package/trellisUtils.js +108 -276
- package/trellisUtils.js.map +7 -1
|
@@ -1,354 +1,145 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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 = 48);
|
|
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
|
-
/***/ 48:
|
|
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/SizeAwareWrapperDeprecated.jsx
|
|
36
|
+
var SizeAwareWrapperDeprecated_exports = {};
|
|
37
|
+
__export(SizeAwareWrapperDeprecated_exports, {
|
|
38
|
+
default: () => SizeAwareWrapperDeprecated_default
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(SizeAwareWrapperDeprecated_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/SizeAwareWrapperDeprecated.jsx
|
|
195
61
|
var styles = {
|
|
196
|
-
position:
|
|
62
|
+
position: "absolute",
|
|
197
63
|
width: 0,
|
|
198
64
|
height: 0,
|
|
199
|
-
visibility:
|
|
200
|
-
display:
|
|
65
|
+
visibility: "hidden",
|
|
66
|
+
display: "none"
|
|
201
67
|
};
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
function SizeAwareWrapperDeprecated(props) {
|
|
209
|
-
var _this;
|
|
210
|
-
|
|
211
|
-
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, SizeAwareWrapperDeprecated);
|
|
212
|
-
|
|
213
|
-
_this = _super.call(this, props);
|
|
214
|
-
|
|
215
|
-
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getElement", function () {
|
|
216
|
-
// it listens on the size of its parent elemnt
|
|
217
|
-
var parentElement = _this.el && _this.el.parentElement;
|
|
68
|
+
var SizeAwareWrapperDeprecated = class extends react_exports.PureComponent {
|
|
69
|
+
constructor(props) {
|
|
70
|
+
super(props);
|
|
71
|
+
__publicField(this, "getElement", () => {
|
|
72
|
+
const parentElement = this.el && this.el.parentElement;
|
|
218
73
|
return parentElement;
|
|
219
74
|
});
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
height = _entry$contentRect.height; // use requestAnimationFrame to make sure width/height is updated in time
|
|
226
|
-
|
|
227
|
-
_this.animationFrameID = window.requestAnimationFrame(function () {
|
|
228
|
-
_this.setState({
|
|
229
|
-
width: width,
|
|
230
|
-
height: height
|
|
231
|
-
});
|
|
75
|
+
__publicField(this, "handleResize", (entries) => {
|
|
76
|
+
entries.forEach((entry) => {
|
|
77
|
+
const { width, height } = entry.contentRect;
|
|
78
|
+
this.animationFrameID = window.requestAnimationFrame(() => {
|
|
79
|
+
this.setState({ width, height });
|
|
232
80
|
});
|
|
233
81
|
});
|
|
234
82
|
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
height = _this$state.height;
|
|
241
|
-
var children = _this.props.children;
|
|
242
|
-
|
|
243
|
-
if (width != null && height != null && typeof children === 'function') {
|
|
244
|
-
return children({
|
|
245
|
-
width: width,
|
|
246
|
-
height: height
|
|
247
|
-
});
|
|
83
|
+
__publicField(this, "renderChildren", () => {
|
|
84
|
+
const { width, height } = this.state;
|
|
85
|
+
const { children } = this.props;
|
|
86
|
+
if (width != null && height != null && typeof children === "function") {
|
|
87
|
+
return children({ width, height });
|
|
248
88
|
}
|
|
249
|
-
|
|
250
89
|
return null;
|
|
251
90
|
});
|
|
252
|
-
|
|
253
|
-
_this.state = {
|
|
91
|
+
this.state = {
|
|
254
92
|
width: null,
|
|
255
93
|
height: null
|
|
256
94
|
};
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return _this;
|
|
95
|
+
this.animationFrameID = null;
|
|
96
|
+
this.ro = this.getResizeObserver();
|
|
260
97
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
var resizableElement = this.getElement();
|
|
266
|
-
|
|
267
|
-
if (resizableElement) {
|
|
268
|
-
this.ro.observe(resizableElement);
|
|
269
|
-
}
|
|
98
|
+
componentDidMount() {
|
|
99
|
+
const resizableElement = this.getElement();
|
|
100
|
+
if (resizableElement) {
|
|
101
|
+
this.ro.observe(resizableElement);
|
|
270
102
|
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (resizableElement) {
|
|
277
|
-
this.ro.unobserve(resizableElement);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
if (window && this.animationFrameID) {
|
|
281
|
-
window.cancelAnimationFrame(this.animationFrameID);
|
|
282
|
-
}
|
|
103
|
+
}
|
|
104
|
+
componentWillUnmount() {
|
|
105
|
+
const resizableElement = this.getElement();
|
|
106
|
+
if (resizableElement) {
|
|
107
|
+
this.ro.unobserve(resizableElement);
|
|
283
108
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
value: function getResizeObserver() {
|
|
287
|
-
if (typeof ResizeObserver !== 'function') {
|
|
288
|
-
return {
|
|
289
|
-
observe: function observe() {},
|
|
290
|
-
unobserve: function unobserve() {}
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return new ResizeObserver(this.handleResize);
|
|
109
|
+
if (window && this.animationFrameID) {
|
|
110
|
+
window.cancelAnimationFrame(this.animationFrameID);
|
|
295
111
|
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
112
|
+
}
|
|
113
|
+
getResizeObserver() {
|
|
114
|
+
if (typeof ResizeObserver !== "function") {
|
|
115
|
+
return {
|
|
116
|
+
observe() {
|
|
117
|
+
},
|
|
118
|
+
unobserve() {
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return new ResizeObserver(this.handleResize);
|
|
123
|
+
}
|
|
124
|
+
render() {
|
|
125
|
+
return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
302
128
|
key: "resize-detector",
|
|
303
129
|
style: styles,
|
|
304
|
-
ref:
|
|
305
|
-
|
|
130
|
+
ref: (el) => {
|
|
131
|
+
this.el = el;
|
|
306
132
|
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
return SizeAwareWrapperDeprecated;
|
|
312
|
-
}(react__WEBPACK_IMPORTED_MODULE_7__["PureComponent"]);
|
|
313
|
-
|
|
133
|
+
}
|
|
134
|
+
), this.renderChildren());
|
|
135
|
+
}
|
|
136
|
+
};
|
|
314
137
|
SizeAwareWrapperDeprecated.propTypes = {
|
|
315
|
-
children:
|
|
316
|
-
|
|
138
|
+
children: prop_types_default.any
|
|
139
|
+
// eslint-disable-line react/forbid-prop-types
|
|
317
140
|
};
|
|
318
141
|
SizeAwareWrapperDeprecated.defaultProps = {
|
|
319
142
|
children: null
|
|
320
143
|
};
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
/***/ }),
|
|
324
|
-
|
|
325
|
-
/***/ 5:
|
|
326
|
-
/***/ (function(module, exports) {
|
|
327
|
-
|
|
328
|
-
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
329
|
-
|
|
330
|
-
/***/ }),
|
|
331
|
-
|
|
332
|
-
/***/ 6:
|
|
333
|
-
/***/ (function(module, exports) {
|
|
334
|
-
|
|
335
|
-
module.exports = require("@babel/runtime/helpers/createClass");
|
|
336
|
-
|
|
337
|
-
/***/ }),
|
|
338
|
-
|
|
339
|
-
/***/ 7:
|
|
340
|
-
/***/ (function(module, exports) {
|
|
341
|
-
|
|
342
|
-
module.exports = require("@babel/runtime/helpers/inherits");
|
|
343
|
-
|
|
344
|
-
/***/ }),
|
|
345
|
-
|
|
346
|
-
/***/ 8:
|
|
347
|
-
/***/ (function(module, exports) {
|
|
348
|
-
|
|
349
|
-
module.exports = require("@babel/runtime/helpers/possibleConstructorReturn");
|
|
350
|
-
|
|
351
|
-
/***/ })
|
|
352
|
-
|
|
353
|
-
/******/ });
|
|
354
|
-
//# sourceMappingURL=SizeAwareWrapperDeprecated.js.map
|
|
144
|
+
var SizeAwareWrapperDeprecated_default = SizeAwareWrapperDeprecated;
|
|
145
|
+
//# sourceMappingURL=SizeAwareWrapperDeprecated.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["src/SizeAwareWrapperDeprecated.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 SizeAwareWrapperDeprecated extends PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n width: null,\n height: null,\n };\n this.animationFrameID = null;\n this.ro = this.getResizeObserver();\n }\n\n componentDidMount() {\n const resizableElement = this.getElement();\n if (resizableElement) {\n this.ro.observe(resizableElement);\n }\n }\n\n componentWillUnmount() {\n const resizableElement = this.getElement();\n if (resizableElement) {\n this.ro.unobserve(resizableElement);\n }\n if (window && this.animationFrameID) {\n window.cancelAnimationFrame(this.animationFrameID);\n }\n }\n\n getElement = () => {\n // it listens on the size of its parent elemnt\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 // use requestAnimationFrame to make sure width/height is updated in time\n this.animationFrameID = window.requestAnimationFrame(() => {\n this.setState({ width, height });\n });\n });\n };\n\n renderChildren = () => {\n // expect children to be a function\n const { width, height } = this.state;\n const { children } = this.props;\n if (width != null && height != null && typeof children === 'function') {\n return children({ width, height });\n }\n return null;\n };\n\n render() {\n return (\n <React.Fragment>\n <div\n key=\"resize-detector\"\n style={styles}\n ref={el => {\n this.el = el;\n }}\n />\n {this.renderChildren()}\n </React.Fragment>\n );\n }\n}\n\nSizeAwareWrapperDeprecated.propTypes = {\n children: T.any, // eslint-disable-line react/forbid-prop-types\n};\n\nSizeAwareWrapperDeprecated.defaultProps = {\n children: null,\n};\n\nexport default SizeAwareWrapperDeprecated;\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,6BAAN,cAAyC,4BAAc;AAAA,EACnD,YAAY,OAAO;AACf,UAAM,KAAK;AA0Bf,sCAAa,MAAM;AAEf,YAAM,gBAAgB,KAAK,MAAM,KAAK,GAAG;AACzC,aAAO;AAAA,IACX;AAYA,wCAAe,aAAW;AACtB,cAAQ,QAAQ,WAAS;AACrB,cAAM,EAAE,OAAO,OAAO,IAAI,MAAM;AAEhC,aAAK,mBAAmB,OAAO,sBAAsB,MAAM;AACvD,eAAK,SAAS,EAAE,OAAO,OAAO,CAAC;AAAA,QACnC,CAAC;AAAA,MACL,CAAC;AAAA,IACL;AAEA,0CAAiB,MAAM;AAEnB,YAAM,EAAE,OAAO,OAAO,IAAI,KAAK;AAC/B,YAAM,EAAE,SAAS,IAAI,KAAK;AAC1B,UAAI,SAAS,QAAQ,UAAU,QAAQ,OAAO,aAAa,YAAY;AACnE,eAAO,SAAS,EAAE,OAAO,OAAO,CAAC;AAAA,MACrC;AACA,aAAO;AAAA,IACX;AA3DI,SAAK,QAAQ;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,IACZ;AACA,SAAK,mBAAmB;AACxB,SAAK,KAAK,KAAK,kBAAkB;AAAA,EACrC;AAAA,EAEA,oBAAoB;AAChB,UAAM,mBAAmB,KAAK,WAAW;AACzC,QAAI,kBAAkB;AAClB,WAAK,GAAG,QAAQ,gBAAgB;AAAA,IACpC;AAAA,EACJ;AAAA,EAEA,uBAAuB;AACnB,UAAM,mBAAmB,KAAK,WAAW;AACzC,QAAI,kBAAkB;AAClB,WAAK,GAAG,UAAU,gBAAgB;AAAA,IACtC;AACA,QAAI,UAAU,KAAK,kBAAkB;AACjC,aAAO,qBAAqB,KAAK,gBAAgB;AAAA,IACrD;AAAA,EACJ;AAAA,EAQA,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,EAsBA,SAAS;AACL,WACI,4CAAC,cAAM,UAAN,MACG;AAAA,MAAC;AAAA;AAAA,QACG,KAAI;AAAA,QACJ,OAAO;AAAA,QACP,KAAK,QAAM;AACP,eAAK,KAAK;AAAA,QACd;AAAA;AAAA,IACJ,GACC,KAAK,eAAe,CACzB;AAAA,EAER;AACJ;AAEA,2BAA2B,YAAY;AAAA,EACnC,UAAU,mBAAE;AAAA;AAChB;AAEA,2BAA2B,eAAe;AAAA,EACtC,UAAU;AACd;AAEA,IAAO,qCAAQ;",
|
|
6
|
+
"names": ["defaultImport"]
|
|
7
|
+
}
|