@capillarytech/blaze-ui 5.18.6 → 5.18.7

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/CapGraph/index.js CHANGED
@@ -1,87 +1,17 @@
1
1
  /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
2
3
  /******/ var __webpack_modules__ = ({
3
4
 
4
5
  /***/ 9206:
5
6
  /***/ ((module) => {
6
7
 
7
- "use strict";
8
8
  module.exports = require("react");
9
9
 
10
10
  /***/ }),
11
11
 
12
- /***/ 9261:
13
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
14
-
15
- "use strict";
16
- __webpack_require__.r(__webpack_exports__);
17
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
19
- /* harmony export */ });
20
- /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(85072);
21
- /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
22
- /* harmony import */ var _node_modules_style_loader_dist_runtime_singletonStyleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64284);
23
- /* harmony import */ var _node_modules_style_loader_dist_runtime_singletonStyleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_singletonStyleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
24
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(77659);
25
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
26
- /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(55056);
27
- /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
28
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10540);
29
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
30
- /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(49458);
31
- /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5__);
32
- /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
33
- /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5__[__WEBPACK_IMPORT_KEY__]
34
- /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
- var options = {};
47
-
48
- ;
49
- options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
50
- options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
51
- options.domAPI = (_node_modules_style_loader_dist_runtime_singletonStyleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
52
- options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
53
-
54
- var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()((_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default()), options);
55
-
56
-
57
-
58
-
59
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default()) && (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default().locals) ? (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default().locals) : undefined);
60
-
61
-
62
- /***/ }),
63
-
64
- /***/ 10540:
65
- /***/ ((module) => {
66
-
67
- "use strict";
68
-
69
-
70
- /* istanbul ignore next */
71
- function insertStyleElement(options) {
72
- var element = document.createElement("style");
73
- options.setAttributes(element, options.attributes);
74
- options.insert(element, options.options);
75
- return element;
76
- }
77
- module.exports = insertStyleElement;
78
-
79
- /***/ }),
80
-
81
12
  /***/ 21020:
82
13
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
83
14
 
84
- "use strict";
85
15
  /**
86
16
  * @license React
87
17
  * react-jsx-runtime.production.min.js
@@ -97,148 +27,16 @@ function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&
97
27
 
98
28
  /***/ }),
99
29
 
