@deephaven/grid 0.22.3-beta.18 → 0.22.3-beta.21

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 (82) hide show
  1. package/dist/CellInputField.d.ts +5 -5
  2. package/dist/CellInputField.d.ts.map +1 -1
  3. package/dist/CellInputField.js +6 -23
  4. package/dist/CellInputField.js.map +1 -1
  5. package/dist/EditableGridModel.js +1 -0
  6. package/dist/EditableGridModel.js.map +1 -1
  7. package/dist/ExpandableGridModel.js +1 -0
  8. package/dist/ExpandableGridModel.js.map +1 -1
  9. package/dist/Grid.js +77 -315
  10. package/dist/Grid.js.map +1 -1
  11. package/dist/GridAxisRange.js.map +1 -1
  12. package/dist/GridColorUtils.js +1 -2
  13. package/dist/GridColorUtils.js.map +1 -1
  14. package/dist/GridMetricCalculator.js +83 -240
  15. package/dist/GridMetricCalculator.js.map +1 -1
  16. package/dist/GridModel.js +13 -31
  17. package/dist/GridModel.js.map +1 -1
  18. package/dist/GridMouseHandler.js +2 -15
  19. package/dist/GridMouseHandler.js.map +1 -1
  20. package/dist/GridRange.js +46 -160
  21. package/dist/GridRange.js.map +1 -1
  22. package/dist/GridRenderer.js +126 -407
  23. package/dist/GridRenderer.js.map +1 -1
  24. package/dist/GridTestUtils.js +0 -5
  25. package/dist/GridTestUtils.js.map +1 -1
  26. package/dist/GridTheme.js.map +1 -1
  27. package/dist/GridUtils.js +68 -217
  28. package/dist/GridUtils.js.map +1 -1
  29. package/dist/KeyHandler.js +2 -8
  30. package/dist/KeyHandler.js.map +1 -1
  31. package/dist/MockGridData.js.map +1 -1
  32. package/dist/MockGridModel.js +0 -42
  33. package/dist/MockGridModel.js.map +1 -1
  34. package/dist/MockTreeGridModel.js +6 -55
  35. package/dist/MockTreeGridModel.js.map +1 -1
  36. package/dist/StaticDataGridModel.js +0 -15
  37. package/dist/StaticDataGridModel.js.map +1 -1
  38. package/dist/ThemeContext.js.map +1 -1
  39. package/dist/ViewportDataGridModel.js +0 -14
  40. package/dist/ViewportDataGridModel.js.map +1 -1
  41. package/dist/errors/AssertionError.js +0 -3
  42. package/dist/errors/AssertionError.js.map +1 -1
  43. package/dist/errors/PasteError.js +0 -3
  44. package/dist/errors/PasteError.js.map +1 -1
  45. package/dist/errors/assertIsDefined.js.map +1 -1
  46. package/dist/errors/index.js.map +1 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/key-handlers/EditKeyHandler.js +0 -12
  49. package/dist/key-handlers/EditKeyHandler.js.map +1 -1
  50. package/dist/key-handlers/PasteKeyHandler.js +15 -33
  51. package/dist/key-handlers/PasteKeyHandler.js.map +1 -1
  52. package/dist/key-handlers/SelectionKeyHandler.js +6 -53
  53. package/dist/key-handlers/SelectionKeyHandler.js.map +1 -1
  54. package/dist/key-handlers/TreeKeyHandler.js +0 -11
  55. package/dist/key-handlers/TreeKeyHandler.js.map +1 -1
  56. package/dist/key-handlers/index.js.map +1 -1
  57. package/dist/memoizeClear.js +1 -4
  58. package/dist/memoizeClear.js.map +1 -1
  59. package/dist/mouse-handlers/EditMouseHandler.js +0 -5
  60. package/dist/mouse-handlers/EditMouseHandler.js.map +1 -1
  61. package/dist/mouse-handlers/GridColumnMoveMouseHandler.js +35 -123
  62. package/dist/mouse-handlers/GridColumnMoveMouseHandler.js.map +1 -1
  63. package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js +2 -27
  64. package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js.map +1 -1
  65. package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js +0 -28
  66. package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js.map +1 -1
  67. package/dist/mouse-handlers/GridRowMoveMouseHandler.js +0 -27
  68. package/dist/mouse-handlers/GridRowMoveMouseHandler.js.map +1 -1
  69. package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js +0 -23
  70. package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js.map +1 -1
  71. package/dist/mouse-handlers/GridRowTreeMouseHandler.js +0 -10
  72. package/dist/mouse-handlers/GridRowTreeMouseHandler.js.map +1 -1
  73. package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js +0 -6
  74. package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js.map +1 -1
  75. package/dist/mouse-handlers/GridSelectionMouseHandler.js +8 -38
  76. package/dist/mouse-handlers/GridSelectionMouseHandler.js.map +1 -1
  77. package/dist/mouse-handlers/GridSeparatorMouseHandler.js +5 -54
  78. package/dist/mouse-handlers/GridSeparatorMouseHandler.js.map +1 -1
  79. package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js +0 -28
  80. package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js.map +1 -1
  81. package/dist/mouse-handlers/index.js.map +1 -1
  82. package/package.json +4 -4
