@visactor/vtable 1.4.2-beta.0 → 1.4.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/ListTable.js +1 -1
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.js +19 -19
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js +2 -0
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -2
- package/cjs/core/BaseTable.js +16 -150
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/utils/get-cell-position.d.ts +42 -0
- package/cjs/core/utils/get-cell-position.js +204 -0
- package/cjs/core/utils/get-cell-position.js.map +1 -0
- package/cjs/edit/edit-manager.d.ts +1 -1
- package/cjs/edit/edit-manager.js +7 -6
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/event.js +7 -3
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +92 -86
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +29 -20
- 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/layout/layout-helper.js +2 -2
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +182 -53
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +3 -0
- package/cjs/layout/simple-header-layout.js +28 -22
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +4 -2
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +60 -56
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +13 -11
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +8 -8
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/state/cell-move/index.js +4 -1
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/sort/index.js +7 -3
- package/cjs/state/sort/index.js.map +1 -1
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js +10 -6
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/util.d.ts +1 -0
- package/cjs/tools/util.js +11 -2
- package/cjs/tools/util.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +2 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.d.ts +1 -0
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +1 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +791 -438
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +1 -1
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.js +19 -19
- package/es/PivotTable.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElement.js +3 -1
- package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -2
- package/es/core/BaseTable.js +18 -150
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/utils/get-cell-position.d.ts +42 -0
- package/es/core/utils/get-cell-position.js +192 -0
- package/es/core/utils/get-cell-position.js.map +1 -0
- package/es/edit/edit-manager.d.ts +1 -1
- package/es/edit/edit-manager.js +7 -6
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/event.js +6 -2
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +92 -86
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +29 -20
- 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/layout/layout-helper.js +2 -2
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/pivot-header-layout.js +182 -53
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +3 -0
- package/es/layout/simple-header-layout.js +28 -22
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/component/custom.js +4 -2
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +60 -56
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +13 -11
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +8 -8
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +1 -1
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/state/cell-move/index.js +4 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/sort/index.js +7 -3
- package/es/state/sort/index.js.map +1 -1
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js +10 -6
- package/es/state/state.js.map +1 -1
- package/es/tools/util.d.ts +1 -0
- package/es/tools/util.js +9 -0
- package/es/tools/util.js.map +1 -1
- package/es/ts-types/base-table.d.ts +2 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.d.ts +1 -0
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +1 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/es/PivotTable.js
CHANGED
|
@@ -224,7 +224,7 @@ export class PivotTable extends BaseTable {
|
|
|
224
224
|
return layoutMap.getBodyIndexByCol(col);
|
|
225
225
|
}
|
|
226
226
|
getFieldData(field, col, row) {
|
|
227
|
-
var _a;
|
|
227
|
+
var _a, _b, _c;
|
|
228
228
|
if (!this.internalProps.layoutMap.isHeader(col, row)) {
|
|
229
229
|
if (this.internalProps.recordsIsTwoDimensionalArray) {
|
|
230
230
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
@@ -234,13 +234,13 @@ export class PivotTable extends BaseTable {
|
|
|
234
234
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
235
235
|
if (cellDimensionPath) {
|
|
236
236
|
let indicatorPosition;
|
|
237
|
-
const colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
237
|
+
const colKeys = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual)).map(((colPath, index) => {
|
|
238
238
|
var _a;
|
|
239
239
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
240
240
|
position: "col",
|
|
241
241
|
index: index
|
|
242
242
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
243
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
243
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
244
244
|
var _a;
|
|
245
245
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
246
246
|
position: "row",
|
|
@@ -316,7 +316,7 @@ export class PivotTable extends BaseTable {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
getCellOriginValue(col, row) {
|
|
319
|
-
var _a;
|
|
319
|
+
var _a, _b, _c;
|
|
320
320
|
const table = this;
|
|
321
321
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
322
322
|
const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
|
|
@@ -328,13 +328,13 @@ export class PivotTable extends BaseTable {
|
|
|
328
328
|
}
|
|
329
329
|
if (this.dataset) {
|
|
330
330
|
let indicatorPosition;
|
|
331
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
331
|
+
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) => {
|
|
332
332
|
var _a;
|
|
333
333
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
334
334
|
position: "col",
|
|
335
335
|
index: index
|
|
336
336
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
337
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
337
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
338
338
|
var _a;
|
|
339
339
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
340
340
|
position: "row",
|
|
@@ -355,7 +355,7 @@ export class PivotTable extends BaseTable {
|
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
getCellRawValue(col, row) {
|
|
358
|
-
var _a;
|
|
358
|
+
var _a, _b, _c;
|
|
359
359
|
const table = this;
|
|
360
360
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
361
361
|
const {title: title} = table.internalProps.layoutMap.getHeader(col, row);
|
|
@@ -367,13 +367,13 @@ export class PivotTable extends BaseTable {
|
|
|
367
367
|
}
|
|
368
368
|
if (this.dataset) {
|
|
369
369
|
let indicatorPosition;
|
|
370
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
370
|
+
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) => {
|
|
371
371
|
var _a;
|
|
372
372
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
373
373
|
position: "col",
|
|
374
374
|
index: index
|
|
375
375
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
376
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
376
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
377
377
|
var _a;
|
|
378
378
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
379
379
|
position: "row",
|
|
@@ -394,7 +394,7 @@ export class PivotTable extends BaseTable {
|
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
getCellOriginRecord(col, row) {
|
|
397
|
-
var _a;
|
|
397
|
+
var _a, _b, _c;
|
|
398
398
|
if (!this.internalProps.layoutMap.isHeader(col, row)) {
|
|
399
399
|
if (this.internalProps.recordsIsTwoDimensionalArray) {
|
|
400
400
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
@@ -402,13 +402,13 @@ export class PivotTable extends BaseTable {
|
|
|
402
402
|
}
|
|
403
403
|
if (this.dataset) {
|
|
404
404
|
let indicatorPosition;
|
|
405
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
405
|
+
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) => {
|
|
406
406
|
var _a;
|
|
407
407
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
408
408
|
position: "col",
|
|
409
409
|
index: index
|
|
410
410
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
411
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
411
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
412
412
|
var _a;
|
|
413
413
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
414
414
|
position: "row",
|
|
@@ -430,7 +430,7 @@ export class PivotTable extends BaseTable {
|
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
getCellRawRecord(col, row) {
|
|
433
|
-
var _a;
|
|
433
|
+
var _a, _b, _c;
|
|
434
434
|
if (!this.internalProps.layoutMap.isHeader(col, row)) {
|
|
435
435
|
if (this.internalProps.recordsIsTwoDimensionalArray) {
|
|
436
436
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
@@ -438,13 +438,13 @@ export class PivotTable extends BaseTable {
|
|
|
438
438
|
}
|
|
439
439
|
if (this.dataset) {
|
|
440
440
|
let indicatorPosition;
|
|
441
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
441
|
+
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) => {
|
|
442
442
|
var _a;
|
|
443
443
|
return colPath.indicatorKey && (indicatorPosition = {
|
|
444
444
|
position: "col",
|
|
445
445
|
index: index
|
|
446
446
|
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
447
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
447
|
+
})), rowKeys = null === (_c = cellDimensionPath.rowHeaderPaths) || void 0 === _c ? void 0 : _c.filter((path => !path.virtual)).map(((rowPath, index) => {
|
|
448
448
|
var _a;
|
|
449
449
|
return rowPath.indicatorKey && (indicatorPosition = {
|
|
450
450
|
position: "row",
|
|
@@ -810,7 +810,7 @@ export class PivotTable extends BaseTable {
|
|
|
810
810
|
this.scenegraph.updateNextFrame();
|
|
811
811
|
}
|
|
812
812
|
_changeCellValueToDataSet(col, row, oldValue, newValue) {
|
|
813
|
-
var _a, _b, _c, _d, _e, _f;
|
|
813
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
814
814
|
if (this.internalProps.recordsIsTwoDimensionalArray) {
|
|
815
815
|
const rowIndex = this.getBodyIndexByRow(row), colIndex = this.getBodyIndexByCol(col);
|
|
816
816
|
this.records[rowIndex][colIndex] = newValue;
|
|
@@ -818,10 +818,10 @@ export class PivotTable extends BaseTable {
|
|
|
818
818
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
819
819
|
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),
|
|
820
820
|
!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 {
|
|
821
|
-
const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
|
|
821
|
+
const colKeys = null === (_d = cellDimensionPath.colHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual)).map((colPath => {
|
|
822
822
|
var _a;
|
|
823
823
|
return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
824
|
-
})), rowKeys = cellDimensionPath.rowHeaderPaths.map((rowPath => {
|
|
824
|
+
})), rowKeys = null === (_e = cellDimensionPath.rowHeaderPaths) || void 0 === _e ? void 0 : _e.filter((path => !path.virtual)).map((rowPath => {
|
|
825
825
|
var _a;
|
|
826
826
|
return null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
827
827
|
}));
|
|
@@ -830,7 +830,7 @@ export class PivotTable extends BaseTable {
|
|
|
830
830
|
} else if (this.flatDataToObjects) {
|
|
831
831
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
832
832
|
if (this.isHeader(col, row)) this.internalProps.layoutMap.changeTreeNodeTitle(col, row, newValue),
|
|
833
|
-
!this.isCornerHeader(col, row) && this.flatDataToObjects.changeRecordFieldValue((null === (
|
|
833
|
+
!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 {
|
|
834
834
|
const colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
|
|
835
835
|
var _a;
|
|
836
836
|
return null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|