@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
package/treb-embed/src/types.ts
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
import type { IArea, Table, TableTheme } from 'treb-base-types';
|
|
23
|
-
import type {
|
|
23
|
+
import type { SerializedNamedExpression, SerializedSheet } from 'treb-grid';
|
|
24
|
+
import type { SerializedMacroFunction } from 'treb-grid/src/types/data_model';
|
|
24
25
|
|
|
25
26
|
export enum SaveFileType {
|
|
26
27
|
json = 'json',
|
|
@@ -38,6 +39,12 @@ export enum SaveFileType {
|
|
|
38
39
|
// and so on
|
|
39
40
|
//
|
|
40
41
|
|
|
42
|
+
/**
|
|
43
|
+
* we're not exporting this type in the public API because there are so many
|
|
44
|
+
* nested types that aren't used anywhere else (in public functions).
|
|
45
|
+
*
|
|
46
|
+
* I would like to do it, though, that `any` looks bad in the public API.
|
|
47
|
+
*/
|
|
41
48
|
export interface TREBDocument {
|
|
42
49
|
app: string;
|
|
43
50
|
version: string;
|
|
@@ -48,8 +55,11 @@ export interface TREBDocument {
|
|
|
48
55
|
decimal_mark?: '.' | ',';
|
|
49
56
|
active_sheet?: number;
|
|
50
57
|
rendered_values?: boolean;
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
|
|
59
|
+
// named_ranges?: {[index: string]: IArea};
|
|
60
|
+
named_ranges?: Record<string, IArea>;
|
|
61
|
+
|
|
62
|
+
macro_functions?: SerializedMacroFunction[];
|
|
53
63
|
named_expressions?: SerializedNamedExpression[];
|
|
54
64
|
tables?: Table[];
|
|
55
65
|
shared_resources?: Record<string, string>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@import './grid.scss';
|
|
3
3
|
@import './theme-defaults.scss';
|
|
4
4
|
@import './dark-theme.scss';
|
|
5
|
-
@import 'treb-charts/style/charts.scss';
|
|
5
|
+
@import '../../treb-charts/style/charts.scss';
|
|
6
6
|
@import './dialog.scss';
|
|
7
7
|
@import './spinner.scss';
|
|
8
8
|
@import './treb-icons.scss';
|
|
@@ -364,34 +364,37 @@
|
|
|
364
364
|
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
}
|
|
368
367
|
|
|
369
|
-
// these are (atm) outside of the container because we want them
|
|
370
|
-
// to be able to float over any outside content as well... what's the
|
|
371
|
-
// rule with that? something about stacking contexts? of course we're
|
|
372
|
-
// always goint to be fighting z-indexes.
|
|
373
|
-
//
|
|
374
|
-
// ...possible to use a dialog element? TODO: investigate...
|
|
375
|
-
//
|
|
376
|
-
|
|
377
|
-
.
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
368
|
+
// these are (atm) outside of the container because we want them
|
|
369
|
+
// to be able to float over any outside content as well... what's the
|
|
370
|
+
// rule with that? something about stacking contexts? of course we're
|
|
371
|
+
// always goint to be fighting z-indexes.
|
|
372
|
+
//
|
|
373
|
+
// ...possible to use a dialog element? TODO: investigate...
|
|
374
|
+
//
|
|
375
|
+
|
|
376
|
+
// OK, but then we can't scope properly. so no.
|
|
377
|
+
|
|
378
|
+
.treb-resize-rect {
|
|
379
|
+
all: initial;
|
|
380
|
+
z-index: 9998; // ugh
|
|
381
|
+
position: fixed;
|
|
382
|
+
top: 0px;
|
|
383
|
+
left: 0px;
|
|
384
|
+
border: 1px dotted var(--treb-resize-frame-color, blue);
|
|
385
|
+
width: 100%;
|
|
386
|
+
height: 100%;
|
|
387
|
+
display: block;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.treb-resize-mask {
|
|
391
|
+
all: initial;
|
|
392
|
+
z-index: 9999; // ugh
|
|
393
|
+
position: fixed;
|
|
394
|
+
top: 0px;
|
|
395
|
+
left: 0px;
|
|
396
|
+
width: 100vw;
|
|
397
|
+
height: 100vh;
|
|
398
|
+
}
|
|
388
399
|
|
|
389
|
-
.treb-resize-mask {
|
|
390
|
-
all: initial;
|
|
391
|
-
z-index: 9999; // ugh
|
|
392
|
-
position: fixed;
|
|
393
|
-
top: 0px;
|
|
394
|
-
left: 0px;
|
|
395
|
-
width: 100vw;
|
|
396
|
-
height: 100vh;
|
|
397
400
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
// import * as ElementTree from 'elementtree';
|
|
23
23
|
// import { Element, ElementTree as Tree } from 'elementtree';
|
|
24
|
-
import { UnitAddress, UnitRange, UnitLiteral, ExpressionUnit } from 'treb-parser';
|
|
24
|
+
import type { UnitAddress, UnitRange, UnitLiteral, ExpressionUnit } from 'treb-parser';
|
|
25
25
|
|
|
26
26
|
import { static_title, ref_title, chart_template } from './chart-template-components2';
|
|
27
27
|
import { column_json, column_series } from './column-chart-template2';
|
|
@@ -41,7 +41,7 @@ import { scatter_series as scatter2_series } from './scatter2-chart-template';
|
|
|
41
41
|
// import { v4 as uuidv4 } from 'uuid';
|
|
42
42
|
|
|
43
43
|
import { Localization } from 'treb-base-types';
|
|
44
|
-
import { RelationshipMap } from '../relationship';
|
|
44
|
+
import type { RelationshipMap } from '../relationship';
|
|
45
45
|
|
|
46
46
|
export interface ChartOptions {
|
|
47
47
|
type: 'donut'|'column'|'bar'|'scatter'|'scatter2';
|
|
@@ -19,10 +19,12 @@
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
22
|
+
import type { ImageOptions } from './embedded-image';
|
|
23
|
+
import { EmbeddedImage } from './embedded-image';
|
|
24
|
+
import type { ChartOptions} from './chart2';
|
|
25
|
+
import { Chart} from './chart2';
|
|
26
|
+
import type { RelationshipMap} from '../relationship';
|
|
27
|
+
import { AddRel } from '../relationship';
|
|
26
28
|
|
|
27
29
|
const pixel_offset = 9525;
|
|
28
30
|
|
|
@@ -1,27 +1,25 @@
|
|
|
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
|
-
|
|
23
|
-
// import { Exporter } from '../export';
|
|
24
|
-
import type { ImportedSheetData, IArea } from 'treb-base-types/src';
|
|
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 { ImportedSheetData } from 'treb-base-types/src';
|
|
25
23
|
|
|
26
24
|
import { Exporter } from '../export2';
|
|
27
25
|
import { Importer } from '../import2';
|
|
@@ -34,25 +34,32 @@ const XMLDeclaration = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\
|
|
|
34
34
|
import { template } from './template-2';
|
|
35
35
|
import type { SerializedSheet } from 'treb-grid';
|
|
36
36
|
|
|
37
|
-
import { IArea,
|
|
38
|
-
AnnotationLayout, Corner as LayoutCorner,
|
|
37
|
+
import type { IArea, ICellAddress, CellValue, DataValidation,
|
|
38
|
+
AnnotationLayout, Corner as LayoutCorner, Cell } from 'treb-base-types';
|
|
39
|
+
import { Area, Cells, ValueType, Style, ValidationType } from 'treb-base-types';
|
|
39
40
|
|
|
40
41
|
// import * as xmlparser from 'fast-xml-parser';
|
|
41
|
-
import {
|
|
42
|
+
import type { XmlBuilderOptions} from 'fast-xml-parser';
|
|
43
|
+
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
|
|
42
44
|
|
|
43
45
|
import { SharedStrings } from './shared-strings2';
|
|
44
|
-
import {
|
|
46
|
+
import type { XlColor, BorderEdge } from './workbook-style2';
|
|
47
|
+
import { StyleCache } from './workbook-style2';
|
|
45
48
|
import { Theme } from './workbook-theme2';
|
|
46
49
|
|
|
47
|
-
import { RelationshipMap
|
|
50
|
+
import type { RelationshipMap} from './relationship';
|
|
51
|
+
import { AddRel } from './relationship';
|
|
48
52
|
import { XMLOptions2 } from './xml-utils';
|
|
49
53
|
|
|
50
|
-
import {
|
|
54
|
+
import type { UnitAddress, UnitRange, ExpressionUnit} from 'treb-parser';
|
|
55
|
+
import { Parser, QuotedSheetNameRegex } from 'treb-parser';
|
|
51
56
|
|
|
52
57
|
// FIXME: move
|
|
53
|
-
import {
|
|
58
|
+
import type { ChartOptions } from './drawing2/chart2';
|
|
59
|
+
import { Chart } from './drawing2/chart2';
|
|
54
60
|
import type { ImageOptions } from './drawing2/embedded-image';
|
|
55
|
-
import {
|
|
61
|
+
import type { TwoCellAnchor } from './drawing2/drawing2';
|
|
62
|
+
import { Drawing } from './drawing2/drawing2';
|
|
56
63
|
import type { TableDescription, TableFooterType } from './workbook2';
|
|
57
64
|
|
|
58
65
|
export class Exporter {
|
|
@@ -22,11 +22,16 @@
|
|
|
22
22
|
//import * as JSZip from 'jszip';
|
|
23
23
|
import JSZip from 'jszip';
|
|
24
24
|
|
|
25
|
-
import { AnchoredChartDescription
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
25
|
+
import type { AnchoredChartDescription} from './workbook2';
|
|
26
|
+
import { ChartType, Workbook } from './workbook2';
|
|
27
|
+
import type { ParseResult } from 'treb-parser';
|
|
28
|
+
import { Parser } from 'treb-parser';
|
|
29
|
+
import type { RangeType, AddressType, HyperlinkType } from './address-type';
|
|
30
|
+
import { is_range, ShiftRange, InRange, is_address } from './address-type';
|
|
31
|
+
import type { ImportedSheetData, AnchoredAnnotation, CellParseResult, AnnotationLayout, Corner as LayoutCorner, ICellAddress, DataValidation, IArea } from 'treb-base-types/src';
|
|
32
|
+
import { ValueType, ValidationType } from 'treb-base-types/src';
|
|
33
|
+
import type { Sheet} from './workbook-sheet2';
|
|
34
|
+
import { VisibleState } from './workbook-sheet2';
|
|
30
35
|
import type { CellAnchor } from './drawing2/drawing2';
|
|
31
36
|
import { XMLUtils } from './xml-utils';
|
|
32
37
|
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
*/
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
import { AddressType, RangeType
|
|
44
|
+
import type { AddressType, RangeType} from './address-type';
|
|
45
|
+
import { is_range } from './address-type';
|
|
45
46
|
import type { SharedStrings } from './shared-strings2';
|
|
46
47
|
import type { Drawing } from './drawing2/drawing2';
|
|
47
48
|
import type { RelationshipMap } from './relationship';
|
|
@@ -1,28 +1,29 @@
|
|
|
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 { FormatParser } from './format_parser';
|
|
23
23
|
import { NumberFormatSection } from './number_format_section';
|
|
24
|
+
import type { TextPart, Complex, DimensionedQuantity, CellValue} from 'treb-base-types';
|
|
24
25
|
import {
|
|
25
|
-
Localization, TextPartFlag,
|
|
26
|
+
Localization, TextPartFlag, IsDimensionedQuantity,
|
|
26
27
|
} from 'treb-base-types';
|
|
27
28
|
|
|
28
29
|
//
|
|
@@ -1,26 +1,27 @@
|
|
|
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 { NumberFormatSection } from './number_format_section';
|
|
23
|
-
import {
|
|
23
|
+
import type { TextPart } from 'treb-base-types';
|
|
24
|
+
import { TextPartFlag } from 'treb-base-types';
|
|
24
25
|
// import { NumberFormat } from './format';
|
|
25
26
|
|
|
26
27
|
const ASTERISK = 0x2A; // TODO
|
|
@@ -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 { Complex } from 'treb-base-types';
|
|
23
|
+
import { ValueType, Localization } from 'treb-base-types';
|
|
23
24
|
import { UnlotusDate } from './format';
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -23,7 +23,8 @@ import { Yield } from 'treb-utils';
|
|
|
23
23
|
|
|
24
24
|
import { DOMUtilities } from '../util/dom_utilities';
|
|
25
25
|
import type { Theme } from 'treb-base-types';
|
|
26
|
-
import {
|
|
26
|
+
import type { FormulaEditorEvent } from './formula_editor_base';
|
|
27
|
+
import { FormulaEditorBase } from './formula_editor_base';
|
|
27
28
|
import type { GridOptions } from '../types/grid_options';
|
|
28
29
|
import type { Autocomplete } from './autocomplete';
|
|
29
30
|
import type { DataModel, ViewModel } from '../types/data_model';
|
|
@@ -19,13 +19,15 @@
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import type { Cell, Theme, ICellAddress } from 'treb-base-types';
|
|
23
|
+
import { Area, Rectangle, Localization } from 'treb-base-types';
|
|
23
24
|
import { Yield, EventSource } from 'treb-utils';
|
|
24
25
|
import type { Parser, UnitRange, UnitAddress, ParseResult, ExpressionUnit } from 'treb-parser';
|
|
25
26
|
|
|
26
27
|
import type { GridSelection } from '../types/grid_selection';
|
|
27
28
|
import type { Autocomplete, AutocompleteResult } from './autocomplete';
|
|
28
|
-
import { AutocompleteExecResult, AutocompleteMatcher
|
|
29
|
+
import type { AutocompleteExecResult, AutocompleteMatcher} from './autocomplete_matcher';
|
|
30
|
+
import { DescriptorType } from './autocomplete_matcher';
|
|
29
31
|
|
|
30
32
|
import type { DataModel, ViewModel } from '../types/data_model';
|
|
31
33
|
import { UA } from '../util/ua';
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
* and get layout working properly.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
import {
|
|
31
|
+
import type { Theme, CellValue, Rectangle, Cell } from 'treb-base-types';
|
|
32
|
+
import { Style, ThemeColor2 } from 'treb-base-types';
|
|
32
33
|
import { Yield } from 'treb-utils';
|
|
33
34
|
import type { Parser } from 'treb-parser';
|
|
34
35
|
import type { GridSelection } from '../types/grid_selection';
|
package/treb-grid/src/index.ts
CHANGED
|
@@ -22,16 +22,19 @@
|
|
|
22
22
|
export { Grid } from './types/grid';
|
|
23
23
|
export { GridBase } from './types/grid_base';
|
|
24
24
|
export { Sheet } from './types/sheet';
|
|
25
|
-
export { DataModel, MacroFunction
|
|
25
|
+
export { DataModel, type MacroFunction } from './types/data_model';
|
|
26
|
+
export type { SerializedNamedExpression, SerializedModel } from './types/data_model';
|
|
26
27
|
export * from './types/grid_events';
|
|
27
|
-
export { SerializedSheet, FreezePane } from './types/sheet_types';
|
|
28
|
-
export { Annotation
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
28
|
+
export type { SerializedSheet, FreezePane } from './types/sheet_types';
|
|
29
|
+
export { Annotation } from './types/annotation';
|
|
30
|
+
export type { ViewData as AnnotationViewData } from './types/annotation';
|
|
31
|
+
export type { GridOptions } from './types/grid_options';
|
|
32
|
+
export { CommandKey } from './types/grid_command';
|
|
33
|
+
export type { Command } from './types/grid_command';
|
|
31
34
|
export { NamedRangeCollection } from './types/named_range';
|
|
32
|
-
export { GridSelection } from './types/grid_selection';
|
|
35
|
+
export type { GridSelection } from './types/grid_selection';
|
|
33
36
|
export { BorderConstants } from './types/border_constants';
|
|
34
|
-
export { SerializeOptions } from './types/serialize_options';
|
|
35
|
-
export { FunctionDescriptor, ArgumentDescriptor } from './editors/autocomplete_matcher';
|
|
37
|
+
export type { SerializeOptions } from './types/serialize_options';
|
|
38
|
+
export type { FunctionDescriptor, ArgumentDescriptor } from './editors/autocomplete_matcher';
|
|
36
39
|
export { UA } from './util/ua';
|
|
37
|
-
export { SetRangeOptions } from './types/set_range_options';
|
|
40
|
+
export type { SetRangeOptions } from './types/set_range_options';
|
|
@@ -23,7 +23,8 @@ import { DOMUtilities } from '../util/dom_utilities';
|
|
|
23
23
|
import type { DataModel, ViewModel } from '../types/data_model';
|
|
24
24
|
|
|
25
25
|
import type { Tile } from '../types/tile';
|
|
26
|
-
import {
|
|
26
|
+
import type { Theme, Point, Extent, Size, Position, ICellAddress, Table } from 'treb-base-types';
|
|
27
|
+
import { Style, Area, Rectangle, ThemeColor } from 'treb-base-types';
|
|
27
28
|
|
|
28
29
|
import { MouseDrag } from '../types/drag_mask';
|
|
29
30
|
import type { GridEvent } from '../types/grid_events';
|
|
@@ -39,7 +40,8 @@ import type { GridEvent } from '../types/grid_events';
|
|
|
39
40
|
// define area as a generic, then define it on some arbitrary value. that would
|
|
40
41
|
// force separation of all the functions between the two types (I think)
|
|
41
42
|
|
|
42
|
-
import {
|
|
43
|
+
import type { CellValue, AnnotationLayout, Corner } from 'treb-base-types';
|
|
44
|
+
import { Area as TileRange } from 'treb-base-types';
|
|
43
45
|
import type { Annotation } from '../types/annotation';
|
|
44
46
|
|
|
45
47
|
export { Area as TileRange } from 'treb-base-types';
|
|
@@ -1,27 +1,29 @@
|
|
|
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 { Theme,
|
|
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 { Theme, ICellAddress } from 'treb-base-types';
|
|
23
|
+
import { Rectangle } from 'treb-base-types';
|
|
23
24
|
import type { BaseLayout } from '../layout/base_layout';
|
|
24
|
-
import {
|
|
25
|
+
import type { SelectionOffset } from './svg_selection_block';
|
|
26
|
+
import { SVGSelectionBlock } from './svg_selection_block';
|
|
25
27
|
import type { GridSelection } from '../types/grid_selection';
|
|
26
28
|
import { HeaderOverlay, Orientation } from './svg_header_overlay';
|
|
27
29
|
import type { DataModel, ViewModel } from '../types/data_model';
|
|
@@ -19,14 +19,16 @@
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import type { ICellAddress,
|
|
23
23
|
PreparedText, RenderTextPart,
|
|
24
|
-
Cell,
|
|
25
|
-
Theme
|
|
24
|
+
Cell, Size,
|
|
25
|
+
Theme} from 'treb-base-types';
|
|
26
|
+
import { TextPartFlag, Style, ValueType, Area, Rectangle, ThemeColor, ThemeColor2 } from 'treb-base-types';
|
|
26
27
|
|
|
27
28
|
import type { Tile } from '../types/tile';
|
|
28
29
|
import { FontMetricsCache as FontMetricsCache2 } from '../util/fontmetrics2';
|
|
29
|
-
import { FormattedString
|
|
30
|
+
import type { FormattedString} from 'treb-parser';
|
|
31
|
+
import { MDParser } from 'treb-parser';
|
|
30
32
|
import type { BaseLayout, TileRange } from '../layout/base_layout';
|
|
31
33
|
import type { DataModel, ViewModel } from '../types/data_model';
|
|
32
34
|
import type { GridOptions } from '../types/grid_options';
|