@visactor/vtable-calendar 1.13.1-alpha.2 → 1.13.1-alpha.4
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 +22 -21
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -12229,10 +12229,7 @@
|
|
|
12229
12229
|
const {
|
|
12230
12230
|
context: context
|
|
12231
12231
|
} = drawContext;
|
|
12232
|
-
context.highPerformanceSave()
|
|
12233
|
-
const t1 = graphic.parent.globalTransMatrix,
|
|
12234
|
-
t2 = graphic.stage.window.getViewBoxTransform().clone().multiply(t1.a, t1.b, t1.c, t1.d, t1.e, t1.f);
|
|
12235
|
-
if (graphic.parent && context.setTransformFromMatrix(t2, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
12232
|
+
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
12236
12233
|
tempDirtyBounds.copy(drawContribution.dirtyBounds), tempBackupDirtyBounds.copy(drawContribution.backupDirtyBounds);
|
|
12237
12234
|
const m = graphic.globalTransMatrix.getInverse();
|
|
12238
12235
|
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m), drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
@@ -46138,7 +46135,7 @@
|
|
|
46138
46135
|
if (cellStyle.customStyleId === customStyleId) if (cellPos.range) for (let col = Math.max(0, cellPos.range.start.col); col <= Math.min(this.table.colCount - 1, cellPos.range.end.col); col++) for (let row = Math.max(0, cellPos.range.start.row); row <= Math.min(this.table.rowCount - 1, cellPos.range.end.row); row++) this.table.scenegraph.updateCellContent(col, row);else this.table.scenegraph.updateCellContent(cellPos.col, cellPos.row);
|
|
46139
46136
|
}), this.table.scenegraph.updateNextFrame();
|
|
46140
46137
|
}
|
|
46141
|
-
arrangeCustomCellStyle(cellPos, customStyleId) {
|
|
46138
|
+
arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
|
|
46142
46139
|
var _a;
|
|
46143
46140
|
const index = this.customCellStyleArrangement.findIndex(style => style.cellPosition.range && cellPos.range ? style.cellPosition.range.start.col === cellPos.range.start.col && style.cellPosition.range.start.row === cellPos.range.start.row && style.cellPosition.range.end.col === cellPos.range.end.col && style.cellPosition.range.end.row === cellPos.range.end.row : style.cellPosition.col === cellPos.col && style.cellPosition.row === cellPos.row);
|
|
46144
46141
|
if (-1 === index && !customStyleId) return;
|
|
@@ -46154,7 +46151,6 @@
|
|
|
46154
46151
|
customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
|
|
46155
46152
|
}
|
|
46156
46153
|
const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
|
|
46157
|
-
let forceFastUpdate;
|
|
46158
46154
|
if (style) {
|
|
46159
46155
|
forceFastUpdate = !0;
|
|
46160
46156
|
for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
|
|
@@ -46326,7 +46322,7 @@
|
|
|
46326
46322
|
constructor(container) {
|
|
46327
46323
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46328
46324
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
46329
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.13.1-alpha.
|
|
46325
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.13.1-alpha.4", 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");
|
|
46330
46326
|
const {
|
|
46331
46327
|
frozenColCount = 0,
|
|
46332
46328
|
frozenRowCount: frozenRowCount,
|
|
@@ -48021,9 +48017,9 @@
|
|
|
48021
48017
|
var _a;
|
|
48022
48018
|
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.registerCustomCellStyle(customStyleId, customStyle);
|
|
48023
48019
|
}
|
|
48024
|
-
arrangeCustomCellStyle(cellPos, customStyleId) {
|
|
48020
|
+
arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate) {
|
|
48025
48021
|
var _a;
|
|
48026
|
-
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.arrangeCustomCellStyle(cellPos, customStyleId);
|
|
48022
|
+
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.arrangeCustomCellStyle(cellPos, customStyleId, forceFastUpdate);
|
|
48027
48023
|
}
|
|
48028
48024
|
isSeriesNumber(col, row) {
|
|
48029
48025
|
return this.internalProps.layoutMap.isSeriesNumber(col, row);
|
|
@@ -49510,7 +49506,7 @@
|
|
|
49510
49506
|
}
|
|
49511
49507
|
}
|
|
49512
49508
|
|
|
49513
|
-
class
|
|
49509
|
+
class EditManager {
|
|
49514
49510
|
constructor(table) {
|
|
49515
49511
|
this.isValidatingValue = !1, this.table = table, this.bindEvent();
|
|
49516
49512
|
}
|
|
@@ -49586,14 +49582,16 @@
|
|
|
49586
49582
|
} else if (!editor.isEditorElement || editor.isEditorElement(target)) return !1;
|
|
49587
49583
|
if (this.editingEditor.getValue, this.editingEditor.validateValue) {
|
|
49588
49584
|
this.isValidatingValue = !0;
|
|
49589
|
-
const
|
|
49585
|
+
const newValue = this.editingEditor.getValue(),
|
|
49586
|
+
oldValue = this.table.getCellOriginValue(this.editCell.col, this.editCell.row),
|
|
49587
|
+
maybePromiseOrValue = null === (_b = (_a = this.editingEditor).validateValue) || void 0 === _b ? void 0 : _b.call(_a, newValue, oldValue, this.editCell, this.table);
|
|
49590
49588
|
return isPromise(maybePromiseOrValue) ? new Promise((resolve, reject) => {
|
|
49591
49589
|
maybePromiseOrValue.then(result => {
|
|
49592
|
-
result
|
|
49590
|
+
dealWithValidateValue(result, this, oldValue, resolve);
|
|
49593
49591
|
}).catch(err => {
|
|
49594
49592
|
this.isValidatingValue = !1, reject(err);
|
|
49595
49593
|
});
|
|
49596
|
-
}) :
|
|
49594
|
+
}) : dealWithValidateValue(maybePromiseOrValue, this, oldValue);
|
|
49597
49595
|
}
|
|
49598
49596
|
return this.doExit(), !0;
|
|
49599
49597
|
}
|
|
@@ -49614,6 +49612,9 @@
|
|
|
49614
49612
|
this.editingEditor && (null === (_b = (_a = this.editingEditor).exit) || void 0 === _b || _b.call(_a), null === (_d = (_c = this.editingEditor).onEnd) || void 0 === _d || _d.call(_c), this.editingEditor = null);
|
|
49615
49613
|
}
|
|
49616
49614
|
}
|
|
49615
|
+
function dealWithValidateValue(validateValue, editManager, oldValue, resolve) {
|
|
49616
|
+
return editManager.isValidatingValue = !1, "validate-return" === validateValue ? (editManager.doExit(), null == resolve || resolve(!0), !0) : "invalidate-return" === validateValue ? (editManager.editingEditor.setValue(oldValue), editManager.doExit(), null == resolve || resolve(!0), !0) : "validate-not-return" === validateValue || "invalidate-not-return" === validateValue ? (null == resolve || resolve(!1), !1) : !0 === validateValue ? (editManager.doExit(), null == resolve || resolve(!0), !0) : (null == resolve || resolve(!1), !1);
|
|
49617
|
+
}
|
|
49617
49618
|
|
|
49618
49619
|
function getGroupByDataConfig(groupByOption) {
|
|
49619
49620
|
if (isString$2(groupByOption)) return {
|
|
@@ -49698,7 +49699,7 @@
|
|
|
49698
49699
|
oldValue = oldValues[i][j],
|
|
49699
49700
|
value = rowValues[j],
|
|
49700
49701
|
maybePromiseOrValue = null === (_b = null === (_a = null == editor ? void 0 : editor.validateValue) || void 0 === _a ? void 0 : _a.call(editor, value, oldValue)) || void 0 === _b || _b;
|
|
49701
|
-
isCanChange = !!isPromise(maybePromiseOrValue) || maybePromiseOrValue;
|
|
49702
|
+
isCanChange = !!isPromise(maybePromiseOrValue) || !0 === maybePromiseOrValue || "validate-return" === maybePromiseOrValue || "invalidate-return" === maybePromiseOrValue;
|
|
49702
49703
|
}
|
|
49703
49704
|
if (isCanChange) {
|
|
49704
49705
|
const value = rowValues[j],
|
|
@@ -50074,11 +50075,11 @@
|
|
|
50074
50075
|
proxy = table.scenegraph.proxy,
|
|
50075
50076
|
{
|
|
50076
50077
|
rowStart: rowStart,
|
|
50077
|
-
rowLimit: rowLimit
|
|
50078
|
+
rowLimit: rowLimit,
|
|
50079
|
+
bodyBottomRow: bodyBottomRow
|
|
50078
50080
|
} = proxy;
|
|
50079
50081
|
let {
|
|
50080
|
-
rowEnd: rowEnd
|
|
50081
|
-
bodyBottomRow: bodyBottomRow
|
|
50082
|
+
rowEnd: rowEnd
|
|
50082
50083
|
} = proxy,
|
|
50083
50084
|
updateRow = 1 / 0;
|
|
50084
50085
|
for (let i = 0; i < addCellPositions.length; i++) {
|
|
@@ -50093,11 +50094,11 @@
|
|
|
50093
50094
|
for (let i = 0; i < removeCellPositions.length; i++) {
|
|
50094
50095
|
const {
|
|
50095
50096
|
row: cellRow
|
|
50096
|
-
} = removeCellPositions[
|
|
50097
|
-
cellRow < rowStart || cellRow > rowEnd
|
|
50097
|
+
} = removeCellPositions[i];
|
|
50098
|
+
cellRow < rowStart || cellRow > rowEnd || (rowEnd === bodyBottomRow ? removeCells.push({
|
|
50098
50099
|
col: col,
|
|
50099
50100
|
row: cellRow
|
|
50100
|
-
})
|
|
50101
|
+
}) : updateRow = Math.min(updateRow, cellRow));
|
|
50101
50102
|
}
|
|
50102
50103
|
if (updateRow !== 1 / 0) for (let i = updateRow; i <= rowEnd; i++) updateCells.push({
|
|
50103
50104
|
col: col,
|
|
@@ -50115,7 +50116,7 @@
|
|
|
50115
50116
|
var _a, _b, _c, _d, _e, _f;
|
|
50116
50117
|
"node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), super(container, options), this.showHeader = !0;
|
|
50117
50118
|
const internalProps = this.internalProps;
|
|
50118
|
-
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : isValid$1(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new
|
|
50119
|
+
if (internalProps.frozenColDragHeaderMode = options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.multipleSort = !!options.multipleSort, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_b = null !== (_a = options.enableTreeNodeMerge) && void 0 !== _a ? _a : isValid$1(options.groupBy)) && void 0 !== _b && _b, this.internalProps.headerHelper.setTableColumnsEditor(), this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, this.transpose = null !== (_d = options.transpose) && void 0 !== _d && _d, "node" !== Env.mode && (this.editorManager = new EditManager(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
50119
50120
|
sortState: internalProps.sortState
|
|
50120
50121
|
}) : this.setRecords([]), options.title) {
|
|
50121
50122
|
const Title = Factory.getComponent("title");
|