package/dist/GridModel.js CHANGED
@@ -1,9 +1,6 @@
1
1
  import { EventTarget } from 'event-target-shim';
2
-
3
2
  /* eslint class-methods-use-this: "off" */
4
-
5
3
  /* eslint no-unused-vars: "off" */
6
-
7
4
  /**
8
5
  * Model for a Grid
9
6
  * All of these methods should return very quickly, as they will be called many times in the render cycle.
@@ -18,24 +15,22 @@ class GridModel extends EventTarget {
18
15
  get floatingTopRowCount() {
19
16
  return 0;
20
17
  }
21
- /** Count of rows that are frozen at the bottom */
22
-
23
18
 
19
+ /** Count of rows that are frozen at the bottom */
24
20
  get floatingBottomRowCount() {
25
21
  return 0;
26
22
  }
27
- /** Count of columns that are frozen (or 'floating') at the left */
28
-
29
23
 
24
+ /** Count of columns that are frozen (or 'floating') at the left */
30
25
  get floatingLeftColumnCount() {
31
26
  return 0;
32
27
  }
33
- /** Count of columns that are frozen (or 'floating') at the right */
34
-
35
28
 
29
+ /** Count of columns that are frozen (or 'floating') at the right */
36
30
  get floatingRightColumnCount() {
37
31
  return 0;
38
32
  }
33
+
39
34
  /**
40
35
  * How many columns header levels are in the grid
41
36
  * Used for column grouping where columns at depth 0 are the base columns
@@ -43,11 +38,10 @@ class GridModel extends EventTarget {
43
38
  * A grid with 1-level grouping would have a columnHeaderDepth of 2
44
39
  * and column headers at depths 0 and 1
45
40
  */
46
-
47
-
48
41
  get columnHeaderMaxDepth() {
49
42
  return 1;
50
43
  }
44
+
51
45
  /**
52
46
  * Get the text for the specified cell
53
47
  * @param column Column to get the text for
@@ -55,7 +49,6 @@ class GridModel extends EventTarget {
55
49
  * @returns Text for the specified cell
56
50
  */
57
51
 
58
-
59
52
  /**
60
53
  * Get the character to replace text when truncated for a specific cell.
61
54
  * Leave undefined to show text truncated with ellipsis
@@ -66,17 +59,17 @@ class GridModel extends EventTarget {
66
59
  truncationCharForCell(column, row) {
67
60
  return undefined;
68
61
  }
62
+
69
63
  /**
70
64
  * Get the text alignment for the specified cell
71
65
  * @param column Column to get the alignment for
72
66
  * @param row Row to get the alignment for
73
67
  * @returns Text alignment for the specified cell
74
68
  */
75
-
76
-
77
69
  textAlignForCell(column, row) {
78
70
  return 'left';
79
71
  }
72
+
80
73
  /**
81
74
  * Get the color for the text in the specified cell
82
75
  * @param column Column to get the color for
@@ -84,11 +77,10 @@ class GridModel extends EventTarget {
84
77
  * @param theme Theme applied to the grid
85
78
  * @returns Color for the text in the cell
86
79
  */
87
-
88
-
89
80
  colorForCell(column, row, theme) {
90
81
  return theme.textColor;
91
82
  }
83
+
92
84
  /**
93
85
  * Get the background color for the cell
94
86
  * @param column Column to get the background color for
@@ -96,11 +88,10 @@ class GridModel extends EventTarget {
96
88
  * @param theme Theme applied to the grid
97
89
  * @returns Background color for the cell
98
90
  */
99
-
100
-
101
91
  backgroundColorForCell(column, row, theme) {
102
92
  return null;
103
93
  }
94
+
104
95
  /**
105
96
  * Text for the column header
106
97
  * @param column Column to get the header for
@@ -108,7 +99,6 @@ class GridModel extends EventTarget {
108
99
  * @returns Text to put in the column header
109
100
  */
