@deephaven/iris-grid 0.59.1-beta.0 → 0.59.1-beta.4
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/EmptyIrisGridModel.d.ts +62 -0
- package/dist/EmptyIrisGridModel.d.ts.map +1 -0
- package/dist/EmptyIrisGridModel.js +168 -0
- package/dist/EmptyIrisGridModel.js.map +1 -0
- package/dist/IrisGrid.d.ts +17 -14
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +151 -146
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridModel.d.ts +5 -4
- package/dist/IrisGridModel.d.ts.map +1 -1
- package/dist/IrisGridModel.js +2 -1
- package/dist/IrisGridModel.js.map +1 -1
- package/dist/IrisGridModelFactory.d.ts +2 -2
- package/dist/IrisGridModelFactory.d.ts.map +1 -1
- package/dist/IrisGridModelFactory.js +1 -1
- package/dist/IrisGridModelFactory.js.map +1 -1
- package/dist/IrisGridModelUpdater.d.ts +3 -1
- package/dist/IrisGridModelUpdater.d.ts.map +1 -1
- package/dist/IrisGridModelUpdater.js +8 -1
- package/dist/IrisGridModelUpdater.js.map +1 -1
- package/dist/IrisGridPartitionSelector.css +14 -36
- package/dist/IrisGridPartitionSelector.css.map +1 -1
- package/dist/IrisGridPartitionSelector.d.ts +39 -38
- package/dist/IrisGridPartitionSelector.d.ts.map +1 -1
- package/dist/IrisGridPartitionSelector.js +253 -227
- package/dist/IrisGridPartitionSelector.js.map +1 -1
- package/dist/IrisGridPartitionedTableModel.d.ts +25 -0
- package/dist/IrisGridPartitionedTableModel.d.ts.map +1 -0
- package/dist/IrisGridPartitionedTableModel.js +74 -0
- package/dist/IrisGridPartitionedTableModel.js.map +1 -0
- package/dist/IrisGridProxyModel.d.ts +18 -4
- package/dist/IrisGridProxyModel.d.ts.map +1 -1
- package/dist/IrisGridProxyModel.js +84 -5
- package/dist/IrisGridProxyModel.js.map +1 -1
- package/dist/IrisGridTableModel.d.ts +14 -4
- package/dist/IrisGridTableModel.d.ts.map +1 -1
- package/dist/IrisGridTableModel.js +96 -21
- package/dist/IrisGridTableModel.js.map +1 -1
- package/dist/IrisGridTableModelTemplate.d.ts +7 -7
- package/dist/IrisGridTableModelTemplate.d.ts.map +1 -1
- package/dist/IrisGridTableModelTemplate.js +1 -1
- package/dist/IrisGridTableModelTemplate.js.map +1 -1
- package/dist/IrisGridTreeTableModel.js +2 -4
- package/dist/IrisGridTreeTableModel.js.map +1 -1
- package/dist/IrisGridUtils.d.ts +7 -7
- package/dist/IrisGridUtils.d.ts.map +1 -1
- package/dist/IrisGridUtils.js +33 -34
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/MissingPartitionError.d.ts +6 -0
- package/dist/MissingPartitionError.d.ts.map +1 -0
- package/dist/MissingPartitionError.js +14 -0
- package/dist/MissingPartitionError.js.map +1 -0
- package/dist/PartitionedGridModel.d.ts +38 -0
- package/dist/PartitionedGridModel.d.ts.map +1 -0
- package/dist/PartitionedGridModel.js +15 -0
- package/dist/PartitionedGridModel.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +16 -15
- package/dist/PartitionSelectorSearch.css +0 -23
- package/dist/PartitionSelectorSearch.css.map +0 -1
- package/dist/PartitionSelectorSearch.d.ts +0 -78
- package/dist/PartitionSelectorSearch.d.ts.map +0 -1
- package/dist/PartitionSelectorSearch.js +0 -343
- package/dist/PartitionSelectorSearch.js.map +0 -1
package/dist/IrisGrid.js
CHANGED
|
@@ -40,6 +40,7 @@ import { Aggregations, AggregationEdit, AggregationUtils, ChartBuilder, CustomCo
|
|
|
40
40
|
import IrisGridUtils from "./IrisGridUtils.js";
|
|
41
41
|
import CrossColumnSearch from "./CrossColumnSearch.js";
|
|
42
42
|
import IrisGridModel from "./IrisGridModel.js";
|
|
43
|
+
import { isPartitionedGridModel } from "./PartitionedGridModel.js";
|
|
43
44
|
import IrisGridPartitionSelector from "./IrisGridPartitionSelector.js";
|
|
44
45
|
import SelectDistinctBuilder from "./sidebar/SelectDistinctBuilder.js";
|
|
45
46
|
import AdvancedSettingsType from "./sidebar/AdvancedSettingsType.js";
|
|
@@ -51,6 +52,7 @@ import IrisGridCellOverflowModal from "./IrisGridCellOverflowModal.js";
|
|
|
51
52
|
import GotoRow from "./GotoRow.js";
|
|
52
53
|
import AggregationOperation from "./sidebar/aggregations/AggregationOperation.js";
|
|
53
54
|
import { IrisGridThemeContext } from "./IrisGridThemeProvider.js";
|
|
55
|
+
import { isMissingPartitionError } from "./MissingPartitionError.js";
|
|
54
56
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
55
57
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
56
58
|
var log = Log.module('IrisGrid');
|
|
@@ -297,7 +299,7 @@ export class IrisGrid extends Component {
|
|
|
297
299
|
}), {
|
|
298
300
|
max: 1
|
|
299
301
|
}));
|
|
300
|
-
_defineProperty(this, "getCachedFilter", memoize((customFilters, quickFilters, advancedFilters,
|
|
302
|
+
_defineProperty(this, "getCachedFilter", memoize((customFilters, quickFilters, advancedFilters, searchFilter) => [...(customFilters !== null && customFilters !== void 0 ? customFilters : []), ...IrisGridUtils.getFiltersFromFilterMap(quickFilters), ...IrisGridUtils.getFiltersFromFilterMap(advancedFilters), ...(searchFilter !== undefined ? [searchFilter] : [])], {
|
|
301
303
|
max: 1
|
|
302
304
|
}));
|
|
303
305
|
_defineProperty(this, "getCachedTheme", memoize((contextTheme, theme, isEditable, floatingRowCount) => {
|
|
@@ -496,8 +498,6 @@ export class IrisGrid extends Component {
|
|
|
496
498
|
this.handleDownloadCanceled = this.handleDownloadCanceled.bind(this);
|
|
497
499
|
this.handleDownloadCompleted = this.handleDownloadCompleted.bind(this);
|
|
498
500
|
this.handlePartitionChange = this.handlePartitionChange.bind(this);
|
|
499
|
-
this.handlePartitionFetchAll = this.handlePartitionFetchAll.bind(this);
|
|
500
|
-
this.handlePartitionDone = this.handlePartitionDone.bind(this);
|
|
501
501
|
this.handleColumnVisibilityChanged = this.handleColumnVisibilityChanged.bind(this);
|
|
502
502
|
this.handleColumnVisibilityReset = this.handleColumnVisibilityReset.bind(this);
|
|
503
503
|
this.handleCrossColumnSearch = this.handleCrossColumnSearch.bind(this);
|
|
@@ -566,11 +566,11 @@ export class IrisGrid extends Component {
|
|
|
566
566
|
customColumnFormatMap,
|
|
567
567
|
isFilterBarShown: _isFilterBarShown,
|
|
568
568
|
isSelectingPartition,
|
|
569
|
+
partitions,
|
|
570
|
+
partitionConfig,
|
|
569
571
|
model: _model,
|
|
570
572
|
movedColumns: movedColumnsProp,
|
|
571
573
|
movedRows: movedRowsProp,
|
|
572
|
-
partitions,
|
|
573
|
-
partitionColumns,
|
|
574
574
|
rollupConfig: _rollupConfig,
|
|
575
575
|
userColumnWidths: _userColumnWidths,
|
|
576
576
|
userRowHeights,
|
|
@@ -614,10 +614,10 @@ export class IrisGrid extends Component {
|
|
|
614
614
|
metrics: undefined,
|
|
615
615
|
keyHandlers,
|
|
616
616
|
mouseHandlers,
|
|
617
|
-
partitions
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
617
|
+
partitionConfig: partitionConfig !== null && partitionConfig !== void 0 ? partitionConfig : partitions && partitions.length ? {
|
|
618
|
+
partitions,
|
|
619
|
+
mode: 'partition'
|
|
620
|
+
} : undefined,
|
|
621
621
|
// setAdvancedFilter and setQuickFilter mutate the arguments
|
|
622
622
|
// so we want to always use map copies from the state instead of props
|
|
623
623
|
quickFilters: _quickFilters ? new Map(_quickFilters) : new Map(),
|
|
@@ -688,15 +688,9 @@ export class IrisGrid extends Component {
|
|
|
688
688
|
}
|
|
689
689
|
componentDidMount() {
|
|
690
690
|
var {
|
|
691
|
-
partitionColumns,
|
|
692
691
|
model
|
|
693
692
|
} = this.props;
|
|
694
|
-
|
|
695
|
-
if (model.isFilterRequired && model.isValuesTableAvailable && columns.length) {
|
|
696
|
-
this.loadPartitionsTable(columns);
|
|
697
|
-
} else {
|
|
698
|
-
this.initState();
|
|
699
|
-
}
|
|
693
|
+
this.initState();
|
|
700
694
|
this.startListening(model);
|
|
701
695
|
}
|
|
702
696
|
componentDidUpdate(prevProps, prevState) {
|
|
@@ -1237,6 +1231,20 @@ export class IrisGrid extends Component {
|
|
|
1237
1231
|
this.updateFormatterSettings(settings);
|
|
1238
1232
|
}
|
|
1239
1233
|
initState() {
|
|
1234
|
+
var {
|
|
1235
|
+
model
|
|
1236
|
+
} = this.props;
|
|
1237
|
+
try {
|
|
1238
|
+
if (isPartitionedGridModel(model) && model.isPartitionRequired) {
|
|
1239
|
+
this.loadPartitionsTable(model);
|
|
1240
|
+
} else {
|
|
1241
|
+
this.loadTableState();
|
|
1242
|
+
}
|
|
1243
|
+
} catch (error) {
|
|
1244
|
+
this.handleTableLoadError(error);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
loadTableState() {
|
|
1240
1248
|
var {
|
|
1241
1249
|
applyInputFiltersOnInit,
|
|
1242
1250
|
inputFilters,
|
|
@@ -1265,67 +1273,72 @@ export class IrisGrid extends Component {
|
|
|
1265
1273
|
});
|
|
1266
1274
|
this.initFormatter();
|
|
1267
1275
|
}
|
|
1268
|
-
loadPartitionsTable(
|
|
1276
|
+
loadPartitionsTable(model) {
|
|
1269
1277
|
var _this = this;
|
|
1270
1278
|
return _asyncToGenerator(function* () {
|
|
1271
|
-
var {
|
|
1272
|
-
model
|
|
1273
|
-
} = _this.props;
|
|
1274
|
-
_this.setState({
|
|
1275
|
-
isSelectingPartition: true
|
|
1276
|
-
});
|
|
1277
1279
|
try {
|
|
1278
|
-
var
|
|
1279
|
-
var columns = partitionTable.columns.slice(0, partitionColumns.length);
|
|
1280
|
-
var sorts = columns.map(column => column.sort().desc());
|
|
1281
|
-
partitionTable.applySort(sorts);
|
|
1282
|
-
partitionTable.setViewport(0, 0, columns);
|
|
1283
|
-
var _data = yield _this.pending.add(partitionTable.getViewportData());
|
|
1284
|
-
if (_data.rows.length > 0) {
|
|
1285
|
-
var row = _data.rows[0];
|
|
1286
|
-
var values = columns.map(column => row.get(column));
|
|
1287
|
-
_this.updatePartition(values, partitionColumns);
|
|
1288
|
-
_this.setState({
|
|
1289
|
-
isSelectingPartition: true
|
|
1290
|
-
});
|
|
1291
|
-
} else {
|
|
1292
|
-
log.info('Table does not have any data, just fetching all');
|
|
1293
|
-
_this.setState({
|
|
1294
|
-
isSelectingPartition: false
|
|
1295
|
-
});
|
|
1296
|
-
_this.handlePartitionFetchAll();
|
|
1297
|
-
}
|
|
1280
|
+
var partitionConfig = yield _this.getInitialPartitionConfig(model);
|
|
1298
1281
|
_this.setState({
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
},
|
|
1302
|
-
_this.initState();
|
|
1303
|
-
});
|
|
1282
|
+
isSelectingPartition: true,
|
|
1283
|
+
partitionConfig
|
|
1284
|
+
}, _this.loadTableState);
|
|
1304
1285
|
} catch (error) {
|
|
1305
|
-
|
|
1286
|
+
if (!PromiseUtils.isCanceled(error)) {
|
|
1287
|
+
_this.handleTableLoadError(error);
|
|
1288
|
+
}
|
|
1306
1289
|
}
|
|
1307
1290
|
})();
|
|
1308
1291
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* Gets the initial partition config for the currently set model.
|
|
1295
|
+
* Sorts the key table and gets the first key.
|
|
1296
|
+
* If the table is ticking, it will wait for the first tick.
|
|
1297
|
+
*/
|
|
1298
|
+
getInitialPartitionConfig(model) {
|
|
1299
|
+
var _this2 = this;
|
|
1300
|
+
return _asyncToGenerator(function* () {
|
|
1301
|
+
var {
|
|
1302
|
+
partitionConfig
|
|
1303
|
+
} = _this2.state;
|
|
1304
|
+
if (partitionConfig !== undefined) {
|
|
1305
|
+
// User already has a partition selected, just use that
|
|
1306
|
+
return partitionConfig;
|
|
1323
1307
|
}
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1308
|
+
var keyTable = yield _this2.pending.add(model.partitionKeysTable(), resolved => resolved.close());
|
|
1309
|
+
var {
|
|
1310
|
+
dh
|
|
1311
|
+
} = model;
|
|
1312
|
+
var sorts = keyTable.columns.map(column => column.sort().desc());
|
|
1313
|
+
keyTable.applySort(sorts);
|
|
1314
|
+
keyTable.setViewport(0, 0);
|
|
1315
|
+
return new Promise((resolve, reject) => {
|
|
1316
|
+
// We want to wait for the first UPDATED event instead of just getting viewport data here
|
|
1317
|
+
// It's possible that the key table does not have any rows of data yet, so just wait until it does have one
|
|
1318
|
+
keyTable.addEventListener(dh.Table.EVENT_UPDATED, event => {
|
|
1319
|
+
try {
|
|
1320
|
+
var {
|
|
1321
|
+
detail: _data
|
|
1322
|
+
} = event;
|
|
1323
|
+
if (_data.rows.length === 0) {
|
|
1324
|
+
// Table is empty, wait for the next updated event
|
|
1325
|
+
return;
|
|
1326
|
+
}
|
|
1327
|
+
var row = _data.rows[0];
|
|
1328
|
+
var values = keyTable.columns.map(column => row.get(column));
|
|
1329
|
+
var newPartition = {
|
|
1330
|
+
partitions: values,
|
|
1331
|
+
mode: 'partition'
|
|
1332
|
+
};
|
|
1333
|
+
keyTable.close();
|
|
1334
|
+
resolve(newPartition);
|
|
1335
|
+
} catch (e) {
|
|
1336
|
+
keyTable.close();
|
|
1337
|
+
reject(e);
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
});
|
|
1341
|
+
})();
|
|
1329
1342
|
}
|
|
1330
1343
|
copyCell(columnIndex, rowIndex) {
|
|
1331
1344
|
var rawValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -1685,24 +1698,10 @@ export class IrisGrid extends Component {
|
|
|
1685
1698
|
log.debug2('handleAnimationEnd');
|
|
1686
1699
|
this.isAnimating = false;
|
|
1687
1700
|
}
|
|
1688
|
-
handlePartitionChange(
|
|
1689
|
-
|
|
1690
|
-
partitionColumns
|
|
1691
|
-
} = this.state;
|
|
1692
|
-
if (partitionColumns.length === 0) {
|
|
1693
|
-
return;
|
|
1694
|
-
}
|
|
1695
|
-
this.updatePartition(partitions, partitionColumns);
|
|
1696
|
-
}
|
|
1697
|
-
handlePartitionFetchAll() {
|
|
1698
|
-
this.setState({
|
|
1699
|
-
partitionFilters: [],
|
|
1700
|
-
isSelectingPartition: false
|
|
1701
|
-
});
|
|
1702
|
-
}
|
|
1703
|
-
handlePartitionDone() {
|
|
1701
|
+
handlePartitionChange(partitionConfig) {
|
|
1702
|
+
this.startLoading('Partitioning...');
|
|
1704
1703
|
this.setState({
|
|
1705
|
-
|
|
1704
|
+
partitionConfig
|
|
1706
1705
|
});
|
|
1707
1706
|
}
|
|
1708
1707
|
handleTableLoadError(error) {
|
|
@@ -1800,15 +1799,15 @@ export class IrisGrid extends Component {
|
|
|
1800
1799
|
} else {
|
|
1801
1800
|
var columnIndex = 0;
|
|
1802
1801
|
var {
|
|
1803
|
-
model:
|
|
1802
|
+
model: _model2
|
|
1804
1803
|
} = this.props;
|
|
1805
1804
|
var {
|
|
1806
1805
|
columnCount
|
|
1807
|
-
} =
|
|
1806
|
+
} = _model2;
|
|
1808
1807
|
for (var i = 0; i < columnCount; i += 1) {
|
|
1809
1808
|
var modelColumn = this.getModelColumn(i);
|
|
1810
1809
|
if (modelColumn != null) {
|
|
1811
|
-
var _column =
|
|
1810
|
+
var _column = _model2.columns[modelColumn];
|
|
1812
1811
|
if (_column != null && TableUtils.isTextType(_column.type)) {
|
|
1813
1812
|
columnIndex = i;
|
|
1814
1813
|
break;
|
|
@@ -1916,60 +1915,60 @@ export class IrisGrid extends Component {
|
|
|
1916
1915
|
});
|
|
1917
1916
|
}
|
|
1918
1917
|
commitPending() {
|
|
1919
|
-
var
|
|
1918
|
+
var _this3 = this;
|
|
1920
1919
|
return _asyncToGenerator(function* () {
|
|
1921
1920
|
var _document, _document$activeEleme;
|
|
1922
1921
|
var {
|
|
1923
1922
|
model
|
|
1924
|
-
} =
|
|
1923
|
+
} = _this3.props;
|
|
1925
1924
|
if (!isEditableGridModel(model) || !model.isEditable) {
|
|
1926
1925
|
throw new Error('Cannot save, table is not editable');
|
|
1927
1926
|
}
|
|
1928
1927
|
var {
|
|
1929
1928
|
pendingSavePromise
|
|
1930
|
-
} =
|
|
1929
|
+
} = _this3.state;
|
|
1931
1930
|
if (pendingSavePromise != null) {
|
|
1932
1931
|
throw new Error('Save already in progress');
|
|
1933
1932
|
}
|
|
1934
1933
|
var containsGridCellInputField = (_document = document) === null || _document === void 0 ? void 0 : (_document$activeEleme = _document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.classList.contains('grid-cell-input-field');
|
|
1935
1934
|
if (containsGridCellInputField != null && containsGridCellInputField) {
|
|
1936
|
-
var
|
|
1935
|
+
var _this3$grid;
|
|
1937
1936
|
if (document.activeElement != null && document.activeElement.classList.contains('error')) {
|
|
1938
1937
|
throw new ValidationError('Current input is invalid');
|
|
1939
1938
|
}
|
|
1940
1939
|
|
|
1941
1940
|
// Focus the grid again to commit any pending input changes
|
|
1942
|
-
(
|
|
1941
|
+
(_this3$grid = _this3.grid) === null || _this3$grid === void 0 ? void 0 : _this3$grid.focus();
|
|
1943
1942
|
}
|
|
1944
|
-
var newPendingSavePromise =
|
|
1945
|
-
|
|
1943
|
+
var newPendingSavePromise = _this3.pending.add(model.commitPending()).then(() => {
|
|
1944
|
+
_this3.setState({
|
|
1946
1945
|
pendingSaveError: null,
|
|
1947
1946
|
pendingSavePromise: null
|
|
1948
1947
|
});
|
|
1949
1948
|
}).catch(err => {
|
|
1950
1949
|
if (!PromiseUtils.isCanceled(err)) {
|
|
1951
|
-
|
|
1950
|
+
_this3.setState({
|
|
1952
1951
|
pendingSaveError: err,
|
|
1953
1952
|
pendingSavePromise: null
|
|
1954
1953
|
});
|
|
1955
1954
|
}
|
|
1956
1955
|
});
|
|
1957
|
-
|
|
1956
|
+
_this3.setState({
|
|
1958
1957
|
pendingSavePromise: newPendingSavePromise
|
|
1959
1958
|
});
|
|
1960
1959
|
return newPendingSavePromise;
|
|
1961
1960
|
})();
|
|
1962
1961
|
}
|
|
1963
1962
|
discardPending() {
|
|
1964
|
-
var
|
|
1963
|
+
var _this4 = this;
|
|
1965
1964
|
return _asyncToGenerator(function* () {
|
|
1966
1965
|
var {
|
|
1967
1966
|
pendingSavePromise
|
|
1968
|
-
} =
|
|
1967
|
+
} = _this4.state;
|
|
1969
1968
|
if (pendingSavePromise != null) {
|
|
1970
1969
|
throw new Error('Cannot cancel a save in progress');
|
|
1971
1970
|
}
|
|
1972
|
-
|
|
1971
|
+
_this4.setState({
|
|
1973
1972
|
pendingSavePromise: null,
|
|
1974
1973
|
pendingSaveError: null,
|
|
1975
1974
|
pendingDataMap: new Map(),
|
|
@@ -1993,7 +1992,7 @@ export class IrisGrid extends Component {
|
|
|
1993
1992
|
* Select all the data for a given row and notify listener
|
|
1994
1993
|
*/
|
|
1995
1994
|
selectData(columnIndex, rowIndex) {
|
|
1996
|
-
var
|
|
1995
|
+
var _this5 = this;
|
|
1997
1996
|
var {
|
|
1998
1997
|
model
|
|
1999
1998
|
} = this.props;
|
|
@@ -2010,7 +2009,7 @@ export class IrisGrid extends Component {
|
|
|
2010
2009
|
} = column;
|
|
2011
2010
|
var value = model.valueForCell(i, rowIndex);
|
|
2012
2011
|
var text = model.textForCell(i, rowIndex);
|
|
2013
|
-
var visibleIndex =
|
|
2012
|
+
var visibleIndex = _this5.getVisibleColumn(i);
|
|
2014
2013
|
var isExpandable = isExpandableGridModel(model) && model.isRowExpandable(rowIndex);
|
|
2015
2014
|
var isGrouped = groupedColumns.find(c => c.name === name) != null;
|
|
2016
2015
|
dataMap[name] = {
|
|
@@ -2224,10 +2223,23 @@ export class IrisGrid extends Component {
|
|
|
2224
2223
|
});
|
|
2225
2224
|
}
|
|
2226
2225
|
handleRequestFailed(event) {
|
|
2227
|
-
var
|
|
2228
|
-
|
|
2226
|
+
var {
|
|
2227
|
+
detail: error
|
|
2228
|
+
} = event;
|
|
2229
|
+
log.error('request failed:', error);
|
|
2229
2230
|
this.stopLoading();
|
|
2230
|
-
|
|
2231
|
+
var {
|
|
2232
|
+
partitionConfig
|
|
2233
|
+
} = this.state;
|
|
2234
|
+
if (isMissingPartitionError(error) && partitionConfig != null) {
|
|
2235
|
+
// We'll try loading the initial partition again
|
|
2236
|
+
this.startLoading('Reloading partition...', true);
|
|
2237
|
+
this.setState({
|
|
2238
|
+
partitionConfig: undefined
|
|
2239
|
+
}, () => {
|
|
2240
|
+
this.initState();
|
|
2241
|
+
});
|
|
2242
|
+
} else if (this.canRollback()) {
|
|
2231
2243
|
this.startLoading('Rolling back changes...', true);
|
|
2232
2244
|
this.rollback();
|
|
2233
2245
|
} else {
|
|
@@ -2235,7 +2247,7 @@ export class IrisGrid extends Component {
|
|
|
2235
2247
|
var {
|
|
2236
2248
|
onError
|
|
2237
2249
|
} = this.props;
|
|
2238
|
-
onError(new Error("Error displaying table: ".concat(
|
|
2250
|
+
onError(new Error("Error displaying table: ".concat(error)));
|
|
2239
2251
|
}
|
|
2240
2252
|
}
|
|
2241
2253
|
handleUpdate() {
|
|
@@ -2485,7 +2497,7 @@ export class IrisGrid extends Component {
|
|
|
2485
2497
|
this.stopLoading();
|
|
2486
2498
|
(_this$grid24 = this.grid) === null || _this$grid24 === void 0 ? void 0 : _this$grid24.forceUpdate();
|
|
2487
2499
|
} else {
|
|
2488
|
-
this.
|
|
2500
|
+
this.loadTableState();
|
|
2489
2501
|
}
|
|
2490
2502
|
}
|
|
2491
2503
|
handlePendingCommitClicked() {
|
|
@@ -2657,17 +2669,17 @@ export class IrisGrid extends Component {
|
|
|
2657
2669
|
}
|
|
2658
2670
|
seekRow(inputString) {
|
|
2659
2671
|
var _arguments = arguments,
|
|
2660
|
-
|
|
2672
|
+
_this6 = this;
|
|
2661
2673
|
return _asyncToGenerator(function* () {
|
|
2662
|
-
var
|
|
2674
|
+
var _this6$grid;
|
|
2663
2675
|
var isBackwards = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : false;
|
|
2664
2676
|
var {
|
|
2665
2677
|
gotoValueSelectedColumnName: selectedColumnName,
|
|
2666
2678
|
gotoValueSelectedFilter
|
|
2667
|
-
} =
|
|
2679
|
+
} = _this6.state;
|
|
2668
2680
|
var {
|
|
2669
2681
|
model
|
|
2670
|
-
} =
|
|
2682
|
+
} = _this6.props;
|
|
2671
2683
|
var {
|
|
2672
2684
|
dh
|
|
2673
2685
|
} = model;
|
|
@@ -2681,14 +2693,14 @@ export class IrisGrid extends Component {
|
|
|
2681
2693
|
if (selectedColumn === undefined) {
|
|
2682
2694
|
return;
|
|
2683
2695
|
}
|
|
2684
|
-
var searchFromRow = (
|
|
2696
|
+
var searchFromRow = (_this6$grid = _this6.grid) === null || _this6$grid === void 0 ? void 0 : _this6$grid.state.cursorRow;
|
|
2685
2697
|
if (searchFromRow == null) {
|
|
2686
2698
|
searchFromRow = 0;
|
|
2687
2699
|
}
|
|
2688
2700
|
var isContains = gotoValueSelectedFilter === FilterType.contains || gotoValueSelectedFilter === FilterType.containsIgnoreCase;
|
|
2689
2701
|
var isIgnoreCase = gotoValueSelectedFilter === FilterType.eqIgnoreCase || gotoValueSelectedFilter === FilterType.containsIgnoreCase;
|
|
2690
2702
|
try {
|
|
2691
|
-
var
|
|
2703
|
+
var _this6$grid2;
|
|
2692
2704
|
var {
|
|
2693
2705
|
formatter
|
|
2694
2706
|
} = model;
|
|
@@ -2725,15 +2737,15 @@ export class IrisGrid extends Component {
|
|
|
2725
2737
|
}
|
|
2726
2738
|
default:
|
|
2727
2739
|
{
|
|
2728
|
-
rowIndex = yield model.seekRow(searchFromRow, selectedColumn, dh.ValueType.STRING,
|
|
2740
|
+
rowIndex = yield model.seekRow(searchFromRow, selectedColumn, dh.ValueType.STRING, _this6.tableUtils.makeValue(selectedColumn.type, inputString, formatter.timeZone), undefined, undefined, isBackwards !== null && isBackwards !== void 0 ? isBackwards : false);
|
|
2729
2741
|
}
|
|
2730
2742
|
}
|
|
2731
|
-
(
|
|
2732
|
-
|
|
2743
|
+
(_this6$grid2 = _this6.grid) === null || _this6$grid2 === void 0 ? void 0 : _this6$grid2.setFocusRow(rowIndex);
|
|
2744
|
+
_this6.setState({
|
|
2733
2745
|
gotoValueError: ''
|
|
2734
2746
|
});
|
|
2735
2747
|
} catch (e) {
|
|
2736
|
-
|
|
2748
|
+
_this6.setState({
|
|
2737
2749
|
gotoValueError: 'invalid input'
|
|
2738
2750
|
});
|
|
2739
2751
|
}
|
|
@@ -3051,7 +3063,7 @@ export class IrisGrid extends Component {
|
|
|
3051
3063
|
render() {
|
|
3052
3064
|
var _rollupConfig$columns3,
|
|
3053
3065
|
_rollupConfig$columns4,
|
|
3054
|
-
|
|
3066
|
+
_this7 = this,
|
|
3055
3067
|
_this$grid31,
|
|
3056
3068
|
_this$grid31$state$dr,
|
|
3057
3069
|
_openOptions;
|
|
@@ -3091,10 +3103,6 @@ export class IrisGrid extends Component {
|
|
|
3091
3103
|
hoverSelectColumn,
|
|
3092
3104
|
quickFilters,
|
|
3093
3105
|
advancedFilters,
|
|
3094
|
-
partitions,
|
|
3095
|
-
partitionFilters,
|
|
3096
|
-
partitionTable,
|
|
3097
|
-
partitionColumns,
|
|
3098
3106
|
searchFilter,
|
|
3099
3107
|
selectDistinctColumns,
|
|
3100
3108
|
movedColumns,
|
|
@@ -3138,13 +3146,14 @@ export class IrisGrid extends Component {
|
|
|
3138
3146
|
gotoValueError,
|
|
3139
3147
|
gotoValueSelectedColumnName,
|
|
3140
3148
|
gotoValue,
|
|
3141
|
-
gotoValueSelectedFilter
|
|
3149
|
+
gotoValueSelectedFilter,
|
|
3150
|
+
partitionConfig
|
|
3142
3151
|
} = this.state;
|
|
3143
3152
|
if (!isReady) {
|
|
3144
3153
|
return null;
|
|
3145
3154
|
}
|
|
3146
3155
|
var theme = this.getTheme();
|
|
3147
|
-
var filter = this.getCachedFilter(customFilters, quickFilters, advancedFilters,
|
|
3156
|
+
var filter = this.getCachedFilter(customFilters, quickFilters, advancedFilters, searchFilter);
|
|
3148
3157
|
var userColumnWidths = metricCalculator.getUserColumnWidths();
|
|
3149
3158
|
var stateOverride = this.getCachedStateOverride(hoverSelectColumn, isFilterBarShown, isSelectingColumn, loadingScrimProgress, quickFilters, advancedFilters, sorts, reverseType, rollupConfig, isMenuShown);
|
|
3150
3159
|
var top = metrics ? metrics.top : 0;
|
|
@@ -3269,7 +3278,7 @@ export class IrisGrid extends Component {
|
|
|
3269
3278
|
var columnIndex = visibleColumns[i];
|
|
3270
3279
|
var columnX = _allColumnXs.get(columnIndex);
|
|
3271
3280
|
var columnWidth = _allColumnWidths.get(columnIndex);
|
|
3272
|
-
var modelColumn =
|
|
3281
|
+
var modelColumn = _this7.getModelColumn(columnIndex);
|
|
3273
3282
|
if (modelColumn != null) {
|
|
3274
3283
|
var isFilterable = model.isFilterable(modelColumn);
|
|
3275
3284
|
if (isFilterable && columnX != null && columnWidth != null && columnWidth > 0) {
|
|
@@ -3294,21 +3303,21 @@ export class IrisGrid extends Component {
|
|
|
3294
3303
|
'filter-set': isFilterSet
|
|
3295
3304
|
}),
|
|
3296
3305
|
onClick: () => {
|
|
3297
|
-
|
|
3306
|
+
_this7.setState({
|
|
3298
3307
|
shownAdvancedFilter: columnIndex
|
|
3299
3308
|
});
|
|
3300
3309
|
},
|
|
3301
3310
|
onContextMenu: event => {
|
|
3302
|
-
var
|
|
3303
|
-
(
|
|
3311
|
+
var _this7$grid;
|
|
3312
|
+
(_this7$grid = _this7.grid) === null || _this7$grid === void 0 ? void 0 : _this7$grid.handleContextMenu(event);
|
|
3304
3313
|
},
|
|
3305
3314
|
onMouseEnter: () => {
|
|
3306
|
-
|
|
3315
|
+
_this7.setState({
|
|
3307
3316
|
hoverAdvancedFilter: columnIndex
|
|
3308
3317
|
});
|
|
3309
3318
|
},
|
|
3310
3319
|
onMouseLeave: () => {
|
|
3311
|
-
|
|
3320
|
+
_this7.setState({
|
|
3312
3321
|
hoverAdvancedFilter: null
|
|
3313
3322
|
});
|
|
3314
3323
|
},
|
|
@@ -3361,7 +3370,7 @@ export class IrisGrid extends Component {
|
|
|
3361
3370
|
width: columnWidth,
|
|
3362
3371
|
height: columnHeaderHeight
|
|
3363
3372
|
};
|
|
3364
|
-
var _modelColumn =
|
|
3373
|
+
var _modelColumn = _this7.getModelColumn(columnIndex);
|
|
3365
3374
|
if (_modelColumn != null) {
|
|
3366
3375
|
var _column3 = model.columns[_modelColumn];
|
|
3367
3376
|
if (_column3 == null) {
|
|
@@ -3381,9 +3390,9 @@ export class IrisGrid extends Component {
|
|
|
3381
3390
|
style: _style2,
|
|
3382
3391
|
children: /*#__PURE__*/_jsx(Popper, {
|
|
3383
3392
|
className: "advanced-filter-menu-popper",
|
|
3384
|
-
onEntered:
|
|
3393
|
+
onEntered: _this7.getAdvancedMenuOpenedHandler(columnIndex),
|
|
3385
3394
|
onExited: () => {
|
|
3386
|
-
|
|
3395
|
+
_this7.handleAdvancedMenuClosed(columnIndex);
|
|
3387
3396
|
},
|
|
3388
3397
|
isShown: shownAdvancedFilter === columnIndex,
|
|
3389
3398
|
interactive: true,
|
|
@@ -3391,7 +3400,7 @@ export class IrisGrid extends Component {
|
|
|
3391
3400
|
options: {
|
|
3392
3401
|
positionFixed: true
|
|
3393
3402
|
},
|
|
3394
|
-
children:
|
|
3403
|
+
children: _this7.getCachedAdvancedFilterMenuActions(model, _column3, advancedFilterOptions, sortDirection, formatter)
|
|
3395
3404
|
})
|
|
3396
3405
|
}, columnIndex);
|
|
3397
3406
|
advancedFilterMenus.push(element);
|
|
@@ -3518,15 +3527,10 @@ export class IrisGrid extends Component {
|
|
|
3518
3527
|
unmountOnExit: true,
|
|
3519
3528
|
children: /*#__PURE__*/_jsx("div", {
|
|
3520
3529
|
className: "iris-grid-partition-selector-wrapper iris-grid-bar iris-grid-bar-primary",
|
|
3521
|
-
children:
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
columns: partitionColumns,
|
|
3526
|
-
partitions: partitions,
|
|
3527
|
-
onChange: this.handlePartitionChange,
|
|
3528
|
-
onFetchAll: this.handlePartitionFetchAll,
|
|
3529
|
-
onDone: this.handlePartitionDone
|
|
3530
|
+
children: isPartitionedGridModel(model) && model.isPartitionRequired && partitionConfig && /*#__PURE__*/_jsx(IrisGridPartitionSelector, {
|
|
3531
|
+
model: model,
|
|
3532
|
+
partitionConfig: partitionConfig,
|
|
3533
|
+
onChange: this.handlePartitionChange
|
|
3530
3534
|
})
|
|
3531
3535
|
})
|
|
3532
3536
|
}), /*#__PURE__*/_jsx(CSSTransition, {
|
|
@@ -3598,7 +3602,8 @@ export class IrisGrid extends Component {
|
|
|
3598
3602
|
pendingRowCount: pendingRowCount,
|
|
3599
3603
|
pendingDataMap: pendingDataMap,
|
|
3600
3604
|
frozenColumns: frozenColumns,
|
|
3601
|
-
columnHeaderGroups: columnHeaderGroups
|
|
3605
|
+
columnHeaderGroups: columnHeaderGroups,
|
|
3606
|
+
partitionConfig: partitionConfig
|
|
3602
3607
|
}), !isMenuShown && /*#__PURE__*/_jsx("div", {
|
|
3603
3608
|
className: "grid-settings-button",
|
|
3604
3609
|
children: /*#__PURE__*/_jsx(Button, {
|
|
@@ -3727,8 +3732,8 @@ _defineProperty(IrisGrid, "defaultProps", {
|
|
|
3727
3732
|
onError: () => undefined,
|
|
3728
3733
|
onStateChange: () => undefined,
|
|
3729
3734
|
onAdvancedSettingsChange: () => undefined,
|
|
3730
|
-
partitions:
|
|
3731
|
-
|
|
3735
|
+
partitions: undefined,
|
|
3736
|
+
partitionConfig: undefined,
|
|
3732
3737
|
quickFilters: EMPTY_MAP,
|
|
3733
3738
|
selectDistinctColumns: EMPTY_ARRAY,
|
|
3734
3739
|
sorts: EMPTY_ARRAY,
|