@trebco/treb 32.3.1 → 32.4.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 +10 -10
- package/package.json +1 -1
- package/treb-base-types/src/api_types.ts +1 -1
- package/treb-base-types/src/area-utils.ts +1 -1
- package/treb-base-types/src/area.ts +1 -1
- package/treb-base-types/src/basic_types.ts +1 -1
- package/treb-base-types/src/cell.ts +1 -1
- package/treb-base-types/src/cells.ts +1 -1
- package/treb-base-types/src/color.ts +1 -1
- package/treb-base-types/src/dom-utilities.ts +1 -1
- package/treb-base-types/src/evaluate-options.ts +21 -0
- package/treb-base-types/src/font-stack.ts +1 -1
- package/treb-base-types/src/gradient.ts +21 -0
- package/treb-base-types/src/import.ts +1 -1
- package/treb-base-types/src/index-standalone.ts +1 -1
- package/treb-base-types/src/index.ts +1 -1
- package/treb-base-types/src/layout.ts +1 -1
- package/treb-base-types/src/localization.ts +1 -1
- package/treb-base-types/src/rectangle.ts +1 -1
- package/treb-base-types/src/render_text.ts +1 -1
- package/treb-base-types/src/style.ts +20 -1
- package/treb-base-types/src/table.ts +1 -1
- package/treb-base-types/src/text_part.ts +1 -1
- package/treb-base-types/src/theme.ts +1 -1
- package/treb-base-types/src/union.ts +1 -1
- package/treb-base-types/src/value-type.ts +1 -1
- package/treb-base-types/style/resizable.css +1 -1
- package/treb-calculator/src/calculator.ts +5 -4
- package/treb-calculator/src/complex-math.ts +1 -1
- package/treb-calculator/src/dag/array-vertex.ts +1 -1
- package/treb-calculator/src/dag/calculation_leaf_vertex.ts +1 -1
- package/treb-calculator/src/dag/graph.ts +1 -1
- package/treb-calculator/src/dag/spreadsheet_vertex.ts +1 -1
- package/treb-calculator/src/dag/spreadsheet_vertex_base.ts +1 -1
- package/treb-calculator/src/dag/state_leaf_vertex.ts +1 -1
- package/treb-calculator/src/dag/vertex.ts +1 -1
- package/treb-calculator/src/descriptors.ts +1 -1
- package/treb-calculator/src/expression-calculator.ts +12 -2
- package/treb-calculator/src/function-error.ts +1 -1
- package/treb-calculator/src/function-library.ts +1 -1
- package/treb-calculator/src/functions/base-functions.ts +26 -4
- package/treb-calculator/src/functions/beta.ts +1 -1
- package/treb-calculator/src/functions/checkbox.ts +1 -1
- package/treb-calculator/src/functions/complex-functions.ts +1 -1
- package/treb-calculator/src/functions/date-utils.ts +1 -1
- package/treb-calculator/src/functions/finance-functions.ts +1 -1
- package/treb-calculator/src/functions/fp.ts +34 -13
- package/treb-calculator/src/functions/function-utilities.ts +21 -0
- package/treb-calculator/src/functions/gamma.ts +25 -4
- package/treb-calculator/src/functions/information-functions.ts +1 -1
- package/treb-calculator/src/functions/lambda-functions.ts +20 -0
- package/treb-calculator/src/functions/matrix-functions.ts +1 -1
- package/treb-calculator/src/functions/regex-functions.ts +1 -1
- package/treb-calculator/src/functions/sparkline.ts +1 -1
- package/treb-calculator/src/functions/statistics-functions.ts +1 -1
- package/treb-calculator/src/functions/text-functions.ts +1 -1
- package/treb-calculator/src/index.ts +1 -1
- package/treb-calculator/src/notifier-types.ts +1 -1
- package/treb-calculator/src/primitives.ts +1 -1
- package/treb-calculator/src/utilities.ts +1 -1
- package/treb-charts/src/chart-functions.ts +1 -1
- package/treb-charts/src/chart-types.ts +1 -1
- package/treb-charts/src/chart-utils.ts +1 -1
- package/treb-charts/src/chart.ts +21 -0
- package/treb-charts/src/default-chart-renderer.ts +21 -0
- package/treb-charts/src/index.ts +1 -1
- package/treb-charts/src/main.ts +1 -1
- package/treb-charts/src/quicksort.ts +1 -1
- package/treb-charts/src/rectangle.ts +1 -1
- package/treb-charts/src/renderer-type.ts +21 -0
- package/treb-charts/src/renderer.ts +1 -1
- package/treb-charts/src/util.ts +1 -1
- package/treb-charts/style/charts.scss +1 -1
- package/treb-data-model/src/annotation.ts +1 -1
- package/treb-data-model/src/conditional_format.ts +34 -2
- package/treb-data-model/src/data-validation.ts +21 -0
- package/treb-data-model/src/data_model.ts +1 -1
- package/treb-data-model/src/index.ts +1 -1
- package/treb-data-model/src/language-model.ts +1 -1
- package/treb-data-model/src/named.ts +1 -1
- package/treb-data-model/src/serialize_options.ts +1 -1
- package/treb-data-model/src/sheet.ts +43 -30
- package/treb-data-model/src/sheet_collection.ts +21 -0
- package/treb-data-model/src/sheet_selection.ts +1 -1
- package/treb-data-model/src/sheet_types.ts +1 -1
- package/treb-data-model/src/types.ts +21 -0
- package/treb-embed/src/content-types.d.ts +21 -0
- package/treb-embed/src/custom-element/global.d.ts +21 -0
- package/treb-embed/src/custom-element/spreadsheet-constructor.ts +21 -0
- package/treb-embed/src/custom-element/treb-global.ts +21 -0
- package/treb-embed/src/custom-element/treb-spreadsheet-element.ts +21 -0
- package/treb-embed/src/embedded-spreadsheet.ts +44 -1
- package/treb-embed/src/export-worker.ts +1 -1
- package/treb-embed/src/index.ts +21 -0
- package/treb-embed/src/options.ts +1 -1
- package/treb-embed/src/plugin.ts +1 -1
- package/treb-embed/src/progress-dialog.ts +1 -1
- package/treb-embed/src/selection-state.ts +21 -0
- package/treb-embed/src/spinner.ts +1 -1
- package/treb-embed/src/toolbar-message.ts +21 -0
- package/treb-embed/src/types.ts +1 -1
- package/treb-embed/style/autocomplete.scss +1 -1
- package/treb-embed/style/dark-theme.scss +1 -1
- package/treb-embed/style/defaults.scss +1 -1
- package/treb-embed/style/dialog.scss +1 -1
- package/treb-embed/style/dropdown-select.scss +1 -1
- package/treb-embed/style/font-stacks.scss +1 -1
- package/treb-embed/style/formula-bar.scss +1 -1
- package/treb-embed/style/grid.scss +1 -1
- package/treb-embed/style/layout.scss +21 -0
- package/treb-embed/style/mouse-mask.scss +1 -1
- package/treb-embed/style/note.scss +1 -1
- package/treb-embed/style/overlay-editor.scss +1 -1
- package/treb-embed/style/spinner.scss +1 -1
- package/treb-embed/style/tab-bar.scss +1 -1
- package/treb-embed/style/table.scss +1 -1
- package/treb-embed/style/theme-defaults.scss +1 -1
- package/treb-embed/style/toolbar.scss +26 -0
- package/treb-embed/style/tooltip.scss +1 -1
- package/treb-embed/style/treb-icons.scss +21 -0
- package/treb-embed/style/treb-spreadsheet-element.scss +21 -0
- package/treb-embed/style/z-index.scss +1 -1
- package/treb-export/src/address-type.ts +1 -1
- package/treb-export/src/base-template.ts +1 -1
- package/treb-export/src/column-width.ts +1 -1
- package/treb-export/src/drawing2/bubble-chart-template.ts +1 -1
- package/treb-export/src/drawing2/chart-template-components2.ts +1 -1
- package/treb-export/src/drawing2/chart2.ts +1 -1
- package/treb-export/src/drawing2/column-chart-template2.ts +1 -1
- package/treb-export/src/drawing2/donut-chart-template2.ts +1 -1
- package/treb-export/src/drawing2/drawing2.ts +1 -1
- package/treb-export/src/drawing2/embedded-image.ts +1 -1
- package/treb-export/src/drawing2/scatter-chart-template2.ts +1 -1
- package/treb-export/src/export.ts +2 -2
- package/treb-export/src/import.ts +1 -1
- package/treb-export/src/index.worker.ts +1 -1
- package/treb-export/src/relationship.ts +1 -1
- package/treb-export/src/shared-strings2.ts +1 -1
- package/treb-export/src/template-2.ts +1 -1
- package/treb-export/src/unescape_xml.ts +21 -0
- package/treb-export/src/workbook-sheet2.ts +1 -1
- package/treb-export/src/workbook-style2.ts +1 -1
- package/treb-export/src/workbook-theme2.ts +1 -1
- package/treb-export/src/workbook2.ts +1 -1
- package/treb-export/src/xml-test.ts +68 -0
- package/treb-export/src/xml-utils.ts +1 -1
- package/treb-export/src/zip-wrapper.ts +21 -0
- package/treb-format/src/format.test.ts +1 -1
- package/treb-format/src/format.ts +1 -1
- package/treb-format/src/format_cache.ts +1 -1
- package/treb-format/src/format_parser.ts +1 -1
- package/treb-format/src/index.ts +1 -1
- package/treb-format/src/number_format_section.ts +1 -1
- package/treb-format/src/value_parser.ts +1 -1
- package/treb-grid/src/editors/autocomplete.ts +1 -1
- package/treb-grid/src/editors/autocomplete_matcher.ts +1 -1
- package/treb-grid/src/editors/editor.ts +1 -1
- package/treb-grid/src/editors/external_editor.ts +21 -0
- package/treb-grid/src/editors/formula_bar.ts +1 -1
- package/treb-grid/src/editors/overlay_editor.ts +1 -1
- package/treb-grid/src/index.ts +1 -1
- package/treb-grid/src/layout/base_layout.ts +1 -1
- package/treb-grid/src/layout/grid_layout.ts +1 -1
- package/treb-grid/src/layout/mock-layout.ts +21 -0
- package/treb-grid/src/render/selection-renderer.ts +1 -1
- package/treb-grid/src/render/svg_header_overlay.ts +1 -1
- package/treb-grid/src/render/svg_selection_block.ts +1 -1
- package/treb-grid/src/render/tile_renderer.ts +45 -3
- package/treb-grid/src/types/border_constants.ts +1 -1
- package/treb-grid/src/types/clipboard_data.ts +1 -1
- package/treb-grid/src/types/clipboard_data2.ts +1 -1
- package/treb-grid/src/types/drag_mask.ts +1 -1
- package/treb-grid/src/types/external_editor_config.ts +21 -0
- package/treb-grid/src/types/grid.ts +1 -1
- package/treb-grid/src/types/grid_base.ts +1 -1
- package/treb-grid/src/types/grid_command.ts +1 -1
- package/treb-grid/src/types/grid_events.ts +1 -1
- package/treb-grid/src/types/grid_options.ts +1 -1
- package/treb-grid/src/types/scale-control.ts +1 -1
- package/treb-grid/src/types/set_range_options.ts +1 -1
- package/treb-grid/src/types/tab_bar.ts +1 -1
- package/treb-grid/src/types/tile.ts +1 -1
- package/treb-grid/src/types/update_flags.ts +1 -1
- package/treb-grid/src/util/fontmetrics.ts +1 -1
- package/treb-grid/src/util/ua.ts +1 -1
- package/treb-parser/package.json +1 -1
- package/treb-parser/src/csv-parser.ts +1 -1
- package/treb-parser/src/index.ts +1 -1
- package/treb-parser/src/md-parser.ts +1 -1
- package/treb-parser/src/parser-types.ts +15 -1
- package/treb-parser/src/parser.ts +40 -7
- package/treb-utils/src/event_source.ts +1 -1
- package/treb-utils/src/ievent_source.ts +1 -1
- package/treb-utils/src/index.ts +1 -1
- package/treb-utils/src/measurement.ts +1 -1
- package/treb-utils/src/scale.ts +1 -1
- package/treb-utils/src/serialize_html.ts +1 -1
- package/treb-utils/src/validate_uri.ts +21 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* You should have received a copy of the GNU General Public License along
|
|
15
15
|
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
*
|
|
17
|
-
* Copyright 2022-
|
|
17
|
+
* Copyright 2022-2025 trebco, llc.
|
|
18
18
|
* info@treb.app
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
@@ -34,7 +34,8 @@ import { Measurement, ValidateURI } from 'treb-utils';
|
|
|
34
34
|
import type { TextPart ,
|
|
35
35
|
Cell, ICellAddress, CellSerializationOptions, CellValue, ImportedSheetData, Complex,
|
|
36
36
|
DimensionedQuantity, IArea, Table, TableTheme, HorizontalAlign, VerticalAlign,
|
|
37
|
-
Theme
|
|
37
|
+
Theme,
|
|
38
|
+
ExtendedCelLStyle} from 'treb-base-types';
|
|
38
39
|
|
|
39
40
|
import { Get as GetFonrMetrics } from 'treb-grid/src/util/fontmetrics';
|
|
40
41
|
|
|
@@ -257,7 +258,7 @@ export class Sheet {
|
|
|
257
258
|
* they will be stacked on top of cell style when rendering.
|
|
258
259
|
* conditional formats have top priority. [FIXME: what about tables?]
|
|
259
260
|
*/
|
|
260
|
-
private conditional_format_cache:
|
|
261
|
+
private conditional_format_cache: ExtendedCelLStyle[][][] = [];
|
|
261
262
|
|
|
262
263
|
/**
|
|
263
264
|
* this is a list of cells we formatted on the last pass, so we can
|
|
@@ -1107,8 +1108,6 @@ export class Sheet {
|
|
|
1107
1108
|
|
|
1108
1109
|
if (!this.cell_style[column]) this.cell_style[column] = [];
|
|
1109
1110
|
|
|
1110
|
-
// testing
|
|
1111
|
-
// const underlying = this.CompositeStyleForCell(address, false);
|
|
1112
1111
|
const underlying = this.CompositeStyleForCell(address, false, false, undefined, false);
|
|
1113
1112
|
|
|
1114
1113
|
const merged = Style.Composite([
|
|
@@ -3333,30 +3332,6 @@ export class Sheet {
|
|
|
3333
3332
|
|
|
3334
3333
|
}
|
|
3335
3334
|
|
|
3336
|
-
/* *
|
|
3337
|
-
* flush the cache and the checklist. flush cell styles at the same
|
|
3338
|
-
* time. this should be called when adding/removing a conditional format.
|
|
3339
|
-
* optionally apply active formats again.
|
|
3340
|
-
*
|
|
3341
|
-
* is this actually necessary? what's the use case? (...)
|
|
3342
|
-
*
|
|
3343
|
-
* /
|
|
3344
|
-
public FlushConditionalFormats(reapply = false) {
|
|
3345
|
-
|
|
3346
|
-
for (const [row, column] of this.conditional_format_checklist) {
|
|
3347
|
-
this.CellData({row, column}).FlushStyle();
|
|
3348
|
-
}
|
|
3349
|
-
|
|
3350
|
-
this.conditional_format_checklist = [];
|
|
3351
|
-
this.conditional_format_cache = [];
|
|
3352
|
-
|
|
3353
|
-
if (reapply) {
|
|
3354
|
-
this.ApplyConditionalFormats();
|
|
3355
|
-
}
|
|
3356
|
-
|
|
3357
|
-
}
|
|
3358
|
-
*/
|
|
3359
|
-
|
|
3360
3335
|
public BleedFlush(area: IArea) {
|
|
3361
3336
|
|
|
3362
3337
|
const rows = [Math.max(0, area.start.row - 1), area.end.row + 1];
|
|
@@ -3428,7 +3403,7 @@ export class Sheet {
|
|
|
3428
3403
|
|
|
3429
3404
|
this.flush_conditional_formats = false; // unset
|
|
3430
3405
|
|
|
3431
|
-
const temp:
|
|
3406
|
+
const temp: ExtendedCelLStyle[][][] = [];
|
|
3432
3407
|
const checklist: IArea[] = [...this.conditional_format_checklist];
|
|
3433
3408
|
|
|
3434
3409
|
this.conditional_format_checklist = []; // flush
|
|
@@ -3500,6 +3475,44 @@ export class Sheet {
|
|
|
3500
3475
|
|
|
3501
3476
|
}
|
|
3502
3477
|
}
|
|
3478
|
+
else if (format.type === 'data-bar') {
|
|
3479
|
+
|
|
3480
|
+
if (result) {
|
|
3481
|
+
|
|
3482
|
+
if (result.type === ValueType.array) {
|
|
3483
|
+
for (let row = area.start.row; row <= area.end.row; row++) {
|
|
3484
|
+
for (let column = area.start.column; column <= area.end.column; column++) {
|
|
3485
|
+
const value = result.value[column - area.start.column][row - area.start.row];
|
|
3486
|
+
if (value.type === ValueType.array) {
|
|
3487
|
+
const [pct, zero] = value.value[0];
|
|
3488
|
+
if (pct.type === ValueType.number && zero.type === ValueType.number) {
|
|
3489
|
+
|
|
3490
|
+
if (!temp[row]) { temp[row] = []; }
|
|
3491
|
+
if (!temp[row][column] ) { temp[row][column] = []; }
|
|
3492
|
+
// const color = format.internal.gradient.Interpolate(value.value);
|
|
3493
|
+
// temp[row][column].push({ [property]: color});
|
|
3494
|
+
temp[row][column].push({
|
|
3495
|
+
databar: {
|
|
3496
|
+
value: pct.value,
|
|
3497
|
+
zero: zero.value,
|
|
3498
|
+
fill: format.fill,
|
|
3499
|
+
negative: format.negative,
|
|
3500
|
+
hide_values: format.hide_values,
|
|
3501
|
+
}
|
|
3502
|
+
});
|
|
3503
|
+
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
checklist.push(area);
|
|
3511
|
+
this.conditional_format_checklist.push(area);
|
|
3512
|
+
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
}
|
|
3503
3516
|
else {
|
|
3504
3517
|
|
|
3505
3518
|
// handle types expression, cell-match and duplicate-values
|
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
import type { Sheet } from './sheet';
|
|
3
24
|
|
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
import type { SerializedSheet } from './sheet_types';
|
|
3
24
|
import type { Sheet } from './sheet';
|
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
/** imported html as text */
|
|
3
24
|
declare module '*.html' {
|
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
/**
|
|
3
24
|
* add our tag to the map
|
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
import { EmbeddedSpreadsheet } from '../embedded-spreadsheet';
|
|
3
24
|
import type { EmbeddedSpreadsheetOptions } from '../options';
|
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
import { SpreadsheetConstructor } from './spreadsheet-constructor';
|
|
3
24
|
import type { EmbeddedSpreadsheetOptions } from '../options';
|
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
import { SpreadsheetConstructor } from './spreadsheet-constructor';
|
|
3
24
|
import type { EmbeddedSpreadsheet } from '../embedded-spreadsheet';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* You should have received a copy of the GNU General Public License along
|
|
15
15
|
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
*
|
|
17
|
-
* Copyright 2022-
|
|
17
|
+
* Copyright 2022-2025 trebco, llc.
|
|
18
18
|
* info@treb.app
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
@@ -52,6 +52,8 @@ import type {
|
|
|
52
52
|
LanguageModel,
|
|
53
53
|
TranslatedFunctionDescriptor,
|
|
54
54
|
SerializedNamed,
|
|
55
|
+
ConditionalFormatDataBarOptions,
|
|
56
|
+
ConditionalFormatDataBar,
|
|
55
57
|
|
|
56
58
|
} from 'treb-data-model';
|
|
57
59
|
|
|
@@ -841,6 +843,10 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
|
|
|
841
843
|
// if we don't have a container. that's distinct (at the moment)
|
|
842
844
|
// from headless, which is a state that can change.
|
|
843
845
|
|
|
846
|
+
// what's the point of having the GridBase type if we're not using
|
|
847
|
+
// it when we don't have a container? or was it built for something
|
|
848
|
+
// else? (A: it was)
|
|
849
|
+
|
|
844
850
|
this.grid = new Grid(
|
|
845
851
|
grid_options,
|
|
846
852
|
this.model,
|
|
@@ -1525,6 +1531,22 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
|
|
|
1525
1531
|
|
|
1526
1532
|
}
|
|
1527
1533
|
|
|
1534
|
+
/**
|
|
1535
|
+
* @internal
|
|
1536
|
+
*/
|
|
1537
|
+
public ConditionalFormatDataBar(range: RangeReference|undefined, options?: ConditionalFormatDataBarOptions): ConditionalFormat {
|
|
1538
|
+
|
|
1539
|
+
const area = this.RangeOrSelection(range, 'invalid range (no selection)');
|
|
1540
|
+
|
|
1541
|
+
const format: ConditionalFormatDataBar = {
|
|
1542
|
+
type: 'data-bar', area, fill: { theme: 4, tint: .5 }, ...options,
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
this.AddConditionalFormat(format);
|
|
1546
|
+
return format;
|
|
1547
|
+
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1528
1550
|
/**
|
|
1529
1551
|
* @internalRemarks removing internal flag
|
|
1530
1552
|
*/
|
|
@@ -4939,6 +4961,25 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
|
|
|
4939
4961
|
// so don't move it, even though it is tempting. or rewrite to
|
|
4940
4962
|
// update on theme changes.
|
|
4941
4963
|
|
|
4964
|
+
switch (entry.type) {
|
|
4965
|
+
case 'gradient':
|
|
4966
|
+
if (!entry.internal) {
|
|
4967
|
+
entry.internal = {};
|
|
4968
|
+
}
|
|
4969
|
+
if (!entry.internal.gradient) {
|
|
4970
|
+
entry.internal.gradient = new Gradient(entry.stops, this.grid.theme, entry.color_space);
|
|
4971
|
+
}
|
|
4972
|
+
break;
|
|
4973
|
+
|
|
4974
|
+
case 'data-bar':
|
|
4975
|
+
if (!entry.internal) {
|
|
4976
|
+
entry.internal = {};
|
|
4977
|
+
}
|
|
4978
|
+
break;
|
|
4979
|
+
|
|
4980
|
+
}
|
|
4981
|
+
|
|
4982
|
+
/*
|
|
4942
4983
|
if (entry.type === 'gradient') {
|
|
4943
4984
|
if (!entry.internal) {
|
|
4944
4985
|
entry.internal = {};
|
|
@@ -4947,6 +4988,8 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
|
|
|
4947
4988
|
entry.internal.gradient = new Gradient(entry.stops, this.grid.theme, entry.color_space);
|
|
4948
4989
|
}
|
|
4949
4990
|
}
|
|
4991
|
+
*/
|
|
4992
|
+
|
|
4950
4993
|
}
|
|
4951
4994
|
|
|
4952
4995
|
sheet.ApplyConditionalFormats();
|
package/treb-embed/src/index.ts
CHANGED
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
/**
|
|
2
23
|
* this is our main file for building and generating API types.
|
|
3
24
|
*
|
package/treb-embed/src/plugin.ts
CHANGED
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
import type { GridSelection } from 'treb-data-model';
|
|
3
24
|
import type { CellStyle } from 'treb-base-types';
|
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
import type { Color } from 'treb-base-types';
|
|
3
24
|
|
package/treb-embed/src/types.ts
CHANGED
|
@@ -1,3 +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-2025 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
|
|
2
23
|
@use './defaults.scss' as *;
|
|
3
24
|
@use './z-index.scss' as *;
|