110
101
 
111
-
112
102
  /** Color for column header
113
103
  * @param column Column to get the color for
114
104
  * @param depth Header depth to get the color for
@@ -118,55 +108,47 @@ class GridModel extends EventTarget {
118
108
  var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
119
109
  return null;
120
110
  }
111
+
121
112
  /**
122
113
  * Text for the row header
123
114
  * @param row Row to get the header for
124
115
  * @returns Text to put in the row header
125
116
  */
126
-
127
-
128
117
  textForRowHeader(row) {
129
118
  return '';
130
119
  }
120
+
131
121
  /**
132
122
  * Text for the row footer
133
123
  * @param row Row to get the footer for
134
124
  * @returns Text to put in the row footer
135
125
  */
136
-
137
-
138
126
  textForRowFooter(row) {
139
127
  return '';
140
128
  }
129
+
141
130
  /**
142
131
  * @param column Column to check
143
132
  * @returns True if the column is movable
144
133
  */
145
-
146
-
147
134
  isColumnMovable(column) {
148
135
  var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
149
136
  return true;
150
137
  }
138
+
151
139
  /**
152
140
  * @param row Row to check
153
141
  * @returns True if the row is movable
154
142
  */
155
-
156
-
157
143
  isRowMovable(row) {
158
144
  return true;
159
145
  }
160
-
161
146
  getColumnHeaderGroup(modelIndex, depth) {
162
147
  return undefined;
163
148
  }
164
-
165
149
  getColumnHeaderParentGroup(modelIndex, depth) {
166
150
  return undefined;
167
151
  }
168
-
169
152
  }
170
-
171
153
  export default GridModel;
