@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.
Files changed (47) hide show
  1. package/cjs/ListTable.js +7 -6
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.js +40 -19
  4. package/cjs/PivotChart.js.map +1 -1
  5. package/cjs/PivotTable.js +77 -34
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/components/empty-tip/empty-tip.js +1 -5
  8. package/cjs/components/empty-tip/empty-tip.js.map +1 -1
  9. package/cjs/core/BaseTable.js +1 -1
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/dataset/dataset.d.ts +4 -1
  12. package/cjs/dataset/dataset.js +5 -5
  13. package/cjs/dataset/dataset.js.map +1 -1
  14. package/cjs/index.d.ts +1 -1
  15. package/cjs/index.js +2 -2
  16. package/cjs/index.js.map +1 -1
  17. package/cjs/layout/tree-helper.js +1 -0
  18. package/cjs/plugins/themes.js +1 -2
  19. package/cjs/scenegraph/style/frame-border.js +3 -2
  20. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  21. package/cjs/vrender.js +9 -9
  22. package/cjs/vrender.js.map +1 -1
  23. package/dist/vtable.js +184 -51
  24. package/dist/vtable.min.js +2 -2
  25. package/es/ListTable.js +6 -6
  26. package/es/ListTable.js.map +1 -1
  27. package/es/PivotChart.js +40 -19
  28. package/es/PivotChart.js.map +1 -1
  29. package/es/PivotTable.js +77 -34
  30. package/es/PivotTable.js.map +1 -1
  31. package/es/components/empty-tip/empty-tip.js +1 -5
  32. package/es/components/empty-tip/empty-tip.js.map +1 -1
  33. package/es/core/BaseTable.js +1 -1
  34. package/es/core/BaseTable.js.map +1 -1
  35. package/es/dataset/dataset.d.ts +4 -1
  36. package/es/dataset/dataset.js +5 -5
  37. package/es/dataset/dataset.js.map +1 -1
  38. package/es/index.d.ts +1 -1
  39. package/es/index.js +1 -1
  40. package/es/index.js.map +1 -1
  41. package/es/layout/tree-helper.js +2 -1
  42. package/es/plugins/themes.js +1 -2
  43. package/es/scenegraph/style/frame-border.js +3 -2
  44. package/es/scenegraph/style/frame-border.js.map +1 -1
  45. package/es/vrender.js +2 -2
  46. package/es/vrender.js.map +1 -1
  47. package/package.json +3 -3
@@ -52,11 +52,7 @@ export class EmptyTip {
52
52
  this._emptyTipComponent = null, this.isReleased = !0;
53
53
  }
54
54
  resetVisible() {
55
- this.table.recordsCount && 0 !== this.table.recordsCount ? (this._emptyTipComponent.setAttributes({
56
- visible: !1
57
- }), this._emptyTipComponent.hideAll()) : (this._emptyTipComponent.setAttributes({
58
- visible: !0
59
- }), this._emptyTipComponent.showAll());
55
+ (this.table.recordsCount && 0 !== this.table.recordsCount || this.table.internalProps.layoutMap.rowCount !== this.table.internalProps.layoutMap.columnHeaderLevelCount) && this.table.internalProps.layoutMap.colCount !== this.table.internalProps.layoutMap.rowHeaderLevelCount ? this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent) && this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent) : this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent) || this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent);
60
56
  }
