@trebco/treb 32.3.3 → 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 +2 -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 +1 -1
- package/treb-calculator/src/functions/function-utilities.ts +21 -0
- package/treb-calculator/src/functions/gamma.ts +1 -1
- package/treb-calculator/src/functions/information-functions.ts +1 -1
- package/treb-calculator/src/functions/lambda-functions.ts +1 -1
- 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 +40 -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 +21 -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/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
package/package.json
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 { ExpressionUnit } from 'treb-parser';
|
|
3
24
|
import type { ICellAddress } from './area';
|
|
@@ -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 { Measurement } from 'treb-utils';
|
|
3
24
|
import { type Color } from './style';
|
|
@@ -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
|
*/
|
|
@@ -242,6 +242,25 @@ export interface CellStyle {
|
|
|
242
242
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
+
/**
|
|
246
|
+
* @internal
|
|
247
|
+
*
|
|
248
|
+
* starting on data bars, but there might be other conditional
|
|
249
|
+
* stuff we want to tack on to standard styles.
|
|
250
|
+
*
|
|
251
|
+
*/
|
|
252
|
+
export type ExtendedCelLStyle = CellStyle & {
|
|
253
|
+
databar?: {
|
|
254
|
+
fill: Color;
|
|
255
|
+
negative?: Color;
|
|
256
|
+
hide_values?: boolean;
|
|
257
|
+
value: number; // as %
|
|
258
|
+
// min: number; // always going to be 0
|
|
259
|
+
// max: number; // always going to be 1
|
|
260
|
+
zero: number; // as %
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
245
264
|
/** @internal */
|
|
246
265
|
export type PropertyKeys = keyof CellStyle;
|
|
247
266
|
|
|
@@ -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
|
*/
|
|
@@ -2503,14 +2503,15 @@ export class Calculator extends Graph {
|
|
|
2503
2503
|
}
|
|
2504
2504
|
break;
|
|
2505
2505
|
|
|
2506
|
+
case 'data-bar':
|
|
2506
2507
|
case 'gradient':
|
|
2507
2508
|
expression = `=Gradient(${
|
|
2508
2509
|
[
|
|
2509
2510
|
this.Unresolve(entry.area, context, true, false),
|
|
2510
2511
|
entry.min ?? '',
|
|
2511
2512
|
entry.max ?? '',
|
|
2512
|
-
|
|
2513
|
-
].join(',')
|
|
2513
|
+
...( entry.type === 'data-bar' ? ['TRUE'] : []),
|
|
2514
|
+
].join(',') // is this correct? are we standardizing i18n? FIXME: check
|
|
2514
2515
|
})`;
|
|
2515
2516
|
break;
|
|
2516
2517
|
|
|
@@ -2538,7 +2539,7 @@ export class Calculator extends Graph {
|
|
|
2538
2539
|
argument_separator: ',',
|
|
2539
2540
|
};
|
|
2540
2541
|
|
|
2541
|
-
if (entry.type !== 'gradient' && entry.type !== 'duplicate-values') {
|
|
2542
|
+
if (entry.type !== 'gradient' && entry.type !== 'duplicate-values' && entry.type !== 'data-bar') {
|
|
2542
2543
|
options = {...entry.options, ...options};
|
|
2543
2544
|
}
|
|
2544
2545
|
|
|
@@ -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
|
*/
|
|
@@ -1265,7 +1265,7 @@ export class ExpressionCalculator {
|
|
|
1265
1265
|
}
|
|
1266
1266
|
|
|
1267
1267
|
const named = this.data_model.GetName(upper_case, this.context.address.sheet_id || 0);
|
|
1268
|
-
|
|
1268
|
+
|
|
1269
1269
|
switch (named?.type) {
|
|
1270
1270
|
case 'range':
|
|
1271
1271
|
if (named.area.count === 1) {
|
|
@@ -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
|
*/
|
|
@@ -2550,9 +2550,15 @@ export const BaseFunctionLibrary: FunctionMap = {
|
|
|
2550
2550
|
{ name: 'range', boxed: true },
|
|
2551
2551
|
{ name: 'min', },
|
|
2552
2552
|
{ name: 'max', },
|
|
2553
|
+
|
|
2554
|
+
/*
|
|
2555
|
+
* data bars use gradients but have to report zero. also we explicitly
|
|
2556
|
+
* set 0 as min/max for data bars, although you can override
|
|
2557
|
+
*/
|
|
2558
|
+
{ name: 'parameters' },
|
|
2553
2559
|
],
|
|
2554
2560
|
visibility: 'internal',
|
|
2555
|
-
fn: (area: UnionValue, static_min?: number, static_max?: number): UnionValue => {
|
|
2561
|
+
fn: (area: UnionValue, static_min?: number, static_max?: number, parameters?: boolean): UnionValue => {
|
|
2556
2562
|
|
|
2557
2563
|
const tmp = Utils.FlattenBoxed([area]);
|
|
2558
2564
|
|
|
@@ -2566,7 +2572,7 @@ export const BaseFunctionLibrary: FunctionMap = {
|
|
|
2566
2572
|
return ref;
|
|
2567
2573
|
}
|
|
2568
2574
|
if (ref.type === ValueType.number) {
|
|
2569
|
-
if (count === 0) {
|
|
2575
|
+
if (count === 0 && !parameters) { // leave 0 min, max for data bars
|
|
2570
2576
|
min = ref.value;
|
|
2571
2577
|
max = ref.value;
|
|
2572
2578
|
}
|
|
@@ -2578,6 +2584,13 @@ export const BaseFunctionLibrary: FunctionMap = {
|
|
|
2578
2584
|
}
|
|
2579
2585
|
}
|
|
2580
2586
|
|
|
2587
|
+
/*
|
|
2588
|
+
if (parameters) {
|
|
2589
|
+
if (min > 0) { min = 0; }
|
|
2590
|
+
if (max < 0) { max = 0; }
|
|
2591
|
+
}
|
|
2592
|
+
*/
|
|
2593
|
+
|
|
2581
2594
|
if (typeof static_max === 'number') {
|
|
2582
2595
|
max = static_max;
|
|
2583
2596
|
}
|
|
@@ -2623,7 +2636,16 @@ export const BaseFunctionLibrary: FunctionMap = {
|
|
|
2623
2636
|
else if (range > 0) {
|
|
2624
2637
|
calc = (src.value - min) / range;
|
|
2625
2638
|
}
|
|
2626
|
-
|
|
2639
|
+
|
|
2640
|
+
if (parameters) {
|
|
2641
|
+
row.push({ type: ValueType.array, value: [[
|
|
2642
|
+
{ type: ValueType.number, value: calc },
|
|
2643
|
+
{ type: ValueType.number, value: (0 - min) / range }, // zero
|
|
2644
|
+
]]});
|
|
2645
|
+
}
|
|
2646
|
+
else {
|
|
2647
|
+
row.push({ type: ValueType.number, value: calc });
|
|
2648
|
+
}
|
|
2627
2649
|
}
|
|
2628
2650
|
else {
|
|
2629
2651
|
row.push({ type: ValueType.undefined });
|
|
@@ -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 { UnionValue, Complex } from 'treb-base-types';
|
|
3
24
|
import { ValueType } from 'treb-base-types';
|