@visactor/vtable 1.11.4 → 1.11.5

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 (63) hide show
  1. package/cjs/ListTable-all.js +6 -5
  2. package/cjs/ListTable-all.js.map +1 -1
  3. package/cjs/PivotTable.js +1 -1
  4. package/cjs/PivotTable.js.map +1 -1
  5. package/cjs/core/BaseTable.d.ts +2 -2
  6. package/cjs/core/BaseTable.js +13 -8
  7. package/cjs/core/BaseTable.js.map +1 -1
  8. package/cjs/core/style-helper.js +6 -6
  9. package/cjs/core/style-helper.js.map +1 -1
  10. package/cjs/index.d.ts +1 -4
  11. package/cjs/index.js +2 -3
  12. package/cjs/index.js.map +1 -1
  13. package/cjs/plugins/custom-cell-style.d.ts +6 -2
  14. package/cjs/plugins/custom-cell-style.js +8 -2
  15. package/cjs/plugins/custom-cell-style.js.map +1 -1
  16. package/cjs/plugins/invert-highlight.d.ts +0 -18
  17. package/cjs/plugins/invert-highlight.js +3 -52
  18. package/cjs/plugins/invert-highlight.js.map +1 -1
  19. package/cjs/plugins/list-tree-stick-cell.d.ts +3 -1
  20. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  21. package/cjs/plugins/list-tree-stick-cell.js.map +1 -1
  22. package/cjs/ts-types/base-table.d.ts +4 -4
  23. package/cjs/ts-types/base-table.js.map +1 -1
  24. package/cjs/vrender.js.map +1 -1
  25. package/dist/vtable.js +169 -515
  26. package/dist/vtable.min.js +2 -2
  27. package/es/ListTable-all.js +5 -3
  28. package/es/ListTable-all.js.map +1 -1
  29. package/es/PivotTable.js +1 -1
  30. package/es/PivotTable.js.map +1 -1
  31. package/es/core/BaseTable.d.ts +2 -2
  32. package/es/core/BaseTable.js +12 -9
  33. package/es/core/BaseTable.js.map +1 -1
  34. package/es/core/style-helper.js +7 -7
  35. package/es/core/style-helper.js.map +1 -1
  36. package/es/index.d.ts +1 -4
  37. package/es/index.js +1 -7
  38. package/es/index.js.map +1 -1
  39. package/es/plugins/custom-cell-style.d.ts +6 -2
  40. package/es/plugins/custom-cell-style.js +6 -0
  41. package/es/plugins/custom-cell-style.js.map +1 -1
  42. package/es/plugins/invert-highlight.d.ts +0 -18
  43. package/es/plugins/invert-highlight.js +0 -55
  44. package/es/plugins/invert-highlight.js.map +1 -1
  45. package/es/plugins/list-tree-stick-cell.d.ts +3 -1
  46. package/es/plugins/list-tree-stick-cell.js +4 -4
  47. package/es/plugins/list-tree-stick-cell.js.map +1 -1
  48. package/es/ts-types/base-table.d.ts +4 -4
  49. package/es/ts-types/base-table.js.map +1 -1
  50. package/es/vrender.js.map +1 -1
  51. package/package.json +4 -4
  52. package/cjs/plugins/carousel-animation.d.ts +0 -48
  53. package/cjs/plugins/carousel-animation.js +0 -71
  54. package/cjs/plugins/carousel-animation.js.map +0 -1
  55. package/cjs/plugins/header-highlight.d.ts +0 -21
  56. package/cjs/plugins/header-highlight.js +0 -108
  57. package/cjs/plugins/header-highlight.js.map +0 -1
  58. package/es/plugins/carousel-animation.d.ts +0 -48
  59. package/es/plugins/carousel-animation.js +0 -63
  60. package/es/plugins/carousel-animation.js.map +0 -1
  61. package/es/plugins/header-highlight.d.ts +0 -21
  62. package/es/plugins/header-highlight.js +0 -100
  63. package/es/plugins/header-highlight.js.map +0 -1
