evui 3.3.56 → 3.3.57

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.
@@ -8045,7 +8045,7 @@ $({ target: 'Number', stat: true }, {
8045
8045
  /***/ "9224":
8046
8046
  /***/ (function(module) {
8047
8047
 
8048
- module.exports = JSON.parse("{\"a\":\"3.3.56\"}");
8048
+ module.exports = JSON.parse("{\"a\":\"3.3.57\"}");
8049
8049
 
8050
8050
  /***/ }),
8051
8051
 
@@ -36534,6 +36534,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
36534
36534
  }, {
36535
36535
  key: "findGraphRange",
36536
36536
  value: function findGraphRange(offset) {
36537
+ var _this$range;
36538
+
36537
36539
  var xp = offset[0];
36538
36540
  var yp = offset[1];
36539
36541
  var item = {
@@ -36544,9 +36546,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
36544
36546
  var gdata = this.data;
36545
36547
  var totalCount = gdata.length;
36546
36548
 
36547
- var _this$range = _slicedToArray(this.range, 2),
36548
- min = _this$range[0],
36549
- max = _this$range[1];
36549
+ var _ref4 = (_this$range = this.range) !== null && _this$range !== void 0 ? _this$range : [],
36550
+ _ref5 = _slicedToArray(_ref4, 2),
36551
+ min = _ref5[0],
36552
+ max = _ref5[1];
36550
36553
 
36551
36554
  if (truthyNumber(min) && truthyNumber(max)) {
36552
36555
  totalCount = max - min + 1;
@@ -36590,6 +36593,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
36590
36593
  }, {
36591
36594
  key: "findGraphRangeCount",
36592
36595
  value: function findGraphRangeCount(offset) {
36596
+ var _this$range2;
36597
+
36593
36598
  var xp = offset[0];
36594
36599
  var yp = offset[1];
36595
36600
  var item = {
@@ -36600,9 +36605,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
36600
36605
  var gdata = this.data;
36601
36606
  var totalCount = gdata.length;
36602
36607
 
36603
- var _this$range2 = _slicedToArray(this.range, 2),
36604
- min = _this$range2[0],
36605
- max = _this$range2[1];
36608
+ var _ref6 = (_this$range2 = this.range) !== null && _this$range2 !== void 0 ? _this$range2 : [],
36609
+ _ref7 = _slicedToArray(_ref6, 2),
36610
+ min = _ref7[0],
36611
+ max = _ref7[1];
36606
36612
 
36607
36613
  if (truthyNumber(min) && truthyNumber(max)) {
36608
36614
  totalCount = max - min + 1;
@@ -36647,11 +36653,11 @@ var element_bar_Bar = /*#__PURE__*/function () {
36647
36653
 
36648
36654
  }, {
36649
36655
  key: "drawValueLabels",
36650
- value: function drawValueLabels(_ref4) {
36651
- var context = _ref4.context,
36652
- data = _ref4.data,
36653
- positions = _ref4.positions,
36654
- isHighlight = _ref4.isHighlight;
36656
+ value: function drawValueLabels(_ref8) {
36657
+ var context = _ref8.context,
36658
+ data = _ref8.data,
36659
+ positions = _ref8.positions,
36660
+ isHighlight = _ref8.isHighlight;
36655
36661
  var isHorizontal = this.isHorizontal;
36656
36662
  var _this$showValue = this.showValue,
36657
36663
  fontSize = _this$showValue.fontSize,
@@ -36677,9 +36683,9 @@ var element_bar_Bar = /*#__PURE__*/function () {
36677
36683
  if (isStacked) {
36678
36684
  value = data.o;
36679
36685
  } else {
36680
- var _ref5;
36686
+ var _ref9;
36681
36687
 
36682
- value = (_ref5 = isHorizontal ? data.x : data.y) !== null && _ref5 !== void 0 ? _ref5 : '';
36688
+ value = (_ref9 = isHorizontal ? data.x : data.y) !== null && _ref9 !== void 0 ? _ref9 : '';
36683
36689
  }
36684
36690
 
36685
36691
  var formattedTxt;
@@ -36768,9 +36774,9 @@ var element_bar_Bar = /*#__PURE__*/function () {
36768
36774
  }
36769
36775
  }, {
36770
36776
  key: "drawBar",
36771
- value: function drawBar(_ref6) {
36772
- var ctx = _ref6.ctx,
36773
- positions = _ref6.positions;
36777
+ value: function drawBar(_ref10) {
36778
+ var ctx = _ref10.ctx,
36779
+ positions = _ref10.positions;
36774
36780
  var isHorizontal = this.isHorizontal;
36775
36781
  var isStackBar = ('stackIndex' in this);
36776
36782
  var isBorderRadius = this.borderRadius && this.borderRadius > 0;
@@ -38383,8 +38389,8 @@ var scale_Scale = /*#__PURE__*/function () {
38383
38389
  var range = scrollbarOpt !== null && scrollbarOpt !== void 0 && scrollbarOpt.use ? scrollbarOpt === null || scrollbarOpt === void 0 ? void 0 : scrollbarOpt.range : this.range;
38384
38390
 
38385
38391
  if ((range === null || range === void 0 ? void 0 : range.length) === 2) {
38386
- maxValue = range[1];
38387
- minValue = range[0];
38392
+ maxValue = range[1] > +minMax.max ? +minMax.max : range[1];
38393
+ minValue = range[0] < +minMax.min ? +minMax.min : range[0];
38388
38394
  } else {
38389
38395
  maxValue = minMax.max;
38390
38396
  minValue = minMax.min;
@@ -39498,6 +39504,7 @@ var scale_logarithmic_LogarithmicScale = /*#__PURE__*/function (_Scale) {
39498
39504
 
39499
39505
 
39500
39506
 
39507
+
39501
39508
  var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
39502
39509
  _inherits(StepScale, _Scale);
39503
39510
 
@@ -39534,13 +39541,17 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
39534
39541
  var range = scrollbarOpt !== null && scrollbarOpt !== void 0 && scrollbarOpt.use ? scrollbarOpt === null || scrollbarOpt === void 0 ? void 0 : scrollbarOpt.range : this.range;
39535
39542
 
39536
39543
  if (range !== null && range !== void 0 && range.length) {
39537
- var _range = _slicedToArray(range, 2);
39544
+ var _range = _slicedToArray(range, 2),
39545
+ min = _range[0],
39546
+ max = _range[1];
39538
39547
 
39539
- minIndex = _range[0];
39540
- maxIndex = _range[1];
39541
- maxValue = this.labels[maxIndex];
39542
- minValue = this.labels[minIndex];
39543
- labelCount = maxIndex - minIndex + 1;
39548
+ if (truthyNumber(min) && truthyNumber(max)) {
39549
+ minIndex = min < minIndex ? minIndex : min;
39550
+ maxIndex = max > maxIndex ? maxIndex : max;
39551
+ maxValue = this.labels[maxIndex];
39552
+ minValue = this.labels[minIndex];
39553
+ labelCount = maxIndex - minIndex + 1;
39554
+ }
39544
39555
  }
39545
39556
 
39546
39557
  var maxWidth = chartRect.chartWidth / (labelCount + 2);
@@ -40111,8 +40122,9 @@ var scale_time_category_TimeCategoryScale = /*#__PURE__*/function (_Scale) {
40111
40122
  ctx.strokeStyle = this.gridLineColor;
40112
40123
  var labelText;
40113
40124
  var labelPoint;
40125
+ var ix;
40114
40126
 
40115
- for (var ix = 0; ix < oriSteps; ix += count) {
40127
+ for (ix = 0; ix < oriSteps; ix += count) {
40116
40128
  var _this$options, _this$options$selectL, _this$options2, _this$options2$select, _selectLabelInfo$data;
40117
40129
 
40118
40130
  ticks[ix] = axisMin + ix * stepValue;
@@ -40176,10 +40188,10 @@ var scale_time_category_TimeCategoryScale = /*#__PURE__*/function (_Scale) {
40176
40188
  ctx.stroke();
40177
40189
  }
40178
40190
 
40179
- if (this.categoryMode && alignToGridLine && count * steps === oriSteps) {
40191
+ if (this.categoryMode && alignToGridLine && ix * count === oriSteps) {
40180
40192
  var diffTime = dayjs_min_default()(labels[1]).diff(dayjs_min_default()(labels[0]));
40181
- var labelLastText = this.getLabelFormat(dayjs_min_default()(labels[labels.length - 1] + diffTime));
40182
- labelCenter = Math.round(startPoint + graphGap * labels.length);
40193
+ var labelLastText = this.getLabelFormat(dayjs_min_default()(ticks[oriSteps - 1] + diffTime));
40194
+ labelCenter = Math.round(startPoint + graphGap * oriSteps);
40183
40195
  linePosition = labelCenter + aliasPixel;
40184
40196
 
40185
40197
  if (this.type === 'x') {
@@ -42236,27 +42248,61 @@ var plugins_scrollbar_module = {
42236
42248
  });
42237
42249
  scrollbarOpt.type = axisOpt === null || axisOpt === void 0 ? void 0 : (_axisOpt$2 = axisOpt[0]) === null || _axisOpt$2 === void 0 ? void 0 : _axisOpt$2.type;
42238
42250
  scrollbarOpt.range = (axisOpt === null || axisOpt === void 0 ? void 0 : (_axisOpt$3 = axisOpt[0]) === null || _axisOpt$3 === void 0 ? void 0 : _axisOpt$3.range) || null;
42239
- scrollbarOpt.interval = null;
42240
42251
  this.createScrollbarLayout(dir);
42241
42252
  this.createScrollbar(dir);
42242
42253
  this.createScrollEvent(dir);
42243
42254
  scrollbarOpt.isInit = true;
42244
42255
  }
42245
42256
  },
42257
+ checkValidRange: function checkValidRange(dir) {
42258
+ var _scrollbarOpt$range;
42259
+
42260
+ var scrollbarOpt = this.scrollbar[dir];
42261
+ var axesType = scrollbarOpt.type;
42262
+
42263
+ if ((_scrollbarOpt$range = scrollbarOpt.range) !== null && _scrollbarOpt$range !== void 0 && _scrollbarOpt$range.length) {
42264
+ var _scrollbarOpt$range2 = _slicedToArray(scrollbarOpt.range, 2),
42265
+ min = _scrollbarOpt$range2[0],
42266
+ max = _scrollbarOpt$range2[1];
42267
+
42268
+ if (!(truthyNumber(min) && truthyNumber(max))) {
42269
+ return true;
42270
+ }
42271
+
42272
+ if (axesType === 'step') {
42273
+ var labels = this.options.type === 'heatMap' ? this.data.labels[dir] : this.data.labels;
42274
+
42275
+ if (min < 0 || max > labels.length - 1) {
42276
+ return true;
42277
+ }
42278
+ } else {
42279
+ var _this$minMax$dir;
42280
+
42281
+ var minMax = (_this$minMax$dir = this.minMax[dir]) === null || _this$minMax$dir === void 0 ? void 0 : _this$minMax$dir[0];
42282
+
42283
+ if (+min < +minMax.min || +max > +minMax.max) {
42284
+ return true;
42285
+ }
42286
+ }
42287
+ }
42288
+
42289
+ return false;
42290
+ },
42246
42291
 
42247
42292
  /**
42248
42293
  * update scrollbar information
42249
42294
  */
42250
- updateScrollbar: function updateScrollbar() {
42251
- this.updateScrollbarInfo('x');
42252
- this.updateScrollbarInfo('y');
42295
+ updateScrollbar: function updateScrollbar(updateData) {
42296
+ this.updateScrollbarInfo('x', updateData);
42297
+ this.updateScrollbarInfo('y', updateData);
42253
42298
  },
42254
42299
 
42255
42300
  /**
42256
42301
  * Updated scrollbar information with updated axis information
42257
42302
  * @param dir axis direction (x | y)
42303
+ * @param updateData is update data
42258
42304
  */
42259
- updateScrollbarInfo: function updateScrollbarInfo(dir) {
42305
+ updateScrollbarInfo: function updateScrollbarInfo(dir, updateData) {
42260
42306
  var _newOpt$, _newOpt$$scrollbar, _newOpt$2, _newOpt$0$scrollbar, _newOpt$3, _newOpt$4, _axisOpt$4, _newOpt$0$scrollbar2;
42261
42307
 
42262
42308
  var _this$options = this.options,
@@ -42275,7 +42321,7 @@ var plugins_scrollbar_module = {
42275
42321
  var axisOpt = dir === 'x' ? this.axesX : this.axesY;
42276
42322
  var isUpdateAxesRange = !lodash_es_isEqual(newOpt === null || newOpt === void 0 ? void 0 : (_newOpt$4 = newOpt[0]) === null || _newOpt$4 === void 0 ? void 0 : _newOpt$4.range, axisOpt === null || axisOpt === void 0 ? void 0 : (_axisOpt$4 = axisOpt[0]) === null || _axisOpt$4 === void 0 ? void 0 : _axisOpt$4.range);
42277
42323
 
42278
- if (isUpdateAxesRange) {
42324
+ if (isUpdateAxesRange || updateData) {
42279
42325
  var _newOpt$5;
42280
42326
 
42281
42327
  this.scrollbar[dir].range = (newOpt === null || newOpt === void 0 ? void 0 : (_newOpt$5 = newOpt[0]) === null || _newOpt$5 === void 0 ? void 0 : _newOpt$5.range) || null;
@@ -42291,10 +42337,18 @@ var plugins_scrollbar_module = {
42291
42337
  var _this$scrollbar$x, _this$scrollbar$x2, _this$scrollbar$y, _this$scrollbar$y2;
42292
42338
 
42293
42339
  if ((_this$scrollbar$x = this.scrollbar.x) !== null && _this$scrollbar$x !== void 0 && _this$scrollbar$x.use && (_this$scrollbar$x2 = this.scrollbar.x) !== null && _this$scrollbar$x2 !== void 0 && _this$scrollbar$x2.isInit) {
42340
+ if (this.checkValidRange('x')) {
42341
+ return;
42342
+ }
42343
+
42294
42344
  this.setScrollbarPosition('x');
42295
42345
  }
42296
42346
 
42297
42347
  if ((_this$scrollbar$y = this.scrollbar.y) !== null && _this$scrollbar$y !== void 0 && _this$scrollbar$y.use && (_this$scrollbar$y2 = this.scrollbar.y) !== null && _this$scrollbar$y2 !== void 0 && _this$scrollbar$y2.isInit) {
42348
+ if (this.checkValidRange('y')) {
42349
+ return;
42350
+ }
42351
+
42298
42352
  this.setScrollbarPosition('y');
42299
42353
  }
42300
42354
  },
@@ -42455,13 +42509,13 @@ var plugins_scrollbar_module = {
42455
42509
  if (scrollbarOpt.showButton) {
42456
42510
  var upBtnDOM = scrollbarDOM.getElementsByClassName('ev-chart-scrollbar-button-up');
42457
42511
  var endPosition = Math.floor(trackSize - thumbSize.size);
42458
- var upBtnOpacity = Math.floor(thumbSize.position) === endPosition ? 0.5 : 1;
42512
+ var upBtnOpacity = Math.floor(thumbSize.position) > endPosition ? 0.5 : 1;
42459
42513
  upBtnDOM[0].style.cssText = "background-color: ".concat(scrollbarOpt.background, ";").concat(upBtnStyle);
42460
42514
  upBtnDOM[0].style.opacity = upBtnOpacity;
42461
42515
  upBtnDOM[0].children[0].style.display = 'block';
42462
42516
  var downBtnDOM = scrollbarDOM.getElementsByClassName('ev-chart-scrollbar-button-down');
42463
42517
  downBtnDOM[0].style.cssText = "background-color: ".concat(scrollbarOpt.background, ";").concat(downBtnStyle);
42464
- downBtnDOM[0].style.opacity = Math.floor(thumbSize.position) === 0 ? 0.5 : 1;
42518
+ downBtnDOM[0].style.opacity = Math.floor(thumbSize.position) < 0 ? 0.5 : 1;
42465
42519
  downBtnDOM[0].children[0].style.display = 'block';
42466
42520
  }
42467
42521
  },
@@ -42474,9 +42528,9 @@ var plugins_scrollbar_module = {
42474
42528
  getScrollbarThumbSize: function getScrollbarThumbSize(dir, trackSize) {
42475
42529
  var scrollbarOpt = this.scrollbar[dir];
42476
42530
 
42477
- var _scrollbarOpt$range = _slicedToArray(scrollbarOpt.range, 2),
42478
- min = _scrollbarOpt$range[0],
42479
- max = _scrollbarOpt$range[1];
42531
+ var _scrollbarOpt$range3 = _slicedToArray(scrollbarOpt.range, 2),
42532
+ min = _scrollbarOpt$range3[0],
42533
+ max = _scrollbarOpt$range3[1];
42480
42534
 
42481
42535
  var axesType = scrollbarOpt.type;
42482
42536
  var thumbSize;
@@ -42493,20 +42547,26 @@ var plugins_scrollbar_module = {
42493
42547
  thumbSize = intervalSize * range;
42494
42548
  thumbPosition = intervalSize * min;
42495
42549
  } else {
42496
- var _this$axesX, _this$axesX$;
42550
+ var _this$minMax$dir2;
42497
42551
 
42498
- var minMax = this.minMax[dir];
42499
- var graphRange = +minMax[0].max - +minMax[0].min;
42552
+ var axisOpt = dir === 'x' ? this.axesX : this.axesY;
42553
+ var minMax = (_this$minMax$dir2 = this.minMax[dir]) === null || _this$minMax$dir2 === void 0 ? void 0 : _this$minMax$dir2[0];
42554
+ var graphRange = +minMax.max - +minMax.min;
42500
42555
 
42501
42556
  var _range = +max - +min;
42502
42557
 
42503
- interval = (_this$axesX = this.axesX) === null || _this$axesX === void 0 ? void 0 : (_this$axesX$ = _this$axesX[0]) === null || _this$axesX$ === void 0 ? void 0 : _this$axesX$.getInterval({
42504
- min: minMax[0].min,
42505
- max: minMax[0].max,
42506
- maxSteps: this.labelRange[dir].max
42507
- });
42558
+ if (axesType === 'time') {
42559
+ var _axisOpt$5, _this$labelRange$dir, _this$labelRange$dir$;
42560
+
42561
+ interval = axisOpt === null || axisOpt === void 0 ? void 0 : (_axisOpt$5 = axisOpt[0]) === null || _axisOpt$5 === void 0 ? void 0 : _axisOpt$5.getInterval({
42562
+ minValue: minMax.min,
42563
+ maxValue: minMax.max,
42564
+ maxSteps: (_this$labelRange$dir = this.labelRange[dir]) === null || _this$labelRange$dir === void 0 ? void 0 : (_this$labelRange$dir$ = _this$labelRange$dir[0]) === null || _this$labelRange$dir$ === void 0 ? void 0 : _this$labelRange$dir$.max
42565
+ });
42566
+ }
42567
+
42508
42568
  steps = Math.ceil(graphRange / interval) + 1;
42509
- startValue = +minMax[0].min;
42569
+ startValue = +minMax.min;
42510
42570
 
42511
42571
  var _intervalSize = trackSize / steps;
42512
42572
 
@@ -42521,9 +42581,7 @@ var plugins_scrollbar_module = {
42521
42581
  scrollbarOpt.interval = interval;
42522
42582
  return {
42523
42583
  size: thumbSize,
42524
- position: thumbPosition,
42525
- background: scrollbarOpt.background,
42526
- radius: scrollbarOpt.radius
42584
+ position: thumbPosition
42527
42585
  };
42528
42586
  },
42529
42587
 
@@ -42836,13 +42894,16 @@ var plugins_scrollbar_module = {
42836
42894
  var scrollbarXDOM = this.scrollbar[dir].dom;
42837
42895
 
42838
42896
  if (scrollbarXDOM) {
42839
- var _this$overlayCanvas2;
42840
-
42841
42897
  scrollbarXDOM.remove();
42842
42898
  this.scrollbar[dir] = {
42843
42899
  isInit: false
42844
42900
  };
42845
- (_this$overlayCanvas2 = this.overlayCanvas) === null || _this$overlayCanvas2 === void 0 ? void 0 : _this$overlayCanvas2.removeEventListener('wheel', this.onScrollbarWheel, false);
42901
+
42902
+ if (dir === 'y') {
42903
+ var _this$overlayCanvas2;
42904
+
42905
+ (_this$overlayCanvas2 = this.overlayCanvas) === null || _this$overlayCanvas2 === void 0 ? void 0 : _this$overlayCanvas2.removeEventListener('wheel', this.onScrollbarWheel, false);
42906
+ }
42846
42907
  }
42847
42908
  }
42848
42909
  };
@@ -43227,6 +43288,8 @@ var plugins_interaction_modules = {
43227
43288
 
43228
43289
  case 'heatMap':
43229
43290
  {
43291
+ var isHorizontal = !!_this.options.horizontal;
43292
+
43230
43293
  if (useSelectItem && useSelectLabel) {
43231
43294
  var useBothAxis = selectLabelOpt.useBothAxis;
43232
43295
 
@@ -43245,7 +43308,16 @@ var plugins_interaction_modules = {
43245
43308
  args.deselected = {
43246
43309
  eventTarget: 'item'
43247
43310
  };
43248
- setSelectedLabelInfo(useBothAxis ? location : null);
43311
+
43312
+ if (!useBothAxis) {
43313
+ var selectLabelAxis = isHorizontal ? 'yAxis' : 'xAxis';
43314
+
43315
+ if (location !== selectLabelAxis) {
43316
+ return;
43317
+ }
43318
+ }
43319
+
43320
+ setSelectedLabelInfo(location, useBothAxis);
43249
43321
  }
43250
43322
  } else if (useSelectItem) {
43251
43323
  setSelectedItemInfo();
@@ -43254,6 +43326,14 @@ var plugins_interaction_modules = {
43254
43326
 
43255
43327
  var _location = _this.getClickedLocation(offset);
43256
43328
 
43329
+ if (!_useBothAxis && _location !== 'chartBackground') {
43330
+ var _selectLabelAxis = isHorizontal ? 'yAxis' : 'xAxis';
43331
+
43332
+ if (_location !== _selectLabelAxis) {
43333
+ return;
43334
+ }
43335
+ }
43336
+
43257
43337
  setSelectedLabelInfo(_useBothAxis ? _location : null);
43258
43338
  }
43259
43339
 
@@ -43849,7 +43929,7 @@ var plugins_interaction_modules = {
43849
43929
  var _this$options$selectL2, _this$options7, _this$defaultSelectIn;
43850
43930
 
43851
43931
  var option = (_this$options$selectL2 = (_this$options7 = this.options) === null || _this$options7 === void 0 ? void 0 : _this$options7.selectLabel) !== null && _this$options$selectL2 !== void 0 ? _this$options$selectL2 : {};
43852
- var before = ((_this$defaultSelectIn = this.defaultSelectInfo) === null || _this$defaultSelectIn === void 0 ? void 0 : _this$defaultSelectIn.targetAxis) === targetAxis ? _objectSpread2(_objectSpread2({}, this.defaultSelectInfo), {}, {
43932
+ var before = targetAxis === null || ((_this$defaultSelectIn = this.defaultSelectInfo) === null || _this$defaultSelectIn === void 0 ? void 0 : _this$defaultSelectIn.targetAxis) === targetAxis ? _objectSpread2(_objectSpread2({}, this.defaultSelectInfo), {}, {
43853
43933
  targetAxis: targetAxis
43854
43934
  }) : {
43855
43935
  dataIndex: [],
@@ -46688,7 +46768,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
46688
46768
  return;
46689
46769
  }
46690
46770
 
46691
- (_this$updateScrollbar = this.updateScrollbar) === null || _this$updateScrollbar === void 0 ? void 0 : _this$updateScrollbar.call(this);
46771
+ (_this$updateScrollbar = this.updateScrollbar) === null || _this$updateScrollbar === void 0 ? void 0 : _this$updateScrollbar.call(this, updateData);
46692
46772
  this.resetProps();
46693
46773
 
46694
46774
  if (updateSeries) {