@trebco/treb 29.1.4 → 29.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trebco/treb",
3
- "version": "29.1.4",
3
+ "version": "29.1.6",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "homepage": "https://treb.app",
6
6
  "repository": {
@@ -65,6 +65,8 @@ export interface ImportedSheetData {
65
65
  sheet_style?: number;
66
66
  column_styles?: number[];
67
67
 
68
+ row_styles?: number[];
69
+
68
70
  // new
69
71
  annotations?: AnchoredAnnotation[];
70
72
 
@@ -2834,6 +2834,16 @@ export class Sheet {
2834
2834
  }
2835
2835
  }
2836
2836
 
2837
+ // and row styles...
2838
+
2839
+ if (data.row_styles) {
2840
+ for (const [row, style] of data.row_styles.entries()) {
2841
+ if (style) {
2842
+ this.UpdateAreaStyle(new Area({ row, column: Infinity }), styles[style]);
2843
+ }
2844
+ }
2845
+ }
2846
+
2837
2847
  // this.cells.FromJSON(cell_data);
2838
2848
  this.cells.FromJSON(data.cells);
2839
2849
  if (data.name) {
@@ -506,6 +506,7 @@ export class Importer {
506
506
  const merges: RangeType[] = [];
507
507
  const conditional_formats: ConditionalFormat[] = [];
508
508
  const links: HyperlinkType[] = [];
509
+ const row_styles: number[] = []; // may be sparse
509
510
  const validations: Array<{
510
511
  address: ICellAddress,
511
512
  validation: DataValidation,
@@ -696,6 +697,13 @@ export class Importer {
696
697
  }
697
698
  }
698
699
 
700
+ if (row.a$?.s) {
701
+ const style_reference = Number(row.a$?.s);
702
+ if (!isNaN(style_reference)) {
703
+ row_styles[row_index - 1] = style_reference;
704
+ }
705
+ }
706
+
699
707
  // if there's a height which is not === default height, but
700
708
  // the customHeight attribute is not set, then it's been auto-sized.
701
709
  // not sure that's something we need to care about necessarily...
@@ -1162,6 +1170,7 @@ export class Importer {
1162
1170
  default_column_width,
1163
1171
  column_widths,
1164
1172
  row_heights,
1173
+ row_styles,
1165
1174
  annotations,
1166
1175
  conditional_formats,
1167
1176
  styles: this.workbook?.style_cache?.CellXfToStyles() || [],
@@ -594,16 +594,11 @@ export class TileRenderer {
594
594
 
595
595
  const scale = this.layout.dpr;
596
596
 
597
- // const render_list: Array<{row: number, column: number, cell: Cell}> = [];
598
-
599
- // this.last_font = undefined;
600
597
  context.setTransform(scale, 0, 0, scale, 0, 0);
601
598
 
602
599
  let left = 0;
603
600
  let top = 0;
604
601
 
605
- // console.info('r', tile.first_cell);
606
-
607
602
  for (let column = tile.first_cell.column; column <= tile.last_cell.column; column++) {
608
603
  const width = this.layout.ColumnWidth(column);
609
604
  if (!width) continue;
@@ -1126,7 +1121,6 @@ export class TileRenderer {
1126
1121
  // (moved to sheet, using numpad naming)
1127
1122
 
1128
1123
  const numpad = this.view.active_sheet.SurroundingStyle(address, this.theme.table);
1129
-
1130
1124
 
1131
1125
  // --- start with fills ----------------------------------------------------
1132
1126
 
@@ -1253,7 +1247,7 @@ export class TileRenderer {
1253
1247
  // paint right border?
1254
1248
 
1255
1249
  if (numpad[6].border_left) {
1256
- context.fillStyle = ThemeColor2(this.theme, numpad[4].border_left_fill, 1);
1250
+ context.fillStyle = ThemeColor2(this.theme, numpad[6].border_left_fill, 1);
1257
1251
  context.fillRect(left + width - 1, top - 1, 1, height + 1);
1258
1252
  }
1259
1253
 
@@ -972,8 +972,7 @@ export class Grid extends GridBase {
972
972
  this.model.named.Reset();
973
973
  // this.model.named_ranges.Reset();
974
974
  // this.model.named_expressions.clear();
975
-
976
- console.info({IDX: import_data.named});
975
+ // console.info({IDX: import_data.named});
977
976
 
978
977
  if (import_data.named) {
979
978
  this.model.UnserializeComposite(import_data.named, this.active_sheet);