@visactor/vtable 0.25.6 → 0.25.8-alpha.0

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 (33) hide show
  1. package/cjs/core/BaseTable.d.ts +4 -1
  2. package/cjs/core/BaseTable.js +26 -8
  3. package/cjs/core/BaseTable.js.map +1 -1
  4. package/cjs/index.d.ts +1 -1
  5. package/cjs/index.js +1 -1
  6. package/cjs/index.js.map +1 -1
  7. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +8 -7
  8. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  9. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +24 -18
  10. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  11. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +18 -16
  12. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  13. package/cjs/ts-types/base-table.d.ts +7 -0
  14. package/cjs/ts-types/base-table.js.map +1 -1
  15. package/cjs/vrender.js.map +1 -1
  16. package/dist/vtable.js +48 -9
  17. package/dist/vtable.min.js +2 -2
  18. package/es/core/BaseTable.d.ts +4 -1
  19. package/es/core/BaseTable.js +27 -8
  20. package/es/core/BaseTable.js.map +1 -1
  21. package/es/index.d.ts +1 -1
  22. package/es/index.js +1 -1
  23. package/es/index.js.map +1 -1
  24. package/es/scenegraph/graphic/contributions/group-contribution-render.js +8 -7
  25. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  26. package/es/scenegraph/group-creater/cell-type/image-cell.js +21 -17
  27. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  28. package/es/scenegraph/group-creater/cell-type/video-cell.js +18 -15
  29. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  30. package/es/ts-types/base-table.d.ts +7 -0
  31. package/es/ts-types/base-table.js.map +1 -1
  32. package/es/vrender.js.map +1 -1
  33. package/package.json +5 -5
