@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
@@ -76,7 +76,7 @@ export class BaseTable extends EventTarget {
76
76
  }
77
77
  constructor(container, options = {}) {
78
78
  var _a, _b, _c, _d, _e, _f, _g;
79
- if (super(), this.showFrozenIcon = !0, this.version = "0.19.2-alpha.2", this.id = `VTable${Date.now()}`,
79
+ if (super(), this.showFrozenIcon = !0, this.version = "0.19.2-alpha.3", this.id = `VTable${Date.now()}`,
80
80
  this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
81
81
  !container && "node" !== options.mode) throw new Error("vtable's container is undefined");
82
82
  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 = defaultPixelRatio, renderChartAsync: renderChartAsync, renderChartAsyncBatchCount: renderChartAsyncBatchCount, mode: mode, modeParams: modeParams, canvasWidth: canvasWidth, canvasHeight: canvasHeight, overscrollBehavior: overscrollBehavior, limitMinWidth: limitMinWidth} = options;
@@ -325,7 +325,7 @@ export class BaseTable extends EventTarget {
325
325
  this.internalProps.pixelRatio = pixelRatio, this.scenegraph.setPixelRatio(pixelRatio);
326
326
  }
327
327
  _updateSize() {
328
- 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;
328
+ 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;
329
329
  const {padding: padding} = this;
330
330
  let widthP = 0, heightP = 0;
331
331
  if ("browser" === Env.mode) {
@@ -342,10 +342,12 @@ export class BaseTable extends EventTarget {
342
342
  const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
343
343
  if (null === (_k = this.internalProps.theme) || void 0 === _k ? void 0 : _k.frameStyle) {
344
344
  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 ]);
345
- this.tableX = (null !== (_q = lineWidths[3]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[3]) && void 0 !== _r ? _r : 0),
346
- this.tableY = (null !== (_s = lineWidths[0]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[0]) && void 0 !== _t ? _t : 0),
347
- 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)),
348
- 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));
345
+ (null === (_q = this.theme.frameStyle) || void 0 === _q ? void 0 : _q.innerBorder) ? (this.tableX = 0,
346
+ this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_r = shadowWidths[1]) && void 0 !== _r ? _r : 0),
347
+ 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),
348
+ this.tableY = (null !== (_v = lineWidths[0]) && void 0 !== _v ? _v : 0) + (null !== (_w = shadowWidths[0]) && void 0 !== _w ? _w : 0),
349
+ 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)),
350
+ 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)));
349
351
  }
350
352
  }
351
353
  get rowHierarchyType() {
@@ -1041,11 +1043,12 @@ export class BaseTable extends EventTarget {
1041
1043
  }
1042
1044
  }
1043
1045
  getCellRange(col, row) {
1046
+ var _a;
1044
1047
  if (this.internalProps.customMergeCell) {
1045
1048
  const customMerge = this.internalProps.customMergeCell(col, row, this);
1046
1049
  if (customMerge && customMerge.range && customMerge.text) return customMerge.range;
1047
1050
  }
1048
- return this.internalProps.layoutMap.getCellRange(col, row);
1051
+ return null === (_a = this.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.getCellRange(col, row);
1049
1052
  }
1050
1053
  hasCustomMerge() {
1051
1054
  return !!this.internalProps.customMergeCell;
@@ -1142,7 +1145,7 @@ export class BaseTable extends EventTarget {
1142
1145
  field: this.getHeaderField(col, row),
1143
1146
  cellHeaderPaths: this.internalProps.layoutMap.getCellHeaderPaths(col, row),
1144
1147
  title: null == colDef ? void 0 : colDef.title,
1145
- cellType: (null == colDef ? void 0 : colDef.cellType) ? "string" == typeof colDef.cellType ? colDef.cellType : "progressbar" : "text",
1148
+ cellType: this.getCellType(col, row),
1146
1149
  originData: this.getCellOriginRecord(col, row),
1147
1150
  cellRange: this.getCellRangeRelativeRect({
1148
1151
  col: col,
@@ -1215,11 +1218,13 @@ export class BaseTable extends EventTarget {
1215
1218
  }
1216
1219
  return this.headerStyleCache.set(cacheKey, cacheStyle), cacheStyle;
1217
1220
  }
1218
- let cacheKey, cacheStyle;
1219
- if (cacheKey = this.isListTable() && !this.transpose || this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol ? col : row,
1221
+ let cacheKey;
1222
+ const cellType = this.getCellType(col, row);
1223
+ let cacheStyle;
1224
+ if (cacheKey = this.isListTable() && !this.transpose || this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol ? col + cellType : row + cellType,
1220
1225
  cacheStyle = layoutMap.isBottomFrozenRow(row) ? this.bodyBottomStyleCache.get(cacheKey) : this.bodyStyleCache.get(cacheKey),
1221
1226
  cacheStyle) return cacheStyle;
1222
- const column = layoutMap.getBody(col, row), styleClass = this.internalProps.bodyHelper.getStyleClass(column.cellType), style = null == column ? void 0 : column.style;
1227
+ const column = layoutMap.getBody(col, row), styleClass = this.internalProps.bodyHelper.getStyleClass(this.getCellType(col, row)), style = null == column ? void 0 : column.style;
1223
1228
  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, {
1224
1229
  col: col,
1225
1230
  row: row,