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