@visactor/vtable 1.26.2 → 1.26.3-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 (61) hide show
  1. package/cjs/dataset/DataStatistics.js +1 -2
  2. package/cjs/edit/edit-manager.js +1 -0
  3. package/cjs/event/EventHandler.js +1 -1
  4. package/cjs/event/EventTarget.js +1 -1
  5. package/cjs/event/drill.js +1 -1
  6. package/cjs/event/event.js +1 -1
  7. package/cjs/event/helper.js +1 -1
  8. package/cjs/event/media-click.js +1 -1
  9. package/cjs/event/scroll.js +1 -1
  10. package/cjs/event/sparkline-event.js +1 -1
  11. package/cjs/event/util.js +1 -1
  12. package/cjs/header-helper/style.js +2 -1
  13. package/cjs/layout/pivot-header-layout.js +0 -1
  14. package/cjs/plugins/index.js +1 -1
  15. package/cjs/plugins/interface.js +1 -1
  16. package/cjs/plugins/invert-highlight.js +1 -1
  17. package/cjs/plugins/list-tree-stick-cell.js +1 -1
  18. package/cjs/plugins/plugin-manager.js +1 -1
  19. package/cjs/scenegraph/component/table-component.js +41 -50
  20. package/cjs/scenegraph/component/table-component.js.map +1 -1
  21. package/cjs/scenegraph/component/util.d.ts +1 -0
  22. package/cjs/scenegraph/component/util.js +9 -1
  23. package/cjs/scenegraph/component/util.js.map +1 -1
  24. package/cjs/scenegraph/scenegraph.js +6 -4
  25. package/cjs/scenegraph/scenegraph.js.map +1 -1
  26. package/cjs/state/state.js +16 -16
  27. package/cjs/state/state.js.map +1 -1
  28. package/cjs/themes/ARCO.js +1 -1
  29. package/cjs/themes/BRIGHT.js +1 -1
  30. package/dist/vtable.js +80 -78
  31. package/dist/vtable.min.js +1 -1
  32. package/es/dataset/DataStatistics.js +1 -2
  33. package/es/edit/edit-manager.js +2 -1
  34. package/es/event/EventHandler.js +1 -1
  35. package/es/event/EventTarget.js +1 -1
  36. package/es/event/drill.js +1 -1
  37. package/es/event/event.js +1 -1
  38. package/es/event/helper.js +1 -1
  39. package/es/event/media-click.js +1 -1
  40. package/es/event/scroll.js +1 -1
  41. package/es/event/sparkline-event.js +1 -1
  42. package/es/event/util.js +1 -1
  43. package/es/header-helper/style.js +2 -1
  44. package/es/layout/pivot-header-layout.js +1 -2
  45. package/es/plugins/index.js +1 -1
  46. package/es/plugins/interface.js +1 -1
  47. package/es/plugins/invert-highlight.js +1 -1
  48. package/es/plugins/list-tree-stick-cell.js +1 -1
  49. package/es/plugins/plugin-manager.js +1 -1
  50. package/es/scenegraph/component/table-component.js +41 -51
  51. package/es/scenegraph/component/table-component.js.map +1 -1
  52. package/es/scenegraph/component/util.d.ts +1 -0
  53. package/es/scenegraph/component/util.js +6 -0
  54. package/es/scenegraph/component/util.js.map +1 -1
  55. package/es/scenegraph/scenegraph.js +6 -4
  56. package/es/scenegraph/scenegraph.js.map +1 -1
  57. package/es/state/state.js +16 -14
  58. package/es/state/state.js.map +1 -1
  59. package/es/themes/ARCO.js +1 -1
  60. package/es/themes/BRIGHT.js +1 -1
  61. package/package.json +4 -4
@@ -70,5 +70,4 @@ export function dateFormat(baseField, formatString, utcOutput, mthNames, dayName
70
70
  }
71
71
  }));
72
72
  };
73
- }
74
- //# sourceMappingURL=DataStatistics.js.map
73
+ }
@@ -163,4 +163,5 @@ function dealWithValidateValue(validateValue, editManager, oldValue, resolve) {
163
163
  editManager.doExit(), null == resolve || resolve(!0), !0) : "validate-not-exit" === validateValue || "invalidate-not-exit" === validateValue ? (null == resolve || resolve(!1),
164
164
  !1) : !0 === validateValue ? (editManager.doExit(), null == resolve || resolve(!0),
165
165
  !0) : (null == resolve || resolve(!1), !1);
