@visactor/vtable-calendar 1.11.2-alpha.1 → 1.11.2-alpha.3
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 +99 -95
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +2 -2
package/dist/vtable-calendar.js
CHANGED
|
@@ -40004,7 +40004,7 @@
|
|
|
40004
40004
|
}
|
|
40005
40005
|
|
|
40006
40006
|
function updateSelectPosition(state, col, row, isShift, isCtrl, isSelectAll) {
|
|
40007
|
-
let
|
|
40007
|
+
let makeSelectCellVisible = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
40008
40008
|
let skipBodyMerge = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
|
|
40009
40009
|
let forceSelect = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : !1;
|
|
40010
40010
|
var _a, _b;
|
|
@@ -40020,7 +40020,7 @@
|
|
|
40020
40020
|
disableHeader: disableHeader,
|
|
40021
40021
|
cellPos: cellPos
|
|
40022
40022
|
} = state.select;
|
|
40023
|
-
if ((disableHeader && table.isHeader(col, row) || "none" === highlightScope) && !1 === forceSelect && (-1
|
|
40023
|
+
if ((disableHeader && table.isHeader(col, row) || "none" === highlightScope) && !1 === forceSelect && (-1 !== col && -1 !== row && makeSelectCellVisible && table._makeVisibleCell(col, row), col = -1, row = -1), -1 !== col && -1 !== row && makeSelectCellVisible) if (interactionState === InteractionState.grabing && state.select.ranges.length > 0) {
|
|
40024
40024
|
const currentRange = state.select.ranges[state.select.ranges.length - 1];
|
|
40025
40025
|
col > currentRange.start.col && col > currentRange.end.col && table._makeVisibleCell(col + 1, row), row > currentRange.start.row && row > currentRange.end.row && table._makeVisibleCell(col, row + 1), col < currentRange.start.col && col < currentRange.end.col && table._makeVisibleCell(col - 1, row), row < currentRange.start.row && row < currentRange.end.row && table._makeVisibleCell(col, row - 1);
|
|
40026
40026
|
} else table._makeVisibleCell(col, row);
|
|
@@ -40752,16 +40752,12 @@
|
|
|
40752
40752
|
function initCheckedState(records, state) {
|
|
40753
40753
|
state.checkedState = [], state.headerCheckedState = {}, state.radioState = {};
|
|
40754
40754
|
let isNeedInitHeaderCheckedStateFromRecord = !1;
|
|
40755
|
-
|
|
40755
|
+
state._checkboxCellTypeFields = [], state._headerCheckFuncs = {}, state.table.internalProps.layoutMap.headerObjects.forEach((hd, index) => {
|
|
40756
40756
|
if ("checkbox" === hd.headerType) {
|
|
40757
40757
|
const headerChecked = hd.define.checked;
|
|
40758
40758
|
null == headerChecked || "function" == typeof headerChecked ? (isNeedInitHeaderCheckedStateFromRecord = !0, "function" == typeof headerChecked && (state._headerCheckFuncs[hd.field] = headerChecked)) : state.headerCheckedState[hd.field] = headerChecked, "checkbox" !== hd.define.cellType || hd.fieldFormat || state._checkboxCellTypeFields.push(hd.field);
|
|
40759
40759
|
}
|
|
40760
|
-
}),
|
|
40761
|
-
for (let i = 0; i < state.table.leftRowSeriesNumberCount; i++) state.headerCheckedState[`_vtable_rowSeries_number_${i}`] = !1, state._checkboxCellTypeFields.push(`_vtable_rowSeries_number_${i}`);
|
|
40762
|
-
isNeedInitHeaderCheckedStateFromRecord = !0;
|
|
40763
|
-
}
|
|
40764
|
-
isNeedInitHeaderCheckedStateFromRecord && records.forEach((record, index) => {
|
|
40760
|
+
}), isNeedInitHeaderCheckedStateFromRecord && records.forEach((record, index) => {
|
|
40765
40761
|
state._checkboxCellTypeFields.forEach(field => {
|
|
40766
40762
|
const value = record[field];
|
|
40767
40763
|
let isChecked;
|
|
@@ -40805,28 +40801,14 @@
|
|
|
40805
40801
|
}
|
|
40806
40802
|
}
|
|
40807
40803
|
function setCellCheckboxState(col, row, checked, table) {
|
|
40808
|
-
const
|
|
40809
|
-
|
|
40810
|
-
if (!
|
|
40811
|
-
const field = table.getHeaderField(col, row);
|
|
40812
|
-
if (table.isHeader(col, row)) {
|
|
40813
|
-
table.stateManager.setHeaderCheckedState(field, checked);
|
|
40814
|
-
"checkbox" === table.getCellType(col, row) && table.scenegraph.updateCheckboxCellState(col, row, checked);
|
|
40815
|
-
} else {
|
|
40816
|
-
table.stateManager.setCheckedState(col, row, field, checked);
|
|
40817
|
-
if ("checkbox" === table.getCellType(col, row)) {
|
|
40818
|
-
const oldHeaderCheckedState = table.stateManager.headerCheckedState[field],
|
|
40819
|
-
newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(field, col, row);
|
|
40820
|
-
oldHeaderCheckedState !== newHeaderCheckedState && table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
40821
|
-
}
|
|
40822
|
-
}
|
|
40823
|
-
return;
|
|
40824
|
-
}
|
|
40804
|
+
const cellGoup = table.scenegraph.getCell(col, row),
|
|
40805
|
+
chechbox = null == cellGoup ? void 0 : cellGoup.getChildByName("checkbox");
|
|
40806
|
+
if (!chechbox) return;
|
|
40825
40807
|
const {
|
|
40826
40808
|
checked: oldChecked,
|
|
40827
40809
|
indeterminate: indeterminate
|
|
40828
|
-
} =
|
|
40829
|
-
indeterminate ? (checked ||
|
|
40810
|
+
} = chechbox.attribute;
|
|
40811
|
+
indeterminate ? (checked || chechbox._handlePointerUp(), chechbox._handlePointerUp()) : oldChecked ? checked || chechbox._handlePointerUp() : checked && chechbox._handlePointerUp();
|
|
40830
40812
|
}
|
|
40831
40813
|
function changeCheckboxOrder(sourceIndex, targetIndex, state) {
|
|
40832
40814
|
const {
|
|
@@ -41152,10 +41134,10 @@
|
|
|
41152
41134
|
let isShift = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
41153
41135
|
let isCtrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
41154
41136
|
let isSelectAll = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
41155
|
-
let
|
|
41137
|
+
let makeSelectCellVisible = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
41156
41138
|
let skipBodyMerge = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
41157
41139
|
let forceSelect = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
|
|
41158
|
-
-1 !== row && -1 !== row && (this.select.selecting = !0), updateSelectPosition(this, col, row, isShift, isCtrl, isSelectAll,
|
|
41140
|
+
-1 !== row && -1 !== row && (this.select.selecting = !0), updateSelectPosition(this, col, row, isShift, isCtrl, isSelectAll, makeSelectCellVisible, skipBodyMerge, forceSelect);
|
|
41159
41141
|
}
|
|
41160
41142
|
checkCellRangeInSelect(cellPosStart, cellPosEnd) {
|
|
41161
41143
|
return checkMultiCellInSelect(cellPosStart, cellPosEnd, this.select.ranges, this.select.highlightScope);
|
|
@@ -41241,10 +41223,7 @@
|
|
|
41241
41223
|
}, 0), this.table.scenegraph.updateChartSizeForResizeRowHeight(this.rowResize.row), this.table.scenegraph.component.hideResizeRow(), this.table.scenegraph.updateNextFrame();
|
|
41242
41224
|
}
|
|
41243
41225
|
startResizeRow(row, x, y, isBottomFrozen) {
|
|
41244
|
-
|
|
41245
|
-
this.rowResize.resizing = !0, this.rowResize.row = row, this.rowResize.y = y, this.rowResize.isBottomFrozen = isBottomFrozen, this.table.scenegraph.component.showResizeRow(row, x, isBottomFrozen);
|
|
41246
|
-
const isHasSelected = !!(null === (_a = this.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
41247
|
-
this.updateSelectPos(-1, -1), this.endSelectCells(!0, isHasSelected), this.table.scenegraph.updateNextFrame();
|
|
41226
|
+
this.rowResize.resizing = !0, this.rowResize.row = row, this.rowResize.y = y, this.rowResize.isBottomFrozen = isBottomFrozen, this.table.scenegraph.component.showResizeRow(row, x, isBottomFrozen), this.table.scenegraph.updateNextFrame();
|
|
41248
41227
|
}
|
|
41249
41228
|
updateResizeRow(xInTable, yInTable) {
|
|
41250
41229
|
updateResizeRow(xInTable, yInTable, this);
|
|
@@ -42409,15 +42388,15 @@
|
|
|
42409
42388
|
handler.on(table.getElement(), "blur", e => {
|
|
42410
42389
|
eventManager.dealTableHover();
|
|
42411
42390
|
}), handler.on(table.getElement(), "keydown", e => {
|
|
42412
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
42391
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
42413
42392
|
if ("a" === e.key && (e.ctrlKey || e.metaKey)) (null === (_a = table.keyboardOptions) || void 0 === _a ? void 0 : _a.selectAllOnCtrlA) && (e.preventDefault(), eventManager.deelTableSelectAll());else if (stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0 && ("ArrowUp" === e.key || "ArrowDown" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key)) {
|
|
42414
|
-
if ((null === (_c = null === (_b = table.options.keyboardOptions) || void 0 === _b ? void 0 : _b.moveEditCellOnArrowKeys) || void 0 === _c || !_c) && (null === (_d = table.editorManager) || void 0 === _d ? void 0 : _d.editingEditor)) return;
|
|
42393
|
+
if ((null === (_c = null === (_b = table.options.keyboardOptions) || void 0 === _b ? void 0 : _b.moveEditCellOnArrowKeys) || void 0 === _c || !_c) && (null === (_d = table.editorManager) || void 0 === _d ? void 0 : _d.editingEditor) || !1 === (null === (_e = table.options.keyboardOptions) || void 0 === _e ? void 0 : _e.moveSelectedCellOnArrowKeys)) return;
|
|
42415
42394
|
let targetCol, targetRow;
|
|
42416
42395
|
if (e.preventDefault(), e.stopPropagation(), "ArrowUp" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = stateManager.select.cellPos.col, targetRow = 0) : (e.shiftKey, targetCol = stateManager.select.cellPos.col, targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row - 1))) : "ArrowDown" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = stateManager.select.cellPos.col, targetRow = table.rowCount - 1) : (e.shiftKey, targetCol = stateManager.select.cellPos.col, targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1))) : "ArrowLeft" === e.key ? e.ctrlKey || e.metaKey ? (targetCol = 0, targetRow = stateManager.select.cellPos.row) : (e.shiftKey, targetRow = stateManager.select.cellPos.row, targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col - 1))) : "ArrowRight" === e.key && (e.ctrlKey || e.metaKey ? (targetCol = table.colCount - 1, targetRow = stateManager.select.cellPos.row) : (e.shiftKey, targetRow = stateManager.select.cellPos.row, targetCol = Math.min(table.colCount - 1, Math.max(0, stateManager.select.cellPos.col + 1)))), isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
42417
|
-
table.selectCell(targetCol, targetRow, e.shiftKey), null !== (
|
|
42418
|
-
} else if ("Escape" === e.key) null === (
|
|
42419
|
-
if (null === (
|
|
42420
|
-
if (handleKeydownListener(e), table.editorManager.completeEdit(), table.getElement().focus(), !0 === (null === (
|
|
42396
|
+
table.selectCell(targetCol, targetRow, e.shiftKey), null !== (_g = null === (_f = table.options.keyboardOptions) || void 0 === _f ? void 0 : _f.moveEditCellOnArrowKeys) && void 0 !== _g && _g && (null === (_h = table.editorManager) || void 0 === _h ? void 0 : _h.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
|
|
42397
|
+
} else if ("Escape" === e.key) null === (_j = table.editorManager) || void 0 === _j || _j.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
|
|
42398
|
+
if (null === (_k = table.editorManager) || void 0 === _k ? void 0 : _k.editingEditor) {
|
|
42399
|
+
if (handleKeydownListener(e), table.editorManager.completeEdit(), table.getElement().focus(), !0 === (null === (_l = table.options.keyboardOptions) || void 0 === _l ? void 0 : _l.moveFocusCellOnEnter)) {
|
|
42421
42400
|
const targetCol = stateManager.select.cellPos.col,
|
|
42422
42401
|
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
42423
42402
|
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
@@ -42425,12 +42404,12 @@
|
|
|
42425
42404
|
}
|
|
42426
42405
|
return;
|
|
42427
42406
|
}
|
|
42428
|
-
if (!0 === (null === (
|
|
42407
|
+
if (!0 === (null === (_m = table.options.keyboardOptions) || void 0 === _m ? void 0 : _m.moveFocusCellOnEnter)) {
|
|
42429
42408
|
const targetCol = stateManager.select.cellPos.col,
|
|
42430
42409
|
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
42431
42410
|
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
42432
42411
|
table.selectCell(targetCol, targetRow, e.shiftKey);
|
|
42433
|
-
} else if ((null === (
|
|
42412
|
+
} else if ((null === (_p = null === (_o = table.options.keyboardOptions) || void 0 === _o ? void 0 : _o.editCellOnEnter) || void 0 === _p || _p) && 1 === (null !== (_r = null === (_q = table.stateManager.select.ranges) || void 0 === _q ? void 0 : _q.length) && void 0 !== _r ? _r : 0)) {
|
|
42434
42413
|
const startCol = table.stateManager.select.ranges[0].start.col,
|
|
42435
42414
|
startRow = table.stateManager.select.ranges[0].start.row,
|
|
42436
42415
|
endCol = table.stateManager.select.ranges[0].end.col,
|
|
@@ -42438,15 +42417,15 @@
|
|
|
42438
42417
|
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && table.editorManager.startEditCell(startCol, startRow);
|
|
42439
42418
|
}
|
|
42440
42419
|
} else if ("Tab" === e.key) {
|
|
42441
|
-
if ((null === (
|
|
42420
|
+
if ((null === (_t = null === (_s = table.options.keyboardOptions) || void 0 === _s ? void 0 : _s.moveFocusCellOnTab) || void 0 === _t || _t) && stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0) {
|
|
42442
42421
|
if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
|
|
42443
42422
|
let targetCol, targetRow;
|
|
42444
42423
|
if (e.preventDefault(), stateManager.select.cellPos.col === table.colCount - 1 ? (targetRow = Math.min(table.rowCount - 1, stateManager.select.cellPos.row + 1), targetCol = table.rowHeaderLevelCount) : (targetRow = stateManager.select.cellPos.row, targetCol = stateManager.select.cellPos.col + 1), isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
42445
|
-
table.selectCell(targetCol, targetRow), (null === (
|
|
42424
|
+
table.selectCell(targetCol, targetRow), (null === (_u = table.editorManager) || void 0 === _u ? void 0 : _u.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
|
|
42446
42425
|
}
|
|
42447
42426
|
} else if (!(e.ctrlKey || e.metaKey || e.shiftKey)) {
|
|
42448
42427
|
const editCellTrigger = table.options.editCellTrigger;
|
|
42449
|
-
if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (
|
|
42428
|
+
if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_v = table.editorManager) || void 0 === _v ? void 0 : _v.editingEditor)) {
|
|
42450
42429
|
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
42451
42430
|
e.key.match(allowedKeys) && table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, "");
|
|
42452
42431
|
}
|
|
@@ -42701,7 +42680,7 @@
|
|
|
42701
42680
|
right || left || (x > table.tableNoFrameWidth - table.getRightFrozenColsWidth() && x < table.tableNoFrameWidth || x > 0 && x < table.getFrozenColsWidth() ? (selectX = x, considerFrozenX = !0) : selectX = table.scrollLeft + x), bottom || top || (y > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() && y < table.tableNoFrameHeight || y > 0 && y < table.getFrozenRowsHeight() ? (selectY = y, considerFrozenY = !0) : selectY = table.scrollTop + y), table.stateManager.updateInteractionState(InteractionState.grabing);
|
|
42702
42681
|
const targetCol = table.getTargetColAtConsiderRightFrozen(selectX, considerFrozenX),
|
|
42703
42682
|
targetRow = table.getTargetRowAtConsiderBottomFrozen(selectY, considerFrozenY);
|
|
42704
|
-
isValid$1(targetCol) && isValid$1(targetRow) && table.stateManager.updateSelectPos(targetCol.col, targetRow.row, !1, !1, !1, !
|
|
42683
|
+
isValid$1(targetCol) && isValid$1(targetRow) && table.stateManager.updateSelectPos(targetCol.col, targetRow.row, !1, !1, !1, !1);
|
|
42705
42684
|
});
|
|
42706
42685
|
} else table.eventManager.inertiaScroll.isInertiaScrolling() ? table.eventManager.inertiaScroll.endInertia() : table.eventManager.scrollYSpeed = 0;
|
|
42707
42686
|
}
|
|
@@ -42926,7 +42905,7 @@
|
|
|
42926
42905
|
}
|
|
42927
42906
|
dealMenuHover(eventArgsSet) {}
|
|
42928
42907
|
dealTableSelect(eventArgsSet, isSelectMoving) {
|
|
42929
|
-
var _a, _b, _c, _d;
|
|
42908
|
+
var _a, _b, _c, _d, _e, _f;
|
|
42930
42909
|
if (!eventArgsSet) return this.table.stateManager.updateSelectPos(-1, -1), !1;
|
|
42931
42910
|
const {
|
|
42932
42911
|
eventArgs: eventArgs
|
|
@@ -42942,7 +42921,7 @@
|
|
|
42942
42921
|
}
|
|
42943
42922
|
return !1;
|
|
42944
42923
|
}
|
|
42945
|
-
return !this.table.isPivotChart() || "axis-label" !== (null === (_c = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target.name) && "chart" !== (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type) ? (this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey, !1,
|
|
42924
|
+
return !this.table.isPivotChart() || "axis-label" !== (null === (_c = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target.name) && "chart" !== (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type) ? (this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey, !1, null === (_f = null === (_e = this.table.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f), !0) : (this.table.stateManager.updateSelectPos(-1, -1), !1);
|
|
42946
42925
|
}
|
|
42947
42926
|
return !1;
|
|
42948
42927
|
}
|
|
@@ -42955,8 +42934,8 @@
|
|
|
42955
42934
|
if ((null === (_b = null === (_a = this.table.stateManager.select) || void 0 === _a ? void 0 : _a.ranges) || void 0 === _b ? void 0 : _b.length) && this.table.stateManager.isFillHandle()) {
|
|
42956
42935
|
let updateRow, updateCol;
|
|
42957
42936
|
const currentRange = this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length - 1];
|
|
42958
|
-
isSelectMoving && (isValid$1(this.table.stateManager.fillHandle.directionRow) || (Math.abs(this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y) >= Math.abs(this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x) ? this.table.stateManager.fillHandle.directionRow = !0 : this.table.stateManager.fillHandle.directionRow = !1), Math.abs(this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y) >= Math.abs(this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x) ? this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y > 0 ? this.table.stateManager.fillHandle.direction = "top" : this.table.stateManager.fillHandle.direction = "bottom" : this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x > 0 ? this.table.stateManager.fillHandle.direction = "left" : this.table.stateManager.fillHandle.direction = "right", this.table.stateManager.fillHandle.directionRow ? (updateRow = eventArgs.row, updateCol = currentRange.end.col) : (updateRow = currentRange.end.row, updateCol = eventArgs.col)), this.table.stateManager.updateSelectPos(isSelectMoving ? updateCol : currentRange.end.col, isSelectMoving ? updateRow : currentRange.end.row, !0, eventArgs.event.ctrlKey || eventArgs.event.metaKey, !1, isSelectMoving);
|
|
42959
|
-
} else this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey, !1, isSelectMoving);
|
|
42937
|
+
isSelectMoving && (isValid$1(this.table.stateManager.fillHandle.directionRow) || (Math.abs(this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y) >= Math.abs(this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x) ? this.table.stateManager.fillHandle.directionRow = !0 : this.table.stateManager.fillHandle.directionRow = !1), Math.abs(this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y) >= Math.abs(this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x) ? this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y > 0 ? this.table.stateManager.fillHandle.direction = "top" : this.table.stateManager.fillHandle.direction = "bottom" : this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x > 0 ? this.table.stateManager.fillHandle.direction = "left" : this.table.stateManager.fillHandle.direction = "right", this.table.stateManager.fillHandle.directionRow ? (updateRow = eventArgs.row, updateCol = currentRange.end.col) : (updateRow = currentRange.end.row, updateCol = eventArgs.col)), this.table.stateManager.updateSelectPos(isSelectMoving ? updateCol : currentRange.end.col, isSelectMoving ? updateRow : currentRange.end.row, !0, eventArgs.event.ctrlKey || eventArgs.event.metaKey, !1, !isSelectMoving);
|
|
42938
|
+
} else this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey, !1, !isSelectMoving);
|
|
42960
42939
|
return !0;
|
|
42961
42940
|
}
|
|
42962
42941
|
return !1;
|
|
@@ -43012,11 +42991,11 @@
|
|
|
43012
42991
|
this.table.stateManager.updateResizeRow(xInTable, yInTable);
|
|
43013
42992
|
}
|
|
43014
42993
|
chechColumnMover(eventArgsSet) {
|
|
43015
|
-
var _a
|
|
42994
|
+
var _a;
|
|
43016
42995
|
const {
|
|
43017
42996
|
eventArgs: eventArgs
|
|
43018
42997
|
} = eventArgsSet;
|
|
43019
|
-
return
|
|
42998
|
+
return !(!eventArgs || !this.table._canDragHeaderPosition(eventArgs.col, eventArgs.row)) && (this.table.stateManager.startMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, null === (_a = null == eventArgs ? void 0 : eventArgs.event) || void 0 === _a ? void 0 : _a.nativeEvent), !0);
|
|
43020
42999
|
}
|
|
43021
43000
|
dealColumnMover(eventArgsSet) {
|
|
43022
43001
|
var _a;
|
|
@@ -43328,12 +43307,14 @@
|
|
|
43328
43307
|
}
|
|
43329
43308
|
class MenuElement {
|
|
43330
43309
|
constructor(table) {
|
|
43331
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
43310
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
43332
43311
|
this._handler = new EventHandler(), this._rootElement = createMenuDomElement$1(), this._secondElement = createMenuDomElement$1(), this._secondElement.sub = !0, this._showChildrenIndex = -1, this._rootElement.addEventListener("wheel", e => {
|
|
43333
43312
|
e.stopPropagation();
|
|
43334
43313
|
}), null === (_a = this._rootElement) || void 0 === _a || _a.addEventListener("mousedown", e => {
|
|
43335
43314
|
e.stopPropagation(), e.preventDefault();
|
|
43336
|
-
}), null === (_b = this._rootElement) || void 0 === _b || _b.addEventListener("
|
|
43315
|
+
}), null === (_b = this._rootElement) || void 0 === _b || _b.addEventListener("contextmenu", e => {
|
|
43316
|
+
e.stopPropagation(), e.preventDefault();
|
|
43317
|
+
}), null === (_c = this._rootElement) || void 0 === _c || _c.addEventListener("touchend", e => {
|
|
43337
43318
|
if (e.stopPropagation(), e.preventDefault(), this._rootElement.classList.contains(HIDDEN_CLASSNAME$1)) return;
|
|
43338
43319
|
const {
|
|
43339
43320
|
col: col,
|
|
@@ -43356,7 +43337,7 @@
|
|
|
43356
43337
|
cellLocation: table.getCellLocation(col, row),
|
|
43357
43338
|
event: e
|
|
43358
43339
|
}), table.fireListeners(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLEAR, null), table.fireListeners(TABLE_EVENT_TYPE.HIDE_MENU, null), e.stopPropagation();
|
|
43359
|
-
}), null === (
|
|
43340
|
+
}), null === (_d = this._rootElement) || void 0 === _d || _d.addEventListener("click", e => {
|
|
43360
43341
|
if (e.stopPropagation(), e.preventDefault(), this._rootElement.classList.contains(HIDDEN_CLASSNAME$1)) return;
|
|
43361
43342
|
const {
|
|
43362
43343
|
col: col,
|
|
@@ -43379,7 +43360,7 @@
|
|
|
43379
43360
|
cellLocation: table.getCellLocation(col, row),
|
|
43380
43361
|
event: e
|
|
43381
43362
|
}), table.fireListeners(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLEAR, null), table.fireListeners(TABLE_EVENT_TYPE.HIDE_MENU, null), e.stopPropagation();
|
|
43382
|
-
}), null === (
|
|
43363
|
+
}), null === (_e = this._rootElement) || void 0 === _e || _e.addEventListener("mousemove", e => {
|
|
43383
43364
|
var _a, _b;
|
|
43384
43365
|
if (this._rootElement.classList.contains(HIDDEN_CLASSNAME$1)) return;
|
|
43385
43366
|
e.stopPropagation();
|
|
@@ -43412,17 +43393,17 @@
|
|
|
43412
43393
|
null == secondElement || secondElement.classList.remove(SHOWN_CLASSNAME$1), null == secondElement || secondElement.classList.add(HIDDEN_CLASSNAME$1);
|
|
43413
43394
|
}
|
|
43414
43395
|
}, 300);
|
|
43415
|
-
}), null === (
|
|
43396
|
+
}), null === (_f = this._secondElement) || void 0 === _f || _f.addEventListener("wheel", e => {
|
|
43416
43397
|
e.stopPropagation();
|
|
43417
|
-
}), null === (
|
|
43398
|
+
}), null === (_g = this._secondElement) || void 0 === _g || _g.addEventListener("mousemove", e => {
|
|
43418
43399
|
this._rootElement.classList.contains(HIDDEN_CLASSNAME$1) || e.stopPropagation();
|
|
43419
|
-
}), null === (
|
|
43400
|
+
}), null === (_h = this._secondElement) || void 0 === _h || _h.addEventListener("mouseenter", e => {
|
|
43420
43401
|
this._mouseEnterSecondElement = !0;
|
|
43421
|
-
}), null === (
|
|
43402
|
+
}), null === (_j = this._secondElement) || void 0 === _j || _j.addEventListener("mouseleave", e => {
|
|
43422
43403
|
this._mouseEnterSecondElement = !1;
|
|
43423
|
-
}), null === (
|
|
43404
|
+
}), null === (_k = this._secondElement) || void 0 === _k || _k.addEventListener("mousedown", e => {
|
|
43424
43405
|
e.stopPropagation(), e.preventDefault();
|
|
43425
|
-
}), null === (
|
|
43406
|
+
}), null === (_l = this._secondElement) || void 0 === _l || _l.addEventListener("click", e => {
|
|
43426
43407
|
if (e.stopPropagation(), e.preventDefault(), this._secondElement.classList.contains(HIDDEN_CLASSNAME$1)) return;
|
|
43427
43408
|
const {
|
|
43428
43409
|
col: col,
|
|
@@ -43492,11 +43473,12 @@
|
|
|
43492
43473
|
this._menuInstanceInfo = void 0, (null == rootElement ? void 0 : rootElement.parentElement) && (rootElement.classList.remove(SHOWN_CLASSNAME$1), rootElement.classList.add(HIDDEN_CLASSNAME$1)), (null == secondElement ? void 0 : secondElement.parentElement) && (secondElement.classList.remove(SHOWN_CLASSNAME$1), secondElement.classList.add(HIDDEN_CLASSNAME$1));
|
|
43493
43474
|
}
|
|
43494
43475
|
_canBindToCell(table, col, row) {
|
|
43476
|
+
var _a;
|
|
43495
43477
|
const rect = table.getCellRangeRelativeRect({
|
|
43496
43478
|
col: col,
|
|
43497
43479
|
row: row
|
|
43498
43480
|
}),
|
|
43499
|
-
element = table.getElement(),
|
|
43481
|
+
element = null !== (_a = table.internalProps.menu.parentElement) && void 0 !== _a ? _a : table.getElement(),
|
|
43500
43482
|
{
|
|
43501
43483
|
top: top,
|
|
43502
43484
|
bottom: bottom,
|
|
@@ -43512,12 +43494,15 @@
|
|
|
43512
43494
|
return !(offsetHeight < top) && !(offsetWidth < left);
|
|
43513
43495
|
}
|
|
43514
43496
|
_bindToCell(table, col, row, position, referencePosition) {
|
|
43497
|
+
var _a;
|
|
43515
43498
|
const rootElement = this._rootElement,
|
|
43516
|
-
element = table.getElement(),
|
|
43499
|
+
element = null !== (_a = table.internalProps.menu.parentElement) && void 0 !== _a ? _a : table.getElement(),
|
|
43517
43500
|
{
|
|
43518
43501
|
width: containerWidth,
|
|
43519
|
-
height: containerHeight
|
|
43520
|
-
|
|
43502
|
+
height: containerHeight,
|
|
43503
|
+
left: containerLeft,
|
|
43504
|
+
top: containerTop
|
|
43505
|
+
} = element.getBoundingClientRect();
|
|
43521
43506
|
if (rootElement) {
|
|
43522
43507
|
rootElement.parentElement !== element && element.appendChild(rootElement), rootElement.style.left = "0px";
|
|
43523
43508
|
const maxWidth = .8 * containerWidth;
|
|
@@ -43529,19 +43514,30 @@
|
|
|
43529
43514
|
const rect = element.getBoundingClientRect(),
|
|
43530
43515
|
scaleX = rect.width / element.offsetWidth,
|
|
43531
43516
|
scaleY = rect.height / element.offsetHeight;
|
|
43532
|
-
|
|
43517
|
+
rootElementTop * scaleY + rootElementHeight > containerHeight && (rootElementTop = (containerHeight - rootElementHeight) / scaleY), rootElementTop < 0 && (rootElementTop /= 2);
|
|
43518
|
+
let deltaTop = 0,
|
|
43519
|
+
deltaLeft = 0;
|
|
43520
|
+
if (table.getElement() !== element) {
|
|
43521
|
+
const {
|
|
43522
|
+
left: left,
|
|
43523
|
+
top: top
|
|
43524
|
+
} = table.getElement().getBoundingClientRect();
|
|
43525
|
+
deltaTop = top - containerTop, deltaLeft = left - containerLeft;
|
|
43526
|
+
}
|
|
43527
|
+
return rootElement.style.top = `${rootElementTop + deltaTop}px`, rootElementLeft < 0 ? rootElementLeft = 0 : rootElementLeft * scaleX + rootElementWidth > containerWidth && (rootElementLeft = (containerWidth - rootElementWidth) / scaleX), rootElement.style.left = `${rootElementLeft + deltaLeft}px`, !0;
|
|
43533
43528
|
}
|
|
43534
43529
|
return !1;
|
|
43535
43530
|
}
|
|
43536
43531
|
_bindSecondElement(table, col, row, x, y) {
|
|
43532
|
+
var _a;
|
|
43537
43533
|
const secondElement = this._secondElement,
|
|
43538
43534
|
rootElement = this._rootElement,
|
|
43539
|
-
element = table.getElement(),
|
|
43535
|
+
element = null !== (_a = table.internalProps.menu.parentElement) && void 0 !== _a ? _a : table.getElement(),
|
|
43540
43536
|
{
|
|
43541
43537
|
width: containerWidth,
|
|
43542
43538
|
left: containerLeft,
|
|
43543
43539
|
top: containerTop
|
|
43544
|
-
} =
|
|
43540
|
+
} = element.getBoundingClientRect(),
|
|
43545
43541
|
{
|
|
43546
43542
|
x: rootLeft,
|
|
43547
43543
|
y: rootTop,
|
|
@@ -45492,7 +45488,7 @@
|
|
|
45492
45488
|
constructor(container) {
|
|
45493
45489
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
45494
45490
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
45495
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.11.2-alpha.
|
|
45491
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.11.2-alpha.3", 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");
|
|
45496
45492
|
const {
|
|
45497
45493
|
frozenColCount = 0,
|
|
45498
45494
|
frozenRowCount: frozenRowCount,
|
|
@@ -46408,13 +46404,12 @@
|
|
|
46408
46404
|
clearSelected() {
|
|
46409
46405
|
this.stateManager.updateSelectPos(-1, -1);
|
|
46410
46406
|
}
|
|
46411
|
-
selectCell(col, row, isShift, isCtrl) {
|
|
46412
|
-
let makeSelectCellVisible = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
46407
|
+
selectCell(col, row, isShift, isCtrl, makeSelectCellVisible) {
|
|
46413
46408
|
let skipBodyMerge = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
|
|
46414
46409
|
let forceSelect = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
46415
|
-
var _a;
|
|
46410
|
+
var _a, _b, _c;
|
|
46416
46411
|
const isHasSelected = !!(null === (_a = this.stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
|
|
46417
|
-
this.stateManager.updateSelectPos(col, row, isShift, isCtrl, !1,
|
|
46412
|
+
this.stateManager.updateSelectPos(col, row, isShift, isCtrl, !1, null === (_c = null != makeSelectCellVisible ? makeSelectCellVisible : null === (_b = this.options.select) || void 0 === _b ? void 0 : _b.makeSelectCellVisible) || void 0 === _c || _c, skipBodyMerge, forceSelect), this.stateManager.endSelectCells(!0, isHasSelected);
|
|
46418
46413
|
}
|
|
46419
46414
|
selectCells(cellRanges) {
|
|
46420
46415
|
const {
|
|
@@ -46422,7 +46417,8 @@
|
|
|
46422
46417
|
scrollTop: scrollTop
|
|
46423
46418
|
} = this;
|
|
46424
46419
|
cellRanges.forEach((cellRange, index) => {
|
|
46425
|
-
|
|
46420
|
+
var _a, _b, _c, _d, _e, _f;
|
|
46421
|
+
cellRange.start.col === cellRange.end.col && cellRange.start.row === cellRange.end.row ? this.stateManager.updateSelectPos(cellRange.start.col, cellRange.start.row, !1, index >= 1, !1, null === (_b = null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.makeSelectCellVisible) || void 0 === _b || _b, !0) : (this.stateManager.updateSelectPos(cellRange.start.col, cellRange.start.row, !1, index >= 1, !1, null === (_d = null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.makeSelectCellVisible) || void 0 === _d || _d, !0), this.stateManager.updateInteractionState(InteractionState.grabing), this.stateManager.updateSelectPos(cellRange.end.col, cellRange.end.row, !1, index >= 1, !1, null === (_f = null === (_e = this.options.select) || void 0 === _e ? void 0 : _e.makeSelectCellVisible) || void 0 === _f || _f, !0)), this.stateManager.endSelectCells(!1, !1), this.stateManager.updateInteractionState(InteractionState.default);
|
|
46426
46422
|
}), this.setScrollTop(scrollTop), this.setScrollLeft(scrollLeft);
|
|
46427
46423
|
}
|
|
46428
46424
|
get recordsCount() {
|
|
@@ -46707,8 +46703,8 @@
|
|
|
46707
46703
|
return !0;
|
|
46708
46704
|
}
|
|
46709
46705
|
_canDragHeaderPosition(col, row) {
|
|
46710
|
-
var _a, _b;
|
|
46711
|
-
if (this.isHeader(col, row) && (this.stateManager.isSelected(col, row) || (null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.
|
|
46706
|
+
var _a, _b, _c;
|
|
46707
|
+
if (this.isHeader(col, row) && (this.stateManager.isSelected(col, row) || "body" === (null === (_a = this.options.select) || void 0 === _a ? void 0 : _a.headerSelectMode) && checkCellInSelect(col, row, [this.getCellRange(this.stateManager.select.cellPos.col, this.stateManager.select.cellPos.row)]) || (null === (_b = this.options.select) || void 0 === _b ? void 0 : _b.disableHeaderSelect) || (null === (_c = this.options.select) || void 0 === _c ? void 0 : _c.disableSelect))) {
|
|
46712
46708
|
if ("disabled" === this.internalProps.frozenColDragHeaderMode && this.isFrozenColumn(col)) return !1;
|
|
46713
46709
|
if (this.stateManager.isSelected(col, row)) {
|
|
46714
46710
|
const selectRange = this.stateManager.select.ranges[0];
|
|
@@ -47934,20 +47930,18 @@
|
|
|
47934
47930
|
}
|
|
47935
47931
|
handleRowSeriesNumber(rowSeriesNumber) {
|
|
47936
47932
|
var _a, _b;
|
|
47937
|
-
rowSeriesNumber && (Array.isArray(rowSeriesNumber) ? this.rowSeriesNumberColumn = rowSeriesNumber.map(
|
|
47938
|
-
var _a, _b
|
|
47933
|
+
rowSeriesNumber && (Array.isArray(rowSeriesNumber) ? this.rowSeriesNumberColumn = rowSeriesNumber.map(seriesNumber => {
|
|
47934
|
+
var _a, _b;
|
|
47939
47935
|
return {
|
|
47940
47936
|
id: this.seqId++,
|
|
47941
47937
|
title: seriesNumber.title,
|
|
47942
|
-
define:
|
|
47943
|
-
field: "_vtable_rowSeries_number_" + index
|
|
47944
|
-
}, seriesNumber),
|
|
47938
|
+
define: seriesNumber,
|
|
47945
47939
|
cellType: null !== (_a = seriesNumber.cellType) && void 0 !== _a ? _a : "text",
|
|
47946
47940
|
headerType: null !== (_b = rowSeriesNumber.cellType) && void 0 !== _b ? _b : "text",
|
|
47947
47941
|
style: seriesNumber.style,
|
|
47948
47942
|
width: seriesNumber.width,
|
|
47949
47943
|
format: seriesNumber.format,
|
|
47950
|
-
field:
|
|
47944
|
+
field: seriesNumber.field,
|
|
47951
47945
|
icon: seriesNumber.icon,
|
|
47952
47946
|
headerIcon: seriesNumber.headerIcon,
|
|
47953
47947
|
isChildNode: !1
|
|
@@ -47955,15 +47949,13 @@
|
|
|
47955
47949
|
}) : this.rowSeriesNumberColumn = [{
|
|
47956
47950
|
id: this.seqId++,
|
|
47957
47951
|
title: rowSeriesNumber.title,
|
|
47958
|
-
define:
|
|
47959
|
-
field: "_vtable_rowSeries_number"
|
|
47960
|
-
}, rowSeriesNumber),
|
|
47952
|
+
define: rowSeriesNumber,
|
|
47961
47953
|
cellType: null !== (_a = rowSeriesNumber.cellType) && void 0 !== _a ? _a : "text",
|
|
47962
47954
|
headerType: null !== (_b = rowSeriesNumber.cellType) && void 0 !== _b ? _b : "text",
|
|
47963
47955
|
style: rowSeriesNumber.style,
|
|
47964
47956
|
width: rowSeriesNumber.width,
|
|
47965
47957
|
format: rowSeriesNumber.format,
|
|
47966
|
-
field: "
|
|
47958
|
+
field: "",
|
|
47967
47959
|
icon: rowSeriesNumber.icon,
|
|
47968
47960
|
headerIcon: rowSeriesNumber.headerIcon,
|
|
47969
47961
|
isChildNode: !1
|
|
@@ -48356,11 +48348,9 @@
|
|
|
48356
48348
|
return this._headerObjectMap[id];
|
|
48357
48349
|
}
|
|
48358
48350
|
getHeaderField(col, row) {
|
|
48359
|
-
var _a
|
|
48360
|
-
if (this.isSeriesNumberInHeader(col, row)) return null === (_a = this.getSeriesNumberHeader(col, row)) || void 0 === _a ? void 0 : _a.field;
|
|
48361
|
-
if (this.isSeriesNumberInBody(col, row)) return null === (_b = this.getSeriesNumberBody(col, row)) || void 0 === _b ? void 0 : _b.field;
|
|
48351
|
+
var _a;
|
|
48362
48352
|
const id = this.getCellId(col, row);
|
|
48363
|
-
return (null === (
|
|
48353
|
+
return (null === (_a = this._headerObjectMap[id]) || void 0 === _a ? void 0 : _a.field) || (this.transpose ? this._columns[row] && this._columns[row].field : this._columns[col - this.leftRowSeriesNumberColumnCount] && this._columns[col - this.leftRowSeriesNumberColumnCount].field);
|
|
48364
48354
|
}
|
|
48365
48355
|
getHeaderCellAdressById(id) {
|
|
48366
48356
|
for (let i = 0; i < this._headerCellIds.length; i++) {
|
|
@@ -51001,11 +50991,12 @@
|
|
|
51001
50991
|
this._menuInstanceInfo = void 0, (null == rootElement ? void 0 : rootElement.parentElement) && (rootElement.classList.remove(SHOWN_CLASSNAME), rootElement.classList.add(HIDDEN_CLASSNAME));
|
|
51002
50992
|
}
|
|
51003
50993
|
_canBindToCell(table, col, row) {
|
|
50994
|
+
var _a;
|
|
51004
50995
|
const rect = table.getCellRangeRelativeRect({
|
|
51005
50996
|
col: col,
|
|
51006
50997
|
row: row
|
|
51007
50998
|
}),
|
|
51008
|
-
element = table.getElement(),
|
|
50999
|
+
element = null !== (_a = table.internalProps.menu.parentElement) && void 0 !== _a ? _a : table.getElement(),
|
|
51009
51000
|
{
|
|
51010
51001
|
top: top,
|
|
51011
51002
|
bottom: bottom,
|
|
@@ -51021,12 +51012,15 @@
|
|
|
51021
51012
|
return !(offsetHeight < top) && !(offsetWidth < left);
|
|
51022
51013
|
}
|
|
51023
51014
|
_bindCell(table, col, row, position, referencePosition) {
|
|
51015
|
+
var _a;
|
|
51024
51016
|
const rootElement = this._rootElement,
|
|
51025
|
-
element = table.getElement(),
|
|
51017
|
+
element = null !== (_a = table.internalProps.menu.parentElement) && void 0 !== _a ? _a : table.getElement(),
|
|
51026
51018
|
{
|
|
51027
51019
|
width: containerWidth,
|
|
51028
|
-
height: containerHeight
|
|
51029
|
-
|
|
51020
|
+
height: containerHeight,
|
|
51021
|
+
left: containerLeft,
|
|
51022
|
+
top: containerTop
|
|
51023
|
+
} = element.getBoundingClientRect();
|
|
51030
51024
|
if (rootElement) {
|
|
51031
51025
|
rootElement.parentElement !== element && element.appendChild(rootElement), rootElement.style.left = "0px";
|
|
51032
51026
|
const maxWidth = .8 * containerWidth;
|
|
@@ -51034,7 +51028,17 @@
|
|
|
51034
51028
|
const rootElementWidth = rootElement.clientWidth,
|
|
51035
51029
|
rootElementHeight = rootElement.clientHeight;
|
|
51036
51030
|
let rootElementLeft, rootElementTop;
|
|
51037
|
-
|
|
51031
|
+
position && (rootElementLeft = position.x, rootElementTop = position.y), referencePosition && (rootElementLeft = referencePosition.rect.right - rootElementWidth, rootElementTop = referencePosition.rect.bottom), rootElementTop + rootElementHeight > containerHeight && (rootElementTop = containerHeight - rootElementHeight, rootElementLeft += rootElementWidth - 2), rootElementTop < 0 && (rootElementTop /= 2);
|
|
51032
|
+
let deltaTop = 0,
|
|
51033
|
+
deltaLeft = 0;
|
|
51034
|
+
if (table.getElement() !== element) {
|
|
51035
|
+
const {
|
|
51036
|
+
left: left,
|
|
51037
|
+
top: top
|
|
51038
|
+
} = table.getElement().getBoundingClientRect();
|
|
51039
|
+
deltaTop = top - containerTop, deltaLeft = left - containerLeft;
|
|
51040
|
+
}
|
|
51041
|
+
return rootElement.style.top = `${rootElementTop + deltaTop}px`, rootElementLeft < 0 ? rootElementLeft = 0 : rootElementLeft + rootElementWidth > containerWidth && (rootElementLeft = containerWidth - rootElementWidth), rootElement.style.left = `${rootElementLeft + deltaLeft}px`, !0;
|
|
51038
51042
|
}
|
|
51039
51043
|
return !1;
|
|
51040
51044
|
}
|