@trebco/treb 23.6.5 → 25.0.0-rc2
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/.eslintignore +8 -0
- package/.eslintrc.js +164 -0
- package/README-shadow-DOM.md +88 -0
- package/README.md +37 -130
- package/api-config.json +29 -0
- package/api-generator/api-generator-types.ts +82 -0
- package/api-generator/api-generator.ts +1172 -0
- package/api-generator/package.json +3 -0
- package/build/treb-spreadsheet.mjs +14 -0
- package/{treb.d.ts → build/treb.d.ts} +323 -271
- package/esbuild-custom-element.mjs +336 -0
- package/esbuild.js +305 -0
- package/package.json +49 -14
- package/treb-base-types/package.json +5 -0
- package/treb-base-types/src/api_types.ts +36 -0
- package/treb-base-types/src/area.ts +583 -0
- package/treb-base-types/src/basic_types.ts +45 -0
- package/treb-base-types/src/cell.ts +612 -0
- package/treb-base-types/src/cells.ts +1066 -0
- package/treb-base-types/src/color.ts +124 -0
- package/treb-base-types/src/import.ts +71 -0
- package/treb-base-types/src/index-standalone.ts +29 -0
- package/treb-base-types/src/index.ts +42 -0
- package/treb-base-types/src/layout.ts +47 -0
- package/treb-base-types/src/localization.ts +187 -0
- package/treb-base-types/src/rectangle.ts +145 -0
- package/treb-base-types/src/render_text.ts +72 -0
- package/treb-base-types/src/style.ts +545 -0
- package/treb-base-types/src/table.ts +109 -0
- package/treb-base-types/src/text_part.ts +54 -0
- package/treb-base-types/src/theme.ts +608 -0
- package/treb-base-types/src/union.ts +152 -0
- package/treb-base-types/src/value-type.ts +164 -0
- package/treb-base-types/style/resizable.css +59 -0
- package/treb-calculator/modern.tsconfig.json +11 -0
- package/treb-calculator/package.json +5 -0
- package/treb-calculator/src/calculator.ts +2546 -0
- package/treb-calculator/src/complex-math.ts +558 -0
- package/treb-calculator/src/dag/array-vertex.ts +198 -0
- package/treb-calculator/src/dag/graph.ts +951 -0
- package/treb-calculator/src/dag/leaf_vertex.ts +118 -0
- package/treb-calculator/src/dag/spreadsheet_vertex.ts +327 -0
- package/treb-calculator/src/dag/spreadsheet_vertex_base.ts +44 -0
- package/treb-calculator/src/dag/vertex.ts +352 -0
- package/treb-calculator/src/descriptors.ts +162 -0
- package/treb-calculator/src/expression-calculator.ts +1069 -0
- package/treb-calculator/src/function-error.ts +103 -0
- package/treb-calculator/src/function-library.ts +103 -0
- package/treb-calculator/src/functions/base-functions.ts +1214 -0
- package/treb-calculator/src/functions/checkbox.ts +164 -0
- package/treb-calculator/src/functions/complex-functions.ts +253 -0
- package/treb-calculator/src/functions/finance-functions.ts +399 -0
- package/treb-calculator/src/functions/information-functions.ts +102 -0
- package/treb-calculator/src/functions/matrix-functions.ts +182 -0
- package/treb-calculator/src/functions/sparkline.ts +335 -0
- package/treb-calculator/src/functions/statistics-functions.ts +350 -0
- package/treb-calculator/src/functions/text-functions.ts +298 -0
- package/treb-calculator/src/index.ts +27 -0
- package/treb-calculator/src/notifier-types.ts +59 -0
- package/treb-calculator/src/primitives.ts +428 -0
- package/treb-calculator/src/utilities.ts +305 -0
- package/treb-charts/package.json +5 -0
- package/treb-charts/src/chart-functions.ts +156 -0
- package/treb-charts/src/chart-types.ts +230 -0
- package/treb-charts/src/chart.ts +1288 -0
- package/treb-charts/src/index.ts +24 -0
- package/treb-charts/src/main.ts +37 -0
- package/treb-charts/src/rectangle.ts +52 -0
- package/treb-charts/src/renderer.ts +1841 -0
- package/treb-charts/src/util.ts +122 -0
- package/treb-charts/style/charts.scss +221 -0
- package/treb-charts/style/old-charts.scss +250 -0
- package/treb-embed/markup/layout.html +137 -0
- package/treb-embed/markup/toolbar.html +175 -0
- package/treb-embed/modern.tsconfig.json +25 -0
- package/treb-embed/src/custom-element/content-types.d.ts +18 -0
- package/treb-embed/src/custom-element/global.d.ts +11 -0
- package/treb-embed/src/custom-element/spreadsheet-constructor.ts +1228 -0
- package/treb-embed/src/custom-element/treb-global.ts +44 -0
- package/treb-embed/src/custom-element/treb-spreadsheet-element.ts +52 -0
- package/treb-embed/src/embedded-spreadsheet.ts +5358 -0
- package/treb-embed/src/index.ts +16 -0
- package/treb-embed/src/language-model.ts +41 -0
- package/treb-embed/src/options.ts +298 -0
- package/treb-embed/src/progress-dialog.ts +228 -0
- package/treb-embed/src/selection-state.ts +16 -0
- package/treb-embed/src/spinner.ts +42 -0
- package/treb-embed/src/toolbar-message.ts +96 -0
- package/treb-embed/src/types.ts +167 -0
- package/treb-embed/style/autocomplete.scss +103 -0
- package/treb-embed/style/dark-theme.scss +114 -0
- package/treb-embed/style/defaults.scss +36 -0
- package/treb-embed/style/dialog.scss +181 -0
- package/treb-embed/style/dropdown-select.scss +101 -0
- package/treb-embed/style/formula-bar.scss +193 -0
- package/treb-embed/style/grid.scss +374 -0
- package/treb-embed/style/layout.scss +424 -0
- package/treb-embed/style/mouse-mask.scss +67 -0
- package/treb-embed/style/note.scss +92 -0
- package/treb-embed/style/overlay-editor.scss +102 -0
- package/treb-embed/style/spinner.scss +92 -0
- package/treb-embed/style/tab-bar.scss +228 -0
- package/treb-embed/style/table.scss +80 -0
- package/treb-embed/style/theme-defaults.scss +444 -0
- package/treb-embed/style/toolbar.scss +416 -0
- package/treb-embed/style/tooltip.scss +68 -0
- package/treb-embed/style/treb-icons.scss +130 -0
- package/treb-embed/style/treb-spreadsheet-element.scss +20 -0
- package/treb-embed/style/z-index.scss +43 -0
- package/treb-export/docs/charts.md +68 -0
- package/treb-export/modern.tsconfig.json +19 -0
- package/treb-export/package.json +4 -0
- package/treb-export/src/address-type.ts +77 -0
- package/treb-export/src/base-template.ts +22 -0
- package/treb-export/src/column-width.ts +85 -0
- package/treb-export/src/drawing2/chart-template-components2.ts +389 -0
- package/treb-export/src/drawing2/chart2.ts +282 -0
- package/treb-export/src/drawing2/column-chart-template2.ts +521 -0
- package/treb-export/src/drawing2/donut-chart-template2.ts +296 -0
- package/treb-export/src/drawing2/drawing2.ts +355 -0
- package/treb-export/src/drawing2/embedded-image.ts +71 -0
- package/treb-export/src/drawing2/scatter-chart-template2.ts +555 -0
- package/treb-export/src/export-worker/export-worker.ts +99 -0
- package/treb-export/src/export-worker/index-modern.ts +22 -0
- package/treb-export/src/export2.ts +2204 -0
- package/treb-export/src/import2.ts +882 -0
- package/treb-export/src/relationship.ts +36 -0
- package/treb-export/src/shared-strings2.ts +128 -0
- package/treb-export/src/template-2.ts +22 -0
- package/treb-export/src/unescape_xml.ts +47 -0
- package/treb-export/src/workbook-sheet2.ts +182 -0
- package/treb-export/src/workbook-style2.ts +1285 -0
- package/treb-export/src/workbook-theme2.ts +88 -0
- package/treb-export/src/workbook2.ts +491 -0
- package/treb-export/src/xml-utils.ts +201 -0
- package/treb-export/template/base/[Content_Types].xml +2 -0
- package/treb-export/template/base/_rels/.rels +2 -0
- package/treb-export/template/base/docProps/app.xml +2 -0
- package/treb-export/template/base/docProps/core.xml +12 -0
- package/treb-export/template/base/xl/_rels/workbook.xml.rels +2 -0
- package/treb-export/template/base/xl/sharedStrings.xml +2 -0
- package/treb-export/template/base/xl/styles.xml +2 -0
- package/treb-export/template/base/xl/theme/theme1.xml +2 -0
- package/treb-export/template/base/xl/workbook.xml +2 -0
- package/treb-export/template/base/xl/worksheets/sheet1.xml +2 -0
- package/treb-export/template/base.xlsx +0 -0
- package/treb-format/package.json +8 -0
- package/treb-format/src/format.test.ts +213 -0
- package/treb-format/src/format.ts +942 -0
- package/treb-format/src/format_cache.ts +199 -0
- package/treb-format/src/format_parser.ts +723 -0
- package/treb-format/src/index.ts +25 -0
- package/treb-format/src/number_format_section.ts +100 -0
- package/treb-format/src/value_parser.ts +337 -0
- package/treb-grid/package.json +5 -0
- package/treb-grid/src/editors/autocomplete.ts +394 -0
- package/treb-grid/src/editors/autocomplete_matcher.ts +260 -0
- package/treb-grid/src/editors/formula_bar.ts +473 -0
- package/treb-grid/src/editors/formula_editor_base.ts +910 -0
- package/treb-grid/src/editors/overlay_editor.ts +511 -0
- package/treb-grid/src/index.ts +37 -0
- package/treb-grid/src/layout/base_layout.ts +2618 -0
- package/treb-grid/src/layout/grid_layout.ts +299 -0
- package/treb-grid/src/layout/rectangle_cache.ts +86 -0
- package/treb-grid/src/render/selection-renderer.ts +414 -0
- package/treb-grid/src/render/svg_header_overlay.ts +93 -0
- package/treb-grid/src/render/svg_selection_block.ts +187 -0
- package/treb-grid/src/render/tile_renderer.ts +2122 -0
- package/treb-grid/src/types/annotation.ts +216 -0
- package/treb-grid/src/types/border_constants.ts +34 -0
- package/treb-grid/src/types/clipboard_data.ts +31 -0
- package/treb-grid/src/types/data_model.ts +334 -0
- package/treb-grid/src/types/drag_mask.ts +81 -0
- package/treb-grid/src/types/grid.ts +7743 -0
- package/treb-grid/src/types/grid_base.ts +3644 -0
- package/treb-grid/src/types/grid_command.ts +470 -0
- package/treb-grid/src/types/grid_events.ts +124 -0
- package/treb-grid/src/types/grid_options.ts +97 -0
- package/treb-grid/src/types/grid_selection.ts +60 -0
- package/treb-grid/src/types/named_range.ts +369 -0
- package/treb-grid/src/types/scale-control.ts +202 -0
- package/treb-grid/src/types/serialize_options.ts +72 -0
- package/treb-grid/src/types/set_range_options.ts +52 -0
- package/treb-grid/src/types/sheet.ts +3099 -0
- package/treb-grid/src/types/sheet_types.ts +95 -0
- package/treb-grid/src/types/tab_bar.ts +464 -0
- package/treb-grid/src/types/tile.ts +59 -0
- package/treb-grid/src/types/update_flags.ts +75 -0
- package/treb-grid/src/util/dom_utilities.ts +44 -0
- package/treb-grid/src/util/fontmetrics2.ts +179 -0
- package/treb-grid/src/util/ua.ts +104 -0
- package/treb-logo.svg +18 -0
- package/treb-parser/package.json +5 -0
- package/treb-parser/src/csv-parser.ts +122 -0
- package/treb-parser/src/index.ts +25 -0
- package/treb-parser/src/md-parser.ts +526 -0
- package/treb-parser/src/parser-types.ts +397 -0
- package/treb-parser/src/parser.test.ts +298 -0
- package/treb-parser/src/parser.ts +2673 -0
- package/treb-utils/package.json +5 -0
- package/treb-utils/src/dispatch.ts +57 -0
- package/treb-utils/src/event_source.ts +147 -0
- package/treb-utils/src/ievent_source.ts +33 -0
- package/treb-utils/src/index.ts +31 -0
- package/treb-utils/src/measurement.ts +174 -0
- package/treb-utils/src/resizable.ts +160 -0
- package/treb-utils/src/scale.ts +137 -0
- package/treb-utils/src/serialize_html.ts +124 -0
- package/treb-utils/src/template.ts +70 -0
- package/treb-utils/src/validate_uri.ts +61 -0
- package/tsconfig.json +10 -0
- package/tsproject.json +30 -0
- package/util/license-plugin-esbuild.js +86 -0
- package/util/list-css-vars.sh +46 -0
- package/README-esm.md +0 -37
- package/treb-bundle.css +0 -2
- package/treb-bundle.mjs +0 -15
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
|
|
2
|
+
import type { Style } from 'treb-base-types';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* this is an attempt to lock down toolbar commands, and better
|
|
6
|
+
* manage type data along with those commands. data should always
|
|
7
|
+
* be optional (not in practice, but in typings).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export interface SetColorToolbarMessage {
|
|
11
|
+
command: 'fill-color'|'text-color'|'border-color';
|
|
12
|
+
color?: Style.Color
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CommentToolbarMessage {
|
|
16
|
+
command: 'update-comment'|'clear-comment';
|
|
17
|
+
comment?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface BorderToolbarMessage {
|
|
21
|
+
command: 'border-top'|'border-bottom'|'border-left'|'border-right'|'border-all'|'border-outside'|'border-none'|'border-double-bottom';
|
|
22
|
+
color?: Style.Color;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface AnnotationToolbarMessage {
|
|
26
|
+
command: 'insert-image'|'insert-donut-chart'|'insert-line-chart'|'insert-column-chart'|'insert-bar-chart';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface LayoutToolbarMessage {
|
|
30
|
+
command: 'insert-row'|'delete-row'|'insert-column'|'delete-column'|'insert-sheet'|'delete-sheet';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface PrecisionToolbarMessage {
|
|
34
|
+
command: 'increase-precision'|'decrease-precision';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IOToolbarMessage {
|
|
38
|
+
command: 'import-file'|'export-xlsx'|'save-json'|'save-csv';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface MergeToolbarMessage {
|
|
42
|
+
command: 'merge-cells'|'unmerge-cells';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface AlignToolbarMessage {
|
|
46
|
+
command: 'align-top'|'align-middle'|'align-bottom';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface JustifyToolbarMessage {
|
|
50
|
+
command: 'justify-left'|'justify-center'|'justify-right';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FontScaleToolbarMessage {
|
|
54
|
+
command: 'font-scale';
|
|
55
|
+
scale?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface NumberFormatToolbarMessage {
|
|
59
|
+
command: 'number-format';
|
|
60
|
+
format?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface TableToolbarMessage {
|
|
64
|
+
command: 'insert-table'|'remove-table';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface CommandToolbarMessage {
|
|
68
|
+
command: 'reset'|'recalculate'|'freeze-panes'|'about'|'revert';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface StyleToolbarMessage {
|
|
72
|
+
command: 'wrap-text'|'lock-cells';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface UIToolbarMessage {
|
|
76
|
+
command: 'toggle-toolbar'|'show-toolbar'|'hide-toolbar'|'toggle-sidebar'|'show-sidebar'|'hide-sidebar';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type ToolbarMessage
|
|
80
|
+
= SetColorToolbarMessage
|
|
81
|
+
| CommentToolbarMessage
|
|
82
|
+
| IOToolbarMessage
|
|
83
|
+
| UIToolbarMessage
|
|
84
|
+
| MergeToolbarMessage
|
|
85
|
+
| BorderToolbarMessage
|
|
86
|
+
| LayoutToolbarMessage
|
|
87
|
+
| AnnotationToolbarMessage
|
|
88
|
+
| PrecisionToolbarMessage
|
|
89
|
+
| JustifyToolbarMessage
|
|
90
|
+
| AlignToolbarMessage
|
|
91
|
+
| TableToolbarMessage
|
|
92
|
+
| CommandToolbarMessage
|
|
93
|
+
| StyleToolbarMessage
|
|
94
|
+
| NumberFormatToolbarMessage
|
|
95
|
+
| FontScaleToolbarMessage
|
|
96
|
+
;
|
|
@@ -0,0 +1,167 @@
|
|
|
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 { IArea, Table, TableTheme } from 'treb-base-types';
|
|
23
|
+
import type { MacroFunction, SerializedNamedExpression, SerializedSheet } from 'treb-grid';
|
|
24
|
+
|
|
25
|
+
export enum SaveFileType {
|
|
26
|
+
json = 'json',
|
|
27
|
+
treb = 'treb',
|
|
28
|
+
trebjson = 'treb.json',
|
|
29
|
+
csv = 'csv',
|
|
30
|
+
tsv = 'tsv',
|
|
31
|
+
xlsx = 'xlsx',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
//
|
|
36
|
+
// FIXME: bring back document_id, move dirty flag into this class;
|
|
37
|
+
// support undoing into clean state based on document id, last save,
|
|
38
|
+
// and so on
|
|
39
|
+
//
|
|
40
|
+
|
|
41
|
+
export interface TREBDocument {
|
|
42
|
+
app: string;
|
|
43
|
+
version: string;
|
|
44
|
+
revision?: number;
|
|
45
|
+
name?: string;
|
|
46
|
+
user_data?: any;
|
|
47
|
+
sheet_data?: SerializedSheet|SerializedSheet[]; // NOTE: support old version, but it would be nice to drop
|
|
48
|
+
decimal_mark?: '.' | ',';
|
|
49
|
+
active_sheet?: number;
|
|
50
|
+
rendered_values?: boolean;
|
|
51
|
+
named_ranges?: {[index: string]: IArea};
|
|
52
|
+
macro_functions?: MacroFunction[];
|
|
53
|
+
named_expressions?: SerializedNamedExpression[];
|
|
54
|
+
tables?: Table[];
|
|
55
|
+
shared_resources?: Record<string, string>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ResizeEvent {
|
|
59
|
+
type: 'resize';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export enum LoadSource {
|
|
63
|
+
DRAG_AND_DROP = 'drag-and-drop',
|
|
64
|
+
LOCAL_FILE = 'local-file',
|
|
65
|
+
NETWORK_FILE = 'network-file',
|
|
66
|
+
LOCAL_STORAGE = 'local-storage',
|
|
67
|
+
UNDO = 'undo',
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export enum LoadType {
|
|
71
|
+
TREB = 'treb',
|
|
72
|
+
CSV = 'csv',
|
|
73
|
+
XLSX = 'xlsx',
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* This event is sent when a document is loaded, and also on undo. The
|
|
78
|
+
* source field can help determine if it was triggered by an undo operation.
|
|
79
|
+
*/
|
|
80
|
+
export interface DocumentLoadEvent {
|
|
81
|
+
type: 'load';
|
|
82
|
+
source?: LoadSource;
|
|
83
|
+
file_type?: LoadType;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* This event is sent when the document is reset.
|
|
88
|
+
*
|
|
89
|
+
* @privateRemarks
|
|
90
|
+
* we should remove this in favor of the Load event, plus a suitable load source.
|
|
91
|
+
*/
|
|
92
|
+
export interface DocumentResetEvent {
|
|
93
|
+
type: 'reset';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* This event is sent when data in the spreadsheet changes, but there are
|
|
98
|
+
* no structural or cell changes. For example, the `RAND` function returns
|
|
99
|
+
* a new value on every calculation, but the function itself does not change.
|
|
100
|
+
*/
|
|
101
|
+
export interface DataChangeEvent {
|
|
102
|
+
type: 'data';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* This event is sent when the value of a cell changes, or when the document
|
|
107
|
+
* structure chages. Structure changes might be inserting/deleting rows or
|
|
108
|
+
* columns, or adding/removing a sheet.
|
|
109
|
+
*/
|
|
110
|
+
export interface DocumentChangeEvent {
|
|
111
|
+
type: 'document-change';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* This event is sent when the spreadsheet selection changes. Use the
|
|
116
|
+
* `GetSelection` method to get the address of the current selection.
|
|
117
|
+
*/
|
|
118
|
+
export interface SelectionEvent {
|
|
119
|
+
type: 'selection';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* This event is sent when the focused view changes, if you have more
|
|
124
|
+
* than one view.
|
|
125
|
+
*/
|
|
126
|
+
export interface FocusViewEvent {
|
|
127
|
+
type: 'focus-view';
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* EmbeddedSheetEvent is a discriminated union. Switch on the `type` field
|
|
132
|
+
* of the event.
|
|
133
|
+
*/
|
|
134
|
+
export type EmbeddedSheetEvent
|
|
135
|
+
= DocumentChangeEvent
|
|
136
|
+
| DocumentResetEvent
|
|
137
|
+
| DocumentLoadEvent
|
|
138
|
+
| DataChangeEvent
|
|
139
|
+
| FocusViewEvent
|
|
140
|
+
| SelectionEvent
|
|
141
|
+
| ResizeEvent
|
|
142
|
+
;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* options when inserting a table into a sheet
|
|
146
|
+
*/
|
|
147
|
+
export interface InsertTableOptions {
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* include a totals/summation row. this impacts the layout and styling:
|
|
151
|
+
* totals row have a unique style and are not included when sorting.
|
|
152
|
+
* defaults to true.
|
|
153
|
+
*/
|
|
154
|
+
totals_row?: boolean;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* show a sort button in table headers. defaults to true.
|
|
158
|
+
*/
|
|
159
|
+
sortable?: boolean;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* base theme color, or a set of styles for the table. useful values for
|
|
163
|
+
* theme color are accent colors 4 (the default), 5, 7 and 9.
|
|
164
|
+
*/
|
|
165
|
+
theme?: number|TableTheme;
|
|
166
|
+
|
|
167
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
* this is getting attached to the document (why? b/c fixed pos?)
|
|
24
|
+
* so it inherits a lot. that's not good.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/* this is no longer attached to document, we can trim some of these */
|
|
28
|
+
/* also a lot of this should move to theme */
|
|
29
|
+
|
|
30
|
+
.treb-layout {
|
|
31
|
+
|
|
32
|
+
.treb-autocomplete {
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
* { box-sizing: border-box; }
|
|
37
|
+
|
|
38
|
+
position: fixed;
|
|
39
|
+
top: -1000px;
|
|
40
|
+
font-size: inherit;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
line-height: normal;
|
|
43
|
+
text-align: left;
|
|
44
|
+
|
|
45
|
+
max-height: 10em;
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
z-index: $z-index-autocomplete;
|
|
48
|
+
|
|
49
|
+
ul {
|
|
50
|
+
|
|
51
|
+
font-size: inherit;
|
|
52
|
+
font-weight: inherit;
|
|
53
|
+
|
|
54
|
+
list-style-type: none;
|
|
55
|
+
padding: 0;
|
|
56
|
+
margin: 0;
|
|
57
|
+
li {
|
|
58
|
+
font-size: inherit;
|
|
59
|
+
font-weight: inherit;
|
|
60
|
+
|
|
61
|
+
padding: 0;
|
|
62
|
+
margin: 0;
|
|
63
|
+
|
|
64
|
+
a {
|
|
65
|
+
font-size: inherit;
|
|
66
|
+
font-weight: inherit;
|
|
67
|
+
display: inline-block;
|
|
68
|
+
width: 100%;
|
|
69
|
+
padding: 3px 6px;
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
cursor: default;
|
|
72
|
+
color: inherit;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
here we unwind the selected style if there's a hover,
|
|
78
|
+
unless you're hovering over the selection. and so on.
|
|
79
|
+
* /
|
|
80
|
+
|
|
81
|
+
&:hover li a.selected {
|
|
82
|
+
background: inherit;
|
|
83
|
+
color: inherit;
|
|
84
|
+
|
|
85
|
+
&:hover {
|
|
86
|
+
background: #339966;
|
|
87
|
+
color: #fff;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.treb-autocomplete-tooltip {
|
|
97
|
+
z-index: $z-index-autocomplete;
|
|
98
|
+
top: -1000px;
|
|
99
|
+
position: fixed;
|
|
100
|
+
white-space: pre;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
* we'll add dark theme, and auto support, but not automatically.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
@mixin dark {
|
|
27
|
+
|
|
28
|
+
--treb-autocomplete-background: #333;
|
|
29
|
+
--treb-autocomplete-border-color: #fff;
|
|
30
|
+
--treb-autocomplete-entry-color: #fff;
|
|
31
|
+
--treb-autocomplete-selected-entry-background: darkred;
|
|
32
|
+
--treb-autocomplete-tooltip-background: darkred;
|
|
33
|
+
--treb-autocomplete-tooltip-border-color: #fff;
|
|
34
|
+
--treb-autocomplete-tooltip-color: #fff;
|
|
35
|
+
--treb-chart-background: #000;
|
|
36
|
+
--treb-chart-grid-color: #976;
|
|
37
|
+
--treb-chart-text-color: #fff;
|
|
38
|
+
--treb-dialog-background: #000;
|
|
39
|
+
--treb-dialog-border-color: #fff;
|
|
40
|
+
--treb-dialog-color: #fff;
|
|
41
|
+
--treb-dropdown-background: #000;
|
|
42
|
+
--treb-dropdown-border-color: #fff;
|
|
43
|
+
--treb-dropdown-caret-active-background: darkred;
|
|
44
|
+
--treb-dropdown-caret-background: #444;
|
|
45
|
+
--treb-dropdown-caret-border-color: #fff;
|
|
46
|
+
--treb-dropdown-caret-color: #fff;
|
|
47
|
+
--treb-dropdown-color: #fff;
|
|
48
|
+
--treb-dropdown-selected-background: darkred;
|
|
49
|
+
--treb-grid-background: #000;
|
|
50
|
+
--treb-grid-default-color: #fff;
|
|
51
|
+
--treb-grid-grid-color: #444;
|
|
52
|
+
--treb-grid-header-background: #444;
|
|
53
|
+
--treb-grid-header-grid-color: #000;
|
|
54
|
+
--treb-note-background: #333;
|
|
55
|
+
--treb-note-border-color: #fff;
|
|
56
|
+
--treb-note-color: #fff;
|
|
57
|
+
--treb-note-marker-color: pink;
|
|
58
|
+
--treb-resize-tooltip-background: #fff;
|
|
59
|
+
--treb-resize-tooltip-color: #000;
|
|
60
|
+
--treb-scale-slider-accent-color: #fff;
|
|
61
|
+
--treb-scale-slider-background: #333;
|
|
62
|
+
--treb-scale-slider-border-color: #fff;
|
|
63
|
+
--treb-selection-color: yellow;
|
|
64
|
+
--treb-selection-fill-opacity: .2;
|
|
65
|
+
--treb-sidebar-button-background: #000;
|
|
66
|
+
--treb-sidebar-button-border-color: #888;
|
|
67
|
+
--treb-stats-value-background: #223;
|
|
68
|
+
--treb-tab-bar-active-tab-background: #444;
|
|
69
|
+
--treb-tab-bar-tab-background: #000;
|
|
70
|
+
--treb-tab-bar-tab-color: #fff;
|
|
71
|
+
--treb-theme-color-1: #222;
|
|
72
|
+
--treb-theme-color-2: #ddd;
|
|
73
|
+
--treb-toolbar-active-button-background: #555;
|
|
74
|
+
--treb-toolbar-button-background: #000;
|
|
75
|
+
--treb-toolbar-hover-button-background: #444;
|
|
76
|
+
--treb-ui-border-color: #666;
|
|
77
|
+
--treb-ui-color: #fff;
|
|
78
|
+
|
|
79
|
+
--treb-table-header-background: #334; // DarkSlateGray;
|
|
80
|
+
--treb-table-odd-background: #122;
|
|
81
|
+
--treb-table-header-font-weight: 700;
|
|
82
|
+
|
|
83
|
+
--treb-table-header-border-top: #889;
|
|
84
|
+
--treb-table-header-border-bottom: #889;
|
|
85
|
+
--treb-table-footer-border-bottom: #889;
|
|
86
|
+
--treb-table-odd-border-top: #889;
|
|
87
|
+
--treb-table-odd-border-bottom: #889;
|
|
88
|
+
--treb-table-even-border-top: #889;
|
|
89
|
+
--treb-table-even-border-bottom: #889;
|
|
90
|
+
|
|
91
|
+
--treb-table-total-border-top: #889;
|
|
92
|
+
--treb-table-total-border-bottom: #889;
|
|
93
|
+
|
|
94
|
+
--treb-table-total-background: #334;
|
|
95
|
+
--treb-table-total-font-weight: 700;
|
|
96
|
+
|
|
97
|
+
// ---
|
|
98
|
+
|
|
99
|
+
--treb-color-scheme: dark;
|
|
100
|
+
--treb-resize-handle-color: lightblue;
|
|
101
|
+
--treb-resize-frame-color: lightblue;
|
|
102
|
+
--treb-formula-bar-locked-background: #234;
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.treb-dark-theme {
|
|
107
|
+
@include dark;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media (prefers-color-scheme: dark) {
|
|
111
|
+
.treb-light-dark-theme {
|
|
112
|
+
@include dark;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
/* shadow for tooltip and (...) */
|
|
23
|
+
|
|
24
|
+
$default-box-shadow: 0px 1px 4px 2px rgba(109,109,109,0.2);
|
|
25
|
+
|
|
26
|
+
$tooltip-arrow-size: 4px;
|
|
27
|
+
|
|
28
|
+
$font-stack: // "-apple-system",
|
|
29
|
+
"BlinkMacSystemFont",
|
|
30
|
+
"Segoe UI",
|
|
31
|
+
"Roboto",
|
|
32
|
+
"Oxygen-Sans",
|
|
33
|
+
"Ubuntu",
|
|
34
|
+
"Cantarell",
|
|
35
|
+
"Helvetica Neue",
|
|
36
|
+
"sans-serif";
|
|
@@ -0,0 +1,181 @@
|
|
|
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
|
+
.treb-layout {
|
|
23
|
+
|
|
24
|
+
--treb-icon-svg: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='153.073px' height='133.742px' viewBox='0.673 4.629 153.073 133.742' enable-background='new 0.673 4.629 153.073 133.742' xml:space='preserve'%3E%3ClinearGradient id='SVGID_1_' gradientUnits='userSpaceOnUse' x1='0.6729' y1='71.5' x2='153.7461' y2='71.5'%3E%3Cstop offset='0' style='stop-color:%235CB5FF'/%3E%3Cstop offset='1' style='stop-color:%230059B9'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23SVGID_1_)' d='M91.656,28.313c-4.989,0-17.266,6.249-21.305,8.504c-2.344-2.473-2.603-6.162-3.036-10.933 c-2.344,2.429-0.824,9.806,0,12.496c-10.238,7.635-18.83,15.531-27.597,24.471c-2.992-4.729-5.031-8.593-5.726-17.183 c-3.038,6.509,0.867,15.057,3.121,19.784c-9.674,12.193-19.263,25.297-27.03,37.834C-25.405,28.313,82.936-16.248,153.746,14.431 C109.879,43.63,98.554,135.784,21.498,111.274c-5.423,7.809-9.069,18.006-13.538,27.072c-3.73,0.263-6.334-1.646-7.288-3.12 c7.506-18.181,17.183-34.192,27.075-49.984c10.718,0.306,21.346,0.478,30.198-1.04c-7.681-2.038-16.877-0.78-26.032-3.123 c5.597-10.718,13.754-18.876,21.867-27.075c8.808,0.782,17.746,3.21,27.074,1.041c-8.111-1.431-15.966-1.952-22.909-4.165 C65.539,42.502,80.722,33.389,91.656,28.313z'/%3E%3C/svg%3E%0A");
|
|
25
|
+
|
|
26
|
+
.treb-icon-64 {
|
|
27
|
+
width: 64px;
|
|
28
|
+
height: 64px;
|
|
29
|
+
background: no-repeat center/100% var(--treb-icon-svg);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.treb-dialog-mask {
|
|
33
|
+
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0px;
|
|
36
|
+
left: 0px;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
z-index: 1000;
|
|
40
|
+
|
|
41
|
+
// background: rgba(255, 0, 0, .5); // dev
|
|
42
|
+
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
align-items: center;
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition: opacity .2s;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.treb-embed-dialog {
|
|
53
|
+
|
|
54
|
+
line-height: 1.6em;
|
|
55
|
+
|
|
56
|
+
border: 1px solid var(--treb-dialog-border-color, var(--treb-ui-border-color, #999));
|
|
57
|
+
|
|
58
|
+
border-top-width: 3px;
|
|
59
|
+
border-top-color: rgb(0, 157, 255);
|
|
60
|
+
border-top-color: rgb(158, 175, 185);
|
|
61
|
+
border-top-color: #999;
|
|
62
|
+
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
align-items: center;
|
|
66
|
+
position: relative;
|
|
67
|
+
|
|
68
|
+
padding: 1em;
|
|
69
|
+
background: var(--treb-dialog-background, #fff);
|
|
70
|
+
color: var(--treb-dialog-color, #000);
|
|
71
|
+
|
|
72
|
+
text-align: left;
|
|
73
|
+
border-radius: 3px;
|
|
74
|
+
|
|
75
|
+
& > * {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
& > div {
|
|
80
|
+
position: relative;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* middle: title, message and (maybe) progress bar */
|
|
84
|
+
&>*:nth-child(2) {
|
|
85
|
+
flex-grow: 1;
|
|
86
|
+
display: block;
|
|
87
|
+
padding: 2px 12px;
|
|
88
|
+
padding-right: 20px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&>.treb-close-box {
|
|
92
|
+
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 0;
|
|
95
|
+
right: 0px;
|
|
96
|
+
padding: 0;
|
|
97
|
+
background: transparent;
|
|
98
|
+
border: 0;
|
|
99
|
+
|
|
100
|
+
&>svg {
|
|
101
|
+
|
|
102
|
+
fill: rgb(115, 130, 140);
|
|
103
|
+
width: 20px;
|
|
104
|
+
height: 20px;
|
|
105
|
+
cursor: default;
|
|
106
|
+
|
|
107
|
+
&:hover,
|
|
108
|
+
&:active {
|
|
109
|
+
fill: rgb(4, 156, 251);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
padding: 4px;
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
small {
|
|
118
|
+
font-size: .9em;
|
|
119
|
+
display: block;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
a {
|
|
123
|
+
text-decoration: none;
|
|
124
|
+
color: inherit;
|
|
125
|
+
|
|
126
|
+
&:hover,
|
|
127
|
+
&:active {
|
|
128
|
+
color: rgb(4, 156, 251);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.dialog-type-success {
|
|
133
|
+
border-top-width: 3px;
|
|
134
|
+
border-top-color: rgb(68, 217, 38);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&.dialog-type-about {
|
|
138
|
+
border-top-width: 3px;
|
|
139
|
+
border-top-color: rgb(0, 157, 255);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.dialog-type-error {
|
|
143
|
+
border-top-width: 3px;
|
|
144
|
+
border-top-color: rgb(249, 47, 6);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&.dialog-type-info {
|
|
148
|
+
border-top-width: 3px;
|
|
149
|
+
border-top-color: rgb(0, 157, 255);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.treb-embed-dialog-title {
|
|
153
|
+
white-space: pre;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.treb-embed-dialog-message {
|
|
157
|
+
white-space: pre;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.treb-embed-progress-container {
|
|
161
|
+
position: relative;
|
|
162
|
+
border: 1px solid red;
|
|
163
|
+
width: 100%;
|
|
164
|
+
height: 6px;
|
|
165
|
+
border: 1px solid #ddd;
|
|
166
|
+
margin: auto;
|
|
167
|
+
margin-top: 1em;
|
|
168
|
+
margin-bottom: .5em;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.treb-embed-progress-bar {
|
|
172
|
+
position: relative;
|
|
173
|
+
background: #52880b;
|
|
174
|
+
top: 0px;
|
|
175
|
+
left: 0px;
|
|
176
|
+
height: 100%;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
}
|