100
- /***/ 31601:
101
- /***/ ((module) => {
102
-
103
- "use strict";
104
-
105
-
106
- module.exports = function (i) {
107
- return i[1];
108
- };
109
-
110
- /***/ }),
111
-
112
- /***/ 49458:
113
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
114
-
115
- // Imports
116
- var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = __webpack_require__(31601);
117
- var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(76314);
118
- var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
119
- // Module
120
- ___CSS_LOADER_EXPORT___.push([module.id, ``, ""]);
121
- // Exports
122
- ___CSS_LOADER_EXPORT___.locals = {};
123
- module.exports = ___CSS_LOADER_EXPORT___;
124
-
125
-
126
- /***/ }),
127
-
128
- /***/ 55056:
129
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
130
-
131
- "use strict";
132
-
133
-
134
- /* istanbul ignore next */
135
- function setAttributesWithoutAttributes(styleElement) {
136
- var nonce = true ? __webpack_require__.nc : 0;
137
- if (nonce) {
138
- styleElement.setAttribute("nonce", nonce);
139
- }
140
- }
141
- module.exports = setAttributesWithoutAttributes;
142
-
143
- /***/ }),
144
-
145
- /***/ 64284:
30
+ /***/ 43363:
146
31
  /***/ ((module) => {
147
32
 
148
- "use strict";
149
-
150
-
151
- /* istanbul ignore next */
152
- var replaceText = function replaceText() {
153
- var textStore = [];
154
- return function replace(index, replacement) {
155
- textStore[index] = replacement;
156
- return textStore.filter(Boolean).join("\n");
157
- };
158
- }();
159
-
160
- /* istanbul ignore next */
161
- function apply(styleElement, index, remove, obj) {
162
- var css;
163
- if (remove) {
164
- css = "";
165
- } else {
166
- css = "";
167
- if (obj.supports) {
168
- css += "@supports (".concat(obj.supports, ") {");
169
- }
170
- if (obj.media) {
171
- css += "@media ".concat(obj.media, " {");
172
- }
173
- var needLayer = typeof obj.layer !== "undefined";
174
- if (needLayer) {
175
- css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
176
- }
177
- css += obj.css;
178
- if (needLayer) {
179
- css += "}";
180
- }
181
- if (obj.media) {
182
- css += "}";
183
- }
184
- if (obj.supports) {
185
- css += "}";
186
- }
187
- }
188
-
189
- // For old IE
190
- /* istanbul ignore if */
191
- if (styleElement.styleSheet) {
192
- styleElement.styleSheet.cssText = replaceText(index, css);
193
- } else {
194
- var cssNode = document.createTextNode(css);
195
- var childNodes = styleElement.childNodes;
196
- if (childNodes[index]) {
197
- styleElement.removeChild(childNodes[index]);
198
- }
199
- if (childNodes.length) {
200
- styleElement.insertBefore(cssNode, childNodes[index]);
201
- } else {
202
- styleElement.appendChild(cssNode);
203
- }
204
- }
205
- }
206
- var singletonData = {
207
- singleton: null,
208
- singletonCounter: 0
209
- };
210
-
211
- /* istanbul ignore next */
212
- function domAPI(options) {
213
- if (typeof document === "undefined") return {
214
- update: function update() {},
215
- remove: function remove() {}
216
- };
217
-
218
- // eslint-disable-next-line no-undef,no-use-before-define
219
- var styleIndex = singletonData.singletonCounter++;
220
- var styleElement =
221
- // eslint-disable-next-line no-undef,no-use-before-define
222
- singletonData.singleton || (
223
- // eslint-disable-next-line no-undef,no-use-before-define
224
- singletonData.singleton = options.insertStyleElement(options));
225
- return {
226
- update: function update(obj) {
227
- apply(styleElement, styleIndex, false, obj);
228
- },
229
- remove: function remove(obj) {
230
- apply(styleElement, styleIndex, true, obj);
231
- }
232
- };
233
- }
234
- module.exports = domAPI;
33
+ module.exports = require("prop-types");
235
34
 
236
35
  /***/ }),
237
36
 
238
37
  /***/ 74848:
239
38
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
240
39
 
241
- "use strict";
242
40
 
243
41
 
