@visactor/vtable-calendar 1.18.2-alpha.2 → 1.18.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 +74 -56
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -45549,7 +45549,7 @@
|
|
|
45549
45549
|
if (eventManager.cellIsHeaderCheck(eventArgsSet)) return;
|
|
45550
45550
|
if ("touch" === e.pointerType) {
|
|
45551
45551
|
if (eventManager.touchEnd = !1, eventManager.touchSetTimeout = setTimeout(() => {
|
|
45552
|
-
eventManager.isTouchdown = !1, eventManager.
|
|
45552
|
+
eventManager.isTouchdown = !1, eventManager.isLongTouch = !0, (eventManager.touchEnd || !eventManager.checkColumnResize(eventArgsSet, !0) && !eventManager.checkRowResize(eventArgsSet, !0)) && (eventManager.touchEnd || !eventManager.checkColumnMover(eventArgsSet)) ? eventManager.dealTableSelect(eventArgsSet) && !eventManager.touchEnd && stateManager.updateInteractionState(InteractionState.grabing) : stateManager.updateInteractionState(InteractionState.grabing);
|
|
45553
45553
|
}, 500), table.hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL)) {
|
|
45554
45554
|
const cellGoup = e.path.find(node => "cell" === node.role);
|
|
45555
45555
|
"cell" !== (null == cellGoup ? void 0 : cellGoup.role) || !isValid$3(cellGoup.col) || !isValid$3(cellGoup.row) || cellGoup.col === table.stateManager.hover.cellPos.col && cellGoup.row === table.stateManager.hover.cellPos.row || cellGoup.col === (null === (_e = table.stateManager.hover.cellPosContainHeader) || void 0 === _e ? void 0 : _e.col) && cellGoup.row === (null === (_f = table.stateManager.hover.cellPosContainHeader) || void 0 === _f ? void 0 : _f.row) || table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL, {
|
|
@@ -45618,6 +45618,9 @@
|
|
|
45618
45618
|
mergeCellInfo: null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.mergeInfo
|
|
45619
45619
|
});
|
|
45620
45620
|
}
|
|
45621
|
+
setTimeout(() => {
|
|
45622
|
+
eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
|
|
45623
|
+
}, 0);
|
|
45621
45624
|
}
|
|
45622
45625
|
}), table.scenegraph.tableGroup.addEventListener("rightdown", e => {
|
|
45623
45626
|
var _a, _b, _c, _d;
|
|
@@ -45653,7 +45656,7 @@
|
|
|
45653
45656
|
var _a, _b, _c, _d, _e;
|
|
45654
45657
|
if (table.stateManager.columnResize.resizing) return;
|
|
45655
45658
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
45656
|
-
if (!eventManager.
|
|
45659
|
+
if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
|
|
45657
45660
|
const {
|
|
45658
45661
|
col: col,
|
|
45659
45662
|
row: row
|
|
@@ -46219,6 +46222,7 @@
|
|
|
46219
46222
|
}
|
|
46220
46223
|
const globalPointerdownCallback = e => {
|
|
46221
46224
|
var _a;
|
|
46225
|
+
if (table.isReleased) return;
|
|
46222
46226
|
table.eventManager.LastBodyPointerXY = {
|
|
46223
46227
|
x: e.x,
|
|
46224
46228
|
y: e.y
|
|
@@ -46242,6 +46246,7 @@
|
|
|
46242
46246
|
}), vglobal.addEventListener("pointerdown", globalPointerdownCallback);
|
|
46243
46247
|
const globalPointerupCallback = e => {
|
|
46244
46248
|
var _a;
|
|
46249
|
+
if (table.isReleased) return;
|
|
46245
46250
|
const target = e.target;
|
|
46246
46251
|
if (target !== table.canvas && (e => {
|
|
46247
46252
|
var _a, _b;
|
|
@@ -46290,7 +46295,7 @@
|
|
|
46290
46295
|
const {
|
|
46291
46296
|
x: x,
|
|
46292
46297
|
y: y
|
|
46293
|
-
} = table._getMouseAbstractPoint(e
|
|
46298
|
+
} = table._getMouseAbstractPoint(e);
|
|
46294
46299
|
stateManager.interactionState === InteractionState.grabing && (stateManager.isResizeCol() ? (eventManager.dealColumnResize(x, y), table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN) && table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN, {
|
|
46295
46300
|
col: table.stateManager.columnResize.col,
|
|
46296
46301
|
colWidth: table.getColWidth(table.stateManager.columnResize.col)
|
|
@@ -46345,21 +46350,21 @@
|
|
|
46345
46350
|
stateManager = table.stateManager,
|
|
46346
46351
|
scenegraph = table.scenegraph;
|
|
46347
46352
|
eventManager.touchMovePoints = [], table.scenegraph.tableGroup.addEventListener("touchstart", e => {
|
|
46348
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
46353
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
46349
46354
|
if (e.target.isChildOf(scenegraph.component.vScrollBar) || e.target.isChildOf(scenegraph.component.vScrollBar)) return;
|
|
46350
46355
|
eventManager.isTouchdown = !0;
|
|
46351
46356
|
const touchEvent = e.nativeEvent;
|
|
46352
46357
|
eventManager.touchMovePoints.push({
|
|
46353
|
-
x:
|
|
46354
|
-
y:
|
|
46358
|
+
x: table.rotateDegree ? null !== (_c = null === (_b = null === (_a = touchEvent.changedTouches) || void 0 === _a ? void 0 : _a[0]) || void 0 === _b ? void 0 : _b._canvasX) && void 0 !== _c ? _c : null === (_d = e.canvas) || void 0 === _d ? void 0 : _d.x : e.page.x,
|
|
46359
|
+
y: table.rotateDegree ? null !== (_g = null === (_f = null === (_e = touchEvent.changedTouches) || void 0 === _e ? void 0 : _e[0]) || void 0 === _f ? void 0 : _f._canvasY) && void 0 !== _g ? _g : null === (_h = e.canvas) || void 0 === _h ? void 0 : _h.y : e.page.y,
|
|
46355
46360
|
timestamp: Date.now()
|
|
46356
46361
|
});
|
|
46357
46362
|
});
|
|
46358
46363
|
const globalTouchMoveCallback = e => {
|
|
46359
|
-
var _a, _b
|
|
46360
|
-
if (eventManager.
|
|
46361
|
-
x:
|
|
46362
|
-
y:
|
|
46364
|
+
var _a, _b;
|
|
46365
|
+
if (eventManager.isLongTouch && e.preventDefault(), eventManager.isTouchdown && isTouchEvent$1(e)) if (eventManager.isTouchMove = !0, (null === (_b = null === (_a = eventManager.downIcon) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.funcType) === IconFuncTypeEnum.dragReorder) e.preventDefault();else if (eventManager.touchMovePoints.length > 4 && eventManager.touchMovePoints.shift(), eventManager.touchMovePoints.push({
|
|
46366
|
+
x: table.rotateDegree ? e.changedTouches[0]._canvasX : e.changedTouches[0].pageX,
|
|
46367
|
+
y: table.rotateDegree ? e.changedTouches[0]._canvasY : e.changedTouches[0].pageY,
|
|
46363
46368
|
timestamp: Date.now()
|
|
46364
46369
|
}), eventManager._enableTableScroll) {
|
|
46365
46370
|
const deltaX = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].x + eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].x,
|
|
@@ -46378,15 +46383,15 @@
|
|
|
46378
46383
|
callback: globalTouchMoveCallback
|
|
46379
46384
|
});
|
|
46380
46385
|
const globalTouchEndCallback = e => {
|
|
46381
|
-
var _a, _b, _c, _d
|
|
46382
|
-
if (eventManager.touchEnd = !0, eventManager.
|
|
46386
|
+
var _a, _b, _c, _d;
|
|
46387
|
+
if (eventManager.touchEnd = !0, eventManager.isLongTouch = !1, eventManager.isTouchdown && isTouchEvent$1(e)) {
|
|
46383
46388
|
if ((null === (_b = null === (_a = eventManager.downIcon) || void 0 === _a ? void 0 : _a.attribute) || void 0 === _b ? void 0 : _b.funcType) === IconFuncTypeEnum.dragReorder) e.preventDefault();else if ((null === (_c = eventManager.touchMovePoints) || void 0 === _c ? void 0 : _c.length) && (eventManager.touchMovePoints.length > 4 && eventManager.touchMovePoints.shift(), eventManager.touchMovePoints.push({
|
|
46384
|
-
x:
|
|
46385
|
-
y:
|
|
46389
|
+
x: table.rotateDegree ? e.changedTouches[0]._canvasX : e.changedTouches[0].pageX,
|
|
46390
|
+
y: table.rotateDegree ? e.changedTouches[0]._canvasY : e.changedTouches[0].pageY,
|
|
46386
46391
|
timestamp: Date.now()
|
|
46387
46392
|
}), eventManager._enableTableScroll)) {
|
|
46388
46393
|
const firstPoint = eventManager.touchMovePoints[0],
|
|
46389
|
-
lastPoint = eventManager.touchMovePoints[(null === (
|
|
46394
|
+
lastPoint = eventManager.touchMovePoints[(null === (_d = eventManager.touchMovePoints) || void 0 === _d ? void 0 : _d.length) - 1],
|
|
46390
46395
|
vX = (lastPoint.x - firstPoint.x) / (lastPoint.timestamp - firstPoint.timestamp),
|
|
46391
46396
|
vY = (lastPoint.y - firstPoint.y) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
46392
46397
|
eventManager.inertiaScroll.startInertia(vX, vY, .95), table.eventManager.inertiaScroll.setScrollHandle((dx, dy) => {
|
|
@@ -46396,7 +46401,7 @@
|
|
|
46396
46401
|
}, table.stateManager);
|
|
46397
46402
|
});
|
|
46398
46403
|
}
|
|
46399
|
-
eventManager.isTouchdown = !1, eventManager.touchMovePoints = [];
|
|
46404
|
+
eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
|
|
46400
46405
|
}
|
|
46401
46406
|
};
|
|
46402
46407
|
vglobal.addEventListener("touchend", globalTouchEndCallback), eventManager.globalEventListeners.push({
|
|
@@ -46405,7 +46410,7 @@
|
|
|
46405
46410
|
callback: globalTouchEndCallback
|
|
46406
46411
|
});
|
|
46407
46412
|
const globalTouchCancelCallback = e => {
|
|
46408
|
-
eventManager.touchEnd = !0, eventManager.
|
|
46413
|
+
eventManager.touchEnd = !0, eventManager.isLongTouch = !1, eventManager.isTouchdown && (eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.touchMovePoints = [], eventManager.isDraging = !1);
|
|
46409
46414
|
};
|
|
46410
46415
|
vglobal.addEventListener("touchcancel", globalTouchCancelCallback), eventManager.globalEventListeners.push({
|
|
46411
46416
|
name: "touchcancel",
|
|
@@ -49481,8 +49486,8 @@
|
|
|
49481
49486
|
constructor(table, options) {
|
|
49482
49487
|
var _a;
|
|
49483
49488
|
this.plugins = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.map(plugin => {
|
|
49484
|
-
this.register(plugin);
|
|
49485
|
-
})
|
|
49489
|
+
this.register(plugin), this._bindTableEventForPlugin(plugin);
|
|
49490
|
+
});
|
|
49486
49491
|
}
|
|
49487
49492
|
register(plugin) {
|
|
49488
49493
|
this.plugins.set(plugin.id, plugin);
|
|
@@ -49493,23 +49498,31 @@
|
|
|
49493
49498
|
getPlugin(id) {
|
|
49494
49499
|
return this.plugins.get(id);
|
|
49495
49500
|
}
|
|
49496
|
-
|
|
49497
|
-
this.plugins.
|
|
49498
|
-
|
|
49499
|
-
|
|
49500
|
-
|
|
49501
|
-
|
|
49502
|
-
|
|
49503
|
-
|
|
49504
|
-
|
|
49505
|
-
|
|
49506
|
-
|
|
49501
|
+
getPluginByName(name) {
|
|
49502
|
+
return Array.from(this.plugins.values()).find(plugin => plugin.name === name);
|
|
49503
|
+
}
|
|
49504
|
+
_bindTableEventForPlugin(plugin) {
|
|
49505
|
+
var _this = this;
|
|
49506
|
+
var _a;
|
|
49507
|
+
null === (_a = plugin.runTime) || void 0 === _a || _a.forEach(runTime => {
|
|
49508
|
+
this.table.on(runTime, function () {
|
|
49509
|
+
var _a;
|
|
49510
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49511
|
+
args[_key] = arguments[_key];
|
|
49512
|
+
}
|
|
49513
|
+
null === (_a = plugin.run) || void 0 === _a || _a.call(plugin, ...args, runTime, _this.table);
|
|
49507
49514
|
});
|
|
49508
49515
|
});
|
|
49509
49516
|
}
|
|
49510
|
-
updatePlugins() {
|
|
49511
|
-
this.plugins.forEach(plugin => {
|
|
49512
|
-
|
|
49517
|
+
updatePlugins(plugins) {
|
|
49518
|
+
Array.from(this.plugins.values()).filter(plugin => !(null == plugins ? void 0 : plugins.some(p => p.id === plugin.id))).forEach(plugin => {
|
|
49519
|
+
this.release(), this.plugins.delete(plugin.id);
|
|
49520
|
+
}), this.plugins.forEach(plugin => {
|
|
49521
|
+
plugin.update && plugin.update();
|
|
49522
|
+
});
|
|
49523
|
+
const addedPlugins = null == plugins ? void 0 : plugins.filter(plugin => !this.plugins.has(plugin.id));
|
|
49524
|
+
null == addedPlugins || addedPlugins.forEach(plugin => {
|
|
49525
|
+
this.register(plugin), this._bindTableEventForPlugin(plugin);
|
|
49513
49526
|
});
|
|
49514
49527
|
}
|
|
49515
49528
|
release() {
|
|
@@ -49535,7 +49548,7 @@
|
|
|
49535
49548
|
constructor(container) {
|
|
49536
49549
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
49537
49550
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
49538
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.18.2
|
|
49551
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.18.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
49539
49552
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
49540
49553
|
options: options,
|
|
49541
49554
|
container: container
|
|
@@ -50379,8 +50392,8 @@
|
|
|
50379
50392
|
return super.fireListeners(type, event);
|
|
50380
50393
|
}
|
|
50381
50394
|
updateOption(options) {
|
|
50382
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
50383
|
-
this.options = options, this._hasAutoImageColumn = void 0;
|
|
50395
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
50396
|
+
null === (_a = this.editorManager) || void 0 === _a || _a.cancelEdit(), this.options = options, this._hasAutoImageColumn = void 0;
|
|
50384
50397
|
const {
|
|
50385
50398
|
frozenColCount = 0,
|
|
50386
50399
|
unfreezeAllOnExceedsMaxWidth: unfreezeAllOnExceedsMaxWidth,
|
|
@@ -50420,9 +50433,9 @@
|
|
|
50420
50433
|
} = options;
|
|
50421
50434
|
pixelRatio && pixelRatio !== this.internalProps.pixelRatio && (this.internalProps.pixelRatio = pixelRatio), 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))), this.showFrozenIcon = "boolean" != typeof showFrozenIcon || showFrozenIcon, "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.widthMode = null != widthMode ? widthMode : "standard", this.heightMode = null != heightMode ? heightMode : "standard", this._widthAdaptiveMode = null != widthAdaptiveMode ? widthAdaptiveMode : "only-body", this._heightAdaptiveMode = null != heightAdaptiveMode ? heightAdaptiveMode : "only-body", this.autoFillWidth = null != autoFillWidth && autoFillWidth, this.autoFillHeight = null != autoFillHeight && autoFillHeight, this.customRender = customRender, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0;
|
|
50422
50435
|
const internalProps = this.internalProps;
|
|
50423
|
-
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (
|
|
50436
|
+
if ("node" === Env.mode || options.canvas || updateRootElementPadding(internalProps.element, this.padding), this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal", internalProps.frozenColCount = frozenColCount, 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 = null !== (_c = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _c ? _c : columnResizeMode, internalProps.rowResizeMode = null !== (_d = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _d ? _d : rowResizeMode, internalProps.dragHeaderMode = null !== (_f = null !== (_e = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _e ? _e : dragHeaderMode) && void 0 !== _f ? _f : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps.cellTextOverflows = {}, 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 = {}, internalProps.stick.changedCells.clear(), internalProps.theme = themes.of(null !== (_g = options.theme) && void 0 !== _g ? _g : themes.DEFAULT), internalProps.theme.isPivot = this.isPivotTable(), setIconColor(internalProps.theme.functionalIconsStyle), this.scenegraph.updateStageBackground(), internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak, internalProps.allowFrozenColCount = null !== (_h = options.allowFrozenColCount) && void 0 !== _h ? _h : 0, internalProps.limitMaxAutoWidth = null !== (_j = options.limitMaxAutoWidth) && void 0 !== _j ? _j : 450, internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10, internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10, null === (_k = internalProps.legends) || void 0 === _k || _k.forEach(legend => {
|
|
50424
50437
|
null == legend || legend.release();
|
|
50425
|
-
}), null === (
|
|
50438
|
+
}), null === (_l = internalProps.title) || void 0 === _l || _l.release(), internalProps.title = null, null === (_m = internalProps.emptyTip) || void 0 === _m || _m.release(), internalProps.emptyTip = null, internalProps.layoutMap.release(), clearChartRenderQueue(), this.scenegraph.clearCells(), this.scenegraph.updateComponent(), this.stateManager.updateOptionSetState(), this._updateSize(), this.eventManager.updateEventBinder(), options.legends) {
|
|
50426
50439
|
internalProps.legends = [];
|
|
50427
50440
|
const createLegend = Factory.getFunction("createLegend");
|
|
50428
50441
|
if (Array.isArray(options.legends)) {
|
|
@@ -50448,11 +50461,11 @@
|
|
|
50448
50461
|
}
|
|
50449
50462
|
if (internalProps.menu = Object.assign({
|
|
50450
50463
|
renderMode: "html"
|
|
50451
|
-
}, options.menu), Array.isArray(null === (
|
|
50464
|
+
}, options.menu), Array.isArray(null === (_o = options.menu) || void 0 === _o ? void 0 : _o.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_p = options.menu) || void 0 === _p ? void 0 : _p.dropDownMenuHighlight), (Array.isArray(null === (_q = options.menu) || void 0 === _q ? void 0 : _q.defaultHeaderMenuItems) || "function" == typeof (null === (_r = options.menu) || void 0 === _r ? void 0 : _r.defaultHeaderMenuItems)) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems), "html" === internalProps.menu.renderMode && !internalProps.menuHandler) {
|
|
50452
50465
|
const MenuHandler = Factory.getComponent("menuHandler");
|
|
50453
50466
|
internalProps.menuHandler = new MenuHandler(this);
|
|
50454
50467
|
}
|
|
50455
|
-
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (
|
|
50468
|
+
this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(), internalProps.customMergeCell = getCustomMergeCellFunc(options.customMergeCell), null === (_s = this.customCellStylePlugin) || void 0 === _s || _s.updateCustomCell(null !== (_t = options.customCellStyle) && void 0 !== _t ? _t : [], null !== (_u = options.customCellStyleArrangement) && void 0 !== _u ? _u : []), this._adjustCanvasSizeByOption();
|
|
50456
50469
|
}
|
|
50457
50470
|
renderWithRecreateCells() {
|
|
50458
50471
|
this.internalProps.stick.changedCells.clear();
|
|
@@ -50490,8 +50503,7 @@
|
|
|
50490
50503
|
return new Rect(this.tableX, this.tableY, width, height);
|
|
50491
50504
|
}
|
|
50492
50505
|
_getMouseAbstractPoint(evt) {
|
|
50493
|
-
|
|
50494
|
-
var _a, _b, _c, _d;
|
|
50506
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
50495
50507
|
let e;
|
|
50496
50508
|
if (!evt) return {
|
|
50497
50509
|
inTable: !1,
|
|
@@ -50505,16 +50517,25 @@
|
|
|
50505
50517
|
let inTable = !0;
|
|
50506
50518
|
rect.right <= clientX && (inTable = !1), rect.bottom <= clientY && (inTable = !1);
|
|
50507
50519
|
const currentWidth = rect.width,
|
|
50508
|
-
widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth),
|
|
50520
|
+
widthRatio = currentWidth / ((90 === this.rotateDegree ? this.canvas.offsetHeight : this.canvas.offsetWidth) || currentWidth),
|
|
50509
50521
|
currentHeight = rect.height,
|
|
50510
|
-
heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight),
|
|
50511
|
-
|
|
50512
|
-
|
|
50513
|
-
|
|
50522
|
+
heightRatio = currentHeight / ((90 === this.rotateDegree ? this.canvas.offsetWidth : this.canvas.offsetHeight) || currentHeight),
|
|
50523
|
+
rotateTablePlugin = this.pluginManager.getPluginByName("Rotate Table");
|
|
50524
|
+
if (rotateTablePlugin && 90 === this.rotateDegree) {
|
|
50525
|
+
const point = {
|
|
50526
|
+
x: clientX / widthRatio - (null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
|
|
50527
|
+
y: clientY / heightRatio - (null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
|
|
50514
50528
|
inTable: inTable
|
|
50515
50529
|
};
|
|
50530
|
+
return rotateTablePlugin.matrix.transformPoint(point, point), point;
|
|
50531
|
+
}
|
|
50532
|
+
const point = {
|
|
50533
|
+
x: (clientX - rect.left) / widthRatio - (null !== (_f = null === (_e = this.options.viewBox) || void 0 === _e ? void 0 : _e.x1) && void 0 !== _f ? _f : 0),
|
|
50534
|
+
y: (clientY - rect.top) / heightRatio - (null !== (_h = null === (_g = this.options.viewBox) || void 0 === _g ? void 0 : _g.y1) && void 0 !== _h ? _h : 0),
|
|
50535
|
+
inTable: inTable
|
|
50536
|
+
};
|
|
50516
50537
|
if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
|
|
50517
|
-
this.scenegraph.stage.window.getViewBoxTransform().transformPoint(point, point);
|
|
50538
|
+
return this.scenegraph.stage.window.getViewBoxTransform().transformPoint(point, point), point;
|
|
50518
50539
|
}
|
|
50519
50540
|
return point;
|
|
50520
50541
|
}
|
|
@@ -54482,14 +54503,11 @@
|
|
|
54482
54503
|
return ifCan;
|
|
54483
54504
|
}
|
|
54484
54505
|
updateOption(options) {
|
|
54485
|
-
let updateConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
54486
|
-
keepData: !1
|
|
54487
|
-
};
|
|
54488
54506
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
54489
54507
|
const internalProps = this.internalProps;
|
|
54490
54508
|
if (super.updateOption(options), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = options.groupBy ? getGroupByDataConfig(options.groupBy) : {}, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$3(options.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, internalProps.releaseList) for (let i = internalProps.releaseList.length - 1; i >= 0; i--) {
|
|
54491
54509
|
const releaseObj = internalProps.releaseList[i];
|
|
54492
|
-
|
|
54510
|
+
releaseObj instanceof DataSource ? releaseObj.updateColumns(this.internalProps.columns) : (null === (_g = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _g || _g.call(releaseObj), internalProps.releaseList.splice(i, 1));
|
|
54493
54511
|
}
|
|
54494
54512
|
if (options.dataSource && this.dataSource !== options.dataSource ? this.dataSource = options.dataSource : options.records ? this.setRecords(options.records, {
|
|
54495
54513
|
sortState: options.sortState
|
|
@@ -54501,7 +54519,7 @@
|
|
|
54501
54519
|
const EmptyTip = Factory.getComponent("emptyTip");
|
|
54502
54520
|
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_j = this.internalProps.emptyTip) || void 0 === _j || _j.resetVisible();
|
|
54503
54521
|
}
|
|
54504
|
-
return new Promise(resolve => {
|
|
54522
|
+
return this.pluginManager.updatePlugins(options.plugins), new Promise(resolve => {
|
|
54505
54523
|
setTimeout(resolve, 0);
|
|
54506
54524
|
});
|
|
54507
54525
|
}
|
|
@@ -54523,7 +54541,7 @@
|
|
|
54523
54541
|
} = table.internalProps;
|
|
54524
54542
|
if (!layoutMap) return;
|
|
54525
54543
|
const dataCount = null !== (_b = null === (_a = table.internalProps.dataSource) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
|
|
54526
|
-
layoutMap.recordsCount = dataCount + (dataCount > 0 ? layoutMap.hasAggregationOnTopCount + layoutMap.hasAggregationOnBottomCount : 0), table.transpose ? (table.rowCount = null !== (_c = layoutMap.rowCount) && void 0 !== _c ? _c : 0, table.colCount = null !== (_d = layoutMap.colCount) && void 0 !== _d ? _d : 0, this.internalProps.frozenColCount = Math.max((null !== (_e = layoutMap.headerLevelCount) && void 0 !== _e ? _e : 0) + layoutMap.leftRowSeriesNumberColumnCount, null !== (_f = this.options.frozenColCount) && void 0 !== _f ? _f : 0), this.internalProps.frozenRowCount = null !== (_g = this.options.frozenRowCount) && void 0 !== _g ? _g : 0, table.bottomFrozenRowCount !== (null !== (_h = this.options.bottomFrozenRowCount) && void 0 !== _h ? _h : 0) && (table.bottomFrozenRowCount = null !== (_j = this.options.bottomFrozenRowCount) && void 0 !== _j ? _j : 0), table.rightFrozenColCount !== (null !== (_k = this.options.rightFrozenColCount) && void 0 !== _k ? _k : 0) && (table.rightFrozenColCount = null !== (_l = this.options.rightFrozenColCount) && void 0 !== _l ? _l : 0)) : (table.colCount = null !== (_m = layoutMap.colCount) && void 0 !== _m ? _m : 0, table.rowCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount, this.internalProps.frozenColCount = null !== (_o = this.options.frozenColCount) && void 0 !== _o ? _o : 0, table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_p = this.options.frozenRowCount) && void 0 !== _p ? _p : 0), table.bottomFrozenRowCount !== (null !== (_q = this.options.bottomFrozenRowCount) && void 0 !== _q ? _q : 0) && (table.bottomFrozenRowCount = null !== (_r = this.options.bottomFrozenRowCount) && void 0 !== _r ? _r : 0), table.rightFrozenColCount !== (null !== (_s = this.options.rightFrozenColCount) && void 0 !== _s ? _s : 0) && (table.rightFrozenColCount = null !== (_t = this.options.rightFrozenColCount) && void 0 !== _t ? _t : 0)), this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
54544
|
+
layoutMap.recordsCount = dataCount + (dataCount > 0 || this.options.showAggregationWhenEmpty ? layoutMap.hasAggregationOnTopCount + layoutMap.hasAggregationOnBottomCount : 0), table.transpose ? (table.rowCount = null !== (_c = layoutMap.rowCount) && void 0 !== _c ? _c : 0, table.colCount = null !== (_d = layoutMap.colCount) && void 0 !== _d ? _d : 0, this.internalProps.frozenColCount = Math.max((null !== (_e = layoutMap.headerLevelCount) && void 0 !== _e ? _e : 0) + layoutMap.leftRowSeriesNumberColumnCount, null !== (_f = this.options.frozenColCount) && void 0 !== _f ? _f : 0), this.internalProps.frozenRowCount = null !== (_g = this.options.frozenRowCount) && void 0 !== _g ? _g : 0, table.bottomFrozenRowCount !== (null !== (_h = this.options.bottomFrozenRowCount) && void 0 !== _h ? _h : 0) && (table.bottomFrozenRowCount = null !== (_j = this.options.bottomFrozenRowCount) && void 0 !== _j ? _j : 0), table.rightFrozenColCount !== (null !== (_k = this.options.rightFrozenColCount) && void 0 !== _k ? _k : 0) && (table.rightFrozenColCount = null !== (_l = this.options.rightFrozenColCount) && void 0 !== _l ? _l : 0)) : (table.colCount = null !== (_m = layoutMap.colCount) && void 0 !== _m ? _m : 0, table.rowCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount, this.internalProps.frozenColCount = null !== (_o = this.options.frozenColCount) && void 0 !== _o ? _o : 0, table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_p = this.options.frozenRowCount) && void 0 !== _p ? _p : 0), table.bottomFrozenRowCount !== (null !== (_q = this.options.bottomFrozenRowCount) && void 0 !== _q ? _q : 0) && (table.bottomFrozenRowCount = null !== (_r = this.options.bottomFrozenRowCount) && void 0 !== _r ? _r : 0), table.rightFrozenColCount !== (null !== (_s = this.options.rightFrozenColCount) && void 0 !== _s ? _s : 0) && (table.rightFrozenColCount = null !== (_t = this.options.rightFrozenColCount) && void 0 !== _t ? _t : 0)), this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
54527
54545
|
}
|
|
54528
54546
|
getFieldData(field, col, row) {
|
|
54529
54547
|
if (null === field) return null;
|
|
@@ -57290,7 +57308,7 @@
|
|
|
57290
57308
|
}), table.on(TABLE_EVENT_TYPE.CONTEXTMENU_CELL, e => {
|
|
57291
57309
|
var _a, _b, _c, _d;
|
|
57292
57310
|
if ("html" === (null === (_a = table.internalProps.menu) || void 0 === _a ? void 0 : _a.renderMode)) {
|
|
57293
|
-
const abstractPos = table._getMouseAbstractPoint(e.event
|
|
57311
|
+
const abstractPos = table._getMouseAbstractPoint(e.event);
|
|
57294
57312
|
let menu = null;
|
|
57295
57313
|
abstractPos.inTable && "function" == typeof (null === (_b = table.internalProps.menu) || void 0 === _b ? void 0 : _b.contextMenuItems) ? menu = table.internalProps.menu.contextMenuItems(table.getHeaderField(e.col, e.row), e.row, e.col, table) : abstractPos.inTable && Array.isArray(null === (_c = table.internalProps.menu) || void 0 === _c ? void 0 : _c.contextMenuItems) && (menu = null === (_d = table.internalProps.menu) || void 0 === _d ? void 0 : _d.contextMenuItems), this._bindToCell(e.col, e.row, "context-menu", {
|
|
57296
57314
|
content: menu,
|
|
@@ -57692,7 +57710,7 @@
|
|
|
57692
57710
|
top: top,
|
|
57693
57711
|
bottom: bottom
|
|
57694
57712
|
} = position.rect,
|
|
57695
|
-
abstractPos = table._getMouseAbstractPoint(event
|
|
57713
|
+
abstractPos = table._getMouseAbstractPoint(event);
|
|
57696
57714
|
abstractPos.inTable && abstractPos.x >= left - 5 && abstractPos.x <= right + 5 && abstractPos.y >= top - 5 && abstractPos.y <= bottom + 5 || this._unbindFromCell();
|
|
57697
57715
|
}
|
|
57698
57716
|
this._attachInfo && table.stateManager.menu.isShow && this._bindToCell(e.col, e.row);
|