@@ -16,13 +16,13 @@ import type { TooltipOptions } from '../ts-types/tooltip';
16
16
  import type { BaseTableAPI, BaseTableConstructorOptions, IBaseTableProtected } from '../ts-types/base-table';
17
17
  import type { DataSet } from '@visactor/vdataset';
18
18
  import { NumberRangeMap } from '../layout/row-height-map';
19
- import { CustomCellStylePlugin } from '../plugins/custom-cell-style';
20
19
  import type { ITextGraphicAttribute } from './../vrender';
21
20
  import { ReactCustomLayout } from '../components/react/react-custom-layout';
22
21
  import type { ISortedMapItem } from '../data/DataSource';
23
22
  import type { EditManeger } from '../edit/edit-manager';
24
23
  import { TableAnimationManager } from './animation';
25
24
  import type { ITableAnimationOption } from '../ts-types/animation/appear';
25
+ import type { CustomCellStylePlugin } from '../plugins/custom-cell-style';
26
26
  export declare abstract class BaseTable extends EventTarget implements BaseTableAPI {
27
27
  internalProps: IBaseTableProtected;
28
28
  showFrozenIcon: boolean;
@@ -69,7 +69,7 @@ export declare abstract class BaseTable extends EventTarget implements BaseTable
69
69
  query?: any;
70
70
  callback: AnyFunction;
71
71
  }[]>;
72
- customCellStylePlugin: CustomCellStylePlugin;
72
+ customCellStylePlugin?: CustomCellStylePlugin;
73
73
  columnWidthComputeMode?: 'normal' | 'only-header' | 'only-body';
74
74
  reactCustomLayout?: ReactCustomLayout;
75
75
  _hasAutoImageColumn?: boolean;
@@ -33,7 +33,7 @@ Object.defineProperty(exports, "__esModule", {
33
33
  value: !0
34
34
  }), exports.BaseTable = void 0;
35
35
 
