@visactor/vtable 1.13.2-alpha.0 → 1.13.3-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/cjs/ListTable.d.ts +1 -1
- package/cjs/ListTable.js +5 -5
- package/cjs/ListTable.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset-pivot-table.js +2 -1
- package/cjs/edit/editors.js +1 -2
- package/cjs/event/listener/table-group.js +5 -5
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/icons.js +18 -0
- package/cjs/icons.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/layout-helper.js +1 -1
- package/cjs/layout/pivot-header-layout.js +1 -1
- package/cjs/layout/pivot-layout.js +2 -0
- package/cjs/layout/row-height-map.js +1 -1
- package/cjs/layout/simple-header-layout.js +1 -1
- package/cjs/layout/tree-helper.js +2 -2
- package/cjs/plugins/chartModules.js +1 -1
- package/cjs/plugins/custom-cell-style.js +1 -1
- package/cjs/plugins/icons.js +1 -1
- package/cjs/plugins/invert-highlight.js +1 -1
- package/cjs/plugins/list-tree-stick-cell.js +1 -1
- package/cjs/plugins/themes.js +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -2
- package/cjs/scenegraph/scenegraph.js +5 -3
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/state/checkbox/checkbox.js +82 -51
- package/cjs/state/checkbox/checkbox.js.map +1 -1
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js +6 -8
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +4 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +1 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +168 -98
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +1 -1
- package/es/ListTable.js +5 -5
- package/es/ListTable.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset-pivot-table.js +2 -1
- package/es/edit/editors.js +1 -2
- package/es/event/listener/table-group.js +4 -6
- package/es/event/listener/table-group.js.map +1 -1
- package/es/icons.js +18 -0
- package/es/icons.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/layout-helper.js +1 -1
- package/es/layout/pivot-header-layout.js +1 -1
- package/es/layout/pivot-layout.js +2 -0
- package/es/layout/row-height-map.js +1 -1
- package/es/layout/simple-header-layout.js +1 -1
- package/es/layout/tree-helper.js +1 -1
- package/es/plugins/chartModules.js +1 -1
- package/es/plugins/custom-cell-style.js +1 -1
- package/es/plugins/icons.js +1 -1
- package/es/plugins/invert-highlight.js +1 -1
- package/es/plugins/list-tree-stick-cell.js +1 -1
- package/es/plugins/themes.js +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -2
- package/es/scenegraph/scenegraph.js +4 -4
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/state/checkbox/checkbox.js +82 -52
- package/es/state/checkbox/checkbox.js.map +1 -1
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js +6 -8
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +4 -0
- package/es/themes/theme.js.map +1 -1
- package/es/ts-types/theme.d.ts +1 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +2 -2
package/dist/vtable.js
CHANGED
|
@@ -29323,8 +29323,6 @@
|
|
|
29323
29323
|
const DEFAULTBORDERLINEDASH = [];
|
|
29324
29324
|
const DEFAULTFONTCOLOR = '#000';
|
|
29325
29325
|
const regUrl = /^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
|
|
29326
|
-
const ResizeColumnHotSpotSize = 16;
|
|
29327
|
-
const ResizeRowHotSpotSize = 16;
|
|
29328
29326
|
const IndicatorDimensionKeyPlaceholder = '$$indicator$$';
|
|
29329
29327
|
const DrillDown = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>`;
|
|
29330
29328
|
const DrillUp = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>`;
|
|
@@ -29803,6 +29801,9 @@
|
|
|
29803
29801
|
get width() {
|
|
29804
29802
|
return columnResize.width ?? columnResize.lineWidth + 2;
|
|
29805
29803
|
},
|
|
29804
|
+
get resizeHotSpotSize() {
|
|
29805
|
+
return columnResize.resizeHotSpotSize ?? 16;
|
|
29806
|
+
},
|
|
29806
29807
|
get labelColor() {
|
|
29807
29808
|
return columnResize.labelColor ?? '#FFF';
|
|
29808
29809
|
},
|
|
@@ -35034,6 +35035,24 @@
|
|
|
35034
35035
|
cursor: 'pointer'
|
|
35035
35036
|
};
|
|
35036
35037
|
},
|
|
35038
|
+
get loading() {
|
|
35039
|
+
return {
|
|
35040
|
+
type: 'image',
|
|
35041
|
+
src: 'https://lf9-dp-fe-cms-tos.' + 'byt' + 'eorg.com/obj/bit-cloud/VTable/media/loading-circle.gif',
|
|
35042
|
+
width: collapse_size,
|
|
35043
|
+
height: collapse_size,
|
|
35044
|
+
name: 'loading',
|
|
35045
|
+
positionType: IconPosition.contentLeft,
|
|
35046
|
+
marginLeft: 0,
|
|
35047
|
+
marginRight: 4,
|
|
35048
|
+
hover: {
|
|
35049
|
+
width: collapse_size_2,
|
|
35050
|
+
height: collapse_size_2,
|
|
35051
|
+
bgColor: 'rgba(101, 117, 168, 0.1)'
|
|
35052
|
+
},
|
|
35053
|
+
isGif: true
|
|
35054
|
+
};
|
|
35055
|
+
},
|
|
35037
35056
|
get drillDown() {
|
|
35038
35057
|
return {
|
|
35039
35058
|
name: 'drillDown',
|
|
@@ -48375,7 +48394,8 @@
|
|
|
48375
48394
|
createFrameBorder(this.cornerHeaderGroup, this.isPivot ? this.table.theme.cornerHeaderStyle.frameStyle : this.table.theme.headerStyle.frameStyle, this.cornerHeaderGroup.role, isListTableWithFrozen ? [true, false, true, true] : undefined);
|
|
48376
48395
|
createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, undefined);
|
|
48377
48396
|
}
|
|
48378
|
-
getResizeColAt(abstractX, abstractY, cellGroup
|
|
48397
|
+
getResizeColAt(abstractX, abstractY, cellGroup) {
|
|
48398
|
+
const offset = this.table.theme.columnResize.resizeHotSpotSize / 2;
|
|
48379
48399
|
let cell;
|
|
48380
48400
|
if (!cellGroup) {
|
|
48381
48401
|
const drawRange = this.table.getDrawRange();
|
|
@@ -48412,7 +48432,8 @@
|
|
|
48412
48432
|
}
|
|
48413
48433
|
return { col: -1, row: -1 };
|
|
48414
48434
|
}
|
|
48415
|
-
getResizeRowAt(abstractX, abstractY, cellGroup
|
|
48435
|
+
getResizeRowAt(abstractX, abstractY, cellGroup) {
|
|
48436
|
+
const offset = this.table.theme.columnResize.resizeHotSpotSize / 2;
|
|
48416
48437
|
if (!cellGroup) ;
|
|
48417
48438
|
else {
|
|
48418
48439
|
let cell;
|
|
@@ -50094,13 +50115,14 @@
|
|
|
50094
50115
|
function setCheckedState(col, row, field, checked, state) {
|
|
50095
50116
|
const recordIndex = state.table.getRecordShowIndexByCell(col, row);
|
|
50096
50117
|
if (recordIndex >= 0) {
|
|
50097
|
-
const dataIndex = state.table.dataSource.getIndexKey(recordIndex);
|
|
50098
|
-
if (state.checkedState
|
|
50099
|
-
state.checkedState
|
|
50118
|
+
const dataIndex = state.table.dataSource.getIndexKey(recordIndex).toString();
|
|
50119
|
+
if (state.checkedState.has(dataIndex)) {
|
|
50120
|
+
state.checkedState.get(dataIndex)[field] = checked;
|
|
50100
50121
|
}
|
|
50101
50122
|
else {
|
|
50102
|
-
state.checkedState
|
|
50103
|
-
|
|
50123
|
+
state.checkedState.set(dataIndex, {
|
|
50124
|
+
[field]: checked
|
|
50125
|
+
});
|
|
50104
50126
|
}
|
|
50105
50127
|
}
|
|
50106
50128
|
}
|
|
@@ -50121,7 +50143,7 @@
|
|
|
50121
50143
|
else if (isValid$1(checked)) {
|
|
50122
50144
|
state.headerCheckedState[field] = checked;
|
|
50123
50145
|
}
|
|
50124
|
-
else if (state.checkedState?.
|
|
50146
|
+
else if (state.checkedState?.size > 0) {
|
|
50125
50147
|
const isAllChecked = state.updateHeaderCheckedState(field, col, row);
|
|
50126
50148
|
return isAllChecked;
|
|
50127
50149
|
}
|
|
@@ -50129,22 +50151,23 @@
|
|
|
50129
50151
|
}
|
|
50130
50152
|
const recordIndex = state.table.getRecordShowIndexByCell(col, row);
|
|
50131
50153
|
if (recordIndex >= 0) {
|
|
50132
|
-
const dataIndex = state.table.dataSource.getIndexKey(recordIndex);
|
|
50133
|
-
if (isValid$1(state.checkedState
|
|
50134
|
-
return state.checkedState
|
|
50154
|
+
const dataIndex = state.table.dataSource.getIndexKey(recordIndex).toString();
|
|
50155
|
+
if (isValid$1(state.checkedState.get(dataIndex)?.[field])) {
|
|
50156
|
+
return state.checkedState.get(dataIndex)[field];
|
|
50135
50157
|
}
|
|
50136
|
-
if (state.checkedState
|
|
50137
|
-
state.checkedState
|
|
50158
|
+
if (state.checkedState.has(dataIndex)) {
|
|
50159
|
+
state.checkedState.get(dataIndex)[field] = checked;
|
|
50138
50160
|
}
|
|
50139
50161
|
else {
|
|
50140
|
-
state.checkedState
|
|
50141
|
-
|
|
50162
|
+
state.checkedState.set(dataIndex, {
|
|
50163
|
+
[field]: checked
|
|
50164
|
+
});
|
|
50142
50165
|
}
|
|
50143
50166
|
}
|
|
50144
50167
|
return checked;
|
|
50145
50168
|
}
|
|
50146
50169
|
function initCheckedState(records, state) {
|
|
50147
|
-
state.checkedState
|
|
50170
|
+
state.checkedState.clear();
|
|
50148
50171
|
state.headerCheckedState = {};
|
|
50149
50172
|
state.radioState = {};
|
|
50150
50173
|
let isNeedInitHeaderCheckedStateFromRecord = false;
|
|
@@ -50180,70 +50203,46 @@
|
|
|
50180
50203
|
isNeedInitHeaderCheckedStateFromRecord = true;
|
|
50181
50204
|
}
|
|
50182
50205
|
if (isNeedInitHeaderCheckedStateFromRecord) {
|
|
50183
|
-
|
|
50184
|
-
state._checkboxCellTypeFields.forEach(field => {
|
|
50185
|
-
const value = record[field];
|
|
50186
|
-
let isChecked;
|
|
50187
|
-
if (isObject$4(value)) {
|
|
50188
|
-
isChecked = value.checked;
|
|
50189
|
-
}
|
|
50190
|
-
else if (typeof value === 'boolean') {
|
|
50191
|
-
isChecked = value;
|
|
50192
|
-
}
|
|
50193
|
-
if (isChecked === undefined || isChecked === null) {
|
|
50194
|
-
const headerCheckFunc = state._headerCheckFuncs[field];
|
|
50195
|
-
if (headerCheckFunc) {
|
|
50196
|
-
const cellAddr = state.table.getCellAddrByFieldRecord(field, index);
|
|
50197
|
-
const globalChecked = getOrApply(headerCheckFunc, {
|
|
50198
|
-
col: cellAddr.col,
|
|
50199
|
-
row: cellAddr.row,
|
|
50200
|
-
table: state.table,
|
|
50201
|
-
context: null,
|
|
50202
|
-
value
|
|
50203
|
-
});
|
|
50204
|
-
isChecked = globalChecked;
|
|
50205
|
-
}
|
|
50206
|
-
}
|
|
50207
|
-
if (!state.checkedState[index]) {
|
|
50208
|
-
state.checkedState[index] = {};
|
|
50209
|
-
}
|
|
50210
|
-
state.checkedState[index][field] = isChecked;
|
|
50211
|
-
});
|
|
50212
|
-
});
|
|
50206
|
+
initRecordCheckState(state);
|
|
50213
50207
|
}
|
|
50214
50208
|
}
|
|
50215
50209
|
function updateHeaderCheckedState(field, state, col, row) {
|
|
50216
|
-
|
|
50210
|
+
let allChecked = true;
|
|
50211
|
+
let allUnChecked = true;
|
|
50212
|
+
let hasChecked = false;
|
|
50213
|
+
state.checkedState.forEach((check_state, index) => {
|
|
50214
|
+
if (index.includes(',')) {
|
|
50215
|
+
index = index.split(',').map(item => {
|
|
50216
|
+
return Number(item);
|
|
50217
|
+
});
|
|
50218
|
+
}
|
|
50219
|
+
else {
|
|
50220
|
+
index = Number(index);
|
|
50221
|
+
}
|
|
50217
50222
|
const tableIndex = state.table.getTableIndexByRecordIndex(index);
|
|
50218
50223
|
const mergeCell = state.table.transpose
|
|
50219
50224
|
? state.table.getCustomMerge(tableIndex, row)
|
|
50220
50225
|
: state.table.getCustomMerge(col, tableIndex);
|
|
50221
|
-
|
|
50222
|
-
|
|
50226
|
+
const data = state.table.dataSource.get(index);
|
|
50227
|
+
if (mergeCell || data.vtableMerge) {
|
|
50228
|
+
return;
|
|
50229
|
+
}
|
|
50230
|
+
if (check_state?.[field] !== true) {
|
|
50231
|
+
allChecked = false;
|
|
50232
|
+
}
|
|
50233
|
+
else {
|
|
50234
|
+
allUnChecked = false;
|
|
50235
|
+
hasChecked = true;
|
|
50223
50236
|
}
|
|
50224
|
-
return check_state?.[field] === true;
|
|
50225
50237
|
});
|
|
50226
50238
|
if (allChecked) {
|
|
50227
50239
|
state.headerCheckedState[field] = true;
|
|
50228
50240
|
return allChecked;
|
|
50229
50241
|
}
|
|
50230
|
-
const allUnChecked = state.checkedState.every((check_state, index) => {
|
|
50231
|
-
const tableIndex = state.table.getTableIndexByRecordIndex(index);
|
|
50232
|
-
const mergeCell = state.table.transpose
|
|
50233
|
-
? state.table.getCustomMerge(tableIndex, row)
|
|
50234
|
-
: state.table.getCustomMerge(col, tableIndex);
|
|
50235
|
-
if (mergeCell) {
|
|
50236
|
-
return true;
|
|
50237
|
-
}
|
|
50238
|
-
return check_state?.[field] === false;
|
|
50239
|
-
});
|
|
50240
50242
|
if (allUnChecked) {
|
|
50241
50243
|
state.headerCheckedState[field] = false;
|
|
50242
50244
|
return false;
|
|
50243
50245
|
}
|
|
50244
|
-
const hasChecked = state.checkedState.find((check_state) => {
|
|
50245
|
-
return check_state?.[field] === true;
|
|
50246
|
-
});
|
|
50247
50246
|
if (hasChecked) {
|
|
50248
50247
|
state.headerCheckedState[field] = 'indeterminate';
|
|
50249
50248
|
return 'indeterminate';
|
|
@@ -50251,7 +50250,7 @@
|
|
|
50251
50250
|
return false;
|
|
50252
50251
|
}
|
|
50253
50252
|
function initLeftRecordsCheckState(records, state) {
|
|
50254
|
-
for (let index = state.checkedState.
|
|
50253
|
+
for (let index = state.checkedState.size; index < records.length; index++) {
|
|
50255
50254
|
const record = records[index];
|
|
50256
50255
|
state._checkboxCellTypeFields.forEach(field => {
|
|
50257
50256
|
const value = record[field];
|
|
@@ -50262,10 +50261,11 @@
|
|
|
50262
50261
|
else if (typeof value === 'boolean') {
|
|
50263
50262
|
isChecked = value;
|
|
50264
50263
|
}
|
|
50265
|
-
|
|
50266
|
-
|
|
50264
|
+
const dataIndex = index.toString();
|
|
50265
|
+
if (!state.checkedState.get(dataIndex)) {
|
|
50266
|
+
state.checkedState.set(dataIndex, {});
|
|
50267
50267
|
}
|
|
50268
|
-
state.checkedState[
|
|
50268
|
+
state.checkedState.get(dataIndex)[field] = isChecked;
|
|
50269
50269
|
});
|
|
50270
50270
|
}
|
|
50271
50271
|
}
|
|
@@ -50318,27 +50318,57 @@
|
|
|
50318
50318
|
}
|
|
50319
50319
|
function changeCheckboxOrder(sourceIndex, targetIndex, state) {
|
|
50320
50320
|
const { checkedState, table } = state;
|
|
50321
|
+
let source;
|
|
50322
|
+
let target;
|
|
50321
50323
|
if (table.internalProps.transpose) {
|
|
50322
50324
|
sourceIndex = table.getRecordShowIndexByCell(sourceIndex, 0);
|
|
50323
50325
|
targetIndex = table.getRecordShowIndexByCell(targetIndex, 0);
|
|
50324
50326
|
}
|
|
50325
50327
|
else {
|
|
50326
|
-
|
|
50327
|
-
|
|
50328
|
+
source = table.getRecordIndexByCell(0, sourceIndex);
|
|
50329
|
+
target = table.getRecordIndexByCell(0, targetIndex);
|
|
50328
50330
|
}
|
|
50329
|
-
if (
|
|
50330
|
-
|
|
50331
|
-
|
|
50332
|
-
|
|
50331
|
+
if (isNumber$2(source) && isNumber$2(target)) {
|
|
50332
|
+
if (sourceIndex > targetIndex) {
|
|
50333
|
+
const sourceRecord = checkedState.get(sourceIndex.toString());
|
|
50334
|
+
for (let i = sourceIndex; i > targetIndex; i--) {
|
|
50335
|
+
checkedState.set(i.toString(), checkedState.get((i - 1).toString()));
|
|
50336
|
+
}
|
|
50337
|
+
checkedState.set(targetIndex.toString(), sourceRecord);
|
|
50338
|
+
}
|
|
50339
|
+
else if (sourceIndex < targetIndex) {
|
|
50340
|
+
const sourceRecord = checkedState.get(sourceIndex.toString());
|
|
50341
|
+
for (let i = sourceIndex; i < targetIndex; i++) {
|
|
50342
|
+
checkedState.set(i.toString(), checkedState.get((i + 1).toString()));
|
|
50343
|
+
}
|
|
50344
|
+
checkedState.set(targetIndex.toString(), sourceRecord);
|
|
50333
50345
|
}
|
|
50334
|
-
checkedState[targetIndex] = sourceRecord;
|
|
50335
50346
|
}
|
|
50336
|
-
else if (
|
|
50337
|
-
|
|
50338
|
-
|
|
50339
|
-
|
|
50347
|
+
else if (isArray$1(source) && isArray$1(target)) {
|
|
50348
|
+
sourceIndex = source[source.length - 1];
|
|
50349
|
+
targetIndex = target[target.length - 1];
|
|
50350
|
+
if (sourceIndex > targetIndex) {
|
|
50351
|
+
const sourceRecord = checkedState.get(source.toString());
|
|
50352
|
+
for (let i = sourceIndex; i > targetIndex; i--) {
|
|
50353
|
+
const now = [...source];
|
|
50354
|
+
now[now.length - 1] = i;
|
|
50355
|
+
const last = [...source];
|
|
50356
|
+
last[last.length - 1] = i - 1;
|
|
50357
|
+
checkedState.set(now.toString(), checkedState.get(last.toString()));
|
|
50358
|
+
}
|
|
50359
|
+
checkedState.set(target.toString(), sourceRecord);
|
|
50360
|
+
}
|
|
50361
|
+
else if (sourceIndex < targetIndex) {
|
|
50362
|
+
const sourceRecord = checkedState.get(source.toString());
|
|
50363
|
+
for (let i = sourceIndex; i < targetIndex; i++) {
|
|
50364
|
+
const now = [...source];
|
|
50365
|
+
now[now.length - 1] = i;
|
|
50366
|
+
const next = [...source];
|
|
50367
|
+
next[next.length - 1] = i + 1;
|
|
50368
|
+
checkedState.set(now.toString(), checkedState.get(next.toString()));
|
|
50369
|
+
}
|
|
50370
|
+
checkedState.set(target.toString(), sourceRecord);
|
|
50340
50371
|
}
|
|
50341
|
-
checkedState[targetIndex] = sourceRecord;
|
|
50342
50372
|
}
|
|
50343
50373
|
}
|
|
50344
50374
|
function getGroupCheckboxState(table) {
|
|
@@ -50348,11 +50378,48 @@
|
|
|
50348
50378
|
dataSource.currentIndexedData.forEach((indexArr, index) => {
|
|
50349
50379
|
if (isArray$1(indexArr) && indexArr.length === groupKeyLength) {
|
|
50350
50380
|
const { vtableOriginIndex } = dataSource.getRawRecord(indexArr);
|
|
50351
|
-
result[vtableOriginIndex] = table.stateManager.checkedState
|
|
50381
|
+
result[vtableOriginIndex] = table.stateManager.checkedState.get(indexArr.toString());
|
|
50352
50382
|
}
|
|
50353
50383
|
});
|
|
50354
50384
|
return result;
|
|
50355
50385
|
}
|
|
50386
|
+
function initRecordCheckState(state) {
|
|
50387
|
+
const table = state.table;
|
|
50388
|
+
const start = table.internalProps.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount;
|
|
50389
|
+
const end = table.internalProps.transpose ? table.colCount : table.rowCount;
|
|
50390
|
+
for (let index = 0; index + start < end; index++) {
|
|
50391
|
+
const record = table.dataSource.get(index);
|
|
50392
|
+
state._checkboxCellTypeFields.forEach(field => {
|
|
50393
|
+
const value = record[field];
|
|
50394
|
+
let isChecked;
|
|
50395
|
+
if (isObject$4(value)) {
|
|
50396
|
+
isChecked = value.checked;
|
|
50397
|
+
}
|
|
50398
|
+
else if (typeof value === 'boolean') {
|
|
50399
|
+
isChecked = value;
|
|
50400
|
+
}
|
|
50401
|
+
if (isChecked === undefined || isChecked === null) {
|
|
50402
|
+
const headerCheckFunc = state._headerCheckFuncs[field];
|
|
50403
|
+
if (headerCheckFunc) {
|
|
50404
|
+
const cellAddr = state.table.getCellAddrByFieldRecord(field, index);
|
|
50405
|
+
const globalChecked = getOrApply(headerCheckFunc, {
|
|
50406
|
+
col: cellAddr.col,
|
|
50407
|
+
row: cellAddr.row,
|
|
50408
|
+
table: state.table,
|
|
50409
|
+
context: null,
|
|
50410
|
+
value
|
|
50411
|
+
});
|
|
50412
|
+
isChecked = globalChecked;
|
|
50413
|
+
}
|
|
50414
|
+
}
|
|
50415
|
+
const dataIndex = state.table.dataSource.getIndexKey(index).toString();
|
|
50416
|
+
if (!state.checkedState.get(dataIndex)) {
|
|
50417
|
+
state.checkedState.set(dataIndex, {});
|
|
50418
|
+
}
|
|
50419
|
+
state.checkedState.get(dataIndex)[field] = isChecked;
|
|
50420
|
+
});
|
|
50421
|
+
}
|
|
50422
|
+
}
|
|
50356
50423
|
|
|
50357
50424
|
function updateResizeRow(xInTable, yInTable, state) {
|
|
50358
50425
|
xInTable = Math.ceil(xInTable);
|
|
@@ -50517,7 +50584,7 @@
|
|
|
50517
50584
|
_clearVerticalScrollBar;
|
|
50518
50585
|
_clearHorizontalScrollBar;
|
|
50519
50586
|
fastScrolling = false;
|
|
50520
|
-
checkedState =
|
|
50587
|
+
checkedState = new Map();
|
|
50521
50588
|
headerCheckedState = {};
|
|
50522
50589
|
_checkboxCellTypeFields = [];
|
|
50523
50590
|
_headerCheckFuncs = {};
|
|
@@ -50956,9 +51023,6 @@
|
|
|
50956
51023
|
this.columnResize.x = x;
|
|
50957
51024
|
this.columnResize.isRightFrozen = isRightFrozen;
|
|
50958
51025
|
this.table.scenegraph.component.showResizeCol(col, y, isRightFrozen);
|
|
50959
|
-
const isHasSelected = !!this.select.ranges?.length;
|
|
50960
|
-
this.updateSelectPos(-1, -1);
|
|
50961
|
-
this.endSelectCells(true, isHasSelected);
|
|
50962
51026
|
this.table.scenegraph.updateNextFrame();
|
|
50963
51027
|
}
|
|
50964
51028
|
updateResizeCol(xInTable, yInTable) {
|
|
@@ -51553,7 +51617,7 @@
|
|
|
51553
51617
|
return syncRadioState(col, row, field, radioType, indexInCell, isChecked, this);
|
|
51554
51618
|
}
|
|
51555
51619
|
changeCheckboxAndRadioOrder(sourceIndex, targetIndex) {
|
|
51556
|
-
if (this.checkedState.
|
|
51620
|
+
if (this.checkedState.size) {
|
|
51557
51621
|
changeCheckboxOrder(sourceIndex, targetIndex, this);
|
|
51558
51622
|
}
|
|
51559
51623
|
if (this.radioState.length) {
|
|
@@ -51944,7 +52008,7 @@
|
|
|
51944
52008
|
if (stateManager.interactionState === InteractionState.grabing &&
|
|
51945
52009
|
!table.editorManager?.editingEditor) {
|
|
51946
52010
|
if (Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1) {
|
|
51947
|
-
if (stateManager.isResizeCol()) ;
|
|
52011
|
+
if (stateManager.isResizeCol() || stateManager.isResizeRow()) ;
|
|
51948
52012
|
else if (stateManager.isMoveCol()) {
|
|
51949
52013
|
eventManager.dealColumnMover(eventArgsSet);
|
|
51950
52014
|
}
|
|
@@ -52086,7 +52150,10 @@
|
|
|
52086
52150
|
}
|
|
52087
52151
|
});
|
|
52088
52152
|
table.scenegraph.tableGroup.addEventListener('pointerleave', (e) => {
|
|
52089
|
-
if (!stateManager.isResizeCol() &&
|
|
52153
|
+
if (!stateManager.isResizeCol() &&
|
|
52154
|
+
!stateManager.isResizeRow() &&
|
|
52155
|
+
!stateManager.isMoveCol() &&
|
|
52156
|
+
!stateManager.isSelecting()) {
|
|
52090
52157
|
stateManager.updateInteractionState(InteractionState.default);
|
|
52091
52158
|
stateManager.updateCursor();
|
|
52092
52159
|
}
|
|
@@ -52431,7 +52498,7 @@
|
|
|
52431
52498
|
stateManager.updateInteractionState(InteractionState.grabing);
|
|
52432
52499
|
const { eventArgs } = eventArgsSet;
|
|
52433
52500
|
if (!eventArgs?.targetCell) {
|
|
52434
|
-
const cell = table.getCellAt(eventArgsSet.abstractPos.x -
|
|
52501
|
+
const cell = table.getCellAt(eventArgsSet.abstractPos.x - table.theme.columnResize.resizeHotSpotSize / 2, eventArgsSet.abstractPos.y);
|
|
52435
52502
|
if (cell) {
|
|
52436
52503
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
|
|
52437
52504
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
|
|
@@ -52450,6 +52517,9 @@
|
|
|
52450
52517
|
if (stateManager.isResizeCol()) {
|
|
52451
52518
|
endResizeCol(table);
|
|
52452
52519
|
}
|
|
52520
|
+
else if (stateManager.isResizeRow()) {
|
|
52521
|
+
endResizeRow(table);
|
|
52522
|
+
}
|
|
52453
52523
|
}
|
|
52454
52524
|
});
|
|
52455
52525
|
table.scenegraph.stage.addEventListener('pointertap', (e) => {
|
|
@@ -58341,7 +58411,7 @@
|
|
|
58341
58411
|
return TABLE_EVENT_TYPE;
|
|
58342
58412
|
}
|
|
58343
58413
|
options;
|
|
58344
|
-
version = "1.13.
|
|
58414
|
+
version = "1.13.3-alpha.0";
|
|
58345
58415
|
pagination;
|
|
58346
58416
|
id = `VTable${Date.now()}`;
|
|
58347
58417
|
headerStyleCache;
|
|
@@ -64993,27 +65063,27 @@
|
|
|
64993
65063
|
this.scenegraph.createSceneGraph();
|
|
64994
65064
|
}
|
|
64995
65065
|
getCheckboxState(field) {
|
|
64996
|
-
if (this.stateManager.checkedState.
|
|
65066
|
+
if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount) {
|
|
64997
65067
|
this.stateManager.initLeftRecordsCheckState(this.records);
|
|
64998
65068
|
}
|
|
64999
65069
|
if (isValid$1(field)) {
|
|
65000
|
-
let stateArr = this.stateManager.checkedState;
|
|
65070
|
+
let stateArr = this.stateManager.checkedState.values();
|
|
65001
65071
|
if (this.options.groupBy) {
|
|
65002
65072
|
stateArr = getGroupCheckboxState(this);
|
|
65003
65073
|
}
|
|
65004
|
-
return stateArr.map(state => {
|
|
65074
|
+
return stateArr.map((state) => {
|
|
65005
65075
|
return state[field];
|
|
65006
65076
|
});
|
|
65007
65077
|
}
|
|
65008
|
-
return this.stateManager.checkedState;
|
|
65078
|
+
return new Array(...this.stateManager.checkedState.values());
|
|
65009
65079
|
}
|
|
65010
65080
|
getCellCheckboxState(col, row) {
|
|
65011
65081
|
const define = this.getBodyColumnDefine(col, row);
|
|
65012
65082
|
const field = define?.field;
|
|
65013
65083
|
const cellType = this.getCellType(col, row);
|
|
65014
65084
|
if (isValid$1(field) && cellType === 'checkbox') {
|
|
65015
|
-
const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row));
|
|
65016
|
-
return this.stateManager.checkedState
|
|
65085
|
+
const dataIndex = this.dataSource.getIndexKey(this.getRecordShowIndexByCell(col, row)).toString();
|
|
65086
|
+
return this.stateManager.checkedState.get(dataIndex)?.[field];
|
|
65017
65087
|
}
|
|
65018
65088
|
return undefined;
|
|
65019
65089
|
}
|
|
@@ -78815,7 +78885,7 @@
|
|
|
78815
78885
|
}
|
|
78816
78886
|
|
|
78817
78887
|
registerForVrender();
|
|
78818
|
-
const version = "1.13.
|
|
78888
|
+
const version = "1.13.3-alpha.0";
|
|
78819
78889
|
function getIcons() {
|
|
78820
78890
|
return get$2();
|
|
78821
78891
|
}
|