@@ -922,18 +922,23 @@ describe('CdkTable', () => {
922
922
undefined ,
923
923
headerRows [ 2 ] . getBoundingClientRect ( ) . height ,
924
924
] ,
925
+ offsets : [
926
+ 0 ,
927
+ undefined ,
928
+ headerRows [ 0 ] . getBoundingClientRect ( ) . height ,
929
+ ] ,
925
930
elements : [ [ headerRows [ 0 ] ] , undefined , [ headerRows [ 2 ] ] ] ,
926
931
} ) ;
927
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
932
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
928
933
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
929
934
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
930
935
931
936
component . stickyHeaders = [ ] ;
932
937
fixture . detectChanges ( ) ;
933
938
flushMicrotasks ( ) ;
934
939
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 : [ ] } ) ;
937
942
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
938
943
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
939
944
} ) ) ;
@@ -949,13 +954,14 @@ describe('CdkTable', () => {
949
954
expectNoStickyStyles ( [ footerRows [ 1 ] ] ) ;
950
955
expectStickyStyles ( footerRows [ 2 ] , '10' , { bottom : '0px' } ) ;
951
956
expectStickyBorderClass ( footerRows [ 2 ] ) ;
952
- expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
957
+ expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
953
958
expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
954
959
sizes : [
955
960
footerRows [ 2 ] . getBoundingClientRect ( ) . height ,
956
961
undefined ,
957
962
footerRows [ 0 ] . getBoundingClientRect ( ) . height ,
958
963
] ,
964
+ offsets : [ 0 , undefined , footerRows [ 0 ] . getBoundingClientRect ( ) . height ] ,
959
965
elements : [ [ footerRows [ 2 ] ] , undefined , [ footerRows [ 0 ] ] ] ,
960
966
} ) ;
961
967
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
@@ -965,8 +971,8 @@ describe('CdkTable', () => {
965
971
fixture . detectChanges ( ) ;
966
972
flushMicrotasks ( ) ;
967
973
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 : [ ] } ) ;
970
976
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
971
977
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
972
978
} ) ) ;
@@ -1010,8 +1016,8 @@ describe('CdkTable', () => {
1010
1016
expectStickyBorderClass ( cells [ 2 ] , { left : true } ) ;
1011
1017
expectNoStickyStyles ( [ cells [ 1 ] , cells [ 3 ] , cells [ 4 ] , cells [ 5 ] ] ) ;
1012
1018
} ) ;
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 : [ ] } ) ;
1015
1021
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
1016
1022
sizes : [
1017
1023
getCells ( dataRows [ 0 ] ) [ 0 ] . getBoundingClientRect ( ) . width ,
@@ -1028,8 +1034,8 @@ describe('CdkTable', () => {
1028
1034
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1029
1035
dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
1030
1036
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 : [ ] } ) ;
1033
1039
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1034
1040
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1035
1041
} ) ) ;
@@ -1063,8 +1069,8 @@ describe('CdkTable', () => {
1063
1069
expectStickyBorderClass ( cells [ 3 ] , { right : true } ) ;
1064
1070
expectNoStickyStyles ( [ cells [ 0 ] , cells [ 1 ] , cells [ 2 ] , cells [ 4 ] ] ) ;
1065
1071
} ) ;
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 : [ ] } ) ;
1068
1074
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1069
1075
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( {
1070
1076
sizes : [
@@ -1080,8 +1086,8 @@ describe('CdkTable', () => {
1080
1086
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1081
1087
dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
1082
1088
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 : [ ] } ) ;
1085
1091
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1086
1092
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1087
1093
} ) ) ;
@@ -1169,10 +1175,12 @@ describe('CdkTable', () => {
1169
1175
1170
1176
expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( {
1171
1177
sizes : [ headerRows [ 0 ] . getBoundingClientRect ( ) . height ] ,
1178
+ offsets : [ 0 ] ,
1172
1179
elements : [ [ headerRows [ 0 ] ] ] ,
1173
1180
} ) ;
1174
1181
expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
1175
1182
sizes : [ footerRows [ 2 ] . getBoundingClientRect ( ) . height ] ,
1183
+ offsets : [ 0 ] ,
1176
1184
elements : [ [ footerRows [ 2 ] ] ] ,
1177
1185
} ) ;
1178
1186
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
@@ -1193,8 +1201,8 @@ describe('CdkTable', () => {
1193
1201
dataRows . forEach ( row => expectNoStickyStyles ( [ row , ...getCells ( row ) ] ) ) ;
1194
1202
footerRows . forEach ( row => expectNoStickyStyles ( [ row , ...getFooterCells ( row ) ] ) ) ;
1195
1203
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 : [ ] } ) ;
1198
1206
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1199
1207
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1200
1208
} ) ) ;
@@ -1235,9 +1243,14 @@ describe('CdkTable', () => {
1235
1243
undefined ,
1236
1244
headerRows [ 2 ] . getBoundingClientRect ( ) . height ,
1237
1245
] ,
1246
+ offsets : [
1247
+ 0 ,
1248
+ undefined ,
1249
+ headerRows [ 0 ] . getBoundingClientRect ( ) . height ,
1250
+ ] ,
1238
1251
elements : [ getHeaderCells ( headerRows [ 0 ] ) , undefined , getHeaderCells ( headerRows [ 2 ] ) ] ,
1239
1252
} ) ;
1240
- expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , elements : [ ] } ) ;
1253
+ expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( { sizes : [ ] , offsets : [ ] , elements : [ ] } ) ;
1241
1254
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1242
1255
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1243
1256
@@ -1246,8 +1259,8 @@ describe('CdkTable', () => {
1246
1259
flushMicrotasks ( ) ;
1247
1260
expectNoStickyStyles ( headerRows ) ; // No sticky styles on rows for native table
1248
1261
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 : [ ] } ) ;
1251
1264
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1252
1265
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1253
1266
} ) ) ;
@@ -1268,13 +1281,18 @@ describe('CdkTable', () => {
1268
1281
} ) ;
1269
1282
expectNoStickyStyles ( getFooterCells ( footerRows [ 1 ] ) ) ;
1270
1283
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 : [ ] } ) ;
1272
1285
expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
1273
1286
sizes : [
1274
1287
footerRows [ 2 ] . getBoundingClientRect ( ) . height ,
1275
1288
undefined ,
1276
1289
footerRows [ 0 ] . getBoundingClientRect ( ) . height ,
1277
1290
] ,
1291
+ offsets : [
1292
+ 0 ,
1293
+ undefined ,
1294
+ footerRows [ 2 ] . getBoundingClientRect ( ) . height ,
1295
+ ] ,
1278
1296
elements : [ getFooterCells ( footerRows [ 2 ] ) , undefined , getFooterCells ( footerRows [ 0 ] ) ] ,
1279
1297
} ) ;
1280
1298
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
@@ -1285,8 +1303,8 @@ describe('CdkTable', () => {
1285
1303
flushMicrotasks ( ) ;
1286
1304
expectNoStickyStyles ( footerRows ) ; // No sticky styles on rows for native table
1287
1305
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 : [ ] } ) ;
1290
1308
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1291
1309
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1292
1310
} ) ) ;
@@ -1339,8 +1357,8 @@ describe('CdkTable', () => {
1339
1357
expectStickyBorderClass ( cells [ 2 ] , { left : true } ) ;
1340
1358
expectNoStickyStyles ( [ cells [ 1 ] , cells [ 3 ] , cells [ 4 ] , cells [ 5 ] ] ) ;
1341
1359
} ) ;
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 : [ ] } ) ;
1344
1362
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
1345
1363
sizes : [
1346
1364
getCells ( dataRows [ 0 ] ) [ 0 ] . getBoundingClientRect ( ) . width ,
@@ -1356,8 +1374,8 @@ describe('CdkTable', () => {
1356
1374
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1357
1375
dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
1358
1376
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 : [ ] } ) ;
1361
1379
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1362
1380
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1363
1381
} ) ) ;
@@ -1391,8 +1409,8 @@ describe('CdkTable', () => {
1391
1409
expectStickyBorderClass ( cells [ 3 ] , { right : true } ) ;
1392
1410
expectNoStickyStyles ( [ cells [ 0 ] , cells [ 1 ] , cells [ 2 ] , cells [ 4 ] ] ) ;
1393
1411
} ) ;
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 : [ ] } ) ;
1396
1414
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1397
1415
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( {
1398
1416
sizes : [
@@ -1408,8 +1426,8 @@ describe('CdkTable', () => {
1408
1426
headerRows . forEach ( row => expectNoStickyStyles ( getHeaderCells ( row ) ) ) ;
1409
1427
dataRows . forEach ( row => expectNoStickyStyles ( getCells ( row ) ) ) ;
1410
1428
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 : [ ] } ) ;
1413
1431
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1414
1432
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1415
1433
} ) ) ;
@@ -1464,10 +1482,12 @@ describe('CdkTable', () => {
1464
1482
1465
1483
expect ( component . mostRecentStickyHeaderRowsUpdate ) . toEqual ( {
1466
1484
sizes : [ headerRows [ 0 ] . getBoundingClientRect ( ) . height ] ,
1485
+ offsets : [ 0 ] ,
1467
1486
elements : [ getHeaderCells ( headerRows [ 0 ] ) ] ,
1468
1487
} ) ;
1469
1488
expect ( component . mostRecentStickyFooterRowsUpdate ) . toEqual ( {
1470
1489
sizes : [ footerRows [ 2 ] . getBoundingClientRect ( ) . height ] ,
1490
+ offsets : [ 0 ] ,
1471
1491
elements : [ getFooterCells ( footerRows [ 2 ] ) ] ,
1472
1492
} ) ;
1473
1493
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( {
@@ -1488,8 +1508,8 @@ describe('CdkTable', () => {
1488
1508
dataRows . forEach ( row => expectNoStickyStyles ( [ row , ...getCells ( row ) ] ) ) ;
1489
1509
footerRows . forEach ( row => expectNoStickyStyles ( [ row , ...getFooterCells ( row ) ] ) ) ;
1490
1510
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 : [ ] } ) ;
1493
1513
expect ( component . mostRecentStickyColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1494
1514
expect ( component . mostRecentStickyEndColumnsUpdate ) . toEqual ( { sizes : [ ] } ) ;
1495
1515
} ) ) ;
0 commit comments