@deephaven/iris-grid 0.13.3-beta.2 → 0.13.5

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