61
57
  _getEmptyTipAttrs() {
62
58
  var _a;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/empty-tip/empty-tip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAK9E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,MAAM,WAAW,GACf,4pDAA4pD,CAAC;AAE/pD,MAAM,OAAO,QAAQ;IAkBnB,YAAY,cAAgC,EAAE,KAAmB;QAhBjE,oBAAe,GAAc;YAC3B,uBAAuB,EAAE,EAAE;YAC3B,IAAI,EAAE,SAAS;YACf,SAAS,EAAE;gBACT,QAAQ,EAAE,EAAE;gBACZ,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MAAM,GACV,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;YACvG,eAAe,CAAC;QAElB,OAAO;YACL,uBAAuB,EAAE,IAAI,CAAC,eAAe,CAAC,uBAAuB;YACrE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,KAAK;YACL,MAAM;YACN,IAAI,gCACF,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,IAC5B,IAAI,CAAC,eAAe,CAAC,SAAS,KACjC,IAAI,EAAE,MAAA,IAAI,CAAC,eAAe,CAAC,SAAS,0CAAE,KAAK,GAC5C;YACD,IAAI,oBACC,IAAI,CAAC,eAAe,CAAC,IAAI,CAC7B;SAEoB,CAAC;IAC1B,CAAC;CACF","file":"empty-tip.js","sourcesContent":["import { EmptyTip as EmptyTipComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { EmptyTipAttributes } from '@visactor/vrender-components';\nimport type { IEmptyTip } from '../../ts-types/component/empty-tip';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nimport type { ListTable } from '../../ListTable';\nimport type { PivotTable } from '../../PivotTable';\nconst emptyTipSvg =\n '<svg t=\"1716726614852\" class=\"icon\" viewBox=\"0 0 1194 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2621\" width=\"200\" height=\"200\"><path d=\"M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z\" fill=\"#8a8a8a\" p-id=\"2622\"></path></svg>';\n\nexport class EmptyTip {\n table: BaseTableAPI;\n _emptyTipOption: IEmptyTip = {\n spaceBetweenTextAndIcon: 20,\n text: 'no data',\n textStyle: {\n fontSize: 14,\n color: '#000'\n },\n icon: {\n image: emptyTipSvg,\n width: 100,\n height: 100\n }\n };\n isReleased: boolean = false;\n private _emptyTipComponent: EmptyTipComponents;\n private _cacheAttrs: EmptyTipAttributes;\n constructor(emptyTipOption: IEmptyTip | true, table: BaseTableAPI) {\n this.table = table;\n this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);\n this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());\n }\n\n private _createOrUpdateEmptyTipComponent(attrs: EmptyTipAttributes): EmptyTipComponents {\n if (this._emptyTipComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._emptyTipComponent.setAttributes(attrs);\n }\n } else {\n const emptyTip = new EmptyTipComponents(attrs);\n emptyTip.name = 'emptyTip';\n this.table.scenegraph.stage.defaultLayer.appendChild(emptyTip);\n this._emptyTipComponent = emptyTip;\n // 代理 emptyTip 组件上的事件\n // emptyTip.on('*', (event: any, type: string) => this._delegateEvent(emptyTip as unknown as INode, event, type));\n }\n // update table size\n // this._adjustTableSize(this._emptyTipComponent.attribute);\n return this._emptyTipComponent;\n }\n\n resize() {\n if (!this._emptyTipComponent) {\n return;\n }\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) -\n leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) -\n topHeaderHeight;\n this._emptyTipComponent.setAttributes({\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n });\n }\n\n release(): void {\n this._emptyTipComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n this._emptyTipComponent = null;\n this.isReleased = true;\n }\n resetVisible() {\n if (!this.table.recordsCount || this.table.recordsCount === 0) {\n this._emptyTipComponent.setAttributes({\n visible: true\n });\n this._emptyTipComponent.showAll();\n } else {\n this._emptyTipComponent.setAttributes({\n visible: false\n });\n this._emptyTipComponent.hideAll();\n }\n }\n\n private _getEmptyTipAttrs() {\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) -\n leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) -\n topHeaderHeight;\n\n return {\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n // visible:this.table.recordsCount === 0?true:false\n } as EmptyTipAttributes;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/components/empty-tip/empty-tip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAK9E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,MAAM,WAAW,GACf,4pDAA4pD,CAAC;AAE/pD,MAAM,OAAO,QAAQ;IAkBnB,YAAY,cAAgC,EAAE,KAAmB;QAhBjE,oBAAe,GAAc;YAC3B,uBAAuB,EAAE,EAAE;YAC3B,IAAI,EAAE,SAAS;YACf,SAAS,EAAE;gBACT,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,MAAM;aACd;YACD,IAAI,E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AC,kBAAkB,EAAE;YACjC,CAAC,CAAC,CAAC,CAAC;QACR,MAAM,eAAe,GACnB,CAAE,IAAI,CAAC,KAAmB,CAAC,SAAS,IAAK,IAAI,CAAC,KAAoB,CAAC,OAAO,CAAC,eAAe;YACxF,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE;YAClC,CAAC,CAAC,CAAC,CAAC;QACR,MAAM,KAAK,GACT,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC;YACxG,eAAe,CAAC;QAClB,MAAM,MAAM,GACV,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC;YACvG,eAAe,CAAC;QAElB,OAAO;YACL,uBAAuB,EAAE,IAAI,CAAC,eAAe,CAAC,uBAAuB;YACrE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,eAAe;YACtC,KAAK;YACL,MAAM;YACN,IAAI,gCACF,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,IAC5B,IAAI,CAAC,eAAe,CAAC,SAAS,KACjC,IAAI,EAAE,MAAA,IAAI,CAAC,eAAe,CAAC,SAAS,0CAAE,KAAK,GAC5C;YACD,IAAI,oBACC,IAAI,CAAC,eAAe,CAAC,IAAI,CAC7B;SAEoB,CAAC;IAC1B,CAAC;CACF","file":"empty-tip.js","sourcesContent":["import { EmptyTip as EmptyTipComponents } from '@visactor/vrender-components';\n// eslint-disable-next-line no-duplicate-imports\nimport type { EmptyTipAttributes } from '@visactor/vrender-components';\nimport type { IEmptyTip } from '../../ts-types/component/empty-tip';\nimport type { BaseTableAPI } from '../../ts-types/base-table';\nimport { isEqual } from '@visactor/vutils';\nimport type { ListTable } from '../../ListTable';\nimport type { PivotTable } from '../../PivotTable';\nconst emptyTipSvg =\n '<svg t=\"1716726614852\" class=\"icon\" viewBox=\"0 0 1194 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2621\" width=\"200\" height=\"200\"><path d=\"M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z\" fill=\"#8a8a8a\" p-id=\"2622\"></path></svg>';\n\nexport class EmptyTip {\n table: BaseTableAPI;\n _emptyTipOption: IEmptyTip = {\n spaceBetweenTextAndIcon: 20,\n text: 'no data',\n textStyle: {\n fontSize: 14,\n color: '#000'\n },\n icon: {\n image: emptyTipSvg,\n width: 100,\n height: 100\n }\n };\n isReleased: boolean = false;\n private _emptyTipComponent: EmptyTipComponents;\n private _cacheAttrs: EmptyTipAttributes;\n constructor(emptyTipOption: IEmptyTip | true, table: BaseTableAPI) {\n this.table = table;\n this._emptyTipOption = Object.assign(this._emptyTipOption, emptyTipOption === true ? {} : emptyTipOption);\n this._emptyTipComponent = this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs());\n }\n\n private _createOrUpdateEmptyTipComponent(attrs: EmptyTipAttributes): EmptyTipComponents {\n if (this._emptyTipComponent) {\n if (!isEqual(attrs, this._cacheAttrs)) {\n this._emptyTipComponent.setAttributes(attrs);\n }\n } else {\n const emptyTip = new EmptyTipComponents(attrs);\n emptyTip.name = 'emptyTip';\n this.table.scenegraph.stage.defaultLayer.appendChild(emptyTip);\n this._emptyTipComponent = emptyTip;\n }\n // update table size\n // this._adjustTableSize(this._emptyTipComponent.attribute);\n return this._emptyTipComponent;\n }\n\n resize() {\n if (!this._emptyTipComponent) {\n return;\n }\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) -\n leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) -\n topHeaderHeight;\n this._emptyTipComponent.setAttributes({\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n });\n }\n\n release(): void {\n this._emptyTipComponent && this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n this._emptyTipComponent = null;\n this.isReleased = true;\n }\n resetVisible() {\n if (\n ((!this.table.recordsCount || this.table.recordsCount === 0) &&\n this.table.internalProps.layoutMap.rowCount === this.table.internalProps.layoutMap.columnHeaderLevelCount) ||\n this.table.internalProps.layoutMap.colCount === this.table.internalProps.layoutMap.rowHeaderLevelCount\n ) {\n // this._emptyTipComponent.setAttributes({\n // visible: true\n // });\n // this._emptyTipComponent.showAll();\n if (!this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent);\n }\n } else {\n // this._emptyTipComponent.setAttributes({\n // visible: false\n // });\n // this._emptyTipComponent.hideAll();\n if (this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)) {\n this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent);\n }\n }\n }\n\n private _getEmptyTipAttrs() {\n const leftHeaderWidth =\n (this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol === false\n ? this.table.getFrozenColsWidth()\n : 0;\n const topHeaderHeight =\n !(this.table as ListTable).transpose || (this.table as PivotTable).options.indicatorsAsCol\n ? this.table.getFrozenRowsHeight()\n : 0;\n const width =\n (this.table.columnHeaderLevelCount > 0 ? this.table.getDrawRange().width : this.table.tableNoFrameWidth) -\n leftHeaderWidth;\n const height =\n (this.table.rowHeaderLevelCount > 0 ? this.table.getDrawRange().height : this.table.tableNoFrameHeight) -\n topHeaderHeight;\n\n return {\n spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,\n x: this.table.tableX + leftHeaderWidth,\n y: this.table.tableY + topHeaderHeight,\n width,\n height,\n text: {\n text: this._emptyTipOption.text,\n ...this._emptyTipOption.textStyle,\n fill: this._emptyTipOption.textStyle?.color\n },\n icon: {\n ...this._emptyTipOption.icon\n }\n // visible:this.table.recordsCount === 0?true:false\n } as EmptyTipAttributes;\n }\n}\n"]}
@@ -84,7 +84,7 @@ export class BaseTable extends EventTarget {
84
84
  }
85
85
  constructor(container, options = {}) {
86
86
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
87
- if (super(), this.showFrozenIcon = !0, this.version = "1.1.1-alpha.0", this.id = `VTable${Date.now()}`,
87
+ if (super(), this.showFrozenIcon = !0, this.version = "1.1.1", this.id = `VTable${Date.now()}`,
88
88
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
89
89
  !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
90
90
  const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth, widthMode: widthMode = "standard", heightMode: heightMode = "standard", autoFillWidth: autoFillWidth = !1, autoFillHeight: autoFillHeight = !1, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", dragHeaderMode: dragHeaderMode, showFrozenIcon: showFrozenIcon, allowFrozenColCount: allowFrozenColCount, padding: padding, hover: hover, menu: menu, select: click, customRender: customRender, pixelRatio: pixelRatio = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;