@deephaven/iris-grid 0.13.3-beta.2 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdvancedFilterCreator.d.ts +63 -69
- package/dist/AdvancedFilterCreator.d.ts.map +1 -1
- package/dist/AdvancedFilterCreator.js +73 -79
- package/dist/AdvancedFilterCreator.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValue.d.ts +45 -45
- package/dist/AdvancedFilterCreatorSelectValue.d.ts.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValue.js +36 -32
- package/dist/AdvancedFilterCreatorSelectValue.js.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValueList.d.ts +52 -47
- package/dist/AdvancedFilterCreatorSelectValueList.d.ts.map +1 -1
- package/dist/AdvancedFilterCreatorSelectValueList.js +39 -24
- package/dist/AdvancedFilterCreatorSelectValueList.js.map +1 -1
- package/dist/ColumnStatistics.d.ts +22 -34
- package/dist/ColumnStatistics.d.ts.map +1 -1
- package/dist/ColumnStatistics.js +12 -8
- package/dist/ColumnStatistics.js.map +1 -1
- package/dist/CrossColumnSearch.d.ts +24 -26
- package/dist/CrossColumnSearch.d.ts.map +1 -1
- package/dist/CrossColumnSearch.js +13 -9
- package/dist/CrossColumnSearch.js.map +1 -1
- package/dist/FilterInputField.d.ts +51 -48
- package/dist/FilterInputField.d.ts.map +1 -1
- package/dist/FilterInputField.js +27 -30
- package/dist/FilterInputField.js.map +1 -1
- package/dist/IrisGrid.d.ts +453 -409
- package/dist/IrisGrid.d.ts.map +1 -1
- package/dist/IrisGrid.js +449 -514
- package/dist/IrisGrid.js.map +1 -1
- package/dist/IrisGridCellOverflowModal.d.ts +1 -1
- package/dist/IrisGridCellOverflowModal.d.ts.map +1 -1
- package/dist/IrisGridCellOverflowModal.js.map +1 -1
- package/dist/IrisGridCopyHandler.d.ts +46 -52
- package/dist/IrisGridCopyHandler.d.ts.map +1 -1
- package/dist/IrisGridCopyHandler.js +38 -22
- package/dist/IrisGridCopyHandler.js.map +1 -1
- package/dist/IrisGridMetricCalculator.d.ts +4 -5
- package/dist/IrisGridMetricCalculator.d.ts.map +1 -1
- package/dist/IrisGridMetricCalculator.js +1 -5
- package/dist/IrisGridMetricCalculator.js.map +1 -1
- package/dist/IrisGridModel.d.ts +35 -37
- package/dist/IrisGridModel.d.ts.map +1 -1
- package/dist/IrisGridModel.js +3 -19
- package/dist/IrisGridModel.js.map +1 -1
- package/dist/IrisGridModelFactory.d.ts +5 -7
- package/dist/IrisGridModelFactory.d.ts.map +1 -1
- package/dist/IrisGridModelFactory.js +5 -5
- package/dist/IrisGridModelFactory.js.map +1 -1
- package/dist/IrisGridModelUpdater.d.ts +11 -13
- package/dist/IrisGridModelUpdater.d.ts.map +1 -1
- package/dist/IrisGridModelUpdater.js.map +1 -1
- package/dist/IrisGridPartitionSelector.d.ts +39 -38
- package/dist/IrisGridPartitionSelector.d.ts.map +1 -1
- package/dist/IrisGridPartitionSelector.js +24 -18
- package/dist/IrisGridPartitionSelector.js.map +1 -1
- package/dist/IrisGridProxyModel.d.ts +32 -111
- package/dist/IrisGridProxyModel.d.ts.map +1 -1
- package/dist/IrisGridProxyModel.js +170 -212
- package/dist/IrisGridProxyModel.js.map +1 -1
- package/dist/IrisGridRenderer.d.ts +31 -59
- package/dist/IrisGridRenderer.d.ts.map +1 -1
- package/dist/IrisGridRenderer.js +46 -92
- package/dist/IrisGridRenderer.js.map +1 -1
- package/dist/IrisGridTableModel.d.ts +147 -48
- package/dist/IrisGridTableModel.d.ts.map +1 -1
- package/dist/IrisGridTableModel.js +1381 -58
- package/dist/IrisGridTableModel.js.map +1 -1
- package/dist/IrisGridTestUtils.d.ts +14 -18
- package/dist/IrisGridTestUtils.d.ts.map +1 -1
- package/dist/IrisGridTestUtils.js +1 -29
- package/dist/IrisGridTestUtils.js.map +1 -1
- package/dist/IrisGridTheme.d.ts +3 -35
- package/dist/IrisGridTheme.d.ts.map +1 -1
- package/dist/IrisGridTheme.js.map +1 -1
- package/dist/IrisGridTreeTableModel.d.ts +7 -26
- package/dist/IrisGridTreeTableModel.d.ts.map +1 -1
- package/dist/IrisGridTreeTableModel.js +14 -24
- package/dist/IrisGridTreeTableModel.js.map +1 -1
- package/dist/IrisGridUtils.d.ts +162 -257
- package/dist/IrisGridUtils.d.ts.map +1 -1
- package/dist/IrisGridUtils.js +95 -132
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/MissingKeyError.d.ts +3 -5
- package/dist/MissingKeyError.d.ts.map +1 -1
- package/dist/MissingKeyError.js.map +1 -1
- package/dist/PartitionSelectorSearch.d.ts +40 -61
- package/dist/PartitionSelectorSearch.d.ts.map +1 -1
- package/dist/PartitionSelectorSearch.js +15 -25
- package/dist/PartitionSelectorSearch.js.map +1 -1
- package/dist/PendingDataBottomBar.d.ts +6 -3
- package/dist/PendingDataBottomBar.d.ts.map +1 -1
- package/dist/PendingDataBottomBar.js.map +1 -1
- package/dist/TableViewportUpdater.d.ts +55 -39
- package/dist/TableViewportUpdater.d.ts.map +1 -1
- package/dist/TableViewportUpdater.js +64 -42
- package/dist/TableViewportUpdater.js.map +1 -1
- package/dist/TreeTableViewportUpdater.d.ts +37 -29
- package/dist/TreeTableViewportUpdater.d.ts.map +1 -1
- package/dist/TreeTableViewportUpdater.js +50 -39
- package/dist/TreeTableViewportUpdater.js.map +1 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -9
- package/dist/index.js.map +1 -1
- package/dist/mousehandlers/IrisGridCellOverflowMouseHandler.d.ts.map +1 -1
- package/dist/mousehandlers/IrisGridCellOverflowMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.d.ts +1 -1
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.d.ts.map +1 -1
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js +0 -2
- package/dist/mousehandlers/IrisGridColumnSelectMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js +1 -1
- package/dist/mousehandlers/IrisGridColumnTooltipMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts +130 -41
- package/dist/mousehandlers/IrisGridContextMenuHandler.d.ts.map +1 -1
- package/dist/mousehandlers/IrisGridContextMenuHandler.js +317 -426
- package/dist/mousehandlers/IrisGridContextMenuHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridFilterMouseHandler.d.ts.map +1 -1
- package/dist/mousehandlers/IrisGridFilterMouseHandler.js +2 -2
- package/dist/mousehandlers/IrisGridFilterMouseHandler.js.map +1 -1
- package/dist/mousehandlers/IrisGridSortMouseHandler.js +1 -1
- package/dist/mousehandlers/IrisGridSortMouseHandler.js.map +1 -1
- package/dist/mousehandlers/PendingMouseHandler.d.ts +4 -8
- package/dist/mousehandlers/PendingMouseHandler.d.ts.map +1 -1
- package/dist/mousehandlers/PendingMouseHandler.js +5 -4
- package/dist/mousehandlers/PendingMouseHandler.js.map +1 -1
- package/dist/sidebar/ChartBuilder.d.ts +33 -48
- package/dist/sidebar/ChartBuilder.d.ts.map +1 -1
- package/dist/sidebar/ChartBuilder.js +27 -28
- package/dist/sidebar/ChartBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnBuilder.d.ts +41 -51
- package/dist/sidebar/CustomColumnBuilder.d.ts.map +1 -1
- package/dist/sidebar/CustomColumnBuilder.js +18 -22
- package/dist/sidebar/CustomColumnBuilder.js.map +1 -1
- package/dist/sidebar/CustomColumnInput.d.ts +36 -26
- package/dist/sidebar/CustomColumnInput.d.ts.map +1 -1
- package/dist/sidebar/CustomColumnInput.js +20 -11
- package/dist/sidebar/CustomColumnInput.js.map +1 -1
- package/dist/sidebar/InputEditor.d.ts +35 -34
- package/dist/sidebar/InputEditor.d.ts.map +1 -1
- package/dist/sidebar/InputEditor.js +24 -43
- package/dist/sidebar/InputEditor.js.map +1 -1
- package/dist/sidebar/RollupRows.d.ts +52 -67
- package/dist/sidebar/RollupRows.d.ts.map +1 -1
- package/dist/sidebar/RollupRows.js +53 -51
- package/dist/sidebar/RollupRows.js.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.d.ts +21 -27
- package/dist/sidebar/SelectDistinctBuilder.d.ts.map +1 -1
- package/dist/sidebar/SelectDistinctBuilder.js +10 -6
- package/dist/sidebar/SelectDistinctBuilder.js.map +1 -1
- package/dist/sidebar/TableCsvExporter.d.ts +39 -42
- package/dist/sidebar/TableCsvExporter.d.ts.map +1 -1
- package/dist/sidebar/TableCsvExporter.js +20 -12
- package/dist/sidebar/TableCsvExporter.js.map +1 -1
- package/dist/sidebar/TableSaver.d.ts +60 -59
- package/dist/sidebar/TableSaver.d.ts.map +1 -1
- package/dist/sidebar/TableSaver.js +68 -154
- package/dist/sidebar/TableSaver.js.map +1 -1
- package/dist/sidebar/VisibilityOrderingBuilder.d.ts +45 -56
- package/dist/sidebar/VisibilityOrderingBuilder.d.ts.map +1 -1
- package/dist/sidebar/VisibilityOrderingBuilder.js +29 -34
- package/dist/sidebar/VisibilityOrderingBuilder.js.map +1 -1
- package/dist/sidebar/aggregations/Aggregations.d.ts.map +1 -1
- package/dist/sidebar/aggregations/Aggregations.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.d.ts +1 -2
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts +5 -6
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js +0 -5
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js.map +1 -1
- package/dist/sidebar/icons/index.d.ts +7 -7
- package/dist/sidebar/icons/index.d.ts.map +1 -1
- package/dist/sidebar/icons/index.js.map +1 -1
- package/dist/sidebar/index.d.ts +12 -12
- package/dist/sidebar/index.d.ts.map +1 -1
- package/dist/sidebar/index.js.map +1 -1
- package/package.json +16 -17
- package/dist/CommonTypes.d.ts +0 -58
- package/dist/CommonTypes.d.ts.map +0 -1
- package/dist/CommonTypes.js +0 -2
- package/dist/CommonTypes.js.map +0 -1
- package/dist/IrisGridTableModelTemplate.d.ts +0 -219
- package/dist/IrisGridTableModelTemplate.d.ts.map +0 -1
- package/dist/IrisGridTableModelTemplate.js +0 -1623
- package/dist/IrisGridTableModelTemplate.js.map +0 -1
|
@@ -1,72 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Formatter, SortDirection } from '@deephaven/jsapi-utils';
|
|
4
|
-
import { CancelablePromise } from '@deephaven/utils';
|
|
5
|
-
import { Column, FilterCondition, Table } from '@deephaven/jsapi-shim';
|
|
6
|
-
import './AdvancedFilterCreator.scss';
|
|
7
|
-
import IrisGridModel from './IrisGridModel';
|
|
8
|
-
import { AdvancedFilterOptions } from './CommonTypes';
|
|
9
|
-
declare type FilterChangeHandler = (selectedType: FilterTypeValue, value: string) => void;
|
|
10
|
-
interface AdvancedFilterCreatorProps {
|
|
11
|
-
model: IrisGridModel;
|
|
12
|
-
column: Column;
|
|
13
|
-
onFilterChange: (column: Column, filter: FilterCondition, options: AdvancedFilterOptions) => void;
|
|
14
|
-
onSortChange: (column: Column, direction: SortDirection, addToExisting?: boolean) => void;
|
|
15
|
-
onDone: () => void;
|
|
16
|
-
options: AdvancedFilterOptions;
|
|
17
|
-
sortDirection: SortDirection;
|
|
18
|
-
formatter: Formatter;
|
|
19
|
-
}
|
|
20
|
-
interface AdvancedFilterItem {
|
|
21
|
-
selectedType?: FilterTypeValue;
|
|
22
|
-
value?: string;
|
|
23
|
-
key: string;
|
|
24
|
-
}
|
|
25
|
-
interface AdvancedFilterCreatorState {
|
|
26
|
-
filterItems: AdvancedFilterItem[];
|
|
27
|
-
filterOperators: FilterOperatorValue[];
|
|
28
|
-
invertSelection: boolean;
|
|
29
|
-
selectedValues: unknown[];
|
|
30
|
-
valuesTableError: null;
|
|
31
|
-
valuesTable?: Table;
|
|
32
|
-
}
|
|
33
|
-
declare class AdvancedFilterCreator extends PureComponent<AdvancedFilterCreatorProps, AdvancedFilterCreatorState> {
|
|
1
|
+
export default AdvancedFilterCreator;
|
|
2
|
+
declare class AdvancedFilterCreator extends React.PureComponent<any, any, any> {
|
|
34
3
|
static debounceFilterUpdate: number;
|
|
35
|
-
|
|
36
|
-
options: {
|
|
37
|
-
filterItems: null;
|
|
38
|
-
filterOperators: null;
|
|
39
|
-
invertSelection: boolean;
|
|
40
|
-
selectedValues: never[];
|
|
41
|
-
};
|
|
42
|
-
sortDirection: null;
|
|
43
|
-
};
|
|
44
|
-
static makeFilterItem(): AdvancedFilterItem;
|
|
45
|
-
constructor(props: AdvancedFilterCreatorProps);
|
|
46
|
-
componentDidMount(): void;
|
|
47
|
-
componentWillUnmount(): void;
|
|
48
|
-
focusTrapContainer: React.RefObject<HTMLFormElement>;
|
|
49
|
-
debounceTimeout?: ReturnType<typeof setTimeout>;
|
|
50
|
-
filterKey: number;
|
|
51
|
-
valuesTablePromise?: CancelablePromise<Table>;
|
|
52
|
-
getFilterChangeHandler(index: number): FilterChangeHandler;
|
|
53
|
-
getFilterDeleteHandler(index: number): () => void;
|
|
54
|
-
getFilterTypes: (columnType: string) => FilterTypeValue[];
|
|
55
|
-
initValuesTable(): void;
|
|
56
|
-
handleFocusTrapEnd(): void;
|
|
57
|
-
handleFocusTrapStart(): void;
|
|
4
|
+
constructor(props: any);
|
|
58
5
|
handleAddAnd(): void;
|
|
59
6
|
handleAddOr(): void;
|
|
60
|
-
handleChangeFilterOperator(event:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
7
|
+
handleChangeFilterOperator(event: any): void;
|
|
8
|
+
handleDone(event: any): void;
|
|
9
|
+
handleFilterChange(filterIndex: any, selectedType: any, value: any): void;
|
|
10
|
+
handleFilterDelete(filterIndex: any): void;
|
|
11
|
+
handleSelectValueChange(selectedValues: any, invertSelection: any): void;
|
|
64
12
|
handleReset(): void;
|
|
65
|
-
handleSortDown(event:
|
|
66
|
-
handleSortUp(event:
|
|
67
|
-
handleSubmit(event:
|
|
68
|
-
|
|
13
|
+
handleSortDown(event: any): void;
|
|
14
|
+
handleSortUp(event: any): void;
|
|
15
|
+
handleSubmit(event: any): void;
|
|
16
|
+
handleFocusTrapStart(): void;
|
|
17
|
+
handleFocusTrapEnd(): void;
|
|
69
18
|
handleUpdateTimeout(): void;
|
|
19
|
+
focusTrapContainer: React.RefObject<any>;
|
|
20
|
+
debounceTimeout: NodeJS.Timeout | null;
|
|
21
|
+
filterKey: number;
|
|
22
|
+
valuesTablePromise: import("@deephaven/utils").CancelablePromise<import("@deephaven/jsapi-shim").Table> | null;
|
|
23
|
+
getFilterChangeHandler(index: any): (selectedType?: any, value?: any) => void;
|
|
24
|
+
getFilterDeleteHandler(index: any): () => void;
|
|
25
|
+
getFilterTypes: (this: any, columnType: any) => import("@deephaven/filters").Type[];
|
|
26
|
+
initValuesTable(): void;
|
|
27
|
+
makeFilterItem(updateKey?: boolean): {
|
|
28
|
+
selectedType: string;
|
|
29
|
+
value: string;
|
|
30
|
+
key: number;
|
|
31
|
+
};
|
|
70
32
|
/**
|
|
71
33
|
* Convenience function to check if the previous filter has been inputted, and
|
|
72
34
|
* we should show the add filter buttons (+ AND OR)
|
|
@@ -75,14 +37,46 @@ declare class AdvancedFilterCreator extends PureComponent<AdvancedFilterCreatorP
|
|
|
75
37
|
shouldShowAddFilter(): boolean;
|
|
76
38
|
/**
|
|
77
39
|
* Sorts the table in the specified direction. If already sorted in that direction, remove it.
|
|
78
|
-
* @param direction The sort direction, ASC or DESC
|
|
79
|
-
* @param addToExisting Add to the existing sort, or replace the existing table sort
|
|
40
|
+
* @param {String} direction The sort direction, ASC or DESC
|
|
41
|
+
* @param {boolean} addToExisting Add to the existing sort, or replace the existing table sort
|
|
80
42
|
*/
|
|
81
|
-
sortTable(direction:
|
|
43
|
+
sortTable(direction: string, addToExisting?: boolean): void;
|
|
82
44
|
startUpdateTimer(): void;
|
|
83
45
|
stopUpdateTimer(): void;
|
|
84
46
|
sendUpdate(): void;
|
|
85
|
-
render(): JSX.Element;
|
|
86
47
|
}
|
|
87
|
-
|
|
48
|
+
declare namespace AdvancedFilterCreator {
|
|
49
|
+
namespace propTypes {
|
|
50
|
+
const model: PropTypes.Validator<any>;
|
|
51
|
+
const column: PropTypes.Validator<PropTypes.InferProps<{
|
|
52
|
+
name: PropTypes.Requireable<string>;
|
|
53
|
+
type: PropTypes.Requireable<string>;
|
|
54
|
+
}>>;
|
|
55
|
+
const onFilterChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
56
|
+
const onSortChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
57
|
+
const onDone: PropTypes.Validator<(...args: any[]) => any>;
|
|
58
|
+
const options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
59
|
+
filterItems: PropTypes.Requireable<(PropTypes.InferProps<{}> | null | undefined)[]>;
|
|
60
|
+
filterOperators: PropTypes.Requireable<(PropTypes.InferProps<{}> | null | undefined)[]>;
|
|
61
|
+
invertSelection: PropTypes.Requireable<boolean>;
|
|
62
|
+
selectedValues: PropTypes.Requireable<any[]>;
|
|
63
|
+
}>>;
|
|
64
|
+
const sortDirection: PropTypes.Requireable<string>;
|
|
65
|
+
const formatter: PropTypes.Validator<Formatter>;
|
|
66
|
+
}
|
|
67
|
+
namespace defaultProps {
|
|
68
|
+
export namespace options_1 {
|
|
69
|
+
const filterItems: null;
|
|
70
|
+
const filterOperators: null;
|
|
71
|
+
const invertSelection: boolean;
|
|
72
|
+
const selectedValues: never[];
|
|
73
|
+
}
|
|
74
|
+
export { options_1 as options };
|
|
75
|
+
const sortDirection_1: null;
|
|
76
|
+
export { sortDirection_1 as sortDirection };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
import React from "react";
|
|
80
|
+
import PropTypes from "prop-types";
|
|
81
|
+
import { Formatter } from "packages/jsapi-utils/src/Formatter";
|
|
88
82
|
//# sourceMappingURL=AdvancedFilterCreator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdvancedFilterCreator.d.ts","sourceRoot":"","sources":["../src/AdvancedFilterCreator.
|
|
1
|
+
{"version":3,"file":"AdvancedFilterCreator.d.ts","sourceRoot":"","sources":["../src/AdvancedFilterCreator.jsx"],"names":[],"mappings":";AAqBA;IACE,oCAAkC;IAElC,wBA2DC;IAmED,qBAKC;IAED,oBAKC;IAED,6CAWC;IA0ED,6BASC;IAjFD,0EASC;IAED,2CAsBC;IAED,yEAIC;IAED,oBAWC;IAED,iCAGC;IAED,+BAGC;IAED,+BAMC;IAxGD,6BAKC;IAZD,2BAKC;IAuHD,4BAGC;IA3NC,yCAA2C;IAC3C,uCAA2B;IAC3B,kBAAkB;IAClB,+GAA8B;IAoDhC,8EAEC;IAED,+CAEC;IAED,oFAA8E;IAE9E,wBAyBC;IAmID;;;;MAMC;IAED;;;;OAIG;IACH,+BAeC;IAED;;;;OAIG;IACH,6CAFW,OAAO,QAKjB;IAED,yBAOC;IAED,wBAKC;IAED,mBAwBC;CAyLF"}
|
|
@@ -4,38 +4,25 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
4
4
|
// disabled for tab-index on focus traps, which are intentionally non-interactive
|
|
5
5
|
import React, { PureComponent } from 'react';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
8
9
|
import memoize from 'memoize-one';
|
|
9
|
-
import { Operator as FilterOperator
|
|
10
|
+
import { Operator as FilterOperator } from '@deephaven/filters';
|
|
10
11
|
import { dhSortAmountDown, dhNewCircleLargeFilled } from '@deephaven/icons';
|
|
11
|
-
import { TableUtils } from '@deephaven/jsapi-utils';
|
|
12
|
+
import { Formatter, TableUtils } from '@deephaven/jsapi-utils';
|
|
12
13
|
import { ContextActionUtils, Tooltip } from '@deephaven/components';
|
|
13
14
|
import Log from '@deephaven/log';
|
|
14
|
-
import { PromiseUtils
|
|
15
|
-
import shortid from 'shortid';
|
|
15
|
+
import { PromiseUtils } from '@deephaven/utils';
|
|
16
16
|
import AdvancedFilterCreatorFilterItem from "./AdvancedFilterCreatorFilterItem.js";
|
|
17
17
|
import AdvancedFilterCreatorSelectValue from "./AdvancedFilterCreatorSelectValue.js";
|
|
18
|
+
import IrisGridModel from "./IrisGridModel.js";
|
|
18
19
|
import "./AdvancedFilterCreator.css";
|
|
19
20
|
var log = Log.module('AdvancedFilterCreator');
|
|
20
21
|
|
|
21
22
|
class AdvancedFilterCreator extends PureComponent {
|
|
22
|
-
static makeFilterItem() {
|
|
23
|
-
return {
|
|
24
|
-
key: shortid()
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
23
|
constructor(props) {
|
|
29
24
|
super(props);
|
|
30
25
|
|
|
31
|
-
_defineProperty(this, "focusTrapContainer", void 0);
|
|
32
|
-
|
|
33
|
-
_defineProperty(this, "debounceTimeout", void 0);
|
|
34
|
-
|
|
35
|
-
_defineProperty(this, "filterKey", void 0);
|
|
36
|
-
|
|
37
|
-
_defineProperty(this, "valuesTablePromise", void 0);
|
|
38
|
-
|
|
39
26
|
_defineProperty(this, "getFilterTypes", memoize(columnType => TableUtils.getFilterTypes(columnType)));
|
|
40
27
|
|
|
41
28
|
this.handleAddAnd = this.handleAddAnd.bind(this);
|
|
@@ -53,29 +40,21 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
53
40
|
this.handleFocusTrapEnd = this.handleFocusTrapEnd.bind(this);
|
|
54
41
|
this.handleUpdateTimeout = this.handleUpdateTimeout.bind(this);
|
|
55
42
|
this.focusTrapContainer = /*#__PURE__*/React.createRef();
|
|
43
|
+
this.debounceTimeout = null;
|
|
56
44
|
this.filterKey = 0;
|
|
45
|
+
this.valuesTablePromise = null;
|
|
57
46
|
var {
|
|
58
47
|
options
|
|
59
48
|
} = props;
|
|
60
49
|
var {
|
|
50
|
+
filterItems,
|
|
61
51
|
filterOperators,
|
|
62
52
|
invertSelection,
|
|
63
53
|
selectedValues
|
|
64
54
|
} = options;
|
|
65
|
-
var filterItems = options.filterItems.map(_ref => {
|
|
66
|
-
var {
|
|
67
|
-
selectedType,
|
|
68
|
-
value
|
|
69
|
-
} = _ref;
|
|
70
|
-
return {
|
|
71
|
-
selectedType,
|
|
72
|
-
value,
|
|
73
|
-
key: shortid()
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
55
|
|
|
77
56
|
if (filterItems == null) {
|
|
78
|
-
filterItems = [
|
|
57
|
+
filterItems = [this.makeFilterItem()];
|
|
79
58
|
}
|
|
80
59
|
|
|
81
60
|
if (filterOperators == null) {
|
|
@@ -98,7 +77,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
98
77
|
invertSelection,
|
|
99
78
|
selectedValues,
|
|
100
79
|
valuesTableError: null,
|
|
101
|
-
valuesTable:
|
|
80
|
+
valuesTable: null
|
|
102
81
|
};
|
|
103
82
|
}
|
|
104
83
|
|
|
@@ -156,20 +135,13 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
156
135
|
}
|
|
157
136
|
|
|
158
137
|
handleFocusTrapEnd() {
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
((_this$focusTrapContai = this.focusTrapContainer) === null || _this$focusTrapContai === void 0 ? void 0 : (_this$focusTrapContai2 = _this$focusTrapContai.current) === null || _this$focusTrapContai2 === void 0 ? void 0 : _this$focusTrapContai2.querySelector('button,select,input,textarea')).focus();
|
|
138
|
+
var inputs = this.focusTrapContainer.current.querySelectorAll('button,select,input,textarea');
|
|
139
|
+
inputs[0].focus();
|
|
162
140
|
}
|
|
163
141
|
|
|
164
142
|
handleFocusTrapStart() {
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
var inputs = (_this$focusTrapContai3 = this.focusTrapContainer) === null || _this$focusTrapContai3 === void 0 ? void 0 : (_this$focusTrapContai4 = _this$focusTrapContai3.current) === null || _this$focusTrapContai4 === void 0 ? void 0 : _this$focusTrapContai4.querySelectorAll('button,select,input,textarea');
|
|
168
|
-
|
|
169
|
-
if (inputs && inputs.length > 0) {
|
|
170
|
-
var element = inputs[inputs.length - 1];
|
|
171
|
-
element.focus();
|
|
172
|
-
}
|
|
143
|
+
var inputs = this.focusTrapContainer.current.querySelectorAll('button,select,input,textarea');
|
|
144
|
+
inputs[inputs.length - 1].focus();
|
|
173
145
|
}
|
|
174
146
|
|
|
175
147
|
handleAddAnd() {
|
|
@@ -177,7 +149,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
177
149
|
filterItems,
|
|
178
150
|
filterOperators
|
|
179
151
|
} = this.state;
|
|
180
|
-
filterItems = filterItems.concat(
|
|
152
|
+
filterItems = filterItems.concat(this.makeFilterItem());
|
|
181
153
|
filterOperators = filterOperators.concat(FilterOperator.and);
|
|
182
154
|
this.setState({
|
|
183
155
|
filterItems,
|
|
@@ -190,7 +162,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
190
162
|
filterItems,
|
|
191
163
|
filterOperators
|
|
192
164
|
} = this.state;
|
|
193
|
-
filterItems = filterItems.concat(
|
|
165
|
+
filterItems = filterItems.concat(this.makeFilterItem());
|
|
194
166
|
filterOperators = filterOperators.concat(FilterOperator.or);
|
|
195
167
|
this.setState({
|
|
196
168
|
filterItems,
|
|
@@ -199,18 +171,14 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
199
171
|
}
|
|
200
172
|
|
|
201
173
|
handleChangeFilterOperator(event) {
|
|
202
|
-
var
|
|
174
|
+
var index = parseInt(event.target.dataset.index, 10);
|
|
203
175
|
var {
|
|
204
|
-
operator
|
|
205
|
-
|
|
206
|
-
} = target.dataset;
|
|
207
|
-
assertNotNull(strIndex);
|
|
208
|
-
var index = parseInt(strIndex, 10);
|
|
176
|
+
operator
|
|
177
|
+
} = event.target.dataset;
|
|
209
178
|
var {
|
|
210
179
|
filterOperators
|
|
211
180
|
} = this.state;
|
|
212
|
-
filterOperators = [
|
|
213
|
-
assertFilterOperatorValue(operator);
|
|
181
|
+
filterOperators = [].concat(filterOperators);
|
|
214
182
|
filterOperators[index] = operator;
|
|
215
183
|
this.setState({
|
|
216
184
|
filterOperators
|
|
@@ -222,7 +190,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
222
190
|
var {
|
|
223
191
|
filterItems
|
|
224
192
|
} = this.state;
|
|
225
|
-
filterItems = [
|
|
193
|
+
filterItems = [].concat(filterItems);
|
|
226
194
|
var {
|
|
227
195
|
key
|
|
228
196
|
} = filterItems[filterIndex];
|
|
@@ -242,8 +210,8 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
242
210
|
filterItems,
|
|
243
211
|
filterOperators
|
|
244
212
|
} = this.state;
|
|
245
|
-
filterItems = [
|
|
246
|
-
filterOperators = [
|
|
213
|
+
filterItems = [].concat(filterItems);
|
|
214
|
+
filterOperators = [].concat(filterOperators);
|
|
247
215
|
|
|
248
216
|
if (filterIndex < filterItems.length) {
|
|
249
217
|
filterItems.splice(filterIndex, 1);
|
|
@@ -257,7 +225,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
257
225
|
}
|
|
258
226
|
|
|
259
227
|
if (filterItems.length === 0) {
|
|
260
|
-
filterItems.push(
|
|
228
|
+
filterItems.push(this.makeFilterItem());
|
|
261
229
|
}
|
|
262
230
|
|
|
263
231
|
this.setState({
|
|
@@ -278,7 +246,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
278
246
|
handleReset() {
|
|
279
247
|
log.debug('Resetting Advanced Filter');
|
|
280
248
|
this.setState({
|
|
281
|
-
filterItems: [
|
|
249
|
+
filterItems: [this.makeFilterItem()],
|
|
282
250
|
filterOperators: [],
|
|
283
251
|
selectedValues: [],
|
|
284
252
|
invertSelection: true
|
|
@@ -315,9 +283,24 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
315
283
|
}
|
|
316
284
|
|
|
317
285
|
handleUpdateTimeout() {
|
|
318
|
-
this.debounceTimeout =
|
|
286
|
+
this.debounceTimeout = null;
|
|
319
287
|
this.sendUpdate();
|
|
320
288
|
}
|
|
289
|
+
|
|
290
|
+
makeFilterItem() {
|
|
291
|
+
var updateKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
292
|
+
var key = this.filterKey;
|
|
293
|
+
|
|
294
|
+
if (updateKey) {
|
|
295
|
+
this.filterKey += 1;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return {
|
|
299
|
+
selectedType: '',
|
|
300
|
+
value: '',
|
|
301
|
+
key
|
|
302
|
+
};
|
|
303
|
+
}
|
|
321
304
|
/**
|
|
322
305
|
* Convenience function to check if the previous filter has been inputted, and
|
|
323
306
|
* we should show the add filter buttons (+ AND OR)
|
|
@@ -343,8 +326,8 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
343
326
|
}
|
|
344
327
|
/**
|
|
345
328
|
* Sorts the table in the specified direction. If already sorted in that direction, remove it.
|
|
346
|
-
* @param direction The sort direction, ASC or DESC
|
|
347
|
-
* @param addToExisting Add to the existing sort, or replace the existing table sort
|
|
329
|
+
* @param {String} direction The sort direction, ASC or DESC
|
|
330
|
+
* @param {boolean} addToExisting Add to the existing sort, or replace the existing table sort
|
|
348
331
|
*/
|
|
349
332
|
|
|
350
333
|
|
|
@@ -363,9 +346,9 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
363
346
|
}
|
|
364
347
|
|
|
365
348
|
stopUpdateTimer() {
|
|
366
|
-
if (this.debounceTimeout
|
|
349
|
+
if (this.debounceTimeout) {
|
|
367
350
|
clearTimeout(this.debounceTimeout);
|
|
368
|
-
this.debounceTimeout =
|
|
351
|
+
this.debounceTimeout = null;
|
|
369
352
|
}
|
|
370
353
|
}
|
|
371
354
|
|
|
@@ -385,13 +368,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
385
368
|
formatter
|
|
386
369
|
} = model;
|
|
387
370
|
var options = {
|
|
388
|
-
filterItems
|
|
389
|
-
var {
|
|
390
|
-
selectedType,
|
|
391
|
-
value
|
|
392
|
-
} = _ref2;
|
|
393
|
-
return selectedType != null && value != null;
|
|
394
|
-
}),
|
|
371
|
+
filterItems,
|
|
395
372
|
filterOperators,
|
|
396
373
|
invertSelection,
|
|
397
374
|
selectedValues
|
|
@@ -429,8 +406,8 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
429
406
|
var filterItem = filterItems[i];
|
|
430
407
|
var {
|
|
431
408
|
key,
|
|
432
|
-
selectedType
|
|
433
|
-
value
|
|
409
|
+
selectedType,
|
|
410
|
+
value
|
|
434
411
|
} = filterItem;
|
|
435
412
|
var element = /*#__PURE__*/React.createElement(AdvancedFilterCreatorFilterItem, {
|
|
436
413
|
key: key,
|
|
@@ -438,8 +415,8 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
438
415
|
filterTypes: filterTypes,
|
|
439
416
|
onChange: this.getFilterChangeHandler(i),
|
|
440
417
|
onDelete: this.getFilterDeleteHandler(i),
|
|
441
|
-
selectedType:
|
|
442
|
-
value:
|
|
418
|
+
selectedType: selectedType,
|
|
419
|
+
value: value
|
|
443
420
|
});
|
|
444
421
|
filterItemElements.push(element);
|
|
445
422
|
|
|
@@ -497,7 +474,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
497
474
|
className: "advanced-filter-creator",
|
|
498
475
|
role: "presentation"
|
|
499
476
|
}, /*#__PURE__*/React.createElement("div", {
|
|
500
|
-
tabIndex: 0,
|
|
477
|
+
tabIndex: "0",
|
|
501
478
|
onFocus: this.handleFocusTrapStart
|
|
502
479
|
}), /*#__PURE__*/React.createElement("form", {
|
|
503
480
|
onSubmit: this.handleSubmit,
|
|
@@ -529,7 +506,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
529
506
|
className: "advanced-filter-column-name"
|
|
530
507
|
}, column.name, "\xA0", /*#__PURE__*/React.createElement("span", {
|
|
531
508
|
className: "column-type"
|
|
532
|
-
}, "(", columnType, ")")), filterItemElements, isValuesTableAvailable && !valuesTableError && /*#__PURE__*/React.createElement(React.Fragment, null, !isBoolean && /*#__PURE__*/React.createElement("hr", null),
|
|
509
|
+
}, "(", columnType, ")")), filterItemElements, isValuesTableAvailable && !valuesTableError && /*#__PURE__*/React.createElement(React.Fragment, null, !isBoolean && /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement("div", {
|
|
533
510
|
className: "form-group"
|
|
534
511
|
}, /*#__PURE__*/React.createElement(AdvancedFilterCreatorSelectValue, {
|
|
535
512
|
table: valuesTable,
|
|
@@ -550,7 +527,7 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
550
527
|
className: "btn btn-primary",
|
|
551
528
|
onClick: this.handleDone
|
|
552
529
|
}, "Done"))), /*#__PURE__*/React.createElement("div", {
|
|
553
|
-
tabIndex: 0,
|
|
530
|
+
tabIndex: "0",
|
|
554
531
|
onFocus: this.handleFocusTrapEnd
|
|
555
532
|
}));
|
|
556
533
|
}
|
|
@@ -559,7 +536,25 @@ class AdvancedFilterCreator extends PureComponent {
|
|
|
559
536
|
|
|
560
537
|
_defineProperty(AdvancedFilterCreator, "debounceFilterUpdate", 250);
|
|
561
538
|
|
|
562
|
-
|
|
539
|
+
AdvancedFilterCreator.propTypes = {
|
|
540
|
+
model: PropTypes.instanceOf(IrisGridModel).isRequired,
|
|
541
|
+
column: PropTypes.shape({
|
|
542
|
+
name: PropTypes.string,
|
|
543
|
+
type: PropTypes.string
|
|
544
|
+
}).isRequired,
|
|
545
|
+
onFilterChange: PropTypes.func.isRequired,
|
|
546
|
+
onSortChange: PropTypes.func.isRequired,
|
|
547
|
+
onDone: PropTypes.func.isRequired,
|
|
548
|
+
options: PropTypes.shape({
|
|
549
|
+
filterItems: PropTypes.arrayOf(PropTypes.shape({})),
|
|
550
|
+
filterOperators: PropTypes.arrayOf(PropTypes.shape({})),
|
|
551
|
+
invertSelection: PropTypes.bool,
|
|
552
|
+
selectedValues: PropTypes.arrayOf(PropTypes.any)
|
|
553
|
+
}),
|
|
554
|
+
sortDirection: PropTypes.string,
|
|
555
|
+
formatter: PropTypes.instanceOf(Formatter).isRequired
|
|
556
|
+
};
|
|
557
|
+
AdvancedFilterCreator.defaultProps = {
|
|
563
558
|
options: {
|
|
564
559
|
filterItems: null,
|
|
565
560
|
filterOperators: null,
|
|
@@ -567,7 +562,6 @@ _defineProperty(AdvancedFilterCreator, "defaultProps", {
|
|
|
567
562
|
selectedValues: []
|
|
568
563
|
},
|
|
569
564
|
sortDirection: null
|
|
570
|
-
}
|
|
571
|
-
|
|
565
|
+
};
|
|
572
566
|
export default AdvancedFilterCreator;
|
|
573
567
|
//# sourceMappingURL=AdvancedFilterCreator.js.map
|