@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
package/RemoteImage.js
CHANGED
|
@@ -1,476 +1,208 @@
|
|
|
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 = 45);
|
|
91
|
-
/******/ })
|
|
92
|
-
/************************************************************************/
|
|
93
|
-
/******/ ([
|
|
94
|
-
/* 0 */
|
|
95
|
-
/***/ (function(module, exports) {
|
|
96
|
-
|
|
97
|
-
module.exports = require("prop-types");
|
|
98
|
-
|
|
99
|
-
/***/ }),
|
|
100
|
-
/* 1 */
|
|
101
|
-
/***/ (function(module, exports) {
|
|
102
|
-
|
|
103
|
-
module.exports = require("react");
|
|
104
|
-
|
|
105
|
-
/***/ }),
|
|
106
|
-
/* 2 */
|
|
107
|
-
/***/ (function(module, exports) {
|
|
108
|
-
|
|
109
|
-
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
110
|
-
|
|
111
|
-
/***/ }),
|
|
112
|
-
/* 3 */
|
|
113
|
-
/***/ (function(module, exports) {
|
|
114
|
-
|
|
115
|
-
module.exports = require("@babel/runtime/helpers/getPrototypeOf");
|
|
116
|
-
|
|
117
|
-
/***/ }),
|
|
118
|
-
/* 4 */,
|
|
119
|
-
/* 5 */
|
|
120
|
-
/***/ (function(module, exports) {
|
|
121
|
-
|
|
122
|
-
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
123
|
-
|
|
124
|
-
/***/ }),
|
|
125
|
-
/* 6 */
|
|
126
|
-
/***/ (function(module, exports) {
|
|
127
|
-
|
|
128
|
-
module.exports = require("@babel/runtime/helpers/createClass");
|
|
129
|
-
|
|
130
|
-
/***/ }),
|
|
131
|
-
/* 7 */
|
|
132
|
-
/***/ (function(module, exports) {
|
|
133
|
-
|
|
134
|
-
module.exports = require("@babel/runtime/helpers/inherits");
|
|
135
|
-
|
|
136
|
-
/***/ }),
|
|
137
|
-
/* 8 */
|
|
138
|
-
/***/ (function(module, exports) {
|
|
139
|
-
|
|
140
|
-
module.exports = require("@babel/runtime/helpers/possibleConstructorReturn");
|
|
141
|
-
|
|
142
|
-
/***/ }),
|
|
143
|
-
/* 9 */
|
|
144
|
-
/***/ (function(module, exports) {
|
|
145
|
-
|
|
146
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
147
|
-
|
|
148
|
-
/***/ }),
|
|
149
|
-
/* 10 */
|
|
150
|
-
/***/ (function(module, exports) {
|
|
151
|
-
|
|
152
|
-
module.exports = require("@babel/runtime/regenerator");
|
|
153
|
-
|
|
154
|
-
/***/ }),
|
|
155
|
-
/* 11 */,
|
|
156
|
-
/* 12 */
|
|
157
|
-
/***/ (function(module, exports) {
|
|
158
|
-
|
|
159
|
-
module.exports = require("@babel/runtime/helpers/slicedToArray");
|
|
160
|
-
|
|
161
|
-
/***/ }),
|
|
162
|
-
/* 13 */
|
|
163
|
-
/***/ (function(module, exports) {
|
|
164
|
-
|
|
165
|
-
module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
|
|
166
|
-
|
|
167
|
-
/***/ }),
|
|
168
|
-
/* 14 */
|
|
169
|
-
/***/ (function(module, exports) {
|
|
170
|
-
|
|
171
|
-
module.exports = require("styled-components");
|
|
172
|
-
|
|
173
|
-
/***/ }),
|
|
174
|
-
/* 15 */,
|
|
175
|
-
/* 16 */,
|
|
176
|
-
/* 17 */,
|
|
177
|
-
/* 18 */,
|
|
178
|
-
/* 19 */
|
|
179
|
-
/***/ (function(module, exports) {
|
|
180
|
-
|
|
181
|
-
module.exports = require("@babel/runtime/helpers/asyncToGenerator");
|
|
182
|
-
|
|
183
|
-
/***/ }),
|
|
184
|
-
/* 20 */,
|
|
185
|
-
/* 21 */,
|
|
186
|
-
/* 22 */,
|
|
187
|
-
/* 23 */,
|
|
188
|
-
/* 24 */,
|
|
189
|
-
/* 25 */,
|
|
190
|
-
/* 26 */,
|
|
191
|
-
/* 27 */,
|
|
192
|
-
/* 28 */,
|
|
193
|
-
/* 29 */,
|
|
194
|
-
/* 30 */
|
|
195
|
-
/***/ (function(module, exports) {
|
|
196
|
-
|
|
197
|
-
module.exports = require("lodash/pick");
|
|
198
|
-
|
|
199
|
-
/***/ }),
|
|
200
|
-
/* 31 */
|
|
201
|
-
/***/ (function(module, exports) {
|
|
202
|
-
|
|
203
|
-
module.exports = require("@splunk/visualization-context/ImageContext");
|
|
204
|
-
|
|
205
|
-
/***/ }),
|
|
206
|
-
/* 32 */
|
|
207
|
-
/***/ (function(module, exports) {
|
|
208
|
-
|
|
209
|
-
module.exports = require("@splunk/visualizations-shared/style");
|
|
210
|
-
|
|
211
|
-
/***/ }),
|
|
212
|
-
/* 33 */,
|
|
213
|
-
/* 34 */,
|
|
214
|
-
/* 35 */,
|
|
215
|
-
/* 36 */,
|
|
216
|
-
/* 37 */,
|
|
217
|
-
/* 38 */,
|
|
218
|
-
/* 39 */,
|
|
219
|
-
/* 40 */,
|
|
220
|
-
/* 41 */,
|
|
221
|
-
/* 42 */,
|
|
222
|
-
/* 43 */,
|
|
223
|
-
/* 44 */,
|
|
224
|
-
/* 45 */
|
|
225
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
226
|
-
|
|
227
|
-
"use strict";
|
|
228
|
-
__webpack_require__.r(__webpack_exports__);
|
|
229
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRemoteImage", function() { return isRemoteImage; });
|
|
230
|
-
/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
|
|
231
|
-
/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);
|
|
232
|
-
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
|
|
233
|
-
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
|
|
234
|
-
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6);
|
|
235
|
-
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
|
|
236
|
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7);
|
|
237
|
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);
|
|
238
|
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
|
|
239
|
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
|
|
240
|
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3);
|
|
241
|
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
|
|
242
|
-
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
|
|
243
|
-
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6__);
|
|
244
|
-
/* harmony import */ var _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13);
|
|
245
|
-
/* harmony import */ var _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_7__);
|
|
246
|
-
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12);
|
|
247
|
-
/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_8__);
|
|
248
|
-
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(10);
|
|
249
|
-
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_9__);
|
|
250
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1);
|
|
251
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_10__);
|
|
252
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(0);
|
|
253
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_11__);
|
|
254
|
-
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(14);
|
|
255
|
-
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_12__);
|
|
256
|
-
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(30);
|
|
257
|
-
/* harmony import */ var lodash_pick__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(lodash_pick__WEBPACK_IMPORTED_MODULE_13__);
|
|
258
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9);
|
|
259
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_14__);
|
|
260
|
-
/* harmony import */ var _splunk_visualization_context_ImageContext__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(31);
|
|
261
|
-
/* harmony import */ var _splunk_visualization_context_ImageContext__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualization_context_ImageContext__WEBPACK_IMPORTED_MODULE_15__);
|
|
262
|
-
/* harmony import */ var _splunk_visualizations_shared_style__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32);
|
|
263
|
-
/* harmony import */ var _splunk_visualizations_shared_style__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_style__WEBPACK_IMPORTED_MODULE_16__);
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
var _templateObject;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
function _createSuper(Derived) {
|
|
279
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
280
|
-
|
|
281
|
-
return function _createSuperInternal() {
|
|
282
|
-
var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived),
|
|
283
|
-
result;
|
|
284
|
-
|
|
285
|
-
if (hasNativeReflectConstruct) {
|
|
286
|
-
var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor;
|
|
287
|
-
|
|
288
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
289
|
-
} else {
|
|
290
|
-
result = Super.apply(this, arguments);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result);
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function _isNativeReflectConstruct() {
|
|
298
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
299
|
-
if (Reflect.construct.sham) return false;
|
|
300
|
-
if (typeof Proxy === "function") return true;
|
|
301
|
-
|
|
302
|
-
try {
|
|
303
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
304
|
-
return true;
|
|
305
|
-
} catch (e) {
|
|
306
|
-
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 });
|
|
307
20
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
+
var __async = (__this, __arguments, generator) => {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
var fulfilled = (value) => {
|
|
37
|
+
try {
|
|
38
|
+
step(generator.next(value));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
reject(e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var rejected = (value) => {
|
|
44
|
+
try {
|
|
45
|
+
step(generator.throw(value));
|
|
46
|
+
} catch (e) {
|
|
47
|
+
reject(e);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
51
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
52
|
+
});
|
|
53
|
+
};
|
|
324
54
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
55
|
+
// src/RemoteImage.jsx
|
|
56
|
+
var RemoteImage_exports = {};
|
|
57
|
+
__export(RemoteImage_exports, {
|
|
58
|
+
default: () => RemoteImage_default,
|
|
59
|
+
isRemoteImage: () => isRemoteImage
|
|
60
|
+
});
|
|
61
|
+
module.exports = __toCommonJS(RemoteImage_exports);
|
|
328
62
|
|
|
329
|
-
|
|
63
|
+
// esm-externals:react
|
|
64
|
+
var react_exports = {};
|
|
65
|
+
__export(react_exports, {
|
|
66
|
+
default: () => react_default
|
|
67
|
+
});
|
|
68
|
+
var defaultImport = __toESM(require("react"));
|
|
69
|
+
__reExport(react_exports, require("react"));
|
|
70
|
+
var react_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
71
|
+
|
|
72
|
+
// esm-externals:prop-types
|
|
73
|
+
var prop_types_exports = {};
|
|
74
|
+
__export(prop_types_exports, {
|
|
75
|
+
default: () => prop_types_default
|
|
76
|
+
});
|
|
77
|
+
var defaultImport2 = __toESM(require("prop-types"));
|
|
78
|
+
__reExport(prop_types_exports, require("prop-types"));
|
|
79
|
+
var prop_types_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
80
|
+
|
|
81
|
+
// esm-externals:styled-components
|
|
82
|
+
var styled_components_exports = {};
|
|
83
|
+
__export(styled_components_exports, {
|
|
84
|
+
default: () => styled_components_default
|
|
85
|
+
});
|
|
86
|
+
var defaultImport3 = __toESM(require("styled-components"));
|
|
87
|
+
__reExport(styled_components_exports, require("styled-components"));
|
|
88
|
+
var styled_components_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
89
|
+
|
|
90
|
+
// esm-externals:lodash/pick
|
|
91
|
+
var pick_exports = {};
|
|
92
|
+
__export(pick_exports, {
|
|
93
|
+
default: () => pick_default
|
|
94
|
+
});
|
|
95
|
+
var defaultImport4 = __toESM(require("lodash/pick"));
|
|
96
|
+
__reExport(pick_exports, require("lodash/pick"));
|
|
97
|
+
var pick_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
98
|
+
|
|
99
|
+
// esm-externals:@splunk/ui-utils/i18n
|
|
100
|
+
var i18n_exports = {};
|
|
101
|
+
__export(i18n_exports, {
|
|
102
|
+
default: () => i18n_default
|
|
103
|
+
});
|
|
104
|
+
var defaultImport5 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
105
|
+
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
106
|
+
var i18n_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
107
|
+
|
|
108
|
+
// esm-externals:@splunk/visualization-context/ImageContext
|
|
109
|
+
var ImageContext_exports = {};
|
|
110
|
+
__export(ImageContext_exports, {
|
|
111
|
+
default: () => ImageContext_default
|
|
112
|
+
});
|
|
113
|
+
var defaultImport6 = __toESM(require("@splunk/visualization-context/ImageContext"));
|
|
114
|
+
__reExport(ImageContext_exports, require("@splunk/visualization-context/ImageContext"));
|
|
115
|
+
var ImageContext_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
116
|
+
|
|
117
|
+
// esm-externals:@splunk/visualizations-shared/style
|
|
118
|
+
var style_exports = {};
|
|
119
|
+
__export(style_exports, {
|
|
120
|
+
default: () => style_default
|
|
121
|
+
});
|
|
122
|
+
var defaultImport7 = __toESM(require("@splunk/visualizations-shared/style"));
|
|
123
|
+
__reExport(style_exports, require("@splunk/visualizations-shared/style"));
|
|
124
|
+
var style_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
125
|
+
|
|
126
|
+
// src/RemoteImage.jsx
|
|
127
|
+
var isRemoteImage = (src = "") => {
|
|
128
|
+
const [type] = src.split("://");
|
|
129
|
+
return src.indexOf("://") > -1 && type !== "http" && type !== "https";
|
|
330
130
|
};
|
|
331
|
-
|
|
332
|
-
var toImageDimensions = function toImageDimensions(props) {
|
|
131
|
+
var toImageDimensions = (props) => {
|
|
333
132
|
if (props.shouldPreserveAspectRatio) {
|
|
334
|
-
return
|
|
133
|
+
return `
|
|
134
|
+
max-width: 100%;
|
|
135
|
+
max-height: 100%;
|
|
136
|
+
width: auto;
|
|
137
|
+
height: auto;
|
|
138
|
+
`;
|
|
335
139
|
}
|
|
336
|
-
|
|
337
|
-
return Object(_splunk_visualizations_shared_style__WEBPACK_IMPORTED_MODULE_16__["toDimension"])(lodash_pick__WEBPACK_IMPORTED_MODULE_13___default()(props, ['width', 'height']));
|
|
140
|
+
return (0, style_exports.toDimension)(pick_default(props, ["width", "height"]));
|
|
338
141
|
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var _super = _createSuper(RemoteImage);
|
|
348
|
-
|
|
349
|
-
function RemoteImage(props) {
|
|
350
|
-
var _this;
|
|
351
|
-
|
|
352
|
-
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, RemoteImage);
|
|
353
|
-
|
|
354
|
-
_this = _super.call(this, props);
|
|
355
|
-
_this.state = {
|
|
356
|
-
imageDataURI: null,
|
|
357
|
-
preserveAspectRatio: props.preserveAspectRatio
|
|
358
|
-
};
|
|
359
|
-
return _this;
|
|
142
|
+
var Image = styled_components_default.img`
|
|
143
|
+
display: block;
|
|
144
|
+
${(props) => toImageDimensions(props)};
|
|
145
|
+
`;
|
|
146
|
+
var RemoteImage = class extends react_exports.PureComponent {
|
|
147
|
+
constructor(props) {
|
|
148
|
+
super(props);
|
|
149
|
+
this.state = { imageDataURI: null, preserveAspectRatio: props.preserveAspectRatio };
|
|
360
150
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
151
|
+
componentDidMount() {
|
|
152
|
+
this.getImage(this.props.imageURL);
|
|
153
|
+
}
|
|
154
|
+
componentDidUpdate(prevProps) {
|
|
155
|
+
if (prevProps.imageURL !== this.props.imageURL) {
|
|
365
156
|
this.getImage(this.props.imageURL);
|
|
366
157
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
value: function componentDidUpdate(prevProps) {
|
|
370
|
-
if (prevProps.imageURL !== this.props.imageURL) {
|
|
371
|
-
this.getImage(this.props.imageURL);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
if (prevProps.preserveAspectRatio !== this.props.preserveAspectRatio) {
|
|
375
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
376
|
-
this.setState({
|
|
377
|
-
preserveAspectRatio: this.props.preserveAspectRatio
|
|
378
|
-
});
|
|
379
|
-
}
|
|
158
|
+
if (prevProps.preserveAspectRatio !== this.props.preserveAspectRatio) {
|
|
159
|
+
this.setState({ preserveAspectRatio: this.props.preserveAspectRatio });
|
|
380
160
|
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
if (!imageRegistry) {
|
|
393
|
-
_context.next = 12;
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
_context.prev = 2;
|
|
398
|
-
_context.next = 5;
|
|
399
|
-
return imageRegistry.getByURL(imageURL);
|
|
400
|
-
|
|
401
|
-
case 5:
|
|
402
|
-
image = _context.sent;
|
|
403
|
-
this.setState({
|
|
404
|
-
imageDataURI: image.dataURI
|
|
405
|
-
});
|
|
406
|
-
_context.next = 12;
|
|
407
|
-
break;
|
|
408
|
-
|
|
409
|
-
case 9:
|
|
410
|
-
_context.prev = 9;
|
|
411
|
-
_context.t0 = _context["catch"](2); // eslint-disable-next-line no-console
|
|
412
|
-
|
|
413
|
-
console.error(_context.t0);
|
|
414
|
-
|
|
415
|
-
case 12:
|
|
416
|
-
case "end":
|
|
417
|
-
return _context.stop();
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}, _callee, this, [[2, 9]]);
|
|
421
|
-
}));
|
|
422
|
-
|
|
423
|
-
function getImage(_x) {
|
|
424
|
-
return _getImage.apply(this, arguments);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
return getImage;
|
|
428
|
-
}()
|
|
429
|
-
}, {
|
|
430
|
-
key: "render",
|
|
431
|
-
value: function render() {
|
|
432
|
-
var imageDataURI = this.state.imageDataURI;
|
|
433
|
-
var _this$props = this.props,
|
|
434
|
-
width = _this$props.width,
|
|
435
|
-
height = _this$props.height,
|
|
436
|
-
title = _this$props.title;
|
|
437
|
-
|
|
438
|
-
if (!imageDataURI) {
|
|
439
|
-
return null;
|
|
161
|
+
}
|
|
162
|
+
getImage(imageURL) {
|
|
163
|
+
return __async(this, null, function* () {
|
|
164
|
+
const imageRegistry = this.context;
|
|
165
|
+
if (imageRegistry) {
|
|
166
|
+
try {
|
|
167
|
+
const image = yield imageRegistry.getByURL(imageURL);
|
|
168
|
+
this.setState({ imageDataURI: image.dataURI });
|
|
169
|
+
} catch (error) {
|
|
170
|
+
console.error(error);
|
|
171
|
+
}
|
|
440
172
|
}
|
|
441
|
-
|
|
442
|
-
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
const { imageDataURI } = this.state;
|
|
177
|
+
const { width, height, title } = this.props;
|
|
178
|
+
if (!imageDataURI) {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
return /* @__PURE__ */ react_default.createElement(
|
|
182
|
+
Image,
|
|
183
|
+
{
|
|
443
184
|
src: imageDataURI,
|
|
444
185
|
shouldPreserveAspectRatio: this.state.preserveAspectRatio,
|
|
445
|
-
width
|
|
446
|
-
height
|
|
447
|
-
alt:
|
|
448
|
-
onError:
|
|
449
|
-
e.target.alt =
|
|
186
|
+
width,
|
|
187
|
+
height,
|
|
188
|
+
alt: (0, i18n_exports._)(title),
|
|
189
|
+
onError: (e) => {
|
|
190
|
+
e.target.alt = (0, i18n_exports._)("Image not found");
|
|
450
191
|
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
width: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.number]),
|
|
463
|
-
height: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.number]),
|
|
464
|
-
preserveAspectRatio: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.bool,
|
|
465
|
-
title: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.string
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
__publicField(RemoteImage, "contextType", ImageContext_default);
|
|
197
|
+
__publicField(RemoteImage, "propTypes", {
|
|
198
|
+
imageURL: prop_types_default.string,
|
|
199
|
+
width: prop_types_default.oneOfType([prop_types_default.string, prop_types_default.number]),
|
|
200
|
+
height: prop_types_default.oneOfType([prop_types_default.string, prop_types_default.number]),
|
|
201
|
+
preserveAspectRatio: prop_types_default.bool,
|
|
202
|
+
title: prop_types_default.string
|
|
466
203
|
});
|
|
467
|
-
|
|
468
|
-
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(RemoteImage, "defaultProps", {
|
|
204
|
+
__publicField(RemoteImage, "defaultProps", {
|
|
469
205
|
preserveAspectRatio: false
|
|
470
206
|
});
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
/***/ })
|
|
475
|
-
/******/ ]);
|
|
476
|
-
//# sourceMappingURL=RemoteImage.js.map
|
|
207
|
+
var RemoteImage_default = RemoteImage;
|
|
208
|
+
//# sourceMappingURL=RemoteImage.js.map
|