@visactor/vtable 1.4.2-alpha.0 → 1.4.2-alpha.2
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/PivotTable.js +19 -19
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/listener/table-group.js +3 -4
- package/cjs/event/listener/table-group.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/vrender.js.map +1 -1
- package/dist/vtable.js +63 -16
- package/dist/vtable.min.js +1 -1
- package/es/PivotTable.js +19 -19
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/listener/table-group.js +3 -4
- package/es/event/listener/table-group.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/vrender.js.map +1 -1
- package/package.json +4 -4
package/cjs/PivotTable.js
CHANGED
|
@@ -222,7 +222,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
222
222
|
return layoutMap.getBodyIndexByCol(col);
|
|
223
223
|
}
|
|
224
224
|
getFieldData(field, col, row) {
|
|
225
|
-
var _a;
|
|
225
|
+
var _a, _b, _c;
|
|
226
226
|
if (!this.internalProps.layoutMap.isHeader(col, row)) {
|
|
227
227
|
if (this.internalProps.recordsIsTwoDimensionalArray) {
|
|
228
228
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
@@ -232,13 +232,13 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
232
232
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
233
233
|
if (cellDimensionPath) {
|
|
234
234
|
let indicatorPosition;
|
|
235
|
-
const colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
235
|
+
const colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
|
|
236
236
|
var _a;
|
|
237
237
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
238
238
|
position: "col",
|
|
239
239
|
index: index
|
|
240
240
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
241
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
241
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
242
242
|
var _a;
|
|
243
243
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
244
244
|
position: "row",
|
|
@@ -314,7 +314,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
getCellOriginValue(col, row) {
|
|
317
|
-
var _a;
|
|
317
|
+
var _a, _b, _c;
|
|
318
318
|
const table = this;
|
|
319
319
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
320
320
|
const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
|
|
@@ -326,13 +326,13 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
326
326
|
}
|
|
327
327
|
if (this.dataset) {
|
|
328
328
|
let indicatorPosition;
|
|
329
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
329
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
|
|
330
330
|
var _a;
|
|
331
331
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
332
332
|
position: "col",
|
|
333
333
|
index: index
|
|
334
334
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
335
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
335
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
336
336
|
var _a;
|
|
337
337
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
338
338
|
position: "row",
|
|
@@ -353,7 +353,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
getCellRawValue(col, row) {
|
|
356
|
-
var _a;
|
|
356
|
+
var _a, _b, _c;
|
|
357
357
|
const table = this;
|
|
358
358
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
359
359
|
const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
|
|
@@ -365,13 +365,13 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
365
365
|
}
|
|
366
366
|
if (this.dataset) {
|
|
367
367
|
let indicatorPosition;
|
|
368
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
368
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
|
|
369
369
|
var _a;
|
|
370
370
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
371
371
|
position: "col",
|
|
372
372
|
index: index
|
|
373
373
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
374
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
374
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
375
375
|
var _a;
|
|
376
376
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
377
377
|
position: "row",
|
|
@@ -392,7 +392,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
getCellOriginRecord(col, row) {
|
|
395
|
-
var _a;
|
|
395
|
+
var _a, _b, _c;
|
|
396
396
|
if (!this.internalProps.layoutMap.isHeader(col, row)) {
|
|
397
397
|
if (this.internalProps.recordsIsTwoDimensionalArray) {
|
|
398
398
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
@@ -400,13 +400,13 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
400
400
|
}
|
|
401
401
|
if (this.dataset) {
|
|
402
402
|
let indicatorPosition;
|
|
403
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
403
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
|
|
404
404
|
var _a;
|
|
405
405
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
406
406
|
position: "col",
|
|
407
407
|
index: index
|
|
408
408
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
409
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
409
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
410
410
|
var _a;
|
|
411
411
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
412
412
|
position: "row",
|
|
@@ -428,7 +428,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
getCellRawRecord(col, row) {
|
|
431
|
-
var _a;
|
|
431
|
+
var _a, _b, _c;
|
|
432
432
|
if (!this.internalProps.layoutMap.isHeader(col, row)) {
|
|
433
433
|
if (this.internalProps.recordsIsTwoDimensionalArray) {
|
|
434
434
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
@@ -436,13 +436,13 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
436
436
|
}
|
|
437
437
|
if (this.dataset) {
|
|
438
438
|
let indicatorPosition;
|
|
439
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
439
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
|
|
440
440
|
var _a;
|
|
441
441
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
442
442
|
position: "col",
|
|
443
443
|
index: index
|
|
444
444
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
445
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
445
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
446
446
|
var _a;
|
|
447
447
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
448
448
|
position: "row",
|
|
@@ -809,7 +809,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
809
809
|
this.scenegraph.updateNextFrame();
|
|
810
810
|
}
|
|
811
811
|
_changeCellValueToDataSet(col, row, oldValue, newValue) {
|
|
812
|
-
var _a, _b, _c, _d, _e, _f;
|
|
812
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
813
813
|
if (this.internalProps.recordsIsTwoDimensionalArray) {
|
|
814
814
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
815
815
|
this.records[rowIndex][colIndex] = newValue;
|
|
@@ -817,10 +817,10 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
817
817
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
818
818
|
if (this.isCornerHeader(col, row)) this.internalProps.layoutMap.changeCornerTitle(col, row, newValue); else if (this.isHeader(col, row)) this.internalProps.layoutMap.changeTreeNodeTitle(col, row, newValue),
|
|
819
819
|
!this.isCornerHeader(col, row) && this.dataset.changeRecordFieldValue((null === (_a = cellDimensionPath.colHeaderPaths) || void 0 === _a ? void 0 : _a.length) ? null !== (_b = cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].indicatorKey) && void 0 !== _b ? _b : cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].dimensionKey : null !== (_c = cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].indicatorKey) && void 0 !== _c ? _c : cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].dimensionKey, oldValue, newValue); else {
|
|
820
|
-
const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
|
|
820
|
+
const colKeys = null === (_d = cellDimensionPath.colHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual)).map((colPath => {
|
|
821
821
|
var _a;
|
|
822
822
|
return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
823
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
|
|
823
|
+
})), rowKeys = null === (_e = cellDimensionPath.rowHeaderPaths) || void 0 === _e ? void 0 : _e.filter((path => !path.virtual)).map((rowPath => {
|
|
824
824
|
var _a;
|
|
825
825
|
return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
826
826
|
}));
|
|
@@ -829,7 +829,7 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
829
829
|
} else if (this.flatDataToObjects) {
|
|
830
830
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
831
831
|
if (this.isHeader(col, row)) this.internalProps.layoutMap.changeTreeNodeTitle(col, row, newValue),
|
|
832
|
-
!this.isCornerHeader(col, row) && this.flatDataToObjects.changeRecordFieldValue((null === (
|
|
832
|
+
!this.isCornerHeader(col, row) && this.flatDataToObjects.changeRecordFieldValue((null === (_f = cellDimensionPath.colHeaderPaths) || void 0 === _f ? void 0 : _f.length) ? null !== (_g = cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].indicatorKey) && void 0 !== _g ? _g : cellDimensionPath.colHeaderPaths[cellDimensionPath.colHeaderPaths.length - 1].dimensionKey : null !== (_h = cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].indicatorKey) && void 0 !== _h ? _h : cellDimensionPath.rowHeaderPaths[cellDimensionPath.rowHeaderPaths.length - 1].dimensionKey, oldValue, newValue); else {
|
|
833
833
|
const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
|
|
834
834
|
var _a;
|
|
835
835
|
return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|