@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
package/dist/IrisGrid.js CHANGED
@@ -17,14 +17,15 @@ import deepEqual from 'deep-equal';
17
17
  import Log from '@deephaven/log';
18
18
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
19
19
  import { ContextActionUtils, ContextActions, DeephavenSpinner, Stack, Menu, Page, Popper, ThemeExport, Tooltip } from '@deephaven/components';
20
- import { Grid, GridRange, GridUtils } from '@deephaven/grid';
20
+ import { Grid, GridRange, GridUtils, isEditableGridModel } from '@deephaven/grid';
21
21
  import { dhEye, dhFilterFilled, dhGraphLineUp, dhTriangleDownSquare, vsCloudDownload, vsEdit, vsFilter, vsMenu, vsRuby, vsSearch, vsSplitHorizontal, vsSymbolOperator, vsTools } from '@deephaven/icons';
22
- import dh, { PropTypes as APIPropTypes } from '@deephaven/jsapi-shim';
22
+ import dh from '@deephaven/jsapi-shim';
23
23
  import { DateUtils, Formatter, FormatterUtils, TableUtils } from '@deephaven/jsapi-utils';
24
- import { Pending, PromiseUtils, ValidationError } from '@deephaven/utils';
24
+ import { assertNotNull, Pending, PromiseUtils, ValidationError } from '@deephaven/utils';
25
25
  import throttle from 'lodash.throttle';
26
26
  import debounce from 'lodash.debounce';
27
27
  import clamp from 'lodash.clamp';
28
+ import { getFormatColumns } from "./sidebar/conditional-formatting/ConditionalFormattingUtils.js";
28
29
  import PendingDataBottomBar from "./PendingDataBottomBar.js";
29
30
  import IrisGridCopyHandler from "./IrisGridCopyHandler.js";
30
31
  import FilterInputField from "./FilterInputField.js";
@@ -48,7 +49,6 @@ import AdvancedSettingsType from "./sidebar/AdvancedSettingsType.js";
48
49
  import AdvancedSettingsMenu from "./sidebar/AdvancedSettingsMenu.js";
49
50
  import SHORTCUTS from "./IrisGridShortcuts.js";
50
51
  import ConditionalFormattingMenu from "./sidebar/conditional-formatting/ConditionalFormattingMenu.js";
51
- import { getFormatColumns } from "./sidebar/conditional-formatting/ConditionalFormattingUtils.js";
52
52
  import ConditionalFormatEditor from "./sidebar/conditional-formatting/ConditionalFormatEditor.js";
53
53
  import IrisGridCellOverflowModal from "./IrisGridCellOverflowModal.js";
54
54
  var log = Log.module('IrisGrid');
