evui 3.4.138 → 3.4.139

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.
@@ -11191,7 +11191,7 @@ $({ target: 'Number', stat: true }, {
11191
11191
  /***/ "9224":
11192
11192
  /***/ (function(module) {
11193
11193
 
11194
- module.exports = JSON.parse("{\"a\":\"3.4.138\"}");
11194
+ module.exports = JSON.parse("{\"a\":\"3.4.139\"}");
11195
11195
 
11196
11196
  /***/ }),
11197
11197
 
@@ -41356,7 +41356,8 @@ var AXIS_OPTION = {
41356
41356
  fitWidth: false,
41357
41357
  fitDir: 'right',
41358
41358
  alignToGridLine: false,
41359
- padding: 0
41359
+ padding: 0,
41360
+ fixWidth: undefined
41360
41361
  },
41361
41362
  title: {
41362
41363
  use: false,
@@ -45180,6 +45181,7 @@ var model_series_modules = {
45180
45181
 
45181
45182
 
45182
45183
 
45184
+
45183
45185
  var scale_Scale = /*#__PURE__*/function () {
45184
45186
  function Scale(type, axisOpt, ctx, options) {
45185
45187
  var _this = this;
@@ -45572,7 +45574,7 @@ var scale_Scale = /*#__PURE__*/function () {
45572
45574
  labelPoint = _this3.position === 'top' ? offsetPoint - 10 : offsetPoint + 10;
45573
45575
 
45574
45576
  if (options !== null && options !== void 0 && (_options$brush = options.brush) !== null && _options$brush !== void 0 && _options$brush.showLabel || !(options !== null && options !== void 0 && options.brush)) {
45575
- ctx.fillText(labelText, labelCenter, labelPoint);
45577
+ ctx.fillText(_this3.checkFixWidth(labelText), labelCenter, labelPoint);
45576
45578
  }
45577
45579
 
45578
45580
  if (!isBlurredLabel && options !== null && options !== void 0 && (_options$selectItem = options.selectItem) !== null && _options$selectItem !== void 0 && _options$selectItem.showLabelTip && hitInfo !== null && hitInfo !== void 0 && hitInfo.label && !((_this3$options3 = _this3.options) !== null && _this3$options3 !== void 0 && _this3$options3.horizontal)) {
@@ -45620,7 +45622,7 @@ var scale_Scale = /*#__PURE__*/function () {
45620
45622
  labelPoint = _this3.position === 'left' ? offsetPoint - 10 : offsetPoint + 10;
45621
45623
 
45622
45624
  if (options !== null && options !== void 0 && (_options$brush2 = options.brush) !== null && _options$brush2 !== void 0 && _options$brush2.showLabel || !(options !== null && options !== void 0 && options.brush)) {
45623
- ctx.fillText(labelText, labelPoint, labelCenter);
45625
+ ctx.fillText(_this3.checkFixWidth(labelText), labelPoint, labelCenter);
45624
45626
  }
45625
45627
 
45626
45628
  if (ix === steps) {
@@ -46176,6 +46178,25 @@ var scale_Scale = /*#__PURE__*/function () {
46176
46178
  ctx.fillText(label, textX, textY);
46177
46179
  ctx.closePath();
46178
46180
  }
46181
+ /**
46182
+ * Check if the label width is greater than the fix width
46183
+ * @param {string} value label value
46184
+ * @returns
46185
+ */
46186
+
46187
+ }, {
46188
+ key: "checkFixWidth",
46189
+ value: function checkFixWidth(value) {
46190
+ var _this$labelStyle3 = this.labelStyle,
46191
+ fixWidth = _this$labelStyle3.fixWidth,
46192
+ fitDir = _this$labelStyle3.fitDir;
46193
+
46194
+ if (truthyNumber(fixWidth) && fixWidth > 0) {
46195
+ return helpers_util.truncateLabelWithEllipsis(value, fixWidth, this.ctx, fitDir);
46196
+ }
46197
+
46198
+ return value;
46199
+ }
46179
46200
  }]);
46180
46201
 
46181
46202
  return Scale;
@@ -46192,6 +46213,7 @@ var scale_Scale = /*#__PURE__*/function () {
46192
46213
 
46193
46214
 
46194
46215
 
46216
+
46195
46217
  var scale_time_TimeScale = /*#__PURE__*/function (_Scale) {
46196
46218
  _inherits(TimeScale, _Scale);
46197
46219
 
@@ -46224,6 +46246,14 @@ var scale_time_TimeScale = /*#__PURE__*/function (_Scale) {
46224
46246
  }
46225
46247
  }
46226
46248
 
46249
+ var _this$labelStyle = this.labelStyle,
46250
+ fixWidth = _this$labelStyle.fixWidth,
46251
+ fitDir = _this$labelStyle.fitDir;
46252
+
46253
+ if (fixWidth > 0) {
46254
+ return helpers_util.truncateLabelWithEllipsis(dayjs_min_default()(value).format(this.timeFormat), fixWidth, this.ctx, fitDir);
46255
+ }
46256
+
46227
46257
  return dayjs_min_default()(value).format(this.timeFormat);
46228
46258
  }
46229
46259
  /**
@@ -46307,6 +46337,14 @@ var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
46307
46337
  }
46308
46338
  }
46309
46339
 
46340
+ var _this$labelStyle = this.labelStyle,
46341
+ fixWidth = _this$labelStyle.fixWidth,
46342
+ fitDir = _this$labelStyle.fitDir;
46343
+
46344
+ if (fixWidth > 0) {
46345
+ return helpers_util.truncateLabelWithEllipsis(helpers_util.labelSignFormat(value, this.decimalPoint), fixWidth, this.ctx, fitDir);
46346
+ }
46347
+
46310
46348
  return helpers_util.labelSignFormat(value, this.decimalPoint);
46311
46349
  }
46312
46350
  /**
@@ -46798,7 +46836,7 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
46798
46836
  if (this.type === 'x') {
46799
46837
  labelPoint = this.position === 'top' ? offsetPoint - 10 : offsetPoint + 10;
46800
46838
  var xPoint = alignToGridLine ? labelCenter : labelCenter + labelGap / 2;
46801
- ctx.fillText(labelText, xPoint, labelPoint);
46839
+ ctx.fillText(this.checkFixWidth(labelText), xPoint, labelPoint);
46802
46840
 
46803
46841
  if (!isBlurredLabel && selectItemOpt !== null && selectItemOpt !== void 0 && selectItemOpt.showLabelTip && hitInfo !== null && hitInfo !== void 0 && hitInfo.label && !horizontal) {
46804
46842
  var selectedLabel = hitInfo.label;
@@ -46842,7 +46880,7 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
46842
46880
  } else {
46843
46881
  labelPoint = this.position === 'left' ? offsetPoint - 10 : offsetPoint + 10;
46844
46882
  var yPoint = alignToGridLine ? labelCenter : labelCenter + labelGap / 2;
46845
- ctx.fillText(labelText, labelPoint, yPoint);
46883
+ ctx.fillText(this.checkFixWidth(labelText), labelPoint, yPoint);
46846
46884
  drawnLabels.push(labelText);
46847
46885
 
46848
46886
  if (this.showAxisTick) {
@@ -46882,14 +46920,14 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
46882
46920
  var lastLabelText = this.getLabelFormat("".concat(lastLabelValue), maxWidth);
46883
46921
 
46884
46922
  if (this.type === 'x') {
46885
- ctx.fillText(lastLabelText, labelCenter, labelPoint);
46923
+ ctx.fillText(this.checkFixWidth(lastLabelText), labelCenter, labelPoint);
46886
46924
 
46887
46925
  if (this.showGrid) {
46888
46926
  ctx.moveTo(linePosition, offsetPoint);
46889
46927
  ctx.lineTo(linePosition, offsetCounterPoint);
46890
46928
  }
46891
46929
  } else {
46892
- ctx.fillText(lastLabelText, labelPoint, labelCenter);
46930
+ ctx.fillText(this.checkFixWidth(lastLabelText), labelPoint, labelCenter);
46893
46931
 
46894
46932
  if (this.showGrid) {
46895
46933
  ctx.moveTo(offsetPoint, linePosition);
@@ -47000,6 +47038,14 @@ var scale_step_StepScale = /*#__PURE__*/function (_Scale) {
47000
47038
  }
47001
47039
  }
47002
47040
 
47041
+ var _this$labelStyle5 = this.labelStyle,
47042
+ fixWidth = _this$labelStyle5.fixWidth,
47043
+ fitDir = _this$labelStyle5.fitDir;
47044
+
47045
+ if (fixWidth > 0) {
47046
+ return helpers_util.truncateLabelWithEllipsis(helpers_util.labelSignFormat(value, this.decimalPoint), fixWidth, this.ctx, fitDir);
47047
+ }
47048
+
47003
47049
  return this.labelStyle.fitWidth ? this.fittingString(value, maxWidth) : value;
47004
47050
  }
47005
47051
  /**
@@ -47076,6 +47122,14 @@ var scale_time_category_TimeCategoryScale = /*#__PURE__*/function (_Scale) {
47076
47122
  }
47077
47123
  }
47078
47124
 
47125
+ var _this$labelStyle = this.labelStyle,
47126
+ fixWidth = _this$labelStyle.fixWidth,
47127
+ fitDir = _this$labelStyle.fitDir;
47128
+
47129
+ if (fixWidth > 0) {
47130
+ return helpers_util.truncateLabelWithEllipsis(dayjs_min_default()(value).format(this.timeFormat), fixWidth, this.ctx, fitDir);
47131
+ }
47132
+
47079
47133
  return dayjs_min_default()(value).format(this.timeFormat);
47080
47134
  }
47081
47135
  /**
@@ -47283,7 +47337,7 @@ var scale_time_category_TimeCategoryScale = /*#__PURE__*/function (_Scale) {
47283
47337
  var _this2$options3, _this2$options3$selec, _this2$options4;
47284
47338
 
47285
47339
  labelPoint = _this2.position === 'top' ? offsetPoint - 10 : offsetPoint + 10;
47286
- ctx.fillText(labelText, labelCenter, labelPoint);
47340
+ ctx.fillText(_this2.checkFixWidth(labelText), labelCenter, labelPoint);
47287
47341
 
47288
47342
  if (!isBlurredLabel && (_this2$options3 = _this2.options) !== null && _this2$options3 !== void 0 && (_this2$options3$selec = _this2$options3.selectItem) !== null && _this2$options3$selec !== void 0 && _this2$options3$selec.showLabelTip && hitInfo !== null && hitInfo !== void 0 && hitInfo.label && !((_this2$options4 = _this2.options) !== null && _this2$options4 !== void 0 && _this2$options4.horizontal)) {
47289
47343
  var selectedLabel = _this2.getLabelFormat(Math.min(axisMax, hitInfo.label + 0 * stepValue));
@@ -47326,7 +47380,7 @@ var scale_time_category_TimeCategoryScale = /*#__PURE__*/function (_Scale) {
47326
47380
  }
47327
47381
  } else {
47328
47382
  labelPoint = _this2.position === 'left' ? offsetPoint - 10 : offsetPoint + 10;
47329
- ctx.fillText(labelText, labelPoint, labelCenter);
47383
+ ctx.fillText(_this2.checkFixWidth(labelText), labelPoint, labelCenter);
47330
47384
 
47331
47385
  if (_this2.showAxisTick) {
47332
47386
  var _this2$axisLineWidth;
@@ -47363,14 +47417,14 @@ var scale_time_category_TimeCategoryScale = /*#__PURE__*/function (_Scale) {
47363
47417
  linePosition = labelCenter + aliasPixel;
47364
47418
 
47365
47419
  if (this.type === 'x') {
47366
- ctx.fillText(labelLastText, labelCenter, labelPoint);
47420
+ ctx.fillText(this.checkFixWidth(labelLastText), labelCenter, labelPoint);
47367
47421
 
47368
47422
  if (this.showGrid) {
47369
47423
  ctx.moveTo(linePosition, offsetPoint);
47370
47424
  ctx.lineTo(linePosition, offsetCounterPoint);
47371
47425
  }
47372
47426
  } else {
47373
- ctx.fillText(labelLastText, labelPoint, labelCenter);
47427
+ ctx.fillText(this.checkFixWidth(labelLastText), labelPoint, labelCenter);
47374
47428
 
47375
47429
  if (this.showGrid) {
47376
47430
  ctx.moveTo(offsetPoint, linePosition);
@@ -55309,8 +55363,16 @@ var chart_core_EvChart = /*#__PURE__*/function () {
55309
55363
  _this2 = this,
55310
55364
  _this$axesSteps,
55311
55365
  _this$axesSteps2,
55312
- _this$axesX$,
55313
55366
  _this$axesY$,
55367
+ _this$axesY$$labelSty,
55368
+ _this$axesY$2,
55369
+ _this$axesY$2$labelSt,
55370
+ _this$axesX$,
55371
+ _this$axesX$$labelSty,
55372
+ _this$axesX$2,
55373
+ _this$axesX$2$labelSt,
55374
+ _this$axesX$3,
55375
+ _this$axesY$3,
55314
55376
  _this$axesRange,
55315
55377
  _this$axesRange$x,
55316
55378
  _this$axesRange2,
@@ -55359,13 +55421,15 @@ var chart_core_EvChart = /*#__PURE__*/function () {
55359
55421
 
55360
55422
  var notFormattedXLabels = getNotFormattedLabels((_this$axesSteps = this.axesSteps) === null || _this$axesSteps === void 0 ? void 0 : _this$axesSteps.x[0]);
55361
55423
  var notFormattedYLabels = getNotFormattedLabels((_this$axesSteps2 = this.axesSteps) === null || _this$axesSteps2 === void 0 ? void 0 : _this$axesSteps2.y[0]);
55362
- var xMaxWidth = (_this$axesX$ = this.axesX[0]) === null || _this$axesX$ === void 0 ? void 0 : _this$axesX$.getLabelWidthHasMaxLength(notFormattedXLabels);
55363
- var yMaxWidth = (_this$axesY$ = this.axesY[0]) === null || _this$axesY$ === void 0 ? void 0 : _this$axesY$.getLabelWidthHasMaxLength(notFormattedYLabels);
55424
+ var yFixWidth = truthyNumber((_this$axesY$ = this.axesY[0]) === null || _this$axesY$ === void 0 ? void 0 : (_this$axesY$$labelSty = _this$axesY$.labelStyle) === null || _this$axesY$$labelSty === void 0 ? void 0 : _this$axesY$$labelSty.fixWidth) ? (_this$axesY$2 = this.axesY[0]) === null || _this$axesY$2 === void 0 ? void 0 : (_this$axesY$2$labelSt = _this$axesY$2.labelStyle) === null || _this$axesY$2$labelSt === void 0 ? void 0 : _this$axesY$2$labelSt.fixWidth : 0;
55425
+ var xFixWidth = truthyNumber((_this$axesX$ = this.axesX[0]) === null || _this$axesX$ === void 0 ? void 0 : (_this$axesX$$labelSty = _this$axesX$.labelStyle) === null || _this$axesX$$labelSty === void 0 ? void 0 : _this$axesX$$labelSty.fixWidth) ? (_this$axesX$2 = this.axesX[0]) === null || _this$axesX$2 === void 0 ? void 0 : (_this$axesX$2$labelSt = _this$axesX$2.labelStyle) === null || _this$axesX$2$labelSt === void 0 ? void 0 : _this$axesX$2$labelSt.fixWidth : 0;
55426
+ var xMaxWidth = (_this$axesX$3 = this.axesX[0]) === null || _this$axesX$3 === void 0 ? void 0 : _this$axesX$3.getLabelWidthHasMaxLength(notFormattedXLabels);
55427
+ var yMaxWidth = (_this$axesY$3 = this.axesY[0]) === null || _this$axesY$3 === void 0 ? void 0 : _this$axesY$3.getLabelWidthHasMaxLength(notFormattedYLabels);
55364
55428
  var adjustedRange = {
55365
55429
  x: !isStepXAxisUseFitWidth ? (_this$axesRange = this.axesRange) === null || _this$axesRange === void 0 ? void 0 : (_this$axesRange$x = _this$axesRange.x) === null || _this$axesRange$x === void 0 ? void 0 : _this$axesRange$x.map(function (value) {
55366
55430
  return _objectSpread2(_objectSpread2({}, value), {}, {
55367
55431
  size: {
55368
- width: Math.max(xMaxWidth, value.size.width),
55432
+ width: xFixWidth || Math.max(xMaxWidth, value.size.width),
55369
55433
  height: value.size.height
55370
55434
  }
55371
55435
  });
@@ -55373,7 +55437,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
55373
55437
  y: !isStepYAxisUseFitWidth ? (_this$axesRange3 = this.axesRange) === null || _this$axesRange3 === void 0 ? void 0 : (_this$axesRange3$y = _this$axesRange3.y) === null || _this$axesRange3$y === void 0 ? void 0 : _this$axesRange3$y.map(function (value) {
55374
55438
  return _objectSpread2(_objectSpread2({}, value), {}, {
55375
55439
  size: {
55376
- width: Math.max(yMaxWidth, value.size.width),
55440
+ width: yFixWidth || Math.max(yMaxWidth, value.size.width),
55377
55441
  height: value.size.height
55378
55442
  }
55379
55443
  });