@@ -922,18 +922,23 @@ describe('CdkTable', () => {
922922 undefined ,
923923 headerRows [ 2 ] . getBoundingClientRect ( ) . height ,
924924 ] ,
925+ offsets : [
926+ 0 ,
927+ undefined ,
928+ headerRows [ 0 ] . getBoundingClientRect ( ) . height ,
929+ ] ,
925930 elements : [ [ headerRows [ 0 ] ] , undefined , [ headerRows [ 2 ] ] ] ,
926931 } ) ;
927- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
932+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
928933 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
929934 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
930935
931936 component . stickyHeaders = [ ] ;
932937 fixture . detectChanges ( ) ;
933938 flushMicrotasks ( ) ;
934939 expectNoStickyStyles ( headerRows ) ;
935- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
936- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
940+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
941+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
937942 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
938943 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
939944 } ) ) ;
@@ -949,13 +954,14 @@ describe('CdkTable', () => {
949954 expectNoStickyStyles ( [ footerRows [ 1 ] ] ) ;
950955 expectStickyStyles ( footerRows [ 2 ] , '10' , { bottom : '0px' } ) ;
951956 expectStickyBorderClass ( footerRows [ 2 ] ) ;
952- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
957+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
953958 expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
954959 sizes : [
955960 footerRows [ 2 ] . getBoundingClientRect ( ) . height ,
956961 undefined ,
957962 footerRows [ 0 ] . getBoundingClientRect ( ) . height ,
958963 ] ,
964+ offsets : [ 0 , undefined , footerRows [ 0 ] . getBoundingClientRect ( ) . height ] ,
959965 elements : [ [ footerRows [ 2 ] ] , undefined , [ footerRows [ 0 ] ] ] ,
960966 } ) ;
961967 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
@@ -965,8 +971,8 @@ describe('CdkTable', () => {
965971 fixture . detectChanges ( ) ;
966972 flushMicrotasks ( ) ;
967973 expectNoStickyStyles ( footerRows ) ;
968- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
969- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
974+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
975+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
970976 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
971977 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
972978 } ) ) ;
@@ -1010,8 +1016,8 @@ describe('CdkTable', () => {
10101016 expectStickyBorderClass ( cells [ 2 ] , { left : true } ) ;
10111017 expectNoStickyStyles ( [ cells [ 1 ] , cells [ 3 ] , cells [ 4 ] , cells [ 5 ] ] ) ;
10121018 } ) ;
1013- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1014- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1019+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1020+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
10151021 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
10161022 sizes : [
10171023 getCells ( dataRows [ 0 ] ) [ 0 ] . getBoundingClientRect ( ) . width ,
@@ -1028,8 +1034,8 @@ describe('CdkTable', () => {
10281034 headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
10291035 dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
10301036 footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1031- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1032- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1037+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1038+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
10331039 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
10341040 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
10351041 } ) ) ;
@@ -1063,8 +1069,8 @@ describe('CdkTable', () => {
10631069 expectStickyBorderClass ( cells [ 3 ] , { right : true } ) ;
10641070 expectNoStickyStyles ( [ cells [ 0 ] , cells [ 1 ] , cells [ 2 ] , cells [ 4 ] ] ) ;
10651071 } ) ;
1066- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1067- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1072+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1073+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
10681074 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
10691075 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( {
10701076 sizes : [
@@ -1080,8 +1086,8 @@ describe('CdkTable', () => {
10801086 headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
10811087 dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
10821088 footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1083- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1084- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1089+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1090+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
10851091 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
10861092 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
10871093 } ) ) ;
@@ -1169,10 +1175,12 @@ describe('CdkTable', () => {
11691175
11701176 expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( {
11711177 sizes : [ headerRows [ 0 ] . getBoundingClientRect ( ) . height ] ,
1178+ offsets : [ 0 ] ,
11721179 elements : [ [ headerRows [ 0 ] ] ] ,
11731180 } ) ;
11741181 expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
11751182 sizes : [ footerRows [ 2 ] . getBoundingClientRect ( ) . height ] ,
1183+ offsets : [ 0 ] ,
11761184 elements : [ [ footerRows [ 2 ] ] ] ,
11771185 } ) ;
11781186 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
@@ -1193,8 +1201,8 @@ describe('CdkTable', () => {
11931201 dataRows . forEach ( row => expectNoStickyStyles ( [ row , ...getCells ( row ) ] ) ) ;
11941202 footerRows . forEach ( row => expectNoStickyStyles ( [ row , ...getFooterCells ( row ) ] ) ) ;
11951203
1196- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1197- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1204+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1205+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
11981206 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
11991207 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
12001208 } ) ) ;
@@ -1235,9 +1243,14 @@ describe('CdkTable', () => {
12351243 undefined ,
12361244 headerRows [ 2 ] . getBoundingClientRect ( ) . height ,
12371245 ] ,
1246+ offsets : [
1247+ 0 ,
1248+ undefined ,
1249+ headerRows [ 0 ] . getBoundingClientRect ( ) . height ,
1250+ ] ,
12381251 elements : [ getHeaderCells ( headerRows [ 0 ] ) , undefined , getHeaderCells ( headerRows [ 2 ] ) ] ,
12391252 } ) ;
1240- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1253+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
12411254 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
12421255 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
12431256
@@ -1246,8 +1259,8 @@ describe('CdkTable', () => {
12461259 flushMicrotasks ( ) ;
12471260 expectNoStickyStyles ( headerRows ) ; // No sticky styles on rows for native table
12481261 headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1249- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1250- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1262+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1263+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
12511264 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
12521265 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
12531266 } ) ) ;
@@ -1268,13 +1281,18 @@ describe('CdkTable', () => {
12681281 } ) ;
12691282 expectNoStickyStyles ( getFooterCells ( footerRows [ 1 ] ) ) ;
12701283 expectNoStickyStyles ( footerRows ) ; // No sticky styles on rows for native table
1271- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1284+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
12721285 expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
12731286 sizes : [
12741287 footerRows [ 2 ] . getBoundingClientRect ( ) . height ,
12751288 undefined ,
12761289 footerRows [ 0 ] . getBoundingClientRect ( ) . height ,
12771290 ] ,
1291+ offsets : [
1292+ 0 ,
1293+ undefined ,
1294+ footerRows [ 2 ] . getBoundingClientRect ( ) . height ,
1295+ ] ,
12781296 elements : [ getFooterCells ( footerRows [ 2 ] ) , undefined , getFooterCells ( footerRows [ 0 ] ) ] ,
12791297 } ) ;
12801298 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
@@ -1285,8 +1303,8 @@ describe('CdkTable', () => {
12851303 flushMicrotasks ( ) ;
12861304 expectNoStickyStyles ( footerRows ) ; // No sticky styles on rows for native table
12871305 footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1288- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1289- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1306+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1307+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
12901308 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
12911309 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
12921310 } ) ) ;
@@ -1339,8 +1357,8 @@ describe('CdkTable', () => {
13391357 expectStickyBorderClass ( cells [ 2 ] , { left : true } ) ;
13401358 expectNoStickyStyles ( [ cells [ 1 ] , cells [ 3 ] , cells [ 4 ] , cells [ 5 ] ] ) ;
13411359 } ) ;
1342- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1343- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1360+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1361+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
13441362 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
13451363 sizes : [
13461364 getCells ( dataRows [ 0 ] ) [ 0 ] . getBoundingClientRect ( ) . width ,
@@ -1356,8 +1374,8 @@ describe('CdkTable', () => {
13561374 headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
13571375 dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
13581376 footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1359- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1360- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1377+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1378+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
13611379 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
13621380 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
13631381 } ) ) ;
@@ -1391,8 +1409,8 @@ describe('CdkTable', () => {
13911409 expectStickyBorderClass ( cells [ 3 ] , { right : true } ) ;
13921410 expectNoStickyStyles ( [ cells [ 0 ] , cells [ 1 ] , cells [ 2 ] , cells [ 4 ] ] ) ;
13931411 } ) ;
1394- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1395- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1412+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1413+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
13961414 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
13971415 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( {
13981416 sizes : [
@@ -1408,8 +1426,8 @@ describe('CdkTable', () => {
14081426 headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
14091427 dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
14101428 footerRows . forEach ( row => expectNoStickyStyles ( getFooterCells ( row ) ) ) ;
1411- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1412- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1429+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1430+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
14131431 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
14141432 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
14151433 } ) ) ;
@@ -1464,10 +1482,12 @@ describe('CdkTable', () => {
14641482
14651483 expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( {
14661484 sizes : [ headerRows [ 0 ] . getBoundingClientRect ( ) . height ] ,
1485+ offsets : [ 0 ] ,
14671486 elements : [ getHeaderCells ( headerRows [ 0 ] ) ] ,
14681487 } ) ;
14691488 expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
14701489 sizes : [ footerRows [ 2 ] . getBoundingClientRect ( ) . height ] ,
1490+ offsets : [ 0 ] ,
14711491 elements : [ getFooterCells ( footerRows [ 2 ] ) ] ,
14721492 } ) ;
14731493 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
@@ -1488,8 +1508,8 @@ describe('CdkTable', () => {
14881508 dataRows . forEach ( row => expectNoStickyStyles ( [ row , ...getCells ( row ) ] ) ) ;
14891509 footerRows . forEach ( row => expectNoStickyStyles ( [ row , ...getFooterCells ( row ) ] ) ) ;
14901510
1491- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1492- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1511+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1512+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
14931513 expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
14941514 expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
14951515 } ) ) ;
0 commit comments