@visactor/vtable 0.23.0-alpha.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ListTable.d.ts +3 -3
- package/cjs/ListTable.js +45 -34
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotTable.d.ts +1 -1
- package/cjs/PivotTable.js +19 -17
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/style/Style.d.ts +3 -0
- package/cjs/body-helper/style/Style.js +22 -15
- package/cjs/body-helper/style/Style.js.map +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js +1 -1
- package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -1
- package/cjs/core/BaseTable.js +27 -17
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js +2 -0
- package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/cjs/core/tableHelper.js +1 -2
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/data/CachedDataSource.d.ts +1 -0
- package/cjs/data/CachedDataSource.js +10 -6
- package/cjs/data/CachedDataSource.js.map +1 -1
- package/cjs/data/DataSource.d.ts +10 -3
- package/cjs/data/DataSource.js +159 -95
- package/cjs/data/DataSource.js.map +1 -1
- package/cjs/edit/edit-manager.js +10 -9
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/event.js +11 -5
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/table-group.js +2 -2
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/event/media-click.js +2 -1
- package/cjs/event/sparkline-event.js +1 -2
- package/cjs/header-helper/style/Style.d.ts +3 -0
- package/cjs/header-helper/style/Style.js +26 -19
- package/cjs/header-helper/style/Style.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/pivot-header-layout.js +4 -2
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +3 -2
- package/cjs/layout/simple-header-layout.js +40 -25
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/scenegraph/component/table-component.js +13 -8
- package/cjs/scenegraph/component/table-component.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +10 -6
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +3 -1
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +3 -2
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +20 -6
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
- package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/cjs/scenegraph/layout/compute-col-width.js +12 -8
- package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
- package/cjs/scenegraph/layout/compute-row-height.js +72 -71
- package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
- package/cjs/scenegraph/layout/frozen.js +2 -2
- package/cjs/scenegraph/layout/frozen.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +18 -11
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +19 -13
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +3 -3
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/utils/cell-border-stroke-width.js +15 -10
- package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +4 -4
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/scenegraph/utils/text-measure.js +6 -6
- package/cjs/scenegraph/utils/text-measure.js.map +1 -1
- package/cjs/state/cell-move/index.js +1 -1
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/resize/update-resize-column.js +1 -1
- package/cjs/state/resize/update-resize-column.js.map +1 -1
- package/cjs/state/select/update-position.js +39 -8
- package/cjs/state/select/update-position.js.map +1 -1
- package/cjs/state/state.d.ts +6 -0
- package/cjs/state/state.js +49 -17
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +11 -3
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/util.d.ts +0 -1
- package/cjs/tools/util.js +3 -13
- package/cjs/tools/util.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +3 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/events.d.ts +18 -0
- package/cjs/ts-types/events.js.map +1 -1
- package/cjs/ts-types/list-table/define/progressbar-define.d.ts +2 -2
- package/cjs/ts-types/list-table/define/progressbar-define.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +4 -4
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +1 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +935 -466
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +3 -3
- package/es/ListTable.js +46 -35
- package/es/ListTable.js.map +1 -1
- package/es/PivotTable.d.ts +1 -1
- package/es/PivotTable.js +19 -17
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/style/Style.d.ts +3 -0
- package/es/body-helper/style/Style.js +22 -15
- package/es/body-helper/style/Style.js.map +1 -1
- package/es/components/legend/continue-legend/continue-legend.js +1 -1
- package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -1
- package/es/core/BaseTable.js +27 -17
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
- package/es/core/TABLE_EVENT_TYPE.js +2 -0
- package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
- package/es/core/tableHelper.js +1 -2
- package/es/core/tableHelper.js.map +1 -1
- package/es/data/CachedDataSource.d.ts +1 -0
- package/es/data/CachedDataSource.js +9 -7
- package/es/data/CachedDataSource.js.map +1 -1
- package/es/data/DataSource.d.ts +10 -3
- package/es/data/DataSource.js +159 -95
- package/es/data/DataSource.js.map +1 -1
- package/es/edit/edit-manager.js +10 -9
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/event.js +11 -5
- package/es/event/event.js.map +1 -1
- package/es/event/listener/table-group.js +2 -2
- package/es/event/listener/table-group.js.map +1 -1
- package/es/event/media-click.js +2 -1
- package/es/event/sparkline-event.js +1 -2
- package/es/header-helper/style/Style.d.ts +3 -0
- package/es/header-helper/style/Style.js +26 -19
- package/es/header-helper/style/Style.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/pivot-header-layout.js +4 -2
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +3 -2
- package/es/layout/simple-header-layout.js +40 -25
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/scenegraph/component/table-component.js +13 -8
- package/es/scenegraph/component/table-component.js.map +1 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js +10 -6
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +2 -1
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +3 -2
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +21 -5
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
- package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
- package/es/scenegraph/layout/compute-col-width.js +11 -8
- package/es/scenegraph/layout/compute-col-width.js.map +1 -1
- package/es/scenegraph/layout/compute-row-height.js +71 -70
- package/es/scenegraph/layout/compute-row-height.js.map +1 -1
- package/es/scenegraph/layout/frozen.js +2 -2
- package/es/scenegraph/layout/frozen.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +16 -9
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +19 -10
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +3 -3
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/utils/cell-border-stroke-width.js +10 -7
- package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +4 -4
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/scenegraph/utils/text-measure.js +6 -6
- package/es/scenegraph/utils/text-measure.js.map +1 -1
- package/es/state/cell-move/index.js +1 -1
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/resize/update-resize-column.js +1 -1
- package/es/state/resize/update-resize-column.js.map +1 -1
- package/es/state/select/update-position.js +39 -8
- package/es/state/select/update-position.js.map +1 -1
- package/es/state/state.d.ts +6 -0
- package/es/state/state.js +49 -17
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +8 -2
- package/es/themes/theme.js.map +1 -1
- package/es/tools/util.d.ts +0 -1
- package/es/tools/util.js +0 -10
- package/es/tools/util.js.map +1 -1
- package/es/ts-types/base-table.d.ts +3 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/events.d.ts +18 -0
- package/es/ts-types/events.js.map +1 -1
- package/es/ts-types/list-table/define/progressbar-define.d.ts +2 -2
- package/es/ts-types/list-table/define/progressbar-define.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +4 -4
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +1 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.js
CHANGED
|
@@ -21687,6 +21687,7 @@
|
|
|
21687
21687
|
_padding;
|
|
21688
21688
|
_defaultPadding = [10, 16, 10, 16];
|
|
21689
21689
|
_textStick;
|
|
21690
|
+
_textStickBaseOnAlign;
|
|
21690
21691
|
_textOverflow;
|
|
21691
21692
|
_textAlign;
|
|
21692
21693
|
_textBaseline;
|
|
@@ -21725,6 +21726,7 @@
|
|
|
21725
21726
|
this._borderColor = style?.borderColor ?? bodyStyle?.borderColor;
|
|
21726
21727
|
this._textOverflow = style?.textOverflow ?? bodyStyle?.textOverflow;
|
|
21727
21728
|
this._textStick = style.textStick ?? bodyStyle?.textStick ?? false;
|
|
21729
|
+
this._textStickBaseOnAlign = style.textStickBaseOnAlign ?? bodyStyle?.textStickBaseOnAlign ?? false;
|
|
21728
21730
|
this._bgColor = style?.bgColor ?? bodyStyle?.bgColor;
|
|
21729
21731
|
this._lineHeight = style?.lineHeight ?? bodyStyle?.lineHeight;
|
|
21730
21732
|
this._underline = style?.underline ?? bodyStyle?.underline;
|
|
@@ -21806,6 +21808,12 @@
|
|
|
21806
21808
|
set textStick(textStick) {
|
|
21807
21809
|
this._textStick = textStick;
|
|
21808
21810
|
}
|
|
21811
|
+
get textStickBaseOnAlign() {
|
|
21812
|
+
return this._textStickBaseOnAlign;
|
|
21813
|
+
}
|
|
21814
|
+
set textStickBaseOnAlign(textStickBaseOnAlign) {
|
|
21815
|
+
this._textStickBaseOnAlign = textStickBaseOnAlign;
|
|
21816
|
+
}
|
|
21809
21817
|
get textAlign() {
|
|
21810
21818
|
return this._textAlign;
|
|
21811
21819
|
}
|
|
@@ -22089,6 +22097,7 @@
|
|
|
22089
22097
|
_padding;
|
|
22090
22098
|
_defaultPadding = [10, 16, 10, 16];
|
|
22091
22099
|
_textStick;
|
|
22100
|
+
_textStickBaseOnAlign;
|
|
22092
22101
|
_marked;
|
|
22093
22102
|
_textAlign;
|
|
22094
22103
|
_textBaseline;
|
|
@@ -22122,6 +22131,7 @@
|
|
|
22122
22131
|
this._fontStyle = style.fontStyle ?? headerStyle?.fontStyle;
|
|
22123
22132
|
this._textOverflow = (style.textOverflow ?? headerStyle?.textOverflow) || 'ellipsis';
|
|
22124
22133
|
this._textStick = style.textStick ?? headerStyle?.textStick ?? false;
|
|
22134
|
+
this._textStickBaseOnAlign = style.textStickBaseOnAlign ?? headerStyle?.textStickBaseOnAlign ?? false;
|
|
22125
22135
|
this._marked = style.marked ?? headerStyle?.marked ?? false;
|
|
22126
22136
|
this._textAlign = (style.textAlign ?? headerStyle?.textAlign) || 'left';
|
|
22127
22137
|
this._textBaseline = (style.textBaseline ?? headerStyle?.textBaseline) || 'middle';
|
|
@@ -22207,6 +22217,12 @@
|
|
|
22207
22217
|
set textStick(textStick) {
|
|
22208
22218
|
this._textStick = textStick;
|
|
22209
22219
|
}
|
|
22220
|
+
get textStickBaseOnAlign() {
|
|
22221
|
+
return this._textStickBaseOnAlign;
|
|
22222
|
+
}
|
|
22223
|
+
set textStickBaseOnAlign(textStickBaseOnAlign) {
|
|
22224
|
+
this._textStickBaseOnAlign = textStickBaseOnAlign;
|
|
22225
|
+
}
|
|
22210
22226
|
get marked() {
|
|
22211
22227
|
return this._marked;
|
|
22212
22228
|
}
|
|
@@ -22779,22 +22795,6 @@
|
|
|
22779
22795
|
}
|
|
22780
22796
|
return res;
|
|
22781
22797
|
}
|
|
22782
|
-
function getValueFromDeepArray(array, index) {
|
|
22783
|
-
let result = array;
|
|
22784
|
-
for (let i = 0; i < index.length; i++) {
|
|
22785
|
-
const currentIdx = index[i];
|
|
22786
|
-
if (result[currentIdx]) {
|
|
22787
|
-
result = result[currentIdx];
|
|
22788
|
-
}
|
|
22789
|
-
else {
|
|
22790
|
-
return undefined;
|
|
22791
|
-
}
|
|
22792
|
-
if (result && result.children && i + 1 < index.length) {
|
|
22793
|
-
result = result.children;
|
|
22794
|
-
}
|
|
22795
|
-
}
|
|
22796
|
-
return result;
|
|
22797
|
-
}
|
|
22798
22798
|
function isAllDigits(str) {
|
|
22799
22799
|
const pattern = /^-?\d+(\.\d+)?$/;
|
|
22800
22800
|
return pattern.test(str);
|
|
@@ -23031,6 +23031,8 @@
|
|
|
23031
23031
|
SORT_CLICK: 'sort_click',
|
|
23032
23032
|
FREEZE_CLICK: 'freeze_click',
|
|
23033
23033
|
SCROLL: 'scroll',
|
|
23034
|
+
SCROLL_HORIZONTAL_END: 'scroll_horizontal_end',
|
|
23035
|
+
SCROLL_VERTICAL_END: 'scroll_vertical_end',
|
|
23034
23036
|
DROPDOWN_MENU_CLICK: 'dropdown_menu_click',
|
|
23035
23037
|
MOUSEOVER_CHART_SYMBOL: 'mouseover_chart_symbol',
|
|
23036
23038
|
DRAG_SELECT_END: 'drag_select_end',
|
|
@@ -24109,9 +24111,9 @@
|
|
|
24109
24111
|
};
|
|
24110
24112
|
|
|
24111
24113
|
function getProp$1(obj, superObj, names, defNames) {
|
|
24112
|
-
return (getChainSafe(obj, ...names)
|
|
24113
|
-
getChainSafe(superObj, ...names)
|
|
24114
|
-
(defNames && getChainSafe(obj, ...defNames))
|
|
24114
|
+
return (getChainSafe(obj, ...names) ??
|
|
24115
|
+
getChainSafe(superObj, ...names) ??
|
|
24116
|
+
(defNames && getChainSafe(obj, ...defNames)) ??
|
|
24115
24117
|
(defNames && getChainSafe(superObj, ...defNames)));
|
|
24116
24118
|
}
|
|
24117
24119
|
class TableTheme {
|
|
@@ -24153,7 +24155,7 @@
|
|
|
24153
24155
|
}
|
|
24154
24156
|
get cellInnerBorder() {
|
|
24155
24157
|
const { obj, superTheme } = this.internalTheme;
|
|
24156
|
-
return
|
|
24158
|
+
return getProp$1(obj, superTheme, ['cellInnerBorder']) ?? true;
|
|
24157
24159
|
}
|
|
24158
24160
|
get cellBorderClipDirection() {
|
|
24159
24161
|
const { obj, superTheme } = this.internalTheme;
|
|
@@ -24419,6 +24421,9 @@
|
|
|
24419
24421
|
},
|
|
24420
24422
|
get hoverOn() {
|
|
24421
24423
|
return scroll.hoverOn ?? true;
|
|
24424
|
+
},
|
|
24425
|
+
get barToSide() {
|
|
24426
|
+
return scroll.barToSide ?? false;
|
|
24422
24427
|
}
|
|
24423
24428
|
};
|
|
24424
24429
|
}
|
|
@@ -33563,16 +33568,18 @@
|
|
|
33563
33568
|
hasHierarchyStateExpand = false;
|
|
33564
33569
|
beforeChangedRecordsMap = [];
|
|
33565
33570
|
registedAggregators = {};
|
|
33571
|
+
rowHierarchyType;
|
|
33566
33572
|
fieldAggregators = [];
|
|
33567
33573
|
layoutColumnObjects = [];
|
|
33574
|
+
lastFilterRules;
|
|
33568
33575
|
constructor(dataSourceObj, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel) {
|
|
33569
33576
|
super();
|
|
33570
33577
|
this.registerAggregators();
|
|
33571
33578
|
this.dataSourceObj = dataSourceObj;
|
|
33572
33579
|
this.dataConfig = dataConfig;
|
|
33573
|
-
this._get = dataSourceObj?.get
|
|
33580
|
+
this._get = dataSourceObj?.get;
|
|
33574
33581
|
this.layoutColumnObjects = columnObjs;
|
|
33575
|
-
this._source = this.processRecords(dataSourceObj?.
|
|
33582
|
+
this._source = dataSourceObj?.records ? this.processRecords(dataSourceObj?.records) : dataSourceObj;
|
|
33576
33583
|
this._sourceLength = this._source?.length || 0;
|
|
33577
33584
|
this.sortedIndexMap = new Map();
|
|
33578
33585
|
this._currentPagerIndexedData = [];
|
|
@@ -33589,6 +33596,7 @@
|
|
|
33589
33596
|
if (rowHierarchyType === 'tree') {
|
|
33590
33597
|
this.initTreeHierarchyState();
|
|
33591
33598
|
}
|
|
33599
|
+
this.rowHierarchyType = rowHierarchyType;
|
|
33592
33600
|
this.updatePagerData();
|
|
33593
33601
|
}
|
|
33594
33602
|
initTreeHierarchyState() {
|
|
@@ -33597,7 +33605,8 @@
|
|
|
33597
33605
|
for (let i = 0; i < nodeLength; i++) {
|
|
33598
33606
|
const indexKey = this.currentIndexedData[i];
|
|
33599
33607
|
const nodeData = this.getOriginalRecord(indexKey);
|
|
33600
|
-
|
|
33608
|
+
const children = nodeData.filteredChildren ?? nodeData.children;
|
|
33609
|
+
if (children?.length > 0) {
|
|
33601
33610
|
if (this.hierarchyExpandLevel > 1) {
|
|
33602
33611
|
!nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.expand);
|
|
33603
33612
|
}
|
|
@@ -33661,26 +33670,46 @@
|
|
|
33661
33670
|
this._generateFieldAggragations();
|
|
33662
33671
|
const filteredRecords = [];
|
|
33663
33672
|
const isHasAggregation = this.fieldAggregators.length >= 1;
|
|
33664
|
-
const isHasFilterRule = this.dataConfig?.filterRules?.length >= 1;
|
|
33673
|
+
const isHasFilterRule = this.dataConfig?.filterRules?.length >= 1 || this.lastFilterRules?.length >= 1;
|
|
33665
33674
|
if (isHasFilterRule || isHasAggregation) {
|
|
33666
33675
|
for (let i = 0, len = records.length; i < len; i++) {
|
|
33667
33676
|
const record = records[i];
|
|
33668
|
-
if (
|
|
33677
|
+
if (this.dataConfig?.filterRules?.length >= 1) {
|
|
33669
33678
|
if (this.filterRecord(record)) {
|
|
33670
33679
|
filteredRecords.push(record);
|
|
33680
|
+
if (this.rowHierarchyType === 'tree' && record.children) {
|
|
33681
|
+
record.filteredChildren = this.filteredChildren(record.children);
|
|
33682
|
+
}
|
|
33671
33683
|
isHasAggregation && this.processRecord(record);
|
|
33672
33684
|
}
|
|
33673
33685
|
}
|
|
33686
|
+
else if (this.lastFilterRules?.length >= 1) {
|
|
33687
|
+
this.clearFilteredChildren(record);
|
|
33688
|
+
isHasAggregation && this.processRecord(record);
|
|
33689
|
+
}
|
|
33674
33690
|
else if (isHasAggregation) {
|
|
33675
33691
|
this.processRecord(record);
|
|
33676
33692
|
}
|
|
33677
33693
|
}
|
|
33678
|
-
if (
|
|
33694
|
+
if (this.dataConfig?.filterRules?.length >= 1) {
|
|
33679
33695
|
return filteredRecords;
|
|
33680
33696
|
}
|
|
33681
33697
|
}
|
|
33682
33698
|
return records;
|
|
33683
33699
|
}
|
|
33700
|
+
filteredChildren(records) {
|
|
33701
|
+
const filteredRecords = [];
|
|
33702
|
+
for (let i = 0, len = records.length; i < len; i++) {
|
|
33703
|
+
const record = records[i];
|
|
33704
|
+
if (this.filterRecord(record)) {
|
|
33705
|
+
filteredRecords.push(record);
|
|
33706
|
+
if (record.children) {
|
|
33707
|
+
record.filteredChildren = this.filteredChildren(record.children);
|
|
33708
|
+
}
|
|
33709
|
+
}
|
|
33710
|
+
}
|
|
33711
|
+
return filteredRecords;
|
|
33712
|
+
}
|
|
33684
33713
|
processRecord(record) {
|
|
33685
33714
|
for (let i = 0; i < this.fieldAggregators.length; i++) {
|
|
33686
33715
|
const aggregator = this.fieldAggregators[i];
|
|
@@ -33689,17 +33718,17 @@
|
|
|
33689
33718
|
}
|
|
33690
33719
|
initChildrenNodeHierarchy(indexKey, hierarchyExpandLevel, currentLevel, nodeData) {
|
|
33691
33720
|
let childTotalLength = 0;
|
|
33692
|
-
const nodeLength = nodeData.children?.length ?? 0;
|
|
33721
|
+
const nodeLength = nodeData.filteredChildren ? nodeData.filteredChildren.length : nodeData.children?.length ?? 0;
|
|
33693
33722
|
for (let j = 0; j < nodeLength; j++) {
|
|
33694
33723
|
if (currentLevel <= hierarchyExpandLevel || nodeData.hierarchyState === HierarchyState.expand) {
|
|
33695
33724
|
childTotalLength += 1;
|
|
33696
33725
|
}
|
|
33697
|
-
const childNodeData = nodeData.children[j];
|
|
33726
|
+
const childNodeData = nodeData.filteredChildren ? nodeData.filteredChildren[j] : nodeData.children[j];
|
|
33698
33727
|
const childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [indexKey, j];
|
|
33699
33728
|
if (currentLevel <= hierarchyExpandLevel || nodeData.hierarchyState === HierarchyState.expand) {
|
|
33700
33729
|
this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childTotalLength, 0, childIndexKey);
|
|
33701
33730
|
}
|
|
33702
|
-
if (childNodeData.children?.length > 0) {
|
|
33731
|
+
if (childNodeData.filteredChildren ? childNodeData.filteredChildren.length > 0 : childNodeData.children?.length > 0) {
|
|
33703
33732
|
if (currentLevel < hierarchyExpandLevel || childNodeData.hierarchyState === HierarchyState.expand) {
|
|
33704
33733
|
!childNodeData.hierarchyState && (childNodeData.hierarchyState = HierarchyState.expand);
|
|
33705
33734
|
this.hasHierarchyStateExpand = true;
|
|
@@ -33747,6 +33776,9 @@
|
|
|
33747
33776
|
throw new Error(`currentIndexedData should has values!`);
|
|
33748
33777
|
}
|
|
33749
33778
|
}
|
|
33779
|
+
get records() {
|
|
33780
|
+
return Array.isArray(this._source) ? this._source : [];
|
|
33781
|
+
}
|
|
33750
33782
|
get source() {
|
|
33751
33783
|
return this._source;
|
|
33752
33784
|
}
|
|
@@ -33795,11 +33827,12 @@
|
|
|
33795
33827
|
if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) {
|
|
33796
33828
|
return;
|
|
33797
33829
|
}
|
|
33798
|
-
|
|
33799
|
-
|
|
33830
|
+
const children = nodeData.filteredChildren ? nodeData.filteredChildren : nodeData.children;
|
|
33831
|
+
if (children) {
|
|
33832
|
+
for (let i = 0; i < children.length; i++) {
|
|
33800
33833
|
childrenLength += 1;
|
|
33801
33834
|
const childIndex = Array.isArray(indexKey) ? indexKey.concat([i]) : [indexKey, i];
|
|
33802
|
-
computeChildrenNodeLength(childIndex,
|
|
33835
|
+
computeChildrenNodeLength(childIndex, children[i].hierarchyState, children[i]);
|
|
33803
33836
|
}
|
|
33804
33837
|
}
|
|
33805
33838
|
};
|
|
@@ -33816,8 +33849,9 @@
|
|
|
33816
33849
|
return 0;
|
|
33817
33850
|
}
|
|
33818
33851
|
let childrenLength = 0;
|
|
33819
|
-
|
|
33820
|
-
|
|
33852
|
+
const children = nodeData.filteredChildren ? nodeData.filteredChildren : nodeData.children;
|
|
33853
|
+
if (children) {
|
|
33854
|
+
const subNodeSortedIndexArray = Array.from({ length: children.length }, (_, i) => i);
|
|
33821
33855
|
this.lastOrder &&
|
|
33822
33856
|
this.lastOrder !== 'normal' &&
|
|
33823
33857
|
this.lastOrderField &&
|
|
@@ -33825,7 +33859,7 @@
|
|
|
33825
33859
|
? subNodeSortedIndexArray[index]
|
|
33826
33860
|
: (subNodeSortedIndexArray[index] = index), (index, rel) => {
|
|
33827
33861
|
subNodeSortedIndexArray[index] = rel;
|
|
33828
|
-
},
|
|
33862
|
+
}, children.length, this.lastOrderFn, this.lastOrder, index => this.getOriginalField(Array.isArray(indexKey) ? indexKey.concat([index]) : [indexKey, index], this.lastOrderField));
|
|
33829
33863
|
for (let i = 0; i < subNodeSortedIndexArray.length; i++) {
|
|
33830
33864
|
childrenLength += 1;
|
|
33831
33865
|
const childIndex = Array.isArray(indexKey)
|
|
@@ -33833,10 +33867,10 @@
|
|
|
33833
33867
|
: [indexKey, subNodeSortedIndexArray[i]];
|
|
33834
33868
|
this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childrenLength, 0, childIndex);
|
|
33835
33869
|
const childData = this.getOriginalRecord(childIndex);
|
|
33836
|
-
if (!
|
|
33837
|
-
|
|
33870
|
+
if (!childData.hierarchyState && (childData.filteredChildren ?? childData.children)) {
|
|
33871
|
+
childData.hierarchyState = HierarchyState.collapse;
|
|
33838
33872
|
}
|
|
33839
|
-
childrenLength += this.pushChildrenNode(childIndex,
|
|
33873
|
+
childrenLength += this.pushChildrenNode(childIndex, childData.hierarchyState, children[subNodeSortedIndexArray[i]]);
|
|
33840
33874
|
}
|
|
33841
33875
|
}
|
|
33842
33876
|
return childrenLength;
|
|
@@ -33873,121 +33907,153 @@
|
|
|
33873
33907
|
}
|
|
33874
33908
|
}
|
|
33875
33909
|
setRecord(record, index) {
|
|
33876
|
-
|
|
33877
|
-
if (
|
|
33878
|
-
this.
|
|
33910
|
+
let isAdd = true;
|
|
33911
|
+
if (this.dataConfig?.filterRules?.length >= 1) {
|
|
33912
|
+
if (this.filterRecord(record)) {
|
|
33913
|
+
if (this.rowHierarchyType === 'tree' && record.children) {
|
|
33914
|
+
record.filteredChildren = this.filteredChildren(record.children);
|
|
33915
|
+
}
|
|
33916
|
+
}
|
|
33917
|
+
else {
|
|
33918
|
+
isAdd = false;
|
|
33919
|
+
}
|
|
33879
33920
|
}
|
|
33880
|
-
|
|
33881
|
-
const
|
|
33882
|
-
|
|
33883
|
-
|
|
33921
|
+
if (isAdd && Array.isArray(this.records)) {
|
|
33922
|
+
const indexed = this.getIndexKey(index);
|
|
33923
|
+
if (!Array.isArray(indexed)) {
|
|
33924
|
+
this.records.splice(indexed, 1, record);
|
|
33925
|
+
}
|
|
33884
33926
|
}
|
|
33885
33927
|
}
|
|
33886
33928
|
addRecord(record, index) {
|
|
33887
|
-
this.
|
|
33888
|
-
|
|
33889
|
-
|
|
33890
|
-
|
|
33891
|
-
|
|
33892
|
-
|
|
33893
|
-
|
|
33894
|
-
|
|
33895
|
-
|
|
33896
|
-
|
|
33929
|
+
if (Array.isArray(this.records)) {
|
|
33930
|
+
this.records.splice(index, 0, record);
|
|
33931
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
33932
|
+
this._sourceLength += 1;
|
|
33933
|
+
if (this.rowHierarchyType === 'tree') {
|
|
33934
|
+
this.initTreeHierarchyState();
|
|
33935
|
+
}
|
|
33936
|
+
if (this.userPagination) {
|
|
33937
|
+
this.pagination.totalCount = this._sourceLength;
|
|
33938
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
33939
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
33940
|
+
const endIndex = startIndex + perPageCount;
|
|
33941
|
+
if (index < endIndex) {
|
|
33942
|
+
this.updatePagerData();
|
|
33943
|
+
}
|
|
33944
|
+
}
|
|
33945
|
+
else {
|
|
33946
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
33947
|
+
this.pagination.totalCount = this._sourceLength;
|
|
33897
33948
|
this.updatePagerData();
|
|
33898
33949
|
}
|
|
33899
|
-
|
|
33900
|
-
|
|
33901
|
-
|
|
33902
|
-
this.pagination.totalCount = this._sourceLength;
|
|
33903
|
-
this.updatePagerData();
|
|
33950
|
+
if (this.dataSourceObj?.added) {
|
|
33951
|
+
this.dataSourceObj.added(index, 1);
|
|
33952
|
+
}
|
|
33904
33953
|
}
|
|
33905
33954
|
}
|
|
33906
33955
|
addRecords(recordArr, index) {
|
|
33907
|
-
if (Array.isArray(
|
|
33908
|
-
|
|
33909
|
-
|
|
33910
|
-
|
|
33956
|
+
if (Array.isArray(this.records)) {
|
|
33957
|
+
if (Array.isArray(recordArr)) {
|
|
33958
|
+
this.records.splice(index, 0, ...recordArr);
|
|
33959
|
+
for (let i = 0; i < recordArr.length; i++) {
|
|
33960
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
33961
|
+
}
|
|
33962
|
+
this._sourceLength += recordArr.length;
|
|
33911
33963
|
}
|
|
33912
|
-
this.
|
|
33913
|
-
|
|
33914
|
-
|
|
33915
|
-
|
|
33916
|
-
|
|
33917
|
-
|
|
33918
|
-
|
|
33919
|
-
|
|
33964
|
+
if (this.userPagination) {
|
|
33965
|
+
this.pagination.totalCount = this._sourceLength;
|
|
33966
|
+
const { perPageCount, currentPage } = this.pagination;
|
|
33967
|
+
const startIndex = perPageCount * (currentPage || 0);
|
|
33968
|
+
const endIndex = startIndex + perPageCount;
|
|
33969
|
+
if (index < endIndex) {
|
|
33970
|
+
this.updatePagerData();
|
|
33971
|
+
}
|
|
33972
|
+
}
|
|
33973
|
+
else {
|
|
33974
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
33975
|
+
this.pagination.totalCount = this._sourceLength;
|
|
33920
33976
|
this.updatePagerData();
|
|
33921
33977
|
}
|
|
33922
|
-
|
|
33923
|
-
|
|
33924
|
-
|
|
33925
|
-
this.pagination.totalCount = this._sourceLength;
|
|
33926
|
-
this.updatePagerData();
|
|
33978
|
+
if (this.dataSourceObj?.added) {
|
|
33979
|
+
this.dataSourceObj.added(index, recordArr.length);
|
|
33980
|
+
}
|
|
33927
33981
|
}
|
|
33928
33982
|
}
|
|
33929
33983
|
addRecordForSorted(record) {
|
|
33930
|
-
this.
|
|
33931
|
-
|
|
33932
|
-
|
|
33933
|
-
|
|
33934
|
-
|
|
33935
|
-
this.
|
|
33936
|
-
|
|
33984
|
+
if (Array.isArray(this.records)) {
|
|
33985
|
+
this.records.push(record);
|
|
33986
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
33987
|
+
this._sourceLength += 1;
|
|
33988
|
+
this.sortedIndexMap.clear();
|
|
33989
|
+
if (!this.userPagination) {
|
|
33990
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
33991
|
+
this.pagination.totalCount = this._sourceLength;
|
|
33992
|
+
}
|
|
33937
33993
|
}
|
|
33938
33994
|
}
|
|
33939
33995
|
addRecordsForSorted(recordArr) {
|
|
33940
|
-
if (Array.isArray(
|
|
33941
|
-
|
|
33942
|
-
|
|
33943
|
-
|
|
33996
|
+
if (Array.isArray(this.records)) {
|
|
33997
|
+
if (Array.isArray(recordArr)) {
|
|
33998
|
+
this.records.push(...recordArr);
|
|
33999
|
+
for (let i = 0; i < recordArr.length; i++) {
|
|
34000
|
+
this.currentIndexedData.push(this.currentIndexedData.length);
|
|
34001
|
+
}
|
|
34002
|
+
this._sourceLength += recordArr.length;
|
|
34003
|
+
this.sortedIndexMap.clear();
|
|
34004
|
+
}
|
|
34005
|
+
if (!this.userPagination) {
|
|
34006
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
34007
|
+
this.pagination.totalCount = this._sourceLength;
|
|
33944
34008
|
}
|
|
33945
|
-
this._sourceLength += recordArr.length;
|
|
33946
|
-
this.sortedIndexMap.clear();
|
|
33947
|
-
}
|
|
33948
|
-
if (!this.userPagination) {
|
|
33949
|
-
this.pagination.perPageCount = this._sourceLength;
|
|
33950
|
-
this.pagination.totalCount = this._sourceLength;
|
|
33951
34009
|
}
|
|
33952
34010
|
}
|
|
33953
34011
|
deleteRecords(recordIndexs) {
|
|
33954
|
-
|
|
33955
|
-
|
|
33956
|
-
|
|
33957
|
-
|
|
33958
|
-
|
|
33959
|
-
|
|
34012
|
+
if (Array.isArray(this.records)) {
|
|
34013
|
+
const realDeletedRecordIndexs = [];
|
|
34014
|
+
const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
34015
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
34016
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
34017
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) {
|
|
34018
|
+
continue;
|
|
34019
|
+
}
|
|
34020
|
+
realDeletedRecordIndexs.push(recordIndex);
|
|
34021
|
+
this.records.splice(recordIndex, 1);
|
|
34022
|
+
this.currentIndexedData.pop();
|
|
34023
|
+
this._sourceLength -= 1;
|
|
33960
34024
|
}
|
|
33961
|
-
|
|
33962
|
-
|
|
33963
|
-
|
|
33964
|
-
|
|
33965
|
-
|
|
33966
|
-
|
|
33967
|
-
|
|
33968
|
-
|
|
33969
|
-
|
|
33970
|
-
|
|
33971
|
-
|
|
33972
|
-
|
|
34025
|
+
if (this.userPagination) {
|
|
34026
|
+
this.updatePagerData();
|
|
34027
|
+
}
|
|
34028
|
+
else {
|
|
34029
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
34030
|
+
this.pagination.totalCount = this._sourceLength;
|
|
34031
|
+
this.updatePagerData();
|
|
34032
|
+
}
|
|
34033
|
+
if (this.dataSourceObj?.deleted) {
|
|
34034
|
+
this.dataSourceObj.deleted(realDeletedRecordIndexs);
|
|
34035
|
+
}
|
|
34036
|
+
return realDeletedRecordIndexs;
|
|
33973
34037
|
}
|
|
33974
|
-
return
|
|
34038
|
+
return [];
|
|
33975
34039
|
}
|
|
33976
34040
|
deleteRecordsForSorted(recordIndexs) {
|
|
33977
|
-
|
|
33978
|
-
|
|
33979
|
-
|
|
33980
|
-
|
|
33981
|
-
|
|
34041
|
+
if (Array.isArray(this.records)) {
|
|
34042
|
+
const recordIndexsMaxToMin = recordIndexs.sort((a, b) => b - a);
|
|
34043
|
+
for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
|
|
34044
|
+
const recordIndex = recordIndexsMaxToMin[index];
|
|
34045
|
+
if (recordIndex >= this._sourceLength || recordIndex < 0) {
|
|
34046
|
+
continue;
|
|
34047
|
+
}
|
|
34048
|
+
const rawIndex = this.currentIndexedData[recordIndex];
|
|
34049
|
+
this.records.splice(rawIndex, 1);
|
|
34050
|
+
this._sourceLength -= 1;
|
|
34051
|
+
}
|
|
34052
|
+
this.sortedIndexMap.clear();
|
|
34053
|
+
if (!this.userPagination) {
|
|
34054
|
+
this.pagination.perPageCount = this._sourceLength;
|
|
34055
|
+
this.pagination.totalCount = this._sourceLength;
|
|
33982
34056
|
}
|
|
33983
|
-
const rawIndex = this.currentIndexedData[recordIndex];
|
|
33984
|
-
this.source.splice(rawIndex, 1);
|
|
33985
|
-
this._sourceLength -= 1;
|
|
33986
|
-
}
|
|
33987
|
-
this.sortedIndexMap.clear();
|
|
33988
|
-
if (!this.userPagination) {
|
|
33989
|
-
this.pagination.perPageCount = this._sourceLength;
|
|
33990
|
-
this.pagination.totalCount = this._sourceLength;
|
|
33991
34057
|
}
|
|
33992
34058
|
}
|
|
33993
34059
|
updateRecords(records, recordIndexs) {
|
|
@@ -33998,7 +34064,7 @@
|
|
|
33998
34064
|
continue;
|
|
33999
34065
|
}
|
|
34000
34066
|
realDeletedRecordIndexs.push(recordIndex);
|
|
34001
|
-
this.
|
|
34067
|
+
this.records[recordIndex] = records[index];
|
|
34002
34068
|
}
|
|
34003
34069
|
if (this.userPagination) {
|
|
34004
34070
|
this.updatePagerData();
|
|
@@ -34015,7 +34081,7 @@
|
|
|
34015
34081
|
if (typeof rawIndex !== 'number') {
|
|
34016
34082
|
return;
|
|
34017
34083
|
}
|
|
34018
|
-
this.
|
|
34084
|
+
this.records[rawIndex] = records[index];
|
|
34019
34085
|
}
|
|
34020
34086
|
this.sortedIndexMap.clear();
|
|
34021
34087
|
}
|
|
@@ -34066,9 +34132,15 @@
|
|
|
34066
34132
|
this.updatePagerData();
|
|
34067
34133
|
this.fireListeners(EVENT_TYPE.CHANGE_ORDER, null);
|
|
34068
34134
|
}
|
|
34135
|
+
clearFilteredChildren(record) {
|
|
34136
|
+
record.filteredChildren = undefined;
|
|
34137
|
+
for (let i = 0; i < record.children?.length ?? 0; i++) {
|
|
34138
|
+
this.clearFilteredChildren(record.children[i]);
|
|
34139
|
+
}
|
|
34140
|
+
}
|
|
34069
34141
|
filterRecord(record) {
|
|
34070
34142
|
let isReserved = true;
|
|
34071
|
-
for (let i = 0; i < this.dataConfig.filterRules
|
|
34143
|
+
for (let i = 0; i < this.dataConfig.filterRules?.length; i++) {
|
|
34072
34144
|
const filterRule = this.dataConfig?.filterRules[i];
|
|
34073
34145
|
if (filterRule.filterKey) {
|
|
34074
34146
|
const filterValue = record[filterRule.filterKey];
|
|
@@ -34085,8 +34157,9 @@
|
|
|
34085
34157
|
return isReserved;
|
|
34086
34158
|
}
|
|
34087
34159
|
updateFilterRulesForSorted(filterRules) {
|
|
34160
|
+
this.lastFilterRules = this.dataConfig.filterRules;
|
|
34088
34161
|
this.dataConfig.filterRules = filterRules;
|
|
34089
|
-
this._source = this.processRecords(this.dataSourceObj?.
|
|
34162
|
+
this._source = this.processRecords(this.dataSourceObj?.records ?? this.dataSourceObj);
|
|
34090
34163
|
this._sourceLength = this._source?.length || 0;
|
|
34091
34164
|
this.sortedIndexMap.clear();
|
|
34092
34165
|
this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
|
|
@@ -34096,8 +34169,9 @@
|
|
|
34096
34169
|
}
|
|
34097
34170
|
}
|
|
34098
34171
|
updateFilterRules(filterRules) {
|
|
34172
|
+
this.lastFilterRules = this.dataConfig.filterRules;
|
|
34099
34173
|
this.dataConfig.filterRules = filterRules;
|
|
34100
|
-
this._source = this.processRecords(this.dataSourceObj?.
|
|
34174
|
+
this._source = this.processRecords(this.dataSourceObj?.records ?? this.dataSourceObj);
|
|
34101
34175
|
this._sourceLength = this._source?.length || 0;
|
|
34102
34176
|
this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
|
|
34103
34177
|
if (this.userPagination) {
|
|
@@ -34106,6 +34180,9 @@
|
|
|
34106
34180
|
else {
|
|
34107
34181
|
this.pagination.perPageCount = this._sourceLength;
|
|
34108
34182
|
this.pagination.totalCount = this._sourceLength;
|
|
34183
|
+
if (this.rowHierarchyType === 'tree') {
|
|
34184
|
+
this.initTreeHierarchyState();
|
|
34185
|
+
}
|
|
34109
34186
|
this.updatePagerData();
|
|
34110
34187
|
}
|
|
34111
34188
|
}
|
|
@@ -34154,6 +34231,7 @@
|
|
|
34154
34231
|
}
|
|
34155
34232
|
release() {
|
|
34156
34233
|
super.release?.();
|
|
34234
|
+
this.lastFilterRules = null;
|
|
34157
34235
|
}
|
|
34158
34236
|
clearSortedMap() {
|
|
34159
34237
|
this.currentIndexedData && (this.currentIndexedData.length = 0);
|
|
@@ -34169,10 +34247,19 @@
|
|
|
34169
34247
|
this.currentPagerIndexedData.length = 0;
|
|
34170
34248
|
}
|
|
34171
34249
|
getOriginalRecord(dataIndex) {
|
|
34172
|
-
|
|
34173
|
-
|
|
34250
|
+
let data;
|
|
34251
|
+
if (!this.dataSourceObj.records) {
|
|
34252
|
+
data = this._get(dataIndex);
|
|
34253
|
+
}
|
|
34254
|
+
else {
|
|
34255
|
+
if (Array.isArray(dataIndex)) {
|
|
34256
|
+
data = getValueFromDeepArray(this.records, dataIndex);
|
|
34257
|
+
}
|
|
34258
|
+
else {
|
|
34259
|
+
data = this.records[dataIndex];
|
|
34260
|
+
}
|
|
34174
34261
|
}
|
|
34175
|
-
return getValue(
|
|
34262
|
+
return getValue(data, (val) => {
|
|
34176
34263
|
this.recordPromiseCallBack(dataIndex, val);
|
|
34177
34264
|
});
|
|
34178
34265
|
}
|
|
@@ -34180,7 +34267,19 @@
|
|
|
34180
34267
|
if (this.beforeChangedRecordsMap?.[dataIndex]) {
|
|
34181
34268
|
return this.beforeChangedRecordsMap[dataIndex];
|
|
34182
34269
|
}
|
|
34183
|
-
|
|
34270
|
+
let data;
|
|
34271
|
+
if (!this.dataSourceObj.records) {
|
|
34272
|
+
data = this._get(dataIndex);
|
|
34273
|
+
}
|
|
34274
|
+
else {
|
|
34275
|
+
if (Array.isArray(dataIndex)) {
|
|
34276
|
+
data = getValueFromDeepArray(this.records, dataIndex);
|
|
34277
|
+
}
|
|
34278
|
+
else {
|
|
34279
|
+
data = this.records[dataIndex];
|
|
34280
|
+
}
|
|
34281
|
+
}
|
|
34282
|
+
return getValue(data, (val) => {
|
|
34184
34283
|
this.recordPromiseCallBack(dataIndex, val);
|
|
34185
34284
|
});
|
|
34186
34285
|
}
|
|
@@ -34304,30 +34403,32 @@
|
|
|
34304
34403
|
targetI = targetIndexs.splice(targetIndexs.length - 1, 1)[0];
|
|
34305
34404
|
if (sourceIndexs.length >= 1) {
|
|
34306
34405
|
const parent = this.getOriginalRecord(sourceIndexs);
|
|
34307
|
-
const sourceIds = parent.
|
|
34406
|
+
const sourceIds = parent.filteredChildren
|
|
34407
|
+
? parent.filteredChildren.splice(sourceI, 1)
|
|
34408
|
+
: parent.children.splice(sourceI, 1);
|
|
34308
34409
|
sourceIds.unshift(targetI, 0);
|
|
34309
|
-
Array.prototype.splice.apply(parent.children, sourceIds);
|
|
34410
|
+
Array.prototype.splice.apply(parent.filteredChildren ?? parent.children, sourceIds);
|
|
34310
34411
|
}
|
|
34311
34412
|
else {
|
|
34312
|
-
const sourceIds = this.
|
|
34413
|
+
const sourceIds = this.records.splice(sourceI, 1);
|
|
34313
34414
|
sourceIds.unshift(targetI, 0);
|
|
34314
|
-
Array.prototype.splice.apply(this.
|
|
34415
|
+
Array.prototype.splice.apply(this.records, sourceIds);
|
|
34315
34416
|
}
|
|
34316
34417
|
}
|
|
34317
34418
|
else {
|
|
34318
34419
|
sourceI = this.currentPagerIndexedData[sourceIndex];
|
|
34319
34420
|
targetI = this.currentPagerIndexedData[targetIndex];
|
|
34320
|
-
const records = this.
|
|
34421
|
+
const records = this.records.splice(sourceI, 1);
|
|
34321
34422
|
records.unshift(targetI, 0);
|
|
34322
|
-
Array.prototype.splice.apply(this.
|
|
34423
|
+
Array.prototype.splice.apply(this.records, records);
|
|
34323
34424
|
}
|
|
34324
34425
|
this.restoreTreeHierarchyState();
|
|
34325
34426
|
this.updatePagerData();
|
|
34326
34427
|
}
|
|
34327
34428
|
else {
|
|
34328
|
-
const records = this.
|
|
34429
|
+
const records = this.records.splice(sourceIndex, 1);
|
|
34329
34430
|
records.unshift(targetIndex, 0);
|
|
34330
|
-
Array.prototype.splice.apply(this.
|
|
34431
|
+
Array.prototype.splice.apply(this.records, records);
|
|
34331
34432
|
}
|
|
34332
34433
|
}
|
|
34333
34434
|
}
|
|
@@ -34335,14 +34436,16 @@
|
|
|
34335
34436
|
if (this.hierarchyExpandLevel) {
|
|
34336
34437
|
for (let i = 0; i < this._sourceLength; i++) {
|
|
34337
34438
|
const nodeData = this.getOriginalRecord(i);
|
|
34338
|
-
|
|
34439
|
+
const children = nodeData.filteredChildren ?? nodeData.children;
|
|
34440
|
+
children && !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.collapse);
|
|
34339
34441
|
}
|
|
34340
34442
|
this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
|
|
34341
34443
|
let nodeLength = this._sourceLength;
|
|
34342
34444
|
for (let i = 0; i < nodeLength; i++) {
|
|
34343
34445
|
const indexKey = this.currentIndexedData[i];
|
|
34344
34446
|
const nodeData = this.getOriginalRecord(indexKey);
|
|
34345
|
-
|
|
34447
|
+
const children = nodeData.filteredChildren ?? nodeData.children;
|
|
34448
|
+
if (children?.length > 0 && nodeData.hierarchyState === HierarchyState.expand) {
|
|
34346
34449
|
this.hasHierarchyStateExpand = true;
|
|
34347
34450
|
const childrenLength = this.restoreChildrenNodeHierarchy(indexKey, nodeData);
|
|
34348
34451
|
i += childrenLength;
|
|
@@ -34356,12 +34459,13 @@
|
|
|
34356
34459
|
}
|
|
34357
34460
|
restoreChildrenNodeHierarchy(indexKey, nodeData) {
|
|
34358
34461
|
let childTotalLength = 0;
|
|
34359
|
-
const
|
|
34462
|
+
const children = nodeData.filteredChildren ?? nodeData.children;
|
|
34463
|
+
const nodeLength = children?.length ?? 0;
|
|
34360
34464
|
for (let j = 0; j < nodeLength; j++) {
|
|
34361
34465
|
if (nodeData.hierarchyState === HierarchyState.expand) {
|
|
34362
34466
|
childTotalLength += 1;
|
|
34363
34467
|
}
|
|
34364
|
-
const childNodeData =
|
|
34468
|
+
const childNodeData = children[j];
|
|
34365
34469
|
const childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [indexKey, j];
|
|
34366
34470
|
if (nodeData.hierarchyState === HierarchyState.expand) {
|
|
34367
34471
|
this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childTotalLength, 0, childIndexKey);
|
|
@@ -34371,6 +34475,23 @@
|
|
|
34371
34475
|
return childTotalLength;
|
|
34372
34476
|
}
|
|
34373
34477
|
}
|
|
34478
|
+
function getValueFromDeepArray(array, index) {
|
|
34479
|
+
let result = array;
|
|
34480
|
+
for (let i = 0; i < index.length; i++) {
|
|
34481
|
+
const currentIdx = index[i];
|
|
34482
|
+
if (result[currentIdx]) {
|
|
34483
|
+
result = result[currentIdx];
|
|
34484
|
+
}
|
|
34485
|
+
else {
|
|
34486
|
+
return undefined;
|
|
34487
|
+
}
|
|
34488
|
+
const children = result.filteredChildren ?? result?.children;
|
|
34489
|
+
if (children && i + 1 < index.length) {
|
|
34490
|
+
result = children;
|
|
34491
|
+
}
|
|
34492
|
+
}
|
|
34493
|
+
return result;
|
|
34494
|
+
}
|
|
34374
34495
|
|
|
34375
34496
|
function _setFieldCache(fCache, index, field, value) {
|
|
34376
34497
|
const recCache = fCache[index] || (fCache[index] = new Map());
|
|
@@ -34385,18 +34506,15 @@
|
|
|
34385
34506
|
static ofArray(array, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel) {
|
|
34386
34507
|
return new CachedDataSource({
|
|
34387
34508
|
get: (index) => {
|
|
34388
|
-
if (Array.isArray(index)) {
|
|
34389
|
-
return getValueFromDeepArray(array, index);
|
|
34390
|
-
}
|
|
34391
34509
|
return array[index];
|
|
34392
34510
|
},
|
|
34393
34511
|
length: array.length,
|
|
34394
|
-
|
|
34512
|
+
records: array
|
|
34395
34513
|
}, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel);
|
|
34396
34514
|
}
|
|
34397
34515
|
constructor(opt, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel) {
|
|
34398
34516
|
super(opt, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel);
|
|
34399
|
-
this._recordCache =
|
|
34517
|
+
this._recordCache = [];
|
|
34400
34518
|
this._fieldCache = {};
|
|
34401
34519
|
}
|
|
34402
34520
|
getOriginalRecord(index) {
|
|
@@ -34417,7 +34535,7 @@
|
|
|
34417
34535
|
}
|
|
34418
34536
|
clearCache() {
|
|
34419
34537
|
if (this._recordCache) {
|
|
34420
|
-
this._recordCache =
|
|
34538
|
+
this._recordCache = [];
|
|
34421
34539
|
}
|
|
34422
34540
|
if (this._fieldCache) {
|
|
34423
34541
|
this._fieldCache = {};
|
|
@@ -34429,8 +34547,13 @@
|
|
|
34429
34547
|
recordPromiseCallBack(index, record) {
|
|
34430
34548
|
this._recordCache[index] = record;
|
|
34431
34549
|
}
|
|
34550
|
+
get records() {
|
|
34551
|
+
return Array.isArray(this._recordCache) && this._recordCache.length > 0 ? this._recordCache : super.records;
|
|
34552
|
+
}
|
|
34432
34553
|
release() {
|
|
34433
34554
|
super.release?.();
|
|
34555
|
+
this._recordCache = null;
|
|
34556
|
+
this._fieldCache = null;
|
|
34434
34557
|
}
|
|
34435
34558
|
}
|
|
34436
34559
|
|
|
@@ -34913,9 +35036,8 @@
|
|
|
34913
35036
|
}
|
|
34914
35037
|
function _setRecords(table, records = []) {
|
|
34915
35038
|
_dealWithUpdateDataSource(table, () => {
|
|
34916
|
-
const data = records;
|
|
34917
35039
|
table.internalProps.records = records;
|
|
34918
|
-
const newDataSource = (table.internalProps.dataSource = CachedDataSource.ofArray(
|
|
35040
|
+
const newDataSource = (table.internalProps.dataSource = CachedDataSource.ofArray(records, table.internalProps.dataConfig, table.pagination, table.internalProps.layoutMap.columnObjects, table.internalProps.layoutMap.rowHierarchyType, table.options.hierarchyExpandLevel ?? (table._hasHierarchyTreeHeader?.() ? 1 : undefined)));
|
|
34919
35041
|
table.addReleaseObj(newDataSource);
|
|
34920
35042
|
});
|
|
34921
35043
|
}
|
|
@@ -36149,11 +36271,12 @@
|
|
|
36149
36271
|
}
|
|
36150
36272
|
|
|
36151
36273
|
function getCellBorderStrokeWidth(col, row, cellTheme, table) {
|
|
36274
|
+
const frameBorderLineWidths = style.toBoxArray(table.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
|
|
36152
36275
|
let strokeArrayWidth = cellTheme?.group?.strokeArrayWidth ?? undefined;
|
|
36153
|
-
if (
|
|
36276
|
+
if (table.theme.cellInnerBorder) {
|
|
36154
36277
|
return strokeArrayWidth;
|
|
36155
36278
|
}
|
|
36156
|
-
if (col === 0) {
|
|
36279
|
+
if (col === 0 && frameBorderLineWidths[3]) {
|
|
36157
36280
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
36158
36281
|
cellTheme?.group?.lineWidth,
|
|
36159
36282
|
cellTheme?.group?.lineWidth,
|
|
@@ -36162,7 +36285,7 @@
|
|
|
36162
36285
|
];
|
|
36163
36286
|
strokeArrayWidth[3] = 0;
|
|
36164
36287
|
}
|
|
36165
|
-
if (col === table.colCount - 1) {
|
|
36288
|
+
if (col === table.colCount - 1 && frameBorderLineWidths[1]) {
|
|
36166
36289
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
36167
36290
|
cellTheme?.group?.lineWidth,
|
|
36168
36291
|
cellTheme?.group?.lineWidth,
|
|
@@ -36171,7 +36294,7 @@
|
|
|
36171
36294
|
];
|
|
36172
36295
|
strokeArrayWidth[1] = 0;
|
|
36173
36296
|
}
|
|
36174
|
-
if (row === 0) {
|
|
36297
|
+
if (row === 0 && frameBorderLineWidths[0]) {
|
|
36175
36298
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
36176
36299
|
cellTheme?.group?.lineWidth,
|
|
36177
36300
|
cellTheme?.group?.lineWidth,
|
|
@@ -36180,7 +36303,7 @@
|
|
|
36180
36303
|
];
|
|
36181
36304
|
strokeArrayWidth[0] = 0;
|
|
36182
36305
|
}
|
|
36183
|
-
if (row === table.rowCount - 1) {
|
|
36306
|
+
if (row === table.rowCount - 1 && frameBorderLineWidths[2]) {
|
|
36184
36307
|
strokeArrayWidth = strokeArrayWidth ?? [
|
|
36185
36308
|
cellTheme?.group?.lineWidth,
|
|
36186
36309
|
cellTheme?.group?.lineWidth,
|
|
@@ -36457,14 +36580,34 @@
|
|
|
36457
36580
|
dataValue = table.getCellOriginRecord(col, row)?.[progressBarDefine.dependField] ?? dataValue;
|
|
36458
36581
|
}
|
|
36459
36582
|
progressBarDefine.barType = progressBarDefine.barType ?? 'default';
|
|
36460
|
-
progressBarDefine.min =
|
|
36461
|
-
|
|
36583
|
+
progressBarDefine.min =
|
|
36584
|
+
getOrApply(progressBarDefine.min, {
|
|
36585
|
+
col,
|
|
36586
|
+
row,
|
|
36587
|
+
table,
|
|
36588
|
+
value,
|
|
36589
|
+
dataValue,
|
|
36590
|
+
cellHeaderPaths: undefined
|
|
36591
|
+
}) ?? 0;
|
|
36592
|
+
progressBarDefine.max =
|
|
36593
|
+
getOrApply(progressBarDefine.max, {
|
|
36594
|
+
col,
|
|
36595
|
+
row,
|
|
36596
|
+
table,
|
|
36597
|
+
value,
|
|
36598
|
+
dataValue,
|
|
36599
|
+
cellHeaderPaths: undefined
|
|
36600
|
+
}) ?? progressBarDefine.min + 100;
|
|
36462
36601
|
const height = table.getRowHeight(row);
|
|
36463
36602
|
let contentWidth = width;
|
|
36464
36603
|
let contentHeight = height;
|
|
36604
|
+
let _contentOffset = 0;
|
|
36605
|
+
if (isNumber$4(table.theme._contentOffset)) {
|
|
36606
|
+
_contentOffset = table.theme._contentOffset;
|
|
36607
|
+
}
|
|
36465
36608
|
const percentCompleteBarGroup = new Group$1({
|
|
36466
|
-
x:
|
|
36467
|
-
y:
|
|
36609
|
+
x: -_contentOffset,
|
|
36610
|
+
y: -_contentOffset,
|
|
36468
36611
|
width: contentWidth,
|
|
36469
36612
|
height: contentHeight
|
|
36470
36613
|
});
|
|
@@ -37673,9 +37816,9 @@
|
|
|
37673
37816
|
textConfig[0].textAlign = textAlign;
|
|
37674
37817
|
const text = new RichText({
|
|
37675
37818
|
width: autoColWidth ? 0 : cellWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth,
|
|
37676
|
-
height: autoRowHeight ? 0 : cellHeight - (padding[0] + padding[2]),
|
|
37819
|
+
height: autoRowHeight && autoWrapText ? 0 : Math.ceil(cellHeight - (padding[0] + padding[2])),
|
|
37677
37820
|
textConfig,
|
|
37678
|
-
verticalDirection: autoRowHeight ? 'top' : textBaseline,
|
|
37821
|
+
verticalDirection: autoRowHeight && autoWrapText ? 'top' : textBaseline,
|
|
37679
37822
|
ellipsis: textOption.ellipsis
|
|
37680
37823
|
});
|
|
37681
37824
|
text.name = 'text';
|
|
@@ -37793,7 +37936,7 @@
|
|
|
37793
37936
|
}
|
|
37794
37937
|
iconAttribute.marginLeft = (icon.marginLeft ?? 0) + hierarchyOffset;
|
|
37795
37938
|
iconAttribute.marginRight = icon.marginRight ?? 0;
|
|
37796
|
-
if (icon.interactive) {
|
|
37939
|
+
if (icon.interactive === false) {
|
|
37797
37940
|
iconAttribute.pickable = false;
|
|
37798
37941
|
}
|
|
37799
37942
|
if (icon.hover) {
|
|
@@ -37881,7 +38024,7 @@
|
|
|
37881
38024
|
cellContent.updateWidth(distWidth - leftIconWidth - rightIconHeight - (padding[1] + padding[3]));
|
|
37882
38025
|
contentHeight = cellContent.AABBBounds.height();
|
|
37883
38026
|
}
|
|
37884
|
-
const oldCellHeight = Math.max(leftIconHeight, rightIconHeight, oldTextHeight) + padding[0] + padding[2];
|
|
38027
|
+
const oldCellHeight = Math.round(Math.max(leftIconHeight, rightIconHeight, oldTextHeight) + padding[0] + padding[2]);
|
|
37885
38028
|
cellGroup.forEachChildren((child) => {
|
|
37886
38029
|
if (child.role === 'icon-left') ;
|
|
37887
38030
|
else if (child.role === 'icon-right') {
|
|
@@ -38696,7 +38839,7 @@
|
|
|
38696
38839
|
});
|
|
38697
38840
|
}
|
|
38698
38841
|
});
|
|
38699
|
-
const lineWidth = cellGroup.attribute.lineWidth;
|
|
38842
|
+
const lineWidth = cellGroup.attribute.strokeArrayWidth ?? cellGroup.attribute.lineWidth;
|
|
38700
38843
|
const isLineWidthArray = isArray$3(lineWidth);
|
|
38701
38844
|
const newLineWidth = [0, 0, 0, 0];
|
|
38702
38845
|
if (col === range.start.col) {
|
|
@@ -39915,7 +40058,7 @@
|
|
|
39915
40058
|
}
|
|
39916
40059
|
}
|
|
39917
40060
|
function computeRowHeight(row, startCol, endCol, table) {
|
|
39918
|
-
let maxHeight
|
|
40061
|
+
let maxHeight;
|
|
39919
40062
|
if (table.isPivotChart() &&
|
|
39920
40063
|
row >= table.columnHeaderLevelCount &&
|
|
39921
40064
|
row < table.rowCount - table.bottomFrozenRowCount) {
|
|
@@ -39935,7 +40078,7 @@
|
|
|
39935
40078
|
for (let col = startCol; col <= endCol; col++) {
|
|
39936
40079
|
const customHeight = computeCustomRenderHeight(col, row, table);
|
|
39937
40080
|
if (customHeight) {
|
|
39938
|
-
maxHeight = Math.max(customHeight.height, maxHeight);
|
|
40081
|
+
maxHeight = isValid$3(maxHeight) ? Math.max(customHeight.height, maxHeight) : customHeight.height;
|
|
39939
40082
|
if (!customHeight.renderDefault) {
|
|
39940
40083
|
continue;
|
|
39941
40084
|
}
|
|
@@ -39946,7 +40089,7 @@
|
|
|
39946
40089
|
if (axisConfig) {
|
|
39947
40090
|
const axisWidth = computeAxisComponentHeight(axisConfig, table);
|
|
39948
40091
|
if (typeof axisWidth === 'number') {
|
|
39949
|
-
maxHeight = Math.max(axisWidth, maxHeight);
|
|
40092
|
+
maxHeight = isValid$3(maxHeight) ? Math.max(axisWidth, maxHeight) : axisWidth;
|
|
39950
40093
|
continue;
|
|
39951
40094
|
}
|
|
39952
40095
|
}
|
|
@@ -39959,19 +40102,14 @@
|
|
|
39959
40102
|
const cellType = table.isHeader(col, row)
|
|
39960
40103
|
? table._getHeaderLayoutMap(col, row)?.headerType
|
|
39961
40104
|
: table.getBodyColumnType(col, row);
|
|
39962
|
-
if (isValid$3(cellType) &&
|
|
39963
|
-
cellType !== 'text' &&
|
|
39964
|
-
cellType !== 'link' &&
|
|
39965
|
-
cellType !== 'progressbar' &&
|
|
39966
|
-
cellType !== 'checkbox') {
|
|
39967
|
-
const defaultHeight = table.getDefaultRowHeight(row);
|
|
39968
|
-
maxHeight = Math.max(maxHeight, isNumber$4(defaultHeight) ? defaultHeight : table.defaultRowHeight);
|
|
39969
|
-
continue;
|
|
39970
|
-
}
|
|
39971
40105
|
const textHeight = computeTextHeight(col, row, cellType, table);
|
|
39972
|
-
maxHeight = Math.max(textHeight, maxHeight);
|
|
40106
|
+
maxHeight = isValid$3(maxHeight) ? Math.max(textHeight, maxHeight) : textHeight;
|
|
39973
40107
|
}
|
|
39974
|
-
|
|
40108
|
+
if (isValid$3(maxHeight)) {
|
|
40109
|
+
return maxHeight;
|
|
40110
|
+
}
|
|
40111
|
+
const defaultHeight = table.getDefaultRowHeight(row);
|
|
40112
|
+
return isNumber$4(defaultHeight) ? defaultHeight : table.defaultRowHeight;
|
|
39975
40113
|
}
|
|
39976
40114
|
function checkFixedStyleAndNoWrap(table) {
|
|
39977
40115
|
const { layoutMap } = table.internalProps;
|
|
@@ -40167,87 +40305,108 @@
|
|
|
40167
40305
|
const fontFamily = getProp('fontFamily', actStyle, col, row, table);
|
|
40168
40306
|
const autoWrapText = getProp('autoWrapText', actStyle, col, row, table);
|
|
40169
40307
|
let text;
|
|
40170
|
-
if (cellType
|
|
40171
|
-
|
|
40308
|
+
if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {
|
|
40309
|
+
maxHeight = lineHeight;
|
|
40172
40310
|
}
|
|
40173
40311
|
else {
|
|
40174
|
-
|
|
40175
|
-
|
|
40176
|
-
|
|
40177
|
-
|
|
40178
|
-
|
|
40179
|
-
|
|
40180
|
-
|
|
40181
|
-
|
|
40182
|
-
|
|
40183
|
-
|
|
40184
|
-
|
|
40185
|
-
|
|
40186
|
-
|
|
40312
|
+
if (cellType === 'checkbox') {
|
|
40313
|
+
text = isObject$4(cellValue) ? cellValue.text : cellValue;
|
|
40314
|
+
}
|
|
40315
|
+
else {
|
|
40316
|
+
text = cellValue;
|
|
40317
|
+
}
|
|
40318
|
+
const lines = validToString(text).split('\n') || [];
|
|
40319
|
+
const cellWidth = table.getColsWidth(col, endCol);
|
|
40320
|
+
if (cellType === 'checkbox') {
|
|
40321
|
+
const size = getProp('size', actStyle, col, row, table);
|
|
40322
|
+
if (autoWrapText) {
|
|
40323
|
+
const spaceBetweenTextAndIcon = getProp('spaceBetweenTextAndIcon', actStyle, col, row, table);
|
|
40324
|
+
const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - size - spaceBetweenTextAndIcon;
|
|
40325
|
+
utilCheckBoxMark.setAttributes({
|
|
40326
|
+
text: {
|
|
40327
|
+
maxLineWidth,
|
|
40328
|
+
text: lines,
|
|
40329
|
+
fontSize,
|
|
40330
|
+
fontStyle,
|
|
40331
|
+
fontWeight,
|
|
40332
|
+
fontFamily,
|
|
40333
|
+
lineHeight,
|
|
40334
|
+
wordBreak: 'break-word'
|
|
40335
|
+
},
|
|
40336
|
+
icon: {
|
|
40337
|
+
width: Math.floor(size / 1.4),
|
|
40338
|
+
height: Math.floor(size / 1.4)
|
|
40339
|
+
},
|
|
40340
|
+
box: {
|
|
40341
|
+
width: size,
|
|
40342
|
+
height: size
|
|
40343
|
+
},
|
|
40344
|
+
spaceBetweenTextAndIcon
|
|
40345
|
+
});
|
|
40346
|
+
utilCheckBoxMark.render();
|
|
40347
|
+
maxHeight = utilTextMark.AABBBounds.height();
|
|
40348
|
+
}
|
|
40349
|
+
else {
|
|
40350
|
+
maxHeight = Math.max(size, lines.length * lineHeight);
|
|
40351
|
+
}
|
|
40352
|
+
}
|
|
40353
|
+
else if (iconInlineFront.length || iconInlineEnd.length) {
|
|
40354
|
+
if (autoWrapText) {
|
|
40355
|
+
const textOption = Object.assign({
|
|
40356
|
+
text: cellValue?.toString(),
|
|
40357
|
+
fontFamily,
|
|
40187
40358
|
fontSize,
|
|
40188
40359
|
fontStyle,
|
|
40189
40360
|
fontWeight,
|
|
40190
|
-
|
|
40191
|
-
|
|
40192
|
-
|
|
40193
|
-
|
|
40194
|
-
|
|
40195
|
-
|
|
40196
|
-
|
|
40197
|
-
|
|
40198
|
-
|
|
40199
|
-
width:
|
|
40200
|
-
height:
|
|
40201
|
-
|
|
40202
|
-
|
|
40361
|
+
lineHeight
|
|
40362
|
+
});
|
|
40363
|
+
textOption.textBaseline = 'middle';
|
|
40364
|
+
const textConfig = [
|
|
40365
|
+
...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),
|
|
40366
|
+
textOption,
|
|
40367
|
+
...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))
|
|
40368
|
+
];
|
|
40369
|
+
utilRichTextMark.setAttributes({
|
|
40370
|
+
width: cellWidth - (padding[1] + padding[3]) - iconWidth,
|
|
40371
|
+
height: 0,
|
|
40372
|
+
textConfig
|
|
40373
|
+
});
|
|
40374
|
+
maxHeight = utilRichTextMark.AABBBounds.height();
|
|
40375
|
+
}
|
|
40376
|
+
else {
|
|
40377
|
+
maxHeight = 0;
|
|
40378
|
+
lines.forEach((line, index) => {
|
|
40379
|
+
if (index === 0 && iconInlineFront.length) {
|
|
40380
|
+
maxHeight += Math.max(lineHeight, iconInlineFrontHeight);
|
|
40381
|
+
}
|
|
40382
|
+
else if (index === lines.length - 1 && iconInlineEnd.length) {
|
|
40383
|
+
maxHeight += Math.max(lineHeight, iconInlineEndHeight);
|
|
40384
|
+
}
|
|
40385
|
+
else {
|
|
40386
|
+
maxHeight += lineHeight;
|
|
40387
|
+
}
|
|
40388
|
+
});
|
|
40389
|
+
}
|
|
40390
|
+
}
|
|
40391
|
+
else if (autoWrapText) {
|
|
40392
|
+
const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;
|
|
40393
|
+
utilTextMark.setAttributes({
|
|
40394
|
+
maxLineWidth,
|
|
40395
|
+
text: lines,
|
|
40396
|
+
fontSize,
|
|
40397
|
+
fontStyle,
|
|
40398
|
+
fontWeight,
|
|
40399
|
+
fontFamily,
|
|
40400
|
+
lineHeight,
|
|
40401
|
+
wordBreak: 'break-word',
|
|
40402
|
+
whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
|
|
40203
40403
|
});
|
|
40204
|
-
|
|
40205
|
-
maxHeight = utilTextMark.AABBBounds.height();
|
|
40404
|
+
maxHeight = utilTextMark.AABBBounds.height() || (typeof lineHeight === 'number' ? lineHeight : fontSize);
|
|
40206
40405
|
}
|
|
40207
40406
|
else {
|
|
40208
|
-
maxHeight =
|
|
40407
|
+
maxHeight = lines.length * lineHeight;
|
|
40209
40408
|
}
|
|
40210
40409
|
}
|
|
40211
|
-
else if (iconInlineFront.length || iconInlineEnd.length) {
|
|
40212
|
-
const textOption = Object.assign({
|
|
40213
|
-
text: cellValue?.toString(),
|
|
40214
|
-
fontFamily,
|
|
40215
|
-
fontSize,
|
|
40216
|
-
fontStyle,
|
|
40217
|
-
fontWeight,
|
|
40218
|
-
lineHeight
|
|
40219
|
-
});
|
|
40220
|
-
textOption.textBaseline = 'middle';
|
|
40221
|
-
const textConfig = [
|
|
40222
|
-
...iconInlineFront.map(icon => dealWithRichTextIcon(icon)),
|
|
40223
|
-
textOption,
|
|
40224
|
-
...iconInlineEnd.map(icon => dealWithRichTextIcon(icon))
|
|
40225
|
-
];
|
|
40226
|
-
utilRichTextMark.setAttributes({
|
|
40227
|
-
width: cellWidth - (padding[1] + padding[3]) - iconWidth,
|
|
40228
|
-
height: 0,
|
|
40229
|
-
textConfig
|
|
40230
|
-
});
|
|
40231
|
-
maxHeight = utilRichTextMark.AABBBounds.height();
|
|
40232
|
-
}
|
|
40233
|
-
else if (autoWrapText) {
|
|
40234
|
-
const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth;
|
|
40235
|
-
utilTextMark.setAttributes({
|
|
40236
|
-
maxLineWidth,
|
|
40237
|
-
text: lines,
|
|
40238
|
-
fontSize,
|
|
40239
|
-
fontStyle,
|
|
40240
|
-
fontWeight,
|
|
40241
|
-
fontFamily,
|
|
40242
|
-
lineHeight,
|
|
40243
|
-
wordBreak: 'break-word',
|
|
40244
|
-
whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
|
|
40245
|
-
});
|
|
40246
|
-
maxHeight = utilTextMark.AABBBounds.height() || (typeof lineHeight === 'number' ? lineHeight : fontSize);
|
|
40247
|
-
}
|
|
40248
|
-
else {
|
|
40249
|
-
maxHeight = lines.length * lineHeight;
|
|
40250
|
-
}
|
|
40251
40410
|
return (Math.max(maxHeight, iconHeight) + padding[0] + padding[2]) / spanRow;
|
|
40252
40411
|
}
|
|
40253
40412
|
function getCellRect$1(col, row, table) {
|
|
@@ -40398,7 +40557,13 @@
|
|
|
40398
40557
|
if (customLayout || customRender) {
|
|
40399
40558
|
const style = scene.table._getCellStyle(col, row);
|
|
40400
40559
|
const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
|
|
40401
|
-
|
|
40560
|
+
let width = cell.attribute.width;
|
|
40561
|
+
let height = cell.attribute.height;
|
|
40562
|
+
if (isMergeCellGroup(cell)) {
|
|
40563
|
+
width = scene.table.getColsWidth(cell.mergeStartCol, cell.mergeEndCol);
|
|
40564
|
+
height = scene.table.getRowsHeight(cell.mergeStartRow, cell.mergeEndRow);
|
|
40565
|
+
}
|
|
40566
|
+
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
|
|
40402
40567
|
customElementsGroup = customResult.elementsGroup;
|
|
40403
40568
|
renderDefault = customResult.renderDefault;
|
|
40404
40569
|
}
|
|
@@ -40410,13 +40575,10 @@
|
|
|
40410
40575
|
}
|
|
40411
40576
|
}
|
|
40412
40577
|
}
|
|
40413
|
-
|
|
40414
|
-
const style = scene.table._getCellStyle(col, row);
|
|
40415
|
-
updateMergeCellContentHeight(cell, distHeight, detaY, scene.table.heightMode === 'autoHeight', getQuadProps(style.padding), style.textAlign, style.textBaseline, scene.table);
|
|
40416
|
-
}
|
|
40578
|
+
updateMergeCellContentHeight(cell, distHeight, detaY, scene.table.heightMode === 'autoHeight', renderDefault, scene.table);
|
|
40417
40579
|
}
|
|
40418
40580
|
}
|
|
40419
|
-
function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight,
|
|
40581
|
+
function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, renderDefault, table) {
|
|
40420
40582
|
if (isMergeCellGroup(cellGroup)) {
|
|
40421
40583
|
distHeight = 0;
|
|
40422
40584
|
for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
|
|
@@ -40432,7 +40594,10 @@
|
|
|
40432
40594
|
dy: 0
|
|
40433
40595
|
});
|
|
40434
40596
|
});
|
|
40435
|
-
|
|
40597
|
+
if (renderDefault) {
|
|
40598
|
+
const style = table._getCellStyle(col, row);
|
|
40599
|
+
updateCellContentHeight(singleCellGroup, distHeight, detaY, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline);
|
|
40600
|
+
}
|
|
40436
40601
|
const rangeHeight = table.getRowHeight(row);
|
|
40437
40602
|
const rangeWidth = table.getColWidth(col);
|
|
40438
40603
|
singleCellGroup.contentHeight = distHeight;
|
|
@@ -40453,7 +40618,8 @@
|
|
|
40453
40618
|
}
|
|
40454
40619
|
}
|
|
40455
40620
|
else {
|
|
40456
|
-
|
|
40621
|
+
const style = table._getCellStyle(cellGroup.col, cellGroup.row);
|
|
40622
|
+
updateCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline);
|
|
40457
40623
|
}
|
|
40458
40624
|
}
|
|
40459
40625
|
|
|
@@ -40698,7 +40864,13 @@
|
|
|
40698
40864
|
if (customLayout || customRender) {
|
|
40699
40865
|
const style = scene.table._getCellStyle(col, row);
|
|
40700
40866
|
const padding = getQuadProps(getProp('padding', style, col, row, scene.table));
|
|
40701
|
-
|
|
40867
|
+
let width = cellGroup.attribute.width;
|
|
40868
|
+
let height = cellGroup.attribute.height;
|
|
40869
|
+
if (isMergeCellGroup(cellGroup)) {
|
|
40870
|
+
width = scene.table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol);
|
|
40871
|
+
height = scene.table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow);
|
|
40872
|
+
}
|
|
40873
|
+
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.heightMode === 'autoHeight', padding, scene.table);
|
|
40702
40874
|
customElementsGroup = customResult.elementsGroup;
|
|
40703
40875
|
renderDefault = customResult.renderDefault;
|
|
40704
40876
|
isHeightChange = true;
|
|
@@ -40711,14 +40883,12 @@
|
|
|
40711
40883
|
}
|
|
40712
40884
|
}
|
|
40713
40885
|
}
|
|
40714
|
-
|
|
40715
|
-
|
|
40716
|
-
isHeightChange = updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, getQuadProps(style.padding), style.textAlign, style.textBaseline, scene.table);
|
|
40717
|
-
}
|
|
40886
|
+
const cellChange = updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, renderDefault, scene.table);
|
|
40887
|
+
isHeightChange = isHeightChange || cellChange;
|
|
40718
40888
|
}
|
|
40719
40889
|
return autoRowHeight && autoWrapText ? isHeightChange : false;
|
|
40720
40890
|
}
|
|
40721
|
-
function updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight,
|
|
40891
|
+
function updateMergeCellContentWidth(cellGroup, distWidth, detaX, autoRowHeight, renderDefault, table) {
|
|
40722
40892
|
if (isMergeCellGroup(cellGroup)) {
|
|
40723
40893
|
distWidth = 0;
|
|
40724
40894
|
let isHeightChange = false;
|
|
@@ -40732,6 +40902,9 @@
|
|
|
40732
40902
|
const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
|
|
40733
40903
|
for (let col = colStart; col <= colEnd; col++) {
|
|
40734
40904
|
for (let row = rowStart; row <= rowEnd; row++) {
|
|
40905
|
+
if (col === cellGroup.col && row !== cellGroup.row) {
|
|
40906
|
+
continue;
|
|
40907
|
+
}
|
|
40735
40908
|
const singleCellGroup = table.scenegraph.getCell(col, row);
|
|
40736
40909
|
singleCellGroup.forEachChildren((child) => {
|
|
40737
40910
|
child.setAttributes({
|
|
@@ -40739,13 +40912,20 @@
|
|
|
40739
40912
|
dy: 0
|
|
40740
40913
|
});
|
|
40741
40914
|
});
|
|
40742
|
-
|
|
40743
|
-
|
|
40744
|
-
|
|
40745
|
-
const
|
|
40746
|
-
const
|
|
40747
|
-
|
|
40748
|
-
|
|
40915
|
+
let changed = false;
|
|
40916
|
+
if (renderDefault) {
|
|
40917
|
+
const style = table._getCellStyle(col, row);
|
|
40918
|
+
const padding = getQuadProps(style.padding);
|
|
40919
|
+
const textAlign = style.textAlign;
|
|
40920
|
+
const textBaseline = style.textBaseline;
|
|
40921
|
+
changed = updateCellContentWidth(singleCellGroup, distWidth, cellHeight, detaX, autoRowHeight, padding, textAlign, textBaseline, table.scenegraph);
|
|
40922
|
+
const hierarchyOffset = getHierarchyOffset(singleCellGroup.col, singleCellGroup.row, table);
|
|
40923
|
+
if (hierarchyOffset) {
|
|
40924
|
+
const text = singleCellGroup.getChildByName('text');
|
|
40925
|
+
const icon = singleCellGroup.getChildByName('expand') || singleCellGroup.getChildByName('collapse');
|
|
40926
|
+
if (icon?.role !== 'icon-left' && text) {
|
|
40927
|
+
text.setAttribute('dx', hierarchyOffset);
|
|
40928
|
+
}
|
|
40749
40929
|
}
|
|
40750
40930
|
}
|
|
40751
40931
|
const rangeHeight = table.getRowHeight(row);
|
|
@@ -40769,6 +40949,10 @@
|
|
|
40769
40949
|
}
|
|
40770
40950
|
return isHeightChange;
|
|
40771
40951
|
}
|
|
40952
|
+
const style = table._getCellStyle(cellGroup.col, cellGroup.row);
|
|
40953
|
+
const padding = getQuadProps(style.padding);
|
|
40954
|
+
const textAlign = style.textAlign;
|
|
40955
|
+
const textBaseline = style.textBaseline;
|
|
40772
40956
|
return updateCellContentWidth(cellGroup, distWidth, table.getRowHeight(cellGroup.row), detaX, autoRowHeight, padding, textAlign, textBaseline, table.scenegraph);
|
|
40773
40957
|
}
|
|
40774
40958
|
function resetRowHeight(scene, row) {
|
|
@@ -41385,7 +41569,8 @@
|
|
|
41385
41569
|
componentGroup.addChild(this.columnResizeBgLine);
|
|
41386
41570
|
componentGroup.addChild(this.columnResizeLine);
|
|
41387
41571
|
componentGroup.addChild(this.columnResizeLabel);
|
|
41388
|
-
|
|
41572
|
+
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
41573
|
+
if (hoverOn && !this.table.theme.scrollStyle.barToSide) {
|
|
41389
41574
|
componentGroup.addChild(this.hScrollBar);
|
|
41390
41575
|
componentGroup.addChild(this.vScrollBar);
|
|
41391
41576
|
}
|
|
@@ -41456,9 +41641,17 @@
|
|
|
41456
41641
|
if (totalWidth > tableWidth) {
|
|
41457
41642
|
const y = Math.min(tableHeight, totalHeight);
|
|
41458
41643
|
const rangeEnd = Math.max(0.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth));
|
|
41644
|
+
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
41645
|
+
let attrY = 0;
|
|
41646
|
+
if (this.table.theme.scrollStyle.barToSide) {
|
|
41647
|
+
attrY = this.table.tableNoFrameHeight - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
|
|
41648
|
+
}
|
|
41649
|
+
else {
|
|
41650
|
+
attrY = y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
|
|
41651
|
+
}
|
|
41459
41652
|
this.hScrollBar.setAttributes({
|
|
41460
|
-
x: frozenColsWidth + (!
|
|
41461
|
-
y:
|
|
41653
|
+
x: frozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0),
|
|
41654
|
+
y: attrY,
|
|
41462
41655
|
width: tableWidth - frozenColsWidth - rightFrozenColsWidth,
|
|
41463
41656
|
range: [0, rangeEnd],
|
|
41464
41657
|
visible: visible === 'always'
|
|
@@ -41483,9 +41676,17 @@
|
|
|
41483
41676
|
if (totalHeight > tableHeight) {
|
|
41484
41677
|
const x = Math.min(tableWidth, totalWidth);
|
|
41485
41678
|
const rangeEnd = Math.max(0.05, (tableHeight - frozenRowsHeight) / (totalHeight - frozenRowsHeight));
|
|
41679
|
+
let attrX = 0;
|
|
41680
|
+
const hoverOn = this.table.theme.scrollStyle.hoverOn;
|
|
41681
|
+
if (this.table.theme.scrollStyle.barToSide) {
|
|
41682
|
+
attrX = this.table.tableNoFrameWidth - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x);
|
|
41683
|
+
}
|
|
41684
|
+
else {
|
|
41685
|
+
attrX = x - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x);
|
|
41686
|
+
}
|
|
41486
41687
|
this.vScrollBar.setAttributes({
|
|
41487
|
-
x:
|
|
41488
|
-
y: frozenRowsHeight + (!
|
|
41688
|
+
x: attrX,
|
|
41689
|
+
y: frozenRowsHeight + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.y : 0),
|
|
41489
41690
|
height: tableHeight - frozenRowsHeight - bottomFrozenRowsHeight,
|
|
41490
41691
|
range: [0, rangeEnd],
|
|
41491
41692
|
visible: visible === 'always'
|
|
@@ -41584,7 +41785,7 @@
|
|
|
41584
41785
|
this.frozenShadowLine.setAttributes({
|
|
41585
41786
|
visible: true,
|
|
41586
41787
|
x: colX,
|
|
41587
|
-
height: this.table.
|
|
41788
|
+
height: this.table.tableNoFrameHeight
|
|
41588
41789
|
});
|
|
41589
41790
|
}
|
|
41590
41791
|
}
|
|
@@ -42377,7 +42578,10 @@
|
|
|
42377
42578
|
if ((typeof lineWidth === 'number' && lineWidth & 1) ||
|
|
42378
42579
|
(Array.isArray(strokeArrayWidth) && strokeArrayWidth.some(width => width & 1))) {
|
|
42379
42580
|
const table = group.stage.table;
|
|
42380
|
-
|
|
42581
|
+
if (!table) {
|
|
42582
|
+
return;
|
|
42583
|
+
}
|
|
42584
|
+
const bottomRight = table?.theme.cellBorderClipDirection === 'bottom-right';
|
|
42381
42585
|
let deltaWidth = 0;
|
|
42382
42586
|
let deltaHeight = 0;
|
|
42383
42587
|
if (bottomRight) {
|
|
@@ -42614,7 +42818,10 @@
|
|
|
42614
42818
|
let heightForStroke;
|
|
42615
42819
|
if (lineWidth & 1) {
|
|
42616
42820
|
const table = group.stage.table;
|
|
42617
|
-
|
|
42821
|
+
if (!table) {
|
|
42822
|
+
return;
|
|
42823
|
+
}
|
|
42824
|
+
const bottomRight = table?.theme.cellBorderClipDirection === 'bottom-right';
|
|
42618
42825
|
let deltaWidth = 0;
|
|
42619
42826
|
let deltaHeight = 0;
|
|
42620
42827
|
if (bottomRight) {
|
|
@@ -42706,7 +42913,10 @@
|
|
|
42706
42913
|
const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(group, Math.ceil(width), Math.ceil(height));
|
|
42707
42914
|
context.beginPath();
|
|
42708
42915
|
const table = group.stage.table;
|
|
42709
|
-
|
|
42916
|
+
if (!table) {
|
|
42917
|
+
return;
|
|
42918
|
+
}
|
|
42919
|
+
const bottomRight = table?.theme.cellBorderClipDirection === 'bottom-right';
|
|
42710
42920
|
let deltaWidth = 0;
|
|
42711
42921
|
let deltaHeight = 0;
|
|
42712
42922
|
if (bottomRight) {
|
|
@@ -42748,7 +42958,7 @@
|
|
|
42748
42958
|
drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
|
|
42749
42959
|
if (group.role === 'cell') {
|
|
42750
42960
|
const table = group.stage.table;
|
|
42751
|
-
if (table.stateManager.interactionState !== InteractionState.scrolling) {
|
|
42961
|
+
if (table && table.stateManager.interactionState !== InteractionState.scrolling) {
|
|
42752
42962
|
const hoverColor = getCellHoverColor(group, table);
|
|
42753
42963
|
if (hoverColor) {
|
|
42754
42964
|
group.attribute._vtableHoverFill = hoverColor;
|
|
@@ -42787,6 +42997,9 @@
|
|
|
42787
42997
|
order = 0;
|
|
42788
42998
|
drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
|
|
42789
42999
|
const table = group.stage.table;
|
|
43000
|
+
if (!table) {
|
|
43001
|
+
return;
|
|
43002
|
+
}
|
|
42790
43003
|
if (group.role === 'body') {
|
|
42791
43004
|
const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();
|
|
42792
43005
|
const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();
|
|
@@ -42899,10 +43112,10 @@
|
|
|
42899
43112
|
}
|
|
42900
43113
|
}
|
|
42901
43114
|
else if (group.role === 'corner-frozen') {
|
|
42902
|
-
if (table.scrollLeft) {
|
|
43115
|
+
if (table && table.scrollLeft) {
|
|
42903
43116
|
width -= 1;
|
|
42904
43117
|
}
|
|
42905
|
-
if (table.scrollTop) {
|
|
43118
|
+
if (table && table.scrollTop) {
|
|
42906
43119
|
height -= 1;
|
|
42907
43120
|
}
|
|
42908
43121
|
}
|
|
@@ -43035,6 +43248,7 @@
|
|
|
43035
43248
|
}
|
|
43036
43249
|
|
|
43037
43250
|
let customAlphabetCharSet = '';
|
|
43251
|
+
let textMeasureMode = 'quick';
|
|
43038
43252
|
const textMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
43039
43253
|
if (isBound(TextMeasureContribution)) {
|
|
43040
43254
|
rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
|
|
@@ -43082,13 +43296,13 @@
|
|
|
43082
43296
|
measureTextWidth(text, options) {
|
|
43083
43297
|
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
43084
43298
|
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
43085
|
-
const textMeasure = fastTextMeasure.measure(text);
|
|
43299
|
+
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
43086
43300
|
return textMeasure.width;
|
|
43087
43301
|
}
|
|
43088
43302
|
measureText(text, options) {
|
|
43089
43303
|
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
43090
43304
|
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
43091
|
-
const textMeasure = fastTextMeasure.measure(text);
|
|
43305
|
+
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
43092
43306
|
return textMeasure;
|
|
43093
43307
|
}
|
|
43094
43308
|
}
|
|
@@ -43096,13 +43310,13 @@
|
|
|
43096
43310
|
measureText(text, options) {
|
|
43097
43311
|
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
43098
43312
|
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
43099
|
-
const textMeasure = fastTextMeasure.measure(text);
|
|
43313
|
+
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
43100
43314
|
return textMeasure;
|
|
43101
43315
|
}
|
|
43102
43316
|
measureTextWidth(text, options) {
|
|
43103
43317
|
const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
|
|
43104
43318
|
const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
|
|
43105
|
-
const textMeasure = fastTextMeasure.measure(text);
|
|
43319
|
+
const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
|
|
43106
43320
|
return textMeasure.width;
|
|
43107
43321
|
}
|
|
43108
43322
|
clipText(text, options, width) {
|
|
@@ -43176,6 +43390,7 @@
|
|
|
43176
43390
|
fastTextMeasureCache.clear();
|
|
43177
43391
|
}
|
|
43178
43392
|
function restoreMeasureText() {
|
|
43393
|
+
textMeasureMode = 'canvas';
|
|
43179
43394
|
container.load(restoreTextMeasureModule);
|
|
43180
43395
|
}
|
|
43181
43396
|
|
|
@@ -43341,7 +43556,8 @@
|
|
|
43341
43556
|
for (let col = colStart; col <= colEnd; col++) {
|
|
43342
43557
|
let maxWidth;
|
|
43343
43558
|
if (!table.internalProps.transpose &&
|
|
43344
|
-
table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-header'
|
|
43559
|
+
(table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-header' ||
|
|
43560
|
+
table.columnWidthComputeMode === 'only-header') &&
|
|
43345
43561
|
'showHeader' in table.internalProps.layoutMap) {
|
|
43346
43562
|
const temp = table.internalProps.layoutMap.showHeader;
|
|
43347
43563
|
table.internalProps.layoutMap.showHeader = true;
|
|
@@ -43349,7 +43565,8 @@
|
|
|
43349
43565
|
table.internalProps.layoutMap.showHeader = temp;
|
|
43350
43566
|
}
|
|
43351
43567
|
else if (!table.internalProps.transpose &&
|
|
43352
|
-
table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-body'
|
|
43568
|
+
(table.internalProps.layoutMap.columnWidths?.[col]?.columnWidthComputeMode === 'only-body' ||
|
|
43569
|
+
table.columnWidthComputeMode === 'only-body')) {
|
|
43353
43570
|
maxWidth = computeColWidth(col, table.internalProps.layoutMap.getBodyRange().start.row, table.internalProps.layoutMap.getBodyRange().end.row, table);
|
|
43354
43571
|
}
|
|
43355
43572
|
else {
|
|
@@ -43419,7 +43636,13 @@
|
|
|
43419
43636
|
}
|
|
43420
43637
|
}
|
|
43421
43638
|
function computeColWidth(col, startRow, endRow, table, forceCompute = false) {
|
|
43422
|
-
|
|
43639
|
+
let width = getColWidthDefinedWidthResizedWidth(col, table);
|
|
43640
|
+
if (table.internalProps.transpose &&
|
|
43641
|
+
width === 'auto' &&
|
|
43642
|
+
((table.columnWidthComputeMode === 'only-header' && col >= table.rowHeaderLevelCount) ||
|
|
43643
|
+
(table.columnWidthComputeMode === 'only-body' && col < table.rowHeaderLevelCount))) {
|
|
43644
|
+
width = table.getDefaultColumnWidth(col);
|
|
43645
|
+
}
|
|
43423
43646
|
if (forceCompute && !table.internalProps.transpose) {
|
|
43424
43647
|
return computeAutoColWidth(width, col, startRow, endRow, forceCompute, table);
|
|
43425
43648
|
}
|
|
@@ -43560,8 +43783,9 @@
|
|
|
43560
43783
|
if (customLayoutObj.rootContainer instanceof Group$2) {
|
|
43561
43784
|
customLayoutObj.rootContainer = decodeReactDom(customLayoutObj.rootContainer);
|
|
43562
43785
|
dealPercentCalc(customLayoutObj.rootContainer, 0, table.getRowHeight(row));
|
|
43786
|
+
const setedWidth = customLayoutObj.rootContainer.attribute.width;
|
|
43563
43787
|
customLayoutObj.rootContainer.setStage(table.scenegraph.stage);
|
|
43564
|
-
width = customLayoutObj.rootContainer.AABBBounds.width() ?? 0;
|
|
43788
|
+
width = setedWidth > 0 ? setedWidth : customLayoutObj.rootContainer.AABBBounds.width() ?? 0;
|
|
43565
43789
|
renderDefault = customLayoutObj.renderDefault;
|
|
43566
43790
|
enableCellPadding = customLayoutObj.enableCellPadding;
|
|
43567
43791
|
}
|
|
@@ -43900,7 +44124,8 @@
|
|
|
43900
44124
|
proxy.setParamsForColumn();
|
|
43901
44125
|
let distCol;
|
|
43902
44126
|
let distRow;
|
|
43903
|
-
if (table.widthMode === 'adaptive'
|
|
44127
|
+
if (table.widthMode === 'adaptive' ||
|
|
44128
|
+
(table.options.autoWrapText && (table.heightMode === 'adaptive' || table.heightMode === 'autoHeight'))) {
|
|
43904
44129
|
distCol = table.colCount - 1;
|
|
43905
44130
|
}
|
|
43906
44131
|
else {
|
|
@@ -46398,6 +46623,9 @@
|
|
|
46398
46623
|
if (!scene.isPivot && !scene.table.transpose) {
|
|
46399
46624
|
scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
|
|
46400
46625
|
}
|
|
46626
|
+
else if (scene.table.options.frozenColCount) {
|
|
46627
|
+
scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
|
|
46628
|
+
}
|
|
46401
46629
|
scene.hasFrozen = true;
|
|
46402
46630
|
scene.frozenColCount = scene.table.frozenColCount;
|
|
46403
46631
|
scene.frozenRowCount = scene.colHeaderGroup.firstChild?.childrenCount ?? 0;
|
|
@@ -46434,6 +46662,9 @@
|
|
|
46434
46662
|
if (!scene.isPivot && !scene.table.transpose) {
|
|
46435
46663
|
scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
|
|
46436
46664
|
}
|
|
46665
|
+
else if (scene.table.options.frozenColCount) {
|
|
46666
|
+
scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1);
|
|
46667
|
+
}
|
|
46437
46668
|
scene.hasFrozen = true;
|
|
46438
46669
|
}
|
|
46439
46670
|
function moveColumnFromBodyToRowHeader(scene) {
|
|
@@ -48286,6 +48517,9 @@
|
|
|
48286
48517
|
if (!this.isPivot && !this.table.transpose) {
|
|
48287
48518
|
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
48288
48519
|
}
|
|
48520
|
+
else if (this.table.options.frozenColCount) {
|
|
48521
|
+
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
48522
|
+
}
|
|
48289
48523
|
this.table.stateManager.checkFrozen();
|
|
48290
48524
|
this.updateContainer();
|
|
48291
48525
|
this.createFrameBorder();
|
|
@@ -48702,6 +48936,9 @@
|
|
|
48702
48936
|
if (!this.isPivot && !this.table.transpose) {
|
|
48703
48937
|
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
48704
48938
|
}
|
|
48939
|
+
else if (this.table.options.frozenColCount) {
|
|
48940
|
+
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
48941
|
+
}
|
|
48705
48942
|
this.component.updateScrollBar();
|
|
48706
48943
|
this.updateNextFrame();
|
|
48707
48944
|
}
|
|
@@ -48713,6 +48950,9 @@
|
|
|
48713
48950
|
if (!this.isPivot && !this.table.transpose) {
|
|
48714
48951
|
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
48715
48952
|
}
|
|
48953
|
+
else if (this.table.options.frozenColCount) {
|
|
48954
|
+
this.component.setFrozenColumnShadow(this.table.frozenColCount - 1);
|
|
48955
|
+
}
|
|
48716
48956
|
this.component.updateScrollBar();
|
|
48717
48957
|
this.updateNextFrame();
|
|
48718
48958
|
}
|
|
@@ -49147,10 +49387,76 @@
|
|
|
49147
49387
|
};
|
|
49148
49388
|
}
|
|
49149
49389
|
else {
|
|
49150
|
-
|
|
49151
|
-
|
|
49152
|
-
|
|
49153
|
-
|
|
49390
|
+
if (state.fillHandle.isFilling) {
|
|
49391
|
+
if (state.fillHandle.direction === 'top') {
|
|
49392
|
+
if (row === state.fillHandle.beforeFillMinRow && row === state.fillHandle.beforeFillMaxRow) {
|
|
49393
|
+
currentRange.start.row = currentRange.end.row = row;
|
|
49394
|
+
}
|
|
49395
|
+
else if (row <= state.fillHandle.beforeFillMinRow) {
|
|
49396
|
+
if (currentRange.start.row < currentRange.end.row) {
|
|
49397
|
+
const temp = currentRange.start.row;
|
|
49398
|
+
currentRange.start.row = currentRange.end.row;
|
|
49399
|
+
currentRange.end.row = temp;
|
|
49400
|
+
}
|
|
49401
|
+
currentRange.end.row = row;
|
|
49402
|
+
}
|
|
49403
|
+
else if (row === state.fillHandle.beforeFillMaxRow) {
|
|
49404
|
+
if (currentRange.start.row > currentRange.end.row) {
|
|
49405
|
+
currentRange.start.row = row;
|
|
49406
|
+
}
|
|
49407
|
+
else {
|
|
49408
|
+
currentRange.end.row = row;
|
|
49409
|
+
}
|
|
49410
|
+
}
|
|
49411
|
+
}
|
|
49412
|
+
else if (state.fillHandle.direction === 'bottom') {
|
|
49413
|
+
if (row >= state.fillHandle.beforeFillMaxRow) {
|
|
49414
|
+
if (currentRange.start.row > currentRange.end.row) {
|
|
49415
|
+
const temp = currentRange.start.row;
|
|
49416
|
+
currentRange.start.row = currentRange.end.row;
|
|
49417
|
+
currentRange.end.row = temp;
|
|
49418
|
+
}
|
|
49419
|
+
currentRange.end.row = row;
|
|
49420
|
+
}
|
|
49421
|
+
}
|
|
49422
|
+
else if (state.fillHandle.direction === 'left') {
|
|
49423
|
+
if (col === state.fillHandle.beforeFillMinCol && col === state.fillHandle.beforeFillMaxCol) {
|
|
49424
|
+
currentRange.start.col = currentRange.end.col = col;
|
|
49425
|
+
}
|
|
49426
|
+
else if (col <= state.fillHandle.beforeFillMinCol) {
|
|
49427
|
+
if (currentRange.start.col < currentRange.end.col) {
|
|
49428
|
+
const temp = currentRange.start.col;
|
|
49429
|
+
currentRange.start.col = currentRange.end.col;
|
|
49430
|
+
currentRange.end.col = temp;
|
|
49431
|
+
}
|
|
49432
|
+
currentRange.end.col = col;
|
|
49433
|
+
}
|
|
49434
|
+
else if (col === state.fillHandle.beforeFillMaxCol) {
|
|
49435
|
+
if (currentRange.start.col > currentRange.end.col) {
|
|
49436
|
+
currentRange.start.col = col;
|
|
49437
|
+
}
|
|
49438
|
+
else {
|
|
49439
|
+
currentRange.end.col = col;
|
|
49440
|
+
}
|
|
49441
|
+
}
|
|
49442
|
+
}
|
|
49443
|
+
else if (state.fillHandle.direction === 'right') {
|
|
49444
|
+
if (col >= state.fillHandle.beforeFillMaxCol) {
|
|
49445
|
+
if (currentRange.start.col > currentRange.end.col) {
|
|
49446
|
+
const temp = currentRange.start.col;
|
|
49447
|
+
currentRange.start.col = currentRange.end.col;
|
|
49448
|
+
currentRange.end.col = temp;
|
|
49449
|
+
}
|
|
49450
|
+
currentRange.end.col = col;
|
|
49451
|
+
}
|
|
49452
|
+
}
|
|
49453
|
+
}
|
|
49454
|
+
else {
|
|
49455
|
+
currentRange.end = {
|
|
49456
|
+
col,
|
|
49457
|
+
row
|
|
49458
|
+
};
|
|
49459
|
+
}
|
|
49154
49460
|
}
|
|
49155
49461
|
scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, currentRange.end.col, currentRange.end.row, extendSelectRange);
|
|
49156
49462
|
}
|
|
@@ -49516,6 +49822,9 @@
|
|
|
49516
49822
|
!state.table.transpose) {
|
|
49517
49823
|
state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen);
|
|
49518
49824
|
}
|
|
49825
|
+
else if (state.table.options.frozenColCount) {
|
|
49826
|
+
state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1);
|
|
49827
|
+
}
|
|
49519
49828
|
state.table.scenegraph.updateNextFrame();
|
|
49520
49829
|
}
|
|
49521
49830
|
function clearWidthsAndHeightsCache(colMin, colMax, rowMin, rowMax, table) {
|
|
@@ -49640,6 +49949,9 @@
|
|
|
49640
49949
|
!state.table.transpose) {
|
|
49641
49950
|
state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen);
|
|
49642
49951
|
}
|
|
49952
|
+
else if (state.table.options.frozenColCount) {
|
|
49953
|
+
state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1);
|
|
49954
|
+
}
|
|
49643
49955
|
state.table.scenegraph.updateNextFrame();
|
|
49644
49956
|
}
|
|
49645
49957
|
function updateResizeColForColumn(detaX, state) {
|
|
@@ -50069,23 +50381,40 @@
|
|
|
50069
50381
|
this.columnResize.x = x;
|
|
50070
50382
|
this.columnResize.isRightFrozen = isRightFrozen;
|
|
50071
50383
|
this.table.scenegraph.component.showResizeCol(col, y, isRightFrozen);
|
|
50072
|
-
this.
|
|
50384
|
+
this.updateSelectPos(-1, -1);
|
|
50073
50385
|
this.table.scenegraph.updateNextFrame();
|
|
50074
50386
|
}
|
|
50075
50387
|
startFillSelect(x, y) {
|
|
50076
50388
|
this.fillHandle.isFilling = true;
|
|
50077
50389
|
this.fillHandle.startX = x;
|
|
50078
50390
|
this.fillHandle.startY = y;
|
|
50079
|
-
this.
|
|
50391
|
+
const currentRange = this.select.ranges[this.select.ranges.length - 1];
|
|
50392
|
+
this.fillHandle.beforeFillMinCol = Math.min(currentRange.start.col, currentRange.end.col);
|
|
50393
|
+
this.fillHandle.beforeFillMinRow = Math.min(currentRange.start.row, currentRange.end.row);
|
|
50394
|
+
this.fillHandle.beforeFillMaxCol = Math.max(currentRange.start.col, currentRange.end.col);
|
|
50395
|
+
this.fillHandle.beforeFillMaxRow = Math.max(currentRange.start.row, currentRange.end.row);
|
|
50080
50396
|
this.table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_FILL_HANDLE, {});
|
|
50081
50397
|
}
|
|
50082
50398
|
endFillSelect() {
|
|
50083
50399
|
this.fillHandle.isFilling = false;
|
|
50084
50400
|
this.fillHandle.startX = undefined;
|
|
50085
50401
|
this.fillHandle.startY = undefined;
|
|
50086
|
-
this.
|
|
50087
|
-
this.
|
|
50088
|
-
|
|
50402
|
+
this.fillHandle.directionRow = undefined;
|
|
50403
|
+
const currentMinCol = Math.min(this.select.ranges[0].start.col, this.select.ranges[0].end.col);
|
|
50404
|
+
const currentMinRow = Math.min(this.select.ranges[0].start.row, this.select.ranges[0].end.row);
|
|
50405
|
+
const currentMaxCol = Math.max(this.select.ranges[0].start.col, this.select.ranges[0].end.col);
|
|
50406
|
+
const currentMaxRow = Math.max(this.select.ranges[0].start.row, this.select.ranges[0].end.row);
|
|
50407
|
+
if (this.fillHandle.beforeFillMinCol !== currentMinCol ||
|
|
50408
|
+
this.fillHandle.beforeFillMinRow !== currentMinRow ||
|
|
50409
|
+
this.fillHandle.beforeFillMaxCol !== currentMaxCol ||
|
|
50410
|
+
this.fillHandle.beforeFillMaxRow !== currentMaxRow) {
|
|
50411
|
+
this.table.eventManager.isDraging &&
|
|
50412
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.DRAG_FILL_HANDLE_END, { direction: this.fillHandle.direction });
|
|
50413
|
+
}
|
|
50414
|
+
this.fillHandle.beforeFillMaxCol = undefined;
|
|
50415
|
+
this.fillHandle.beforeFillMaxRow = undefined;
|
|
50416
|
+
this.fillHandle.beforeFillMinCol = undefined;
|
|
50417
|
+
this.fillHandle.beforeFillMinRow = undefined;
|
|
50089
50418
|
}
|
|
50090
50419
|
updateResizeCol(xInTable, yInTable) {
|
|
50091
50420
|
updateResizeColumn(xInTable, yInTable, this);
|
|
@@ -50132,13 +50461,44 @@
|
|
|
50132
50461
|
this.table.scenegraph.updateFrozenIcon(0, this.table.colCount - 1);
|
|
50133
50462
|
}
|
|
50134
50463
|
}
|
|
50464
|
+
checkVerticalScrollBarEnd() {
|
|
50465
|
+
const totalHeight = this.table.getAllRowsHeight();
|
|
50466
|
+
const scrollTop = this.scroll.verticalBarPos;
|
|
50467
|
+
const viewHeight = this.table.tableNoFrameHeight;
|
|
50468
|
+
if (scrollTop + viewHeight >= totalHeight) {
|
|
50469
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL_VERTICAL_END, {
|
|
50470
|
+
scrollTop,
|
|
50471
|
+
scrollLeft: this.scroll.horizontalBarPos,
|
|
50472
|
+
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
50473
|
+
scrollWidth: this.table.theme.scrollStyle?.width,
|
|
50474
|
+
viewHeight,
|
|
50475
|
+
viewWidth: this.table.tableNoFrameWidth
|
|
50476
|
+
});
|
|
50477
|
+
}
|
|
50478
|
+
}
|
|
50479
|
+
checkHorizontalScrollBarEnd() {
|
|
50480
|
+
const totalWidth = this.table.getAllColsWidth();
|
|
50481
|
+
const scrollLeft = this.scroll.horizontalBarPos;
|
|
50482
|
+
const viewWidth = this.table.tableNoFrameWidth;
|
|
50483
|
+
if (scrollLeft + viewWidth >= totalWidth) {
|
|
50484
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL_HORIZONTAL_END, {
|
|
50485
|
+
scrollTop: this.scroll.verticalBarPos,
|
|
50486
|
+
scrollLeft,
|
|
50487
|
+
scrollHeight: this.table.theme.scrollStyle?.width,
|
|
50488
|
+
scrollWidth: this.table.theme.scrollStyle?.width,
|
|
50489
|
+
viewHeight: this.table.tableNoFrameHeight,
|
|
50490
|
+
viewWidth
|
|
50491
|
+
});
|
|
50492
|
+
}
|
|
50493
|
+
}
|
|
50135
50494
|
updateVerticalScrollBar(yRatio) {
|
|
50136
50495
|
const totalHeight = this.table.getAllRowsHeight();
|
|
50496
|
+
const oldVerticalBarPos = this.scroll.verticalBarPos;
|
|
50137
50497
|
this.scroll.verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
|
|
50138
50498
|
this.table.scenegraph.setY(-this.scroll.verticalBarPos, yRatio === 1);
|
|
50139
50499
|
this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY;
|
|
50140
50500
|
this.table.scenegraph.proxy.deltaY = 0;
|
|
50141
|
-
this.
|
|
50501
|
+
this.updateHoverPos(-1, -1);
|
|
50142
50502
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
50143
50503
|
scrollTop: this.scroll.verticalBarPos,
|
|
50144
50504
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -50149,14 +50509,18 @@
|
|
|
50149
50509
|
scrollDirection: 'vertical',
|
|
50150
50510
|
scrollRatioY: yRatio
|
|
50151
50511
|
});
|
|
50512
|
+
if (oldVerticalBarPos !== this.scroll.verticalBarPos) {
|
|
50513
|
+
this.checkVerticalScrollBarEnd();
|
|
50514
|
+
}
|
|
50152
50515
|
}
|
|
50153
50516
|
updateHorizontalScrollBar(xRatio) {
|
|
50154
50517
|
const totalWidth = this.table.getAllColsWidth();
|
|
50518
|
+
const oldHorizontalBarPos = this.scroll.horizontalBarPos;
|
|
50155
50519
|
this.scroll.horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
|
|
50156
50520
|
this.table.scenegraph.setX(-this.scroll.horizontalBarPos, xRatio === 1);
|
|
50157
50521
|
this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX;
|
|
50158
50522
|
this.table.scenegraph.proxy.deltaX = 0;
|
|
50159
|
-
this.
|
|
50523
|
+
this.updateHoverPos(-1, -1);
|
|
50160
50524
|
this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
|
|
50161
50525
|
scrollTop: this.scroll.verticalBarPos,
|
|
50162
50526
|
scrollLeft: this.scroll.horizontalBarPos,
|
|
@@ -50167,14 +50531,18 @@
|
|
|
50167
50531
|
scrollDirection: 'horizontal',
|
|
50168
50532
|
scrollRatioX: xRatio
|
|
50169
50533
|
});
|
|
50534
|
+
if (oldHorizontalBarPos !== this.scroll.horizontalBarPos) {
|
|
50535
|
+
this.checkHorizontalScrollBarEnd();
|
|
50536
|
+
}
|
|
50170
50537
|
}
|
|
50171
50538
|
setScrollTop(top) {
|
|
50172
50539
|
const totalHeight = this.table.getAllRowsHeight();
|
|
50173
50540
|
top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height));
|
|
50174
50541
|
top = Math.ceil(top);
|
|
50175
50542
|
if (top !== this.scroll.verticalBarPos || this.table.isPivotChart()) {
|
|
50176
|
-
this.
|
|
50543
|
+
this.updateHoverPos(-1, -1);
|
|
50177
50544
|
}
|
|
50545
|
+
const oldVerticalBarPos = this.scroll.verticalBarPos;
|
|
50178
50546
|
this.scroll.verticalBarPos = top;
|
|
50179
50547
|
this.table.scenegraph.setY(-top);
|
|
50180
50548
|
const yRatio = top / (totalHeight - this.table.scenegraph.height);
|
|
@@ -50189,6 +50557,9 @@
|
|
|
50189
50557
|
scrollDirection: 'vertical',
|
|
50190
50558
|
scrollRatioY: yRatio
|
|
50191
50559
|
});
|
|
50560
|
+
if (oldVerticalBarPos !== top) {
|
|
50561
|
+
this.checkVerticalScrollBarEnd();
|
|
50562
|
+
}
|
|
50192
50563
|
}
|
|
50193
50564
|
setScrollLeft(left) {
|
|
50194
50565
|
const totalWidth = this.table.getAllColsWidth();
|
|
@@ -50196,8 +50567,9 @@
|
|
|
50196
50567
|
left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width));
|
|
50197
50568
|
left = Math.ceil(left);
|
|
50198
50569
|
if (left !== this.scroll.horizontalBarPos) {
|
|
50199
|
-
this.
|
|
50570
|
+
this.updateHoverPos(-1, -1);
|
|
50200
50571
|
}
|
|
50572
|
+
const oldHorizontalBarPos = this.scroll.horizontalBarPos;
|
|
50201
50573
|
this.scroll.horizontalBarPos = left;
|
|
50202
50574
|
this.table.scenegraph.setX(-left);
|
|
50203
50575
|
const xRatio = left / (totalWidth - this.table.scenegraph.width);
|
|
@@ -50212,6 +50584,9 @@
|
|
|
50212
50584
|
scrollDirection: 'horizontal',
|
|
50213
50585
|
scrollRatioX: xRatio
|
|
50214
50586
|
});
|
|
50587
|
+
if (oldHorizontalBarPos !== left) {
|
|
50588
|
+
this.checkHorizontalScrollBarEnd();
|
|
50589
|
+
}
|
|
50215
50590
|
}
|
|
50216
50591
|
hideVerticalScrollBar() {
|
|
50217
50592
|
this.table.scenegraph.component.hideVerticalScrollBar();
|
|
@@ -51131,7 +51506,7 @@
|
|
|
51131
51506
|
target: { col: eventArgsSet.eventArgs.col, row: eventArgsSet.eventArgs.row },
|
|
51132
51507
|
source: {
|
|
51133
51508
|
col: table.stateManager.columnMove.colSource,
|
|
51134
|
-
row: table.stateManager.columnMove.
|
|
51509
|
+
row: table.stateManager.columnMove.rowSource
|
|
51135
51510
|
}
|
|
51136
51511
|
});
|
|
51137
51512
|
}
|
|
@@ -51142,7 +51517,9 @@
|
|
|
51142
51517
|
table.stateManager.endFillSelect();
|
|
51143
51518
|
}
|
|
51144
51519
|
const eventArgsSet = getCellEventArgsSet(e);
|
|
51145
|
-
if (
|
|
51520
|
+
if (table.eventManager.isDraging &&
|
|
51521
|
+
eventArgsSet.eventArgs &&
|
|
51522
|
+
table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
|
|
51146
51523
|
const cellsEvent = {
|
|
51147
51524
|
event: e.nativeEvent,
|
|
51148
51525
|
cells: [],
|
|
@@ -52289,6 +52666,7 @@
|
|
|
52289
52666
|
}
|
|
52290
52667
|
else if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
|
|
52291
52668
|
this.table.scenegraph.updateAutoColWidth(resizeCol.col);
|
|
52669
|
+
this.table.internalProps._widthResizedColMap.add(resizeCol.col);
|
|
52292
52670
|
this.table.scenegraph.updateChartSize(resizeCol.col);
|
|
52293
52671
|
const state = this.table.stateManager;
|
|
52294
52672
|
if (state.columnResize.col < state.table.frozenColCount &&
|
|
@@ -52296,6 +52674,14 @@
|
|
|
52296
52674
|
!state.table.transpose) {
|
|
52297
52675
|
state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen);
|
|
52298
52676
|
}
|
|
52677
|
+
const colWidths = [];
|
|
52678
|
+
for (let col = 0; col < this.table.colCount; col++) {
|
|
52679
|
+
colWidths.push(this.table.getColWidth(col));
|
|
52680
|
+
}
|
|
52681
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
|
|
52682
|
+
col: resizeCol.col,
|
|
52683
|
+
colWidths
|
|
52684
|
+
});
|
|
52299
52685
|
}
|
|
52300
52686
|
}
|
|
52301
52687
|
});
|
|
@@ -52376,21 +52762,26 @@
|
|
|
52376
52762
|
if (Math.abs(this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y) >=
|
|
52377
52763
|
Math.abs(this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x)) {
|
|
52378
52764
|
this.table.stateManager.fillHandle.directionRow = true;
|
|
52379
|
-
if (this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y > 0) {
|
|
52380
|
-
this.table.stateManager.fillHandle.direction = 'top';
|
|
52381
|
-
}
|
|
52382
|
-
else {
|
|
52383
|
-
this.table.stateManager.fillHandle.direction = 'bottom';
|
|
52384
|
-
}
|
|
52385
52765
|
}
|
|
52386
52766
|
else {
|
|
52387
52767
|
this.table.stateManager.fillHandle.directionRow = false;
|
|
52388
|
-
|
|
52389
|
-
|
|
52390
|
-
|
|
52391
|
-
|
|
52392
|
-
|
|
52393
|
-
|
|
52768
|
+
}
|
|
52769
|
+
}
|
|
52770
|
+
if (Math.abs(this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y) >=
|
|
52771
|
+
Math.abs(this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x)) {
|
|
52772
|
+
if (this.table.stateManager.fillHandle.startY - eventArgsSet.abstractPos.y > 0) {
|
|
52773
|
+
this.table.stateManager.fillHandle.direction = 'top';
|
|
52774
|
+
}
|
|
52775
|
+
else {
|
|
52776
|
+
this.table.stateManager.fillHandle.direction = 'bottom';
|
|
52777
|
+
}
|
|
52778
|
+
}
|
|
52779
|
+
else {
|
|
52780
|
+
if (this.table.stateManager.fillHandle.startX - eventArgsSet.abstractPos.x > 0) {
|
|
52781
|
+
this.table.stateManager.fillHandle.direction = 'left';
|
|
52782
|
+
}
|
|
52783
|
+
else {
|
|
52784
|
+
this.table.stateManager.fillHandle.direction = 'right';
|
|
52394
52785
|
}
|
|
52395
52786
|
}
|
|
52396
52787
|
if (this.table.stateManager.fillHandle.directionRow) {
|
|
@@ -52434,8 +52825,8 @@
|
|
|
52434
52825
|
const { eventArgs } = eventArgsSet;
|
|
52435
52826
|
if (eventArgs) {
|
|
52436
52827
|
if (this.table.stateManager.select?.ranges?.length) {
|
|
52437
|
-
const lastCol = this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length - 1].end.col;
|
|
52438
|
-
const lastRow = this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length - 1].end.row;
|
|
52828
|
+
const lastCol = Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length - 1].start.col, this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length - 1].end.col);
|
|
52829
|
+
const lastRow = Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length - 1].start.row, this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length - 1].end.row);
|
|
52439
52830
|
const lastCellBound = this.table.scenegraph.highPerformanceGetCell(lastCol, lastRow).globalAABBBounds;
|
|
52440
52831
|
const distanceX = Math.abs(eventArgsSet.abstractPos.x - lastCellBound.x2);
|
|
52441
52832
|
const distanceY = Math.abs(eventArgsSet.abstractPos.y - lastCellBound.y2);
|
|
@@ -54833,7 +55224,7 @@
|
|
|
54833
55224
|
this.orient = option.orient ?? 'left';
|
|
54834
55225
|
this.visible = option.visible ?? true;
|
|
54835
55226
|
this.position = option.position ?? 'middle';
|
|
54836
|
-
this.selectedData = option.defaultSelected ??
|
|
55227
|
+
this.selectedData = option.defaultSelected ?? null;
|
|
54837
55228
|
this.createComponent();
|
|
54838
55229
|
this.initEvent();
|
|
54839
55230
|
}
|
|
@@ -55135,7 +55526,7 @@
|
|
|
55135
55526
|
this.orient = option.orient ?? 'left';
|
|
55136
55527
|
this.visible = option.visible ?? true;
|
|
55137
55528
|
this.position = option.position ?? 'middle';
|
|
55138
|
-
this.selectedData = option.defaultSelected ??
|
|
55529
|
+
this.selectedData = option.defaultSelected ?? null;
|
|
55139
55530
|
this.createComponent();
|
|
55140
55531
|
this.initEvent();
|
|
55141
55532
|
}
|
|
@@ -55742,7 +56133,7 @@
|
|
|
55742
56133
|
return TABLE_EVENT_TYPE;
|
|
55743
56134
|
}
|
|
55744
56135
|
options;
|
|
55745
|
-
version = "0.23.0
|
|
56136
|
+
version = "0.23.0";
|
|
55746
56137
|
pagination;
|
|
55747
56138
|
id = `VTable${Date.now()}`;
|
|
55748
56139
|
headerStyleCache;
|
|
@@ -55752,6 +56143,7 @@
|
|
|
55752
56143
|
isReleased = false;
|
|
55753
56144
|
_chartEventMap = {};
|
|
55754
56145
|
customCellStylePlugin;
|
|
56146
|
+
columnWidthComputeMode;
|
|
55755
56147
|
constructor(container, options = {}) {
|
|
55756
56148
|
super();
|
|
55757
56149
|
if (!container && options.mode !== 'node') {
|
|
@@ -55785,6 +56177,7 @@
|
|
|
55785
56177
|
this.tableNoFrameHeight = 0;
|
|
55786
56178
|
this.canvasWidth = canvasWidth;
|
|
55787
56179
|
this.canvasHeight = canvasHeight;
|
|
56180
|
+
this.columnWidthComputeMode = options.columnWidthComputeMode ?? 'normal';
|
|
55788
56181
|
const internalProps = (this.internalProps = {});
|
|
55789
56182
|
showFrozenIcon !== undefined && (this.showFrozenIcon = showFrozenIcon);
|
|
55790
56183
|
if (typeof allowFrozenColCount === 'number' && allowFrozenColCount <= 0) {
|
|
@@ -56218,6 +56611,22 @@
|
|
|
56218
56611
|
}
|
|
56219
56612
|
return this.defaultRowHeight;
|
|
56220
56613
|
}
|
|
56614
|
+
getDefaultColumnWidth(col) {
|
|
56615
|
+
if (this.isRowHeader(col, 0) || this.isCornerHeader(col, 0)) {
|
|
56616
|
+
return Array.isArray(this.defaultHeaderColWidth)
|
|
56617
|
+
? this.defaultHeaderColWidth[col] ?? this.defaultColWidth
|
|
56618
|
+
: this.defaultHeaderColWidth;
|
|
56619
|
+
}
|
|
56620
|
+
else if (this.isRightFrozenColumn(col, this.columnHeaderLevelCount)) {
|
|
56621
|
+
if (this.isPivotTable()) {
|
|
56622
|
+
return Array.isArray(this.defaultHeaderColWidth)
|
|
56623
|
+
? this.defaultHeaderColWidth[this.rowHeaderLevelCount - this.rightFrozenColCount] ?? this.defaultColWidth
|
|
56624
|
+
: this.defaultHeaderColWidth;
|
|
56625
|
+
}
|
|
56626
|
+
return this.defaultColWidth;
|
|
56627
|
+
}
|
|
56628
|
+
return this.defaultColWidth;
|
|
56629
|
+
}
|
|
56221
56630
|
getDefaultRowHeight(row) {
|
|
56222
56631
|
if (this.isColumnHeader(0, row) || this.isCornerHeader(0, row)) {
|
|
56223
56632
|
return Array.isArray(this.defaultHeaderRowHeight)
|
|
@@ -56272,32 +56681,14 @@
|
|
|
56272
56681
|
else if (width) {
|
|
56273
56682
|
return width;
|
|
56274
56683
|
}
|
|
56275
|
-
|
|
56276
|
-
return Array.isArray(this.defaultHeaderColWidth)
|
|
56277
|
-
? this.defaultHeaderColWidth[col] ?? this.defaultColWidth
|
|
56278
|
-
: this.defaultHeaderColWidth;
|
|
56279
|
-
}
|
|
56280
|
-
else if (this.isRightFrozenColumn(col, this.columnHeaderLevelCount)) {
|
|
56281
|
-
if (this.isPivotTable()) {
|
|
56282
|
-
return Array.isArray(this.defaultHeaderColWidth)
|
|
56283
|
-
? this.defaultHeaderColWidth[this.rowHeaderLevelCount - this.rightFrozenColCount] ?? this.defaultColWidth
|
|
56284
|
-
: this.defaultHeaderColWidth;
|
|
56285
|
-
}
|
|
56286
|
-
return this.defaultColWidth;
|
|
56287
|
-
}
|
|
56288
|
-
return this.defaultColWidth;
|
|
56684
|
+
return this.getDefaultColumnWidth(col);
|
|
56289
56685
|
}
|
|
56290
56686
|
getColWidthDefinedNumber(col) {
|
|
56291
56687
|
const width = this.getColWidthDefined(col);
|
|
56292
56688
|
return this._adjustColWidth(col, this._colWidthDefineToPxWidth(width));
|
|
56293
56689
|
}
|
|
56294
56690
|
getColWidth(col) {
|
|
56295
|
-
const width = this.colWidthsMap.get(col) ??
|
|
56296
|
-
(col < this.rowHeaderLevelCount
|
|
56297
|
-
? Array.isArray(this.defaultHeaderColWidth)
|
|
56298
|
-
? this.defaultHeaderColWidth[col] ?? this.defaultColWidth
|
|
56299
|
-
: this.defaultHeaderColWidth
|
|
56300
|
-
: this.defaultColWidth);
|
|
56691
|
+
const width = this.colWidthsMap.get(col) ?? this.getDefaultColumnWidth(col);
|
|
56301
56692
|
if ((this.widthMode === 'adaptive' && typeof width === 'number') ||
|
|
56302
56693
|
(this.transpose && typeof width === 'number')) {
|
|
56303
56694
|
return this._colWidthDefineToPxWidth(width);
|
|
@@ -56955,14 +57346,20 @@
|
|
|
56955
57346
|
}
|
|
56956
57347
|
getBottomFrozenRowsHeight() {
|
|
56957
57348
|
if (this.bottomFrozenRowCount > 0) {
|
|
56958
|
-
|
|
57349
|
+
let height = 0;
|
|
57350
|
+
for (let row = this.rowCount - this.bottomFrozenRowCount; row <= this.rowCount - 1; row++) {
|
|
57351
|
+
height += this.getRowHeight(row);
|
|
57352
|
+
}
|
|
56959
57353
|
return height;
|
|
56960
57354
|
}
|
|
56961
57355
|
return 0;
|
|
56962
57356
|
}
|
|
56963
57357
|
getRightFrozenColsWidth() {
|
|
56964
57358
|
if (this.rightFrozenColCount > 0) {
|
|
56965
|
-
|
|
57359
|
+
let width = 0;
|
|
57360
|
+
for (let col = this.colCount - this.rightFrozenColCount; col <= this.colCount - 1; col++) {
|
|
57361
|
+
width += this.getColWidth(col);
|
|
57362
|
+
}
|
|
56966
57363
|
return width;
|
|
56967
57364
|
}
|
|
56968
57365
|
return 0;
|
|
@@ -58008,13 +58405,23 @@
|
|
|
58008
58405
|
return customLayout;
|
|
58009
58406
|
}
|
|
58010
58407
|
hasAutoImageColumn() {
|
|
58011
|
-
|
|
58012
|
-
if ((column.cellType === 'image' || typeof column.cellType === 'function') &&
|
|
58408
|
+
const bodyColumn = this.internalProps.layoutMap.columnObjects.find((column) => {
|
|
58409
|
+
if ((column.cellType === 'image' || column.cellType === 'video' || typeof column.cellType === 'function') &&
|
|
58013
58410
|
column.define.imageAutoSizing) {
|
|
58014
58411
|
return true;
|
|
58015
58412
|
}
|
|
58016
58413
|
return false;
|
|
58017
58414
|
});
|
|
58415
|
+
const headerObj = this.internalProps.layoutMap.headerObjects.find((column) => {
|
|
58416
|
+
if (column) {
|
|
58417
|
+
if ((column.headerType === 'image' || column.headerType === 'video' || typeof column.headerType === 'function') &&
|
|
58418
|
+
column.define.imageAutoSizing) {
|
|
58419
|
+
return true;
|
|
58420
|
+
}
|
|
58421
|
+
}
|
|
58422
|
+
return false;
|
|
58423
|
+
});
|
|
58424
|
+
return bodyColumn || headerObj;
|
|
58018
58425
|
}
|
|
58019
58426
|
_getActiveChartInstance() {
|
|
58020
58427
|
const cellGroup = this.scenegraph.getCell(this.stateManager.hover?.cellPos?.col, this.stateManager.hover?.cellPos?.row);
|
|
@@ -59372,11 +59779,32 @@
|
|
|
59372
59779
|
get hasAggregationOnBottomCount() {
|
|
59373
59780
|
return this._hasAggregationOnBottomCount;
|
|
59374
59781
|
}
|
|
59375
|
-
|
|
59782
|
+
getAggregatorsByCell(col, row) {
|
|
59376
59783
|
const column = this.getBody(col, row);
|
|
59377
59784
|
const aggregators = column.aggregator;
|
|
59378
59785
|
return aggregators;
|
|
59379
59786
|
}
|
|
59787
|
+
getAggregatorsByCellRange(startCol, startRow, endCol, endRow) {
|
|
59788
|
+
let aggregators = [];
|
|
59789
|
+
if (this.transpose) {
|
|
59790
|
+
for (let i = startRow; i <= endRow; i++) {
|
|
59791
|
+
const column = this.getBody(startCol, i);
|
|
59792
|
+
if (column.aggregator) {
|
|
59793
|
+
aggregators = aggregators.concat(Array.isArray(column.aggregator) ? column.aggregator : [column.aggregator]);
|
|
59794
|
+
}
|
|
59795
|
+
}
|
|
59796
|
+
}
|
|
59797
|
+
else {
|
|
59798
|
+
for (let i = startCol; i <= endCol; i++) {
|
|
59799
|
+
const column = this.getBody(i, startRow);
|
|
59800
|
+
if (column.aggregator) {
|
|
59801
|
+
aggregators = aggregators.concat(Array.isArray(column.aggregator) ? column.aggregator : [column.aggregator]);
|
|
59802
|
+
}
|
|
59803
|
+
}
|
|
59804
|
+
return aggregators;
|
|
59805
|
+
}
|
|
59806
|
+
return [];
|
|
59807
|
+
}
|
|
59380
59808
|
getAggregatorOnTop(col, row) {
|
|
59381
59809
|
const column = this.getBody(col, row);
|
|
59382
59810
|
const aggregators = column.aggregator;
|
|
@@ -59427,26 +59855,34 @@
|
|
|
59427
59855
|
}
|
|
59428
59856
|
return null;
|
|
59429
59857
|
}
|
|
59430
|
-
|
|
59858
|
+
getAggregatorCellAddress(startCol, startRow, endCol, endRow) {
|
|
59431
59859
|
const cellAddrs = [];
|
|
59860
|
+
const topCount = this.hasAggregationOnTopCount;
|
|
59861
|
+
const bottomCount = this.hasAggregationOnBottomCount;
|
|
59432
59862
|
if (this.transpose) {
|
|
59433
|
-
|
|
59434
|
-
|
|
59435
|
-
|
|
59436
|
-
|
|
59437
|
-
|
|
59438
|
-
|
|
59439
|
-
|
|
59863
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
59864
|
+
const column = this.getBody(startCol, row);
|
|
59865
|
+
if (column.aggregator) {
|
|
59866
|
+
for (let i = 0; i < topCount; i++) {
|
|
59867
|
+
cellAddrs.push({ col: this.headerLevelCount + i, row });
|
|
59868
|
+
}
|
|
59869
|
+
for (let i = 0; i < bottomCount; i++) {
|
|
59870
|
+
cellAddrs.push({ col: this.rowCount - bottomCount + i, row });
|
|
59871
|
+
}
|
|
59872
|
+
}
|
|
59440
59873
|
}
|
|
59441
59874
|
}
|
|
59442
59875
|
else {
|
|
59443
|
-
|
|
59444
|
-
|
|
59445
|
-
|
|
59446
|
-
|
|
59447
|
-
|
|
59448
|
-
|
|
59449
|
-
|
|
59876
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
59877
|
+
const column = this.getBody(col, startRow);
|
|
59878
|
+
if (column.aggregator) {
|
|
59879
|
+
for (let i = 0; i < topCount; i++) {
|
|
59880
|
+
cellAddrs.push({ col, row: this.headerLevelCount + i });
|
|
59881
|
+
}
|
|
59882
|
+
for (let i = 0; i < bottomCount; i++) {
|
|
59883
|
+
cellAddrs.push({ col, row: this.rowCount - bottomCount + i });
|
|
59884
|
+
}
|
|
59885
|
+
}
|
|
59450
59886
|
}
|
|
59451
59887
|
}
|
|
59452
59888
|
return cellAddrs;
|
|
@@ -60540,8 +60976,10 @@
|
|
|
60540
60976
|
if (this.table.internalProps.layoutMap?.isAggregation?.(col, row)) {
|
|
60541
60977
|
return;
|
|
60542
60978
|
}
|
|
60979
|
+
if (!this.editingEditor) {
|
|
60980
|
+
this.editCell = { col, row };
|
|
60981
|
+
}
|
|
60543
60982
|
this.editingEditor = editor;
|
|
60544
|
-
this.editCell = { col, row };
|
|
60545
60983
|
const dataValue = this.table.getCellOriginValue(col, row);
|
|
60546
60984
|
const rect = this.table.getCellRangeRelativeRect(this.table.getCellRange(col, row));
|
|
60547
60985
|
const referencePosition = { rect: { left: rect.left, top: rect.top, width: rect.width, height: rect.height } };
|
|
@@ -60580,12 +61018,14 @@
|
|
|
60580
61018
|
}
|
|
60581
61019
|
}
|
|
60582
61020
|
if (!this.editingEditor.getValue) ;
|
|
60583
|
-
|
|
60584
|
-
|
|
60585
|
-
|
|
60586
|
-
|
|
60587
|
-
|
|
60588
|
-
|
|
61021
|
+
if (!this.editingEditor.validateValue || this.editingEditor.validateValue?.()) {
|
|
61022
|
+
const changedValue = this.editingEditor.getValue?.();
|
|
61023
|
+
this.table.changeCellValue(this.editCell.col, this.editCell.row, changedValue);
|
|
61024
|
+
this.editingEditor.exit && (void 0);
|
|
61025
|
+
this.editingEditor.exit?.();
|
|
61026
|
+
this.editingEditor.onEnd?.();
|
|
61027
|
+
this.editingEditor = null;
|
|
61028
|
+
}
|
|
60589
61029
|
}
|
|
60590
61030
|
cancelEdit() {
|
|
60591
61031
|
if (this.editingEditor) {
|
|
@@ -60665,10 +61105,10 @@
|
|
|
60665
61105
|
return this.internalProps.sortState;
|
|
60666
61106
|
}
|
|
60667
61107
|
get records() {
|
|
60668
|
-
return this.dataSource?.
|
|
61108
|
+
return this.dataSource?.records;
|
|
60669
61109
|
}
|
|
60670
61110
|
get recordsCount() {
|
|
60671
|
-
return this.dataSource.
|
|
61111
|
+
return this.dataSource.records.length;
|
|
60672
61112
|
}
|
|
60673
61113
|
updateColumns(columns) {
|
|
60674
61114
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
@@ -61233,7 +61673,6 @@
|
|
|
61233
61673
|
}
|
|
61234
61674
|
updateFilterRules(filterRules) {
|
|
61235
61675
|
this.scenegraph.clearCells();
|
|
61236
|
-
this.internalProps.dataConfig.filterRules = filterRules;
|
|
61237
61676
|
if (this.sortState) {
|
|
61238
61677
|
this.dataSource.updateFilterRulesForSorted(filterRules);
|
|
61239
61678
|
sortRecords(this);
|
|
@@ -61266,6 +61705,9 @@
|
|
|
61266
61705
|
return undefined;
|
|
61267
61706
|
}
|
|
61268
61707
|
setRecords(records, option) {
|
|
61708
|
+
this.internalProps.dataSource?.release();
|
|
61709
|
+
this.internalProps.releaseList = this.internalProps.releaseList?.filter((item) => !item.dataSourceObj);
|
|
61710
|
+
this.internalProps.dataSource = null;
|
|
61269
61711
|
let sort;
|
|
61270
61712
|
if (Array.isArray(option) || option?.order) {
|
|
61271
61713
|
sort = option;
|
|
@@ -61379,69 +61821,72 @@
|
|
|
61379
61821
|
}
|
|
61380
61822
|
return isValid$3(editorDefine);
|
|
61381
61823
|
}
|
|
61382
|
-
changeCellValue(col, row, value) {
|
|
61383
|
-
|
|
61384
|
-
|
|
61385
|
-
|
|
61386
|
-
|
|
61387
|
-
this.
|
|
61388
|
-
|
|
61389
|
-
else {
|
|
61390
|
-
this.dataSource.changeFieldValue(value, recordIndex, field, col, row, this);
|
|
61391
|
-
}
|
|
61392
|
-
const aggregators = this.internalProps.layoutMap.getAggregators(col, row);
|
|
61393
|
-
if (aggregators) {
|
|
61394
|
-
if (Array.isArray(aggregators)) {
|
|
61395
|
-
for (let i = 0; i < aggregators?.length; i++) {
|
|
61396
|
-
aggregators[i].recalculate();
|
|
61397
|
-
}
|
|
61824
|
+
changeCellValue(col, row, value, workOnEditableCell = false) {
|
|
61825
|
+
if ((workOnEditableCell && this.isHasEditorDefine(col, row)) || workOnEditableCell === false) {
|
|
61826
|
+
const recordIndex = this.getRecordShowIndexByCell(col, row);
|
|
61827
|
+
const { field } = this.internalProps.layoutMap.getBody(col, row);
|
|
61828
|
+
const beforeChangeValue = this.getCellRawValue(col, row);
|
|
61829
|
+
if (this.isHeader(col, row)) {
|
|
61830
|
+
this.internalProps.layoutMap.updateColumnTitle(col, row, value);
|
|
61398
61831
|
}
|
|
61399
61832
|
else {
|
|
61400
|
-
|
|
61401
|
-
}
|
|
61402
|
-
const
|
|
61403
|
-
|
|
61404
|
-
|
|
61405
|
-
|
|
61406
|
-
for (let
|
|
61407
|
-
|
|
61833
|
+
this.dataSource.changeFieldValue(value, recordIndex, field, col, row, this);
|
|
61834
|
+
}
|
|
61835
|
+
const range = this.getCellRange(col, row);
|
|
61836
|
+
const aggregators = this.internalProps.layoutMap.getAggregatorsByCell(col, row);
|
|
61837
|
+
if (aggregators) {
|
|
61838
|
+
if (Array.isArray(aggregators)) {
|
|
61839
|
+
for (let i = 0; i < aggregators?.length; i++) {
|
|
61840
|
+
aggregators[i].recalculate();
|
|
61841
|
+
}
|
|
61842
|
+
}
|
|
61843
|
+
else {
|
|
61844
|
+
aggregators.recalculate();
|
|
61845
|
+
}
|
|
61846
|
+
const aggregatorCells = this.internalProps.layoutMap.getAggregatorCellAddress(range.start.col, range.start.row, range.end.col, range.end.row);
|
|
61847
|
+
for (let i = 0; i < aggregatorCells.length; i++) {
|
|
61848
|
+
const range = this.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);
|
|
61849
|
+
for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {
|
|
61850
|
+
for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {
|
|
61851
|
+
this.scenegraph.updateCellContent(sCol, sRow);
|
|
61852
|
+
}
|
|
61408
61853
|
}
|
|
61409
61854
|
}
|
|
61410
61855
|
}
|
|
61411
|
-
|
|
61412
|
-
|
|
61413
|
-
|
|
61414
|
-
|
|
61415
|
-
this.scenegraph.updateCellContent(sCol, sRow);
|
|
61856
|
+
for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {
|
|
61857
|
+
for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {
|
|
61858
|
+
this.scenegraph.updateCellContent(sCol, sRow);
|
|
61859
|
+
}
|
|
61416
61860
|
}
|
|
61417
|
-
|
|
61418
|
-
|
|
61419
|
-
|
|
61420
|
-
|
|
61861
|
+
if (this.widthMode === 'adaptive' || (this.autoFillWidth && this.getAllColsWidth() <= this.tableNoFrameWidth)) {
|
|
61862
|
+
if (this.internalProps._widthResizedColMap.size === 0) {
|
|
61863
|
+
this.scenegraph.recalculateColWidths();
|
|
61864
|
+
}
|
|
61421
61865
|
}
|
|
61422
|
-
|
|
61423
|
-
|
|
61424
|
-
|
|
61425
|
-
|
|
61426
|
-
|
|
61427
|
-
|
|
61866
|
+
else if (!this.internalProps._widthResizedColMap.has(col)) {
|
|
61867
|
+
const oldWidth = this.getColWidth(col);
|
|
61868
|
+
const newWidth = computeColWidth(col, 0, this.rowCount - 1, this, false);
|
|
61869
|
+
if (newWidth !== oldWidth) {
|
|
61870
|
+
this.scenegraph.updateColWidth(col, newWidth - oldWidth);
|
|
61871
|
+
}
|
|
61428
61872
|
}
|
|
61873
|
+
if (this.heightMode === 'adaptive' ||
|
|
61874
|
+
(this.autoFillHeight && this.getAllRowsHeight() <= this.tableNoFrameHeight)) {
|
|
61875
|
+
this.scenegraph.recalculateRowHeights();
|
|
61876
|
+
}
|
|
61877
|
+
else if (this.heightMode === 'autoHeight') {
|
|
61878
|
+
const oldHeight = this.getRowHeight(row);
|
|
61879
|
+
const newHeight = computeRowHeight(row, 0, this.colCount - 1, this);
|
|
61880
|
+
this.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
61881
|
+
}
|
|
61882
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
61883
|
+
col,
|
|
61884
|
+
row,
|
|
61885
|
+
rawValue: beforeChangeValue,
|
|
61886
|
+
changedValue: this.getCellOriginValue(col, row)
|
|
61887
|
+
});
|
|
61888
|
+
this.scenegraph.updateNextFrame();
|
|
61429
61889
|
}
|
|
61430
|
-
if (this.heightMode === 'adaptive' || (this.autoFillHeight && this.getAllRowsHeight() <= this.tableNoFrameHeight)) {
|
|
61431
|
-
this.scenegraph.recalculateRowHeights();
|
|
61432
|
-
}
|
|
61433
|
-
else if (this.heightMode === 'autoHeight') {
|
|
61434
|
-
const oldHeight = this.getRowHeight(row);
|
|
61435
|
-
const newHeight = computeRowHeight(row, 0, this.colCount - 1, this);
|
|
61436
|
-
this.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
61437
|
-
}
|
|
61438
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
61439
|
-
col,
|
|
61440
|
-
row,
|
|
61441
|
-
rawValue: beforeChangeValue,
|
|
61442
|
-
changedValue: this.getCellOriginValue(col, row)
|
|
61443
|
-
});
|
|
61444
|
-
this.scenegraph.updateNextFrame();
|
|
61445
61890
|
}
|
|
61446
61891
|
changeCellValues(startCol, startRow, values, workOnEditableCell = false) {
|
|
61447
61892
|
let pasteColEnd = startCol;
|
|
@@ -61482,6 +61927,21 @@
|
|
|
61482
61927
|
}
|
|
61483
61928
|
const startRange = this.getCellRange(startCol, startRow);
|
|
61484
61929
|
const range = this.getCellRange(pasteColEnd, pasteRowEnd);
|
|
61930
|
+
const aggregators = this.internalProps.layoutMap.getAggregatorsByCellRange(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
61931
|
+
if (aggregators) {
|
|
61932
|
+
for (let i = 0; i < aggregators?.length; i++) {
|
|
61933
|
+
aggregators[i].recalculate();
|
|
61934
|
+
}
|
|
61935
|
+
const aggregatorCells = this.internalProps.layoutMap.getAggregatorCellAddress(startRange.start.col, startRange.start.row, range.end.col, range.end.row);
|
|
61936
|
+
for (let i = 0; i < aggregatorCells.length; i++) {
|
|
61937
|
+
const range = this.getCellRange(aggregatorCells[i].col, aggregatorCells[i].row);
|
|
61938
|
+
for (let sCol = range.start.col; sCol <= range.end.col; sCol++) {
|
|
61939
|
+
for (let sRow = range.start.row; sRow <= range.end.row; sRow++) {
|
|
61940
|
+
this.scenegraph.updateCellContent(sCol, sRow);
|
|
61941
|
+
}
|
|
61942
|
+
}
|
|
61943
|
+
}
|
|
61944
|
+
}
|
|
61485
61945
|
for (let sCol = startRange.start.col; sCol <= range.end.col; sCol++) {
|
|
61486
61946
|
for (let sRow = startRange.start.row; sRow <= range.end.row; sRow++) {
|
|
61487
61947
|
this.scenegraph.updateCellContent(sCol, sRow);
|
|
@@ -62009,7 +62469,13 @@
|
|
|
62009
62469
|
this.hasTwoIndicatorAxes = this._indicators.some(indicatorObject => {
|
|
62010
62470
|
if (indicatorObject.chartSpec &&
|
|
62011
62471
|
indicatorObject.chartSpec.series &&
|
|
62012
|
-
indicatorObject.chartSpec.series.length > 1
|
|
62472
|
+
indicatorObject.chartSpec.series.length > 1 &&
|
|
62473
|
+
indicatorObject.chartSpec.axes?.every((axis) => {
|
|
62474
|
+
if (axis.orient === (this.indicatorsAsCol ? 'top' : 'right') && axis.visible === false) {
|
|
62475
|
+
return false;
|
|
62476
|
+
}
|
|
62477
|
+
return true;
|
|
62478
|
+
})) {
|
|
62013
62479
|
return true;
|
|
62014
62480
|
}
|
|
62015
62481
|
return false;
|
|
@@ -66259,41 +66725,44 @@
|
|
|
66259
66725
|
}
|
|
66260
66726
|
return isValid$3(editorDefine);
|
|
66261
66727
|
}
|
|
66262
|
-
changeCellValue(col, row, value) {
|
|
66263
|
-
|
|
66264
|
-
|
|
66265
|
-
|
|
66266
|
-
|
|
66267
|
-
|
|
66268
|
-
this._changeCellValueToDataSet(col, row, newValue);
|
|
66269
|
-
this.scenegraph.updateCellContent(col, row);
|
|
66270
|
-
if (this.widthMode === 'adaptive' || (this.autoFillWidth && this.getAllColsWidth() <= this.tableNoFrameWidth)) {
|
|
66271
|
-
if (this.internalProps._widthResizedColMap.size === 0) {
|
|
66272
|
-
this.scenegraph.recalculateColWidths();
|
|
66728
|
+
changeCellValue(col, row, value, workOnEditableCell = false) {
|
|
66729
|
+
if ((workOnEditableCell && this.isHasEditorDefine(col, row)) || workOnEditableCell === false) {
|
|
66730
|
+
let newValue = value;
|
|
66731
|
+
const rawValue = this.getCellRawValue(col, row);
|
|
66732
|
+
if (typeof rawValue === 'number' && isAllDigits(value)) {
|
|
66733
|
+
newValue = parseFloat(value);
|
|
66273
66734
|
}
|
|
66274
|
-
|
|
66275
|
-
|
|
66276
|
-
|
|
66277
|
-
|
|
66278
|
-
|
|
66279
|
-
|
|
66735
|
+
this._changeCellValueToDataSet(col, row, newValue);
|
|
66736
|
+
this.scenegraph.updateCellContent(col, row);
|
|
66737
|
+
if (this.widthMode === 'adaptive' || (this.autoFillWidth && this.getAllColsWidth() <= this.tableNoFrameWidth)) {
|
|
66738
|
+
if (this.internalProps._widthResizedColMap.size === 0) {
|
|
66739
|
+
this.scenegraph.recalculateColWidths();
|
|
66740
|
+
}
|
|
66280
66741
|
}
|
|
66742
|
+
else if (!this.internalProps._widthResizedColMap.has(col)) {
|
|
66743
|
+
const oldWidth = this.getColWidth(col);
|
|
66744
|
+
const newWidth = computeColWidth(col, 0, this.rowCount - 1, this, false);
|
|
66745
|
+
if (newWidth !== oldWidth) {
|
|
66746
|
+
this.scenegraph.updateColWidth(col, newWidth - oldWidth);
|
|
66747
|
+
}
|
|
66748
|
+
}
|
|
66749
|
+
if (this.heightMode === 'adaptive' ||
|
|
66750
|
+
(this.autoFillHeight && this.getAllRowsHeight() <= this.tableNoFrameHeight)) {
|
|
66751
|
+
this.scenegraph.recalculateRowHeights();
|
|
66752
|
+
}
|
|
66753
|
+
else if (this.heightMode === 'autoHeight') {
|
|
66754
|
+
const oldHeight = this.getRowHeight(row);
|
|
66755
|
+
const newHeight = computeRowHeight(row, 0, this.colCount - 1, this);
|
|
66756
|
+
this.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
66757
|
+
}
|
|
66758
|
+
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
66759
|
+
col,
|
|
66760
|
+
row,
|
|
66761
|
+
rawValue: this.getCellRawValue(col, row),
|
|
66762
|
+
changedValue: newValue
|
|
66763
|
+
});
|
|
66764
|
+
this.scenegraph.updateNextFrame();
|
|
66281
66765
|
}
|
|
66282
|
-
if (this.heightMode === 'adaptive' || (this.autoFillHeight && this.getAllRowsHeight() <= this.tableNoFrameHeight)) {
|
|
66283
|
-
this.scenegraph.recalculateRowHeights();
|
|
66284
|
-
}
|
|
66285
|
-
else if (this.heightMode === 'autoHeight') {
|
|
66286
|
-
const oldHeight = this.getRowHeight(row);
|
|
66287
|
-
const newHeight = computeRowHeight(row, 0, this.colCount - 1, this);
|
|
66288
|
-
this.scenegraph.updateRowHeight(row, newHeight - oldHeight);
|
|
66289
|
-
}
|
|
66290
|
-
this.fireListeners(TABLE_EVENT_TYPE.CHANGE_CELL_VALUE, {
|
|
66291
|
-
col,
|
|
66292
|
-
row,
|
|
66293
|
-
rawValue: this.getCellRawValue(col, row),
|
|
66294
|
-
changedValue: newValue
|
|
66295
|
-
});
|
|
66296
|
-
this.scenegraph.updateNextFrame();
|
|
66297
66766
|
}
|
|
66298
66767
|
changeCellValues(startCol, startRow, values, workOnEditableCell = false) {
|
|
66299
66768
|
let pasteColEnd = startCol;
|
|
@@ -67830,7 +68299,7 @@
|
|
|
67830
68299
|
}
|
|
67831
68300
|
|
|
67832
68301
|
registerForVrender();
|
|
67833
|
-
const version = "0.23.0
|
|
68302
|
+
const version = "0.23.0";
|
|
67834
68303
|
function getIcons() {
|
|
67835
68304
|
return get$2();
|
|
67836
68305
|
}
|