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