package/dist/vtable.js CHANGED
@@ -36677,7 +36677,10 @@
36677
36677
  function createImageCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme, isAsync) {
36678
36678
  const headerStyle = table._getCellStyle(col, row);
36679
36679
  const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
36680
- if (isValid$3(functionalPadding)) {
36680
+ if (table.options.customConfig?.imageMargin) {
36681
+ padding = getQuadProps(table.options.customConfig?.imageMargin);
36682
+ }
36683
+ else if (isValid$3(functionalPadding)) {
36681
36684
  padding = functionalPadding;
36682
36685
  }
36683
36686
  if (cellTheme?.text?.textAlign) {
@@ -36830,7 +36833,13 @@
36830
36833
  const headerStyle = table._getCellStyle(col, row);
36831
36834
  const textAlign = getProp('textAlign', headerStyle, col, row, table) ?? 'left';
36832
36835
  const textBaseline = getProp('textBaseline', headerStyle, col, row, table) ?? 'middle';
36833
- const padding = getQuadProps(getProp('padding', headerStyle, col, row, table)) ?? [0, 0, 0, 0];
36836
+ let padding;
36837
+ if (table.options.customConfig?.imageMargin) {
36838
+ padding = getQuadProps(table.options.customConfig?.imageMargin);
36839
+ }
36840
+ else {
36841
+ padding = getQuadProps(getProp('padding', headerStyle, col, row, table)) ?? [0, 0, 0, 0];
36842
+ }
36834
36843
  const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, table);
36835
36844
  const colStart = cellGroup.mergeStartCol ?? cellGroup.col;
36836
36845
  const rowStart = cellGroup.mergeStartRow ?? cellGroup.row;
@@ -38731,7 +38740,10 @@
38731
38740
  function createVideoCellGroup(columnGroup, xOrigin, yOrigin, col, row, width, height, keepAspectRatio, imageAutoSizing, padding, textAlign, textBaseline, table, cellTheme, isAsync) {
38732
38741
  const headerStyle = table._getCellStyle(col, row);
38733
38742
  const functionalPadding = getFunctionalProp('padding', headerStyle, col, row, table);
38734
- if (isValid$3(functionalPadding)) {
38743
+ if (table.options.customConfig?.imageMargin) {
38744
+ padding = getQuadProps(table.options.customConfig?.imageMargin);
38745
+ }
38746
+ else if (isValid$3(functionalPadding)) {
38735
38747
  padding = functionalPadding;
38736
38748
  }
38737
38749
  if (cellTheme?.text?.textAlign) {
@@ -44045,7 +44057,7 @@
44045
44057
  if (stroke &&
44046
44058
  Array.isArray(lineDash) &&
44047
44059
  lineDash.length &&
44048
- lineDash[0].length &&
44060
+ lineDash[0]?.length &&
44049
44061
  !Array.isArray(strokeArrayColor) &&
44050
44062
  !Array.isArray(strokeArrayWidth)) {
44051
44063
  doFillOrStroke.doStroke = false;
@@ -44062,7 +44074,7 @@
44062
44074
  drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
44063
44075
  const { lineDash = groupAttribute.lineDash, stroke = groupAttribute.stroke, strokeArrayColor = groupAttribute.strokeArrayColor, strokeArrayWidth = groupAttribute.strokeArrayWidth, lineWidth = groupAttribute.lineWidth } = group.attribute;
44064
44076
  if (!stroke ||
44065
- !(Array.isArray(lineDash) && lineDash.length && lineDash[0].length) ||
44077
+ !(Array.isArray(lineDash) && lineDash.length && lineDash[0]?.length) ||
44066
44078
  Array.isArray(strokeArrayColor) ||
44067
44079
  Array.isArray(strokeArrayWidth)) {
44068
44080
  return;
@@ -58370,7 +58382,7 @@
58370
58382
  return TABLE_EVENT_TYPE;
58371
58383
  }
58372
58384
  options;
58373
- version = "0.25.6";
58385
+ version = "0.25.8-alpha.0";
58374
58386
  pagination;
58375
58387
  id = `VTable${Date.now()}`;
58376
58388
  headerStyleCache;
@@ -60895,7 +60907,7 @@
60895
60907
  const c = this.scenegraph.stage.toCanvas();
60896
60908
  return c.toDataURL();
60897
60909
  }
60898
- exportCellImg(col, row) {
60910
+ exportCellImg(col, row, options) {
60899
60911
  const isInView = this.cellIsInVisualView(col, row);
60900
60912
  const { scrollTop, scrollLeft } = this;
60901
60913
  if (!isInView) {
@@ -60909,16 +60921,43 @@
60909
60921
  this.stateManager.updateHoverPos(-1, -1);
60910
60922
  this.scenegraph.component.hideVerticalScrollBar();
60911
60923
  this.scenegraph.component.hideHorizontalScrollBar();
60924
+ this.scenegraph.tableGroup.border.setAttribute('visible', false);
60925
+ let oldFill;
60926
+ if (options?.disableBackground) {
60927
+ const cellGroup = this.scenegraph.getCell(col, row);
60928
+ oldFill = cellGroup.attribute.fill;
60929
+ cellGroup.setAttribute('fill', 'transparent');
60930
+ }
60931
+ let oldStroke;
60932
+ if (options?.disableBorder) {
60933
+ const cellGroup = this.scenegraph.getCell(col, row);
60934
+ oldStroke = cellGroup.attribute.stroke;
60935
+ cellGroup.setAttribute('stroke', false);
60936
+ }
60912
60937
  this.scenegraph.renderSceneGraph();
60913
- const c = this.scenegraph.stage.toCanvas(false, new AABBBounds().set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY));
60938
+ let sizeOffset = 0;
60939
+ if (this.theme.cellBorderClipDirection === 'bottom-right') {
60940
+ sizeOffset = 1;
60941
+ }
60942
+ const c = this.scenegraph.stage.toCanvas(false, new AABBBounds().set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX - sizeOffset, cellRect.bottom + this.tableY - sizeOffset));
60914
60943
  if (!isInView) {
60915
60944
  this.setScrollTop(scrollTop);
60916
60945
  this.setScrollLeft(scrollLeft);
60917
60946
  }
60947
+ this.scenegraph.tableGroup.border.setAttribute('visible', true);
60948
+ if (oldFill) {
60949
+ const cellGroup = this.scenegraph.getCell(col, row);
60950
+ cellGroup.setAttribute('fill', oldFill);
60951
+ }
60952
+ if (oldStroke) {
60953
+ const cellGroup = this.scenegraph.getCell(col, row);
60954
+ cellGroup.setAttribute('stroke', oldStroke);
60955
+ }
60918
60956
  if (this.stateManager.select?.ranges?.length > 0) {
60919
60957
  restoreCellSelectBorder(this.scenegraph);
60920
60958
  }
60921
60959
  this.stateManager.updateHoverPos(hoverCol, hoverRow);
60960
+ this.scenegraph.updateNextFrame();
60922
60961
  return c.toDataURL();
60923
60962
  }
60924
60963
  exportCellRangeImg(cellRange) {
@@ -71090,7 +71129,7 @@
71090
71129
  }
71091
71130
 
71092
71131
  registerForVrender();
71093
- const version = "0.25.6";
71132
+ const version = "0.25.8-alpha.0";
71094
71133
  function getIcons() {
71095
71134
  return get$2();
71096
71135
  }