@visactor/vtable 0.15.0 → 0.15.1
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 +51 -34
- 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 +65 -65
- 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 +7 -6
- 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 +2 -2
- 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/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/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 +549 -410
- 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 +54 -37
- 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 +65 -65
- 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 +6 -6
- 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 +2 -2
- 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/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/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) => {
|
|
@@ -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;
|
|
@@ -37770,6 +37778,9 @@
|
|
|
37770
37778
|
if (columnGroup.lastChild) {
|
|
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,7 +37834,7 @@
|
|
|
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
37839
|
const height = isMerge
|
|
37829
37840
|
? table.getRowHeight(row) / (range.end.row - range.start.row + 1)
|
|
@@ -38827,7 +38838,7 @@
|
|
|
38827
38838
|
newHeights[row] = height;
|
|
38828
38839
|
}
|
|
38829
38840
|
else {
|
|
38830
|
-
table.
|
|
38841
|
+
table._setRowHeight(row, height);
|
|
38831
38842
|
}
|
|
38832
38843
|
}
|
|
38833
38844
|
}
|
|
@@ -38838,7 +38849,7 @@
|
|
|
38838
38849
|
newHeights[row] = height;
|
|
38839
38850
|
}
|
|
38840
38851
|
else {
|
|
38841
|
-
table.
|
|
38852
|
+
table._setRowHeight(row, height);
|
|
38842
38853
|
}
|
|
38843
38854
|
}
|
|
38844
38855
|
}
|
|
@@ -38855,7 +38866,7 @@
|
|
|
38855
38866
|
newHeights[row] = height;
|
|
38856
38867
|
}
|
|
38857
38868
|
else {
|
|
38858
|
-
table.
|
|
38869
|
+
table._setRowHeight(row, height);
|
|
38859
38870
|
}
|
|
38860
38871
|
}
|
|
38861
38872
|
}
|
|
@@ -38873,7 +38884,7 @@
|
|
|
38873
38884
|
newHeights[row] = height;
|
|
38874
38885
|
}
|
|
38875
38886
|
else {
|
|
38876
|
-
table.
|
|
38887
|
+
table._setRowHeight(row, height);
|
|
38877
38888
|
}
|
|
38878
38889
|
}
|
|
38879
38890
|
}
|
|
@@ -38884,7 +38895,7 @@
|
|
|
38884
38895
|
newHeights[row] = height;
|
|
38885
38896
|
}
|
|
38886
38897
|
else {
|
|
38887
|
-
table.
|
|
38898
|
+
table._setRowHeight(row, height);
|
|
38888
38899
|
}
|
|
38889
38900
|
}
|
|
38890
38901
|
}
|
|
@@ -38926,7 +38937,7 @@
|
|
|
38926
38937
|
newHeights[row] = rowHeight;
|
|
38927
38938
|
}
|
|
38928
38939
|
else {
|
|
38929
|
-
table.
|
|
38940
|
+
table._setRowHeight(row, rowHeight, false);
|
|
38930
38941
|
}
|
|
38931
38942
|
}
|
|
38932
38943
|
}
|
|
@@ -38945,11 +38956,28 @@
|
|
|
38945
38956
|
if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {
|
|
38946
38957
|
const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);
|
|
38947
38958
|
for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {
|
|
38959
|
+
let rowHeight;
|
|
38960
|
+
if (row === table.rowCount - table.bottomFrozenRowCount - 1) {
|
|
38961
|
+
rowHeight =
|
|
38962
|
+
canvasHeight -
|
|
38963
|
+
actualHeaderHeight -
|
|
38964
|
+
(update
|
|
38965
|
+
? newHeights.reduce((acr, cur, index) => {
|
|
38966
|
+
if (index >= table.frozenRowCount && index <= table.rowCount - table.bottomFrozenRowCount - 2) {
|
|
38967
|
+
return acr + cur;
|
|
38968
|
+
}
|
|
38969
|
+
return acr;
|
|
38970
|
+
}, 0)
|
|
38971
|
+
: table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2));
|
|
38972
|
+
}
|
|
38973
|
+
else {
|
|
38974
|
+
rowHeight = Math.round((update ? newHeights[row] : table.getRowHeight(row)) * factor);
|
|
38975
|
+
}
|
|
38948
38976
|
if (update) {
|
|
38949
|
-
newHeights[row] =
|
|
38977
|
+
newHeights[row] = rowHeight;
|
|
38950
38978
|
}
|
|
38951
38979
|
else {
|
|
38952
|
-
table.
|
|
38980
|
+
table._setRowHeight(row, rowHeight, false);
|
|
38953
38981
|
}
|
|
38954
38982
|
}
|
|
38955
38983
|
}
|
|
@@ -39064,7 +39092,7 @@
|
|
|
39064
39092
|
newHeights[row] = height;
|
|
39065
39093
|
}
|
|
39066
39094
|
else {
|
|
39067
|
-
table.
|
|
39095
|
+
table._setRowHeight(row, height);
|
|
39068
39096
|
}
|
|
39069
39097
|
}
|
|
39070
39098
|
}
|
|
@@ -39250,7 +39278,7 @@
|
|
|
39250
39278
|
}
|
|
39251
39279
|
|
|
39252
39280
|
function updateRowHeight(scene, row, detaY) {
|
|
39253
|
-
scene.table.
|
|
39281
|
+
scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);
|
|
39254
39282
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
39255
39283
|
const cell = scene.getCell(col, row);
|
|
39256
39284
|
const mergeInfo = getCellMergeInfo(scene.table, col, row);
|
|
@@ -39394,7 +39422,7 @@
|
|
|
39394
39422
|
}
|
|
39395
39423
|
|
|
39396
39424
|
function updateColWidth(scene, col, detaX) {
|
|
39397
|
-
scene.table.
|
|
39425
|
+
scene.table._setColWidth(col, scene.table.getColWidth(col) + detaX, true);
|
|
39398
39426
|
const autoRowHeight = scene.table.heightMode === 'autoHeight';
|
|
39399
39427
|
const colOrCornerHeaderColumn = scene.getColGroup(col, true);
|
|
39400
39428
|
if (colOrCornerHeaderColumn) {
|
|
@@ -39412,9 +39440,13 @@
|
|
|
39412
39440
|
if (bottomColumn) {
|
|
39413
39441
|
updateColunmWidth(bottomColumn, detaX, autoRowHeight, 'bottom', scene);
|
|
39414
39442
|
}
|
|
39443
|
+
const rightTopColumn = scene.getColGroupInRightTopCorner(col);
|
|
39444
|
+
if (rightTopColumn) {
|
|
39445
|
+
updateColunmWidth(rightTopColumn, detaX, autoRowHeight, 'right-top', scene);
|
|
39446
|
+
}
|
|
39415
39447
|
const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);
|
|
39416
39448
|
if (rightBottomColumn) {
|
|
39417
|
-
updateColunmWidth(
|
|
39449
|
+
updateColunmWidth(rightBottomColumn, detaX, autoRowHeight, 'right-bottom', scene);
|
|
39418
39450
|
}
|
|
39419
39451
|
if (col < scene.frozenColCount) {
|
|
39420
39452
|
scene.cornerHeaderGroup.forEachChildrenSkipChild((column, index) => {
|
|
@@ -39507,11 +39539,19 @@
|
|
|
39507
39539
|
colGroup = scene.getColGroupInLeftBottomCorner(col);
|
|
39508
39540
|
oldContainerHeight = scene.leftBottomCornerGroup.attribute.height ?? 0;
|
|
39509
39541
|
}
|
|
39542
|
+
else if (mode === 'right-top') {
|
|
39543
|
+
row = 0;
|
|
39544
|
+
colGroup = scene.getColGroupInRightTopCorner(col);
|
|
39545
|
+
oldContainerHeight = scene.rightTopCornerGroup.attribute.height ?? 0;
|
|
39546
|
+
}
|
|
39510
39547
|
else if (mode === 'right-bottom') {
|
|
39511
39548
|
row = scene.table.rowCount - scene.table.bottomFrozenRowCount;
|
|
39512
39549
|
colGroup = scene.getColGroupInRightBottomCorner(col);
|
|
39513
39550
|
oldContainerHeight = scene.rightBottomCornerGroup.attribute.height ?? 0;
|
|
39514
39551
|
}
|
|
39552
|
+
if (!colGroup) {
|
|
39553
|
+
continue;
|
|
39554
|
+
}
|
|
39515
39555
|
let y = 0;
|
|
39516
39556
|
colGroup.forEachChildren((cellGroup) => {
|
|
39517
39557
|
cellGroup.setAttribute('y', y);
|
|
@@ -39660,7 +39700,7 @@
|
|
|
39660
39700
|
}
|
|
39661
39701
|
function resetRowHeight(scene, row) {
|
|
39662
39702
|
const maxHeight = computeRowHeight(row, 0, scene.table.colCount - 1, scene.table);
|
|
39663
|
-
scene.table.
|
|
39703
|
+
scene.table._setRowHeight(row, maxHeight, true);
|
|
39664
39704
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
39665
39705
|
const distHeight = maxHeight;
|
|
39666
39706
|
const cell = scene.highPerformanceGetCell(col, row);
|
|
@@ -40058,7 +40098,7 @@
|
|
|
40058
40098
|
let symbolRotate = Math.PI;
|
|
40059
40099
|
const linePoints = [];
|
|
40060
40100
|
if (cellLocation === 'columnHeader') {
|
|
40061
|
-
rectX = this.table.getColsWidth(0, col - 1) - this.table.
|
|
40101
|
+
rectX = this.table.getColsWidth(0, col - 1) - this.table.stateManager.scroll.horizontalBarPos;
|
|
40062
40102
|
rectY = this.table.getRowsHeight(0, this.table.frozenRowCount - 1);
|
|
40063
40103
|
rectHeight = this.table.tableNoFrameHeight;
|
|
40064
40104
|
if (mergeInfo) {
|
|
@@ -40074,7 +40114,7 @@
|
|
|
40074
40114
|
linePoints.push({ x: 0, y: this.table.tableNoFrameHeight });
|
|
40075
40115
|
}
|
|
40076
40116
|
else if (cellLocation === 'rowHeader') {
|
|
40077
|
-
rectY = this.table.getRowsHeight(0, row - 1) - this.table.
|
|
40117
|
+
rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos;
|
|
40078
40118
|
rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1);
|
|
40079
40119
|
rectWidth = this.table.tableNoFrameWidth;
|
|
40080
40120
|
if (mergeInfo) {
|
|
@@ -40119,13 +40159,13 @@
|
|
|
40119
40159
|
}
|
|
40120
40160
|
update(backX, lineX, backY, lineY) {
|
|
40121
40161
|
if (typeof backX === 'number' && typeof lineX === 'number') {
|
|
40122
|
-
this.columnMoverLabel.setAttribute('x', lineX - this.table.
|
|
40123
|
-
this.columnMoverLine.setAttribute('x', lineX - this.table.
|
|
40162
|
+
this.columnMoverLabel.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);
|
|
40163
|
+
this.columnMoverLine.setAttribute('x', lineX - this.table.stateManager.scroll.horizontalBarPos);
|
|
40124
40164
|
this.columnMoverBack.setAttribute('x', backX);
|
|
40125
40165
|
}
|
|
40126
40166
|
else if (typeof backY === 'number' && typeof lineY === 'number') {
|
|
40127
|
-
this.columnMoverLabel.setAttribute('y', lineY - this.table.
|
|
40128
|
-
this.columnMoverLine.setAttribute('y', lineY - this.table.
|
|
40167
|
+
this.columnMoverLabel.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);
|
|
40168
|
+
this.columnMoverLine.setAttribute('y', lineY - this.table.stateManager.scroll.verticalBarPos);
|
|
40129
40169
|
this.columnMoverBack.setAttribute('y', backY);
|
|
40130
40170
|
}
|
|
40131
40171
|
}
|
|
@@ -40304,8 +40344,8 @@
|
|
|
40304
40344
|
this.vScrollBar.hideAll();
|
|
40305
40345
|
}
|
|
40306
40346
|
updateScrollBar() {
|
|
40307
|
-
const oldHorizontalBarPos = this.table.
|
|
40308
|
-
const oldVerticalBarPos = this.table.
|
|
40347
|
+
const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos;
|
|
40348
|
+
const oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos;
|
|
40309
40349
|
const theme = this.table.theme;
|
|
40310
40350
|
const width = theme.scrollStyle?.width;
|
|
40311
40351
|
const visible = theme.scrollStyle?.visible;
|
|
@@ -40371,8 +40411,8 @@
|
|
|
40371
40411
|
visible: false
|
|
40372
40412
|
});
|
|
40373
40413
|
}
|
|
40374
|
-
this.table.
|
|
40375
|
-
this.table.
|
|
40414
|
+
this.table.stateManager.setScrollLeft(oldHorizontalBarPos);
|
|
40415
|
+
this.table.stateManager.setScrollTop(oldVerticalBarPos);
|
|
40376
40416
|
}
|
|
40377
40417
|
hideResizeCol() {
|
|
40378
40418
|
this.columnResizeLine.setAttribute('visible', false);
|
|
@@ -40685,16 +40725,10 @@
|
|
|
40685
40725
|
}
|
|
40686
40726
|
axes.forEach((axis, index) => {
|
|
40687
40727
|
if (axis.type === 'linear') {
|
|
40688
|
-
|
|
40689
|
-
chartAxis._domain = {
|
|
40690
|
-
min: axis.range?.min ?? 0,
|
|
40691
|
-
max: axis.range?.max ?? 0
|
|
40692
|
-
};
|
|
40728
|
+
chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
|
|
40693
40729
|
}
|
|
40694
40730
|
else if (axis.type === 'band') {
|
|
40695
|
-
|
|
40696
|
-
chartAxis._spec.domain = axis.domain.slice(0);
|
|
40697
|
-
chartAxis.updateScaleDomain();
|
|
40731
|
+
chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
|
|
40698
40732
|
}
|
|
40699
40733
|
});
|
|
40700
40734
|
chartInstance.updateViewBox({
|
|
@@ -40924,7 +40958,7 @@
|
|
|
40924
40958
|
isValid$6(cellGroup.mergeEndRow)) {
|
|
40925
40959
|
for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
|
|
40926
40960
|
for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
|
|
40927
|
-
const key = isCellHover(table.
|
|
40961
|
+
const key = isCellHover(table.stateManager, col, row);
|
|
40928
40962
|
if (key && (!colorKey || key === 'cellBgColor')) {
|
|
40929
40963
|
colorKey = key;
|
|
40930
40964
|
}
|
|
@@ -40932,7 +40966,7 @@
|
|
|
40932
40966
|
}
|
|
40933
40967
|
}
|
|
40934
40968
|
else if (cellGroup.role === 'cell') {
|
|
40935
|
-
colorKey = isCellHover(table.
|
|
40969
|
+
colorKey = isCellHover(table.stateManager, cellGroup.col, cellGroup.row);
|
|
40936
40970
|
}
|
|
40937
40971
|
if (!colorKey) {
|
|
40938
40972
|
return undefined;
|
|
@@ -41310,7 +41344,7 @@
|
|
|
41310
41344
|
drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
|
|
41311
41345
|
if (group.role === 'cell') {
|
|
41312
41346
|
const table = group.stage.table;
|
|
41313
|
-
if (table.
|
|
41347
|
+
if (table.stateManager.interactionState !== InteractionState.scrolling) {
|
|
41314
41348
|
const hoverColor = getCellHoverColor(group, table);
|
|
41315
41349
|
if (hoverColor) {
|
|
41316
41350
|
group.oldColor = group.attribute.fill;
|
|
@@ -41488,7 +41522,7 @@
|
|
|
41488
41522
|
newWidths[col] = maxWidth;
|
|
41489
41523
|
}
|
|
41490
41524
|
else {
|
|
41491
|
-
table.
|
|
41525
|
+
table._setColWidth(col, maxWidth, false, true);
|
|
41492
41526
|
}
|
|
41493
41527
|
}
|
|
41494
41528
|
if (table.widthMode === 'adaptive') {
|
|
@@ -41524,7 +41558,7 @@
|
|
|
41524
41558
|
newWidths[col] = colWidth;
|
|
41525
41559
|
}
|
|
41526
41560
|
else {
|
|
41527
|
-
table.
|
|
41561
|
+
table._setColWidth(col, colWidth, false, true);
|
|
41528
41562
|
}
|
|
41529
41563
|
}
|
|
41530
41564
|
}
|
|
@@ -41543,11 +41577,28 @@
|
|
|
41543
41577
|
if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {
|
|
41544
41578
|
const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);
|
|
41545
41579
|
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
41580
|
+
let colWidth;
|
|
41581
|
+
if (col === table.colCount - table.rightFrozenColCount - 1) {
|
|
41582
|
+
colWidth =
|
|
41583
|
+
canvasWidth -
|
|
41584
|
+
actualHeaderWidth -
|
|
41585
|
+
(update
|
|
41586
|
+
? newWidths.reduce((acr, cur, index) => {
|
|
41587
|
+
if (index >= table.frozenColCount && index <= table.colCount - table.rightFrozenColCount - 2) {
|
|
41588
|
+
return acr + cur;
|
|
41589
|
+
}
|
|
41590
|
+
return acr;
|
|
41591
|
+
}, 0)
|
|
41592
|
+
: table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2));
|
|
41593
|
+
}
|
|
41594
|
+
else {
|
|
41595
|
+
colWidth = Math.round((update ? newWidths[col] : table.getColWidth(col)) * factor);
|
|
41596
|
+
}
|
|
41546
41597
|
if (update) {
|
|
41547
|
-
newWidths[col] =
|
|
41598
|
+
newWidths[col] = colWidth;
|
|
41548
41599
|
}
|
|
41549
41600
|
else {
|
|
41550
|
-
table.
|
|
41601
|
+
table._setColWidth(col, colWidth, false, true);
|
|
41551
41602
|
}
|
|
41552
41603
|
}
|
|
41553
41604
|
}
|
|
@@ -41856,11 +41907,13 @@
|
|
|
41856
41907
|
y: table.getFrozenRowsHeight()
|
|
41857
41908
|
});
|
|
41858
41909
|
createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.columnHeaderLevelCount - 1, table.isListTable() ? 'columnHeader' : 'cornerHeader', table);
|
|
41859
|
-
|
|
41910
|
+
distCol - table.rightFrozenColCount >= table.frozenColCount &&
|
|
41911
|
+
createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, 0, table.columnHeaderLevelCount - 1, 'columnHeader', table);
|
|
41860
41912
|
createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.columnHeaderLevelCount, distRow - table.bottomFrozenRowCount, table.isListTable() && !table.internalProps.transpose ? 'body' : 'rowHeader', table);
|
|
41861
41913
|
if (table.bottomFrozenRowCount > 0) {
|
|
41862
41914
|
createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isListTable() ? 'body' : 'rowHeader', table);
|
|
41863
|
-
|
|
41915
|
+
distCol - table.rightFrozenColCount >= table.frozenColCount &&
|
|
41916
|
+
createColGroup(bottomFrozenGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isPivotChart() ? 'rowHeader' : 'body', table);
|
|
41864
41917
|
}
|
|
41865
41918
|
if (table.rightFrozenColCount > 0) {
|
|
41866
41919
|
createColGroup(rightTopCornerGroup, xOrigin, yOrigin, table.colCount - 1 - table.rightFrozenColCount + 1, table.colCount - 1, 0, table.columnHeaderLevelCount - 1, 'columnHeader', table);
|
|
@@ -41869,7 +41922,8 @@
|
|
|
41869
41922
|
if (table.bottomFrozenRowCount > 0 && table.rightFrozenColCount > 0) {
|
|
41870
41923
|
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
41924
|
}
|
|
41872
|
-
|
|
41925
|
+
distCol - table.rightFrozenColCount >= table.frozenColCount &&
|
|
41926
|
+
createColGroup(bodyGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.columnHeaderLevelCount, distRow - table.bottomFrozenRowCount, 'body', table);
|
|
41873
41927
|
if (!bodyGroup.firstChild && !colHeaderGroup.firstChild) {
|
|
41874
41928
|
proxy.currentRow = proxy.totalRow;
|
|
41875
41929
|
proxy.rowEnd = proxy.currentRow;
|
|
@@ -42875,13 +42929,27 @@
|
|
|
42875
42929
|
const updateRowStart = Math.min(sourceRowStart, targetRowStart);
|
|
42876
42930
|
const updateRowEnd = Math.max(sourceRowEnd, targetRowEnd);
|
|
42877
42931
|
for (let col = updateColStart; col <= updateColEnd; col++) {
|
|
42932
|
+
const columnWidth = table.getColWidth(col);
|
|
42878
42933
|
const columnHeaderGroup = table.scenegraph.getColGroup(col, true);
|
|
42879
42934
|
const columnGroup = table.scenegraph.getColGroup(col);
|
|
42935
|
+
const columnBottomGroup = table.scenegraph.getColGroupInBottom(col);
|
|
42880
42936
|
if (columnHeaderGroup) {
|
|
42881
|
-
columnHeaderGroup.setAttribute('width',
|
|
42937
|
+
columnHeaderGroup.setAttribute('width', columnWidth);
|
|
42938
|
+
columnHeaderGroup.forEachChildren((child) => {
|
|
42939
|
+
child.setAttribute('width', columnWidth);
|
|
42940
|
+
});
|
|
42882
42941
|
}
|
|
42883
42942
|
if (columnGroup) {
|
|
42884
|
-
columnGroup.setAttribute('width',
|
|
42943
|
+
columnGroup.setAttribute('width', columnWidth);
|
|
42944
|
+
columnGroup.forEachChildren((child) => {
|
|
42945
|
+
child.setAttribute('width', columnWidth);
|
|
42946
|
+
});
|
|
42947
|
+
}
|
|
42948
|
+
if (columnBottomGroup) {
|
|
42949
|
+
columnBottomGroup.setAttribute('width', columnWidth);
|
|
42950
|
+
columnBottomGroup.forEachChildren((child) => {
|
|
42951
|
+
child.setAttribute('width', columnWidth);
|
|
42952
|
+
});
|
|
42885
42953
|
}
|
|
42886
42954
|
}
|
|
42887
42955
|
scene.updateContainer();
|
|
@@ -44852,6 +44920,10 @@
|
|
|
44852
44920
|
}
|
|
44853
44921
|
this.proxy?.release();
|
|
44854
44922
|
}
|
|
44923
|
+
updateStageBackground() {
|
|
44924
|
+
this.stage.background = this.table.theme.underlayBackgroundColor;
|
|
44925
|
+
this.stage.renderNextFrame();
|
|
44926
|
+
}
|
|
44855
44927
|
createComponent() {
|
|
44856
44928
|
this.component = new TableComponent(this.table);
|
|
44857
44929
|
this.component.addToGroup(this.componentGroup);
|
|
@@ -44970,7 +45042,7 @@
|
|
|
44970
45042
|
this.stage.renderNextFrame();
|
|
44971
45043
|
}
|
|
44972
45044
|
resetAllSelectComponent() {
|
|
44973
|
-
if (this.table.
|
|
45045
|
+
if (this.table.stateManager.select?.ranges?.length > 0) {
|
|
44974
45046
|
updateAllSelectComponent(this);
|
|
44975
45047
|
}
|
|
44976
45048
|
}
|
|
@@ -45158,8 +45230,8 @@
|
|
|
45158
45230
|
width: Math.min(this.table.tableNoFrameWidth, Math.max(this.colHeaderGroup.attribute.width, this.bodyGroup.attribute.width, 0) +
|
|
45159
45231
|
Math.max(this.cornerHeaderGroup.attribute.width, this.rowHeaderGroup.attribute.width, 0) +
|
|
45160
45232
|
this.rightBottomCornerGroup.attribute.width),
|
|
45161
|
-
height: Math.min(this.table.tableNoFrameHeight, (this.colHeaderGroup.attribute.height
|
|
45162
|
-
(this.bodyGroup.attribute.height
|
|
45233
|
+
height: Math.min(this.table.tableNoFrameHeight, Math.max(this.colHeaderGroup.attribute.height, this.cornerHeaderGroup.attribute.height, 0) +
|
|
45234
|
+
Math.max(this.rowHeaderGroup.attribute.height, this.bodyGroup.attribute.height, 0) +
|
|
45163
45235
|
this.bottomFrozenGroup.attribute.height)
|
|
45164
45236
|
});
|
|
45165
45237
|
if (this.tableGroup.border) {
|
|
@@ -45287,7 +45359,7 @@
|
|
|
45287
45359
|
if (!this.isPivot && !this.transpose) {
|
|
45288
45360
|
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
45289
45361
|
}
|
|
45290
|
-
this.table.
|
|
45362
|
+
this.table.stateManager.checkFrozen();
|
|
45291
45363
|
this.updateContainer();
|
|
45292
45364
|
this.createFrameBorder();
|
|
45293
45365
|
this.updateBorderSizeAndPosition();
|
|
@@ -45330,7 +45402,17 @@
|
|
|
45330
45402
|
if (actualWidth < canvasWidth && actualWidth - actualHeaderWidth > 0) {
|
|
45331
45403
|
const factor = (canvasWidth - actualHeaderWidth) / (actualWidth - actualHeaderWidth);
|
|
45332
45404
|
for (let col = table.frozenColCount; col < table.colCount - table.rightFrozenColCount; col++) {
|
|
45333
|
-
|
|
45405
|
+
let colWidth;
|
|
45406
|
+
if (col === table.colCount - table.rightFrozenColCount - 1) {
|
|
45407
|
+
colWidth =
|
|
45408
|
+
canvasWidth -
|
|
45409
|
+
actualHeaderWidth -
|
|
45410
|
+
table.getColsWidth(table.frozenColCount, table.colCount - table.rightFrozenColCount - 2);
|
|
45411
|
+
}
|
|
45412
|
+
else {
|
|
45413
|
+
colWidth = Math.round(table.getColWidth(col) * factor);
|
|
45414
|
+
}
|
|
45415
|
+
this.setColWidth(col, colWidth);
|
|
45334
45416
|
}
|
|
45335
45417
|
}
|
|
45336
45418
|
}
|
|
@@ -45398,7 +45480,17 @@
|
|
|
45398
45480
|
if (actualHeight < canvasHeight && actualHeight - actualHeaderHeight > 0) {
|
|
45399
45481
|
const factor = (canvasHeight - actualHeaderHeight) / (actualHeight - actualHeaderHeight);
|
|
45400
45482
|
for (let row = table.frozenRowCount; row < table.rowCount - table.bottomFrozenRowCount; row++) {
|
|
45401
|
-
|
|
45483
|
+
let rowHeight;
|
|
45484
|
+
if (row === table.rowCount - table.bottomFrozenRowCount - 1) {
|
|
45485
|
+
rowHeight =
|
|
45486
|
+
canvasHeight -
|
|
45487
|
+
actualHeaderHeight -
|
|
45488
|
+
table.getRowsHeight(table.frozenRowCount, table.rowCount - table.bottomFrozenRowCount - 2);
|
|
45489
|
+
}
|
|
45490
|
+
else {
|
|
45491
|
+
rowHeight = Math.round(table.getRowHeight(row) * factor);
|
|
45492
|
+
}
|
|
45493
|
+
this.setRowHeight(row, rowHeight);
|
|
45402
45494
|
}
|
|
45403
45495
|
}
|
|
45404
45496
|
}
|
|
@@ -45493,11 +45585,11 @@
|
|
|
45493
45585
|
updateContainer() {
|
|
45494
45586
|
this.updateContainerAttrWidthAndX();
|
|
45495
45587
|
this.updateTableSize();
|
|
45496
|
-
const oldHorizontalBarPos = this.table.
|
|
45497
|
-
const oldVerticalBarPos = this.table.
|
|
45588
|
+
const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos;
|
|
45589
|
+
const oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos;
|
|
45498
45590
|
this.component.updateScrollBar();
|
|
45499
|
-
this.table.
|
|
45500
|
-
this.table.
|
|
45591
|
+
this.table.stateManager.setScrollLeft(oldHorizontalBarPos);
|
|
45592
|
+
this.table.stateManager.setScrollTop(oldVerticalBarPos);
|
|
45501
45593
|
this.updateNextFrame();
|
|
45502
45594
|
}
|
|
45503
45595
|
updateCellContentWhileResize(col, row) {
|
|
@@ -45644,7 +45736,7 @@
|
|
|
45644
45736
|
updateRow(removeCells, addCells, updateCells, this.table);
|
|
45645
45737
|
this.recalculateColWidths();
|
|
45646
45738
|
this.recalculateRowHeights();
|
|
45647
|
-
this.table.
|
|
45739
|
+
this.table.stateManager.checkFrozen();
|
|
45648
45740
|
if (!this.isPivot && !this.transpose) {
|
|
45649
45741
|
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
45650
45742
|
}
|
|
@@ -45912,13 +46004,13 @@
|
|
|
45912
46004
|
return;
|
|
45913
46005
|
}
|
|
45914
46006
|
table.internalProps.sortState = tableState;
|
|
45915
|
-
table.
|
|
46007
|
+
table.stateManager.setSortState(tableState);
|
|
45916
46008
|
if (headerC?.sort) {
|
|
45917
46009
|
executeSort(tableState, table, headerC);
|
|
45918
46010
|
}
|
|
45919
46011
|
table.internalProps.layoutMap.clearCellRangeMap();
|
|
45920
46012
|
table.scenegraph.sortCell();
|
|
45921
|
-
table.
|
|
46013
|
+
table.stateManager.updateSelectPos(-1, -1);
|
|
45922
46014
|
}
|
|
45923
46015
|
function executeSort(newState, table, headerDefine) {
|
|
45924
46016
|
let hd;
|
|
@@ -45954,9 +46046,6 @@
|
|
|
45954
46046
|
col = -1;
|
|
45955
46047
|
row = -1;
|
|
45956
46048
|
}
|
|
45957
|
-
if (cellPos.col === col && cellPos.row === row) {
|
|
45958
|
-
return;
|
|
45959
|
-
}
|
|
45960
46049
|
if (col !== -1 && row !== -1 && state.select.ranges.length > 0) {
|
|
45961
46050
|
if (interactionState === InteractionState.grabing) {
|
|
45962
46051
|
const currentRange = state.select.ranges[state.select.ranges.length - 1];
|
|
@@ -46267,7 +46356,7 @@
|
|
|
46267
46356
|
const cellLocation = state.table.getCellLocation(col, row);
|
|
46268
46357
|
const delta = cellLocation === 'columnHeader' ? state.columnMove.x : cellLocation === 'rowHeader' ? state.columnMove.y : 0;
|
|
46269
46358
|
state.table.scenegraph.component.showMoveCol(col, row, delta);
|
|
46270
|
-
state.table.
|
|
46359
|
+
state.table.stateManager.updateSelectPos(-1, -1);
|
|
46271
46360
|
state.table.scenegraph.updateNextFrame();
|
|
46272
46361
|
}
|
|
46273
46362
|
function updateMoveCol(col, row, x, y, state) {
|
|
@@ -46537,7 +46626,7 @@
|
|
|
46537
46626
|
}
|
|
46538
46627
|
}
|
|
46539
46628
|
|
|
46540
|
-
class
|
|
46629
|
+
class StateManager {
|
|
46541
46630
|
table;
|
|
46542
46631
|
interactionState;
|
|
46543
46632
|
select;
|
|
@@ -46823,7 +46912,7 @@
|
|
|
46823
46912
|
this.columnResize.x = x;
|
|
46824
46913
|
this.columnResize.isRightFrozen = isRightFrozen;
|
|
46825
46914
|
this.table.scenegraph.component.showResizeCol(col, y, isRightFrozen);
|
|
46826
|
-
this.table.
|
|
46915
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
46827
46916
|
this.table.scenegraph.updateNextFrame();
|
|
46828
46917
|
}
|
|
46829
46918
|
updateResizeCol(xInTable, yInTable) {
|
|
@@ -46873,7 +46962,7 @@
|
|
|
46873
46962
|
const totalHeight = this.table.getAllRowsHeight();
|
|
46874
46963
|
this.scroll.verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
|
|
46875
46964
|
this.table.scenegraph.setY(-this.scroll.verticalBarPos);
|
|
46876
|
-
this.table.
|
|
46965
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
46877
46966
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
46878
46967
|
scrollTop: this.scroll.verticalBarPos,
|
|
46879
46968
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -46889,7 +46978,7 @@
|
|
|
46889
46978
|
const totalWidth = this.table.getAllColsWidth();
|
|
46890
46979
|
this.scroll.horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
|
|
46891
46980
|
this.table.scenegraph.setX(-this.scroll.horizontalBarPos);
|
|
46892
|
-
this.table.
|
|
46981
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
46893
46982
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
46894
46983
|
scrollTop: this.scroll.verticalBarPos,
|
|
46895
46984
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -46909,7 +46998,7 @@
|
|
|
46909
46998
|
this.table.scenegraph.setY(-top);
|
|
46910
46999
|
const yRatio = top / (totalHeight - this.table.scenegraph.height);
|
|
46911
47000
|
this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
|
|
46912
|
-
this.table.
|
|
47001
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
46913
47002
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
46914
47003
|
scrollTop: this.scroll.verticalBarPos,
|
|
46915
47004
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -46930,7 +47019,7 @@
|
|
|
46930
47019
|
this.table.scenegraph.setX(-left);
|
|
46931
47020
|
const xRatio = left / (totalWidth - this.table.scenegraph.width);
|
|
46932
47021
|
this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
|
|
46933
|
-
this.table.
|
|
47022
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
46934
47023
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
46935
47024
|
scrollTop: this.scroll.verticalBarPos,
|
|
46936
47025
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -47431,18 +47520,18 @@
|
|
|
47431
47520
|
}
|
|
47432
47521
|
const dimension = table.internalProps.layoutMap.getHeaderDimension(col, row);
|
|
47433
47522
|
if (dimension?.drillDown || dimension?.drillUp) {
|
|
47434
|
-
table.
|
|
47523
|
+
table.stateManager.updateDrillState(dimension.dimensionKey, dimension.title, dimension.drillDown, dimension.drillUp, col, row);
|
|
47435
47524
|
}
|
|
47436
47525
|
else {
|
|
47437
|
-
table.
|
|
47526
|
+
table.stateManager.updateDrillState(undefined, undefined, false, false, -1, -1);
|
|
47438
47527
|
}
|
|
47439
47528
|
});
|
|
47440
47529
|
table.on(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, (e) => {
|
|
47441
|
-
table.
|
|
47530
|
+
table.stateManager.updateDrillState(undefined, undefined, false, false, -1, -1);
|
|
47442
47531
|
});
|
|
47443
47532
|
}
|
|
47444
47533
|
function drillClick(table) {
|
|
47445
|
-
table.fireListeners(PIVOT_TABLE_EVENT_TYPE.DRILLMENU_CLICK, table.
|
|
47534
|
+
table.fireListeners(PIVOT_TABLE_EVENT_TYPE.DRILLMENU_CLICK, table.stateManager.drill);
|
|
47446
47535
|
}
|
|
47447
47536
|
function checkHaveDrill(table) {
|
|
47448
47537
|
const rowsDefine = table.internalProps.layoutMap.rowsDefine;
|
|
@@ -47483,12 +47572,12 @@
|
|
|
47483
47572
|
const { col, row, x, y } = e;
|
|
47484
47573
|
const type = table.getBodyColumnType(col, row);
|
|
47485
47574
|
if (type !== 'sparkline') {
|
|
47486
|
-
table.
|
|
47575
|
+
table.stateManager.updateSparklineHoverPose(-1, -1, 0, 0);
|
|
47487
47576
|
}
|
|
47488
|
-
table.
|
|
47577
|
+
table.stateManager.updateSparklineHoverPose(col, row, x, y);
|
|
47489
47578
|
});
|
|
47490
47579
|
table.on(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, (e) => {
|
|
47491
|
-
table.
|
|
47580
|
+
table.stateManager.updateSparklineHoverPose(-1, -1, 0, 0);
|
|
47492
47581
|
});
|
|
47493
47582
|
}
|
|
47494
47583
|
|
|
@@ -47525,9 +47614,9 @@
|
|
|
47525
47614
|
let LastBodyPointerXY;
|
|
47526
47615
|
let isDown = false;
|
|
47527
47616
|
let isDraging = false;
|
|
47528
|
-
function bindTableGroupListener(
|
|
47529
|
-
const table =
|
|
47530
|
-
const
|
|
47617
|
+
function bindTableGroupListener(eventManager) {
|
|
47618
|
+
const table = eventManager.table;
|
|
47619
|
+
const stateManager = table.stateManager;
|
|
47531
47620
|
document.body.addEventListener('pointerdown', e => {
|
|
47532
47621
|
LastBodyPointerXY = { x: e.x, y: e.y };
|
|
47533
47622
|
isDown = true;
|
|
@@ -47546,16 +47635,16 @@
|
|
|
47546
47635
|
}
|
|
47547
47636
|
}
|
|
47548
47637
|
const { x, y } = table._getMouseAbstractPoint(e, false);
|
|
47549
|
-
if (
|
|
47638
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
47550
47639
|
return;
|
|
47551
47640
|
}
|
|
47552
|
-
if (
|
|
47553
|
-
if (
|
|
47554
|
-
|
|
47641
|
+
if (stateManager.interactionState === InteractionState.grabing) {
|
|
47642
|
+
if (stateManager.isResizeCol()) {
|
|
47643
|
+
eventManager.dealColumnResize(x, y);
|
|
47555
47644
|
if (table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN)) {
|
|
47556
47645
|
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN, {
|
|
47557
|
-
col: table.
|
|
47558
|
-
colWidth: table.getColWidth(table.
|
|
47646
|
+
col: table.stateManager.columnResize.col,
|
|
47647
|
+
colWidth: table.getColWidth(table.stateManager.columnResize.col)
|
|
47559
47648
|
});
|
|
47560
47649
|
}
|
|
47561
47650
|
}
|
|
@@ -47565,43 +47654,43 @@
|
|
|
47565
47654
|
const lastX = LastPointerXY?.x ?? e.x;
|
|
47566
47655
|
const lastY = LastPointerXY?.y ?? e.y;
|
|
47567
47656
|
LastPointerXY = { x: e.x, y: e.y };
|
|
47568
|
-
if (
|
|
47569
|
-
clearTimeout(
|
|
47570
|
-
|
|
47657
|
+
if (eventManager.touchSetTimeout) {
|
|
47658
|
+
clearTimeout(eventManager.touchSetTimeout);
|
|
47659
|
+
eventManager.touchSetTimeout = undefined;
|
|
47571
47660
|
}
|
|
47572
47661
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47573
|
-
if (
|
|
47662
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
47574
47663
|
return;
|
|
47575
47664
|
}
|
|
47576
|
-
if (
|
|
47665
|
+
if (stateManager.interactionState === InteractionState.grabing &&
|
|
47577
47666
|
Math.abs(lastX - e.x) + Math.abs(lastY - e.y) >= 1) {
|
|
47578
|
-
if (
|
|
47579
|
-
else if (
|
|
47580
|
-
|
|
47667
|
+
if (stateManager.isResizeCol()) ;
|
|
47668
|
+
else if (stateManager.isMoveCol()) {
|
|
47669
|
+
eventManager.dealColumnMover(eventArgsSet);
|
|
47581
47670
|
}
|
|
47582
47671
|
else {
|
|
47583
|
-
|
|
47672
|
+
eventManager.dealTableSelect(eventArgsSet, true);
|
|
47584
47673
|
}
|
|
47585
47674
|
return;
|
|
47586
47675
|
}
|
|
47587
|
-
if (
|
|
47588
|
-
|
|
47676
|
+
if (stateManager.isResizeCol() || eventManager.checkColumnResize(eventArgsSet)) {
|
|
47677
|
+
stateManager.updateCursor('col-resize');
|
|
47589
47678
|
}
|
|
47590
47679
|
else {
|
|
47591
|
-
|
|
47680
|
+
stateManager.updateCursor();
|
|
47592
47681
|
}
|
|
47593
47682
|
const cellGoup = e.path.find(node => node.role === 'cell');
|
|
47594
47683
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
|
|
47595
47684
|
if (cellGoup?.role === 'cell' &&
|
|
47596
|
-
table.
|
|
47597
|
-
table.
|
|
47598
|
-
(cellGoup.col !== table.
|
|
47685
|
+
table.stateManager.hover.cellPos.col !== -1 &&
|
|
47686
|
+
table.stateManager.hover.cellPos.row !== -1 &&
|
|
47687
|
+
(cellGoup.col !== table.stateManager.hover.cellPos.col || cellGoup.row !== table.stateManager.hover.cellPos.row)) {
|
|
47599
47688
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
47600
|
-
col: table.
|
|
47601
|
-
row: table.
|
|
47689
|
+
col: table.stateManager.hover.cellPos.col,
|
|
47690
|
+
row: table.stateManager.hover.cellPos.row,
|
|
47602
47691
|
cellRange: table.getCellRangeRelativeRect({
|
|
47603
|
-
col: table.
|
|
47604
|
-
row: table.
|
|
47692
|
+
col: table.stateManager.hover.cellPos.col,
|
|
47693
|
+
row: table.stateManager.hover.cellPos.row
|
|
47605
47694
|
}),
|
|
47606
47695
|
scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
|
|
47607
47696
|
event: e.nativeEvent,
|
|
@@ -47613,7 +47702,7 @@
|
|
|
47613
47702
|
if (cellGoup?.role === 'cell' &&
|
|
47614
47703
|
isValid$6(cellGoup.col) &&
|
|
47615
47704
|
isValid$6(cellGoup.row) &&
|
|
47616
|
-
(cellGoup.col !== table.
|
|
47705
|
+
(cellGoup.col !== table.stateManager.hover.cellPos.col || cellGoup.row !== table.stateManager.hover.cellPos.row)) {
|
|
47617
47706
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_CELL, {
|
|
47618
47707
|
col: cellGoup.col,
|
|
47619
47708
|
row: cellGoup.row,
|
|
@@ -47627,8 +47716,8 @@
|
|
|
47627
47716
|
});
|
|
47628
47717
|
}
|
|
47629
47718
|
}
|
|
47630
|
-
|
|
47631
|
-
|
|
47719
|
+
eventManager.dealIconHover(eventArgsSet);
|
|
47720
|
+
eventManager.dealTableHover(eventArgsSet);
|
|
47632
47721
|
if (eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.MOUSEMOVE_CELL)) {
|
|
47633
47722
|
let icon;
|
|
47634
47723
|
let position;
|
|
@@ -47660,7 +47749,7 @@
|
|
|
47660
47749
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47661
47750
|
const cellGoup = eventArgsSet?.eventArgs?.target;
|
|
47662
47751
|
if (cellGoup?.role === 'table') {
|
|
47663
|
-
|
|
47752
|
+
eventManager.dealTableHover();
|
|
47664
47753
|
}
|
|
47665
47754
|
});
|
|
47666
47755
|
table.scenegraph.tableGroup.addEventListener('pointerover', (e) => {
|
|
@@ -47693,11 +47782,11 @@
|
|
|
47693
47782
|
}
|
|
47694
47783
|
});
|
|
47695
47784
|
table.scenegraph.tableGroup.addEventListener('pointerleave', (e) => {
|
|
47696
|
-
if (!
|
|
47697
|
-
|
|
47698
|
-
|
|
47785
|
+
if (!stateManager.isResizeCol() && !stateManager.isMoveCol() && !stateManager.isSelecting()) {
|
|
47786
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
47787
|
+
stateManager.updateCursor();
|
|
47699
47788
|
}
|
|
47700
|
-
|
|
47789
|
+
eventManager.dealTableHover();
|
|
47701
47790
|
const target = e.target;
|
|
47702
47791
|
if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {
|
|
47703
47792
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, {
|
|
@@ -47709,31 +47798,31 @@
|
|
|
47709
47798
|
}
|
|
47710
47799
|
});
|
|
47711
47800
|
table.scenegraph.tableGroup.addEventListener('pointerupoutside', (e) => {
|
|
47712
|
-
if (
|
|
47801
|
+
if (stateManager.isResizeCol()) {
|
|
47713
47802
|
endResizeCol(table);
|
|
47714
47803
|
}
|
|
47715
|
-
else if (
|
|
47716
|
-
table.
|
|
47717
|
-
if (table.
|
|
47718
|
-
table.
|
|
47719
|
-
table.
|
|
47720
|
-
table.
|
|
47804
|
+
else if (stateManager.isMoveCol()) {
|
|
47805
|
+
table.stateManager.endMoveCol();
|
|
47806
|
+
if (table.stateManager.columnMove?.colSource !== -1 &&
|
|
47807
|
+
table.stateManager.columnMove?.rowSource !== -1 &&
|
|
47808
|
+
table.stateManager.columnMove?.colTarget !== -1 &&
|
|
47809
|
+
table.stateManager.columnMove?.rowTarget !== -1) {
|
|
47721
47810
|
if (table.hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {
|
|
47722
47811
|
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {
|
|
47723
|
-
target: { col: table.
|
|
47812
|
+
target: { col: table.stateManager.columnMove.colTarget, row: table.stateManager.columnMove.rowTarget },
|
|
47724
47813
|
source: {
|
|
47725
|
-
col: table.
|
|
47726
|
-
row: table.
|
|
47814
|
+
col: table.stateManager.columnMove.colSource,
|
|
47815
|
+
row: table.stateManager.columnMove.rowSource
|
|
47727
47816
|
}
|
|
47728
47817
|
});
|
|
47729
47818
|
}
|
|
47730
47819
|
}
|
|
47731
47820
|
}
|
|
47732
|
-
else if (
|
|
47733
|
-
if (table.
|
|
47734
|
-
const lastCol = table.
|
|
47735
|
-
const lastRow = table.
|
|
47736
|
-
table.
|
|
47821
|
+
else if (stateManager.isSelecting()) {
|
|
47822
|
+
if (table.stateManager.select?.ranges?.length) {
|
|
47823
|
+
const lastCol = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.col;
|
|
47824
|
+
const lastRow = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.row;
|
|
47825
|
+
table.stateManager.endSelectCells();
|
|
47737
47826
|
if (table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
|
|
47738
47827
|
const cellsEvent = {
|
|
47739
47828
|
event: e.nativeEvent,
|
|
@@ -47748,8 +47837,8 @@
|
|
|
47748
47837
|
}
|
|
47749
47838
|
}
|
|
47750
47839
|
}
|
|
47751
|
-
|
|
47752
|
-
|
|
47840
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
47841
|
+
eventManager.dealTableHover();
|
|
47753
47842
|
});
|
|
47754
47843
|
table.scenegraph.tableGroup.addEventListener('pointerdown', (e) => {
|
|
47755
47844
|
LastPointerXY = { x: e.x, y: e.y };
|
|
@@ -47757,52 +47846,52 @@
|
|
|
47757
47846
|
return;
|
|
47758
47847
|
}
|
|
47759
47848
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47760
|
-
if (
|
|
47849
|
+
if (stateManager.interactionState !== InteractionState.default) {
|
|
47761
47850
|
return;
|
|
47762
47851
|
}
|
|
47763
47852
|
if (table.isPivotChart() && eventArgsSet?.eventArgs?.target.type !== 'chart') {
|
|
47764
47853
|
table.scenegraph.updateChartState(null);
|
|
47765
47854
|
}
|
|
47766
|
-
if (
|
|
47855
|
+
if (stateManager.menu.isShow &&
|
|
47767
47856
|
eventArgsSet.eventArgs &&
|
|
47768
|
-
eventArgsSet.eventArgs.target !==
|
|
47769
|
-
|
|
47857
|
+
eventArgsSet.eventArgs.target !== stateManager.residentHoverIcon?.icon) {
|
|
47858
|
+
stateManager.hideMenu();
|
|
47770
47859
|
}
|
|
47771
47860
|
const hitIcon = eventArgsSet?.eventArgs?.target?.role?.startsWith('icon')
|
|
47772
47861
|
? eventArgsSet.eventArgs.target
|
|
47773
47862
|
: undefined;
|
|
47774
47863
|
if (!hitIcon || hitIcon.attribute.interactive === false) {
|
|
47775
47864
|
if (e.pointerType === 'touch') {
|
|
47776
|
-
|
|
47777
|
-
|
|
47778
|
-
|
|
47779
|
-
|
|
47780
|
-
if (!
|
|
47781
|
-
|
|
47865
|
+
eventManager.touchEnd = false;
|
|
47866
|
+
eventManager.touchSetTimeout = setTimeout(() => {
|
|
47867
|
+
eventManager.isTouchdown = false;
|
|
47868
|
+
eventManager.touchMove = true;
|
|
47869
|
+
if (!eventManager.touchEnd && eventManager.checkColumnResize(eventArgsSet, true)) {
|
|
47870
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47782
47871
|
return;
|
|
47783
47872
|
}
|
|
47784
|
-
if (!
|
|
47785
|
-
|
|
47873
|
+
if (!eventManager.touchEnd && eventManager.chechColumnMover(eventArgsSet)) {
|
|
47874
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47786
47875
|
return;
|
|
47787
47876
|
}
|
|
47788
|
-
if (
|
|
47789
|
-
|
|
47877
|
+
if (eventManager.dealTableSelect(eventArgsSet) && !eventManager.touchEnd) {
|
|
47878
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47790
47879
|
}
|
|
47791
47880
|
}, 500);
|
|
47792
|
-
|
|
47881
|
+
eventManager.dealTableHover(eventArgsSet);
|
|
47793
47882
|
}
|
|
47794
47883
|
else {
|
|
47795
|
-
if (
|
|
47884
|
+
if (eventManager.checkColumnResize(eventArgsSet, true)) {
|
|
47796
47885
|
table.scenegraph.updateChartState(null);
|
|
47797
|
-
|
|
47886
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47798
47887
|
return;
|
|
47799
47888
|
}
|
|
47800
|
-
if (
|
|
47801
|
-
|
|
47889
|
+
if (eventManager.chechColumnMover(eventArgsSet)) {
|
|
47890
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47802
47891
|
return;
|
|
47803
47892
|
}
|
|
47804
|
-
if (
|
|
47805
|
-
|
|
47893
|
+
if (eventManager.dealTableSelect(eventArgsSet)) {
|
|
47894
|
+
stateManager.updateInteractionState(InteractionState.grabing);
|
|
47806
47895
|
}
|
|
47807
47896
|
}
|
|
47808
47897
|
}
|
|
@@ -47822,26 +47911,26 @@
|
|
|
47822
47911
|
if (e.button !== 0) {
|
|
47823
47912
|
return;
|
|
47824
47913
|
}
|
|
47825
|
-
if (
|
|
47826
|
-
|
|
47827
|
-
if (
|
|
47914
|
+
if (stateManager.interactionState === 'grabing') {
|
|
47915
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
47916
|
+
if (stateManager.isResizeCol()) {
|
|
47828
47917
|
endResizeCol(table);
|
|
47829
47918
|
}
|
|
47830
|
-
else if (
|
|
47919
|
+
else if (stateManager.isMoveCol()) {
|
|
47831
47920
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47832
|
-
table.
|
|
47921
|
+
table.stateManager.endMoveCol();
|
|
47833
47922
|
if (eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {
|
|
47834
47923
|
table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {
|
|
47835
47924
|
target: { col: eventArgsSet.eventArgs.col, row: eventArgsSet.eventArgs.row },
|
|
47836
47925
|
source: {
|
|
47837
|
-
col: table.
|
|
47838
|
-
row: table.
|
|
47926
|
+
col: table.stateManager.columnMove.colSource,
|
|
47927
|
+
row: table.stateManager.columnMove.colSource
|
|
47839
47928
|
}
|
|
47840
47929
|
});
|
|
47841
47930
|
}
|
|
47842
47931
|
}
|
|
47843
|
-
else if (
|
|
47844
|
-
table.
|
|
47932
|
+
else if (stateManager.isSelecting()) {
|
|
47933
|
+
table.stateManager.endSelectCells();
|
|
47845
47934
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47846
47935
|
if (eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
|
|
47847
47936
|
const cellsEvent = {
|
|
@@ -47857,8 +47946,8 @@
|
|
|
47857
47946
|
}
|
|
47858
47947
|
}
|
|
47859
47948
|
}
|
|
47860
|
-
else if (
|
|
47861
|
-
|
|
47949
|
+
else if (stateManager.interactionState === InteractionState.scrolling) {
|
|
47950
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
47862
47951
|
}
|
|
47863
47952
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
|
|
47864
47953
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
@@ -47875,7 +47964,7 @@
|
|
|
47875
47964
|
table.scenegraph.tableGroup.addEventListener('rightdown', (e) => {
|
|
47876
47965
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47877
47966
|
if (eventArgsSet.eventArgs) {
|
|
47878
|
-
|
|
47967
|
+
stateManager.triggerContextMenu(eventArgsSet.eventArgs.col, eventArgsSet.eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
|
|
47879
47968
|
const { col, row } = eventArgsSet.eventArgs;
|
|
47880
47969
|
if (table.hasListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CELL)) {
|
|
47881
47970
|
const cellInfo = table.getCellInfo(col, row);
|
|
@@ -47901,7 +47990,7 @@
|
|
|
47901
47990
|
: undefined,
|
|
47902
47991
|
target: eventArgsSet?.eventArgs?.target
|
|
47903
47992
|
};
|
|
47904
|
-
if (cellInRanges(table.
|
|
47993
|
+
if (cellInRanges(table.stateManager.select.ranges, col, row)) {
|
|
47905
47994
|
cellsEvent.cells = table.getSelectedCellInfos();
|
|
47906
47995
|
}
|
|
47907
47996
|
else {
|
|
@@ -47912,22 +48001,22 @@
|
|
|
47912
48001
|
}
|
|
47913
48002
|
});
|
|
47914
48003
|
table.scenegraph.tableGroup.addEventListener('pointertap', (e) => {
|
|
47915
|
-
if (table.
|
|
48004
|
+
if (table.stateManager.columnResize.resizing || table.stateManager.columnMove.moving) {
|
|
47916
48005
|
return;
|
|
47917
48006
|
}
|
|
47918
48007
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47919
|
-
|
|
48008
|
+
eventManager.dealIconClick(e, eventArgsSet);
|
|
47920
48009
|
if (!eventArgsSet?.eventArgs) {
|
|
47921
48010
|
return;
|
|
47922
48011
|
}
|
|
47923
|
-
if (
|
|
48012
|
+
if (eventManager.touchSetTimeout || e.pointerType !== 'touch') {
|
|
47924
48013
|
if (e.pointerType === 'touch') {
|
|
47925
48014
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
47926
|
-
if (
|
|
47927
|
-
clearTimeout(
|
|
47928
|
-
|
|
47929
|
-
|
|
47930
|
-
|
|
48015
|
+
if (eventManager.touchSetTimeout) {
|
|
48016
|
+
clearTimeout(eventManager.touchSetTimeout);
|
|
48017
|
+
eventManager.dealTableSelect(eventArgsSet);
|
|
48018
|
+
stateManager.endSelectCells();
|
|
48019
|
+
eventManager.touchSetTimeout = undefined;
|
|
47931
48020
|
}
|
|
47932
48021
|
}
|
|
47933
48022
|
if (table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
|
|
@@ -47965,14 +48054,14 @@
|
|
|
47965
48054
|
if (!isDraging &&
|
|
47966
48055
|
target &&
|
|
47967
48056
|
!target.isDescendantsOf(table.scenegraph.tableGroup)) {
|
|
47968
|
-
|
|
47969
|
-
|
|
47970
|
-
|
|
47971
|
-
|
|
48057
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48058
|
+
eventManager.dealTableHover();
|
|
48059
|
+
eventManager.dealTableSelect();
|
|
48060
|
+
stateManager.updateCursor();
|
|
47972
48061
|
table.scenegraph.updateChartState(null);
|
|
47973
48062
|
}
|
|
47974
48063
|
else if (isDraging) {
|
|
47975
|
-
|
|
48064
|
+
stateManager.endSelectCells();
|
|
47976
48065
|
}
|
|
47977
48066
|
});
|
|
47978
48067
|
table.scenegraph.tableGroup.addEventListener('checkbox_state_change', (e) => {
|
|
@@ -47986,18 +48075,18 @@
|
|
|
47986
48075
|
checked: e.detail.checked
|
|
47987
48076
|
};
|
|
47988
48077
|
if (table.isHeader(col, row)) {
|
|
47989
|
-
table.
|
|
48078
|
+
table.stateManager.setHeaderCheckedState(cellInfo.field, e.detail.checked);
|
|
47990
48079
|
const define = table.getBodyColumnDefine(col, row);
|
|
47991
48080
|
if (define.cellType === 'checkbox') {
|
|
47992
48081
|
table.scenegraph.updateCheckboxCellState(col, row, e.detail.checked);
|
|
47993
48082
|
}
|
|
47994
48083
|
}
|
|
47995
48084
|
else {
|
|
47996
|
-
table.
|
|
48085
|
+
table.stateManager.setCheckedState(col, row, cellInfo.field, e.detail.checked);
|
|
47997
48086
|
const define = table.getBodyColumnDefine(col, row);
|
|
47998
48087
|
if (define.headerType === 'checkbox') {
|
|
47999
|
-
const oldHeaderCheckedState = table.
|
|
48000
|
-
const newHeaderCheckedState = table.
|
|
48088
|
+
const oldHeaderCheckedState = table.stateManager.headerCheckedState[cellInfo.field];
|
|
48089
|
+
const newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(cellInfo.field);
|
|
48001
48090
|
if (oldHeaderCheckedState !== newHeaderCheckedState) {
|
|
48002
48091
|
table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
|
|
48003
48092
|
}
|
|
@@ -48006,26 +48095,26 @@
|
|
|
48006
48095
|
table.fireListeners(TABLE_EVENT_TYPE.CHECKBOX_STATE_CHANGE, cellsEvent);
|
|
48007
48096
|
});
|
|
48008
48097
|
}
|
|
48009
|
-
function bindGesture(
|
|
48010
|
-
const table =
|
|
48011
|
-
|
|
48098
|
+
function bindGesture(eventManager) {
|
|
48099
|
+
const table = eventManager.table;
|
|
48100
|
+
eventManager.gesture = new Gesture(table.scenegraph.stage, {
|
|
48012
48101
|
tap: {
|
|
48013
48102
|
interval: 300
|
|
48014
48103
|
}
|
|
48015
48104
|
});
|
|
48016
|
-
|
|
48105
|
+
eventManager.gesture.on('doubletap', e => {
|
|
48017
48106
|
dblclickHandler(e, table);
|
|
48018
48107
|
});
|
|
48019
48108
|
}
|
|
48020
48109
|
function endResizeCol(table) {
|
|
48021
|
-
table.
|
|
48110
|
+
table.stateManager.endResizeCol();
|
|
48022
48111
|
if (table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END)) {
|
|
48023
48112
|
const columns = [];
|
|
48024
48113
|
for (let col = 0; col < table.colCount; col++) {
|
|
48025
48114
|
columns.push(table.getColWidth(col));
|
|
48026
48115
|
}
|
|
48027
48116
|
table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
48028
|
-
col: table.
|
|
48117
|
+
col: table.stateManager.columnResize.col,
|
|
48029
48118
|
columns
|
|
48030
48119
|
});
|
|
48031
48120
|
}
|
|
@@ -48065,76 +48154,76 @@
|
|
|
48065
48154
|
}
|
|
48066
48155
|
}
|
|
48067
48156
|
|
|
48068
|
-
function bindScrollBarListener(
|
|
48069
|
-
const table =
|
|
48070
|
-
const
|
|
48157
|
+
function bindScrollBarListener(eventManager) {
|
|
48158
|
+
const table = eventManager.table;
|
|
48159
|
+
const stateManager = table.stateManager;
|
|
48071
48160
|
const scenegraph = table.scenegraph;
|
|
48072
48161
|
scenegraph.component.vScrollBar.addEventListener('pointerover', (e) => {
|
|
48073
|
-
|
|
48162
|
+
stateManager.showVerticalScrollBar();
|
|
48074
48163
|
});
|
|
48075
48164
|
scenegraph.component.hScrollBar.addEventListener('pointerover', (e) => {
|
|
48076
|
-
|
|
48165
|
+
stateManager.showHorizontalScrollBar();
|
|
48077
48166
|
});
|
|
48078
48167
|
scenegraph.component.vScrollBar.addEventListener('pointerout', (e) => {
|
|
48079
|
-
if (
|
|
48168
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48080
48169
|
return;
|
|
48081
48170
|
}
|
|
48082
|
-
|
|
48171
|
+
stateManager.hideVerticalScrollBar();
|
|
48083
48172
|
});
|
|
48084
48173
|
scenegraph.component.hScrollBar.addEventListener('pointerout', (e) => {
|
|
48085
|
-
if (
|
|
48174
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48086
48175
|
return;
|
|
48087
48176
|
}
|
|
48088
|
-
|
|
48177
|
+
stateManager.hideHorizontalScrollBar();
|
|
48089
48178
|
});
|
|
48090
48179
|
scenegraph.component.vScrollBar._slider.addEventListener('pointerdown', () => {
|
|
48091
|
-
if (
|
|
48092
|
-
|
|
48180
|
+
if (stateManager.interactionState !== InteractionState.scrolling) {
|
|
48181
|
+
stateManager.updateInteractionState(InteractionState.scrolling);
|
|
48093
48182
|
}
|
|
48094
48183
|
});
|
|
48095
48184
|
scenegraph.component.vScrollBar.addEventListener('pointerup', () => {
|
|
48096
|
-
|
|
48097
|
-
if (
|
|
48098
|
-
|
|
48185
|
+
stateManager.fastScrolling = false;
|
|
48186
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48187
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48099
48188
|
}
|
|
48100
48189
|
});
|
|
48101
48190
|
scenegraph.component.vScrollBar.addEventListener('pointerupoutside', () => {
|
|
48102
|
-
|
|
48103
|
-
if (
|
|
48104
|
-
|
|
48191
|
+
stateManager.fastScrolling = false;
|
|
48192
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48193
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48105
48194
|
}
|
|
48106
48195
|
});
|
|
48107
48196
|
scenegraph.component.hScrollBar._slider.addEventListener('pointerdown', () => {
|
|
48108
|
-
if (
|
|
48109
|
-
|
|
48197
|
+
if (stateManager.interactionState !== InteractionState.scrolling) {
|
|
48198
|
+
stateManager.updateInteractionState(InteractionState.scrolling);
|
|
48110
48199
|
}
|
|
48111
48200
|
});
|
|
48112
48201
|
scenegraph.component.hScrollBar.addEventListener('pointerup', () => {
|
|
48113
|
-
|
|
48114
|
-
if (
|
|
48115
|
-
|
|
48202
|
+
stateManager.fastScrolling = false;
|
|
48203
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48204
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48116
48205
|
}
|
|
48117
48206
|
});
|
|
48118
48207
|
scenegraph.component.hScrollBar.addEventListener('pointerupoutside', () => {
|
|
48119
|
-
|
|
48120
|
-
if (
|
|
48121
|
-
|
|
48208
|
+
stateManager.fastScrolling = false;
|
|
48209
|
+
if (stateManager.interactionState === InteractionState.scrolling) {
|
|
48210
|
+
stateManager.updateInteractionState(InteractionState.default);
|
|
48122
48211
|
}
|
|
48123
48212
|
});
|
|
48124
|
-
const throttleVerticalWheel = throttle(
|
|
48125
|
-
const throttleHorizontalWheel = throttle(
|
|
48213
|
+
const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20);
|
|
48214
|
+
const throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
|
|
48126
48215
|
scenegraph.component.vScrollBar.addEventListener('scroll', (e) => {
|
|
48127
|
-
|
|
48128
|
-
if (
|
|
48129
|
-
|
|
48216
|
+
stateManager.fastScrolling = true;
|
|
48217
|
+
if (stateManager.interactionState !== InteractionState.scrolling) {
|
|
48218
|
+
stateManager.updateInteractionState(InteractionState.scrolling);
|
|
48130
48219
|
}
|
|
48131
48220
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
48132
48221
|
throttleVerticalWheel(ratio, e);
|
|
48133
48222
|
});
|
|
48134
48223
|
scenegraph.component.hScrollBar.addEventListener('scroll', (e) => {
|
|
48135
|
-
|
|
48136
|
-
if (
|
|
48137
|
-
|
|
48224
|
+
stateManager.fastScrolling = true;
|
|
48225
|
+
if (stateManager.interactionState !== InteractionState.scrolling) {
|
|
48226
|
+
stateManager.updateInteractionState(InteractionState.scrolling);
|
|
48138
48227
|
}
|
|
48139
48228
|
const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
|
|
48140
48229
|
throttleHorizontalWheel(ratio);
|
|
@@ -48207,21 +48296,21 @@
|
|
|
48207
48296
|
return totalWidth !== 0 && deltaX >= 0 && Math.abs(state.scroll.horizontalBarPos - totalWidth) < 1;
|
|
48208
48297
|
}
|
|
48209
48298
|
|
|
48210
|
-
function bindContainerDomListener(
|
|
48211
|
-
const table =
|
|
48212
|
-
const
|
|
48299
|
+
function bindContainerDomListener(eventManager) {
|
|
48300
|
+
const table = eventManager.table;
|
|
48301
|
+
const stateManager = table.stateManager;
|
|
48213
48302
|
const handler = table.internalProps.handler;
|
|
48214
48303
|
handler.on(table.getElement(), 'blur', (e) => {
|
|
48215
|
-
|
|
48304
|
+
eventManager.dealTableHover();
|
|
48216
48305
|
});
|
|
48217
48306
|
handler.on(table.getElement(), 'wheel', (e) => {
|
|
48218
|
-
handleWhell(e,
|
|
48307
|
+
handleWhell(e, stateManager);
|
|
48219
48308
|
});
|
|
48220
48309
|
handler.on(table.getElement(), 'keydown', (e) => {
|
|
48221
48310
|
if (table.keyboardOptions?.selectAllOnCtrlA) {
|
|
48222
48311
|
if (e.key === 'a' && (e.ctrlKey || e.metaKey)) {
|
|
48223
48312
|
e.preventDefault();
|
|
48224
|
-
|
|
48313
|
+
eventManager.deelTableSelectAll();
|
|
48225
48314
|
}
|
|
48226
48315
|
}
|
|
48227
48316
|
if (table.hasListeners(TABLE_EVENT_TYPE.KEYDOWN)) {
|
|
@@ -48229,7 +48318,6 @@
|
|
|
48229
48318
|
keyCode: e.keyCode ?? e.which,
|
|
48230
48319
|
code: e.code,
|
|
48231
48320
|
event: e,
|
|
48232
|
-
cells: table.getSelectedCellInfos(),
|
|
48233
48321
|
scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth
|
|
48234
48322
|
};
|
|
48235
48323
|
table.fireListeners(TABLE_EVENT_TYPE.KEYDOWN, cellsEvent);
|
|
@@ -48247,7 +48335,7 @@
|
|
|
48247
48335
|
e.clipboardData.setData('text/plain', data);
|
|
48248
48336
|
}
|
|
48249
48337
|
table.fireListeners(TABLE_EVENT_TYPE.COPY_DATA, {
|
|
48250
|
-
cellRange: table.
|
|
48338
|
+
cellRange: table.stateManager.select.ranges,
|
|
48251
48339
|
copyData: data
|
|
48252
48340
|
});
|
|
48253
48341
|
}
|
|
@@ -48261,87 +48349,87 @@
|
|
|
48261
48349
|
});
|
|
48262
48350
|
}
|
|
48263
48351
|
|
|
48264
|
-
function bindTouchListener(
|
|
48265
|
-
const table =
|
|
48266
|
-
const
|
|
48352
|
+
function bindTouchListener(eventManager) {
|
|
48353
|
+
const table = eventManager.table;
|
|
48354
|
+
const stateManager = table.stateManager;
|
|
48267
48355
|
const scenegraph = table.scenegraph;
|
|
48268
|
-
|
|
48356
|
+
eventManager.touchMovePoints = [];
|
|
48269
48357
|
table.scenegraph.tableGroup.addEventListener('touchstart', (e) => {
|
|
48270
48358
|
if (e.target.isChildOf(scenegraph.component.vScrollBar) || e.target.isChildOf(scenegraph.component.vScrollBar)) {
|
|
48271
48359
|
return;
|
|
48272
48360
|
}
|
|
48273
|
-
|
|
48274
|
-
|
|
48361
|
+
eventManager.isTouchdown = true;
|
|
48362
|
+
eventManager.touchMovePoints.push({
|
|
48275
48363
|
x: e.page.x,
|
|
48276
48364
|
y: e.page.y,
|
|
48277
48365
|
timestamp: Date.now()
|
|
48278
48366
|
});
|
|
48279
48367
|
});
|
|
48280
48368
|
window.addEventListener('touchmove', (e) => {
|
|
48281
|
-
if (
|
|
48369
|
+
if (eventManager.touchMove) {
|
|
48282
48370
|
e.preventDefault();
|
|
48283
48371
|
}
|
|
48284
|
-
if (!
|
|
48372
|
+
if (!eventManager.isTouchdown || !isTouchEvent$1(e)) {
|
|
48285
48373
|
return;
|
|
48286
48374
|
}
|
|
48287
|
-
if (
|
|
48288
|
-
|
|
48375
|
+
if (eventManager.touchMovePoints.length > 4) {
|
|
48376
|
+
eventManager.touchMovePoints.shift();
|
|
48289
48377
|
}
|
|
48290
|
-
|
|
48378
|
+
eventManager.touchMovePoints.push({
|
|
48291
48379
|
x: e.changedTouches[0].pageX,
|
|
48292
48380
|
y: e.changedTouches[0].pageY,
|
|
48293
48381
|
timestamp: Date.now()
|
|
48294
48382
|
});
|
|
48295
|
-
const deltaX = -
|
|
48296
|
-
|
|
48297
|
-
const deltaY = -
|
|
48298
|
-
|
|
48299
|
-
handleWhell({ deltaX, deltaY },
|
|
48383
|
+
const deltaX = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].x +
|
|
48384
|
+
eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].x;
|
|
48385
|
+
const deltaY = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].y +
|
|
48386
|
+
eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].y;
|
|
48387
|
+
handleWhell({ deltaX, deltaY }, stateManager);
|
|
48300
48388
|
if (e.cancelable &&
|
|
48301
48389
|
(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,
|
|
48390
|
+
(Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, stateManager)) ||
|
|
48391
|
+
(Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, stateManager)))) {
|
|
48304
48392
|
e.preventDefault();
|
|
48305
48393
|
}
|
|
48306
48394
|
}, { passive: false });
|
|
48307
48395
|
window.addEventListener('touchend', (e) => {
|
|
48308
|
-
|
|
48309
|
-
|
|
48310
|
-
if (!
|
|
48396
|
+
eventManager.touchEnd = true;
|
|
48397
|
+
eventManager.touchMove = false;
|
|
48398
|
+
if (!eventManager.isTouchdown || !isTouchEvent$1(e)) {
|
|
48311
48399
|
return;
|
|
48312
48400
|
}
|
|
48313
|
-
if (
|
|
48314
|
-
if (
|
|
48315
|
-
|
|
48401
|
+
if (eventManager.touchMovePoints?.length) {
|
|
48402
|
+
if (eventManager.touchMovePoints.length > 4) {
|
|
48403
|
+
eventManager.touchMovePoints.shift();
|
|
48316
48404
|
}
|
|
48317
|
-
|
|
48405
|
+
eventManager.touchMovePoints.push({
|
|
48318
48406
|
x: e.changedTouches[0].pageX,
|
|
48319
48407
|
y: e.changedTouches[0].pageY,
|
|
48320
48408
|
timestamp: Date.now()
|
|
48321
48409
|
});
|
|
48322
|
-
const firstPoint =
|
|
48323
|
-
const lastPoint =
|
|
48410
|
+
const firstPoint = eventManager.touchMovePoints[0];
|
|
48411
|
+
const lastPoint = eventManager.touchMovePoints[eventManager.touchMovePoints?.length - 1];
|
|
48324
48412
|
const vX = (lastPoint.x - firstPoint.x) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
48325
48413
|
const vY = (lastPoint.y - firstPoint.y) / (lastPoint.timestamp - firstPoint.timestamp);
|
|
48326
|
-
startInertia(vX, vY,
|
|
48414
|
+
startInertia(vX, vY, stateManager);
|
|
48327
48415
|
}
|
|
48328
|
-
|
|
48329
|
-
|
|
48416
|
+
eventManager.isTouchdown = false;
|
|
48417
|
+
eventManager.touchMovePoints = [];
|
|
48330
48418
|
});
|
|
48331
48419
|
window.addEventListener('touchcancel', (e) => {
|
|
48332
|
-
|
|
48333
|
-
|
|
48334
|
-
if (!
|
|
48420
|
+
eventManager.touchEnd = true;
|
|
48421
|
+
eventManager.touchMove = false;
|
|
48422
|
+
if (!eventManager.isTouchdown) {
|
|
48335
48423
|
return;
|
|
48336
48424
|
}
|
|
48337
|
-
|
|
48338
|
-
|
|
48425
|
+
eventManager.isTouchdown = false;
|
|
48426
|
+
eventManager.touchMovePoints = [];
|
|
48339
48427
|
});
|
|
48340
48428
|
}
|
|
48341
48429
|
function isTouchEvent$1(e) {
|
|
48342
48430
|
return !!e.changedTouches;
|
|
48343
48431
|
}
|
|
48344
|
-
function startInertia(vX, vY,
|
|
48432
|
+
function startInertia(vX, vY, stateManager) {
|
|
48345
48433
|
let time = Date.now();
|
|
48346
48434
|
const friction = 0.95;
|
|
48347
48435
|
const inertia = () => {
|
|
@@ -48361,7 +48449,7 @@
|
|
|
48361
48449
|
stopped = false;
|
|
48362
48450
|
dy = ((vY + newVY) / 2) * dffTime;
|
|
48363
48451
|
}
|
|
48364
|
-
handleWhell({ deltaX: -dx, deltaY: -dy },
|
|
48452
|
+
handleWhell({ deltaX: -dx, deltaY: -dy }, stateManager);
|
|
48365
48453
|
if (stopped) {
|
|
48366
48454
|
return;
|
|
48367
48455
|
}
|
|
@@ -48378,7 +48466,7 @@
|
|
|
48378
48466
|
return;
|
|
48379
48467
|
}
|
|
48380
48468
|
table.scenegraph.tableGroup.addEventListener('click', (e) => {
|
|
48381
|
-
if (table.
|
|
48469
|
+
if (table.stateManager.columnMove.moving || table.stateManager.columnResize.resizing) {
|
|
48382
48470
|
return;
|
|
48383
48471
|
}
|
|
48384
48472
|
if (e.target.name === 'axis-label') {
|
|
@@ -48498,7 +48586,7 @@
|
|
|
48498
48586
|
return 'bottom';
|
|
48499
48587
|
}
|
|
48500
48588
|
|
|
48501
|
-
class
|
|
48589
|
+
class EventManager {
|
|
48502
48590
|
table;
|
|
48503
48591
|
isTouchdown;
|
|
48504
48592
|
touchMovePoints;
|
|
@@ -48527,28 +48615,28 @@
|
|
|
48527
48615
|
if (this.table.isReleased) {
|
|
48528
48616
|
return;
|
|
48529
48617
|
}
|
|
48530
|
-
const
|
|
48618
|
+
const stateManager = this.table.stateManager;
|
|
48531
48619
|
this.table.on(TABLE_EVENT_TYPE.ICON_CLICK, iconInfo => {
|
|
48532
48620
|
const { col, row, x, y, funcType, icon } = iconInfo;
|
|
48533
48621
|
if (funcType === IconFuncTypeEnum.dropDown) {
|
|
48534
|
-
|
|
48622
|
+
stateManager.triggerDropDownMenu(col, row, x, y);
|
|
48535
48623
|
}
|
|
48536
48624
|
else if (funcType === IconFuncTypeEnum.sort) {
|
|
48537
|
-
|
|
48625
|
+
stateManager.triggerSort(col, row, icon);
|
|
48538
48626
|
}
|
|
48539
48627
|
else if (funcType === IconFuncTypeEnum.frozen) {
|
|
48540
|
-
|
|
48628
|
+
stateManager.triggerFreeze(col, row, icon);
|
|
48541
48629
|
}
|
|
48542
48630
|
else if (funcType === IconFuncTypeEnum.drillDown) {
|
|
48543
48631
|
drillClick(this.table);
|
|
48544
48632
|
}
|
|
48545
48633
|
else if (funcType === IconFuncTypeEnum.collapse || funcType === IconFuncTypeEnum.expand) {
|
|
48546
|
-
this.table.
|
|
48634
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48547
48635
|
this.table.toggleHierarchyState(col, row);
|
|
48548
48636
|
}
|
|
48549
48637
|
});
|
|
48550
48638
|
this.table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
|
|
48551
|
-
|
|
48639
|
+
stateManager.hideMenu();
|
|
48552
48640
|
});
|
|
48553
48641
|
if (checkHaveTextStick(this.table)) {
|
|
48554
48642
|
this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
|
|
@@ -48574,31 +48662,31 @@
|
|
|
48574
48662
|
}
|
|
48575
48663
|
dealTableHover(eventArgsSet) {
|
|
48576
48664
|
if (!eventArgsSet) {
|
|
48577
|
-
this.table.
|
|
48665
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
48578
48666
|
return;
|
|
48579
48667
|
}
|
|
48580
48668
|
const { eventArgs } = eventArgsSet;
|
|
48581
48669
|
if (eventArgs) {
|
|
48582
|
-
this.table.
|
|
48670
|
+
this.table.stateManager.updateHoverPos(eventArgs.col, eventArgs.row);
|
|
48583
48671
|
}
|
|
48584
48672
|
else {
|
|
48585
|
-
this.table.
|
|
48673
|
+
this.table.stateManager.updateHoverPos(-1, -1);
|
|
48586
48674
|
}
|
|
48587
48675
|
}
|
|
48588
48676
|
dealIconHover(eventArgsSet) {
|
|
48589
48677
|
const { eventArgs } = eventArgsSet;
|
|
48590
48678
|
if (eventArgs) {
|
|
48591
|
-
this.table.
|
|
48679
|
+
this.table.stateManager.updateHoverIcon(eventArgs.col, eventArgs.row, eventArgs.target, eventArgs.targetCell, eventArgs.event);
|
|
48592
48680
|
}
|
|
48593
48681
|
else {
|
|
48594
|
-
this.table.
|
|
48682
|
+
this.table.stateManager.updateHoverIcon(-1, -1, undefined, undefined);
|
|
48595
48683
|
}
|
|
48596
48684
|
}
|
|
48597
48685
|
dealMenuHover(eventArgsSet) {
|
|
48598
48686
|
}
|
|
48599
48687
|
dealTableSelect(eventArgsSet, isSelectMoving) {
|
|
48600
48688
|
if (!eventArgsSet) {
|
|
48601
|
-
this.table.
|
|
48689
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48602
48690
|
return false;
|
|
48603
48691
|
}
|
|
48604
48692
|
const { eventArgs } = eventArgsSet;
|
|
@@ -48608,30 +48696,30 @@
|
|
|
48608
48696
|
}
|
|
48609
48697
|
const define = this.table.getBodyColumnDefine(eventArgs.col, eventArgs.row);
|
|
48610
48698
|
if (this.table.isHeader(eventArgs.col, eventArgs.row) &&
|
|
48611
|
-
(define?.disableHeaderSelect || this.table.
|
|
48699
|
+
(define?.disableHeaderSelect || this.table.stateManager.select?.disableHeader)) {
|
|
48612
48700
|
if (!isSelectMoving) {
|
|
48613
|
-
this.table.
|
|
48701
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48614
48702
|
}
|
|
48615
48703
|
return false;
|
|
48616
48704
|
}
|
|
48617
48705
|
else if (!this.table.isHeader(eventArgs.col, eventArgs.row) && define?.disableSelect) {
|
|
48618
48706
|
if (!isSelectMoving) {
|
|
48619
|
-
this.table.
|
|
48707
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48620
48708
|
}
|
|
48621
48709
|
return false;
|
|
48622
48710
|
}
|
|
48623
48711
|
if (this.table.isPivotChart() &&
|
|
48624
48712
|
(eventArgsSet?.eventArgs?.target.name === 'axis-label' || eventArgsSet?.eventArgs?.target.type === 'chart')) {
|
|
48625
|
-
this.table.
|
|
48713
|
+
this.table.stateManager.updateSelectPos(-1, -1);
|
|
48626
48714
|
return false;
|
|
48627
48715
|
}
|
|
48628
|
-
this.table.
|
|
48716
|
+
this.table.stateManager.updateSelectPos(eventArgs.col, eventArgs.row, eventArgs.event.shiftKey, eventArgs.event.ctrlKey || eventArgs.event.metaKey);
|
|
48629
48717
|
return true;
|
|
48630
48718
|
}
|
|
48631
48719
|
return false;
|
|
48632
48720
|
}
|
|
48633
48721
|
deelTableSelectAll() {
|
|
48634
|
-
this.table.
|
|
48722
|
+
this.table.stateManager.updateSelectPos(-1, -1, false, false, true);
|
|
48635
48723
|
}
|
|
48636
48724
|
dealMenuSelect(eventArgsSet) {
|
|
48637
48725
|
}
|
|
@@ -48641,7 +48729,7 @@
|
|
|
48641
48729
|
const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgs.targetCell);
|
|
48642
48730
|
if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
|
|
48643
48731
|
if (update) {
|
|
48644
|
-
this.table.
|
|
48732
|
+
this.table.stateManager.startResizeCol(resizeCol.col, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, resizeCol.rightFrozen);
|
|
48645
48733
|
}
|
|
48646
48734
|
return true;
|
|
48647
48735
|
}
|
|
@@ -48649,22 +48737,22 @@
|
|
|
48649
48737
|
return false;
|
|
48650
48738
|
}
|
|
48651
48739
|
dealColumnResize(xInTable, yInTable) {
|
|
48652
|
-
this.table.
|
|
48740
|
+
this.table.stateManager.updateResizeCol(xInTable, yInTable);
|
|
48653
48741
|
}
|
|
48654
48742
|
chechColumnMover(eventArgsSet) {
|
|
48655
48743
|
const { eventArgs } = eventArgsSet;
|
|
48656
48744
|
if (eventArgs &&
|
|
48657
48745
|
this.table.isHeader(eventArgs.col, eventArgs.row) &&
|
|
48658
|
-
checkCellInSelect(eventArgs.col, eventArgs.row, this.table.
|
|
48746
|
+
checkCellInSelect(eventArgs.col, eventArgs.row, this.table.stateManager.select.ranges) &&
|
|
48659
48747
|
this.table._canDragHeaderPosition(eventArgs.col, eventArgs.row)) {
|
|
48660
|
-
this.table.
|
|
48748
|
+
this.table.stateManager.startMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
|
|
48661
48749
|
return true;
|
|
48662
48750
|
}
|
|
48663
48751
|
return false;
|
|
48664
48752
|
}
|
|
48665
48753
|
dealColumnMover(eventArgsSet) {
|
|
48666
48754
|
const { eventArgs } = eventArgsSet;
|
|
48667
|
-
this.table.
|
|
48755
|
+
this.table.stateManager.updateMoveCol(eventArgs.col, eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
|
|
48668
48756
|
}
|
|
48669
48757
|
startColumnResize(eventArgsSet) {
|
|
48670
48758
|
}
|
|
@@ -49271,8 +49359,8 @@
|
|
|
49271
49359
|
const children = this._menuInstanceInfo.content[dropDownIndex]?.children;
|
|
49272
49360
|
for (let i = 0; i < children.length; i++) {
|
|
49273
49361
|
const menuItem = children[i];
|
|
49274
|
-
const isHighlight = table.
|
|
49275
|
-
? isMenuHighlight(table, table.
|
|
49362
|
+
const isHighlight = table.stateManager.menu.dropDownMenuHighlight
|
|
49363
|
+
? isMenuHighlight(table, table.stateManager.menu.dropDownMenuHighlight, typeof menuItem === 'object' ? menuItem?.menuKey || menuItem?.text : menuItem, col, row)
|
|
49276
49364
|
: false;
|
|
49277
49365
|
const item = createItem(menuItem, isHighlight);
|
|
49278
49366
|
item.col = col;
|
|
@@ -49348,7 +49436,7 @@
|
|
|
49348
49436
|
if (typeof menu === 'object' && menu.children && menu.children.length) {
|
|
49349
49437
|
for (let j = 0; j < menu.children.length; j++) {
|
|
49350
49438
|
const childItem = menu.children[j];
|
|
49351
|
-
if (isMenuHighlight(table, table.
|
|
49439
|
+
if (isMenuHighlight(table, table.stateManager.menu.dropDownMenuHighlight, typeof childItem === 'object' ? childItem?.menuKey : childItem, col, row) &&
|
|
49352
49440
|
menuKey === (typeof childItem === 'object' ? childItem?.menuKey : childItem)) {
|
|
49353
49441
|
highlight = true;
|
|
49354
49442
|
return;
|
|
@@ -49397,16 +49485,16 @@
|
|
|
49397
49485
|
const menuListItem = menuInstanceInfo.content;
|
|
49398
49486
|
for (let i = 0; i < menuListItem?.length ?? 0; i++) {
|
|
49399
49487
|
const menuItem = menuListItem[i];
|
|
49400
|
-
let isHighlight = table.
|
|
49401
|
-
? isMenuHighlight(table, table.
|
|
49488
|
+
let isHighlight = table.stateManager.menu.dropDownMenuHighlight
|
|
49489
|
+
? isMenuHighlight(table, table.stateManager.menu.dropDownMenuHighlight, typeof menuItem === 'object' ? menuItem?.menuKey || menuItem?.text : menuItem, col, row)
|
|
49402
49490
|
: false;
|
|
49403
|
-
if (table.
|
|
49491
|
+
if (table.stateManager.menu.dropDownMenuHighlight &&
|
|
49404
49492
|
typeof menuItem === 'object' &&
|
|
49405
49493
|
Array.isArray(menuItem.children) &&
|
|
49406
49494
|
menuItem.children.length) {
|
|
49407
49495
|
for (let i = 0; i < menuItem.children.length; i++) {
|
|
49408
49496
|
const childItem = menuItem.children[i];
|
|
49409
|
-
if (isMenuHighlight(table, table.
|
|
49497
|
+
if (isMenuHighlight(table, table.stateManager.menu.dropDownMenuHighlight, typeof childItem === 'object' ? childItem?.menuKey || childItem?.text : childItem, col, row)) {
|
|
49410
49498
|
isHighlight = true;
|
|
49411
49499
|
break;
|
|
49412
49500
|
}
|
|
@@ -49835,8 +49923,8 @@
|
|
|
49835
49923
|
if (typeof menu === 'object' && menu.children && menu.children.length) {
|
|
49836
49924
|
for (let j = 0; j < menu.children.length; j++) {
|
|
49837
49925
|
const childItem = menu.children[j];
|
|
49838
|
-
if (_table.
|
|
49839
|
-
isMenuHighlight(_table, _table.
|
|
49926
|
+
if (_table.stateManager.menu?.dropDownMenuHighlight &&
|
|
49927
|
+
isMenuHighlight(_table, _table.stateManager.menu?.dropDownMenuHighlight, typeof childItem === 'object' ? childItem?.menuKey : childItem, col, row)) {
|
|
49840
49928
|
highlightIndex = i;
|
|
49841
49929
|
subHighlightIndex = j;
|
|
49842
49930
|
break;
|
|
@@ -50211,12 +50299,12 @@
|
|
|
50211
50299
|
if (isMobile()) {
|
|
50212
50300
|
rootElement.style.fontSize = '11px';
|
|
50213
50301
|
}
|
|
50214
|
-
const { x1: menuLeft, x2: menuRight, y1: menuTop, y2: menuBottom } = table.
|
|
50302
|
+
const { x1: menuLeft, x2: menuRight, y1: menuTop, y2: menuBottom } = table.stateManager.menu.bounds;
|
|
50215
50303
|
const tooltipLeft = tooltipX;
|
|
50216
50304
|
const tooltipRight = tooltipLeft + rootElementWidth;
|
|
50217
50305
|
const tooltipTop = tooltipY;
|
|
50218
50306
|
const tooltipBottom = tooltipLeft + rootElementHeight;
|
|
50219
|
-
if (table.
|
|
50307
|
+
if (table.stateManager.menu.isShow &&
|
|
50220
50308
|
menuLeft < tooltipRight &&
|
|
50221
50309
|
menuRight > tooltipLeft &&
|
|
50222
50310
|
menuBottom > tooltipTop &&
|
|
@@ -50423,8 +50511,8 @@
|
|
|
50423
50511
|
if (isMobile()) {
|
|
50424
50512
|
return;
|
|
50425
50513
|
}
|
|
50426
|
-
const { x1: left, x2: right, y1: top, y2: bottom } = table.
|
|
50427
|
-
if (table.
|
|
50514
|
+
const { x1: left, x2: right, y1: top, y2: bottom } = table.stateManager.menu.bounds;
|
|
50515
|
+
if (table.stateManager.menu.isShow &&
|
|
50428
50516
|
typeof e.x === 'number' &&
|
|
50429
50517
|
typeof e.y === 'number' &&
|
|
50430
50518
|
e.x > left &&
|
|
@@ -50490,7 +50578,7 @@
|
|
|
50490
50578
|
this._unbindFromCell();
|
|
50491
50579
|
}
|
|
50492
50580
|
}
|
|
50493
|
-
if (this._attachInfo && table.
|
|
50581
|
+
if (this._attachInfo && table.stateManager.menu.isShow) {
|
|
50494
50582
|
this._bindToCell(e.col, e.row);
|
|
50495
50583
|
}
|
|
50496
50584
|
});
|
|
@@ -51565,14 +51653,14 @@
|
|
|
51565
51653
|
canvasHeight;
|
|
51566
51654
|
_vDataSet;
|
|
51567
51655
|
scenegraph;
|
|
51568
|
-
|
|
51569
|
-
|
|
51656
|
+
stateManager;
|
|
51657
|
+
eventManager;
|
|
51570
51658
|
_pixelRatio;
|
|
51571
51659
|
static get EVENT_TYPE() {
|
|
51572
51660
|
return TABLE_EVENT_TYPE;
|
|
51573
51661
|
}
|
|
51574
51662
|
options;
|
|
51575
|
-
version = "0.15.
|
|
51663
|
+
version = "0.15.1";
|
|
51576
51664
|
pagination;
|
|
51577
51665
|
id = `VTable${Date.now()}`;
|
|
51578
51666
|
headerStyleCache;
|
|
@@ -51681,8 +51769,8 @@
|
|
|
51681
51769
|
: 10;
|
|
51682
51770
|
this._vDataSet = new DataSet();
|
|
51683
51771
|
this.scenegraph = new Scenegraph(this);
|
|
51684
|
-
this.
|
|
51685
|
-
this.
|
|
51772
|
+
this.stateManager = new StateManager(this);
|
|
51773
|
+
this.eventManager = new EventManager(this);
|
|
51686
51774
|
if (options.legends) {
|
|
51687
51775
|
internalProps.legends = createLegend(options.legends, this);
|
|
51688
51776
|
this.scenegraph.tableGroup.setAttributes({
|
|
@@ -51757,7 +51845,7 @@
|
|
|
51757
51845
|
if (this.tableNoFrameWidth - this.getColsWidth(0, frozenColCount - 1) <= 120) {
|
|
51758
51846
|
this.internalProps.frozenColCount = 0;
|
|
51759
51847
|
}
|
|
51760
|
-
this.
|
|
51848
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
51761
51849
|
}
|
|
51762
51850
|
setFrozenColCount(frozenColCount) {
|
|
51763
51851
|
if (frozenColCount >= this.colCount) {
|
|
@@ -51768,7 +51856,7 @@
|
|
|
51768
51856
|
if (this.tableNoFrameWidth - this.getColsWidth(0, frozenColCount - 1) <= 120) {
|
|
51769
51857
|
this.internalProps.frozenColCount = 0;
|
|
51770
51858
|
}
|
|
51771
|
-
this.
|
|
51859
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
51772
51860
|
}
|
|
51773
51861
|
_setFrozenColCount(frozenColCount) {
|
|
51774
51862
|
if (frozenColCount >= this.colCount) {
|
|
@@ -51983,9 +52071,6 @@
|
|
|
51983
52071
|
get rowHierarchyType() {
|
|
51984
52072
|
return 'grid';
|
|
51985
52073
|
}
|
|
51986
|
-
setColWidths(widths) {
|
|
51987
|
-
widths.forEach((value, index) => this.setColWidth(index, value));
|
|
51988
|
-
}
|
|
51989
52074
|
getColsWidth(startCol, endCol) {
|
|
51990
52075
|
endCol = Math.min(endCol, this.colCount - 1);
|
|
51991
52076
|
const cachedColWidth = this._colRangeWidthsMap.get(`$${startCol}$${endCol}`);
|
|
@@ -52033,7 +52118,7 @@
|
|
|
52033
52118
|
}
|
|
52034
52119
|
return this.internalProps.defaultRowHeight;
|
|
52035
52120
|
}
|
|
52036
|
-
|
|
52121
|
+
_setRowHeight(row, height, clearCache) {
|
|
52037
52122
|
this.rowHeightsMap.put(row, Math.round(height));
|
|
52038
52123
|
if (clearCache) {
|
|
52039
52124
|
this._clearRowRangeHeightsMap(row);
|
|
@@ -52126,13 +52211,13 @@
|
|
|
52126
52211
|
}
|
|
52127
52212
|
return this._adjustColWidth(col, this._colWidthDefineToPxWidth(width));
|
|
52128
52213
|
}
|
|
52129
|
-
|
|
52214
|
+
_setColWidth(col, width, clearCache, skipCheckFrozen) {
|
|
52130
52215
|
this.colWidthsMap.put(col, typeof width === 'number' ? Math.round(width) : width);
|
|
52131
52216
|
if (clearCache) {
|
|
52132
52217
|
this._clearColRangeWidthsMap(col);
|
|
52133
52218
|
}
|
|
52134
52219
|
if (!skipCheckFrozen) {
|
|
52135
|
-
this.
|
|
52220
|
+
this.stateManager.checkFrozen();
|
|
52136
52221
|
}
|
|
52137
52222
|
}
|
|
52138
52223
|
_clearColRangeWidthsMap(col) {
|
|
@@ -52540,16 +52625,16 @@
|
|
|
52540
52625
|
return count;
|
|
52541
52626
|
}
|
|
52542
52627
|
get scrollTop() {
|
|
52543
|
-
return this.
|
|
52628
|
+
return this.stateManager.scroll.verticalBarPos;
|
|
52544
52629
|
}
|
|
52545
52630
|
set scrollTop(scrollTop) {
|
|
52546
|
-
this.
|
|
52631
|
+
this.stateManager.setScrollTop(scrollTop);
|
|
52547
52632
|
}
|
|
52548
52633
|
get scrollLeft() {
|
|
52549
|
-
return this.
|
|
52634
|
+
return this.stateManager.scroll.horizontalBarPos;
|
|
52550
52635
|
}
|
|
52551
52636
|
set scrollLeft(scrollLeft) {
|
|
52552
|
-
this.
|
|
52637
|
+
this.stateManager.setScrollLeft(scrollLeft);
|
|
52553
52638
|
}
|
|
52554
52639
|
getScrollLeft() {
|
|
52555
52640
|
return this.scrollLeft;
|
|
@@ -52654,6 +52739,7 @@
|
|
|
52654
52739
|
this.colContentWidthsMap = new NumberMap();
|
|
52655
52740
|
this.colWidthsLimit = {};
|
|
52656
52741
|
internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
|
|
52742
|
+
this.scenegraph.updateStageBackground();
|
|
52657
52743
|
internalProps.autoWrapText = options.autoWrapText;
|
|
52658
52744
|
internalProps.allowFrozenColCount = options.allowFrozenColCount ?? internalProps.colCount;
|
|
52659
52745
|
internalProps.limitMaxAutoWidth = options.limitMaxAutoWidth ?? 450;
|
|
@@ -52670,7 +52756,7 @@
|
|
|
52670
52756
|
internalProps.title?.release();
|
|
52671
52757
|
internalProps.layoutMap.release();
|
|
52672
52758
|
this.scenegraph.clearCells();
|
|
52673
|
-
this.
|
|
52759
|
+
this.stateManager.initState();
|
|
52674
52760
|
this._updateSize();
|
|
52675
52761
|
if (options.legends) {
|
|
52676
52762
|
internalProps.legends = createLegend(options.legends, this);
|
|
@@ -52699,11 +52785,13 @@
|
|
|
52699
52785
|
this.clearRowHeightCache();
|
|
52700
52786
|
}
|
|
52701
52787
|
renderWithRecreateCells() {
|
|
52788
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
52702
52789
|
this.refreshHeader();
|
|
52703
52790
|
this.scenegraph.clearCells();
|
|
52704
52791
|
this.headerStyleCache = new Map();
|
|
52705
52792
|
this.bodyStyleCache = new Map();
|
|
52706
52793
|
this.scenegraph.createSceneGraph();
|
|
52794
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
52707
52795
|
this.render();
|
|
52708
52796
|
}
|
|
52709
52797
|
getFrozenRowsHeight() {
|
|
@@ -52901,20 +52989,25 @@
|
|
|
52901
52989
|
return Math.min(Math.ceil(absoluteX / this.internalProps.defaultColWidth), this.colCount - 1);
|
|
52902
52990
|
}
|
|
52903
52991
|
clearSelected() {
|
|
52904
|
-
this.
|
|
52992
|
+
this.stateManager.updateSelectPos(-1, -1);
|
|
52905
52993
|
}
|
|
52906
52994
|
selectCell(col, row) {
|
|
52907
|
-
this.
|
|
52908
|
-
this.
|
|
52995
|
+
this.stateManager.updateSelectPos(col, row);
|
|
52996
|
+
this.stateManager.endSelectCells();
|
|
52909
52997
|
}
|
|
52910
52998
|
selectCells(cellRanges) {
|
|
52911
52999
|
const { scrollLeft, scrollTop } = this;
|
|
52912
53000
|
cellRanges.forEach((cellRange, index) => {
|
|
52913
|
-
|
|
52914
|
-
|
|
52915
|
-
|
|
52916
|
-
|
|
52917
|
-
|
|
53001
|
+
if (cellRange.start.col === cellRange.end.col && cellRange.start.row === cellRange.end.row) {
|
|
53002
|
+
this.stateManager.updateSelectPos(cellRange.start.col, cellRange.start.row, false, index >= 1);
|
|
53003
|
+
}
|
|
53004
|
+
else {
|
|
53005
|
+
this.stateManager.updateSelectPos(cellRange.start.col, cellRange.start.row, false, index >= 1);
|
|
53006
|
+
this.stateManager.updateInteractionState(InteractionState.grabing);
|
|
53007
|
+
this.stateManager.updateSelectPos(cellRange.end.col, cellRange.end.row, false, index >= 1);
|
|
53008
|
+
}
|
|
53009
|
+
this.stateManager.endSelectCells(false);
|
|
53010
|
+
this.stateManager.updateInteractionState(InteractionState.default);
|
|
52918
53011
|
});
|
|
52919
53012
|
this.setScrollTop(scrollTop);
|
|
52920
53013
|
this.setScrollLeft(scrollLeft);
|
|
@@ -52968,12 +53061,15 @@
|
|
|
52968
53061
|
this.options.theme = theme;
|
|
52969
53062
|
}
|
|
52970
53063
|
updateTheme(theme) {
|
|
53064
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
52971
53065
|
this.internalProps.theme = themes.of(theme ?? themes.DEFAULT);
|
|
52972
53066
|
this.options.theme = theme;
|
|
53067
|
+
this.scenegraph.updateStageBackground();
|
|
52973
53068
|
this.scenegraph.clearCells();
|
|
52974
53069
|
this.headerStyleCache = new Map();
|
|
52975
53070
|
this.bodyStyleCache = new Map();
|
|
52976
53071
|
this.scenegraph.createSceneGraph();
|
|
53072
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
52977
53073
|
this.render();
|
|
52978
53074
|
}
|
|
52979
53075
|
getBodyField(col, row) {
|
|
@@ -53108,10 +53204,10 @@
|
|
|
53108
53204
|
return description;
|
|
53109
53205
|
}
|
|
53110
53206
|
setDropDownMenuHighlight(cells) {
|
|
53111
|
-
this.
|
|
53207
|
+
this.stateManager.setDropDownMenuHighlight(cells);
|
|
53112
53208
|
}
|
|
53113
53209
|
_dropDownMenuIsHighlight(colNow, rowNow, index) {
|
|
53114
|
-
return this.
|
|
53210
|
+
return this.stateManager.dropDownMenuIsHighlight(colNow, rowNow, index);
|
|
53115
53211
|
}
|
|
53116
53212
|
isHeader(col, row) {
|
|
53117
53213
|
return this.internalProps.layoutMap && this.internalProps.layoutMap.isHeader(col, row);
|
|
@@ -53292,8 +53388,8 @@
|
|
|
53292
53388
|
return limit.max !== limit.min;
|
|
53293
53389
|
}
|
|
53294
53390
|
_canDragHeaderPosition(col, row) {
|
|
53295
|
-
if (this.isHeader(col, row) && this.
|
|
53296
|
-
const selectRange = this.
|
|
53391
|
+
if (this.isHeader(col, row) && this.stateManager.isSelected(col, row)) {
|
|
53392
|
+
const selectRange = this.stateManager.select.ranges[0];
|
|
53297
53393
|
if (this.isColumnHeader(col, row)) {
|
|
53298
53394
|
if (selectRange.end.row !== this.rowCount - 1) {
|
|
53299
53395
|
return false;
|
|
@@ -53347,7 +53443,7 @@
|
|
|
53347
53443
|
menuType = Array.isArray(dropDownMenuOptions.content) ? 'dropdown-menu' : 'container';
|
|
53348
53444
|
}
|
|
53349
53445
|
if (this.internalProps.menu.renderMode === 'html') {
|
|
53350
|
-
this.
|
|
53446
|
+
this.stateManager.menu.isShow = true;
|
|
53351
53447
|
this.internalProps.menuHandler._bindToCell(col, row, menuType, dropDownMenuOptions);
|
|
53352
53448
|
}
|
|
53353
53449
|
}
|
|
@@ -53439,8 +53535,8 @@
|
|
|
53439
53535
|
this.render();
|
|
53440
53536
|
}
|
|
53441
53537
|
getCopyValue() {
|
|
53442
|
-
if (this.
|
|
53443
|
-
const ranges = this.
|
|
53538
|
+
if (this.stateManager.select?.ranges?.length > 0) {
|
|
53539
|
+
const ranges = this.stateManager.select.ranges;
|
|
53444
53540
|
let minCol = Math.min(ranges[0].start.col, ranges[0].end.col);
|
|
53445
53541
|
let maxCol = Math.max(ranges[0].start.col, ranges[0].end.col);
|
|
53446
53542
|
let minRow = Math.min(ranges[0].start.row, ranges[0].end.row);
|
|
@@ -53537,10 +53633,10 @@
|
|
|
53537
53633
|
return '';
|
|
53538
53634
|
}
|
|
53539
53635
|
getSelectedCellInfos() {
|
|
53540
|
-
if (!this.
|
|
53636
|
+
if (!this.stateManager.select?.ranges) {
|
|
53541
53637
|
return null;
|
|
53542
53638
|
}
|
|
53543
|
-
const ranges = this.
|
|
53639
|
+
const ranges = this.stateManager.select.ranges;
|
|
53544
53640
|
if (!ranges.length) {
|
|
53545
53641
|
return [];
|
|
53546
53642
|
}
|
|
@@ -53646,7 +53742,7 @@
|
|
|
53646
53742
|
});
|
|
53647
53743
|
}
|
|
53648
53744
|
_getActiveChartInstance() {
|
|
53649
|
-
const cellGroup = this.scenegraph.getCell(this.
|
|
53745
|
+
const cellGroup = this.scenegraph.getCell(this.stateManager.hover?.cellPos?.col, this.stateManager.hover?.cellPos?.row);
|
|
53650
53746
|
return cellGroup?.getChildren()?.[0]?.type === 'chart'
|
|
53651
53747
|
? cellGroup.getChildren()[0].activeChartInstance
|
|
53652
53748
|
: null;
|
|
@@ -53665,6 +53761,16 @@
|
|
|
53665
53761
|
}
|
|
53666
53762
|
return false;
|
|
53667
53763
|
}
|
|
53764
|
+
getCustomMergeValue(col, row) {
|
|
53765
|
+
if (this.internalProps.customMergeCell) {
|
|
53766
|
+
const customMerge = this.getCustomMerge(col, row);
|
|
53767
|
+
if (customMerge) {
|
|
53768
|
+
const { text } = customMerge;
|
|
53769
|
+
return text;
|
|
53770
|
+
}
|
|
53771
|
+
}
|
|
53772
|
+
return undefined;
|
|
53773
|
+
}
|
|
53668
53774
|
exportImg() {
|
|
53669
53775
|
const c = this.scenegraph.stage.toCanvas();
|
|
53670
53776
|
return c.toDataURL();
|
|
@@ -53945,7 +54051,6 @@
|
|
|
53945
54051
|
title: { visible: false },
|
|
53946
54052
|
domainLine: { visible: false },
|
|
53947
54053
|
seriesIndex: index,
|
|
53948
|
-
height: -1,
|
|
53949
54054
|
sync: { axisId: NO_AXISID_FRO_VTABLE }
|
|
53950
54055
|
}));
|
|
53951
54056
|
});
|
|
@@ -53968,8 +54073,7 @@
|
|
|
53968
54073
|
domainLine: { visible: false },
|
|
53969
54074
|
tick: { visible: false },
|
|
53970
54075
|
subTick: { visible: false },
|
|
53971
|
-
title: { visible: false }
|
|
53972
|
-
width: -1
|
|
54076
|
+
title: { visible: false }
|
|
53973
54077
|
}));
|
|
53974
54078
|
}
|
|
53975
54079
|
else {
|
|
@@ -54003,7 +54107,6 @@
|
|
|
54003
54107
|
title: { visible: false },
|
|
54004
54108
|
domainLine: { visible: false },
|
|
54005
54109
|
seriesIndex: index,
|
|
54006
|
-
width: -1,
|
|
54007
54110
|
sync: { axisId: NO_AXISID_FRO_VTABLE }
|
|
54008
54111
|
}));
|
|
54009
54112
|
});
|
|
@@ -54027,8 +54130,7 @@
|
|
|
54027
54130
|
domainLine: { visible: false },
|
|
54028
54131
|
tick: { visible: false },
|
|
54029
54132
|
subTick: { visible: false },
|
|
54030
|
-
title: { visible: false }
|
|
54031
|
-
height: -1
|
|
54133
|
+
title: { visible: false }
|
|
54032
54134
|
}));
|
|
54033
54135
|
}
|
|
54034
54136
|
return axes;
|
|
@@ -55087,7 +55189,9 @@
|
|
|
55087
55189
|
: [];
|
|
55088
55190
|
this.showHeader = options.showHeader ?? true;
|
|
55089
55191
|
this.transpose = options.transpose ?? false;
|
|
55090
|
-
|
|
55192
|
+
if (Env.mode !== 'node') {
|
|
55193
|
+
this.editorManager = new EditManeger(this);
|
|
55194
|
+
}
|
|
55091
55195
|
this.refreshHeader();
|
|
55092
55196
|
if (options.dataSource) {
|
|
55093
55197
|
_setDataSource(this, options.dataSource);
|
|
@@ -55119,6 +55223,7 @@
|
|
|
55119
55223
|
return this.internalProps.sortState;
|
|
55120
55224
|
}
|
|
55121
55225
|
updateColumns(columns) {
|
|
55226
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
55122
55227
|
this.internalProps.columns = cloneDeep$1(columns);
|
|
55123
55228
|
this.options.columns = columns;
|
|
55124
55229
|
this.refreshHeader();
|
|
@@ -55126,6 +55231,7 @@
|
|
|
55126
55231
|
this.headerStyleCache = new Map();
|
|
55127
55232
|
this.bodyStyleCache = new Map();
|
|
55128
55233
|
this.scenegraph.createSceneGraph();
|
|
55234
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
55129
55235
|
this.renderAsync();
|
|
55130
55236
|
}
|
|
55131
55237
|
get header() {
|
|
@@ -55157,6 +55263,10 @@
|
|
|
55157
55263
|
if (col === -1 || row === -1) {
|
|
55158
55264
|
return null;
|
|
55159
55265
|
}
|
|
55266
|
+
const customMergeText = this.getCustomMergeValue(col, row);
|
|
55267
|
+
if (customMergeText) {
|
|
55268
|
+
return customMergeText;
|
|
55269
|
+
}
|
|
55160
55270
|
const table = this;
|
|
55161
55271
|
if (table.internalProps.layoutMap.isHeader(col, row)) {
|
|
55162
55272
|
const { title } = table.internalProps.layoutMap.getHeader(col, row);
|
|
@@ -55301,7 +55411,7 @@
|
|
|
55301
55411
|
for (let col = 0; col < layoutMap.columnWidths.length; col++) {
|
|
55302
55412
|
const { width, minWidth, maxWidth } = layoutMap.columnWidths?.[col] ?? {};
|
|
55303
55413
|
if (width && ((typeof width === 'string' && width !== 'auto') || (typeof width === 'number' && width > 0))) {
|
|
55304
|
-
table.
|
|
55414
|
+
table._setColWidth(col, width);
|
|
55305
55415
|
}
|
|
55306
55416
|
if (minWidth && ((typeof minWidth === 'number' && minWidth > 0) || typeof minWidth === 'string')) {
|
|
55307
55417
|
table.setMinColWidth(col, minWidth);
|
|
@@ -55337,7 +55447,7 @@
|
|
|
55337
55447
|
table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
|
|
55338
55448
|
table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
|
|
55339
55449
|
}
|
|
55340
|
-
this.
|
|
55450
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
55341
55451
|
}
|
|
55342
55452
|
getFieldData(field, col, row) {
|
|
55343
55453
|
if (field === null) {
|
|
@@ -55567,25 +55677,36 @@
|
|
|
55567
55677
|
this.scenegraph.sortCell();
|
|
55568
55678
|
}
|
|
55569
55679
|
}
|
|
55570
|
-
this.
|
|
55680
|
+
this.stateManager.updateSortState(sortState);
|
|
55571
55681
|
}
|
|
55572
55682
|
getCheckboxState(field) {
|
|
55573
|
-
if (this.
|
|
55574
|
-
this.
|
|
55683
|
+
if (this.stateManager.checkedState.length < this.rowCount - this.columnHeaderLevelCount) {
|
|
55684
|
+
this.stateManager.initLeftRecordsCheckState(this.records);
|
|
55575
55685
|
}
|
|
55576
55686
|
if (isValid$6(field)) {
|
|
55577
|
-
return this.
|
|
55687
|
+
return this.stateManager.checkedState.map(state => {
|
|
55578
55688
|
return state[field];
|
|
55579
55689
|
});
|
|
55580
55690
|
}
|
|
55581
|
-
return this.
|
|
55691
|
+
return this.stateManager.checkedState;
|
|
55692
|
+
}
|
|
55693
|
+
getCellCheckboxState(col, row) {
|
|
55694
|
+
const define = this.getBodyColumnDefine(col, row);
|
|
55695
|
+
const field = define?.field;
|
|
55696
|
+
const cellType = define?.cellType;
|
|
55697
|
+
if (isValid$6(field) && cellType === 'checkbox') {
|
|
55698
|
+
const dataIndex = this.dataSource.getIndexKey(this.getRecordIndexByCell(col, row));
|
|
55699
|
+
return this.stateManager.checkedState[dataIndex][field];
|
|
55700
|
+
}
|
|
55701
|
+
return undefined;
|
|
55582
55702
|
}
|
|
55583
55703
|
setRecords(records, sort) {
|
|
55584
55704
|
typeof window !== 'undefined' ? window.performance.now() : 0;
|
|
55705
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
55585
55706
|
this.scenegraph.clearCells();
|
|
55586
55707
|
if (sort !== undefined) {
|
|
55587
55708
|
this.internalProps.sortState = sort;
|
|
55588
|
-
this.
|
|
55709
|
+
this.stateManager.setSortState(this.sortState);
|
|
55589
55710
|
}
|
|
55590
55711
|
if (records) {
|
|
55591
55712
|
_setRecords(this, records);
|
|
@@ -55610,7 +55731,7 @@
|
|
|
55610
55731
|
else {
|
|
55611
55732
|
hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
|
|
55612
55733
|
}
|
|
55613
|
-
|
|
55734
|
+
this.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
|
|
55614
55735
|
}
|
|
55615
55736
|
}
|
|
55616
55737
|
this.refreshRowColCount();
|
|
@@ -55618,8 +55739,9 @@
|
|
|
55618
55739
|
else {
|
|
55619
55740
|
_setRecords(this, records);
|
|
55620
55741
|
}
|
|
55621
|
-
this.
|
|
55742
|
+
this.stateManager.initCheckedState(records);
|
|
55622
55743
|
this.scenegraph.createSceneGraph();
|
|
55744
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
55623
55745
|
if (this.internalProps.title && !this.internalProps.title.isReleased) {
|
|
55624
55746
|
this._updateSize();
|
|
55625
55747
|
this.internalProps.title.resize();
|
|
@@ -55635,8 +55757,8 @@
|
|
|
55635
55757
|
if (isValid$6(col) && isValid$6(row)) {
|
|
55636
55758
|
this.editorManager.startEditCell(col, row);
|
|
55637
55759
|
}
|
|
55638
|
-
else if (this.
|
|
55639
|
-
const { col, row } = this.
|
|
55760
|
+
else if (this.stateManager.select?.cellPos) {
|
|
55761
|
+
const { col, row } = this.stateManager.select.cellPos;
|
|
55640
55762
|
if (isValid$6(col) && isValid$6(row)) {
|
|
55641
55763
|
this.editorManager.startEditCell(col, row);
|
|
55642
55764
|
}
|
|
@@ -56829,16 +56951,19 @@
|
|
|
56829
56951
|
}
|
|
56830
56952
|
return 0;
|
|
56831
56953
|
}
|
|
56832
|
-
|
|
56833
|
-
|
|
56834
|
-
|
|
56835
|
-
|
|
56836
|
-
|
|
56837
|
-
|
|
56838
|
-
|
|
56954
|
+
if (this.indicatorKeys.length >= 1) {
|
|
56955
|
+
const axisOption = this._table.pivotChartAxes.find(axisOption => {
|
|
56956
|
+
return axisOption.orient === 'bottom';
|
|
56957
|
+
});
|
|
56958
|
+
if (axisOption?.visible === false) {
|
|
56959
|
+
return 0;
|
|
56960
|
+
}
|
|
56961
|
+
if (this.indicatorsAsCol) {
|
|
56962
|
+
return 1;
|
|
56963
|
+
}
|
|
56839
56964
|
return 1;
|
|
56840
56965
|
}
|
|
56841
|
-
return
|
|
56966
|
+
return 0;
|
|
56842
56967
|
}
|
|
56843
56968
|
get rightFrozenColCount() {
|
|
56844
56969
|
if (!this._table.isPivotChart()) {
|
|
@@ -56944,7 +57069,7 @@
|
|
|
56944
57069
|
id: '',
|
|
56945
57070
|
field: undefined,
|
|
56946
57071
|
indicatorKey: undefined,
|
|
56947
|
-
cellType:
|
|
57072
|
+
cellType: 'text',
|
|
56948
57073
|
define: undefined
|
|
56949
57074
|
});
|
|
56950
57075
|
}
|
|
@@ -56954,7 +57079,7 @@
|
|
|
56954
57079
|
id: '',
|
|
56955
57080
|
field: undefined,
|
|
56956
57081
|
indicatorKey: undefined,
|
|
56957
|
-
cellType:
|
|
57082
|
+
cellType: 'text',
|
|
56958
57083
|
define: undefined
|
|
56959
57084
|
});
|
|
56960
57085
|
}
|
|
@@ -57678,14 +57803,16 @@
|
|
|
57678
57803
|
if (!this._table.isPivotChart()) {
|
|
57679
57804
|
return false;
|
|
57680
57805
|
}
|
|
57681
|
-
if (this.
|
|
57682
|
-
|
|
57683
|
-
|
|
57684
|
-
|
|
57685
|
-
|
|
57686
|
-
|
|
57687
|
-
|
|
57688
|
-
|
|
57806
|
+
if (this.indicatorKeys.length >= 1) {
|
|
57807
|
+
if (this.isBottomFrozenRow(col, row) || this.isRightFrozenColumn(col, row)) {
|
|
57808
|
+
return true;
|
|
57809
|
+
}
|
|
57810
|
+
if (this.isRowHeader(col, row) && col === this.rowHeaderLevelCount - 1) {
|
|
57811
|
+
return true;
|
|
57812
|
+
}
|
|
57813
|
+
if (this.hasTwoIndicatorAxes && this.indicatorsAsCol && row === this.columnHeaderLevelCount - 1) {
|
|
57814
|
+
return true;
|
|
57815
|
+
}
|
|
57689
57816
|
}
|
|
57690
57817
|
return false;
|
|
57691
57818
|
}
|
|
@@ -58049,7 +58176,7 @@
|
|
|
58049
58176
|
}
|
|
58050
58177
|
const space = bandSpace(count, paddingInner, paddingOuter);
|
|
58051
58178
|
const step = bandwidth / (1 - paddingInner);
|
|
58052
|
-
const wholeSize = space * step;
|
|
58179
|
+
const wholeSize = Math.ceil(space * step);
|
|
58053
58180
|
return wholeSize;
|
|
58054
58181
|
}
|
|
58055
58182
|
function bandSpace(count, paddingInner, paddingOuter) {
|
|
@@ -59588,12 +59715,15 @@
|
|
|
59588
59715
|
this.updatePivotSortState(options.pivotSortState);
|
|
59589
59716
|
}
|
|
59590
59717
|
this.refreshHeader();
|
|
59591
|
-
this.
|
|
59718
|
+
this.stateManager.initCheckedState(records);
|
|
59592
59719
|
this.scenegraph.createSceneGraph();
|
|
59593
59720
|
if (options.title) {
|
|
59594
59721
|
this.internalProps.title = new Title(options.title, this);
|
|
59595
59722
|
this.scenegraph.resize();
|
|
59596
59723
|
}
|
|
59724
|
+
setTimeout(() => {
|
|
59725
|
+
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
59726
|
+
}, 0);
|
|
59597
59727
|
}
|
|
59598
59728
|
static get EVENT_TYPE() {
|
|
59599
59729
|
return PIVOT_TABLE_EVENT_TYPE;
|
|
@@ -59630,7 +59760,7 @@
|
|
|
59630
59760
|
this.internalProps.rowTree =
|
|
59631
59761
|
!options.indicatorsAsCol && !options.rows?.length && !options.rowTree ? [] : cloneDeep$1(options.rowTree);
|
|
59632
59762
|
options.records && (this.internalProps.records = options.records);
|
|
59633
|
-
this.
|
|
59763
|
+
this.stateManager.initCheckedState(this.internalProps.records);
|
|
59634
59764
|
this.pagination = options.pagination;
|
|
59635
59765
|
internalProps.columnResizeType = options.columnResizeType ?? 'column';
|
|
59636
59766
|
internalProps.dataConfig = cloneDeep$1(options.dataConfig);
|
|
@@ -59742,7 +59872,7 @@
|
|
|
59742
59872
|
for (let col = 0; col < internalProps.layoutMap.columnWidths.length; col++) {
|
|
59743
59873
|
const { width, minWidth, maxWidth } = internalProps.layoutMap.columnWidths?.[col] ?? {};
|
|
59744
59874
|
if (width && ((typeof width === 'string' && width !== 'auto') || (typeof width === 'number' && width > 0))) {
|
|
59745
|
-
this.
|
|
59875
|
+
this._setColWidth(col, width);
|
|
59746
59876
|
}
|
|
59747
59877
|
if (minWidth && ((typeof minWidth === 'number' && minWidth > 0) || typeof minWidth === 'string')) {
|
|
59748
59878
|
this.setMinColWidth(col, minWidth);
|
|
@@ -59765,7 +59895,7 @@
|
|
|
59765
59895
|
table.frozenRowCount = layoutMap.headerLevelCount;
|
|
59766
59896
|
table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
|
|
59767
59897
|
table.rightFrozenColCount = this.options.rightFrozenColCount ?? 0;
|
|
59768
|
-
this.
|
|
59898
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
59769
59899
|
}
|
|
59770
59900
|
_getSortFuncFromHeaderOption(columns, field, fieldKey) {
|
|
59771
59901
|
return undefined;
|
|
@@ -59825,6 +59955,10 @@
|
|
|
59825
59955
|
return dataValue;
|
|
59826
59956
|
}
|
|
59827
59957
|
getCellValue(col, row) {
|
|
59958
|
+
const customMergeText = this.getCustomMergeValue(col, row);
|
|
59959
|
+
if (customMergeText) {
|
|
59960
|
+
return customMergeText;
|
|
59961
|
+
}
|
|
59828
59962
|
if (this.internalProps.layoutMap.isHeader(col, row)) {
|
|
59829
59963
|
const { title, fieldFormat } = this.internalProps.layoutMap.getHeader(col, row);
|
|
59830
59964
|
return typeof fieldFormat === 'function' ? fieldFormat(title) : title;
|
|
@@ -60064,6 +60198,7 @@
|
|
|
60064
60198
|
return result;
|
|
60065
60199
|
}
|
|
60066
60200
|
setRecords(records) {
|
|
60201
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
60067
60202
|
this.options.records = this.internalProps.records = records;
|
|
60068
60203
|
const options = this.options;
|
|
60069
60204
|
const internalProps = this.internalProps;
|
|
@@ -60089,6 +60224,7 @@
|
|
|
60089
60224
|
this.refreshHeader();
|
|
60090
60225
|
this.scenegraph.clearCells();
|
|
60091
60226
|
this.scenegraph.createSceneGraph();
|
|
60227
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
60092
60228
|
if (this.internalProps.title && !this.internalProps.title.isReleased) {
|
|
60093
60229
|
this._updateSize();
|
|
60094
60230
|
this.internalProps.title.resize();
|
|
@@ -60172,6 +60308,9 @@
|
|
|
60172
60308
|
this.internalProps.title = new Title(options.title, this);
|
|
60173
60309
|
this.scenegraph.resize();
|
|
60174
60310
|
}
|
|
60311
|
+
setTimeout(() => {
|
|
60312
|
+
this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
|
|
60313
|
+
}, 0);
|
|
60175
60314
|
}
|
|
60176
60315
|
static get EVENT_TYPE() {
|
|
60177
60316
|
return PIVOT_CHART_EVENT_TYPE;
|
|
@@ -60270,7 +60409,7 @@
|
|
|
60270
60409
|
for (let col = 0; col < internalProps.layoutMap.columnWidths.length; col++) {
|
|
60271
60410
|
const { width, minWidth, maxWidth } = internalProps.layoutMap.columnWidths?.[col] ?? {};
|
|
60272
60411
|
if (width && ((typeof width === 'string' && width !== 'auto') || (typeof width === 'number' && width > 0))) {
|
|
60273
|
-
this.
|
|
60412
|
+
this._setColWidth(col, width);
|
|
60274
60413
|
}
|
|
60275
60414
|
if (minWidth && ((typeof minWidth === 'number' && minWidth > 0) || typeof minWidth === 'string')) {
|
|
60276
60415
|
this.setMinColWidth(col, minWidth);
|
|
@@ -60293,7 +60432,7 @@
|
|
|
60293
60432
|
table.frozenRowCount = layoutMap.headerLevelCount;
|
|
60294
60433
|
table.bottomFrozenRowCount = layoutMap?.bottomFrozenRowCount ?? 0;
|
|
60295
60434
|
table.rightFrozenColCount = layoutMap?.rightFrozenColCount ?? 0;
|
|
60296
|
-
this.
|
|
60435
|
+
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
|
|
60297
60436
|
}
|
|
60298
60437
|
_getSortFuncFromHeaderOption(columns, field, fieldKey) {
|
|
60299
60438
|
return undefined;
|
|
@@ -60347,6 +60486,10 @@
|
|
|
60347
60486
|
return dataValue;
|
|
60348
60487
|
}
|
|
60349
60488
|
getCellValue(col, row) {
|
|
60489
|
+
const customMergeText = this.getCustomMergeValue(col, row);
|
|
60490
|
+
if (customMergeText) {
|
|
60491
|
+
return customMergeText;
|
|
60492
|
+
}
|
|
60350
60493
|
if (this.internalProps.layoutMap.isHeader(col, row)) {
|
|
60351
60494
|
const { title, fieldFormat } = this.internalProps.layoutMap.getHeader(col, row);
|
|
60352
60495
|
return typeof fieldFormat === 'function' ? fieldFormat(title) : title;
|
|
@@ -60819,16 +60962,10 @@
|
|
|
60819
60962
|
const viewBox = chartNode.getViewBox();
|
|
60820
60963
|
axes.forEach((axis, index) => {
|
|
60821
60964
|
if (axis.type === 'linear') {
|
|
60822
|
-
|
|
60823
|
-
chartAxis._domain = {
|
|
60824
|
-
min: axis.range?.min ?? 0,
|
|
60825
|
-
max: axis.range?.max ?? 0
|
|
60826
|
-
};
|
|
60965
|
+
chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
|
|
60827
60966
|
}
|
|
60828
60967
|
else if (axis.type === 'band') {
|
|
60829
|
-
|
|
60830
|
-
chartAxis._spec.domain = axis.domain.slice(0);
|
|
60831
|
-
chartAxis.updateScaleDomain();
|
|
60968
|
+
chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
|
|
60832
60969
|
}
|
|
60833
60970
|
});
|
|
60834
60971
|
chartInstance.updateViewBox({
|
|
@@ -60889,6 +61026,7 @@
|
|
|
60889
61026
|
return undefined;
|
|
60890
61027
|
}
|
|
60891
61028
|
setRecords(records) {
|
|
61029
|
+
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
60892
61030
|
this.options.records = this.internalProps.records = records;
|
|
60893
61031
|
this.options;
|
|
60894
61032
|
const internalProps = this.internalProps;
|
|
@@ -60897,6 +61035,7 @@
|
|
|
60897
61035
|
this.refreshHeader();
|
|
60898
61036
|
this.scenegraph.clearCells();
|
|
60899
61037
|
this.scenegraph.createSceneGraph();
|
|
61038
|
+
this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
|
|
60900
61039
|
if (this.internalProps.title && !this.internalProps.title.isReleased) {
|
|
60901
61040
|
this._updateSize();
|
|
60902
61041
|
this.internalProps.title.resize();
|
|
@@ -61411,7 +61550,7 @@
|
|
|
61411
61550
|
return new Tag$1(params ? params.attribute : {});
|
|
61412
61551
|
}
|
|
61413
61552
|
|
|
61414
|
-
const version = "0.15.
|
|
61553
|
+
const version = "0.15.1";
|
|
61415
61554
|
function getIcons() {
|
|
61416
61555
|
return get$2();
|
|
61417
61556
|
}
|