@trebco/treb 28.5.2 → 28.10.0

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.
Files changed (168) hide show
  1. package/dist/treb-spreadsheet-light.mjs +15 -15
  2. package/dist/treb-spreadsheet.mjs +15 -15
  3. package/dist/treb.d.ts +37 -6
  4. package/package.json +1 -1
  5. package/treb-base-types/src/api_types.ts +1 -1
  6. package/treb-base-types/src/area.ts +1 -1
  7. package/treb-base-types/src/basic_types.ts +21 -21
  8. package/treb-base-types/src/cell.ts +1 -1
  9. package/treb-base-types/src/cells.ts +1 -1
  10. package/treb-base-types/src/color.ts +1 -1
  11. package/treb-base-types/src/dom-utilities.ts +1 -1
  12. package/treb-base-types/src/gradient.ts +1 -1
  13. package/treb-base-types/src/import.ts +1 -1
  14. package/treb-base-types/src/index-standalone.ts +9 -9
  15. package/treb-base-types/src/index.ts +1 -1
  16. package/treb-base-types/src/layout.ts +21 -21
  17. package/treb-base-types/src/localization.ts +27 -21
  18. package/treb-base-types/src/rectangle.ts +1 -1
  19. package/treb-base-types/src/render_text.ts +1 -1
  20. package/treb-base-types/src/style.ts +1 -1
  21. package/treb-base-types/src/table.ts +1 -1
  22. package/treb-base-types/src/text_part.ts +21 -21
  23. package/treb-base-types/src/theme.ts +1 -1
  24. package/treb-base-types/src/union.ts +1 -1
  25. package/treb-base-types/src/value-type.ts +1 -1
  26. package/treb-base-types/style/resizable.css +21 -21
  27. package/treb-calculator/src/calculator.ts +24 -31
  28. package/treb-calculator/src/complex-math.ts +1 -1
  29. package/treb-calculator/src/dag/array-vertex.ts +1 -1
  30. package/treb-calculator/src/dag/calculation_leaf_vertex.ts +8 -1
  31. package/treb-calculator/src/dag/graph.ts +8 -1
  32. package/treb-calculator/src/dag/spreadsheet_vertex.ts +1 -1
  33. package/treb-calculator/src/dag/spreadsheet_vertex_base.ts +21 -21
  34. package/treb-calculator/src/dag/state_leaf_vertex.ts +1 -1
  35. package/treb-calculator/src/dag/vertex.ts +21 -21
  36. package/treb-calculator/src/descriptors.ts +1 -1
  37. package/treb-calculator/src/expression-calculator.ts +1 -1
  38. package/treb-calculator/src/function-error.ts +1 -1
  39. package/treb-calculator/src/function-library.ts +1 -1
  40. package/treb-calculator/src/functions/base-functions.ts +31 -2
  41. package/treb-calculator/src/functions/checkbox.ts +1 -1
  42. package/treb-calculator/src/functions/complex-functions.ts +1 -1
  43. package/treb-calculator/src/functions/finance-functions.ts +1 -1
  44. package/treb-calculator/src/functions/information-functions.ts +1 -1
  45. package/treb-calculator/src/functions/matrix-functions.ts +1 -1
  46. package/treb-calculator/src/functions/sparkline.ts +1 -1
  47. package/treb-calculator/src/functions/statistics-functions.ts +1 -1
  48. package/treb-calculator/src/functions/text-functions.ts +1 -1
  49. package/treb-calculator/src/index.ts +1 -1
  50. package/treb-calculator/src/notifier-types.ts +1 -1
  51. package/treb-calculator/src/primitives.ts +1 -1
  52. package/treb-calculator/src/utilities.ts +1 -1
  53. package/treb-charts/src/chart-functions.ts +12 -1
  54. package/treb-charts/src/chart-types.ts +39 -21
  55. package/treb-charts/src/chart-utils.ts +783 -0
  56. package/treb-charts/src/chart.ts +96 -1291
  57. package/treb-charts/src/default-chart-renderer.ts +560 -0
  58. package/treb-charts/src/index.ts +5 -4
  59. package/treb-charts/src/main.ts +17 -17
  60. package/treb-charts/src/rectangle.ts +21 -21
  61. package/treb-charts/src/renderer-type.ts +32 -0
  62. package/treb-charts/src/renderer.ts +82 -1
  63. package/treb-charts/src/util.ts +1 -1
  64. package/treb-charts/style/charts.scss +9 -1
  65. package/treb-charts/style/old-charts.scss +21 -21
  66. package/treb-embed/markup/toolbar.html +35 -34
  67. package/treb-embed/src/custom-element/treb-global.ts +10 -2
  68. package/treb-embed/src/embedded-spreadsheet.ts +72 -113
  69. package/treb-embed/src/language-model.ts +1 -1
  70. package/treb-embed/src/options.ts +37 -1
  71. package/treb-embed/src/progress-dialog.ts +1 -1
  72. package/treb-embed/src/spinner.ts +1 -1
  73. package/treb-embed/src/types.ts +1 -1
  74. package/treb-embed/style/autocomplete.scss +1 -1
  75. package/treb-embed/style/dark-theme.scss +1 -1
  76. package/treb-embed/style/defaults.scss +1 -1
  77. package/treb-embed/style/dialog.scss +1 -1
  78. package/treb-embed/style/dropdown-select.scss +1 -1
  79. package/treb-embed/style/formula-bar.scss +1 -1
  80. package/treb-embed/style/grid.scss +1 -1
  81. package/treb-embed/style/layout.scss +4 -0
  82. package/treb-embed/style/mouse-mask.scss +1 -1
  83. package/treb-embed/style/note.scss +1 -1
  84. package/treb-embed/style/overlay-editor.scss +1 -1
  85. package/treb-embed/style/spinner.scss +1 -1
  86. package/treb-embed/style/tab-bar.scss +1 -1
  87. package/treb-embed/style/table.scss +1 -1
  88. package/treb-embed/style/theme-defaults.scss +1 -1
  89. package/treb-embed/style/toolbar.scss +37 -0
  90. package/treb-embed/style/tooltip.scss +1 -1
  91. package/treb-embed/style/z-index.scss +1 -1
  92. package/treb-export/src/address-type.ts +21 -21
  93. package/treb-export/src/base-template.ts +1 -1
  94. package/treb-export/src/column-width.ts +1 -1
  95. package/treb-export/src/drawing2/chart-template-components2.ts +1 -1
  96. package/treb-export/src/drawing2/chart2.ts +1 -1
  97. package/treb-export/src/drawing2/column-chart-template2.ts +1 -1
  98. package/treb-export/src/drawing2/donut-chart-template2.ts +1 -1
  99. package/treb-export/src/drawing2/drawing2.ts +1 -1
  100. package/treb-export/src/drawing2/embedded-image.ts +1 -1
  101. package/treb-export/src/drawing2/scatter-chart-template2.ts +1 -1
  102. package/treb-export/src/export-worker/export-worker.ts +1 -1
  103. package/treb-export/src/export-worker/index.worker.ts +1 -1
  104. package/treb-export/src/export2.ts +1 -1
  105. package/treb-export/src/import2.ts +1 -1
  106. package/treb-export/src/relationship.ts +1 -1
  107. package/treb-export/src/shared-strings2.ts +1 -1
  108. package/treb-export/src/template-2.ts +2 -2
  109. package/treb-export/src/workbook-sheet2.ts +1 -1
  110. package/treb-export/src/workbook-style2.ts +1 -1
  111. package/treb-export/src/workbook-theme2.ts +1 -1
  112. package/treb-export/src/workbook2.ts +1 -1
  113. package/treb-export/src/xml-utils.ts +1 -1
  114. package/treb-format/src/format.test.ts +21 -21
  115. package/treb-format/src/format.ts +1 -1
  116. package/treb-format/src/format_cache.ts +21 -21
  117. package/treb-format/src/format_parser.ts +1 -1
  118. package/treb-format/src/index.ts +4 -4
  119. package/treb-format/src/number_format_section.ts +21 -21
  120. package/treb-format/src/value_parser.ts +1 -1
  121. package/treb-grid/src/editors/autocomplete.ts +1 -1
  122. package/treb-grid/src/editors/autocomplete_matcher.ts +21 -21
  123. package/treb-grid/src/editors/editor.ts +1 -1
  124. package/treb-grid/src/editors/formula_bar.ts +1 -1
  125. package/treb-grid/src/editors/overlay_editor.ts +1 -1
  126. package/treb-grid/src/index.ts +1 -1
  127. package/treb-grid/src/layout/base_layout.ts +1 -1
  128. package/treb-grid/src/layout/grid_layout.ts +1 -1
  129. package/treb-grid/src/layout/rectangle_cache.ts +21 -21
  130. package/treb-grid/src/render/selection-renderer.ts +1 -1
  131. package/treb-grid/src/render/svg_header_overlay.ts +1 -1
  132. package/treb-grid/src/render/svg_selection_block.ts +1 -1
  133. package/treb-grid/src/render/tile_renderer.ts +1 -1
  134. package/treb-grid/src/types/annotation.ts +1 -1
  135. package/treb-grid/src/types/border_constants.ts +1 -1
  136. package/treb-grid/src/types/clipboard_data.ts +1 -1
  137. package/treb-grid/src/types/conditional_format.ts +1 -1
  138. package/treb-grid/src/types/data_model.ts +1 -1
  139. package/treb-grid/src/types/drag_mask.ts +21 -21
  140. package/treb-grid/src/types/grid.ts +12 -2
  141. package/treb-grid/src/types/grid_base.ts +128 -6
  142. package/treb-grid/src/types/grid_command.ts +33 -1
  143. package/treb-grid/src/types/grid_events.ts +8 -1
  144. package/treb-grid/src/types/grid_options.ts +9 -1
  145. package/treb-grid/src/types/grid_selection.ts +1 -1
  146. package/treb-grid/src/types/named_range.ts +1 -1
  147. package/treb-grid/src/types/scale-control.ts +1 -1
  148. package/treb-grid/src/types/serialize_options.ts +1 -1
  149. package/treb-grid/src/types/set_range_options.ts +1 -1
  150. package/treb-grid/src/types/sheet.ts +1 -57
  151. package/treb-grid/src/types/sheet_types.ts +1 -1
  152. package/treb-grid/src/types/tab_bar.ts +1 -1
  153. package/treb-grid/src/types/tile.ts +21 -21
  154. package/treb-grid/src/types/update_flags.ts +2 -1
  155. package/treb-grid/src/util/fontmetrics2.ts +1 -1
  156. package/treb-grid/src/util/ua.ts +21 -21
  157. package/treb-parser/src/csv-parser.ts +21 -21
  158. package/treb-parser/src/index.ts +5 -5
  159. package/treb-parser/src/md-parser.ts +1 -1
  160. package/treb-parser/src/parser-types.ts +1 -1
  161. package/treb-parser/src/parser.test.ts +21 -21
  162. package/treb-parser/src/parser.ts +1 -1
  163. package/treb-utils/src/event_source.ts +1 -1
  164. package/treb-utils/src/ievent_source.ts +13 -13
  165. package/treb-utils/src/index.ts +1 -1
  166. package/treb-utils/src/measurement.ts +1 -1
  167. package/treb-utils/src/scale.ts +21 -21
  168. package/treb-utils/src/serialize_html.ts +1 -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -67,6 +67,10 @@ interface PatchOptions extends PatchAreaOptions {
67
67
  sheet: Sheet;
68
68
  }
