@trebco/treb 25.2.0 → 25.4.2
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/{.eslintrc.js → .eslintrc.cjs} +4 -0
- package/api-generator/api-generator.ts +25 -55
- package/dist/treb-spreadsheet.mjs +9 -9
- package/dist/treb.d.ts +1 -1
- package/esbuild-custom-element.mjs +5 -264
- package/esbuild-utils.mjs +273 -0
- package/package.json +2 -2
- package/treb-base-types/src/cell.ts +23 -22
- package/treb-base-types/src/cells.ts +55 -2
- package/treb-base-types/src/union.ts +2 -1
- package/treb-calculator/src/calculator.ts +8 -5
- package/treb-calculator/src/dag/array-vertex.ts +22 -22
- package/treb-calculator/src/dag/graph.ts +25 -23
- package/treb-calculator/src/dag/leaf_vertex.ts +23 -22
- package/treb-calculator/src/dag/spreadsheet_vertex.ts +25 -23
- package/treb-calculator/src/expression-calculator.ts +23 -22
- package/treb-calculator/src/function-error.ts +23 -22
- package/treb-calculator/src/functions/base-functions.ts +3 -2
- package/treb-calculator/src/functions/checkbox.ts +23 -22
- package/treb-calculator/src/functions/complex-functions.ts +2 -1
- package/treb-calculator/src/functions/finance-functions.ts +22 -22
- package/treb-calculator/src/functions/information-functions.ts +22 -22
- package/treb-calculator/src/functions/matrix-functions.ts +2 -1
- package/treb-calculator/src/functions/statistics-functions.ts +22 -22
- package/treb-calculator/src/functions/text-functions.ts +23 -22
- package/treb-calculator/src/primitives.ts +23 -22
- package/treb-calculator/src/utilities.ts +23 -24
- package/treb-charts/src/chart-functions.ts +22 -22
- package/treb-charts/src/chart.ts +6 -3
- package/treb-charts/src/renderer.ts +25 -23
- package/treb-charts/src/util.ts +23 -22
- package/treb-embed/modern.tsconfig.json +3 -2
- package/treb-embed/src/custom-element/spreadsheet-constructor.ts +10 -14
- package/treb-embed/src/embedded-spreadsheet.ts +53 -44
- package/treb-embed/src/progress-dialog.ts +0 -3
- package/treb-embed/src/types.ts +13 -3
- package/treb-embed/style/layout.scss +32 -29
- package/treb-export/src/drawing2/chart2.ts +2 -2
- package/treb-export/src/drawing2/drawing2.ts +6 -4
- package/treb-export/src/export-worker/export-worker.ts +22 -24
- package/treb-export/src/export-worker/index-modern.ts +2 -1
- package/treb-export/src/export2.ts +15 -8
- package/treb-export/src/import2.ts +10 -5
- package/treb-export/src/workbook-sheet2.ts +2 -1
- package/treb-format/src/format.ts +23 -22
- package/treb-format/src/format_parser.ts +23 -22
- package/treb-format/src/value_parser.ts +23 -22
- package/treb-grid/src/editors/formula_bar.ts +2 -1
- package/treb-grid/src/editors/formula_editor_base.ts +4 -2
- package/treb-grid/src/editors/overlay_editor.ts +2 -1
- package/treb-grid/src/index.ts +12 -9
- package/treb-grid/src/layout/base_layout.ts +4 -2
- package/treb-grid/src/render/selection-renderer.ts +25 -23
- package/treb-grid/src/render/tile_renderer.ts +6 -4
- package/treb-grid/src/types/annotation.ts +33 -37
- package/treb-grid/src/types/data_model.ts +30 -22
- package/treb-grid/src/types/grid.ts +55 -584
- package/treb-grid/src/types/grid_base.ts +401 -7
- package/treb-grid/src/types/grid_events.ts +3 -0
- package/treb-grid/src/types/grid_selection.ts +22 -22
- package/treb-grid/src/types/named_range.ts +22 -22
- package/treb-grid/src/types/sheet.ts +8 -7
- package/treb-grid/src/types/sheet_types.ts +11 -7
- package/treb-grid/src/types/tab_bar.ts +1 -1
- package/treb-parser/src/parser.ts +5 -4
- package/tsproject.json +3 -4
- package/tsconfig.json +0 -10
- /package/treb-embed/src/{custom-element/content-types.d.ts → content-types.d.ts} +0 -0
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of TREB.
|
|
3
|
-
*
|
|
4
|
-
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
-
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
-
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
-
* later version.
|
|
8
|
-
*
|
|
9
|
-
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
-
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
-
* details.
|
|
13
|
-
*
|
|
14
|
-
* You should have received a copy of the GNU General Public License along
|
|
15
|
-
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
-
*
|
|
17
|
-
* Copyright 2022-2023 trebco, llc.
|
|
18
|
-
* info@treb.app
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import {
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2023 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type { ICellAddress, AnnotationLayout } from 'treb-base-types';
|
|
23
|
+
import { Rectangle } from 'treb-base-types';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* new annotation class. annotations are arbitrary content
|
|
@@ -78,8 +79,18 @@ export interface ViewData {
|
|
|
78
79
|
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
/**
|
|
83
|
+
* why is this a class? it doesn't do anything.
|
|
84
|
+
* FIXME: -> interface
|
|
85
|
+
*/
|
|
81
86
|
export class Annotation {
|
|
82
87
|
|
|
88
|
+
/**
|
|
89
|
+
* the key field is used to identify and coordinate annotations when we
|
|
90
|
+
* have freeze panes. when an annotation crosses a freeze pane, we need
|
|
91
|
+
* two copies of the rendered node so that we can scroll. we use the key
|
|
92
|
+
* to match the frozen/unfrozen instances.
|
|
93
|
+
*/
|
|
83
94
|
public get key(): number { return this.key_; }
|
|
84
95
|
|
|
85
96
|
/** coordinates, in sheet space */
|
|
@@ -105,15 +116,6 @@ export class Annotation {
|
|
|
105
116
|
/** also opaque data, but not serialized. */
|
|
106
117
|
public temp: any = {};
|
|
107
118
|
|
|
108
|
-
/* * flag indicating we have inflated this. not serialized */
|
|
109
|
-
// public inflated = false;
|
|
110
|
-
|
|
111
|
-
/* * if function exists, will be called when the annotation is resized */
|
|
112
|
-
// public resize_callback?: () => void;
|
|
113
|
-
|
|
114
|
-
/* * if function exists, will be called when the annotation needs to update */
|
|
115
|
-
// public update_callback?: () => void;
|
|
116
|
-
|
|
117
119
|
/** annotation can be resized. this is advisory, for UI */
|
|
118
120
|
public resizable = true;
|
|
119
121
|
|
|
@@ -132,12 +134,6 @@ export class Annotation {
|
|
|
132
134
|
/** resize when resizing/inserting rows/columns */
|
|
133
135
|
public resize_with_cells = true;
|
|
134
136
|
|
|
135
|
-
/* * layout node, obviously not serialized */
|
|
136
|
-
// public node?: HTMLDivElement;
|
|
137
|
-
|
|
138
|
-
/* * content node */
|
|
139
|
-
// public content_node?: HTMLDivElement;
|
|
140
|
-
|
|
141
137
|
public view: ViewData[] = [];
|
|
142
138
|
|
|
143
139
|
/**
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is part of TREB.
|
|
3
|
-
*
|
|
4
|
-
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
-
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
-
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
-
* later version.
|
|
8
|
-
*
|
|
9
|
-
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
-
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
-
* details.
|
|
13
|
-
*
|
|
14
|
-
* You should have received a copy of the GNU General Public License along
|
|
15
|
-
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
-
*
|
|
17
|
-
* Copyright 2022-2023 trebco, llc.
|
|
18
|
-
* info@treb.app
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2023 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
22
|
import type { Sheet } from './sheet';
|
|
23
23
|
import type { IArea, ICellAddress, Table } from 'treb-base-types';
|
|
24
24
|
import type { SerializedSheet } from './sheet_types';
|
|
@@ -26,12 +26,20 @@ import { NamedRangeCollection } from './named_range';
|
|
|
26
26
|
import type { ExpressionUnit, UnitAddress, UnitStructuredReference, UnitRange } from 'treb-parser';
|
|
27
27
|
import { Style } from 'treb-base-types';
|
|
28
28
|
|
|
29
|
-
export interface
|
|
29
|
+
export interface SerializedMacroFunction {
|
|
30
30
|
name: string;
|
|
31
31
|
function_def: string;
|
|
32
32
|
argument_names?: string[];
|
|
33
33
|
// argument_default_values?: any[]; // <- new
|
|
34
34
|
description?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* we define this as extending the serialized version, rather
|
|
39
|
+
* than taking out the parameter, so we can make that def public
|
|
40
|
+
* in the API types.
|
|
41
|
+
*/
|
|
42
|
+
export interface MacroFunction extends SerializedMacroFunction {
|
|
35
43
|
expression?: ExpressionUnit;
|
|
36
44
|
}
|
|
37
45
|
|