@deephaven/iris-grid 0.42.1-beta.4 → 0.43.0
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/package.json +15 -15
- package/dist/AdvancedFilterCreator.css +0 -106
- package/dist/AdvancedFilterCreator.css.map +0 -1
- package/dist/AdvancedFilterCreator.js +0 -541
- package/dist/AdvancedFilterCreator.js.map +0 -1
- package/dist/AdvancedFilterCreatorFilterItem.css +0 -9
- package/dist/AdvancedFilterCreatorFilterItem.css.map +0 -1
- package/dist/AdvancedFilterCreatorFilterItem.js +0 -184
- package/dist/AdvancedFilterCreatorFilterItem.js.map +0 -1
- package/dist/AdvancedFilterCreatorSelectValue.css +0 -50
- package/dist/AdvancedFilterCreatorSelectValue.css.map +0 -1
- package/dist/AdvancedFilterCreatorSelectValue.js +0 -301
- package/dist/AdvancedFilterCreatorSelectValue.js.map +0 -1
- package/dist/AdvancedFilterCreatorSelectValueList.js +0 -272
- package/dist/AdvancedFilterCreatorSelectValueList.js.map +0 -1
- package/dist/ColumnHeaderGroup.js +0 -61
- package/dist/ColumnHeaderGroup.js.map +0 -1
- package/dist/ColumnStatistics.css +0 -76
- package/dist/ColumnStatistics.css.map +0 -1
- package/dist/ColumnStatistics.js +0 -202
- package/dist/ColumnStatistics.js.map +0 -1
- package/dist/CommonTypes.js +0 -2
- package/dist/CommonTypes.js.map +0 -1
- package/dist/CrossColumnSearch.css +0 -35
- package/dist/CrossColumnSearch.css.map +0 -1
- package/dist/CrossColumnSearch.js +0 -199
- package/dist/CrossColumnSearch.js.map +0 -1
- package/dist/FilterInputField.css +0 -56
- package/dist/FilterInputField.css.map +0 -1
- package/dist/FilterInputField.js +0 -232
- package/dist/FilterInputField.js.map +0 -1
- package/dist/GotoRow.css +0 -45
- package/dist/GotoRow.css.map +0 -1
- package/dist/GotoRow.js +0 -298
- package/dist/GotoRow.js.map +0 -1
- package/dist/IrisGrid.css +0 -359
- package/dist/IrisGrid.css.map +0 -1
- package/dist/IrisGrid.js +0 -3651
- package/dist/IrisGrid.js.map +0 -1
- package/dist/IrisGridBottomBar.css +0 -85
- package/dist/IrisGridBottomBar.css.map +0 -1
- package/dist/IrisGridBottomBar.js +0 -36
- package/dist/IrisGridBottomBar.js.map +0 -1
- package/dist/IrisGridCellOverflowModal.css +0 -17
- package/dist/IrisGridCellOverflowModal.css.map +0 -1
- package/dist/IrisGridCellOverflowModal.js +0 -157
- package/dist/IrisGridCellOverflowModal.js.map +0 -1
- package/dist/IrisGridCellRendererUtils.js +0 -20
- package/dist/IrisGridCellRendererUtils.js.map +0 -1
- package/dist/IrisGridCopyHandler.css +0 -64
- package/dist/IrisGridCopyHandler.css.map +0 -1
- package/dist/IrisGridCopyHandler.js +0 -331
- package/dist/IrisGridCopyHandler.js.map +0 -1
- package/dist/IrisGridDataBarCellRenderer.js +0 -10
- package/dist/IrisGridDataBarCellRenderer.js.map +0 -1
- package/dist/IrisGridIcons.js +0 -25
- package/dist/IrisGridIcons.js.map +0 -1
- package/dist/IrisGridMetricCalculator.js +0 -33
- package/dist/IrisGridMetricCalculator.js.map +0 -1
- package/dist/IrisGridModel.js +0 -263
- package/dist/IrisGridModel.js.map +0 -1
- package/dist/IrisGridModelFactory.js +0 -27
- package/dist/IrisGridModelFactory.js.map +0 -1
- package/dist/IrisGridModelUpdater.js +0 -96
- package/dist/IrisGridModelUpdater.js.map +0 -1
- package/dist/IrisGridPartitionSelector.css +0 -48
- package/dist/IrisGridPartitionSelector.css.map +0 -1
- package/dist/IrisGridPartitionSelector.js +0 -198
- package/dist/IrisGridPartitionSelector.js.map +0 -1
- package/dist/IrisGridProxyModel.js +0 -530
- package/dist/IrisGridProxyModel.js.map +0 -1
- package/dist/IrisGridRenderer.js +0 -779
- package/dist/IrisGridRenderer.js.map +0 -1
- package/dist/IrisGridShortcuts.js +0 -59
- package/dist/IrisGridShortcuts.js.map +0 -1
- package/dist/IrisGridTableModel.js +0 -273
- package/dist/IrisGridTableModel.js.map +0 -1
- package/dist/IrisGridTableModelTemplate.js +0 -1589
- package/dist/IrisGridTableModelTemplate.js.map +0 -1
- package/dist/IrisGridTestUtils.js +0 -121
- package/dist/IrisGridTestUtils.js.map +0 -1
- package/dist/IrisGridTextCellRenderer.js +0 -139
- package/dist/IrisGridTextCellRenderer.js.map +0 -1
- package/dist/IrisGridTheme.js +0 -96
- package/dist/IrisGridTheme.js.map +0 -1
- package/dist/IrisGridTheme.module.css +0 -69
- package/dist/IrisGridTheme.module.css.map +0 -1
- package/dist/IrisGridTreeTableModel.js +0 -145
- package/dist/IrisGridTreeTableModel.js.map +0 -1
- package/dist/IrisGridUtils.js +0 -1279
- package/dist/IrisGridUtils.js.map +0 -1
- package/dist/MissingKeyError.js +0 -15
- package/dist/MissingKeyError.js.map +0 -1
- package/dist/PartitionSelectorSearch.css +0 -22
- package/dist/PartitionSelectorSearch.css.map +0 -1
- package/dist/PartitionSelectorSearch.js +0 -317
- package/dist/PartitionSelectorSearch.js.map +0 -1
- package/dist/PendingDataBottomBar.css +0 -13
- package/dist/PendingDataBottomBar.css.map +0 -1
- package/dist/PendingDataBottomBar.js +0 -98
- package/dist/PendingDataBottomBar.js.map +0 -1
- package/dist/TableViewportUpdater.js +0 -156
- package/dist/TableViewportUpdater.js.map +0 -1
- package/dist/ToastBottomBar.js +0 -42
- package/dist/ToastBottomBar.js.map +0 -1
- package/dist/TreeTableViewportUpdater.js +0 -96
- package/dist/TreeTableViewportUpdater.js.map +0 -1
- package/dist/declaration.d.js +0 -2
- package/dist/declaration.d.js.map +0 -1
- package/dist/format-context-menus/CustomFormatAction.css +0 -25
- package/dist/format-context-menus/CustomFormatAction.css.map +0 -1
- package/dist/format-context-menus/CustomFormatAction.js +0 -132
- package/dist/format-context-menus/CustomFormatAction.js.map +0 -1
- package/dist/format-context-menus/DateTimeFormatContextMenu.js +0 -53
- package/dist/format-context-menus/DateTimeFormatContextMenu.js.map +0 -1
- package/dist/format-context-menus/DecimalFormatContextMenu.js +0 -59
- package/dist/format-context-menus/DecimalFormatContextMenu.js.map +0 -1
- package/dist/format-context-menus/FormatContextMenuUtils.js +0 -63
- package/dist/format-context-menus/FormatContextMenuUtils.js.map +0 -1
- package/dist/format-context-menus/IntegerFormatContextMenu.js +0 -43
- package/dist/format-context-menus/IntegerFormatContextMenu.js.map +0 -1
- package/dist/format-context-menus/index.js +0 -4
- package/dist/format-context-menus/index.js.map +0 -1
- package/dist/index.js +0 -24
- package/dist/index.js.map +0 -1
- package/dist/key-handlers/ClearFilterKeyHandler.js +0 -21
- package/dist/key-handlers/ClearFilterKeyHandler.js.map +0 -1
- package/dist/key-handlers/CopyKeyHandler.js +0 -31
- package/dist/key-handlers/CopyKeyHandler.js.map +0 -1
- package/dist/key-handlers/ReverseKeyHandler.js +0 -32
- package/dist/key-handlers/ReverseKeyHandler.js.map +0 -1
- package/dist/key-handlers/index.js +0 -4
- package/dist/key-handlers/index.js.map +0 -1
- package/dist/mousehandlers/IrisGridCellOverflowMouseHandler.js +0 -175
- package/dist/mousehandlers/IrisGridCellOverflowMouseHandler.js.map +0 -1
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js +0 -139
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js.map +0 -1
- package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js +0 -83
- package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js.map +0 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.css +0 -19
- package/dist/mousehandlers/IrisGridContextMenuHandler.css.map +0 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js +0 -1220
- package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +0 -1
- package/dist/mousehandlers/IrisGridDataSelectMouseHandler.js +0 -28
- package/dist/mousehandlers/IrisGridDataSelectMouseHandler.js.map +0 -1
- package/dist/mousehandlers/IrisGridFilterMouseHandler.js +0 -80
- package/dist/mousehandlers/IrisGridFilterMouseHandler.js.map +0 -1
- package/dist/mousehandlers/IrisGridRowTreeMouseHandler.js +0 -126
- package/dist/mousehandlers/IrisGridRowTreeMouseHandler.js.map +0 -1
- package/dist/mousehandlers/IrisGridSortMouseHandler.js +0 -46
- package/dist/mousehandlers/IrisGridSortMouseHandler.js.map +0 -1
- package/dist/mousehandlers/IrisGridTokenMouseHandler.js +0 -151
- package/dist/mousehandlers/IrisGridTokenMouseHandler.js.map +0 -1
- package/dist/mousehandlers/PendingMouseHandler.js +0 -39
- package/dist/mousehandlers/PendingMouseHandler.js.map +0 -1
- package/dist/mousehandlers/index.js +0 -11
- package/dist/mousehandlers/index.js.map +0 -1
- package/dist/sidebar/AdvancedSettings.js +0 -6
- package/dist/sidebar/AdvancedSettings.js.map +0 -1
- package/dist/sidebar/AdvancedSettingsMenu.js +0 -29
- package/dist/sidebar/AdvancedSettingsMenu.js.map +0 -1
- package/dist/sidebar/AdvancedSettingsType.js +0 -7
- package/dist/sidebar/AdvancedSettingsType.js.map +0 -1
- package/dist/sidebar/ChartBuilder.css +0 -56
- package/dist/sidebar/ChartBuilder.css.map +0 -1
- package/dist/sidebar/ChartBuilder.js +0 -443
- package/dist/sidebar/ChartBuilder.js.map +0 -1
- package/dist/sidebar/CustomColumnBuilder.css +0 -58
- package/dist/sidebar/CustomColumnBuilder.css.map +0 -1
- package/dist/sidebar/CustomColumnBuilder.js +0 -384
- package/dist/sidebar/CustomColumnBuilder.js.map +0 -1
- package/dist/sidebar/CustomColumnInput.js +0 -90
- package/dist/sidebar/CustomColumnInput.js.map +0 -1
- package/dist/sidebar/InputEditor.css +0 -35
- package/dist/sidebar/InputEditor.css.map +0 -1
- package/dist/sidebar/InputEditor.js +0 -177
- package/dist/sidebar/InputEditor.js.map +0 -1
- package/dist/sidebar/OptionType.js +0 -19
- package/dist/sidebar/OptionType.js.map +0 -1
- package/dist/sidebar/RollupRows.css +0 -120
- package/dist/sidebar/RollupRows.css.map +0 -1
- package/dist/sidebar/RollupRows.js +0 -519
- package/dist/sidebar/RollupRows.js.map +0 -1
- package/dist/sidebar/SelectDistinctBuilder.css +0 -41
- package/dist/sidebar/SelectDistinctBuilder.css.map +0 -1
- package/dist/sidebar/SelectDistinctBuilder.js +0 -155
- package/dist/sidebar/SelectDistinctBuilder.js.map +0 -1
- package/dist/sidebar/TableCsvExporter.css +0 -32
- package/dist/sidebar/TableCsvExporter.css.map +0 -1
- package/dist/sidebar/TableCsvExporter.js +0 -399
- package/dist/sidebar/TableCsvExporter.js.map +0 -1
- package/dist/sidebar/TableSaver.js +0 -487
- package/dist/sidebar/TableSaver.js.map +0 -1
- package/dist/sidebar/aggregations/AggregationEdit.css +0 -61
- package/dist/sidebar/aggregations/AggregationEdit.css.map +0 -1
- package/dist/sidebar/aggregations/AggregationEdit.js +0 -155
- package/dist/sidebar/aggregations/AggregationEdit.js.map +0 -1
- package/dist/sidebar/aggregations/AggregationOperation.js +0 -19
- package/dist/sidebar/aggregations/AggregationOperation.js.map +0 -1
- package/dist/sidebar/aggregations/AggregationUtils.js +0 -59
- package/dist/sidebar/aggregations/AggregationUtils.js.map +0 -1
- package/dist/sidebar/aggregations/Aggregations.css +0 -43
- package/dist/sidebar/aggregations/Aggregations.css.map +0 -1
- package/dist/sidebar/aggregations/Aggregations.js +0 -178
- package/dist/sidebar/aggregations/Aggregations.js.map +0 -1
- package/dist/sidebar/aggregations/index.js +0 -2
- package/dist/sidebar/aggregations/index.js.map +0 -1
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js +0 -123
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js.map +0 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.js +0 -243
- package/dist/sidebar/conditional-formatting/ConditionEditor.js.map +0 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.css +0 -22
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.css.map +0 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js +0 -109
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js.map +0 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.js +0 -18
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.js.map +0 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.css +0 -57
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.css.map +0 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js +0 -150
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js.map +0 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js +0 -635
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js.map +0 -1
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js +0 -122
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js.map +0 -1
- package/dist/sidebar/conditional-formatting/StyleEditor.css +0 -55
- package/dist/sidebar/conditional-formatting/StyleEditor.css.map +0 -1
- package/dist/sidebar/conditional-formatting/StyleEditor.js +0 -150
- package/dist/sidebar/conditional-formatting/StyleEditor.js.map +0 -1
- package/dist/sidebar/icons/BarIcon.js +0 -24
- package/dist/sidebar/icons/BarIcon.js.map +0 -1
- package/dist/sidebar/icons/FormatColumnWhereIcon.js +0 -42
- package/dist/sidebar/icons/FormatColumnWhereIcon.js.map +0 -1
- package/dist/sidebar/icons/FormatRowWhereIcon.js +0 -36
- package/dist/sidebar/icons/FormatRowWhereIcon.js.map +0 -1
- package/dist/sidebar/icons/HistogramIcon.js +0 -24
- package/dist/sidebar/icons/HistogramIcon.js.map +0 -1
- package/dist/sidebar/icons/LineIcon.js +0 -27
- package/dist/sidebar/icons/LineIcon.js.map +0 -1
- package/dist/sidebar/icons/PieIcon.js +0 -24
- package/dist/sidebar/icons/PieIcon.js.map +0 -1
- package/dist/sidebar/icons/ScatterIcon.js +0 -74
- package/dist/sidebar/icons/ScatterIcon.js.map +0 -1
- package/dist/sidebar/icons/index.js +0 -8
- package/dist/sidebar/icons/index.js.map +0 -1
- package/dist/sidebar/index.js +0 -18
- package/dist/sidebar/index.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.css +0 -68
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.css.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js +0 -964
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilder.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.js +0 -132
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingBuilderUtils.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.css +0 -29
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.css.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js +0 -188
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingGroup.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js +0 -81
- package/dist/sidebar/visibility-ordering-builder/VisibilityOrderingItem.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/PointerSensorWithInteraction.js +0 -30
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/PointerSensorWithInteraction.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js +0 -158
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTree.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js +0 -146
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeInner.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.js +0 -59
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/SortableTreeItem.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.css +0 -139
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.css.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js +0 -44
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/TreeItem.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.js +0 -129
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/keyboardCoordinates.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/types.js +0 -4
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/types.js.map +0 -1
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.js +0 -261
- package/dist/sidebar/visibility-ordering-builder/sortable-tree/utilities.js.map +0 -1
|
@@ -1,1220 +0,0 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
|
-
/* eslint class-methods-use-this: "off" */
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
|
-
import { dhFilterFilled, vsRemove, vsCheck, vsFilter } from '@deephaven/icons';
|
|
10
|
-
import debounce from 'lodash.debounce';
|
|
11
|
-
import { ContextActions, ContextActionUtils, GLOBAL_SHORTCUTS } from '@deephaven/components';
|
|
12
|
-
import { GridMouseHandler, GridRenderer, isEditableGridModel, isExpandableGridModel } from '@deephaven/grid';
|
|
13
|
-
import { TableColumnFormatter, DateTimeColumnFormatter, TableUtils } from '@deephaven/jsapi-utils';
|
|
14
|
-
import Log from '@deephaven/log';
|
|
15
|
-
import { assertNotNull, copyToClipboard } from '@deephaven/utils';
|
|
16
|
-
import { DateTimeFormatContextMenu, DecimalFormatContextMenu, IntegerFormatContextMenu } from "../format-context-menus/index.js";
|
|
17
|
-
import "./IrisGridContextMenuHandler.css";
|
|
18
|
-
import SHORTCUTS from "../IrisGridShortcuts.js";
|
|
19
|
-
var log = Log.module('IrisGridContextMenuHandler');
|
|
20
|
-
var DEBOUNCE_UPDATE_FORMAT = 150;
|
|
21
|
-
var CONTEXT_MENU_DATE_FORMAT = 'yyyy-MM-dd HH:mm:ss.SSSSSSSSS';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Used to eat the mouse event in the bottom right corner of the scroll bar
|
|
25
|
-
*/
|
|
26
|
-
class IrisGridContextMenuHandler extends GridMouseHandler {
|
|
27
|
-
/**
|
|
28
|
-
* Get filter condition for quick filter and combines with a new filter using the operator specified,
|
|
29
|
-
* returns new filter if no operator supplied.
|
|
30
|
-
* @param columnFilter
|
|
31
|
-
* @param newColumnFilter
|
|
32
|
-
* @param operator
|
|
33
|
-
*/
|
|
34
|
-
static getQuickFilterCondition(columnFilter, newColumnFilter, operator) {
|
|
35
|
-
if (columnFilter && operator === '&&') {
|
|
36
|
-
return columnFilter.and(newColumnFilter);
|
|
37
|
-
}
|
|
38
|
-
if (columnFilter && operator === '||') {
|
|
39
|
-
return columnFilter.or(newColumnFilter);
|
|
40
|
-
}
|
|
41
|
-
return newColumnFilter;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* combines filter text with operator if declared
|
|
46
|
-
* @param filterText
|
|
47
|
-
* @param newFilterText
|
|
48
|
-
* @param operator
|
|
49
|
-
*/
|
|
50
|
-
static getQuickFilterText(filterText, newFilterText, operator) {
|
|
51
|
-
return operator && filterText != null ? "".concat(filterText, " ").concat(operator, " ").concat(newFilterText) : newFilterText;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Converts operator to text string,
|
|
56
|
-
*/
|
|
57
|
-
static getOperatorAsText(operator) {
|
|
58
|
-
return operator === '&&' ? 'And' : 'Or';
|
|
59
|
-
}
|
|
60
|
-
static getRowOptionFormatted(command, cellValue) {
|
|
61
|
-
var len = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 30;
|
|
62
|
-
return "".concat(command, " \"").concat(GridRenderer.truncate(cellValue, len - command.length - 3), "\"");
|
|
63
|
-
}
|
|
64
|
-
constructor(irisGrid, dh) {
|
|
65
|
-
super();
|
|
66
|
-
_defineProperty(this, "irisGrid", void 0);
|
|
67
|
-
_defineProperty(this, "debouncedUpdateCustomFormat", void 0);
|
|
68
|
-
_defineProperty(this, "dh", void 0);
|
|
69
|
-
this.debouncedUpdateCustomFormat = debounce(irisGrid.handleFormatSelection, DEBOUNCE_UPDATE_FORMAT);
|
|
70
|
-
this.dh = dh;
|
|
71
|
-
this.irisGrid = irisGrid;
|
|
72
|
-
}
|
|
73
|
-
componentWillUnmount() {
|
|
74
|
-
this.debouncedUpdateCustomFormat.flush();
|
|
75
|
-
}
|
|
76
|
-
getHeaderActions(modelIndex, gridPoint) {
|
|
77
|
-
var {
|
|
78
|
-
irisGrid
|
|
79
|
-
} = this;
|
|
80
|
-
var {
|
|
81
|
-
column: visibleIndex
|
|
82
|
-
} = gridPoint;
|
|
83
|
-
assertNotNull(visibleIndex);
|
|
84
|
-
var {
|
|
85
|
-
model
|
|
86
|
-
} = irisGrid.props;
|
|
87
|
-
var {
|
|
88
|
-
columns
|
|
89
|
-
} = model;
|
|
90
|
-
var column = columns[modelIndex];
|
|
91
|
-
var actions = [];
|
|
92
|
-
var {
|
|
93
|
-
metrics,
|
|
94
|
-
reverseType,
|
|
95
|
-
quickFilters,
|
|
96
|
-
advancedFilters,
|
|
97
|
-
searchFilter
|
|
98
|
-
} = irisGrid.state;
|
|
99
|
-
var theme = irisGrid.getTheme();
|
|
100
|
-
assertNotNull(metrics);
|
|
101
|
-
var {
|
|
102
|
-
filterIconColor,
|
|
103
|
-
filterBarActiveColor,
|
|
104
|
-
contextMenuSortIconColor,
|
|
105
|
-
contextMenuReverseIconColor
|
|
106
|
-
} = theme;
|
|
107
|
-
var modelSort = model.sort;
|
|
108
|
-
var columnSort = TableUtils.getSortForColumn(modelSort, column.name);
|
|
109
|
-
var hasReverse = reverseType !== TableUtils.REVERSE_TYPE.NONE;
|
|
110
|
-
var {
|
|
111
|
-
userColumnWidths
|
|
112
|
-
} = metrics;
|
|
113
|
-
var isColumnHidden = [...userColumnWidths.values()].some(columnWidth => columnWidth === 0);
|
|
114
|
-
var isColumnFreezable = model.getColumnHeaderParentGroup(modelIndex, 0) === undefined && !(isExpandableGridModel(model) && model.hasExpandableRows);
|
|
115
|
-
var isColumnFrozen = model.isColumnFrozen(modelIndex);
|
|
116
|
-
var isColumnSortable = model.isColumnSortable(modelIndex);
|
|
117
|
-
actions.push({
|
|
118
|
-
title: 'Hide Column',
|
|
119
|
-
group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
|
|
120
|
-
action: () => {
|
|
121
|
-
this.irisGrid.hideColumnByVisibleIndex(visibleIndex);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
actions.push({
|
|
125
|
-
title: isColumnFrozen ? 'Unfreeze Column' : 'Freeze Column',
|
|
126
|
-
group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
|
|
127
|
-
disabled: !isColumnFreezable,
|
|
128
|
-
action: () => {
|
|
129
|
-
if (isColumnFrozen) {
|
|
130
|
-
this.irisGrid.unFreezeColumnByColumnName(column.name);
|
|
131
|
-
} else {
|
|
132
|
-
this.irisGrid.freezeColumnByColumnName(column.name);
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
order: 10
|
|
136
|
-
});
|
|
137
|
-
actions.push({
|
|
138
|
-
title: 'Show All Columns',
|
|
139
|
-
group: IrisGridContextMenuHandler.GROUP_HIDE_COLUMNS,
|
|
140
|
-
action: () => {
|
|
141
|
-
this.irisGrid.showAllColumns();
|
|
142
|
-
},
|
|
143
|
-
disabled: !isColumnHidden
|
|
144
|
-
});
|
|
145
|
-
actions.push({
|
|
146
|
-
title: 'Quick Filters',
|
|
147
|
-
icon: vsRemove,
|
|
148
|
-
iconColor: filterBarActiveColor,
|
|
149
|
-
shortcut: SHORTCUTS.TABLE.TOGGLE_QUICK_FILTER,
|
|
150
|
-
group: IrisGridContextMenuHandler.GROUP_FILTER,
|
|
151
|
-
order: 10,
|
|
152
|
-
action: () => {
|
|
153
|
-
this.irisGrid.toggleFilterBar(visibleIndex);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
actions.push({
|
|
157
|
-
title: 'Advanced Filters',
|
|
158
|
-
icon: advancedFilters.get(modelIndex) ? dhFilterFilled : vsFilter,
|
|
159
|
-
iconColor: filterIconColor,
|
|
160
|
-
group: IrisGridContextMenuHandler.GROUP_FILTER,
|
|
161
|
-
order: 20,
|
|
162
|
-
action: () => {
|
|
163
|
-
this.irisGrid.handleAdvancedMenuOpened(visibleIndex);
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
actions.push({
|
|
167
|
-
title: 'Clear Table Filters',
|
|
168
|
-
group: IrisGridContextMenuHandler.GROUP_FILTER,
|
|
169
|
-
order: 40,
|
|
170
|
-
// this just displays the shortcut, the actual listener is in irisgrid handleKeyDown
|
|
171
|
-
shortcut: SHORTCUTS.TABLE.CLEAR_FILTERS,
|
|
172
|
-
action: () => {
|
|
173
|
-
this.irisGrid.clearAllFilters();
|
|
174
|
-
},
|
|
175
|
-
disabled: !(quickFilters.size > 0 || advancedFilters.size > 0 || searchFilter != null)
|
|
176
|
-
});
|
|
177
|
-
actions.push({
|
|
178
|
-
title: 'Sort by',
|
|
179
|
-
icon: vsRemove,
|
|
180
|
-
iconColor: contextMenuSortIconColor,
|
|
181
|
-
group: IrisGridContextMenuHandler.GROUP_SORT,
|
|
182
|
-
order: 10,
|
|
183
|
-
actions: this.sortByActions(column, modelIndex, columnSort),
|
|
184
|
-
disabled: !isColumnSortable
|
|
185
|
-
});
|
|
186
|
-
actions.push({
|
|
187
|
-
title: 'Add Additional Sort',
|
|
188
|
-
/**
|
|
189
|
-
* disable conditions:
|
|
190
|
-
* 1. table is sorted only by this column
|
|
191
|
-
* 2. table is only reversed
|
|
192
|
-
* 3. 1 & 2 combined
|
|
193
|
-
* 4. table has no sort
|
|
194
|
-
* reverse is a type of sort, so needs to be accounted for in exclusions
|
|
195
|
-
* */
|
|
196
|
-
disabled: columnSort && modelSort.length === 1 || hasReverse && modelSort.length === 1 || columnSort && hasReverse && modelSort.length === 2 || modelSort.length === 0 || !isColumnSortable,
|
|
197
|
-
group: IrisGridContextMenuHandler.GROUP_SORT,
|
|
198
|
-
order: 20,
|
|
199
|
-
actions: this.additionalSortActions(column, modelIndex)
|
|
200
|
-
});
|
|
201
|
-
actions.push({
|
|
202
|
-
title: 'Clear Table Sorting',
|
|
203
|
-
disabled:
|
|
204
|
-
// reverse is a type of sort, but special and needs to be exluded despite being part of model.sort
|
|
205
|
-
modelSort.length === 0 || hasReverse && modelSort.length === 1,
|
|
206
|
-
group: IrisGridContextMenuHandler.GROUP_SORT,
|
|
207
|
-
action: () => {
|
|
208
|
-
this.irisGrid.sortColumn(visibleIndex, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.none);
|
|
209
|
-
},
|
|
210
|
-
order: 30
|
|
211
|
-
});
|
|
212
|
-
actions.push({
|
|
213
|
-
title: reverseType === TableUtils.REVERSE_TYPE.NONE ? 'Reverse Table' : 'Clear Reverse Table',
|
|
214
|
-
icon: vsRemove,
|
|
215
|
-
iconColor: contextMenuReverseIconColor,
|
|
216
|
-
group: IrisGridContextMenuHandler.GROUP_SORT,
|
|
217
|
-
order: 40,
|
|
218
|
-
disabled: !model.isReversible,
|
|
219
|
-
// this just displays the shortcut, the actual listener is in irisgrid handleKeyDown
|
|
220
|
-
shortcut: SHORTCUTS.TABLE.REVERSE,
|
|
221
|
-
action: () => {
|
|
222
|
-
if (reverseType === TableUtils.REVERSE_TYPE.NONE) {
|
|
223
|
-
this.irisGrid.reverse(TableUtils.REVERSE_TYPE.POST_SORT);
|
|
224
|
-
} else {
|
|
225
|
-
this.irisGrid.reverse(TableUtils.REVERSE_TYPE.NONE);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
actions.push({
|
|
230
|
-
title: 'Copy Column Name',
|
|
231
|
-
group: IrisGridContextMenuHandler.GROUP_COPY,
|
|
232
|
-
action: () => {
|
|
233
|
-
var _model$textForColumnH;
|
|
234
|
-
copyToClipboard((_model$textForColumnH = model.textForColumnHeader(modelIndex)) !== null && _model$textForColumnH !== void 0 ? _model$textForColumnH : '').catch(e => log.error('Unable to copy header', e));
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
if (TableUtils.isDateType(column.type)) {
|
|
238
|
-
actions.push({
|
|
239
|
-
title: 'Date/Time Format',
|
|
240
|
-
group: IrisGridContextMenuHandler.GROUP_FORMAT,
|
|
241
|
-
actions: this.dateFormatActions(column)
|
|
242
|
-
});
|
|
243
|
-
} else if (TableUtils.isNumberType(column.type)) {
|
|
244
|
-
var _this$numberFormatAct;
|
|
245
|
-
actions.push({
|
|
246
|
-
title: 'Number Format',
|
|
247
|
-
group: IrisGridContextMenuHandler.GROUP_FORMAT,
|
|
248
|
-
actions: (_this$numberFormatAct = this.numberFormatActions(column)) !== null && _this$numberFormatAct !== void 0 ? _this$numberFormatAct : undefined
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
return actions;
|
|
252
|
-
}
|
|
253
|
-
getCellActions(modelColumn, grid, gridPoint) {
|
|
254
|
-
assertNotNull(modelColumn);
|
|
255
|
-
var {
|
|
256
|
-
dh,
|
|
257
|
-
irisGrid
|
|
258
|
-
} = this;
|
|
259
|
-
var {
|
|
260
|
-
column: columnIndex,
|
|
261
|
-
row: rowIndex
|
|
262
|
-
} = gridPoint;
|
|
263
|
-
var {
|
|
264
|
-
model,
|
|
265
|
-
canCopy
|
|
266
|
-
} = irisGrid.props;
|
|
267
|
-
var {
|
|
268
|
-
columns
|
|
269
|
-
} = model;
|
|
270
|
-
var modelRow = irisGrid.getModelRow(rowIndex);
|
|
271
|
-
assertNotNull(modelRow);
|
|
272
|
-
var value = model.valueForCell(modelColumn, modelRow);
|
|
273
|
-
var valueText = model.textForCell(modelColumn, modelRow);
|
|
274
|
-
var column = columns[modelColumn];
|
|
275
|
-
var actions = [];
|
|
276
|
-
var {
|
|
277
|
-
quickFilters
|
|
278
|
-
} = irisGrid.state;
|
|
279
|
-
var theme = irisGrid.getTheme();
|
|
280
|
-
var {
|
|
281
|
-
filterIconColor
|
|
282
|
-
} = theme;
|
|
283
|
-
var {
|
|
284
|
-
settings
|
|
285
|
-
} = irisGrid.props;
|
|
286
|
-
var dateFilterFormatter = new DateTimeColumnFormatter(dh, {
|
|
287
|
-
timeZone: settings === null || settings === void 0 ? void 0 : settings.timeZone,
|
|
288
|
-
showTimeZone: false,
|
|
289
|
-
showTSeparator: true,
|
|
290
|
-
defaultDateTimeFormatString: CONTEXT_MENU_DATE_FORMAT
|
|
291
|
-
});
|
|
292
|
-
var previewFilterFormatter = new DateTimeColumnFormatter(dh, {
|
|
293
|
-
timeZone: settings === null || settings === void 0 ? void 0 : settings.timeZone,
|
|
294
|
-
showTimeZone: settings === null || settings === void 0 ? void 0 : settings.showTimeZone,
|
|
295
|
-
showTSeparator: settings === null || settings === void 0 ? void 0 : settings.showTSeparator,
|
|
296
|
-
defaultDateTimeFormatString: CONTEXT_MENU_DATE_FORMAT
|
|
297
|
-
});
|
|
298
|
-
if (column == null || rowIndex == null) return actions;
|
|
299
|
-
|
|
300
|
-
// grid data area context menu options
|
|
301
|
-
if (model.isFilterable(modelColumn)) {
|
|
302
|
-
// cell data area contextmenu options
|
|
303
|
-
var filterMenu = {
|
|
304
|
-
title: 'Filter by Value',
|
|
305
|
-
icon: vsRemove,
|
|
306
|
-
iconColor: filterIconColor,
|
|
307
|
-
group: IrisGridContextMenuHandler.GROUP_FILTER,
|
|
308
|
-
order: 10,
|
|
309
|
-
actions: []
|
|
310
|
-
};
|
|
311
|
-
if (value == null) {
|
|
312
|
-
// null gets a special menu
|
|
313
|
-
if (quickFilters.get(modelColumn)) {
|
|
314
|
-
filterMenu.actions.push({
|
|
315
|
-
title: 'And',
|
|
316
|
-
actions: this.nullFilterActions(column, quickFilters.get(modelColumn), '&&'),
|
|
317
|
-
order: 2,
|
|
318
|
-
group: ContextActions.groups.high
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
filterMenu.actions.push(...this.nullFilterActions(column));
|
|
322
|
-
} else if (value === '') {
|
|
323
|
-
// empty string gets a special menu
|
|
324
|
-
if (quickFilters.get(modelColumn)) {
|
|
325
|
-
filterMenu.actions.push({
|
|
326
|
-
title: 'And',
|
|
327
|
-
actions: this.emptyStringFilterActions(column, quickFilters.get(modelColumn), '&&'),
|
|
328
|
-
order: 2,
|
|
329
|
-
group: ContextActions.groups.high
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
filterMenu.actions.push(...this.emptyStringFilterActions(column));
|
|
333
|
-
} else if (TableUtils.isBooleanType(column.type)) {
|
|
334
|
-
// boolean should have OR condition, and handles it's own null menu options
|
|
335
|
-
if (quickFilters.get(modelColumn)) {
|
|
336
|
-
filterMenu.actions.push({
|
|
337
|
-
title: 'Or',
|
|
338
|
-
actions: this.booleanFilterActions(column, valueText, quickFilters.get(modelColumn), '||'),
|
|
339
|
-
order: 2,
|
|
340
|
-
group: ContextActions.groups.high
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
filterMenu.actions.push(...this.booleanFilterActions(column, valueText));
|
|
344
|
-
} else if (TableUtils.isNumberType(column.type) || TableUtils.isCharType(column.type)) {
|
|
345
|
-
// Chars get treated like numbers in terms of which filters are available
|
|
346
|
-
assertNotNull(modelColumn);
|
|
347
|
-
// We want to show the full unformatted value if it's a number, so user knows which value they are matching
|
|
348
|
-
// If it's a Char we just show the char
|
|
349
|
-
var numberValueText = TableUtils.isCharType(column.type) ? String.fromCharCode(value) : "".concat(value);
|
|
350
|
-
if (quickFilters.get(modelColumn)) {
|
|
351
|
-
filterMenu.actions.push({
|
|
352
|
-
title: 'And',
|
|
353
|
-
actions: this.numberFilterActions(column, numberValueText, value, quickFilters.get(modelColumn), '&&'),
|
|
354
|
-
order: 2,
|
|
355
|
-
group: ContextActions.groups.high
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
filterMenu.actions.push(...this.numberFilterActions(column, numberValueText, value, quickFilters.get(modelColumn)));
|
|
359
|
-
} else if (TableUtils.isDateType(column.type)) {
|
|
360
|
-
var dateValueText = dateFilterFormatter.format(value);
|
|
361
|
-
var previewValue = previewFilterFormatter.format(value);
|
|
362
|
-
if (quickFilters.get(modelColumn)) {
|
|
363
|
-
filterMenu.actions.push({
|
|
364
|
-
title: 'And',
|
|
365
|
-
actions: this.dateFilterActions(column, dateValueText, previewValue, value, quickFilters.get(modelColumn), '&&'),
|
|
366
|
-
order: 2,
|
|
367
|
-
group: ContextActions.groups.high
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
filterMenu.actions.push(...this.dateFilterActions(column, dateValueText, previewValue, value, quickFilters.get(modelColumn)));
|
|
371
|
-
} else {
|
|
372
|
-
if (quickFilters.get(modelColumn)) {
|
|
373
|
-
filterMenu.actions.push({
|
|
374
|
-
title: 'And',
|
|
375
|
-
actions: this.stringFilterActions(column, valueText, value, quickFilters.get(modelColumn), '&&'),
|
|
376
|
-
order: 2,
|
|
377
|
-
group: ContextActions.groups.high
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
filterMenu.actions.push(...this.stringFilterActions(column, valueText, value));
|
|
381
|
-
}
|
|
382
|
-
if (filterMenu.actions != null && filterMenu.actions.length > 0) {
|
|
383
|
-
actions.push(filterMenu);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// Expand/Collapse options
|
|
388
|
-
if (isExpandableGridModel(model) && model.isRowExpandable(modelRow)) {
|
|
389
|
-
// If there are grouped columns, then it is a rollup
|
|
390
|
-
// For rollups, the column number will be the depth minus one
|
|
391
|
-
var expandingColumn = model.groupedColumns.length > 0 ? model.depthForRow(modelRow) - 1 : 0;
|
|
392
|
-
var cellValue = model.valueForCell(expandingColumn, modelRow);
|
|
393
|
-
var cellText = cellValue == null ? 'null' : model.textForCell(expandingColumn, modelRow);
|
|
394
|
-
actions.push({
|
|
395
|
-
title: IrisGridContextMenuHandler.getRowOptionFormatted(model.isRowExpanded(modelRow) ? 'Collapse' : 'Expand', cellText),
|
|
396
|
-
group: IrisGridContextMenuHandler.GROUP_EXPAND_COLLAPSE,
|
|
397
|
-
order: 10,
|
|
398
|
-
action: () => {
|
|
399
|
-
model.setRowExpanded(modelRow, !model.isRowExpanded(modelRow));
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
if (model.isExpandAllAvailable === true) {
|
|
403
|
-
actions.push({
|
|
404
|
-
title: IrisGridContextMenuHandler.getRowOptionFormatted('Expand All in', cellText),
|
|
405
|
-
group: IrisGridContextMenuHandler.GROUP_EXPAND_COLLAPSE,
|
|
406
|
-
order: 20,
|
|
407
|
-
action: () => {
|
|
408
|
-
model.setRowExpanded(modelRow, true, true);
|
|
409
|
-
}
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
if (isExpandableGridModel(model) && model.hasExpandableRows && model.isExpandAllAvailable === true) {
|
|
414
|
-
actions.push({
|
|
415
|
-
title: 'Expand Entire Table',
|
|
416
|
-
group: IrisGridContextMenuHandler.GROUP_EXPAND_COLLAPSE,
|
|
417
|
-
order: 30,
|
|
418
|
-
action: () => {
|
|
419
|
-
model.expandAll();
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
actions.push({
|
|
423
|
-
title: 'Collapse Entire Table',
|
|
424
|
-
group: IrisGridContextMenuHandler.GROUP_EXPAND_COLLAPSE,
|
|
425
|
-
order: 40,
|
|
426
|
-
action: () => {
|
|
427
|
-
model.collapseAll();
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
var gotoRow = {
|
|
432
|
-
title: 'Go to',
|
|
433
|
-
iconColor: filterIconColor,
|
|
434
|
-
shortcut: SHORTCUTS.TABLE.GOTO_ROW,
|
|
435
|
-
group: IrisGridContextMenuHandler.GROUP_GOTO,
|
|
436
|
-
order: 10,
|
|
437
|
-
action: () => this.irisGrid.toggleGotoRow("".concat(rowIndex + 1), "".concat(value), column.name)
|
|
438
|
-
};
|
|
439
|
-
actions.push(gotoRow);
|
|
440
|
-
if (canCopy) {
|
|
441
|
-
actions.push({
|
|
442
|
-
title: 'Copy Cell',
|
|
443
|
-
group: IrisGridContextMenuHandler.GROUP_COPY,
|
|
444
|
-
order: 10,
|
|
445
|
-
action: () => {
|
|
446
|
-
irisGrid.copyCell(columnIndex, rowIndex);
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
actions.push({
|
|
450
|
-
title: 'Copy Cell Unformatted',
|
|
451
|
-
group: IrisGridContextMenuHandler.GROUP_COPY,
|
|
452
|
-
order: 20,
|
|
453
|
-
action: () => {
|
|
454
|
-
irisGrid.copyCell(columnIndex, rowIndex, true);
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
return actions;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Gets an equality filter for the provided numeric value
|
|
463
|
-
* @param column The column to make the filter for
|
|
464
|
-
* @param value The value to get the equality filter for
|
|
465
|
-
*/
|
|
466
|
-
getNumberValueEqualsFilter(column, value) {
|
|
467
|
-
var {
|
|
468
|
-
dh
|
|
469
|
-
} = this;
|
|
470
|
-
var columnFilter = column.filter();
|
|
471
|
-
if (value === Number.POSITIVE_INFINITY) {
|
|
472
|
-
return dh.FilterCondition.invoke('isInf', columnFilter).and(columnFilter.greaterThan(dh.FilterValue.ofNumber(0)));
|
|
473
|
-
}
|
|
474
|
-
if (value === Number.NEGATIVE_INFINITY) {
|
|
475
|
-
return dh.FilterCondition.invoke('isInf', columnFilter).and(columnFilter.lessThan(dh.FilterValue.ofNumber(0)));
|
|
476
|
-
}
|
|
477
|
-
if (Number.isNaN(value)) {
|
|
478
|
-
return dh.FilterCondition.invoke('isNaN', columnFilter);
|
|
479
|
-
}
|
|
480
|
-
var filterValue = this.getFilterValueForNumberOrChar(column.type, value);
|
|
481
|
-
return columnFilter.eq(filterValue);
|
|
482
|
-
}
|
|
483
|
-
getFilterValueForNumberOrChar(columnType, value) {
|
|
484
|
-
var {
|
|
485
|
-
dh
|
|
486
|
-
} = this;
|
|
487
|
-
return TableUtils.isCharType(columnType) ? dh.FilterValue.ofString(String.fromCharCode(value)) : dh.FilterValue.ofNumber(value);
|
|
488
|
-
}
|
|
489
|
-
onContextMenu(gridPoint, grid, event) {
|
|
490
|
-
var {
|
|
491
|
-
irisGrid
|
|
492
|
-
} = this;
|
|
493
|
-
var {
|
|
494
|
-
y,
|
|
495
|
-
column: columnIndex,
|
|
496
|
-
row: rowIndex,
|
|
497
|
-
columnHeaderDepth
|
|
498
|
-
} = gridPoint;
|
|
499
|
-
var modelColumn = irisGrid.getModelColumn(columnIndex);
|
|
500
|
-
var modelRow = irisGrid.getModelRow(rowIndex);
|
|
501
|
-
var {
|
|
502
|
-
model,
|
|
503
|
-
canCopy
|
|
504
|
-
} = irisGrid.props;
|
|
505
|
-
var {
|
|
506
|
-
columns
|
|
507
|
-
} = model;
|
|
508
|
-
var {
|
|
509
|
-
metrics,
|
|
510
|
-
isFilterBarShown,
|
|
511
|
-
quickFilters,
|
|
512
|
-
advancedFilters,
|
|
513
|
-
selectedRanges
|
|
514
|
-
} = irisGrid.state;
|
|
515
|
-
assertNotNull(metrics);
|
|
516
|
-
var {
|
|
517
|
-
columnHeaderHeight,
|
|
518
|
-
gridY,
|
|
519
|
-
columnHeaderMaxDepth
|
|
520
|
-
} = metrics;
|
|
521
|
-
var actions = [];
|
|
522
|
-
if (modelColumn != null && modelRow != null) {
|
|
523
|
-
var value = model.valueForCell(modelColumn, modelRow);
|
|
524
|
-
var valueText = model.textForCell(modelColumn, modelRow);
|
|
525
|
-
var column = columns[modelColumn];
|
|
526
|
-
var {
|
|
527
|
-
onContextMenu
|
|
528
|
-
} = irisGrid.props;
|
|
529
|
-
if (column != null) {
|
|
530
|
-
actions.push(onContextMenu({
|
|
531
|
-
model,
|
|
532
|
-
value,
|
|
533
|
-
valueText,
|
|
534
|
-
column,
|
|
535
|
-
rowIndex,
|
|
536
|
-
columnIndex,
|
|
537
|
-
modelRow,
|
|
538
|
-
modelColumn
|
|
539
|
-
}));
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
if (modelColumn != null && model.isFilterable(modelColumn)) {
|
|
543
|
-
// Clear column filter should still be available after last row
|
|
544
|
-
// And should be available in both header and body context menus
|
|
545
|
-
actions.push({
|
|
546
|
-
title: 'Clear Column Filter',
|
|
547
|
-
group: IrisGridContextMenuHandler.GROUP_FILTER,
|
|
548
|
-
order: 30,
|
|
549
|
-
action: () => {
|
|
550
|
-
this.irisGrid.removeColumnFilter(modelColumn);
|
|
551
|
-
},
|
|
552
|
-
disabled: !(quickFilters.has(modelColumn) || advancedFilters.has(modelColumn))
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
if (isFilterBarShown ? y <= gridY : y <= columnHeaderHeight * columnHeaderMaxDepth && columnHeaderDepth === 0) {
|
|
556
|
-
// grid header context menu options
|
|
557
|
-
if (modelColumn != null) {
|
|
558
|
-
actions.push(...this.getHeaderActions(modelColumn, gridPoint));
|
|
559
|
-
}
|
|
560
|
-
} else {
|
|
561
|
-
// grid body context menu options
|
|
562
|
-
if (modelColumn != null && modelRow != null) {
|
|
563
|
-
actions.push(...this.getCellActions(modelColumn, grid, gridPoint));
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
// blank space context menu options
|
|
567
|
-
if (canCopy && selectedRanges.length > 0) {
|
|
568
|
-
actions.push({
|
|
569
|
-
title: 'Copy Selection',
|
|
570
|
-
shortcut: GLOBAL_SHORTCUTS.COPY,
|
|
571
|
-
group: IrisGridContextMenuHandler.GROUP_COPY,
|
|
572
|
-
order: 30,
|
|
573
|
-
action: () => {
|
|
574
|
-
irisGrid.copyRanges(selectedRanges);
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
actions.push({
|
|
578
|
-
title: 'Copy Selection w/ Headers',
|
|
579
|
-
group: IrisGridContextMenuHandler.GROUP_COPY,
|
|
580
|
-
order: 40,
|
|
581
|
-
action: () => {
|
|
582
|
-
irisGrid.copyRanges(selectedRanges, true);
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
if (isEditableGridModel(model) && model.isEditable && selectedRanges.length > 0) {
|
|
587
|
-
actions.push({
|
|
588
|
-
title: 'Delete Selected Rows',
|
|
589
|
-
group: IrisGridContextMenuHandler.GROUP_EDIT,
|
|
590
|
-
order: 50,
|
|
591
|
-
action: () => {
|
|
592
|
-
this.irisGrid.deleteRanges(selectedRanges);
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
if (actions.length === 0) {
|
|
598
|
-
return false;
|
|
599
|
-
}
|
|
600
|
-
assertNotNull(irisGrid.gridWrapper);
|
|
601
|
-
ContextActions.triggerMenu(irisGrid.gridWrapper, event.clientX, event.clientY, actions);
|
|
602
|
-
return true;
|
|
603
|
-
}
|
|
604
|
-
dateFormatActions(column) {
|
|
605
|
-
var _this = this;
|
|
606
|
-
var {
|
|
607
|
-
model
|
|
608
|
-
} = this.irisGrid.props;
|
|
609
|
-
var {
|
|
610
|
-
formatter
|
|
611
|
-
} = model;
|
|
612
|
-
var selectedFormat = formatter.getColumnFormat(column.type, column.name);
|
|
613
|
-
var formatOptions = DateTimeFormatContextMenu.getOptions(formatter, selectedFormat);
|
|
614
|
-
var actions = [];
|
|
615
|
-
var _loop = function _loop() {
|
|
616
|
-
var {
|
|
617
|
-
description,
|
|
618
|
-
format,
|
|
619
|
-
group,
|
|
620
|
-
isSelected,
|
|
621
|
-
title
|
|
622
|
-
} = formatOptions[i];
|
|
623
|
-
actions.push({
|
|
624
|
-
title,
|
|
625
|
-
description,
|
|
626
|
-
icon: isSelected ? vsCheck : undefined,
|
|
627
|
-
group,
|
|
628
|
-
order: i,
|
|
629
|
-
action: () => {
|
|
630
|
-
var modelIndex = model.getColumnIndexByName(column.name);
|
|
631
|
-
assertNotNull(modelIndex);
|
|
632
|
-
_this.irisGrid.handleFormatSelection(modelIndex, format);
|
|
633
|
-
}
|
|
634
|
-
});
|
|
635
|
-
};
|
|
636
|
-
for (var i = 0; i < formatOptions.length; i += 1) {
|
|
637
|
-
_loop();
|
|
638
|
-
}
|
|
639
|
-
return actions;
|
|
640
|
-
}
|
|
641
|
-
numberFormatActions(column) {
|
|
642
|
-
var _this2 = this;
|
|
643
|
-
var {
|
|
644
|
-
model
|
|
645
|
-
} = this.irisGrid.props;
|
|
646
|
-
var {
|
|
647
|
-
formatter
|
|
648
|
-
} = model;
|
|
649
|
-
var {
|
|
650
|
-
dh
|
|
651
|
-
} = this;
|
|
652
|
-
var selectedFormat = formatter.getColumnFormat(column.type, column.name);
|
|
653
|
-
var formatOptions;
|
|
654
|
-
var columnIndex = model.getColumnIndexByName(column.name);
|
|
655
|
-
if (TableUtils.isDecimalType(column.type)) {
|
|
656
|
-
formatOptions = DecimalFormatContextMenu.getOptions(dh, selectedFormat, format => {
|
|
657
|
-
assertNotNull(columnIndex);
|
|
658
|
-
this.debouncedUpdateCustomFormat(columnIndex, format);
|
|
659
|
-
});
|
|
660
|
-
} else if (TableUtils.isIntegerType(column.type)) {
|
|
661
|
-
formatOptions = IntegerFormatContextMenu.getOptions(dh, selectedFormat, format => {
|
|
662
|
-
assertNotNull(columnIndex);
|
|
663
|
-
this.debouncedUpdateCustomFormat(columnIndex, format);
|
|
664
|
-
});
|
|
665
|
-
} else {
|
|
666
|
-
log.error('Invalid column type in numberFormatActions');
|
|
667
|
-
return null;
|
|
668
|
-
}
|
|
669
|
-
var actions = [];
|
|
670
|
-
var _loop2 = function _loop2() {
|
|
671
|
-
var {
|
|
672
|
-
format,
|
|
673
|
-
isSelected
|
|
674
|
-
} = formatOptions[i];
|
|
675
|
-
actions.push(_objectSpread(_objectSpread({}, formatOptions[i]), {}, {
|
|
676
|
-
icon: isSelected ? vsCheck : undefined,
|
|
677
|
-
order: i,
|
|
678
|
-
action: () => {
|
|
679
|
-
if (columnIndex === undefined && format && format.type === TableColumnFormatter.TYPE_CONTEXT_CUSTOM) {
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
assertNotNull(columnIndex);
|
|
683
|
-
_this2.irisGrid.handleFormatSelection(columnIndex, format);
|
|
684
|
-
}
|
|
685
|
-
}));
|
|
686
|
-
};
|
|
687
|
-
for (var i = 0; i < formatOptions.length; i += 1) {
|
|
688
|
-
_loop2();
|
|
689
|
-
}
|
|
690
|
-
return actions;
|
|
691
|
-
}
|
|
692
|
-
stringFilterActions(column, valueText, value, quickFilter, operator) {
|
|
693
|
-
var {
|
|
694
|
-
dh
|
|
695
|
-
} = this;
|
|
696
|
-
var filterValue = dh.FilterValue.ofString(value);
|
|
697
|
-
var newQuickFilter = quickFilter;
|
|
698
|
-
if (!newQuickFilter) {
|
|
699
|
-
newQuickFilter = {
|
|
700
|
-
filter: null,
|
|
701
|
-
text: null
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
var {
|
|
705
|
-
filter,
|
|
706
|
-
text: filterText
|
|
707
|
-
} = newQuickFilter;
|
|
708
|
-
var actions = [];
|
|
709
|
-
var {
|
|
710
|
-
model
|
|
711
|
-
} = this.irisGrid.props;
|
|
712
|
-
var columnIndex = model.getColumnIndexByName(column.name);
|
|
713
|
-
var quickFilterValueText = TableUtils.escapeQuickTextFilter(valueText);
|
|
714
|
-
assertNotNull(columnIndex);
|
|
715
|
-
actions.push({
|
|
716
|
-
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
717
|
-
className: "iris-grid-filter-menu-item-value"
|
|
718
|
-
}, operator ? IrisGridContextMenuHandler.getOperatorAsText(operator) : '', ' ', "\"", valueText, "\""),
|
|
719
|
-
order: 1,
|
|
720
|
-
group: ContextActions.groups.high
|
|
721
|
-
});
|
|
722
|
-
actions.push({
|
|
723
|
-
title: 'text is exactly',
|
|
724
|
-
description: "Show only rows where ".concat(column.name, " is ").concat(value, " (case sensitive)"),
|
|
725
|
-
action: () => {
|
|
726
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().eq(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "".concat(quickFilterValueText), operator));
|
|
727
|
-
},
|
|
728
|
-
order: 10,
|
|
729
|
-
group: ContextActions.groups.low
|
|
730
|
-
});
|
|
731
|
-
actions.push({
|
|
732
|
-
title: 'text is not exactly',
|
|
733
|
-
description: "Show only rows where ".concat(column.name, " is not ").concat(valueText, " (case sensitive)"),
|
|
734
|
-
action: () => {
|
|
735
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().notEq(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "!=".concat(quickFilterValueText), operator));
|
|
736
|
-
},
|
|
737
|
-
order: 20,
|
|
738
|
-
group: ContextActions.groups.low
|
|
739
|
-
});
|
|
740
|
-
actions.push({
|
|
741
|
-
title: "text contains",
|
|
742
|
-
description: "Show only rows where ".concat(column.name, " contains ").concat(valueText),
|
|
743
|
-
action: () => {
|
|
744
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull().not().and(column.filter().contains(filterValue)), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "~".concat(quickFilterValueText), operator));
|
|
745
|
-
},
|
|
746
|
-
order: 30,
|
|
747
|
-
group: ContextActions.groups.low
|
|
748
|
-
});
|
|
749
|
-
actions.push({
|
|
750
|
-
title: 'text does not contain',
|
|
751
|
-
description: "Show only rows where ".concat(column.name, " does not contain ").concat(value),
|
|
752
|
-
action: () => {
|
|
753
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull().or(column.filter().contains(filterValue).not()), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "!~".concat(quickFilterValueText), operator));
|
|
754
|
-
},
|
|
755
|
-
order: 40,
|
|
756
|
-
group: ContextActions.groups.low
|
|
757
|
-
});
|
|
758
|
-
actions.push({
|
|
759
|
-
title: 'text starts with',
|
|
760
|
-
description: "Show only rows where ".concat(column.name, " starts with ").concat(valueText),
|
|
761
|
-
action: () => {
|
|
762
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull().not().and(column.filter().invoke('startsWith', filterValue)), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "".concat(quickFilterValueText, "*"), operator));
|
|
763
|
-
},
|
|
764
|
-
order: 50,
|
|
765
|
-
group: ContextActions.groups.low
|
|
766
|
-
});
|
|
767
|
-
actions.push({
|
|
768
|
-
title: 'text ends with',
|
|
769
|
-
description: "Show only rows where ".concat(column.name, " ends with ").concat(valueText),
|
|
770
|
-
action: () => {
|
|
771
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull().not().and(column.filter().invoke('endsWith', filterValue)), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "*".concat(quickFilterValueText), operator));
|
|
772
|
-
},
|
|
773
|
-
order: 60,
|
|
774
|
-
group: ContextActions.groups.low
|
|
775
|
-
});
|
|
776
|
-
return actions;
|
|
777
|
-
}
|
|
778
|
-
numberFilterActions(column, valueText, value, quickFilter, operator) {
|
|
779
|
-
var filterValue = this.getFilterValueForNumberOrChar(column.type, value);
|
|
780
|
-
var filter = null;
|
|
781
|
-
var filterText = null;
|
|
782
|
-
if (quickFilter) {
|
|
783
|
-
filter = quickFilter.filter;
|
|
784
|
-
filterText = quickFilter.text;
|
|
785
|
-
}
|
|
786
|
-
var actions = [];
|
|
787
|
-
var isFinite = value !== Number.POSITIVE_INFINITY && value !== Number.NEGATIVE_INFINITY && !Number.isNaN(value);
|
|
788
|
-
var {
|
|
789
|
-
model
|
|
790
|
-
} = this.irisGrid.props;
|
|
791
|
-
var columnIndex = model.getColumnIndexByName(column.name);
|
|
792
|
-
assertNotNull(columnIndex);
|
|
793
|
-
actions.push({
|
|
794
|
-
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
795
|
-
className: "iris-grid-filter-menu-item-value"
|
|
796
|
-
}, operator ? IrisGridContextMenuHandler.getOperatorAsText(operator) : '', ' ', "\"", valueText, "\""),
|
|
797
|
-
order: 1,
|
|
798
|
-
group: ContextActions.groups.high
|
|
799
|
-
});
|
|
800
|
-
actions.push({
|
|
801
|
-
title: 'is equal to',
|
|
802
|
-
description: "Show only rows where ".concat(column.name, " is ").concat(valueText),
|
|
803
|
-
action: () => {
|
|
804
|
-
var valueFilter = this.getNumberValueEqualsFilter(column, value);
|
|
805
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, valueFilter, operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "=".concat(valueText), operator));
|
|
806
|
-
},
|
|
807
|
-
order: 10,
|
|
808
|
-
group: ContextActions.groups.low
|
|
809
|
-
});
|
|
810
|
-
actions.push({
|
|
811
|
-
title: 'is not equal to',
|
|
812
|
-
description: "Show only rows where ".concat(column.name, " is not ").concat(valueText),
|
|
813
|
-
action: () => {
|
|
814
|
-
var valueFilter = this.getNumberValueEqualsFilter(column, value).not();
|
|
815
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, valueFilter, operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "!=".concat(valueText), operator));
|
|
816
|
-
},
|
|
817
|
-
order: 20,
|
|
818
|
-
group: ContextActions.groups.low
|
|
819
|
-
});
|
|
820
|
-
|
|
821
|
-
// IDS-6092 Less/greater than filters don't make sense for Infinite/NaN
|
|
822
|
-
// TODO (DH-11799): These char filters should work in Bard, with the merge for DH-11040: https://gitlab.eng.illumon.com/illumon/iris/merge_requests/5801
|
|
823
|
-
// They do not work in Powell though, so disable them.
|
|
824
|
-
if (isFinite && !TableUtils.isCharType(column.type)) {
|
|
825
|
-
actions.push({
|
|
826
|
-
title: 'greater than',
|
|
827
|
-
description: "Show only rows where ".concat(column.name, " is greater than ").concat(valueText),
|
|
828
|
-
action: () => {
|
|
829
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().greaterThan(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, ">".concat(valueText), operator));
|
|
830
|
-
},
|
|
831
|
-
order: 30,
|
|
832
|
-
group: ContextActions.groups.low
|
|
833
|
-
});
|
|
834
|
-
actions.push({
|
|
835
|
-
title: 'greater than or equal to',
|
|
836
|
-
description: "Show only rows where ".concat(column.name, " is greater than or equal to ").concat(valueText),
|
|
837
|
-
action: () => {
|
|
838
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().greaterThanOrEqualTo(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, ">=".concat(valueText), operator));
|
|
839
|
-
},
|
|
840
|
-
order: 40,
|
|
841
|
-
group: ContextActions.groups.low
|
|
842
|
-
});
|
|
843
|
-
actions.push({
|
|
844
|
-
title: 'less than',
|
|
845
|
-
description: "Show only rows where ".concat(column.name, " is less than ").concat(valueText),
|
|
846
|
-
action: () => {
|
|
847
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().lessThan(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "<".concat(valueText), operator));
|
|
848
|
-
},
|
|
849
|
-
order: 50,
|
|
850
|
-
group: ContextActions.groups.low
|
|
851
|
-
});
|
|
852
|
-
actions.push({
|
|
853
|
-
title: 'less than or equal to',
|
|
854
|
-
description: "Show only rows where ".concat(column.name, " is less than or equal to ").concat(valueText),
|
|
855
|
-
action: () => {
|
|
856
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().lessThanOrEqualTo(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "<=".concat(valueText), operator));
|
|
857
|
-
},
|
|
858
|
-
order: 60,
|
|
859
|
-
group: ContextActions.groups.low
|
|
860
|
-
});
|
|
861
|
-
}
|
|
862
|
-
return actions;
|
|
863
|
-
}
|
|
864
|
-
booleanFilterActions(column, valueText, quickFilter, operator) {
|
|
865
|
-
var actions = [];
|
|
866
|
-
var {
|
|
867
|
-
model
|
|
868
|
-
} = this.irisGrid.props;
|
|
869
|
-
var {
|
|
870
|
-
filter,
|
|
871
|
-
text: filterText
|
|
872
|
-
} = quickFilter || {};
|
|
873
|
-
var columnIndex = model.getColumnIndexByName(column.name);
|
|
874
|
-
assertNotNull(columnIndex);
|
|
875
|
-
actions.push({
|
|
876
|
-
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
877
|
-
className: "iris-grid-filter-menu-item-value"
|
|
878
|
-
}, operator ? IrisGridContextMenuHandler.getOperatorAsText(operator) : '', ' ', "\"", valueText !== null && valueText !== void 0 ? valueText : 'null', "\""),
|
|
879
|
-
order: 1,
|
|
880
|
-
group: ContextActions.groups.high
|
|
881
|
-
});
|
|
882
|
-
actions.push({
|
|
883
|
-
title: 'true',
|
|
884
|
-
description: "Show only rows where ".concat(column.name, " is true"),
|
|
885
|
-
action: () => {
|
|
886
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isTrue(), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, 'true', operator));
|
|
887
|
-
},
|
|
888
|
-
order: 10,
|
|
889
|
-
group: ContextActions.groups.low
|
|
890
|
-
});
|
|
891
|
-
actions.push({
|
|
892
|
-
title: 'false',
|
|
893
|
-
description: "Show only rows where ".concat(column.name, " is false"),
|
|
894
|
-
action: () => {
|
|
895
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isFalse(), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, 'false', operator));
|
|
896
|
-
},
|
|
897
|
-
order: 20,
|
|
898
|
-
group: ContextActions.groups.low
|
|
899
|
-
});
|
|
900
|
-
actions.push({
|
|
901
|
-
title: 'is null',
|
|
902
|
-
description: "Show only rows where ".concat(column.name, " is null"),
|
|
903
|
-
action: () => {
|
|
904
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull(), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, 'null', operator));
|
|
905
|
-
},
|
|
906
|
-
order: 30,
|
|
907
|
-
group: ContextActions.groups.low
|
|
908
|
-
});
|
|
909
|
-
actions.push({
|
|
910
|
-
title: 'is not null',
|
|
911
|
-
description: "Show only rows where ".concat(column.name, " is not null"),
|
|
912
|
-
action: () => {
|
|
913
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull().not(), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, '!null', operator));
|
|
914
|
-
},
|
|
915
|
-
order: 40,
|
|
916
|
-
group: ContextActions.groups.low
|
|
917
|
-
});
|
|
918
|
-
return actions;
|
|
919
|
-
}
|
|
920
|
-
dateFilterActions(column, valueText, previewValue, value, quickFilter, operator) {
|
|
921
|
-
var {
|
|
922
|
-
dh
|
|
923
|
-
} = this;
|
|
924
|
-
var filterValue = dh.FilterValue.ofNumber(value);
|
|
925
|
-
var filter = null;
|
|
926
|
-
var filterText = null;
|
|
927
|
-
if (quickFilter) {
|
|
928
|
-
filter = quickFilter.filter;
|
|
929
|
-
filterText = quickFilter.text;
|
|
930
|
-
}
|
|
931
|
-
var {
|
|
932
|
-
model
|
|
933
|
-
} = this.irisGrid.props;
|
|
934
|
-
var columnIndex = model.getColumnIndexByName(column.name);
|
|
935
|
-
assertNotNull(columnIndex);
|
|
936
|
-
var actions = [];
|
|
937
|
-
actions.push({
|
|
938
|
-
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
939
|
-
className: "iris-grid-filter-menu-item-value"
|
|
940
|
-
}, operator ? IrisGridContextMenuHandler.getOperatorAsText(operator) : '', ' ', "\"", previewValue, "\""),
|
|
941
|
-
order: 1,
|
|
942
|
-
group: ContextActions.groups.high
|
|
943
|
-
});
|
|
944
|
-
actions.push({
|
|
945
|
-
title: 'date is',
|
|
946
|
-
description: "Show only rows where ".concat(column.name, " is ").concat(previewValue),
|
|
947
|
-
action: () => {
|
|
948
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().eq(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "=".concat(valueText), operator));
|
|
949
|
-
},
|
|
950
|
-
order: 10,
|
|
951
|
-
group: ContextActions.groups.low
|
|
952
|
-
});
|
|
953
|
-
actions.push({
|
|
954
|
-
title: 'date is not',
|
|
955
|
-
description: "Show only rows where ".concat(column.name, " is not ").concat(previewValue),
|
|
956
|
-
action: () => {
|
|
957
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().notEq(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "!=".concat(valueText), operator));
|
|
958
|
-
},
|
|
959
|
-
order: 20,
|
|
960
|
-
group: ContextActions.groups.low
|
|
961
|
-
});
|
|
962
|
-
actions.push({
|
|
963
|
-
title: 'date is before',
|
|
964
|
-
description: "Show only rows where ".concat(column.name, " is before ").concat(previewValue),
|
|
965
|
-
action: () => {
|
|
966
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().lessThan(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "<".concat(valueText), operator));
|
|
967
|
-
},
|
|
968
|
-
order: 30,
|
|
969
|
-
group: ContextActions.groups.low
|
|
970
|
-
});
|
|
971
|
-
actions.push({
|
|
972
|
-
title: 'date is before or equal',
|
|
973
|
-
description: "Show only rows where ".concat(column.name, " is before or equal to ").concat(previewValue),
|
|
974
|
-
action: () => {
|
|
975
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().lessThanOrEqualTo(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "<=".concat(valueText), operator));
|
|
976
|
-
},
|
|
977
|
-
order: 40,
|
|
978
|
-
group: ContextActions.groups.low
|
|
979
|
-
});
|
|
980
|
-
actions.push({
|
|
981
|
-
title: 'date is after',
|
|
982
|
-
description: "Show only rows where ".concat(column.name, " is greater than ").concat(previewValue),
|
|
983
|
-
action: () => {
|
|
984
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().greaterThan(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, ">".concat(valueText), operator));
|
|
985
|
-
},
|
|
986
|
-
order: 50,
|
|
987
|
-
group: ContextActions.groups.low
|
|
988
|
-
});
|
|
989
|
-
actions.push({
|
|
990
|
-
title: 'date is after or equal',
|
|
991
|
-
description: "Show only rows where ".concat(column.name, " is after or equal to ").concat(previewValue),
|
|
992
|
-
action: () => {
|
|
993
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().greaterThanOrEqualTo(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, ">=".concat(valueText), operator));
|
|
994
|
-
},
|
|
995
|
-
order: 60,
|
|
996
|
-
group: ContextActions.groups.low
|
|
997
|
-
});
|
|
998
|
-
return actions;
|
|
999
|
-
}
|
|
1000
|
-
emptyStringFilterActions(column, quickFilter, operator) {
|
|
1001
|
-
var {
|
|
1002
|
-
dh
|
|
1003
|
-
} = this;
|
|
1004
|
-
var filterValue = dh.FilterValue.ofString('');
|
|
1005
|
-
var newQuickFilter = quickFilter;
|
|
1006
|
-
if (!newQuickFilter) {
|
|
1007
|
-
newQuickFilter = {
|
|
1008
|
-
filter: null,
|
|
1009
|
-
text: null
|
|
1010
|
-
};
|
|
1011
|
-
}
|
|
1012
|
-
var {
|
|
1013
|
-
filter,
|
|
1014
|
-
text: filterText
|
|
1015
|
-
} = newQuickFilter;
|
|
1016
|
-
var actions = [];
|
|
1017
|
-
var {
|
|
1018
|
-
model
|
|
1019
|
-
} = this.irisGrid.props;
|
|
1020
|
-
var columnIndex = model.getColumnIndexByName(column.name);
|
|
1021
|
-
assertNotNull(columnIndex);
|
|
1022
|
-
actions.push({
|
|
1023
|
-
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
1024
|
-
className: "iris-grid-filter-menu-item-value"
|
|
1025
|
-
}, operator ? IrisGridContextMenuHandler.getOperatorAsText(operator) : '', ' ', /*#__PURE__*/React.createElement("i", {
|
|
1026
|
-
className: "text-muted"
|
|
1027
|
-
}, "empty")),
|
|
1028
|
-
order: 1,
|
|
1029
|
-
group: ContextActions.groups.high
|
|
1030
|
-
});
|
|
1031
|
-
actions.push({
|
|
1032
|
-
title: 'is empty string',
|
|
1033
|
-
description: "Show only rows where ".concat(column.name, " is empty"),
|
|
1034
|
-
action: () => {
|
|
1035
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().eq(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "=", operator));
|
|
1036
|
-
},
|
|
1037
|
-
order: 10,
|
|
1038
|
-
group: ContextActions.groups.low
|
|
1039
|
-
});
|
|
1040
|
-
actions.push({
|
|
1041
|
-
title: 'is not empty string',
|
|
1042
|
-
description: "Show only rows where ".concat(column.name, " is not empty"),
|
|
1043
|
-
action: () => {
|
|
1044
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().notEq(filterValue), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, "!=", operator));
|
|
1045
|
-
},
|
|
1046
|
-
order: 20,
|
|
1047
|
-
group: ContextActions.groups.low
|
|
1048
|
-
});
|
|
1049
|
-
return actions;
|
|
1050
|
-
}
|
|
1051
|
-
nullFilterActions(column, quickFilter, operator) {
|
|
1052
|
-
var filter = null;
|
|
1053
|
-
var filterText = null;
|
|
1054
|
-
if (quickFilter) {
|
|
1055
|
-
filter = quickFilter.filter;
|
|
1056
|
-
filterText = quickFilter.text;
|
|
1057
|
-
}
|
|
1058
|
-
var actions = [];
|
|
1059
|
-
var {
|
|
1060
|
-
model
|
|
1061
|
-
} = this.irisGrid.props;
|
|
1062
|
-
var columnIndex = model.getColumnIndexByName(column.name);
|
|
1063
|
-
assertNotNull(columnIndex);
|
|
1064
|
-
actions.push({
|
|
1065
|
-
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
1066
|
-
className: "iris-grid-filter-menu-item-value"
|
|
1067
|
-
}, operator ? IrisGridContextMenuHandler.getOperatorAsText(operator) : '', ' ', /*#__PURE__*/React.createElement("i", {
|
|
1068
|
-
className: "text-muted"
|
|
1069
|
-
}, "null")),
|
|
1070
|
-
order: 1,
|
|
1071
|
-
group: ContextActions.groups.high
|
|
1072
|
-
});
|
|
1073
|
-
actions.push({
|
|
1074
|
-
title: 'is null',
|
|
1075
|
-
description: "Show only rows where ".concat(column.name, " is null"),
|
|
1076
|
-
action: () => {
|
|
1077
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull(), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, 'null', operator));
|
|
1078
|
-
},
|
|
1079
|
-
order: 10,
|
|
1080
|
-
group: ContextActions.groups.low
|
|
1081
|
-
});
|
|
1082
|
-
actions.push({
|
|
1083
|
-
title: 'is not null',
|
|
1084
|
-
description: "Show only rows where ".concat(column.name, " is not null"),
|
|
1085
|
-
action: () => {
|
|
1086
|
-
this.irisGrid.setQuickFilter(columnIndex, IrisGridContextMenuHandler.getQuickFilterCondition(filter, column.filter().isNull().not(), operator), IrisGridContextMenuHandler.getQuickFilterText(filterText, '!null', operator));
|
|
1087
|
-
},
|
|
1088
|
-
order: 20,
|
|
1089
|
-
group: ContextActions.groups.low
|
|
1090
|
-
});
|
|
1091
|
-
return actions;
|
|
1092
|
-
}
|
|
1093
|
-
sortByActions(column, modelColumn, columnSort) {
|
|
1094
|
-
var theme = this.irisGrid.getTheme();
|
|
1095
|
-
var {
|
|
1096
|
-
contextMenuSortIconColor
|
|
1097
|
-
} = theme;
|
|
1098
|
-
var sortActions = [{
|
|
1099
|
-
title: "".concat(column.name, " Ascending"),
|
|
1100
|
-
order: 10,
|
|
1101
|
-
action: () => {
|
|
1102
|
-
this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending);
|
|
1103
|
-
},
|
|
1104
|
-
icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending) ? vsRemove : undefined,
|
|
1105
|
-
iconColor: contextMenuSortIconColor
|
|
1106
|
-
}, {
|
|
1107
|
-
title: "".concat(column.name, " Descending"),
|
|
1108
|
-
order: 20,
|
|
1109
|
-
action: () => {
|
|
1110
|
-
this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending);
|
|
1111
|
-
},
|
|
1112
|
-
icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending) ? vsRemove : undefined,
|
|
1113
|
-
iconColor: contextMenuSortIconColor
|
|
1114
|
-
}, {
|
|
1115
|
-
title: "Remove Sort",
|
|
1116
|
-
order: 50,
|
|
1117
|
-
action: () => {
|
|
1118
|
-
this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.none, false, true);
|
|
1119
|
-
},
|
|
1120
|
-
disabled: !columnSort
|
|
1121
|
-
}];
|
|
1122
|
-
if (TableUtils.isNumberType(column.type)) {
|
|
1123
|
-
sortActions.push({
|
|
1124
|
-
title: "ABS(".concat(column.name, ") Ascending"),
|
|
1125
|
-
order: 30,
|
|
1126
|
-
action: () => {
|
|
1127
|
-
this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending, true);
|
|
1128
|
-
},
|
|
1129
|
-
icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending, true) ? vsRemove : undefined,
|
|
1130
|
-
iconColor: contextMenuSortIconColor
|
|
1131
|
-
});
|
|
1132
|
-
sortActions.push({
|
|
1133
|
-
title: "ABS(".concat(column.name, ") Descending"),
|
|
1134
|
-
order: 40,
|
|
1135
|
-
action: () => {
|
|
1136
|
-
this.irisGrid.sortColumn(modelColumn, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending, true);
|
|
1137
|
-
},
|
|
1138
|
-
icon: this.checkColumnSort(columnSort, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending, true) ? vsRemove : undefined,
|
|
1139
|
-
iconColor: contextMenuSortIconColor
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
|
-
return sortActions;
|
|
1143
|
-
}
|
|
1144
|
-
additionalSortActions(column, columnIndex) {
|
|
1145
|
-
var theme = this.irisGrid.getTheme();
|
|
1146
|
-
var {
|
|
1147
|
-
contextMenuSortIconColor
|
|
1148
|
-
} = theme;
|
|
1149
|
-
var additionalSortActions = [{
|
|
1150
|
-
title: 'Add Sort By',
|
|
1151
|
-
menuElement: /*#__PURE__*/React.createElement("div", {
|
|
1152
|
-
className: "btn-context-menu menu-title"
|
|
1153
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
1154
|
-
className: "icon"
|
|
1155
|
-
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
1156
|
-
icon: vsRemove,
|
|
1157
|
-
style: {
|
|
1158
|
-
color: contextMenuSortIconColor !== null && contextMenuSortIconColor !== void 0 ? contextMenuSortIconColor : undefined
|
|
1159
|
-
}
|
|
1160
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
1161
|
-
className: "title"
|
|
1162
|
-
}, "Add Additional Sort"), /*#__PURE__*/React.createElement("span", {
|
|
1163
|
-
className: "shortcut"
|
|
1164
|
-
}, ContextActionUtils.isMacPlatform() ? '⌘Click' : 'Ctrl+Click')),
|
|
1165
|
-
order: 1
|
|
1166
|
-
}, {
|
|
1167
|
-
title: "".concat(column.name, " Ascending"),
|
|
1168
|
-
order: 10,
|
|
1169
|
-
action: () => {
|
|
1170
|
-
this.irisGrid.sortColumn(columnIndex, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending, false, true);
|
|
1171
|
-
}
|
|
1172
|
-
}, {
|
|
1173
|
-
title: "".concat(column.name, " Descending"),
|
|
1174
|
-
order: 20,
|
|
1175
|
-
action: () => {
|
|
1176
|
-
this.irisGrid.sortColumn(columnIndex, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending, false, true);
|
|
1177
|
-
}
|
|
1178
|
-
}];
|
|
1179
|
-
if (TableUtils.isNumberType(column.type)) {
|
|
1180
|
-
additionalSortActions.push({
|
|
1181
|
-
title: "ABS(".concat(column.name, ") Ascending"),
|
|
1182
|
-
order: 30,
|
|
1183
|
-
action: () => {
|
|
1184
|
-
this.irisGrid.sortColumn(columnIndex, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.ascending, true, true);
|
|
1185
|
-
}
|
|
1186
|
-
});
|
|
1187
|
-
additionalSortActions.push({
|
|
1188
|
-
title: "ABS(".concat(column.name, ") Descending"),
|
|
1189
|
-
order: 40,
|
|
1190
|
-
action: () => {
|
|
1191
|
-
this.irisGrid.sortColumn(columnIndex, IrisGridContextMenuHandler.COLUMN_SORT_DIRECTION.descending, true, true);
|
|
1192
|
-
}
|
|
1193
|
-
});
|
|
1194
|
-
}
|
|
1195
|
-
return additionalSortActions;
|
|
1196
|
-
}
|
|
1197
|
-
checkColumnSort(columnSort) {
|
|
1198
|
-
var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
1199
|
-
var isAbs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1200
|
-
if (!columnSort) {
|
|
1201
|
-
return false;
|
|
1202
|
-
}
|
|
1203
|
-
return columnSort.direction === direction && columnSort.isAbs === isAbs;
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
_defineProperty(IrisGridContextMenuHandler, "GROUP_EDIT", ContextActions.groups.high + 10);
|
|
1207
|
-
_defineProperty(IrisGridContextMenuHandler, "GROUP_HIDE_COLUMNS", ContextActions.groups.high + 25);
|
|
1208
|
-
_defineProperty(IrisGridContextMenuHandler, "GROUP_FILTER", ContextActions.groups.high + 50);
|
|
1209
|
-
_defineProperty(IrisGridContextMenuHandler, "GROUP_EXPAND_COLLAPSE", ContextActions.groups.high + 55);
|
|
1210
|
-
_defineProperty(IrisGridContextMenuHandler, "GROUP_GOTO", ContextActions.groups.high + 60);
|
|
1211
|
-
_defineProperty(IrisGridContextMenuHandler, "GROUP_SORT", ContextActions.groups.high + 75);
|
|
1212
|
-
_defineProperty(IrisGridContextMenuHandler, "GROUP_COPY", ContextActions.groups.high + 100);
|
|
1213
|
-
_defineProperty(IrisGridContextMenuHandler, "GROUP_FORMAT", ContextActions.groups.high + 150);
|
|
1214
|
-
_defineProperty(IrisGridContextMenuHandler, "COLUMN_SORT_DIRECTION", {
|
|
1215
|
-
ascending: 'ASC',
|
|
1216
|
-
descending: 'DESC',
|
|
1217
|
-
none: null
|
|
1218
|
-
});
|
|
1219
|
-
export default IrisGridContextMenuHandler;
|
|
1220
|
-
//# sourceMappingURL=IrisGridContextMenuHandler.js.map
|