@visactor/vtable 0.15.0 → 0.15.2
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 +32 -14
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +25 -14
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +15 -7
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/menu/dom/logic/MenuElement.js +5 -5
- package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/cjs/components/tooltip/TooltipHandler.js +3 -3
- package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js +2 -2
- package/cjs/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +7 -7
- package/cjs/core/BaseTable.js +52 -35
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/event/drill.js +3 -3
- package/cjs/event/drill.js.map +1 -1
- package/cjs/event/event.d.ts +1 -1
- package/cjs/event/event.js +19 -19
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.d.ts +2 -2
- package/cjs/event/listener/container-dom.js +6 -7
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/scroll-bar.d.ts +2 -2
- package/cjs/event/listener/scroll-bar.js +16 -16
- package/cjs/event/listener/scroll-bar.js.map +1 -1
- package/cjs/event/listener/table-group.d.ts +3 -3
- package/cjs/event/listener/table-group.js +77 -67
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/listener/touch.d.ts +2 -2
- package/cjs/event/listener/touch.js +23 -23
- package/cjs/event/listener/touch.js.map +1 -1
- package/cjs/event/pivot-chart/axis-click.js +1 -1
- package/cjs/event/pivot-chart/axis-click.js.map +1 -1
- package/cjs/event/scroll.d.ts +4 -4
- package/cjs/event/scroll.js.map +1 -1
- package/cjs/event/sparkline-event.js +3 -3
- package/cjs/event/sparkline-event.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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-chart-spec.js +2 -6
- package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +17 -7
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/cell-mover.js +6 -6
- package/cjs/scenegraph/component/cell-mover.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +2 -2
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +12 -9
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +8 -7
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +7 -8
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +3 -3
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +11 -4
- package/cjs/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/cjs/scenegraph/layout/auto-height.js +1 -1
- package/cjs/scenegraph/layout/auto-height.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +7 -3
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +12 -8
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/move-cell.js +9 -3
- package/cjs/scenegraph/layout/move-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +11 -7
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +1 -0
- package/cjs/scenegraph/scenegraph.js +20 -10
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/render-service.js +1 -1
- package/cjs/scenegraph/utils/render-service.js.map +1 -1
- package/cjs/state/cell-move/index.d.ts +4 -4
- package/cjs/state/cell-move/index.js +1 -1
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/frozen/index.js.map +1 -1
- package/cjs/state/hover/is-cell-hover.d.ts +2 -2
- package/cjs/state/hover/is-cell-hover.js +2 -2
- package/cjs/state/hover/is-cell-hover.js.map +1 -1
- package/cjs/state/hover/update-position.d.ts +2 -2
- package/cjs/state/hover/update-position.js.map +1 -1
- package/cjs/state/resize/update-resize-column.d.ts +2 -2
- package/cjs/state/resize/update-resize-column.js.map +1 -1
- package/cjs/state/select/update-position.d.ts +2 -2
- package/cjs/state/select/update-position.js +86 -88
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/sort/index.js +2 -2
- package/cjs/state/sort/index.js.map +1 -1
- package/cjs/state/state.d.ts +1 -1
- package/cjs/state/state.js +8 -8
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/ARCO.js +1 -2
- package/cjs/themes/BRIGHT.js +2 -1
- package/cjs/tools/LimitPromiseQueue.js +1 -1
- package/cjs/tools/NumberMap.js +1 -1
- package/cjs/tools/util.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +6 -6
- package/cjs/ts-types/base-table.js +1 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/common.js +1 -1
- package/cjs/ts-types/events.d.ts +0 -1
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/list-table/define/basic-define.js.map +1 -1
- package/dist/vtable.js +588 -420
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +1 -0
- package/es/ListTable.js +33 -14
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +26 -13
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +17 -6
- package/es/PivotTable.js.map +1 -1
- package/es/components/menu/dom/logic/MenuElement.js +5 -5
- package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
- package/es/components/tooltip/TooltipHandler.js +3 -3
- package/es/components/tooltip/TooltipHandler.js.map +1 -1
- package/es/components/tooltip/logic/BubbleTooltipElement.js +2 -2
- package/es/components/tooltip/logic/BubbleTooltipElement.js.map +1 -1
- package/es/core/BaseTable.d.ts +7 -7
- package/es/core/BaseTable.js +55 -38
- package/es/core/BaseTable.js.map +1 -1
- package/es/event/drill.js +3 -3
- package/es/event/drill.js.map +1 -1
- package/es/event/event.d.ts +1 -1
- package/es/event/event.js +16 -16
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.d.ts +2 -2
- package/es/event/listener/container-dom.js +6 -7
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/scroll-bar.d.ts +2 -2
- package/es/event/listener/scroll-bar.js +15 -15
- package/es/event/listener/scroll-bar.js.map +1 -1
- package/es/event/listener/table-group.d.ts +3 -3
- package/es/event/listener/table-group.js +77 -66
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/listener/touch.d.ts +2 -2
- package/es/event/listener/touch.js +21 -21
- package/es/event/listener/touch.js.map +1 -1
- package/es/event/pivot-chart/axis-click.js +1 -1
- package/es/event/pivot-chart/axis-click.js.map +1 -1
- package/es/event/scroll.d.ts +4 -4
- package/es/event/scroll.js.map +1 -1
- package/es/event/sparkline-event.js +3 -3
- package/es/event/sparkline-event.js.map +1 -1
- package/es/header-helper/header-helper.js +1 -1
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-chart-spec.js +2 -6
- package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
- package/es/layout/pivot-header-layout.js +17 -7
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/component/cell-mover.js +6 -6
- package/es/scenegraph/component/cell-mover.js.map +1 -1
- package/es/scenegraph/component/table-component.js +2 -2
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +12 -9
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +7 -7
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +7 -6
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +3 -3
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +3 -3
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js +11 -4
- package/es/scenegraph/group-creater/progress/update-position/dynamic-set-y.js.map +1 -1
- package/es/scenegraph/layout/auto-height.js +1 -1
- package/es/scenegraph/layout/auto-height.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +7 -3
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +12 -8
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/move-cell.js +9 -3
- package/es/scenegraph/layout/move-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +11 -7
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +1 -0
- package/es/scenegraph/scenegraph.js +20 -10
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/render-service.js +1 -1
- package/es/scenegraph/utils/render-service.js.map +1 -1
- package/es/state/cell-move/index.d.ts +4 -4
- package/es/state/cell-move/index.js +1 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/frozen/index.js.map +1 -1
- package/es/state/hover/is-cell-hover.d.ts +2 -2
- package/es/state/hover/is-cell-hover.js +2 -2
- package/es/state/hover/is-cell-hover.js.map +1 -1
- package/es/state/hover/update-position.d.ts +2 -2
- package/es/state/hover/update-position.js.map +1 -1
- package/es/state/resize/update-resize-column.d.ts +2 -2
- package/es/state/resize/update-resize-column.js.map +1 -1
- package/es/state/select/update-position.d.ts +2 -2
- package/es/state/select/update-position.js +86 -88
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/sort/index.js +2 -2
- package/es/state/sort/index.js.map +1 -1
- package/es/state/state.d.ts +1 -1
- package/es/state/state.js +6 -6
- package/es/state/state.js.map +1 -1
- package/es/themes/ARCO.js +1 -2
- package/es/themes/BRIGHT.js +2 -1
- package/es/tools/LimitPromiseQueue.js +1 -1
- package/es/tools/NumberMap.js +1 -1
- package/es/tools/util.js.map +1 -1
- package/es/ts-types/base-table.d.ts +6 -6
- package/es/ts-types/base-table.js +1 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/common.js +1 -1
- package/es/ts-types/events.d.ts +0 -1
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/list-table/define/basic-define.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.js
CHANGED
|
@@ -9352,7 +9352,7 @@
|
|
|
9352
9352
|
function isMouseLike(pointerType) {
|
|
9353
9353
|
return "mouse" === pointerType || "pen" === pointerType;
|
|
9354
9354
|
}
|
|
9355
|
-
class EventManager {
|
|
9355
|
+
let EventManager$1 = class EventManager {
|
|
9356
9356
|
constructor(root, config) {
|
|
9357
9357
|
this.dispatch = new EventEmitter(), this.mappingState = {
|
|
9358
9358
|
trackingData: {}
|
|
@@ -9581,7 +9581,7 @@
|
|
|
9581
9581
|
const pickResult = this.rootTarget.pick(x, y);
|
|
9582
9582
|
return target = pickResult && pickResult.graphic ? pickResult.graphic : pickResult && pickResult.group ? pickResult.group : x >= 0 && x <= get$5(this.rootTarget, "width") && y >= 0 && y <= get$5(this.rootTarget, "height") ? this.rootTarget : null, e && (e.pickParams = pickResult.params), target;
|
|
9583
9583
|
}
|
|
9584
|
-
}
|
|
9584
|
+
};
|
|
9585
9585
|
|
|
9586
9586
|
const EventTarget$1 = {
|
|
9587
9587
|
pickable: !0,
|
|
@@ -9656,7 +9656,7 @@
|
|
|
9656
9656
|
autoPreventDefault = !1,
|
|
9657
9657
|
clickInterval: clickInterval
|
|
9658
9658
|
} = params;
|
|
9659
|
-
this.manager = new EventManager(rootNode, {
|
|
9659
|
+
this.manager = new EventManager$1(rootNode, {
|
|
9660
9660
|
clickInterval: clickInterval
|
|
9661
9661
|
}), this.globalObj = global, this.supportsPointerEvents = global.supportsPointerEvents, this.supportsTouchEvents = global.supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
|
|
9662
9662
|
default: "inherit",
|
|
@@ -35704,9 +35704,6 @@
|
|
|
35704
35704
|
}
|
|
35705
35705
|
return Number(v);
|
|
35706
35706
|
});
|
|
35707
|
-
const left = 0;
|
|
35708
|
-
const right = contentWidth;
|
|
35709
|
-
const bottom = contentHeight;
|
|
35710
35707
|
const borderWidth = getQuadProps(getProp('borderLineWidth', style, col, row, table));
|
|
35711
35708
|
let barPaddingTop = Math.max(barPadding[0], borderWidth[0]);
|
|
35712
35709
|
const barPaddingRight = Math.max(barPadding[1], borderWidth[1]);
|
|
@@ -35720,6 +35717,9 @@
|
|
|
35720
35717
|
if (barPaddingLeft & 1) {
|
|
35721
35718
|
barPaddingLeft += 0.5;
|
|
35722
35719
|
}
|
|
35720
|
+
const top = barPaddingTop;
|
|
35721
|
+
const left = barPaddingLeft;
|
|
35722
|
+
const right = contentWidth;
|
|
35723
35723
|
if (typeof barHeight === 'string' && str.endsWith(barHeight, '%')) {
|
|
35724
35724
|
barHeight = Number(barHeight.substr(0, barHeight.length - 1));
|
|
35725
35725
|
barHeight = (contentHeight * barHeight) / 100;
|
|
@@ -35758,8 +35758,9 @@
|
|
|
35758
35758
|
? 1
|
|
35759
35759
|
: (num - progressBarDefine.min) / (progressBarDefine.max - progressBarDefine.min);
|
|
35760
35760
|
const barMaxWidth = contentWidth;
|
|
35761
|
-
const barTop =
|
|
35762
|
-
const
|
|
35761
|
+
const barTop = top + contentHeight - barHeight - barBottom;
|
|
35762
|
+
const barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
35763
|
+
const barLeft = barRightToLeft ? left + right - barSize : left;
|
|
35763
35764
|
const bgFillColor = getOrApply(barBgColor, {
|
|
35764
35765
|
col,
|
|
35765
35766
|
row,
|
|
@@ -35779,7 +35780,6 @@
|
|
|
35779
35780
|
});
|
|
35780
35781
|
percentCompleteBarGroup.addChild(barBack);
|
|
35781
35782
|
}
|
|
35782
|
-
const barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
35783
35783
|
const fillColor = getOrApply(barColor, {
|
|
35784
35784
|
col,
|
|
35785
35785
|
row,
|
|
@@ -35806,8 +35806,8 @@
|
|
|
35806
35806
|
const positiveRate = num > 0 ? num / positiveRange : 0;
|
|
35807
35807
|
const negativeRate = num < 0 ? -num / negativeRange : 0;
|
|
35808
35808
|
const barMaxWidth = contentWidth;
|
|
35809
|
-
const barTop =
|
|
35810
|
-
const barLeft = left
|
|
35809
|
+
const barTop = top + contentHeight - barHeight - barBottom;
|
|
35810
|
+
const barLeft = left;
|
|
35811
35811
|
const bgFillColor = getOrApply(barBgColor, {
|
|
35812
35812
|
col,
|
|
35813
35813
|
row,
|
|
@@ -35981,10 +35981,10 @@
|
|
|
35981
35981
|
const _positiveRange = progressBarDefine.max > 0 ? progressBarDefine.max : 0;
|
|
35982
35982
|
const range = Math.max(_negativeRange, _positiveRange);
|
|
35983
35983
|
const percentile = range === 0 ? 0 : Math.abs(num) / range;
|
|
35984
|
-
const barMaxWidth =
|
|
35984
|
+
const barMaxWidth = contentWidth;
|
|
35985
35985
|
const barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
35986
|
-
const barTop =
|
|
35987
|
-
const barLeft = barRightToLeft ?
|
|
35986
|
+
const barTop = top + contentHeight - barHeight - barBottom;
|
|
35987
|
+
const barLeft = barRightToLeft ? left + right - barSize : left;
|
|
35988
35988
|
const bgFillColor = getOrApply(barBgColor, {
|
|
35989
35989
|
col,
|
|
35990
35990
|
row,
|
|
@@ -37396,7 +37396,7 @@
|
|
|
37396
37396
|
isChecked = value;
|
|
37397
37397
|
text = '';
|
|
37398
37398
|
}
|
|
37399
|
-
isChecked = table.
|
|
37399
|
+
isChecked = table.stateManager.syncCheckedState(col, row, define.field, isChecked);
|
|
37400
37400
|
const hierarchyOffset = getHierarchyOffset(col, row, table);
|
|
37401
37401
|
const cellStyle = table._getCellStyle(col, row);
|
|
37402
37402
|
const autoWrapText = cellStyle.autoWrapText ?? table.internalProps.autoWrapText;
|
|
@@ -37411,7 +37411,7 @@
|
|
|
37411
37411
|
value,
|
|
37412
37412
|
dataValue
|
|
37413
37413
|
});
|
|
37414
|
-
isChecked = table.
|
|
37414
|
+
isChecked = table.stateManager.syncCheckedState(col, row, define.field, globalChecked);
|
|
37415
37415
|
}
|
|
37416
37416
|
const globalDisable = getOrApply(disable, {
|
|
37417
37417
|
col,
|
|
@@ -37481,6 +37481,9 @@
|
|
|
37481
37481
|
}
|
|
37482
37482
|
|
|
37483
37483
|
function createCell(type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme) {
|
|
37484
|
+
if (isPromise$1(value)) {
|
|
37485
|
+
value = table.getCellValue(col, row);
|
|
37486
|
+
}
|
|
37484
37487
|
let bgColorFunc;
|
|
37485
37488
|
if (table.internalProps?.dataConfig?.mappingRules && !table.isHeader(col, row)) {
|
|
37486
37489
|
table.internalProps?.dataConfig?.mappingRules?.forEach((mappingRule, i) => {
|
|
@@ -37609,7 +37612,7 @@
|
|
|
37609
37612
|
const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);
|
|
37610
37613
|
let isMerge;
|
|
37611
37614
|
let range;
|
|
37612
|
-
if (cellLocation !== 'body' || define?.mergeCell) {
|
|
37615
|
+
if (cellLocation !== 'body' || define?.mergeCell || table.internalProps.customMergeCell) {
|
|
37613
37616
|
range = table.getCellRange(col, row);
|
|
37614
37617
|
isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
|
|
37615
37618
|
}
|
|
@@ -37715,10 +37718,10 @@
|
|
|
37715
37718
|
}
|
|
37716
37719
|
if (isPromise$1(value)) {
|
|
37717
37720
|
oldCellGroup.removeAllChild();
|
|
37718
|
-
dealPromiseData(value, table, updateCellContent.bind(null, type, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon,
|
|
37721
|
+
dealPromiseData(value, table, updateCellContent.bind(null, type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme));
|
|
37719
37722
|
}
|
|
37720
37723
|
else {
|
|
37721
|
-
newCellGroup = updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon,
|
|
37724
|
+
newCellGroup = updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme);
|
|
37722
37725
|
}
|
|
37723
37726
|
if (isMerge) {
|
|
37724
37727
|
const rangeHeight = table.getRowHeight(row);
|
|
@@ -37731,7 +37734,10 @@
|
|
|
37731
37734
|
}
|
|
37732
37735
|
return newCellGroup;
|
|
37733
37736
|
}
|
|
37734
|
-
function updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon,
|
|
37737
|
+
function updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme) {
|
|
37738
|
+
if (isPromise$1(value)) {
|
|
37739
|
+
value = table.getCellValue(col, row);
|
|
37740
|
+
}
|
|
37735
37741
|
if (oldCellGroup.row !== row || oldCellGroup.col !== col) {
|
|
37736
37742
|
return null;
|
|
37737
37743
|
}
|
|
@@ -37750,13 +37756,15 @@
|
|
|
37750
37756
|
const mayHaveIcon = !!define?.icon || !!define?.tree;
|
|
37751
37757
|
const cellType = table.getBodyColumnType(col, row);
|
|
37752
37758
|
const autoRowHeight = table.heightMode === 'autoHeight';
|
|
37759
|
+
const value = table.getCellValue(col, row);
|
|
37753
37760
|
if (!table.isHeader(col, row) &&
|
|
37754
37761
|
oldCellGroup.role === 'cell' &&
|
|
37755
37762
|
cellType === 'text' &&
|
|
37756
37763
|
!autoWrapText &&
|
|
37757
37764
|
!autoRowHeight &&
|
|
37758
37765
|
!mayHaveIcon &&
|
|
37759
|
-
oldCellGroup.firstChild?.type === 'text'
|
|
37766
|
+
oldCellGroup.firstChild?.type === 'text' &&
|
|
37767
|
+
!isPromise$1(value)) {
|
|
37760
37768
|
return true;
|
|
37761
37769
|
}
|
|
37762
37770
|
return false;
|
|
@@ -37767,9 +37775,12 @@
|
|
|
37767
37775
|
let textAlign;
|
|
37768
37776
|
let textBaseline;
|
|
37769
37777
|
let y = 0;
|
|
37770
|
-
if (columnGroup.lastChild) {
|
|
37778
|
+
if (columnGroup.lastChild && columnGroup.lastChild.row === rowStart - 1) {
|
|
37771
37779
|
y = columnGroup.lastChild.attribute.y + columnGroup.lastChild.attribute.height;
|
|
37772
37780
|
}
|
|
37781
|
+
else if (columnGroup.colHeight) {
|
|
37782
|
+
y = columnGroup.colHeight;
|
|
37783
|
+
}
|
|
37773
37784
|
for (let j = rowStart; j <= rowEnd; j++) {
|
|
37774
37785
|
const row = j;
|
|
37775
37786
|
const define = cellLocation !== 'body' ? table.getHeaderDefine(col, row) : table.getBodyColumnDefine(col, row);
|
|
@@ -37823,11 +37834,9 @@
|
|
|
37823
37834
|
const type = (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||
|
|
37824
37835
|
'text';
|
|
37825
37836
|
if (isPromise$1(value)) {
|
|
37826
|
-
dealPromiseData(value, table, createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon,
|
|
37837
|
+
dealPromiseData(value, table, createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme));
|
|
37827
37838
|
columnGroup.updateColumnRowNumber(row);
|
|
37828
|
-
const height =
|
|
37829
|
-
? table.getRowHeight(row) / (range.end.row - range.start.row + 1)
|
|
37830
|
-
: table.getRowHeight(row);
|
|
37839
|
+
const height = table.getRowHeight(row);
|
|
37831
37840
|
columnGroup.updateColumnHeight(height);
|
|
37832
37841
|
y += height;
|
|
37833
37842
|
}
|
|
@@ -38827,7 +38836,7 @@
|
|
|
38827
38836
|
newHeights[row] = height;
|
|
38828
38837
|
}
|
|
38829
38838
|
else {
|
|
38830
|
-
table.
|
|
38839
|
+
table._setRowHeight(row, height);
|
|
38831
38840
|
}
|
|
38832
38841
|
}
|
|
38833
38842
|
}
|
|
@@ -38838,7 +38847,7 @@
|
|
|
38838
38847
|
newHeights[row] = height;
|
|
38839
38848
|
}
|
|
38840
38849
|
else {
|
|
38841
|
-
table.
|
|
38850
|
+
table._setRowHeight(row, height);
|
|
38842
38851
|
}
|
|
38843
38852
|
}
|
|
38844
38853
|
}
|
|
@@ -38855,7 +38864,7 @@
|
|
|
38855
38864
|
newHeights[row] = height;
|
|
38856
38865
|
}
|
|
38857
38866
|
else {
|
|
38858
|
-
table.
|
|
38867
|
+
table._setRowHeight(row, height);
|
|
38859
38868
|
}
|
|
38860
38869
|
}
|
|
38861
38870
|
}
|
|
@@ -38873,7 +38882,7 @@
|
|
|
38873
38882
|
newHeights[row] = height;
|
|
38874
38883
|
}
|
|
38875
38884
|
else {
|
|
38876
|
-
table.
|
|
38885
|
+
table._setRowHeight(row, height);
|
|
38877
38886
|
}
|
|
38878
38887
|
}
|
|
38879
38888
|
}
|
|
@@ -38884,7 +38893,7 @@
|
|
|
38884
38893
|
newHeights[row] = height;
|
|
38885
38894
|
}
|
|
38886
38895
|
else {
|
|
38887
|
-
table.
|
|
38896
|
+
table._setRowHeight(row, height);
|
|
38888
38897
|
}
|
|
38889
38898
|
}
|
|
38890
38899
|
}
|
|
@@ -38926,7 +38935,7 @@
|
|
|
38926
38935
|
newHeights[row] = rowHeight;
|
|
38927
38936
|
}
|
|
38928
38937
|
else {
|
|
38929
|
-
table.
|
|
38938
|
+
table._setRowHeight(row, rowHeight, false);
|
|
38930
38939
|
}
|
|
38931
38940
|
}
|
|
38932
38941
|
}
|
|
@@ -38945,11 +38954,28 @@
|
|
|
38945
38954
|
if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {
|
|
38946
38955
|
const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);
|
|
38947
38956
|
for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {
|
|
38957
|
+
let rowHeight;
|
|
38958
|
+
if (row === table.rowCount - table.bottomFrozenRowCount - 1) {
|
|
38959
|
+
rowHeight =
|
|
38960
|
+
canvasHeight -
|
|
38961
|
+
actualHeaderHeight -
|
|
38962
|
+
(update
|
|
38963
|
+
? newHeights.reduce((acr, cur, index) => {
|
|
38964
|
+
if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {
|
|
38965
|
+
return acr + cur;
|
|
38966
|
+
}
|
|
38967
|
+
return acr;
|
|
38968
|
+
}, 0)
|
|
38969
|
+
: table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2));
|
|
38970
|
+
}
|
|
38971
|
+
else {
|
|
38972
|
+
rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);
|
|
38973
|
+
}
|
|
38948
38974
|
if (update) {
|
|
38949
|
-
newHeights[row] =
|
|
38975
|
+
newHeights[row] = rowHeight;
|
|
38950
38976
|
}
|
|
38951
38977
|
else {
|
|
38952
|
-
table.
|
|
38978
|
+
table._setRowHeight(row, rowHeight, false);
|
|
38953
38979
|
}
|
|
38954
38980
|
}
|
|
38955
38981
|
}
|
|
@@ -39064,7 +39090,7 @@
|
|
|
39064
39090
|
newHeights[row] = height;
|
|
39065
39091
|
}
|
|
39066
39092
|
else {
|
|
39067
|
-
table.
|
|
39093
|
+
table._setRowHeight(row, height);
|
|
39068
39094
|
}
|
|
39069
39095
|
}
|
|
39070
39096
|
}
|
|
@@ -39250,7 +39276,7 @@
|
|
|
39250
39276
|
}
|
|
39251
39277
|
|
|
39252
39278
|
function updateRowHeight(scene, row, detaY) {
|
|
39253
|
-
scene.table.
|
|
39279
|
+
scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);
|
|
39254
39280
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
39255
39281
|
const cell = scene.getCell(col, row);
|
|
39256
39282
|
const mergeInfo = getCellMergeInfo(scene.table, col, row);
|
|
@@ -39394,7 +39420,7 @@
|
|
|
39394
39420
|
}
|
|
39395
39421
|
|
|
39396
39422
|
function updateColWidth(scene, col, detaX) {
|
|
39397
|
-
scene.table.
|
|
39423
|
+
scene.table._setColWidth(col, scene.table.getColWidth(col) + detaX, true);
|
|
39398
39424
|
const autoRowHeight = scene.table.heightMode === 'autoHeight';
|
|
39399
39425
|
const colOrCornerHeaderColumn = scene.getColGroup(col, true);
|
|
39400
39426
|
if (colOrCornerHeaderColumn) {
|
|
@@ -39412,9 +39438,13 @@
|
|
|
39412
39438
|
if (bottomColumn) {
|
|
39413
39439
|
updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);
|
|
39414
39440
|
}
|
|
39441
|
+
const rightTopColumn = scene.getColGroupInRightTopCorner(col);
|
|
39442
|
+
if (rightTopColumn) {
|
|
39443
|
+
updateColunmWidth(rightTopColumn, detaX, autoRowHeight, 'right-top', scene);
|
|
39444
|
+
}
|
|
39415
39445
|
const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);
|
|
39416
39446
|
if (rightBottomColumn) {
|
|
39417
|
-
updateColunmWidth(
|
|
39447
|
+
updateColunmWidth(rightBottomColumn, detaX, autoRowHeight, 'right-bottom', scene);
|
|
39418
39448
|
}
|
|
39419
39449
|
if (col < scene.frozenColCount) {
|
|
39420
39450
|
scene.cornerHeaderGroup.forEachChildrenSkipChild((column, index) => {
|
|
@@ -39507,11 +39537,19 @@
|
|
|
39507
39537
|
colGroup = scene.getColGroupInLeftBottomCorner(col);
|
|
39508
39538
|
oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;
|
|
39509
39539
|
}
|
|
39540
|
+
else if (mode === 'right-top') {
|
|
39541
|
+
row = 0;
|
|
39542
|
+
colGroup = scene.getColGroupInRightTopCorner(col);
|
|
39543
|
+
oldContainerHeight = scene.rightTopCornerGroup.attribute.height ?? 0;
|
|
39544
|
+
}
|
|
39510
39545
|
else if (mode === 'right-bottom') {
|
|
39511
39546
|
row = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
39512
39547
|
colGroup = scene.getColGroupInRightBottomCorner(col);
|
|
39513
39548
|
oldContainerHeight = scene.rightBottomCornerGroup.attribute.height ?? 0;
|
|
39514
39549
|
}
|
|
39550
|
+
if (!colGroup) {
|
|
39551
|
+
continue;
|
|
39552
|
+
}
|
|
39515
39553
|
let y = 0;
|
|
39516
39554
|
colGroup.forEachChildren((cellGroup) => {
|
|
39517
39555
|
cellGroup.setAttribute('y', y);
|
|
@@ -39660,7 +39698,7 @@
|
|
|
39660
39698
|
}
|
|
39661
39699
|
function resetRowHeight(scene, row) {
|
|
39662
39700
|
const maxHeight = computeRowHeight(row, 0, scene.table.colCount - 1, scene.table);
|
|
39663
|
-
scene.table.
|
|
39701
|
+
scene.table._setRowHeight(row, maxHeight, true);
|
|
39664
39702
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
39665
39703
|
const distHeight = maxHeight;
|
|
39666
39704
|
const cell = scene.highPerformanceGetCell(col, row);
|
|
@@ -40058,7 +40096,7 @@
|
|
|
40058
40096
|
let symbolRotate = Math.PI;
|
|
40059
40097
|
const linePoints = [];
|
|
40060
40098
|
if (cellLocation === 'columnHeader') {
|
|
40061
|
-
rectX = this.table.getColsWidth(0, col - 1) - this.table.
|
|
40099
|
+
rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos;
|
|
40062
40100
|
rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1);
|
|
40063
40101
|
rectHeight = this.table.tableNoFrameHeight;
|
|
40064
40102
|
if (mergeInfo) {
|
|
@@ -40074,7 +40112,7 @@
|
|
|
40074
40112
|
linePoints.push({ x: 0, y: this.table.tableNoFrameHeight });
|
|
40075
40113
|
}
|
|
40076
40114
|
else if (cellLocation === 'rowHeader') {
|
|
40077
|
-
rectY = this.table.getRowsHeight(0, row - 1) - this.table.
|
|
40115
|
+
rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos;
|
|
40078
40116
|
rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1);
|
|
40079
40117
|
rectWidth = this.table.tableNoFrameWidth;
|
|
40080
40118
|
if (mergeInfo) {
|
|
@@ -40119,13 +40157,13 @@
|
|
|
40119
40157
|
}
|
|
40120
40158
|
update(backX, lineX, backY, lineY) {
|
|
40121
40159
|
if (typeof backX === 'number' && typeof lineX === 'number') {
|
|
40122
|
-
this.columnMoverLabel.setAttribute('x', lineX - this.table.
|
|
40123
|
-
this.columnMoverLine.setAttribute('x', lineX - this.table.
|
|
40160
|
+
this.columnMoverLabel.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);
|
|
40161
|
+
this.columnMoverLine.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);
|
|
40124
40162
|
this.columnMoverBack.setAttribute('x', backX);
|
|
40125
40163
|
}
|
|
40126
40164
|
else if (typeof backY === 'number' && typeof lineY === 'number') {
|
|
40127
|
-
this.columnMoverLabel.setAttribute('y', lineY - this.table.
|
|
40128
|
-
this.columnMoverLine.setAttribute('y', lineY - this.table.
|
|
40165
|
+
this.columnMoverLabel.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);
|
|
40166
|
+
this.columnMoverLine.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);
|
|
40129
40167
|
this.columnMoverBack.setAttribute('y', backY);
|
|
40130
40168
|
}
|
|
40131
40169
|
}
|
|
@@ -40304,8 +40342,8 @@
|
|
|
40304
40342
|
this.vScrollBar.hideAll();
|
|
40305
40343
|
}
|
|
40306
40344
|
updateScrollBar() {
|
|
40307
|
-
const oldHorizontalBarPos = this.table.
|
|
40308
|
-
const oldVerticalBarPos = this.table.
|
|
40345
|
+
const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos;
|
|
40346
|
+
const oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos;
|
|
40309
40347
|
const theme = this.table.theme;
|
|
40310
40348
|
const width = theme.scrollStyle?.width;
|
|
40311
40349
|
const visible = theme.scrollStyle?.visible;
|
|
@@ -40371,8 +40409,8 @@
|
|
|
40371
40409
|
visible: false
|
|
40372
40410
|
});
|
|
40373
40411
|
}
|
|
40374
|
-
this.table.
|
|
40375
|
-
this.table.
|
|
40412
|
+
this.table.stateManager.setScrollLeft(oldHorizontalBarPos);
|
|
40413
|
+
this.table.stateManager.setScrollTop(oldVerticalBarPos);
|
|
40376
40414
|
}
|
|
40377
40415
|
hideResizeCol() {
|
|
40378
40416
|
this.columnResizeLine.setAttribute('visible', false);
|
|
@@ -40685,16 +40723,10 @@
|
|
|
40685
40723
|
}
|
|
40686
40724
|
axes.forEach((axis, index) => {
|
|
40687
40725
|
if (axis.type === 'linear') {
|
|
40688
|
-
|
|
40689
|
-
chartAxis._domain = {
|
|
40690
|
-
min: axis.range?.min ?? 0,
|
|
40691
|
-
max: axis.range?.max ?? 0
|
|
40692
|
-
};
|
|
40726
|
+
chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
|
|
40693
40727
|
}
|
|
40694
40728
|
else if (axis.type === 'band') {
|
|
40695
|
-
|
|
40696
|
-
chartAxis._spec.domain = axis.domain.slice(0);
|
|
40697
|
-
chartAxis.updateScaleDomain();
|
|
40729
|
+
chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
|
|
40698
40730
|
}
|
|
40699
40731
|
});
|
|
40700
40732
|
chartInstance.updateViewBox({
|
|
@@ -40924,7 +40956,7 @@
|
|
|
40924
40956
|
isValid$6(cellGroup.mergeEndRow)) {
|
|
40925
40957
|
for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
|
|
40926
40958
|
for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
|
|
40927
|
-
const key = isCellHover(table.
|
|
40959
|
+
const key = isCellHover(table.stateManager, col, row);
|
|
40928
40960
|
if (key && (!colorKey || key === 'cellBgColor')) {
|
|
40929
40961
|
colorKey = key;
|
|
40930
40962
|
}
|
|
@@ -40932,7 +40964,7 @@
|
|
|
40932
40964
|
}
|
|
40933
40965
|
}
|
|
40934
40966
|
else if (cellGroup.role === 'cell') {
|
|
40935
|
-
colorKey = isCellHover(table.
|
|
40967
|
+
colorKey = isCellHover(table.stateManager, cellGroup.col, cellGroup.row);
|
|
40936
40968
|
}
|
|
40937
40969
|
if (!colorKey) {
|
|
40938
40970
|
return undefined;
|
|
@@ -41310,7 +41342,7 @@
|
|
|
41310
41342
|
drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
|
|
41311
41343
|
if (group.role === 'cell') {
|
|
41312
41344
|
const table = group.stage.table;
|
|
41313
|
-
if (table.
|
|
41345
|
+
if (table.stateManager.interactionState !== InteractionState.scrolling) {
|
|
41314
41346
|
const hoverColor = getCellHoverColor(group, table);
|
|
41315
41347
|
if (hoverColor) {
|
|
41316
41348
|
group.oldColor = group.attribute.fill;
|
|
@@ -41488,7 +41520,7 @@
|
|
|
41488
41520
|
newWidths[col] = maxWidth;
|
|
41489
41521
|
}
|
|
41490
41522
|
else {
|
|
41491
|
-
table.
|
|
41523
|
+
table._setColWidth(col, maxWidth, false, true);
|
|
41492
41524
|
}
|
|
41493
41525
|
}
|
|
41494
41526
|
if (table.widthMode === 'adaptive') {
|
|
@@ -41524,7 +41556,7 @@
|
|
|
41524
41556
|
newWidths[col] = colWidth;
|
|
41525
41557
|
}
|
|
41526
41558
|
else {
|
|
41527
|
-
table.
|
|
41559
|
+
table._setColWidth(col, colWidth, false, true);
|
|
41528
41560
|
}
|
|
41529
41561
|
}
|
|
41530
41562
|
}
|
|
@@ -41543,11 +41575,28 @@
|
|
|
41543
41575
|
if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {
|
|
41544
41576
|
const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);
|
|
41545
41577
|
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
41578
|
+
let colWidth;
|
|
41579
|
+
if (col === table.colCount - table.rightFrozenColCount - 1) {
|
|
41580
|
+
colWidth =
|
|
41581
|
+
canvasWidth -
|
|
41582
|
+
actualHeaderWidth -
|
|
41583
|
+
(update
|
|
41584
|
+
? newWidths.reduce((acr, cur, index) => {
|
|
41585
|
+
if (index >= table.frozenColCount && index <= table.colCount - table.rightFrozenColCount - 2) {
|
|
41586
|
+
return acr + cur;
|
|
41587
|
+
}
|
|
41588
|
+
return acr;
|
|
41589
|
+
}, 0)
|
|
41590
|
+
: table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2));
|
|
41591
|
+
}
|
|
41592
|
+
else {
|
|
41593
|
+
colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
|
|
41594
|
+
}
|
|
41546
41595
|
if (update) {
|
|
41547
|
-
newWidths[col] =
|
|
41596
|
+
newWidths[col] = colWidth;
|
|
41548
41597
|
}
|
|
41549
41598
|
else {
|
|
41550
|
-
table.
|
|
41599
|
+
table._setColWidth(col, colWidth, false, true);
|
|
41551
41600
|
}
|
|
41552
41601
|
}
|
|
41553
41602
|
}
|
|
@@ -41856,11 +41905,13 @@
|
|
|
41856
41905
|
y: table.getFrozenRowsHeight()
|
|
41857
41906
|
});
|
|
41858
41907
|
createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.columnHeaderLevelCount - 1, table.isListTable() ? 'columnHeader' : 'cornerHeader', table);
|
|
41859
|
-
|
|
41908
|
+
distCol - table.rightFrozenColCount >= table.frozenColCount &&
|
|
41909
|
+
createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, 0, table.columnHeaderLevelCount - 1, 'columnHeader', table);
|
|
41860
41910
|
createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.columnHeaderLevelCount, distRow - table.bottomFrozenRowCount, table.isListTable() && !table.internalProps.transpose ? 'body' : 'rowHeader', table);
|
|
41861
41911
|
if (table.bottomFrozenRowCount > 0) {
|
|
41862
41912
|
createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isListTable() ? 'body' : 'rowHeader', table);
|
|
41863
|
-
|
|
41913
|
+
distCol - table.rightFrozenColCount >= table.frozenColCount &&
|
|
41914
|
+
createColGroup(bottomFrozenGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isPivotChart() ? 'rowHeader' : 'body', table);
|
|
41864
41915
|
}
|
|
41865
41916
|
if (table.rightFrozenColCount > 0) {
|
|
41866
41917
|
createColGroup(rightTopCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, 0, table.columnHeaderLevelCount - 1, 'columnHeader', table);
|
|
@@ -41869,7 +41920,8 @@
|
|
|
41869
41920
|
if (table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0) {
|
|
41870
41921
|
createColGroup(rightBottomCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, 'body', table);
|
|
41871
41922
|
}
|
|
41872
|
-
|
|
41923
|
+
distCol - table.rightFrozenColCount >= table.frozenColCount &&
|
|
41924
|
+
createColGroup(bodyGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.columnHeaderLevelCount, distRow - table.bottomFrozenRowCount, 'body', table);
|
|
41873
41925
|
if (!bodyGroup.firstChild && !colHeaderGroup.firstChild) {
|
|
41874
41926
|
proxy.currentRow = proxy.totalRow;
|
|
41875
41927
|
proxy.rowEnd = proxy.currentRow;
|
|
@@ -42194,18 +42246,18 @@
|
|
|
42194
42246
|
}
|
|
42195
42247
|
function move(deltaRow, screenTopRow, screenTopY, y, proxy) {
|
|
42196
42248
|
if (deltaRow > 0) {
|
|
42197
|
-
moveCell(deltaRow, 'up', screenTopRow, screenTopY, proxy);
|
|
42249
|
+
moveCell(deltaRow, 'up', screenTopRow, screenTopY, y, proxy);
|
|
42198
42250
|
proxy.updateBody(y - proxy.deltaY);
|
|
42199
42251
|
}
|
|
42200
42252
|
else if (deltaRow < 0) {
|
|
42201
|
-
moveCell(-deltaRow, 'down', screenTopRow, screenTopY, proxy);
|
|
42253
|
+
moveCell(-deltaRow, 'down', screenTopRow, screenTopY, y, proxy);
|
|
42202
42254
|
proxy.updateBody(y - proxy.deltaY);
|
|
42203
42255
|
}
|
|
42204
42256
|
else {
|
|
42205
42257
|
proxy.updateBody(y - proxy.deltaY);
|
|
42206
42258
|
}
|
|
42207
42259
|
}
|
|
42208
|
-
async function moveCell(count, direction, screenTopRow, screenTopY, proxy) {
|
|
42260
|
+
async function moveCell(count, direction, screenTopRow, screenTopY, y, proxy) {
|
|
42209
42261
|
if (direction === 'up' && proxy.rowEnd + count > proxy.bodyBottomRow) {
|
|
42210
42262
|
count = proxy.bodyBottomRow - proxy.rowEnd;
|
|
42211
42263
|
}
|
|
@@ -42280,7 +42332,22 @@
|
|
|
42280
42332
|
updateAutoRow(0, proxy.table.frozenColCount - 1, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
|
|
42281
42333
|
updateAutoRow(proxy.table.colCount - proxy.table.rightFrozenColCount, proxy.table.colCount - 1, syncTopRow, syncBottomRow, proxy.table, distEndRow > proxy.bodyBottomRow - (proxy.rowEnd - proxy.rowStart + 1) ? 'down' : 'up');
|
|
42282
42334
|
}
|
|
42283
|
-
proxy.
|
|
42335
|
+
if (syncTopRow === proxy.bodyTopRow) {
|
|
42336
|
+
const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, syncTopRow, true);
|
|
42337
|
+
const delaY = cellGroup.attribute.y - y;
|
|
42338
|
+
proxy.table.scenegraph.proxy.deltaY = delaY;
|
|
42339
|
+
}
|
|
42340
|
+
else if (syncBottomRow === proxy.bodyBottomRow) {
|
|
42341
|
+
const cellGroup = proxy.table.scenegraph.highPerformanceGetCell(proxy.bodyLeftCol, syncBottomRow, true);
|
|
42342
|
+
const delaY = cellGroup.attribute.y +
|
|
42343
|
+
cellGroup.attribute.height -
|
|
42344
|
+
(proxy.table.tableNoFrameHeight - proxy.table.getFrozenRowsHeight()) -
|
|
42345
|
+
y;
|
|
42346
|
+
proxy.table.scenegraph.proxy.deltaY = -delaY;
|
|
42347
|
+
}
|
|
42348
|
+
else {
|
|
42349
|
+
proxy.table.scenegraph.proxy.deltaY = 0;
|
|
42350
|
+
}
|
|
42284
42351
|
proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
|
|
42285
42352
|
proxy.totalRow = Math.max(0, Math.min(proxy.table.rowCount - 1, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count));
|
|
42286
42353
|
proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
|
|
@@ -42875,13 +42942,27 @@
|
|
|
42875
42942
|
const updateRowStart = Math.min(sourceRowStart, targetRowStart);
|
|
42876
42943
|
const updateRowEnd = Math.max(sourceRowEnd, targetRowEnd);
|
|
42877
42944
|
for (let col = updateColStart; col <= updateColEnd; col++) {
|
|
42945
|
+
const columnWidth = table.getColWidth(col);
|
|
42878
42946
|
const columnHeaderGroup = table.scenegraph.getColGroup(col, true);
|
|
42879
42947
|
const columnGroup = table.scenegraph.getColGroup(col);
|
|
42948
|
+
const columnBottomGroup = table.scenegraph.getColGroupInBottom(col);
|
|
42880
42949
|
if (columnHeaderGroup) {
|
|
42881
|
-
columnHeaderGroup.setAttribute('width',
|
|
42950
|
+
columnHeaderGroup.setAttribute('width', columnWidth);
|
|
42951
|
+
columnHeaderGroup.forEachChildren((child) => {
|
|
42952
|
+
child.setAttribute('width', columnWidth);
|
|
42953
|
+
});
|
|
42882
42954
|
}
|
|
42883
42955
|
if (columnGroup) {
|
|
42884
|
-
columnGroup.setAttribute('width',
|
|
42956
|
+
columnGroup.setAttribute('width', columnWidth);
|
|
42957
|
+
columnGroup.forEachChildren((child) => {
|
|
42958
|
+
child.setAttribute('width', columnWidth);
|
|
42959
|
+
});
|
|
42960
|
+
}
|
|
42961
|
+
if (columnBottomGroup) {
|
|
42962
|
+
columnBottomGroup.setAttribute('width', columnWidth);
|
|
42963
|
+
columnBottomGroup.forEachChildren((child) => {
|
|
42964
|
+
child.setAttribute('width', columnWidth);
|
|
42965
|
+
});
|
|
42885
42966
|
}
|
|
42886
42967
|
}
|
|
42887
42968
|
scene.updateContainer();
|
|
@@ -44852,6 +44933,10 @@
|
|
|
44852
44933
|
}
|
|
44853
44934
|
this.proxy?.release();
|
|
44854
44935
|
}
|
|
44936
|
+
updateStageBackground() {
|
|
44937
|
+
this.stage.background = this.table.theme.underlayBackgroundColor;
|
|
44938
|
+
this.stage.renderNextFrame();
|
|
44939
|
+
}
|
|
44855
44940
|
createComponent() {
|
|
44856
44941
|
this.component = new TableComponent(this.table);
|
|
44857
44942
|
this.component.addToGroup(this.componentGroup);
|
|
@@ -44970,7 +45055,7 @@
|
|
|
44970
45055
|
this.stage.renderNextFrame();
|
|
44971
45056
|
}
|
|
44972
45057
|
resetAllSelectComponent() {
|
|
44973
|
-
if (this.table.
|
|
45058
|
+
if (this.table.stateManager.select?.ranges?.length > 0) {
|
|
44974
45059
|
updateAllSelectComponent(this);
|
|
44975
45060
|
}
|
|
44976
45061
|
}
|
|
@@ -45158,8 +45243,8 @@
|
|
|
45158
45243
|
width: Math.min(this.table.tableNoFrameWidth, Math.max(this.colHeaderGroup.attribute.width, this.bodyGroup.attribute.width, 0) +
|
|
45159
45244
|
Math.max(this.cornerHeaderGroup.attribute.width, this.rowHeaderGroup.attribute.width, 0) +
|
|
45160
45245
|
this.rightBottomCornerGroup.attribute.width),
|
|
45161
|
-
height: Math.min(this.table.tableNoFrameHeight, (this.colHeaderGroup.attribute.height
|
|
45162
|
-
(this.bodyGroup.attribute.height
|
|
45246
|
+
height: Math.min(this.table.tableNoFrameHeight, Math.max(this.colHeaderGroup.attribute.height, this.cornerHeaderGroup.attribute.height, 0) +
|
|
45247
|
+
Math.max(this.rowHeaderGroup.attribute.height, this.bodyGroup.attribute.height, 0) +
|
|
45163
45248
|
this.bottomFrozenGroup.attribute.height)
|
|
45164
45249
|
});
|
|
45165
45250
|
if (this.tableGroup.border) {
|
|
@@ -45287,7 +45372,7 @@
|
|
|
45287
45372
|
if (!this.isPivot && !this.transpose) {
|
|
45288
45373
|
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
45289
45374
|
}
|
|
45290
|
-
this.table.
|
|
45375
|
+
this.table.stateManager.checkFrozen();
|
|
45291
45376
|
this.updateContainer();
|
|
45292
45377
|
this.createFrameBorder();
|
|
45293
45378
|
this.updateBorderSizeAndPosition();
|
|
@@ -45330,7 +45415,17 @@
|
|
|
45330
45415
|
if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {
|
|
45331
45416
|
const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);
|
|
45332
45417
|
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
45333
|
-
|
|
45418
|
+
let colWidth;
|
|
45419
|
+
if (col === table.colCount - table.rightFrozenColCount - 1) {
|
|
45420
|
+
colWidth =
|
|
45421
|
+
canvasWidth -
|
|
45422
|
+
actualHeaderWidth -
|
|
45423
|
+
table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2);
|
|
45424
|
+
}
|
|
45425
|
+
else {
|
|
45426
|
+
colWidth = Math.round(table.getColWidth(col) * factor);
|
|
45427
|
+
}
|
|
45428
|
+
this.setColWidth(col, colWidth);
|
|
45334
45429
|
}
|
|
45335
45430
|
}
|
|
45336
45431
|
}
|
|
@@ -45398,7 +45493,17 @@
|
|
|
45398
45493
|
if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {
|
|
45399
45494
|
const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);
|
|
45400
45495
|
for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {
|
|
45401
|
-
|
|
45496
|
+
let rowHeight;
|
|
45497
|
+
if (row === table.rowCount - table.bottomFrozenRowCount - 1) {
|
|
45498
|
+
rowHeight =
|
|
45499
|
+
canvasHeight -
|
|
45500
|
+
actualHeaderHeight -
|
|
45501
|
+
table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2);
|
|
45502
|
+
}
|
|
45503
|
+
else {
|
|
45504
|
+
rowHeight = Math.round(table.getRowHeight(row) * factor);
|
|
45505
|
+
}
|
|
45506
|
+
this.setRowHeight(row, rowHeight);
|
|
45402
45507
|
}
|
|
45403
45508
|
}
|
|
45404
45509
|
}
|
|
@@ -45493,11 +45598,11 @@
|
|
|
45493
45598
|
updateContainer() {
|
|
45494
45599
|
this.updateContainerAttrWidthAndX();
|
|
45495
45600
|
this.updateTableSize();
|
|
45496
|
-
const oldHorizontalBarPos = this.table.
|
|
45497
|
-
const oldVerticalBarPos = this.table.
|
|
45601
|
+
const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos;
|
|
45602
|
+
const oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos;
|
|
45498
45603
|
this.component.updateScrollBar();
|
|
45499
|
-
this.table.
|
|
45500
|
-
this.table.
|
|
45604
|
+
this.table.stateManager.setScrollLeft(oldHorizontalBarPos);
|
|
45605
|
+
this.table.stateManager.setScrollTop(oldVerticalBarPos);
|
|
45501
45606
|
this.updateNextFrame();
|
|
45502
45607
|
}
|
|
45503
45608
|
updateCellContentWhileResize(col, row) {
|
|
@@ -45644,7 +45749,7 @@
|
|
|
45644
45749
|
updateRow(removeCells, addCells, updateCells, this.table);
|
|
45645
45750
|
this.recalculateColWidths();
|
|
45646
45751
|
this.recalculateRowHeights();
|
|
45647
|
-
this.table.
|
|
45752
|
+
this.table.stateManager.checkFrozen();
|
|
45648
45753
|
if (!this.isPivot && !this.transpose) {
|
|
45649
45754
|
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
45650
45755
|
}
|
|
@@ -45912,13 +46017,13 @@
|
|
|
45912
46017
|
return;
|
|
45913
46018
|
}
|
|
45914
46019
|
table.internalProps.sortState = tableState;
|
|
45915
|
-
table.
|
|
46020
|
+
table.stateManager.setSortState(tableState);
|
|
45916
46021
|
if (headerC?.sort) {
|
|
45917
46022
|
executeSort(tableState, table, headerC);
|
|
45918
46023
|
}
|
|
45919
46024
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
45920
46025
|
table.scenegraph.sortCell();
|
|
45921
|
-
table.
|
|
46026
|
+
table.stateManager.updateSelectPos(-1, -1);
|
|
45922
46027
|
}
|
|
45923
46028
|
function executeSort(newState, table, headerDefine) {
|
|
45924
46029
|
let hd;
|
|
@@ -45954,9 +46059,6 @@
|
|
|
45954
46059
|
col = -1;
|
|
45955
46060
|
row = -1;
|
|
45956
46061
|
}
|
|
45957
|
-
if (cellPos.col === col && cellPos.row === row) {
|
|
45958
|
-
return;
|
|
45959
|
-
}
|
|
45960
46062
|
if (col !== -1 && row !== -1 && state.select.ranges.length > 0) {
|
|
45961
46063
|
if (interactionState === InteractionState.grabing) {
|
|
45962
46064
|
const currentRange = state.select.ranges[state.select.ranges.length - 1];
|
|
@@ -46267,7 +46369,7 @@
|
|
|
46267
46369
|
const cellLocation = state.table.getCellLocation(col, row);
|
|
46268
46370
|
const delta = cellLocation === 'columnHeader' ? state.columnMove.x : cellLocation === 'rowHeader' ? state.columnMove.y : 0;
|
|
46269
46371
|
state.table.scenegraph.component.showMoveCol(col, row, delta);
|
|
46270
|
-
state.table.
|
|
46372
|
+
state.table.stateManager.updateSelectPos(-1, -1);
|
|
46271
46373
|
state.table.scenegraph.updateNextFrame();
|
|
46272
46374
|
}
|
|
46273
46375
|
function updateMoveCol(col, row, x, y, state) {
|
|
@@ -46537,7 +46639,7 @@
|
|
|
46537
46639
|
}
|
|
46538
46640
|
}
|
|
46539
46641
|
|
|
46540
|
-
class
|
|
46642
|
+
class StateManager {
|
|
46541
46643
|
table;
|
|
46542
46644
|
interactionState;
|
|
46543
46645
|
select;
|
|
@@ -46823,7 +46925,7 @@
|
|
|
46823
46925
|
this.columnResize.x = x;
|
|
46824
46926
|
this.columnResize.isRightFrozen = isRightFrozen;
|
|
46825
46927
|
this.table.scenegraph.component.showResizeCol(col, y, isRightFrozen);
|
|
46826
|
-
this.table.
|
|
46928
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
46827
46929
|
this.table.scenegraph.updateNextFrame();
|
|
46828
46930
|
}
|
|
46829
46931
|
updateResizeCol(xInTable, yInTable) {
|
|
@@ -46873,7 +46975,7 @@
|
|
|
46873
46975
|
const totalHeight = this.table.getAllRowsHeight();
|
|
46874
46976
|
this.scroll.verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
|
|
46875
46977
|
this.table.scenegraph.setY(-this.scroll.verticalBarPos);
|
|
46876
|
-
this.table.
|
|
46978
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
46877
46979
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
46878
46980
|
scrollTop: this.scroll.verticalBarPos,
|
|
46879
46981
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -46889,7 +46991,7 @@
|
|
|
46889
46991
|
const totalWidth = this.table.getAllColsWidth();
|
|
46890
46992
|
this.scroll.horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
|
|
46891
46993
|
this.table.scenegraph.setX(-this.scroll.horizontalBarPos);
|
|
46892
|
-
this.table.
|
|
46994
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
46893
46995
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
46894
46996
|
scrollTop: this.scroll.verticalBarPos,
|
|
46895
46997
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -46909,7 +47011,7 @@
|
|
|
46909
47011
|
this.table.scenegraph.setY(-top);
|
|
46910
47012
|
const yRatio = top / (totalHeight - this.table.scenegraph.height);
|
|
46911
47013
|
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
46912
|
-
this.table.
|
|
47014
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
46913
47015
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
46914
47016
|
scrollTop: this.scroll.verticalBarPos,
|
|
46915
47017
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -46930,7 +47032,7 @@
|
|
|
46930
47032
|
this.table.scenegraph.setX(-left);
|
|
46931
47033
|
const xRatio = left / (totalWidth - this.table.scenegraph.width);
|
|
46932
47034
|
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
46933
|
-
this.table.
|
|
47035
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
46934
47036
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
46935
47037
|
scrollTop: this.scroll.verticalBarPos,
|
|
46936
47038
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -47431,18 +47533,18 @@
|
|
|
47431
47533
|
}
|
|
47432
47534
|
const dimension = table.internalProps.layoutMap.getHeaderDimension(col, row);
|
|
47433
47535
|
if (dimension?.drillDown || dimension?.drillUp) {
|
|
47434
|
-
table.
|
|
47536
|
+
table.stateManager.updateDrillState(dimension.dimensionKey, dimension.title, dimension.drillDown, dimension.drillUp, col, row);
|
|
47435
47537
|
}
|
|
47436
47538
|
else {
|
|
47437
|
-
table.
|
|
47539
|
+
table.stateManager.updateDrillState(undefined, undefined, false, false, -1, -1);
|
|
47438
47540
|
}
|
|
47439
47541
|
});
|
|
47440
47542
|
table.on(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, (e) => {
|
|
47441
|
-
table.
|
|
47543
|
+
table.stateManager.updateDrillState(undefined, undefined, false, false, -1, -1);
|
|
47442
47544
|
});
|
|
47443
47545
|
}
|
|
47444
47546
|
function drillClick(table) {
|
|
47445
|
-
table.fireListeners(PIVOT_TABLE_EVENT_TYPE.DRILLMENU_CLICK, table.
|
|
47547
|
+
table.fireListeners(PIVOT_TABLE_EVENT_TYPE.DRILLMENU_CLICK, table.stateManager.drill);
|
|
47446
47548
|
}
|
|
47447
47549
|
function checkHaveDrill(table) {
|
|
47448
47550
|
const rowsDefine = table.internalProps.layoutMap.rowsDefine;
|
|
@@ -47483,12 +47585,12 @@
|
|
|
47483
47585
|
const { col, row, x, y } = e;
|
|
47484
47586
|
const type = table.getBodyColumnType(col, row);
|
|
47485
47587
|
if (type !== 'sparkline') {
|
|
47486
|
-
table.
|
|
47588
|
+
table.stateManager.updateSparklineHoverPose(-1, -1, 0, 0);
|
|
47487
47589
|
}
|
|
47488
|
-
table.
|
|
47590
|
+
table.stateManager.updateSparklineHoverPose(col, row, x, y);
|
|
47489
47591
|
});
|
|
47490
47592
|
table.on(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, (e) => {
|
|
47491
|
-
table.
|
|
47593
|
+
table.stateManager.updateSparklineHoverPose(-1, -1, 0, 0);
|
|
47492
47594
|
});
|
|
47493
47595
|
}
|
|
47494
47596
|
|
|
@@ -47525,9 +47627,9 @@
|
|
|
47525
47627
|
let LastBodyPointerXY;
|
|
47526
47628
|
let isDown = false;
|
|
47527
47629
|
let isDraging = false;
|
|
47528
|
-
function bindTableGroupListener(
|
|
47529
|
-
const table =
|
|
47530
|
-
const
|
|
47630
|
+
function bindTableGroupListener(eventManager) {
|
|
47631
|
+
const table = eventManager.table;
|
|
47632
|
+
const stateManager = table.stateManager;
|
|
47531
47633
|
document.body.addEventListener('pointerdown', e => {
|
|
47532
47634
|
LastBodyPointerXY = { x: e.x, y: e.y };
|
|
47533
47635
|
isDown = true;
|
|
@@ -47546,16 +47648,16 @@
|
|
|
47546
47648
|
}
|
|
47547
47649
|
}
|
|
47548
47650
|
const { x, y } = table._getMouseAbstractPoint(e, false);
|
|
47549
|
-
if (
|
|
47651
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
47550
47652
|
return;
|
|
47551
47653
|
}
|
|
47552
|
-
if (
|
|
47553
|
-
if (
|
|
47554
|
-
|
|
47654
|
+
if (stateManager.interactionState === InteractionState.grabing) {
|
|
47655
|
+
if (stateManager.isResizeCol()) {
|
|
47656
|
+
eventManager.dealColumnResize(x, y);
|
|
47555
47657
|
if (table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN)) {
|
|
47556
47658
|
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN, {
|
|
47557
|
-
col: table.
|
|
47558
|
-
colWidth: table.getColWidth(table.
|
|
47659
|
+
col: table.stateManager.columnResize.col,
|
|
47660
|
+
colWidth: table.getColWidth(table.stateManager.columnResize.col)
|
|
47559
47661
|
});
|
|
47560
47662
|
}
|
|
47561
47663
|
}
|
|
@@ -47565,43 +47667,43 @@
|
|
|
47565
47667
|
const lastX = LastPointerXY?.x ?? e.x;
|
|
47566
47668
|
const lastY = LastPointerXY?.y ?? e.y;
|
|
47567
47669
|
LastPointerXY = { x: e.x, y: e.y };
|
|
47568
|
-
if (
|
|
47569
|
-
clearTimeout(
|
|
47570
|
-
|
|
47670
|
+
if (eventManager.touchSetTimeout) {
|
|
47671
|
+
clearTimeout(eventManager.touchSetTimeout);
|
|
47672
|
+
eventManager.touchSetTimeout = undefined;
|
|
47571
47673
|
}
|
|
47572
47674
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47573
|
-
if (
|
|
47675
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
47574
47676
|
return;
|
|
47575
47677
|
}
|
|
47576
|
-
if (
|
|
47678
|
+
if (stateManager.interactionState === InteractionState.grabing &&
|
|
47577
47679
|
Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1) {
|
|
47578
|
-
if (
|
|
47579
|
-
else if (
|
|
47580
|
-
|
|
47680
|
+
if (stateManager.isResizeCol()) ;
|
|
47681
|
+
else if (stateManager.isMoveCol()) {
|
|
47682
|
+
eventManager.dealColumnMover(eventArgsSet);
|
|
47581
47683
|
}
|
|
47582
47684
|
else {
|
|
47583
|
-
|
|
47685
|
+
eventManager.dealTableSelect(eventArgsSet, true);
|
|
47584
47686
|
}
|
|
47585
47687
|
return;
|
|
47586
47688
|
}
|
|
47587
|
-
if (
|
|
47588
|
-
|
|
47689
|
+
if (stateManager.isResizeCol() || eventManager.checkColumnResize(eventArgsSet)) {
|
|
47690
|
+
stateManager.updateCursor('col-resize');
|
|
47589
47691
|
}
|
|
47590
47692
|
else {
|
|
47591
|
-
|
|
47693
|
+
stateManager.updateCursor();
|
|
47592
47694
|
}
|
|
47593
47695
|
const cellGoup = e.path.find(node => node.role === 'cell');
|
|
47594
47696
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
|
|
47595
47697
|
if (cellGoup?.role === 'cell' &&
|
|
47596
|
-
table.
|
|
47597
|
-
table.
|
|
47598
|
-
(cellGoup.col !== table.
|
|
47698
|
+
table.stateManager.hover.cellPos.col !== -1 &&
|
|
47699
|
+
table.stateManager.hover.cellPos.row !== -1 &&
|
|
47700
|
+
(cellGoup.col !== table.stateManager.hover.cellPos.col || cellGoup.row !== table.stateManager.hover.cellPos.row)) {
|
|
47599
47701
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
47600
|
-
col: table.
|
|
47601
|
-
row: table.
|
|
47702
|
+
col: table.stateManager.hover.cellPos.col,
|
|
47703
|
+
row: table.stateManager.hover.cellPos.row,
|
|
47602
47704
|
cellRange: table.getCellRangeRelativeRect({
|
|
47603
|
-
col: table.
|
|
47604
|
-
row: table.
|
|
47705
|
+
col: table.stateManager.hover.cellPos.col,
|
|
47706
|
+
row: table.stateManager.hover.cellPos.row
|
|
47605
47707
|
}),
|
|
47606
47708
|
scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
|
|
47607
47709
|
event: e.nativeEvent,
|
|
@@ -47613,7 +47715,7 @@
|
|
|
47613
47715
|
if (cellGoup?.role === 'cell' &&
|
|
47614
47716
|
isValid$6(cellGoup.col) &&
|
|
47615
47717
|
isValid$6(cellGoup.row) &&
|
|
47616
|
-
(cellGoup.col !== table.
|
|
47718
|
+
(cellGoup.col !== table.stateManager.hover.cellPos.col || cellGoup.row !== table.stateManager.hover.cellPos.row)) {
|
|
47617
47719
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL, {
|
|
47618
47720
|
col: cellGoup.col,
|
|
47619
47721
|
row: cellGoup.row,
|
|
@@ -47627,8 +47729,8 @@
|
|
|
47627
47729
|
});
|
|
47628
47730
|
}
|
|
47629
47731
|
}
|
|
47630
|
-
|
|
47631
|
-
|
|
47732
|
+
eventManager.dealIconHover(eventArgsSet);
|
|
47733
|
+
eventManager.dealTableHover(eventArgsSet);
|
|
47632
47734
|
if (eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.MOUSEMOVE_CELL)) {
|
|
47633
47735
|
let icon;
|
|
47634
47736
|
let position;
|
|
@@ -47660,7 +47762,7 @@
|
|
|
47660
47762
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47661
47763
|
const cellGoup = eventArgsSet?.eventArgs?.target;
|
|
47662
47764
|
if (cellGoup?.role === 'table') {
|
|
47663
|
-
|
|
47765
|
+
eventManager.dealTableHover();
|
|
47664
47766
|
}
|
|
47665
47767
|
});
|
|
47666
47768
|
table.scenegraph.tableGroup.addEventListener('pointerover', (e) => {
|
|
@@ -47693,11 +47795,11 @@
|
|
|
47693
47795
|
}
|
|
47694
47796
|
});
|
|
47695
47797
|
table.scenegraph.tableGroup.addEventListener('pointerleave', (e) => {
|
|
47696
|
-
if (!
|
|
47697
|
-
|
|
47698
|
-
|
|
47798
|
+
if (!stateManager.isResizeCol() && !stateManager.isMoveCol() && !stateManager.isSelecting()) {
|
|
47799
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
47800
|
+
stateManager.updateCursor();
|
|
47699
47801
|
}
|
|
47700
|
-
|
|
47802
|
+
eventManager.dealTableHover();
|
|
47701
47803
|
const target = e.target;
|
|
47702
47804
|
if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {
|
|
47703
47805
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, {
|
|
@@ -47709,31 +47811,31 @@
|
|
|
47709
47811
|
}
|
|
47710
47812
|
});
|
|
47711
47813
|
table.scenegraph.tableGroup.addEventListener('pointerupoutside', (e) => {
|
|
47712
|
-
if (
|
|
47814
|
+
if (stateManager.isResizeCol()) {
|
|
47713
47815
|
endResizeCol(table);
|
|
47714
47816
|
}
|
|
47715
|
-
else if (
|
|
47716
|
-
table.
|
|
47717
|
-
if (table.
|
|
47718
|
-
table.
|
|
47719
|
-
table.
|
|
47720
|
-
table.
|
|
47817
|
+
else if (stateManager.isMoveCol()) {
|
|
47818
|
+
table.stateManager.endMoveCol();
|
|
47819
|
+
if (table.stateManager.columnMove?.colSource !== -1 &&
|
|
47820
|
+
table.stateManager.columnMove?.rowSource !== -1 &&
|
|
47821
|
+
table.stateManager.columnMove?.colTarget !== -1 &&
|
|
47822
|
+
table.stateManager.columnMove?.rowTarget !== -1) {
|
|
47721
47823
|
if (table.hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {
|
|
47722
47824
|
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {
|
|
47723
|
-
target: { col: table.
|
|
47825
|
+
target: { col: table.stateManager.columnMove.colTarget, row: table.stateManager.columnMove.rowTarget },
|
|
47724
47826
|
source: {
|
|
47725
|
-
col: table.
|
|
47726
|
-
row: table.
|
|
47827
|
+
col: table.stateManager.columnMove.colSource,
|
|
47828
|
+
row: table.stateManager.columnMove.rowSource
|
|
47727
47829
|
}
|
|
47728
47830
|
});
|
|
47729
47831
|
}
|
|
47730
47832
|
}
|
|
47731
47833
|
}
|
|
47732
|
-
else if (
|
|
47733
|
-
if (table.
|
|
47734
|
-
const lastCol = table.
|
|
47735
|
-
const lastRow = table.
|
|
47736
|
-
table.
|
|
47834
|
+
else if (stateManager.isSelecting()) {
|
|
47835
|
+
if (table.stateManager.select?.ranges?.length) {
|
|
47836
|
+
const lastCol = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.col;
|
|
47837
|
+
const lastRow = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.row;
|
|
47838
|
+
table.stateManager.endSelectCells();
|
|
47737
47839
|
if (table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
|
|
47738
47840
|
const cellsEvent = {
|
|
47739
47841
|
event: e.nativeEvent,
|
|
@@ -47748,8 +47850,8 @@
|
|
|
47748
47850
|
}
|
|
47749
47851
|
}
|
|
47750
47852
|
}
|
|
47751
|
-
|
|
47752
|
-
|
|
47853
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
47854
|
+
eventManager.dealTableHover();
|
|
47753
47855
|
});
|
|
47754
47856
|
table.scenegraph.tableGroup.addEventListener('pointerdown', (e) => {
|
|
47755
47857
|
LastPointerXY = { x: e.x, y: e.y };
|
|
@@ -47757,52 +47859,52 @@
|
|
|
47757
47859
|
return;
|
|
47758
47860
|
}
|
|
47759
47861
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47760
|
-
if (
|
|
47862
|
+
if (stateManager.interactionState !== InteractionState.default) {
|
|
47761
47863
|
return;
|
|
47762
47864
|
}
|
|
47763
47865
|
if (table.isPivotChart() && eventArgsSet?.eventArgs?.target.type !== 'chart') {
|
|
47764
47866
|
table.scenegraph.updateChartState(null);
|
|
47765
47867
|
}
|
|
47766
|
-
if (
|
|
47868
|
+
if (stateManager.menu.isShow &&
|
|
47767
47869
|
eventArgsSet.eventArgs &&
|
|
47768
|
-
eventArgsSet.eventArgs.target !==
|
|
47769
|
-
|
|
47870
|
+
eventArgsSet.eventArgs.target !== stateManager.residentHoverIcon?.icon) {
|
|
47871
|
+
stateManager.hideMenu();
|
|
47770
47872
|
}
|
|
47771
47873
|
const hitIcon = eventArgsSet?.eventArgs?.target?.role?.startsWith('icon')
|
|
47772
47874
|
? eventArgsSet.eventArgs.target
|
|
47773
47875
|
: undefined;
|
|
47774
47876
|
if (!hitIcon || hitIcon.attribute.interactive === false) {
|
|
47775
47877
|
if (e.pointerType === 'touch') {
|
|
47776
|
-
|
|
47777
|
-
|
|
47778
|
-
|
|
47779
|
-
|
|
47780
|
-
if (!
|
|
47781
|
-
|
|
47878
|
+
eventManager.touchEnd = false;
|
|
47879
|
+
eventManager.touchSetTimeout = setTimeout(() => {
|
|
47880
|
+
eventManager.isTouchdown = false;
|
|
47881
|
+
eventManager.touchMove = true;
|
|
47882
|
+
if (!eventManager.touchEnd && eventManager.checkColumnResize(eventArgsSet, true)) {
|
|
47883
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47782
47884
|
return;
|
|
47783
47885
|
}
|
|
47784
|
-
if (!
|
|
47785
|
-
|
|
47886
|
+
if (!eventManager.touchEnd && eventManager.chechColumnMover(eventArgsSet)) {
|
|
47887
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47786
47888
|
return;
|
|
47787
47889
|
}
|
|
47788
|
-
if (
|
|
47789
|
-
|
|
47890
|
+
if (eventManager.dealTableSelect(eventArgsSet) && !eventManager.touchEnd) {
|
|
47891
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47790
47892
|
}
|
|
47791
47893
|
}, 500);
|
|
47792
|
-
|
|
47894
|
+
eventManager.dealTableHover(eventArgsSet);
|
|
47793
47895
|
}
|
|
47794
47896
|
else {
|
|
47795
|
-
if (
|
|
47897
|
+
if (eventManager.checkColumnResize(eventArgsSet, true)) {
|
|
47796
47898
|
table.scenegraph.updateChartState(null);
|
|
47797
|
-
|
|
47899
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47798
47900
|
return;
|
|
47799
47901
|
}
|
|
47800
|
-
if (
|
|
47801
|
-
|
|
47902
|
+
if (eventManager.chechColumnMover(eventArgsSet)) {
|
|
47903
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47802
47904
|
return;
|
|
47803
47905
|
}
|
|
47804
|
-
if (
|
|
47805
|
-
|
|
47906
|
+
if (eventManager.dealTableSelect(eventArgsSet)) {
|
|
47907
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47806
47908
|
}
|
|
47807
47909
|
}
|
|
47808
47910
|
}
|
|
@@ -47822,26 +47924,26 @@
|
|
|
47822
47924
|
if (e.button !== 0) {
|
|
47823
47925
|
return;
|
|
47824
47926
|
}
|
|
47825
|
-
if (
|
|
47826
|
-
|
|
47827
|
-
if (
|
|
47927
|
+
if (stateManager.interactionState === 'grabing') {
|
|
47928
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
47929
|
+
if (stateManager.isResizeCol()) {
|
|
47828
47930
|
endResizeCol(table);
|
|
47829
47931
|
}
|
|
47830
|
-
else if (
|
|
47932
|
+
else if (stateManager.isMoveCol()) {
|
|
47831
47933
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47832
|
-
table.
|
|
47934
|
+
table.stateManager.endMoveCol();
|
|
47833
47935
|
if (eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {
|
|
47834
47936
|
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {
|
|
47835
47937
|
target: { col: eventArgsSet.eventArgs.col, row: eventArgsSet.eventArgs.row },
|
|
47836
47938
|
source: {
|
|
47837
|
-
col: table.
|
|
47838
|
-
row: table.
|
|
47939
|
+
col: table.stateManager.columnMove.colSource,
|
|
47940
|
+
row: table.stateManager.columnMove.colSource
|
|
47839
47941
|
}
|
|
47840
47942
|
});
|
|
47841
47943
|
}
|
|
47842
47944
|
}
|
|
47843
|
-
else if (
|
|
47844
|
-
table.
|
|
47945
|
+
else if (stateManager.isSelecting()) {
|
|
47946
|
+
table.stateManager.endSelectCells();
|
|
47845
47947
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47846
47948
|
if (eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
|
|
47847
47949
|
const cellsEvent = {
|
|
@@ -47857,8 +47959,8 @@
|
|
|
47857
47959
|
}
|
|
47858
47960
|
}
|
|
47859
47961
|
}
|
|
47860
|
-
else if (
|
|
47861
|
-
|
|
47962
|
+
else if (stateManager.interactionState === InteractionState.scrolling) {
|
|
47963
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
47862
47964
|
}
|
|
47863
47965
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
|
|
47864
47966
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
@@ -47875,7 +47977,7 @@
|
|
|
47875
47977
|
table.scenegraph.tableGroup.addEventListener('rightdown', (e) => {
|
|
47876
47978
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47877
47979
|
if (eventArgsSet.eventArgs) {
|
|
47878
|
-
|
|
47980
|
+
stateManager.triggerContextMenu(eventArgsSet.eventArgs.col, eventArgsSet.eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
|
|
47879
47981
|
const { col, row } = eventArgsSet.eventArgs;
|
|
47880
47982
|
if (table.hasListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL)) {
|
|
47881
47983
|
const cellInfo = table.getCellInfo(col, row);
|
|
@@ -47901,7 +48003,7 @@
|
|
|
47901
48003
|
: undefined,
|
|
47902
48004
|
target: eventArgsSet?.eventArgs?.target
|
|
47903
48005
|
};
|
|
47904
|
-
if (cellInRanges(table.
|
|
48006
|
+
if (cellInRanges(table.stateManager.select.ranges, col, row)) {
|
|
47905
48007
|
cellsEvent.cells = table.getSelectedCellInfos();
|
|
47906
48008
|
}
|
|
47907
48009
|
else {
|
|
@@ -47912,22 +48014,22 @@
|
|
|
47912
48014
|
}
|
|
47913
48015
|
});
|
|
47914
48016
|
table.scenegraph.tableGroup.addEventListener('pointertap', (e) => {
|
|
47915
|
-
if (table.
|
|
48017
|
+
if (table.stateManager.columnResize.resizing || table.stateManager.columnMove.moving) {
|
|
47916
48018
|
return;
|
|
47917
48019
|
}
|
|
47918
48020
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47919
|
-
|
|
48021
|
+
eventManager.dealIconClick(e, eventArgsSet);
|
|
47920
48022
|
if (!eventArgsSet?.eventArgs) {
|
|
47921
48023
|
return;
|
|
47922
48024
|
}
|
|
47923
|
-
if (
|
|
48025
|
+
if (eventManager.touchSetTimeout || e.pointerType !== 'touch') {
|
|
47924
48026
|
if (e.pointerType === 'touch') {
|
|
47925
48027
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47926
|
-
if (
|
|
47927
|
-
clearTimeout(
|
|
47928
|
-
|
|
47929
|
-
|
|
47930
|
-
|
|
48028
|
+
if (eventManager.touchSetTimeout) {
|
|
48029
|
+
clearTimeout(eventManager.touchSetTimeout);
|
|
48030
|
+
eventManager.dealTableSelect(eventArgsSet);
|
|
48031
|
+
stateManager.endSelectCells();
|
|
48032
|
+
eventManager.touchSetTimeout = undefined;
|
|
47931
48033
|
}
|
|
47932
48034
|
}
|
|
47933
48035
|
if (table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
|
|
@@ -47965,20 +48067,36 @@
|
|
|
47965
48067
|
if (!isDraging &&
|
|
47966
48068
|
target &&
|
|
47967
48069
|
!target.isDescendantsOf(table.scenegraph.tableGroup)) {
|
|
47968
|
-
|
|
47969
|
-
|
|
47970
|
-
|
|
47971
|
-
|
|
48070
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48071
|
+
eventManager.dealTableHover();
|
|
48072
|
+
eventManager.dealTableSelect();
|
|
48073
|
+
stateManager.updateCursor();
|
|
47972
48074
|
table.scenegraph.updateChartState(null);
|
|
47973
48075
|
}
|
|
47974
48076
|
else if (isDraging) {
|
|
47975
|
-
|
|
48077
|
+
stateManager.endSelectCells();
|
|
47976
48078
|
}
|
|
47977
48079
|
});
|
|
47978
48080
|
table.scenegraph.tableGroup.addEventListener('checkbox_state_change', (e) => {
|
|
47979
48081
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47980
48082
|
const { col, row } = eventArgsSet.eventArgs;
|
|
47981
48083
|
const cellInfo = table.getCellInfo(col, row);
|
|
48084
|
+
const mergeRange = getCellMergeInfo(table, col, row);
|
|
48085
|
+
if (mergeRange) {
|
|
48086
|
+
for (let col = mergeRange.start.col; col <= mergeRange.end.col; col++) {
|
|
48087
|
+
for (let row = mergeRange.start.row; row <= mergeRange.end.row; row++) {
|
|
48088
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
48089
|
+
cellGroup.forEachChildren((checkbox) => {
|
|
48090
|
+
if (checkbox.name === 'checkbox') {
|
|
48091
|
+
checkbox.setAttributes({
|
|
48092
|
+
checked: e.target.attribute.checked,
|
|
48093
|
+
indeterminate: e.target.attribute.indeterminate
|
|
48094
|
+
});
|
|
48095
|
+
}
|
|
48096
|
+
});
|
|
48097
|
+
}
|
|
48098
|
+
}
|
|
48099
|
+
}
|
|
47982
48100
|
const cellsEvent = {
|
|
47983
48101
|
...cellInfo,
|
|
47984
48102
|
event: e.nativeEvent,
|
|
@@ -47986,18 +48104,18 @@
|
|
|
47986
48104
|
checked: e.detail.checked
|
|
47987
48105
|
};
|
|
47988
48106
|
if (table.isHeader(col, row)) {
|
|
47989
|
-
table.
|
|
48107
|
+
table.stateManager.setHeaderCheckedState(cellInfo.field, e.detail.checked);
|
|
47990
48108
|
const define = table.getBodyColumnDefine(col, row);
|
|
47991
48109
|
if (define.cellType === 'checkbox') {
|
|
47992
48110
|
table.scenegraph.updateCheckboxCellState(col, row, e.detail.checked);
|
|
47993
48111
|
}
|
|
47994
48112
|
}
|
|
47995
48113
|
else {
|
|
47996
|
-
table.
|
|
48114
|
+
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked);
|
|
47997
48115
|
const define = table.getBodyColumnDefine(col, row);
|
|
47998
48116
|
if (define.headerType === 'checkbox') {
|
|
47999
|
-
const oldHeaderCheckedState = table.
|
|
48000
|
-
const newHeaderCheckedState = table.
|
|
48117
|
+
const oldHeaderCheckedState = table.stateManager.headerCheckedState[cellInfo.field];
|
|
48118
|
+
const newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(cellInfo.field);
|
|
48001
48119
|
if (oldHeaderCheckedState !== newHeaderCheckedState) {
|
|
48002
48120
|
table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
48003
48121
|
}
|
|
@@ -48006,26 +48124,26 @@
|
|
|
48006
48124
|
table.fireListeners(TABLE_EVENT_TYPE.CHECKBOX_STATE_CHANGE, cellsEvent);
|
|
48007
48125
|
});
|
|
48008
48126
|
}
|
|
48009
|
-
function bindGesture(
|
|
48010
|
-
const table =
|
|
48011
|
-
|
|
48127
|
+
function bindGesture(eventManager) {
|
|
48128
|
+
const table = eventManager.table;
|
|
48129
|
+
eventManager.gesture = new Gesture(table.scenegraph.stage, {
|
|
48012
48130
|
tap: {
|
|
48013
48131
|
interval: 300
|
|
48014
48132
|
}
|
|
48015
48133
|
});
|
|
48016
|
-
|
|
48134
|
+
eventManager.gesture.on('doubletap', e => {
|
|
48017
48135
|
dblclickHandler(e, table);
|
|
48018
48136
|
});
|
|
48019
48137
|
}
|
|
48020
48138
|
function endResizeCol(table) {
|
|
48021
|
-
table.
|
|
48139
|
+
table.stateManager.endResizeCol();
|
|
48022
48140
|
if (table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END)) {
|
|
48023
48141
|
const columns = [];
|
|
48024
48142
|
for (let col = 0; col < table.colCount; col++) {
|
|
48025
48143
|
columns.push(table.getColWidth(col));
|
|
48026
48144
|
}
|
|
48027
48145
|
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
48028
|
-
col: table.
|
|
48146
|
+
col: table.stateManager.columnResize.col,
|
|
48029
48147
|
columns
|
|
48030
48148
|
});
|
|
48031
48149
|
}
|
|
@@ -48065,76 +48183,76 @@
|
|
|
48065
48183
|
}
|
|
48066
48184
|
}
|
|
48067
48185
|
|
|
48068
|
-
function bindScrollBarListener(
|
|
48069
|
-
const table =
|
|
48070
|
-
const
|
|
48186
|
+
function bindScrollBarListener(eventManager) {
|
|
48187
|
+
const table = eventManager.table;
|
|
48188
|
+
const stateManager = table.stateManager;
|
|
48071
48189
|
const scenegraph = table.scenegraph;
|
|
48072
48190
|
scenegraph.component.vScrollBar.addEventListener('pointerover', (e) => {
|
|
48073
|
-
|
|
48191
|
+
stateManager.showVerticalScrollBar();
|
|
48074
48192
|
});
|
|
48075
48193
|
scenegraph.component.hScrollBar.addEventListener('pointerover', (e) => {
|
|
48076
|
-
|
|
48194
|
+
stateManager.showHorizontalScrollBar();
|
|
48077
48195
|
});
|
|
48078
48196
|
scenegraph.component.vScrollBar.addEventListener('pointerout', (e) => {
|
|
48079
|
-
if (
|
|
48197
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48080
48198
|
return;
|
|
48081
48199
|
}
|
|
48082
|
-
|
|
48200
|
+
stateManager.hideVerticalScrollBar();
|
|
48083
48201
|
});
|
|
48084
48202
|
scenegraph.component.hScrollBar.addEventListener('pointerout', (e) => {
|
|
48085
|
-
if (
|
|
48203
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48086
48204
|
return;
|
|
48087
48205
|
}
|
|
48088
|
-
|
|
48206
|
+
stateManager.hideHorizontalScrollBar();
|
|
48089
48207
|
});
|
|
48090
48208
|
scenegraph.component.vScrollBar._slider.addEventListener('pointerdown', () => {
|
|
48091
|
-
if (
|
|
48092
|
-
|
|
48209
|
+
if (stateManager.interactionState !== InteractionState.scrolling) {
|
|
48210
|
+
stateManager.updateInteractionState(InteractionState.scrolling);
|
|
48093
48211
|
}
|
|
48094
48212
|
});
|
|
48095
48213
|
scenegraph.component.vScrollBar.addEventListener('pointerup', () => {
|
|
48096
|
-
|
|
48097
|
-
if (
|
|
48098
|
-
|
|
48214
|
+
stateManager.fastScrolling = false;
|
|
48215
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48216
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48099
48217
|
}
|
|
48100
48218
|
});
|
|
48101
48219
|
scenegraph.component.vScrollBar.addEventListener('pointerupoutside', () => {
|
|
48102
|
-
|
|
48103
|
-
if (
|
|
48104
|
-
|
|
48220
|
+
stateManager.fastScrolling = false;
|
|
48221
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48222
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48105
48223
|
}
|
|
48106
48224
|
});
|
|
48107
48225
|
scenegraph.component.hScrollBar._slider.addEventListener('pointerdown', () => {
|
|
48108
|
-
if (
|
|
48109
|
-
|
|
48226
|
+
if (stateManager.interactionState !== InteractionState.scrolling) {
|
|
48227
|
+
stateManager.updateInteractionState(InteractionState.scrolling);
|
|
48110
48228
|
}
|
|
48111
48229
|
});
|
|
48112
48230
|
scenegraph.component.hScrollBar.addEventListener('pointerup', () => {
|
|
48113
|
-
|
|
48114
|
-
if (
|
|
48115
|
-
|
|
48231
|
+
stateManager.fastScrolling = false;
|
|
48232
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48233
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48116
48234
|
}
|
|
48117
48235
|
});
|
|
48118
48236
|
scenegraph.component.hScrollBar.addEventListener('pointerupoutside', () => {
|
|
48119
|
-
|
|
48120
|
-
if (
|
|
48121
|
-
|
|
48237
|
+
stateManager.fastScrolling = false;
|
|
48238
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48239
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48122
48240
|
}
|
|
48123
48241
|
});
|
|
48124
|
-
const throttleVerticalWheel = throttle(
|
|
48125
|
-
const throttleHorizontalWheel = throttle(
|
|
48242
|
+
const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20);
|
|
48243
|
+
const throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
|
|
48126
48244
|
scenegraph.component.vScrollBar.addEventListener('scroll', (e) => {
|
|
48127
|
-
|
|
48128
|
-
if (
|
|
48129
|
-
|
|
48245
|
+
stateManager.fastScrolling = true;
|
|
48246
|
+
if (stateManager.interactionState !== InteractionState.scrolling) {
|
|
48247
|
+
stateManager.updateInteractionState(InteractionState.scrolling);
|
|
48130
48248
|
}
|
|
48131
48249
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
48132
48250
|
throttleVerticalWheel(ratio, e);
|
|
48133
48251
|
});
|
|
48134
48252
|
scenegraph.component.hScrollBar.addEventListener('scroll', (e) => {
|
|
48135
|
-
|
|
48136
|
-
if (
|
|
48137
|
-
|
|
48253
|
+
stateManager.fastScrolling = true;
|
|
48254
|
+
if (stateManager.interactionState !== InteractionState.scrolling) {
|
|
48255
|
+
stateManager.updateInteractionState(InteractionState.scrolling);
|
|
48138
48256
|
}
|
|
48139
48257
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
48140
48258
|
throttleHorizontalWheel(ratio);
|
|
@@ -48207,21 +48325,21 @@
|
|
|
48207
48325
|
return totalWidth !== 0 && deltaX >= 0 && Math.abs(state.scroll.horizontalBarPos - totalWidth) < 1;
|
|
48208
48326
|
}
|
|
48209
48327
|
|
|
48210
|
-
function bindContainerDomListener(
|
|
48211
|
-
const table =
|
|
48212
|
-
const
|
|
48328
|
+
function bindContainerDomListener(eventManager) {
|
|
48329
|
+
const table = eventManager.table;
|
|
48330
|
+
const stateManager = table.stateManager;
|
|
48213
48331
|
const handler = table.internalProps.handler;
|
|
48214
48332
|
handler.on(table.getElement(), 'blur', (e) => {
|
|
48215
|
-
|
|
48333
|
+
eventManager.dealTableHover();
|
|
48216
48334
|
});
|
|
48217
48335
|
handler.on(table.getElement(), 'wheel', (e) => {
|
|
48218
|
-
handleWhell(e,
|
|
48336
|
+
handleWhell(e, stateManager);
|
|
48219
48337
|
});
|
|
48220
48338
|
handler.on(table.getElement(), 'keydown', (e) => {
|
|
48221
48339
|
if (table.keyboardOptions?.selectAllOnCtrlA) {
|
|
48222
48340
|
if (e.key === 'a' && (e.ctrlKey || e.metaKey)) {
|
|
48223
48341
|
e.preventDefault();
|
|
48224
|
-
|
|
48342
|
+
eventManager.deelTableSelectAll();
|
|
48225
48343
|
}
|
|
48226
48344
|
}
|
|
48227
48345
|
if (table.hasListeners(TABLE_EVENT_TYPE.KEYDOWN)) {
|
|
@@ -48229,7 +48347,6 @@
|
|
|
48229
48347
|
keyCode: e.keyCode ?? e.which,
|
|
48230
48348
|
code: e.code,
|
|
48231
48349
|
event: e,
|
|
48232
|
-
cells: table.getSelectedCellInfos(),
|
|
48233
48350
|
scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth
|
|
48234
48351
|
};
|
|
48235
48352
|
table.fireListeners(TABLE_EVENT_TYPE.KEYDOWN, cellsEvent);
|
|
@@ -48247,7 +48364,7 @@
|
|
|
48247
48364
|
e.clipboardData.setData('text/plain', data);
|
|
48248
48365
|
}
|
|
48249
48366
|
table.fireListeners(TABLE_EVENT_TYPE.COPY_DATA, {
|
|
48250
|
-
cellRange: table.
|
|
48367
|
+
cellRange: table.stateManager.select.ranges,
|
|
48251
48368
|
copyData: data
|
|
48252
48369
|
});
|
|
48253
48370
|
}
|
|
@@ -48261,87 +48378,87 @@
|
|
|
48261
48378
|
});
|
|
48262
48379
|
}
|
|
48263
48380
|
|
|
48264
|
-
function bindTouchListener(
|
|
48265
|
-
const table =
|
|
48266
|
-
const
|
|
48381
|
+
function bindTouchListener(eventManager) {
|
|
48382
|
+
const table = eventManager.table;
|
|
48383
|
+
const stateManager = table.stateManager;
|
|
48267
48384
|
const scenegraph = table.scenegraph;
|
|
48268
|
-
|
|
48385
|
+
eventManager.touchMovePoints = [];
|
|
48269
48386
|
table.scenegraph.tableGroup.addEventListener('touchstart', (e) => {
|
|
48270
48387
|
if (e.target.isChildOf(scenegraph.component.vScrollBar) || e.target.isChildOf(scenegraph.component.vScrollBar)) {
|
|
48271
48388
|
return;
|
|
48272
48389
|
}
|
|
48273
|
-
|
|
48274
|
-
|
|
48390
|
+
eventManager.isTouchdown = true;
|
|
48391
|
+
eventManager.touchMovePoints.push({
|
|
48275
48392
|
x: e.page.x,
|
|
48276
48393
|
y: e.page.y,
|
|
48277
48394
|
timestamp: Date.now()
|
|
48278
48395
|
});
|
|
48279
48396
|
});
|
|
48280
48397
|
window.addEventListener('touchmove', (e) => {
|
|
48281
|
-
if (
|
|
48398
|
+
if (eventManager.touchMove) {
|
|
48282
48399
|
e.preventDefault();
|
|
48283
48400
|
}
|
|
48284
|
-
if (!
|
|
48401
|
+
if (!eventManager.isTouchdown || !isTouchEvent$1(e)) {
|
|
48285
48402
|
return;
|
|
48286
48403
|
}
|
|
48287
|
-
if (
|
|
48288
|
-
|
|
48404
|
+
if (eventManager.touchMovePoints.length > 4) {
|
|
48405
|
+
eventManager.touchMovePoints.shift();
|
|
48289
48406
|
}
|
|
48290
|
-
|
|
48407
|
+
eventManager.touchMovePoints.push({
|
|
48291
48408
|
x: e.changedTouches[0].pageX,
|
|
48292
48409
|
y: e.changedTouches[0].pageY,
|
|
48293
48410
|
timestamp: Date.now()
|
|
48294
48411
|
});
|
|
48295
|
-
const deltaX = -
|
|
48296
|
-
|
|
48297
|
-
const deltaY = -
|
|
48298
|
-
|
|
48299
|
-
handleWhell({ deltaX, deltaY },
|
|
48412
|
+
const deltaX = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].x +
|
|
48413
|
+
eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].x;
|
|
48414
|
+
const deltaY = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].y +
|
|
48415
|
+
eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].y;
|
|
48416
|
+
handleWhell({ deltaX, deltaY }, stateManager);
|
|
48300
48417
|
if (e.cancelable &&
|
|
48301
48418
|
(table.internalProps.overscrollBehavior === 'none' ||
|
|
48302
|
-
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY,
|
|
48303
|
-
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX,
|
|
48419
|
+
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, stateManager)) ||
|
|
48420
|
+
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, stateManager)))) {
|
|
48304
48421
|
e.preventDefault();
|
|
48305
48422
|
}
|
|
48306
48423
|
}, { passive: false });
|
|
48307
48424
|
window.addEventListener('touchend', (e) => {
|
|
48308
|
-
|
|
48309
|
-
|
|
48310
|
-
if (!
|
|
48425
|
+
eventManager.touchEnd = true;
|
|
48426
|
+
eventManager.touchMove = false;
|
|
48427
|
+
if (!eventManager.isTouchdown || !isTouchEvent$1(e)) {
|
|
48311
48428
|
return;
|
|
48312
48429
|
}
|
|
48313
|
-
if (
|
|
48314
|
-
if (
|
|
48315
|
-
|
|
48430
|
+
if (eventManager.touchMovePoints?.length) {
|
|
48431
|
+
if (eventManager.touchMovePoints.length > 4) {
|
|
48432
|
+
eventManager.touchMovePoints.shift();
|
|
48316
48433
|
}
|
|
48317
|
-
|
|
48434
|
+
eventManager.touchMovePoints.push({
|
|
48318
48435
|
x: e.changedTouches[0].pageX,
|
|
48319
48436
|
y: e.changedTouches[0].pageY,
|
|
48320
48437
|
timestamp: Date.now()
|
|
48321
48438
|
});
|
|
48322
|
-
const firstPoint =
|
|
48323
|
-
const lastPoint =
|
|
48439
|
+
const firstPoint = eventManager.touchMovePoints[0];
|
|
48440
|
+
const lastPoint = eventManager.touchMovePoints[eventManager.touchMovePoints?.length - 1];
|
|
48324
48441
|
const vX = (lastPoint.x - firstPoint.x) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
48325
48442
|
const vY = (lastPoint.y - firstPoint.y) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
48326
|
-
startInertia(vX, vY,
|
|
48443
|
+
startInertia(vX, vY, stateManager);
|
|
48327
48444
|
}
|
|
48328
|
-
|
|
48329
|
-
|
|
48445
|
+
eventManager.isTouchdown = false;
|
|
48446
|
+
eventManager.touchMovePoints = [];
|
|
48330
48447
|
});
|
|
48331
48448
|
window.addEventListener('touchcancel', (e) => {
|
|
48332
|
-
|
|
48333
|
-
|
|
48334
|
-
if (!
|
|
48449
|
+
eventManager.touchEnd = true;
|
|
48450
|
+
eventManager.touchMove = false;
|
|
48451
|
+
if (!eventManager.isTouchdown) {
|
|
48335
48452
|
return;
|
|
48336
48453
|
}
|
|
48337
|
-
|
|
48338
|
-
|
|
48454
|
+
eventManager.isTouchdown = false;
|
|
48455
|
+
eventManager.touchMovePoints = [];
|
|
48339
48456
|
});
|
|
48340
48457
|
}
|
|
48341
48458
|
function isTouchEvent$1(e) {
|
|
48342
48459
|
return !!e.changedTouches;
|
|
48343
48460
|
}
|
|
48344
|
-
function startInertia(vX, vY,
|
|
48461
|
+
function startInertia(vX, vY, stateManager) {
|
|
48345
48462
|
let time = Date.now();
|
|
48346
48463
|
const friction = 0.95;
|
|
48347
48464
|
const inertia = () => {
|
|
@@ -48361,7 +48478,7 @@
|
|
|
48361
48478
|
stopped = false;
|
|
48362
48479
|
dy = ((vY + newVY) / 2) * dffTime;
|
|
48363
48480
|
}
|
|
48364
|
-
handleWhell({ deltaX: -dx, deltaY: -dy },
|
|
48481
|
+
handleWhell({ deltaX: -dx, deltaY: -dy }, stateManager);
|
|
48365
48482
|
if (stopped) {
|
|
48366
48483
|
return;
|
|
48367
48484
|
}
|
|
@@ -48378,7 +48495,7 @@
|
|
|
48378
48495
|
return;
|
|
48379
48496
|
}
|
|
48380
48497
|
table.scenegraph.tableGroup.addEventListener('click', (e) => {
|
|
48381
|
-
if (table.
|
|
48498
|
+
if (table.stateManager.columnMove.moving || table.stateManager.columnResize.resizing) {
|
|
48382
48499
|
return;
|
|
48383
48500
|
}
|
|
48384
48501
|
if (e.target.name === 'axis-label') {
|
|
@@ -48498,7 +48615,7 @@
|
|
|
48498
48615
|
return 'bottom';
|
|
48499
48616
|
}
|
|
48500
48617
|
|
|
48501
|
-
class
|
|
48618
|
+
class EventManager {
|
|
48502
48619
|
table;
|
|
48503
48620
|
isTouchdown;
|
|
48504
48621
|
touchMovePoints;
|
|
@@ -48527,28 +48644,28 @@
|
|
|
48527
48644
|
if (this.table.isReleased) {
|
|
48528
48645
|
return;
|
|
48529
48646
|
}
|
|
48530
|
-
const
|
|
48647
|
+
const stateManager = this.table.stateManager;
|
|
48531
48648
|
this.table.on(TABLE_EVENT_TYPE.ICON_CLICK, iconInfo => {
|
|
48532
48649
|
const { col, row, x, y, funcType, icon } = iconInfo;
|
|
48533
48650
|
if (funcType === IconFuncTypeEnum.dropDown) {
|
|
48534
|
-
|
|
48651
|
+
stateManager.triggerDropDownMenu(col, row, x, y);
|
|
48535
48652
|
}
|
|
48536
48653
|
else if (funcType === IconFuncTypeEnum.sort) {
|
|
48537
|
-
|
|
48654
|
+
stateManager.triggerSort(col, row, icon);
|
|
48538
48655
|
}
|
|
48539
48656
|
else if (funcType === IconFuncTypeEnum.frozen) {
|
|
48540
|
-
|
|
48657
|
+
stateManager.triggerFreeze(col, row, icon);
|
|
48541
48658
|
}
|
|
48542
48659
|
else if (funcType === IconFuncTypeEnum.drillDown) {
|
|
48543
48660
|
drillClick(this.table);
|
|
48544
48661
|
}
|
|
48545
48662
|
else if (funcType === IconFuncTypeEnum.collapse || funcType === IconFuncTypeEnum.expand) {
|
|
48546
|
-
this.table.
|
|
48663
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48547
48664
|
this.table.toggleHierarchyState(col, row);
|
|
48548
48665
|
}
|
|
48549
48666
|
});
|
|
48550
48667
|
this.table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
|
|
48551
|
-
|
|
48668
|
+
stateManager.hideMenu();
|
|
48552
48669
|
});
|
|
48553
48670
|
if (checkHaveTextStick(this.table)) {
|
|
48554
48671
|
this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
|
|
@@ -48574,31 +48691,31 @@
|
|
|
48574
48691
|
}
|
|
48575
48692
|
dealTableHover(eventArgsSet) {
|
|
48576
48693
|
if (!eventArgsSet) {
|
|
48577
|
-
this.table.
|
|
48694
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
48578
48695
|
return;
|
|
48579
48696
|
}
|
|
48580
48697
|
const { eventArgs } = eventArgsSet;
|
|
48581
48698
|
if (eventArgs) {
|
|
48582
|
-
this.table.
|
|
48699
|
+
this.table.stateManager.updateHoverPos(eventArgs.col, eventArgs.row);
|
|
48583
48700
|
}
|
|
48584
48701
|
else {
|
|
48585
|
-
this.table.
|
|
48702
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
48586
48703
|
}
|
|
48587
48704
|
}
|
|
48588
48705
|
dealIconHover(eventArgsSet) {
|
|
48589
48706
|
const { eventArgs } = eventArgsSet;
|
|
48590
48707
|
if (eventArgs) {
|
|
48591
|
-
this.table.
|
|
48708
|
+
this.table.stateManager.updateHoverIcon(eventArgs.col, eventArgs.row, eventArgs.target, eventArgs.targetCell, eventArgs.event);
|
|
48592
48709
|
}
|
|
48593
48710
|
else {
|
|
48594
|
-
this.table.
|
|
48711
|
+
this.table.stateManager.updateHoverIcon(-1, -1, undefined, undefined);
|
|
48595
48712
|
}
|
|
48596
48713
|
}
|
|
48597
48714
|
dealMenuHover(eventArgsSet) {
|
|
48598
48715
|
}
|
|
48599
48716
|
dealTableSelect(eventArgsSet, isSelectMoving) {
|
|
48600
48717
|
if (!eventArgsSet) {
|
|
48601
|
-
this.table.
|
|
48718
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48602
48719
|
return false;
|
|
48603
48720
|
}
|
|
48604
48721
|
const { eventArgs } = eventArgsSet;
|
|
@@ -48608,30 +48725,30 @@
|
|
|
48608
48725
|
}
|
|
48609
48726
|
const define = this.table.getBodyColumnDefine(eventArgs.col, eventArgs.row);
|
|
48610
48727
|
if (this.table.isHeader(eventArgs.col, eventArgs.row) &&
|
|
48611
|
-
(define?.disableHeaderSelect || this.table.
|
|
48728
|
+
(define?.disableHeaderSelect || this.table.stateManager.select?.disableHeader)) {
|
|
48612
48729
|
if (!isSelectMoving) {
|
|
48613
|
-
this.table.
|
|
48730
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48614
48731
|
}
|
|
48615
48732
|
return false;
|
|
48616
48733
|
}
|
|
48617
48734
|
else if (!this.table.isHeader(eventArgs.col, eventArgs.row) && define?.disableSelect) {
|
|
48618
48735
|
if (!isSelectMoving) {
|
|
48619
|
-
this.table.
|
|
48736
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48620
48737
|
}
|
|
48621
48738
|
return false;
|
|
48622
48739
|
}
|
|
48623
48740
|
if (this.table.isPivotChart() &&
|
|
48624
48741
|
(eventArgsSet?.eventArgs?.target.name === 'axis-label' || eventArgsSet?.eventArgs?.target.type === 'chart')) {
|
|
48625
|
-
this.table.
|
|
48742
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48626
48743
|
return false;
|
|
48627
48744
|
}
|
|
48628
|
-
this.table.
|
|
48745
|
+
this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey);
|
|
48629
48746
|
return true;
|
|
48630
48747
|
}
|
|
48631
48748
|
return false;
|
|
48632
48749
|
}
|
|
48633
48750
|
deelTableSelectAll() {
|
|
48634
|
-
this.table.
|
|
48751
|
+
this.table.stateManager.updateSelectPos(-1, -1, false, false, true);
|
|
48635
48752
|
}
|
|
48636
48753
|
dealMenuSelect(eventArgsSet) {
|
|
48637
48754
|
}
|
|
@@ -48641,7 +48758,7 @@
|
|
|
48641
48758
|
const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgs.targetCell);
|
|
48642
48759
|
if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
|
|
48643
48760
|
if (update) {
|
|
48644
|
-
this.table.
|
|
48761
|
+
this.table.stateManager.startResizeCol(resizeCol.col, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, resizeCol.rightFrozen);
|
|
48645
48762
|
}
|
|
48646
48763
|
return true;
|
|
48647
48764
|
}
|
|
@@ -48649,22 +48766,22 @@
|
|
|
48649
48766
|
return false;
|
|
48650
48767
|
}
|
|
48651
48768
|
dealColumnResize(xInTable, yInTable) {
|
|
48652
|
-
this.table.
|
|
48769
|
+
this.table.stateManager.updateResizeCol(xInTable, yInTable);
|
|
48653
48770
|
}
|
|
48654
48771
|
chechColumnMover(eventArgsSet) {
|
|
48655
48772
|
const { eventArgs } = eventArgsSet;
|
|
48656
48773
|
if (eventArgs &&
|
|
48657
48774
|
this.table.isHeader(eventArgs.col, eventArgs.row) &&
|
|
48658
|
-
checkCellInSelect(eventArgs.col, eventArgs.row, this.table.
|
|
48775
|
+
checkCellInSelect(eventArgs.col, eventArgs.row, this.table.stateManager.select.ranges) &&
|
|
48659
48776
|
this.table._canDragHeaderPosition(eventArgs.col, eventArgs.row)) {
|
|
48660
|
-
this.table.
|
|
48777
|
+
this.table.stateManager.startMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
|
|
48661
48778
|
return true;
|
|
48662
48779
|
}
|
|
48663
48780
|
return false;
|
|
48664
48781
|
}
|
|
48665
48782
|
dealColumnMover(eventArgsSet) {
|
|
48666
48783
|
const { eventArgs } = eventArgsSet;
|
|
48667
|
-
this.table.
|
|
48784
|
+
this.table.stateManager.updateMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
|
|
48668
48785
|
}
|
|
48669
48786
|
startColumnResize(eventArgsSet) {
|
|
48670
48787
|
}
|
|
@@ -49271,8 +49388,8 @@
|
|
|
49271
49388
|
const children = this._menuInstanceInfo.content[dropDownIndex]?.children;
|
|
49272
49389
|
for (let i = 0; i < children.length; i++) {
|
|
49273
49390
|
const menuItem = children[i];
|
|
49274
|
-
const isHighlight = table.
|
|
49275
|
-
? isMenuHighlight(table, table.
|
|
49391
|
+
const isHighlight = table.stateManager.menu.dropDownMenuHighlight
|
|
49392
|
+
? isMenuHighlight(table, table.stateManager.menu.dropDownMenuHighlight, typeof menuItem === 'object' ? menuItem?.menuKey || menuItem?.text : menuItem, col, row)
|
|
49276
49393
|
: false;
|
|
49277
49394
|
const item = createItem(menuItem, isHighlight);
|
|
49278
49395
|
item.col = col;
|
|
@@ -49348,7 +49465,7 @@
|
|
|
49348
49465
|
if (typeof menu === 'object' && menu.children && menu.children.length) {
|
|
49349
49466
|
for (let j = 0; j < menu.children.length; j++) {
|
|
49350
49467
|
const childItem = menu.children[j];
|
|
49351
|
-
if (isMenuHighlight(table, table.
|
|
49468
|
+
if (isMenuHighlight(table, table.stateManager.menu.dropDownMenuHighlight, typeof childItem === 'object' ? childItem?.menuKey : childItem, col, row) &&
|
|
49352
49469
|
menuKey === (typeof childItem === 'object' ? childItem?.menuKey : childItem)) {
|
|
49353
49470
|
highlight = true;
|
|
49354
49471
|
return;
|
|
@@ -49397,16 +49514,16 @@
|
|
|
49397
49514
|
const menuListItem = menuInstanceInfo.content;
|
|
49398
49515
|
for (let i = 0; i < menuListItem?.length ?? 0; i++) {
|
|
49399
49516
|
const menuItem = menuListItem[i];
|
|
49400
|
-
let isHighlight = table.
|
|
49401
|
-
? isMenuHighlight(table, table.
|
|
49517
|
+
let isHighlight = table.stateManager.menu.dropDownMenuHighlight
|
|
49518
|
+
? isMenuHighlight(table, table.stateManager.menu.dropDownMenuHighlight, typeof menuItem === 'object' ? menuItem?.menuKey || menuItem?.text : menuItem, col, row)
|
|
49402
49519
|
: false;
|
|
49403
|
-
if (table.
|
|
49520
|
+
if (table.stateManager.menu.dropDownMenuHighlight &&
|
|
49404
49521
|
typeof menuItem === 'object' &&
|
|
49405
49522
|
Array.isArray(menuItem.children) &&
|
|
49406
49523
|
menuItem.children.length) {
|
|
49407
49524
|
for (let i = 0; i < menuItem.children.length; i++) {
|
|
49408
49525
|
const childItem = menuItem.children[i];
|
|
49409
|
-
if (isMenuHighlight(table, table.
|
|
49526
|
+
if (isMenuHighlight(table, table.stateManager.menu.dropDownMenuHighlight, typeof childItem === 'object' ? childItem?.menuKey || childItem?.text : childItem, col, row)) {
|
|
49410
49527
|
isHighlight = true;
|
|
49411
49528
|
break;
|
|
49412
49529
|
}
|
|
@@ -49835,8 +49952,8 @@
|
|
|
49835
49952
|
if (typeof menu === 'object' && menu.children && menu.children.length) {
|
|
49836
49953
|
for (let j = 0; j < menu.children.length; j++) {
|
|
49837
49954
|
const childItem = menu.children[j];
|
|
49838
|
-
if (_table.
|
|
49839
|
-
isMenuHighlight(_table, _table.
|
|
49955
|
+
if (_table.stateManager.menu?.dropDownMenuHighlight &&
|
|
49956
|
+
isMenuHighlight(_table, _table.stateManager.menu?.dropDownMenuHighlight, typeof childItem === 'object' ? childItem?.menuKey : childItem, col, row)) {
|
|
49840
49957
|
highlightIndex = i;
|
|
49841
49958
|
subHighlightIndex = j;
|
|
49842
49959
|
break;
|
|
@@ -50211,12 +50328,12 @@
|
|
|
50211
50328
|
if (isMobile()) {
|
|
50212
50329
|
rootElement.style.fontSize = '11px';
|
|
50213
50330
|
}
|
|
50214
|
-
const { x1: menuLeft, x2: menuRight, y1: menuTop, y2: menuBottom } = table.
|
|
50331
|
+
const { x1: menuLeft, x2: menuRight, y1: menuTop, y2: menuBottom } = table.stateManager.menu.bounds;
|
|
50215
50332
|
const tooltipLeft = tooltipX;
|
|
50216
50333
|
const tooltipRight = tooltipLeft + rootElementWidth;
|
|
50217
50334
|
const tooltipTop = tooltipY;
|
|
50218
50335
|
const tooltipBottom = tooltipLeft + rootElementHeight;
|
|
50219
|
-
if (table.
|
|
50336
|
+
if (table.stateManager.menu.isShow &&
|
|
50220
50337
|
menuLeft < tooltipRight &&
|
|
50221
50338
|
menuRight > tooltipLeft &&
|
|
50222
50339
|
menuBottom > tooltipTop &&
|
|
@@ -50423,8 +50540,8 @@
|
|
|
50423
50540
|
if (isMobile()) {
|
|
50424
50541
|
return;
|
|
50425
50542
|
}
|
|
50426
|
-
const { x1: left, x2: right, y1: top, y2: bottom } = table.
|
|
50427
|
-
if (table.
|
|
50543
|
+
const { x1: left, x2: right, y1: top, y2: bottom } = table.stateManager.menu.bounds;
|
|
50544
|
+
if (table.stateManager.menu.isShow &&
|
|
50428
50545
|
typeof e.x === 'number' &&
|
|
50429
50546
|
typeof e.y === 'number' &&
|
|
50430
50547
|
e.x > left &&
|
|
@@ -50490,7 +50607,7 @@
|
|
|
50490
50607
|
this._unbindFromCell();
|
|
50491
50608
|
}
|
|
50492
50609
|
}
|
|
50493
|
-
if (this._attachInfo && table.
|
|
50610
|
+
if (this._attachInfo && table.stateManager.menu.isShow) {
|
|
50494
50611
|
this._bindToCell(e.col, e.row);
|
|
50495
50612
|
}
|
|
50496
50613
|
});
|
|
@@ -51565,14 +51682,14 @@
|
|
|
51565
51682
|
canvasHeight;
|
|
51566
51683
|
_vDataSet;
|
|
51567
51684
|
scenegraph;
|
|
51568
|
-
|
|
51569
|
-
|
|
51685
|
+
stateManager;
|
|
51686
|
+
eventManager;
|
|
51570
51687
|
_pixelRatio;
|
|
51571
51688
|
static get EVENT_TYPE() {
|
|
51572
51689
|
return TABLE_EVENT_TYPE;
|
|
51573
51690
|
}
|
|
51574
51691
|
options;
|
|
51575
|
-
version = "0.15.
|
|
51692
|
+
version = "0.15.2";
|
|
51576
51693
|
pagination;
|
|
51577
51694
|
id = `VTable${Date.now()}`;
|
|
51578
51695
|
headerStyleCache;
|
|
@@ -51681,8 +51798,8 @@
|
|
|
51681
51798
|
: 10;
|
|
51682
51799
|
this._vDataSet = new DataSet();
|
|
51683
51800
|
this.scenegraph = new Scenegraph(this);
|
|
51684
|
-
this.
|
|
51685
|
-
this.
|
|
51801
|
+
this.stateManager = new StateManager(this);
|
|
51802
|
+
this.eventManager = new EventManager(this);
|
|
51686
51803
|
if (options.legends) {
|
|
51687
51804
|
internalProps.legends = createLegend(options.legends, this);
|
|
51688
51805
|
this.scenegraph.tableGroup.setAttributes({
|
|
@@ -51757,7 +51874,7 @@
|
|
|
51757
51874
|
if (this.tableNoFrameWidth - this.getColsWidth(0, frozenColCount - 1) <= 120) {
|
|
51758
51875
|
this.internalProps.frozenColCount = 0;
|
|
51759
51876
|
}
|
|
51760
|
-
this.
|
|
51877
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
51761
51878
|
}
|
|
51762
51879
|
setFrozenColCount(frozenColCount) {
|
|
51763
51880
|
if (frozenColCount >= this.colCount) {
|
|
@@ -51768,7 +51885,7 @@
|
|
|
51768
51885
|
if (this.tableNoFrameWidth - this.getColsWidth(0, frozenColCount - 1) <= 120) {
|
|
51769
51886
|
this.internalProps.frozenColCount = 0;
|
|
51770
51887
|
}
|
|
51771
|
-
this.
|
|
51888
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
51772
51889
|
}
|
|
51773
51890
|
_setFrozenColCount(frozenColCount) {
|
|
51774
51891
|
if (frozenColCount >= this.colCount) {
|
|
@@ -51983,9 +52100,6 @@
|
|
|
51983
52100
|
get rowHierarchyType() {
|
|
51984
52101
|
return 'grid';
|
|
51985
52102
|
}
|
|
51986
|
-
setColWidths(widths) {
|
|
51987
|
-
widths.forEach((value, index) => this.setColWidth(index, value));
|
|
51988
|
-
}
|
|
51989
52103
|
getColsWidth(startCol, endCol) {
|
|
51990
52104
|
endCol = Math.min(endCol, this.colCount - 1);
|
|
51991
52105
|
const cachedColWidth = this._colRangeWidthsMap.get(`$${startCol}$${endCol}`);
|
|
@@ -52033,7 +52147,7 @@
|
|
|
52033
52147
|
}
|
|
52034
52148
|
return this.internalProps.defaultRowHeight;
|
|
52035
52149
|
}
|
|
52036
|
-
|
|
52150
|
+
_setRowHeight(row, height, clearCache) {
|
|
52037
52151
|
this.rowHeightsMap.put(row, Math.round(height));
|
|
52038
52152
|
if (clearCache) {
|
|
52039
52153
|
this._clearRowRangeHeightsMap(row);
|
|
@@ -52126,13 +52240,13 @@
|
|
|
52126
52240
|
}
|
|
52127
52241
|
return this._adjustColWidth(col, this._colWidthDefineToPxWidth(width));
|
|
52128
52242
|
}
|
|
52129
|
-
|
|
52243
|
+
_setColWidth(col, width, clearCache, skipCheckFrozen) {
|
|
52130
52244
|
this.colWidthsMap.put(col, typeof width === 'number' ? Math.round(width) : width);
|
|
52131
52245
|
if (clearCache) {
|
|
52132
52246
|
this._clearColRangeWidthsMap(col);
|
|
52133
52247
|
}
|
|
52134
52248
|
if (!skipCheckFrozen) {
|
|
52135
|
-
this.
|
|
52249
|
+
this.stateManager.checkFrozen();
|
|
52136
52250
|
}
|
|
52137
52251
|
}
|
|
52138
52252
|
_clearColRangeWidthsMap(col) {
|
|
@@ -52540,16 +52654,16 @@
|
|
|
52540
52654
|
return count;
|
|
52541
52655
|
}
|
|
52542
52656
|
get scrollTop() {
|
|
52543
|
-
return this.
|
|
52657
|
+
return this.stateManager.scroll.verticalBarPos;
|
|
52544
52658
|
}
|
|
52545
52659
|
set scrollTop(scrollTop) {
|
|
52546
|
-
this.
|
|
52660
|
+
this.stateManager.setScrollTop(scrollTop);
|
|
52547
52661
|
}
|
|
52548
52662
|
get scrollLeft() {
|
|
52549
|
-
return this.
|
|
52663
|
+
return this.stateManager.scroll.horizontalBarPos;
|
|
52550
52664
|
}
|
|
52551
52665
|
set scrollLeft(scrollLeft) {
|
|
52552
|
-
this.
|
|
52666
|
+
this.stateManager.setScrollLeft(scrollLeft);
|
|
52553
52667
|
}
|
|
52554
52668
|
getScrollLeft() {
|
|
52555
52669
|
return this.scrollLeft;
|
|
@@ -52654,6 +52768,7 @@
|
|
|
52654
52768
|
this.colContentWidthsMap = new NumberMap();
|
|
52655
52769
|
this.colWidthsLimit = {};
|
|
52656
52770
|
internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
|
|
52771
|
+
this.scenegraph.updateStageBackground();
|
|
52657
52772
|
internalProps.autoWrapText = options.autoWrapText;
|
|
52658
52773
|
internalProps.allowFrozenColCount = options.allowFrozenColCount ?? internalProps.colCount;
|
|
52659
52774
|
internalProps.limitMaxAutoWidth = options.limitMaxAutoWidth ?? 450;
|
|
@@ -52670,7 +52785,7 @@
|
|
|
52670
52785
|
internalProps.title?.release();
|
|
52671
52786
|
internalProps.layoutMap.release();
|
|
52672
52787
|
this.scenegraph.clearCells();
|
|
52673
|
-
this.
|
|
52788
|
+
this.stateManager.initState();
|
|
52674
52789
|
this._updateSize();
|
|
52675
52790
|
if (options.legends) {
|
|
52676
52791
|
internalProps.legends = createLegend(options.legends, this);
|
|
@@ -52699,11 +52814,13 @@
|
|
|
52699
52814
|
this.clearRowHeightCache();
|
|
52700
52815
|
}
|
|
52701
52816
|
renderWithRecreateCells() {
|
|
52817
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
52702
52818
|
this.refreshHeader();
|
|
52703
52819
|
this.scenegraph.clearCells();
|
|
52704
52820
|
this.headerStyleCache = new Map();
|
|
52705
52821
|
this.bodyStyleCache = new Map();
|
|
52706
52822
|
this.scenegraph.createSceneGraph();
|
|
52823
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
52707
52824
|
this.render();
|
|
52708
52825
|
}
|
|
52709
52826
|
getFrozenRowsHeight() {
|
|
@@ -52901,20 +53018,25 @@
|
|
|
52901
53018
|
return Math.min(Math.ceil(absoluteX / this.internalProps.defaultColWidth), this.colCount - 1);
|
|
52902
53019
|
}
|
|
52903
53020
|
clearSelected() {
|
|
52904
|
-
this.
|
|
53021
|
+
this.stateManager.updateSelectPos(-1, -1);
|
|
52905
53022
|
}
|
|
52906
53023
|
selectCell(col, row) {
|
|
52907
|
-
this.
|
|
52908
|
-
this.
|
|
53024
|
+
this.stateManager.updateSelectPos(col, row);
|
|
53025
|
+
this.stateManager.endSelectCells();
|
|
52909
53026
|
}
|
|
52910
53027
|
selectCells(cellRanges) {
|
|
52911
53028
|
const { scrollLeft, scrollTop } = this;
|
|
52912
53029
|
cellRanges.forEach((cellRange, index) => {
|
|
52913
|
-
|
|
52914
|
-
|
|
52915
|
-
|
|
52916
|
-
|
|
52917
|
-
|
|
53030
|
+
if (cellRange.start.col === cellRange.end.col && cellRange.start.row === cellRange.end.row) {
|
|
53031
|
+
this.stateManager.updateSelectPos(cellRange.start.col, cellRange.start.row, false, index >= 1);
|
|
53032
|
+
}
|
|
53033
|
+
else {
|
|
53034
|
+
this.stateManager.updateSelectPos(cellRange.start.col, cellRange.start.row, false, index >= 1);
|
|
53035
|
+
this.stateManager.updateInteractionState(InteractionState.grabing);
|
|
53036
|
+
this.stateManager.updateSelectPos(cellRange.end.col, cellRange.end.row, false, index >= 1);
|
|
53037
|
+
}
|
|
53038
|
+
this.stateManager.endSelectCells(false);
|
|
53039
|
+
this.stateManager.updateInteractionState(InteractionState.default);
|
|
52918
53040
|
});
|
|
52919
53041
|
this.setScrollTop(scrollTop);
|
|
52920
53042
|
this.setScrollLeft(scrollLeft);
|
|
@@ -52968,12 +53090,15 @@
|
|
|
52968
53090
|
this.options.theme = theme;
|
|
52969
53091
|
}
|
|
52970
53092
|
updateTheme(theme) {
|
|
53093
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
52971
53094
|
this.internalProps.theme = themes.of(theme ?? themes.DEFAULT);
|
|
52972
53095
|
this.options.theme = theme;
|
|
53096
|
+
this.scenegraph.updateStageBackground();
|
|
52973
53097
|
this.scenegraph.clearCells();
|
|
52974
53098
|
this.headerStyleCache = new Map();
|
|
52975
53099
|
this.bodyStyleCache = new Map();
|
|
52976
53100
|
this.scenegraph.createSceneGraph();
|
|
53101
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
52977
53102
|
this.render();
|
|
52978
53103
|
}
|
|
52979
53104
|
getBodyField(col, row) {
|
|
@@ -53075,7 +53200,7 @@
|
|
|
53075
53200
|
col,
|
|
53076
53201
|
row,
|
|
53077
53202
|
table: this,
|
|
53078
|
-
value:
|
|
53203
|
+
value: customMerge.text,
|
|
53079
53204
|
dataValue: this.getCellOriginValue(col, row),
|
|
53080
53205
|
cellHeaderPaths: this.getCellHeaderPaths(col, row)
|
|
53081
53206
|
}, styleClass, this.options.autoWrapText);
|
|
@@ -53108,10 +53233,10 @@
|
|
|
53108
53233
|
return description;
|
|
53109
53234
|
}
|
|
53110
53235
|
setDropDownMenuHighlight(cells) {
|
|
53111
|
-
this.
|
|
53236
|
+
this.stateManager.setDropDownMenuHighlight(cells);
|
|
53112
53237
|
}
|
|
53113
53238
|
_dropDownMenuIsHighlight(colNow, rowNow, index) {
|
|
53114
|
-
return this.
|
|
53239
|
+
return this.stateManager.dropDownMenuIsHighlight(colNow, rowNow, index);
|
|
53115
53240
|
}
|
|
53116
53241
|
isHeader(col, row) {
|
|
53117
53242
|
return this.internalProps.layoutMap && this.internalProps.layoutMap.isHeader(col, row);
|
|
@@ -53292,8 +53417,8 @@
|
|
|
53292
53417
|
return limit.max !== limit.min;
|
|
53293
53418
|
}
|
|
53294
53419
|
_canDragHeaderPosition(col, row) {
|
|
53295
|
-
if (this.isHeader(col, row) && this.
|
|
53296
|
-
const selectRange = this.
|
|
53420
|
+
if (this.isHeader(col, row) && this.stateManager.isSelected(col, row)) {
|
|
53421
|
+
const selectRange = this.stateManager.select.ranges[0];
|
|
53297
53422
|
if (this.isColumnHeader(col, row)) {
|
|
53298
53423
|
if (selectRange.end.row !== this.rowCount - 1) {
|
|
53299
53424
|
return false;
|
|
@@ -53347,7 +53472,7 @@
|
|
|
53347
53472
|
menuType = Array.isArray(dropDownMenuOptions.content) ? 'dropdown-menu' : 'container';
|
|
53348
53473
|
}
|
|
53349
53474
|
if (this.internalProps.menu.renderMode === 'html') {
|
|
53350
|
-
this.
|
|
53475
|
+
this.stateManager.menu.isShow = true;
|
|
53351
53476
|
this.internalProps.menuHandler._bindToCell(col, row, menuType, dropDownMenuOptions);
|
|
53352
53477
|
}
|
|
53353
53478
|
}
|
|
@@ -53439,8 +53564,8 @@
|
|
|
53439
53564
|
this.render();
|
|
53440
53565
|
}
|
|
53441
53566
|
getCopyValue() {
|
|
53442
|
-
if (this.
|
|
53443
|
-
const ranges = this.
|
|
53567
|
+
if (this.stateManager.select?.ranges?.length > 0) {
|
|
53568
|
+
const ranges = this.stateManager.select.ranges;
|
|
53444
53569
|
let minCol = Math.min(ranges[0].start.col, ranges[0].end.col);
|
|
53445
53570
|
let maxCol = Math.max(ranges[0].start.col, ranges[0].end.col);
|
|
53446
53571
|
let minRow = Math.min(ranges[0].start.row, ranges[0].end.row);
|
|
@@ -53537,10 +53662,10 @@
|
|
|
53537
53662
|
return '';
|
|
53538
53663
|
}
|
|
53539
53664
|
getSelectedCellInfos() {
|
|
53540
|
-
if (!this.
|
|
53665
|
+
if (!this.stateManager.select?.ranges) {
|
|
53541
53666
|
return null;
|
|
53542
53667
|
}
|
|
53543
|
-
const ranges = this.
|
|
53668
|
+
const ranges = this.stateManager.select.ranges;
|
|
53544
53669
|
if (!ranges.length) {
|
|
53545
53670
|
return [];
|
|
53546
53671
|
}
|
|
@@ -53646,7 +53771,7 @@
|
|
|
53646
53771
|
});
|
|
53647
53772
|
}
|
|
53648
53773
|
_getActiveChartInstance() {
|
|
53649
|
-
const cellGroup = this.scenegraph.getCell(this.
|
|
53774
|
+
const cellGroup = this.scenegraph.getCell(this.stateManager.hover?.cellPos?.col, this.stateManager.hover?.cellPos?.row);
|
|
53650
53775
|
return cellGroup?.getChildren()?.[0]?.type === 'chart'
|
|
53651
53776
|
? cellGroup.getChildren()[0].activeChartInstance
|
|
53652
53777
|
: null;
|
|
@@ -53665,6 +53790,16 @@
|
|
|
53665
53790
|
}
|
|
53666
53791
|
return false;
|
|
53667
53792
|
}
|
|
53793
|
+
getCustomMergeValue(col, row) {
|
|
53794
|
+
if (this.internalProps.customMergeCell) {
|
|
53795
|
+
const customMerge = this.getCustomMerge(col, row);
|
|
53796
|
+
if (customMerge) {
|
|
53797
|
+
const { text } = customMerge;
|
|
53798
|
+
return text;
|
|
53799
|
+
}
|
|
53800
|
+
}
|
|
53801
|
+
return undefined;
|
|
53802
|
+
}
|
|
53668
53803
|
exportImg() {
|
|
53669
53804
|
const c = this.scenegraph.stage.toCanvas();
|
|
53670
53805
|
return c.toDataURL();
|
|
@@ -53945,7 +54080,6 @@
|
|
|
53945
54080
|
title: { visible: false },
|
|
53946
54081
|
domainLine: { visible: false },
|
|
53947
54082
|
seriesIndex: index,
|
|
53948
|
-
height: -1,
|
|
53949
54083
|
sync: { axisId: NO_AXISID_FRO_VTABLE }
|
|
53950
54084
|
}));
|
|
53951
54085
|
});
|
|
@@ -53968,8 +54102,7 @@
|
|
|
53968
54102
|
domainLine: { visible: false },
|
|
53969
54103
|
tick: { visible: false },
|
|
53970
54104
|
subTick: { visible: false },
|
|
53971
|
-
title: { visible: false }
|
|
53972
|
-
width: -1
|
|
54105
|
+
title: { visible: false }
|
|
53973
54106
|
}));
|
|
53974
54107
|
}
|
|
53975
54108
|
else {
|
|
@@ -54003,7 +54136,6 @@
|
|
|
54003
54136
|
title: { visible: false },
|
|
54004
54137
|
domainLine: { visible: false },
|
|
54005
54138
|
seriesIndex: index,
|
|
54006
|
-
width: -1,
|
|
54007
54139
|
sync: { axisId: NO_AXISID_FRO_VTABLE }
|
|
54008
54140
|
}));
|
|
54009
54141
|
});
|
|
@@ -54027,8 +54159,7 @@
|
|
|
54027
54159
|
domainLine: { visible: false },
|
|
54028
54160
|
tick: { visible: false },
|
|
54029
54161
|
subTick: { visible: false },
|
|
54030
|
-
title: { visible: false }
|
|
54031
|
-
height: -1
|
|
54162
|
+
title: { visible: false }
|
|
54032
54163
|
}));
|
|
54033
54164
|
}
|
|
54034
54165
|
return axes;
|
|
@@ -55087,7 +55218,9 @@
|
|
|
55087
55218
|
: [];
|
|
55088
55219
|
this.showHeader = options.showHeader ?? true;
|
|
55089
55220
|
this.transpose = options.transpose ?? false;
|
|
55090
|
-
|
|
55221
|
+
if (Env.mode !== 'node') {
|
|
55222
|
+
this.editorManager = new EditManeger(this);
|
|
55223
|
+
}
|
|
55091
55224
|
this.refreshHeader();
|
|
55092
55225
|
if (options.dataSource) {
|
|
55093
55226
|
_setDataSource(this, options.dataSource);
|
|
@@ -55119,6 +55252,7 @@
|
|
|
55119
55252
|
return this.internalProps.sortState;
|
|
55120
55253
|
}
|
|
55121
55254
|
updateColumns(columns) {
|
|
55255
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
55122
55256
|
this.internalProps.columns = cloneDeep$1(columns);
|
|
55123
55257
|
this.options.columns = columns;
|
|
55124
55258
|
this.refreshHeader();
|
|
@@ -55126,6 +55260,7 @@
|
|
|
55126
55260
|
this.headerStyleCache = new Map();
|
|
55127
55261
|
this.bodyStyleCache = new Map();
|
|
55128
55262
|
this.scenegraph.createSceneGraph();
|
|
55263
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
55129
55264
|
this.renderAsync();
|
|
55130
55265
|
}
|
|
55131
55266
|
get header() {
|
|
@@ -55157,6 +55292,10 @@
|
|
|
55157
55292
|
if (col === -1 || row === -1) {
|
|
55158
55293
|
return null;
|
|
55159
55294
|
}
|
|
55295
|
+
const customMergeText = this.getCustomMergeValue(col, row);
|
|
55296
|
+
if (customMergeText) {
|
|
55297
|
+
return customMergeText;
|
|
55298
|
+
}
|
|
55160
55299
|
const table = this;
|
|
55161
55300
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
55162
55301
|
const { title } = table.internalProps.layoutMap.getHeader(col, row);
|
|
@@ -55301,7 +55440,7 @@
|
|
|
55301
55440
|
for (let col = 0; col < layoutMap.columnWidths.length; col++) {
|
|
55302
55441
|
const { width, minWidth, maxWidth } = layoutMap.columnWidths?.[col] ?? {};
|
|
55303
55442
|
if (width && ((typeof width === 'string' && width !== 'auto') || (typeof width === 'number' && width > 0))) {
|
|
55304
|
-
table.
|
|
55443
|
+
table._setColWidth(col, width);
|
|
55305
55444
|
}
|
|
55306
55445
|
if (minWidth && ((typeof minWidth === 'number' && minWidth > 0) || typeof minWidth === 'string')) {
|
|
55307
55446
|
table.setMinColWidth(col, minWidth);
|
|
@@ -55337,7 +55476,7 @@
|
|
|
55337
55476
|
table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
|
|
55338
55477
|
table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
|
|
55339
55478
|
}
|
|
55340
|
-
this.
|
|
55479
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
55341
55480
|
}
|
|
55342
55481
|
getFieldData(field, col, row) {
|
|
55343
55482
|
if (field === null) {
|
|
@@ -55567,25 +55706,36 @@
|
|
|
55567
55706
|
this.scenegraph.sortCell();
|
|
55568
55707
|
}
|
|
55569
55708
|
}
|
|
55570
|
-
this.
|
|
55709
|
+
this.stateManager.updateSortState(sortState);
|
|
55571
55710
|
}
|
|
55572
55711
|
getCheckboxState(field) {
|
|
55573
|
-
if (this.
|
|
55574
|
-
this.
|
|
55712
|
+
if (this.stateManager.checkedState.length < this.rowCount - this.columnHeaderLevelCount) {
|
|
55713
|
+
this.stateManager.initLeftRecordsCheckState(this.records);
|
|
55575
55714
|
}
|
|
55576
55715
|
if (isValid$6(field)) {
|
|
55577
|
-
return this.
|
|
55716
|
+
return this.stateManager.checkedState.map(state => {
|
|
55578
55717
|
return state[field];
|
|
55579
55718
|
});
|
|
55580
55719
|
}
|
|
55581
|
-
return this.
|
|
55720
|
+
return this.stateManager.checkedState;
|
|
55721
|
+
}
|
|
55722
|
+
getCellCheckboxState(col, row) {
|
|
55723
|
+
const define = this.getBodyColumnDefine(col, row);
|
|
55724
|
+
const field = define?.field;
|
|
55725
|
+
const cellType = define?.cellType;
|
|
55726
|
+
if (isValid$6(field) && cellType === 'checkbox') {
|
|
55727
|
+
const dataIndex = this.dataSource.getIndexKey(this.getRecordIndexByCell(col, row));
|
|
55728
|
+
return this.stateManager.checkedState[dataIndex][field];
|
|
55729
|
+
}
|
|
55730
|
+
return undefined;
|
|
55582
55731
|
}
|
|
55583
55732
|
setRecords(records, sort) {
|
|
55584
55733
|
typeof window !== 'undefined' ? window.performance.now() : 0;
|
|
55734
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
55585
55735
|
this.scenegraph.clearCells();
|
|
55586
55736
|
if (sort !== undefined) {
|
|
55587
55737
|
this.internalProps.sortState = sort;
|
|
55588
|
-
this.
|
|
55738
|
+
this.stateManager.setSortState(this.sortState);
|
|
55589
55739
|
}
|
|
55590
55740
|
if (records) {
|
|
55591
55741
|
_setRecords(this, records);
|
|
@@ -55610,7 +55760,7 @@
|
|
|
55610
55760
|
else {
|
|
55611
55761
|
hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
55612
55762
|
}
|
|
55613
|
-
|
|
55763
|
+
this.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
55614
55764
|
}
|
|
55615
55765
|
}
|
|
55616
55766
|
this.refreshRowColCount();
|
|
@@ -55618,8 +55768,9 @@
|
|
|
55618
55768
|
else {
|
|
55619
55769
|
_setRecords(this, records);
|
|
55620
55770
|
}
|
|
55621
|
-
this.
|
|
55771
|
+
this.stateManager.initCheckedState(records);
|
|
55622
55772
|
this.scenegraph.createSceneGraph();
|
|
55773
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
55623
55774
|
if (this.internalProps.title && !this.internalProps.title.isReleased) {
|
|
55624
55775
|
this._updateSize();
|
|
55625
55776
|
this.internalProps.title.resize();
|
|
@@ -55635,8 +55786,8 @@
|
|
|
55635
55786
|
if (isValid$6(col) && isValid$6(row)) {
|
|
55636
55787
|
this.editorManager.startEditCell(col, row);
|
|
55637
55788
|
}
|
|
55638
|
-
else if (this.
|
|
55639
|
-
const { col, row } = this.
|
|
55789
|
+
else if (this.stateManager.select?.cellPos) {
|
|
55790
|
+
const { col, row } = this.stateManager.select.cellPos;
|
|
55640
55791
|
if (isValid$6(col) && isValid$6(row)) {
|
|
55641
55792
|
this.editorManager.startEditCell(col, row);
|
|
55642
55793
|
}
|
|
@@ -56829,16 +56980,19 @@
|
|
|
56829
56980
|
}
|
|
56830
56981
|
return 0;
|
|
56831
56982
|
}
|
|
56832
|
-
|
|
56833
|
-
|
|
56834
|
-
|
|
56835
|
-
|
|
56836
|
-
|
|
56837
|
-
|
|
56838
|
-
|
|
56983
|
+
if (this.indicatorKeys.length >= 1) {
|
|
56984
|
+
const axisOption = this._table.pivotChartAxes.find(axisOption => {
|
|
56985
|
+
return axisOption.orient === 'bottom';
|
|
56986
|
+
});
|
|
56987
|
+
if (axisOption?.visible === false) {
|
|
56988
|
+
return 0;
|
|
56989
|
+
}
|
|
56990
|
+
if (this.indicatorsAsCol) {
|
|
56991
|
+
return 1;
|
|
56992
|
+
}
|
|
56839
56993
|
return 1;
|
|
56840
56994
|
}
|
|
56841
|
-
return
|
|
56995
|
+
return 0;
|
|
56842
56996
|
}
|
|
56843
56997
|
get rightFrozenColCount() {
|
|
56844
56998
|
if (!this._table.isPivotChart()) {
|
|
@@ -56944,7 +57098,7 @@
|
|
|
56944
57098
|
id: '',
|
|
56945
57099
|
field: undefined,
|
|
56946
57100
|
indicatorKey: undefined,
|
|
56947
|
-
cellType:
|
|
57101
|
+
cellType: 'text',
|
|
56948
57102
|
define: undefined
|
|
56949
57103
|
});
|
|
56950
57104
|
}
|
|
@@ -56954,7 +57108,7 @@
|
|
|
56954
57108
|
id: '',
|
|
56955
57109
|
field: undefined,
|
|
56956
57110
|
indicatorKey: undefined,
|
|
56957
|
-
cellType:
|
|
57111
|
+
cellType: 'text',
|
|
56958
57112
|
define: undefined
|
|
56959
57113
|
});
|
|
56960
57114
|
}
|
|
@@ -57678,14 +57832,16 @@
|
|
|
57678
57832
|
if (!this._table.isPivotChart()) {
|
|
57679
57833
|
return false;
|
|
57680
57834
|
}
|
|
57681
|
-
if (this.
|
|
57682
|
-
|
|
57683
|
-
|
|
57684
|
-
|
|
57685
|
-
|
|
57686
|
-
|
|
57687
|
-
|
|
57688
|
-
|
|
57835
|
+
if (this.indicatorKeys.length >= 1) {
|
|
57836
|
+
if (this.isBottomFrozenRow(col, row) || this.isRightFrozenColumn(col, row)) {
|
|
57837
|
+
return true;
|
|
57838
|
+
}
|
|
57839
|
+
if (this.isRowHeader(col, row) && col === this.rowHeaderLevelCount - 1) {
|
|
57840
|
+
return true;
|
|
57841
|
+
}
|
|
57842
|
+
if (this.hasTwoIndicatorAxes && this.indicatorsAsCol && row === this.columnHeaderLevelCount - 1) {
|
|
57843
|
+
return true;
|
|
57844
|
+
}
|
|
57689
57845
|
}
|
|
57690
57846
|
return false;
|
|
57691
57847
|
}
|
|
@@ -58049,7 +58205,7 @@
|
|
|
58049
58205
|
}
|
|
58050
58206
|
const space = bandSpace(count, paddingInner, paddingOuter);
|
|
58051
58207
|
const step = bandwidth / (1 - paddingInner);
|
|
58052
|
-
const wholeSize = space * step;
|
|
58208
|
+
const wholeSize = Math.ceil(space * step);
|
|
58053
58209
|
return wholeSize;
|
|
58054
58210
|
}
|
|
58055
58211
|
function bandSpace(count, paddingInner, paddingOuter) {
|
|
@@ -59588,12 +59744,15 @@
|
|
|
59588
59744
|
this.updatePivotSortState(options.pivotSortState);
|
|
59589
59745
|
}
|
|
59590
59746
|
this.refreshHeader();
|
|
59591
|
-
this.
|
|
59747
|
+
this.stateManager.initCheckedState(records);
|
|
59592
59748
|
this.scenegraph.createSceneGraph();
|
|
59593
59749
|
if (options.title) {
|
|
59594
59750
|
this.internalProps.title = new Title(options.title, this);
|
|
59595
59751
|
this.scenegraph.resize();
|
|
59596
59752
|
}
|
|
59753
|
+
setTimeout(() => {
|
|
59754
|
+
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
59755
|
+
}, 0);
|
|
59597
59756
|
}
|
|
59598
59757
|
static get EVENT_TYPE() {
|
|
59599
59758
|
return PIVOT_TABLE_EVENT_TYPE;
|
|
@@ -59630,7 +59789,7 @@
|
|
|
59630
59789
|
this.internalProps.rowTree =
|
|
59631
59790
|
!options.indicatorsAsCol && !options.rows?.length && !options.rowTree ? [] : cloneDeep$1(options.rowTree);
|
|
59632
59791
|
options.records && (this.internalProps.records = options.records);
|
|
59633
|
-
this.
|
|
59792
|
+
this.stateManager.initCheckedState(this.internalProps.records);
|
|
59634
59793
|
this.pagination = options.pagination;
|
|
59635
59794
|
internalProps.columnResizeType = options.columnResizeType ?? 'column';
|
|
59636
59795
|
internalProps.dataConfig = cloneDeep$1(options.dataConfig);
|
|
@@ -59742,7 +59901,7 @@
|
|
|
59742
59901
|
for (let col = 0; col < internalProps.layoutMap.columnWidths.length; col++) {
|
|
59743
59902
|
const { width, minWidth, maxWidth } = internalProps.layoutMap.columnWidths?.[col] ?? {};
|
|
59744
59903
|
if (width && ((typeof width === 'string' && width !== 'auto') || (typeof width === 'number' && width > 0))) {
|
|
59745
|
-
this.
|
|
59904
|
+
this._setColWidth(col, width);
|
|
59746
59905
|
}
|
|
59747
59906
|
if (minWidth && ((typeof minWidth === 'number' && minWidth > 0) || typeof minWidth === 'string')) {
|
|
59748
59907
|
this.setMinColWidth(col, minWidth);
|
|
@@ -59765,7 +59924,7 @@
|
|
|
59765
59924
|
table.frozenRowCount = layoutMap.headerLevelCount;
|
|
59766
59925
|
table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
|
|
59767
59926
|
table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
|
|
59768
|
-
this.
|
|
59927
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
59769
59928
|
}
|
|
59770
59929
|
_getSortFuncFromHeaderOption(columns, field, fieldKey) {
|
|
59771
59930
|
return undefined;
|
|
@@ -59825,6 +59984,10 @@
|
|
|
59825
59984
|
return dataValue;
|
|
59826
59985
|
}
|
|
59827
59986
|
getCellValue(col, row) {
|
|
59987
|
+
const customMergeText = this.getCustomMergeValue(col, row);
|
|
59988
|
+
if (customMergeText) {
|
|
59989
|
+
return customMergeText;
|
|
59990
|
+
}
|
|
59828
59991
|
if (this.internalProps.layoutMap.isHeader(col, row)) {
|
|
59829
59992
|
const { title, fieldFormat } = this.internalProps.layoutMap.getHeader(col, row);
|
|
59830
59993
|
return typeof fieldFormat === 'function' ? fieldFormat(title) : title;
|
|
@@ -60064,6 +60227,7 @@
|
|
|
60064
60227
|
return result;
|
|
60065
60228
|
}
|
|
60066
60229
|
setRecords(records) {
|
|
60230
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
60067
60231
|
this.options.records = this.internalProps.records = records;
|
|
60068
60232
|
const options = this.options;
|
|
60069
60233
|
const internalProps = this.internalProps;
|
|
@@ -60089,6 +60253,7 @@
|
|
|
60089
60253
|
this.refreshHeader();
|
|
60090
60254
|
this.scenegraph.clearCells();
|
|
60091
60255
|
this.scenegraph.createSceneGraph();
|
|
60256
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
60092
60257
|
if (this.internalProps.title && !this.internalProps.title.isReleased) {
|
|
60093
60258
|
this._updateSize();
|
|
60094
60259
|
this.internalProps.title.resize();
|
|
@@ -60172,6 +60337,9 @@
|
|
|
60172
60337
|
this.internalProps.title = new Title(options.title, this);
|
|
60173
60338
|
this.scenegraph.resize();
|
|
60174
60339
|
}
|
|
60340
|
+
setTimeout(() => {
|
|
60341
|
+
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
60342
|
+
}, 0);
|
|
60175
60343
|
}
|
|
60176
60344
|
static get EVENT_TYPE() {
|
|
60177
60345
|
return PIVOT_CHART_EVENT_TYPE;
|
|
@@ -60270,7 +60438,7 @@
|
|
|
60270
60438
|
for (let col = 0; col < internalProps.layoutMap.columnWidths.length; col++) {
|
|
60271
60439
|
const { width, minWidth, maxWidth } = internalProps.layoutMap.columnWidths?.[col] ?? {};
|
|
60272
60440
|
if (width && ((typeof width === 'string' && width !== 'auto') || (typeof width === 'number' && width > 0))) {
|
|
60273
|
-
this.
|
|
60441
|
+
this._setColWidth(col, width);
|
|
60274
60442
|
}
|
|
60275
60443
|
if (minWidth && ((typeof minWidth === 'number' && minWidth > 0) || typeof minWidth === 'string')) {
|
|
60276
60444
|
this.setMinColWidth(col, minWidth);
|
|
@@ -60293,7 +60461,7 @@
|
|
|
60293
60461
|
table.frozenRowCount = layoutMap.headerLevelCount;
|
|
60294
60462
|
table.bottomFrozenRowCount = layoutMap?.bottomFrozenRowCount ?? 0;
|
|
60295
60463
|
table.rightFrozenColCount = layoutMap?.rightFrozenColCount ?? 0;
|
|
60296
|
-
this.
|
|
60464
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
60297
60465
|
}
|
|
60298
60466
|
_getSortFuncFromHeaderOption(columns, field, fieldKey) {
|
|
60299
60467
|
return undefined;
|
|
@@ -60347,6 +60515,10 @@
|
|
|
60347
60515
|
return dataValue;
|
|
60348
60516
|
}
|
|
60349
60517
|
getCellValue(col, row) {
|
|
60518
|
+
const customMergeText = this.getCustomMergeValue(col, row);
|
|
60519
|
+
if (customMergeText) {
|
|
60520
|
+
return customMergeText;
|
|
60521
|
+
}
|
|
60350
60522
|
if (this.internalProps.layoutMap.isHeader(col, row)) {
|
|
60351
60523
|
const { title, fieldFormat } = this.internalProps.layoutMap.getHeader(col, row);
|
|
60352
60524
|
return typeof fieldFormat === 'function' ? fieldFormat(title) : title;
|
|
@@ -60819,16 +60991,10 @@
|
|
|
60819
60991
|
const viewBox = chartNode.getViewBox();
|
|
60820
60992
|
axes.forEach((axis, index) => {
|
|
60821
60993
|
if (axis.type === 'linear') {
|
|
60822
|
-
|
|
60823
|
-
chartAxis._domain = {
|
|
60824
|
-
min: axis.range?.min ?? 0,
|
|
60825
|
-
max: axis.range?.max ?? 0
|
|
60826
|
-
};
|
|
60994
|
+
chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
|
|
60827
60995
|
}
|
|
60828
60996
|
else if (axis.type === 'band') {
|
|
60829
|
-
|
|
60830
|
-
chartAxis._spec.domain = axis.domain.slice(0);
|
|
60831
|
-
chartAxis.updateScaleDomain();
|
|
60997
|
+
chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
|
|
60832
60998
|
}
|
|
60833
60999
|
});
|
|
60834
61000
|
chartInstance.updateViewBox({
|
|
@@ -60889,6 +61055,7 @@
|
|
|
60889
61055
|
return undefined;
|
|
60890
61056
|
}
|
|
60891
61057
|
setRecords(records) {
|
|
61058
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
60892
61059
|
this.options.records = this.internalProps.records = records;
|
|
60893
61060
|
this.options;
|
|
60894
61061
|
const internalProps = this.internalProps;
|
|
@@ -60897,6 +61064,7 @@
|
|
|
60897
61064
|
this.refreshHeader();
|
|
60898
61065
|
this.scenegraph.clearCells();
|
|
60899
61066
|
this.scenegraph.createSceneGraph();
|
|
61067
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
60900
61068
|
if (this.internalProps.title && !this.internalProps.title.isReleased) {
|
|
60901
61069
|
this._updateSize();
|
|
60902
61070
|
this.internalProps.title.resize();
|
|
@@ -61411,7 +61579,7 @@
|
|
|
61411
61579
|
return new Tag$1(params ? params.attribute : {});
|
|
61412
61580
|
}
|
|
61413
61581
|
|
|
61414
|
-
const version = "0.15.
|
|
61582
|
+
const version = "0.15.2";
|
|
61415
61583
|
function getIcons() {
|
|
61416
61584
|
return get$2();
|
|
61417
61585
|
}
|