@deephaven/iris-grid 1.27.3 → 1.27.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/IrisGrid.d.ts +3 -1
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +283 -243
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridUtils.d.ts +16 -0
- package/dist/IrisGridUtils.d.ts.map +1 -1
- package/dist/IrisGridUtils.js +87 -69
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.css +14 -0
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.css.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.d.ts +1 -0
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js +15 -2
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js.map +1 -1
- package/package.json +2 -2
package/dist/IrisGrid.js
CHANGED
|
@@ -72,18 +72,6 @@ var DEFAULT_AGGREGATION_SETTINGS = Object.freeze({
|
|
|
72
72
|
showOnTop: false
|
|
73
73
|
});
|
|
74
74
|
var UNFORMATTED_DATE_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS z";
|
|
75
|
-
function isEmptyConfig(_ref) {
|
|
76
|
-
var advancedFilters = _ref.advancedFilters,
|
|
77
|
-
aggregationSettings = _ref.aggregationSettings,
|
|
78
|
-
customColumns = _ref.customColumns,
|
|
79
|
-
quickFilters = _ref.quickFilters,
|
|
80
|
-
reverse = _ref.reverse,
|
|
81
|
-
rollupConfig = _ref.rollupConfig,
|
|
82
|
-
searchFilter = _ref.searchFilter,
|
|
83
|
-
selectDistinctColumns = _ref.selectDistinctColumns,
|
|
84
|
-
sorts = _ref.sorts;
|
|
85
|
-
return advancedFilters.size === 0 && aggregationSettings.aggregations.length === 0 && customColumns.length === 0 && quickFilters.size === 0 && !reverse && rollupConfig == null && searchFilter == null && selectDistinctColumns.length === 0 && sorts.length === 0;
|
|
86
|
-
}
|
|
87
75
|
|
|
88
76
|
/**
|
|
89
77
|
* The subset of `IrisGridProps` that overrides how the grid presents its
|
|
@@ -308,8 +296,8 @@ class IrisGrid extends Component {
|
|
|
308
296
|
})).sort((a, b) => {
|
|
309
297
|
var _a$item$order, _b$item$order;
|
|
310
298
|
return ((_a$item$order = a.item.order) !== null && _a$item$order !== void 0 ? _a$item$order : Infinity) - ((_b$item$order = b.item.order) !== null && _b$item$order !== void 0 ? _b$item$order : Infinity) || a.index - b.index;
|
|
311
|
-
}).map(
|
|
312
|
-
var item =
|
|
299
|
+
}).map(_ref => {
|
|
300
|
+
var item = _ref.item;
|
|
313
301
|
return item;
|
|
314
302
|
});
|
|
315
303
|
return Object.freeze(sortedItems);
|
|
@@ -332,10 +320,10 @@ class IrisGrid extends Component {
|
|
|
332
320
|
}));
|
|
333
321
|
_defineProperty(this, "getAggregationMap", memoize((columns, aggregations) => {
|
|
334
322
|
var aggregationMap = {};
|
|
335
|
-
aggregations.forEach(
|
|
336
|
-
var operation =
|
|
337
|
-
selected =
|
|
338
|
-
invert =
|
|
323
|
+
aggregations.forEach(_ref2 => {
|
|
324
|
+
var operation = _ref2.operation,
|
|
325
|
+
selected = _ref2.selected,
|
|
326
|
+
invert = _ref2.invert;
|
|
339
327
|
aggregationMap[operation] = AggregationUtils.getOperationColumnNames(columns, operation, selected, invert);
|
|
340
328
|
});
|
|
341
329
|
return aggregationMap;
|
|
@@ -470,10 +458,11 @@ class IrisGrid extends Component {
|
|
|
470
458
|
leading: false,
|
|
471
459
|
trailing: true
|
|
472
460
|
}));
|
|
473
|
-
// Apply live changes
|
|
461
|
+
// Apply live changes; clear any previous preview error on each new update
|
|
474
462
|
_defineProperty(this, "handleConditionalFormatEditorUpdate", debounce(conditionalFormatPreview => {
|
|
475
463
|
this.setState({
|
|
476
|
-
conditionalFormatPreview
|
|
464
|
+
conditionalFormatPreview,
|
|
465
|
+
conditionalFormatError: null
|
|
477
466
|
});
|
|
478
467
|
}, SET_CONDITIONAL_FORMAT_DEBOUNCE));
|
|
479
468
|
_defineProperty(this, "handleDownloadProgressUpdate", throttle((tableDownloadProgress, tableDownloadEstimatedTime) => {
|
|
@@ -799,6 +788,7 @@ class IrisGrid extends Component {
|
|
|
799
788
|
conditionalFormats,
|
|
800
789
|
conditionalFormatEditIndex: null,
|
|
801
790
|
conditionalFormatPreview: undefined,
|
|
791
|
+
conditionalFormatError: null,
|
|
802
792
|
// Column user is hovering over for selection
|
|
803
793
|
hoverSelectColumn: null,
|
|
804
794
|
isTableDownloading: false,
|
|
@@ -859,6 +849,7 @@ class IrisGrid extends Component {
|
|
|
859
849
|
settings = _this$props.settings,
|
|
860
850
|
model = _this$props.model,
|
|
861
851
|
customFilters = _this$props.customFilters,
|
|
852
|
+
quickFilters = _this$props.quickFilters,
|
|
862
853
|
sorts = _this$props.sorts,
|
|
863
854
|
getMetricCalculator = _this$props.getMetricCalculator;
|
|
864
855
|
if (model !== prevProps.model) {
|
|
@@ -906,6 +897,9 @@ class IrisGrid extends Component {
|
|
|
906
897
|
if (sorts !== prevProps.sorts) {
|
|
907
898
|
this.updateSorts(sorts);
|
|
908
899
|
}
|
|
900
|
+
if (quickFilters !== prevProps.quickFilters) {
|
|
901
|
+
this.updateQuickFilters(quickFilters);
|
|
902
|
+
}
|
|
909
903
|
var loadingScrimStartTime = this.loadingScrimStartTime,
|
|
910
904
|
loadingScrimFinishTime = this.loadingScrimFinishTime;
|
|
911
905
|
if (loadingScrimStartTime != null && loadingScrimFinishTime != null) {
|
|
@@ -1041,7 +1035,7 @@ class IrisGrid extends Component {
|
|
|
1041
1035
|
return rowIndex != null ? modelRows.get(rowIndex) : null;
|
|
1042
1036
|
}
|
|
1043
1037
|
getTheme() {
|
|
1044
|
-
var
|
|
1038
|
+
var _ref3;
|
|
1045
1039
|
var _this$props3 = this.props,
|
|
1046
1040
|
model = _this$props3.model,
|
|
1047
1041
|
theme = _this$props3.theme,
|
|
@@ -1049,7 +1043,7 @@ class IrisGrid extends Component {
|
|
|
1049
1043
|
var _this$context = this.context,
|
|
1050
1044
|
contextTheme = _this$context.theme,
|
|
1051
1045
|
contextDensity = _this$context.density;
|
|
1052
|
-
return this.getCachedTheme(contextTheme, theme, (
|
|
1046
|
+
return this.getCachedTheme(contextTheme, theme, (_ref3 = isEditableGridModel(model) && model.isEditable) !== null && _ref3 !== void 0 ? _ref3 : false, model.floatingTopRowCount + model.floatingBottomRowCount, density !== null && density !== void 0 ? density : contextDensity);
|
|
1053
1047
|
}
|
|
1054
1048
|
getVisibleColumn(modelIndex) {
|
|
1055
1049
|
var movedColumns = this.state.movedColumns;
|
|
@@ -1080,13 +1074,13 @@ class IrisGrid extends Component {
|
|
|
1080
1074
|
var newAdvancedFilters = replaceExisting ? new Map() : new Map(advancedFilters);
|
|
1081
1075
|
var newQuickFilters = replaceExisting ? new Map() : new Map(quickFilters);
|
|
1082
1076
|
var isChanged = replaceExisting && advancedFilters.size > 0;
|
|
1083
|
-
inputFilters.forEach(
|
|
1084
|
-
var name =
|
|
1085
|
-
type =
|
|
1086
|
-
value =
|
|
1087
|
-
var modelIndex = model.columns.findIndex(
|
|
1088
|
-
var columnName =
|
|
1089
|
-
columnType =
|
|
1077
|
+
inputFilters.forEach(_ref4 => {
|
|
1078
|
+
var name = _ref4.name,
|
|
1079
|
+
type = _ref4.type,
|
|
1080
|
+
value = _ref4.value;
|
|
1081
|
+
var modelIndex = model.columns.findIndex(_ref5 => {
|
|
1082
|
+
var columnName = _ref5.name,
|
|
1083
|
+
columnType = _ref5.type;
|
|
1090
1084
|
return columnName === name && columnType === type;
|
|
1091
1085
|
});
|
|
1092
1086
|
if (modelIndex >= 0) {
|
|
@@ -1143,8 +1137,8 @@ class IrisGrid extends Component {
|
|
|
1143
1137
|
this.startLoading('Filtering...', {
|
|
1144
1138
|
resetRanges: true
|
|
1145
1139
|
});
|
|
1146
|
-
this.setState(
|
|
1147
|
-
var advancedFilters =
|
|
1140
|
+
this.setState(_ref6 => {
|
|
1141
|
+
var advancedFilters = _ref6.advancedFilters;
|
|
1148
1142
|
var newAdvancedFilters = new Map(advancedFilters);
|
|
1149
1143
|
if (filter == null) {
|
|
1150
1144
|
newAdvancedFilters.delete(modelIndex);
|
|
@@ -1171,8 +1165,8 @@ class IrisGrid extends Component {
|
|
|
1171
1165
|
this.startLoading('Filtering...', {
|
|
1172
1166
|
resetRanges: true
|
|
1173
1167
|
});
|
|
1174
|
-
this.setState(
|
|
1175
|
-
var quickFilters =
|
|
1168
|
+
this.setState(_ref7 => {
|
|
1169
|
+
var quickFilters = _ref7.quickFilters;
|
|
1176
1170
|
var newQuickFilters = new Map(quickFilters);
|
|
1177
1171
|
newQuickFilters.set(modelIndex, {
|
|
1178
1172
|
filter,
|
|
@@ -1197,9 +1191,9 @@ class IrisGrid extends Component {
|
|
|
1197
1191
|
this.clearAllFilters();
|
|
1198
1192
|
}
|
|
1199
1193
|
var model = this.props.model;
|
|
1200
|
-
filterMap.forEach((
|
|
1201
|
-
var columnType =
|
|
1202
|
-
filterList =
|
|
1194
|
+
filterMap.forEach((_ref8, columnName) => {
|
|
1195
|
+
var columnType = _ref8.columnType,
|
|
1196
|
+
filterList = _ref8.filterList;
|
|
1203
1197
|
var column = model.columns.find(c => c.name === columnName && c.type === columnType);
|
|
1204
1198
|
if (column == null) {
|
|
1205
1199
|
return;
|
|
@@ -1220,9 +1214,9 @@ class IrisGrid extends Component {
|
|
|
1220
1214
|
resetRanges: true
|
|
1221
1215
|
});
|
|
1222
1216
|
var clearRange = Array.isArray(modelRange) ? modelRange : [modelRange, modelRange];
|
|
1223
|
-
this.setState(
|
|
1224
|
-
var advancedFilters =
|
|
1225
|
-
quickFilters =
|
|
1217
|
+
this.setState(_ref9 => {
|
|
1218
|
+
var advancedFilters = _ref9.advancedFilters,
|
|
1219
|
+
quickFilters = _ref9.quickFilters;
|
|
1226
1220
|
var newAdvancedFilters = advancedFilters ? new Map(advancedFilters) : new Map();
|
|
1227
1221
|
var newQuickFilters = quickFilters ? new Map(quickFilters) : new Map();
|
|
1228
1222
|
newAdvancedFilters.forEach((_, column) => {
|
|
@@ -1245,8 +1239,8 @@ class IrisGrid extends Component {
|
|
|
1245
1239
|
this.startLoading('Clearing Filter...', {
|
|
1246
1240
|
resetRanges: true
|
|
1247
1241
|
});
|
|
1248
|
-
this.setState(
|
|
1249
|
-
var quickFilters =
|
|
1242
|
+
this.setState(_ref0 => {
|
|
1243
|
+
var quickFilters = _ref0.quickFilters;
|
|
1250
1244
|
var newQuickFilters = new Map(quickFilters);
|
|
1251
1245
|
newQuickFilters.delete(modelColumn);
|
|
1252
1246
|
return {
|
|
@@ -1337,9 +1331,9 @@ class IrisGrid extends Component {
|
|
|
1337
1331
|
advancedFilters: newAdvancedFilters
|
|
1338
1332
|
});
|
|
1339
1333
|
}
|
|
1340
|
-
setFilters(
|
|
1341
|
-
var quickFilters =
|
|
1342
|
-
advancedFilters =
|
|
1334
|
+
setFilters(_ref1) {
|
|
1335
|
+
var quickFilters = _ref1.quickFilters,
|
|
1336
|
+
advancedFilters = _ref1.advancedFilters;
|
|
1343
1337
|
this.setState({
|
|
1344
1338
|
quickFilters,
|
|
1345
1339
|
advancedFilters
|
|
@@ -1519,15 +1513,15 @@ class IrisGrid extends Component {
|
|
|
1519
1513
|
if (isPartitionedGridModel(model)) {
|
|
1520
1514
|
var data = this.getRowDataMap(rowIndex);
|
|
1521
1515
|
var partitionColumnSet = new Set(model.partitionColumns.map(column => column.name));
|
|
1522
|
-
var values = Object.entries(data).filter(
|
|
1523
|
-
var
|
|
1524
|
-
key =
|
|
1525
|
-
_ =
|
|
1516
|
+
var values = Object.entries(data).filter(_ref10 => {
|
|
1517
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
1518
|
+
key = _ref11[0],
|
|
1519
|
+
_ = _ref11[1];
|
|
1526
1520
|
return partitionColumnSet.has(key);
|
|
1527
|
-
}).map(
|
|
1528
|
-
var
|
|
1529
|
-
key =
|
|
1530
|
-
columnData =
|
|
1521
|
+
}).map(_ref12 => {
|
|
1522
|
+
var _ref13 = _slicedToArray(_ref12, 2),
|
|
1523
|
+
key = _ref13[0],
|
|
1524
|
+
columnData = _ref13[1];
|
|
1531
1525
|
return columnData.value;
|
|
1532
1526
|
});
|
|
1533
1527
|
var newPartition = {
|
|
@@ -1606,13 +1600,13 @@ class IrisGrid extends Component {
|
|
|
1606
1600
|
}
|
|
1607
1601
|
}
|
|
1608
1602
|
startLoading(loadingText) {
|
|
1609
|
-
var
|
|
1610
|
-
|
|
1611
|
-
resetRanges =
|
|
1612
|
-
|
|
1613
|
-
loadingCancelShown =
|
|
1614
|
-
|
|
1615
|
-
loadingBlocksGrid =
|
|
1603
|
+
var _ref14 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
1604
|
+
_ref14$resetRanges = _ref14.resetRanges,
|
|
1605
|
+
resetRanges = _ref14$resetRanges === void 0 ? false : _ref14$resetRanges,
|
|
1606
|
+
_ref14$loadingCancelS = _ref14.loadingCancelShown,
|
|
1607
|
+
loadingCancelShown = _ref14$loadingCancelS === void 0 ? true : _ref14$loadingCancelS,
|
|
1608
|
+
_ref14$loadingBlocksG = _ref14.loadingBlocksGrid,
|
|
1609
|
+
loadingBlocksGrid = _ref14$loadingBlocksG === void 0 ? true : _ref14$loadingBlocksG;
|
|
1616
1610
|
this.setState({
|
|
1617
1611
|
loadingText,
|
|
1618
1612
|
loadingCancelShown,
|
|
@@ -1670,6 +1664,9 @@ class IrisGrid extends Component {
|
|
|
1670
1664
|
var _this$lastLoadedConfi = this.lastLoadedConfig,
|
|
1671
1665
|
advancedFilters = _this$lastLoadedConfi.advancedFilters,
|
|
1672
1666
|
aggregationSettings = _this$lastLoadedConfi.aggregationSettings,
|
|
1667
|
+
conditionalFormats = _this$lastLoadedConfi.conditionalFormats,
|
|
1668
|
+
conditionalFormatEditIndex = _this$lastLoadedConfi.conditionalFormatEditIndex,
|
|
1669
|
+
conditionalFormatPreview = _this$lastLoadedConfi.conditionalFormatPreview,
|
|
1673
1670
|
customColumns = _this$lastLoadedConfi.customColumns,
|
|
1674
1671
|
quickFilters = _this$lastLoadedConfi.quickFilters,
|
|
1675
1672
|
reverse = _this$lastLoadedConfi.reverse,
|
|
@@ -1681,6 +1678,9 @@ class IrisGrid extends Component {
|
|
|
1681
1678
|
this.setState({
|
|
1682
1679
|
advancedFilters,
|
|
1683
1680
|
aggregationSettings,
|
|
1681
|
+
conditionalFormats,
|
|
1682
|
+
conditionalFormatEditIndex,
|
|
1683
|
+
conditionalFormatPreview,
|
|
1684
1684
|
customColumns,
|
|
1685
1685
|
quickFilters,
|
|
1686
1686
|
reverse,
|
|
@@ -1694,6 +1694,9 @@ class IrisGrid extends Component {
|
|
|
1694
1694
|
this.setState({
|
|
1695
1695
|
advancedFilters: new Map(),
|
|
1696
1696
|
aggregationSettings: DEFAULT_AGGREGATION_SETTINGS,
|
|
1697
|
+
conditionalFormats: [],
|
|
1698
|
+
conditionalFormatEditIndex: null,
|
|
1699
|
+
conditionalFormatPreview: undefined,
|
|
1697
1700
|
customColumns: [],
|
|
1698
1701
|
quickFilters: new Map(),
|
|
1699
1702
|
reverse: false,
|
|
@@ -1709,7 +1712,7 @@ class IrisGrid extends Component {
|
|
|
1709
1712
|
* @returns true if there's a previously known safe state or if some of the current state isn't empty.
|
|
1710
1713
|
*/
|
|
1711
1714
|
canRollback() {
|
|
1712
|
-
return this.lastLoadedConfig != null || !isEmptyConfig(this.state);
|
|
1715
|
+
return this.lastLoadedConfig != null || !IrisGridUtils.isEmptyConfig(this.state);
|
|
1713
1716
|
}
|
|
1714
1717
|
startListening(model) {
|
|
1715
1718
|
model.addEventListener(IrisGridModel.EVENT.UPDATED, this.handleUpdate);
|
|
@@ -1987,8 +1990,26 @@ class IrisGrid extends Component {
|
|
|
1987
1990
|
});
|
|
1988
1991
|
(_this$grid0 = this.grid) === null || _this$grid0 === void 0 || _this$grid0.forceUpdate();
|
|
1989
1992
|
}
|
|
1990
|
-
|
|
1993
|
+
updateQuickFilters(quickFilters) {
|
|
1991
1994
|
var _this$grid1;
|
|
1995
|
+
var currentQuickFilters = this.state.quickFilters;
|
|
1996
|
+
if (quickFilters == null) {
|
|
1997
|
+
if (currentQuickFilters.size === 0) {
|
|
1998
|
+
return;
|
|
1999
|
+
}
|
|
2000
|
+
} else if (quickFilters === currentQuickFilters) {
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
2003
|
+
this.startLoading('Filtering...', {
|
|
2004
|
+
resetRanges: true
|
|
2005
|
+
});
|
|
2006
|
+
this.setState({
|
|
2007
|
+
quickFilters: quickFilters !== null && quickFilters !== void 0 ? quickFilters : EMPTY_MAP
|
|
2008
|
+
});
|
|
2009
|
+
(_this$grid1 = this.grid) === null || _this$grid1 === void 0 || _this$grid1.forceUpdate();
|
|
2010
|
+
}
|
|
2011
|
+
sortColumn(modelColumn) {
|
|
2012
|
+
var _this$grid10;
|
|
1992
2013
|
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TableUtils.sortDirection.none;
|
|
1993
2014
|
var isAbs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1994
2015
|
var addToExisting = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
@@ -1999,15 +2020,15 @@ class IrisGrid extends Component {
|
|
|
1999
2020
|
this.setState({
|
|
2000
2021
|
sorts
|
|
2001
2022
|
});
|
|
2002
|
-
(_this$
|
|
2023
|
+
(_this$grid10 = this.grid) === null || _this$grid10 === void 0 || _this$grid10.forceUpdate();
|
|
2003
2024
|
}
|
|
2004
2025
|
reverse(reverse) {
|
|
2005
|
-
var _this$
|
|
2026
|
+
var _this$grid11;
|
|
2006
2027
|
this.startLoading('Reversing...');
|
|
2007
2028
|
this.setState({
|
|
2008
2029
|
reverse
|
|
2009
2030
|
});
|
|
2010
|
-
(_this$
|
|
2031
|
+
(_this$grid11 = this.grid) === null || _this$grid11 === void 0 || _this$grid11.forceUpdate();
|
|
2011
2032
|
}
|
|
2012
2033
|
isReversible() {
|
|
2013
2034
|
var model = this.props.model;
|
|
@@ -2040,8 +2061,8 @@ class IrisGrid extends Component {
|
|
|
2040
2061
|
this.focusFilterBar(columnIndex);
|
|
2041
2062
|
}
|
|
2042
2063
|
} else {
|
|
2043
|
-
var _this$
|
|
2044
|
-
(_this$
|
|
2064
|
+
var _this$grid12;
|
|
2065
|
+
(_this$grid12 = this.grid) === null || _this$grid12 === void 0 || _this$grid12.focus();
|
|
2045
2066
|
}
|
|
2046
2067
|
}
|
|
2047
2068
|
isTableSearchAvailable() {
|
|
@@ -2073,13 +2094,13 @@ class IrisGrid extends Component {
|
|
|
2073
2094
|
var _this$crossColumnRef2;
|
|
2074
2095
|
(_this$crossColumnRef2 = this.crossColumnRef) === null || _this$crossColumnRef2 === void 0 || _this$crossColumnRef2.current.focus();
|
|
2075
2096
|
} else {
|
|
2076
|
-
var _this$
|
|
2077
|
-
(_this$
|
|
2097
|
+
var _this$grid13;
|
|
2098
|
+
(_this$grid13 = this.grid) === null || _this$grid13 === void 0 || _this$grid13.focus();
|
|
2078
2099
|
}
|
|
2079
2100
|
});
|
|
2080
2101
|
}
|
|
2081
2102
|
toggleGotoRow() {
|
|
2082
|
-
var _this$
|
|
2103
|
+
var _this$grid14, _this$grid15;
|
|
2083
2104
|
var row = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
2084
2105
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
2085
2106
|
var columnName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
@@ -2099,8 +2120,8 @@ class IrisGrid extends Component {
|
|
|
2099
2120
|
(_this$gotoRowRef$curr = this.gotoRowRef.current) === null || _this$gotoRowRef$curr === void 0 || _this$gotoRowRef$curr.focus();
|
|
2100
2121
|
return;
|
|
2101
2122
|
}
|
|
2102
|
-
var cursorRow = (_this$
|
|
2103
|
-
var cursorColumn = (_this$
|
|
2123
|
+
var cursorRow = (_this$grid14 = this.grid) === null || _this$grid14 === void 0 ? void 0 : _this$grid14.state.cursorRow;
|
|
2124
|
+
var cursorColumn = (_this$grid15 = this.grid) === null || _this$grid15 === void 0 ? void 0 : _this$grid15.state.cursorColumn;
|
|
2104
2125
|
if (cursorRow == null || cursorColumn == null) {
|
|
2105
2126
|
// if a cell is not selected / grid is not rendered
|
|
2106
2127
|
this.setState({
|
|
@@ -2245,7 +2266,7 @@ class IrisGrid extends Component {
|
|
|
2245
2266
|
this.setAdvancedFilter(index, filter, options);
|
|
2246
2267
|
}
|
|
2247
2268
|
handleAdvancedFilterSortChange(column, direction) {
|
|
2248
|
-
var _this$
|
|
2269
|
+
var _this$grid16;
|
|
2249
2270
|
var addToExisting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2250
2271
|
var model = this.props.model;
|
|
2251
2272
|
var columnIndex = model.getColumnIndexByName(column.name);
|
|
@@ -2266,15 +2287,15 @@ class IrisGrid extends Component {
|
|
|
2266
2287
|
this.setState({
|
|
2267
2288
|
sorts
|
|
2268
2289
|
});
|
|
2269
|
-
(_this$
|
|
2290
|
+
(_this$grid16 = this.grid) === null || _this$grid16 === void 0 || _this$grid16.forceUpdate();
|
|
2270
2291
|
}
|
|
2271
2292
|
handleAdvancedFilterDone() {
|
|
2272
|
-
var _this$
|
|
2273
|
-
(_this$
|
|
2293
|
+
var _this$grid17;
|
|
2294
|
+
(_this$grid17 = this.grid) === null || _this$grid17 === void 0 || _this$grid17.focus();
|
|
2274
2295
|
}
|
|
2275
2296
|
handleAdvancedFilterToggleMaximize(column) {
|
|
2276
|
-
this.setState(
|
|
2277
|
-
var maximizedAdvancedFilter =
|
|
2297
|
+
this.setState(_ref15 => {
|
|
2298
|
+
var maximizedAdvancedFilter = _ref15.maximizedAdvancedFilter;
|
|
2278
2299
|
return {
|
|
2279
2300
|
maximizedAdvancedFilter: maximizedAdvancedFilter === column ? null : column
|
|
2280
2301
|
};
|
|
@@ -2345,9 +2366,9 @@ class IrisGrid extends Component {
|
|
|
2345
2366
|
this.startLoading('Filtering...', {
|
|
2346
2367
|
resetRanges: true
|
|
2347
2368
|
});
|
|
2348
|
-
this.setState(
|
|
2349
|
-
var focusedFilterBarColumn =
|
|
2350
|
-
quickFilters =
|
|
2369
|
+
this.setState(_ref16 => {
|
|
2370
|
+
var focusedFilterBarColumn = _ref16.focusedFilterBarColumn,
|
|
2371
|
+
quickFilters = _ref16.quickFilters;
|
|
2351
2372
|
var newQuickFilters = new Map(quickFilters);
|
|
2352
2373
|
if (focusedFilterBarColumn != null) {
|
|
2353
2374
|
var modelIndex = this.getModelColumn(focusedFilterBarColumn);
|
|
@@ -2363,8 +2384,8 @@ class IrisGrid extends Component {
|
|
|
2363
2384
|
var setGridFocus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
2364
2385
|
var defocusInput = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
2365
2386
|
if (setGridFocus) {
|
|
2366
|
-
var _this$
|
|
2367
|
-
(_this$
|
|
2387
|
+
var _this$grid18;
|
|
2388
|
+
(_this$grid18 = this.grid) === null || _this$grid18 === void 0 || _this$grid18.focus();
|
|
2368
2389
|
}
|
|
2369
2390
|
if (defocusInput) {
|
|
2370
2391
|
this.setState({
|
|
@@ -2401,9 +2422,9 @@ class IrisGrid extends Component {
|
|
|
2401
2422
|
handleColumnAlignmentChange(modelIndex, alignment) {
|
|
2402
2423
|
var model = this.props.model;
|
|
2403
2424
|
var column = model.columns[modelIndex];
|
|
2404
|
-
this.setState(
|
|
2405
|
-
var
|
|
2406
|
-
columnAlignmentMap =
|
|
2425
|
+
this.setState(_ref17 => {
|
|
2426
|
+
var _ref17$columnAlignmen = _ref17.columnAlignmentMap,
|
|
2427
|
+
columnAlignmentMap = _ref17$columnAlignmen === void 0 ? EMPTY_MAP : _ref17$columnAlignmen;
|
|
2407
2428
|
var newColumnAlignmentMap = new Map(columnAlignmentMap);
|
|
2408
2429
|
if (alignment != null) {
|
|
2409
2430
|
newColumnAlignmentMap.set(column.name, alignment);
|
|
@@ -2428,8 +2449,8 @@ class IrisGrid extends Component {
|
|
|
2428
2449
|
});
|
|
2429
2450
|
}
|
|
2430
2451
|
handleMenuBack() {
|
|
2431
|
-
this.setState(
|
|
2432
|
-
var openOptions =
|
|
2452
|
+
this.setState(_ref18 => {
|
|
2453
|
+
var openOptions = _ref18.openOptions;
|
|
2433
2454
|
var newOptions = [...openOptions];
|
|
2434
2455
|
newOptions.pop();
|
|
2435
2456
|
return {
|
|
@@ -2438,19 +2459,21 @@ class IrisGrid extends Component {
|
|
|
2438
2459
|
});
|
|
2439
2460
|
}
|
|
2440
2461
|
handleMenuSelect(option) {
|
|
2441
|
-
this.setState(
|
|
2442
|
-
var openOptions =
|
|
2462
|
+
this.setState(_ref19 => {
|
|
2463
|
+
var openOptions = _ref19.openOptions;
|
|
2443
2464
|
return {
|
|
2444
2465
|
openOptions: [...openOptions, option]
|
|
2445
2466
|
};
|
|
2446
2467
|
});
|
|
2447
2468
|
}
|
|
2448
2469
|
handleRequestFailed(event) {
|
|
2449
|
-
var
|
|
2450
|
-
error =
|
|
2470
|
+
var _ref20 = event,
|
|
2471
|
+
error = _ref20.detail;
|
|
2451
2472
|
log.error('request failed:', error);
|
|
2452
2473
|
this.stopLoading();
|
|
2453
|
-
var
|
|
2474
|
+
var _this$state11 = this.state,
|
|
2475
|
+
partitionConfig = _this$state11.partitionConfig,
|
|
2476
|
+
conditionalFormatEditIndex = _this$state11.conditionalFormatEditIndex;
|
|
2454
2477
|
if (isMissingPartitionError(error) && partitionConfig != null) {
|
|
2455
2478
|
// We'll try loading the initial partition again
|
|
2456
2479
|
this.startLoading('Reloading partition...', {
|
|
@@ -2461,6 +2484,14 @@ class IrisGrid extends Component {
|
|
|
2461
2484
|
}, () => {
|
|
2462
2485
|
this.initState();
|
|
2463
2486
|
});
|
|
2487
|
+
} else if (conditionalFormatEditIndex !== null) {
|
|
2488
|
+
var _errorMessage;
|
|
2489
|
+
// Preview format failed — surface error in the editor instead of rolling back
|
|
2490
|
+
var errorMessage = (_errorMessage = error === null || error === void 0 ? void 0 : error.errorMessage) !== null && _errorMessage !== void 0 ? _errorMessage : String(error);
|
|
2491
|
+
this.setState({
|
|
2492
|
+
conditionalFormatError: errorMessage,
|
|
2493
|
+
conditionalFormatPreview: undefined
|
|
2494
|
+
});
|
|
2464
2495
|
} else if (this.canRollback()) {
|
|
2465
2496
|
this.startLoading('Rolling back changes...', {
|
|
2466
2497
|
resetRanges: true
|
|
@@ -2481,11 +2512,11 @@ class IrisGrid extends Component {
|
|
|
2481
2512
|
* pending operations into a single scrim).
|
|
2482
2513
|
*/
|
|
2483
2514
|
handlePending(event) {
|
|
2484
|
-
var
|
|
2485
|
-
detail =
|
|
2486
|
-
var
|
|
2487
|
-
text =
|
|
2488
|
-
options =
|
|
2515
|
+
var _ref21 = event,
|
|
2516
|
+
detail = _ref21.detail;
|
|
2517
|
+
var _ref22 = detail !== null && detail !== void 0 ? detail : {},
|
|
2518
|
+
text = _ref22.text,
|
|
2519
|
+
options = _ref22.options;
|
|
2489
2520
|
if (this.loadingScrimStartTime == null) {
|
|
2490
2521
|
this.startLoading(text !== null && text !== void 0 ? text : 'Loading...', _objectSpread({
|
|
2491
2522
|
loadingCancelShown: false
|
|
@@ -2512,21 +2543,27 @@ class IrisGrid extends Component {
|
|
|
2512
2543
|
this.stopLoading();
|
|
2513
2544
|
}
|
|
2514
2545
|
handleUpdate() {
|
|
2515
|
-
var _this$
|
|
2546
|
+
var _this$grid19;
|
|
2516
2547
|
log.debug2('Received model update');
|
|
2517
|
-
var _this$
|
|
2518
|
-
advancedFilters = _this$
|
|
2519
|
-
aggregationSettings = _this$
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2548
|
+
var _this$state12 = this.state,
|
|
2549
|
+
advancedFilters = _this$state12.advancedFilters,
|
|
2550
|
+
aggregationSettings = _this$state12.aggregationSettings,
|
|
2551
|
+
conditionalFormats = _this$state12.conditionalFormats,
|
|
2552
|
+
conditionalFormatEditIndex = _this$state12.conditionalFormatEditIndex,
|
|
2553
|
+
conditionalFormatPreview = _this$state12.conditionalFormatPreview,
|
|
2554
|
+
customColumns = _this$state12.customColumns,
|
|
2555
|
+
quickFilters = _this$state12.quickFilters,
|
|
2556
|
+
reverse = _this$state12.reverse,
|
|
2557
|
+
rollupConfig = _this$state12.rollupConfig,
|
|
2558
|
+
searchFilter = _this$state12.searchFilter,
|
|
2559
|
+
selectDistinctColumns = _this$state12.selectDistinctColumns,
|
|
2560
|
+
sorts = _this$state12.sorts;
|
|
2527
2561
|
var config = {
|
|
2528
2562
|
advancedFilters,
|
|
2529
2563
|
aggregationSettings,
|
|
2564
|
+
conditionalFormats,
|
|
2565
|
+
conditionalFormatEditIndex,
|
|
2566
|
+
conditionalFormatPreview,
|
|
2530
2567
|
customColumns,
|
|
2531
2568
|
quickFilters,
|
|
2532
2569
|
reverse,
|
|
@@ -2535,12 +2572,12 @@ class IrisGrid extends Component {
|
|
|
2535
2572
|
selectDistinctColumns,
|
|
2536
2573
|
sorts
|
|
2537
2574
|
};
|
|
2538
|
-
if (!isEmptyConfig(config)) {
|
|
2575
|
+
if (!IrisGridUtils.isEmptyConfig(config)) {
|
|
2539
2576
|
this.lastLoadedConfig = config;
|
|
2540
2577
|
} else {
|
|
2541
2578
|
this.lastLoadedConfig = null;
|
|
2542
2579
|
}
|
|
2543
|
-
(_this$
|
|
2580
|
+
(_this$grid19 = this.grid) === null || _this$grid19 === void 0 || _this$grid19.forceUpdate();
|
|
2544
2581
|
this.stopLoading();
|
|
2545
2582
|
}
|
|
2546
2583
|
handleTableChanged() {
|
|
@@ -2568,11 +2605,11 @@ class IrisGrid extends Component {
|
|
|
2568
2605
|
});
|
|
2569
2606
|
}
|
|
2570
2607
|
handleViewChanged(metrics) {
|
|
2571
|
-
var _this$grid$state, _this$
|
|
2608
|
+
var _this$grid$state, _this$grid20;
|
|
2572
2609
|
var model = this.props.model;
|
|
2573
|
-
var
|
|
2574
|
-
|
|
2575
|
-
selectionEndRow =
|
|
2610
|
+
var _ref23 = (_this$grid$state = (_this$grid20 = this.grid) === null || _this$grid20 === void 0 ? void 0 : _this$grid20.state) !== null && _this$grid$state !== void 0 ? _this$grid$state : {},
|
|
2611
|
+
_ref23$selectionEndRo = _ref23.selectionEndRow,
|
|
2612
|
+
selectionEndRow = _ref23$selectionEndRo === void 0 ? 0 : _ref23$selectionEndRo;
|
|
2576
2613
|
var pendingRowCount = 0;
|
|
2577
2614
|
if (isEditableGridModel(model) && model.isEditable) {
|
|
2578
2615
|
assertNotNull(metrics);
|
|
@@ -2637,8 +2674,8 @@ class IrisGrid extends Component {
|
|
|
2637
2674
|
// Parsing them again causes a loop with undo/redo that makes it unusable
|
|
2638
2675
|
columnHeaderGroups: columnHeaderGroups.every(group => isColumnHeaderGroup(group) && group.isValid()) ? columnHeaderGroups : IrisGridUtils.parseColumnHeaderGroups(model, columnHeaderGroups).groups
|
|
2639
2676
|
}, () => {
|
|
2640
|
-
var _this$
|
|
2641
|
-
return (_this$
|
|
2677
|
+
var _this$grid21;
|
|
2678
|
+
return (_this$grid21 = this.grid) === null || _this$grid21 === void 0 ? void 0 : _this$grid21.forceUpdate();
|
|
2642
2679
|
});
|
|
2643
2680
|
}
|
|
2644
2681
|
handleTooltipRef(tooltip) {
|
|
@@ -2656,9 +2693,9 @@ class IrisGrid extends Component {
|
|
|
2656
2693
|
}
|
|
2657
2694
|
handleConditionalFormatCreate() {
|
|
2658
2695
|
log.debug('Create new conditional format');
|
|
2659
|
-
var _this$
|
|
2660
|
-
openOptions = _this$
|
|
2661
|
-
conditionalFormats = _this$
|
|
2696
|
+
var _this$state13 = this.state,
|
|
2697
|
+
openOptions = _this$state13.openOptions,
|
|
2698
|
+
conditionalFormats = _this$state13.conditionalFormats;
|
|
2662
2699
|
this.setState({
|
|
2663
2700
|
openOptions: [...openOptions, {
|
|
2664
2701
|
type: OptionType.CONDITIONAL_FORMATTING_EDIT,
|
|
@@ -2671,9 +2708,9 @@ class IrisGrid extends Component {
|
|
|
2671
2708
|
}
|
|
2672
2709
|
handleConditionalFormatEdit(index) {
|
|
2673
2710
|
log.debug('Edit conditional format', index);
|
|
2674
|
-
var _this$
|
|
2675
|
-
openOptions = _this$
|
|
2676
|
-
conditionalFormats = _this$
|
|
2711
|
+
var _this$state14 = this.state,
|
|
2712
|
+
openOptions = _this$state14.openOptions,
|
|
2713
|
+
conditionalFormats = _this$state14.conditionalFormats;
|
|
2677
2714
|
this.setState({
|
|
2678
2715
|
openOptions: [...openOptions, {
|
|
2679
2716
|
type: OptionType.CONDITIONAL_FORMATTING_EDIT,
|
|
@@ -2705,18 +2742,19 @@ class IrisGrid extends Component {
|
|
|
2705
2742
|
// Not resetting conditionalFormatPreview here
|
|
2706
2743
|
// to prevent editor fields change during the menu transition
|
|
2707
2744
|
this.setState({
|
|
2708
|
-
conditionalFormatEditIndex: null
|
|
2745
|
+
conditionalFormatEditIndex: null,
|
|
2746
|
+
conditionalFormatError: null
|
|
2709
2747
|
});
|
|
2710
2748
|
}
|
|
2711
2749
|
handleUpdateCustomColumns(customColumns) {
|
|
2712
2750
|
log.info("handleUpdateCustomColumns:", customColumns);
|
|
2713
2751
|
var model = this.props.model;
|
|
2714
|
-
var _this$
|
|
2715
|
-
movedColumns = _this$
|
|
2716
|
-
sorts = _this$
|
|
2717
|
-
quickFilters = _this$
|
|
2718
|
-
advancedFilters = _this$
|
|
2719
|
-
selectDistinctColumns = _this$
|
|
2752
|
+
var _this$state15 = this.state,
|
|
2753
|
+
movedColumns = _this$state15.movedColumns,
|
|
2754
|
+
sorts = _this$state15.sorts,
|
|
2755
|
+
quickFilters = _this$state15.quickFilters,
|
|
2756
|
+
advancedFilters = _this$state15.advancedFilters,
|
|
2757
|
+
selectDistinctColumns = _this$state15.selectDistinctColumns;
|
|
2720
2758
|
var columns = model.columns;
|
|
2721
2759
|
var oldCustomColumns = model.customColumns.map(customColumn => "".concat(customColumn));
|
|
2722
2760
|
var removedColumnNames = IrisGridUtils.getRemovedCustomColumnNames(oldCustomColumns, customColumns);
|
|
@@ -2824,7 +2862,7 @@ class IrisGrid extends Component {
|
|
|
2824
2862
|
return this.discardPending();
|
|
2825
2863
|
}
|
|
2826
2864
|
handlePendingDataUpdated() {
|
|
2827
|
-
var _this$
|
|
2865
|
+
var _this$grid22;
|
|
2828
2866
|
log.debug('pending data updated');
|
|
2829
2867
|
var model = this.props.model;
|
|
2830
2868
|
var pendingDataMap = model.pendingDataMap,
|
|
@@ -2834,13 +2872,13 @@ class IrisGrid extends Component {
|
|
|
2834
2872
|
pendingDataErrors,
|
|
2835
2873
|
pendingSaveError: null
|
|
2836
2874
|
});
|
|
2837
|
-
(_this$
|
|
2875
|
+
(_this$grid22 = this.grid) === null || _this$grid22 === void 0 || _this$grid22.forceUpdate();
|
|
2838
2876
|
}
|
|
2839
2877
|
handleResizeColumn(modelIndex) {
|
|
2840
|
-
var _this$
|
|
2841
|
-
var _this$
|
|
2842
|
-
metrics = _this$
|
|
2843
|
-
metricCalculator = _this$
|
|
2878
|
+
var _this$grid23;
|
|
2879
|
+
var _this$state16 = this.state,
|
|
2880
|
+
metrics = _this$state16.metrics,
|
|
2881
|
+
metricCalculator = _this$state16.metricCalculator;
|
|
2844
2882
|
if (!metrics) throw new Error('Metrics not set');
|
|
2845
2883
|
var contentWidth = getOrThrow(metrics.contentColumnWidths, modelIndex);
|
|
2846
2884
|
var userWidths = metricCalculator.getUserColumnWidths();
|
|
@@ -2850,23 +2888,23 @@ class IrisGrid extends Component {
|
|
|
2850
2888
|
} else {
|
|
2851
2889
|
metricCalculator.setColumnWidth(modelIndex, contentWidth);
|
|
2852
2890
|
}
|
|
2853
|
-
(_this$
|
|
2891
|
+
(_this$grid23 = this.grid) === null || _this$grid23 === void 0 || _this$grid23.forceUpdate();
|
|
2854
2892
|
}
|
|
2855
2893
|
handleResizeAllColumns() {
|
|
2856
|
-
var _this$
|
|
2857
|
-
var _this$
|
|
2858
|
-
metrics = _this$
|
|
2859
|
-
metricCalculator = _this$
|
|
2894
|
+
var _this$grid24;
|
|
2895
|
+
var _this$state17 = this.state,
|
|
2896
|
+
metrics = _this$state17.metrics,
|
|
2897
|
+
metricCalculator = _this$state17.metricCalculator;
|
|
2860
2898
|
if (!metrics) throw new Error('Metrics not set');
|
|
2861
2899
|
var allColumns = [...metrics.allColumnWidths.entries()];
|
|
2862
|
-
var visibleColumns = allColumns.filter(
|
|
2863
|
-
var
|
|
2864
|
-
_ =
|
|
2865
|
-
width =
|
|
2900
|
+
var visibleColumns = allColumns.filter(_ref24 => {
|
|
2901
|
+
var _ref25 = _slicedToArray(_ref24, 2),
|
|
2902
|
+
_ = _ref25[0],
|
|
2903
|
+
width = _ref25[1];
|
|
2866
2904
|
return width !== 0;
|
|
2867
|
-
}).map(
|
|
2868
|
-
var
|
|
2869
|
-
modelIndex =
|
|
2905
|
+
}).map(_ref26 => {
|
|
2906
|
+
var _ref27 = _slicedToArray(_ref26, 1),
|
|
2907
|
+
modelIndex = _ref27[0];
|
|
2870
2908
|
return modelIndex;
|
|
2871
2909
|
});
|
|
2872
2910
|
var contentWidths = metrics.contentColumnWidths;
|
|
@@ -2888,7 +2926,7 @@ class IrisGrid extends Component {
|
|
|
2888
2926
|
metricCalculator.setColumnWidth(_modelIndex, _contentWidth);
|
|
2889
2927
|
}
|
|
2890
2928
|
}
|
|
2891
|
-
(_this$
|
|
2929
|
+
(_this$grid24 = this.grid) === null || _this$grid24 === void 0 || _this$grid24.forceUpdate();
|
|
2892
2930
|
}
|
|
2893
2931
|
|
|
2894
2932
|
/**
|
|
@@ -2929,8 +2967,8 @@ class IrisGrid extends Component {
|
|
|
2929
2967
|
if (shouldStartLoading) {
|
|
2930
2968
|
this.startLoading("Aggregating ".concat(aggregation.operation, "..."));
|
|
2931
2969
|
}
|
|
2932
|
-
this.setState(
|
|
2933
|
-
var aggregationSettings =
|
|
2970
|
+
this.setState(_ref28 => {
|
|
2971
|
+
var aggregationSettings = _ref28.aggregationSettings;
|
|
2934
2972
|
return {
|
|
2935
2973
|
selectedAggregation: aggregation,
|
|
2936
2974
|
aggregationSettings: _objectSpread(_objectSpread({}, aggregationSettings), {}, {
|
|
@@ -3034,8 +3072,8 @@ class IrisGrid extends Component {
|
|
|
3034
3072
|
*/
|
|
3035
3073
|
removeEmptyAggregations() {
|
|
3036
3074
|
log.debug('removeEmptyAggregations');
|
|
3037
|
-
this.setState(
|
|
3038
|
-
var aggregationSettings =
|
|
3075
|
+
this.setState(_ref29 => {
|
|
3076
|
+
var aggregationSettings = _ref29.aggregationSettings;
|
|
3039
3077
|
var aggregations = aggregationSettings.aggregations;
|
|
3040
3078
|
var newAggregations = aggregations.filter(a => a.selected.length > 0 || a.invert);
|
|
3041
3079
|
if (newAggregations.length !== aggregations.length) {
|
|
@@ -3210,11 +3248,11 @@ class IrisGrid extends Component {
|
|
|
3210
3248
|
onStateChange(irisGridState, gridState);
|
|
3211
3249
|
}
|
|
3212
3250
|
handleOverflowClose() {
|
|
3213
|
-
var _this$
|
|
3251
|
+
var _this$grid25;
|
|
3214
3252
|
this.setState({
|
|
3215
3253
|
showOverflowModal: false
|
|
3216
3254
|
});
|
|
3217
|
-
(_this$
|
|
3255
|
+
(_this$grid25 = this.grid) === null || _this$grid25 === void 0 || _this$grid25.focus(); // Focus on the grid after closing the overflow modal
|
|
3218
3256
|
}
|
|
3219
3257
|
handleOpenNoPastePermissionModal(errorMessage) {
|
|
3220
3258
|
this.setState({
|
|
@@ -3229,9 +3267,9 @@ class IrisGrid extends Component {
|
|
|
3229
3267
|
}
|
|
3230
3268
|
getColumnBoundingRect() {
|
|
3231
3269
|
var _this$gridWrapper2;
|
|
3232
|
-
var _this$
|
|
3233
|
-
metrics = _this$
|
|
3234
|
-
shownColumnTooltip = _this$
|
|
3270
|
+
var _this$state18 = this.state,
|
|
3271
|
+
metrics = _this$state18.metrics,
|
|
3272
|
+
shownColumnTooltip = _this$state18.shownColumnTooltip;
|
|
3235
3273
|
assertNotNull(metrics);
|
|
3236
3274
|
assertNotNull(shownColumnTooltip);
|
|
3237
3275
|
var gridRect = (_this$gridWrapper2 = this.gridWrapper) === null || _this$gridWrapper2 === void 0 ? void 0 : _this$gridWrapper2.getBoundingClientRect();
|
|
@@ -3284,22 +3322,22 @@ class IrisGrid extends Component {
|
|
|
3284
3322
|
gotoRowError: 'Invalid row index'
|
|
3285
3323
|
});
|
|
3286
3324
|
} else if (rowInt === 0) {
|
|
3287
|
-
var _this$
|
|
3325
|
+
var _this$grid26;
|
|
3288
3326
|
this.setState({
|
|
3289
3327
|
gotoRowError: '',
|
|
3290
3328
|
gotoValueError: ''
|
|
3291
3329
|
});
|
|
3292
|
-
(_this$
|
|
3330
|
+
(_this$grid26 = this.grid) === null || _this$grid26 === void 0 || _this$grid26.setFocusRow(0);
|
|
3293
3331
|
} else if (rowInt < 0) {
|
|
3294
|
-
var _this$
|
|
3332
|
+
var _this$grid27;
|
|
3295
3333
|
this.setState({
|
|
3296
3334
|
gotoRowError: '',
|
|
3297
3335
|
gotoValueError: ''
|
|
3298
3336
|
});
|
|
3299
|
-
(_this$
|
|
3337
|
+
(_this$grid27 = this.grid) === null || _this$grid27 === void 0 || _this$grid27.setFocusRow(rowInt + rowCount);
|
|
3300
3338
|
} else {
|
|
3301
|
-
var _this$
|
|
3302
|
-
(_this$
|
|
3339
|
+
var _this$grid28;
|
|
3340
|
+
(_this$grid28 = this.grid) === null || _this$grid28 === void 0 || _this$grid28.setFocusRow(rowInt - 1);
|
|
3303
3341
|
this.setState({
|
|
3304
3342
|
gotoRowError: '',
|
|
3305
3343
|
gotoValueError: ''
|
|
@@ -3397,12 +3435,12 @@ class IrisGrid extends Component {
|
|
|
3397
3435
|
});
|
|
3398
3436
|
}
|
|
3399
3437
|
handleGotoValueSelectedColumnNameChanged(columnName) {
|
|
3400
|
-
var _this$
|
|
3438
|
+
var _this$grid29;
|
|
3401
3439
|
var model = this.props.model;
|
|
3402
|
-
var cursorRow = (_this$
|
|
3403
|
-
var _this$
|
|
3404
|
-
prevColumnName = _this$
|
|
3405
|
-
gotoValueManuallyChanged = _this$
|
|
3440
|
+
var cursorRow = (_this$grid29 = this.grid) === null || _this$grid29 === void 0 ? void 0 : _this$grid29.state.cursorRow;
|
|
3441
|
+
var _this$state19 = this.state,
|
|
3442
|
+
prevColumnName = _this$state19.gotoValueSelectedColumnName,
|
|
3443
|
+
gotoValueManuallyChanged = _this$state19.gotoValueManuallyChanged;
|
|
3406
3444
|
if (cursorRow != null) {
|
|
3407
3445
|
var index = model.getColumnIndexByName(columnName);
|
|
3408
3446
|
var column = IrisGridUtils.getColumnByName(model.columns, columnName);
|
|
@@ -3455,7 +3493,7 @@ class IrisGrid extends Component {
|
|
|
3455
3493
|
* @returns The filter input field element or null if not applicable
|
|
3456
3494
|
*/
|
|
3457
3495
|
getFilterBarInput(metrics, metricCalculator, focusedFilterBarColumn, quickFilters, advancedFilters) {
|
|
3458
|
-
var _this$
|
|
3496
|
+
var _this$grid30;
|
|
3459
3497
|
if (metrics == null || focusedFilterBarColumn == null) {
|
|
3460
3498
|
return null;
|
|
3461
3499
|
}
|
|
@@ -3510,7 +3548,7 @@ class IrisGrid extends Component {
|
|
|
3510
3548
|
onChange: this.handleFilterBarChange,
|
|
3511
3549
|
onDone: this.handleFilterBarDone,
|
|
3512
3550
|
onTab: this.handleFilterBarTab,
|
|
3513
|
-
onContextMenu: (_this$
|
|
3551
|
+
onContextMenu: (_this$grid30 = this.grid) === null || _this$grid30 === void 0 ? void 0 : _this$grid30.handleContextMenu,
|
|
3514
3552
|
debounceMs: debounceMs,
|
|
3515
3553
|
value: value
|
|
3516
3554
|
}, focusedFilterBarColumn);
|
|
@@ -3519,7 +3557,7 @@ class IrisGrid extends Component {
|
|
|
3519
3557
|
var _rollupConfig$columns7,
|
|
3520
3558
|
_rollupConfig$columns8,
|
|
3521
3559
|
_this7 = this,
|
|
3522
|
-
_this$
|
|
3560
|
+
_this$grid31,
|
|
3523
3561
|
_openOptions;
|
|
3524
3562
|
var _this$props8 = this.props,
|
|
3525
3563
|
children = _this$props8.children,
|
|
@@ -3538,75 +3576,76 @@ class IrisGrid extends Component {
|
|
|
3538
3576
|
onCreateChart = _this$props8.onCreateChart,
|
|
3539
3577
|
transformTableOptions = _this$props8.transformTableOptions;
|
|
3540
3578
|
var cellInputRendererRegistry = this.context.cellInputRendererRegistry;
|
|
3541
|
-
var _this$
|
|
3542
|
-
metricCalculator = _this$
|
|
3543
|
-
metrics = _this$
|
|
3544
|
-
isFilterBarShown = _this$
|
|
3545
|
-
isSelectingPartition = _this$
|
|
3546
|
-
isMenuShown = _this$
|
|
3547
|
-
isReady = _this$
|
|
3548
|
-
copyOperation = _this$
|
|
3549
|
-
focusedFilterBarColumn = _this$
|
|
3550
|
-
loadingText = _this$
|
|
3551
|
-
loadingScrimProgress = _this$
|
|
3552
|
-
loadingSpinnerShown = _this$
|
|
3553
|
-
loadingCancelShown = _this$
|
|
3554
|
-
loadingBlocksGrid = _this$
|
|
3555
|
-
shownColumnTooltip = _this$
|
|
3556
|
-
hoverAdvancedFilter = _this$
|
|
3557
|
-
shownAdvancedFilter = _this$
|
|
3558
|
-
maximizedAdvancedFilter = _this$
|
|
3559
|
-
hoverSelectColumn = _this$
|
|
3560
|
-
quickFilters = _this$
|
|
3561
|
-
advancedFilters = _this$
|
|
3562
|
-
searchFilter = _this$
|
|
3563
|
-
selectDistinctColumns = _this$
|
|
3564
|
-
movedColumns = _this$
|
|
3565
|
-
movedRows = _this$
|
|
3566
|
-
formatter = _this$
|
|
3567
|
-
conditionalFormats = _this$
|
|
3568
|
-
conditionalFormatPreview = _this$
|
|
3569
|
-
conditionalFormatEditIndex = _this$
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3579
|
+
var _this$state20 = this.state,
|
|
3580
|
+
metricCalculator = _this$state20.metricCalculator,
|
|
3581
|
+
metrics = _this$state20.metrics,
|
|
3582
|
+
isFilterBarShown = _this$state20.isFilterBarShown,
|
|
3583
|
+
isSelectingPartition = _this$state20.isSelectingPartition,
|
|
3584
|
+
isMenuShown = _this$state20.isMenuShown,
|
|
3585
|
+
isReady = _this$state20.isReady,
|
|
3586
|
+
copyOperation = _this$state20.copyOperation,
|
|
3587
|
+
focusedFilterBarColumn = _this$state20.focusedFilterBarColumn,
|
|
3588
|
+
loadingText = _this$state20.loadingText,
|
|
3589
|
+
loadingScrimProgress = _this$state20.loadingScrimProgress,
|
|
3590
|
+
loadingSpinnerShown = _this$state20.loadingSpinnerShown,
|
|
3591
|
+
loadingCancelShown = _this$state20.loadingCancelShown,
|
|
3592
|
+
loadingBlocksGrid = _this$state20.loadingBlocksGrid,
|
|
3593
|
+
shownColumnTooltip = _this$state20.shownColumnTooltip,
|
|
3594
|
+
hoverAdvancedFilter = _this$state20.hoverAdvancedFilter,
|
|
3595
|
+
shownAdvancedFilter = _this$state20.shownAdvancedFilter,
|
|
3596
|
+
maximizedAdvancedFilter = _this$state20.maximizedAdvancedFilter,
|
|
3597
|
+
hoverSelectColumn = _this$state20.hoverSelectColumn,
|
|
3598
|
+
quickFilters = _this$state20.quickFilters,
|
|
3599
|
+
advancedFilters = _this$state20.advancedFilters,
|
|
3600
|
+
searchFilter = _this$state20.searchFilter,
|
|
3601
|
+
selectDistinctColumns = _this$state20.selectDistinctColumns,
|
|
3602
|
+
movedColumns = _this$state20.movedColumns,
|
|
3603
|
+
movedRows = _this$state20.movedRows,
|
|
3604
|
+
formatter = _this$state20.formatter,
|
|
3605
|
+
conditionalFormats = _this$state20.conditionalFormats,
|
|
3606
|
+
conditionalFormatPreview = _this$state20.conditionalFormatPreview,
|
|
3607
|
+
conditionalFormatEditIndex = _this$state20.conditionalFormatEditIndex,
|
|
3608
|
+
conditionalFormatError = _this$state20.conditionalFormatError,
|
|
3609
|
+
columnAlignmentMap = _this$state20.columnAlignmentMap,
|
|
3610
|
+
sorts = _this$state20.sorts,
|
|
3611
|
+
reverse = _this$state20.reverse,
|
|
3612
|
+
customColumns = _this$state20.customColumns,
|
|
3613
|
+
selectedRanges = _this$state20.selectedRanges,
|
|
3614
|
+
isTableDownloading = _this$state20.isTableDownloading,
|
|
3615
|
+
tableDownloadStatus = _this$state20.tableDownloadStatus,
|
|
3616
|
+
tableDownloadProgress = _this$state20.tableDownloadProgress,
|
|
3617
|
+
tableDownloadEstimatedTime = _this$state20.tableDownloadEstimatedTime,
|
|
3618
|
+
showSearchBar = _this$state20.showSearchBar,
|
|
3619
|
+
searchValue = _this$state20.searchValue,
|
|
3620
|
+
selectedSearchColumns = _this$state20.selectedSearchColumns,
|
|
3621
|
+
invertSearchColumns = _this$state20.invertSearchColumns,
|
|
3622
|
+
aggregationSettings = _this$state20.aggregationSettings,
|
|
3623
|
+
selectedAggregation = _this$state20.selectedAggregation,
|
|
3624
|
+
rollupConfig = _this$state20.rollupConfig,
|
|
3625
|
+
openOptions = _this$state20.openOptions,
|
|
3626
|
+
pendingSavePromise = _this$state20.pendingSavePromise,
|
|
3627
|
+
pendingSaveError = _this$state20.pendingSaveError,
|
|
3628
|
+
pendingRowCount = _this$state20.pendingRowCount,
|
|
3629
|
+
pendingDataErrors = _this$state20.pendingDataErrors,
|
|
3630
|
+
pendingDataMap = _this$state20.pendingDataMap,
|
|
3631
|
+
toastMessage = _this$state20.toastMessage,
|
|
3632
|
+
frozenColumns = _this$state20.frozenColumns,
|
|
3633
|
+
columnHeaderGroups = _this$state20.columnHeaderGroups,
|
|
3634
|
+
showOverflowModal = _this$state20.showOverflowModal,
|
|
3635
|
+
showNoPastePermissionModal = _this$state20.showNoPastePermissionModal,
|
|
3636
|
+
noPastePermissionError = _this$state20.noPastePermissionError,
|
|
3637
|
+
overflowText = _this$state20.overflowText,
|
|
3638
|
+
overflowButtonTooltipProps = _this$state20.overflowButtonTooltipProps,
|
|
3639
|
+
expandCellTooltipProps = _this$state20.expandCellTooltipProps,
|
|
3640
|
+
hoverTooltipProps = _this$state20.hoverTooltipProps,
|
|
3641
|
+
isGotoShown = _this$state20.isGotoShown,
|
|
3642
|
+
gotoRow = _this$state20.gotoRow,
|
|
3643
|
+
gotoRowError = _this$state20.gotoRowError,
|
|
3644
|
+
gotoValueError = _this$state20.gotoValueError,
|
|
3645
|
+
gotoValueSelectedColumnName = _this$state20.gotoValueSelectedColumnName,
|
|
3646
|
+
gotoValue = _this$state20.gotoValue,
|
|
3647
|
+
gotoValueSelectedFilter = _this$state20.gotoValueSelectedFilter,
|
|
3648
|
+
partitionConfig = _this$state20.partitionConfig;
|
|
3610
3649
|
if (!isReady) {
|
|
3611
3650
|
return null;
|
|
3612
3651
|
}
|
|
@@ -3773,8 +3812,8 @@ class IrisGrid extends Component {
|
|
|
3773
3812
|
return 1; // continue
|
|
3774
3813
|
}
|
|
3775
3814
|
var advancedFilter = advancedFilters.get(modelColumn);
|
|
3776
|
-
var
|
|
3777
|
-
advancedFilterOptions =
|
|
3815
|
+
var _ref30 = advancedFilter || {},
|
|
3816
|
+
advancedFilterOptions = _ref30.options;
|
|
3778
3817
|
var sort = TableUtils.getSortForColumn(model.sort, column.name);
|
|
3779
3818
|
var sortDirection = sort ? sort.direction : null;
|
|
3780
3819
|
if (!isSortDirection(sortDirection)) {
|
|
@@ -3844,6 +3883,7 @@ class IrisGrid extends Component {
|
|
|
3844
3883
|
dh: model.dh,
|
|
3845
3884
|
columns: model.columns,
|
|
3846
3885
|
rule: conditionalFormatPreview,
|
|
3886
|
+
errorMessage: conditionalFormatError !== null && conditionalFormatError !== void 0 ? conditionalFormatError : undefined,
|
|
3847
3887
|
onUpdate: this.handleConditionalFormatEditorUpdate,
|
|
3848
3888
|
onSave: this.handleConditionalFormatEditorSave,
|
|
3849
3889
|
onCancel: this.handleConditionalFormatEditorCancel
|
|
@@ -4014,7 +4054,7 @@ class IrisGrid extends Component {
|
|
|
4014
4054
|
movedColumns: movedColumns,
|
|
4015
4055
|
customColumns: customColumns,
|
|
4016
4056
|
hiddenColumns: hiddenColumns,
|
|
4017
|
-
alwaysFetchColumns: this.getAlwaysFetchColumns(alwaysFetchColumns, model.columns, movedColumns, model.floatingLeftColumnCount, model.floatingRightColumnCount, (_this$
|
|
4057
|
+
alwaysFetchColumns: this.getAlwaysFetchColumns(alwaysFetchColumns, model.columns, movedColumns, model.floatingLeftColumnCount, model.floatingRightColumnCount, (_this$grid31 = this.grid) === null || _this$grid31 === void 0 || (_this$grid31 = _this$grid31.state.draggingColumn) === null || _this$grid31 === void 0 ? void 0 : _this$grid31.range),
|
|
4018
4058
|
formatColumns: this.getCachedPreviewFormatColumns(model.dh, model.columns, conditionalFormats, conditionalFormatPreview,
|
|
4019
4059
|
// Disable the preview format when we press Back on the format edit page
|
|
4020
4060
|
((_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),
|