36
- const columnStyleContents = __importStar(require("../body-helper/style")), style_1 = require("./style"), style = __importStar(require("../tools/style")), ts_types_1 = require("../ts-types"), helper_1 = require("../tools/helper"), TABLE_EVENT_TYPE_1 = require("./TABLE_EVENT_TYPE"), EventHandler_1 = require("../event/EventHandler"), EventTarget_1 = require("../event/EventTarget"), NumberMap_1 = require("../tools/NumberMap"), Rect_1 = require("../tools/Rect"), util_1 = require("../tools/util"), themes_1 = __importDefault(require("../themes")), env_1 = require("../tools/env"), scenegraph_1 = require("../scenegraph/scenegraph"), state_1 = require("../state/state"), event_1 = require("../event/event"), body_helper_1 = require("../body-helper/body-helper"), header_helper_1 = require("../header-helper/header-helper"), vutils_1 = require("@visactor/vutils"), text_measure_1 = require("../scenegraph/utils/text-measure"), get_prop_1 = require("../scenegraph/utils/get-prop"), icons_1 = require("../plugins/icons"), tableHelper_1 = require("./tableHelper"), FouseInput_1 = require("./FouseInput"), pixel_ratio_1 = require("../tools/pixel-ratio"), chart_render_helper_1 = require("../scenegraph/graphic/contributions/chart-render-helper"), row_height_map_1 = require("../layout/row-height-map"), row_series_number_helper_1 = require("./row-series-number-helper"), custom_cell_style_1 = require("../plugins/custom-cell-style"), update_select_border_1 = require("../scenegraph/select/update-select-border"), react_custom_layout_1 = require("../components/react/react-custom-layout"), layout_helper_1 = require("../layout/layout-helper"), factory_1 = require("./factory"), get_cell_position_1 = require("./utils/get-cell-position"), style_helper_1 = require("./style-helper"), frozen_react_1 = require("../scenegraph/layout/frozen-react"), icons_2 = require("../icons"), animation_1 = require("./animation"), check_in_select_1 = require("../state/common/check-in-select"), {toBoxArray: toBoxArray} = helper_1.style, {isTouchEvent: isTouchEvent} = helper_1.event, rangeReg = /^\$(\d+)\$(\d+)$/;
36
+ const columnStyleContents = __importStar(require("../body-helper/style")), style_1 = require("./style"), style = __importStar(require("../tools/style")), ts_types_1 = require("../ts-types"), helper_1 = require("../tools/helper"), TABLE_EVENT_TYPE_1 = require("./TABLE_EVENT_TYPE"), EventHandler_1 = require("../event/EventHandler"), EventTarget_1 = require("../event/EventTarget"), NumberMap_1 = require("../tools/NumberMap"), Rect_1 = require("../tools/Rect"), util_1 = require("../tools/util"), themes_1 = __importDefault(require("../themes")), env_1 = require("../tools/env"), scenegraph_1 = require("../scenegraph/scenegraph"), state_1 = require("../state/state"), event_1 = require("../event/event"), body_helper_1 = require("../body-helper/body-helper"), header_helper_1 = require("../header-helper/header-helper"), vutils_1 = require("@visactor/vutils"), text_measure_1 = require("../scenegraph/utils/text-measure"), get_prop_1 = require("../scenegraph/utils/get-prop"), icons_1 = require("../plugins/icons"), tableHelper_1 = require("./tableHelper"), FouseInput_1 = require("./FouseInput"), pixel_ratio_1 = require("../tools/pixel-ratio"), chart_render_helper_1 = require("../scenegraph/graphic/contributions/chart-render-helper"), row_height_map_1 = require("../layout/row-height-map"), row_series_number_helper_1 = require("./row-series-number-helper"), update_select_border_1 = require("../scenegraph/select/update-select-border"), react_custom_layout_1 = require("../components/react/react-custom-layout"), layout_helper_1 = require("../layout/layout-helper"), factory_1 = require("./factory"), get_cell_position_1 = require("./utils/get-cell-position"), style_helper_1 = require("./style-helper"), frozen_react_1 = require("../scenegraph/layout/frozen-react"), icons_2 = require("../icons"), animation_1 = require("./animation"), check_in_select_1 = require("../state/common/check-in-select"), {toBoxArray: toBoxArray} = helper_1.style, {isTouchEvent: isTouchEvent} = helper_1.event, rangeReg = /^\$(\d+)\$(\d+)$/;
37
37
 
38
38
  (0, style_1.importStyle)();
39
39
 
@@ -43,7 +43,7 @@ class BaseTable extends EventTarget_1.EventTarget {
43
43
  }