172
154
  //# sourceMappingURL=GridModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridModel.js","names":["EventTarget","GridModel","floatingTopRowCount","floatingBottomRowCount","floatingLeftColumnCount","floatingRightColumnCount","columnHeaderMaxDepth","truncationCharForCell","column","row","undefined","textAlignForCell","colorForCell","theme","textColor","backgroundColorForCell","colorForColumnHeader","depth","textForRowHeader","textForRowFooter","isColumnMovable","isRowMovable","getColumnHeaderGroup","modelIndex","getColumnHeaderParentGroup"],"sources":["../src/GridModel.ts"],"sourcesContent":["import { EventTarget, Event } from 'event-target-shim';\nimport type { IColumnHeaderGroup } from './ColumnHeaderGroup';\nimport { ModelIndex } from './GridMetrics';\nimport { GridColor, GridTheme, NullableGridColor } from './GridTheme';\n\n/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n/**\n * Model for a Grid\n * All of these methods should return very quickly, as they will be called many times in the render cycle.\n * If data needs to be loaded asynchronously, return something immediately, then trigger an event for the table to refresh (Not yet implemented).\n */\nabstract class GridModel<\n TEventMap extends Record<string, Event<string>> = Record<\n string,\n Event<string>\n >,\n TMode extends 'standard' | 'strict' = 'standard'\n> extends EventTarget<TEventMap, TMode> {\n /** Count of rows in the grid */\n abstract get rowCount(): number;\n\n /** Count of columns in the grid */\n abstract get columnCount(): number;\n\n /** Count of rows that are frozen (or 'floating') at the top */\n get floatingTopRowCount(): number {\n return 0;\n }\n\n /** Count of rows that are frozen at the bottom */\n get floatingBottomRowCount(): number {\n return 0;\n }\n\n /** Count of columns that are frozen (or 'floating') at the left */\n get floatingLeftColumnCount(): number {\n return 0;\n }\n\n /** Count of columns that are frozen (or 'floating') at the right */\n get floatingRightColumnCount(): number {\n return 0;\n }\n\n /**\n * How many columns header levels are in the grid\n * Used for column grouping where columns at depth 0 are the base columns\n *\n * A grid with 1-level grouping would have a columnHeaderDepth of 2\n * and column headers at depths 0 and 1\n */\n get columnHeaderMaxDepth(): number {\n return 1;\n }\n\n /**\n * Get the text for the specified cell\n * @param column Column to get the text for\n * @param row Row to get the text for\n * @returns Text for the specified cell\n */\n abstract textForCell(column: ModelIndex, row: ModelIndex): string;\n\n /**\n * Get the character to replace text when truncated for a specific cell.\n * Leave undefined to show text truncated with ellipsis\n * @param column Column to get the truncation character for\n * @param row Row to get the truncation character for\n * @returns Truncation character for the specified cell\n */\n truncationCharForCell(\n column: ModelIndex,\n row: ModelIndex\n ): string | undefined {\n return undefined;\n }\n\n /**\n * Get the text alignment for the specified cell\n * @param column Column to get the alignment for\n * @param row Row to get the alignment for\n * @returns Text alignment for the specified cell\n */\n textAlignForCell(column: ModelIndex, row: ModelIndex): CanvasTextAlign {\n return 'left';\n }\n\n /**\n * Get the color for the text in the specified cell\n * @param column Column to get the color for\n * @param row Row to get the color for\n * @param theme Theme applied to the grid\n * @returns Color for the text in the cell\n */\n colorForCell(\n column: ModelIndex,\n row: ModelIndex,\n theme: GridTheme\n ): GridColor {\n return theme.textColor;\n }\n\n /**\n * Get the background color for the cell\n * @param column Column to get the background color for\n * @param row Row to get the background color for\n * @param theme Theme applied to the grid\n * @returns Background color for the cell\n */\n backgroundColorForCell(\n column: ModelIndex,\n row: ModelIndex,\n theme: GridTheme\n ): NullableGridColor {\n return null;\n }\n\n /**\n * Text for the column header\n * @param column Column to get the header for\n * @param depth Depth to get the header text for. 0 is base columns\n * @returns Text to put in the column header\n */\n abstract textForColumnHeader(\n column: ModelIndex,\n depth?: number\n ): string | undefined;\n\n /** Color for column header\n * @param column Column to get the color for\n * @param depth Header depth to get the color for\n * @returns Color for the header at the depth or null\n */\n colorForColumnHeader(column: ModelIndex, depth = 0): string | null {\n return null;\n }\n\n /**\n * Text for the row header\n * @param row Row to get the header for\n * @returns Text to put in the row header\n */\n textForRowHeader(row: ModelIndex): string {\n return '';\n }\n\n /**\n * Text for the row footer\n * @param row Row to get the footer for\n * @returns Text to put in the row footer\n */\n textForRowFooter(row: ModelIndex): string {\n return '';\n }\n\n /**\n * @param column Column to check\n * @returns True if the column is movable\n */\n isColumnMovable(column: ModelIndex, depth = 0): boolean {\n return true;\n }\n\n /**\n * @param row Row to check\n * @returns True if the row is movable\n */\n isRowMovable(row: ModelIndex): boolean {\n return true;\n }\n\n getColumnHeaderGroup(\n modelIndex: ModelIndex,\n depth: number\n ): IColumnHeaderGroup | undefined {\n return undefined;\n }\n\n getColumnHeaderParentGroup(\n modelIndex: ModelIndex,\n depth: number\n ): IColumnHeaderGroup | undefined {\n return undefined;\n }\n}\n\nexport default GridModel;\n"],"mappings":"AAAA,SAASA,WAAT,QAAmC,mBAAnC;;AAKA;;AACA;;AACA;AACA;AACA;AACA;AACA;AACA,MAAeC,SAAf,SAMUD,WANV,CAMwC;EACtC;;EAGA;;EAGA;EACuB,IAAnBE,mBAAmB,GAAW;IAChC,OAAO,CAAP;EACD;EAED;;;EAC0B,IAAtBC,sBAAsB,GAAW;IACnC,OAAO,CAAP;EACD;EAED;;;EAC2B,IAAvBC,uBAAuB,GAAW;IACpC,OAAO,CAAP;EACD;EAED;;;EAC4B,IAAxBC,wBAAwB,GAAW;IACrC,OAAO,CAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;AACA;;;EAC0B,IAApBC,oBAAoB,GAAW;IACjC,OAAO,CAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,qBAAqB,CACnBC,MADmB,EAEnBC,GAFmB,EAGC;IACpB,OAAOC,SAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EACEC,gBAAgB,CAACH,MAAD,EAAqBC,GAArB,EAAuD;IACrE,OAAO,MAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;AACA;;;EACEG,YAAY,CACVJ,MADU,EAEVC,GAFU,EAGVI,KAHU,EAIC;IACX,OAAOA,KAAK,CAACC,SAAb;EACD;EAED;AACF;AACA;AACA;AACA;AACA;AACA;;;EACEC,sBAAsB,CACpBP,MADoB,EAEpBC,GAFoB,EAGpBI,KAHoB,EAID;IACnB,OAAO,IAAP;EACD;EAED;AACF;AACA;AACA;AACA;AACA;;;EAME;AACF;AACA;AACA;AACA;EACEG,oBAAoB,CAACR,MAAD,EAA+C;IAAA,IAA1BS,KAA0B,uEAAlB,CAAkB;IACjE,OAAO,IAAP;EACD;EAED;AACF;AACA;AACA;AACA;;;EACEC,gBAAgB,CAACT,GAAD,EAA0B;IACxC,OAAO,EAAP;EACD;EAED;AACF;AACA;AACA;AACA;;;EACEU,gBAAgB,CAACV,GAAD,EAA0B;IACxC,OAAO,EAAP;EACD;EAED;AACF;AACA;AACA;;;EACEW,eAAe,CAACZ,MAAD,EAAyC;IAAA,IAApBS,KAAoB,uEAAZ,CAAY;IACtD,OAAO,IAAP;EACD;EAED;AACF;AACA;AACA;;;EACEI,YAAY,CAACZ,GAAD,EAA2B;IACrC,OAAO,IAAP;EACD;;EAEDa,oBAAoB,CAClBC,UADkB,EAElBN,KAFkB,EAGc;IAChC,OAAOP,SAAP;EACD;;EAEDc,0BAA0B,CACxBD,UADwB,EAExBN,KAFwB,EAGQ;IAChC,OAAOP,SAAP;EACD;;AAtKqC;;AAyKxC,eAAeT,SAAf"}