69
69
 
70
+ const AssertNever = (value: never) => {
71
+ console.error('invalid case');
72
+ };
73
+
70
74
  export class GridBase {
71
75
 
72
76
  // --- public members --------------------------------------------------------
@@ -160,6 +164,24 @@ export class GridBase {
160
164
 
161
165
  // --- API methods -----------------------------------------------------------
162
166
 
167
+ public RemoveConditionalFormat(options: {
168
+ format?: ConditionalFormat;
169
+ area?: IArea;
170
+ }) {
171
+
172
+ this.ExecCommand({
173
+ key: CommandKey.RemoveConditionalFormat,
174
+ ...options,
175
+ });
176
+ }
177
+
178
+ public AddConditionalFormat(format: ConditionalFormat) {
179
+ this.ExecCommand({
180
+ key: CommandKey.AddConditionalFormat,
181
+ format,
182
+ });
183
+ }
184
+
163
185
  /** remove a table. doesn't remove any data, just removes the overlay. */
164
186
  public RemoveTable(table: Table) {
165
187
  this.ExecCommand({
@@ -1887,7 +1909,7 @@ export class GridBase {
1887
1909
  break;
1888
1910
  */
1889
1911
 
1890
- // special case
1912
+ // special cases
1891
1913
  case CommandKey.SortTable:
1892
1914
  case CommandKey.RemoveTable:
1893
1915
  if (!command.table.area.start.sheet_id) {
@@ -1895,6 +1917,12 @@ export class GridBase {
1895
1917
  }
1896
1918
  break;
1897
1919
 
1920
+ case CommandKey.AddConditionalFormat:
1921
+ if (!command.format.area.start.sheet_id) {
1922
+ command.format.area.start.sheet_id = id;
1923
+ }
1924
+ break;
1925
+
1898
1926
  // field
1899
1927
  case CommandKey.ResizeRows:
1900
1928
  case CommandKey.ResizeColumns:
@@ -1920,6 +1948,14 @@ export class GridBase {
1920
1948
  case CommandKey.Select:
1921
1949
  case CommandKey.InsertTable:
1922
1950
 
1951
+ // note that remove conditional format could have a format
1952
+ // object (with an area) instead of an area. but in that case,
1953
+ // the format object must match an existing format, so it would
1954
+ // have to have a proper area. there's no case where we would
1955
+ // want to add it. so we only handle the area case.
1956
+
1957
+ case CommandKey.RemoveConditionalFormat:
1958
+
1923
1959
  if (command.area) {
1924
1960
  if (IsCellAddress(command.area)) {
1925
1961
  if (!command.area.sheet_id) {
@@ -1934,10 +1970,13 @@ export class GridBase {
1934
1970
  }
1935
1971
  break;
1936
1972
 
1937
- // default:
1938
- // // command key here should be `never` if we've covered all the
1939
- // // cases (ts will complain)
1940
- // // console.warn('unhandled command key', command.key);
1973
+ default:
1974
+
1975
+ // this is intended to check that we've handled all cases. if you
1976
+ // add additional commands and they're not handled, this should
1977
+ // raise a ts error.
1978
+
1979
+ AssertNever(command);
1941
1980
 
1942
1981
  }
1943
1982
  }
@@ -3534,6 +3573,88 @@ export class GridBase {
3534
3573
 
3535
3574
  break;
3536
3575
 
3576
+ case CommandKey.AddConditionalFormat:
3577
+ {
3578
+
3579
+ const sheet = this.FindSheet(command.format.area);
3580
+ sheet.conditional_formats.push(command.format);
3581
+
3582
+ sheet.Invalidate(new Area(command.format.area.start, command.format.area.end));
3583
+
3584
+ if (sheet === this.active_sheet) {
3585
+ // flags.style_area = Area.Join(command.format.area, flags.style_area);
3586
+ flags.render_area = Area.Join(command.format.area, flags.render_area);
3587
+ }
3588
+ else {
3589
+ // flags.style_event = true;
3590
+ }
3591
+
3592
+ flags.structure_event = true;
3593
+ flags.conditional_formatting_event = true;
3594
+
3595
+ }
3596
+ break;
3597
+
3598
+ case CommandKey.RemoveConditionalFormat:
3599
+
3600
+ {
3601
+ let sheet: Sheet|undefined;
3602
+ let count = 0;
3603
+
3604
+ if (command.format) {
3605
+
3606
+ // we're removing by object equivalence, not strict equality.
3607
+ // this is in case we're switching contexts and the objects
3608
+ // are not strictly equal. may be unecessary. do we need to
3609
+ // normalize in some way? (...)
3610
+
3611
+ const format = JSON.stringify(command.format);
3612
+
3613
+ sheet = this.FindSheet(command.format.area);
3614
+ sheet.conditional_formats = sheet.conditional_formats.filter(test => {
3615
+ // if (test === command.format) {
3616
+ if (JSON.stringify(test) === format) {
3617
+ count++;
3618
+ flags.render_area = Area.Join(test.area, flags.render_area);
3619
+ return false;
3620
+ }
3621
+ return true;
3622
+ });
3623
+
3624
+ }
3625
+ else if (command.area) {
3626
+ const area = new Area(command.area.start, command.area.end);
3627
+ sheet = this.FindSheet(command.area);
3628
+
3629
+ sheet.conditional_formats = sheet.conditional_formats.filter(test => {
3630
+ const compare = new Area(test.area.start, test.area.end);
3631
+ if (compare.Intersects(area)) {
3632
+ count++;
3633
+ flags.render_area = Area.Join(compare, flags.render_area);
3634
+ return false;
3635
+ }
3636
+ return true;
3637
+ });
3638
+
3639
+ }
3640
+
3641
+ if (sheet && count) {
3642
+ sheet.FlushConditionalFormats();
3643
+ flags.structure_event = true;
3644
+
3645
+ // this will flush leaf vertices. but it's expensive because
3646
+ // it's rebuilding the whole graph. we could maybe reduce a
3647
+ // bit... the question is what's worse: rebuilding the graph
3648
+ // or leaving orphans for a while?
3649
+
3650
+ // flags.structure_rebuild_required = true;
3651
+
3652
+ flags.conditional_formatting_event = true;
3653
+ }
3654
+
3655
+ }
3656
+ break;
3657
+
3537
3658
  case CommandKey.InsertTable:
3538
3659
 
3539
3660
  // the most important thing here is validating that we can
@@ -4170,6 +4291,7 @@ export class GridBase {
4170
4291
  events.push({
4171
4292
  type: 'structure',
4172
4293
  rebuild_required: flags.structure_rebuild_required,
4294
+ conditional_format: flags.conditional_formatting_event,
4173
4295
  });
4174
4296
  }
4175
4297
 
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -22,6 +22,7 @@
22
22
  import type { ICellAddress, IArea, Style, CellStyle, Color, CellValue, Table, TableSortType, TableTheme } from 'treb-base-types';
23
23
  import type { ExpressionUnit } from 'treb-parser';
24
24
  import type { BorderConstants } from './border_constants';
25
+ import type { ConditionalFormat } from './conditional_format';
25
26
 
26
27
  /**
27
28
  * switching to an exec-command based model, so we can serialize
@@ -73,6 +74,9 @@ export enum CommandKey {
73
74
  InsertTable,
74
75
  RemoveTable,
75
76
 
77
+ AddConditionalFormat,
78
+ RemoveConditionalFormat,
79
+
76
80
  }
77
81
 
78
82
  /** base type for sheet commands -- can select sheet by name, id or index */
@@ -418,6 +422,32 @@ export interface ReorderSheetCommand {
418
422
  move_before: number;
419
423
  }
420
424
 
425
+ /**
426
+ * add conditional format
427
+ */
428
+ export interface AddConditionalFormatCommand {
429
+ key: CommandKey.AddConditionalFormat;
430
+ format: ConditionalFormat;
431
+ }
432
+
433
+ /**
434
+ * remove conditional format, either as an object or from a target
435
+ * area. as an object, we'll match using object equivalence and not
436
+ * identity.
437
+ */
438
+ export interface RemoveConditionalFormatCommand {
439
+
440
+ key: CommandKey.RemoveConditionalFormat;
441
+
442
+ /** if format is omitted, we will remove all formats from the target range */
443
+ format?: ConditionalFormat;
444
+
445
+ /** one of area or format should be supplied */
446
+ area?: IArea;
447
+
448
+ }
449
+
450
+
421
451
  /**
422
452
  * ephemeral flag added to commands.
423
453
  * /
@@ -459,6 +489,8 @@ export type Command =
459
489
  | ActivateSheetCommand
460
490
  | DataValidationCommand
461
491
  | DuplicateSheetCommand
492
+ | AddConditionalFormatCommand
493
+ | RemoveConditionalFormatCommand
462
494
  ) ; // & Ephemeral;
463
495
 
464
496
  /**
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -23,6 +23,7 @@ import type { GridSelection } from './grid_selection';
23
23
  import type { Annotation } from './annotation';
24
24
  import type { Sheet } from './sheet';
25
25
  import type { Area } from 'treb-base-types';
26
+ import type { ConditionalFormat } from './conditional_format';
26
27
 
27
28
  export enum ErrorCode {
28
29
 
@@ -80,6 +81,12 @@ export interface StructureEvent {
80
81
  * FIXME: merge/unmerge? (...) I think yes
81
82
  */
82
83
  rebuild_required?: boolean;
84
+
85
+ /**
86
+ * we can use this when conditional formats are modified/added/removed
87
+ */
88
+ conditional_format?: boolean;
89
+
83
90
  }
84
91
 
85
92
  export interface AnnotationEvent {
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -24,6 +24,14 @@ import type { StatsEntry } from './tab_bar';
24
24
 
25
25
  export type StatsFunction = (data: CellValue|CellValue[][]|undefined) => StatsEntry[];
26
26
 
27
+
28
+ /**
29
+ * @internalRemarks
30
+ *
31
+ * why are there two levels of options? can we consolidate this with
32
+ * the embedded spreadsheet options? they are never (AFAICT) used
33
+ * independently. maybe that's recent.
34
+ */
27
35
  export interface GridOptions {
28
36
 
29
37
  /** can expand rows/columns */
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -3232,62 +3232,6 @@ export class Sheet {
3232
3232
 
3233
3233
  }
3234
3234
 
3235
- /*
3236
- public ApplyConditionalFormats() {
3237
-
3238
- this.FlushConditionalFormatCache();
3239
-
3240
- for (const entry of this.conditional_formats) {
3241
-
3242
- console.info({entry});
3243
-
3244
- if (entry.applied) {
3245
- this.ApplyConditionalFormatCache(entry);
3246
- }
3247
- }
3248
-
3249
- }
3250
-
3251
- public FlushConditionalFormatCache() {
3252
-
3253
- // FIXME: need to flush any styles that are set, unless they match;
3254
- // perhaps we should use an alternate cache so we can compare? TODO/FIXME
3255
-
3256
- for (const [row, row_data] of this.conditional_format_cache.entries()) {
3257
- if (row_data) {
3258
- for (const [column, column_data] of row_data.entries()) {
3259
- if (column_data) {
3260
-
3261
- this.CellData({row, column}).FlushStyle();
3262
-
3263
- }
3264
- }
3265
- }
3266
- }
3267
-
3268
- this.conditional_format_cache = [];
3269
-
3270
- }
3271
-
3272
- public ApplyConditionalFormatCache(format: ConditionalFormat) {
3273
-
3274
- for (let row = format.area.start.row; row <= format.area.end.row; row++ ) {
3275
- for (let column = format.area.start.column; column <= format.area.end.column; column++ ) {
3276
- if (!this.conditional_format_cache[row]) {
3277
- this.conditional_format_cache[row] = [];
3278
- }
3279
- if (!this.conditional_format_cache[row][column]) {
3280
- this.conditional_format_cache[row][column] = [];
3281
- }
3282
- this.conditional_format_cache[row][column].push(format.style);
3283
- this.CellData({row, column}).FlushStyle();
3284
-
3285
- }
3286
- }
3287
-
3288
- }
3289
- */
3290
-
3291
3235
  private ConditionalFormatForCell(address: ICellAddress): CellStyle[] {
3292
3236
  if (this.conditional_format_cache[address.row]) {
3293
3237
  return this.conditional_format_cache[address.row][address.column] || [];
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -1,24 +1,24 @@
1
- /*
2
- * This file is part of TREB.
3
- *
4
- * TREB is free software: you can redistribute it and/or modify it under the
5
- * terms of the GNU General Public License as published by the Free Software
6
- * Foundation, either version 3 of the License, or (at your option) any
7
- * later version.
8
- *
9
- * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
- * details.
13
- *
14
- * You should have received a copy of the GNU General Public License along
15
- * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
- *
17
- * Copyright 2022-2023 trebco, llc.
18
- * info@treb.app
19
- *
20
- */
21
-
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2024 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+
22
22
  import type { Point, Size, Position } from 'treb-base-types';
23
23
 
24
24
  /**
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -64,6 +64,7 @@ export interface UpdateFlags {
64
64
 
65
65
  data_event?: boolean;
66
66
  style_event?: boolean;
67
+ conditional_formatting_event?: boolean;
67
68
  structure_event?: boolean;
68
69
  structure_rebuild_required?: boolean;
69
70
 
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -1,24 +1,24 @@
1
- /*
2
- * This file is part of TREB.
3
- *
4
- * TREB is free software: you can redistribute it and/or modify it under the
5
- * terms of the GNU General Public License as published by the Free Software
6
- * Foundation, either version 3 of the License, or (at your option) any
7
- * later version.
8
- *
9
- * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
- * details.
13
- *
14
- * You should have received a copy of the GNU General Public License along
15
- * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
- *
17
- * Copyright 2022-2023 trebco, llc.
18
- * info@treb.app
19
- *
20
- */
21
-
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2024 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+
22
22
  const app_version = typeof navigator === 'undefined' ? '' : navigator.appVersion;
23
23
  const user_agent = typeof navigator === 'undefined' ? '' : navigator.userAgent;
24
24
 
@@ -1,24 +1,24 @@
1
- /*
2
- * This file is part of TREB.
3
- *
4
- * TREB is free software: you can redistribute it and/or modify it under the
5
- * terms of the GNU General Public License as published by the Free Software
6
- * Foundation, either version 3 of the License, or (at your option) any
7
- * later version.
8
- *
9
- * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
- * details.
13
- *
14
- * You should have received a copy of the GNU General Public License along
15
- * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
- *
17
- * Copyright 2022-2023 trebco, llc.
18
- * info@treb.app
19
- *
20
- */
21
-
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2024 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+
22
22
  enum ParseState {
23
23
  default = 0,
24
24
  quoted = 1,
@@ -14,12 +14,12 @@
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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
21
21
 
22
- export * from './parser-types';
23
- export * from './parser';
24
- export * from './csv-parser';
25
- export * from './md-parser';
22
+ export * from './parser-types';
23
+ export * from './parser';
24
+ export * from './csv-parser';
25
+ export * from './md-parser';
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */
@@ -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-2023 trebco, llc.
17
+ * Copyright 2022-2024 trebco, llc.
18
18
  * info@treb.app
19
19
  *
20
20
  */