@visactor/vtable-calendar 1.15.2-alpha.2 → 1.15.2

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.
@@ -46846,7 +46846,7 @@
46846
46846
  constructor(container) {
46847
46847
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46848
46848
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
46849
- if (super(), this.showFrozenIcon = !0, this.version = "1.15.2-alpha.2", 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");
46849
+ if (super(), this.showFrozenIcon = !0, this.version = "1.15.2", 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");
46850
46850
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
46851
46851
  const {
46852
46852
  frozenColCount = 0,
@@ -53683,7 +53683,7 @@
53683
53683
  width: 100,
53684
53684
  height: 100
53685
53685
  }
53686
- }, this.isReleased = !1, this.table = table, isBoolean$4(emptyTipOption) || isValid$3(emptyTipOption.displayMode) || (this.table.isListTable() ? emptyTipOption.displayMode = "basedOnTable" : emptyTipOption.displayMode = "basedOnContainer"), this._emptyTipOption = Object.assign(this._emptyTipOption, !0 === emptyTipOption ? {} : emptyTipOption), this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());
53686
+ }, this.isReleased = !1, this.table = table, this._emptyTipOption = Object.assign(this._emptyTipOption, !0 === emptyTipOption ? {} : emptyTipOption), isValid$3(this._emptyTipOption.displayMode) || (this.table.isListTable() ? this._emptyTipOption.displayMode = "basedOnTable" : this._emptyTipOption.displayMode = "basedOnContainer"), this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());
53687
53687
  }
53688
53688
  _createOrUpdateEmptyTipComponent(attrs) {
53689
53689
  if (this._emptyTipComponent) isEqual(attrs, this._cacheAttrs) || this._emptyTipComponent.setAttributes(attrs);else {
@@ -55876,22 +55876,42 @@
55876
55876
  }
55877
55877
 
55878
55878
  function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table, range) {
55879
- var _a, _b, _c, _d, _e, _f;
55880
- 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, {
55881
- col: col,
55882
- row: row,
55883
- table: table,
55884
- value: value,
55885
- dataValue: dataValue,
55886
- cellHeaderPaths: void 0
55887
- })) && void 0 !== _d ? _d : 0, progressBarDefine.max = null !== (_e = getOrApply(progressBarDefine.max, {
55888
- col: col,
55889
- row: row,
55890
- table: table,
55891
- value: value,
55892
- dataValue: dataValue,
55893
- cellHeaderPaths: void 0
55894
- })) && void 0 !== _e ? _e : progressBarDefine.min + 100;
55879
+ var _a, _b, _c, _d, _e;
55880
+ if (progressBarDefine.dependField) {
55881
+ const dependField = getOrApply(progressBarDefine.dependField, {
55882
+ col: col,
55883
+ row: row,
55884
+ table: table,
55885
+ value: value,
55886
+ dataValue: dataValue,
55887
+ cellHeaderPaths: void 0
55888
+ });
55889
+ dataValue = null !== (_b = null === (_a = table.getCellOriginRecord(col, row)) || void 0 === _a ? void 0 : _a[dependField]) && void 0 !== _b ? _b : dataValue;
55890
+ }
55891
+ const barType = null !== (_c = getOrApply(progressBarDefine.barType, {
55892
+ col: col,
55893
+ row: row,
55894
+ table: table,
55895
+ value: value,
55896
+ dataValue: dataValue,
55897
+ cellHeaderPaths: void 0
55898
+ })) && void 0 !== _c ? _c : "default",
55899
+ min = null !== (_d = getOrApply(progressBarDefine.min, {
55900
+ col: col,
55901
+ row: row,
55902
+ table: table,
55903
+ value: value,
55904
+ dataValue: dataValue,
55905
+ cellHeaderPaths: void 0
55906
+ })) && void 0 !== _d ? _d : 0,
55907
+ max = null !== (_e = getOrApply(progressBarDefine.max, {
55908
+ col: col,
55909
+ row: row,
55910
+ table: table,
55911
+ value: value,
55912
+ dataValue: dataValue,
55913
+ cellHeaderPaths: void 0
55914
+ })) && void 0 !== _e ? _e : min + 100;
55895
55915
  let height = 0;
55896
55916
  height = range ? table.getRowsHeight(range.start.row, range.end.row) : table.getRowHeight(row);
55897
55917
  let contentWidth = width,
@@ -55953,8 +55973,8 @@
55953
55973
  str.endsWith(svalue, "%") && (svalue = svalue.substr(0, svalue.length - 1));
55954
55974
  const num = Number(svalue);
55955
55975
  if (isNaN(num)) return percentCompleteBarGroup;
55956
- if ("default" === (null !== (_f = progressBarDefine.barType) && void 0 !== _f ? _f : "default")) {
55957
- const percentile = num < progressBarDefine.min ? 0 : num > progressBarDefine.max ? 1 : (num - progressBarDefine.min) / (progressBarDefine.max - progressBarDefine.min),
55976
+ if ("default" === (null != barType ? barType : "default")) {
55977
+ const percentile = num < min ? 0 : num > max ? 1 : (num - min) / (max - min),
55958
55978
  barMaxWidth = contentWidth,
55959
55979
  barTop = top + contentHeight - barHeight - barBottom;
55960
55980
  let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
@@ -55996,9 +56016,9 @@
55996
56016
  fill: fillColor
55997
56017
  });
55998
56018
  percentCompleteBarGroup.addChild(barMain);
55999
- } else if ("negative" === progressBarDefine.barType) {
56000
- const negativeRange = progressBarDefine.min < 0 ? -progressBarDefine.min : 0,
56001
- positiveRange = progressBarDefine.max > 0 ? progressBarDefine.max : 0,
56019
+ } else if ("negative" === barType) {
56020
+ const negativeRange = min < 0 ? -min : 0,
56021
+ positiveRange = max > 0 ? max : 0,
56002
56022
  negativeFactor = negativeRange / (negativeRange + positiveRange),
56003
56023
  positiveFactor = 1 - negativeFactor,
56004
56024
  positiveRate = num > 0 ? num / positiveRange : 0,
@@ -56171,9 +56191,9 @@
56171
56191
  });
56172
56192
  percentCompleteBarGroup.addChild(barMark);
56173
56193
  }
56174
- } else if ("negative_no_axis" === progressBarDefine.barType) {
56175
- const _negativeRange = progressBarDefine.min < 0 ? -progressBarDefine.min : 0,
56176
- _positiveRange = progressBarDefine.max > 0 ? progressBarDefine.max : 0,
56194
+ } else if ("negative_no_axis" === barType) {
56195
+ const _negativeRange = min < 0 ? -min : 0,
56196
+ _positiveRange = max > 0 ? max : 0,
56177
56197
  range = Math.max(_negativeRange, _positiveRange),
56178
56198
  percentile = 0 === range ? 0 : Math.abs(num) / range,
56179
56199
  barMaxWidth = contentWidth;