244
42
  if (true) {
@@ -247,272 +45,11 @@ if (true) {
247
45
  {}
248
46
 
249
47
 
250
- /***/ }),
251
-
252
- /***/ 76314:
253
- /***/ ((module) => {
254
-
255
- "use strict";
256
-
257
-
258
- /*
259
- MIT License http://www.opensource.org/licenses/mit-license.php
260
- Author Tobias Koppers @sokra
261
- */
262
- module.exports = function (cssWithMappingToString) {
263
- var list = [];
264
-
265
- // return the list of modules as css string
266
- list.toString = function toString() {
267
- return this.map(function (item) {
268
- var content = "";
269
- var needLayer = typeof item[5] !== "undefined";
270
- if (item[4]) {
271
- content += "@supports (".concat(item[4], ") {");
272
- }
273
- if (item[2]) {
274
- content += "@media ".concat(item[2], " {");
275
- }
276
- if (needLayer) {
277
- content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
278
- }
279
- content += cssWithMappingToString(item);
280
- if (needLayer) {
281
- content += "}";
282
- }
283
- if (item[2]) {
284
- content += "}";
285
- }
286
- if (item[4]) {
287
- content += "}";
288
- }
289
- return content;
290
- }).join("");
291
- };
292
-
293
- // import a list of modules into the list
294
- list.i = function i(modules, media, dedupe, supports, layer) {
295
- if (typeof modules === "string") {
296
- modules = [[null, modules, undefined]];
297
- }
298
- var alreadyImportedModules = {};
299
- if (dedupe) {
300
- for (var k = 0; k < this.length; k++) {
301
- var id = this[k][0];
302
- if (id != null) {
303
- alreadyImportedModules[id] = true;
304
- }
305
- }
306
- }
307
- for (var _k = 0; _k < modules.length; _k++) {
308
- var item = [].concat(modules[_k]);
309
- if (dedupe && alreadyImportedModules[item[0]]) {
310
- continue;
311
- }
312
- if (typeof layer !== "undefined") {
313
- if (typeof item[5] === "undefined") {
314
- item[5] = layer;
315
- } else {
316
- item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
317
- item[5] = layer;
318
- }
319
- }
320
- if (media) {
321
- if (!item[2]) {
322
- item[2] = media;
323
- } else {
324
- item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
325
- item[2] = media;
326
- }
327
- }
328
- if (supports) {
329
- if (!item[4]) {
330
- item[4] = "".concat(supports);
331
- } else {
332
- item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
333
- item[4] = supports;
334
- }
335
- }
336
- list.push(item);
337
- }
338
- };
339
- return list;
340
- };
341
-
342
- /***/ }),
343
-
344
- /***/ 77659:
345
- /***/ ((module) => {
346
-
347
- "use strict";
348
-
349
-
350
- var memo = {};
351
-
352
- /* istanbul ignore next */
353
- function getTarget(target) {
354
- if (typeof memo[target] === "undefined") {
355
- var styleTarget = document.querySelector(target);
356
-
357
- // Special case to return head of iframe instead of iframe itself
358
- if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
359
- try {
360
- // This will throw an exception if access to iframe is blocked
361
- // due to cross-origin restrictions
362
- styleTarget = styleTarget.contentDocument.head;
363
- } catch (e) {
364
- // istanbul ignore next
365
- styleTarget = null;
366
- }
367
- }
368
- memo[target] = styleTarget;
369
- }
370
- return memo[target];
371
- }
372
-
373
- /* istanbul ignore next */
374
- function insertBySelector(insert, style) {
375
- var target = getTarget(insert);
376
- if (!target) {
377
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
378
- }
379
- target.appendChild(style);
380
- }
381
- module.exports = insertBySelector;
382
-
383
- /***/ }),
384
-
385
- /***/ 85072:
386
- /***/ ((module) => {
387
-
388
- "use strict";
389
-
390
-
391
- var stylesInDOM = [];
392
- function getIndexByIdentifier(identifier) {
393
- var result = -1;
394
- for (var i = 0; i < stylesInDOM.length; i++) {
395
- if (stylesInDOM[i].identifier === identifier) {
396
- result = i;
397
- break;
398
- }
399
- }
400
- return result;
401
- }
402
- function modulesToDom(list, options) {
403
- var idCountMap = {};
404
- var identifiers = [];
405
- for (var i = 0; i < list.length; i++) {
406
- var item = list[i];
407
- var id = options.base ? item[0] + options.base : item[0];
408
- var count = idCountMap[id] || 0;
409
- var identifier = "".concat(id, " ").concat(count);
410
- idCountMap[id] = count + 1;
411
- var indexByIdentifier = getIndexByIdentifier(identifier);
412
- var obj = {
413
- css: item[1],
414
- media: item[2],
415
- sourceMap: item[3],
416
- supports: item[4],
417
- layer: item[5]
418
- };
419
- if (indexByIdentifier !== -1) {
420
- stylesInDOM[indexByIdentifier].references++;
421
- stylesInDOM[indexByIdentifier].updater(obj);
422
- } else {
423
- var updater = addElementStyle(obj, options);
424
- options.byIndex = i;
425
- stylesInDOM.splice(i, 0, {
426
- identifier: identifier,
427
- updater: updater,
428
- references: 1
429
- });
430
- }
431
- identifiers.push(identifier);
432
- }
433
- return identifiers;
434
- }
435
- function addElementStyle(obj, options) {
436
- var api = options.domAPI(options);
437
- api.update(obj);
438
- var updater = function updater(newObj) {
439
- if (newObj) {
440
- if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
441
- return;
442
- }
443
- api.update(obj = newObj);
444
- } else {
445
- api.remove();
446
- }
447
- };
448
- return updater;
449
- }
450
- module.exports = function (list, options) {
451
- options = options || {};
452
- list = list || [];
453
- var lastIdentifiers = modulesToDom(list, options);
454
- return function update(newList) {
455
- newList = newList || [];
456
- for (var i = 0; i < lastIdentifiers.length; i++) {
457
- var identifier = lastIdentifiers[i];
458
- var index = getIndexByIdentifier(identifier);
459
- stylesInDOM[index].references--;
460
- }
461
- var newLastIdentifiers = modulesToDom(newList, options);
462
- for (var _i = 0; _i < lastIdentifiers.length; _i++) {
463
- var _identifier = lastIdentifiers[_i];
464
- var _index = getIndexByIdentifier(_identifier);
465
- if (stylesInDOM[_index].references === 0) {
466
- stylesInDOM[_index].updater();
467
- stylesInDOM.splice(_index, 1);
468
- }
469
- }
470
- lastIdentifiers = newLastIdentifiers;
471
- };
472
- };
473
-
474
- /***/ }),
475
-
476
- /***/ 87906:
477
- /***/ ((__unused_webpack_module, exports) => {
478
-
479
- "use strict";
480
-
481
-
482
- exports.__esModule = true;
483
- exports.DEFAULT_TOOLTIP_STYLES = exports.DEFAULT_HEIGHT = void 0;
484
- /** Default chart height in pixels (BizCharts expects number). */
485
- const DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = 400;
486
-
487
- /** Default G2 tooltip styles (rem-based, 14px = 1rem). */
488
- const DEFAULT_TOOLTIP_STYLES = exports.DEFAULT_TOOLTIP_STYLES = {
489
- g2Tooltip: {
490
- position: 'absolute',
491
- visibility: 'hidden',
492
- border: '0.071rem solid #efefef',
493
- backgroundColor: '#fff',
494
- color: '#46af45',
495
- opacity: '0.8',
496
- padding: '0.357rem 1.071rem',
497
- transition: 'top 200ms, left 200ms'
498
- },
499
- g2TooltipList: {
500
- display: 'flex',
501
- flexDirection: 'row',
502
- margin: '0.714rem'
503
- },
504
- g2TooltipListItem: {
505
- marginRight: '0.714rem',
506
- color: '#000'
507
- }
508
- };
509
-
510
48
  /***/ }),