166
- }
166
+ }
167
+ //# sourceMappingURL=edit-manager.js.map
@@ -116,4 +116,4 @@ export class EventHandler {
116
116
  "node" !== Env.mode && (this.clear(), this.listeners = {});
117
117
  }
118
118
  }
119
- //# sourceMappingURL=EventHandler.js.map
119
+ //# sourceMappingURL=EventHandler.js.map
@@ -57,4 +57,4 @@ export class EventTarget {
57
57
  delete this.listenersData;
58
58
  }
59
59
  }
60
- //# sourceMappingURL=EventTarget.js.map
60
+ //# sourceMappingURL=EventTarget.js.map
package/es/event/drill.js CHANGED
@@ -29,4 +29,4 @@ export function checkHaveDrill(table) {
29
29
  }
30
30
  return !1;
31
31
  }
32
- //# sourceMappingURL=drill.js.map
32
+ //# sourceMappingURL=drill.js.map
package/es/event/event.js CHANGED
@@ -582,4 +582,4 @@ export class EventManager {
582
582
  return values;
583
583
  }
584
584
  }
585
- //# sourceMappingURL=event.js.map
585
+ //# sourceMappingURL=event.js.map
@@ -34,4 +34,4 @@ export function fireMoveColEventListeners(table, endMoveColSuccess, e) {
34
34
  });
35
35
  }
36
36
  }
37
- //# sourceMappingURL=helper.js.map
37
+ //# sourceMappingURL=helper.js.map
@@ -82,4 +82,4 @@ export function bindMediaClick(table) {
82
82
  }
83
83
  }));
84
84
  }
85
- //# sourceMappingURL=media-click.js.map
85
+ //# sourceMappingURL=media-click.js.map
@@ -112,4 +112,4 @@ export class InertiaScroll {
112
112
  return !!this.runingId;
113
113
  }
114
114
  }
115
- //# sourceMappingURL=scroll.js.map
115
+ //# sourceMappingURL=scroll.js.map
@@ -16,4 +16,4 @@ export function bindSparklineHoverEvent(table) {
16
16
  table.stateManager.updateSparklineHoverPose(-1, -1, 0, 0);
17
17
  })));
18
18
  }
19
- //# sourceMappingURL=sparkline-event.js.map
19
+ //# sourceMappingURL=sparkline-event.js.map
package/es/event/util.js CHANGED
@@ -70,4 +70,4 @@ export function setDataToHTML(data) {
70
70
  })), result.push("<tr>", ...rowValues, "</tr>"), rowIndex === rows.length - 1 && result.push("</tbody>");
71
71
  })), result.push("</table>"), [ META_HEAD, result.join("") ].join("");
72
72
  }
73
- //# sourceMappingURL=util.js.map
73
+ //# sourceMappingURL=util.js.map
@@ -13,4 +13,5 @@ export function of(headerStyle, defaultHeaderStyle, styleArg, StyleClass, global
13
13
  return headerStyle || defaultHeaderStyle ? headerStyle instanceof Style ? headerStyle : "function" == typeof headerStyle ? of(headerStyle(styleArg), defaultHeaderStyle, styleArg, StyleClass, globalAutoWrapText, theme) : (headerStyle || (headerStyle = {}),
14
14
  globalAutoWrapText && !isValid(headerStyle.autoWrapText) && (headerStyle.autoWrapText = !0),
15
15
  StyleClass === CheckboxStyle ? new CheckboxStyle(null != headerStyle ? headerStyle : {}, null != defaultHeaderStyle ? defaultHeaderStyle : {}, null !== (_a = theme.checkboxStyle) && void 0 !== _a ? _a : {}) : new StyleClass(null != headerStyle ? headerStyle : {}, null != defaultHeaderStyle ? defaultHeaderStyle : {})) : StyleClass.DEFAULT;
16
- }
16
+ }
17
+ //# sourceMappingURL=style.js.map
@@ -2025,5 +2025,4 @@ function bandSpace(count, paddingInner, paddingOuter) {
2025
2025
  let space;
2026
2026
  return space = 1 === count ? count + 2 * paddingOuter : count - paddingInner + 2 * paddingOuter,
2027
2027
  count ? space > 0 ? space : 1 : 0;
2028
- }
2029
- //# sourceMappingURL=pivot-header-layout.js.map
2028
+ }
@@ -1,4 +1,4 @@
1
1
  export { PluginManager } from "./plugin-manager";
