@trebco/treb 25.5.0 → 25.6.1
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/dist/treb-spreadsheet.mjs +7 -7
- package/dist/treb.d.ts +3 -2
- package/package.json +1 -1
- package/treb-base-types/src/import.ts +23 -22
- package/treb-base-types/src/table.ts +0 -4
- package/treb-calculator/src/calculator.ts +2 -2
- package/treb-embed/src/embedded-spreadsheet.ts +25 -16
- package/treb-embed/style/layout.scss +4 -4
- package/treb-export/src/export2.ts +16 -10
- package/treb-export/src/import2.ts +2 -1
- package/treb-grid/src/index.ts +2 -1
- package/treb-grid/src/layout/base_layout.ts +16 -13
- package/treb-grid/src/types/annotation.ts +110 -82
- package/treb-grid/src/types/grid.ts +29 -29
- package/treb-grid/src/types/grid_base.ts +47 -47
- package/treb-grid/src/types/sheet.ts +9 -9
- package/treb-grid/src/types/sheet_types.ts +2 -2
|
@@ -2512,12 +2512,12 @@ export class Sheet {
|
|
|
2512
2512
|
// push out for annotations
|
|
2513
2513
|
|
|
2514
2514
|
for (const annotation of this.annotations) {
|
|
2515
|
-
if (!annotation.extent) {
|
|
2515
|
+
if (!annotation.data.extent) {
|
|
2516
2516
|
this.CalculateAnnotationExtent(annotation);
|
|
2517
2517
|
}
|
|
2518
|
-
if (annotation.extent) {
|
|
2519
|
-
rows = Math.max(rows, annotation.extent.row + 1);
|
|
2520
|
-
columns = Math.max(columns, annotation.extent.column + 1);
|
|
2518
|
+
if (annotation.data.extent) {
|
|
2519
|
+
rows = Math.max(rows, annotation.data.extent.row + 1);
|
|
2520
|
+
columns = Math.max(columns, annotation.data.extent.column + 1);
|
|
2521
2521
|
}
|
|
2522
2522
|
}
|
|
2523
2523
|
|
|
@@ -2769,22 +2769,22 @@ export class Sheet {
|
|
|
2769
2769
|
// at some point, we just need to make sure that happens before this
|
|
2770
2770
|
// is called
|
|
2771
2771
|
|
|
2772
|
-
if (annotation.layout) {
|
|
2773
|
-
annotation.extent = { ...annotation.layout.br.address };
|
|
2772
|
+
if (annotation.data.layout) {
|
|
2773
|
+
annotation.data.extent = { ...annotation.data.layout.br.address };
|
|
2774
2774
|
return;
|
|
2775
2775
|
}
|
|
2776
2776
|
|
|
2777
2777
|
// 1000 here is just sanity check, it might be larger
|
|
2778
2778
|
const sanity = 1000;
|
|
2779
2779
|
|
|
2780
|
-
annotation.extent = { row: 0, column: 0 };
|
|
2780
|
+
annotation.data.extent = { row: 0, column: 0 };
|
|
2781
2781
|
|
|
2782
2782
|
let right = annotation.rect?.right;
|
|
2783
2783
|
if (right && this.default_column_width) { // also sanity check
|
|
2784
2784
|
for (let i = 0; right >= 0 && i < sanity; i++) {
|
|
2785
2785
|
right -= this.GetColumnWidth(i); // FIXME: check // it's ok, rect is scaled to unit
|
|
2786
2786
|
if (right < 0) {
|
|
2787
|
-
annotation.extent.column = i;
|
|
2787
|
+
annotation.data.extent.column = i;
|
|
2788
2788
|
break;
|
|
2789
2789
|
}
|
|
2790
2790
|
}
|
|
@@ -2795,7 +2795,7 @@ export class Sheet {
|
|
|
2795
2795
|
for (let i = 0; bottom >= 0 && i < sanity; i++) {
|
|
2796
2796
|
bottom -= this.GetRowHeight(i); // FIXME: check // it's ok, rect is scaled to unit
|
|
2797
2797
|
if (bottom < 0) {
|
|
2798
|
-
annotation.extent.row = i;
|
|
2798
|
+
annotation.data.extent.row = i;
|
|
2799
2799
|
break;
|
|
2800
2800
|
}
|
|
2801
2801
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
import type { IArea, SerializedCellData, Style } from 'treb-base-types';
|
|
23
|
-
import type { Annotation } from './annotation';
|
|
23
|
+
import type { Annotation, AnnotationData } from './annotation';
|
|
24
24
|
import type { GridSelection } from './grid_selection';
|
|
25
25
|
|
|
26
26
|
export interface UpdateHints {
|
|
@@ -82,7 +82,7 @@ export interface SerializedSheet {
|
|
|
82
82
|
name?: string;
|
|
83
83
|
|
|
84
84
|
selection: GridSelection;
|
|
85
|
-
annotations?: Partial<Annotation>[];
|
|
85
|
+
annotations?: Partial<AnnotationData>[]; // Partial<Annotation>[];
|
|
86
86
|
scroll?: ScrollOffset;
|
|
87
87
|
|
|
88
88
|
visible?: boolean;
|