44
44
  constructor(container, options = {}) {
45
45
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
46
- if (super(), this.showFrozenIcon = !0, this.version = "1.11.4", this.id = `VTable${Date.now()}`,
46
+ if (super(), this.showFrozenIcon = !0, this.version = "1.11.5", this.id = `VTable${Date.now()}`,
47
47
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
48
48
  !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
49
49
  const {frozenColCount: frozenColCount = 0, frozenRowCount: frozenRowCount, 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 = pixel_ratio_1.defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
@@ -138,7 +138,9 @@ class BaseTable extends EventTarget_1.EventTarget {
138
138
  this.headerStyleCache = new Map, this.bodyStyleCache = new Map, this.bodyMergeTitleCache = new Map,
139
139
  this.bodyBottomStyleCache = new Map, internalProps.stick = {
140
140
  changedCells: new Map
141
- }, internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin = new custom_cell_style_1.CustomCellStylePlugin(this, null !== (_j = options.customCellStyle) && void 0 !== _j ? _j : [], null !== (_k = options.customCellStyleArrangement) && void 0 !== _k ? _k : []);
141
+ }, internalProps.customMergeCell = options.customMergeCell;
142
+ const CustomCellStylePlugin = factory_1.Factory.getComponent("customCellStylePlugin");
143
+ CustomCellStylePlugin && (this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_j = options.customCellStyle) && void 0 !== _j ? _j : [], null !== (_k = options.customCellStyleArrangement) && void 0 !== _k ? _k : []));
142
144
  }
143
145
  getContainer() {
144
146
  return this.container;
@@ -784,7 +786,7 @@ class BaseTable extends EventTarget_1.EventTarget {
784
786
  return super.fireListeners(type, event);
785
787
  }
786
788
  updateOption(options) {
787
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
789
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
788
790
  this.options = options, this._hasAutoImageColumn = void 0;
789
791
  const {frozenColCount: frozenColCount = 0, defaultRowHeight: defaultRowHeight = 40, defaultHeaderRowHeight: defaultHeaderRowHeight, defaultColWidth: defaultColWidth = 80, defaultHeaderColWidth: defaultHeaderColWidth = 80, 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, pixelRatio: pixelRatio, widthMode: widthMode, heightMode: heightMode, autoFillWidth: autoFillWidth, autoFillHeight: autoFillHeight, widthAdaptiveMode: widthAdaptiveMode, heightAdaptiveMode: heightAdaptiveMode, customRender: customRender, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth, limitMinHeight: limitMinHeight} = options;
790
792
  pixelRatio && pixelRatio !== this.internalProps.pixelRatio && (this.internalProps.pixelRatio = pixelRatio),
@@ -859,7 +861,7 @@ class BaseTable extends EventTarget_1.EventTarget {
859
861
  internalProps.menuHandler = new MenuHandler(this);
860
862
  }
861
863
  this.clearCellStyleCache(), this.clearColWidthCache(), this.clearRowHeightCache(),
862
- internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin.updateCustomCell(null !== (_l = options.customCellStyle) && void 0 !== _l ? _l : [], null !== (_m = options.customCellStyleArrangement) && void 0 !== _m ? _m : []);
864
+ internalProps.customMergeCell = options.customMergeCell, null === (_l = this.customCellStylePlugin) || void 0 === _l || _l.updateCustomCell(null !== (_m = options.customCellStyle) && void 0 !== _m ? _m : [], null !== (_o = options.customCellStyleArrangement) && void 0 !== _o ? _o : []);
863
865
  }
864
866
  renderWithRecreateCells() {
865
867
  const oldHoverState = {
@@ -1656,13 +1658,16 @@ class BaseTable extends EventTarget_1.EventTarget {
1656
1658
  }
1657
1659
  changeRecordOrder(source, target) {}
1658
1660
  hasCustomCellStyle(customStyleId) {
1659
- return this.customCellStylePlugin.hasCustomCellStyle(customStyleId);
1661
+ var _a;
1662
+ return null === (_a = this.customCellStylePlugin) || void 0 === _a ? void 0 : _a.hasCustomCellStyle(customStyleId);
1660
1663
  }
1661
1664
  registerCustomCellStyle(customStyleId, customStyle) {
1662
- this.customCellStylePlugin.registerCustomCellStyle(customStyleId, customStyle);
1665
+ var _a;
1666
+ null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.registerCustomCellStyle(customStyleId, customStyle);
1663
1667
  }
1664
1668
  arrangeCustomCellStyle(cellPos, customStyleId) {
1665
- this.customCellStylePlugin.arrangeCustomCellStyle(cellPos, customStyleId);
1669
+ var _a;
1670
+ null === (_a = this.customCellStylePlugin) || void 0 === _a || _a.arrangeCustomCellStyle(cellPos, customStyleId);
1666
1671
  }
1667
1672
  isSeriesNumber(col, row) {
1668
1673
  return this.internalProps.layoutMap.isSeriesNumber(col, row);