@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/cjs/PivotTable.js
CHANGED
|
@@ -78,8 +78,8 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
78
78
|
"node" !== env_1.Env.mode && (this.editorManager = new edit_manager_1.EditManeger(this)),
|
|
79
79
|
this.refreshHeader(), this.stateManager.initCheckedState(records), this.scenegraph.createSceneGraph(),
|
|
80
80
|
options.title && (this.internalProps.title = new title_1.Title(options.title, this),
|
|
81
|
-
this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip
|
|
82
|
-
setTimeout((() => {
|
|
81
|
+
this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
|
|
82
|
+
this.internalProps.emptyTip.resetVisible()), setTimeout((() => {
|
|
83
83
|
this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
84
84
|
}), 0);
|
|
85
85
|
}
|
|
@@ -165,8 +165,8 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
165
165
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
166
166
|
})), internalProps.releaseList = null), this.scenegraph.clearCells(), this.scenegraph.createSceneGraph(),
|
|
167
167
|
options.title && (this.internalProps.title = new title_1.Title(options.title, this),
|
|
168
|
-
this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip
|
|
169
|
-
new Promise((resolve => {
|
|
168
|
+
this.scenegraph.resize()), this.options.emptyTip && (this.internalProps.emptyTip || (this.internalProps.emptyTip = new empty_tip_1.EmptyTip(this.options.emptyTip, this)),
|
|
169
|
+
this.internalProps.emptyTip.resetVisible()), new Promise((resolve => {
|
|
170
170
|
setTimeout(resolve, 0);
|
|
171
171
|
}));
|
|
172
172
|
}
|
|
@@ -230,13 +230,20 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
230
230
|
if (this.dataset) {
|
|
231
231
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
232
232
|
if (cellDimensionPath) {
|
|
233
|
-
|
|
233
|
+
let indicatorPosition;
|
|
234
|
+
const colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
234
235
|
var _a;
|
|
235
|
-
return
|
|
236
|
-
|
|
236
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
237
|
+
position: "col",
|
|
238
|
+
index: index
|
|
239
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
240
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
237
241
|
var _a;
|
|
238
|
-
return
|
|
239
|
-
|
|
242
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
243
|
+
position: "row",
|
|
244
|
+
index: index
|
|
245
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
246
|
+
})), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
|
|
240
247
|
if (aggregator.records && aggregator.records.length >= 1) return aggregator.records[0][field];
|
|
241
248
|
}
|
|
242
249
|
} else if (this.flatDataToObjects) {
|
|
@@ -277,13 +284,21 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
277
284
|
return dataValue;
|
|
278
285
|
}
|
|
279
286
|
if (this.dataset) {
|
|
280
|
-
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row)
|
|
287
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row);
|
|
288
|
+
let indicatorPosition;
|
|
289
|
+
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) => {
|
|
281
290
|
var _a;
|
|
282
|
-
return
|
|
283
|
-
|
|
291
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
292
|
+
position: "col",
|
|
293
|
+
index: index
|
|
294
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
295
|
+
})), 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) => {
|
|
284
296
|
var _a;
|
|
285
|
-
return
|
|
286
|
-
|
|
297
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
298
|
+
position: "row",
|
|
299
|
+
index: index
|
|
300
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
301
|
+
})), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition), {fieldFormat: fieldFormat} = this.internalProps.layoutMap.getBody(col, row);
|
|
287
302
|
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 : "";
|
|
288
303
|
}
|
|
289
304
|
if (this.flatDataToObjects) {
|
|
@@ -309,13 +324,20 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
309
324
|
return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
|
|
310
325
|
}
|
|
311
326
|
if (this.dataset) {
|
|
312
|
-
|
|
327
|
+
let indicatorPosition;
|
|
328
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
313
329
|
var _a;
|
|
314
|
-
return
|
|
315
|
-
|
|
330
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
331
|
+
position: "col",
|
|
332
|
+
index: index
|
|
333
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
334
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
316
335
|
var _a;
|
|
317
|
-
return
|
|
318
|
-
|
|
336
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
337
|
+
position: "row",
|
|
338
|
+
index: index
|
|
339
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
340
|
+
})), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition);
|
|
319
341
|
return aggregator.value ? aggregator.value() : void 0;
|
|
320
342
|
}
|
|
321
343
|
if (this.flatDataToObjects) {
|
|
@@ -341,13 +363,20 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
341
363
|
return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
|
|
342
364
|
}
|
|
343
365
|
if (this.dataset) {
|
|
344
|
-
|
|
366
|
+
let indicatorPosition;
|
|
367
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
345
368
|
var _a;
|
|
346
|
-
return
|
|
347
|
-
|
|
369
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
370
|
+
position: "col",
|
|
371
|
+
index: index
|
|
372
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
373
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
348
374
|
var _a;
|
|
349
|
-
return
|
|
350
|
-
|
|
375
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
376
|
+
position: "row",
|
|
377
|
+
index: index
|
|
378
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
379
|
+
})), aggregator = this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !1, indicatorPosition);
|
|
351
380
|
return aggregator.value ? aggregator.value() : void 0;
|
|
352
381
|
}
|
|
353
382
|
if (this.flatDataToObjects) {
|
|
@@ -369,14 +398,21 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
369
398
|
return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
|
|
370
399
|
}
|
|
371
400
|
if (this.dataset) {
|
|
372
|
-
|
|
401
|
+
let indicatorPosition;
|
|
402
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
373
403
|
var _a;
|
|
374
|
-
return
|
|
375
|
-
|
|
404
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
405
|
+
position: "col",
|
|
406
|
+
index: index
|
|
407
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
408
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
376
409
|
var _a;
|
|
377
|
-
return
|
|
410
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
411
|
+
position: "row",
|
|
412
|
+
index: index
|
|
413
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
378
414
|
}));
|
|
379
|
-
return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
|
|
415
|
+
return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !0, indicatorPosition).records;
|
|
380
416
|
}
|
|
381
417
|
if (this.flatDataToObjects) {
|
|
382
418
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
|
|
@@ -398,14 +434,21 @@ class PivotTable extends BaseTable_1.BaseTable {
|
|
|
398
434
|
return null === (_a = this.records[rowIndex]) || void 0 === _a ? void 0 : _a[colIndex];
|
|
399
435
|
}
|
|
400
436
|
if (this.dataset) {
|
|
401
|
-
|
|
437
|
+
let indicatorPosition;
|
|
438
|
+
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map(((colPath, index) => {
|
|
402
439
|
var _a;
|
|
403
|
-
return
|
|
404
|
-
|
|
440
|
+
return colPath.indicatorKey && (indicatorPosition = {
|
|
441
|
+
position: "col",
|
|
442
|
+
index: index
|
|
443
|
+
}), null !== (_a = colPath.indicatorKey) && void 0 !== _a ? _a : colPath.value;
|
|
444
|
+
})), rowKeys = cellDimensionPath.rowHeaderPaths.map(((rowPath, index) => {
|
|
405
445
|
var _a;
|
|
406
|
-
return
|
|
446
|
+
return rowPath.indicatorKey && (indicatorPosition = {
|
|
447
|
+
position: "row",
|
|
448
|
+
index: index
|
|
449
|
+
}), null !== (_a = rowPath.indicatorKey) && void 0 !== _a ? _a : rowPath.value;
|
|
407
450
|
}));
|
|
408
|
-
return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row)).records;
|
|
451
|
+
return this.dataset.getAggregator(rowKeys, colKeys, this.internalProps.layoutMap.getIndicatorKey(col, row), !1, indicatorPosition).records;
|
|
409
452
|
}
|
|
410
453
|
if (this.flatDataToObjects) {
|
|
411
454
|
const cellDimensionPath = this.internalProps.layoutMap.getCellHeaderPaths(col, row), colKeys = cellDimensionPath.colHeaderPaths.map((colPath => {
|