@visactor/vtable-calendar 1.18.4-alpha.1 → 1.18.5-alpha.0
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 +250 -68
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
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) {
|
|
@@ -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
|
}
|
|
@@ -46301,6 +46333,7 @@
|
|
|
46301
46333
|
!1 !== isCompleteEdit && (stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover());
|
|
46302
46334
|
});
|
|
46303
46335
|
}
|
|
46336
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
46304
46337
|
};
|
|
46305
46338
|
eventManager.globalEventListeners.push({
|
|
46306
46339
|
name: "pointerup",
|
|
@@ -46521,49 +46554,77 @@
|
|
|
46521
46554
|
checked: checked,
|
|
46522
46555
|
field: field
|
|
46523
46556
|
} = args;
|
|
46524
|
-
if (
|
|
46557
|
+
if (!table.internalProps.layoutMap.isSeriesNumber(col, row) || !0 !== (null === (_a = table.internalProps.rowSeriesNumber) || void 0 === _a ? void 0 : _a.enableTreeCheckbox)) return;
|
|
46525
46558
|
if (table.isHeader(col, row)) return;
|
|
46526
46559
|
const record = table.getCellOriginRecord(col, row),
|
|
46527
46560
|
indexedData = table.dataSource.currentPagerIndexedData,
|
|
46528
46561
|
titleShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
46529
46562
|
let titleIndex = indexedData[titleShowIndex];
|
|
46530
46563
|
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);
|
|
46564
|
+
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 {
|
|
46565
|
+
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
46566
|
const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number,
|
|
46534
46567
|
newHeaderCheckedState = table.stateManager.updateHeaderCheckedState("_vtable_rowSeries_number", col, row);
|
|
46535
46568
|
oldHeaderCheckedState !== newHeaderCheckedState && table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
46536
46569
|
}
|
|
46537
|
-
} else updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table);
|
|
46570
|
+
} else updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col);
|
|
46538
46571
|
});
|
|
46539
46572
|
}
|
|
46540
|
-
function
|
|
46573
|
+
function bindGroupCheckboxTreeChange(table) {
|
|
46574
|
+
table.on("checkbox_state_change", args => {
|
|
46575
|
+
var _a;
|
|
46576
|
+
const {
|
|
46577
|
+
col: col,
|
|
46578
|
+
row: row,
|
|
46579
|
+
checked: checked,
|
|
46580
|
+
field: field
|
|
46581
|
+
} = args,
|
|
46582
|
+
isCheckboxAndTree = table.internalProps.columns.some(column => column.tree);
|
|
46583
|
+
if (table.internalProps.enableCheckboxCascade, !isCheckboxAndTree) return;
|
|
46584
|
+
if (table.isHeader(col, row)) return;
|
|
46585
|
+
const record = table.getCellOriginRecord(col, row),
|
|
46586
|
+
indexedData = table.dataSource.currentPagerIndexedData,
|
|
46587
|
+
titleShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
46588
|
+
let titleIndex = indexedData[titleShowIndex];
|
|
46589
|
+
if (isNumber$4(titleIndex) && (titleIndex = [titleIndex]), record.vtableMerge || (null === (_a = record.children) || void 0 === _a ? void 0 : _a.length)) {
|
|
46590
|
+
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 {
|
|
46591
|
+
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);
|
|
46592
|
+
const oldHeaderCheckedState = table.stateManager.headerCheckedState._vtable_rowSeries_number,
|
|
46593
|
+
newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(field, col, row);
|
|
46594
|
+
oldHeaderCheckedState !== newHeaderCheckedState && table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
46595
|
+
}
|
|
46596
|
+
} else updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field);
|
|
46597
|
+
});
|
|
46598
|
+
}
|
|
46599
|
+
function setAllChildrenCheckboxState(state, titleShowIndex, titleIndex, indexedData, table, col, field) {
|
|
46541
46600
|
var _a;
|
|
46601
|
+
const fieldName = field || "_vtable_rowSeries_number";
|
|
46542
46602
|
let i = titleShowIndex + 1;
|
|
46543
46603
|
for (; isArray$7(indexedData[i]) && (null === (_a = indexedData[i]) || void 0 === _a ? void 0 : _a.length) > titleIndex.length;) {
|
|
46544
46604
|
const row = table.columnHeaderLevelCount + i;
|
|
46545
|
-
table.stateManager.setCheckedState(
|
|
46605
|
+
table.stateManager.setCheckedState(col, row, fieldName, state), setCellCheckboxStateByAttribute(col, row, state, table), i++;
|
|
46546
46606
|
}
|
|
46547
46607
|
}
|
|
46548
|
-
function updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table) {
|
|
46608
|
+
function updateGroupTitleCheckboxState(titleShowIndex, titleIndex, indexedData, table, col, field) {
|
|
46549
46609
|
var _a;
|
|
46550
46610
|
let parentLength = titleIndex.length - 1;
|
|
46551
46611
|
if (parentLength > 0) {
|
|
46552
46612
|
let i = titleShowIndex - 1;
|
|
46553
46613
|
for (; parentLength > 0 && i >= 0;) {
|
|
46554
46614
|
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(
|
|
46615
|
+
updateParentCheckboxState(col, table.columnHeaderLevelCount + i, indexedData[i], table, field), parentLength--;
|
|
46556
46616
|
}
|
|
46557
46617
|
i--;
|
|
46558
46618
|
}
|
|
46559
46619
|
}
|
|
46560
46620
|
}
|
|
46561
|
-
function updateParentCheckboxState(col, row, currentIndex, table) {
|
|
46621
|
+
function updateParentCheckboxState(col, row, currentIndex, table, field) {
|
|
46562
46622
|
const {
|
|
46563
46623
|
checkedState: checkedState
|
|
46564
46624
|
} = table.stateManager,
|
|
46565
46625
|
key = currentIndex.toString(),
|
|
46566
|
-
|
|
46626
|
+
fieldName = field || "_vtable_rowSeries_number";
|
|
46627
|
+
isArray$7(currentIndex) && currentIndex.length;
|
|
46567
46628
|
let start = !1;
|
|
46568
46629
|
const result = [],
|
|
46569
46630
|
keys = Array.from(checkedState.keys()).sort((a, b) => {
|
|
@@ -46578,25 +46639,24 @@
|
|
|
46578
46639
|
}
|
|
46579
46640
|
return 0;
|
|
46580
46641
|
}),
|
|
46581
|
-
stateArr = keys.map(key => checkedState.get(key))
|
|
46642
|
+
stateArr = keys.map(key => checkedState.get(key)),
|
|
46643
|
+
childOfCurrentIndex = keys.filter(item => item.startsWith(key + ",") && item !== key);
|
|
46582
46644
|
if (stateArr.forEach((state, i) => {
|
|
46583
46645
|
const index = keys[i],
|
|
46584
|
-
value = state
|
|
46585
|
-
|
|
46586
|
-
|
|
46587
|
-
}
|
|
46588
|
-
index === key && (start = !0);
|
|
46646
|
+
value = state,
|
|
46647
|
+
isChildOfCurrentIndex = childOfCurrentIndex.includes(index);
|
|
46648
|
+
start && (isChildOfCurrentIndex ? result.push(value[fieldName]) : start = !1), index === key && (start = !0);
|
|
46589
46649
|
}), 0 === result.length) return;
|
|
46590
46650
|
const allChecked = result.every(item => !!item),
|
|
46591
46651
|
allUnChecked = result.every(item => !item);
|
|
46592
|
-
allChecked ? (table.stateManager.setCheckedState(col, row,
|
|
46652
|
+
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
46653
|
}
|
|
46594
|
-
function updateChildrenCheckboxState(parentState, currentIndex, table) {
|
|
46654
|
+
function updateChildrenCheckboxState(parentState, currentIndex, table, field) {
|
|
46595
46655
|
const {
|
|
46596
46656
|
checkedState: checkedState
|
|
46597
46657
|
} = table.stateManager,
|
|
46598
|
-
key = currentIndex.toString()
|
|
46599
|
-
|
|
46658
|
+
key = currentIndex.toString();
|
|
46659
|
+
isArray$7(currentIndex) && currentIndex.length;
|
|
46600
46660
|
let start = !1;
|
|
46601
46661
|
const keys = Array.from(checkedState.keys()).sort((a, b) => {
|
|
46602
46662
|
var _a, _b;
|
|
@@ -46610,14 +46670,13 @@
|
|
|
46610
46670
|
}
|
|
46611
46671
|
return 0;
|
|
46612
46672
|
}),
|
|
46673
|
+
childrenOfKey = keys.filter(item => item.startsWith(key + ",") && item !== key),
|
|
46613
46674
|
stateArr = keys.map(key => checkedState.get(key));
|
|
46614
46675
|
stateArr.forEach((state, i) => {
|
|
46615
46676
|
const index = keys[i],
|
|
46616
|
-
value = state
|
|
46617
|
-
|
|
46618
|
-
|
|
46619
|
-
}
|
|
46620
|
-
index === key && (start = !0);
|
|
46677
|
+
value = state,
|
|
46678
|
+
shouldSelectChildren = 0 !== childrenOfKey.length && childrenOfKey.includes(index);
|
|
46679
|
+
start && (shouldSelectChildren ? value[field] = parentState : start = !1), index === key && (start = !0);
|
|
46621
46680
|
});
|
|
46622
46681
|
}
|
|
46623
46682
|
function bindHeaderCheckboxChange(table) {
|
|
@@ -46754,7 +46813,7 @@
|
|
|
46754
46813
|
}, 0);
|
|
46755
46814
|
}
|
|
46756
46815
|
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));
|
|
46816
|
+
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
46817
|
}
|
|
46759
46818
|
dealTableHover(eventArgsSet) {
|
|
46760
46819
|
if (!eventArgsSet) return void this.table.stateManager.updateHoverPos(-1, -1);
|
|
@@ -49575,7 +49634,7 @@
|
|
|
49575
49634
|
constructor(container) {
|
|
49576
49635
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
49577
49636
|
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.
|
|
49637
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.18.5-alpha.0", 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
49638
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
49580
49639
|
options: options,
|
|
49581
49640
|
container: container
|
|
@@ -49597,6 +49656,7 @@
|
|
|
49597
49656
|
keyboardOptions: keyboardOptions,
|
|
49598
49657
|
eventOptions: eventOptions,
|
|
49599
49658
|
rowSeriesNumber: rowSeriesNumber,
|
|
49659
|
+
enableCheckboxCascade: enableCheckboxCascade,
|
|
49600
49660
|
columnResizeMode: columnResizeMode,
|
|
49601
49661
|
rowResizeMode = "none",
|
|
49602
49662
|
resize: resize,
|
|
@@ -49628,7 +49688,7 @@
|
|
|
49628
49688
|
bottom: 0
|
|
49629
49689
|
}, 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
49690
|
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 = {};
|
|
49691
|
+
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
49692
|
const that = this;
|
|
49633
49693
|
if (internalProps.calcWidthContext = {
|
|
49634
49694
|
_: internalProps,
|
|
@@ -50431,6 +50491,7 @@
|
|
|
50431
50491
|
keyboardOptions: keyboardOptions,
|
|
50432
50492
|
eventOptions: eventOptions,
|
|
50433
50493
|
rowSeriesNumber: rowSeriesNumber,
|
|
50494
|
+
enableCheckboxCascade: enableCheckboxCascade,
|
|
50434
50495
|
columnResizeMode: columnResizeMode,
|
|
50435
50496
|
rowResizeMode = "none",
|
|
50436
50497
|
resize: resize,
|
|
@@ -50460,7 +50521,7 @@
|
|
|
50460
50521
|
} = options;
|
|
50461
50522
|
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
50523
|
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 => {
|
|
50524
|
+
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
50525
|
null == legend || legend.release();
|
|
50465
50526
|
}), 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
50527
|
internalProps.legends = [];
|
|
@@ -52964,7 +53025,7 @@
|
|
|
52964
53025
|
style: rowSeriesNumber.style,
|
|
52965
53026
|
width: rowSeriesNumber.width,
|
|
52966
53027
|
format: rowSeriesNumber.format,
|
|
52967
|
-
field:
|
|
53028
|
+
field: rowSeriesNumber.field,
|
|
52968
53029
|
icon: rowSeriesNumber.icon,
|
|
52969
53030
|
headerIcon: rowSeriesNumber.headerIcon,
|
|
52970
53031
|
isChildNode: !1
|
|
@@ -53867,6 +53928,7 @@
|
|
|
53867
53928
|
}
|
|
53868
53929
|
function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
53869
53930
|
var _a, _b;
|
|
53931
|
+
const changedCellResults = [];
|
|
53870
53932
|
let pasteColEnd = startCol,
|
|
53871
53933
|
pasteRowEnd = startRow;
|
|
53872
53934
|
const beforeChangeValues = [],
|
|
@@ -53886,7 +53948,7 @@
|
|
|
53886
53948
|
}
|
|
53887
53949
|
}
|
|
53888
53950
|
for (let i = 0; i < values.length && !(startRow + i > table.rowCount - 1); i++) {
|
|
53889
|
-
pasteRowEnd = startRow + i;
|
|
53951
|
+
changedCellResults[i] = [], pasteRowEnd = startRow + i;
|
|
53890
53952
|
const rowValues = values[i];
|
|
53891
53953
|
let thisRowPasteColEnd = startCol;
|
|
53892
53954
|
for (let j = 0; j < rowValues.length && !(startCol + j > table.colCount - 1); j++) {
|
|
@@ -53900,6 +53962,7 @@
|
|
|
53900
53962
|
isCanChange = !!isPromise(maybePromiseOrValue) || !0 === maybePromiseOrValue || "validate-exit" === maybePromiseOrValue || "invalidate-exit" === maybePromiseOrValue;
|
|
53901
53963
|
}
|
|
53902
53964
|
if (isCanChange) {
|
|
53965
|
+
changedCellResults[i][j] = !0;
|
|
53903
53966
|
const value = rowValues[j],
|
|
53904
53967
|
recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i),
|
|
53905
53968
|
{
|
|
@@ -53916,7 +53979,7 @@
|
|
|
53916
53979
|
currentValue: oldValue,
|
|
53917
53980
|
changedValue: changedValue
|
|
53918
53981
|
});
|
|
53919
|
-
}
|
|
53982
|
+
} else changedCellResults[i][j] = !1;
|
|
53920
53983
|
}
|
|
53921
53984
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
53922
53985
|
}
|
|
@@ -53933,7 +53996,7 @@
|
|
|
53933
53996
|
}
|
|
53934
53997
|
}
|
|
53935
53998
|
}
|
|
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(),
|
|
53999
|
+
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
54000
|
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
54001
|
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
54002
|
const oldWidth = table.getColWidth(sCol),
|
|
@@ -53950,7 +54013,7 @@
|
|
|
53950
54013
|
}
|
|
53951
54014
|
table.scenegraph.updateRowsHeight(rows, deltaYs);
|
|
53952
54015
|
}
|
|
53953
|
-
table.scenegraph.updateNextFrame();
|
|
54016
|
+
return table.scenegraph.updateNextFrame(), changedCellResults;
|
|
53954
54017
|
}
|
|
53955
54018
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
53956
54019
|
if ("group" === oldCellUpdateType) return oldCellUpdateType;
|
|
@@ -58064,7 +58127,84 @@
|
|
|
58064
58127
|
return cellGroup;
|
|
58065
58128
|
}
|
|
58066
58129
|
|
|
58067
|
-
|
|
58130
|
+
class CheckboxContent extends Group {
|
|
58131
|
+
constructor(params) {
|
|
58132
|
+
super(params), this._autoWidth = !1, this._autoHeight = !1, this._leftGroup = new Group({
|
|
58133
|
+
pickable: !1,
|
|
58134
|
+
fill: !1,
|
|
58135
|
+
stroke: !1
|
|
58136
|
+
}), this._leftGroup.role = "content-left", this._rightGroup = new Group({
|
|
58137
|
+
pickable: !1,
|
|
58138
|
+
fill: !1,
|
|
58139
|
+
stroke: !1
|
|
58140
|
+
}), this._rightGroup.role = "content-right", this._checkboxGroup = new Group({
|
|
58141
|
+
pickable: !1,
|
|
58142
|
+
fill: !1,
|
|
58143
|
+
stroke: !1
|
|
58144
|
+
}), this._checkboxGroup.role = "content-center", this.appendChild(this._leftGroup), this.appendChild(this._rightGroup), this.appendChild(this._checkboxGroup);
|
|
58145
|
+
}
|
|
58146
|
+
addLeftOccupyingIcon(icon) {
|
|
58147
|
+
var _a, _b, _c;
|
|
58148
|
+
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);
|
|
58149
|
+
}
|
|
58150
|
+
addRightOccupyingIcon(icon) {
|
|
58151
|
+
var _a, _b, _c;
|
|
58152
|
+
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);
|
|
58153
|
+
}
|
|
58154
|
+
addCheckbox(checkbox) {
|
|
58155
|
+
this._checkboxGroup.appendChild(checkbox);
|
|
58156
|
+
}
|
|
58157
|
+
setCheckboxContentOption(option) {
|
|
58158
|
+
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;
|
|
58159
|
+
}
|
|
58160
|
+
layout() {
|
|
58161
|
+
let leftOccupyingWidth = this._leftGroup.width;
|
|
58162
|
+
leftOccupyingWidth === 1 / 0 && (leftOccupyingWidth = 0);
|
|
58163
|
+
let rightOccupyingWidth = this._rightGroup.width;
|
|
58164
|
+
if (rightOccupyingWidth === -1 / 0 && (rightOccupyingWidth = 0), this._autoWidth) {
|
|
58165
|
+
const checkboxWidth = this._checkboxGroup.width;
|
|
58166
|
+
this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + checkboxWidth, this.setAttribute("width", this._cellWidth);
|
|
58167
|
+
} else {
|
|
58168
|
+
const contentWidth = this._cellWidth - leftOccupyingWidth - rightOccupyingWidth;
|
|
58169
|
+
this.updateCenterLayout(contentWidth);
|
|
58170
|
+
const centerWidth = this._checkboxGroup.width;
|
|
58171
|
+
this._cellWidth = leftOccupyingWidth + rightOccupyingWidth + centerWidth, this.setAttribute("width", this._cellWidth);
|
|
58172
|
+
}
|
|
58173
|
+
this.updateHorizontalPos();
|
|
58174
|
+
const leftOccupyingHeight = this._leftGroup.height,
|
|
58175
|
+
rightOccupyingHeight = this._rightGroup.height,
|
|
58176
|
+
centerHeight = this._checkboxGroup.height;
|
|
58177
|
+
this._cellHeight = Math.max(leftOccupyingHeight, rightOccupyingHeight, centerHeight), this.setAttribute("height", this._cellHeight), this.updateVerticalPos();
|
|
58178
|
+
}
|
|
58179
|
+
updateCenterLayout(contentWidth) {
|
|
58180
|
+
let checkboxWidth = contentWidth;
|
|
58181
|
+
this._checkboxGroup.forEachChildren(child => {
|
|
58182
|
+
child instanceof CheckBox && (checkboxWidth -= child.AABBBounds.width());
|
|
58183
|
+
});
|
|
58184
|
+
const checkbox = this._checkboxGroup.getChildByName("checkbox-content");
|
|
58185
|
+
checkbox instanceof CheckBox && checkbox.setAttribute("width", checkboxWidth);
|
|
58186
|
+
let x = 0;
|
|
58187
|
+
this._checkboxGroup.forEachChildren(child => {
|
|
58188
|
+
child.setAttribute("x", x), x += child.AABBBounds.width();
|
|
58189
|
+
});
|
|
58190
|
+
}
|
|
58191
|
+
updateHorizontalPos() {
|
|
58192
|
+
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);
|
|
58193
|
+
}
|
|
58194
|
+
updateVerticalPos() {
|
|
58195
|
+
"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 => {
|
|
58196
|
+
icon.setAttribute("y", (this._leftGroup.height - icon.AABBBounds.height()) / 2);
|
|
58197
|
+
}), this._rightGroup.forEachChildren(icon => {
|
|
58198
|
+
icon.setAttribute("y", (this._rightGroup.height - icon.AABBBounds.height()) / 2);
|
|
58199
|
+
}), 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 => {
|
|
58200
|
+
icon.setAttribute("y", this._leftGroup.height - icon.AABBBounds.height());
|
|
58201
|
+
}), this._rightGroup.forEachChildren(icon => {
|
|
58202
|
+
icon.setAttribute("y", this._rightGroup.height - icon.AABBBounds.height());
|
|
58203
|
+
}), 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));
|
|
58204
|
+
}
|
|
58205
|
+
}
|
|
58206
|
+
|
|
58207
|
+
function createCheckboxCellGroup(cellGroup, columnGroup, xOrigin, yOrigin, col, row, colWidth, width, height, padding, textAlign, textBaseline, mayHaveIcon, table, cellTheme, define, range, isAsync, isCheckboxTree) {
|
|
58068
58208
|
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
58209
|
if (!cellGroup) {
|
|
58070
58210
|
const strokeArrayWidth = getCellBorderStrokeWidth(col, row, cellTheme, table);
|
|
@@ -58107,25 +58247,62 @@
|
|
|
58107
58247
|
range && (iconCol = range.start.col, iconRow = range.start.row), icons = table.getCellIcons(iconCol, iconRow);
|
|
58108
58248
|
}
|
|
58109
58249
|
let iconWidth = 0,
|
|
58110
|
-
cellLeftIconWidth = 0
|
|
58250
|
+
cellLeftIconWidth = 0,
|
|
58251
|
+
cellRightIconWidth = 0,
|
|
58252
|
+
cellabsoluteRightIconWidth = 0,
|
|
58253
|
+
cellContentLeftIcons = [];
|
|
58111
58254
|
if (Array.isArray(icons) && 0 !== icons.length) {
|
|
58112
58255
|
const {
|
|
58113
58256
|
leftIconWidth: leftIconWidth,
|
|
58114
58257
|
rightIconWidth: rightIconWidth,
|
|
58258
|
+
contentLeftIcons: contentLeftIcons,
|
|
58259
|
+
contentRightIcons: contentRightIcons,
|
|
58115
58260
|
absoluteLeftIconWidth: absoluteLeftIconWidth,
|
|
58116
58261
|
absoluteRightIconWidth: absoluteRightIconWidth
|
|
58117
58262
|
} = dealWithIconLayout(icons, cellGroup, range, table);
|
|
58118
|
-
iconWidth = leftIconWidth + rightIconWidth, cellLeftIconWidth = leftIconWidth, cellGroup.forEachChildren(child => {
|
|
58263
|
+
iconWidth = leftIconWidth + rightIconWidth, cellLeftIconWidth = leftIconWidth, cellRightIconWidth = rightIconWidth, cellContentLeftIcons = contentLeftIcons, cellabsoluteRightIconWidth = absoluteRightIconWidth, cellGroup.forEachChildren(child => {
|
|
58119
58264
|
"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
58265
|
}), cellGroup.forEachChildren(child => {
|
|
58121
58266
|
"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
58267
|
});
|
|
58123
58268
|
}
|
|
58124
|
-
const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table);
|
|
58125
|
-
|
|
58269
|
+
const checkboxComponent = createCheckbox(col, row, colWidth - iconWidth, width, height, padding, cellTheme, define, table, isCheckboxTree);
|
|
58270
|
+
if (1 !== cellContentLeftIcons.length || cellContentLeftIcons[0].name !== InternalIconName.expandIconName && cellContentLeftIcons[0].name !== InternalIconName.collapseIconName) checkboxComponent && cellGroup.appendChild(checkboxComponent), checkboxComponent.render();else {
|
|
58271
|
+
const checkContent = new CheckboxContent({
|
|
58272
|
+
x: 0,
|
|
58273
|
+
y: 0,
|
|
58274
|
+
fill: !1,
|
|
58275
|
+
stroke: !1,
|
|
58276
|
+
pickable: !1
|
|
58277
|
+
});
|
|
58278
|
+
checkContent.name = "checkbox-content", checkContent.setCheckboxContentOption({
|
|
58279
|
+
autoWidth: !1,
|
|
58280
|
+
autoHeight: !1,
|
|
58281
|
+
cellWidth: width - (padding[1] + padding[3]),
|
|
58282
|
+
cellHeight: height - padding[0] - padding[2],
|
|
58283
|
+
align: textAlign,
|
|
58284
|
+
baseline: textBaseline
|
|
58285
|
+
});
|
|
58286
|
+
const dealWithIconComputeVar = {
|
|
58287
|
+
addedHierarchyOffset: 0
|
|
58288
|
+
};
|
|
58289
|
+
cellContentLeftIcons.forEach(icon => {
|
|
58290
|
+
const iconMark = dealWithIcon(icon, void 0, cellGroup.col, cellGroup.row, range, table, dealWithIconComputeVar);
|
|
58291
|
+
iconMark.role = "icon-content-left", iconMark.name = icon.name, checkContent.addLeftOccupyingIcon(iconMark);
|
|
58292
|
+
}), checkboxComponent && checkContent.addCheckbox(checkboxComponent), cellGroup.appendChild(checkContent), checkContent.layout();
|
|
58293
|
+
checkContent.AABBBounds.width(), checkContent.AABBBounds.height();
|
|
58294
|
+
const Awidth = width - (padding[1] + padding[3]),
|
|
58295
|
+
Aheight = height - (padding[0] + padding[2]);
|
|
58296
|
+
cellGroup.forEachChildren(child => {
|
|
58297
|
+
"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));
|
|
58298
|
+
}), cellGroup.forEachChildren(child => {
|
|
58299
|
+
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]));
|
|
58300
|
+
});
|
|
58301
|
+
}
|
|
58302
|
+
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
58303
|
}
|
|
58127
|
-
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table) {
|
|
58128
|
-
var _a, _b, _c, _d;
|
|
58304
|
+
function createCheckbox(col, row, colWidth, cellWidth, cellHeight, padding, cellTheme, define, table, isCheckboxTree) {
|
|
58305
|
+
var _a, _b, _c, _d, _e;
|
|
58129
58306
|
const style = table._getCellStyle(col, row),
|
|
58130
58307
|
size = getProp("size", style, col, row, table),
|
|
58131
58308
|
spaceBetweenTextAndIcon = getProp("spaceBetweenTextAndIcon", style, col, row, table),
|
|
@@ -58143,10 +58320,14 @@
|
|
|
58143
58320
|
let isChecked,
|
|
58144
58321
|
isDisabled,
|
|
58145
58322
|
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 = ""),
|
|
58323
|
+
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)) {
|
|
58324
|
+
const checkboxSeriesNumberStyle = table.getFieldData(define.field, col, row);
|
|
58325
|
+
checkboxSeriesNumberStyle && (isChecked = checkboxSeriesNumberStyle.checked, isDisabled = checkboxSeriesNumberStyle.disable, text = null !== (_c = checkboxSeriesNumberStyle.text) && void 0 !== _c ? _c : "");
|
|
58326
|
+
}
|
|
58327
|
+
isChecked = table.stateManager.syncCheckedState(col, row, define.field, isChecked);
|
|
58147
58328
|
const hierarchyOffset = getHierarchyOffset(col, row, table),
|
|
58148
58329
|
cellStyle = table._getCellStyle(col, row),
|
|
58149
|
-
autoWrapText = null !== (
|
|
58330
|
+
autoWrapText = null !== (_d = cellStyle.autoWrapText) && void 0 !== _d ? _d : table.internalProps.autoWrapText,
|
|
58150
58331
|
{
|
|
58151
58332
|
lineClamp: lineClamp
|
|
58152
58333
|
} = cellStyle,
|
|
@@ -58185,7 +58366,7 @@
|
|
|
58185
58366
|
wordBreak: "break-word",
|
|
58186
58367
|
heightLimit: autoRowHeight ? -1 : cellHeight - Math.floor(padding[0] + padding[2]),
|
|
58187
58368
|
pickable: !1,
|
|
58188
|
-
dx: hierarchyOffset,
|
|
58369
|
+
dx: isCheckboxTree ? 0 : hierarchyOffset,
|
|
58189
58370
|
whiteSpace: 1 !== text.length || autoWrapText ? "normal" : "no-wrap"
|
|
58190
58371
|
},
|
|
58191
58372
|
checkboxAttributes = {
|
|
@@ -58200,8 +58381,9 @@
|
|
|
58200
58381
|
width: size,
|
|
58201
58382
|
height: size
|
|
58202
58383
|
},
|
|
58384
|
+
dx: isCheckboxTree ? hierarchyOffset : 0,
|
|
58203
58385
|
spaceBetweenTextAndIcon: spaceBetweenTextAndIcon,
|
|
58204
|
-
disabled: null !== (
|
|
58386
|
+
disabled: null !== (_e = null != isDisabled ? isDisabled : globalDisable) && void 0 !== _e && _e
|
|
58205
58387
|
};
|
|
58206
58388
|
"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
58389
|
const checkbox = new CheckBox(checkboxAttributes);
|