@perspective-dev/viewer-datagrid 4.4.1 → 4.5.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.
Files changed (39) hide show
  1. package/dist/cdn/perspective-viewer-datagrid.js +4 -4
  2. package/dist/cdn/perspective-viewer-datagrid.js.map +4 -4
  3. package/dist/css/perspective-viewer-datagrid.css +1 -1
  4. package/dist/esm/custom_elements/datagrid.d.ts +12 -17
  5. package/dist/esm/model/meta_columns.d.ts +1 -0
  6. package/dist/esm/perspective-viewer-datagrid.js +3 -3
  7. package/dist/esm/perspective-viewer-datagrid.js.map +4 -4
  8. package/dist/esm/plugin/column_config_schema.d.ts +31 -0
  9. package/package.json +1 -1
  10. package/src/css/regular_table.css +36 -0
  11. package/src/ts/color_utils.ts +50 -13
  12. package/src/ts/custom_elements/datagrid.ts +63 -48
  13. package/src/ts/data_listener/format_tree_header.ts +2 -2
  14. package/src/ts/data_listener/formatter_cache.ts +8 -95
  15. package/src/ts/data_listener/index.ts +9 -3
  16. package/src/ts/event_handlers/click/edit_click.ts +3 -0
  17. package/src/ts/event_handlers/dispatch_click.ts +4 -1
  18. package/src/ts/event_handlers/expand_collapse.ts +4 -1
  19. package/src/ts/event_handlers/header_click.ts +9 -3
  20. package/src/ts/event_handlers/keydown/edit_keydown.ts +11 -2
  21. package/src/ts/event_handlers/select_region.ts +15 -4
  22. package/src/ts/event_handlers/sort.ts +4 -1
  23. package/src/ts/get_cell_config.ts +10 -3
  24. package/src/ts/model/column_overrides.ts +3 -5
  25. package/src/ts/model/create.ts +22 -5
  26. package/src/ts/{plugin/column_style_controls.ts → model/meta_columns.ts} +33 -62
  27. package/src/ts/model/toolbar.ts +11 -2
  28. package/src/ts/plugin/activate.ts +3 -1
  29. package/src/ts/plugin/column_config_schema.ts +187 -0
  30. package/src/ts/plugin/draw.ts +1 -0
  31. package/src/ts/plugin/restore.ts +6 -2
  32. package/src/ts/plugin/save.ts +1 -5
  33. package/src/ts/style_handlers/body.ts +6 -2
  34. package/src/ts/style_handlers/column_header.ts +6 -2
  35. package/src/ts/style_handlers/consolidated.ts +1 -0
  36. package/src/ts/style_handlers/editable.ts +6 -2
  37. package/src/ts/style_handlers/focus.ts +2 -0
  38. package/src/ts/style_handlers/group_header.ts +10 -4
  39. package/dist/esm/plugin/column_style_controls.d.ts +0 -28
@@ -28,12 +28,14 @@ export function applyGroupHeaderStyles(
28
28
  let marked = new Set<number>();
29
29
 
30
30
  for (let y = 0; y < headerRows.length; y++) {
31
- const { row, cells } = headerRows[y];
31
+ const { cells } = headerRows[y];
32
32
  const tops = new Set<number>();
33
33
 
34
34
  for (let x = 0; x < cells.length; x++) {
35
35
  const { element: td, metadata } = cells[x];
36
- if (!metadata) continue;
36
+ if (!metadata) {
37
+ continue;
38
+ }
37
39
 
38
40
  td.style.backgroundColor = "";
39
41
 
@@ -63,13 +65,17 @@ export function applyGroupHeaderStyles(
63
65
 
64
66
  // Calculate spanning for psp-is-top
65
67
  let xx = x;
66
- for (; m[y] && m[y][xx]; ++xx);
68
+ for (; m[y] && m[y][xx]; ++xx) {}
69
+
67
70
  tops.add(xx);
68
71
 
69
72
  const cell = td;
70
73
  for (let tx = xx; tx < xx + cell.colSpan; ++tx) {
71
74
  for (let ty = y; ty < y + cell.rowSpan; ++ty) {
72
- if (!m[ty]) m[ty] = [];
75
+ if (!m[ty]) {
76
+ m[ty] = [];
77
+ }
78
+
73
79
  m[ty][tx] = true;
74
80
  }
75
81
  }
@@ -1,28 +0,0 @@
1
- import type { ColumnType } from "@perspective-dev/client";
2
- import type { DatagridPluginElement } from "../types.js";
3
- interface NumberStyleOpts {
4
- datagrid_number_style: {
5
- fg_gradient: number;
6
- pos_fg_color: string;
7
- neg_fg_color: string;
8
- number_fg_mode: string;
9
- bg_gradient: number;
10
- pos_bg_color: string;
11
- neg_bg_color: string;
12
- number_bg_mode: string;
13
- };
14
- number_string_format: boolean;
15
- }
16
- interface DatetimeStyleOpts {
17
- datagrid_datetime_style?: {
18
- color: string;
19
- bg_color: string;
20
- };
21
- datagrid_string_style?: {
22
- color: string;
23
- bg_color: string;
24
- };
25
- }
26
- export type ColumnStyleOpts = NumberStyleOpts | DatetimeStyleOpts | null;
27
- export default function column_style_opts(this: DatagridPluginElement, type: ColumnType, _group: string): ColumnStyleOpts;
28
- export {};