2
2
 
3
3
  export { CustomCellStylePlugin } from "./custom-cell-style";
4
- //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
1
  export { };
2
- //# sourceMappingURL=interface.js.map
2
+ //# sourceMappingURL=interface.js.map
@@ -11,4 +11,4 @@ export function onBeforeAttributeUpdateForInvertHighlight(val, attribute) {
11
11
  });
12
12
  }
13
13
  }
14
- //# sourceMappingURL=invert-highlight.js.map
14
+ //# sourceMappingURL=invert-highlight.js.map
@@ -205,4 +205,4 @@ function keepRowAtVisiblePosition(col, row, visibleTop, table) {
205
205
  export const registerListTreeStickCellPlugin = () => {
206
206
  Factory.registerComponent("listTreeStickCellPlugin", ListTreeStickCellPlugin);
207
207
  };
208
- //# sourceMappingURL=list-tree-stick-cell.js.map
208
+ //# sourceMappingURL=list-tree-stick-cell.js.map
@@ -51,4 +51,4 @@ export class PluginManager {
51
51
  }));
52
52
  }
53
53
  }
54
- //# sourceMappingURL=plugin-manager.js.map
54
+ //# sourceMappingURL=plugin-manager.js.map
@@ -8,7 +8,7 @@ import { DrillIcon } from "./drill-icon";
8
8
 
9
9
  import { CellMover } from "./cell-mover";
10
10
 
11
- import { getColX, getRowY } from "./util";
11
+ import { getBodyHorizontalScrollRange, getColX, getRowY } from "./util";
12
12
 
13
13
  import { isValid } from "@visactor/vutils";
14
14
 
@@ -260,13 +260,13 @@ export class TableComponent {
260
260
  }