1
+ {"version":3,"file":"GridModel.js","names":["EventTarget","GridModel","floatingTopRowCount","floatingBottomRowCount","floatingLeftColumnCount","floatingRightColumnCount","columnHeaderMaxDepth","truncationCharForCell","column","row","undefined","textAlignForCell","colorForCell","theme","textColor","backgroundColorForCell","colorForColumnHeader","depth","textForRowHeader","textForRowFooter","isColumnMovable","isRowMovable","getColumnHeaderGroup","modelIndex","getColumnHeaderParentGroup"],"sources":["../src/GridModel.ts"],"sourcesContent":["import { EventTarget, Event } from 'event-target-shim';\nimport type { IColumnHeaderGroup } from './ColumnHeaderGroup';\nimport { ModelIndex } from './GridMetrics';\nimport { GridColor, GridTheme, NullableGridColor } from './GridTheme';\n\n/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n/**\n * Model for a Grid\n * All of these methods should return very quickly, as they will be called many times in the render cycle.\n * If data needs to be loaded asynchronously, return something immediately, then trigger an event for the table to refresh (Not yet implemented).\n */\nabstract class GridModel<\n TEventMap extends Record<string, Event<string>> = Record<\n string,\n Event<string>\n >,\n TMode extends 'standard' | 'strict' = 'standard'\n> extends EventTarget<TEventMap, TMode> {\n /** Count of rows in the grid */\n abstract get rowCount(): number;\n\n /** Count of columns in the grid */\n abstract get columnCount(): number;\n\n /** Count of rows that are frozen (or 'floating') at the top */\n get floatingTopRowCount(): number {\n return 0;\n }\n\n /** Count of rows that are frozen at the bottom */\n get floatingBottomRowCount(): number {\n return 0;\n }\n\n /** Count of columns that are frozen (or 'floating') at the left */\n get floatingLeftColumnCount(): number {\n return 0;\n }\n\n /** Count of columns that are frozen (or 'floating') at the right */\n get floatingRightColumnCount(): number {\n return 0;\n }\n\n /**\n * How many columns header levels are in the grid\n * Used for column grouping where columns at depth 0 are the base columns\n *\n * A grid with 1-level grouping would have a columnHeaderDepth of 2\n * and column headers at depths 0 and 1\n */\n get columnHeaderMaxDepth(): number {\n return 1;\n }\n\n /**\n * Get the text for the specified cell\n * @param column Column to get the text for\n * @param row Row to get the text for\n * @returns Text for the specified cell\n */\n abstract textForCell(column: ModelIndex, row: ModelIndex): string;\n\n /**\n * Get the character to replace text when truncated for a specific cell.\n * Leave undefined to show text truncated with ellipsis\n * @param column Column to get the truncation character for\n * @param row Row to get the truncation character for\n * @returns Truncation character for the specified cell\n */\n truncationCharForCell(\n column: ModelIndex,\n row: ModelIndex\n ): string | undefined {\n return undefined;\n }\n\n /**\n * Get the text alignment for the specified cell\n * @param column Column to get the alignment for\n * @param row Row to get the alignment for\n * @returns Text alignment for the specified cell\n */\n textAlignForCell(column: ModelIndex, row: ModelIndex): CanvasTextAlign {\n return 'left';\n }\n\n /**\n * Get the color for the text in the specified cell\n * @param column Column to get the color for\n * @param row Row to get the color for\n * @param theme Theme applied to the grid\n * @returns Color for the text in the cell\n */\n colorForCell(\n column: ModelIndex,\n row: ModelIndex,\n theme: GridTheme\n ): GridColor {\n return theme.textColor;\n }\n\n /**\n * Get the background color for the cell\n * @param column Column to get the background color for\n * @param row Row to get the background color for\n * @param theme Theme applied to the grid\n * @returns Background color for the cell\n */\n backgroundColorForCell(\n column: ModelIndex,\n row: ModelIndex,\n theme: GridTheme\n ): NullableGridColor {\n return null;\n }\n\n /**\n * Text for the column header\n * @param column Column to get the header for\n * @param depth Depth to get the header text for. 0 is base columns\n * @returns Text to put in the column header\n */\n abstract textForColumnHeader(\n column: ModelIndex,\n depth?: number\n ): string | undefined;\n\n /** Color for column header\n * @param column Column to get the color for\n * @param depth Header depth to get the color for\n * @returns Color for the header at the depth or null\n */\n colorForColumnHeader(column: ModelIndex, depth = 0): string | null {\n return null;\n }\n\n /**\n * Text for the row header\n * @param row Row to get the header for\n * @returns Text to put in the row header\n */\n textForRowHeader(row: ModelIndex): string {\n return '';\n }\n\n /**\n * Text for the row footer\n * @param row Row to get the footer for\n * @returns Text to put in the row footer\n */\n textForRowFooter(row: ModelIndex): string {\n return '';\n }\n\n /**\n * @param column Column to check\n * @returns True if the column is movable\n */\n isColumnMovable(column: ModelIndex, depth = 0): boolean {\n return true;\n }\n\n /**\n * @param row Row to check\n * @returns True if the row is movable\n */\n isRowMovable(row: ModelIndex): boolean {\n return true;\n }\n\n getColumnHeaderGroup(\n modelIndex: ModelIndex,\n depth: number\n ): IColumnHeaderGroup | undefined {\n return undefined;\n }\n\n getColumnHeaderParentGroup(\n modelIndex: ModelIndex,\n depth: number\n ): IColumnHeaderGroup | undefined {\n return undefined;\n }\n}\n\nexport default GridModel;\n"],"mappings":"AAAA,SAASA,WAAW,QAAe,mBAAmB;AAKtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAeC,SAAS,SAMdD,WAAW,CAAmB;EACtC;;EAGA;;EAGA;EACA,IAAIE,mBAAmB,GAAW;IAChC,OAAO,CAAC;EACV;;EAEA;EACA,IAAIC,sBAAsB,GAAW;IACnC,OAAO,CAAC;EACV;;EAEA;EACA,IAAIC,uBAAuB,GAAW;IACpC,OAAO,CAAC;EACV;;EAEA;EACA,IAAIC,wBAAwB,GAAW;IACrC,OAAO,CAAC;EACV;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIC,oBAAoB,GAAW;IACjC,OAAO,CAAC;EACV;;EAEA;AACF;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,qBAAqB,CACnBC,MAAkB,EAClBC,GAAe,EACK;IACpB,OAAOC,SAAS;EAClB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,gBAAgB,CAACH,MAAkB,EAAEC,GAAe,EAAmB;IACrE,OAAO,MAAM;EACf;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEG,YAAY,CACVJ,MAAkB,EAClBC,GAAe,EACfI,KAAgB,EACL;IACX,OAAOA,KAAK,CAACC,SAAS;EACxB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,sBAAsB,CACpBP,MAAkB,EAClBC,GAAe,EACfI,KAAgB,EACG;IACnB,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;;EAME;AACF;AACA;AACA;AACA;EACEG,oBAAoB,CAACR,MAAkB,EAA4B;IAAA,IAA1BS,KAAK,uEAAG,CAAC;IAChD,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;EACEC,gBAAgB,CAACT,GAAe,EAAU;IACxC,OAAO,EAAE;EACX;;EAEA;AACF;AACA;AACA;AACA;EACEU,gBAAgB,CAACV,GAAe,EAAU;IACxC,OAAO,EAAE;EACX;;EAEA;AACF;AACA;AACA;EACEW,eAAe,CAACZ,MAAkB,EAAsB;IAAA,IAApBS,KAAK,uEAAG,CAAC;IAC3C,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACEI,YAAY,CAACZ,GAAe,EAAW;IACrC,OAAO,IAAI;EACb;EAEAa,oBAAoB,CAClBC,UAAsB,EACtBN,KAAa,EACmB;IAChC,OAAOP,SAAS;EAClB;EAEAc,0BAA0B,CACxBD,UAAsB,EACtBN,KAAa,EACmB;IAChC,OAAOP,SAAS;EAClB;AACF;AAEA,eAAeT,SAAS"}
@@ -1,7 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
2
  /* eslint class-methods-use-this: "off" */
