@visactor/vtable 1.1.1-alpha.0 → 1.1.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.js +7 -6
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +40 -19
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +77 -34
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/empty-tip/empty-tip.js +1 -5
- package/cjs/components/empty-tip/empty-tip.js.map +1 -1
- package/cjs/core/BaseTable.js +1 -1
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +4 -1
- package/cjs/dataset/dataset.js +5 -5
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/cjs/layout/tree-helper.js +1 -0
- package/cjs/plugins/themes.js +1 -2
- package/cjs/scenegraph/style/frame-border.js +3 -2
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/vrender.js +9 -9
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +184 -51
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +6 -6
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +40 -19
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +77 -34
- package/es/PivotTable.js.map +1 -1
- package/es/components/empty-tip/empty-tip.js +1 -5
- package/es/components/empty-tip/empty-tip.js.map +1 -1
- package/es/core/BaseTable.js +1 -1
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.d.ts +4 -1
- package/es/dataset/dataset.js +5 -5
- package/es/dataset/dataset.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/tree-helper.js +2 -1
- package/es/plugins/themes.js +1 -2
- package/es/scenegraph/style/frame-border.js +3 -2
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/vrender.js +2 -2
- package/es/vrender.js.map +1 -1
- package/package.json +3 -3
package/es/PivotTable.js
CHANGED
|
@@ -82,8 +82,8 @@ export class PivotTable extends BaseTable {
|
|
|
82
82
|
"node" !== Env.mode && (this.editorManager = new EditManeger(this)), this.refreshHeader(),
|
|
83
83
|
this.stateManager.initCheckedState(records), this.scenegraph.createSceneGraph(),
|
|
84
84
|
options.title && (this.internalProps.title = new Title(options.title, this), this.scenegraph.resize()),
|
|
85
|
-
this.options.emptyTip && (this.internalProps.emptyTip
|
|
86
|
-
setTimeout((() => {
|
|
85
|
+
this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this)),
|
|
86
|
+
this.internalProps.emptyTip.resetVisible()), setTimeout((() => {
|
|
87
87
|
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
88
88
|
}), 0);
|
|
89
89
|
}
|
|
@@ -167,8 +167,8 @@ export class PivotTable extends BaseTable {
|
|
|
167
167
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
168
168
|
})), internalProps.releaseList = null), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(),
|
|
169
169
|
options.title && (this.internalProps.title = new Title(options.title, this), this.scenegraph.resize()),
|
|
170
|
-
this.options.emptyTip && (this.internalProps.emptyTip
|
|
171
|
-
new Promise((resolve => {
|
|
170
|
+
this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this)),
|
|
171
|
+
this.internalProps.emptyTip.resetVisible()), new Promise((resolve => {
|
|
172
172
|
setTimeout(resolve, 0);
|
|
173
173
|
}));
|
|
174
174
|
}
|
|
@@ -232,13 +232,20 @@ export class PivotTable extends BaseTable {
|
|
|
232
232
|
if (this.dataset) {
|
|
233
233
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
234
234
|
if (cellDimensionPath) {
|
|
235
|
-
|
|
235
|
+
let indicatorPosition;
|
|
236
|
+
const colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
236
237
|
var _a;
|
|
237
|
-
return
|
|
238
|
-
|
|
238
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
239
|
+
position: "col",
|
|
240
|
+
index: index
|
|
241
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
242
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
239
243
|
var _a;
|
|
240
|
-
return
|
|
241
|
-
|
|
244
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
245
|
+
position: "row",
|
|
246
|
+
index: index
|
|
247
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
248
|
+
})), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
|
|
242
249
|
if (aggregator.records && aggregator.records.length >= 1) return aggregator.records[0][field];
|
|
243
250
|
}
|
|
244
251
|
} else if (this.flatDataToObjects) {
|
|
@@ -279,13 +286,21 @@ export class PivotTable extends BaseTable {
|
|
|
279
286
|
return dataValue;
|
|
280
287
|
}
|
|
281
288
|
if (this.dataset) {
|
|
282
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row)
|
|
289
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
290
|
+
let indicatorPosition;
|
|
291
|
+
const colKeys = null === (_c = null === (_b = cellDimensionPath.colHeaderPaths) || void 0 === _b ? void 0 : _b.filter((path => !path.virtual))) || void 0 === _c ? void 0 : _c.map(((colPath, index) => {
|
|
283
292
|
var _a;
|
|
284
|
-
return
|
|
285
|
-
|
|
293
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
294
|
+
position: "col",
|
|
295
|
+
index: index
|
|
296
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
297
|
+
})), rowKeys = null === (_e = null === (_d = cellDimensionPath.rowHeaderPaths) || void 0 === _d ? void 0 : _d.filter((path => !path.virtual))) || void 0 === _e ? void 0 : _e.map(((rowPath, index) => {
|
|
286
298
|
var _a;
|
|
287
|
-
return
|
|
288
|
-
|
|
299
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
300
|
+
position: "row",
|
|
301
|
+
index: index
|
|
302
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
303
|
+
})), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition), {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row);
|
|
289
304
|
return aggregator.formatValue ? aggregator.formatValue(col, row, this) : "function" == typeof fieldFormat ? fieldFormat(null == aggregator ? void 0 : aggregator.value(), col, row, this) : null !== (_f = null == aggregator ? void 0 : aggregator.value()) && void 0 !== _f ? _f : "";
|
|
290
305
|
}
|
|
291
306
|
if (this.flatDataToObjects) {
|
|
@@ -311,13 +326,20 @@ export class PivotTable extends BaseTable {
|
|
|
311
326
|
return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
|
|
312
327
|
}
|
|
313
328
|
if (this.dataset) {
|
|
314
|
-
|
|
329
|
+
let indicatorPosition;
|
|
330
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
315
331
|
var _a;
|
|
316
|
-
return
|
|
317
|
-
|
|
332
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
333
|
+
position: "col",
|
|
334
|
+
index: index
|
|
335
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
336
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
318
337
|
var _a;
|
|
319
|
-
return
|
|
320
|
-
|
|
338
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
339
|
+
position: "row",
|
|
340
|
+
index: index
|
|
341
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
342
|
+
})), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
|
|
321
343
|
return aggregator.value ? aggregator.value() : void 0;
|
|
322
344
|
}
|
|
323
345
|
if (this.flatDataToObjects) {
|
|
@@ -343,13 +365,20 @@ export class PivotTable extends BaseTable {
|
|
|
343
365
|
return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
|
|
344
366
|
}
|
|
345
367
|
if (this.dataset) {
|
|
346
|
-
|
|
368
|
+
let indicatorPosition;
|
|
369
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
347
370
|
var _a;
|
|
348
|
-
return
|
|
349
|
-
|
|
371
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
372
|
+
position: "col",
|
|
373
|
+
index: index
|
|
374
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
375
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
350
376
|
var _a;
|
|
351
|
-
return
|
|
352
|
-
|
|
377
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
378
|
+
position: "row",
|
|
379
|
+
index: index
|
|
380
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
381
|
+
})), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !1, indicatorPosition);
|
|
353
382
|
return aggregator.value ? aggregator.value() : void 0;
|
|
354
383
|
}
|
|
355
384
|
if (this.flatDataToObjects) {
|
|
@@ -371,14 +400,21 @@ export class PivotTable extends BaseTable {
|
|
|
371
400
|
return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
|
|
372
401
|
}
|
|
373
402
|
if (this.dataset) {
|
|
374
|
-
|
|
403
|
+
let indicatorPosition;
|
|
404
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
375
405
|
var _a;
|
|
376
|
-
return
|
|
377
|
-
|
|
406
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
407
|
+
position: "col",
|
|
408
|
+
index: index
|
|
409
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
410
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
378
411
|
var _a;
|
|
379
|
-
return
|
|
412
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
413
|
+
position: "row",
|
|
414
|
+
index: index
|
|
415
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
380
416
|
}));
|
|
381
|
-
return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
|
|
417
|
+
return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition).records;
|
|
382
418
|
}
|
|
383
419
|
if (this.flatDataToObjects) {
|
|
384
420
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
|
|
@@ -400,14 +436,21 @@ export class PivotTable extends BaseTable {
|
|
|
400
436
|
return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
|
|
401
437
|
}
|
|
402
438
|
if (this.dataset) {
|
|
403
|
-
|
|
439
|
+
let indicatorPosition;
|
|
440
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
404
441
|
var _a;
|
|
405
|
-
return
|
|
406
|
-
|
|
442
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
443
|
+
position: "col",
|
|
444
|
+
index: index
|
|
445
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
446
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
407
447
|
var _a;
|
|
408
|
-
return
|
|
448
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
449
|
+
position: "row",
|
|
450
|
+
index: index
|
|
451
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
409
452
|
}));
|
|
410
|
-
return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
|
|
453
|
+
return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !1, indicatorPosition).records;
|
|
411
454
|
}
|
|
412
455
|
if (this.flatDataToObjects) {
|
|
413
456
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
|