261
261
  updateScrollBar() {
262
262
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
263
- const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos, oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos, oldFrozenHorizontalBarPos = this.table.stateManager.scroll.frozenHorizontalBarPos, oldRightFrozenHorizontalBarPos = this.table.stateManager.scroll.rightFrozenHorizontalBarPos, theme = this.table.theme, width = null === (_a = theme.scrollStyle) || void 0 === _a ? void 0 : _a.width, visible1 = null === (_b = theme.scrollStyle) || void 0 === _b ? void 0 : _b.visible, horizontalVisible = null !== (_d = null === (_c = theme.scrollStyle) || void 0 === _c ? void 0 : _c.horizontalVisible) && void 0 !== _d ? _d : visible1, verticalVisible = null !== (_f = null === (_e = theme.scrollStyle) || void 0 === _e ? void 0 : _e.verticalVisible) && void 0 !== _f ? _f : visible1, tableWidth = Math.ceil(this.table.tableNoFrameWidth), tableHeight = Math.ceil(this.table.tableNoFrameHeight), totalHeight = this.table.getAllRowsHeight(), totalWidth = this.table.getAllColsWidth(), frozenRowsHeight = this.table.getFrozenRowsHeight(), frozenColsWidth = this.table.getFrozenColsWidth(), frozenColsContentWidth = null !== (_j = null === (_h = (_g = this.table).getFrozenColsContentWidth) || void 0 === _h ? void 0 : _h.call(_g)) && void 0 !== _j ? _j : frozenColsWidth, bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.table.getRightFrozenColsWidth(), rightFrozenColsContentWidth = null !== (_m = null === (_l = (_k = this.table).getRightFrozenColsContentWidth) || void 0 === _l ? void 0 : _l.call(_k)) && void 0 !== _m ? _m : rightFrozenColsWidth, hoverOn = this.table.theme.scrollStyle.hoverOn, sizeTolerance = (null === (_o = this.table.options.customConfig) || void 0 === _o ? void 0 : _o._disableColumnAndRowSizeRound) ? 1 : 0;
264
- if (totalWidth > tableWidth + sizeTolerance) {
265
- const y = Math.min(tableHeight, totalHeight), bodyViewportWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth, bodyContentWidth = totalWidth - frozenColsContentWidth - rightFrozenColsContentWidth, rangeEnd = bodyContentWidth > 0 ? Math.max(.05, bodyViewportWidth / bodyContentWidth) : 1;
266
- let attrY = 0;
267
- attrY = this.table.theme.scrollStyle.barToSide ? this.table.tableNoFrameHeight - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) + this.table.tableY : y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
263
+ const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos, oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos, oldFrozenHorizontalBarPos = this.table.stateManager.scroll.frozenHorizontalBarPos, oldRightFrozenHorizontalBarPos = this.table.stateManager.scroll.rightFrozenHorizontalBarPos, theme = this.table.theme, width = null === (_a = theme.scrollStyle) || void 0 === _a ? void 0 : _a.width, visible1 = null === (_b = theme.scrollStyle) || void 0 === _b ? void 0 : _b.visible, horizontalVisible = null !== (_d = null === (_c = theme.scrollStyle) || void 0 === _c ? void 0 : _c.horizontalVisible) && void 0 !== _d ? _d : visible1, verticalVisible = null !== (_f = null === (_e = theme.scrollStyle) || void 0 === _e ? void 0 : _e.verticalVisible) && void 0 !== _f ? _f : visible1, tableWidth = Math.ceil(this.table.tableNoFrameWidth), tableHeight = Math.ceil(this.table.tableNoFrameHeight), totalHeight = this.table.getAllRowsHeight(), totalWidth = this.table.getAllColsWidth(), frozenRowsHeight = this.table.getFrozenRowsHeight(), frozenColsWidth = this.table.getFrozenColsWidth(), frozenColsContentWidth = null !== (_j = null === (_h = (_g = this.table).getFrozenColsContentWidth) || void 0 === _h ? void 0 : _h.call(_g)) && void 0 !== _j ? _j : frozenColsWidth, bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.table.getRightFrozenColsWidth(), rightFrozenColsContentWidth = null !== (_m = null === (_l = (_k = this.table).getRightFrozenColsContentWidth) || void 0 === _l ? void 0 : _l.call(_k)) && void 0 !== _m ? _m : rightFrozenColsWidth, hoverOn = this.table.theme.scrollStyle.hoverOn, sizeTolerance = (null === (_o = this.table.options.customConfig) || void 0 === _o ? void 0 : _o._disableColumnAndRowSizeRound) ? 1 : 0, bodyScrollRange = getBodyHorizontalScrollRange(this.table), y = Math.min(tableHeight, totalHeight);
264
+ let attrY = 0;
265
+ attrY = this.table.theme.scrollStyle.barToSide ? this.table.tableNoFrameHeight - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) + this.table.tableY : y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
266
+ const ignoreFrozenCols = null !== (_q = null === (_p = this.table.theme.scrollStyle) || void 0 === _p ? void 0 : _p.ignoreFrozenCols) && void 0 !== _q && _q;
267
+ if (bodyScrollRange > sizeTolerance) {
268
+ const bodyViewportWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth, bodyContentWidth = bodyViewportWidth + bodyScrollRange, rangeEnd = bodyContentWidth > 0 ? Math.max(.05, bodyViewportWidth / bodyContentWidth) : 1;
268
269
  let hScrollBarx = frozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x), hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
269
- const ignoreFrozenCols = null !== (_q = null === (_p = this.table.theme.scrollStyle) || void 0 === _p ? void 0 : _p.ignoreFrozenCols) && void 0 !== _q && _q;
270
270
  ignoreFrozenCols ? (hScrollBarx = hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x,
271
271
  hScrollBarWidth = tableWidth) : (hScrollBarx = frozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x),
