@deephaven/iris-grid 1.7.1 → 1.7.2-beta.3
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.js +5 -7
- package/dist/AdvancedFilterCreator.js.map +1 -1
- package/dist/AdvancedFilterCreatorFilterItem.js +6 -7
- package/dist/AdvancedFilterCreatorFilterItem.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValue.js +1 -2
- package/dist/AdvancedFilterCreatorSelectValue.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValueList.js +2 -3
- package/dist/AdvancedFilterCreatorSelectValueList.js.map +1 -1
- package/dist/ColumnHeaderGroup.js.map +1 -1
- package/dist/ColumnStatistics.d.ts +2 -2
- package/dist/ColumnStatistics.d.ts.map +1 -1
- package/dist/ColumnStatistics.js +2 -5
- package/dist/ColumnStatistics.js.map +1 -1
- package/dist/CommonTypes.js.map +1 -1
- package/dist/CrossColumnSearch.js +2 -4
- package/dist/CrossColumnSearch.js.map +1 -1
- package/dist/EmptyIrisGridModel.js.map +1 -1
- package/dist/FilterInputField.js +4 -5
- package/dist/FilterInputField.js.map +1 -1
- package/dist/GotoRow.js +4 -6
- package/dist/GotoRow.js.map +1 -1
- package/dist/IrisGrid.d.ts +39 -49
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +158 -175
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridBottomBar.js.map +1 -1
- package/dist/IrisGridCacheUtils.js.map +1 -1
- package/dist/IrisGridCellOverflowModal.js +1 -2
- package/dist/IrisGridCellOverflowModal.js.map +1 -1
- package/dist/IrisGridCellRendererUtils.js.map +1 -1
- package/dist/IrisGridCopyHandler.js +4 -6
- package/dist/IrisGridCopyHandler.js.map +1 -1
- package/dist/IrisGridDataBarCellRenderer.js.map +1 -1
- package/dist/IrisGridIcons.js.map +1 -1
- package/dist/IrisGridMetricCalculator.d.ts +1 -2
- package/dist/IrisGridMetricCalculator.d.ts.map +1 -1
- package/dist/IrisGridMetricCalculator.js +3 -2
- package/dist/IrisGridMetricCalculator.js.map +1 -1
- package/dist/IrisGridModel.js.map +1 -1
- package/dist/IrisGridModelFactory.js.map +1 -1
- package/dist/IrisGridModelUpdater.js.map +1 -1
- package/dist/IrisGridPartitionSelector.d.ts.map +1 -1
- package/dist/IrisGridPartitionSelector.js +6 -8
- package/dist/IrisGridPartitionSelector.js.map +1 -1
- package/dist/IrisGridPartitionedTableModel.js.map +1 -1
- package/dist/IrisGridProxyModel.js +6 -7
- package/dist/IrisGridProxyModel.js.map +1 -1
- package/dist/IrisGridRenderer.js +0 -1
- package/dist/IrisGridRenderer.js.map +1 -1
- package/dist/IrisGridShortcuts.js.map +1 -1
- package/dist/IrisGridTableModel.js +1 -2
- package/dist/IrisGridTableModel.js.map +1 -1
- package/dist/IrisGridTableModelTemplate.d.ts +1 -1
- package/dist/IrisGridTableModelTemplate.d.ts.map +1 -1
- package/dist/IrisGridTableModelTemplate.js +57 -61
- package/dist/IrisGridTableModelTemplate.js.map +1 -1
- package/dist/IrisGridTestUtils.js.map +1 -1
- package/dist/IrisGridTextCellRenderer.js.map +1 -1
- package/dist/IrisGridTheme.js.map +1 -1
- package/dist/IrisGridThemeProvider.js.map +1 -1
- package/dist/IrisGridTreeTableModel.js +12 -13
- package/dist/IrisGridTreeTableModel.js.map +1 -1
- package/dist/IrisGridUtils.js +56 -56
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/LazyIrisGrid.d.ts +55 -78
- package/dist/LazyIrisGrid.d.ts.map +1 -1
- package/dist/LazyIrisGrid.js.map +1 -1
- package/dist/MissingKeyError.js.map +1 -1
- package/dist/MissingPartitionError.js.map +1 -1
- package/dist/NoPastePermissionModal.js +1 -2
- package/dist/NoPastePermissionModal.js.map +1 -1
- package/dist/PartitionedGridModel.js.map +1 -1
- package/dist/PendingDataBottomBar.js +1 -2
- package/dist/PendingDataBottomBar.js.map +1 -1
- package/dist/ToastBottomBar.js.map +1 -1
- package/dist/declaration.d.js.map +1 -1
- package/dist/format-context-menus/CustomFormatAction.js +1 -2
- package/dist/format-context-menus/CustomFormatAction.js.map +1 -1
- package/dist/format-context-menus/DateTimeFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/FormatContextMenuUtils.js.map +1 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/TextAlignmentFormatContextMenu.js +6 -4
- package/dist/format-context-menus/TextAlignmentFormatContextMenu.js.map +1 -1
- package/dist/format-context-menus/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/key-handlers/ClearFilterKeyHandler.js.map +1 -1
- package/dist/key-handlers/CopyCellKeyHandler.js.map +1 -1
- package/dist/key-handlers/CopyKeyHandler.js.map +1 -1
- package/dist/key-handlers/ReverseKeyHandler.js.map +1 -1
- package/dist/key-handlers/index.js.map +1 -1
- package/dist/mousehandlers/IrisGridCellOverflowMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.d.ts.map +1 -1
- package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js +5 -2
- package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js +1 -2
- package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridCopyCellMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridDataSelectMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridFilterMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridPartitionedTableMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridRowTreeMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridSortMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridTokenMouseHandler.js +1 -3
- package/dist/mousehandlers/IrisGridTokenMouseHandler.js.map +1 -1
- package/dist/mousehandlers/PendingMouseHandler.js.map +1 -1
- package/dist/mousehandlers/index.js.map +1 -1
- package/dist/sidebar/AdvancedSettings.js.map +1 -1
- package/dist/sidebar/AdvancedSettingsMenu.d.ts +1 -1
- package/dist/sidebar/AdvancedSettingsMenu.d.ts.map +1 -1
- package/dist/sidebar/AdvancedSettingsMenu.js.map +1 -1
- package/dist/sidebar/AdvancedSettingsType.js +3 -3
- package/dist/sidebar/AdvancedSettingsType.js.map +1 -1
- package/dist/sidebar/ChartBuilder.d.ts +2 -2
- package/dist/sidebar/ChartBuilder.d.ts.map +1 -1
- package/dist/sidebar/ChartBuilder.js +1 -2
- package/dist/sidebar/ChartBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnBuilder.js +3 -5
- package/dist/sidebar/CustomColumnBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnInput.js +1 -2
- package/dist/sidebar/CustomColumnInput.js.map +1 -1
- package/dist/sidebar/DownloadServiceWorkerUtils.js +1 -1
- package/dist/sidebar/DownloadServiceWorkerUtils.js.map +1 -1
- package/dist/sidebar/InputEditor.js +8 -9
- package/dist/sidebar/InputEditor.js.map +1 -1
- package/dist/sidebar/OptionType.js +3 -3
- package/dist/sidebar/OptionType.js.map +1 -1
- package/dist/sidebar/RollupRows.js +7 -9
- package/dist/sidebar/RollupRows.js.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.js +1 -2
- package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
- package/dist/sidebar/TableCsvExporter.js +5 -7
- package/dist/sidebar/TableCsvExporter.js.map +1 -1
- package/dist/sidebar/TableSaver.js +9 -10
- package/dist/sidebar/TableSaver.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationEdit.js +4 -5
- package/dist/sidebar/aggregations/AggregationEdit.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationOperation.js +3 -3
- package/dist/sidebar/aggregations/AggregationOperation.js.map +1 -1
- package/dist/sidebar/aggregations/AggregationUtils.js +0 -1
- package/dist/sidebar/aggregations/AggregationUtils.js.map +1 -1
- package/dist/sidebar/aggregations/Aggregations.d.ts.map +1 -1
- package/dist/sidebar/aggregations/Aggregations.js +2 -4
- package/dist/sidebar/aggregations/Aggregations.js.map +1 -1
- package/dist/sidebar/aggregations/index.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js +1 -3
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.js +2 -3
- package/dist/sidebar/conditional-formatting/ConditionEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js +1 -2
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js +1 -2
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js +21 -21
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/RowFormatEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js +1 -3
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/StyleEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/StyleEditor.js +2 -3
- package/dist/sidebar/conditional-formatting/StyleEditor.js.map +1 -1
- package/dist/sidebar/icons/BarIcon.js +1 -2
- package/dist/sidebar/icons/BarIcon.js.map +1 -1
- package/dist/sidebar/icons/FormatColumnWhereIcon.js +1 -2
- package/dist/sidebar/icons/FormatColumnWhereIcon.js.map +1 -1
- package/dist/sidebar/icons/FormatRowWhereIcon.js +1 -2
- package/dist/sidebar/icons/FormatRowWhereIcon.js.map +1 -1
- package/dist/sidebar/icons/HistogramIcon.js +1 -2
- package/dist/sidebar/icons/HistogramIcon.js.map +1 -1
- package/dist/sidebar/icons/LineIcon.js +1 -2
- package/dist/sidebar/icons/LineIcon.js.map +1 -1
- package/dist/sidebar/icons/PieIcon.js +1 -2
- package/dist/sidebar/icons/PieIcon.js.map +1 -1
- package/dist/sidebar/icons/ScatterIcon.js +1 -2
- package/dist/sidebar/icons/ScatterIcon.js.map +1 -1
- package/dist/sidebar/icons/index.js.map +1 -1
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.d.ts +2 -2
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.d.ts.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js +34 -36
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.js +3 -3
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js +3 -5
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.d.ts.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js +2 -4
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/PointerSensorWithInteraction.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js +4 -4
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js +3 -6
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js +1 -2
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/types.js.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.d.ts +1 -2
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.d.ts.map +1 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.js.map +1 -1
- package/package.json +17 -18
|
@@ -74,10 +74,6 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
74
74
|
get columns() {
|
|
75
75
|
return this.table.columns;
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
// Map from new row index to their values. Only for input tables that can have new rows added.
|
|
79
|
-
// The index of these rows start at 0, and they are appended at the end of the regular table data.
|
|
80
|
-
// These rows can be sparse, so using a map instead of an array.
|
|
81
77
|
/**
|
|
82
78
|
* @param dh JSAPI instance
|
|
83
79
|
* @param table Iris data table to be used in the model
|
|
@@ -107,6 +103,9 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
107
103
|
_defineProperty(this, "totalsTablePromise", void 0);
|
|
108
104
|
_defineProperty(this, "totals", void 0);
|
|
109
105
|
_defineProperty(this, "totalsDataMap", void 0);
|
|
106
|
+
// Map from new row index to their values. Only for input tables that can have new rows added.
|
|
107
|
+
// The index of these rows start at 0, and they are appended at the end of the regular table data.
|
|
108
|
+
// These rows can be sparse, so using a map instead of an array.
|
|
110
109
|
_defineProperty(this, "pendingNewDataMap", void 0);
|
|
111
110
|
_defineProperty(this, "pendingNewRowCount", 0);
|
|
112
111
|
_defineProperty(this, "_columnHeaderGroupMap", new Map());
|
|
@@ -146,7 +145,7 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
146
145
|
if (frontColumns.length > 0 || backColumns.length > 0 || frozenColumns.length > 0) {
|
|
147
146
|
var usedColumns = new Set();
|
|
148
147
|
var frontIndex = 0;
|
|
149
|
-
frozenColumns === null || frozenColumns === void 0
|
|
148
|
+
frozenColumns === null || frozenColumns === void 0 || frozenColumns.forEach(name => {
|
|
150
149
|
if (usedColumns.has(name)) {
|
|
151
150
|
throw new Error("Column specified in multiple layout hints: ".concat(name));
|
|
152
151
|
}
|
|
@@ -161,7 +160,7 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
161
160
|
frontIndex += 1;
|
|
162
161
|
});
|
|
163
162
|
var backIndex = this.columns.length - 1;
|
|
164
|
-
backColumns === null || backColumns === void 0
|
|
163
|
+
backColumns === null || backColumns === void 0 || backColumns.forEach(name => {
|
|
165
164
|
if (usedColumns.has(name)) {
|
|
166
165
|
throw new Error("Column specified in multiple layout hints: ".concat(name));
|
|
167
166
|
}
|
|
@@ -245,6 +244,9 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
245
244
|
log.debug2('setViewport', this.viewport);
|
|
246
245
|
this.applyViewport();
|
|
247
246
|
}, SET_VIEWPORT_THROTTLE));
|
|
247
|
+
/**
|
|
248
|
+
* Applies the current viewport to the underlying table.
|
|
249
|
+
*/
|
|
248
250
|
_defineProperty(this, "applyViewport", throttle(() => {
|
|
249
251
|
if (!this.viewport) {
|
|
250
252
|
return;
|
|
@@ -284,7 +286,7 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
284
286
|
if (!map.has(rowIndex)) {
|
|
285
287
|
map.set(rowIndex, []);
|
|
286
288
|
}
|
|
287
|
-
(_map$get = map.get(rowIndex)) === null || _map$get === void 0
|
|
289
|
+
(_map$get = map.get(rowIndex)) === null || _map$get === void 0 || _map$get.push(new MissingKeyError(rowIndex, columns[i].name));
|
|
288
290
|
}
|
|
289
291
|
}
|
|
290
292
|
});
|
|
@@ -397,10 +399,10 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
397
399
|
}));
|
|
398
400
|
}
|
|
399
401
|
get rowCount() {
|
|
400
|
-
var _this$totals$operatio, _this$totals
|
|
402
|
+
var _this$totals$operatio, _this$totals;
|
|
401
403
|
return (
|
|
402
404
|
// Table size can be negative if the table isn't ready yet
|
|
403
|
-
Math.max(this.table.size, 0) + this.pendingNewRowCount + ((_this$totals$operatio = (_this$totals = this.totals) === null || _this$totals === void 0
|
|
405
|
+
Math.max(this.table.size, 0) + this.pendingNewRowCount + ((_this$totals$operatio = (_this$totals = this.totals) === null || _this$totals === void 0 || (_this$totals = _this$totals.operationOrder) === null || _this$totals === void 0 ? void 0 : _this$totals.length) !== null && _this$totals$operatio !== void 0 ? _this$totals$operatio : 0)
|
|
404
406
|
);
|
|
405
407
|
}
|
|
406
408
|
get pendingDataErrors() {
|
|
@@ -449,12 +451,12 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
449
451
|
return this.columns.length;
|
|
450
452
|
}
|
|
451
453
|
get floatingBottomRowCount() {
|
|
452
|
-
var _this$totals$
|
|
453
|
-
return this.totals != null && this.totals.showOnTop ? 0 : (_this$totals$
|
|
454
|
+
var _this$totals$operatio2, _this$totals2;
|
|
455
|
+
return this.totals != null && this.totals.showOnTop ? 0 : (_this$totals$operatio2 = (_this$totals2 = this.totals) === null || _this$totals2 === void 0 || (_this$totals2 = _this$totals2.operationOrder) === null || _this$totals2 === void 0 ? void 0 : _this$totals2.length) !== null && _this$totals$operatio2 !== void 0 ? _this$totals$operatio2 : 0;
|
|
454
456
|
}
|
|
455
457
|
get floatingTopRowCount() {
|
|
456
|
-
var _this$totals$
|
|
457
|
-
return this.totals != null && this.totals.showOnTop ? (_this$totals$
|
|
458
|
+
var _this$totals$operatio3, _this$totals3;
|
|
459
|
+
return this.totals != null && this.totals.showOnTop ? (_this$totals$operatio3 = (_this$totals3 = this.totals) === null || _this$totals3 === void 0 || (_this$totals3 = _this$totals3.operationOrder) === null || _this$totals3 === void 0 ? void 0 : _this$totals3.length) !== null && _this$totals$operatio3 !== void 0 ? _this$totals$operatio3 : 0 : 0;
|
|
458
460
|
}
|
|
459
461
|
get isValuesTableAvailable() {
|
|
460
462
|
return this.table.selectDistinct != null && this.table.copy != null;
|
|
@@ -520,15 +522,15 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
520
522
|
|
|
521
523
|
// Use a separate cache from memoization just for the strings that are currently displayed
|
|
522
524
|
if (((_this$formattedString = this.formattedStringData[x]) === null || _this$formattedString === void 0 ? void 0 : _this$formattedString[y]) === undefined) {
|
|
523
|
-
var
|
|
524
|
-
if (
|
|
525
|
+
var value = this.valueForCell(x, y);
|
|
526
|
+
if (value === null) {
|
|
525
527
|
return null;
|
|
526
528
|
}
|
|
527
|
-
if (
|
|
529
|
+
if (value === undefined) {
|
|
528
530
|
return undefined;
|
|
529
531
|
}
|
|
530
|
-
var
|
|
531
|
-
var hasCustomColumnFormat = this.getCachedCustomColumnFormatFlag(this.formatter,
|
|
532
|
+
var column = this.sourceColumn(x, y);
|
|
533
|
+
var hasCustomColumnFormat = this.getCachedCustomColumnFormatFlag(this.formatter, column.name, column.type);
|
|
532
534
|
var formatOverride;
|
|
533
535
|
if (!hasCustomColumnFormat) {
|
|
534
536
|
var formatForCell = this.formatForCell(x, y);
|
|
@@ -536,7 +538,7 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
536
538
|
formatOverride = formatForCell;
|
|
537
539
|
}
|
|
538
540
|
}
|
|
539
|
-
var text = this.displayString(
|
|
541
|
+
var text = this.displayString(value, column.type, column.name, formatOverride);
|
|
540
542
|
this.cacheFormattedValue(x, y, text);
|
|
541
543
|
}
|
|
542
544
|
return this.formattedStringData[x][y];
|
|
@@ -576,9 +578,9 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
576
578
|
if (data) {
|
|
577
579
|
var {
|
|
578
580
|
format,
|
|
579
|
-
value
|
|
581
|
+
value
|
|
580
582
|
} = data;
|
|
581
|
-
if (
|
|
583
|
+
if (value == null || value === '') {
|
|
582
584
|
assertNotNull(theme.nullStringColor);
|
|
583
585
|
return theme.nullStringColor;
|
|
584
586
|
}
|
|
@@ -592,9 +594,9 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
592
594
|
}
|
|
593
595
|
|
|
594
596
|
// Fallback to formatting based on the value/type of the cell
|
|
595
|
-
if (
|
|
596
|
-
var
|
|
597
|
-
return IrisGridUtils.colorForValue(theme,
|
|
597
|
+
if (value != null) {
|
|
598
|
+
var column = this.sourceColumn(x, y);
|
|
599
|
+
return IrisGridUtils.colorForValue(theme, column.type, column.name, value);
|
|
598
600
|
}
|
|
599
601
|
} else if (this.isPendingRow(y) && this.isKeyColumn(x)) {
|
|
600
602
|
assertNotNull(theme.errorTextColor);
|
|
@@ -732,8 +734,8 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
732
734
|
}
|
|
733
735
|
}
|
|
734
736
|
row(y) {
|
|
735
|
-
var _this$totals$
|
|
736
|
-
var totalsRowCount = (_this$totals$
|
|
737
|
+
var _this$totals$operatio4, _this$totals4, _this$totals$showOnTo, _this$totals5, _this$viewportData$of, _this$viewportData, _this$viewportData$ro, _this$viewportData2;
|
|
738
|
+
var totalsRowCount = (_this$totals$operatio4 = (_this$totals4 = this.totals) === null || _this$totals4 === void 0 || (_this$totals4 = _this$totals4.operationOrder) === null || _this$totals4 === void 0 ? void 0 : _this$totals4.length) !== null && _this$totals$operatio4 !== void 0 ? _this$totals$operatio4 : 0;
|
|
737
739
|
var showOnTop = (_this$totals$showOnTo = (_this$totals5 = this.totals) === null || _this$totals5 === void 0 ? void 0 : _this$totals5.showOnTop) !== null && _this$totals$showOnTo !== void 0 ? _this$totals$showOnTo : false;
|
|
738
740
|
var totalsRow = this.totalsRow(y);
|
|
739
741
|
if (totalsRow != null) {
|
|
@@ -749,7 +751,7 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
749
751
|
}
|
|
750
752
|
var offset = (_this$viewportData$of = (_this$viewportData = this.viewportData) === null || _this$viewportData === void 0 ? void 0 : _this$viewportData.offset) !== null && _this$viewportData$of !== void 0 ? _this$viewportData$of : 0;
|
|
751
753
|
var viewportY = (showOnTop ? y - totalsRowCount : y) - offset;
|
|
752
|
-
return (_this$viewportData$ro = (_this$viewportData2 = this.viewportData) === null || _this$viewportData2 === void 0
|
|
754
|
+
return (_this$viewportData$ro = (_this$viewportData2 = this.viewportData) === null || _this$viewportData2 === void 0 || (_this$viewportData2 = _this$viewportData2.rows) === null || _this$viewportData2 === void 0 ? void 0 : _this$viewportData2[viewportY]) !== null && _this$viewportData$ro !== void 0 ? _this$viewportData$ro : null;
|
|
753
755
|
}
|
|
754
756
|
|
|
755
757
|
/**
|
|
@@ -772,15 +774,14 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
772
774
|
// When there are multiple aggregations for the column, the column name will be the original name of the column with the operation appended afterward
|
|
773
775
|
// When the the operation is the default operation OR there is only one operation for the column, then the totals column name is just the original column name
|
|
774
776
|
var totalsColumn = (_this$totalsTable = this.totalsTable) === null || _this$totalsTable === void 0 ? void 0 : _this$totalsTable.columns.find(col => {
|
|
775
|
-
var _this$totals9
|
|
776
|
-
return col.name === "".concat(tableColumn.name, "__").concat(operation) || (operation === defaultOperation || ((_this$totals9 = this.totals) === null || _this$totals9 === void 0
|
|
777
|
+
var _this$totals9;
|
|
778
|
+
return col.name === "".concat(tableColumn.name, "__").concat(operation) || (operation === defaultOperation || ((_this$totals9 = this.totals) === null || _this$totals9 === void 0 || (_this$totals9 = _this$totals9.operationMap[col.name]) === null || _this$totals9 === void 0 ? void 0 : _this$totals9.length) === 1) && col.name === tableColumn.name;
|
|
777
779
|
});
|
|
778
780
|
if (totalsColumn != null) {
|
|
779
781
|
return totalsColumn;
|
|
780
782
|
}
|
|
781
783
|
// There may be cases were the totals table doesn't have a column, such as when there's a virtual column
|
|
782
784
|
}
|
|
783
|
-
|
|
784
785
|
return this.columns[column];
|
|
785
786
|
}
|
|
786
787
|
|
|
@@ -791,9 +792,9 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
791
792
|
* @returns The row within the totals table if it's a totals row, null otherwise
|
|
792
793
|
*/
|
|
793
794
|
totalsRow(y) {
|
|
794
|
-
var _this$totals$
|
|
795
|
-
var totalsRowCount = (_this$totals$
|
|
796
|
-
var showOnTop = (_this$totals$showOnTo2 = (_this$
|
|
795
|
+
var _this$totals$operatio5, _this$totals0, _this$totals$showOnTo2, _this$totals1;
|
|
796
|
+
var totalsRowCount = (_this$totals$operatio5 = (_this$totals0 = this.totals) === null || _this$totals0 === void 0 || (_this$totals0 = _this$totals0.operationOrder) === null || _this$totals0 === void 0 ? void 0 : _this$totals0.length) !== null && _this$totals$operatio5 !== void 0 ? _this$totals$operatio5 : 0;
|
|
797
|
+
var showOnTop = (_this$totals$showOnTo2 = (_this$totals1 = this.totals) === null || _this$totals1 === void 0 ? void 0 : _this$totals1.showOnTop) !== null && _this$totals$showOnTo2 !== void 0 ? _this$totals$showOnTo2 : false;
|
|
797
798
|
var totalsRow = showOnTop ? y : y - this.table.size;
|
|
798
799
|
if (totalsRow >= 0 && totalsRow < totalsRowCount) {
|
|
799
800
|
return totalsRow;
|
|
@@ -866,8 +867,8 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
866
867
|
}
|
|
867
868
|
copyTotalsData(totalsData) {
|
|
868
869
|
var _this$totals$defaultO2,
|
|
869
|
-
_this$
|
|
870
|
-
_this$
|
|
870
|
+
_this$totals10,
|
|
871
|
+
_this$totals11,
|
|
871
872
|
_this = this;
|
|
872
873
|
if (totalsData == null) {
|
|
873
874
|
log.warn('invalid data!');
|
|
@@ -883,12 +884,12 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
883
884
|
}
|
|
884
885
|
var dataMap = new Map();
|
|
885
886
|
var row = rows[0];
|
|
886
|
-
var defaultOperation = (_this$totals$defaultO2 = (_this$
|
|
887
|
-
var operationMap = (_this$
|
|
887
|
+
var defaultOperation = (_this$totals$defaultO2 = (_this$totals10 = this.totals) === null || _this$totals10 === void 0 ? void 0 : _this$totals10.defaultOperation) !== null && _this$totals$defaultO2 !== void 0 ? _this$totals$defaultO2 : AggregationOperation.SUM;
|
|
888
|
+
var operationMap = (_this$totals11 = this.totals) === null || _this$totals11 === void 0 ? void 0 : _this$totals11.operationMap;
|
|
888
889
|
var _loop = function _loop() {
|
|
889
890
|
var _operationMap$name$, _operationMap$name;
|
|
890
891
|
var column = columns[c];
|
|
891
|
-
var [name, operation = (_operationMap$name$ = operationMap === null || operationMap === void 0
|
|
892
|
+
var [name, operation = (_operationMap$name$ = operationMap === null || operationMap === void 0 || (_operationMap$name = operationMap[name]) === null || _operationMap$name === void 0 ? void 0 : _operationMap$name[0]) !== null && _operationMap$name$ !== void 0 ? _operationMap$name$ : defaultOperation] = column.name.split('__');
|
|
892
893
|
if (!dataMap.has(operation)) {
|
|
893
894
|
dataMap.set(operation, {
|
|
894
895
|
data: new Map()
|
|
@@ -931,8 +932,8 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
931
932
|
columns
|
|
932
933
|
} = data;
|
|
933
934
|
for (var r = 0; r < data.rows.length; r += 1) {
|
|
934
|
-
var
|
|
935
|
-
var newRow = this.extractViewportRow(
|
|
935
|
+
var row = data.rows[r];
|
|
936
|
+
var newRow = this.extractViewportRow(row, columns);
|
|
936
937
|
newData.rows.push(newRow);
|
|
937
938
|
}
|
|
938
939
|
return newData;
|
|
@@ -940,11 +941,11 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
940
941
|
extractViewportRow(row, columns) {
|
|
941
942
|
var data = new Map();
|
|
942
943
|
for (var c = 0; c < columns.length; c += 1) {
|
|
943
|
-
var
|
|
944
|
-
var index = this.getColumnIndexByName(
|
|
945
|
-
data.set(index !== null && index !== void 0 ? index :
|
|
946
|
-
value: row.get(
|
|
947
|
-
format: row.getFormat(
|
|
944
|
+
var column = columns[c];
|
|
945
|
+
var index = this.getColumnIndexByName(column.name);
|
|
946
|
+
data.set(index !== null && index !== void 0 ? index : column.name, {
|
|
947
|
+
value: row.get(column),
|
|
948
|
+
format: row.getFormat(column)
|
|
948
949
|
});
|
|
949
950
|
}
|
|
950
951
|
return {
|
|
@@ -1040,11 +1041,6 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
1040
1041
|
this.addTotalsListeners(this.totalsTable);
|
|
1041
1042
|
}
|
|
1042
1043
|
}
|
|
1043
|
-
|
|
1044
|
-
/**
|
|
1045
|
-
* Applies the current viewport to the underlying table.
|
|
1046
|
-
*/
|
|
1047
|
-
|
|
1048
1044
|
applyBufferedViewport(viewportTop, viewportBottom, columns) {
|
|
1049
1045
|
this.dispatchEvent(new EventShimCustomEvent(IrisGridModel.EVENT.VIEWPORT_UPDATED));
|
|
1050
1046
|
log.debug2('applyBufferedViewport', viewportTop, viewportBottom, columns);
|
|
@@ -1215,8 +1211,8 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
1215
1211
|
assertNotNull(range.startColumn);
|
|
1216
1212
|
// Check if any of the columns in grid range are key columns
|
|
1217
1213
|
var bound = (_range$endColumn = range.endColumn) !== null && _range$endColumn !== void 0 ? _range$endColumn : this.table.size;
|
|
1218
|
-
for (var
|
|
1219
|
-
if (this.isKeyColumn(
|
|
1214
|
+
for (var column = range.startColumn; column <= bound; column += 1) {
|
|
1215
|
+
if (this.isKeyColumn(column)) {
|
|
1220
1216
|
isKeyColumnInRange = true;
|
|
1221
1217
|
break;
|
|
1222
1218
|
}
|
|
@@ -1288,8 +1284,8 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
1288
1284
|
var column = _this6.columns[x];
|
|
1289
1285
|
columnSet.add(column);
|
|
1290
1286
|
if (formattedText[x] === undefined) {
|
|
1291
|
-
var
|
|
1292
|
-
formattedText[x] =
|
|
1287
|
+
var value = _this6.tableUtils.makeValue(column.type, text, _this6.formatter.timeZone);
|
|
1288
|
+
formattedText[x] = value != null ? _this6.displayString(value, column.type, column.name) : null;
|
|
1293
1289
|
}
|
|
1294
1290
|
_this6.cachePendingValue(x, y, formattedText[x]);
|
|
1295
1291
|
});
|
|
@@ -1410,11 +1406,11 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
1410
1406
|
data: new Map()
|
|
1411
1407
|
});
|
|
1412
1408
|
}
|
|
1413
|
-
var
|
|
1414
|
-
assertNotNull(
|
|
1409
|
+
var row = newDataMap.get(pendingRow);
|
|
1410
|
+
assertNotNull(row);
|
|
1415
1411
|
var {
|
|
1416
1412
|
data: rowData
|
|
1417
|
-
} =
|
|
1413
|
+
} = row;
|
|
1418
1414
|
var newRowData = new Map(rowData);
|
|
1419
1415
|
if (value != null) {
|
|
1420
1416
|
newRowData.set(x, {
|
|
@@ -1424,7 +1420,7 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
1424
1420
|
newRowData.delete(x);
|
|
1425
1421
|
}
|
|
1426
1422
|
if (newRowData.size > 0) {
|
|
1427
|
-
newDataMap.set(pendingRow, _objectSpread(_objectSpread({},
|
|
1423
|
+
newDataMap.set(pendingRow, _objectSpread(_objectSpread({}, row), {}, {
|
|
1428
1424
|
data: newRowData
|
|
1429
1425
|
}));
|
|
1430
1426
|
} else {
|
|
@@ -1444,7 +1440,7 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
1444
1440
|
if (!rowMap.has(y)) {
|
|
1445
1441
|
rowMap.set(y, []);
|
|
1446
1442
|
}
|
|
1447
|
-
(_rowMap$get = rowMap.get(y)) === null || _rowMap$get === void 0
|
|
1443
|
+
(_rowMap$get = rowMap.get(y)) === null || _rowMap$get === void 0 || _rowMap$get.push(edit);
|
|
1448
1444
|
return rowMap;
|
|
1449
1445
|
}, new Map());
|
|
1450
1446
|
var ranges = GridRange.consolidate(edits.map(edit => {
|
|
@@ -1560,8 +1556,8 @@ class IrisGridTableModelTemplate extends IrisGridModel {
|
|
|
1560
1556
|
}
|
|
1561
1557
|
isValidForCell(x, y, value) {
|
|
1562
1558
|
try {
|
|
1563
|
-
var
|
|
1564
|
-
this.tableUtils.makeValue(
|
|
1559
|
+
var column = this.columns[x];
|
|
1560
|
+
this.tableUtils.makeValue(column.type, value, this.formatter.timeZone);
|
|
1565
1561
|
return true;
|
|
1566
1562
|
} catch (e) {
|
|
1567
1563
|
return false;
|