@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.
- package/dist/vtable-calendar.js +45 -25
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -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.
|
|
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
|
|
52704
|
-
|
|
52705
|
-
|
|
52706
|
-
|
|
52707
|
-
|
|
52708
|
-
|
|
52709
|
-
|
|
52710
|
-
|
|
52711
|
-
|
|
52712
|
-
|
|
52713
|
-
row:
|
|
52714
|
-
|
|
52715
|
-
|
|
52716
|
-
|
|
52717
|
-
|
|
52718
|
-
|
|
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
|
|
52781
|
-
const percentile = num <
|
|
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" ===
|
|
52824
|
-
const negativeRange =
|
|
52825
|
-
positiveRange =
|
|
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" ===
|
|
52999
|
-
const _negativeRange =
|
|
53000
|
-
_positiveRange =
|
|
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;
|