11import type ViewDataProvider from './view_model/m_view_data_provider' ;
22
33export default class CellsSelectionState {
4- _focusedCell : any = null ;
4+ private focusedCell : any = null ;
55
6- _selectedCells : any = null ;
6+ private selectedCells : any = null ;
77
8- _firstSelectedCell : any = null ;
8+ private firstSelectedCell : any = null ;
99
10- _prevFocusedCell : any = null ;
10+ private prevFocusedCell : any = null ;
1111
12- _prevFirstSelectedCell : any ;
12+ private prevFirstSelectedCell : any ;
1313
14- _prevSelectedCells : any = null ;
14+ private prevSelectedCells : any = null ;
1515
1616 constructor ( public viewDataProvider : ViewDataProvider ) { }
1717
1818 getFocusedCell ( ) {
19- const focusedCell = this . _focusedCell ;
19+ const { focusedCell } = this ;
2020
2121 if ( ! focusedCell ) {
2222 return undefined ;
@@ -34,7 +34,7 @@ export default class CellsSelectionState {
3434 setFocusedCell ( rowIndex , columnIndex , isAllDay ) {
3535 if ( rowIndex >= 0 ) {
3636 const cell = this . viewDataProvider . getCellData ( rowIndex , columnIndex , isAllDay ) ;
37- this . _focusedCell = cell ;
37+ this . focusedCell = cell ;
3838 }
3939 }
4040
@@ -54,20 +54,20 @@ export default class CellsSelectionState {
5454 firstCellCoordinates . columnIndex ,
5555 firstCellCoordinates . allDay ,
5656 )
57- : this . _firstSelectedCell ;
57+ : this . firstSelectedCell ;
5858 const lastCell = viewDataProvider . getCellData ( lastRowIndex , lastColumnIndex , isLastCellAllDay ) ;
5959
60- this . _firstSelectedCell = firstCell ;
60+ this . firstSelectedCell = firstCell ;
6161
62- this . _selectedCells = this . viewDataProvider . getCellsBetween ( firstCell , lastCell ) ;
62+ this . selectedCells = this . viewDataProvider . getCellsBetween ( firstCell , lastCell ) ;
6363 }
6464
6565 setSelectedCellsByData ( selectedCellsData ) {
66- this . _selectedCells = selectedCellsData ;
66+ this . selectedCells = selectedCellsData ;
6767 }
6868
6969 getSelectedCells ( ) {
70- return this . _selectedCells ;
70+ return this . selectedCells ;
7171 }
7272
7373 releaseSelectedAndFocusedCells ( ) {
@@ -76,33 +76,33 @@ export default class CellsSelectionState {
7676 }
7777
7878 releaseSelectedCells ( ) {
79- this . _prevSelectedCells = this . _selectedCells ;
80- this . _prevFirstSelectedCell = this . _firstSelectedCell ;
79+ this . prevSelectedCells = this . selectedCells ;
80+ this . prevFirstSelectedCell = this . firstSelectedCell ;
8181
82- this . _selectedCells = null ;
83- this . _firstSelectedCell = null ;
82+ this . selectedCells = null ;
83+ this . firstSelectedCell = null ;
8484 }
8585
8686 releaseFocusedCell ( ) {
87- this . _prevFocusedCell = this . _focusedCell ;
88- this . _focusedCell = null ;
87+ this . prevFocusedCell = this . focusedCell ;
88+ this . focusedCell = null ;
8989 }
9090
9191 restoreSelectedAndFocusedCells ( ) {
92- this . _selectedCells = this . _selectedCells || this . _prevSelectedCells ;
93- this . _focusedCell = this . _focusedCell || this . _prevFocusedCell ;
94- this . _firstSelectedCell = this . _firstSelectedCell || this . _prevFirstSelectedCell ;
92+ this . selectedCells = this . selectedCells || this . prevSelectedCells ;
93+ this . focusedCell = this . focusedCell || this . prevFocusedCell ;
94+ this . firstSelectedCell = this . firstSelectedCell || this . prevFirstSelectedCell ;
9595
96- this . _prevSelectedCells = null ;
97- this . _prevFirstSelectedCell = null ;
98- this . _prevFocusedCell = null ;
96+ this . prevSelectedCells = null ;
97+ this . prevFirstSelectedCell = null ;
98+ this . prevFocusedCell = null ;
9999 }
100100
101101 clearSelectedAndFocusedCells ( ) {
102- this . _prevSelectedCells = null ;
103- this . _selectedCells = null ;
102+ this . prevSelectedCells = null ;
103+ this . selectedCells = null ;
104104
105- this . _prevFocusedCell = null ;
106- this . _focusedCell = null ;
105+ this . prevFocusedCell = null ;
106+ this . focusedCell = null ;
107107 }
108108}
0 commit comments