272
272
  hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth), this.hScrollBar.setAttributes({
@@ -281,59 +281,49 @@ export class TableComponent {
281
281
  x: bounds.x1,
282
282
  y: bounds.y1
283
283
  }, "always" === horizontalVisible && this.hScrollBar.showAll();
284
- const frozenScrollable = this.table.options.scrollFrozenCols && this.table.getFrozenColsOffset() > 0;
285
- if (!ignoreFrozenCols && frozenScrollable) {
286
- const frozenRangeEnd = Math.max(.05, frozenColsWidth / frozenColsContentWidth), x = hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x;
287
- this.frozenHScrollBar.setAttributes({
288
- x: x,
289
- y: attrY,
290
- width: frozenColsWidth,
291
- range: [ 0, frozenRangeEnd ],
292
- visible: "always" === horizontalVisible
293
- });
294
- const bounds = this.frozenHScrollBar.AABBBounds && this.frozenHScrollBar.globalAABBBounds;
295
- this.frozenHScrollBar._viewPosition = {
296
- x: bounds.x1,
297
- y: bounds.y1
298
- }, "always" === horizontalVisible && this.frozenHScrollBar.showAll();
299
- } else this.frozenHScrollBar.setAttributes({
300
- x: 2 * -this.table.tableNoFrameWidth,
301
- y: 2 * -this.table.tableNoFrameHeight,
302
- width: 0,
303
- visible: !1
304
- });
305
- const rightFrozenScrollable = this.table.options.scrollRightFrozenCols && this.table.getRightFrozenColsOffset() > 0;
306
- if (!ignoreFrozenCols && rightFrozenScrollable) {
307
- const rightFrozenRangeEnd = Math.max(.05, rightFrozenColsWidth / rightFrozenColsContentWidth), x = tableWidth - rightFrozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x);
308
- this.rightFrozenHScrollBar.setAttributes({
309
- x: x,
310
- y: attrY,
311
- width: rightFrozenColsWidth,
312
- range: [ 0, rightFrozenRangeEnd ],
313
- visible: "always" === horizontalVisible
314
- });
315
- const bounds = this.rightFrozenHScrollBar.AABBBounds && this.rightFrozenHScrollBar.globalAABBBounds;
316
- this.rightFrozenHScrollBar._viewPosition = {
317
- x: bounds.x1,
318
- y: bounds.y1
319
- }, "always" === horizontalVisible && this.rightFrozenHScrollBar.showAll();
320
- } else this.rightFrozenHScrollBar.setAttributes({
321
- x: 2 * -this.table.tableNoFrameWidth,
322
- y: 2 * -this.table.tableNoFrameHeight,
323
- width: 0,
324
- visible: !1
325
- });
326
284
  } else this.hScrollBar.setAttributes({
327
285
  x: 2 * -this.table.tableNoFrameWidth,
328
286
  y: 2 * -this.table.tableNoFrameHeight,
329
287
  width: 0,
330
288
  visible: !1
331
- }), this.frozenHScrollBar.setAttributes({
289
+ });
290
+ const frozenScrollable = this.table.options.scrollFrozenCols && this.table.getFrozenColsOffset() > 0;
291
+ if (!ignoreFrozenCols && frozenScrollable) {
292
+ const frozenRangeEnd = Math.max(.05, frozenColsWidth / frozenColsContentWidth), x = hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x;
293
+ this.frozenHScrollBar.setAttributes({
294
+ x: x,
295
+ y: attrY,
296
+ width: frozenColsWidth,
297
+ range: [ 0, frozenRangeEnd ],
298
+ visible: "always" === horizontalVisible
299
+ });
300
+ const bounds = this.frozenHScrollBar.AABBBounds && this.frozenHScrollBar.globalAABBBounds;
301
+ this.frozenHScrollBar._viewPosition = {
302
+ x: bounds.x1,
303
+ y: bounds.y1
304
+ }, "always" === horizontalVisible && this.frozenHScrollBar.showAll();
305
+ } else this.frozenHScrollBar.setAttributes({
332
306
  x: 2 * -this.table.tableNoFrameWidth,
333
307
  y: 2 * -this.table.tableNoFrameHeight,
334
308
  width: 0,
335
309
  visible: !1
336
- }), this.rightFrozenHScrollBar.setAttributes({
310
+ });
311
+ const rightFrozenScrollable = this.table.options.scrollRightFrozenCols && this.table.getRightFrozenColsOffset() > 0;
312
+ if (!ignoreFrozenCols && rightFrozenScrollable) {
313
+ const rightFrozenRangeEnd = Math.max(.05, rightFrozenColsWidth / rightFrozenColsContentWidth), x = tableWidth - rightFrozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x);
314
+ this.rightFrozenHScrollBar.setAttributes({
315
+ x: x,
316
+ y: attrY,
317
+ width: rightFrozenColsWidth,
318
+ range: [ 0, rightFrozenRangeEnd ],
319
+ visible: "always" === horizontalVisible
320
+ });
321
+ const bounds = this.rightFrozenHScrollBar.AABBBounds && this.rightFrozenHScrollBar.globalAABBBounds;
322
+ this.rightFrozenHScrollBar._viewPosition = {
323
+ x: bounds.x1,
324
+ y: bounds.y1
325
+ }, "always" === horizontalVisible && this.rightFrozenHScrollBar.showAll();
326
+ } else this.rightFrozenHScrollBar.setAttributes({
337
327
  x: 2 * -this.table.tableNoFrameWidth,
338
328
  y: 2 * -this.table.tableNoFrameHeight,
339
329
  width: 0,