@visactor/vtable 1.23.0 → 1.23.1-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/README.md +20 -0
- package/cjs/ListTable.js +12 -8
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +13 -6
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +16 -9
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js +5 -4
- package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +5 -4
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/title/title.js +4 -4
- package/cjs/components/title/title.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +4 -0
- package/cjs/core/BaseTable.js +26 -18
- package/cjs/core/BaseTable.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/ts-types/base-table.d.ts +5 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +96 -43
- package/dist/vtable.min.js +1 -1
- package/es/ListTable.js +12 -8
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +13 -6
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +16 -9
- package/es/PivotTable.js.map +1 -1
- package/es/components/legend/continue-legend/continue-legend.js +5 -4
- package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +5 -4
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/title/title.js +4 -4
- package/es/components/title/title.js.map +1 -1
- package/es/core/BaseTable.d.ts +4 -0
- package/es/core/BaseTable.js +26 -18
- package/es/core/BaseTable.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/ts-types/base-table.d.ts +5 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -118,10 +118,30 @@ const option = {
|
|
|
118
118
|
widthMode:'standard'
|
|
119
119
|
};
|
|
120
120
|
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Component Layout Priority
|
|
121
124
|
|
|
125
|
+
The `componentLayoutOrder` option allows you to control the layout priority of `title` and `legend`. This affects the order in which they occupy space in the drawing area. By default, the order is `['legend', 'title']`.
|
|
122
126
|
|
|
127
|
+
To place the title above the legend, you can configure it as follows:
|
|
123
128
|
|
|
129
|
+
```javascript
|
|
130
|
+
const option = {
|
|
131
|
+
// ...other options
|
|
132
|
+
title: {
|
|
133
|
+
text: 'Sales Analysis',
|
|
134
|
+
orient: 'top',
|
|
135
|
+
align: 'center'
|
|
136
|
+
},
|
|
137
|
+
legends: {
|
|
138
|
+
orient: 'top',
|
|
139
|
+
// ...other legend options
|
|
140
|
+
},
|
|
141
|
+
componentLayoutOrder: ['title', 'legend']
|
|
142
|
+
};
|
|
124
143
|
|
|
144
|
+
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
|
|
125
145
|
```
|
|
126
146
|
|
|
127
147
|
##
|
package/cjs/ListTable.js
CHANGED
|
@@ -336,14 +336,14 @@ class ListTable extends core_1.BaseTable {
|
|
|
336
336
|
}) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(),
|
|
337
337
|
this.render()), options.title) {
|
|
338
338
|
const Title = factory_1.Factory.getComponent("title");
|
|
339
|
-
internalProps.title = new Title(options.title, this)
|
|
339
|
+
internalProps.title = new Title(options.title, this);
|
|
340
340
|
}
|
|
341
341
|
if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible(); else {
|
|
342
342
|
const EmptyTip = factory_1.Factory.getComponent("emptyTip");
|
|
343
343
|
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_j = this.internalProps.emptyTip) || void 0 === _j || _j.resetVisible();
|
|
344
344
|
}
|
|
345
345
|
return this.pluginManager.updatePlugins(options.plugins), setTimeout((() => {
|
|
346
|
-
this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.UPDATED, null);
|
|
346
|
+
this.resize(), this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.UPDATED, null);
|
|
347
347
|
}), 0), new Promise((resolve => {
|
|
348
348
|
setTimeout(resolve, 0);
|
|
349
349
|
}));
|
|
@@ -622,7 +622,7 @@ class ListTable extends core_1.BaseTable {
|
|
|
622
622
|
this.setCellCheckboxState(col, row, checked);
|
|
623
623
|
}
|
|
624
624
|
setRecords(records, option) {
|
|
625
|
-
var _a, _b, _c, _d;
|
|
625
|
+
var _a, _b, _c, _d, _e;
|
|
626
626
|
let sort;
|
|
627
627
|
(0, chart_render_helper_1.clearChartRenderQueue)(), null === (_a = this.internalProps.dataSource) || void 0 === _a || _a.release(),
|
|
628
628
|
this.internalProps.releaseList = null === (_b = this.internalProps.releaseList) || void 0 === _b ? void 0 : _b.filter((item => !item.dataSourceObj)),
|
|
@@ -649,12 +649,16 @@ class ListTable extends core_1.BaseTable {
|
|
|
649
649
|
}
|
|
650
650
|
this.refreshRowColCount();
|
|
651
651
|
} else (0, tableHelper_1._setRecords)(this, records);
|
|
652
|
-
|
|
653
|
-
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize()
|
|
654
|
-
|
|
655
|
-
|
|
652
|
+
this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(),
|
|
653
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize();
|
|
654
|
+
if ((null !== (_c = this.options.componentLayoutOrder) && void 0 !== _c ? _c : [ "legend", "title" ]).forEach((component => {
|
|
655
|
+
var _a, _b;
|
|
656
|
+
"legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach((legend => {
|
|
657
|
+
null == legend || legend.resize();
|
|
658
|
+
})) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
|
|
659
|
+
})), this.scenegraph.resize(), this.options.emptyTip) if (this.internalProps.emptyTip) null === (_d = this.internalProps.emptyTip) || void 0 === _d || _d.resetVisible(); else {
|
|
656
660
|
const EmptyTip = factory_1.Factory.getComponent("emptyTip");
|
|
657
|
-
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (
|
|
661
|
+
this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_e = this.internalProps.emptyTip) || void 0 === _e || _e.resetVisible();
|
|
658
662
|
}
|
|
659
663
|
this.render(), (0, vutils_1.isValid)(oldHoverState.col) && (0, vutils_1.isValid)(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0 && setTimeout((() => {
|
|
660
664
|
var _a;
|