@deephaven/iris-grid 0.13.3-treemap.2 → 0.14.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 (184) hide show
  1. package/dist/AdvancedFilterCreator.d.ts +69 -63
  2. package/dist/AdvancedFilterCreator.d.ts.map +1 -1
  3. package/dist/AdvancedFilterCreator.js +79 -73
  4. package/dist/AdvancedFilterCreator.js.map +1 -1
  5. package/dist/AdvancedFilterCreatorSelectValue.d.ts +45 -45
  6. package/dist/AdvancedFilterCreatorSelectValue.d.ts.map +1 -1
  7. package/dist/AdvancedFilterCreatorSelectValue.js +32 -36
  8. package/dist/AdvancedFilterCreatorSelectValue.js.map +1 -1
  9. package/dist/AdvancedFilterCreatorSelectValueList.d.ts +47 -52
  10. package/dist/AdvancedFilterCreatorSelectValueList.d.ts.map +1 -1
  11. package/dist/AdvancedFilterCreatorSelectValueList.js +24 -39
  12. package/dist/AdvancedFilterCreatorSelectValueList.js.map +1 -1
  13. package/dist/ColumnStatistics.d.ts +34 -22
  14. package/dist/ColumnStatistics.d.ts.map +1 -1
  15. package/dist/ColumnStatistics.js +8 -12
  16. package/dist/ColumnStatistics.js.map +1 -1
  17. package/dist/CommonTypes.d.ts +58 -0
  18. package/dist/CommonTypes.d.ts.map +1 -0
  19. package/dist/CommonTypes.js +2 -0
  20. package/dist/CommonTypes.js.map +1 -0
  21. package/dist/CrossColumnSearch.d.ts +26 -24
  22. package/dist/CrossColumnSearch.d.ts.map +1 -1
  23. package/dist/CrossColumnSearch.js +9 -13
  24. package/dist/CrossColumnSearch.js.map +1 -1
  25. package/dist/FilterInputField.d.ts +48 -51
  26. package/dist/FilterInputField.d.ts.map +1 -1
  27. package/dist/FilterInputField.js +30 -27
  28. package/dist/FilterInputField.js.map +1 -1
  29. package/dist/IrisGrid.d.ts +409 -453
  30. package/dist/IrisGrid.d.ts.map +1 -1
  31. package/dist/IrisGrid.js +514 -449
  32. package/dist/IrisGrid.js.map +1 -1
  33. package/dist/IrisGridCellOverflowModal.d.ts +1 -1
  34. package/dist/IrisGridCellOverflowModal.d.ts.map +1 -1
  35. package/dist/IrisGridCellOverflowModal.js.map +1 -1
  36. package/dist/IrisGridCopyHandler.d.ts +52 -46
  37. package/dist/IrisGridCopyHandler.d.ts.map +1 -1
  38. package/dist/IrisGridCopyHandler.js +22 -38
  39. package/dist/IrisGridCopyHandler.js.map +1 -1
  40. package/dist/IrisGridMetricCalculator.d.ts +5 -4
  41. package/dist/IrisGridMetricCalculator.d.ts.map +1 -1
  42. package/dist/IrisGridMetricCalculator.js +5 -1
  43. package/dist/IrisGridMetricCalculator.js.map +1 -1
  44. package/dist/IrisGridModel.d.ts +37 -35
  45. package/dist/IrisGridModel.d.ts.map +1 -1
  46. package/dist/IrisGridModel.js +19 -3
  47. package/dist/IrisGridModel.js.map +1 -1
  48. package/dist/IrisGridModelFactory.d.ts +7 -5
  49. package/dist/IrisGridModelFactory.d.ts.map +1 -1
  50. package/dist/IrisGridModelFactory.js +5 -5
  51. package/dist/IrisGridModelFactory.js.map +1 -1
  52. package/dist/IrisGridModelUpdater.d.ts +13 -11
  53. package/dist/IrisGridModelUpdater.d.ts.map +1 -1
  54. package/dist/IrisGridModelUpdater.js.map +1 -1
  55. package/dist/IrisGridPartitionSelector.d.ts +38 -39
  56. package/dist/IrisGridPartitionSelector.d.ts.map +1 -1
  57. package/dist/IrisGridPartitionSelector.js +18 -24
  58. package/dist/IrisGridPartitionSelector.js.map +1 -1
  59. package/dist/IrisGridProxyModel.d.ts +111 -32
  60. package/dist/IrisGridProxyModel.d.ts.map +1 -1
  61. package/dist/IrisGridProxyModel.js +212 -170
  62. package/dist/IrisGridProxyModel.js.map +1 -1
  63. package/dist/IrisGridRenderer.d.ts +59 -31
  64. package/dist/IrisGridRenderer.d.ts.map +1 -1
  65. package/dist/IrisGridRenderer.js +92 -46
  66. package/dist/IrisGridRenderer.js.map +1 -1
  67. package/dist/IrisGridTableModel.d.ts +48 -147
  68. package/dist/IrisGridTableModel.d.ts.map +1 -1
  69. package/dist/IrisGridTableModel.js +58 -1381
  70. package/dist/IrisGridTableModel.js.map +1 -1
  71. package/dist/IrisGridTableModelTemplate.d.ts +219 -0
  72. package/dist/IrisGridTableModelTemplate.d.ts.map +1 -0
  73. package/dist/IrisGridTableModelTemplate.js +1623 -0
  74. package/dist/IrisGridTableModelTemplate.js.map +1 -0
  75. package/dist/IrisGridTestUtils.d.ts +18 -14
  76. package/dist/IrisGridTestUtils.d.ts.map +1 -1
  77. package/dist/IrisGridTestUtils.js +29 -1
  78. package/dist/IrisGridTestUtils.js.map +1 -1
  79. package/dist/IrisGridTheme.d.ts +35 -3
  80. package/dist/IrisGridTheme.d.ts.map +1 -1
  81. package/dist/IrisGridTheme.js.map +1 -1
  82. package/dist/IrisGridTreeTableModel.d.ts +26 -7
  83. package/dist/IrisGridTreeTableModel.d.ts.map +1 -1
  84. package/dist/IrisGridTreeTableModel.js +24 -14
  85. package/dist/IrisGridTreeTableModel.js.map +1 -1
  86. package/dist/IrisGridUtils.d.ts +257 -162
  87. package/dist/IrisGridUtils.d.ts.map +1 -1
  88. package/dist/IrisGridUtils.js +132 -95
  89. package/dist/IrisGridUtils.js.map +1 -1
  90. package/dist/MissingKeyError.d.ts +5 -3
  91. package/dist/MissingKeyError.d.ts.map +1 -1
  92. package/dist/MissingKeyError.js.map +1 -1
  93. package/dist/PartitionSelectorSearch.d.ts +61 -40
  94. package/dist/PartitionSelectorSearch.d.ts.map +1 -1
  95. package/dist/PartitionSelectorSearch.js +25 -15
  96. package/dist/PartitionSelectorSearch.js.map +1 -1
  97. package/dist/PendingDataBottomBar.d.ts +3 -6
  98. package/dist/PendingDataBottomBar.d.ts.map +1 -1
  99. package/dist/PendingDataBottomBar.js.map +1 -1
  100. package/dist/TableViewportUpdater.d.ts +39 -55
  101. package/dist/TableViewportUpdater.d.ts.map +1 -1
  102. package/dist/TableViewportUpdater.js +42 -64
  103. package/dist/TableViewportUpdater.js.map +1 -1
  104. package/dist/TreeTableViewportUpdater.d.ts +29 -37
  105. package/dist/TreeTableViewportUpdater.d.ts.map +1 -1
  106. package/dist/TreeTableViewportUpdater.js +39 -50
  107. package/dist/TreeTableViewportUpdater.js.map +1 -1
  108. package/dist/index.d.ts +9 -0
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +9 -0
  111. package/dist/index.js.map +1 -1
  112. package/dist/mousehandlers/IrisGridCellOverflowMouseHandler.d.ts.map +1 -1
  113. package/dist/mousehandlers/IrisGridCellOverflowMouseHandler.js.map +1 -1
  114. package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.d.ts +1 -1
  115. package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.d.ts.map +1 -1
  116. package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js +2 -0
  117. package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js.map +1 -1
  118. package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js +1 -1
  119. package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js.map +1 -1
  120. package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts +41 -130
  121. package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts.map +1 -1
  122. package/dist/mousehandlers/IrisGridContextMenuHandler.js +426 -317
  123. package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +1 -1
  124. package/dist/mousehandlers/IrisGridFilterMouseHandler.d.ts.map +1 -1
  125. package/dist/mousehandlers/IrisGridFilterMouseHandler.js +2 -2
  126. package/dist/mousehandlers/IrisGridFilterMouseHandler.js.map +1 -1
  127. package/dist/mousehandlers/IrisGridSortMouseHandler.js +1 -1
  128. package/dist/mousehandlers/IrisGridSortMouseHandler.js.map +1 -1
  129. package/dist/mousehandlers/PendingMouseHandler.d.ts +8 -4
  130. package/dist/mousehandlers/PendingMouseHandler.d.ts.map +1 -1
  131. package/dist/mousehandlers/PendingMouseHandler.js +4 -5
  132. package/dist/mousehandlers/PendingMouseHandler.js.map +1 -1
  133. package/dist/sidebar/ChartBuilder.d.ts +48 -33
  134. package/dist/sidebar/ChartBuilder.d.ts.map +1 -1
  135. package/dist/sidebar/ChartBuilder.js +28 -27
  136. package/dist/sidebar/ChartBuilder.js.map +1 -1
  137. package/dist/sidebar/CustomColumnBuilder.d.ts +51 -41
  138. package/dist/sidebar/CustomColumnBuilder.d.ts.map +1 -1
  139. package/dist/sidebar/CustomColumnBuilder.js +22 -18
  140. package/dist/sidebar/CustomColumnBuilder.js.map +1 -1
  141. package/dist/sidebar/CustomColumnInput.d.ts +26 -36
  142. package/dist/sidebar/CustomColumnInput.d.ts.map +1 -1
  143. package/dist/sidebar/CustomColumnInput.js +11 -20
  144. package/dist/sidebar/CustomColumnInput.js.map +1 -1
  145. package/dist/sidebar/InputEditor.d.ts +34 -35
  146. package/dist/sidebar/InputEditor.d.ts.map +1 -1
  147. package/dist/sidebar/InputEditor.js +43 -24
  148. package/dist/sidebar/InputEditor.js.map +1 -1
  149. package/dist/sidebar/RollupRows.d.ts +67 -52
  150. package/dist/sidebar/RollupRows.d.ts.map +1 -1
  151. package/dist/sidebar/RollupRows.js +51 -53
  152. package/dist/sidebar/RollupRows.js.map +1 -1
  153. package/dist/sidebar/SelectDistinctBuilder.d.ts +27 -21
  154. package/dist/sidebar/SelectDistinctBuilder.d.ts.map +1 -1
  155. package/dist/sidebar/SelectDistinctBuilder.js +6 -10
  156. package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
  157. package/dist/sidebar/TableCsvExporter.d.ts +42 -39
  158. package/dist/sidebar/TableCsvExporter.d.ts.map +1 -1
  159. package/dist/sidebar/TableCsvExporter.js +12 -20
  160. package/dist/sidebar/TableCsvExporter.js.map +1 -1
  161. package/dist/sidebar/TableSaver.d.ts +59 -60
  162. package/dist/sidebar/TableSaver.d.ts.map +1 -1
  163. package/dist/sidebar/TableSaver.js +154 -68
  164. package/dist/sidebar/TableSaver.js.map +1 -1
  165. package/dist/sidebar/VisibilityOrderingBuilder.d.ts +56 -45
  166. package/dist/sidebar/VisibilityOrderingBuilder.d.ts.map +1 -1
  167. package/dist/sidebar/VisibilityOrderingBuilder.js +34 -29
  168. package/dist/sidebar/VisibilityOrderingBuilder.js.map +1 -1
  169. package/dist/sidebar/aggregations/Aggregations.d.ts.map +1 -1
  170. package/dist/sidebar/aggregations/Aggregations.js.map +1 -1
  171. package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.d.ts +2 -1
  172. package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.d.ts.map +1 -1
  173. package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js.map +1 -1
  174. package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts +6 -5
  175. package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts.map +1 -1
  176. package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js +5 -0
  177. package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js.map +1 -1
  178. package/dist/sidebar/icons/index.d.ts +7 -7
  179. package/dist/sidebar/icons/index.d.ts.map +1 -1
  180. package/dist/sidebar/icons/index.js.map +1 -1
  181. package/dist/sidebar/index.d.ts +12 -12
  182. package/dist/sidebar/index.d.ts.map +1 -1
  183. package/dist/sidebar/index.js.map +1 -1
  184. package/package.json +17 -16
