@visactor/vtable 1.3.2-alpha.2 → 1.3.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.
- package/cjs/ListTable.js +7 -6
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +0 -1
- package/cjs/PivotChart.js +0 -4
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/components/axis/axis.js +2 -3
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/empty-tip/empty-tip.js +2 -2
- package/cjs/components/empty-tip/empty-tip.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -2
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/react/react-custom-layout.d.ts +21 -0
- package/cjs/components/react/react-custom-layout.js +48 -0
- package/cjs/components/react/react-custom-layout.js.map +1 -0
- package/cjs/components/tooltip/TooltipHandler.js +1 -3
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js +7 -3
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +7 -4
- package/cjs/core/BaseTable.js +229 -80
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.d.ts +0 -1
- package/cjs/core/FouseInput.js +2 -5
- package/cjs/core/FouseInput.js.map +1 -1
- package/cjs/core/style.js +1 -1
- package/cjs/core/style.js.map +1 -1
- package/cjs/dataset/dataset.d.ts +2 -0
- package/cjs/dataset/dataset.js +8 -7
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/event.js +1 -2
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +1 -1
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +5 -3
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +2 -1
- package/cjs/event/sparkline-event.js +1 -2
- package/cjs/event/util.js +2 -2
- package/cjs/event/util.js.map +1 -1
- package/cjs/index.d.ts +3 -1
- package/cjs/index.js +13 -4
- package/cjs/index.js.map +1 -1
- package/cjs/layout/layout-helper.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +57 -37
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/custom.js +6 -4
- package/cjs/scenegraph/component/custom.js.map +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
- package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +0 -1
- package/cjs/scenegraph/graphic/chart.js +20 -34
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
- package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +4 -0
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +3 -0
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +0 -1
- package/cjs/scenegraph/refresh-node/update-chart.js +2 -9
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +15 -12
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/themes/ARCO.js +1 -1
- package/cjs/themes/BRIGHT.js +1 -1
- package/cjs/themes/DARK.js +1 -1
- package/cjs/themes/DEFAULT.js +1 -1
- package/cjs/themes/SIMPLIFY.js +1 -1
- package/cjs/themes/theme.js +6 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/LimitPromiseQueue.js +1 -1
- package/cjs/tools/NumberMap.js +1 -1
- package/cjs/tools/Rect.js +1 -1
- package/cjs/tools/calc.js +1 -1
- package/cjs/tools/debounce.js +1 -1
- package/cjs/tools/diff-cell.js +2 -2
- package/cjs/ts-types/base-table.d.ts +12 -15
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/customLayout.d.ts +1 -1
- package/cjs/ts-types/customLayout.js.map +1 -1
- package/cjs/ts-types/icon.d.ts +2 -0
- package/cjs/ts-types/icon.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/ts-types/tooltip.d.ts +2 -0
- package/cjs/ts-types/tooltip.js.map +1 -1
- package/cjs/vrender.d.ts +4 -0
- package/cjs/vrender.js +39 -11
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +25304 -9898
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +3 -3
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +0 -1
- package/es/PivotChart.js +2 -5
- package/es/PivotChart.js.map +1 -1
- package/es/components/axis/axis.js +1 -3
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/empty-tip/empty-tip.js +2 -2
- package/es/components/empty-tip/empty-tip.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +1 -2
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/react/react-custom-layout.d.ts +21 -0
- package/es/components/react/react-custom-layout.js +38 -0
- package/es/components/react/react-custom-layout.js.map +1 -0
- package/es/components/tooltip/TooltipHandler.js +1 -3
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElement.js +7 -3
- package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElementStyle.js.map +1 -1
- package/es/core/BaseTable.d.ts +7 -4
- package/es/core/BaseTable.js +232 -82
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.d.ts +0 -1
- package/es/core/FouseInput.js +2 -5
- package/es/core/FouseInput.js.map +1 -1
- package/es/core/style.js +1 -1
- package/es/core/style.js.map +1 -1
- package/es/dataset/dataset.d.ts +2 -0
- package/es/dataset/dataset.js +8 -7
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/event.js +1 -2
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +1 -1
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +5 -3
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +2 -1
- package/es/event/sparkline-event.js +1 -2
- package/es/event/util.js +2 -2
- package/es/event/util.js.map +1 -1
- package/es/index.d.ts +3 -1
- package/es/index.js +5 -1
- package/es/index.js.map +1 -1
- package/es/layout/layout-helper.js.map +1 -1
- package/es/layout/pivot-header-layout.js +56 -36
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/component/custom.js +7 -3
- package/es/scenegraph/component/custom.js.map +1 -1
- package/es/scenegraph/debug-tool/debug-tool.js +1 -4
- package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +0 -1
- package/es/scenegraph/graphic/chart.js +21 -33
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +8 -20
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
- package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +4 -0
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +2 -2
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +2 -2
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +3 -0
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +0 -1
- package/es/scenegraph/refresh-node/update-chart.js +0 -6
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +15 -12
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/themes/ARCO.js +1 -1
- package/es/themes/BRIGHT.js +1 -1
- package/es/themes/DARK.js +1 -1
- package/es/themes/DEFAULT.js +1 -1
- package/es/themes/SIMPLIFY.js +1 -1
- package/es/themes/theme.js +6 -0
- package/es/themes/theme.js.map +1 -1
- package/es/tools/LimitPromiseQueue.js +1 -1
- package/es/tools/NumberMap.js +1 -1
- package/es/tools/Rect.js +1 -1
- package/es/tools/calc.js +1 -1
- package/es/tools/debounce.js +1 -1
- package/es/tools/diff-cell.js +1 -1
- package/es/ts-types/base-table.d.ts +12 -15
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/customLayout.d.ts +1 -1
- package/es/ts-types/customLayout.js.map +1 -1
- package/es/ts-types/icon.d.ts +2 -0
- package/es/ts-types/icon.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/ts-types/tooltip.d.ts +2 -0
- package/es/ts-types/tooltip.js.map +1 -1
- package/es/vrender.d.ts +4 -0
- package/es/vrender.js +9 -3
- package/es/vrender.js.map +1 -1
- package/package.json +6 -5
- package/cjs/core/utils/get-cell-position.d.ts +0 -42
- package/cjs/core/utils/get-cell-position.js +0 -206
- package/cjs/core/utils/get-cell-position.js.map +0 -1
- package/es/core/utils/get-cell-position.d.ts +0 -42
- package/es/core/utils/get-cell-position.js +0 -194
- package/es/core/utils/get-cell-position.js.map +0 -1
package/es/core/BaseTable.js
CHANGED
|
@@ -46,7 +46,7 @@ import { getProp } from "../scenegraph/utils/get-prop";
|
|
|
46
46
|
|
|
47
47
|
import { IconCache } from "../plugins/icons";
|
|
48
48
|
|
|
49
|
-
import { _applyColWidthLimits, _getScrollableVisibleRect, _setDataSource, _toPxWidth, createRootElement, getStyleTheme, updateRootElementPadding } from "./tableHelper";
|
|
49
|
+
import { _applyColWidthLimits, _getScrollableVisibleRect, _getTargetFrozenColAt, _getTargetFrozenRowAt, _setDataSource, _toPxWidth, createRootElement, getStyleTheme, updateRootElementPadding } from "./tableHelper";
|
|
50
50
|
|
|
51
51
|
import { MenuHandler } from "../components/menu/dom/MenuHandler";
|
|
52
52
|
|
|
@@ -70,9 +70,9 @@ import { CustomCellStylePlugin, mergeStyle } from "../plugins/custom-cell-style"
|
|
|
70
70
|
|
|
71
71
|
import { hideCellSelectBorder, restoreCellSelectBorder } from "../scenegraph/select/update-select-border";
|
|
72
72
|
|
|
73
|
-
import {
|
|
73
|
+
import { ReactCustomLayout } from "../components/react/react-custom-layout";
|
|
74
74
|
|
|
75
|
-
import {
|
|
75
|
+
import { hasAutoImageColumn } from "../layout/layout-helper";
|
|
76
76
|
|
|
77
77
|
const {toBoxArray: toBoxArray} = utilStyle, {isTouchEvent: isTouchEvent} = event, rangeReg = /^\$(\d+)\$(\d+)$/;
|
|
78
78
|
|
|
@@ -85,10 +85,10 @@ export class BaseTable extends EventTarget {
|
|
|
85
85
|
return TABLE_EVENT_TYPE;
|
|
86
86
|
}
|
|
87
87
|
constructor(container, options = {}) {
|
|
88
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
89
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.3.
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
89
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.3.3-alpha.0", this.id = `VTable${Date.now()}`,
|
|
90
90
|
this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200),
|
|
91
|
-
!container && "node" !== options.mode
|
|
91
|
+
!container && "node" !== options.mode) throw new Error("vtable's container is undefined");
|
|
92
92
|
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, widthAdaptiveMode: widthAdaptiveMode = "only-body", heightAdaptiveMode: heightAdaptiveMode = "only-body", keyboardOptions: keyboardOptions, eventOptions: eventOptions, rowSeriesNumber: rowSeriesNumber, columnResizeMode: columnResizeMode, rowResizeMode: rowResizeMode = "none", 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, limitMinHeight: limitMinHeight, clearDOM: clearDOM = !0} = options;
|
|
93
93
|
this.container = container, this.options = options, this._widthMode = widthMode,
|
|
94
94
|
this._heightMode = heightMode, this._widthAdaptiveMode = widthAdaptiveMode, this._heightAdaptiveMode = heightAdaptiveMode,
|
|
@@ -106,12 +106,14 @@ export class BaseTable extends EventTarget {
|
|
|
106
106
|
this.columnWidthComputeMode = null !== (_a = options.columnWidthComputeMode) && void 0 !== _a ? _a : "normal";
|
|
107
107
|
const internalProps = this.internalProps = {};
|
|
108
108
|
if (void 0 !== showFrozenIcon && (this.showFrozenIcon = showFrozenIcon), "number" == typeof allowFrozenColCount && allowFrozenColCount <= 0 && (this.showFrozenIcon = !1),
|
|
109
|
-
|
|
110
|
-
internalProps.element.style.position = "relative", internalProps.focusControl = new FocusInput(this, internalProps.element),
|
|
111
|
-
internalProps.canvas = this.options.canvas, internalProps.context = internalProps.canvas.getContext("2d")) : "node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
|
|
109
|
+
"node" !== Env.mode && (internalProps.element = createRootElement(this.padding),
|
|
112
110
|
internalProps.focusControl = new FocusInput(this, internalProps.element), internalProps.canvas = document.createElement("canvas"),
|
|
113
|
-
internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d")
|
|
114
|
-
|
|
111
|
+
internalProps.element.appendChild(internalProps.canvas), internalProps.context = internalProps.canvas.getContext("2d"),
|
|
112
|
+
(null === (_b = options.customConfig) || void 0 === _b ? void 0 : _b.createReactContainer) && (internalProps.bodyDomContainer = document.createElement("div"),
|
|
113
|
+
internalProps.bodyDomContainer.classList.add("table-component-container"), internalProps.element.appendChild(internalProps.bodyDomContainer),
|
|
114
|
+
internalProps.headerDomContainer = document.createElement("div"), internalProps.headerDomContainer.classList.add("table-component-container"),
|
|
115
|
+
internalProps.element.appendChild(internalProps.headerDomContainer))), internalProps.handler = new EventHandler,
|
|
116
|
+
isNumber(this.options.resizeTime) && (internalProps.handler.resizeTime = this.options.resizeTime),
|
|
115
117
|
internalProps.pixelRatio = pixelRatio, internalProps.frozenColCount = frozenColCount,
|
|
116
118
|
internalProps.defaultRowHeight = defaultRowHeight, internalProps.defaultHeaderRowHeight = null != defaultHeaderRowHeight ? defaultHeaderRowHeight : defaultRowHeight,
|
|
117
119
|
internalProps.defaultColWidth = defaultColWidth, internalProps.defaultHeaderColWidth = null != defaultHeaderColWidth ? defaultHeaderColWidth : defaultColWidth,
|
|
@@ -129,15 +131,15 @@ export class BaseTable extends EventTarget {
|
|
|
129
131
|
var _a;
|
|
130
132
|
return "node" === Env.mode ? canvasWidth / (null != pixelRatio ? pixelRatio : 1) : this._.canvas.width / (null !== (_a = this._.context.pixelRatio) && void 0 !== _a ? _a : window.devicePixelRatio);
|
|
131
133
|
}
|
|
132
|
-
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (
|
|
134
|
+
}, internalProps.cellTextOverflows = {}, internalProps.focusedTable = !1, internalProps.theme = themes.of(null !== (_c = options.theme) && void 0 !== _c ? _c : themes.DEFAULT),
|
|
133
135
|
internalProps.theme.isPivot = this.isPivotTable(), container ? (clearDOM && (container.innerHTML = ""),
|
|
134
136
|
container.appendChild(internalProps.element), this._updateSize()) : this._updateSize(),
|
|
135
|
-
this.options = options, internalProps.theme = themes.of(null !== (
|
|
137
|
+
this.options = options, internalProps.theme = themes.of(null !== (_d = options.theme) && void 0 !== _d ? _d : themes.DEFAULT),
|
|
136
138
|
internalProps.theme.isPivot = this.isPivotTable(), internalProps.bodyHelper = new BodyHelper(this),
|
|
137
139
|
internalProps.headerHelper = new HeaderHelper(this), internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this),
|
|
138
140
|
internalProps.autoWrapText = options.autoWrapText, internalProps.enableLineBreak = options.enableLineBreak,
|
|
139
|
-
internalProps.allowFrozenColCount = null !== (
|
|
140
|
-
internalProps.limitMaxAutoWidth = null !== (
|
|
141
|
+
internalProps.allowFrozenColCount = null !== (_e = options.allowFrozenColCount) && void 0 !== _e ? _e : 0,
|
|
142
|
+
internalProps.limitMaxAutoWidth = null !== (_f = options.limitMaxAutoWidth) && void 0 !== _f ? _f : 450,
|
|
141
143
|
internalProps.limitMinWidth = null != limitMinWidth ? "number" == typeof limitMinWidth ? limitMinWidth : limitMinWidth ? 10 : 0 : 10,
|
|
142
144
|
internalProps.limitMinHeight = null != limitMinHeight ? "number" == typeof limitMinHeight ? limitMinHeight : limitMinHeight ? 10 : 0 : 10,
|
|
143
145
|
this._vDataSet = new DataSet, this.scenegraph = new Scenegraph(this), this.stateManager = new StateManager(this),
|
|
@@ -159,13 +161,13 @@ export class BaseTable extends EventTarget {
|
|
|
159
161
|
}, options.tooltip), "html" === internalProps.tooltip.renderMode && (internalProps.tooltipHandler = new TooltipHandler(this, internalProps.tooltip.confine)),
|
|
160
162
|
internalProps.menu = Object.assign({
|
|
161
163
|
renderMode: "html"
|
|
162
|
-
}, options.menu), Array.isArray(null === (
|
|
163
|
-
Array.isArray(null === (
|
|
164
|
+
}, options.menu), Array.isArray(null === (_g = options.menu) || void 0 === _g ? void 0 : _g.dropDownMenuHighlight) && this.setDropDownMenuHighlight(null === (_h = options.menu) || void 0 === _h ? void 0 : _h.dropDownMenuHighlight),
|
|
165
|
+
Array.isArray(null === (_j = options.menu) || void 0 === _j ? void 0 : _j.defaultHeaderMenuItems) && (this.globalDropDownMenu = options.menu.defaultHeaderMenuItems),
|
|
164
166
|
"html" === internalProps.menu.renderMode && (internalProps.menuHandler = new MenuHandler(this)),
|
|
165
167
|
this.headerStyleCache = new Map, this.bodyStyleCache = new Map, this.bodyBottomStyleCache = new Map,
|
|
166
168
|
internalProps.stick = {
|
|
167
169
|
changedCells: new Map
|
|
168
|
-
}, internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (
|
|
170
|
+
}, internalProps.customMergeCell = options.customMergeCell, this.customCellStylePlugin = new CustomCellStylePlugin(this, null !== (_k = options.customCellStyle) && void 0 !== _k ? _k : [], null !== (_l = options.customCellStyleArrangement) && void 0 !== _l ? _l : []);
|
|
169
171
|
}
|
|
170
172
|
getContainer() {
|
|
171
173
|
return this.container;
|
|
@@ -197,8 +199,8 @@ export class BaseTable extends EventTarget {
|
|
|
197
199
|
this.internalProps.colCount = colCount;
|
|
198
200
|
}
|
|
199
201
|
get frozenColCount() {
|
|
200
|
-
var _a, _b, _c;
|
|
201
|
-
return null !== (
|
|
202
|
+
var _a, _b, _c, _d, _e;
|
|
203
|
+
return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.frozenColCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.frozenColCount) && void 0 !== _e ? _e : 0;
|
|
202
204
|
}
|
|
203
205
|
set frozenColCount(frozenColCount) {
|
|
204
206
|
frozenColCount >= this.colCount && (frozenColCount = 0), this.internalProps.frozenColCount = frozenColCount,
|
|
@@ -217,22 +219,22 @@ export class BaseTable extends EventTarget {
|
|
|
217
219
|
this.options.frozenColCount && (this.tableNoFrameWidth - this.getColsWidth(0, this.options.frozenColCount - 1) <= 120 ? this._setFrozenColCount(0) : this.frozenColCount !== this.options.frozenColCount && this._setFrozenColCount(this.options.frozenColCount));
|
|
218
220
|
}
|
|
219
221
|
get frozenRowCount() {
|
|
220
|
-
var _a, _b, _c;
|
|
221
|
-
return null !== (
|
|
222
|
+
var _a, _b, _c, _d, _e;
|
|
223
|
+
return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.frozenRowCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.frozenRowCount) && void 0 !== _e ? _e : 0;
|
|
222
224
|
}
|
|
223
225
|
set frozenRowCount(frozenRowCount) {
|
|
224
226
|
this.internalProps.frozenRowCount = frozenRowCount;
|
|
225
227
|
}
|
|
226
228
|
get rightFrozenColCount() {
|
|
227
|
-
var _a, _b, _c;
|
|
228
|
-
return null !== (
|
|
229
|
+
var _a, _b, _c, _d, _e;
|
|
230
|
+
return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.rightFrozenColCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.rightFrozenColCount) && void 0 !== _e ? _e : 0;
|
|
229
231
|
}
|
|
230
232
|
set rightFrozenColCount(rightFrozenColCount) {
|
|
231
233
|
this.scenegraph.dealWidthRightFrozen(rightFrozenColCount);
|
|
232
234
|
}
|
|
233
235
|
get bottomFrozenRowCount() {
|
|
234
|
-
var _a, _b, _c;
|
|
235
|
-
return null !== (
|
|
236
|
+
var _a, _b, _c, _d, _e;
|
|
237
|
+
return null !== (_e = null !== (_c = null === (_b = null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.layoutMap) || void 0 === _b ? void 0 : _b.bottomFrozenRowCount) && void 0 !== _c ? _c : null === (_d = this.internalProps) || void 0 === _d ? void 0 : _d.bottomFrozenRowCount) && void 0 !== _e ? _e : 0;
|
|
236
238
|
}
|
|
237
239
|
set bottomFrozenRowCount(bottomFrozenRowCount) {
|
|
238
240
|
this.scenegraph.dealWidthBottomFrozen(bottomFrozenRowCount);
|
|
@@ -376,11 +378,10 @@ export class BaseTable extends EventTarget {
|
|
|
376
378
|
}
|
|
377
379
|
}
|
|
378
380
|
_updateSize() {
|
|
379
|
-
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
|
|
381
|
+
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;
|
|
380
382
|
const {padding: padding} = this;
|
|
381
383
|
let widthP = 0, heightP = 0;
|
|
382
|
-
if (
|
|
383
|
-
heightP = this.options.viewBox.y2 - this.options.viewBox.y1, (null === (_a = null == this ? void 0 : this.scenegraph) || void 0 === _a ? void 0 : _a.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP)); else if ("browser" === Env.mode) {
|
|
384
|
+
if ("browser" === Env.mode) {
|
|
384
385
|
const element = this.getElement();
|
|
385
386
|
let widthWithoutPadding = 0, heightWithoutPadding = 0;
|
|
386
387
|
if (element.parentElement) {
|
|
@@ -392,31 +393,25 @@ export class BaseTable extends EventTarget {
|
|
|
392
393
|
element.style.width = width1 && width1 - padding.left - padding.right + "px" || "0px",
|
|
393
394
|
element.style.height = height1 && height1 - padding.top - padding.bottom + "px" || "0px";
|
|
394
395
|
const {canvas: canvas} = this.internalProps;
|
|
395
|
-
widthP = null !== (
|
|
396
|
-
heightP = null !== (
|
|
397
|
-
(null === (
|
|
396
|
+
widthP = null !== (_b = null === (_a = canvas.parentElement) || void 0 === _a ? void 0 : _a.offsetWidth) && void 0 !== _b ? _b : 0,
|
|
397
|
+
heightP = null !== (_d = null === (_c = canvas.parentElement) || void 0 === _c ? void 0 : _c.offsetHeight) && void 0 !== _d ? _d : 0,
|
|
398
|
+
(null === (_e = null == this ? void 0 : this.scenegraph) || void 0 === _e ? void 0 : _e.stage) ? this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "",
|
|
398
399
|
canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`,
|
|
399
|
-
canvas.style.height = `${heightP}px`)
|
|
400
|
+
canvas.style.height = `${heightP}px`), this.internalProps.bodyDomContainer && (this.internalProps.bodyDomContainer.style.width = `${widthP}px`,
|
|
401
|
+
this.internalProps.bodyDomContainer.style.height = `${heightP}px`), this.internalProps.headerDomContainer && (this.internalProps.headerDomContainer.style.width = `${widthP}px`,
|
|
402
|
+
this.internalProps.headerDomContainer.style.height = `${heightP}px`);
|
|
400
403
|
} else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
|
|
401
404
|
const width = Math.floor(widthP - style.getScrollBarSize(this.getTheme().scrollStyle)), height = Math.floor(heightP - style.getScrollBarSize(this.getTheme().scrollStyle));
|
|
402
|
-
if (null === (
|
|
403
|
-
const lineWidths = toBoxArray(null !== (
|
|
404
|
-
(null === (
|
|
405
|
-
this.tableY = 0, this.tableNoFrameWidth = width - (null !== (
|
|
406
|
-
this.tableNoFrameHeight = height - (null !== (
|
|
407
|
-
this.tableY = (null !== (
|
|
408
|
-
this.tableNoFrameWidth = width - ((null !== (
|
|
409
|
-
this.tableNoFrameHeight = height - ((null !== (
|
|
405
|
+
if (null === (_f = this.internalProps.theme) || void 0 === _f ? void 0 : _f.frameStyle) {
|
|
406
|
+
const lineWidths = toBoxArray(null !== (_h = null === (_g = this.internalProps.theme.frameStyle) || void 0 === _g ? void 0 : _g.borderLineWidth) && void 0 !== _h ? _h : [ null ]), shadowWidths = toBoxArray(null !== (_k = null === (_j = this.internalProps.theme.frameStyle) || void 0 === _j ? void 0 : _j.shadowBlur) && void 0 !== _k ? _k : [ 0 ]);
|
|
407
|
+
(null === (_l = this.theme.frameStyle) || void 0 === _l ? void 0 : _l.innerBorder) ? (this.tableX = 0,
|
|
408
|
+
this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_m = shadowWidths[1]) && void 0 !== _m ? _m : 0),
|
|
409
|
+
this.tableNoFrameHeight = height - (null !== (_o = shadowWidths[2]) && void 0 !== _o ? _o : 0)) : (this.tableX = (null !== (_p = lineWidths[3]) && void 0 !== _p ? _p : 0) + (null !== (_q = shadowWidths[3]) && void 0 !== _q ? _q : 0),
|
|
410
|
+
this.tableY = (null !== (_r = lineWidths[0]) && void 0 !== _r ? _r : 0) + (null !== (_s = shadowWidths[0]) && void 0 !== _s ? _s : 0),
|
|
411
|
+
this.tableNoFrameWidth = width - ((null !== (_t = lineWidths[1]) && void 0 !== _t ? _t : 0) + (null !== (_u = shadowWidths[1]) && void 0 !== _u ? _u : 0)) - ((null !== (_v = lineWidths[3]) && void 0 !== _v ? _v : 0) + (null !== (_w = shadowWidths[3]) && void 0 !== _w ? _w : 0)),
|
|
412
|
+
this.tableNoFrameHeight = height - ((null !== (_x = lineWidths[0]) && void 0 !== _x ? _x : 0) + (null !== (_y = shadowWidths[0]) && void 0 !== _y ? _y : 0)) - ((null !== (_z = lineWidths[2]) && void 0 !== _z ? _z : 0) + (null !== (_0 = shadowWidths[2]) && void 0 !== _0 ? _0 : 0)));
|
|
410
413
|
}
|
|
411
414
|
}
|
|
412
|
-
updateViewBox(newViewBox) {
|
|
413
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
414
|
-
const oldWidth = null !== (_d = null !== (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox.x2) && void 0 !== _b ? _b : 0 - (null === (_c = this.options) || void 0 === _c ? void 0 : _c.viewBox.x1)) && void 0 !== _d ? _d : 0, oldHeight = null !== (_h = null !== (_f = null === (_e = this.options) || void 0 === _e ? void 0 : _e.viewBox.y2) && void 0 !== _f ? _f : 0 - (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox.y1)) && void 0 !== _h ? _h : 0, newWidth = newViewBox.x2 - newViewBox.x1, newHeight = newViewBox.y2 - newViewBox.y1;
|
|
415
|
-
this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);
|
|
416
|
-
}
|
|
417
|
-
setViewBoxTransform(a, b, c, d, e, f) {
|
|
418
|
-
this.internalProps.modifiedViewBoxTransform = !0, this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
|
|
419
|
-
}
|
|
420
415
|
get rowHierarchyType() {
|
|
421
416
|
return "grid";
|
|
422
417
|
}
|
|
@@ -647,16 +642,41 @@ export class BaseTable extends EventTarget {
|
|
|
647
642
|
} : null;
|
|
648
643
|
}
|
|
649
644
|
getRowAt(absoluteY) {
|
|
650
|
-
|
|
645
|
+
const frozen = _getTargetFrozenRowAt(this, absoluteY);
|
|
646
|
+
if (frozen) return frozen;
|
|
647
|
+
let row = this.getTargetRowAt(absoluteY);
|
|
648
|
+
return row || (row = {
|
|
649
|
+
top: -1,
|
|
650
|
+
row: -1,
|
|
651
|
+
bottom: -1,
|
|
652
|
+
height: -1
|
|
653
|
+
}), row;
|
|
651
654
|
}
|
|
652
655
|
getColAt(absoluteX) {
|
|
653
|
-
|
|
656
|
+
const frozen = _getTargetFrozenColAt(this, absoluteX);
|
|
657
|
+
if (frozen) return frozen;
|
|
658
|
+
let col = this.getTargetColAt(absoluteX);
|
|
659
|
+
return col || (col = {
|
|
660
|
+
left: -1,
|
|
661
|
+
col: -1,
|
|
662
|
+
right: -1,
|
|
663
|
+
width: 1
|
|
664
|
+
}), col;
|
|
654
665
|
}
|
|
655
666
|
getCellAt(absoluteX, absoluteY) {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
667
|
+
const rowInfo = this.getRowAt(absoluteY), {row: row, top: top, bottom: bottom, height: height} = rowInfo, colInfo = this.getColAt(absoluteX), {col: col, left: left, right: right, width: width} = colInfo;
|
|
668
|
+
return {
|
|
669
|
+
row: row,
|
|
670
|
+
col: col,
|
|
671
|
+
rect: {
|
|
672
|
+
left: left,
|
|
673
|
+
right: right,
|
|
674
|
+
top: top,
|
|
675
|
+
bottom: bottom,
|
|
676
|
+
width: width,
|
|
677
|
+
height: height
|
|
678
|
+
}
|
|
679
|
+
};
|
|
660
680
|
}
|
|
661
681
|
_checkRowCol(col, row) {
|
|
662
682
|
return col >= 0 && col < this.colCount && row >= 0 && row < this.rowCount;
|
|
@@ -682,11 +702,8 @@ export class BaseTable extends EventTarget {
|
|
|
682
702
|
}));
|
|
683
703
|
}
|
|
684
704
|
_toRelativeRect(absoluteRect, relativeX = !0, relativeY = !0) {
|
|
685
|
-
var _a, _b, _c, _d;
|
|
686
705
|
const rect = absoluteRect.copy(), visibleRect = this.getVisibleRect();
|
|
687
706
|
return rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0)), rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0)),
|
|
688
|
-
rect.offsetLeft(null !== (_b = null === (_a = this.options.viewBox) || void 0 === _a ? void 0 : _a.x1) && void 0 !== _b ? _b : 0),
|
|
689
|
-
rect.offsetTop(null !== (_d = null === (_c = this.options.viewBox) || void 0 === _c ? void 0 : _c.y1) && void 0 !== _d ? _d : 0),
|
|
690
707
|
rect;
|
|
691
708
|
}
|
|
692
709
|
getVisibleRect() {
|
|
@@ -791,11 +808,9 @@ export class BaseTable extends EventTarget {
|
|
|
791
808
|
internalProps.layoutMap.release(), internalProps.releaseList && (internalProps.releaseList.forEach((releaseObj => {
|
|
792
809
|
var _a;
|
|
793
810
|
return null === (_a = null == releaseObj ? void 0 : releaseObj.release) || void 0 === _a ? void 0 : _a.call(releaseObj);
|
|
794
|
-
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release()
|
|
795
|
-
internalProps.focusControl.release();
|
|
811
|
+
})), internalProps.releaseList = null), this.scenegraph.stage.release(), this.scenegraph.proxy.release();
|
|
796
812
|
const {parentElement: parentElement} = internalProps.element;
|
|
797
|
-
parentElement &&
|
|
798
|
-
null === (_q = null === (_p = null === (_o = this.editorManager) || void 0 === _o ? void 0 : _o.editingEditor) || void 0 === _p ? void 0 : _p.onEnd) || void 0 === _q || _q.call(_p),
|
|
813
|
+
parentElement && parentElement.removeChild(internalProps.element), null === (_q = null === (_p = null === (_o = this.editorManager) || void 0 === _o ? void 0 : _o.editingEditor) || void 0 === _p ? void 0 : _p.onEnd) || void 0 === _q || _q.call(_p),
|
|
799
814
|
this.isReleased = !0, this.scenegraph = null, this.internalProps = null;
|
|
800
815
|
}
|
|
801
816
|
fireListeners(type, event) {
|
|
@@ -903,7 +918,6 @@ export class BaseTable extends EventTarget {
|
|
|
903
918
|
return new Rect(this.tableX, this.tableY, width, height);
|
|
904
919
|
}
|
|
905
920
|
_getMouseAbstractPoint(evt, isAddScroll = !0) {
|
|
906
|
-
var _a, _b, _c, _d;
|
|
907
921
|
let e;
|
|
908
922
|
if (!evt) return {
|
|
909
923
|
inTable: !1,
|
|
@@ -914,30 +928,138 @@ export class BaseTable extends EventTarget {
|
|
|
914
928
|
const clientX = e.clientX || e.pageX + window.scrollX, clientY = e.clientY || e.pageY + window.scrollY, rect = this.internalProps.canvas.getBoundingClientRect();
|
|
915
929
|
let inTable = !0;
|
|
916
930
|
rect.right <= clientX && (inTable = !1), rect.bottom <= clientY && (inTable = !1);
|
|
917
|
-
const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight)
|
|
918
|
-
|
|
919
|
-
|
|
931
|
+
const currentWidth = rect.width, widthRatio = currentWidth / (this.canvas.offsetWidth || currentWidth), currentHeight = rect.height, heightRatio = currentHeight / (this.canvas.offsetHeight || currentHeight);
|
|
932
|
+
return {
|
|
933
|
+
x: (clientX - rect.left) / widthRatio + (isAddScroll ? this.scrollLeft : 0),
|
|
934
|
+
y: (clientY - rect.top) / heightRatio + (isAddScroll ? this.scrollTop : 0),
|
|
920
935
|
inTable: inTable
|
|
921
936
|
};
|
|
922
|
-
if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
|
|
923
|
-
this.scenegraph.stage.window.getViewBoxTransform().transformPoint(point, point);
|
|
924
|
-
}
|
|
925
|
-
return point;
|
|
926
937
|
}
|
|
927
938
|
getTheme() {
|
|
928
939
|
return this.internalProps.theme;
|
|
929
940
|
}
|
|
930
941
|
getTargetColAt(absoluteX) {
|
|
931
|
-
|
|
942
|
+
if (0 === absoluteX) return {
|
|
943
|
+
left: 0,
|
|
944
|
+
col: 0,
|
|
945
|
+
right: 0,
|
|
946
|
+
width: 0
|
|
947
|
+
};
|
|
948
|
+
const findAfter = (startCol, startRight) => {
|
|
949
|
+
let left = startRight - this.getColWidth(startCol);
|
|
950
|
+
const {colCount: colCount} = this.internalProps;
|
|
951
|
+
for (let col = startCol; col < colCount; col++) {
|
|
952
|
+
const width = this.getColWidth(col), right = left + width;
|
|
953
|
+
if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) return {
|
|
954
|
+
left: left,
|
|
955
|
+
col: col,
|
|
956
|
+
right: right,
|
|
957
|
+
width: width
|
|
958
|
+
};
|
|
959
|
+
left = right;
|
|
960
|
+
}
|
|
961
|
+
return null;
|
|
962
|
+
}, candCol = this.computeTargetColByX(absoluteX), right = this.getColsWidth(0, candCol);
|
|
963
|
+
return absoluteX >= right ? findAfter(candCol, right) : ((startCol, startRight) => {
|
|
964
|
+
let right = startRight;
|
|
965
|
+
for (let col = startCol; col >= 0; col--) {
|
|
966
|
+
const width = this.getColWidth(col), left = right - width;
|
|
967
|
+
if (Math.round(left) <= Math.round(absoluteX) && Math.round(absoluteX) < Math.round(right)) return {
|
|
968
|
+
left: left,
|
|
969
|
+
col: col,
|
|
970
|
+
right: right,
|
|
971
|
+
width: width
|
|
972
|
+
};
|
|
973
|
+
right = left;
|
|
974
|
+
}
|
|
975
|
+
return null;
|
|
976
|
+
})(candCol, right);
|
|
932
977
|
}
|
|
933
978
|
getTargetRowAt(absoluteY) {
|
|
934
|
-
|
|
979
|
+
if (0 === absoluteY) return {
|
|
980
|
+
top: 0,
|
|
981
|
+
row: 0,
|
|
982
|
+
bottom: 0,
|
|
983
|
+
height: 0
|
|
984
|
+
};
|
|
985
|
+
const findAfter = (startRow, startBottom) => {
|
|
986
|
+
let top = startBottom - this.getRowHeight(startRow);
|
|
987
|
+
const {rowCount: rowCount} = this.internalProps;
|
|
988
|
+
for (let row = startRow; row < rowCount; row++) {
|
|
989
|
+
const height = this.getRowHeight(row), bottom = top + height;
|
|
990
|
+
if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) return {
|
|
991
|
+
top: top,
|
|
992
|
+
row: row,
|
|
993
|
+
bottom: bottom,
|
|
994
|
+
height: height
|
|
995
|
+
};
|
|
996
|
+
top = bottom;
|
|
997
|
+
}
|
|
998
|
+
return null;
|
|
999
|
+
}, candRow = this.computeTargetRowByY(absoluteY), bottom = this.getRowsHeight(0, candRow);
|
|
1000
|
+
return absoluteY >= bottom ? findAfter(candRow, bottom) : ((startRow, startBottom) => {
|
|
1001
|
+
let bottom = startBottom;
|
|
1002
|
+
for (let row = startRow; row >= 0; row--) {
|
|
1003
|
+
const height = this.getRowHeight(row), top = bottom - height;
|
|
1004
|
+
if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) return {
|
|
1005
|
+
top: top,
|
|
1006
|
+
row: row,
|
|
1007
|
+
bottom: bottom,
|
|
1008
|
+
height: height
|
|
1009
|
+
};
|
|
1010
|
+
bottom = top;
|
|
1011
|
+
}
|
|
1012
|
+
return null;
|
|
1013
|
+
})(candRow, bottom);
|
|
935
1014
|
}
|
|
936
1015
|
getTargetColAtConsiderRightFrozen(absoluteX, isConsider) {
|
|
937
|
-
|
|
1016
|
+
if (0 === absoluteX) return {
|
|
1017
|
+
left: 0,
|
|
1018
|
+
col: 0,
|
|
1019
|
+
right: 0,
|
|
1020
|
+
width: 0
|
|
1021
|
+
};
|
|
1022
|
+
if (isConsider && absoluteX > this.tableNoFrameWidth - this.getRightFrozenColsWidth() && absoluteX < this.tableNoFrameWidth) for (let i = 0; i < this.rightFrozenColCount; i++) if (absoluteX > this.tableNoFrameWidth - this.getColsWidth(this.colCount - i - 1, this.colCount - 1)) return {
|
|
1023
|
+
col: this.colCount - i - 1,
|
|
1024
|
+
left: void 0,
|
|
1025
|
+
right: void 0,
|
|
1026
|
+
width: void 0
|
|
1027
|
+
};
|
|
1028
|
+
return this.getTargetColAt(absoluteX);
|
|
938
1029
|
}
|
|
939
1030
|
getTargetRowAtConsiderBottomFrozen(absoluteY, isConsider) {
|
|
940
|
-
|
|
1031
|
+
if (0 === absoluteY) return {
|
|
1032
|
+
top: 0,
|
|
1033
|
+
row: 0,
|
|
1034
|
+
bottom: 0,
|
|
1035
|
+
height: 0
|
|
1036
|
+
};
|
|
1037
|
+
if (isConsider && absoluteY > this.tableNoFrameHeight - this.getBottomFrozenRowsHeight() && absoluteY < this.tableNoFrameHeight) for (let i = 0; i < this.rightFrozenColCount; i++) if (absoluteY > this.tableNoFrameHeight - this.getRowsHeight(this.rowCount - i - 1, this.rowCount - 1)) return {
|
|
1038
|
+
row: this.rowCount - i - 1,
|
|
1039
|
+
top: void 0,
|
|
1040
|
+
bottom: void 0,
|
|
1041
|
+
height: void 0
|
|
1042
|
+
};
|
|
1043
|
+
return this.getTargetRowAt(absoluteY);
|
|
1044
|
+
}
|
|
1045
|
+
computeTargetRowByY(absoluteY) {
|
|
1046
|
+
let defaultRowHeight = this.internalProps.defaultRowHeight;
|
|
1047
|
+
return this._rowRangeHeightsMap.get("$0$" + (this.rowCount - 1)) && (defaultRowHeight = this._rowRangeHeightsMap.get("$0$" + (this.rowCount - 1)) / this.rowCount),
|
|
1048
|
+
Math.min(Math.ceil(absoluteY / defaultRowHeight), this.rowCount - 1);
|
|
1049
|
+
}
|
|
1050
|
+
computeTargetColByX(absoluteX) {
|
|
1051
|
+
if (this._colRangeWidthsMap.get("$0$" + (this.colCount - 1))) {
|
|
1052
|
+
let startCol = 0, endCol = this.colCount - 1;
|
|
1053
|
+
for (;endCol - startCol > 1; ) {
|
|
1054
|
+
const midCol = Math.floor((startCol + endCol) / 2);
|
|
1055
|
+
if (absoluteX < this._colRangeWidthsMap.get(`$0$${midCol}`)) endCol = midCol; else {
|
|
1056
|
+
if (!(absoluteX > this._colRangeWidthsMap.get(`$0$${midCol}`))) return midCol;
|
|
1057
|
+
startCol = midCol;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
return endCol;
|
|
1061
|
+
}
|
|
1062
|
+
return Math.min(Math.ceil(absoluteX / this.internalProps.defaultColWidth), this.colCount - 1);
|
|
941
1063
|
}
|
|
942
1064
|
clearSelected() {
|
|
943
1065
|
this.stateManager.updateSelectPos(-1, -1);
|
|
@@ -1559,30 +1681,49 @@ export class BaseTable extends EventTarget {
|
|
|
1559
1681
|
return "chart" === (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _e ? void 0 : _e[0]) || void 0 === _f ? void 0 : _f.type) ? cellGroup.getChildren()[0].activeChartInstance : null;
|
|
1560
1682
|
}
|
|
1561
1683
|
cellIsInVisualView(col, row) {
|
|
1684
|
+
var _a, _b, _c, _d;
|
|
1562
1685
|
const drawRange = this.getDrawRange(), rect = this.getCellRelativeRect(col, row);
|
|
1563
1686
|
if (col < this.frozenColCount && row < this.frozenRowCount) return !0;
|
|
1564
|
-
|
|
1687
|
+
let colHeaderRangeRect, rowHeaderRangeRect, bottomFrozenRangeRect, rightFrozenRangeRect;
|
|
1688
|
+
if (this.frozenRowCount >= 1 && (colHeaderRangeRect = this.getCellRangeRelativeRect({
|
|
1565
1689
|
start: {
|
|
1566
1690
|
col: 0,
|
|
1567
1691
|
row: 0
|
|
1568
1692
|
},
|
|
1569
1693
|
end: {
|
|
1570
1694
|
col: this.colCount - 1,
|
|
1571
|
-
row: this.
|
|
1695
|
+
row: this.frozenRowCount - 1
|
|
1572
1696
|
}
|
|
1573
|
-
}), rowHeaderRangeRect = this.getCellRangeRelativeRect({
|
|
1697
|
+
})), this.frozenColCount >= 1 && (rowHeaderRangeRect = this.getCellRangeRelativeRect({
|
|
1574
1698
|
start: {
|
|
1575
1699
|
col: 0,
|
|
1576
1700
|
row: 0
|
|
1577
1701
|
},
|
|
1578
1702
|
end: {
|
|
1579
|
-
col: this.
|
|
1703
|
+
col: this.frozenColCount - 1,
|
|
1580
1704
|
row: this.rowCount - 1
|
|
1581
1705
|
}
|
|
1582
|
-
})
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1706
|
+
})), this.bottomFrozenRowCount >= 1 && (bottomFrozenRangeRect = this.getCellRangeRelativeRect({
|
|
1707
|
+
start: {
|
|
1708
|
+
col: 0,
|
|
1709
|
+
row: this.rowCount - this.bottomFrozenRowCount
|
|
1710
|
+
},
|
|
1711
|
+
end: {
|
|
1712
|
+
col: this.colCount - 1,
|
|
1713
|
+
row: this.rowCount - 1
|
|
1714
|
+
}
|
|
1715
|
+
})), this.rightFrozenColCount >= 1 && (rightFrozenRangeRect = this.getCellRangeRelativeRect({
|
|
1716
|
+
start: {
|
|
1717
|
+
col: this.colCount - this.rightFrozenColCount,
|
|
1718
|
+
row: 0
|
|
1719
|
+
},
|
|
1720
|
+
end: {
|
|
1721
|
+
col: this.colCount - 1,
|
|
1722
|
+
row: this.rowCount - 1
|
|
1723
|
+
}
|
|
1724
|
+
})), rect.top >= drawRange.top && rect.bottom <= drawRange.bottom && rect.left >= drawRange.left && rect.right <= drawRange.right) {
|
|
1725
|
+
if (this.isFrozenCell(col, row)) return !0;
|
|
1726
|
+
if (rect.top >= (null !== (_a = null == colHeaderRangeRect ? void 0 : colHeaderRangeRect.bottom) && void 0 !== _a ? _a : rect.top) && rect.left >= (null !== (_b = null == rowHeaderRangeRect ? void 0 : rowHeaderRangeRect.right) && void 0 !== _b ? _b : rect.left) && rect.bottom <= (null !== (_c = null == bottomFrozenRangeRect ? void 0 : bottomFrozenRangeRect.top) && void 0 !== _c ? _c : rect.bottom) && rect.right <= (null !== (_d = null == rightFrozenRangeRect ? void 0 : rightFrozenRangeRect.left) && void 0 !== _d ? _d : rect.right)) return !0;
|
|
1586
1727
|
}
|
|
1587
1728
|
return !1;
|
|
1588
1729
|
}
|
|
@@ -1740,5 +1881,14 @@ export class BaseTable extends EventTarget {
|
|
|
1740
1881
|
var _a;
|
|
1741
1882
|
null === (_a = this.dataSource) || void 0 === _a || _a.setSortedIndexMap(field, filedMap);
|
|
1742
1883
|
}
|
|
1884
|
+
checkReactCustomLayout() {
|
|
1885
|
+
this.reactCustomLayout || (this.reactCustomLayout = new ReactCustomLayout(this));
|
|
1886
|
+
}
|
|
1887
|
+
get bodyDomContainer() {
|
|
1888
|
+
return this.internalProps.bodyDomContainer;
|
|
1889
|
+
}
|
|
1890
|
+
get headerDomContainer() {
|
|
1891
|
+
return this.internalProps.headerDomContainer;
|
|
1892
|
+
}
|
|
1743
1893
|
}
|
|
1744
1894
|
//# sourceMappingURL=BaseTable.js.map
|