evui 3.3.25 → 3.3.26

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.
@@ -7959,7 +7959,7 @@ $({ target: 'Number', stat: true }, {
7959
7959
  /***/ "9224":
7960
7960
  /***/ (function(module) {
7961
7961
 
7962
- module.exports = JSON.parse("{\"a\":\"3.3.25\"}");
7962
+ module.exports = JSON.parse("{\"a\":\"3.3.26\"}");
7963
7963
 
7964
7964
  /***/ }),
7965
7965
 
@@ -36377,7 +36377,10 @@ var element_pie_Pie = /*#__PURE__*/function () {
36377
36377
  var formattedTxt;
36378
36378
 
36379
36379
  if (formatter) {
36380
- formattedTxt = formatter(value);
36380
+ formattedTxt = formatter({
36381
+ value: value,
36382
+ percentage: this.data.percentage
36383
+ });
36381
36384
  }
36382
36385
 
36383
36386
  if (!formatter || typeof formattedTxt !== 'string') {
@@ -40268,11 +40271,7 @@ var plugins_legend_gradient_modules = {
40268
40271
  this.onLegendBoxLeave = function () {
40269
40272
  _this2.legendDragInfo.dragging = false;
40270
40273
 
40271
- var lineDOM = _this2.containerDOM.getElementsByClassName('ev-chart-legend-line')[0];
40272
-
40273
- var targetDOM = lineDOM.getElementsByClassName('ev-chart-legend-thumb')[0];
40274
-
40275
- _this2.clearOverlay(targetDOM);
40274
+ _this2.clearOverlay();
40276
40275
 
40277
40276
  var seriesList = Object.values(_this2.seriesList);
40278
40277
 
@@ -40351,7 +40350,7 @@ var plugins_legend_gradient_modules = {
40351
40350
  },
40352
40351
  clearOverlay: function clearOverlay() {
40353
40352
  var targetDOM = this.containerDOM.getElementsByClassName('ev-chart-legend-line')[0];
40354
- var overlayDOM = targetDOM.getElementsByClassName('ev-chart-legend-overlay')[0];
40353
+ var overlayDOM = targetDOM === null || targetDOM === void 0 ? void 0 : targetDOM.getElementsByClassName('ev-chart-legend-overlay')[0];
40355
40354
 
40356
40355
  if (overlayDOM) {
40357
40356
  targetDOM.removeChild(overlayDOM);
@@ -40399,12 +40398,15 @@ var plugins_legend_gradient_modules = {
40399
40398
  itemDOM.style.cssText = itemStyle;
40400
40399
  overlayDOM.appendChild(tooltipDOM);
40401
40400
  overlayDOM.appendChild(itemDOM);
40402
- targetDOM.appendChild(overlayDOM);
40403
- var thumbDOM = targetDOM.getElementsByClassName('ev-chart-legend-thumb')[0];
40404
- var labels = thumbDOM.children;
40405
- labels.forEach(function (labelDOM) {
40406
- labelDOM.style.opacity = 0.2;
40407
- });
40401
+ targetDOM === null || targetDOM === void 0 ? void 0 : targetDOM.appendChild(overlayDOM);
40402
+ var thumbDOM = targetDOM === null || targetDOM === void 0 ? void 0 : targetDOM.getElementsByClassName('ev-chart-legend-thumb')[0];
40403
+
40404
+ if (thumbDOM) {
40405
+ var labels = thumbDOM.children;
40406
+ labels.forEach(function (labelDOM) {
40407
+ labelDOM.style.opacity = 0.2;
40408
+ });
40409
+ }
40408
40410
  },
40409
40411
  createLegendHandle: function createLegendHandle(type) {
40410
40412
  var colorBtnDOM = document.createElement('span');
@@ -40739,36 +40741,7 @@ var plugins_interaction_modules = {
40739
40741
  var hitInfo = _this.findHitItem(offset);
40740
40742
 
40741
40743
  if (tooltip !== null && tooltip !== void 0 && tooltip.showAllValueInRange && hitInfo !== null && hitInfo !== void 0 && hitInfo.items) {
40742
- (function () {
40743
- var _hitInfo$items, _hitInfo$items$hitIte, _hitInfo$items$hitIte2, _hitInfo$items2, _hitInfo$items2$hitIt, _hitInfo$items2$hitIt2;
40744
-
40745
- var isHorizontal = !!_this.options.horizontal;
40746
- var hitItemId = Object.keys(hitInfo.items)[0];
40747
- var hitItemData = isHorizontal ? (_hitInfo$items = hitInfo.items) === null || _hitInfo$items === void 0 ? void 0 : (_hitInfo$items$hitIte = _hitInfo$items[hitItemId]) === null || _hitInfo$items$hitIte === void 0 ? void 0 : (_hitInfo$items$hitIte2 = _hitInfo$items$hitIte.data) === null || _hitInfo$items$hitIte2 === void 0 ? void 0 : _hitInfo$items$hitIte2.y : (_hitInfo$items2 = hitInfo.items) === null || _hitInfo$items2 === void 0 ? void 0 : (_hitInfo$items2$hitIt = _hitInfo$items2[hitItemId]) === null || _hitInfo$items2$hitIt === void 0 ? void 0 : (_hitInfo$items2$hitIt2 = _hitInfo$items2$hitIt.data) === null || _hitInfo$items2$hitIt2 === void 0 ? void 0 : _hitInfo$items2$hitIt2.x;
40748
- var sIds = Object.keys(_this.seriesList);
40749
-
40750
- for (var ix = 0; ix < sIds.length; ix++) {
40751
- var sId = sIds[ix];
40752
- var series = _this.seriesList[sId];
40753
- var hasData = series.data.find(function (data) {
40754
- return isHorizontal ? data.y : (data === null || data === void 0 ? void 0 : data.x) === hitItemData;
40755
- });
40756
-
40757
- if (hasData && !hitInfo.items[sId] && series !== null && series !== void 0 && series.show) {
40758
- var item = {};
40759
- item.color = series.color;
40760
- item.hit = false;
40761
- item.name = series.name;
40762
- item.axis = {
40763
- x: series.xAxisIndex,
40764
- y: series.yAxisIndex
40765
- };
40766
- item.index = isHorizontal ? series.yAxisIndex : series.xAxisIndex;
40767
- item.data = hasData;
40768
- hitInfo.items[sId] = item;
40769
- }
40770
- }
40771
- })();
40744
+ _this.addNotHitInfo(hitInfo);
40772
40745
  }
40773
40746
 
40774
40747
  var ctx = _this.overlayCtx;
@@ -41149,14 +41122,10 @@ var plugins_interaction_modules = {
41149
41122
  * @returns {object} hit item information
41150
41123
  */
41151
41124
  findHitItem: function findHitItem(offset) {
41152
- var _tooltipOpt$formatter;
41153
-
41154
41125
  var sIds = Object.keys(this.seriesList);
41155
41126
  var items = {};
41156
41127
  var isHorizontal = !!this.options.horizontal;
41157
41128
  var ctx = this.tooltipCtx;
41158
- var tooltipOpt = this.options.tooltip;
41159
- var tooltipValueFormatter = typeof tooltipOpt.formatter === 'function' ? tooltipOpt.formatter : (_tooltipOpt$formatter = tooltipOpt.formatter) === null || _tooltipOpt$formatter === void 0 ? void 0 : _tooltipOpt$formatter.value;
41160
41129
  var hitId = null;
41161
41130
  var maxs = '';
41162
41131
  var maxsw = 0;
@@ -41191,33 +41160,11 @@ var plugins_interaction_modules = {
41191
41160
  y: series.yAxisIndex
41192
41161
  };
41193
41162
  items[sId] = item;
41194
- var formattedTxt = '';
41195
-
41196
- if (tooltipValueFormatter) {
41197
- if (this.options.type === 'pie') {
41198
- formattedTxt = tooltipValueFormatter({
41199
- value: gdata,
41200
- name: sName
41201
- });
41202
- } else if (this.options.type === 'heatMap') {
41203
- formattedTxt = tooltipValueFormatter({
41204
- x: item.data.x,
41205
- y: item.data.y,
41206
- value: gdata > -1 ? gdata : 'error'
41207
- });
41208
- } else {
41209
- formattedTxt = tooltipValueFormatter({
41210
- x: this.options.horizontal ? gdata : item.data.x,
41211
- y: this.options.horizontal ? item.data.y : gdata,
41212
- name: sName
41213
- });
41214
- }
41215
- }
41216
-
41217
- if (!tooltipValueFormatter || typeof formattedTxt !== 'string') {
41218
- formattedTxt = numberWithComma(gdata);
41219
- }
41220
-
41163
+ var formattedTxt = this.getFormattedTooltipValue({
41164
+ seriesName: sName,
41165
+ value: gdata,
41166
+ itemData: item.data
41167
+ });
41221
41168
  item.data.formatted = formattedTxt;
41222
41169
 
41223
41170
  if (maxsw < sw) {
@@ -41252,6 +41199,98 @@ var plugins_interaction_modules = {
41252
41199
  };
41253
41200
  },
41254
41201
 
41202
+ /**
41203
+ * get formatted value for tooltip
41204
+ * @param seriesName
41205
+ * @param value
41206
+ * @param x
41207
+ * @param y
41208
+ * @returns {string}
41209
+ */
41210
+ getFormattedTooltipValue: function getFormattedTooltipValue(_ref2) {
41211
+ var _tooltipOpt$formatter;
41212
+
41213
+ var seriesName = _ref2.seriesName,
41214
+ value = _ref2.value,
41215
+ itemData = _ref2.itemData;
41216
+ var tooltipOpt = this.options.tooltip;
41217
+ var tooltipValueFormatter = typeof tooltipOpt.formatter === 'function' ? tooltipOpt.formatter : (_tooltipOpt$formatter = tooltipOpt.formatter) === null || _tooltipOpt$formatter === void 0 ? void 0 : _tooltipOpt$formatter.value;
41218
+ var formattedTxt = value;
41219
+
41220
+ if (tooltipValueFormatter) {
41221
+ if (this.options.type === 'pie') {
41222
+ formattedTxt = tooltipValueFormatter({
41223
+ value: value,
41224
+ name: seriesName,
41225
+ percentage: itemData.percentage
41226
+ });
41227
+ } else if (this.options.type === 'heatMap') {
41228
+ formattedTxt = tooltipValueFormatter({
41229
+ x: itemData.x,
41230
+ y: itemData.y,
41231
+ value: value > -1 ? value : 'error'
41232
+ });
41233
+ } else {
41234
+ formattedTxt = tooltipValueFormatter({
41235
+ x: this.options.horizontal ? value : itemData.x,
41236
+ y: this.options.horizontal ? itemData.y : value,
41237
+ name: seriesName
41238
+ });
41239
+ }
41240
+ }
41241
+
41242
+ if (value && (!tooltipValueFormatter || typeof formattedTxt !== 'string')) {
41243
+ if (this.options.type === 'heatMap') {
41244
+ formattedTxt = value < 0 ? 'error' : numberWithComma(value);
41245
+ } else {
41246
+ formattedTxt = numberWithComma(value);
41247
+ }
41248
+ }
41249
+
41250
+ return formattedTxt;
41251
+ },
41252
+
41253
+ /**
41254
+ * add not hit info
41255
+ * @param hitInfo
41256
+ */
41257
+ addNotHitInfo: function addNotHitInfo(hitInfo) {
41258
+ var _hitInfo$items, _hitInfo$items$hitIte, _hitInfo$items$hitIte2, _hitInfo$items2, _hitInfo$items2$hitIt, _hitInfo$items2$hitIt2;
41259
+
41260
+ var isHorizontal = !!this.options.horizontal;
41261
+ var hitItemId = Object.keys(hitInfo.items)[0];
41262
+ var hitItemData = isHorizontal ? (_hitInfo$items = hitInfo.items) === null || _hitInfo$items === void 0 ? void 0 : (_hitInfo$items$hitIte = _hitInfo$items[hitItemId]) === null || _hitInfo$items$hitIte === void 0 ? void 0 : (_hitInfo$items$hitIte2 = _hitInfo$items$hitIte.data) === null || _hitInfo$items$hitIte2 === void 0 ? void 0 : _hitInfo$items$hitIte2.y : (_hitInfo$items2 = hitInfo.items) === null || _hitInfo$items2 === void 0 ? void 0 : (_hitInfo$items2$hitIt = _hitInfo$items2[hitItemId]) === null || _hitInfo$items2$hitIt === void 0 ? void 0 : (_hitInfo$items2$hitIt2 = _hitInfo$items2$hitIt.data) === null || _hitInfo$items2$hitIt2 === void 0 ? void 0 : _hitInfo$items2$hitIt2.x;
41263
+ var sIds = Object.keys(this.seriesList);
41264
+
41265
+ for (var ix = 0; ix < sIds.length; ix++) {
41266
+ var sId = sIds[ix];
41267
+ var series = this.seriesList[sId];
41268
+ var hasData = series.data.find(function (data) {
41269
+ return isHorizontal ? (data === null || data === void 0 ? void 0 : data.y) === hitItemData : (data === null || data === void 0 ? void 0 : data.x) === hitItemData;
41270
+ });
41271
+
41272
+ if (hasData && !hitInfo.items[sId] && series !== null && series !== void 0 && series.show) {
41273
+ var item = {};
41274
+ item.color = series.color;
41275
+ item.hit = false;
41276
+ item.name = series.name;
41277
+ item.axis = {
41278
+ x: series.xAxisIndex,
41279
+ y: series.yAxisIndex
41280
+ };
41281
+ item.index = isHorizontal ? series.yAxisIndex : series.xAxisIndex;
41282
+ item.data = hasData;
41283
+ item.data.formatted = this.getFormattedTooltipValue({
41284
+ seriesName: series.name,
41285
+ value: hasData.o,
41286
+ x: hasData.x,
41287
+ y: hasData.y
41288
+ });
41289
+ hitInfo.items[sId] = item;
41290
+ }
41291
+ }
41292
+ },
41293
+
41255
41294
  /**
41256
41295
  *
41257
41296
  * @param targetInfo {object} '{ dataIndex: number, seriesID: string }'
@@ -41324,10 +41363,10 @@ var plugins_interaction_modules = {
41324
41363
  });
41325
41364
  var dataEntries = Object.entries(this.data.data);
41326
41365
  infoObj.data = infoObj.dataIndex.map(function (labelIdx) {
41327
- return Object.fromEntries(dataEntries.map(function (_ref2) {
41328
- var _ref3 = _slicedToArray(_ref2, 2),
41329
- sId = _ref3[0],
41330
- data = _ref3[1];
41366
+ return Object.fromEntries(dataEntries.map(function (_ref3) {
41367
+ var _ref4 = _slicedToArray(_ref3, 2),
41368
+ sId = _ref4[0],
41369
+ data = _ref4[1];
41331
41370
 
41332
41371
  return [sId, data[labelIdx]];
41333
41372
  }));
@@ -41447,12 +41486,12 @@ var plugins_interaction_modules = {
41447
41486
  * object.range: coordinate-based range in graph
41448
41487
  * @returns {object}
41449
41488
  */
41450
- getSelectionRage: function getSelectionRage(_ref4) {
41451
- var xsp = _ref4.xsp,
41452
- ysp = _ref4.ysp,
41453
- width = _ref4.width,
41454
- height = _ref4.height,
41455
- range = _ref4.range;
41489
+ getSelectionRage: function getSelectionRage(_ref5) {
41490
+ var xsp = _ref5.xsp,
41491
+ ysp = _ref5.ysp,
41492
+ width = _ref5.width,
41493
+ height = _ref5.height,
41494
+ range = _ref5.range;
41456
41495
  var dataRangeX = this.axesSteps.x.length ? this.axesSteps.x[0] : null;
41457
41496
  var dataRangeY = this.axesSteps.y.length ? this.axesSteps.y[0] : null;
41458
41497
 
@@ -41498,6 +41537,8 @@ var plugins_interaction_modules = {
41498
41537
  return this.seriesList[sId].findBlockRange(range);
41499
41538
  },
41500
41539
  getSelectionRangeForHeatMap: function getSelectionRangeForHeatMap(range) {
41540
+ var _this$seriesList$sId$;
41541
+
41501
41542
  var dataRangeX = this.axesSteps.x.length ? this.axesSteps.x[0] : null;
41502
41543
  var dataRangeY = this.axesSteps.y.length ? this.axesSteps.y[0] : null;
41503
41544
 
@@ -41507,11 +41548,11 @@ var plugins_interaction_modules = {
41507
41548
 
41508
41549
  var sId = Object.keys(this.seriesList)[0];
41509
41550
 
41510
- var _this$seriesList$sId$ = this.seriesList[sId].findSelectionRange(range),
41511
- xMin = _this$seriesList$sId$.xMin,
41512
- xMax = _this$seriesList$sId$.xMax,
41513
- yMin = _this$seriesList$sId$.yMin,
41514
- yMax = _this$seriesList$sId$.yMax;
41551
+ var _ref6 = (_this$seriesList$sId$ = this.seriesList[sId].findSelectionRange(range)) !== null && _this$seriesList$sId$ !== void 0 ? _this$seriesList$sId$ : {},
41552
+ xMin = _ref6.xMin,
41553
+ xMax = _ref6.xMax,
41554
+ yMin = _ref6.yMin,
41555
+ yMax = _ref6.yMax;
41515
41556
 
41516
41557
  return {
41517
41558
  xMin: xMin !== null && xMin !== void 0 ? xMin : dataRangeX.graphMin,
@@ -42262,6 +42303,7 @@ var plugins_pie_modules = {
42262
42303
  var startAngle = 1.5 * Math.PI;
42263
42304
  var endAngle;
42264
42305
  var series;
42306
+ var percentage;
42265
42307
  var centerX = chartRect.width / 2;
42266
42308
  var centerY = chartRect.height / 2;
42267
42309
  var chartWidth = centerX - (padding.left + padding.right);
@@ -42301,6 +42343,7 @@ var plugins_pie_modules = {
42301
42343
  for (var jx = 0; jx < pie.data.length; jx++) {
42302
42344
  slice = pie.data[jx];
42303
42345
  value = slice.value;
42346
+ percentage = value / pie.total * 100;
42304
42347
  sliceAngle = 2 * Math.PI * (value / pie.total);
42305
42348
  endAngle = startAngle + sliceAngle;
42306
42349
  slice.sa = startAngle;
@@ -42329,7 +42372,8 @@ var plugins_pie_modules = {
42329
42372
  series.startAngle = startAngle;
42330
42373
  series.endAngle = endAngle;
42331
42374
  series.data = {
42332
- o: value
42375
+ o: value,
42376
+ percentage: percentage
42333
42377
  };
42334
42378
  series.draw(ctx, strokeOptions);
42335
42379
  startAngle += sliceAngle;
@@ -43249,12 +43293,18 @@ var chart_core_EvChart = /*#__PURE__*/function () {
43249
43293
  var opt = this.options;
43250
43294
 
43251
43295
  if (opt.title.show) {
43252
- this.initTitle();
43296
+ if (!this.isInitTitle) {
43297
+ this.initTitle();
43298
+ }
43299
+
43253
43300
  this.showTitle();
43254
43301
  }
43255
43302
 
43256
43303
  if (opt.legend.show) {
43257
- this.initLegend();
43304
+ if (!this.isInitLegend) {
43305
+ this.initLegend();
43306
+ }
43307
+
43258
43308
  this.setLegendPosition();
43259
43309
  }
43260
43310
 
@@ -43972,6 +44022,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
43972
44022
  this.clear();
43973
44023
  this.bufferCtx.restore();
43974
44024
  this.bufferCtx.save();
44025
+ this.initRect();
43975
44026
  this.initScale();
43976
44027
  this.chartRect = this.getChartRect();
43977
44028
  this.drawChart();
@@ -45573,10 +45624,12 @@ var treeGrid_uses_clickEvent = function clickEvent(params) {
45573
45624
  var tagName = event.target.tagName.toLowerCase();
45574
45625
  var cellInfo = {};
45575
45626
 
45576
- if (tagName === 'td') {
45577
- cellInfo = event.target.dataset;
45578
- } else {
45579
- cellInfo = event.target.closest('td').dataset;
45627
+ if (event.target.offsetParent) {
45628
+ if (tagName === 'td') {
45629
+ cellInfo = event.target.dataset;
45630
+ } else {
45631
+ cellInfo = event.target.closest('td').dataset;
45632
+ }
45580
45633
  }
45581
45634
 
45582
45635
  return {