@@ -10,10 +10,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
10
10
  import { dhFilterFilled, vsRemove, vsCheck, vsFilter } from '@deephaven/icons';
11
11
  import debounce from 'lodash.debounce';
12
12
  import { ContextActions, ContextActionUtils, GLOBAL_SHORTCUTS } from '@deephaven/components';
13
- import { GridMouseHandler } from '@deephaven/grid';
13
+ import { GridMouseHandler, isEditableGridModel } from '@deephaven/grid';
14
14
  import dh from '@deephaven/jsapi-shim';
15
15
  import { TableColumnFormatter, DateTimeColumnFormatter, TableUtils } from '@deephaven/jsapi-utils';
16
16
  import Log from '@deephaven/log';
17
+ import { assertNotNull } from '@deephaven/utils';
17
18
  import { DateTimeFormatContextMenu, DecimalFormatContextMenu, IntegerFormatContextMenu } from "../format-context-menus/index.js";
18
19
  import "./IrisGridContextMenuHandler.css";
19
20
  import SHORTCUTS from "../IrisGridShortcuts.js";
@@ -29,9 +30,9 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
29
30
  * Get filter condition for quick filter with existed column filter and the new filter to be applied,
30
31
  * returns new filter if filters are not additive.
31
32
  * if filters are additive, returns filter conditions combined with 'and'.
