@@ -104,6 +104,18 @@ extension TableMapOperation on Node {
104
104
comparator: (iKey, index) => iKey >= index,
105
105
);
106
106
107
+ final rowBoldAttributes = _remapSource (
108
+ this .rowBoldAttributes,
109
+ index,
110
+ comparator: (iKey, index) => iKey >= index,
111
+ );
112
+
113
+ final rowTextColors = _remapSource (
114
+ this .rowTextColors,
115
+ index,
116
+ comparator: (iKey, index) => iKey >= index,
117
+ );
118
+
107
119
return attributes
108
120
.mergeValues (
109
121
SimpleTableBlockKeys .rowColors,
@@ -112,6 +124,14 @@ extension TableMapOperation on Node {
112
124
.mergeValues (
113
125
SimpleTableBlockKeys .rowAligns,
114
126
rowAligns,
127
+ )
128
+ .mergeValues (
129
+ SimpleTableBlockKeys .rowBoldAttributes,
130
+ rowBoldAttributes,
131
+ )
132
+ .mergeValues (
133
+ SimpleTableBlockKeys .rowTextColors,
134
+ rowTextColors,
115
135
);
116
136
} catch (e) {
117
137
Log .warn ('Failed to map row insertion attributes: $e ' );
@@ -167,6 +187,18 @@ extension TableMapOperation on Node {
167
187
comparator: (iKey, index) => iKey >= index,
168
188
);
169
189
190
+ final columnBoldAttributes = _remapSource (
191
+ this .columnBoldAttributes,
192
+ index,
193
+ comparator: (iKey, index) => iKey >= index,
194
+ );
195
+
196
+ final columnTextColors = _remapSource (
197
+ this .columnTextColors,
198
+ index,
199
+ comparator: (iKey, index) => iKey >= index,
200
+ );
201
+
170
202
final bool distributeColumnWidthsEvenly =
171
203
attributes[SimpleTableBlockKeys .distributeColumnWidthsEvenly] ??
172
204
false ;
@@ -189,6 +221,14 @@ extension TableMapOperation on Node {
189
221
.mergeValues (
190
222
SimpleTableBlockKeys .columnWidths,
191
223
columnWidths,
224
+ )
225
+ .mergeValues (
226
+ SimpleTableBlockKeys .columnBoldAttributes,
227
+ columnBoldAttributes,
228
+ )
229
+ .mergeValues (
230
+ SimpleTableBlockKeys .columnTextColors,
231
+ columnTextColors,
192
232
);
193
233
} catch (e) {
194
234
Log .warn ('Failed to map row insertion attributes: $e ' );
@@ -238,6 +278,18 @@ extension TableMapOperation on Node {
238
278
index,
239
279
);
240
280
281
+ final (rowBoldAttributes, duplicatedRowBoldAttribute) =
282
+ _findDuplicatedEntryAndRemap (
283
+ this .rowBoldAttributes,
284
+ index,
285
+ );
286
+
287
+ final (rowTextColors, duplicatedRowTextColor) =
288
+ _findDuplicatedEntryAndRemap (
289
+ this .rowTextColors,
290
+ index,
291
+ );
292
+
241
293
return attributes
242
294
.mergeValues (
243
295
SimpleTableBlockKeys .rowColors,
@@ -248,6 +300,16 @@ extension TableMapOperation on Node {
248
300
SimpleTableBlockKeys .rowAligns,
249
301
rowAligns,
250
302
duplicatedEntry: duplicatedRowAlign,
303
+ )
304
+ .mergeValues (
305
+ SimpleTableBlockKeys .rowBoldAttributes,
306
+ rowBoldAttributes,
307
+ duplicatedEntry: duplicatedRowBoldAttribute,
308
+ )
309
+ .mergeValues (
310
+ SimpleTableBlockKeys .rowTextColors,
311
+ rowTextColors,
312
+ duplicatedEntry: duplicatedRowTextColor,
251
313
);
252
314
} catch (e) {
253
315
Log .warn ('Failed to map row insertion attributes: $e ' );
@@ -304,6 +366,18 @@ extension TableMapOperation on Node {
304
366
index,
305
367
);
306
368
369
+ final (columnBoldAttributes, duplicatedColumnBoldAttribute) =
370
+ _findDuplicatedEntryAndRemap (
371
+ this .columnBoldAttributes,
372
+ index,
373
+ );
374
+
375
+ final (columnTextColors, duplicatedColumnTextColor) =
376
+ _findDuplicatedEntryAndRemap (
377
+ this .columnTextColors,
378
+ index,
379
+ );
380
+
307
381
return attributes
308
382
.mergeValues (
309
383
SimpleTableBlockKeys .columnColors,
@@ -319,6 +393,16 @@ extension TableMapOperation on Node {
319
393
SimpleTableBlockKeys .columnWidths,
320
394
columnWidths,
321
395
duplicatedEntry: duplicatedColumnWidth,
396
+ )
397
+ .mergeValues (
398
+ SimpleTableBlockKeys .columnBoldAttributes,
399
+ columnBoldAttributes,
400
+ duplicatedEntry: duplicatedColumnBoldAttribute,
401
+ )
402
+ .mergeValues (
403
+ SimpleTableBlockKeys .columnTextColors,
404
+ columnTextColors,
405
+ duplicatedEntry: duplicatedColumnTextColor,
322
406
);
323
407
} catch (e) {
324
408
Log .warn ('Failed to map column duplication attributes: $e ' );
@@ -364,13 +448,15 @@ extension TableMapOperation on Node {
364
448
comparator: (iKey, index) => iKey > index,
365
449
filterIndex: index,
366
450
);
451
+
367
452
final columnAligns = _remapSource (
368
453
this .columnAligns,
369
454
index,
370
455
increment: false ,
371
456
comparator: (iKey, index) => iKey > index,
372
457
filterIndex: index,
373
458
);
459
+
374
460
final columnWidths = _remapSource (
375
461
this .columnWidths,
376
462
index,
@@ -379,6 +465,22 @@ extension TableMapOperation on Node {
379
465
filterIndex: index,
380
466
);
381
467
468
+ final columnBoldAttributes = _remapSource (
469
+ this .columnBoldAttributes,
470
+ index,
471
+ increment: false ,
472
+ comparator: (iKey, index) => iKey > index,
473
+ filterIndex: index,
474
+ );
475
+
476
+ final columnTextColors = _remapSource (
477
+ this .columnTextColors,
478
+ index,
479
+ increment: false ,
480
+ comparator: (iKey, index) => iKey > index,
481
+ filterIndex: index,
482
+ );
483
+
382
484
return attributes
383
485
.mergeValues (
384
486
SimpleTableBlockKeys .columnColors,
@@ -391,6 +493,14 @@ extension TableMapOperation on Node {
391
493
.mergeValues (
392
494
SimpleTableBlockKeys .columnWidths,
393
495
columnWidths,
496
+ )
497
+ .mergeValues (
498
+ SimpleTableBlockKeys .columnBoldAttributes,
499
+ columnBoldAttributes,
500
+ )
501
+ .mergeValues (
502
+ SimpleTableBlockKeys .columnTextColors,
503
+ columnTextColors,
394
504
);
395
505
} catch (e) {
396
506
Log .warn ('Failed to map column deletion attributes: $e ' );
@@ -443,6 +553,22 @@ extension TableMapOperation on Node {
443
553
filterIndex: index,
444
554
);
445
555
556
+ final rowBoldAttributes = _remapSource (
557
+ this .rowBoldAttributes,
558
+ index,
559
+ increment: false ,
560
+ comparator: (iKey, index) => iKey > index,
561
+ filterIndex: index,
562
+ );
563
+
564
+ final rowTextColors = _remapSource (
565
+ this .rowTextColors,
566
+ index,
567
+ increment: false ,
568
+ comparator: (iKey, index) => iKey > index,
569
+ filterIndex: index,
570
+ );
571
+
446
572
return attributes
447
573
.mergeValues (
448
574
SimpleTableBlockKeys .rowColors,
@@ -451,6 +577,14 @@ extension TableMapOperation on Node {
451
577
.mergeValues (
452
578
SimpleTableBlockKeys .rowAligns,
453
579
rowAligns,
580
+ )
581
+ .mergeValues (
582
+ SimpleTableBlockKeys .rowBoldAttributes,
583
+ rowBoldAttributes,
584
+ )
585
+ .mergeValues (
586
+ SimpleTableBlockKeys .rowTextColors,
587
+ rowTextColors,
454
588
);
455
589
} catch (e) {
456
590
Log .warn ('Failed to map row deletion attributes: $e ' );
@@ -531,6 +665,10 @@ extension TableMapOperation on Node {
531
665
final duplicatedColumnColor = this .columnColors[fromIndex.toString ()];
532
666
final duplicatedColumnAlign = this .columnAligns[fromIndex.toString ()];
533
667
final duplicatedColumnWidth = this .columnWidths[fromIndex.toString ()];
668
+ final duplicatedColumnBoldAttribute =
669
+ this .columnBoldAttributes[fromIndex.toString ()];
670
+ final duplicatedColumnTextColor =
671
+ this .columnTextColors[fromIndex.toString ()];
534
672
535
673
/// Case 1: fromIndex > toIndex
536
674
/// Before:
@@ -619,6 +757,34 @@ extension TableMapOperation on Node {
619
757
filterIndex: fromIndex,
620
758
);
621
759
760
+ final columnBoldAttributes = _remapSource (
761
+ this .columnBoldAttributes,
762
+ fromIndex,
763
+ increment: fromIndex > toIndex,
764
+ comparator: (iKey, index) {
765
+ if (fromIndex > toIndex) {
766
+ return iKey < fromIndex && iKey >= toIndex;
767
+ } else {
768
+ return iKey > fromIndex && iKey <= toIndex;
769
+ }
770
+ },
771
+ filterIndex: fromIndex,
772
+ );
773
+
774
+ final columnTextColors = _remapSource (
775
+ this .columnTextColors,
776
+ fromIndex,
777
+ increment: fromIndex > toIndex,
778
+ comparator: (iKey, index) {
779
+ if (fromIndex > toIndex) {
780
+ return iKey < fromIndex && iKey >= toIndex;
781
+ } else {
782
+ return iKey > fromIndex && iKey <= toIndex;
783
+ }
784
+ },
785
+ filterIndex: fromIndex,
786
+ );
787
+
622
788
return attributes
623
789
.mergeValues (
624
790
SimpleTableBlockKeys .columnColors,
@@ -652,6 +818,28 @@ extension TableMapOperation on Node {
652
818
)
653
819
: null ,
654
820
removeNullValue: true ,
821
+ )
822
+ .mergeValues (
823
+ SimpleTableBlockKeys .columnBoldAttributes,
824
+ columnBoldAttributes,
825
+ duplicatedEntry: duplicatedColumnBoldAttribute != null
826
+ ? MapEntry (
827
+ toIndex.toString (),
828
+ duplicatedColumnBoldAttribute,
829
+ )
830
+ : null ,
831
+ removeNullValue: true ,
832
+ )
833
+ .mergeValues (
834
+ SimpleTableBlockKeys .columnTextColors,
835
+ columnTextColors,
836
+ duplicatedEntry: duplicatedColumnTextColor != null
837
+ ? MapEntry (
838
+ toIndex.toString (),
839
+ duplicatedColumnTextColor,
840
+ )
841
+ : null ,
842
+ removeNullValue: true ,
655
843
);
656
844
} catch (e) {
657
845
Log .warn ('Failed to map column deletion attributes: $e ' );
@@ -667,6 +855,9 @@ extension TableMapOperation on Node {
667
855
try {
668
856
final duplicatedRowColor = this .rowColors[fromIndex.toString ()];
669
857
final duplicatedRowAlign = this .rowAligns[fromIndex.toString ()];
858
+ final duplicatedRowBoldAttribute =
859
+ this .rowBoldAttributes[fromIndex.toString ()];
860
+ final duplicatedRowTextColor = this .rowTextColors[fromIndex.toString ()];
670
861
671
862
/// Example:
672
863
/// Case 1: fromIndex > toIndex
@@ -742,6 +933,34 @@ extension TableMapOperation on Node {
742
933
filterIndex: fromIndex,
743
934
);
744
935
936
+ final rowBoldAttributes = _remapSource (
937
+ this .rowBoldAttributes,
938
+ fromIndex,
939
+ increment: fromIndex > toIndex,
940
+ comparator: (iKey, index) {
941
+ if (fromIndex > toIndex) {
942
+ return iKey < fromIndex && iKey >= toIndex;
943
+ } else {
944
+ return iKey > fromIndex && iKey <= toIndex;
945
+ }
946
+ },
947
+ filterIndex: fromIndex,
948
+ );
949
+
950
+ final rowTextColors = _remapSource (
951
+ this .rowTextColors,
952
+ fromIndex,
953
+ increment: fromIndex > toIndex,
954
+ comparator: (iKey, index) {
955
+ if (fromIndex > toIndex) {
956
+ return iKey < fromIndex && iKey >= toIndex;
957
+ } else {
958
+ return iKey > fromIndex && iKey <= toIndex;
959
+ }
960
+ },
961
+ filterIndex: fromIndex,
962
+ );
963
+
745
964
return attributes
746
965
.mergeValues (
747
966
SimpleTableBlockKeys .rowColors,
@@ -764,6 +983,28 @@ extension TableMapOperation on Node {
764
983
)
765
984
: null ,
766
985
removeNullValue: true ,
986
+ )
987
+ .mergeValues (
988
+ SimpleTableBlockKeys .rowBoldAttributes,
989
+ rowBoldAttributes,
990
+ duplicatedEntry: duplicatedRowBoldAttribute != null
991
+ ? MapEntry (
992
+ toIndex.toString (),
993
+ duplicatedRowBoldAttribute,
994
+ )
995
+ : null ,
996
+ removeNullValue: true ,
997
+ )
998
+ .mergeValues (
999
+ SimpleTableBlockKeys .rowTextColors,
1000
+ rowTextColors,
1001
+ duplicatedEntry: duplicatedRowTextColor != null
1002
+ ? MapEntry (
1003
+ toIndex.toString (),
1004
+ duplicatedRowTextColor,
1005
+ )
1006
+ : null ,
1007
+ removeNullValue: true ,
767
1008
);
768
1009
} catch (e) {
769
1010
Log .warn ('Failed to map row reordering attributes: $e ' );
0 commit comments