@visactor/vtable-calendar 1.18.4-alpha.0 → 1.18.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 +264 -83
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +5 -5
package/dist/vtable-calendar.js
CHANGED
|
@@ -29391,7 +29391,8 @@
|
|
|
29391
29391
|
EMPTY_TIP_CLICK: "empty_tip_click",
|
|
29392
29392
|
EMPTY_TIP_DBLCLICK: "empty_tip_dblclick",
|
|
29393
29393
|
BUTTON_CLICK: "button_click",
|
|
29394
|
-
BEFORE_CACHE_CHART_IMAGE: "before_cache_chart_image"
|
|
29394
|
+
BEFORE_CACHE_CHART_IMAGE: "before_cache_chart_image",
|
|
29395
|
+
PASTED_DATA: "pasted_data"
|
|
29395
29396
|
};
|
|
29396
29397
|
|
|
29397
29398
|
const judgeType = value => {
|
|
@@ -33235,8 +33236,9 @@
|
|
|
33235
33236
|
addRecordsForTree(recordArr, recordIndex) {
|
|
33236
33237
|
if (isArray$7(recordArr) && 0 !== recordArr.length) {
|
|
33237
33238
|
if (this.adjustBeforeChangedRecordsMap(recordIndex, recordArr.length), isNumber$4(recordIndex)) this.dataSourceObj.records.splice(recordIndex, 0, ...recordArr);else {
|
|
33238
|
-
const
|
|
33239
|
-
|
|
33239
|
+
const recordIndex_copy = [...recordIndex],
|
|
33240
|
+
index = recordIndex_copy.pop(),
|
|
33241
|
+
parentRecord = this.getOriginalRecord(recordIndex_copy);
|
|
33240
33242
|
parentRecord.children ? parentRecord.children.splice(index, 0, ...recordArr) : parentRecord.children = recordArr;
|
|
33241
33243
|
}
|
|
33242
33244
|
this.initTreeHierarchyState(), this.updatePagerData();
|
|
@@ -33249,8 +33251,9 @@
|
|
|
33249
33251
|
const recordIndex = recordIndexsMaxToMin[index];
|
|
33250
33252
|
if (!isNumber$4(recordIndex) || !(recordIndex >= this.sourceLength || recordIndex < 0)) {
|
|
33251
33253
|
if (this.beforeChangedRecordsMap.delete(recordIndex.toString()), isNumber$4(recordIndex)) this.dataSourceObj.records.splice(recordIndex, 1);else {
|
|
33252
|
-
const
|
|
33253
|
-
|
|
33254
|
+
const recordIndex_copy = [...recordIndex],
|
|
33255
|
+
index = recordIndex_copy.pop();
|
|
33256
|
+
this.getOriginalRecord(recordIndex_copy).children.splice(index, 1);
|
|
33254
33257
|
}
|
|
33255
33258
|
this.adjustBeforeChangedRecordsMap(recordIndex, 1, "delete");
|
|
33256
33259
|
}
|
|
@@ -33262,8 +33265,9 @@
|
|
|
33262
33265
|
const recordIndex = recordIndexs[index],
|
|
33263
33266
|
record = records[index];
|
|
33264
33267
|
if (!isNumber$4(recordIndex) || !(recordIndex >= this.sourceLength || recordIndex < 0)) if (this.beforeChangedRecordsMap.delete(recordIndex.toString()), isNumber$4(recordIndex)) this.dataSourceObj.records.splice(recordIndex, 1, record);else {
|
|
33265
|
-
const
|
|
33266
|
-
|
|
33268
|
+
const recordIndex_copy = [...recordIndex],
|
|
33269
|
+
index = recordIndex_copy.pop();
|
|
33270
|
+
this.getOriginalRecord(recordIndex_copy).children.splice(index, 1, record);
|
|
33267
33271
|
}
|
|
33268
33272
|
}
|
|
33269
33273
|
this.initTreeHierarchyState(), this.updatePagerData();
|
|
@@ -35616,7 +35620,9 @@
|
|
|
35616
35620
|
if ("cell" !== table.scenegraph.highPerformanceGetCell(col, row).role) return cellGroup;
|
|
35617
35621
|
value = table.getCellValue(col, row), isAsync = !0;
|
|
35618
35622
|
}
|
|
35619
|
-
if ("
|
|
35623
|
+
if ("checkbox" === type && define.tree) {
|
|
35624
|
+
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !0);
|
|
35625
|
+
} else if ("text" === type || "link" === type || customResult) {
|
|
35620
35626
|
if ("link" === type) {
|
|
35621
35627
|
const cellValue = value,
|
|
35622
35628
|
cellOriginValue = table.getCellOriginValue(col, row),
|
|
@@ -35675,7 +35681,7 @@
|
|
|
35675
35681
|
if (isAggregation && isSeriesNumber) {
|
|
35676
35682
|
cellGroup = Factory.getFunction("createTextCellGroup")(table, value, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, !1, void 0, !0, cellTheme, range, isAsync);
|
|
35677
35683
|
} else {
|
|
35678
|
-
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync);
|
|
35684
|
+
cellGroup = Factory.getFunction("createCheckboxCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, !1);
|
|
35679
35685
|
}
|
|
35680
35686
|
} else if ("radio" === type) {
|
|
35681
35687
|
cellGroup = Factory.getFunction("createRadioCellGroup")(null, columnGroup, 0, y, col, row, colWidth, cellWidth, cellHeight, padding, textAlign, textBaseline, table, cellTheme, define, range);
|
|
@@ -38378,10 +38384,7 @@
|
|
|
38378
38384
|
let fullImage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
38379
38385
|
let viewBox = arguments.length > 2 ? arguments[2] : undefined;
|
|
38380
38386
|
if ("released" === stage.releaseStatus) return null;
|
|
38381
|
-
const
|
|
38382
|
-
window = renderToNewWindow(stage, fullImage, viewBox);
|
|
38383
|
-
window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, 0, 0), stage.renderTo(window);
|
|
38384
|
-
const c = window.getNativeHandler();
|
|
38387
|
+
const c = renderToNewWindow(stage, fullImage, viewBox).getNativeHandler();
|
|
38385
38388
|
return c.nativeCanvas ? c.nativeCanvas : null;
|
|
38386
38389
|
}
|
|
38387
38390
|
function renderToNewWindow(stage) {
|
|
@@ -38407,7 +38410,7 @@
|
|
|
38407
38410
|
canvasControled: !0,
|
|
38408
38411
|
offscreen: !0,
|
|
38409
38412
|
title: ""
|
|
38410
|
-
}), stage.renderTo(window), window;
|
|
38413
|
+
}), window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, 0, 0), stage.renderTo(window), window;
|
|
38411
38414
|
}
|
|
38412
38415
|
|
|
38413
38416
|
var __decorate$6 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -42732,13 +42735,13 @@
|
|
|
42732
42735
|
if (this.table.transpose) null === (_a = this.bodyGroup.children) || void 0 === _a || _a.forEach(columnGroup => {
|
|
42733
42736
|
var _a;
|
|
42734
42737
|
null === (_a = columnGroup.getChildAt(row)) || void 0 === _a || _a.getChildren().forEach(node => {
|
|
42735
|
-
"checkbox" === node.name && ("indeterminate" === checked ? (node.setAttribute("indeterminate", !0), node.setAttribute("checked", void 0)) : (node.setAttribute("indeterminate", void 0), node.setAttribute("checked", checked)));
|
|
42738
|
+
"checkbox" === node.name && ("indeterminate" === checked ? (node.setAttribute("indeterminate", !0), node.setAttribute("checked", void 0)) : (node.setAttribute("indeterminate", void 0), node.setAttribute("checked", checked))), "checkbox-content" === node.name && ("indeterminate" === checked ? (node._checkboxGroup.getChildByName("checkbox").setAttribute("indeterminate", !0), node._checkboxGroup.getChildByName("checkbox").setAttribute("checked", void 0)) : (node._checkboxGroup.getChildByName("checkbox").setAttribute("indeterminate", void 0), node._checkboxGroup.getChildByName("checkbox").setAttribute("checked", checked)));
|
|
42736
42739
|
});
|
|
42737
42740
|
});else {
|
|
42738
42741
|
const columnGroup = this.getColGroup(col);
|
|
42739
42742
|
null === (_b = null == columnGroup ? void 0 : columnGroup.children) || void 0 === _b || _b.forEach(cellNode => {
|
|
42740
42743
|
cellNode.getChildren().find(node => {
|
|
42741
|
-
"checkbox" === node.name && ("indeterminate" === checked ? (node.setAttribute("indeterminate", !0), node.setAttribute("checked", void 0)) : (node.setAttribute("indeterminate", void 0), node.setAttribute("checked", checked)));
|
|
42744
|
+
"checkbox" === node.name && ("indeterminate" === checked ? (node.setAttribute("indeterminate", !0), node.setAttribute("checked", void 0)) : (node.setAttribute("indeterminate", void 0), node.setAttribute("checked", checked))), "checkbox-content" === node.name && ("indeterminate" === checked ? (node._checkboxGroup.getChildByName("checkbox").setAttribute("indeterminate", !0), node._checkboxGroup.getChildByName("checkbox").setAttribute("checked", void 0)) : (node._checkboxGroup.getChildByName("checkbox").setAttribute("indeterminate", void 0), node._checkboxGroup.getChildByName("checkbox").setAttribute("checked", checked)));
|
|
42742
42745
|
});
|
|
42743
42746
|
});
|
|
42744
42747
|
}
|
|
@@ -42747,12 +42750,12 @@
|
|
|
42747
42750
|
var _a, _b;
|
|
42748
42751
|
if (this.table.transpose) null === (_a = this.rowHeaderGroup.children) || void 0 === _a || _a.forEach(columnGroup => {
|
|
42749
42752
|
columnGroup.getChildAt(row).getChildren().forEach(node => {
|
|
42750
|
-
"checkbox" === node.name && ("indeterminate" === checked ? (node.setAttribute("indeterminate", !0), node.setAttribute("checked", void 0)) : (node.setAttribute("indeterminate", void 0), node.setAttribute("checked", checked)));
|
|
42753
|
+
"checkbox" === node.name && ("indeterminate" === checked ? (node.setAttribute("indeterminate", !0), node.setAttribute("checked", void 0)) : (node.setAttribute("indeterminate", void 0), node.setAttribute("checked", checked))), "checkbox-content" === node.name && ("indeterminate" === checked ? (node._checkboxGroup.getChildByName("checkbox").setAttribute("indeterminate", !0), node._checkboxGroup.getChildByName("checkbox").setAttribute("checked", void 0)) : (node._checkboxGroup.getChildByName("checkbox").setAttribute("indeterminate", void 0), node._checkboxGroup.getChildByName("checkbox").setAttribute("checked", checked)));
|
|
42751
42754
|
});
|
|
42752
42755
|
});else {
|
|
42753
42756
|
null === (_b = this.getColGroup(col, !0).children) || void 0 === _b || _b.forEach(cellNode => {
|
|
42754
42757
|
cellNode.getChildren().find(node => {
|
|
42755
|
-
"checkbox" === node.name && ("indeterminate" === checked ? (node.setAttribute("indeterminate", !0), node.setAttribute("checked", void 0)) : (node.setAttribute("indeterminate", void 0), node.setAttribute("checked", checked)));
|
|
42758
|
+
"checkbox" === node.name && ("indeterminate" === checked ? (node.setAttribute("indeterminate", !0), node.setAttribute("checked", void 0)) : (node.setAttribute("indeterminate", void 0), node.setAttribute("checked", checked))), "checkbox-content" === node.name && ("indeterminate" === checked ? (node._checkboxGroup.getChildByName("checkbox").setAttribute("indeterminate", !0), node._checkboxGroup.getChildByName("checkbox").setAttribute("checked", void 0)) : (node._checkboxGroup.getChildByName("checkbox").setAttribute("indeterminate", void 0), node._checkboxGroup.getChildByName("checkbox").setAttribute("checked", checked)));
|
|
42756
42759
|
});
|
|
42757
42760
|
});
|
|
42758
42761
|
}
|
|
@@ -44252,8 +44255,9 @@
|
|
|
44252
44255
|
indeterminate ? (checked || checkbox._handlePointerUp(), checkbox._handlePointerUp()) : oldChecked ? checked || checkbox._handlePointerUp() : checked && checkbox._handlePointerUp();
|
|
44253
44256
|
}
|
|
44254
44257
|
function setCellCheckboxStateByAttribute(col, row, checked, table) {
|
|
44258
|
+
var _a, _b;
|
|
44255
44259
|
const cellGroup = table.scenegraph.getCell(col, row),
|
|
44256
|
-
checkbox = null == cellGroup ? void 0 : cellGroup.getChildByName("checkbox");
|
|
44260
|
+
checkbox = (null == cellGroup ? void 0 : cellGroup.getChildByName("checkbox")) || (null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildByName("checkbox-content")) || void 0 === _a ? void 0 : _a._checkboxGroup) || void 0 === _b ? void 0 : _b.getChildByName("checkbox"));
|
|
44257
44261
|
checkbox && ("indeterminate" === checked ? (checkbox.setAttribute("indeterminate", !0), checkbox.setAttribute("checked", void 0)) : (checkbox.setAttribute("indeterminate", void 0), checkbox.setAttribute("checked", checked)));
|
|
44258
44262
|
}
|
|
44259
44263
|
function changeCheckboxOrder(sourceIndex, targetIndex, state) {
|
|
@@ -46032,7 +46036,7 @@
|
|
|
46032
46036
|
handler.on(table.getElement(), "blur", e => {
|
|
46033
46037
|
eventManager.dealTableHover();
|
|
46034
46038
|
}), handler.on(table.getElement(), "keydown", e => {
|
|
46035
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
46039
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
46036
46040
|
const beforeKeydownEvent = {
|
|
46037
46041
|
keyCode: null !== (_a = e.keyCode) && void 0 !== _a ? _a : e.which,
|
|
46038
46042
|
code: e.code,
|
|
@@ -46042,10 +46046,10 @@
|
|
|
46042
46046
|
if ((null === (_d = null === (_c = table.options.keyboardOptions) || void 0 === _c ? void 0 : _c.moveEditCellOnArrowKeys) || void 0 === _d || !_d) && (null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.editingEditor) || !1 === (null === (_f = table.options.keyboardOptions) || void 0 === _f ? void 0 : _f.moveSelectedCellOnArrowKeys)) return;
|
|
46043
46047
|
let targetCol, targetRow;
|
|
46044
46048
|
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;
|
|
46045
|
-
table.selectCell(targetCol, targetRow, e.shiftKey), null !== (_h = null === (_g = table.options.keyboardOptions) || void 0 === _g ? void 0 : _g.moveEditCellOnArrowKeys) && void 0 !== _h && _h && (null === (_j = table.editorManager) || void 0 === _j ? void 0 : _j.editingEditor) && (table.editorManager.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && table.editorManager.startEditCell(targetCol, targetRow));
|
|
46046
|
-
} else if ("Escape" === e.key) null === (
|
|
46047
|
-
if (null === (
|
|
46048
|
-
if (handleKeydownListener(e), table.editorManager.completeEdit(), table.getElement().focus(), !0 === (null === (
|
|
46049
|
+
table.selectCell(targetCol, targetRow, e.shiftKey), null !== (_h = null === (_g = table.options.keyboardOptions) || void 0 === _g ? void 0 : _g.moveEditCellOnArrowKeys) && void 0 !== _h && _h && (null === (_j = table.editorManager) || void 0 === _j ? void 0 : _j.editingEditor) && (null === (_k = table.editorManager) || void 0 === _k || _k.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && (null === (_l = table.editorManager) || void 0 === _l || _l.startEditCell(targetCol, targetRow)));
|
|
46050
|
+
} else if ("Escape" === e.key) null === (_m = table.editorManager) || void 0 === _m || _m.cancelEdit(), table.getElement().focus();else if ("Enter" === e.key) {
|
|
46051
|
+
if (null === (_o = table.editorManager) || void 0 === _o ? void 0 : _o.editingEditor) {
|
|
46052
|
+
if (handleKeydownListener(e), null === (_p = table.editorManager) || void 0 === _p || _p.completeEdit(), table.getElement().focus(), !0 === (null === (_q = table.options.keyboardOptions) || void 0 === _q ? void 0 : _q.moveFocusCellOnEnter)) {
|
|
46049
46053
|
const targetCol = stateManager.select.cellPos.col,
|
|
46050
46054
|
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
46051
46055
|
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
@@ -46053,30 +46057,30 @@
|
|
|
46053
46057
|
}
|
|
46054
46058
|
return;
|
|
46055
46059
|
}
|
|
46056
|
-
if (!0 === (null === (
|
|
46060
|
+
if (!0 === (null === (_r = table.options.keyboardOptions) || void 0 === _r ? void 0 : _r.moveFocusCellOnEnter)) {
|
|
46057
46061
|
const targetCol = stateManager.select.cellPos.col,
|
|
46058
46062
|
targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
46059
46063
|
if (isCellDisableSelect(table, targetCol, targetRow)) return;
|
|
46060
46064
|
table.selectCell(targetCol, targetRow, e.shiftKey);
|
|
46061
|
-
} else if ((null === (
|
|
46065
|
+
} else if ((null === (_t = null === (_s = table.options.keyboardOptions) || void 0 === _s ? void 0 : _s.editCellOnEnter) || void 0 === _t || _t) && 1 === (null !== (_v = null === (_u = table.stateManager.select.ranges) || void 0 === _u ? void 0 : _u.length) && void 0 !== _v ? _v : 0)) {
|
|
46062
46066
|
const startCol = table.stateManager.select.ranges[0].start.col,
|
|
46063
46067
|
startRow = table.stateManager.select.ranges[0].start.row,
|
|
46064
46068
|
endCol = table.stateManager.select.ranges[0].end.col,
|
|
46065
46069
|
endRow = table.stateManager.select.ranges[0].end.row;
|
|
46066
|
-
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && table.editorManager.startEditCell(startCol, startRow);
|
|
46070
|
+
startCol === endCol && startRow === endRow && table.getEditor(startCol, startRow) && (null === (_w = table.editorManager) || void 0 === _w || _w.startEditCell(startCol, startRow));
|
|
46067
46071
|
}
|
|
46068
46072
|
} else if ("Tab" === e.key) {
|
|
46069
|
-
if ((null === (
|
|
46073
|
+
if ((null === (_y = null === (_x = table.options.keyboardOptions) || void 0 === _x ? void 0 : _x.moveFocusCellOnTab) || void 0 === _y || _y) && stateManager.select.cellPos.col >= 0 && stateManager.select.cellPos.row >= 0) {
|
|
46070
46074
|
if (stateManager.select.cellPos.col === table.colCount - 1 && stateManager.select.cellPos.row === table.rowCount - 1) return;
|
|
46071
46075
|
let targetCol, targetRow;
|
|
46072
46076
|
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;
|
|
46073
|
-
table.selectCell(targetCol, targetRow), (null === (
|
|
46077
|
+
table.selectCell(targetCol, targetRow), (null === (_z = table.editorManager) || void 0 === _z ? void 0 : _z.editingEditor) && (null === (_0 = table.editorManager) || void 0 === _0 || _0.completeEdit(), table.getElement().focus(), table.getEditor(targetCol, targetRow) && (null === (_1 = table.editorManager) || void 0 === _1 || _1.startEditCell(targetCol, targetRow)));
|
|
46074
46078
|
}
|
|
46075
46079
|
} else if (!e.ctrlKey && !e.metaKey) {
|
|
46076
46080
|
const editCellTrigger = table.options.editCellTrigger;
|
|
46077
|
-
if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (
|
|
46081
|
+
if (("keydown" === editCellTrigger || Array.isArray(editCellTrigger) && editCellTrigger.includes("keydown")) && !(null === (_2 = table.editorManager) || void 0 === _2 ? void 0 : _2.editingEditor)) {
|
|
46078
46082
|
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
46079
|
-
e.key.match(allowedKeys) && (table.editorManager.beginTriggerEditCellMode = "keydown", table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, ""));
|
|
46083
|
+
e.key.match(allowedKeys) && (table.editorManager && (table.editorManager.beginTriggerEditCellMode = "keydown"), null === (_3 = table.editorManager) || void 0 === _3 || _3.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, ""));
|
|
46080
46084
|
}
|
|
46081
46085
|
}
|
|
46082
46086
|
handleKeydownListener(e);
|
|
@@ -46137,7 +46141,14 @@
|
|
|
46137
46141
|
values.push(rowValues), cells.forEach(function (cell, cellIndex) {
|
|
46138
46142
|
cellIndex === cells.length - 1 && (cell = cell.trim()), rowValues.push(cell);
|
|
46139
46143
|
});
|
|
46140
|
-
})
|
|
46144
|
+
});
|
|
46145
|
+
const changedCellResults = table.changeCellValues(col, row, values);
|
|
46146
|
+
table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA) && table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
46147
|
+
col: col,
|
|
46148
|
+
row: row,
|
|
46149
|
+
pasteData: values,
|
|
46150
|
+
changedCellResults: changedCellResults
|
|
46151
|
+
});
|
|
46141
46152
|
}
|
|
46142
46153
|
}
|
|
46143
46154
|
}), handler.on(table.getElement(), "contextmenu", e => {
|
|
@@ -46169,7 +46180,14 @@
|
|
|
46169
46180
|
rowValues = Array.from(rowContent.matchAll(cellRegex)).map(cellMatch => cellMatch[1].replace(/(<(?!br)([^>]+)>)/gi, "").replace(/<br(\s*|\/)>[\r\n]?/gim, "\n").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/	/gi, "\t").replace(/ /g, " "));
|
|
46170
46181
|
values.push(rowValues), pasteValuesColCount = Math.max(pasteValuesColCount, null !== (_a = null == rowValues ? void 0 : rowValues.length) && void 0 !== _a ? _a : 0);
|
|
46171
46182
|
}
|
|
46172
|
-
pasteValuesRowCount = null !== (_b = values.length) && void 0 !== _b ? _b : 0, values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1)
|
|
46183
|
+
pasteValuesRowCount = null !== (_b = values.length) && void 0 !== _b ? _b : 0, values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
|
|
46184
|
+
const changedCellResults = table.changeCellValues(col, row, values, !0);
|
|
46185
|
+
table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA) && table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
46186
|
+
col: col,
|
|
46187
|
+
row: row,
|
|
46188
|
+
pasteData: values,
|
|
46189
|
+
changedCellResults: changedCellResults
|
|
46190
|
+
});
|
|
46173
46191
|
} else navigator.clipboard.read().then(clipboardItems => {
|
|
46174
46192
|
for (const item of clipboardItems) item.types.includes("text/plain") && item.getType("text/plain").then(blob => {
|
|
46175
46193
|
blob.text().then(_pasteValue);
|
|
@@ -46196,7 +46214,14 @@
|
|
|
46196
46214
|
values.push(rowValues), cells.forEach(function (cell, cellIndex) {
|
|
46197
46215
|
cellIndex === cells.length - 1 && (cell = cell.trim()), rowValues.push(cell);
|
|
46198
46216
|
}), pasteValuesColCount = Math.max(pasteValuesColCount, null !== (_a = null == rowValues ? void 0 : rowValues.length) && void 0 !== _a ? _a : 0);
|
|
46199
|
-
}), pasteValuesRowCount = null !== (_a = values.length) && void 0 !== _a ? _a : 0, values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1)
|
|
46217
|
+
}), pasteValuesRowCount = null !== (_a = values.length) && void 0 !== _a ? _a : 0, values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
|
|
46218
|
+
const changedCellResults = table.changeCellValues(col, row, values, !0);
|
|
46219
|
+
table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA) && table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
46220
|
+
col: col,
|
|
46221
|
+
row: row,
|
|
46222
|
+
pasteData: values,
|
|
46223
|
+
changedCellResults: changedCellResults
|
|
46224
|
+
});
|
|
46200
46225
|
}
|
|
46201
46226
|
function pasteTextToTable(item) {
|
|
46202
46227
|
const ranges = table.stateManager.select.ranges,
|
|
@@ -46219,7 +46244,14 @@
|
|
|
46219
46244
|
values.push(rowValues), cells.forEach(function (cell, cellIndex) {
|
|
46220
46245
|
cell.includes("\n") && (cell = cell.replace(/^"(.*)"$/, "$1").replace(/["]*/g, match => new Array(Math.floor(match.length / 2)).fill('"').join(""))), rowValues.push(cell);
|
|
46221
46246
|
}), pasteValuesColCount = Math.max(pasteValuesColCount, null !== (_a = null == rowValues ? void 0 : rowValues.length) && void 0 !== _a ? _a : 0);
|
|
46222
|
-
}), pasteValuesRowCount = null !== (_a = values.length) && void 0 !== _a ? _a : 0, values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1)
|
|
46247
|
+
}), pasteValuesRowCount = null !== (_a = values.length) && void 0 !== _a ? _a : 0, values = handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
|
|
46248
|
+
const changedCellResults = table.changeCellValues(col, row, values, !0);
|
|
46249
|
+
table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA) && table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
46250
|
+
col: col,
|
|
46251
|
+
row: row,
|
|
46252
|
+
pasteData: values,
|
|
46253
|
+
changedCellResults: changedCellResults
|
|
46254
|
+
});
|
|
46223
46255
|
});
|
|
46224
46256
|
});
|
|
46225
46257
|
}
|
|
@@ -46267,7 +46299,7 @@
|
|
|
46267
46299
|
callback: globalPointerdownCallback
|
|
46268
46300
|
}), vglobal.addEventListener("pointerdown", globalPointerdownCallback);
|
|
46269
46301
|
const globalPointerupCallback = e => {
|
|
46270
|
-
var _a;
|
|
46302
|
+
var _a, _b;
|
|
46271
46303
|
if (table.isReleased) return;
|
|
46272
46304
|
const target = e.target;
|
|
46273
46305
|
if (target !== table.canvas && (e => {
|
|
@@ -46295,8 +46327,8 @@
|
|
|
46295
46327
|
})(e), table.eventManager.LastBodyPointerXY = null, table.eventManager.isDown = !1, table.eventManager.isDraging = !1, table.eventManager.inertiaScroll.endInertia(), "grabing" === stateManager.interactionState && stateManager.isResizeCol()) endResizeCol(table);else if ("grabing" === stateManager.interactionState && stateManager.isResizeRow()) endResizeRow(table);else if (stateManager.isMoveCol()) {
|
|
46296
46328
|
const endMoveColSuccess = table.stateManager.endMoveCol();
|
|
46297
46329
|
fireMoveColEventListeners(table, endMoveColSuccess, e);
|
|
46298
|
-
} else if (table.editorManager.editingEditor && !table.getElement().contains(target)) {
|
|
46299
|
-
const isCompleteEdit = null === (
|
|
46330
|
+
} else if ((null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.editingEditor) && !table.getElement().contains(target)) {
|
|
46331
|
+
const isCompleteEdit = null === (_b = table.editorManager) || void 0 === _b ? void 0 : _b.completeEdit(e);
|
|
46300
46332
|
getPromiseValue(isCompleteEdit, isCompleteEdit => {
|
|
46301
46333
|
!1 !== isCompleteEdit && (stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover());
|
|
46302
46334
|
});
|
|
@@ -46521,49 +46553,77 @@
|
|
|
46521
46553
|
checked: checked,
|
|
46522
46554
|
field: field
|
|
46523
46555
|
} = args;
|
|
46524
|
-
if (
|
|
46556
|
+
if (!table.internalProps.layoutMap.isSeriesNumber(col, row) || !0 !== (null === (_a = table.internalProps.rowSeriesNumber) || void 0 === _a ? void 0 : _a.enableTreeCheckbox)) return;
|
|
46525
46557
|
if (table.isHeader(col, row)) return;
|
|
46526
46558
|
const record = table.getCellOriginRecord(col, row),
|
|
46527
46559
|
indexedData = table.dataSource.currentPagerIndexedData,
|
|
46528
46560
|
titleShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
46529
46561
|
let titleIndex = indexedData[titleShowIndex];
|
|
46530
46562
|
if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge || (null === (_b = record.children) || void 0 === _b ? void 0 : _b.length)) {
|
|
46531
|
-
if (checked) getHierarchyState(table, col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!0, titleIndex, table) : setAllChildrenCheckboxState(!0, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);else {
|
|
46532
|
-
getHierarchyState(table, col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!1, titleIndex, table) : setAllChildrenCheckboxState(!1, titleShowIndex, titleIndex, indexedData, table), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
|
|
46563
|
+
if (checked) getHierarchyState(table, col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!0, titleIndex, table, field) : setAllChildrenCheckboxState(!0, titleShowIndex, titleIndex, indexedData, table, col), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col);else {
|
|
46564
|
+
getHierarchyState(table, col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!1, titleIndex, table, field) : setAllChildrenCheckboxState(!1, titleShowIndex, titleIndex, indexedData, table, col), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col);
|
|
46533
46565
|
const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number,
|
|
46534
46566
|
newHeaderCheckedState = table.stateManager.updateHeaderCheckedState("_vtable_rowSeries_number", col, row);
|
|
46535
46567
|
oldHeaderCheckedState !== newHeaderCheckedState && table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
46536
46568
|
}
|
|
46537
|
-
} else updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
|
|
46569
|
+
} else updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col);
|
|
46538
46570
|
});
|
|
46539
46571
|
}
|
|
46540
|
-
function
|
|
46572
|
+
function bindGroupCheckboxTreeChange(table) {
|
|
46573
|
+
table.on("checkbox_state_change", args => {
|
|
46574
|
+
var _a;
|
|
46575
|
+
const {
|
|
46576
|
+
col: col,
|
|
46577
|
+
row: row,
|
|
46578
|
+
checked: checked,
|
|
46579
|
+
field: field
|
|
46580
|
+
} = args,
|
|
46581
|
+
isCheckboxAndTree = table.internalProps.columns.some(column => column.tree);
|
|
46582
|
+
if (table.internalProps.enableCheckboxCascade, !isCheckboxAndTree) return;
|
|
46583
|
+
if (table.isHeader(col, row)) return;
|
|
46584
|
+
const record = table.getCellOriginRecord(col, row),
|
|
46585
|
+
indexedData = table.dataSource.currentPagerIndexedData,
|
|
46586
|
+
titleShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
46587
|
+
let titleIndex = indexedData[titleShowIndex];
|
|
46588
|
+
if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge || (null === (_a = record.children) || void 0 === _a ? void 0 : _a.length)) {
|
|
46589
|
+
if (checked) getHierarchyState(table, col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!0, titleIndex, table, field) : setAllChildrenCheckboxState(!0, titleShowIndex, titleIndex, indexedData, table, col, field), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field);else {
|
|
46590
|
+
getHierarchyState(table, col, row) === HierarchyState.collapse ? updateChildrenCheckboxState(!1, titleIndex, table, field) : setAllChildrenCheckboxState(!1, titleShowIndex, titleIndex, indexedData, table, col, field), updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field);
|
|
46591
|
+
const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number,
|
|
46592
|
+
newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(field, col, row);
|
|
46593
|
+
oldHeaderCheckedState !== newHeaderCheckedState && table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
46594
|
+
}
|
|
46595
|
+
} else updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field);
|
|
46596
|
+
});
|
|
46597
|
+
}
|
|
46598
|
+
function setAllChildrenCheckboxState(state, titleShowIndex, titleIndex, indexedData, table, col, field) {
|
|
46541
46599
|
var _a;
|
|
46600
|
+
const fieldName = field || "_vtable_rowSeries_number";
|
|
46542
46601
|
let i = titleShowIndex + 1;
|
|
46543
46602
|
for (; isArray$7(indexedData[i]) && (null === (_a = indexedData[i]) || void 0 === _a ? void 0 : _a.length) > titleIndex.length;) {
|
|
46544
46603
|
const row = table.columnHeaderLevelCount + i;
|
|
46545
|
-
table.stateManager.setCheckedState(
|
|
46604
|
+
table.stateManager.setCheckedState(col, row, fieldName, state), setCellCheckboxStateByAttribute(col, row, state, table), i++;
|
|
46546
46605
|
}
|
|
46547
46606
|
}
|
|
46548
|
-
function updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table) {
|
|
46607
|
+
function updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field) {
|
|
46549
46608
|
var _a;
|
|
46550
46609
|
let parentLength = titleIndex.length - 1;
|
|
46551
46610
|
if (parentLength > 0) {
|
|
46552
46611
|
let i = titleShowIndex - 1;
|
|
46553
46612
|
for (; parentLength > 0 && i >= 0;) {
|
|
46554
46613
|
if (isArray$7(indexedData[i]) && (null === (_a = indexedData[i]) || void 0 === _a ? void 0 : _a.length) === parentLength || 1 === parentLength && isNumber$4(indexedData[i])) {
|
|
46555
|
-
updateParentCheckboxState(
|
|
46614
|
+
updateParentCheckboxState(col, table.columnHeaderLevelCount + i, indexedData[i], table, field), parentLength--;
|
|
46556
46615
|
}
|
|
46557
46616
|
i--;
|
|
46558
46617
|
}
|
|
46559
46618
|
}
|
|
46560
46619
|
}
|
|
46561
|
-
function updateParentCheckboxState(col, row, currentIndex, table) {
|
|
46620
|
+
function updateParentCheckboxState(col, row, currentIndex, table, field) {
|
|
46562
46621
|
const {
|
|
46563
46622
|
checkedState: checkedState
|
|
46564
46623
|
} = table.stateManager,
|
|
46565
46624
|
key = currentIndex.toString(),
|
|
46566
|
-
|
|
46625
|
+
fieldName = field || "_vtable_rowSeries_number";
|
|
46626
|
+
isArray$7(currentIndex) && currentIndex.length;
|
|
46567
46627
|
let start = !1;
|
|
46568
46628
|
const result = [],
|
|
46569
46629
|
keys = Array.from(checkedState.keys()).sort((a, b) => {
|
|
@@ -46578,25 +46638,24 @@
|
|
|
46578
46638
|
}
|
|
46579
46639
|
return 0;
|
|
46580
46640
|
}),
|
|
46581
|
-
stateArr = keys.map(key => checkedState.get(key))
|
|
46641
|
+
stateArr = keys.map(key => checkedState.get(key)),
|
|
46642
|
+
childOfCurrentIndex = keys.filter(item => item.startsWith(key + ",") && item !== key);
|
|
46582
46643
|
if (stateArr.forEach((state, i) => {
|
|
46583
46644
|
const index = keys[i],
|
|
46584
|
-
value = state
|
|
46585
|
-
|
|
46586
|
-
|
|
46587
|
-
}
|
|
46588
|
-
index === key && (start = !0);
|
|
46645
|
+
value = state,
|
|
46646
|
+
isChildOfCurrentIndex = childOfCurrentIndex.includes(index);
|
|
46647
|
+
start && (isChildOfCurrentIndex ? result.push(value[fieldName]) : start = !1), index === key && (start = !0);
|
|
46589
46648
|
}), 0 === result.length) return;
|
|
46590
46649
|
const allChecked = result.every(item => !!item),
|
|
46591
46650
|
allUnChecked = result.every(item => !item);
|
|
46592
|
-
allChecked ? (table.stateManager.setCheckedState(col, row,
|
|
46651
|
+
allChecked ? (table.stateManager.setCheckedState(col, row, fieldName, !0), setCellCheckboxStateByAttribute(col, row, !0, table)) : allUnChecked ? (table.stateManager.setCheckedState(col, row, fieldName, !1), setCellCheckboxStateByAttribute(col, row, !1, table)) : (table.stateManager.setCheckedState(col, row, fieldName, "indeterminate"), setCellCheckboxStateByAttribute(col, row, "indeterminate", table));
|
|
46593
46652
|
}
|
|
46594
|
-
function updateChildrenCheckboxState(parentState, currentIndex, table) {
|
|
46653
|
+
function updateChildrenCheckboxState(parentState, currentIndex, table, field) {
|
|
46595
46654
|
const {
|
|
46596
46655
|
checkedState: checkedState
|
|
46597
46656
|
} = table.stateManager,
|
|
46598
|
-
key = currentIndex.toString()
|
|
46599
|
-
|
|
46657
|
+
key = currentIndex.toString();
|
|
46658
|
+
isArray$7(currentIndex) && currentIndex.length;
|
|
46600
46659
|
let start = !1;
|
|
46601
46660
|
const keys = Array.from(checkedState.keys()).sort((a, b) => {
|
|
46602
46661
|
var _a, _b;
|
|
@@ -46610,14 +46669,13 @@
|
|
|
46610
46669
|
}
|
|
46611
46670
|
return 0;
|
|
46612
46671
|
}),
|
|
46672
|
+
childrenOfKey = keys.filter(item => item.startsWith(key + ",") && item !== key),
|
|
46613
46673
|
stateArr = keys.map(key => checkedState.get(key));
|
|
46614
46674
|
stateArr.forEach((state, i) => {
|
|
46615
46675
|
const index = keys[i],
|
|
46616
|
-
value = state
|
|
46617
|
-
|
|
46618
|
-
|
|
46619
|
-
}
|
|
46620
|
-
index === key && (start = !0);
|
|
46676
|
+
value = state,
|
|
46677
|
+
shouldSelectChildren = 0 !== childrenOfKey.length && childrenOfKey.includes(index);
|
|
46678
|
+
start && (shouldSelectChildren ? value[field] = parentState : start = !1), index === key && (start = !0);
|
|
46621
46679
|
});
|
|
46622
46680
|
}
|
|
46623
46681
|
function bindHeaderCheckboxChange(table) {
|
|
@@ -46754,7 +46812,7 @@
|
|
|
46754
46812
|
}, 0);
|
|
46755
46813
|
}
|
|
46756
46814
|
bindSelfEvent() {
|
|
46757
|
-
this.table.isReleased || (bindIconClickEvent(this.table), bindDropdownMenuClickEvent(this.table), this.updateEventBinder(), bindMediaClick(this.table), bindDBClickAutoColumnWidthEvent(this.table), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table), bindHeaderCheckboxChange(this.table), bindButtonClickEvent(this.table), rightButtonClickEvent(this.table));
|
|
46815
|
+
this.table.isReleased || (bindIconClickEvent(this.table), bindDropdownMenuClickEvent(this.table), this.updateEventBinder(), bindMediaClick(this.table), bindDBClickAutoColumnWidthEvent(this.table), this.table.isPivotTable() && checkHaveDrill(this.table) && bindDrillEvent(this.table), bindSparklineHoverEvent(this.table), bindAxisClickEvent(this.table), bindAxisHoverEvent(this.table), bindGroupTitleCheckboxChange(this.table), bindGroupCheckboxTreeChange(this.table), bindHeaderCheckboxChange(this.table), bindButtonClickEvent(this.table), rightButtonClickEvent(this.table));
|
|
46758
46816
|
}
|
|
46759
46817
|
dealTableHover(eventArgsSet) {
|
|
46760
46818
|
if (!eventArgsSet) return void this.table.stateManager.updateHoverPos(-1, -1);
|
|
@@ -49575,7 +49633,7 @@
|
|
|
49575
49633
|
constructor(container) {
|
|
49576
49634
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
49577
49635
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
49578
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.18.4
|
|
49636
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.18.4", 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");
|
|
49579
49637
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
49580
49638
|
options: options,
|
|
49581
49639
|
container: container
|
|
@@ -49597,6 +49655,7 @@
|
|
|
49597
49655
|
keyboardOptions: keyboardOptions,
|
|
49598
49656
|
eventOptions: eventOptions,
|
|
49599
49657
|
rowSeriesNumber: rowSeriesNumber,
|
|
49658
|
+
enableCheckboxCascade: enableCheckboxCascade,
|
|
49600
49659
|
columnResizeMode: columnResizeMode,
|
|
49601
49660
|
rowResizeMode = "none",
|
|
49602
49661
|
resize: resize,
|
|
@@ -49628,7 +49687,7 @@
|
|
|
49628
49687
|
bottom: 0
|
|
49629
49688
|
}, padding && ("number" == typeof padding ? (this.padding.top = padding, this.padding.left = padding, this.padding.bottom = padding, this.padding.right = padding) : (padding.top && (this.padding.top = padding.top), padding.bottom && (this.padding.bottom = padding.bottom), padding.left && (this.padding.left = padding.left), padding.right && (this.padding.right = padding.right))), (isValid$3(canvasHeight) || isValid$3(canvasWidth)) && (this.canvasSizeSeted = !0), this.tableNoFrameWidth = 0, this.tableNoFrameHeight = 0, this.canvasWidth = isNumber$4(canvasWidth) ? canvasWidth : void 0, this.canvasHeight = isNumber$4(canvasHeight) ? canvasHeight : void 0, this.columnWidthComputeMode = null !== (_b = options.columnWidthComputeMode) && void 0 !== _b ? _b : "normal";
|
|
49630
49689
|
const internalProps = this.internalProps = {};
|
|
49631
|
-
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.columnResizeMode = null !== (_d = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _d ? _d : columnResizeMode, internalProps.rowResizeMode = null !== (_e = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _e ? _e : rowResizeMode, internalProps.dragHeaderMode = null !== (_g = null !== (_f = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _f ? _f : dragHeaderMode) && void 0 !== _g ? _g : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
49690
|
+
void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1), this.options.canvas ? ("node" !== Env.mode && (internalProps.element = this.options.canvas.parentElement, internalProps.element.style.position = "relative"), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding), internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"), internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"), (null === (_c = options.customConfig) || void 0 === _c ? void 0 : _c.createReactContainer) && createReactContainer(this)), internalProps.handler = new EventHandler(), isNumber$4(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime), internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount, internalProps.frozenRowCount = frozenRowCount, internalProps.unfreezeAllOnExceedsMaxWidth = null == unfreezeAllOnExceedsMaxWidth || unfreezeAllOnExceedsMaxWidth, internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight, internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth, internalProps.keyboardOptions = keyboardOptions, internalProps.eventOptions = eventOptions, internalProps.rowSeriesNumber = rowSeriesNumber, internalProps.enableCheckboxCascade = enableCheckboxCascade, internalProps.columnResizeMode = null !== (_d = null == resize ? void 0 : resize.columnResizeMode) && void 0 !== _d ? _d : columnResizeMode, internalProps.rowResizeMode = null !== (_e = null == resize ? void 0 : resize.rowResizeMode) && void 0 !== _e ? _e : rowResizeMode, internalProps.dragHeaderMode = null !== (_g = null !== (_f = null == dragOrder ? void 0 : dragOrder.dragHeaderMode) && void 0 !== _f ? _f : dragHeaderMode) && void 0 !== _g ? _g : "none", internalProps.renderChartAsync = renderChartAsync, setBatchRenderChartCount(renderChartAsyncBatchCount), internalProps.overscrollBehavior = null != overscrollBehavior ? overscrollBehavior : "auto", internalProps._rowHeightsMap = new NumberRangeMap(this), internalProps._rowRangeHeightsMap = new Map(), internalProps._colRangeWidthsMap = new Map(), internalProps._widthResizedColMap = new Set(), internalProps._heightResizedRowMap = new Set(), this.colWidthsMap = new NumberMap(), this.colContentWidthsMap = new NumberMap(), this.colWidthsLimit = {};
|
|
49632
49691
|
const that = this;
|
|
49633
49692
|
if (internalProps.calcWidthContext = {
|
|
49634
49693
|
_: internalProps,
|
|
@@ -50431,6 +50490,7 @@
|
|
|
50431
50490
|
keyboardOptions: keyboardOptions,
|
|
50432
50491
|
eventOptions: eventOptions,
|
|
50433
50492
|
rowSeriesNumber: rowSeriesNumber,
|
|
50493
|
+
enableCheckboxCascade: enableCheckboxCascade,
|
|
50434
50494
|
columnResizeMode: columnResizeMode,
|
|
50435
50495
|
rowResizeMode = "none",
|
|
50436
50496
|
resize: resize,
|
|
@@ -50460,7 +50520,7 @@
|
|
|
50460
50520
|
} = options;
|
|
50461
50521
|
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;
|
|
50462
50522
|
const internalProps = this.internalProps;
|
|
50463
|
-
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 => {
|
|
50523
|
+
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.enableCheckboxCascade = enableCheckboxCascade, 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 => {
|
|
50464
50524
|
null == legend || legend.release();
|
|
50465
50525
|
}), 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) {
|
|
50466
50526
|
internalProps.legends = [];
|
|
@@ -52964,7 +53024,7 @@
|
|
|
52964
53024
|
style: rowSeriesNumber.style,
|
|
52965
53025
|
width: rowSeriesNumber.width,
|
|
52966
53026
|
format: rowSeriesNumber.format,
|
|
52967
|
-
field:
|
|
53027
|
+
field: rowSeriesNumber.field,
|
|
52968
53028
|
icon: rowSeriesNumber.icon,
|
|
52969
53029
|
headerIcon: rowSeriesNumber.headerIcon,
|
|
52970
53030
|
isChildNode: !1
|
|
@@ -53867,6 +53927,7 @@
|
|
|
53867
53927
|
}
|
|
53868
53928
|
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
53869
53929
|
var _a, _b;
|
|
53930
|
+
const changedCellResults = [];
|
|
53870
53931
|
let pasteColEnd = startCol,
|
|
53871
53932
|
pasteRowEnd = startRow;
|
|
53872
53933
|
const beforeChangeValues = [],
|
|
@@ -53886,7 +53947,7 @@
|
|
|
53886
53947
|
}
|
|
53887
53948
|
}
|
|
53888
53949
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
53889
|
-
pasteRowEnd = startRow + i;
|
|
53950
|
+
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
53890
53951
|
const rowValues = values[i];
|
|
53891
53952
|
let thisRowPasteColEnd = startCol;
|
|
53892
53953
|
for (let j = 0; j < rowValues.length && !(startCol + j > table.colCount - 1); j++) {
|
|
@@ -53900,6 +53961,7 @@
|
|
|
53900
53961
|
isCanChange = !!isPromise(maybePromiseOrValue) || !0 === maybePromiseOrValue || "validate-exit" === maybePromiseOrValue || "invalidate-exit" === maybePromiseOrValue;
|
|
53901
53962
|
}
|
|
53902
53963
|
if (isCanChange) {
|
|
53964
|
+
changedCellResults[i][j] = !0;
|
|
53903
53965
|
const value = rowValues[j],
|
|
53904
53966
|
recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
53905
53967
|
{
|
|
@@ -53916,7 +53978,7 @@
|
|
|
53916
53978
|
currentValue: oldValue,
|
|
53917
53979
|
changedValue: changedValue
|
|
53918
53980
|
});
|
|
53919
|
-
}
|
|
53981
|
+
} else changedCellResults[i][j] = !1;
|
|
53920
53982
|
}
|
|
53921
53983
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
53922
53984
|
}
|
|
@@ -53933,7 +53995,7 @@
|
|
|
53933
53995
|
}
|
|
53934
53996
|
}
|
|
53935
53997
|
}
|
|
53936
|
-
if ("group" === cellUpdateType && table.dataSource.updateRecordsForGroup([], []), "sort" === cellUpdateType || "group" === cellUpdateType) return table.dataSource.sortedIndexMap.clear(), sortRecords(table), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(),
|
|
53998
|
+
if ("group" === cellUpdateType && table.dataSource.updateRecordsForGroup([], []), "sort" === cellUpdateType || "group" === cellUpdateType) return table.dataSource.sortedIndexMap.clear(), sortRecords(table), table.refreshRowColCount(), table.internalProps.layoutMap.clearCellRangeMap(), table.scenegraph.clearCells(), table.scenegraph.createSceneGraph(), changedCellResults;
|
|
53937
53999
|
for (let sCol = startRange.start.col; sCol <= range.end.col; sCol++) for (let sRow = startRange.start.row; sRow <= range.end.row; sRow++) table.scenegraph.updateCellContent(sCol, sRow);
|
|
53938
54000
|
if ("adaptive" === table.widthMode || table.autoFillWidth && table.getAllColsWidth() <= table.tableNoFrameWidth) 0 === table.internalProps._widthResizedColMap.size && table.scenegraph.recalculateColWidths();else for (let sCol = startCol; sCol <= range.end.col; sCol++) if (!table.internalProps._widthResizedColMap.has(sCol)) {
|
|
53939
54001
|
const oldWidth = table.getColWidth(sCol),
|
|
@@ -53950,7 +54012,7 @@
|
|
|
53950
54012
|
}
|
|
53951
54013
|
table.scenegraph.updateRowsHeight(rows, deltaYs);
|
|
53952
54014
|
}
|
|
53953
|
-
table.scenegraph.updateNextFrame();
|
|
54015
|
+
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
53954
54016
|
}
|
|
53955
54017
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
53956
54018
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
@@ -58064,7 +58126,84 @@
|
|
|
58064
58126
|
return cellGroup;
|
|
58065
58127
|
}
|
|
58066
58128
|
|
|
58067
|
-
|
|
58129
|
+
class CheckboxContent extends Group {
|
|
58130
|
+
constructor(params) {
|
|
58131
|
+
super(params), this._autoWidth = !1, this._autoHeight = !1, this._leftGroup = new Group({
|
|
58132
|
+
pickable: !1,
|
|
58133
|
+
fill: !1,
|
|
58134
|
+
stroke: !1
|
|
58135
|
+
}), this._leftGroup.role = "content-left", this._rightGroup = new Group({
|
|
58136
|
+
pickable: !1,
|
|
58137
|
+
fill: !1,
|
|
58138
|
+
stroke: !1
|
|
58139
|
+
}), this._rightGroup.role = "content-right", this._checkboxGroup = new Group({
|
|
58140
|
+
pickable: !1,
|
|
58141
|
+
fill: !1,
|
|
58142
|
+
stroke: !1
|
|
58143
|
+
}), this._checkboxGroup.role = "content-center", this.appendChild(this._leftGroup), this.appendChild(this._rightGroup), this.appendChild(this._checkboxGroup);
|
|
58144
|
+
}
|
|
58145
|
+
addLeftOccupyingIcon(icon) {
|
|
58146
|
+
var _a, _b, _c;
|
|
58147
|
+
icon.setAttribute("x", this._leftGroup.width + (null !== (_a = icon.attribute.marginLeft) && void 0 !== _a ? _a : 0)), this._leftGroup.appendChild(icon), this._leftGroup.setDeltaWidth((null !== (_b = icon.attribute.marginLeft) && void 0 !== _b ? _b : 0) + (null !== (_c = icon.attribute.marginRight) && void 0 !== _c ? _c : 0) + icon.attribute.width);
|
|
58148
|
+
}
|
|
58149
|
+
addRightOccupyingIcon(icon) {
|
|
58150
|
+
var _a, _b, _c;
|
|
58151
|
+
icon.setAttribute("x", this._rightGroup.width + (null !== (_a = icon.attribute.marginLeft) && void 0 !== _a ? _a : 0)), this._rightGroup.appendChild(icon), this._rightGroup.setDeltaWidth((null !== (_b = icon.attribute.marginLeft) && void 0 !== _b ? _b : 0) + (null !== (_c = icon.attribute.marginRight) && void 0 !== _c ? _c : 0) + icon.attribute.width);
|
|
58152
|
+
}
|
|
58153
|
+
addCheckbox(checkbox) {
|
|
58154
|
+
this._checkboxGroup.appendChild(checkbox);
|
|
58155
|
+
}
|
|
58156
|
+
setCheckboxContentOption(option) {
|
|
58157
|
+
this._autoWidth = option.autoWidth, this._autoHeight = option.autoHeight, this._cellWidth = option.cellWidth, this._originCellWidth = option.cellWidth, this._cellHeight = option.cellHeight, this._align = option.align, this._baseline = option.baseline;
|
|
58158
|
+
}
|
|
58159
|
+
layout() {
|
|
58160
|
+
let leftOccupyingWidth = this._leftGroup.width;
|
|
58161
|
+
leftOccupyingWidth === 1 / 0 && (leftOccupyingWidth = 0);
|
|
58162
|
+
let rightOccupyingWidth = this._rightGroup.width;
|
|
58163
|
+
if (rightOccupyingWidth === -1 / 0 && (rightOccupyingWidth = 0), this._autoWidth) {
|
|
58164
|
+
const checkboxWidth = this._checkboxGroup.width;
|
|
58165
|
+
this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + checkboxWidth, this.setAttribute("width", this._cellWidth);
|
|
58166
|
+
} else {
|
|
58167
|
+
const contentWidth = this._cellWidth - leftOccupyingWidth - rightOccupyingWidth;
|
|
58168
|
+
this.updateCenterLayout(contentWidth);
|
|
58169
|
+
const centerWidth = this._checkboxGroup.width;
|
|
58170
|
+
this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + centerWidth, this.setAttribute("width", this._cellWidth);
|
|
58171
|
+
}
|
|
58172
|
+
this.updateHorizontalPos();
|
|
58173
|
+
const leftOccupyingHeight = this._leftGroup.height,
|
|
58174
|
+
rightOccupyingHeight = this._rightGroup.height,
|
|
58175
|
+
centerHeight = this._checkboxGroup.height;
|
|
58176
|
+
this._cellHeight = Math.max(leftOccupyingHeight, rightOccupyingHeight, centerHeight), this.setAttribute("height", this._cellHeight), this.updateVerticalPos();
|
|
58177
|
+
}
|
|
58178
|
+
updateCenterLayout(contentWidth) {
|
|
58179
|
+
let checkboxWidth = contentWidth;
|
|
58180
|
+
this._checkboxGroup.forEachChildren(child => {
|
|
58181
|
+
child instanceof CheckBox && (checkboxWidth -= child.AABBBounds.width());
|
|
58182
|
+
});
|
|
58183
|
+
const checkbox = this._checkboxGroup.getChildByName("checkbox-content");
|
|
58184
|
+
checkbox instanceof CheckBox && checkbox.setAttribute("width", checkboxWidth);
|
|
58185
|
+
let x = 0;
|
|
58186
|
+
this._checkboxGroup.forEachChildren(child => {
|
|
58187
|
+
child.setAttribute("x", x), x += child.AABBBounds.width();
|
|
58188
|
+
});
|
|
58189
|
+
}
|
|
58190
|
+
updateHorizontalPos() {
|
|
58191
|
+
this._leftGroup.setAttribute("x", 0), this._rightGroup.setAttribute("x", this._cellWidth - this._rightGroup.width), this._checkboxGroup.setAttribute("x", 4), "left" === this._align || "start" === this._align ? this.setAttribute("dx", 0) : "center" === this._align ? this.setAttribute("dx", -this.attribute.width / 2) : "right" !== this._align && "end" !== this._align || this.setAttribute("dx", -this.attribute.width);
|
|
58192
|
+
}
|
|
58193
|
+
updateVerticalPos() {
|
|
58194
|
+
"top" === this._baseline ? (this._leftGroup.setAttribute("y", 0), this._rightGroup.setAttribute("y", 0), this._checkboxGroup.setAttribute("y", 0)) : "middle" === this._baseline ? (this._leftGroup.forEachChildren(icon => {
|
|
58195
|
+
icon.setAttribute("y", (this._leftGroup.height - icon.AABBBounds.height()) / 2);
|
|
58196
|
+
}), this._rightGroup.forEachChildren(icon => {
|
|
58197
|
+
icon.setAttribute("y", (this._rightGroup.height - icon.AABBBounds.height()) / 2);
|
|
58198
|
+
}), this._leftGroup.setAttribute("y", this._cellHeight / 2 - this._leftGroup.height / 2), this._rightGroup.setAttribute("y", this._cellHeight / 2 - this._rightGroup.height / 2), this._checkboxGroup.setAttribute("y", this._cellHeight / 2 - this._checkboxGroup.height / 2)) : "bottom" === this._baseline && (this._leftGroup.forEachChildren(icon => {
|
|
58199
|
+
icon.setAttribute("y", this._leftGroup.height - icon.AABBBounds.height());
|
|
58200
|
+
}), this._rightGroup.forEachChildren(icon => {
|
|
58201
|
+
icon.setAttribute("y", this._rightGroup.height - icon.AABBBounds.height());
|
|
58202
|
+
}), this._leftGroup.setAttribute("y", this._cellHeight - this._leftGroup.height), this._rightGroup.setAttribute("y", this._cellHeight - this._rightGroup.height), this._checkboxGroup.setAttribute("y", this._cellHeight - this._checkboxGroup.height));
|
|
58203
|
+
}
|
|
58204
|
+
}
|
|
58205
|
+
|
|
58206
|
+
function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, isCheckboxTree) {
|
|
58068
58207
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
58069
58208
|
if (!cellGroup) {
|
|
58070
58209
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
@@ -58107,25 +58246,62 @@
|
|
|
58107
58246
|
range && (iconCol = range.start.col, iconRow = range.start.row), icons = table.getCellIcons(iconCol, iconRow);
|
|
58108
58247
|
}
|
|
58109
58248
|
let iconWidth = 0,
|
|
58110
|
-
cellLeftIconWidth = 0
|
|
58249
|
+
cellLeftIconWidth = 0,
|
|
58250
|
+
cellRightIconWidth = 0,
|
|
58251
|
+
cellabsoluteRightIconWidth = 0,
|
|
58252
|
+
cellContentLeftIcons = [];
|
|
58111
58253
|
if (Array.isArray(icons) && 0 !== icons.length) {
|
|
58112
58254
|
const {
|
|
58113
58255
|
leftIconWidth: leftIconWidth,
|
|
58114
58256
|
rightIconWidth: rightIconWidth,
|
|
58257
|
+
contentLeftIcons: contentLeftIcons,
|
|
58258
|
+
contentRightIcons: contentRightIcons,
|
|
58115
58259
|
absoluteLeftIconWidth: absoluteLeftIconWidth,
|
|
58116
58260
|
absoluteRightIconWidth: absoluteRightIconWidth
|
|
58117
58261
|
} = dealWithIconLayout(icons, cellGroup, range, table);
|
|
58118
|
-
iconWidth = leftIconWidth + rightIconWidth, cellLeftIconWidth = leftIconWidth, cellGroup.forEachChildren(child => {
|
|
58262
|
+
iconWidth = leftIconWidth + rightIconWidth, cellLeftIconWidth = leftIconWidth, cellRightIconWidth = rightIconWidth, cellContentLeftIcons = contentLeftIcons, cellabsoluteRightIconWidth = absoluteRightIconWidth, cellGroup.forEachChildren(child => {
|
|
58119
58263
|
"icon-left" === child.role ? child.setAttribute("x", child.attribute.x + padding[3]) : "icon-right" === child.role ? child.setAttribute("x", child.attribute.x + width - rightIconWidth - padding[1]) : "icon-absolute-right" === child.role && child.setAttribute("x", child.attribute.x + width - absoluteRightIconWidth - padding[1]);
|
|
58120
58264
|
}), cellGroup.forEachChildren(child => {
|
|
58121
58265
|
"middle" === textBaseline ? child.setAttribute("y", (height - child.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", height - child.AABBBounds.height() - padding[2]) : child.setAttribute("y", padding[0]);
|
|
58122
58266
|
});
|
|
58123
58267
|
}
|
|
58124
|
-
const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
|
|
58125
|
-
|
|
58268
|
+
const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, isCheckboxTree);
|
|
58269
|
+
if (1 !== cellContentLeftIcons.length || cellContentLeftIcons[0].name !== InternalIconName.expandIconName && cellContentLeftIcons[0].name !== InternalIconName.collapseIconName) checkboxComponent && cellGroup.appendChild(checkboxComponent), checkboxComponent.render();else {
|
|
58270
|
+
const checkContent = new CheckboxContent({
|
|
58271
|
+
x: 0,
|
|
58272
|
+
y: 0,
|
|
58273
|
+
fill: !1,
|
|
58274
|
+
stroke: !1,
|
|
58275
|
+
pickable: !1
|
|
58276
|
+
});
|
|
58277
|
+
checkContent.name = "checkbox-content", checkContent.setCheckboxContentOption({
|
|
58278
|
+
autoWidth: !1,
|
|
58279
|
+
autoHeight: !1,
|
|
58280
|
+
cellWidth: width - (padding[1] + padding[3]),
|
|
58281
|
+
cellHeight: height - padding[0] - padding[2],
|
|
58282
|
+
align: textAlign,
|
|
58283
|
+
baseline: textBaseline
|
|
58284
|
+
});
|
|
58285
|
+
const dealWithIconComputeVar = {
|
|
58286
|
+
addedHierarchyOffset: 0
|
|
58287
|
+
};
|
|
58288
|
+
cellContentLeftIcons.forEach(icon => {
|
|
58289
|
+
const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, range, table, dealWithIconComputeVar);
|
|
58290
|
+
iconMark.role = "icon-content-left", iconMark.name = icon.name, checkContent.addLeftOccupyingIcon(iconMark);
|
|
58291
|
+
}), checkboxComponent && checkContent.addCheckbox(checkboxComponent), cellGroup.appendChild(checkContent), checkContent.layout();
|
|
58292
|
+
checkContent.AABBBounds.width(), checkContent.AABBBounds.height();
|
|
58293
|
+
const Awidth = width - (padding[1] + padding[3]),
|
|
58294
|
+
Aheight = height - (padding[0] + padding[2]);
|
|
58295
|
+
cellGroup.forEachChildren(child => {
|
|
58296
|
+
"icon-left" === child.role ? child.setAttribute("x", child.attribute.x + padding[3]) : "icon-right" === child.role ? child.setAttribute("x", child.attribute.x + Awidth - cellRightIconWidth + padding[3]) : "icon-absolute-right" === child.role ? child.setAttribute("x", child.attribute.x + Awidth - cellabsoluteRightIconWidth + padding[3] + padding[1]) : "content" !== child.name && "checkbox-content" !== child.name || ("center" === textAlign && "richtext" !== child.type ? child.setAttribute("x", padding[3] + cellLeftIconWidth + (Awidth - cellLeftIconWidth - cellRightIconWidth) / 2) : "right" === textAlign && "richtext" !== child.type ? child.setAttribute("x", padding[3] + Awidth - cellRightIconWidth) : child.setAttribute("x", padding[3] + cellLeftIconWidth));
|
|
58297
|
+
}), cellGroup.forEachChildren(child => {
|
|
58298
|
+
child.name !== CUSTOM_CONTAINER_NAME$1 && ("middle" === textBaseline ? (null == child ? void 0 : child._checkboxGroup) && child._leftGroup.setAttribute("y", padding[0] + (Aheight - child._checkboxGroup.AABBBounds.height()) / 2) : "bottom" === textBaseline ? child.setAttribute("y", padding[0] + Aheight - child.AABBBounds.height()) : child.setAttribute("y", padding[0]));
|
|
58299
|
+
});
|
|
58300
|
+
}
|
|
58301
|
+
return width -= padding[1] + padding[3] + iconWidth, height -= padding[0] + padding[2], "center" === textAlign ? checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth + (width - checkboxComponent.AABBBounds.width()) / 2) : "right" === textAlign ? checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth + width - checkboxComponent.AABBBounds.width()) : checkboxComponent.setAttribute("x", padding[3] + cellLeftIconWidth), "middle" === textBaseline ? checkboxComponent.setAttribute("y", padding[0] + (height - checkboxComponent.AABBBounds.height()) / 2) : "bottom" === textBaseline ? checkboxComponent.setAttribute("y", padding[0] + height - checkboxComponent.AABBBounds.height()) : checkboxComponent.setAttribute("y", padding[0]), cellGroup;
|
|
58126
58302
|
}
|
|
58127
|
-
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
|
|
58128
|
-
var _a, _b, _c, _d;
|
|
58303
|
+
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, isCheckboxTree) {
|
|
58304
|
+
var _a, _b, _c, _d, _e;
|
|
58129
58305
|
const style = table._getCellStyle(col, row),
|
|
58130
58306
|
size = getProp("size", style, col, row, table),
|
|
58131
58307
|
spaceBetweenTextAndIcon = getProp("spaceBetweenTextAndIcon", style, col, row, table),
|
|
@@ -58143,10 +58319,14 @@
|
|
|
58143
58319
|
let isChecked,
|
|
58144
58320
|
isDisabled,
|
|
58145
58321
|
text = null !== (_a = value) && void 0 !== _a ? _a : "";
|
|
58146
|
-
isObject$7(value) ? (isChecked = value.checked, isDisabled = value.disable, text = null !== (_b = value.text) && void 0 !== _b ? _b : "") : "boolean" == typeof value && (isChecked = value, text = ""),
|
|
58322
|
+
if (isObject$7(value) ? (isChecked = value.checked, isDisabled = value.disable, text = null !== (_b = value.text) && void 0 !== _b ? _b : "") : "boolean" == typeof value && (isChecked = value, text = ""), table.internalProps.layoutMap.isSeriesNumber(col, row)) {
|
|
58323
|
+
const checkboxSeriesNumberStyle = table.getFieldData(define.field, col, row);
|
|
58324
|
+
checkboxSeriesNumberStyle && (isChecked = checkboxSeriesNumberStyle.checked, isDisabled = checkboxSeriesNumberStyle.disable, text = null !== (_c = checkboxSeriesNumberStyle.text) && void 0 !== _c ? _c : "");
|
|
58325
|
+
}
|
|
58326
|
+
isChecked = table.stateManager.syncCheckedState(col, row, define.field, isChecked);
|
|
58147
58327
|
const hierarchyOffset = getHierarchyOffset(col, row, table),
|
|
58148
58328
|
cellStyle = table._getCellStyle(col, row),
|
|
58149
|
-
autoWrapText = null !== (
|
|
58329
|
+
autoWrapText = null !== (_d = cellStyle.autoWrapText) && void 0 !== _d ? _d : table.internalProps.autoWrapText,
|
|
58150
58330
|
{
|
|
58151
58331
|
lineClamp: lineClamp
|
|
58152
58332
|
} = cellStyle,
|
|
@@ -58185,7 +58365,7 @@
|
|
|
58185
58365
|
wordBreak: "break-word",
|
|
58186
58366
|
heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
|
|
58187
58367
|
pickable: !1,
|
|
58188
|
-
dx: hierarchyOffset,
|
|
58368
|
+
dx: isCheckboxTree ? 0 : hierarchyOffset,
|
|
58189
58369
|
whiteSpace: 1 !== text.length || autoWrapText ? "normal" : "no-wrap"
|
|
58190
58370
|
},
|
|
58191
58371
|
checkboxAttributes = {
|
|
@@ -58200,8 +58380,9 @@
|
|
|
58200
58380
|
width: size,
|
|
58201
58381
|
height: size
|
|
58202
58382
|
},
|
|
58383
|
+
dx: isCheckboxTree ? hierarchyOffset : 0,
|
|
58203
58384
|
spaceBetweenTextAndIcon: spaceBetweenTextAndIcon,
|
|
58204
|
-
disabled: null !== (
|
|
58385
|
+
disabled: null !== (_e = null != isDisabled ? isDisabled : globalDisable) && void 0 !== _e && _e
|
|
58205
58386
|
};
|
|
58206
58387
|
"indeterminate" === isChecked ? (checkboxAttributes.checked = void 0, checkboxAttributes.indeterminate = !0) : (checkboxAttributes.checked = isChecked, checkboxAttributes.indeterminate = void 0), defaultFill && (checkboxAttributes.box.fill = defaultFill), defaultStroke && (checkboxAttributes.box.stroke = defaultStroke), disableFill && (checkboxAttributes.box.disableFill = disableFill), checkedFill && (checkboxAttributes.box.checkedFill = checkedFill), checkedStroke && (checkboxAttributes.box.checkedStroke = checkedStroke), disableCheckedFill && (checkboxAttributes.box.disableCheckedFill = disableCheckedFill), disableCheckedStroke && (checkboxAttributes.box.disableCheckedStroke = disableCheckedStroke), checkIconImage && (checkboxAttributes.icon.checkIconImage = checkIconImage), indeterminateIconImage && (checkboxAttributes.icon.indeterminateIconImage = indeterminateIconImage);
|
|
58207
58388
|
const checkbox = new CheckBox(checkboxAttributes);
|