@visactor/vtable-calendar 1.11.6-alpha.5 → 1.11.6-alpha.6

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.
@@ -45586,7 +45586,7 @@
45586
45586
  constructor(container) {
45587
45587
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
45588
45588
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
45589
- if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.5", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
45589
+ if (super(), this.showFrozenIcon = !0, this.version = "1.11.6-alpha.6", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
45590
45590
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
45591
45591
  const {
45592
45592
  frozenColCount = 0,
@@ -52700,22 +52700,42 @@
52700
52700
  }
52701
52701
 
52702
52702
  function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table, range) {
52703
- var _a, _b, _c, _d, _e, _f;
52704
- progressBarDefine.dependField && (dataValue = null !== (_b = null === (_a = table.getCellOriginRecord(col, row)) || void 0 === _a ? void 0 : _a[progressBarDefine.dependField]) && void 0 !== _b ? _b : dataValue), progressBarDefine.barType = null !== (_c = progressBarDefine.barType) && void 0 !== _c ? _c : "default", progressBarDefine.min = null !== (_d = getOrApply(progressBarDefine.min, {
52705
- col: col,
52706
- row: row,
52707
- table: table,
52708
- value: value,
52709
- dataValue: dataValue,
52710
- cellHeaderPaths: void 0
52711
- })) && void 0 !== _d ? _d : 0, progressBarDefine.max = null !== (_e = getOrApply(progressBarDefine.max, {
52712
- col: col,
52713
- row: row,
52714
- table: table,
52715
- value: value,
52716
- dataValue: dataValue,
52717
- cellHeaderPaths: void 0
52718
- })) && void 0 !== _e ? _e : progressBarDefine.min + 100;
52703
+ var _a, _b, _c, _d, _e;
52704
+ if (progressBarDefine.dependField) {
52705
+ const dependField = getOrApply(progressBarDefine.dependField, {
52706
+ col: col,
52707
+ row: row,
52708
+ table: table,
52709
+ value: value,
52710
+ dataValue: dataValue,
52711
+ cellHeaderPaths: void 0
52712
+ });
52713
+ dataValue = null !== (_b = null === (_a = table.getCellOriginRecord(col, row)) || void 0 === _a ? void 0 : _a[dependField]) && void 0 !== _b ? _b : dataValue;
52714
+ }
52715
+ const barType = null !== (_c = getOrApply(progressBarDefine.barType, {
52716
+ col: col,
52717
+ row: row,
52718
+ table: table,
52719
+ value: value,
52720
+ dataValue: dataValue,
52721
+ cellHeaderPaths: void 0
52722
+ })) && void 0 !== _c ? _c : "default",
52723
+ min = null !== (_d = getOrApply(progressBarDefine.min, {
52724
+ col: col,
52725
+ row: row,
52726
+ table: table,
52727
+ value: value,
52728
+ dataValue: dataValue,
52729
+ cellHeaderPaths: void 0
52730
+ })) && void 0 !== _d ? _d : 0,
52731
+ max = null !== (_e = getOrApply(progressBarDefine.max, {
52732
+ col: col,
52733
+ row: row,
52734
+ table: table,
52735
+ value: value,
52736
+ dataValue: dataValue,
52737
+ cellHeaderPaths: void 0
52738
+ })) && void 0 !== _e ? _e : min + 100;
52719
52739
  let height = 0;
52720
52740
  height = range ? table.getRowsHeight(range.start.row, range.end.row) : table.getRowHeight(row);
52721
52741
  let contentWidth = width,
@@ -52777,8 +52797,8 @@
52777
52797
  str.endsWith(svalue, "%") && (svalue = svalue.substr(0, svalue.length - 1));
52778
52798
  const num = Number(svalue);
52779
52799
  if (isNaN(num)) return percentCompleteBarGroup;
52780
- if ("default" === (null !== (_f = progressBarDefine.barType) && void 0 !== _f ? _f : "default")) {
52781
- const percentile = num < progressBarDefine.min ? 0 : num > progressBarDefine.max ? 1 : (num - progressBarDefine.min) / (progressBarDefine.max - progressBarDefine.min),
52800
+ if ("default" === (null != barType ? barType : "default")) {
52801
+ const percentile = num < min ? 0 : num > max ? 1 : (num - min) / (max - min),
52782
52802
  barMaxWidth = contentWidth,
52783
52803
  barTop = top + contentHeight - barHeight - barBottom;
52784
52804
  let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
@@ -52820,9 +52840,9 @@
52820
52840
  fill: fillColor
52821
52841
  });
52822
52842
  percentCompleteBarGroup.addChild(barMain);
52823
- } else if ("negative" === progressBarDefine.barType) {
52824
- const negativeRange = progressBarDefine.min < 0 ? -progressBarDefine.min : 0,
52825
- positiveRange = progressBarDefine.max > 0 ? progressBarDefine.max : 0,
52843
+ } else if ("negative" === barType) {
52844
+ const negativeRange = min < 0 ? -min : 0,
52845
+ positiveRange = max > 0 ? max : 0,
52826
52846
  negativeFactor = negativeRange / (negativeRange + positiveRange),
52827
52847
  positiveFactor = 1 - negativeFactor,
52828
52848
  positiveRate = num > 0 ? num / positiveRange : 0,
@@ -52995,9 +53015,9 @@
52995
53015
  });
52996
53016
  percentCompleteBarGroup.addChild(barMark);
52997
53017
  }
52998
- } else if ("negative_no_axis" === progressBarDefine.barType) {
52999
- const _negativeRange = progressBarDefine.min < 0 ? -progressBarDefine.min : 0,
53000
- _positiveRange = progressBarDefine.max > 0 ? progressBarDefine.max : 0,
53018
+ } else if ("negative_no_axis" === barType) {
53019
+ const _negativeRange = min < 0 ? -min : 0,
53020
+ _positiveRange = max > 0 ? max : 0,
53001
53021
  range = Math.max(_negativeRange, _positiveRange),
53002
53022
  percentile = 0 === range ? 0 : Math.abs(num) / range,
53003
53023
  barMaxWidth = contentWidth;