@visactor/vtable-calendar 1.16.2-alpha.2 → 1.16.3-alpha.0
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 +18 -15
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -29268,7 +29268,7 @@
|
|
|
29268
29268
|
if (null == record) return;
|
|
29269
29269
|
if (isPromise(record)) return record.then(r => getField(r, field, col, row, table, promiseCallBack));
|
|
29270
29270
|
const fieldGet = isFieldAssessor(field) ? field.get : field;
|
|
29271
|
-
if (fieldGet in record) {
|
|
29271
|
+
if (isObject$7(record) && fieldGet in record) {
|
|
29272
29272
|
return getValue$2(record[fieldGet], promiseCallBack);
|
|
29273
29273
|
}
|
|
29274
29274
|
if ("function" == typeof fieldGet) {
|
|
@@ -40337,7 +40337,7 @@
|
|
|
40337
40337
|
class Scenegraph {
|
|
40338
40338
|
constructor(table) {
|
|
40339
40339
|
let width, height;
|
|
40340
|
-
this._needUpdateContainer = !1, this.table = table, this.hasFrozen = !1, this.clear = !0, this.mergeMap = new Map(), setPoptipTheme(this.table.theme.textPopTipStyle),
|
|
40340
|
+
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({
|
|
40341
40341
|
canvas: table.canvas,
|
|
40342
40342
|
width: width,
|
|
40343
40343
|
height: height,
|
|
@@ -43831,7 +43831,7 @@
|
|
|
43831
43831
|
!1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu) && e.preventDefault();
|
|
43832
43832
|
}), table.options.canvas || handler.on(table.getContainer(), "resize", e => {
|
|
43833
43833
|
var _a;
|
|
43834
|
-
0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio()), e.windowSizeNotChange || table.resize());
|
|
43834
|
+
table.isReleased || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio()), e.windowSizeNotChange || table.resize());
|
|
43835
43835
|
});
|
|
43836
43836
|
const regex = /<tr[^>]*>([\s\S]*?)<\/tr>/g,
|
|
43837
43837
|
cellRegex = /<td[^>]*>([\s\S]*?)<\/td>/g;
|
|
@@ -45795,6 +45795,7 @@
|
|
|
45795
45795
|
value: "",
|
|
45796
45796
|
children: [],
|
|
45797
45797
|
level: -1,
|
|
45798
|
+
afterSpanLevel: -1,
|
|
45798
45799
|
levelSpan: 1,
|
|
45799
45800
|
startIndex: 0,
|
|
45800
45801
|
size: 0,
|
|
@@ -45810,9 +45811,9 @@
|
|
|
45810
45811
|
node.startIndex = startIndex, node.startInTotal = (null !== (_a = parent.startInTotal) && void 0 !== _a ? _a : 0) + node.startIndex, node.hide && (this.hasHideNode = !0), (null !== (_b = node.dimensionKey) && void 0 !== _b ? _b : node.indicatorKey) && (node.virtual || this.dimensionKeys.contain(node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey) || this.dimensionKeys.put(node.level, node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey), this.dimensionKeysIncludeVirtual.contain(node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey) || this.dimensionKeysIncludeVirtual.put(node.level, node.indicatorKey ? IndicatorDimensionKeyPlaceholder : node.dimensionKey), node.id || (node.id = ++this.sharedVar.seqId));
|
|
45811
45812
|
let size = node.dimensionKey && this.sizeIncludeParent ? 1 : 0;
|
|
45812
45813
|
const children = node.children || node.columns;
|
|
45813
|
-
return "grid" === this.hierarchyType ? (null == children ? void 0 : children.length) >= 1 ? children.forEach(n => {
|
|
45814
|
-
var _a;
|
|
45815
|
-
n.level = (null !== (_a = node.level) && void 0 !== _a ? _a : 0) + 1, this.totalLevel = Math.max(this.totalLevel, n.level + 1), size += this.setTreeNode(n, size, node);
|
|
45814
|
+
return "grid" === this.hierarchyType || null === this.hierarchyType ? (null == children ? void 0 : children.length) >= 1 ? children.forEach(n => {
|
|
45815
|
+
var _a, _b, _c;
|
|
45816
|
+
n.level = (null !== (_a = node.level) && void 0 !== _a ? _a : 0) + 1, "grid" === this.hierarchyType && (n.afterSpanLevel = (null !== (_b = node.afterSpanLevel) && void 0 !== _b ? _b : 0) + (null !== (_c = node.levelSpan) && void 0 !== _c ? _c : 1)), this.totalLevel = Math.max(this.totalLevel, n.level + 1), size += this.setTreeNode(n, size, node);
|
|
45816
45817
|
}) : size = 1 : node.hierarchyState === HierarchyState.expand && (null == children ? void 0 : children.length) >= 1 ? children.forEach(n => {
|
|
45817
45818
|
var _a;
|
|
45818
45819
|
n.level = (null !== (_a = node.level) && void 0 !== _a ? _a : 0) + 1, this.totalLevel = Math.max(this.totalLevel, n.level + 1), this.expandedMaxLevel = Math.max(this.expandedMaxLevel, n.level + 1), size += this.setTreeNode(n, size, node);
|
|
@@ -46094,7 +46095,7 @@
|
|
|
46094
46095
|
right: 0,
|
|
46095
46096
|
width: 0
|
|
46096
46097
|
};
|
|
46097
|
-
if (
|
|
46098
|
+
if (isConsider && absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && absoluteX < _this.tableNoFrameWidth && absoluteX <= _this.getAllColsWidth()) for (let i = 0; i < _this.rightFrozenColCount; i++) if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) return {
|
|
46098
46099
|
col: _this.colCount - i - 1,
|
|
46099
46100
|
left: void 0,
|
|
46100
46101
|
right: void 0,
|
|
@@ -46146,8 +46147,8 @@
|
|
|
46146
46147
|
y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight && y <= _this.getAllRowsHeight() && (bottomFrozen = !0);
|
|
46147
46148
|
let rightFrozen = !1;
|
|
46148
46149
|
x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth && x <= _this.getAllColsWidth() && (rightFrozen = !0);
|
|
46149
|
-
const colInfo = getTargetColAtConsiderRightFrozen(
|
|
46150
|
-
rowInfo = getTargetRowAtConsiderBottomFrozen(
|
|
46150
|
+
const colInfo = getTargetColAtConsiderRightFrozen(leftFrozen || rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this),
|
|
46151
|
+
rowInfo = getTargetRowAtConsiderBottomFrozen(topFrozen || bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this);
|
|
46151
46152
|
if (colInfo && rowInfo) {
|
|
46152
46153
|
const {
|
|
46153
46154
|
row: row,
|
|
@@ -46989,7 +46990,7 @@
|
|
|
46989
46990
|
constructor(container) {
|
|
46990
46991
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46991
46992
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
46992
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.16.
|
|
46993
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.16.3-alpha.0", 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");
|
|
46993
46994
|
!1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
|
|
46994
46995
|
const {
|
|
46995
46996
|
frozenColCount = 0,
|
|
@@ -47037,7 +47038,7 @@
|
|
|
47037
47038
|
bottom: 0
|
|
47038
47039
|
}, 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";
|
|
47039
47040
|
const internalProps = this.internalProps = {};
|
|
47040
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? (
|
|
47041
|
+
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 = {};
|
|
47041
47042
|
const that = this;
|
|
47042
47043
|
if (internalProps.calcWidthContext = {
|
|
47043
47044
|
_: internalProps,
|
|
@@ -47328,7 +47329,8 @@
|
|
|
47328
47329
|
return this.internalProps.pixelRatio;
|
|
47329
47330
|
}
|
|
47330
47331
|
setPixelRatio(pixelRatio) {
|
|
47331
|
-
|
|
47332
|
+
var _a;
|
|
47333
|
+
if (pixelRatio !== (null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.pixelRatio)) {
|
|
47332
47334
|
this.internalProps.pixelRatio = pixelRatio;
|
|
47333
47335
|
const canvasWidth = this.canvasWidth;
|
|
47334
47336
|
this.internalProps.calcWidthContext = {
|
|
@@ -50290,7 +50292,7 @@
|
|
|
50290
50292
|
constructor(table, columns, showHeader, hierarchyIndent) {
|
|
50291
50293
|
this.seqId = 0, this.leftRowSeriesNumberColumnCount = 0, this.rightRowSeriesNumberColumnCount = 0, this.bodyRowSpanCount = 1, this._transpose = !1, this._showHeader = !0, this._recordsCount = 0, this._hasAggregation = !1, this._hasAggregationOnTopCount = 0, this._hasAggregationOnBottomCount = 0, this._cellRangeMap = new Map(), this._showHeader = showHeader, this._table = table, this._columns = [], this._columnsIncludeHided = [], this._headerCellIds = [], this.hierarchyIndent = null != hierarchyIndent ? hierarchyIndent : 20, this.hierarchyTextStartAlignment = table.options.hierarchyTextStartAlignment, this.columnTree = new DimensionTree(columns, {
|
|
50292
50294
|
seqId: 0
|
|
50293
|
-
}), this._headerObjectsIncludeHided = this._addHeaders(0, columns, []), this._headerObjects = this._headerObjectsIncludeHided.filter(col => !0 !== col.define.hide), this._headerObjectMap = this._headerObjects.reduce((o, e) => (o[e.id] = e, o), {}), this.rowHierarchyType = checkHasTreeDefine(this) ? "tree" : "grid", this._hasAggregation = checkHasAggregation(this), this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this), this._hasAggregationOnTopCount = checkHasAggregationOnTop(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
|
|
50295
|
+
}, null), this._headerObjectsIncludeHided = this._addHeaders(0, columns, []), this._headerObjects = this._headerObjectsIncludeHided.filter(col => !0 !== col.define.hide), this._headerObjectMap = this._headerObjects.reduce((o, e) => (o[e.id] = e, o), {}), this.rowHierarchyType = checkHasTreeDefine(this) ? "tree" : "grid", this._hasAggregation = checkHasAggregation(this), this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this), this._hasAggregationOnTopCount = checkHasAggregationOnTop(this), this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
|
|
50294
50296
|
}
|
|
50295
50297
|
handleRowSeriesNumber(rowSeriesNumber) {
|
|
50296
50298
|
var _a, _b;
|
|
@@ -51100,6 +51102,7 @@
|
|
|
51100
51102
|
},
|
|
51101
51103
|
referencePosition: referencePosition,
|
|
51102
51104
|
container: this.table.getElement(),
|
|
51105
|
+
table: this.table,
|
|
51103
51106
|
col: col,
|
|
51104
51107
|
row: row
|
|
51105
51108
|
});
|
|
@@ -52068,7 +52071,7 @@
|
|
|
52068
52071
|
}
|
|
52069
52072
|
getCheckboxState(field) {
|
|
52070
52073
|
if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$3(field)) {
|
|
52071
|
-
let stateArr = Array.from(this.stateManager.checkedState.keys()).sort().map(key => this.stateManager.checkedState.get(key));
|
|
52074
|
+
let stateArr = Array.from(this.stateManager.checkedState.keys()).sort((a, b) => Number(a) - Number(b)).map(key => this.stateManager.checkedState.get(key));
|
|
52072
52075
|
return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), Array.from(stateArr, state => state[field]);
|
|
52073
52076
|
}
|
|
52074
52077
|
return new Array(...this.stateManager.checkedState.values());
|
|
@@ -53706,7 +53709,7 @@
|
|
|
53706
53709
|
size = getSizeAfterResize(Math.min(width, widthLimit), height, null === (_s = null === (_r = attribute.title) || void 0 === _r ? void 0 : _r.style) || void 0 === _s ? void 0 : _s.angle);
|
|
53707
53710
|
titleWidth = "left" !== config.orient && "right" !== config.orient || !attribute.title.autoRotate ? size.width : size.height, titleWidth += null !== (_t = attribute.title.space) && void 0 !== _t ? _t : 4;
|
|
53708
53711
|
}
|
|
53709
|
-
return tickWidth + labelWidth + titleWidth + 1;
|
|
53712
|
+
return Math.ceil(tickWidth + labelWidth + titleWidth + 1);
|
|
53710
53713
|
}
|
|
53711
53714
|
function computeAxisComponentHeight(config, table) {
|
|
53712
53715
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|