1
1
import { default as Table , TableProps , ColumnType } from "antd/es/table" ;
2
- import { TableCellContext , TableRowContext } from "comps/comps/tableComp /tableContext" ;
3
- import { TableToolbar } from "comps/comps/tableComp /tableToolbarComp" ;
4
- import { RowColorViewType , RowHeightViewType , TableEventOptionValues } from "comps/comps/tableComp /tableTypes" ;
2
+ import { TableCellContext , TableRowContext } from "comps/comps/tableLiteComp /tableContext" ;
3
+ import { TableToolbar } from "comps/comps/tableLiteComp /tableToolbarComp" ;
4
+ import { RowColorViewType , RowHeightViewType , TableEventOptionValues } from "comps/comps/tableLiteComp /tableTypes" ;
5
5
import {
6
6
COL_MIN_WIDTH ,
7
7
COLUMN_CHILDREN_KEY ,
@@ -12,7 +12,7 @@ import {
12
12
onTableChange ,
13
13
RecordType ,
14
14
supportChildrenTree ,
15
- } from "comps/comps/tableComp /tableUtils" ;
15
+ } from "comps/comps/tableLiteComp /tableUtils" ;
16
16
import {
17
17
handleToHoverRow ,
18
18
handleToSelectedRow ,
@@ -870,14 +870,12 @@ export const TableCompView = React.memo((props: {
870
870
const size = useMemo ( ( ) => compChildren . size . getView ( ) , [ compChildren . size ] ) ;
871
871
const editModeClicks = useMemo ( ( ) => compChildren . editModeClicks . getView ( ) , [ compChildren . editModeClicks ] ) ;
872
872
const onEvent = useMemo ( ( ) => compChildren . onEvent . getView ( ) , [ compChildren . onEvent ] ) ;
873
- const currentExpandedRows = useMemo ( ( ) => compChildren . currentExpandedRows . getView ( ) , [ compChildren . currentExpandedRows ] ) ;
874
873
const dynamicColumn = compChildren . dynamicColumn . getView ( ) ;
875
874
const dynamicColumnConfig = useMemo (
876
875
( ) => compChildren . dynamicColumnConfig . getView ( ) ,
877
876
[ compChildren . dynamicColumnConfig ]
878
877
) ;
879
878
const columnsAggrData = comp . columnAggrData ;
880
- const expansion = useMemo ( ( ) => compChildren . expansion . getView ( ) , [ compChildren . expansion ] ) ;
881
879
const antdColumns = useMemo (
882
880
( ) =>
883
881
columnsToAntdFormat (
@@ -970,17 +968,7 @@ export const TableCompView = React.memo((props: {
970
968
updateEmptyRows ( ) ;
971
969
} , [ updateEmptyRows ] ) ;
972
970
973
- useUpdateEffect ( ( ) => {
974
- if ( ! isEqual ( currentExpandedRows , expandedRowKeys ) ) {
975
- compChildren . currentExpandedRows . dispatchChangeValueAction ( expandedRowKeys ) ;
976
- }
977
- } , [ expandedRowKeys ] ) ;
978
971
979
- useUpdateEffect ( ( ) => {
980
- if ( ! isEqual ( currentExpandedRows , expandedRowKeys ) ) {
981
- setExpandedRowKeys ( currentExpandedRows ) ;
982
- }
983
- } , [ currentExpandedRows ] ) ;
984
972
985
973
const pageDataInfo = useMemo ( ( ) => {
986
974
// Data pagination
@@ -1032,7 +1020,7 @@ export const TableCompView = React.memo((props: {
1032
1020
total : pageDataInfo . total ,
1033
1021
current : pageDataInfo . current ,
1034
1022
} }
1035
- columns = { columns }
1023
+ columns = { columns as any }
1036
1024
onRefresh = { ( ) =>
1037
1025
onRefresh (
1038
1026
editorState . queryCompInfoList ( ) . map ( ( info ) => info . name ) ,
@@ -1062,7 +1050,6 @@ export const TableCompView = React.memo((props: {
1062
1050
tableSize = { size }
1063
1051
istoolbarPositionBelow = { toolbar . position === "below" }
1064
1052
multiSelectEnabled = { compChildren . selection . children . mode . value === 'multiple' }
1065
- expandableRows = { Boolean ( expansion . expandModalView ) }
1066
1053
summaryRows = { parseInt ( summaryRows ) }
1067
1054
columns = { columns }
1068
1055
summaryRowStyle = { summaryRowStyle }
@@ -1119,31 +1106,12 @@ export const TableCompView = React.memo((props: {
1119
1106
$showHRowGridBorder = { showHRowGridBorder }
1120
1107
>
1121
1108
< ResizeableTable < RecordType >
1122
- expandable = { {
1123
- ...expansion . expandableConfig ,
1124
- childrenColumnName : supportChildren
1125
- ? COLUMN_CHILDREN_KEY
1126
- : "OB_CHILDREN_KEY_PLACEHOLDER" ,
1127
- fixed : "left" ,
1128
- onExpand : ( expanded ) => {
1129
- if ( expanded ) {
1130
- handleChangeEvent ( 'rowExpand' )
1131
- } else {
1132
- handleChangeEvent ( 'rowShrink' )
1133
- }
1134
- } ,
1135
- onExpandedRowsChange : ( expandedRowKeys ) => {
1136
- setExpandedRowKeys ( expandedRowKeys as unknown as string [ ] ) ;
1137
- } ,
1138
- expandedRowKeys : expandedRowKeys ,
1139
- } }
1140
- // rowKey={OB_ROW_ORI_INDEX}
1141
1109
rowColorFn = { compChildren . rowColor . getView ( ) as any }
1142
1110
rowHeightFn = { compChildren . rowHeight . getView ( ) as any }
1143
1111
{ ...compChildren . selection . getView ( ) ( onEvent ) }
1144
1112
bordered = { compChildren . showRowGridBorder . getView ( ) }
1145
1113
onChange = { ( pagination , filters , sorter , extra ) => {
1146
- onTableChange ( pagination , filters , sorter , extra , comp . dispatch , onEvent ) ;
1114
+ onTableChange ( pagination , filters , sorter , extra , comp . dispatch , onEvent as any ) ;
1147
1115
} }
1148
1116
showHeader = { ! compChildren . hideHeader . getView ( ) }
1149
1117
columns = { antdColumns }
@@ -1163,9 +1131,6 @@ export const TableCompView = React.memo((props: {
1163
1131
} }
1164
1132
summary = { summaryView }
1165
1133
/>
1166
- < SlotConfigContext . Provider value = { { modalWidth : width && Math . max ( width , 300 ) } } >
1167
- { expansion . expandModalView }
1168
- </ SlotConfigContext . Provider >
1169
1134
</ TableWrapper >
1170
1135
</ ScrollBar >
1171
1136
{ toolbar . position === "below" && ! hideToolbar && ( toolbar . fixedToolbar || ( tableAutoHeight && showHorizontalScrollbar ) ) && toolbarView }
0 commit comments