@@ -11,7 +11,8 @@ import {
1111 IViewportOffset ,
1212 IColumn ,
1313 Presentation ,
14- Columns
14+ Columns ,
15+ ILoadingState
1516} from 'dash-table/components/Table/props' ;
1617import CellInput from 'dash-table/components/CellInput' ;
1718import derivedCellEventHandlerProps , { Handler } from 'dash-table/derived/cell/eventHandlerProps' ;
@@ -35,15 +36,16 @@ function getCellType(
3536 active : boolean ,
3637 editable : boolean ,
3738 dropdown : IDropdownValue [ ] | undefined ,
38- presentation : Presentation | undefined
39+ presentation : Presentation | undefined ,
40+ is_loading : boolean
3941) : CellType {
4042 switch ( presentation ) {
4143 case Presentation . Input :
42- return ( ! active || ! editable ) ? CellType . Label : CellType . Input ;
44+ return ( ! active || ! editable || is_loading ) ? CellType . Label : CellType . Input ;
4345 case Presentation . Dropdown :
4446 return ( ! dropdown || ! editable ) ? CellType . DropdownLabel : CellType . Dropdown ;
4547 default :
46- return ( ! active || ! editable ) ? CellType . Label : CellType . Input ;
48+ return ( ! active || ! editable || is_loading ) ? CellType . Label : CellType . Input ;
4749 }
4850}
4951
@@ -62,7 +64,8 @@ class Contents {
6264 data : Data ,
6365 _offset : IViewportOffset ,
6466 isFocused : boolean ,
65- dropdowns : ( IDropdown | undefined ) [ ] [ ]
67+ dropdowns : ( IDropdown | undefined ) [ ] [ ] ,
68+ loading_state : ILoadingState | undefined
6669 ) : JSX . Element [ ] [ ] => {
6770 const formatters = R . map ( getFormatter , columns ) ;
6871
@@ -76,7 +79,8 @@ class Contents {
7679 columnIndex ,
7780 rowIndex ,
7881 datum ,
79- formatters
82+ formatters ,
83+ loading_state
8084 ) , columns ) , data ) ;
8185 } ) ;
8286
@@ -87,7 +91,8 @@ class Contents {
8791 data : Data ,
8892 offset : IViewportOffset ,
8993 isFocused : boolean ,
90- dropdowns : ( IDropdown | undefined ) [ ] [ ]
94+ dropdowns : ( IDropdown | undefined ) [ ] [ ] ,
95+ loading_state : ILoadingState | undefined
9196 ) : JSX . Element [ ] [ ] => {
9297 if ( ! activeCell ) {
9398 return contents ;
@@ -112,20 +117,21 @@ class Contents {
112117 jActive ,
113118 iActive ,
114119 data [ i ] ,
115- formatters
120+ formatters ,
121+ loading_state
116122 ) ;
117123
118124 return contents ;
119125 } ) ;
120126
121- private getContent ( active : boolean , isFocused : boolean , column : IColumn , dropdown : IDropdown | undefined , columnIndex : number , rowIndex : number , datum : any , formatters : ( ( value : any ) => any ) [ ] ) {
127+ private getContent ( active : boolean , isFocused : boolean , column : IColumn , dropdown : IDropdown | undefined , columnIndex : number , rowIndex : number , datum : any , formatters : ( ( value : any ) => any ) [ ] , loading_state : ILoadingState | undefined ) {
122128 const className = [
123129 ...( active ? [ 'input-active' ] : [ ] ) ,
124130 isFocused ? 'focused' : 'unfocused' ,
125131 'dash-cell-value'
126132 ] . join ( ' ' ) ;
127133
128- const cellType = getCellType ( active , column . editable , dropdown && dropdown . options , column . presentation ) ;
134+ const cellType = getCellType ( active , column . editable , dropdown && dropdown . options , column . presentation , loading_state && loading_state . is_loading ? true : false ) ;
129135
130136 switch ( cellType ) {
131137 case CellType . Dropdown :
0 commit comments