@visactor/vtable-calendar 1.13.1-alpha.1 → 1.13.1-alpha.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 +16 -20
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +2 -2
package/dist/vtable-calendar.js
CHANGED
|
@@ -46138,7 +46138,7 @@
|
|
|
46138
46138
|
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
46139
|
}), this.table.scenegraph.updateNextFrame();
|
|
46140
46140
|
}
|
|
46141
|
-
arrangeCustomCellStyle(cellPos, customStyleId
|
|
46141
|
+
arrangeCustomCellStyle(cellPos, customStyleId) {
|
|
46142
46142
|
var _a;
|
|
46143
46143
|
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
46144
|
if (-1 === index && !customStyleId) return;
|
|
@@ -46154,6 +46154,7 @@
|
|
|
46154
46154
|
customStyleId ? this.customCellStyleArrangement[index].customStyleId = customStyleId : this.customCellStyleArrangement.splice(index, 1);
|
|
46155
46155
|
}
|
|
46156
46156
|
const style = null === (_a = this.getCustomCellStyleOption(customStyleId)) || void 0 === _a ? void 0 : _a.style;
|
|
46157
|
+
let forceFastUpdate;
|
|
46157
46158
|
if (style) {
|
|
46158
46159
|
forceFastUpdate = !0;
|
|
46159
46160
|
for (const key in style) if (-1 === cellStyleKeys.indexOf(key)) {
|
|
@@ -46325,7 +46326,7 @@
|
|
|
46325
46326
|
constructor(container) {
|
|
46326
46327
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
46327
46328
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
46328
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.13.1-alpha.
|
|
46329
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.13.1-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");
|
|
46329
46330
|
const {
|
|
46330
46331
|
frozenColCount = 0,
|
|
46331
46332
|
frozenRowCount: frozenRowCount,
|
|
@@ -48020,9 +48021,9 @@
|
|
|
48020
48021
|
var _a;
|
|
48021
48022
|
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.registerCustomCellStyle(customStyleId, customStyle);
|
|
48022
48023
|
}
|
|
48023
|
-
arrangeCustomCellStyle(cellPos, customStyleId
|
|
48024
|
+
arrangeCustomCellStyle(cellPos, customStyleId) {
|
|
48024
48025
|
var _a;
|
|
48025
|
-
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.arrangeCustomCellStyle(cellPos, customStyleId
|
|
48026
|
+
null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.arrangeCustomCellStyle(cellPos, customStyleId);
|
|
48026
48027
|
}
|
|
48027
48028
|
isSeriesNumber(col, row) {
|
|
48028
48029
|
return this.internalProps.layoutMap.isSeriesNumber(col, row);
|
|
@@ -49509,7 +49510,7 @@
|
|
|
49509
49510
|
}
|
|
49510
49511
|
}
|
|
49511
49512
|
|
|
49512
|
-
class
|
|
49513
|
+
class EditManeger {
|
|
49513
49514
|
constructor(table) {
|
|
49514
49515
|
this.isValidatingValue = !1, this.table = table, this.bindEvent();
|
|
49515
49516
|
}
|
|
@@ -49585,16 +49586,14 @@
|
|
|
49585
49586
|
} else if (!editor.isEditorElement || editor.isEditorElement(target)) return !1;
|
|
49586
49587
|
if (this.editingEditor.getValue, this.editingEditor.validateValue) {
|
|
49587
49588
|
this.isValidatingValue = !0;
|
|
49588
|
-
const
|
|
49589
|
-
oldValue = this.table.getCellOriginValue(this.editCell.col, this.editCell.row),
|
|
49590
|
-
maybePromiseOrValue = null === (_b = (_a = this.editingEditor).validateValue) || void 0 === _b ? void 0 : _b.call(_a, newValue, oldValue, this.editCell, this.table);
|
|
49589
|
+
const maybePromiseOrValue = null === (_b = (_a = this.editingEditor).validateValue) || void 0 === _b ? void 0 : _b.call(_a);
|
|
49591
49590
|
return isPromise(maybePromiseOrValue) ? new Promise((resolve, reject) => {
|
|
49592
49591
|
maybePromiseOrValue.then(result => {
|
|
49593
|
-
|
|
49592
|
+
result ? (this.doExit(), resolve(!0)) : (this.isValidatingValue = !1, resolve(!1));
|
|
49594
49593
|
}).catch(err => {
|
|
49595
49594
|
this.isValidatingValue = !1, reject(err);
|
|
49596
49595
|
});
|
|
49597
|
-
}) :
|
|
49596
|
+
}) : !!maybePromiseOrValue && (this.doExit(), !0);
|
|
49598
49597
|
}
|
|
49599
49598
|
return this.doExit(), !0;
|
|
49600
49599
|
}
|
|
@@ -49615,9 +49614,6 @@
|
|
|
49615
49614
|
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);
|
|
49616
49615
|
}
|
|
49617
49616
|
}
|
|
49618
|
-
function dealWithValidateValue(validateValue, editManager, oldValue, resolve) {
|
|
49619
|
-
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);
|
|
49620
|
-
}
|
|
49621
49617
|
|
|
49622
49618
|
function getGroupByDataConfig(groupByOption) {
|
|
49623
49619
|
if (isString$2(groupByOption)) return {
|
|
@@ -50078,11 +50074,11 @@
|
|
|
50078
50074
|
proxy = table.scenegraph.proxy,
|
|
50079
50075
|
{
|
|
50080
50076
|
rowStart: rowStart,
|
|
50081
|
-
rowLimit: rowLimit
|
|
50082
|
-
bodyBottomRow: bodyBottomRow
|
|
50077
|
+
rowLimit: rowLimit
|
|
50083
50078
|
} = proxy;
|
|
50084
50079
|
let {
|
|
50085
|
-
rowEnd: rowEnd
|
|
50080
|
+
rowEnd: rowEnd,
|
|
50081
|
+
bodyBottomRow: bodyBottomRow
|
|
50086
50082
|
} = proxy,
|
|
50087
50083
|
updateRow = 1 / 0;
|
|
50088
50084
|
for (let i = 0; i < addCellPositions.length; i++) {
|
|
@@ -50097,11 +50093,11 @@
|
|
|
50097
50093
|
for (let i = 0; i < removeCellPositions.length; i++) {
|
|
50098
50094
|
const {
|
|
50099
50095
|
row: cellRow
|
|
50100
|
-
} = removeCellPositions[i];
|
|
50101
|
-
cellRow < rowStart || cellRow > rowEnd
|
|
50096
|
+
} = removeCellPositions[removeCellPositions.length - i - 1];
|
|
50097
|
+
cellRow < rowStart || cellRow > rowEnd ? bodyBottomRow-- : rowEnd === bodyBottomRow ? (removeCells.push({
|
|
50102
50098
|
col: col,
|
|
50103
50099
|
row: cellRow
|
|
50104
|
-
}) : updateRow = Math.min(updateRow, cellRow));
|
|
50100
|
+
}), updateRow--) : (updateRow = Math.min(updateRow, cellRow), bodyBottomRow--);
|
|
50105
50101
|
}
|
|
50106
50102
|
if (updateRow !== 1 / 0) for (let i = updateRow; i <= rowEnd; i++) updateCells.push({
|
|
50107
50103
|
col: col,
|
|
@@ -50119,7 +50115,7 @@
|
|
|
50119
50115
|
var _a, _b, _c, _d, _e, _f;
|
|
50120
50116
|
"node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), super(container, options), this.showHeader = !0;
|
|
50121
50117
|
const internalProps = this.internalProps;
|
|
50122
|
-
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
|
|
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 EditManeger(this)), this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, options.dataSource ? _setDataSource(this, options.dataSource) : options.records ? this.setRecords(options.records, {
|
|
50123
50119
|
sortState: internalProps.sortState
|
|
50124
50120
|
}) : this.setRecords([]), options.title) {
|
|
50125
50121
|
const Title = Factory.getComponent("title");
|