@@ -89,6 +89,56 @@ export class IrisGrid extends Component {
89
89
  constructor(props) {
90
90
  super(props);
91
91
 
92
+ _defineProperty(this, "grid", void 0);
93
+
94
+ _defineProperty(this, "gridWrapper", void 0);
95
+
96
+ _defineProperty(this, "lastFocusedFilterBarColumn", void 0);
97
+
98
+ _defineProperty(this, "lastLoadedConfig", void 0);
99
+
100
+ _defineProperty(this, "tooltip", void 0);
101
+
102
+ _defineProperty(this, "pending", void 0);
103
+
104
+ _defineProperty(this, "globalColumnFormats", void 0);
105
+
106
+ _defineProperty(this, "dateTimeFormatterOptions", void 0);
107
+
108
+ _defineProperty(this, "decimalFormatOptions", void 0);
109
+
110
+ _defineProperty(this, "integerFormatOptions", void 0);
111
+
112
+ _defineProperty(this, "truncateNumbersWithPound", void 0);
113
+
114
+ _defineProperty(this, "loadingScrimStartTime", void 0);
115
+
116
+ _defineProperty(this, "loadingScrimFinishTime", void 0);
117
+
118
+ _defineProperty(this, "animationFrame", void 0);
119
+
120
+ _defineProperty(this, "loadingTimer", void 0);
121
+
122
+ _defineProperty(this, "renderer", void 0);
123
+
124
+ _defineProperty(this, "tableSaver", void 0);
125
+
126
+ _defineProperty(this, "crossColumnRef", void 0);
127
+
128
+ _defineProperty(this, "isAnimating", void 0);
129
+
130
+ _defineProperty(this, "filterInputRef", void 0);
131
+
132
+ _defineProperty(this, "toggleFilterBarAction", void 0);
133
+
134
+ _defineProperty(this, "toggleSearchBarAction", void 0);
135
+
136
+ _defineProperty(this, "discardAction", void 0);
137
+
138
+ _defineProperty(this, "commitAction", void 0);
139
+
140
+ _defineProperty(this, "contextActions", void 0);
141
+
92
142
  _defineProperty(this, "getAdvancedMenuOpenedHandler", memoize(column => this.handleAdvancedMenuOpened.bind(this, column), {
93
143
  max: 100
94
144
  }));
@@ -249,7 +299,7 @@ export class IrisGrid extends Component {
249
299
  _defineProperty(this, "getCachedPreviewFormatColumns", memoize((columns, rulesParam, preview, editIndex) => {
250
300
  log.debug('getCachedPreviewFormatColumns', rulesParam, preview, editIndex);
251
301
 
252
- if (preview !== undefined && editIndex !== null) {
302
+ if (preview !== undefined && editIndex !== undefined) {
253
303
  var rules = [...rulesParam];
254
304
  rules[editIndex] = preview;
255
305
  return this.getCachedFormatColumns(columns, rules);
@@ -295,14 +345,16 @@ export class IrisGrid extends Component {
295
345
  max: 1
296
346
  }));
297
347
 
298
- _defineProperty(this, "getCachedFilter", memoize((customFilters, quickFilters, advancedFilters, partitionFilters, searchFilter) => [...customFilters, ...partitionFilters, ...IrisGridUtils.getFiltersFromFilterMap(quickFilters), ...IrisGridUtils.getFiltersFromFilterMap(advancedFilters), ...(searchFilter ? [searchFilter] : []) // null check
348
+ _defineProperty(this, "getCachedFilter", memoize((customFilters, quickFilters, advancedFilters, partitionFilters, searchFilter) => [...(customFilters ? [customFilters] : []), // null check
349
+ ...(partitionFilters ? [partitionFilters] : []), // null check
350
+ ...IrisGridUtils.getFiltersFromFilterMap(quickFilters), ...IrisGridUtils.getFiltersFromFilterMap(advancedFilters), ...(searchFilter ? [searchFilter] : []) // null check
299
351
  ], {
300
352
  max: 1
301
353
  }));
302
354
 
303
- _defineProperty(this, "getCachedTheme", memoize((theme, isEditable) => _objectSpread(_objectSpread({}, IrisGridTheme), {}, {
355
+ _defineProperty(this, "getCachedTheme", memoize((theme, isEditable) => _objectSpread(_objectSpread(_objectSpread({}, IrisGridTheme), theme), {}, {
304
356
  autoSelectRow: !isEditable
305
- }, theme), {
357
+ }), {
306
358
  max: 1
307
359
  }));
308
360
 
@@ -321,6 +373,32 @@ export class IrisGrid extends Component {
321
373
  return [...columnSet];
322
374
  }));
323
375
 
376
+ _defineProperty(this, "updateSearchFilter", debounce((searchValue, selectedSearchColumns, columns, invertSearchColumns) => {
377
+ var searchFilter = CrossColumnSearch.createSearchFilter(searchValue, selectedSearchColumns, columns, invertSearchColumns);
378
+ this.setState({
379
+ searchFilter
380
+ });
381
+ }, SET_FILTER_DEBOUNCE));
382
+
383
+ _defineProperty(this, "handleConditionalFormatEditorUpdate", debounce(conditionalFormatPreview => {
384
+ this.setState({
385
+ conditionalFormatPreview
386
+ });
387
+ }, SET_CONDITIONAL_FORMAT_DEBOUNCE));
388
+
389
+ _defineProperty(this, "handleDownloadProgressUpdate", throttle((tableDownloadProgress, tableDownloadEstimatedTime) => {
390
+ var {
391
+ tableDownloadStatus
392
+ } = this.state;
393
+
394
+ if (tableDownloadStatus === TableCsvExporter.DOWNLOAD_STATUS.DOWNLOADING) {
395
+ this.setState({
396
+ tableDownloadProgress,
397
+ tableDownloadEstimatedTime
398
+ });
399
+ }
400
+ }, UPDATE_DOWNLOAD_THROTTLE));
401
+
324
402
  _defineProperty(this, "getOverflowButtonTooltip", memoize(overflowButtonTooltipProps => {
325
403
  if (overflowButtonTooltipProps == null) {
326
404
  return null;
@@ -382,8 +460,6 @@ export class IrisGrid extends Component {
382
460
  this.handleConditionalFormatEdit = this.handleConditionalFormatEdit.bind(this);
383
461
  this.handleConditionalFormatsChange = this.handleConditionalFormatsChange.bind(this);
384
462
  this.handleConditionalFormatEditorSave = this.handleConditionalFormatEditorSave.bind(this);
385
- this.handleConditionalFormatEditorUpdate = debounce(this.handleConditionalFormatEditorUpdate.bind(this), SET_CONDITIONAL_FORMAT_DEBOUNCE);
386
- this.handleConditionalFormatEditorCancel = this.handleConditionalFormatEditorCancel.bind(this);
387
463
  this.handleUpdateCustomColumns = this.handleUpdateCustomColumns.bind(this);
388
464
  this.handleCustomColumnsChanged = this.handleCustomColumnsChanged.bind(this);
389
465
  this.handleSelectDistinctChanged = this.handleSelectDistinctChanged.bind(this);
@@ -394,7 +470,6 @@ export class IrisGrid extends Component {
394
470
  this.handleDownloadTableStart = this.handleDownloadTableStart.bind(this);
395
471
  this.handleCancelDownloadTable = this.handleCancelDownloadTable.bind(this);
396
472
  this.handleDownloadCanceled = this.handleDownloadCanceled.bind(this);
397
- this.handleDownloadProgressUpdate = throttle(this.handleDownloadProgressUpdate.bind(this), UPDATE_DOWNLOAD_THROTTLE);
398
473
  this.handleDownloadCompleted = this.handleDownloadCompleted.bind(this);
399
474
  this.handlePartitionAppend = this.handlePartitionAppend.bind(this);
400
475
  this.handlePartitionChange = this.handlePartitionChange.bind(this);
@@ -405,12 +480,9 @@ export class IrisGrid extends Component {
405
480
  this.handleRollupChange = this.handleRollupChange.bind(this);
406
481
  this.handleOverflowClose = this.handleOverflowClose.bind(this);
407
482
  this.getColumnBoundingRect = this.getColumnBoundingRect.bind(this);
408
- this.updateSearchFilter = debounce(this.updateSearchFilter.bind(this), SET_FILTER_DEBOUNCE);
409
483
  this.grid = null;
410
484
  this.gridWrapper = null;
411
- this.lastFocusedFilterBarColumn = null;
412
485
  this.lastLoadedConfig = null;
413
- this.tooltip = null;
414
486
  this.pending = new Pending();
415
487
  this.globalColumnFormats = [];
416
488
  this.dateTimeFormatterOptions = {};
@@ -418,14 +490,10 @@ export class IrisGrid extends Component {
418
490
  this.integerFormatOptions = {};
419
491
  this.truncateNumbersWithPound = false; // When the loading scrim started/when it should extend to the end of the screen.
420
492
 
421
- this.loadingScrimStartTime = null;
422
- this.loadingScrimFinishTime = null;
423
- this.loadingTimer = null;
424
493
  this.renderer = new IrisGridRenderer();
425
494
  this.tableSaver = null;
426
495
  this.crossColumnRef = /*#__PURE__*/React.createRef();
427
496
  this.isAnimating = false;
428
- this.animationFrame = null;
429
497
  this.filterInputRef = /*#__PURE__*/React.createRef();
430
498
  this.toggleFilterBarAction = {
431
499
  action: () => this.toggleFilterBar(),
@@ -441,7 +509,7 @@ export class IrisGrid extends Component {
441
509
  model
442
510
  } = this.props;
443
511
 
444
- if (model.isEditable && model.pendingDataMap.size > 0) {
512
+ if (isEditableGridModel(model) && model.isEditable && model.pendingDataMap.size > 0) {
445
513
  this.discardPending().catch(log.error);
446
514
  }
447
515
  },
@@ -453,7 +521,7 @@ export class IrisGrid extends Component {
453
521
  model
454
522
  } = this.props;
455
523
 
456
- if (model.isEditable && model.pendingDataMap.size > 0 && model.pendingDataErrors.size === 0) {
524
+ if (isEditableGridModel(model) && model.isEditable && model.pendingDataMap.size > 0 && model.pendingDataErrors.size === 0) {
457
525
  this.commitPending().catch(log.error);
458
526
  }
459
527
  },
@@ -475,9 +543,9 @@ export class IrisGrid extends Component {
475
543
  userColumnWidths,
476
544
  userRowHeights,
477
545
  showSearchBar: _showSearchBar,
478
- searchValue,
479
- selectedSearchColumns,
480
- invertSearchColumns,
546
+ searchValue: _searchValue,
547
+ selectedSearchColumns: _selectedSearchColumns,
548
+ invertSearchColumns: _invertSearchColumns,
481
549
  advancedFilters: _advancedFilters,
482
550
  quickFilters: _quickFilters,
483
551
  selectDistinctColumns,
@@ -501,16 +569,16 @@ export class IrisGrid extends Component {
501
569
  userRowHeights: new Map(userRowHeights),
502
570
  movedColumns: _movedColumns
503
571
  });
504
- var searchColumns = selectedSearchColumns !== null && selectedSearchColumns !== void 0 ? selectedSearchColumns : [];
572
+ var searchColumns = _selectedSearchColumns !== null && _selectedSearchColumns !== void 0 ? _selectedSearchColumns : [];
505
573
 
506
- var _searchFilter = CrossColumnSearch.createSearchFilter(searchValue, searchColumns, _model.columns, invertSearchColumns);
574
+ var _searchFilter = CrossColumnSearch.createSearchFilter(_searchValue, searchColumns, _model.columns, _invertSearchColumns);
507
575
 
508
576
  this.state = {
509
577
  isFilterBarShown: _isFilterBarShown,
510
578
  isSelectingPartition,
511
579
  focusedFilterBarColumn: null,
512
580
  metricCalculator,
513
- metrics: null,
581
+ metrics: undefined,
514
582
  keyHandlers,
515
583
  mouseHandlers,
516
584
  partition,
@@ -519,11 +587,10 @@ export class IrisGrid extends Component {
519
587
  partitionFilters: [],
520
588
  // setAdvancedFilter and setQuickFilter mutate the arguments
521
589
  // so we want to always use map copies from the state instead of props
522
- quickFilters: new Map(_quickFilters),
590
+ quickFilters: _quickFilters ? new Map(_quickFilters) : new Map(),
523
591
  advancedFilters: new Map(_advancedFilters),
524
592
  shownAdvancedFilter: null,
525
593
  hoverAdvancedFilter: null,
526
- filter: [],
527
594
  sorts: [],
528
595
  reverseType: TableUtils.REVERSE_TYPE.NONE,
529
596
  customColumns: [],
@@ -544,7 +611,7 @@ export class IrisGrid extends Component {
544
611
  customColumnFormatMap: new Map(customColumnFormatMap),
545
612
  conditionalFormats,
546
613
  conditionalFormatEditIndex: null,
547
- conditionalFormatPreview: undefined,
614
+ conditionalFormatPreview: null,
548
615
  // Column user is hovering over for selection
549
616
  hoverSelectColumn: null,
550
617
  isTableDownloading: false,
@@ -554,16 +621,16 @@ export class IrisGrid extends Component {
554
621
  tableDownloadEstimatedTime: 0,
555
622
  showSearchBar: _showSearchBar,
556
623
  searchFilter: _searchFilter,
557
- searchValue,
624
+ searchValue: _searchValue,
558
625
  selectedSearchColumns: searchColumns,
559
- invertSearchColumns,
626
+ invertSearchColumns: _invertSearchColumns,
560
627
  rollupConfig: _rollupConfig,
561
628
  rollupSelectedColumns: [],
562
629
  aggregationSettings: _aggregationSettings,
563
630
  selectedAggregation: null,
564
631
  openOptions: [],
565
632
  pendingRowCount: 0,
566
- pendingDataMap,
633
+ pendingDataMap: pendingDataMap !== null && pendingDataMap !== void 0 ? pendingDataMap : new Map(),
567
634
  pendingDataErrors: new Map(),
568
635
  pendingSavePromise: null,
569
636
  pendingSaveError: null,
@@ -654,8 +721,8 @@ export class IrisGrid extends Component {
654
721
  var loadingScrimProgress = Math.min(currentTime / totalTime, 1);
655
722
 
656
723
  if (loadingScrimFinishTime < now) {
657
- this.loadingScrimStartTime = null;
658
- this.loadingScrimFinishTime = null;
724
+ this.loadingScrimStartTime = undefined;
725
+ this.loadingScrimFinishTime = undefined;
659
726
  }
660
727
 
661
728
  this.setState(state => {
@@ -687,7 +754,10 @@ export class IrisGrid extends Component {
687
754
  }
688
755
 
689
756
  this.handleDownloadProgressUpdate.cancel();
690
- cancelAnimationFrame(this.animationFrame);
757
+
758
+ if (this.animationFrame) {
759
+ cancelAnimationFrame(this.animationFrame);
760
+ }
691
761
  }
692
762
 
693
763
  getValueForCell(columnIndex, rowIndex) {
@@ -698,49 +768,61 @@ export class IrisGrid extends Component {
698
768
  var modelColumn = this.getModelColumn(columnIndex);
699
769
  var modelRow = this.getModelRow(rowIndex);
700
770
 
701
- if (rawValue) {
771
+ if (rawValue && modelColumn != null && modelRow != null) {
702
772
  return model.valueForCell(modelColumn, modelRow);
703
773
  }
704
774
 
705
- return model.textForCell(modelColumn, modelRow);
775
+ if (rawValue) {
776
+ return null;
777
+ }
778
+
779
+ if (modelColumn != null && modelRow != null) {
780
+ return model.textForCell(modelColumn, modelRow);
781
+ }
782
+
783
+ return '';
706
784
  }
707
785
 
708
786
  getModelColumn(columnIndex) {
709
787
  var {
710
788
  metrics
711
789
  } = this.state;
790
+ assertNotNull(metrics);
712
791
  var {
713
792
  modelColumns
714
793
  } = metrics;
715
794
 
716
- if (!modelColumns) {
795
+ if (modelColumns == null) {
717
796
  return null;
718
797
  }
719
798
 
720
- return modelColumns.get(columnIndex);
799
+ return columnIndex != null ? modelColumns.get(columnIndex) : null;
721
800
  }
722
801
 
723
802
  getModelRow(rowIndex) {
724
803
  var {
725
804
  metrics
726
805
  } = this.state;
806
+ assertNotNull(metrics);
727
807
  var {
728
808
  modelRows
729
809
  } = metrics;
730
810
 
731
- if (!modelRows) {
811
+ if (modelRows == null) {
732
812
  return null;
733
813
  }
734
814
 
735
- return modelRows.get(rowIndex);
815
+ return rowIndex != null ? modelRows.get(rowIndex) : null;
736
816
  }
737
817
 
738
818
  getTheme() {
819
+ var _ref5;
820
+
739
821
  var {
740
822
  model,
741
823
  theme
742
824
  } = this.props;
743
- return this.getCachedTheme(theme, model.isEditable);
825
+ return this.getCachedTheme(theme, (_ref5 = isEditableGridModel(model) && model.isEditable) !== null && _ref5 !== void 0 ? _ref5 : false);
744
826
  }
745
827
 
746
828
  getVisibleColumn(modelIndex) {
@@ -752,8 +834,8 @@ export class IrisGrid extends Component {
752
834
  /**
753
835
  * Applies the provided input filters as quick filters,
754
836
  * and clears any existing quickFilters or advancedFilters on that column
755
- * @param {inputFilter[]} inputFilters Array of input filters to apply
756
- * @param {boolean} replaceExisting If true, new filters will replace the existing ones, instead of merging
837
+ * @param inputFilters Array of input filters to apply
838
+ * @param replaceExisting If true, new filters will replace the existing ones, instead of merging
757
839
  */
758
840
 
759
841
 
@@ -769,17 +851,17 @@ export class IrisGrid extends Component {
769
851
  var newAdvancedFilters = replaceExisting ? new Map() : new Map(advancedFilters);
770
852
  var newQuickFilters = replaceExisting ? new Map() : new Map(quickFilters);
771
853
  var isChanged = replaceExisting && advancedFilters.size > 0;
772
- inputFilters.forEach(_ref5 => {
854
+ inputFilters.forEach(_ref6 => {
773
855
  var {
774
856
  name,
775
857
  type,
776
858
  value
777
- } = _ref5;
778
- var modelIndex = model.columns.findIndex(_ref6 => {
859
+ } = _ref6;
860
+ var modelIndex = model.columns.findIndex(_ref7 => {
779
861
  var {
780
862
  name: columnName,
781
863
  type: columnType
782
- } = _ref6;
864
+ } = _ref7;
783
865
  return columnName === name && columnType === type;
784
866
  });
785
867
 
@@ -800,10 +882,10 @@ export class IrisGrid extends Component {
800
882
  }
801
883
  /**
802
884
  * Applies a quick filter
803
- * @param {number} modelIndex The index in the model of the column to set
804
- * @param {string} value The string value to set to the quick filter
805
- * @param {Map} quickFilters The quick filters map
806
- * @returns {boolean} True if the filters have changed because this quick filter was applied
885
+ * @param modelIndex The index in the model of the column to set
886
+ * @param value The string value to set to the quick filter
887
+ * @param quickFilters The quick filters map
888
+ * @returns True if the filters have changed because this quick filter was applied
807
889
  */
808
890
 
809
891
 
@@ -830,10 +912,15 @@ export class IrisGrid extends Component {
830
912
  }
831
913
  }
832
914
 
833
- quickFilters.set(modelIndex, {
834
- text: value,
835
- filter: IrisGrid.makeQuickFilter(column, value, formatter.timeZone)
836
- });
915
+ var filter = IrisGrid.makeQuickFilter(column, value, formatter.timeZone);
916
+
917
+ if (filter) {
918
+ quickFilters.set(modelIndex, {
919
+ text: value,
920
+ filter
921
+ });
922
+ }
923
+
837
924
  return true;
838
925
  }
839
926
 
@@ -841,17 +928,12 @@ export class IrisGrid extends Component {
841
928
  }
842
929
 
843
930
  setAdvancedFilter(modelIndex, filter, options) {
844
- if (modelIndex == null) {
845
- log.error('Invalid model index to filter on');
846
- return;
847
- }
848
-
849
931
  log.debug('Setting advanced filter', modelIndex, filter);
850
932
  this.startLoading('Filtering...', true);
851
- this.setState(_ref7 => {
933
+ this.setState(_ref8 => {
852
934
  var {
853
935
  advancedFilters
854
- } = _ref7;
936
+ } = _ref8;
855
937
  var newAdvancedFilters = new Map(advancedFilters);
856
938
 
857
939
  if (filter == null) {
@@ -870,19 +952,19 @@ export class IrisGrid extends Component {
870
952
  }
871
953
  /**
872
954
  * Sets a quick filter against the provided column
873
- * @param {Number} modelIndex The index in the model for the column this filter is applied to
874
- * @param {dh.FilterCondition} filter A filter to apply to the column, or null if there was an error
875
- * @param {String} text The original text the filter was created with
955
+ * @param modelIndex The index in the model for the column this filter is applied to
956
+ * @param filter A filter to apply to the column, or null if there was an error
957
+ * @param text The original text the filter was created with
876
958
  */
877
959
 
878
960
 
879
961
  setQuickFilter(modelIndex, filter, text) {
880
962
  log.debug('Setting quick filter', modelIndex, filter, text);
881
963
  this.startLoading('Filtering...', true);
882
- this.setState(_ref8 => {
964
+ this.setState(_ref9 => {
883
965
  var {
884
966
  quickFilters
885
- } = _ref8;
967
+ } = _ref9;
886
968
  var newQuickFilters = new Map(quickFilters);
887
969
  newQuickFilters.set(modelIndex, {
888
970
  filter,
@@ -895,7 +977,7 @@ export class IrisGrid extends Component {
895
977
  }
896
978
  /**
897
979
  * Set grid filters based on the filter map
898
- * @param {Map<string, Object>} filterMap Filter map
980
+ * @param filterMap Filter map
899
981
  */
900
982
 
901
983
 
@@ -915,12 +997,12 @@ export class IrisGrid extends Component {
915
997
  var {
916
998
  model
917
999
  } = this.props;
918
- filterMap.forEach((_ref9, columnName) => {
1000
+ filterMap.forEach((_ref10, columnName) => {
919
1001
  var {
920
1002
  columnType,
921
1003
  text,
922
1004
  value
923
- } = _ref9;
1005
+ } = _ref10;
924
1006
  var column = model.columns.find(c => c.name === columnName && c.type === columnType);
925
1007
 
926
1008
  if (column == null) {
@@ -928,6 +1010,7 @@ export class IrisGrid extends Component {
928
1010
  }
929
1011
 
930
1012
  var columnIndex = model.getColumnIndexByName(column.name);
1013
+ assertNotNull(columnIndex);
931
1014
 
932
1015
  if (value === null) {
933
1016
  this.setQuickFilter(columnIndex, column.filter().isNull(), '=null');
@@ -940,13 +1023,13 @@ export class IrisGrid extends Component {
940
1023
 
941
1024
  removeColumnFilter(modelColumn) {
942
1025
  this.startLoading('Filtering...', true);
943
- this.setState(_ref10 => {
1026
+ this.setState(_ref11 => {
944
1027
  var {
945
1028
  advancedFilters,
946
1029
  quickFilters
947
- } = _ref10;
948
- var newAdvancedFilters = new Map(advancedFilters);
949
- var newQuickFilters = new Map(quickFilters);
1030
+ } = _ref11;
1031
+ var newAdvancedFilters = advancedFilters ? new Map(advancedFilters) : new Map();
1032
+ var newQuickFilters = quickFilters ? new Map(quickFilters) : new Map();
950
1033
  newQuickFilters.delete(modelColumn);
951
1034
  newAdvancedFilters.delete(modelColumn);
952
1035
  return {
@@ -975,7 +1058,7 @@ export class IrisGrid extends Component {
975
1058
  quickFilters: new Map(),
976
1059
  advancedFilters: new Map(),
977
1060
  searchValue: '',
978
- searchFilter: null
1061
+ searchFilter: undefined
979
1062
  });
980
1063
  }
981
1064
 
@@ -983,7 +1066,7 @@ export class IrisGrid extends Component {
983
1066
  log.debug('Clearing cross-column search');
984
1067
  this.setState({
985
1068
  searchValue: '',
986
- searchFilter: null
1069
+ searchFilter: undefined
987
1070
  });
988
1071
  }
989
1072
 
@@ -1040,11 +1123,11 @@ export class IrisGrid extends Component {
1040
1123
  });
1041
1124
  }
1042
1125
 
1043
- setFilters(_ref11) {
1126
+ setFilters(_ref12) {
1044
1127
  var {
1045
1128
  quickFilters,
1046
1129
  advancedFilters
1047
- } = _ref11;
1130
+ } = _ref12;
1048
1131
  this.setState({
1049
1132
  quickFilters,
1050
1133
  advancedFilters
@@ -1052,17 +1135,17 @@ export class IrisGrid extends Component {
1052
1135
  }
1053
1136
 
1054
1137
  updateFormatterSettings(settings) {
1138
+ var _settings$defaultDeci, _settings$defaultInte, _settings$truncateNum;
1139
+
1055
1140
  var forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1056
1141
  var globalColumnFormats = FormatterUtils.getColumnFormats(settings);
1057
1142
  var dateTimeFormatterOptions = FormatterUtils.getDateTimeFormatterOptions(settings);
1058
- var {
1059
- defaultDecimalFormatOptions = {},
1060
- defaultIntegerFormatOptions = {},
1061
- truncateNumbersWithPound = false
1062
- } = settings;
1143
+ var defaultDecimalFormatOptions = (_settings$defaultDeci = settings === null || settings === void 0 ? void 0 : settings.defaultDecimalFormatOptions) !== null && _settings$defaultDeci !== void 0 ? _settings$defaultDeci : {};
1144
+ var defaultIntegerFormatOptions = (_settings$defaultInte = settings === null || settings === void 0 ? void 0 : settings.defaultIntegerFormatOptions) !== null && _settings$defaultInte !== void 0 ? _settings$defaultInte : {};
1145
+ var truncateNumbersWithPound = (_settings$truncateNum = settings === null || settings === void 0 ? void 0 : settings.truncateNumbersWithPound) !== null && _settings$truncateNum !== void 0 ? _settings$truncateNum : false;
1063
1146
  var isColumnFormatChanged = !deepEqual(this.globalColumnFormats, globalColumnFormats);
1064
1147
  var isDateFormattingChanged = !deepEqual(this.dateTimeFormatterOptions, dateTimeFormatterOptions);
1065
- var isDecimalFormattingChanged = !deepEqual(this.decimalFormatOptions, defaultDecimalFormatOptions);
1148
+ var isDecimalFormattingChanged = !deepEqual(this.decimalFormatOptions, settings === null || settings === void 0 ? void 0 : settings.defaultDecimalFormatOptions);
1066
1149
  var isIntegerFormattingChanged = !deepEqual(this.integerFormatOptions, defaultIntegerFormatOptions);
1067
1150
  var isTruncateNumbersChanged = this.truncateNumbersWithPound !== truncateNumbersWithPound;
1068
1151
 
@@ -1081,6 +1164,8 @@ export class IrisGrid extends Component {
1081
1164
  }
1082
1165
 
1083
1166
  updateFormatter(updatedFormats) {
1167
+ var _this$globalColumnFor;
1168
+
1084
1169
  var forceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1085
1170
  var {
1086
1171
  customColumnFormatMap
@@ -1090,7 +1175,7 @@ export class IrisGrid extends Component {
1090
1175
  customColumnFormatMap
1091
1176
  }, updatedFormats);
1092
1177
 
1093
- var mergedColumnFormats = [...this.globalColumnFormats, ...update.customColumnFormatMap.values()];
1178
+ var mergedColumnFormats = [...((_this$globalColumnFor = this.globalColumnFormats) !== null && _this$globalColumnFor !== void 0 ? _this$globalColumnFor : []), ...update.customColumnFormatMap.values()];
1094
1179
  var formatter = new Formatter(mergedColumnFormats, this.dateTimeFormatterOptions, this.decimalFormatOptions, this.integerFormatOptions, this.truncateNumbersWithPound);
1095
1180
  log.debug('updateFormatter', this.globalColumnFormats, mergedColumnFormats);
1096
1181
  this.setState(_objectSpread(_objectSpread({}, update), {}, {
@@ -1155,17 +1240,20 @@ export class IrisGrid extends Component {
1155
1240
 
1156
1241
  try {
1157
1242
  var partitionTable = yield _this.pending.add(model.valuesTable(partitionColumn), resolved => resolved.close());
1158
- var column = partitionTable.columns[0];
1159
- var sort = column.sort().desc();
1243
+ var _column = partitionTable.columns[0];
1244
+
1245
+ var sort = _column.sort().desc();
1246
+
1160
1247
  partitionTable.applySort([sort]);
1161
- partitionTable.setViewport(0, 0, [column]);
1248
+ partitionTable.setViewport(0, 0, [_column]);
1162
1249
  var data = yield _this.pending.add(partitionTable.getViewportData());
1163
1250
 
1164
1251
  if (data.rows.length > 0) {
1165
1252
  var row = data.rows[0];
1166
- var value = row.get(column);
1167
1253
 
1168
- _this.updatePartition(value, partitionColumn);
1254
+ var _value = row.get(_column);
1255
+
1256
+ _this.updatePartition(_value, partitionColumn);
1169
1257
 
1170
1258
  _this.setState({
1171
1259
  isSelectingPartition: true
@@ -1208,25 +1296,26 @@ export class IrisGrid extends Component {
1208
1296
  } = this.props;
1209
1297
 
1210
1298
  if (canCopy) {
1211
- var value = this.getValueForCell(columnIndex, rowIndex, rawValue);
1212
- ContextActionUtils.copyToClipboard(value).catch(e => log.error('Unable to copy cell', e));
1299
+ var _value2 = String(this.getValueForCell(columnIndex, rowIndex, rawValue));
1300
+
1301
+ ContextActionUtils.copyToClipboard(_value2).catch(e => log.error('Unable to copy cell', e));
1213
1302
  } else {
1214
1303
  log.error('Attempted to copyCell for user without copy permission.');
1215
1304
  }
1216
1305
  }
1217
1306
  /**
1218
1307
  * Copy the provided ranges to the clipboard
1219
- * @param {GridRange[]} ranges The ranges to copy
1220
- * @param {boolean} includeHeaders Include the headers or not
1221
- * @param {boolean} formatValues Whether to format values or not
1222
- * @param {string|null} error Error message if one occurred
1308
+ * @paramranges The ranges to copy
1309
+ * @param includeHeaders Include the headers or not
1310
+ * @param formatValues Whether to format values or not
1311
+ * @param error Error message if one occurred
1223
1312
  */
1224
1313
 
1225
1314
 
1226
1315
  copyRanges(ranges) {
1227
1316
  var includeHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1228
1317
  var formatValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
1229
- var error = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
1318
+ var error = arguments.length > 3 ? arguments[3] : undefined;
1230
1319
  var {
1231
1320
  model,
1232
1321
  canCopy
@@ -1235,9 +1324,7 @@ export class IrisGrid extends Component {
1235
1324
  metricCalculator,
1236
1325
  movedColumns
1237
1326
  } = this.state;
1238
- var {
1239
- userColumnWidths
1240
- } = metricCalculator;
1327
+ var userColumnWidths = metricCalculator.getUserColumnWidths();
1241
1328
 
1242
1329
  if (canCopy) {
1243
1330
  var copyOperation = {
@@ -1277,6 +1364,8 @@ export class IrisGrid extends Component {
1277
1364
  minScrimTransitionTime,
1278
1365
  maxScrimTransitionTime
1279
1366
  } = theme;
1367
+ assertNotNull(minScrimTransitionTime);
1368
+ assertNotNull(maxScrimTransitionTime);
1280
1369
  var height = (_this$gridWrapper$get = (_this$gridWrapper = this.gridWrapper) === null || _this$gridWrapper === void 0 ? void 0 : _this$gridWrapper.getBoundingClientRect().height) !== null && _this$gridWrapper$get !== void 0 ? _this$gridWrapper$get : 0;
1281
1370
  var scrimTransitionTime = Math.max(minScrimTransitionTime, Math.min(height / 2, maxScrimTransitionTime));
1282
1371
  this.loadingScrimStartTime = Date.now();
@@ -1293,17 +1382,17 @@ export class IrisGrid extends Component {
1293
1382
  }
1294
1383
 
1295
1384
  stopLoading() {
1296
- this.loadingScrimStartTime = null;
1297
- this.loadingScrimFinishTime = null;
1385
+ this.loadingScrimStartTime = undefined;
1386
+ this.loadingScrimFinishTime = undefined;
1298
1387
  this.setState({
1299
1388
  loadingText: null,
1300
1389
  loadingScrimProgress: null,
1301
1390
  loadingSpinnerShown: false
1302
1391
  });
1303
1392
 
1304
- if (this.loadingTimer) {
1393
+ if (this.loadingTimer != null) {
1305
1394
  clearTimeout(this.loadingTimer);
1306
- this.loadingTimer = null;
1395
+ this.loadingTimer = undefined;
1307
1396
  }
1308
1397
  }
1309
1398
  /**
@@ -1345,7 +1434,7 @@ export class IrisGrid extends Component {
1345
1434
  customColumns: [],
1346
1435
  quickFilters: new Map(),
1347
1436
  reverseType: TableUtils.REVERSE_TYPE.NONE,
1348
- rollupConfig: null,
1437
+ rollupConfig: undefined,
1349
1438
  selectDistinctColumns: [],
1350
1439
  sorts: []
1351
1440
  });
@@ -1376,7 +1465,9 @@ export class IrisGrid extends Component {
1376
1465
  }
1377
1466
 
1378
1467
  focus() {
1379
- if (this.grid) this.grid.focus();
1468
+ var _this$grid;
1469
+
1470
+ (_this$grid = this.grid) === null || _this$grid === void 0 ? void 0 : _this$grid.focus();
1380
1471
  }
1381
1472
 
1382
1473
  focusFilterBar(column) {
@@ -1388,7 +1479,7 @@ export class IrisGrid extends Component {
1388
1479
  } = model;
1389
1480
  var modelColumn = this.getModelColumn(column);
1390
1481
 
1391
- if (column == null || column < 0 || columnCount <= column || !model.isFilterable(modelColumn)) {
1482
+ if (column == null || modelColumn == null || column < 0 || columnCount <= column || !model.isFilterable(modelColumn)) {
1392
1483
  this.setState({
1393
1484
  focusedFilterBarColumn: null
1394
1485
  });
@@ -1399,6 +1490,7 @@ export class IrisGrid extends Component {
1399
1490
  metricCalculator,
1400
1491
  metrics
1401
1492
  } = this.state;
1493
+ assertNotNull(metrics);
1402
1494
  var {
1403
1495
  gridX,
1404
1496
  left,
@@ -1407,13 +1499,18 @@ export class IrisGrid extends Component {
1407
1499
  } = metrics;
1408
1500
 
1409
1501
  if (column < left) {
1410
- this.grid.setViewState({
1502
+ var _this$grid2;
1503
+
1504
+ (_this$grid2 = this.grid) === null || _this$grid2 === void 0 ? void 0 : _this$grid2.setViewState({
1411
1505
  left: column
1412
1506
  }, true);
1413
1507
  } else if (rightVisible < column) {
1414
- var metricState = this.grid.getMetricState();
1508
+ var _this$grid3, _this$grid4;
1509
+
1510
+ var metricState = (_this$grid3 = this.grid) === null || _this$grid3 === void 0 ? void 0 : _this$grid3.getMetricState();
1511
+ assertNotNull(metricState);
1415
1512
  var newLeft = metricCalculator.getLastLeft(metricState, column, gridX);
1416
- this.grid.setViewState({
1513
+ (_this$grid4 = this.grid) === null || _this$grid4 === void 0 ? void 0 : _this$grid4.setViewState({
1417
1514
  left: Math.min(newLeft, lastLeft)
1418
1515
  }, true);
1419
1516
  }
@@ -1426,12 +1523,14 @@ export class IrisGrid extends Component {
1426
1523
  }
1427
1524
 
1428
1525
  hideColumnByVisibleIndex(columnVisibleIndex) {
1526
+ var _this$grid5;
1527
+
1429
1528
  var {
1430
1529
  metricCalculator,
1431
1530
  movedColumns
1432
1531
  } = this.state;
1433
1532
  metricCalculator.setColumnWidth(GridUtils.getModelIndex(columnVisibleIndex, movedColumns), 0);
1434
- this.grid.forceUpdate();
1533
+ (_this$grid5 = this.grid) === null || _this$grid5 === void 0 ? void 0 : _this$grid5.forceUpdate();
1435
1534
  }
1436
1535
 
1437
1536
  freezeColumnByColumnName(columnName) {
@@ -1446,6 +1545,7 @@ export class IrisGrid extends Component {
1446
1545
  var allFrozenColumns = frozenColumns == null ? new Set(model.frozenColumns) : new Set(frozenColumns);
1447
1546
  allFrozenColumns.add(columnName);
1448
1547
  var modelIndex = model.getColumnIndexByName(columnName);
1548
+ assertNotNull(modelIndex);
1449
1549
  var visibleIndex = GridUtils.getVisibleIndex(modelIndex, movedColumns);
1450
1550
  var newMovedColumns = GridUtils.moveItem(visibleIndex, allFrozenColumns.size - 1, movedColumns);
1451
1551
  this.setState({
@@ -1466,6 +1566,7 @@ export class IrisGrid extends Component {
1466
1566
  var allFrozenColumns = frozenColumns == null ? new Set(model.frozenColumns) : new Set(frozenColumns);
1467
1567
  allFrozenColumns.delete(columnName);
1468
1568
  var modelIndex = model.getColumnIndexByName(columnName);
1569
+ assertNotNull(modelIndex);
1469
1570
  var visibleIndex = GridUtils.getVisibleIndex(modelIndex, movedColumns); // Move to after remaining frozen columns and front columns
1470
1571
 
1471
1572
  var newMovedColumns = GridUtils.moveItem(visibleIndex, allFrozenColumns.size + model.frontColumns.length, movedColumns);
@@ -1476,6 +1577,8 @@ export class IrisGrid extends Component {
1476
1577
  }
1477
1578
 
1478
1579
  handleColumnVisibilityChanged(modelIndexes, visibilityOption) {
1580
+ var _this$grid6;
1581
+
1479
1582
  var {
1480
1583
  metricCalculator
1481
1584
  } = this.state;
@@ -1490,7 +1593,7 @@ export class IrisGrid extends Component {
1490
1593
  });
1491
1594
  }
1492
1595
 
1493
- this.grid.forceUpdate();
1596
+ (_this$grid6 = this.grid) === null || _this$grid6 === void 0 ? void 0 : _this$grid6.forceUpdate();
1494
1597
  }
1495
1598
 
1496
1599
  handleCrossColumnSearch(searchValue, selectedSearchColumns, invertSearchColumns) {
@@ -1505,16 +1608,11 @@ export class IrisGrid extends Component {
1505
1608
  });
1506
1609
  }
1507
1610
 
1508
- updateSearchFilter(searchValue, selectedSearchColumns, columns, invertSearchColumns) {
1509
- var searchFilter = CrossColumnSearch.createSearchFilter(searchValue, selectedSearchColumns, columns, invertSearchColumns);
1510
- this.setState({
1511
- searchFilter
1512
- });
1513
- }
1514
-
1515
1611
  handleAnimationLoop() {
1516
- this.grid.updateCanvasScale();
1517
- this.grid.updateCanvas();
1612
+ var _this$grid7, _this$grid8;
1613
+
1614
+ (_this$grid7 = this.grid) === null || _this$grid7 === void 0 ? void 0 : _this$grid7.updateCanvasScale();
1615
+ (_this$grid8 = this.grid) === null || _this$grid8 === void 0 ? void 0 : _this$grid8.updateCanvas();
1518
1616
 
1519
1617
  if (this.isAnimating) {
1520
1618
  this.animationFrame = requestAnimationFrame(this.handleAnimationLoop);
@@ -1575,12 +1673,12 @@ export class IrisGrid extends Component {
1575
1673
  }
1576
1674
 
1577
1675
  showAllColumns() {
1676
+ var _this$grid9;
1677
+
1578
1678
  var {
1579
1679
  metricCalculator
1580
1680
  } = this.state;
1581
- var {
1582
- userColumnWidths
1583
- } = metricCalculator;
1681
+ var userColumnWidths = metricCalculator.getUserColumnWidths();
1584
1682
  var entries = [...userColumnWidths.entries()];
1585
1683
 
1586
1684
  for (var i = 0; i < entries.length; i += 1) {
@@ -1591,7 +1689,7 @@ export class IrisGrid extends Component {
1591
1689
  }
1592
1690
  }
1593
1691
 
1594
- this.grid.forceUpdate();
1692
+ (_this$grid9 = this.grid) === null || _this$grid9 === void 0 ? void 0 : _this$grid9.forceUpdate();
1595
1693
  }
1596
1694
 
1597
1695
  toggleSort(columnIndex, addToExisting) {
@@ -1603,38 +1701,47 @@ export class IrisGrid extends Component {
1603
1701
  sorts: currentSorts
1604
1702
  } = this.state;
1605
1703
  var modelColumn = this.getModelColumn(columnIndex);
1606
- var sorts = TableUtils.toggleSortForColumn(currentSorts, model.table, modelColumn, addToExisting);
1704
+ assertNotNull(modelColumn);
1705
+ var sorts = TableUtils.toggleSortForColumn(currentSorts, model.columns, modelColumn, addToExisting);
1607
1706
  this.updateSorts(sorts);
1608
1707
  }
1609
1708
 
1610
1709
  updateSorts(sorts) {
1710
+ var _this$grid10;
1711
+
1611
1712
  this.startLoading('Sorting...');
1612
1713
  this.setState({
1613
1714
  sorts
1614
1715
  });
1615
- this.grid.forceUpdate();
1716
+ (_this$grid10 = this.grid) === null || _this$grid10 === void 0 ? void 0 : _this$grid10.forceUpdate();
1616
1717
  }
1617
1718
 
1618
- sortColumn(modelColumn, direction) {
1719
+ sortColumn(modelColumn) {
1720
+ var _this$grid11;
1721
+
1722
+ var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TableUtils.sortDirection.none;
1619
1723
  var isAbs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1620
1724
  var addToExisting = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
1725
+ assertNotNull(modelColumn);
1621
1726
  var {
1622
1727
  model
1623
1728
  } = this.props;
1624
- var sorts = TableUtils.sortColumn(model.table, modelColumn, direction, isAbs, addToExisting);
1729
+ var sorts = TableUtils.sortColumn(model.sort, model.columns, modelColumn, direction, isAbs, addToExisting);
1625
1730
  this.startLoading('Sorting...');
1626
1731
  this.setState({
1627
1732
  sorts
1628
1733
  });
1629
- this.grid.forceUpdate();
1734
+ (_this$grid11 = this.grid) === null || _this$grid11 === void 0 ? void 0 : _this$grid11.forceUpdate();
1630
1735
  }
1631
1736
 
1632
1737
  reverse(reverseType) {
1738
+ var _this$grid12;
1739
+
1633
1740
  this.startLoading('Reversing...');
1634
1741
  this.setState({
1635
1742
  reverseType
1636
1743
  });
1637
- this.grid.forceUpdate();
1744
+ (_this$grid12 = this.grid) === null || _this$grid12 === void 0 ? void 0 : _this$grid12.forceUpdate();
1638
1745
  }
1639
1746
 
1640
1747
  isReversible() {
@@ -1660,19 +1767,19 @@ export class IrisGrid extends Component {
1660
1767
  } else {
1661
1768
  var columnIndex = 0;
1662
1769
  var {
1663
- model
1770
+ model: _model2
1664
1771
  } = this.props;
1665
1772
  var {
1666
1773
  columnCount
1667
- } = model;
1774
+ } = _model2;
1668
1775
 
1669
1776
  for (var i = 0; i < columnCount; i += 1) {
1670
1777
  var modelColumn = this.getModelColumn(i);
1671
1778
 
1672
1779
  if (modelColumn != null) {
1673
- var column = model.columns[modelColumn];
1780
+ var _column2 = _model2.columns[modelColumn];
1674
1781
 
1675
- if (column != null && TableUtils.isTextType(column.type)) {
1782
+ if (_column2 != null && TableUtils.isTextType(_column2.type)) {
1676
1783
  columnIndex = i;
1677
1784
  break;
1678
1785
  }
@@ -1682,7 +1789,9 @@ export class IrisGrid extends Component {
1682
1789
  this.focusFilterBar(columnIndex);
1683
1790
  }
1684
1791
  } else {
1685
- this.grid.focus();
1792
+ var _this$grid13;
1793
+
1794
+ (_this$grid13 = this.grid) === null || _this$grid13 === void 0 ? void 0 : _this$grid13.focus();
1686
1795
  }
1687
1796
  }
1688
1797
 
@@ -1719,10 +1828,16 @@ export class IrisGrid extends Component {
1719
1828
  this.setState({
1720
1829
  showSearchBar: update
1721
1830
  }, () => {
1722
- if (update && this.crossColumnRef.current) {
1723
- this.crossColumnRef.current.focus();
1831
+ var _this$crossColumnRef;
1832
+
1833
+ if (update && (_this$crossColumnRef = this.crossColumnRef) !== null && _this$crossColumnRef !== void 0 && _this$crossColumnRef.current) {
1834
+ var _this$crossColumnRef2;
1835
+
1836
+ (_this$crossColumnRef2 = this.crossColumnRef) === null || _this$crossColumnRef2 === void 0 ? void 0 : _this$crossColumnRef2.current.focus();
1724
1837
  } else {
1725
- this.grid.focus();
1838
+ var _this$grid14;
1839
+
1840
+ (_this$grid14 = this.grid) === null || _this$grid14 === void 0 ? void 0 : _this$grid14.focus();
1726
1841
  }
1727
1842
  });
1728
1843
  }
@@ -1731,11 +1846,13 @@ export class IrisGrid extends Component {
1731
1846
  var _this2 = this;
1732
1847
 
1733
1848
  return _asyncToGenerator(function* () {
1849
+ var _document, _document$activeEleme;
1850
+
1734
1851
  var {
1735
1852
  model
1736
1853
  } = _this2.props;
1737
1854
 
1738
- if (!model.isEditable) {
1855
+ if (!isEditableGridModel(model) || !model.isEditable) {
1739
1856
  throw new Error('Cannot save, table is not editable');
1740
1857
  }
1741
1858
 
@@ -1747,13 +1864,15 @@ export class IrisGrid extends Component {
1747
1864
  throw new Error('Save already in progress');
1748
1865
  }
1749
1866
 
1750
- if (document.activeElement.classList.contains('grid-cell-input-field')) {
1867
+ if ((_document = document) !== null && _document !== void 0 && (_document$activeEleme = _document.activeElement) !== null && _document$activeEleme !== void 0 && _document$activeEleme.classList.contains('grid-cell-input-field')) {
1868
+ var _this2$grid;
1869
+
1751
1870
  if (document.activeElement.classList.contains('error')) {
1752
1871
  throw new ValidationError('Current input is invalid');
1753
1872
  } // Focus the grid again to commit any pending input changes
1754
1873
 
1755
1874
 
1756
- _this2.grid.focus();
1875
+ (_this2$grid = _this2.grid) === null || _this2$grid === void 0 ? void 0 : _this2$grid.focus();
1757
1876
  }
1758
1877
 
1759
1878
  var newPendingSavePromise = _this2.pending.add(model.commitPending()).then(() => {
@@ -1800,7 +1919,7 @@ export class IrisGrid extends Component {
1800
1919
  }
1801
1920
  /**
1802
1921
  * Select the passed in column and notify listener
1803
- * @param {dh.Column} column The column in this table to link
1922
+ * @param column The column in this table to link
1804
1923
  */
1805
1924
 
1806
1925
 
@@ -1825,15 +1944,17 @@ export class IrisGrid extends Component {
1825
1944
  var dataMap = {};
1826
1945
 
1827
1946
  for (var i = 0; i < columns.length; i += 1) {
1828
- var column = columns[i];
1947
+ var _column3 = columns[i];
1829
1948
  var {
1830
1949
  name,
1831
1950
  type
1832
- } = column;
1833
- var value = model.valueForCell(i, rowIndex);
1951
+ } = _column3;
1952
+
1953
+ var _value3 = model.valueForCell(i, rowIndex);
1954
+
1834
1955
  var text = model.textForCell(i, rowIndex);
1835
1956
  dataMap[name] = {
1836
- value,
1957
+ value: _value3,
1837
1958
  text,
1838
1959
  type
1839
1960
  };
@@ -1849,15 +1970,20 @@ export class IrisGrid extends Component {
1849
1970
  var {
1850
1971
  model
1851
1972
  } = this.props;
1852
- this.setAdvancedFilter(model.getColumnIndexByName(column.name), filter, options);
1973
+ var index = model.getColumnIndexByName(column.name);
1974
+ assertNotNull(index);
1975
+ this.setAdvancedFilter(index, filter, options);
1853
1976
  }
1854
1977
 
1855
1978
  handleAdvancedFilterSortChange(column, direction) {
1979
+ var _this$grid15;
1980
+
1856
1981
  var addToExisting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1857
1982
  var {
1858
1983
  model
1859
1984
  } = this.props;
1860
1985
  var columnIndex = model.getColumnIndexByName(column.name);
1986
+ assertNotNull(columnIndex);
1861
1987
  var oldSort = TableUtils.getSortForColumn(model.sort, columnIndex);
1862
1988
  var newSort = null;
1863
1989
 
@@ -1875,11 +2001,13 @@ export class IrisGrid extends Component {
1875
2001
  this.setState({
1876
2002
  sorts
1877
2003
  });
1878
- this.grid.forceUpdate();
2004
+ (_this$grid15 = this.grid) === null || _this$grid15 === void 0 ? void 0 : _this$grid15.forceUpdate();
1879
2005
  }
1880
2006
 
1881
2007
  handleAdvancedFilterDone() {
1882
- this.grid.focus();
2008
+ var _this$grid16;
2009
+
2010
+ (_this$grid16 = this.grid) === null || _this$grid16 === void 0 ? void 0 : _this$grid16.focus();
1883
2011
  }
1884
2012
 
1885
2013
  handleAdvancedMenuOpened(column) {
@@ -1889,13 +2017,17 @@ export class IrisGrid extends Component {
1889
2017
  }
1890
2018
 
1891
2019
  handleAdvancedMenuClosed(columnIndex) {
2020
+ var _this$filterInputRef;
2021
+
1892
2022
  var {
1893
2023
  focusedFilterBarColumn,
1894
2024
  isFilterBarShown
1895
2025
  } = this.state;
1896
2026
 
1897
- if (isFilterBarShown && focusedFilterBarColumn === columnIndex && this.filterInputRef.current !== null) {
1898
- this.filterInputRef.current.focus();
2027
+ if (isFilterBarShown && focusedFilterBarColumn === columnIndex && ((_this$filterInputRef = this.filterInputRef) === null || _this$filterInputRef === void 0 ? void 0 : _this$filterInputRef.current) !== null) {
2028
+ var _this$filterInputRef2;
2029
+
2030
+ (_this$filterInputRef2 = this.filterInputRef) === null || _this$filterInputRef2 === void 0 ? void 0 : _this$filterInputRef2.current.focus();
1899
2031
  this.setState({
1900
2032
  shownAdvancedFilter: null
1901
2033
  });
@@ -1934,14 +2066,19 @@ export class IrisGrid extends Component {
1934
2066
 
1935
2067
  handleFilterBarChange(value) {
1936
2068
  this.startLoading('Filtering...', true);
1937
- this.setState(_ref12 => {
2069
+ this.setState(_ref13 => {
1938
2070
  var {
1939
2071
  focusedFilterBarColumn,
1940
2072
  quickFilters
1941
- } = _ref12;
2073
+ } = _ref13;
1942
2074
  var newQuickFilters = new Map(quickFilters);
1943
- var modelIndex = this.getModelColumn(focusedFilterBarColumn);
1944
- this.applyQuickFilter(modelIndex, value, newQuickFilters);
2075
+
2076
+ if (focusedFilterBarColumn != null) {
2077
+ var modelIndex = this.getModelColumn(focusedFilterBarColumn);
2078
+ assertNotNull(modelIndex);
2079
+ this.applyQuickFilter(modelIndex, value, newQuickFilters);
2080
+ }
2081
+
1945
2082
  return {
1946
2083
  quickFilters: newQuickFilters
1947
2084
  };
@@ -1953,7 +2090,9 @@ export class IrisGrid extends Component {
1953
2090
  var defocusInput = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1954
2091
 
1955
2092
  if (setGridFocus) {
1956
- this.grid.focus();
2093
+ var _this$grid17;
2094
+
2095
+ (_this$grid17 = this.grid) === null || _this$grid17 === void 0 ? void 0 : _this$grid17.focus();
1957
2096
  }
1958
2097
 
1959
2098
  if (defocusInput) {
@@ -1967,6 +2106,7 @@ export class IrisGrid extends Component {
1967
2106
  var {
1968
2107
  focusedFilterBarColumn
1969
2108
  } = this.state;
2109
+ assertNotNull(focusedFilterBarColumn);
1970
2110
 
1971
2111
  if (backward) {
1972
2112
  this.focusFilterBar(focusedFilterBarColumn - 1);
@@ -1985,8 +2125,9 @@ export class IrisGrid extends Component {
1985
2125
  } = this.state;
1986
2126
  var customColumnFormatMap = new Map(prevCustomColumnFormatMap);
1987
2127
 
1988
- if (selectedFormat) {
2128
+ if (selectedFormat != null) {
1989
2129
  var normalizedType = TableUtils.getNormalizedType(column.type);
2130
+ assertNotNull(normalizedType);
1990
2131
  var columnFormattingRule = Formatter.makeColumnFormattingRule(normalizedType, column.name, selectedFormat);
1991
2132
  customColumnFormatMap.set(column.name, columnFormattingRule);
1992
2133
  } else {
@@ -2012,10 +2153,10 @@ export class IrisGrid extends Component {
2012
2153
  }
2013
2154
 
2014
2155
  handleMenuBack() {
2015
- this.setState(_ref13 => {
2156
+ this.setState(_ref14 => {
2016
2157
  var {
2017
2158
  openOptions
2018
- } = _ref13;
2159
+ } = _ref14;
2019
2160
  var newOptions = [...openOptions];
2020
2161
  newOptions.pop();
2021
2162
  return {
@@ -2025,10 +2166,10 @@ export class IrisGrid extends Component {
2025
2166
  }
2026
2167
 
2027
2168
  handleMenuSelect(option) {
2028
- this.setState(_ref14 => {
2169
+ this.setState(_ref15 => {
2029
2170
  var {
2030
2171
  openOptions
2031
- } = _ref14;
2172
+ } = _ref15;
2032
2173
  return {
2033
2174
  openOptions: [...openOptions, option]
2034
2175
  };
@@ -2036,7 +2177,8 @@ export class IrisGrid extends Component {
2036
2177
  }
2037
2178
 
2038
2179
  handleRequestFailed(event) {
2039
- log.error('request failed:', event.detail);
2180
+ var customEvent = event;
2181
+ log.error('request failed:', customEvent.detail);
2040
2182
  this.stopLoading();
2041
2183
 
2042
2184
  if (this.canRollback()) {
@@ -2047,11 +2189,13 @@ export class IrisGrid extends Component {
2047
2189
  var {
2048
2190
  onError
2049
2191
  } = this.props;
2050
- onError(new Error("Error displaying table: ".concat(event.detail)));
2192
+ onError(new Error("Error displaying table: ".concat(customEvent.detail)));
2051
2193
  }
2052
2194
  }
2053
2195
 
2054
2196
  handleUpdate() {
2197
+ var _this$grid18;
2198
+
2055
2199
  this.stopLoading();
2056
2200
  log.debug2('Received model update');
2057
2201
  var {
@@ -2083,26 +2227,27 @@ export class IrisGrid extends Component {
2083
2227
  this.lastLoadedConfig = null;
2084
2228
  }
2085
2229
 
2086
- this.grid.forceUpdate();
2230
+ (_this$grid18 = this.grid) === null || _this$grid18 === void 0 ? void 0 : _this$grid18.forceUpdate();
2087
2231
  }
2088
2232
 
2089
2233
  handleViewChanged(metrics) {
2090
- var _this$grid$state, _this$grid;
2234
+ var _this$grid$state, _this$grid19;
2091
2235
 
2092
2236
  var {
2093
2237
  model
2094
2238
  } = this.props;
2095
- var {
2096
- bottomViewport
2097
- } = metrics;
2098
2239
  var {
2099
2240
  selectionEndRow = 0
2100
- } = (_this$grid$state = (_this$grid = this.grid) === null || _this$grid === void 0 ? void 0 : _this$grid.state) !== null && _this$grid$state !== void 0 ? _this$grid$state : {};
2241
+ } = (_this$grid$state = (_this$grid19 = this.grid) === null || _this$grid19 === void 0 ? void 0 : _this$grid19.state) !== null && _this$grid$state !== void 0 ? _this$grid$state : {};
2101
2242
  var pendingRowCount = 0;
2102
2243
 
2103
- if (model.isEditable) {
2104
- // We have an editable table that we can add new rows to
2244
+ if (isEditableGridModel(model) && model.isEditable) {
2245
+ assertNotNull(metrics);
2246
+ var {
2247
+ bottomViewport
2248
+ } = metrics; // We have an editable table that we can add new rows to
2105
2249
  // Display empty rows beneath the table rows that user can fill in
2250
+
2106
2251
  var bottomNonFloating = model.rowCount - model.floatingBottomRowCount;
2107
2252
 
2108
2253
  if (selectionEndRow === bottomNonFloating - 1) {
@@ -2124,6 +2269,7 @@ export class IrisGrid extends Component {
2124
2269
  }
2125
2270
 
2126
2271
  handleSelectionChanged(selectedRanges) {
2272
+ assertNotNull(selectedRanges);
2127
2273
  var {
2128
2274
  onSelectionChanged
2129
2275
  } = this.props;
@@ -2144,7 +2290,7 @@ export class IrisGrid extends Component {
2144
2290
  }
2145
2291
 
2146
2292
  handleMovedColumnsChanged(movedColumns) {
2147
- var onChangeApplied = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
2293
+ var onChangeApplied = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => null;
2148
2294
  this.setState({
2149
2295
  movedColumns
2150
2296
  }, onChangeApplied);
@@ -2201,12 +2347,6 @@ export class IrisGrid extends Component {
2201
2347
  } // Apply live changes
2202
2348
 
2203
2349
 
2204
- handleConditionalFormatEditorUpdate(conditionalFormatPreview) {
2205
- this.setState({
2206
- conditionalFormatPreview
2207
- });
2208
- }
2209
-
2210
2350
  handleConditionalFormatEditorSave(config) {
2211
2351
  log.debug('Save conditional format changes', config);
2212
2352
  this.setState(state => {
@@ -2259,7 +2399,7 @@ export class IrisGrid extends Component {
2259
2399
  var newMovedColumns = IrisGridUtils.removeColumnFromMovedColumns(columns, movedColumns, removedColumnNames);
2260
2400
  var newSelectDistinctColumns = IrisGridUtils.removeColumnsFromSelectDistinctColumns(selectDistinctColumns, removedColumnNames);
2261
2401
 
2262
- if (newSorts.length !== sorts) {
2402
+ if (newSorts.length !== sorts.length) {
2263
2403
  log.debug('removing sorts from removed custom columns...');
2264
2404
  this.setState({
2265
2405
  sorts: newSorts
@@ -2290,8 +2430,7 @@ export class IrisGrid extends Component {
2290
2430
  }
2291
2431
 
2292
2432
  this.setState({
2293
- customColumns,
2294
- top: 0
2433
+ customColumns
2295
2434
  });
2296
2435
  this.startLoading('Applying custom columns...');
2297
2436
  }
@@ -2303,8 +2442,10 @@ export class IrisGrid extends Component {
2303
2442
  } = this.state;
2304
2443
 
2305
2444
  if (isReady) {
2445
+ var _this$grid20;
2446
+
2306
2447
  this.stopLoading();
2307
- this.grid.forceUpdate();
2448
+ (_this$grid20 = this.grid) === null || _this$grid20 === void 0 ? void 0 : _this$grid20.forceUpdate();
2308
2449
  } else {
2309
2450
  this.initState();
2310
2451
  }
@@ -2319,6 +2460,8 @@ export class IrisGrid extends Component {
2319
2460
  }
2320
2461
 
2321
2462
  handlePendingDataUpdated() {
2463
+ var _this$grid21;
2464
+
2322
2465
  log.debug('pending data updated');
2323
2466
  var {
2324
2467
  model
@@ -2332,11 +2475,11 @@ export class IrisGrid extends Component {
2332
2475
  pendingDataErrors,
2333
2476
  pendingSaveError: null
2334
2477
  });
2335
- this.grid.forceUpdate();
2478
+ (_this$grid21 = this.grid) === null || _this$grid21 === void 0 ? void 0 : _this$grid21.forceUpdate();
2336
2479
  }
2337
2480
  /**
2338
2481
  * User added, removed, or changed the order of aggregations, or position
2339
- * @param {AggregationSettings} aggregationSettings The new aggregation settings
2482
+ * @param aggregationSettings The new aggregation settings
2340
2483
  */
2341
2484
 
2342
2485
 
@@ -2349,17 +2492,17 @@ export class IrisGrid extends Component {
2349
2492
  }
2350
2493
  /**
2351
2494
  * A specific aggregation has been modified
2352
- * @param {Aggregation} aggregation The new aggregation
2495
+ * @param aggregation The new aggregation
2353
2496
  */
2354
2497
 
2355
2498
 
2356
2499
  handleAggregationChange(aggregation) {
2357
2500
  log.debug('handleAggregationChange', aggregation);
2358
2501
  this.startLoading("Aggregating ".concat(aggregation.operation, "..."));
2359
- this.setState(_ref15 => {
2502
+ this.setState(_ref16 => {
2360
2503
  var {
2361
2504
  aggregationSettings
2362
- } = _ref15;
2505
+ } = _ref16;
2363
2506
  return {
2364
2507
  selectedAggregation: aggregation,
2365
2508
  aggregationSettings: _objectSpread(_objectSpread({}, aggregationSettings), {}, {
@@ -2370,7 +2513,7 @@ export class IrisGrid extends Component {
2370
2513
  }
2371
2514
  /**
2372
2515
  * An aggregations has been selected for editing
2373
- * @param {Aggregation} aggregation The aggregation to edit
2516
+ * @param aggregation The aggregation to edit
2374
2517
  */
2375
2518
 
2376
2519
 
@@ -2439,20 +2582,16 @@ export class IrisGrid extends Component {
2439
2582
  }
2440
2583
  }
2441
2584
 
2442
- handleDownloadTable() {
2443
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2444
- args[_key] = arguments[_key];
2445
- }
2446
-
2585
+ handleDownloadTable(fileName, frozenTable, tableSubscription, gridRanges) {
2447
2586
  var {
2448
2587
  canDownloadCsv
2449
2588
  } = this.props;
2450
2589
 
2451
2590
  if (canDownloadCsv) {
2452
- log.info('start table downloading', ...args);
2591
+ log.info('start table downloading', fileName, frozenTable, tableSubscription, gridRanges);
2453
2592
  this.setState(() => {
2454
2593
  if (this.tableSaver) {
2455
- this.tableSaver.startDownload(...args);
2594
+ this.tableSaver.startDownload(fileName, frozenTable, tableSubscription, gridRanges);
2456
2595
  }
2457
2596
 
2458
2597
  return {
@@ -2465,25 +2604,14 @@ export class IrisGrid extends Component {
2465
2604
  }
2466
2605
 
2467
2606
  handleCancelDownloadTable() {
2468
- this.tableSaver.cancelDownload();
2607
+ var _this$tableSaver;
2608
+
2609
+ (_this$tableSaver = this.tableSaver) === null || _this$tableSaver === void 0 ? void 0 : _this$tableSaver.cancelDownload();
2469
2610
  this.setState({
2470
2611
  isTableDownloading: false
2471
2612
  });
2472
2613
  }
2473
2614
 
2474
- handleDownloadProgressUpdate(tableDownloadProgress, tableDownloadEstimatedTime) {
2475
- var {
2476
- tableDownloadStatus
2477
- } = this.state;
2478
-
2479
- if (tableDownloadStatus === TableCsvExporter.DOWNLOAD_STATUS.DOWNLOADING) {
2480
- this.setState({
2481
- tableDownloadProgress,
2482
- tableDownloadEstimatedTime
2483
- });
2484
- }
2485
- }
2486
-
2487
2615
  handleDownloadCompleted() {
2488
2616
  this.setState({
2489
2617
  isTableDownloading: false,
@@ -2501,7 +2629,7 @@ export class IrisGrid extends Component {
2501
2629
  }
2502
2630
  /**
2503
2631
  * Delete the specified ranges from the table.
2504
- * @param {GridRange[]} ranges The ranges to delete
2632
+ * @param ranges The ranges to delete
2505
2633
  */
2506
2634
 
2507
2635
 
@@ -2534,7 +2662,7 @@ export class IrisGrid extends Component {
2534
2662
  });
2535
2663
  } else {
2536
2664
  this.grid.setState({
2537
- cursor: Grid.CURSOR_TYPE_DEFAULT
2665
+ cursor: null
2538
2666
  });
2539
2667
  this.setState({
2540
2668
  hoverSelectColumn: null
@@ -2582,12 +2710,17 @@ export class IrisGrid extends Component {
2582
2710
  }
2583
2711
 
2584
2712
  getColumnBoundingRect() {
2713
+ var _this$gridWrapper2;
2714
+
2585
2715
  var {
2586
2716
  metrics,
2587
2717
  shownColumnTooltip
2588
2718
  } = this.state;
2589
- var gridRect = this.gridWrapper.getBoundingClientRect();
2719
+ assertNotNull(metrics);
2720
+ assertNotNull(shownColumnTooltip);
2721
+ var gridRect = (_this$gridWrapper2 = this.gridWrapper) === null || _this$gridWrapper2 === void 0 ? void 0 : _this$gridWrapper2.getBoundingClientRect();
2590
2722
  var popperMargin = 20;
2723
+ assertNotNull(gridRect);
2591
2724
  var {
2592
2725
  columnHeaderHeight,
2593
2726
  visibleColumnXs,
@@ -2596,13 +2729,21 @@ export class IrisGrid extends Component {
2596
2729
  } = metrics;
2597
2730
  var columnX = visibleColumnXs.get(shownColumnTooltip);
2598
2731
  var columnWidth = visibleColumnWidths.get(shownColumnTooltip);
2732
+ assertNotNull(columnX);
2733
+ assertNotNull(columnWidth);
2734
+ var left = gridRect.left + clamp(columnX + columnWidth / 2, popperMargin, width - popperMargin);
2599
2735
  return {
2600
2736
  top: gridRect.top,
2601
- left: gridRect.left + clamp(columnX + columnWidth / 2, popperMargin, width - popperMargin),
2737
+ left,
2602
2738
  bottom: gridRect.top + columnHeaderHeight,
2603
2739
  right: gridRect.left + clamp(columnX + columnWidth / 2, popperMargin, width - popperMargin) + 1,
2604
2740
  width: 1,
2605
- height: columnHeaderHeight
2741
+ height: columnHeaderHeight,
2742
+ x: left,
2743
+ y: gridRect.top,
2744
+ toJSON: () => {
2745
+ throw new Error('not implemented');
2746
+ }
2606
2747
  };
2607
2748
  }
2608
2749
 
@@ -2694,9 +2835,7 @@ export class IrisGrid extends Component {
2694
2835
 
2695
2836
  var theme = this.getTheme();
2696
2837
  var filter = this.getCachedFilter(customFilters, quickFilters, advancedFilters, partitionFilters, searchFilter);
2697
- var {
2698
- userColumnWidths
2699
- } = metricCalculator;
2838
+ var userColumnWidths = metricCalculator.getUserColumnWidths();
2700
2839
  var stateOverride = this.getCachedStateOverride(hoverSelectColumn, isFilterBarShown, isSelectingColumn, loadingScrimProgress, quickFilters, advancedFilters, sorts, reverseType, rollupConfig);
2701
2840
  var top = metrics ? metrics.top : 0;
2702
2841
  var bottom = metrics ? metrics.bottomViewport : 0;
@@ -2724,11 +2863,13 @@ export class IrisGrid extends Component {
2724
2863
  var columnWidth = visibleColumnWidths.get(focusedFilterBarColumn);
2725
2864
 
2726
2865
  if (columnX != null && columnWidth != null) {
2866
+ var _theme$filterBarHeigh, _theme$filterBarHeigh2, _this$grid22;
2867
+
2727
2868
  var x = gridX + columnX;
2728
- var y = gridY - theme.filterBarHeight;
2869
+ var y = gridY - ((_theme$filterBarHeigh = theme.filterBarHeight) !== null && _theme$filterBarHeigh !== void 0 ? _theme$filterBarHeigh : 0);
2729
2870
  var fieldWidth = columnWidth + 1; // cover right border
2730
2871
 
2731
- var fieldHeight = theme.filterBarHeight - 1; // remove bottom border
2872
+ var fieldHeight = ((_theme$filterBarHeigh2 = theme.filterBarHeight) !== null && _theme$filterBarHeigh2 !== void 0 ? _theme$filterBarHeigh2 : 0) - 1; // remove bottom border
2732
2873
 
2733
2874
  var style = {
2734
2875
  top: y,
@@ -2736,14 +2877,15 @@ export class IrisGrid extends Component {
2736
2877
  minWidth: fieldWidth,
2737
2878
  height: fieldHeight
2738
2879
  };
2739
- var value = '';
2880
+ var _value4 = '';
2740
2881
  var isValid = true;
2741
2882
  var modelColumn = this.getModelColumn(focusedFilterBarColumn);
2883
+ assertNotNull(modelColumn);
2742
2884
  var quickFilter = quickFilters.get(modelColumn);
2743
2885
  var advancedFilter = advancedFilters.get(modelColumn);
2744
2886
 
2745
2887
  if (quickFilter != null) {
2746
- value = quickFilter.text;
2888
+ _value4 = quickFilter.text;
2747
2889
  isValid = quickFilter.filter != null;
2748
2890
  }
2749
2891
 
@@ -2753,7 +2895,7 @@ export class IrisGrid extends Component {
2753
2895
  style: style,
2754
2896
  className: classNames({
2755
2897
  error: !isValid,
2756
- active: value !== '' || advancedFilter != null,
2898
+ active: _value4 !== '' || advancedFilter != null,
2757
2899
  'iris-grid-has-filter': isBarFiltered
2758
2900
  }),
2759
2901
  isAdvancedFilterSet: advancedFilter != null,
@@ -2766,9 +2908,9 @@ export class IrisGrid extends Component {
2766
2908
  onChange: this.handleFilterBarChange,
2767
2909
  onDone: this.handleFilterBarDone,
2768
2910
  onTab: this.handleFilterBarTab,
2769
- onContextMenu: this.grid.handleContextMenu,
2911
+ onContextMenu: (_this$grid22 = this.grid) === null || _this$grid22 === void 0 ? void 0 : _this$grid22.handleContextMenu,
2770
2912
  debounceMs: debounceMs,
2771
- value: value
2913
+ value: _value4
2772
2914
  });
2773
2915
  }
2774
2916
  }
@@ -2813,6 +2955,9 @@ export class IrisGrid extends Component {
2813
2955
  var _columnX = _visibleColumnXs.get(shownColumnTooltip);
2814
2956
 
2815
2957
  var _columnWidth = _visibleColumnWidths.get(shownColumnTooltip);
2958
+
2959
+ assertNotNull(_columnX);
2960
+ assertNotNull(_columnWidth);
2816
2961
  /**
2817
2962
  * Create a wrapper dom element, the size of the column header.
2818
2963
  * The wrapper acts as tooltip parent, the tooltip component
@@ -2821,7 +2966,6 @@ export class IrisGrid extends Component {
2821
2966
  * so popper only remains triggered while mouse is inside the panel.
2822
2967
  */
2823
2968
 
2824
-
2825
2969
  var boundedLeft = Math.max(0, _columnX);
2826
2970
  var boundedWidth = _columnWidth;
2827
2971
 
@@ -2866,34 +3010,39 @@ export class IrisGrid extends Component {
2866
3010
 
2867
3011
  var _modelColumn = this.getModelColumn(shownColumnTooltip);
2868
3012
 
2869
- var column = model.columns[_modelColumn];
2870
-
2871
- if (column != null) {
2872
- var _this$tooltip;
2873
-
2874
- columnTooltip = /*#__PURE__*/React.createElement("div", {
2875
- style: wrapperStyle
2876
- }, /*#__PURE__*/React.createElement(Tooltip, {
2877
- key: column.name,
2878
- timeout: 400,
2879
- interactive: true,
2880
- options: popperOptions,
2881
- ref: this.handleTooltipRef,
2882
- referenceObject: virtualReference,
2883
- onExited: () => {
2884
- this.setState({
2885
- shownColumnTooltip: null
2886
- });
2887
- }
2888
- }, /*#__PURE__*/React.createElement(ColumnStatistics, {
2889
- model: model,
2890
- column: column,
2891
- onStatistics: () => {
2892
- if (this.tooltip) this.tooltip.update();
2893
- }
2894
- }))); // #510 We may need to update the position of the tooltip if it's already opened and columns are resized
3013
+ if (_modelColumn != null) {
3014
+ var _this$tooltip2;
3015
+
3016
+ var _column4 = model.columns[_modelColumn];
3017
+
3018
+ if (_column4 != null) {
3019
+ columnTooltip = /*#__PURE__*/React.createElement("div", {
3020
+ style: wrapperStyle
3021
+ }, /*#__PURE__*/React.createElement(Tooltip, {
3022
+ key: _column4.name,
3023
+ timeout: 400,
3024
+ interactive: true,
3025
+ options: popperOptions,
3026
+ ref: this.handleTooltipRef,
3027
+ referenceObject: virtualReference,
3028
+ onExited: () => {
3029
+ this.setState({
3030
+ shownColumnTooltip: null
3031
+ });
3032
+ }
3033
+ }, /*#__PURE__*/React.createElement(ColumnStatistics, {
3034
+ model: model,
3035
+ column: _column4,
3036
+ onStatistics: () => {
3037
+ var _this$tooltip;
3038
+
3039
+ (_this$tooltip = this.tooltip) === null || _this$tooltip === void 0 ? void 0 : _this$tooltip.update();
3040
+ }
3041
+ })));
3042
+ } // #510 We may need to update the position of the tooltip if it's already opened and columns are resized
3043
+
2895
3044
 
2896
- (_this$tooltip = this.tooltip) === null || _this$tooltip === void 0 ? void 0 : _this$tooltip.update();
3045
+ (_this$tooltip2 = this.tooltip) === null || _this$tooltip2 === void 0 ? void 0 : _this$tooltip2.update();
2897
3046
  }
2898
3047
  }
2899
3048
 
@@ -2920,63 +3069,67 @@ export class IrisGrid extends Component {
2920
3069
 
2921
3070
  var modelColumn = _this4.getModelColumn(columnIndex);
2922
3071
 
2923
- var isFilterable = model.isFilterable(modelColumn);
2924
-
2925
- if (isFilterable && columnX != null && columnWidth != null && columnWidth > 0) {
2926
- var _x = _gridX + columnX + columnWidth - 24;
2927
-
2928
- var _y = _gridY2 - filterBarHeight + 2; // 2 acts as top margin for the button
2929
-
2930
-
2931
- var _style = {
2932
- position: 'absolute',
2933
- top: _y,
2934
- left: _x
2935
- };
2936
-
2937
- var _advancedFilter = advancedFilters.get(modelColumn);
2938
-
2939
- var isFilterSet = _advancedFilter != null;
2940
- var isFilterVisible = columnIndex === hoverAdvancedFilter || columnIndex === focusedFilterBarColumn || isFilterSet;
2941
- var element = /*#__PURE__*/React.createElement("div", {
2942
- className: classNames('advanced-filter-button-container', {
2943
- hidden: !isFilterVisible
2944
- }),
2945
- key: columnIndex,
2946
- style: _style
2947
- }, isFilterVisible && /*#__PURE__*/React.createElement("button", {
2948
- type: "button",
2949
- className: classNames('btn btn-link btn-link-icon advanced-filter-button', {
2950
- 'filter-set': isFilterSet
2951
- }),
2952
- onClick: () => {
2953
- _this4.setState({
2954
- shownAdvancedFilter: columnIndex
2955
- });
2956
- },
2957
- onContextMenu: event => {
2958
- _this4.grid.handleContextMenu(event);
2959
- },
2960
- onMouseEnter: () => {
2961
- _this4.setState({
2962
- hoverAdvancedFilter: columnIndex
2963
- });
2964
- },
2965
- onMouseLeave: () => {
2966
- _this4.setState({
2967
- hoverAdvancedFilter: null
2968
- });
2969
- }
2970
- }, /*#__PURE__*/React.createElement("div", {
2971
- className: "fa-layers"
2972
- }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
2973
- icon: dhFilterFilled,
2974
- className: "filter-solid"
2975
- }), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
2976
- icon: vsFilter,
2977
- className: "filter-light"
2978
- }))));
2979
- filterBar.push(element);
3072
+ if (modelColumn != null) {
3073
+ var isFilterable = model.isFilterable(modelColumn);
3074
+
3075
+ if (isFilterable && columnX != null && columnWidth != null && columnWidth > 0) {
3076
+ var _x = _gridX + columnX + columnWidth - 24;
3077
+
3078
+ var _y = _gridY2 - (filterBarHeight !== null && filterBarHeight !== void 0 ? filterBarHeight : 0) + 2; // 2 acts as top margin for the button
3079
+
3080
+
3081
+ var _style = {
3082
+ position: 'absolute',
3083
+ top: _y,
3084
+ left: _x
3085
+ };
3086
+
3087
+ var _advancedFilter = advancedFilters.get(modelColumn);
3088
+
3089
+ var isFilterSet = _advancedFilter != null;
3090
+ var isFilterVisible = columnIndex === hoverAdvancedFilter || columnIndex === focusedFilterBarColumn || isFilterSet;
3091
+ var element = /*#__PURE__*/React.createElement("div", {
3092
+ className: classNames('advanced-filter-button-container', {
3093
+ hidden: !isFilterVisible
3094
+ }),
3095
+ key: columnIndex,
3096
+ style: _style
3097
+ }, isFilterVisible && /*#__PURE__*/React.createElement("button", {
3098
+ type: "button",
3099
+ className: classNames('btn btn-link btn-link-icon advanced-filter-button', {
3100
+ 'filter-set': isFilterSet
3101
+ }),
3102
+ onClick: () => {
3103
+ _this4.setState({
3104
+ shownAdvancedFilter: columnIndex
3105
+ });
3106
+ },
3107
+ onContextMenu: event => {
3108
+ var _this4$grid;
3109
+
3110
+ (_this4$grid = _this4.grid) === null || _this4$grid === void 0 ? void 0 : _this4$grid.handleContextMenu(event);
3111
+ },
3112
+ onMouseEnter: () => {
3113
+ _this4.setState({
3114
+ hoverAdvancedFilter: columnIndex
3115
+ });
3116
+ },
3117
+ onMouseLeave: () => {
3118
+ _this4.setState({
3119
+ hoverAdvancedFilter: null
3120
+ });
3121
+ }
3122
+ }, /*#__PURE__*/React.createElement("div", {
3123
+ className: "fa-layers"
3124
+ }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
3125
+ icon: dhFilterFilled,
3126
+ className: "filter-solid"
3127
+ }), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
3128
+ icon: vsFilter,
3129
+ className: "filter-light"
3130
+ }))));
3131
+ filterBar.push(element);
3132
+ }
2980
3133
  }
2981
3134
  };
2982
3135
 
@@ -3023,30 +3176,32 @@ export class IrisGrid extends Component {
3023
3176
 
3024
3177
  var _modelColumn2 = _this4.getModelColumn(columnIndex);
3025
3178
 
3026
- var _column = model.columns[_modelColumn2];
3027
-
3028
- var _advancedFilter2 = advancedFilters.get(_modelColumn2);
3029
-
3030
- var {
3031
- options: advancedFilterOptions
3032
- } = _advancedFilter2 || {};
3033
- var sort = TableUtils.getSortForColumn(model.sort, _modelColumn2);
3034
- var sortDirection = sort ? sort.direction : null;
3035
- var element = /*#__PURE__*/React.createElement("div", {
3036
- key: columnIndex,
3037
- className: "advanced-filter-menu-container",
3038
- style: _style2
3039
- }, /*#__PURE__*/React.createElement(Popper, {
3040
- className: "advanced-filter-menu-popper",
3041
- onEntered: _this4.getAdvancedMenuOpenedHandler(columnIndex),
3042
- onExited: () => {
3043
- _this4.handleAdvancedMenuClosed(columnIndex);
3044
- },
3045
- isShown: shownAdvancedFilter === columnIndex,
3046
- interactive: true,
3047
- closeOnBlur: true
3048
- }, _this4.getCachedAdvancedFilterMenuActions(model, _column, advancedFilterOptions, sortDirection, formatter)));
3049
- advancedFilterMenus.push(element);
3179
+ if (_modelColumn2 != null) {
3180
+ var _column5 = model.columns[_modelColumn2];
3181
+
3182
+ var _advancedFilter2 = advancedFilters.get(_modelColumn2);
3183
+
3184
+ var {
3185
+ options: advancedFilterOptions
3186
+ } = _advancedFilter2 || {};
3187
+ var sort = TableUtils.getSortForColumn(model.sort, _modelColumn2);
3188
+ var sortDirection = sort ? sort.direction : null;
3189
+ var element = /*#__PURE__*/React.createElement("div", {
3190
+ key: columnIndex,
3191
+ className: "advanced-filter-menu-container",
3192
+ style: _style2
3193
+ }, /*#__PURE__*/React.createElement(Popper, {
3194
+ className: "advanced-filter-menu-popper",
3195
+ onEntered: _this4.getAdvancedMenuOpenedHandler(columnIndex),
3196
+ onExited: () => {
3197
+ _this4.handleAdvancedMenuClosed(columnIndex);
3198
+ },
3199
+ isShown: shownAdvancedFilter === columnIndex,
3200
+ interactive: true,
3201
+ closeOnBlur: true
3202
+ }, _this4.getCachedAdvancedFilterMenuActions(model, _column5, advancedFilterOptions, sortDirection, formatter)));
3203
+ advancedFilterMenus.push(element);
3204
+ }
3050
3205
  }
3051
3206
  };
3052
3207
 
@@ -3078,7 +3233,6 @@ export class IrisGrid extends Component {
3078
3233
 
3079
3234
  case OptionType.CONDITIONAL_FORMATTING:
3080
3235
  return /*#__PURE__*/React.createElement(ConditionalFormattingMenu, {
3081
- columns: model.columns,
3082
3236
  rules: conditionalFormats,
3083
3237
  onChange: this.handleConditionalFormatsChange,
3084
3238
  onCreate: this.handleConditionalFormatCreate,
@@ -3086,6 +3240,9 @@ export class IrisGrid extends Component {
3086
3240
  });
3087
3241
 
3088
3242
  case OptionType.CONDITIONAL_FORMATTING_EDIT:
3243
+ assertNotNull(model.columns);
3244
+ assertNotNull(conditionalFormatPreview);
3245
+ assertNotNull(this.handleConditionalFormatEditorUpdate);
3089
3246
  return /*#__PURE__*/React.createElement(ConditionalFormatEditor, {
3090
3247
  columns: model.columns,
3091
3248
  rule: conditionalFormatPreview,
@@ -3105,7 +3262,6 @@ export class IrisGrid extends Component {
3105
3262
 
3106
3263
  case OptionType.ROLLUP_ROWS:
3107
3264
  return /*#__PURE__*/React.createElement(RollupRows, {
3108
- metrics: metrics,
3109
3265
  model: model,
3110
3266
  onChange: this.handleRollupChange,
3111
3267
  config: rollupConfig,
@@ -3121,7 +3277,7 @@ export class IrisGrid extends Component {
3121
3277
  });
3122
3278
 
3123
3279
  case OptionType.AGGREGATION_EDIT:
3124
- return /*#__PURE__*/React.createElement(AggregationEdit, {
3280
+ return selectedAggregation && /*#__PURE__*/React.createElement(AggregationEdit, {
3125
3281
  aggregation: selectedAggregation,
3126
3282
  columns: model.originalColumns,
3127
3283
  onChange: this.handleAggregationChange
@@ -3134,7 +3290,7 @@ export class IrisGrid extends Component {
3134
3290
  isDownloading: isTableDownloading,
3135
3291
  tableDownloadStatus: tableDownloadStatus,
3136
3292
  tableDownloadProgress: tableDownloadProgress,
3137
- tableDownloadEstimatedTime: tableDownloadEstimatedTime,
3293
+ tableDownloadEstimatedTime: tableDownloadEstimatedTime !== null && tableDownloadEstimatedTime !== void 0 ? tableDownloadEstimatedTime : undefined,
3138
3294
  onDownload: this.handleDownloadTable,
3139
3295
  onDownloadStart: this.handleDownloadTableStart,
3140
3296
  onCancel: this.handleCancelDownloadTable,
@@ -3156,7 +3312,7 @@ export class IrisGrid extends Component {
3156
3312
  });
3157
3313
 
3158
3314
  default:
3159
- throw Error('Unexpected option type', option.type);
3315
+ throw Error("Unexpected option type ".concat(option.type));
3160
3316
  }
3161
3317
  });
3162
3318
  var hiddenColumns = this.getCachedHiddenColumns(IrisGridUtils.getHiddenColumns(userColumnWidths));
@@ -3181,9 +3337,7 @@ export class IrisGrid extends Component {
3181
3337
  className: "iris-grid-partition-selector-wrapper iris-grid-bar iris-grid-bar-primary"
3182
3338
  }, partitionTable && partitionColumn && /*#__PURE__*/React.createElement(IrisGridPartitionSelector, {
3183
3339
  table: partitionTable,
3184
- getFormattedString: function getFormattedString() {
3185
- return model.displayString(...arguments);
3186
- },
3340
+ getFormattedString: (value, type, stringName) => model.displayString(value, type, stringName),
3187
3341
  columnName: partitionColumn.name,
3188
3342
  partition: partition,
3189
3343
  onChange: this.handlePartitionChange,
@@ -3218,7 +3372,7 @@ export class IrisGrid extends Component {
3218
3372
  ref: grid => {
3219
3373
  this.grid = grid;
3220
3374
  },
3221
- isStickyBottom: !model.isEditable,
3375
+ isStickyBottom: !isEditableGridModel(model) || !model.isEditable,
3222
3376
  isStuckToBottom: isStuckToBottom,
3223
3377
  isStuckToRight: isStuckToRight,
3224
3378
  metricCalculator: metricCalculator,
@@ -3253,8 +3407,8 @@ export class IrisGrid extends Component {
3253
3407
  customColumns: customColumns,
3254
3408
  hiddenColumns: hiddenColumns,
3255
3409
  alwaysFetchColumns: this.getAlwaysFetchColumns(alwaysFetchColumns, model.columns, movedColumns, model.floatingLeftColumnCount, model.floatingRightColumnCount),
3256
- formatColumns: this.getCachedPreviewFormatColumns(this.getCachedModelColumns(model, customColumns), conditionalFormats, conditionalFormatPreview, // Disable the preview format when we press Back on the format edit page
3257
- ((_openOptions = openOptions[openOptions.length - 1]) === null || _openOptions === void 0 ? void 0 : _openOptions.type) === OptionType.CONDITIONAL_FORMATTING_EDIT ? conditionalFormatEditIndex : null),
3410
+ formatColumns: this.getCachedPreviewFormatColumns(this.getCachedModelColumns(model, customColumns), conditionalFormats, conditionalFormatPreview === null ? undefined : conditionalFormatPreview, // Disable the preview format when we press Back on the format edit page
3411
+ ((_openOptions = openOptions[openOptions.length - 1]) === null || _openOptions === void 0 ? void 0 : _openOptions.type) === OptionType.CONDITIONAL_FORMATTING_EDIT ? conditionalFormatEditIndex !== null && conditionalFormatEditIndex !== void 0 ? conditionalFormatEditIndex : undefined : undefined),
3258
3412
  rollupConfig: this.getModelRollupConfig(model.originalColumns, rollupConfig, aggregationSettings),
3259
3413
  totalsConfig: this.getModelTotalsConfig(model.columns, rollupConfig, aggregationSettings),
3260
3414
  selectDistinctColumns: selectDistinctColumns,
@@ -3273,7 +3427,7 @@ export class IrisGrid extends Component {
3273
3427
  }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
3274
3428
  icon: vsMenu,
3275
3429
  transform: "up-1"
3276
- }))), focusField, loadingElement, filterBar, columnTooltip, advancedFilterMenus, this.getOverflowButtonTooltip(overflowButtonTooltipProps)), /*#__PURE__*/React.createElement(PendingDataBottomBar, {
3430
+ }))), focusField, loadingElement, filterBar, columnTooltip, advancedFilterMenus, overflowButtonTooltipProps && this.getOverflowButtonTooltip(overflowButtonTooltipProps)), /*#__PURE__*/React.createElement(PendingDataBottomBar, {
3277
3431
  error: pendingSaveError,
3278
3432
  isSaving: pendingSavePromise != null,
3279
3433
  saveTooltip: "Commit (".concat(this.commitAction.shortcut.getDisplayText(), ")"),
@@ -3288,7 +3442,7 @@ export class IrisGrid extends Component {
3288
3442
  onDiscard: this.handlePendingDiscardClicked
3289
3443
  }), /*#__PURE__*/React.createElement(ToastBottomBar, null, toastMessage), /*#__PURE__*/React.createElement(IrisGridCopyHandler, {
3290
3444
  model: model,
3291
- copyOperation: copyOperation,
3445
+ copyOperation: copyOperation !== null && copyOperation !== void 0 ? copyOperation : undefined,
3292
3446
  onEntering: this.handleAnimationStart,
3293
3447
  onEntered: this.handleAnimationEnd,
3294
3448
  onExiting: this.handleAnimationStart,
@@ -3339,97 +3493,7 @@ _defineProperty(IrisGrid, "maxDebounce", 500);
3339
3493
 
3340
3494
  _defineProperty(IrisGrid, "loadingSpinnerDelay", 800);
3341
3495
 
3342
- IrisGrid.propTypes = {
3343
- children: PropTypes.node,
3344
- advancedFilters: PropTypes.instanceOf(Map),
3345
- advancedSettings: PropTypes.instanceOf(Map),
3346
- alwaysFetchColumns: PropTypes.arrayOf(PropTypes.string),
3347
- isFilterBarShown: PropTypes.bool,
3348
- applyInputFiltersOnInit: PropTypes.bool,
3349
- conditionalFormats: PropTypes.arrayOf(PropTypes.shape({})),
3350
- customColumnFormatMap: PropTypes.instanceOf(Map),
3351
- movedColumns: PropTypes.arrayOf(PropTypes.shape({
3352
- from: PropTypes.number.isRequired,
3353
- to: PropTypes.number.isRequired
3354
- })),
3355
- movedRows: PropTypes.arrayOf(PropTypes.shape({
3356
- from: PropTypes.number.isRequired,
3357
- to: PropTypes.number.isRequired
3358
- })),
3359
- inputFilters: PropTypes.arrayOf(PropTypes.shape({
3360
- name: PropTypes.string.isRequired,
3361
- type: PropTypes.string.isRequired,
3362
- value: PropTypes.string.isRequired
3363
- })),
3364
- customFilters: PropTypes.arrayOf(PropTypes.shape({})),
3365
- model: PropTypes.instanceOf(IrisGridModel).isRequired,
3366
- onCreateChart: PropTypes.func,
3367
- onColumnSelected: PropTypes.func,
3368
- onError: PropTypes.func,
3369
- onDataSelected: PropTypes.func,
3370
- onStateChange: PropTypes.func,
3371
- onPartitionAppend: PropTypes.func,
3372
- onAdvancedSettingsChange: PropTypes.func,
3373
- partition: PropTypes.string,
3374
- partitionColumn: APIPropTypes.Column,
3375
- sorts: PropTypes.arrayOf(PropTypes.shape({})),
3376
- reverseType: PropTypes.string,
3377
- quickFilters: PropTypes.instanceOf(Map),
3378
- customColumns: PropTypes.arrayOf(PropTypes.string),
3379
- selectDistinctColumns: PropTypes.arrayOf(PropTypes.string),
3380
- // These settings come from the redux store
3381
- settings: PropTypes.shape({
3382
- timeZone: PropTypes.string.isRequired,
3383
- defaultDateTimeFormat: PropTypes.string.isRequired,
3384
- showTimeZone: PropTypes.bool.isRequired,
3385
- showTSeparator: PropTypes.bool.isRequired,
3386
- truncateNumbersWithPound: PropTypes.bool.isRequired,
3387
- formatter: PropTypes.arrayOf(PropTypes.shape({})).isRequired
3388
- }),
3389
- userColumnWidths: PropTypes.instanceOf(Map),
3390
- userRowHeights: PropTypes.instanceOf(Map),
3391
- onSelectionChanged: PropTypes.func,
3392
- rollupConfig: PropTypes.shape({
3393
- columns: PropTypes.arrayOf(PropTypes.string),
3394
- showConstituents: PropTypes.bool,
3395
- showNonAggregatedColumns: PropTypes.bool,
3396
- includeDescriptions: PropTypes.bool
3397
- }),
3398
- aggregationSettings: PropTypes.shape({
3399
- aggregations: PropTypes.arrayOf(PropTypes.shape({
3400
- operation: PropTypes.string.isRequired,
3401
- selected: PropTypes.arrayOf(PropTypes.string).isRequired,
3402
- invert: PropTypes.bool.isRequired
3403
- })),
3404
- showOnTop: PropTypes.bool
3405
- }),
3406
- isSelectingColumn: PropTypes.bool,
3407
- isSelectingPartition: PropTypes.bool,
3408
- isStuckToBottom: PropTypes.bool,
3409
- isStuckToRight: PropTypes.bool,
3410
- // eslint-disable-next-line react/no-unused-prop-types
3411
- columnSelectionValidator: PropTypes.func,
3412
- columnAllowedCursor: PropTypes.string,
3413
- // eslint-disable-next-line react/no-unused-prop-types
3414
- columnNotAllowedCursor: PropTypes.string,
3415
- name: PropTypes.string,
3416
- onlyFetchVisibleColumns: PropTypes.bool,
3417
- showSearchBar: PropTypes.bool,
3418
- searchValue: PropTypes.string,
3419
- selectedSearchColumns: PropTypes.arrayOf(PropTypes.string),
3420
- invertSearchColumns: PropTypes.bool,
3421
- // eslint-disable-next-line react/no-unused-prop-types
3422
- onContextMenu: PropTypes.func,
3423
- pendingDataMap: PropTypes.instanceOf(Map),
3424
- getDownloadWorker: PropTypes.func,
3425
- canCopy: PropTypes.bool,
3426
- canDownloadCsv: PropTypes.bool,
3427
- frozenColumns: PropTypes.arrayOf(PropTypes.string),
3428
- // Theme override for IrisGridTheme
3429
- theme: PropTypes.shape({}),
3430
- canToggleSearch: PropTypes.bool
3431
- };
3432
- IrisGrid.defaultProps = {
3496
+ _defineProperty(IrisGrid, "defaultProps", {
3433
3497
  children: null,
3434
3498
  advancedFilters: new Map(),
3435
3499
  advancedSettings: new Map(),
@@ -3443,12 +3507,12 @@ IrisGrid.defaultProps = {
3443
3507
  inputFilters: [],
3444
3508
  customFilters: [],
3445
3509
  onCreateChart: undefined,
3446
- onColumnSelected: () => {},
3447
- onDataSelected: () => {},
3448
- onError: () => {},
3449
- onStateChange: () => {},
3450
- onPartitionAppend: () => {},
3451
- onAdvancedSettingsChange: () => {},
3510
+ onColumnSelected: () => undefined,
3511
+ onDataSelected: () => undefined,
3512
+ onError: () => undefined,
3513
+ onStateChange: () => undefined,
3514
+ onPartitionAppend: () => undefined,
3515
+ onAdvancedSettingsChange: () => undefined,
3452
3516
  partition: null,
3453
3517
  partitionColumn: null,
3454
3518
  quickFilters: new Map(),
@@ -3457,10 +3521,10 @@ IrisGrid.defaultProps = {
3457
3521
  reverseType: TableUtils.REVERSE_TYPE.NONE,
3458
3522
  customColumns: [],
3459
3523
  aggregationSettings: DEFAULT_AGGREGATION_SETTINGS,
3460
- rollupConfig: null,
3524
+ rollupConfig: undefined,
3461
3525
  userColumnWidths: new Map(),
3462
3526
  userRowHeights: new Map(),
3463
- onSelectionChanged: () => {},
3527
+ onSelectionChanged: () => undefined,
3464
3528
  isSelectingColumn: false,
3465
3529
  isSelectingPartition: false,
3466
3530
  isStuckToBottom: false,
@@ -3474,7 +3538,7 @@ IrisGrid.defaultProps = {
3474
3538
  searchValue: '',
3475
3539
  selectedSearchColumns: null,
3476
3540
  invertSearchColumns: true,
3477
- onContextMenu: () => [],
3541
+ onContextMenu: () => undefined,
3478
3542
  pendingDataMap: new Map(),
3479
3543
  getDownloadWorker: undefined,
3480
3544
  settings: {
@@ -3496,6 +3560,7 @@ IrisGrid.defaultProps = {
3496
3560
  frozenColumns: null,
3497
3561
  theme: {},
3498
3562
  canToggleSearch: true
3499
- };
3563
+ });
3564
+
3500
3565
  export default IrisGrid;
3501
3566
  //# sourceMappingURL=IrisGrid.js.map