@visactor/vtable-calendar 1.15.2-alpha.1 → 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.
- package/dist/vtable-calendar.js +48 -28
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +3 -3
package/dist/vtable-calendar.js
CHANGED
|
@@ -40214,7 +40214,7 @@
|
|
|
40214
40214
|
class Scenegraph {
|
|
40215
40215
|
constructor(table) {
|
|
40216
40216
|
let width, height;
|
|
40217
|
-
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map(), setPoptipTheme(this.table.theme.textPopTipStyle),
|
|
40217
|
+
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map(), setPoptipTheme(this.table.theme.textPopTipStyle), table.options.canvas && table.options.viewBox ? (vglobal.setEnv("browser"), width = table.options.viewBox.x2 - table.options.viewBox.x1, height = table.options.viewBox.y2 - table.options.viewBox.y1) : "node" === Env.mode ? (vglobal.setEnv("node", table.options.modeParams), width = table.canvasWidth, height = table.canvasHeight) : (vglobal.setEnv("browser"), width = table.canvas.width, height = table.canvas.height), this.stage = createStage(Object.assign({
|
|
40218
40218
|
canvas: table.canvas,
|
|
40219
40219
|
width: width,
|
|
40220
40220
|
height: height,
|
|
@@ -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
|
|
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,
|
|
@@ -46894,7 +46894,7 @@
|
|
|
46894
46894
|
bottom: 0
|
|
46895
46895
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), isValid$3(canvasHeight) && isValid$3(canvasWidth) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
46896
46896
|
const internalProps = this.internalProps = {};
|
|
46897
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? (
|
|
46897
|
+
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = columnResizeMode, internalProps.rowResizeMode = rowResizeMode, internalProps.dragHeaderMode = null != dragHeaderMode ? dragHeaderMode : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
46898
46898
|
const that = this;
|
|
46899
46899
|
if (internalProps.calcWidthContext = {
|
|
46900
46900
|
_: internalProps,
|
|
@@ -53683,7 +53683,7 @@
|
|
|
53683
53683
|
width: 100,
|
|
53684
53684
|
height: 100
|
|
53685
53685
|
}
|
|
53686
|
-
}, this.isReleased = !1, this.table = table,
|
|
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
|
|
55880
|
-
|
|
55881
|
-
|
|
55882
|
-
|
|
55883
|
-
|
|
55884
|
-
|
|
55885
|
-
|
|
55886
|
-
|
|
55887
|
-
|
|
55888
|
-
|
|
55889
|
-
row:
|
|
55890
|
-
|
|
55891
|
-
|
|
55892
|
-
|
|
55893
|
-
|
|
55894
|
-
|
|
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
|
|
55957
|
-
const percentile = num <
|
|
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" ===
|
|
56000
|
-
const negativeRange =
|
|
56001
|
-
positiveRange =
|
|
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" ===
|
|
56175
|
-
const _negativeRange =
|
|
56176
|
-
_positiveRange =
|
|
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;
|