4
-
5
3
  /* eslint no-unused-vars: "off" */
6
4
 
7
5
  /**
@@ -18,51 +16,40 @@ export class GridMouseHandler {
18
16
  // Default to well below any of the GRID mouse handlers 100-1000+
19
17
  constructor() {
20
18
  var order = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5000;
21
-
22
19
  _defineProperty(this, "order", void 0);
23
-
24
20
  _defineProperty(this, "cursor", null);
25
-
26
21
  this.order = order;
27
- } // Cursor to use if this returns any truthy value including { stopPropagation: false, preventDefault: false }
22
+ }
28
23
 
24
+ // Cursor to use if this returns any truthy value including { stopPropagation: false, preventDefault: false }
29
25
 
30
26
  onDown(gridPoint, grid, event) {
31
27
  return false;
32
28
  }
33
-
34
29
  onMove(gridPoint, grid, event) {
35
30
  return false;
36
31
  }
37
-
38
32
  onDrag(gridPoint, grid, event) {
39
33
  return false;
40
34
  }
41
-
42
35
  onLeave(gridPoint, grid, event) {
43
36
  return false;
44
37
  }
45
-
46
38
  onClick(gridPoint, grid, event) {
47
39
  return false;
48
40
  }
49
-
50
41
  onContextMenu(gridPoint, grid, event) {
51
42
  return false;
52
43
  }
53
-
54
44
  onDoubleClick(gridPoint, grid, event) {
55
45
  return false;
56
46
  }
57
-
58
47
  onUp(gridPoint, grid, event) {
59
48
  return false;
60
49
  }
61
-
62
50
  onWheel(gridPoint, grid, event) {
63
51
  return false;
64
52
  }
65
-
66
53
  }
67
54
  export default GridMouseHandler;
68
55
  //# sourceMappingURL=GridMouseHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridMouseHandler.js","names":["GridMouseHandler","constructor","order","onDown","gridPoint","grid","event","onMove","onDrag","onLeave","onClick","onContextMenu","onDoubleClick","onUp","onWheel"],"sources":["../src/GridMouseHandler.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport { EventHandlerResult } from './EventHandlerResult';\nimport Grid from './Grid';\nimport { GridPoint } from './GridUtils';\n\n/**\n * Some events we listen to are a native mouse event, and others are wrapped with React's SyntheticEvent.\n * The GridMouseHandler shouldn't care though - the properties it accesses should be common on both types of events.\n */\nexport type GridMouseEvent = MouseEvent | React.MouseEvent;\n\nexport type GridWheelEvent = WheelEvent | React.WheelEvent;\n\nexport type GridMouseHandlerFunctionName =\n | 'onDown'\n | 'onMove'\n | 'onDrag'\n | 'onLeave'\n | 'onClick'\n | 'onContextMenu'\n | 'onDoubleClick'\n | 'onUp'\n | 'onWheel';\n\n/**\n * Define a region in the grid that interacts with the mouse on a grid.\n * Return true from any of the events to indicate they're consumed, and stopPropagation/preventDefault will be called.\n */\nexport class GridMouseHandler {\n order: number;\n\n // What order this mouse handler should trigger in. Smaller numbers trigger first\n // Default to well below any of the GRID mouse handlers 100-1000+\n constructor(order = 5000) {\n this.order = order;\n }\n\n // Cursor to use if this returns any truthy value including { stopPropagation: false, preventDefault: false }\n cursor: string | null = null;\n\n onDown(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onMove(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onDrag(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onLeave(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onClick(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onContextMenu(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onDoubleClick(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onUp(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onWheel(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n}\n\nexport default GridMouseHandler;\n"],"mappings":";;AAAA;;AACA;;AAKA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAN,CAAuB;EAG5B;EACA;EACAC,WAAW,GAAe;IAAA,IAAdC,KAAc,uEAAN,IAAM;;IAAA;;IAAA,gCAKF,IALE;;IACxB,KAAKA,KAAL,GAAaA,KAAb;EACD,CAP2B,CAS5B;;;EAGAC,MAAM,CACJC,SADI,EAEJC,IAFI,EAGJC,KAHI,EAIgB;IACpB,OAAO,KAAP;EACD;;EAEDC,MAAM,CACJH,SADI,EAEJC,IAFI,EAGJC,KAHI,EAIgB;IACpB,OAAO,KAAP;EACD;;EAEDE,MAAM,CACJJ,SADI,EAEJC,IAFI,EAGJC,KAHI,EAIgB;IACpB,OAAO,KAAP;EACD;;EAEDG,OAAO,CACLL,SADK,EAELC,IAFK,EAGLC,KAHK,EAIe;IACpB,OAAO,KAAP;EACD;;EAEDI,OAAO,CACLN,SADK,EAELC,IAFK,EAGLC,KAHK,EAIe;IACpB,OAAO,KAAP;EACD;;EAEDK,aAAa,CACXP,SADW,EAEXC,IAFW,EAGXC,KAHW,EAIS;IACpB,OAAO,KAAP;EACD;;EAEDM,aAAa,CACXR,SADW,EAEXC,IAFW,EAGXC,KAHW,EAIS;IACpB,OAAO,KAAP;EACD;;EAEDO,IAAI,CACFT,SADE,EAEFC,IAFE,EAGFC,KAHE,EAIkB;IACpB,OAAO,KAAP;EACD;;EAEDQ,OAAO,CACLV,SADK,EAELC,IAFK,EAGLC,KAHK,EAIe;IACpB,OAAO,KAAP;EACD;;AAlF2B;AAqF9B,eAAeN,gBAAf"}
1
+ {"version":3,"file":"GridMouseHandler.js","names":["GridMouseHandler","constructor","order","onDown","gridPoint","grid","event","onMove","onDrag","onLeave","onClick","onContextMenu","onDoubleClick","onUp","onWheel"],"sources":["../src/GridMouseHandler.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\nimport { EventHandlerResult } from './EventHandlerResult';\nimport Grid from './Grid';\nimport { GridPoint } from './GridUtils';\n\n/**\n * Some events we listen to are a native mouse event, and others are wrapped with React's SyntheticEvent.\n * The GridMouseHandler shouldn't care though - the properties it accesses should be common on both types of events.\n */\nexport type GridMouseEvent = MouseEvent | React.MouseEvent;\n\nexport type GridWheelEvent = WheelEvent | React.WheelEvent;\n\nexport type GridMouseHandlerFunctionName =\n | 'onDown'\n | 'onMove'\n | 'onDrag'\n | 'onLeave'\n | 'onClick'\n | 'onContextMenu'\n | 'onDoubleClick'\n | 'onUp'\n | 'onWheel';\n\n/**\n * Define a region in the grid that interacts with the mouse on a grid.\n * Return true from any of the events to indicate they're consumed, and stopPropagation/preventDefault will be called.\n */\nexport class GridMouseHandler {\n order: number;\n\n // What order this mouse handler should trigger in. Smaller numbers trigger first\n // Default to well below any of the GRID mouse handlers 100-1000+\n constructor(order = 5000) {\n this.order = order;\n }\n\n // Cursor to use if this returns any truthy value including { stopPropagation: false, preventDefault: false }\n cursor: string | null = null;\n\n onDown(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onMove(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onDrag(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onLeave(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onClick(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onContextMenu(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onDoubleClick(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onUp(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n\n onWheel(\n gridPoint: GridPoint,\n grid: Grid,\n event: GridMouseEvent\n ): EventHandlerResult {\n return false;\n }\n}\n\nexport default GridMouseHandler;\n"],"mappings":";AAAA;AACA;;AAKA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,CAAC;EAG5B;EACA;EACAC,WAAW,GAAe;IAAA,IAAdC,KAAK,uEAAG,IAAI;IAAA;IAAA,gCAKA,IAAI;IAJ1B,IAAI,CAACA,KAAK,GAAGA,KAAK;EACpB;;EAEA;;EAGAC,MAAM,CACJC,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;EAEAC,MAAM,CACJH,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;EAEAE,MAAM,CACJJ,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;EAEAG,OAAO,CACLL,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;EAEAI,OAAO,CACLN,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;EAEAK,aAAa,CACXP,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;EAEAM,aAAa,CACXR,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;EAEAO,IAAI,CACFT,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;EAEAQ,OAAO,CACLV,SAAoB,EACpBC,IAAU,EACVC,KAAqB,EACD;IACpB,OAAO,KAAK;EACd;AACF;AAEA,eAAeN,gBAAgB"}