k-vtable 1.0.34 → 1.0.35
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.
- package/cjs/ListTable.d.ts +1 -0
- package/cjs/ListTable.js +184 -25
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +3 -2
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -0
- package/cjs/PivotTable.js +95 -15
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +14 -0
- package/cjs/core/BaseTable.js +149 -41
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/record-helper.js +83 -13
- package/cjs/core/record-helper.js.map +1 -1
- package/cjs/core/tableHelper.js +5 -3
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/core/utils/get-cell-position.js +23 -12
- package/cjs/core/utils/get-cell-position.js.map +1 -1
- package/cjs/data/DataSource.js +3 -2
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/dataset/dataset.js +5 -1
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/edit/edit-manager.js +24 -16
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/EventTarget.js +3 -1
- package/cjs/event/EventTarget.js.map +1 -1
- package/cjs/event/helper.js +1 -1
- package/cjs/event/listener/container-dom.js +11 -6
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/scroll-bar.js +77 -6
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/listener/table-group.js +53 -23
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +1 -1
- package/cjs/event/scroll.js +35 -12
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/event/sparkline-event.js +1 -1
- package/cjs/event/util.d.ts +2 -0
- package/cjs/event/util.js +29 -4
- package/cjs/event/util.js.map +1 -1
- package/cjs/header-helper/header-helper.js +2 -2
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/header-helper/style.js +2 -1
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +51 -12
- package/cjs/index.js.map +1 -1
- package/cjs/layout/cell-range/simple-cell-range.js +14 -5
- package/cjs/layout/cell-range/simple-cell-range.js.map +1 -1
- package/cjs/plugins/index.js +1 -1
- package/cjs/plugins/interface.js +1 -1
- package/cjs/plugins/invert-highlight.js +1 -1
- package/cjs/plugins/list-tree-stick-cell.js +1 -1
- package/cjs/plugins/plugin-manager.js +1 -1
- package/cjs/scenegraph/component/table-component.d.ts +6 -1
- package/cjs/scenegraph/component/table-component.js +143 -17
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/component/util.js +5 -2
- package/cjs/scenegraph/component/util.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +29 -10
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +7 -4
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/init-scenegraph.js +37 -7
- package/cjs/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/proxy.js +4 -2
- package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +13 -0
- package/cjs/scenegraph/scenegraph.js +194 -23
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/create-select-border.js +9 -10
- package/cjs/scenegraph/select/create-select-border.js.map +1 -1
- package/cjs/scenegraph/select/delete-select-border.js.map +1 -1
- package/cjs/scenegraph/select/move-select-border.js.map +1 -1
- package/cjs/scenegraph/select/update-custom-select-border.js +9 -9
- package/cjs/scenegraph/select/update-custom-select-border.js.map +1 -1
- package/cjs/scenegraph/select/update-select-border.js +27 -122
- package/cjs/scenegraph/select/update-select-border.js.map +1 -1
- package/cjs/scenegraph/select/update-select-style.js.map +1 -1
- package/cjs/state/select/update-position.js +2 -1
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +8 -1
- package/cjs/state/state.js +82 -40
- package/cjs/state/state.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +15 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/dataset/aggregation.js +94 -39
- package/cjs/ts-types/dataset/aggregation.js.map +1 -1
- package/cjs/ts-types/events.d.ts +16 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +2381 -733
- package/dist/vtable.min.js +1 -15
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +178 -25
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +2 -2
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +1 -0
- package/es/PivotTable.js +93 -15
- package/es/PivotTable.js.map +1 -1
- package/es/core/BaseTable.d.ts +14 -0
- package/es/core/BaseTable.js +148 -40
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/es/core/TABLE_EVENT_TYPE.js +2 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/record-helper.js +83 -12
- package/es/core/record-helper.js.map +1 -1
- package/es/core/tableHelper.js +5 -3
- package/es/core/tableHelper.js.map +1 -1
- package/es/core/utils/get-cell-position.js +23 -12
- package/es/core/utils/get-cell-position.js.map +1 -1
- package/es/data/DataSource.js +3 -2
- package/es/data/DataSource.js.map +1 -1
- package/es/dataset/dataset.js +5 -1
- package/es/dataset/dataset.js.map +1 -1
- package/es/edit/edit-manager.js +22 -16
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/EventTarget.js +3 -1
- package/es/event/EventTarget.js.map +1 -1
- package/es/event/helper.js +1 -1
- package/es/event/listener/container-dom.js +10 -5
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/scroll-bar.js +75 -6
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/listener/table-group.js +53 -24
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +1 -1
- package/es/event/scroll.js +35 -12
- package/es/event/scroll.js.map +1 -1
- package/es/event/sparkline-event.js +1 -1
- package/es/event/util.d.ts +2 -0
- package/es/event/util.js +25 -1
- package/es/event/util.js.map +1 -1
- package/es/header-helper/header-helper.js +2 -2
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/header-helper/style.js +2 -1
- package/es/index.d.ts +3 -3
- package/es/index.js +5 -3
- package/es/index.js.map +1 -1
- package/es/layout/cell-range/simple-cell-range.js +14 -5
- package/es/layout/cell-range/simple-cell-range.js.map +1 -1
- package/es/plugins/index.js +1 -1
- package/es/plugins/interface.js +1 -1
- package/es/plugins/invert-highlight.js +1 -1
- package/es/plugins/list-tree-stick-cell.js +1 -1
- package/es/plugins/plugin-manager.js +1 -1
- package/es/scenegraph/component/table-component.d.ts +6 -1
- package/es/scenegraph/component/table-component.js +141 -17
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/component/util.js +5 -2
- package/es/scenegraph/component/util.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +29 -10
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +7 -4
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/init-scenegraph.js +37 -7
- package/es/scenegraph/group-creater/init-scenegraph.js.map +1 -1
- package/es/scenegraph/group-creater/progress/proxy.js +4 -2
- package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +13 -0
- package/es/scenegraph/scenegraph.js +185 -18
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/create-select-border.js +9 -10
- package/es/scenegraph/select/create-select-border.js.map +1 -1
- package/es/scenegraph/select/delete-select-border.js.map +1 -1
- package/es/scenegraph/select/move-select-border.js.map +1 -1
- package/es/scenegraph/select/update-custom-select-border.js +9 -9
- package/es/scenegraph/select/update-custom-select-border.js.map +1 -1
- package/es/scenegraph/select/update-select-border.js +25 -118
- package/es/scenegraph/select/update-select-border.js.map +1 -1
- package/es/scenegraph/select/update-select-style.js.map +1 -1
- package/es/state/select/update-position.js +3 -0
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.d.ts +8 -1
- package/es/state/state.js +81 -40
- package/es/state/state.js.map +1 -1
- package/es/ts-types/base-table.d.ts +15 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/dataset/aggregation.js +68 -38
- package/es/ts-types/dataset/aggregation.js.map +1 -1
- package/es/ts-types/events.d.ts +16 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +12 -11
|
@@ -7,6 +7,7 @@ import { CellMover } from './cell-mover';
|
|
|
7
7
|
import type { BaseTableAPI } from '../../ts-types/base-table';
|
|
8
8
|
export declare class TableComponent {
|
|
9
9
|
table: BaseTableAPI;
|
|
10
|
+
_horizontalScrollBarTarget?: 'body' | 'frozen' | 'rightFrozen' | 'all';
|
|
10
11
|
border: IRect;
|
|
11
12
|
columnResizeLine: ILine;
|
|
12
13
|
columnResizeBgLine: ILine;
|
|
@@ -17,6 +18,8 @@ export declare class TableComponent {
|
|
|
17
18
|
menu: MenuHandler;
|
|
18
19
|
vScrollBar: ScrollBar;
|
|
19
20
|
hScrollBar: ScrollBar;
|
|
21
|
+
frozenHScrollBar: ScrollBar;
|
|
22
|
+
rightFrozenHScrollBar: ScrollBar;
|
|
20
23
|
frozenShadowLine: IRect;
|
|
21
24
|
rightFrozenShadowLine: IRect;
|
|
22
25
|
topFrozenShadowLine: IRect;
|
|
@@ -51,9 +54,11 @@ export declare class TableComponent {
|
|
|
51
54
|
hideVerticalScrollBar(): void;
|
|
52
55
|
showVerticalScrollBar(): void;
|
|
53
56
|
hideHorizontalScrollBar(): void;
|
|
54
|
-
showHorizontalScrollBar(): void;
|
|
57
|
+
showHorizontalScrollBar(target?: 'body' | 'frozen' | 'rightFrozen' | 'all'): void;
|
|
55
58
|
updateVerticalScrollBarPos(topRatio: number): void;
|
|
56
59
|
updateHorizontalScrollBarPos(leftRatio: number): void;
|
|
60
|
+
updateFrozenHorizontalScrollBarPos(leftRatio: number): void;
|
|
61
|
+
updateRightFrozenHorizontalScrollBarPos(leftRatio: number): void;
|
|
57
62
|
updateHorizontalFrozenShadowLine: (rightRatio: number) => void;
|
|
58
63
|
updateVerticalFrozenShadowLine: (topRatio: number) => void;
|
|
59
64
|
updateStyle(): void;
|
|
@@ -248,7 +248,9 @@ export class TableComponent {
|
|
|
248
248
|
componentGroup.addChild(this.columnResizeLabel), componentGroup.addChild(this.rowResizeBgLine),
|
|
249
249
|
componentGroup.addChild(this.rowResizeLine), componentGroup.addChild(this.rowResizeLabel);
|
|
250
250
|
this.table.theme.scrollStyle.hoverOn && !this.table.theme.scrollStyle.barToSide ? (componentGroup.addChild(this.hScrollBar),
|
|
251
|
+
componentGroup.addChild(this.frozenHScrollBar), componentGroup.addChild(this.rightFrozenHScrollBar),
|
|
251
252
|
componentGroup.addChild(this.vScrollBar)) : (componentGroup.stage.defaultLayer.addChild(this.hScrollBar),
|
|
253
|
+
componentGroup.stage.defaultLayer.addChild(this.frozenHScrollBar), componentGroup.stage.defaultLayer.addChild(this.rightFrozenHScrollBar),
|
|
252
254
|
componentGroup.stage.defaultLayer.addChild(this.vScrollBar)), this.menu.bindTableComponent(componentGroup),
|
|
253
255
|
this.drillIcon.appand(componentGroup), this.cellMover.appand(componentGroup);
|
|
254
256
|
}
|
|
@@ -274,7 +276,33 @@ export class TableComponent {
|
|
|
274
276
|
sliderStyle: sliderStyle,
|
|
275
277
|
range: [ 0, .1 ],
|
|
276
278
|
visible: !1
|
|
277
|
-
}), this.hScrollBar.render(), this.hScrollBar.hideAll(), this.
|
|
279
|
+
}), this.hScrollBar.render(), this.hScrollBar.hideAll(), this.frozenHScrollBar = new ScrollBar({
|
|
280
|
+
direction: "horizontal",
|
|
281
|
+
x: 2 * -this.table.tableNoFrameWidth,
|
|
282
|
+
y: 2 * -this.table.tableNoFrameHeight,
|
|
283
|
+
width: this.table.tableNoFrameWidth,
|
|
284
|
+
height: width,
|
|
285
|
+
padding: horizontalPadding,
|
|
286
|
+
railStyle: {
|
|
287
|
+
fill: scrollRailColor
|
|
288
|
+
},
|
|
289
|
+
sliderStyle: sliderStyle,
|
|
290
|
+
range: [ 0, .1 ],
|
|
291
|
+
visible: !1
|
|
292
|
+
}), this.frozenHScrollBar.render(), this.frozenHScrollBar.hideAll(), this.rightFrozenHScrollBar = new ScrollBar({
|
|
293
|
+
direction: "horizontal",
|
|
294
|
+
x: 2 * -this.table.tableNoFrameWidth,
|
|
295
|
+
y: 2 * -this.table.tableNoFrameHeight,
|
|
296
|
+
width: this.table.tableNoFrameWidth,
|
|
297
|
+
height: width,
|
|
298
|
+
padding: horizontalPadding,
|
|
299
|
+
railStyle: {
|
|
300
|
+
fill: scrollRailColor
|
|
301
|
+
},
|
|
302
|
+
sliderStyle: sliderStyle,
|
|
303
|
+
range: [ 0, .1 ],
|
|
304
|
+
visible: !1
|
|
305
|
+
}), this.rightFrozenHScrollBar.render(), this.rightFrozenHScrollBar.hideAll(), this.vScrollBar = new ScrollBar({
|
|
278
306
|
direction: "vertical",
|
|
279
307
|
x: 2 * -this.table.tableNoFrameWidth,
|
|
280
308
|
y: 2 * -this.table.tableNoFrameHeight,
|
|
@@ -290,14 +318,15 @@ export class TableComponent {
|
|
|
290
318
|
}), this.vScrollBar.render(), this.vScrollBar.hideAll();
|
|
291
319
|
}
|
|
292
320
|
updateScrollBar() {
|
|
293
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
294
|
-
const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos, oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos, 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(), bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight(), rightFrozenColsWidth = this.table.getRightFrozenColsWidth(), hoverOn = this.table.theme.scrollStyle.hoverOn, sizeTolerance = (null === (
|
|
321
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
322
|
+
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;
|
|
295
323
|
if (totalWidth > tableWidth + sizeTolerance) {
|
|
296
|
-
const y = Math.min(tableHeight, totalHeight), rangeEnd = Math.max(.05,
|
|
324
|
+
const y = Math.min(tableHeight, totalHeight), bodyViewportWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth, bodyContentWidth = totalWidth - frozenColsContentWidth - rightFrozenColsContentWidth, rangeEnd = bodyContentWidth > 0 ? Math.max(.05, bodyViewportWidth / bodyContentWidth) : 1;
|
|
297
325
|
let attrY = 0;
|
|
298
326
|
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);
|
|
299
327
|
let hScrollBarx = frozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x), hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
|
|
300
|
-
null !== (
|
|
328
|
+
const ignoreFrozenCols = null !== (_q = null === (_p = this.table.theme.scrollStyle) || void 0 === _p ? void 0 : _p.ignoreFrozenCols) && void 0 !== _q && _q;
|
|
329
|
+
ignoreFrozenCols ? (hScrollBarx = hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x,
|
|
301
330
|
hScrollBarWidth = tableWidth) : (hScrollBarx = frozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x),
|
|
302
331
|
hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth), this.hScrollBar.setAttributes({
|
|
303
332
|
x: hScrollBarx,
|
|
@@ -311,11 +340,63 @@ export class TableComponent {
|
|
|
311
340
|
x: bounds.x1,
|
|
312
341
|
y: bounds.y1
|
|
313
342
|
}, "always" === horizontalVisible && this.hScrollBar.showAll();
|
|
343
|
+
const frozenScrollable = this.table.options.scrollFrozenCols && this.table.getFrozenColsOffset() > 0;
|
|
344
|
+
if (!ignoreFrozenCols && frozenScrollable) {
|
|
345
|
+
const frozenRangeEnd = Math.max(.05, frozenColsWidth / frozenColsContentWidth), x = hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x;
|
|
346
|
+
this.frozenHScrollBar.setAttributes({
|
|
347
|
+
x: x,
|
|
348
|
+
y: attrY,
|
|
349
|
+
width: frozenColsWidth,
|
|
350
|
+
range: [ 0, frozenRangeEnd ],
|
|
351
|
+
visible: "always" === horizontalVisible
|
|
352
|
+
});
|
|
353
|
+
const bounds = this.frozenHScrollBar.AABBBounds && this.frozenHScrollBar.globalAABBBounds;
|
|
354
|
+
this.frozenHScrollBar._viewPosition = {
|
|
355
|
+
x: bounds.x1,
|
|
356
|
+
y: bounds.y1
|
|
357
|
+
}, "always" === horizontalVisible && this.frozenHScrollBar.showAll();
|
|
358
|
+
} else this.frozenHScrollBar.setAttributes({
|
|
359
|
+
x: 2 * -this.table.tableNoFrameWidth,
|
|
360
|
+
y: 2 * -this.table.tableNoFrameHeight,
|
|
361
|
+
width: 0,
|
|
362
|
+
visible: !1
|
|
363
|
+
});
|
|
364
|
+
const rightFrozenScrollable = this.table.options.scrollRightFrozenCols && this.table.getRightFrozenColsOffset() > 0;
|
|
365
|
+
if (!ignoreFrozenCols && rightFrozenScrollable) {
|
|
366
|
+
const rightFrozenRangeEnd = Math.max(.05, rightFrozenColsWidth / rightFrozenColsContentWidth), x = tableWidth - rightFrozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x);
|
|
367
|
+
this.rightFrozenHScrollBar.setAttributes({
|
|
368
|
+
x: x,
|
|
369
|
+
y: attrY,
|
|
370
|
+
width: rightFrozenColsWidth,
|
|
371
|
+
range: [ 0, rightFrozenRangeEnd ],
|
|
372
|
+
visible: "always" === horizontalVisible
|
|
373
|
+
});
|
|
374
|
+
const bounds = this.rightFrozenHScrollBar.AABBBounds && this.rightFrozenHScrollBar.globalAABBBounds;
|
|
375
|
+
this.rightFrozenHScrollBar._viewPosition = {
|
|
376
|
+
x: bounds.x1,
|
|
377
|
+
y: bounds.y1
|
|
378
|
+
}, "always" === horizontalVisible && this.rightFrozenHScrollBar.showAll();
|
|
379
|
+
} else this.rightFrozenHScrollBar.setAttributes({
|
|
380
|
+
x: 2 * -this.table.tableNoFrameWidth,
|
|
381
|
+
y: 2 * -this.table.tableNoFrameHeight,
|
|
382
|
+
width: 0,
|
|
383
|
+
visible: !1
|
|
384
|
+
});
|
|
314
385
|
} else this.hScrollBar.setAttributes({
|
|
315
386
|
x: 2 * -this.table.tableNoFrameWidth,
|
|
316
387
|
y: 2 * -this.table.tableNoFrameHeight,
|
|
317
388
|
width: 0,
|
|
318
389
|
visible: !1
|
|
390
|
+
}), this.frozenHScrollBar.setAttributes({
|
|
391
|
+
x: 2 * -this.table.tableNoFrameWidth,
|
|
392
|
+
y: 2 * -this.table.tableNoFrameHeight,
|
|
393
|
+
width: 0,
|
|
394
|
+
visible: !1
|
|
395
|
+
}), this.rightFrozenHScrollBar.setAttributes({
|
|
396
|
+
x: 2 * -this.table.tableNoFrameWidth,
|
|
397
|
+
y: 2 * -this.table.tableNoFrameHeight,
|
|
398
|
+
width: 0,
|
|
399
|
+
visible: !1
|
|
319
400
|
});
|
|
320
401
|
if (totalHeight > tableHeight + sizeTolerance) {
|
|
321
402
|
const x = Math.min(tableWidth, totalWidth), rangeEnd = Math.max(.05, (tableHeight - frozenRowsHeight) / (totalHeight - frozenRowsHeight));
|
|
@@ -339,8 +420,9 @@ export class TableComponent {
|
|
|
339
420
|
height: 0,
|
|
340
421
|
visible: !1
|
|
341
422
|
});
|
|
342
|
-
this.table.stateManager.setScrollLeft(oldHorizontalBarPos), this.table.stateManager.
|
|
343
|
-
this.
|
|
423
|
+
this.table.stateManager.setScrollLeft(oldHorizontalBarPos), this.table.stateManager.setFrozenColsScrollLeft(oldFrozenHorizontalBarPos, !1),
|
|
424
|
+
this.table.stateManager.setRightFrozenColsScrollLeft(oldRightFrozenHorizontalBarPos, !1),
|
|
425
|
+
this.table.stateManager.setScrollTop(oldVerticalBarPos), this.setBottomFrozenColumnShadow();
|
|
344
426
|
}
|
|
345
427
|
hideResizeCol() {
|
|
346
428
|
this.columnResizeLine.setAttribute("visible", !1), this.columnResizeBgLine.setAttribute("visible", !1),
|
|
@@ -466,9 +548,9 @@ export class TableComponent {
|
|
|
466
548
|
this.cellMover.update(backX, lineX, backY, lineY);
|
|
467
549
|
}
|
|
468
550
|
setFrozenColumnShadow(col, isRightFrozen) {
|
|
469
|
-
var _a, _b;
|
|
470
|
-
const colX = getColX(col, this.table, isRightFrozen);
|
|
471
|
-
col < 0 || "always" !== (null === (
|
|
551
|
+
var _a, _b, _c, _d, _e;
|
|
552
|
+
const colX = !isRightFrozen && col === this.table.frozenColCount - 1 && (null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0) > 0 ? this.table.getFrozenColsWidth() : getColX(col, this.table, isRightFrozen);
|
|
553
|
+
col < 0 || "always" !== (null === (_e = null === (_d = this.table.theme.frozenColumnLine) || void 0 === _d ? void 0 : _d.shadow) || void 0 === _e ? void 0 : _e.visible) ? this.frozenShadowLine.setAttributes({
|
|
472
554
|
visible: !1,
|
|
473
555
|
x: colX,
|
|
474
556
|
height: this.table.getDrawRange().height
|
|
@@ -479,9 +561,9 @@ export class TableComponent {
|
|
|
479
561
|
});
|
|
480
562
|
}
|
|
481
563
|
setRightFrozenColumnShadow(col) {
|
|
482
|
-
var _a, _b;
|
|
483
|
-
const colX = getColX(col, this.table, !0);
|
|
484
|
-
col >= this.table.colCount || "always" !== (null === (
|
|
564
|
+
var _a, _b, _c, _d, _e;
|
|
565
|
+
const colX = this.table.options.scrollRightFrozenCols && (null !== (_c = null === (_b = (_a = this.table).getRightFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0) > 0 ? this.table.tableNoFrameWidth - this.table.getRightFrozenColsWidth() : getColX(col, this.table, !0);
|
|
566
|
+
col >= this.table.colCount || "always" !== (null === (_e = null === (_d = this.table.theme.frozenColumnLine) || void 0 === _d ? void 0 : _d.shadow) || void 0 === _e ? void 0 : _e.visible) ? this.rightFrozenShadowLine.setAttributes({
|
|
485
567
|
visible: !1,
|
|
486
568
|
x: colX - this.rightFrozenShadowLine.attribute.width,
|
|
487
569
|
height: this.table.getDrawRange().height
|
|
@@ -556,13 +638,23 @@ export class TableComponent {
|
|
|
556
638
|
var _a;
|
|
557
639
|
const visible1 = this.table.theme.scrollStyle.visible, horizontalVisible = null !== (_a = this.table.theme.scrollStyle.horizontalVisible) && void 0 !== _a ? _a : visible1;
|
|
558
640
|
"focus" !== horizontalVisible && "scrolling" !== horizontalVisible || (this.hScrollBar.setAttribute("visible", !1),
|
|
559
|
-
this.hScrollBar.hideAll(), this.
|
|
641
|
+
this.hScrollBar.hideAll(), this.frozenHScrollBar.setAttribute("visible", !1), this.frozenHScrollBar.hideAll(),
|
|
642
|
+
this.rightFrozenHScrollBar.setAttribute("visible", !1), this.rightFrozenHScrollBar.hideAll(),
|
|
643
|
+
this._horizontalScrollBarTarget = void 0, this.table.scenegraph.updateNextFrame());
|
|
560
644
|
}
|
|
561
|
-
showHorizontalScrollBar() {
|
|
645
|
+
showHorizontalScrollBar(target = "all") {
|
|
562
646
|
var _a;
|
|
563
647
|
const visible1 = this.table.theme.scrollStyle.visible, horizontalVisible = null !== (_a = this.table.theme.scrollStyle.horizontalVisible) && void 0 !== _a ? _a : visible1;
|
|
564
|
-
"focus" !== horizontalVisible && "scrolling" !== horizontalVisible
|
|
565
|
-
this.
|
|
648
|
+
if ("focus" !== horizontalVisible && "scrolling" !== horizontalVisible) return;
|
|
649
|
+
if (this._horizontalScrollBarTarget === target) return;
|
|
650
|
+
this._horizontalScrollBarTarget = target;
|
|
651
|
+
const showFrozen = "all" === target || "frozen" === target, showRightFrozen = "all" === target || "rightFrozen" === target, bodyVisible = ("all" === target || "body" === target) && this.hScrollBar.attribute.width > 0;
|
|
652
|
+
this.hScrollBar.setAttribute("visible", bodyVisible), bodyVisible ? this.hScrollBar.showAll() : this.hScrollBar.hideAll();
|
|
653
|
+
const frozenVisible = showFrozen && this.frozenHScrollBar.attribute.width > 0;
|
|
654
|
+
this.frozenHScrollBar.setAttribute("visible", frozenVisible), frozenVisible ? this.frozenHScrollBar.showAll() : this.frozenHScrollBar.hideAll();
|
|
655
|
+
const rightFrozenVisible = showRightFrozen && this.rightFrozenHScrollBar.attribute.width > 0;
|
|
656
|
+
this.rightFrozenHScrollBar.setAttribute("visible", rightFrozenVisible), rightFrozenVisible ? this.rightFrozenHScrollBar.showAll() : this.rightFrozenHScrollBar.hideAll(),
|
|
657
|
+
this.table.scenegraph.updateNextFrame();
|
|
566
658
|
}
|
|
567
659
|
updateVerticalScrollBarPos(topRatio) {
|
|
568
660
|
this.updateVerticalFrozenShadowLine(topRatio);
|
|
@@ -584,6 +676,24 @@ export class TableComponent {
|
|
|
584
676
|
y: bounds.y1
|
|
585
677
|
};
|
|
586
678
|
}
|
|
679
|
+
updateFrozenHorizontalScrollBarPos(leftRatio) {
|
|
680
|
+
const range = this.frozenHScrollBar.attribute.range, size = range[1] - range[0], range0 = leftRatio * (1 - size);
|
|
681
|
+
this.frozenHScrollBar.setAttribute("range", [ range0, range0 + size ]);
|
|
682
|
+
const bounds = this.frozenHScrollBar.AABBBounds && this.frozenHScrollBar.globalAABBBounds;
|
|
683
|
+
this.frozenHScrollBar._viewPosition = {
|
|
684
|
+
x: bounds.x1,
|
|
685
|
+
y: bounds.y1
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
updateRightFrozenHorizontalScrollBarPos(leftRatio) {
|
|
689
|
+
const range = this.rightFrozenHScrollBar.attribute.range, size = range[1] - range[0], range0 = leftRatio * (1 - size);
|
|
690
|
+
this.rightFrozenHScrollBar.setAttribute("range", [ range0, range0 + size ]);
|
|
691
|
+
const bounds = this.rightFrozenHScrollBar.AABBBounds && this.rightFrozenHScrollBar.globalAABBBounds;
|
|
692
|
+
this.rightFrozenHScrollBar._viewPosition = {
|
|
693
|
+
x: bounds.x1,
|
|
694
|
+
y: bounds.y1
|
|
695
|
+
};
|
|
696
|
+
}
|
|
587
697
|
updateStyle() {
|
|
588
698
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
589
699
|
const theme = this.table.theme, scrollRailColor = null === (_a = theme.scrollStyle) || void 0 === _a ? void 0 : _a.scrollRailColor, scrollSliderColor = null === (_b = theme.scrollStyle) || void 0 === _b ? void 0 : _b.scrollSliderColor, scrollSliderCornerRadius = null === (_c = theme.scrollStyle) || void 0 === _c ? void 0 : _c.scrollSliderCornerRadius, width = null === (_d = theme.scrollStyle) || void 0 === _d ? void 0 : _d.width, horizontalPadding = null === (_e = theme.scrollStyle) || void 0 === _e ? void 0 : _e.horizontalPadding, verticalPadding = null === (_f = theme.scrollStyle) || void 0 === _f ? void 0 : _f.verticalPadding;
|
|
@@ -607,6 +717,20 @@ export class TableComponent {
|
|
|
607
717
|
fill: scrollRailColor
|
|
608
718
|
},
|
|
609
719
|
sliderStyle: sliderStyle
|
|
720
|
+
}), this.frozenHScrollBar.setAttributes({
|
|
721
|
+
height: width,
|
|
722
|
+
padding: horizontalPadding,
|
|
723
|
+
railStyle: {
|
|
724
|
+
fill: scrollRailColor
|
|
725
|
+
},
|
|
726
|
+
sliderStyle: sliderStyle
|
|
727
|
+
}), this.rightFrozenHScrollBar.setAttributes({
|
|
728
|
+
height: width,
|
|
729
|
+
padding: horizontalPadding,
|
|
730
|
+
railStyle: {
|
|
731
|
+
fill: scrollRailColor
|
|
732
|
+
},
|
|
733
|
+
sliderStyle: sliderStyle
|
|
610
734
|
});
|
|
611
735
|
const columnResizeColor = null === (_g = theme.columnResize) || void 0 === _g ? void 0 : _g.lineColor, columnResizeWidth = null === (_h = theme.columnResize) || void 0 === _h ? void 0 : _h.lineWidth, columnResizeBgColor = null === (_j = theme.columnResize) || void 0 === _j ? void 0 : _j.bgColor, columnResizeBgWidth = null === (_k = theme.columnResize) || void 0 === _k ? void 0 : _k.width;
|
|
612
736
|
this.columnResizeLine.setAttributes({
|