@visactor/vtable 1.22.10 → 1.22.11-alpha.1
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 +9 -3
- package/cjs/ListTable.js +35 -6
- package/cjs/ListTable.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/index.d.ts +1 -0
- package/cjs/core/index.js +30 -0
- package/cjs/core/index.js.map +1 -0
- package/cjs/core/record-helper.d.ts +7 -2
- package/cjs/core/record-helper.js +64 -24
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/dataset/DataStatistics.js +1 -2
- package/cjs/edit/editors.js +2 -1
- package/cjs/event/event.js +7 -1
- package/cjs/event/event.js.map +1 -1
- package/cjs/header-helper/style.js +1 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/index.js +2 -1
- package/cjs/plugins/index.js +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -2
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/events.d.ts +15 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +7 -2
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +107 -18
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +9 -3
- package/es/ListTable.js +35 -7
- package/es/ListTable.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
- package/es/core/TABLE_EVENT_TYPE.js +1 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/index.d.ts +1 -0
- package/es/core/index.js +2 -0
- package/es/core/index.js.map +1 -0
- package/es/core/record-helper.d.ts +7 -2
- package/es/core/record-helper.js +58 -20
- package/es/core/record-helper.js.map +1 -1
- package/es/dataset/DataStatistics.js +1 -2
- package/es/edit/editors.js +2 -1
- package/es/event/event.js +7 -1
- package/es/event/event.js.map +1 -1
- package/es/header-helper/style.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/index.js +2 -1
- package/es/plugins/index.js +1 -1
- package/es/ts-types/base-table.d.ts +2 -2
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/events.d.ts +15 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +7 -2
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +4 -4
package/dist/vtable.js
CHANGED
|
@@ -36410,6 +36410,7 @@
|
|
|
36410
36410
|
AFTER_UPDATE_CELL_CONTENT_WIDTH: 'after_update_cell_content_width',
|
|
36411
36411
|
AFTER_UPDATE_SELECT_BORDER_HEIGHT: 'after_update_select_border_height',
|
|
36412
36412
|
CHANGE_CELL_VALUE: 'change_cell_value',
|
|
36413
|
+
CHANGE_CELL_VALUES: 'change_cell_values',
|
|
36413
36414
|
DRAG_FILL_HANDLE_END: 'drag_fill_handle_end',
|
|
36414
36415
|
MOUSEDOWN_FILL_HANDLE: 'mousedown_fill_handle',
|
|
36415
36416
|
DBLCLICK_FILL_HANDLE: 'dblclick_fill_handle',
|
|
@@ -65576,7 +65577,7 @@
|
|
|
65576
65577
|
}
|
|
65577
65578
|
const shiftMultiSelect = this.table.keyboardOptions?.shiftMultiSelect ?? true;
|
|
65578
65579
|
const ctrlMultiSelect = this.table.keyboardOptions?.ctrlMultiSelect ?? true;
|
|
65579
|
-
this.table.stateManager.updateSelectPos(this.table.stateManager.select.selectInline === 'row' ? this.table.colCount - 1 : eventArgs.col, this.table.stateManager.select.selectInline === 'col' ? this.table.rowCount - 1 : eventArgs.row, eventArgs.event.shiftKey && shiftMultiSelect, (eventArgs.event.ctrlKey || eventArgs.event.metaKey) && ctrlMultiSelect, false, isSelectMoving ? false :
|
|
65580
|
+
this.table.stateManager.updateSelectPos(this.table.stateManager.select.selectInline === 'row' ? this.table.colCount - 1 : eventArgs.col, this.table.stateManager.select.selectInline === 'col' ? this.table.rowCount - 1 : eventArgs.row, eventArgs.event.shiftKey && shiftMultiSelect, (eventArgs.event.ctrlKey || eventArgs.event.metaKey) && ctrlMultiSelect, false, isSelectMoving ? false : this.table.options.select?.makeSelectCellVisible ?? true);
|
|
65580
65581
|
return true;
|
|
65581
65582
|
}
|
|
65582
65583
|
return false;
|
|
@@ -66113,13 +66114,19 @@
|
|
|
66113
66114
|
if (!selectCells || selectCells.length === 0) {
|
|
66114
66115
|
return;
|
|
66115
66116
|
}
|
|
66117
|
+
const changeValues = [];
|
|
66116
66118
|
for (let i = 0; i < selectCells.length; i++) {
|
|
66117
66119
|
for (let j = 0; j < selectCells[i].length; j++) {
|
|
66118
66120
|
if (selectCells[i][j]) {
|
|
66119
|
-
|
|
66121
|
+
changeValues.push({
|
|
66122
|
+
col: selectCells[i][j].col,
|
|
66123
|
+
row: selectCells[i][j].row,
|
|
66124
|
+
value: undefined
|
|
66125
|
+
});
|
|
66120
66126
|
}
|
|
66121
66127
|
}
|
|
66122
66128
|
}
|
|
66129
|
+
table.changeCellValuesByIds(changeValues);
|
|
66123
66130
|
}
|
|
66124
66131
|
catch (error) {
|
|
66125
66132
|
}
|
|
@@ -70169,7 +70176,7 @@
|
|
|
70169
70176
|
return TABLE_EVENT_TYPE;
|
|
70170
70177
|
}
|
|
70171
70178
|
options;
|
|
70172
|
-
version = "1.22.
|
|
70179
|
+
version = "1.22.11-alpha.1";
|
|
70173
70180
|
pagination;
|
|
70174
70181
|
id = `VTable${Date.now()}`;
|
|
70175
70182
|
headerStyleCache;
|
|
@@ -76206,9 +76213,10 @@
|
|
|
76206
76213
|
return { addRecordRule };
|
|
76207
76214
|
}
|
|
76208
76215
|
|
|
76209
|
-
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table) {
|
|
76216
|
+
function listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
76210
76217
|
if ((workOnEditableCell && table.isHasEditorDefine(col, row)) || workOnEditableCell === false) {
|
|
76211
|
-
const
|
|
76218
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
76219
|
+
const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
|
|
76212
76220
|
const { field } = table.internalProps.layoutMap.getBody(col, row);
|
|
76213
76221
|
const beforeChangeValue = table.getCellRawValue(col, row);
|
|
76214
76222
|
const oldValue = table.getCellOriginValue(col, row);
|
|
@@ -76216,7 +76224,7 @@
|
|
|
76216
76224
|
table.internalProps.layoutMap.updateColumnTitle(col, row, value);
|
|
76217
76225
|
}
|
|
76218
76226
|
else {
|
|
76219
|
-
table.dataSource.changeFieldValue(value,
|
|
76227
|
+
table.dataSource.changeFieldValue(value, recordShowIndex, field, col, row, table);
|
|
76220
76228
|
}
|
|
76221
76229
|
const range = table.getCellRange(col, row);
|
|
76222
76230
|
const aggregators = table.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
@@ -76269,18 +76277,24 @@
|
|
|
76269
76277
|
}
|
|
76270
76278
|
const changedValue = table.getCellOriginValue(col, row);
|
|
76271
76279
|
if (oldValue !== changedValue && triggerEvent) {
|
|
76272
|
-
|
|
76280
|
+
const changeValue = {
|
|
76273
76281
|
col,
|
|
76274
76282
|
row,
|
|
76283
|
+
recordIndex,
|
|
76284
|
+
field,
|
|
76275
76285
|
rawValue: beforeChangeValue,
|
|
76276
76286
|
currentValue: oldValue,
|
|
76277
76287
|
changedValue
|
|
76278
|
-
}
|
|
76288
|
+
};
|
|
76289
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
|
|
76290
|
+
if (!silentChangeCellValuesEvent) {
|
|
76291
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
|
|
76292
|
+
}
|
|
76279
76293
|
}
|
|
76280
76294
|
table.scenegraph.updateNextFrame();
|
|
76281
76295
|
}
|
|
76282
76296
|
}
|
|
76283
|
-
async function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table) {
|
|
76297
|
+
async function listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
76284
76298
|
const changedCellResults = [];
|
|
76285
76299
|
let pasteColEnd = startCol;
|
|
76286
76300
|
let pasteRowEnd = startRow;
|
|
@@ -76307,6 +76321,7 @@
|
|
|
76307
76321
|
oldRowValues.push(oldValue);
|
|
76308
76322
|
}
|
|
76309
76323
|
}
|
|
76324
|
+
const resultChangeValues = [];
|
|
76310
76325
|
for (let i = 0; i < values.length; i++) {
|
|
76311
76326
|
if (startRow + i > table.rowCount - 1) {
|
|
76312
76327
|
break;
|
|
@@ -76346,7 +76361,8 @@
|
|
|
76346
76361
|
if (isCanChange) {
|
|
76347
76362
|
changedCellResults[i][j] = true;
|
|
76348
76363
|
const value = rowValues[j];
|
|
76349
|
-
const
|
|
76364
|
+
const recordShowIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);
|
|
76365
|
+
const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
|
|
76350
76366
|
const { field } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i);
|
|
76351
76367
|
const beforeChangeValue = beforeChangeValues[i][j];
|
|
76352
76368
|
const oldValue = oldValues[i][j];
|
|
@@ -76354,17 +76370,21 @@
|
|
|
76354
76370
|
table.internalProps.layoutMap.updateColumnTitle(startCol + j, startRow + i, value);
|
|
76355
76371
|
}
|
|
76356
76372
|
else {
|
|
76357
|
-
table.dataSource.changeFieldValue(value,
|
|
76373
|
+
table.dataSource.changeFieldValue(value, recordShowIndex, field, startCol + j, startRow + i, table);
|
|
76358
76374
|
}
|
|
76359
76375
|
const changedValue = table.getCellOriginValue(startCol + j, startRow + i);
|
|
76360
76376
|
if (oldValue !== changedValue && triggerEvent) {
|
|
76361
|
-
|
|
76377
|
+
const changeValue = {
|
|
76362
76378
|
col: startCol + j,
|
|
76363
76379
|
row: startRow + i,
|
|
76380
|
+
recordIndex,
|
|
76381
|
+
field,
|
|
76364
76382
|
rawValue: beforeChangeValue,
|
|
76365
76383
|
currentValue: oldValue,
|
|
76366
76384
|
changedValue
|
|
76367
|
-
}
|
|
76385
|
+
};
|
|
76386
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
|
|
76387
|
+
resultChangeValues.push(changeValue);
|
|
76368
76388
|
}
|
|
76369
76389
|
}
|
|
76370
76390
|
else {
|
|
@@ -76373,6 +76393,9 @@
|
|
|
76373
76393
|
}
|
|
76374
76394
|
pasteColEnd = Math.max(pasteColEnd, thisRowPasteColEnd);
|
|
76375
76395
|
}
|
|
76396
|
+
if (!silentChangeCellValuesEvent) {
|
|
76397
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
|
|
76398
|
+
}
|
|
76376
76399
|
const startRange = table.getCellRange(startCol, startRow);
|
|
76377
76400
|
const range = table.getCellRange(pasteColEnd, pasteRowEnd);
|
|
76378
76401
|
const aggregators = table.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
@@ -76445,6 +76468,31 @@
|
|
|
76445
76468
|
table.scenegraph.updateNextFrame();
|
|
76446
76469
|
return changedCellResults;
|
|
76447
76470
|
}
|
|
76471
|
+
async function listTableChangeCellValuesByIds(changeValues, triggerEvent, table, silentChangeCellValuesEvent) {
|
|
76472
|
+
const resultChangeValues = [];
|
|
76473
|
+
for (let i = 0; i < changeValues.length; i++) {
|
|
76474
|
+
const { col, row, value } = changeValues[i];
|
|
76475
|
+
const recordShowIndex = table.getRecordShowIndexByCell(col, row);
|
|
76476
|
+
const recordIndex = recordShowIndex >= 0 ? table.dataSource.getIndexKey(recordShowIndex) : undefined;
|
|
76477
|
+
const { field } = table.internalProps.layoutMap.getBody(col, row);
|
|
76478
|
+
const oldValue = table.getCellOriginValue(col, row);
|
|
76479
|
+
listTableChangeCellValue(col, row, value, false, triggerEvent, table, true);
|
|
76480
|
+
if (oldValue !== value && triggerEvent) {
|
|
76481
|
+
resultChangeValues.push({
|
|
76482
|
+
col,
|
|
76483
|
+
row,
|
|
76484
|
+
recordIndex,
|
|
76485
|
+
field,
|
|
76486
|
+
rawValue: oldValue,
|
|
76487
|
+
currentValue: oldValue,
|
|
76488
|
+
changedValue: value
|
|
76489
|
+
});
|
|
76490
|
+
}
|
|
76491
|
+
}
|
|
76492
|
+
if (!silentChangeCellValuesEvent) {
|
|
76493
|
+
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: resultChangeValues });
|
|
76494
|
+
}
|
|
76495
|
+
}
|
|
76448
76496
|
function getCellUpdateType(col, row, table, oldCellUpdateType) {
|
|
76449
76497
|
if (oldCellUpdateType === 'group') {
|
|
76450
76498
|
return oldCellUpdateType;
|
|
@@ -78295,11 +78343,38 @@
|
|
|
78295
78343
|
}
|
|
78296
78344
|
return isValid$1(editorDefine);
|
|
78297
78345
|
}
|
|
78298
|
-
changeCellValue(col, row, value, workOnEditableCell = false, triggerEvent = true) {
|
|
78299
|
-
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this);
|
|
78346
|
+
changeCellValue(col, row, value, workOnEditableCell = false, triggerEvent = true, silentChangeCellValuesEvent) {
|
|
78347
|
+
return listTableChangeCellValue(col, row, value, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
78348
|
+
}
|
|
78349
|
+
changeCellValues(startCol, startRow, values, workOnEditableCell = false, triggerEvent = true, silentChangeCellValuesEvent) {
|
|
78350
|
+
return listTableChangeCellValues(startCol, startRow, values, workOnEditableCell, triggerEvent, this, silentChangeCellValuesEvent);
|
|
78300
78351
|
}
|
|
78301
|
-
|
|
78302
|
-
return
|
|
78352
|
+
changeCellValuesByIds(changeValues, triggerEvent = true, silentChangeCellValuesEvent) {
|
|
78353
|
+
return listTableChangeCellValuesByIds(changeValues, triggerEvent, this, silentChangeCellValuesEvent);
|
|
78354
|
+
}
|
|
78355
|
+
changeSourceCellValue(recordIndex, field, value) {
|
|
78356
|
+
const tableIndex = this.getTableIndexByRecordIndex(recordIndex);
|
|
78357
|
+
const cellAddr = this.getCellAddrByFieldRecord(field, recordIndex);
|
|
78358
|
+
if (tableIndex < 0 || cellAddr.col < 0 || cellAddr.row < 0) {
|
|
78359
|
+
return;
|
|
78360
|
+
}
|
|
78361
|
+
this.dataSource.changeFieldValue(value, tableIndex, field, cellAddr.col, cellAddr.row, this);
|
|
78362
|
+
const beforeChangeValue = this.getCellRawValue(cellAddr.col, cellAddr.row);
|
|
78363
|
+
const oldValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
78364
|
+
const changedValue = this.getCellOriginValue(cellAddr.col, cellAddr.row);
|
|
78365
|
+
if (oldValue !== changedValue) {
|
|
78366
|
+
const changeValue = {
|
|
78367
|
+
col: cellAddr.col,
|
|
78368
|
+
row: cellAddr.row,
|
|
78369
|
+
recordIndex,
|
|
78370
|
+
field,
|
|
78371
|
+
rawValue: beforeChangeValue,
|
|
78372
|
+
currentValue: oldValue,
|
|
78373
|
+
changedValue
|
|
78374
|
+
};
|
|
78375
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, changeValue);
|
|
78376
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUES, { values: [changeValue] });
|
|
78377
|
+
}
|
|
78303
78378
|
}
|
|
78304
78379
|
addRecord(record, recordIndex) {
|
|
78305
78380
|
const success = listTableAddRecord(record, recordIndex, this);
|
|
@@ -78328,6 +78403,19 @@
|
|
|
78328
78403
|
}
|
|
78329
78404
|
}
|
|
78330
78405
|
deleteRecords(recordIndexs) {
|
|
78406
|
+
const deletedRecords = [];
|
|
78407
|
+
if (recordIndexs?.length > 0) {
|
|
78408
|
+
recordIndexs.forEach(index => {
|
|
78409
|
+
let record = null;
|
|
78410
|
+
if (typeof index === 'number') {
|
|
78411
|
+
record = this.dataSource.get(index);
|
|
78412
|
+
}
|
|
78413
|
+
else {
|
|
78414
|
+
record = [];
|
|
78415
|
+
}
|
|
78416
|
+
deletedRecords.push(record);
|
|
78417
|
+
});
|
|
78418
|
+
}
|
|
78331
78419
|
listTableDeleteRecords(recordIndexs, this);
|
|
78332
78420
|
adjustHeightResizedRowMapWithDeleteRecordIndex(this, recordIndexs);
|
|
78333
78421
|
this.internalProps.emptyTip?.resetVisible();
|
|
@@ -78337,6 +78425,7 @@
|
|
|
78337
78425
|
}
|
|
78338
78426
|
this.fireListeners(TABLE_EVENT_TYPE.DELETE_RECORD, {
|
|
78339
78427
|
recordIndexs,
|
|
78428
|
+
records: deletedRecords,
|
|
78340
78429
|
rowIndexs,
|
|
78341
78430
|
deletedCount: Array.isArray(recordIndexs[0])
|
|
78342
78431
|
? recordIndexs.length
|
|
@@ -93314,7 +93403,7 @@
|
|
|
93314
93403
|
}
|
|
93315
93404
|
|
|
93316
93405
|
registerForVrender();
|
|
93317
|
-
const version = "1.22.
|
|
93406
|
+
const version = "1.22.11-alpha.1";
|
|
93318
93407
|
function getIcons() {
|
|
93319
93408
|
return get$2();
|
|
93320
93409
|
}
|