@visactor/vtable 0.19.2-alpha.2 → 0.19.2-alpha.3

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 (59) hide show
  1. package/cjs/ListTable.js +1 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/body-helper/body-helper.js +1 -0
  4. package/cjs/body-helper/body-helper.js.map +1 -1
  5. package/cjs/core/BaseTable.js +16 -11
  6. package/cjs/core/BaseTable.js.map +1 -1
  7. package/cjs/event/listener/table-group.js +14 -4
  8. package/cjs/event/listener/table-group.js.map +1 -1
  9. package/cjs/event/sparkline-event.js +1 -1
  10. package/cjs/event/sparkline-event.js.map +1 -1
  11. package/cjs/index.d.ts +1 -1
  12. package/cjs/index.js +1 -1
  13. package/cjs/index.js.map +1 -1
  14. package/cjs/scenegraph/scenegraph.js +20 -5
  15. package/cjs/scenegraph/scenegraph.js.map +1 -1
  16. package/cjs/scenegraph/style/frame-border.js +7 -4
  17. package/cjs/scenegraph/style/frame-border.js.map +1 -1
  18. package/cjs/state/hover/is-cell-hover.js +1 -1
  19. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  20. package/cjs/state/state.js +2 -2
  21. package/cjs/state/state.js.map +1 -1
  22. package/cjs/themes/theme.js +3 -0
  23. package/cjs/themes/theme.js.map +1 -1
  24. package/cjs/ts-types/list-table/layout-map/api.d.ts +1 -1
  25. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  26. package/cjs/ts-types/theme.d.ts +1 -0
  27. package/cjs/ts-types/theme.js.map +1 -1
  28. package/cjs/vrender.js.map +1 -1
  29. package/dist/vtable.js +133 -48
  30. package/dist/vtable.min.js +2 -2
  31. package/es/ListTable.js +1 -1
  32. package/es/ListTable.js.map +1 -1
  33. package/es/body-helper/body-helper.js +1 -0
  34. package/es/body-helper/body-helper.js.map +1 -1
  35. package/es/core/BaseTable.js +16 -11
  36. package/es/core/BaseTable.js.map +1 -1
  37. package/es/event/listener/table-group.js +14 -4
  38. package/es/event/listener/table-group.js.map +1 -1
  39. package/es/event/sparkline-event.js +1 -1
  40. package/es/event/sparkline-event.js.map +1 -1
  41. package/es/index.d.ts +1 -1
  42. package/es/index.js +1 -1
  43. package/es/index.js.map +1 -1
  44. package/es/scenegraph/scenegraph.js +20 -5
  45. package/es/scenegraph/scenegraph.js.map +1 -1
  46. package/es/scenegraph/style/frame-border.js +7 -4
  47. package/es/scenegraph/style/frame-border.js.map +1 -1
  48. package/es/state/hover/is-cell-hover.js +1 -1
  49. package/es/state/hover/is-cell-hover.js.map +1 -1
  50. package/es/state/state.js +2 -2
  51. package/es/state/state.js.map +1 -1
  52. package/es/themes/theme.js +3 -0
  53. package/es/themes/theme.js.map +1 -1
  54. package/es/ts-types/list-table/layout-map/api.d.ts +1 -1
  55. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  56. package/es/ts-types/theme.d.ts +1 -0
  57. package/es/ts-types/theme.js.map +1 -1
  58. package/es/vrender.js.map +1 -1
  59. package/package.json +2 -2
@@ -45,7 +45,7 @@ class BaseTable extends EventTarget_1.EventTarget {
45
45
  }