32
- * @param {FilterCondition} columnFilter
33
- * @param {FilterCondition} newColumnFilter
34
- * @param {boolean} additive
33
+ * @param columnFilter
34
+ * @param newColumnFilter
35
+ * @param additive
35
36
  */
36
37
  static getQuickFilterCondition(columnFilter, newColumnFilter) {
37
38
  var additive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
@@ -44,9 +45,9 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
44
45
  }
45
46
  /**
46
47
  * combines filter text with '&&' if filters are additive
47
- * @param {String} filterText
48
- * @param {String} newFilterText
49
- * @param {boolean} additive
48
+ * @param filterText
49
+ * @param newFilterText
50
+ * @param additive
50
51
  */
51
52
 
52
53
 
@@ -56,8 +57,8 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
56
57
  }
57
58
  /**
58
59
  * Gets an equality filter for the provided numeric value
59
- * @param {dh.Column} column The column to make the filter for
60
- * @param {Number} value The value to get the equality filter for
60
+ * @param column The column to make the filter for
61
+ * @param value The value to get the equality filter for
61
62
  */
62
63
 
63
64
 
@@ -86,6 +87,11 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
86
87
 
87
88
  constructor(irisGrid) {
88
89
  super();
90
+
91
+ _defineProperty(this, "irisGrid", void 0);
92
+
93
+ _defineProperty(this, "debouncedUpdateCustomFormat", void 0);
94
+
89
95
  this.debouncedUpdateCustomFormat = debounce(irisGrid.handleFormatSelection, DEBOUNCE_UPDATE_FORMAT);
90
96
  this.irisGrid = irisGrid;
91
97
  }
@@ -94,350 +100,418 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
94
100
  this.debouncedUpdateCustomFormat.flush();
95
101
  }
96
102
 