511
49
 
512
50
  /***/ 99622:
513
51
  /***/ ((module) => {
514
52
 
515
- "use strict";
516
53
  module.exports = require("bizcharts");
517
54
 
518
55
  /***/ })
@@ -531,7 +68,7 @@ module.exports = require("bizcharts");
531
68
  /******/ }
532
69
  /******/ // Create a new module (and put it into the cache)
533
70
  /******/ var module = __webpack_module_cache__[moduleId] = {
534
- /******/ id: moduleId,
71
+ /******/ // no module.id needed
535
72
  /******/ // no module.loaded needed
536
73
  /******/ exports: {}
537
74
  /******/ };
@@ -544,191 +81,203 @@ module.exports = require("bizcharts");
544
81
  /******/ }
545
82
  /******/
546
83
  /************************************************************************/
547
- /******/ /* webpack/runtime/compat get default export */
548
- /******/ (() => {
549
- /******/ // getDefaultExport function for compatibility with non-harmony modules
550
- /******/ __webpack_require__.n = (module) => {
551
- /******/ var getter = module && module.__esModule ?
552
- /******/ () => (module['default']) :
553
- /******/ () => (module);
554
- /******/ __webpack_require__.d(getter, { a: getter });
555
- /******/ return getter;
556
- /******/ };
557
- /******/ })();
558
- /******/
559
- /******/ /* webpack/runtime/define property getters */
560
- /******/ (() => {
561
- /******/ // define getter functions for harmony exports
562
- /******/ __webpack_require__.d = (exports, definition) => {
563
- /******/ for(var key in definition) {
564
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
565
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
566
- /******/ }
567
- /******/ }
568
- /******/ };
569
- /******/ })();
570
- /******/
571
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
572
- /******/ (() => {
573
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
574
- /******/ })();
575
- /******/
576
- /******/ /* webpack/runtime/make namespace object */
577
- /******/ (() => {
578
- /******/ // define __esModule on exports
579
- /******/ __webpack_require__.r = (exports) => {
580
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
581
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
582
- /******/ }
583
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
584
- /******/ };
585
- /******/ })();
586
- /******/
587
- /******/ /* webpack/runtime/nonce */
588
- /******/ (() => {
589
- /******/ __webpack_require__.nc = undefined;
590
- /******/ })();
591
- /******/
592
- /************************************************************************/
593
84
  var __webpack_exports__ = {};