46
46
  constructor(container, options = {}) {
47
47
  var _a, _b, _c, _d, _e, _f, _g;
48
- if (super(), this.showFrozenIcon = !0, this.version = "0.19.2-alpha.2", this.id = `VTable${Date.now()}`,
48
+ if (super(), this.showFrozenIcon = !0, this.version = "0.19.2-alpha.3", this.id = `VTable${Date.now()}`,
49
49
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = (0, util_1.throttle2)(this.render.bind(this), 200),
50
50
  !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
51
51
  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, keyboardOptions: keyboardOptions, eventOptions: eventOptions, columnResizeMode: columnResizeMode, 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} = options;
@@ -296,7 +296,7 @@ class BaseTable extends EventTarget_1.EventTarget {
296
296
  this.internalProps.pixelRatio = pixelRatio, this.scenegraph.setPixelRatio(pixelRatio);
297
297
  }
298
298
  _updateSize() {
299
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
299
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
300
300
  const {padding: padding} = this;
301
301
  let widthP = 0, heightP = 0;
302
302
  if ("browser" === env_1.Env.mode) {
@@ -313,10 +313,12 @@ class BaseTable extends EventTarget_1.EventTarget {
313
313
  const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
314
314
  if (null === (_k = this.internalProps.theme) || void 0 === _k ? void 0 : _k.frameStyle) {
315
315
  const lineWidths = toBoxArray(null !== (_m = null === (_l = this.internalProps.theme.frameStyle) || void 0 === _l ? void 0 : _l.borderLineWidth) && void 0 !== _m ? _m : [ null ]), shadowWidths = toBoxArray(null !== (_p = null === (_o = this.internalProps.theme.frameStyle) || void 0 === _o ? void 0 : _o.shadowBlur) && void 0 !== _p ? _p : [ 0 ]);
316
- this.tableX = (null !== (_q = lineWidths[3]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[3]) && void 0 !== _r ? _r : 0),
317
- this.tableY = (null !== (_s = lineWidths[0]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[0]) && void 0 !== _t ? _t : 0),
318
- this.tableNoFrameWidth = width - ((null !== (_u = lineWidths[1]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[1]) && void 0 !== _v ? _v : 0)) - ((null !== (_w = lineWidths[3]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[3]) && void 0 !== _x ? _x : 0)),
319
- this.tableNoFrameHeight = height - ((null !== (_y = lineWidths[0]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[0]) && void 0 !== _z ? _z : 0)) - ((null !== (_0 = lineWidths[2]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[2]) && void 0 !== _1 ? _1 : 0));
316
+ (null === (_q = this.theme.frameStyle) || void 0 === _q ? void 0 : _q.innerBorder) ? (this.tableX = 0,
317
+ this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_r = shadowWidths[1]) && void 0 !== _r ? _r : 0),
318
+ this.tableNoFrameHeight = height - (null !== (_s = shadowWidths[2]) && void 0 !== _s ? _s : 0)) : (this.tableX = (null !== (_t = lineWidths[3]) && void 0 !== _t ? _t : 0) + (null !== (_u = shadowWidths[3]) && void 0 !== _u ? _u : 0),
319
+ this.tableY = (null !== (_v = lineWidths[0]) && void 0 !== _v ? _v : 0) + (null !== (_w = shadowWidths[0]) && void 0 !== _w ? _w : 0),
320
+ this.tableNoFrameWidth = width - ((null !== (_x = lineWidths[1]) && void 0 !== _x ? _x : 0) + (null !== (_y = shadowWidths[1]) && void 0 !== _y ? _y : 0)) - ((null !== (_z = lineWidths[3]) && void 0 !== _z ? _z : 0) + (null !== (_0 = shadowWidths[3]) && void 0 !== _0 ? _0 : 0)),
321
+ this.tableNoFrameHeight = height - ((null !== (_1 = lineWidths[0]) && void 0 !== _1 ? _1 : 0) + (null !== (_2 = shadowWidths[0]) && void 0 !== _2 ? _2 : 0)) - ((null !== (_3 = lineWidths[2]) && void 0 !== _3 ? _3 : 0) + (null !== (_4 = shadowWidths[2]) && void 0 !== _4 ? _4 : 0)));
320
322
  }
321
323
  }
322
324
  get rowHierarchyType() {
@@ -1015,11 +1017,12 @@ class BaseTable extends EventTarget_1.EventTarget {
1015
1017
  }
1016
1018
  }
1017
1019
  getCellRange(col, row) {
1020
+ var _a;
1018
1021
  if (this.internalProps.customMergeCell) {
1019
1022
  const customMerge = this.internalProps.customMergeCell(col, row, this);
1020
1023
  if (customMerge && customMerge.range && customMerge.text) return customMerge.range;
1021
1024
  }
1022
- return this.internalProps.layoutMap.getCellRange(col, row);
1025
+ return null === (_a = this.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.getCellRange(col, row);
1023
1026
  }
1024
1027
  hasCustomMerge() {
1025
1028
  return !!this.internalProps.customMergeCell;
@@ -1116,7 +1119,7 @@ class BaseTable extends EventTarget_1.EventTarget {
1116
1119
  field: this.getHeaderField(col, row),
1117
1120
  cellHeaderPaths: this.internalProps.layoutMap.getCellHeaderPaths(col, row),
1118
1121
  title: null == colDef ? void 0 : colDef.title,
1119
- cellType: (null == colDef ? void 0 : colDef.cellType) ? "string" == typeof colDef.cellType ? colDef.cellType : "progressbar" : "text",
1122
+ cellType: this.getCellType(col, row),
1120
1123
  originData: this.getCellOriginRecord(col, row),
1121
1124
  cellRange: this.getCellRangeRelativeRect({
1122
1125
  col: col,
@@ -1189,11 +1192,13 @@ class BaseTable extends EventTarget_1.EventTarget {
1189
1192
  }
1190
1193
  return this.headerStyleCache.set(cacheKey, cacheStyle), cacheStyle;
1191
1194
  }
1192
- let cacheKey, cacheStyle;
1193
- if (cacheKey = this.isListTable() && !this.transpose || this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol ? col : row,
1195
+ let cacheKey;
1196
+ const cellType = this.getCellType(col, row);
1197
+ let cacheStyle;
1198
+ if (cacheKey = this.isListTable() && !this.transpose || this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol ? col + cellType : row + cellType,
1194
1199
  cacheStyle = layoutMap.isBottomFrozenRow(row) ? this.bodyBottomStyleCache.get(cacheKey) : this.bodyStyleCache.get(cacheKey),
1195
1200
  cacheStyle) return cacheStyle;
1196
- const column = layoutMap.getBody(col, row), styleClass = this.internalProps.bodyHelper.getStyleClass(column.cellType), style = null == column ? void 0 : column.style;
1201
+ const column = layoutMap.getBody(col, row), styleClass = this.internalProps.bodyHelper.getStyleClass(this.getCellType(col, row)), style = null == column ? void 0 : column.style;
1197
1202
  return cacheStyle = columnStyleContents.of(style, layoutMap.isBottomFrozenRow(row) && this.theme.bottomFrozenStyle ? this.theme.bottomFrozenStyle : layoutMap.isRightFrozenColumn(col) && this.theme.rightFrozenStyle ? this.theme.rightFrozenStyle : this.theme.bodyStyle, {
1198
1203
  col: col,
1199
1204
  row: row,