97
- onContextMenu(gridPoint, grid, event) {
103
+ getHeaderActions(modelColumn, gridPoint) {
98
104
  var {
99
105
  irisGrid
100
106
  } = this;
101
107
  var {
102
- y,
103
- column: columnIndex,
104
- row: rowIndex
108
+ column: columnIndex
105
109
  } = gridPoint;
106
- var modelColumn = irisGrid.getModelColumn(columnIndex);
107
- var modelRow = irisGrid.getModelRow(rowIndex);
110
+ assertNotNull(columnIndex);
108
111
  var {
109
- model,
110
- canCopy
112
+ model
111
113
  } = irisGrid.props;
112
114
  var {
113
115
  columns
114
116
  } = model;
115
- var value = model.valueForCell(modelColumn, modelRow);
116
- var valueText = model.textForCell(modelColumn, modelRow);
117
117
  var column = columns[modelColumn];
118
118
  var actions = [];
119
119
  var {
120
120
  metrics,
121
- isFilterBarShown,
122
121
  reverseType,
123
122
  quickFilters,
124
123
  advancedFilters,
125
124
  searchFilter
126
125
  } = irisGrid.state;
127
126
  var theme = irisGrid.getTheme();
128
- var {
129
- columnHeaderHeight,
130
- gridY
131
- } = metrics;
127
+ assertNotNull(metrics);
132
128
  var {
133
129
  filterIconColor,
134
130
  filterBarActiveColor,
135
131
  contextMenuSortIconColor,
136
132
  contextMenuReverseIconColor
137
133
  } = theme;
138
- var {
139
- onContextMenu,
140
- settings
141
- } = irisGrid.props;
142
134
  var modelSort = model.sort;
143
135
  var columnSort = TableUtils.getSortForColumn(modelSort, modelColumn);
144
136
  var hasReverse = reverseType !== TableUtils.REVERSE_TYPE.NONE;
145
- var dateFilterFormatter = new DateTimeColumnFormatter({
146
- timeZone: settings.timeZone,
147
- showTimeZone: false,
148
- showTSeparator: true,
149
- defaultDateTimeFormatString: CONTEXT_MENU_DATE_FORMAT
137
+ var {
138
+ userColumnWidths
139
+ } = metrics;
140
+ var isColumnHidden = [...userColumnWidths.values()].some(columnWidth => columnWidth === 0);
141
+ var isColumnFrozen = model.isColumnFrozen(columnIndex);
142
+ actions.push({
143
+ title: 'Hide Column',
144
+ group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
145
+ action: () => {
146
+ this.irisGrid.hideColumnByVisibleIndex(columnIndex);
147
+ }
150
148
  });
151
- var previewFilterFormatter = new DateTimeColumnFormatter({
152
- timeZone: settings.timeZone,
153
- showTimeZone: settings.showTimeZone,
154
- showTSeparator: settings.showTSeparator,
155
- defaultDateTimeFormatString: CONTEXT_MENU_DATE_FORMAT
149
+ actions.push({
150
+ title: isColumnFrozen ? 'Unfreeze Column' : 'Freeze Column',
151
+ group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
152
+ action: () => {
153
+ if (isColumnFrozen) {
154
+ this.irisGrid.unFreezeColumnByColumnName(column.name);
155
+ } else {
156
+ this.irisGrid.freezeColumnByColumnName(column.name);
157
+ }
158
+ },
159
+ order: 10
160
+ });
161
+ actions.push({
162
+ title: 'Show All Columns',
163
+ group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
164
+ action: () => {
165
+ this.irisGrid.showAllColumns();
166
+ },
167
+ disabled: !isColumnHidden
168
+ });
169
+ actions.push({
170
+ title: 'Quick Filters',
171
+ icon: vsRemove,
172
+ iconColor: filterBarActiveColor,
173
+ shortcut: SHORTCUTS.TABLE.TOGGLE_QUICK_FILTER,
174
+ group: IrisGridContextMenuHandler.GROUP_FILTER,
175
+ order: 10,
176
+ action: () => {
177
+ this.irisGrid.toggleFilterBar(columnIndex);
178
+ }
179
+ });
180
+ actions.push({
181
+ title: 'Advanced Filters',
182
+ icon: advancedFilters.get(modelColumn) ? dhFilterFilled : vsFilter,
183
+ iconColor: filterIconColor,
184
+ group: IrisGridContextMenuHandler.GROUP_FILTER,
185
+ order: 20,
186
+ action: () => {
187
+ this.irisGrid.handleAdvancedMenuOpened(columnIndex);
188
+ }
189
+ });
190
+ actions.push({
191
+ title: 'Clear Table Filters',
192
+ group: IrisGridContextMenuHandler.GROUP_FILTER,
193
+ order: 40,
194
+ // this just displays the shortcut, the actual listener is in irisgrid handleKeyDown
195
+ shortcut: SHORTCUTS.TABLE.CLEAR_FILTERS,
196
+ action: () => {
197
+ this.irisGrid.clearAllFilters();
198
+ },
199
+ disabled: !(quickFilters.size > 0 || advancedFilters.size > 0 || searchFilter !== null)
200
+ });
201
+ actions.push({
202
+ title: 'Sort by',
203
+ icon: vsRemove,
204
+ iconColor: contextMenuSortIconColor,
205
+ group: IrisGridContextMenuHandler.GROUP_SORT,
206
+ order: 10,
207
+ actions: this.sortByActions(column, modelColumn, columnSort)
208
+ });
209
+ actions.push({
210
+ title: 'Add Additional Sort',
211
+
212
+ /**
213
+ * disable conditions:
214
+ * 1. table is sorted only by this column
215
+ * 2. table is only reversed
216
+ * 3. 1 & 2 combined
217
+ * 4. table has no sort
218
+ * reverse is a type of sort, so needs to be accounted for in exclusions
219
+ * */
220
+ disabled: columnSort && modelSort.length === 1 || hasReverse && modelSort.length === 1 || columnSort && hasReverse && modelSort.length === 2 || modelSort.length === 0,
221
+ group: IrisGridContextMenuHandler.GROUP_SORT,
222
+ order: 20,
223
+ actions: this.additionalSortActions(column, modelColumn)
224
+ });
225
+ actions.push({
226
+ title: 'Clear Table Sorting',
227
+ disabled: // reverse is a type of sort, but special and needs to be exluded despite being part of model.sort
228
+ modelSort.length === 0 || hasReverse && modelSort.length === 1,
229
+ group: IrisGridContextMenuHandler.GROUP_SORT,
230
+ action: () => {
231
+ this.irisGrid.sortColumn(columnIndex, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.none);
232
+ },
233
+ order: 30
234
+ });
235
+ actions.push({
236
+ title: reverseType === TableUtils.REVERSE_TYPE.NONE ? 'Reverse Table' : 'Clear Reverse Table',
237
+ icon: vsRemove,
238
+ iconColor: contextMenuReverseIconColor,
239
+ group: IrisGridContextMenuHandler.GROUP_SORT,
240
+ order: 40,
241
+ disabled: !model.isReversible,
242
+ // this just displays the shortcut, the actual listener is in irisgrid handleKeyDown
243
+ shortcut: SHORTCUTS.TABLE.REVERSE,
244
+ action: () => {
245
+ if (reverseType === TableUtils.REVERSE_TYPE.NONE) {
246
+ this.irisGrid.reverse(TableUtils.REVERSE_TYPE.POST_SORT);
247
+ } else {
248
+ this.irisGrid.reverse(TableUtils.REVERSE_TYPE.NONE);
249
+ }
250
+ }
251
+ });
252
+ actions.push({
253
+ title: 'Copy Column Name',
254
+ group: IrisGridContextMenuHandler.GROUP_COPY,
255
+ action: () => {
256
+ ContextActionUtils.copyToClipboard(model.textForColumnHeader(modelColumn)).catch(e => log.error('Unable to copy header', e));
257
+ }
156
258
  });
157
259
 
158
- if (column != null) {
159
- var {
160
- table
161
- } = model;
162
- actions.push(onContextMenu({
163
- table,
164
- model,
165
- value,
166
- valueText,
167
- column,
168
- rowIndex,
169
- columnIndex,
170
- modelRow,
171
- modelColumn
172
- }));
173
- }
260
+ if (TableUtils.isDateType(column.type)) {
261
+ actions.push({
262
+ title: 'Date/Time Format',
263
+ group: IrisGridContextMenuHandler.GROUP_FORMAT,
264
+ actions: this.dateFormatActions(column)
265
+ });
266
+ } else if (TableUtils.isNumberType(column.type)) {
267
+ var _this$numberFormatAct;
174
268
 
175
- if (column != null && model.isFilterable(modelColumn)) {
176
269
  actions.push({
177
- title: 'Clear Column Filter',
178
- group: IrisGridContextMenuHandler.GROUP_FILTER,
179
- order: 30,
180
- action: () => {
181
- this.irisGrid.removeColumnFilter(modelColumn);
182
- },
183
- disabled: !(quickFilters.has(modelColumn) || advancedFilters.has(modelColumn))
270
+ title: 'Number Format',
271
+ group: IrisGridContextMenuHandler.GROUP_FORMAT,
272
+ actions: (_this$numberFormatAct = this.numberFormatActions(column)) !== null && _this$numberFormatAct !== void 0 ? _this$numberFormatAct : undefined
184
273
  });
185
274
  }
186
275
 
187
- if (isFilterBarShown ? y <= gridY : y <= columnHeaderHeight) {
188
- // grid header context menu options
189
- if (column != null) {
190
- var {
191
- userColumnWidths
192
- } = metrics;
193
- var isColumnHidden = [...userColumnWidths.values()].some(columnWidth => columnWidth === 0);
194
- var isColumnFrozen = model.isColumnFrozen(modelColumn);
195
- actions.push({
196
- title: 'Hide Column',
197
- group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
198
- action: () => {
199
- this.irisGrid.hideColumnByVisibleIndex(columnIndex);
200
- }
201
- });
202
- actions.push({
203
- title: isColumnFrozen ? 'Unfreeze Column' : 'Freeze Column',
204
- group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
205
- action: () => {
206
- if (isColumnFrozen) {
207
- this.irisGrid.unFreezeColumnByColumnName(column.name);
208
- } else {
209
- this.irisGrid.freezeColumnByColumnName(column.name);
210
- }
211
- },
212
- order: 10,
213
- disabled: !model.isColumnMovable(modelColumn) && !isColumnFrozen
214
- });
215
- actions.push({
216
- title: 'Show All Columns',
217
- group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
218
- action: () => {
219
- this.irisGrid.showAllColumns();
220
- },
221
- disabled: !isColumnHidden
222
- });
223
- actions.push({
224
- title: 'Quick Filters',
276
+ return actions;
277
+ }
278
+
279
+ getCellActions(modelColumn, grid, gridPoint) {
280
+ assertNotNull(modelColumn);
281
+ var {
282
+ irisGrid
283
+ } = this;
284
+ var {
285
+ column: columnIndex,
286
+ row: rowIndex
287
+ } = gridPoint;
288
+ var {
289
+ model,
290
+ canCopy
291
+ } = irisGrid.props;
292
+ var {
293
+ columns
294
+ } = model;
295
+ var modelRow = irisGrid.getModelRow(rowIndex);
296
+ assertNotNull(modelRow);
297
+ var value = model.valueForCell(modelColumn, modelRow);
298
+ var valueText = model.textForCell(modelColumn, modelRow);
299
+ var column = columns[modelColumn];
300
+ var actions = [];
301
+ var {
302
+ quickFilters
303
+ } = irisGrid.state;
304
+ var theme = irisGrid.getTheme();
305
+ var {
306
+ filterIconColor
307
+ } = theme;
308
+ var {
309
+ settings
310
+ } = irisGrid.props;
311
+ var dateFilterFormatter = new DateTimeColumnFormatter({
312
+ timeZone: settings === null || settings === void 0 ? void 0 : settings.timeZone,
313
+ showTimeZone: false,
314
+ showTSeparator: true,
315
+ defaultDateTimeFormatString: CONTEXT_MENU_DATE_FORMAT
316
+ });
317
+ var previewFilterFormatter = new DateTimeColumnFormatter({
318
+ timeZone: settings === null || settings === void 0 ? void 0 : settings.timeZone,
319
+ showTimeZone: settings === null || settings === void 0 ? void 0 : settings.showTimeZone,
320
+ showTSeparator: settings === null || settings === void 0 ? void 0 : settings.showTSeparator,
321
+ defaultDateTimeFormatString: CONTEXT_MENU_DATE_FORMAT
322
+ }); // grid data area context menu options
323
+
324
+ if (column != null && rowIndex != null) {
325
+ if (model.isFilterable(modelColumn)) {
326
+ // cell data area contextmenu options
327
+ var filterMenu = {
328
+ title: 'Filter By Value',
225
329
  icon: vsRemove,
226
- iconColor: filterBarActiveColor,
227
- shortcut: SHORTCUTS.TABLE.TOGGLE_QUICK_FILTER,
330
+ iconColor: filterIconColor,
228
331
  group: IrisGridContextMenuHandler.GROUP_FILTER,
229
332
  order: 10,
230
- action: () => {
231
- this.irisGrid.toggleFilterBar(columnIndex);
232
- }
233
- });
234
- actions.push({
235
- title: 'Advanced Filters',
236
- icon: advancedFilters.get(modelColumn) ? dhFilterFilled : vsFilter,
333
+ actions: []
334
+ };
335
+ var andFilterMenu = {
336
+ title: 'Add Filter By Value',
337
+ icon: vsRemove,
237
338
  iconColor: filterIconColor,
238
339
  group: IrisGridContextMenuHandler.GROUP_FILTER,
239
340
  order: 20,
240
- action: () => {
241
- this.irisGrid.handleAdvancedMenuOpened(columnIndex);
341
+ actions: [],
342
+ disabled: !quickFilters.get(modelColumn)
343
+ };
344
+
345
+ if (value != null) {
346
+ // Chars get treated like numbers in terms of which filters are available
347
+ if (TableUtils.isNumberType(column.type) || TableUtils.isCharType(column.type)) {
348
+ assertNotNull(modelColumn); // We want to show the full unformatted value if it's a number, so user knows which value they are matching
349
+ // If it's a Char we just show the char
350
+
351
+ var numberValueText = TableUtils.isCharType(column.type) ? String.fromCharCode(value) : "".concat(value);
352
+ filterMenu.actions = this.numberFilterActions(column, numberValueText, value, quickFilters.get(modelColumn));
353
+ andFilterMenu.actions = this.numberFilterActions(column, numberValueText, value, quickFilters.get(modelColumn), true);
354
+ } else if (TableUtils.isBooleanType(column.type)) {
355
+ filterMenu.actions = this.booleanFilterActions(column, valueText);
356
+ andFilterMenu.actions = this.booleanFilterActions(column, valueText, quickFilters.get(modelColumn), true);
357
+ } else if (TableUtils.isDateType(column.type)) {
358
+ var dateValueText = dateFilterFormatter.format(value);
359
+ var previewValue = previewFilterFormatter.format(value);
360
+ filterMenu.actions = this.dateFilterActions(column, dateValueText, previewValue, value);
361
+ andFilterMenu.actions = this.dateFilterActions(column, dateValueText, previewValue, value, quickFilters.get(modelColumn), true);
362
+ } else {
363
+ filterMenu.actions = this.stringFilterActions(column, valueText, value);
364
+ andFilterMenu.actions = this.stringFilterActions(column, valueText, value, quickFilters.get(modelColumn), true);
242
365
  }
243
- });
244
- actions.push({
245
- title: 'Clear Table Filters',
246
- group: IrisGridContextMenuHandler.GROUP_FILTER,
247
- order: 40,
248
- // this just displays the shortcut, the actual listener is in irisgrid handleKeyDown
249
- shortcut: SHORTCUTS.TABLE.CLEAR_FILTERS,
250
- action: () => {
251
- this.irisGrid.clearAllFilters();
252
- },
253
- disabled: !(quickFilters.size > 0 || advancedFilters.size > 0 || searchFilter !== null)
254
- });
366
+ } else {
367
+ filterMenu.actions = this.nullFilterActions(column);
368
+ andFilterMenu.actions = this.nullFilterActions(column, quickFilters.get(modelColumn), true);
369
+ }
370
+
371
+ if (filterMenu.actions != null && filterMenu.actions.length > 0) {
372
+ actions.push(filterMenu);
373
+ }
374
+
375
+ if (andFilterMenu.actions != null && andFilterMenu.actions.length > 0) {
376
+ actions.push(andFilterMenu);
377
+ }
378
+ }
379
+
380
+ if (canCopy) {
255
381
  actions.push({
256
- title: 'Sort by',
257
- icon: vsRemove,
258
- iconColor: contextMenuSortIconColor,
259
- group: IrisGridContextMenuHandler.GROUP_SORT,
382
+ title: 'Copy Cell',
383
+ group: IrisGridContextMenuHandler.GROUP_COPY,
260
384
  order: 10,
261
- actions: this.sortByActions(column, modelColumn, columnSort)
385
+ action: () => {
386
+ irisGrid.copyCell(columnIndex, rowIndex);
387
+ }
262
388
  });
263
389
  actions.push({
264
- title: 'Add Additional Sort',
265
-
266
- /**
267
- * disable conditions:
268
- * 1. table is sorted only by this column
269
- * 2. table is only reversed
270
- * 3. 1 & 2 combined
271
- * 4. table has no sort
272
- * reverse is a type of sort, so needs to be accounted for in exclusions
273
- * */
274
- disabled: columnSort && modelSort.length === 1 || hasReverse && modelSort.length === 1 || columnSort && hasReverse && modelSort.length === 2 || modelSort.length === 0,
275
- group: IrisGridContextMenuHandler.GROUP_SORT,
390
+ title: 'Copy Cell Unformatted',
391
+ group: IrisGridContextMenuHandler.GROUP_COPY,
276
392
  order: 20,
277
- actions: this.additionalSortActions(column, modelColumn)
393
+ action: () => {
394
+ irisGrid.copyCell(columnIndex, rowIndex, true);
395
+ }
278
396
  });
397
+ }
398
+ } // data area, including blank space context menu options
399
+
400
+
401
+ var {
402
+ selectedRanges
403
+ } = grid.state;
404
+
405
+ if (selectedRanges.length > 0) {
406
+ if (canCopy) {
279
407
  actions.push({
280
- title: 'Clear Table Sorting',
281
- disabled: // reverse is a type of sort, but special and needs to be exluded despite being part of model.sort
282
- modelSort.length === 0 || hasReverse && modelSort.length === 1,
283
- group: IrisGridContextMenuHandler.GROUP_SORT,
408
+ title: 'Copy Selection',
409
+ shortcut: GLOBAL_SHORTCUTS.COPY,
410
+ group: IrisGridContextMenuHandler.GROUP_COPY,
411
+ order: 30,
284
412
  action: () => {
285
- this.irisGrid.sortColumn(columnIndex, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.none);
286
- },
287
- order: 30
413
+ irisGrid.copyRanges(selectedRanges);
414
+ }
288
415
  });
289
416
  actions.push({
290
- title: reverseType === TableUtils.REVERSE_TYPE.NONE ? 'Reverse Table' : 'Clear Reverse Table',
291
- icon: vsRemove,
292
- iconColor: contextMenuReverseIconColor,
293
- group: IrisGridContextMenuHandler.GROUP_SORT,
417
+ title: 'Copy Selection w/ Headers',
418
+ group: IrisGridContextMenuHandler.GROUP_COPY,
294
419
  order: 40,
295
- disabled: !model.isReversible,
296
- // this just displays the shortcut, the actual listener is in irisgrid handleKeyDown
297
- shortcut: SHORTCUTS.TABLE.REVERSE,
298
420
  action: () => {
299
- if (reverseType === TableUtils.REVERSE_TYPE.NONE) {
300
- this.irisGrid.reverse(TableUtils.REVERSE_TYPE.POST_SORT);
301
- } else {
302
- this.irisGrid.reverse(TableUtils.REVERSE_TYPE.NONE);
303
- }
421
+ irisGrid.copyRanges(selectedRanges, true);
304
422
  }
305
423
  });
424
+ }
425
+
426
+ if (isEditableGridModel(model) && model.isEditable) {
306
427
  actions.push({
307
- title: 'Copy Column Name',
308
- group: IrisGridContextMenuHandler.GROUP_COPY,
428
+ title: 'Delete Selected Rows',
429
+ group: IrisGridContextMenuHandler.GROUP_EDIT,
430
+ order: 50,
309
431
  action: () => {
310
- ContextActionUtils.copyToClipboard(model.textForColumnHeader(modelColumn)).catch(e => log.error('Unable to copy header', e));
432
+ this.irisGrid.deleteRanges(selectedRanges);
311
433
  }
312
434
  });
313
-
314
- if (TableUtils.isDateType(column.type)) {
315
- actions.push({
316
- title: 'Date/Time Format',
317
- group: IrisGridContextMenuHandler.GROUP_FORMAT,
318
- actions: this.dateFormatActions(column)
319
- });
320
- } else if (TableUtils.isNumberType(column.type)) {
321
- actions.push({
322
- title: 'Number Format',
323
- group: IrisGridContextMenuHandler.GROUP_FORMAT,
324
- actions: this.numberFormatActions(column)
325
- });
326
- }
327
435
  }
328
- } else {
329
- // grid data area context menu options
330
- if (column != null && rowIndex != null) {
331
- if (model.isFilterable(modelColumn)) {
332
- // cell data area contextmenu options
333
- var filterMenu = {
334
- title: 'Filter By Value',
335
- icon: vsRemove,
336
- iconColor: filterIconColor,
337
- group: IrisGridContextMenuHandler.GROUP_FILTER,
338
- order: 10,
339
- actions: null
340
- };
341
- var andFilterMenu = {
342
- title: 'Add Filter By Value',
343
- icon: vsRemove,
344
- iconColor: filterIconColor,
345
- group: IrisGridContextMenuHandler.GROUP_FILTER,
346
- order: 20,
347
- actions: null,
348
- disabled: !quickFilters.get(modelColumn)
349
- };
350
-
351
- if (value != null) {
352
- // Chars get treated like numbers in terms of which filters are available
353
- if (TableUtils.isNumberType(column.type) || TableUtils.isCharType(column.type)) {
354
- // We want to show the full unformatted value if it's a number, so user knows which value they are matching
355
- // If it's a Char we just show the char
356
- var numberValueText = TableUtils.isCharType(column.type) ? String.fromCharCode(value) : "".concat(value);
357
- filterMenu.actions = this.numberFilterActions(column, numberValueText, value);
358
- andFilterMenu.actions = this.numberFilterActions(column, numberValueText, value, quickFilters.get(modelColumn), true);
359
- } else if (TableUtils.isBooleanType(column.type)) {
360
- filterMenu.actions = this.booleanFilterActions(column, valueText);
361
- andFilterMenu.actions = this.booleanFilterActions(column, valueText, quickFilters.get(modelColumn), true);
362
- } else if (TableUtils.isDateType(column.type)) {
363
- var dateValueText = dateFilterFormatter.format(value);
364
- var previewValue = previewFilterFormatter.format(value);
365
- filterMenu.actions = this.dateFilterActions(column, dateValueText, previewValue, value);
366
- andFilterMenu.actions = this.dateFilterActions(column, dateValueText, previewValue, value, quickFilters.get(modelColumn), true);
367
- } else {
368
- filterMenu.actions = this.stringFilterActions(column, valueText, value);
369
- andFilterMenu.actions = this.stringFilterActions(column, valueText, value, quickFilters.get(modelColumn), true);
370
- }
371
- } else {
372
- filterMenu.actions = this.nullFilterActions(column);
373
- andFilterMenu.actions = this.nullFilterActions(column, quickFilters.get(modelColumn), true);
374
- }
436
+ }
375
437
 
376
- if (filterMenu.actions != null && filterMenu.actions.length > 0) {
377
- actions.push(filterMenu);
378
- }
438
+ return actions;
439
+ }
379
440
 
380
- if (andFilterMenu.actions != null && andFilterMenu.actions.length > 0) {
381
- actions.push(andFilterMenu);
382
- }
383
- }
441
+ onContextMenu(gridPoint, grid, event) {
442
+ var {
443
+ irisGrid
444
+ } = this;
445
+ var {
446
+ y,
447
+ column: columnIndex,
448
+ row: rowIndex
449
+ } = gridPoint;
450
+ var modelColumn = irisGrid.getModelColumn(columnIndex);
451
+ var modelRow = irisGrid.getModelRow(rowIndex);
452
+ var {
453
+ model
454
+ } = irisGrid.props;
455
+ var {
456
+ columns
457
+ } = model;
458
+ var {
459
+ metrics,
460
+ isFilterBarShown,
461
+ quickFilters,
462
+ advancedFilters
463
+ } = irisGrid.state;
464
+ assertNotNull(metrics);
465
+ var {
466
+ columnHeaderHeight,
467
+ gridY
468
+ } = metrics;
469
+ var actions = [];
384
470
 
385
- if (canCopy) {
386
- actions.push({
387
- title: 'Copy Cell',
388
- group: IrisGridContextMenuHandler.GROUP_COPY,
389
- order: 10,
390
- action: () => {
391
- irisGrid.copyCell(columnIndex, rowIndex);
392
- }
393
- });
394
- actions.push({
395
- title: 'Copy Cell Unformatted',
396
- group: IrisGridContextMenuHandler.GROUP_COPY,
397
- order: 20,
398
- action: () => {
399
- irisGrid.copyCell(columnIndex, rowIndex, true);
400
- }
401
- });
402
- }
403
- } // data area, including blank space context menu options
471
+ if (modelColumn != null && modelRow != null) {
472
+ var value = model.valueForCell(modelColumn, modelRow);
473
+ var valueText = model.textForCell(modelColumn, modelRow);
474
+ var column = columns[modelColumn];
475
+ var {
476
+ onContextMenu
477
+ } = irisGrid.props;
404
478
 
479
+ if (column != null) {
480
+ actions.push(onContextMenu({
481
+ model,
482
+ value,
483
+ valueText,
484
+ column,
485
+ rowIndex,
486
+ columnIndex,
487
+ modelRow,
488
+ modelColumn
489
+ }));
490
+ }
405
491
 
406
- var {
407
- selectedRanges
408
- } = grid.state;
409
-
410
- if (selectedRanges.length > 0) {
411
- if (canCopy) {
412
- actions.push({
413
- title: 'Copy Selection',
414
- shortcut: GLOBAL_SHORTCUTS.COPY,
415
- group: IrisGridContextMenuHandler.GROUP_COPY,
416
- order: 30,
417
- action: () => {
418
- irisGrid.copyRanges(selectedRanges);
419
- }
420
- });
421
- actions.push({
422
- title: 'Copy Selection w/ Headers',
423
- group: IrisGridContextMenuHandler.GROUP_COPY,
424
- order: 40,
425
- action: () => {
426
- irisGrid.copyRanges(selectedRanges, true);
427
- }
428
- });
429
- }
492
+ if (modelColumn != null && column != null && model.isFilterable(modelColumn)) {
493
+ actions.push({
494
+ title: 'Clear Column Filter',
495
+ group: IrisGridContextMenuHandler.GROUP_FILTER,
496
+ order: 30,
497
+ action: () => {
498
+ this.irisGrid.removeColumnFilter(modelColumn);
499
+ },
500
+ disabled: !(quickFilters.has(modelColumn) || advancedFilters.has(modelColumn))
501
+ });
502
+ }
503
+ }
430
504
 
431
- if (model.isEditable) {
432
- actions.push({
433
- title: 'Delete Selected Rows',
434
- group: IrisGridContextMenuHandler.GROUP_EDIT,
435
- order: 50,
436
- action: () => {
437
- this.irisGrid.deleteRanges(selectedRanges);
438
- }
439
- });
505
+ if (modelColumn != null) {
506
+ var _column = columns[modelColumn];
507
+
508
+ if (isFilterBarShown ? y <= gridY : y <= columnHeaderHeight) {
509
+ // grid header context menu options
510
+ if (_column != null) {
511
+ actions.push(...this.getHeaderActions(modelColumn, gridPoint));
440
512
  }
513
+ } else {
514
+ actions.push(...this.getCellActions(modelColumn, grid, gridPoint));
441
515
  }
442
516
  }
443
517
 
@@ -445,6 +519,7 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
445
519
  return false;
446
520
  }
447
521
 
522
+ assertNotNull(irisGrid.gridWrapper);
448
523
  ContextActions.triggerMenu(irisGrid.gridWrapper, event.pageX, event.pageY, actions);
449
524
  return true;
450
525
  }
@@ -459,6 +534,7 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
459
534
  formatter
460
535
  } = model;
461
536
  var selectedFormat = formatter.getColumnFormat(column.type, column.name);
537
+ assertNotNull(selectedFormat);
462
538
  var formatOptions = DateTimeFormatContextMenu.getOptions(formatter, selectedFormat);
463
539
  var actions = [];
464
540
 
@@ -473,11 +549,14 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
473
549
  actions.push({
474
550
  title,
475
551
  description,
476
- icon: isSelected ? vsCheck : null,
552
+ icon: isSelected ? vsCheck : undefined,
477
553
  group,
478
554
  order: i,
479
555
  action: () => {
480
- _this.irisGrid.handleFormatSelection(model.getColumnIndexByName(column.name), format);
556
+ var modelIndex = model.getColumnIndexByName(column.name);
557
+ assertNotNull(modelIndex);
558
+
559
+ _this.irisGrid.handleFormatSelection(modelIndex, format);
481
560
  }
482
561
  });
483
562
  };
@@ -504,10 +583,12 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
504
583
 
505
584
  if (TableUtils.isDecimalType(column.type)) {
506
585
  formatOptions = DecimalFormatContextMenu.getOptions(selectedFormat, format => {
586
+ assertNotNull(columnIndex);
507
587
  this.debouncedUpdateCustomFormat(columnIndex, format);
508
588
  });
509
589
  } else if (TableUtils.isIntegerType(column.type)) {
510
590
  formatOptions = IntegerFormatContextMenu.getOptions(selectedFormat, format => {
591
+ assertNotNull(columnIndex);
511
592
  this.debouncedUpdateCustomFormat(columnIndex, format);
512
593
  });
513
594
  } else {
@@ -523,13 +604,15 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
523
604
  isSelected
524
605
  } = formatOptions[i];
525
606
  actions.push(_objectSpread(_objectSpread({}, formatOptions[i]), {}, {
526
- icon: isSelected ? vsCheck : null,
607
+ icon: isSelected ? vsCheck : undefined,
527
608
  order: i,
528
609
  action: () => {
529
- if (format && format.type === TableColumnFormatter.TYPE_CONTEXT_CUSTOM) {
610
+ if (!columnIndex && format && format.type === TableColumnFormatter.TYPE_CONTEXT_CUSTOM) {
530
611
  return;
531
612
  }
532
613
 
614
+ assertNotNull(columnIndex);
615
+
533
616
  _this2.irisGrid.handleFormatSelection(columnIndex, format);
534
617
  }
535
618
  }));
@@ -542,19 +625,28 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
542
625
  return actions;
543
626
  }
544
627
 
545
- stringFilterActions(column, valueText, value) {
546
- var quickFilter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
628
+ stringFilterActions(column, valueText, value, quickFilter) {
547
629
  var additive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
548
630
  var filterValue = dh.FilterValue.ofString(value);
631
+ var newQuickFilter = quickFilter;
632
+
633
+ if (!newQuickFilter) {
634
+ newQuickFilter = {
635
+ filter: null,
636
+ text: null
637
+ };
638
+ }
639
+
549
640
  var {
550
641
  filter,
551
642
  text: filterText
552
- } = quickFilter;
643
+ } = newQuickFilter;
553
644
  var actions = [];
554
645
  var {
555
646
  model
556
647
  } = this.irisGrid.props;
557
648
  var columnIndex = model.getColumnIndexByName(column.name);
649
+ assertNotNull(columnIndex);
558
650
  actions.push({
559
651
  menuElement: /*#__PURE__*/React.createElement("div", {
560
652
  className: "iris-grid-filter-menu-item-value"
@@ -605,27 +697,31 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
605
697
  title: 'text ends with',
606
698
  description: "Show only rows where ".concat(column.name, " ends with ").concat(valueText),
607
699
  action: () => {
608
- this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(quickFilter, column.filter().invoke('endsWith', filterValue), additive), IrisGridContextMenuHandler.getQuickFilterText(filterText, "*".concat(valueText), additive));
700
+ this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().invoke('endsWith', filterValue), additive), IrisGridContextMenuHandler.getQuickFilterText(filterText, "*".concat(valueText), additive));
609
701
  },
610
702
  order: 60
611
703
  });
612
704
  return actions;
613
705
  }
614
706
 
615
- numberFilterActions(column, valueText, value) {
616
- var quickFilter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
707
+ numberFilterActions(column, valueText, value, quickFilter) {
617
708
  var additive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
618
709
  var filterValue = IrisGridContextMenuHandler.getFilterValueForNumberOrChar(column.type, value);
619
- var {
620
- filter,
621
- text: filterText
622
- } = quickFilter;
710
+ var filter = null;
711
+ var filterText = null;
712
+
713
+ if (quickFilter) {
714
+ filter = quickFilter.filter;
715
+ filterText = quickFilter.text;
716
+ }
717
+
623
718
  var actions = [];
624
719
  var isFinite = value !== Number.POSITIVE_INFINITY && value !== Number.NEGATIVE_INFINITY && !Number.isNaN(value);
625
720
  var {
626
721
  model
627
722
  } = this.irisGrid.props;
628
723
  var columnIndex = model.getColumnIndexByName(column.name);
724
+ assertNotNull(columnIndex);
629
725
  actions.push({
630
726
  menuElement: /*#__PURE__*/React.createElement("div", {
631
727
  className: "iris-grid-filter-menu-item-value"
@@ -691,10 +787,14 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
691
787
  return actions;
692
788
  }
693
789
 
694
- booleanFilterActions(column, valueText) {
695
- var quickFilter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
790
+ booleanFilterActions(column, valueText, quickFilter) {
696
791
  var additive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
697
792
  var actions = [];
793
+
794
+ if (quickFilter == null) {
795
+ return actions;
796
+ }
797
+
698
798
  var {
699
799
  filter,
700
800
  text: filterText
@@ -703,6 +803,7 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
703
803
  model
704
804
  } = this.irisGrid.props;
705
805
  var columnIndex = model.getColumnIndexByName(column.name);
806
+ assertNotNull(columnIndex);
706
807
  actions.push({
707
808
  menuElement: /*#__PURE__*/React.createElement("div", {
708
809
  className: "iris-grid-filter-menu-item-value"
@@ -729,25 +830,29 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
729
830
  title: 'null',
730
831
  description: "Show only rows where ".concat(column.name, " is null"),
731
832
  action: () => {
732
- this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(quickFilter, column.filter().isNull(), additive), IrisGridContextMenuHandler.getQuickFilterText(filterText, 'null', additive));
833
+ this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull(), additive), IrisGridContextMenuHandler.getQuickFilterText(filterText, 'null', additive));
733
834
  },
734
835
  order: 30
735
836
  });
736
837
  return actions;
737
838
  }
738
839
 
739
- dateFilterActions(column, valueText, previewValue, value) {
740
- var quickFilter = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
840
+ dateFilterActions(column, valueText, previewValue, value, quickFilter) {
741
841
  var additive = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
742
842
  var filterValue = dh.FilterValue.ofNumber(value);
743
- var {
744
- filter,
745
- text: filterText
746
- } = quickFilter;
843
+ var filter = null;
844
+ var filterText = null;
845
+
846
+ if (quickFilter) {
847
+ filter = quickFilter.filter;
848
+ filterText = quickFilter.text;
849
+ }
850
+
747
851
  var {
748
852
  model
749
853
  } = this.irisGrid.props;
750
854
  var columnIndex = model.getColumnIndexByName(column.name);
855
+ assertNotNull(columnIndex);
751
856
  var actions = [];
752
857
  actions.push({
753
858
  menuElement: /*#__PURE__*/React.createElement("div", {
@@ -806,18 +911,22 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
806
911
  return actions;
807
912
  }
808
913
 
809
- nullFilterActions(column) {
810
- var quickFilter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
914
+ nullFilterActions(column, quickFilter) {
811
915
  var additive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
812
- var {
813
- filter,
814
- text: filterText
815
- } = quickFilter;
916
+ var filter = null;
917
+ var filterText = null;
918
+
919
+ if (quickFilter) {
920
+ filter = quickFilter.filter;
921
+ filterText = quickFilter.text;
922
+ }
923
+
816
924
  var actions = [];
817
925
  var {
818
926
  model
819
927
  } = this.irisGrid.props;
820
928
  var columnIndex = model.getColumnIndexByName(column.name);
929
+ assertNotNull(columnIndex);
821
930
  actions.push({
822
931
  menuElement: /*#__PURE__*/React.createElement("div", {
823
932
  className: "iris-grid-filter-menu-item-value"
@@ -854,7 +963,7 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
854
963
  action: () => {
855
964
  this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending);
856
965
  },
857
- icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending) ? vsRemove : null,
966
+ icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending) ? vsRemove : undefined,
858
967
  iconColor: contextMenuSortIconColor
859
968
  }, {
860
969
  title: "".concat(column.name, " Descending"),
@@ -862,7 +971,7 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
862
971
  action: () => {
863
972
  this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending);
864
973
  },
865
- icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending) ? vsRemove : null,
974
+ icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending) ? vsRemove : undefined,
866
975
  iconColor: contextMenuSortIconColor
867
976
  }, {
868
977
  title: "Remove Sort",
@@ -880,7 +989,7 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
880
989
  action: () => {
881
990
  this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending, true);
882
991
  },
883
- icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending, true) ? vsRemove : null,
992
+ icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending, true) ? vsRemove : undefined,
884
993
  iconColor: contextMenuSortIconColor
885
994
  });
886
995
  sortActions.push({
@@ -889,7 +998,7 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
889
998
  action: () => {
890
999
  this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending, true);
891
1000
  },
892
- icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending, true) ? vsRemove : null,
1001
+ icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending, true) ? vsRemove : undefined,
893
1002
  iconColor: contextMenuSortIconColor
894
1003
  });
895
1004
  }
@@ -911,7 +1020,7 @@ class IrisGridContextMenuHandler extends GridMouseHandler {
911
1020
  }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
912
1021
  icon: vsRemove,
913
1022
  style: {
914
- color: contextMenuSortIconColor
1023
+ color: contextMenuSortIconColor !== null && contextMenuSortIconColor !== void 0 ? contextMenuSortIconColor : undefined
915
1024
  }
916
1025
  })), /*#__PURE__*/React.createElement("span", {
917
1026
  className: "title"