594
- // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
85
+ // This entry needs to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
595
86
  (() => {
596
- "use strict";
597
87
  var exports = __webpack_exports__;
598
88
 
599
89
 
600
90
  exports.__esModule = true;
601
91
  exports["default"] = void 0;
602
92
  var _bizcharts = __webpack_require__(99622);
603
- var _react = _interopRequireWildcard(__webpack_require__(9206));
604
- var _constants = __webpack_require__(87906);
605
- var _styles = _interopRequireDefault(__webpack_require__(9261));
93
+ var _propTypes = _interopRequireDefault(__webpack_require__(43363));
94
+ var _react = _interopRequireDefault(__webpack_require__(9206));
606
95
  var _jsxRuntime = __webpack_require__(74848);
607
96
  const _excluded = ["marker", "position"],
608
97
  _excluded2 = ["showTooltip", "tooltip", "tooltipDisable", "type", "groupBy", "colors", "shape", "showlabel", "label"];
609
98
  /**
610
- * CapGraph – chart component built on BizCharts (G2).
99
+ *
100
+ * CapGraph
101
+ *
611
102
  */
612
103
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
613
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
614
104
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
615
105
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
616
- const defaultContainerTpl = () => "<div class=\"g2-tooltip\"><div class=\"g2-tooltip-title\" style=\"margin:10px 0;\"></div><ul class=\"g2-tooltip-list\"></ul></div>";
617
- const defaultItemTpl = '<li data-index={index}><span style="background-color:{color};width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:8px;"></span>{value}</li>';
618
-
619
- // Many optional props + BizCharts children; logic preserved from class component
620
- const CapGraph = _ref => {
621
- let {
622
- data,
623
- xAxis,
624
- yAxis,
625
- y1Axis,
626
- y1AxisProps = {},
627
- legend,
628
- g2Tooltip,
629
- g2TooltipList,
630
- g2TooltipListItem,
631
- itemTemplate,
632
- containerTemplate,
633
- size,
634
- scale,
635
- tooltipData,
636
- height,
637
- chartProps = {},
638
- yAxisProps = {},
639
- graphList = [],
640
- xAxisProps = {},
641
- showGuide,
642
- coord,
643
- guide,
644
- title = null
645
- } = _ref;
646
- const [tooltipIndex, setTooltipIndex] = (0, _react.useState)(0);
647
- const updateTooltipInfo = (0, _react.useCallback)((x, y) => {
648
- setTooltipIndex(x);
649
- return {
650
- name: x,
651
- value: y
106
+ const defaultStyles = {
107
+ g2Tooltip: {
108
+ position: 'absolute',
109
+ visibility: 'hidden',
110
+ border: '1px solid #efefef',
111
+ backgroundColor: '#fff',
112
+ color: '#46af45',
113
+ opacity: '0.8',
114
+ padding: '5px 15px',
115
+ transition: 'top 200ms,left 200ms'
116
+ },
117
+ g2TooltipList: {
118
+ display: 'flex',
119
+ flexDirection: 'row',
120
+ margin: '10px'
121
+ },
122
+ g2TooltipListItem: {
123
+ marginRight: '10px',
124
+ color: '#000'
125
+ }
126
+ };
127
+ class CapGraph extends _react.default.Component {
128
+ constructor() {
129
+ super(...arguments);
130
+ this.state = {
131
+ tooltipIndex: 0 // stores the x-axis value of the data point being hovered on
132
+ };
133
+ this.updateTooltipInfo = (x, y) => {
134
+ this.setState({
135
+ tooltipIndex: x
136
+ });
137
+ return {
138
+ name: x,
139
+ value: y
140
+ };
652
141
  };
653
- }, []);
654
- let legendType = 'circle';
655
- let legendPosition = 'bottom-center';
656
- let legendProps = {};
657
- if (legend) {
658
- var _ref2, _ref3;
659
- legendType = (_ref2 = legend.marker) != null ? _ref2 : 'circle';
660
- legendPosition = (_ref3 = legend.position) != null ? _ref3 : 'bottom-center';
661
- const rest = _objectWithoutPropertiesLoose(legend, _excluded);
662
- legendProps = rest;
663
142
  }
664
- const resolvedContainerTpl = typeof containerTemplate === 'function' ? containerTemplate : defaultContainerTpl;
665
- const {
666
- Text
667
- } = _bizcharts.Guide;
668
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
669
- className: _styles.default['cap-graph-wrapper'],
670
- "data-testid": "cap-graph",
671
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_bizcharts.Chart, _extends({
672
- height: height != null ? height : _constants.DEFAULT_HEIGHT,
673
- data: data,
674
- forceFit: true,
675
- scale: scale
676
- }, chartProps, {
677
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Axis, _extends({
678
- name: yAxis
679
- }, yAxisProps)), y1Axis && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Axis, _extends({
680
- name: y1Axis
681
- }, y1AxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Axis, _extends({
682
- name: xAxis
683
- }, xAxisProps)), coord && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Coord, _extends({}, coord)), showGuide && guide && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Guide, {
684
- children: data.map((obj, idx) => {
685
- var _ref4;
686
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Text, {
143
+ render() {
144
+ const {
145
+ data,
146
+ xAxis,
147
+ yAxis,
148
+ y1Axis,
149
+ y1AxisProps,
150
+ legend,
151
+ g2Tooltip,
152
+ g2TooltipList,
153
+ g2TooltipListItem,
154
+ itemTemplate,
155
+ size,
156
+ scale,
157
+ tooltipData,
158
+ height,
159
+ chartProps,
160
+ yAxisProps,
161
+ graphList,
162
+ xAxisProps,
163
+ showGuide,
164
+ coord,
165
+ guide,
166
+ title
167
+ } = this.props;
168
+ let {
169
+ containerTemplate
170
+ } = this.props;
171
+ const {
172
+ Text
173
+ } = _bizcharts.Guide;
174
+ let legendType = 'circle';
175
+ let legendPosition = 'bottom-center';
176
+ let legendProps = {};
177
+ const defaultHeight = 400;
178
+ const defaultContainerTpl = () => "<div class=\"g2-tooltip\"><div class=\"g2-tooltip-title\" style=\"margin:10px 0;\"></div><ul class=\"g2-tooltip-list\"></ul></div>";
179
+ const defaultItemTpl = '<li data-index={index}><span style="background-color:{color};width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:8px;"></span>{value}</li>';
180
+ if (legend) {
181
+ var _legend = legend;
182
+ ({
183
+ marker: legendType,
184
+ position: legendPosition
185
+ } = _legend);
186
+ legendProps = _objectWithoutPropertiesLoose(_legend, _excluded);
187
+ _legend;
188
+ }
189
+ if (typeof containerTemplate !== 'function') {
190
+ containerTemplate = defaultContainerTpl;
191
+ }
192
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
193
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_bizcharts.Chart, _extends({
194
+ height: height || defaultHeight,
195
+ data: data,
196
+ forceFit: true,
197
+ scale: scale
198
+ }, chartProps, {
199
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Axis, _extends({
200
+ name: yAxis
201
+ }, yAxisProps)), y1Axis && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Axis, _extends({
202
+ name: y1Axis
203
+ }, y1AxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Axis, _extends({
204
+ name: xAxis
205
+ }, xAxisProps)), coord && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Coord, _extends({}, coord)), showGuide && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Guide, {
206
+ children: data.map((obj, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Text, {
687
207
  top: true,
688
208
  position: obj.position,
689
209
  content: obj.content,
690
210
  style: guide.style
691
- }, (_ref4 = obj.position) != null ? _ref4 : idx);
692
- })
693
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Tooltip, {
694
- offset: 50,
695
- showTitle: false,
696
- containerTpl: resolvedContainerTpl(tooltipData, tooltipIndex) || defaultContainerTpl,
697
- itemTpl: itemTemplate != null ? itemTemplate : defaultItemTpl,
698
- "g2-tooltip": g2Tooltip != null ? g2Tooltip : _constants.DEFAULT_TOOLTIP_STYLES.g2Tooltip,
699
- "g2-tooltip-list": g2TooltipList != null ? g2TooltipList : _constants.DEFAULT_TOOLTIP_STYLES.g2TooltipList,
700
- "g2-tooltip-list-item": g2TooltipListItem != null ? g2TooltipListItem : _constants.DEFAULT_TOOLTIP_STYLES.g2TooltipListItem
701
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Legend, _extends({
702
- marker: legendType,
703
- position: legendPosition,
704
- title: title
705
- }, legendProps)), graphList.map(_ref5 => {
706
- let {
707
- showTooltip,
708
- tooltip,
709
- tooltipDisable,
710
- type,
711
- groupBy,
712
- colors,
713
- shape,
714
- showlabel,
715
- label
716
- } = _ref5,
717
- rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
718
- const tooltipProp = showTooltip ? tooltip : !tooltipDisable && [xAxis + "*" + yAxis, updateTooltipInfo];
719
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Geom, _extends({
720
- type: type,
721
- position: xAxis + "*" + yAxis,
722
- color: groupBy && colors ? [groupBy, colors] : undefined,
723
- size: size,
724
- tooltip: tooltipProp,
725
- shape: shape
726
- }, rest, {
727
- children: showlabel && label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Label, _extends({}, label))
728
- }), type);
729
- })]
730
- }))
731
- });
211
+ }, obj.position || idx))
212
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Tooltip, {
213
+ offset: 50,
214
+ showTitle: false,
215
+ containerTpl: containerTemplate(tooltipData, this.state.tooltipIndex) || defaultContainerTpl,
216
+ itemTpl: itemTemplate || defaultItemTpl,
217
+ "g2-tooltip": g2Tooltip || defaultStyles.g2Tooltip,
218
+ "g2-tooltip-list": g2TooltipList || defaultStyles.g2TooltipList,
219
+ "g2-tooltip-list-item": g2TooltipListItem || defaultStyles.g2TooltipListItem
220
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Legend, _extends({
221
+ marker: legendType,
222
+ position: legendPosition,
223
+ title: title
224
+ }, legendProps)), graphList.map(_ref => {
225
+ let {
226
+ showTooltip,
227
+ tooltip,
228
+ tooltipDisable,
229
+ type,
230
+ groupBy,
231
+ colors,
232
+ shape,
233
+ showlabel,
234
+ label
235
+ } = _ref,
236
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded2);
237
+ const tooltipProp = showTooltip ? tooltip : !tooltipDisable && [xAxis + "*" + yAxis, this.updateTooltipInfo];
238
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Geom, _extends({
239
+ type: type,
240
+ position: xAxis + "*" + yAxis,
241
+ color: [groupBy, colors],
242
+ size: size,
243
+ tooltip: tooltipProp,
244
+ shape: shape
245
+ }, rest, {
246
+ children: showlabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bizcharts.Label, _extends({}, label))
247
+ }), type);
248
+ })]
249
+ }))
250
+ });
251
+ }
252
+ }
253
+ CapGraph.defaultProps = {
254
+ graphList: [],
255
+ xAxisProps: {},
256
+ yAxisProps: {},
257
+ title: null
258
+ };
259
+ CapGraph.propTypes = {
260
+ height: _propTypes.default.number,
261
+ data: _propTypes.default.array.isRequired,
262
+ xAxis: _propTypes.default.string.isRequired,
263
+ yAxis: _propTypes.default.string.isRequired,
264
+ legend: _propTypes.default.object,
265
+ g2Tooltip: _propTypes.default.object,
266
+ g2TooltipList: _propTypes.default.object,
267
+ g2TooltipListItem: _propTypes.default.object,
268
+ itemTemplate: _propTypes.default.string,
269
+ containerTemplate: _propTypes.default.func,
270
+ size: _propTypes.default.number,
271
+ scale: _propTypes.default.object,
272
+ tooltipData: _propTypes.default.object,
273
+ graphList: _propTypes.default.array,
274
+ yAxisProps: _propTypes.default.object,
275
+ xAxisProps: _propTypes.default.object,
276
+ chartProps: _propTypes.default.object,
277
+ title: _propTypes.default.object,
278
+ showGuide: _propTypes.default.bool,
279
+ coord: _propTypes.default.object,
280
+ guide: _propTypes.default.object
732
281
  };
733
282
  var _default = exports["default"] = CapGraph;
734
283
  })();