@adaptabletools/adaptable 10.0.1 → 10.0.4-canary.1
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/base.css +68 -26
- package/index.css +80 -28
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/NotificationsOptions.d.ts +3 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +107 -5
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +39 -0
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/Events/AdaptableReady.d.ts +2 -6
- package/src/Api/Events/AdaptableStateChanged.d.ts +2 -1
- package/src/Api/Events/AlertFired.d.ts +2 -1
- package/src/Api/Events/BaseEventInfo.d.ts +10 -0
- package/src/{Utilities/Interface/ProgressIndicator.js → Api/Events/BaseEventInfo.js} +0 -0
- package/src/Api/Events/CellChanged.d.ts +2 -1
- package/src/Api/Events/ChexboxColumnClicked.d.ts +2 -1
- package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -1
- package/src/Api/Events/DashboardChanged.d.ts +2 -1
- package/src/Api/Events/FlashingAlertFired.d.ts +2 -1
- package/src/Api/Events/GridDataChanged.d.ts +2 -1
- package/src/Api/Events/LayoutChanged.d.ts +2 -1
- package/src/Api/Events/LiveDataChanged.d.ts +2 -1
- package/src/Api/Events/SearchChanged.d.ts +2 -1
- package/src/Api/Events/SelectionChanged.d.ts +2 -1
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -1
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -1
- package/src/Api/Events/ThemeChanged.d.ts +2 -1
- package/src/Api/GridApi.d.ts +34 -8
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +22 -15
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +8 -0
- package/src/Api/Implementation/ColumnApiImpl.js +69 -36
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -17
- package/src/Api/Implementation/DashboardApiImpl.js +2 -1
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +28 -10
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
- package/src/Api/Implementation/InternalApiImpl.js +20 -4
- package/src/Api/Implementation/LayoutApiImpl.js +4 -3
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -0
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +1 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +12 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +69 -87
- package/src/Api/InternalApi.d.ts +3 -1
- package/src/Api/UserInterfaceApi.d.ts +16 -6
- package/src/PredefinedConfig/AlertState.d.ts +4 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +33 -33
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +19 -18
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +3 -2
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/PredefinedConfig/Common/SpecialColumnSettings.js +2 -0
- package/src/PredefinedConfig/FilterState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +7 -3
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.js +12 -11
- package/src/Strategy/BulkUpdateModule.js +5 -5
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +59 -62
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +5 -5
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +3 -3
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.js +6 -6
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
- package/src/Utilities/Helpers/DateHelper.js +30 -20
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +14 -2
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/ReportService.js +13 -12
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
- package/src/Utilities/runIfNotResolvedIn.js +23 -0
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +6 -4
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +53 -32
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
- package/src/View/Components/FilterForm/QuickFilterForm.js +72 -31
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +47 -15
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +7 -7
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +2 -2
- package/src/View/CustomSort/CustomSortPopup.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/Dashboard/CustomToolbarWrapper.js +2 -1
- package/src/View/Dashboard/Dashboard.js +2 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +5 -5
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
- package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +4 -2
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +5 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +2 -2
- package/src/View/UIHelper.d.ts +2 -0
- package/src/View/UIHelper.js +10 -1
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
- package/src/agGrid/ActionColumnRenderer.js +21 -4
- package/src/agGrid/Adaptable.d.ts +20 -4
- package/src/agGrid/Adaptable.js +249 -102
- package/src/agGrid/agGridHelper.js +33 -32
- package/src/agGrid/agGridMenuHelper.js +2 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/components/Loader/Loader.d.ts +7 -0
- package/src/components/Loader/Loader.js +13 -0
- package/src/components/Loader/index.d.ts +2 -0
- package/src/components/Loader/index.js +7 -0
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
- package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
- package/src/metamodel/adaptable.metamodel.d.ts +125 -16
- package/src/metamodel/adaptable.metamodel.js +403 -106
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
|
@@ -1,63 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Redux from 'redux';
|
|
3
|
-
import * as FilterRedux from '../../../Redux/ActionsReducers/FilterRedux';
|
|
4
|
-
import * as PopupRedux from '../../../Redux/ActionsReducers/PopupRedux';
|
|
5
|
-
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
1
|
+
/// <reference types="react" />
|
|
6
2
|
import { ColumnFilterContext } from '../../../Utilities/Interface/ColumnFilterContext';
|
|
7
3
|
import { ColumnMenuTab } from '../../../PredefinedConfig/Common/Enums';
|
|
8
|
-
import { ModuleViewPopupProps } from '../SharedProps/ModuleViewPopupProps';
|
|
9
|
-
import { UIPrompt } from '../../../Utilities/Interface/MessagePopups';
|
|
10
|
-
import { AdaptableMenuItem } from '../../../PredefinedConfig/Common/Menu';
|
|
11
4
|
import { ColumnFilter } from '../../../PredefinedConfig/FilterState';
|
|
12
|
-
import { AdaptablePredicateDef } from '../../../PredefinedConfig/Common/AdaptablePredicate';
|
|
13
|
-
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
14
|
-
interface FilterFormProps extends ModuleViewPopupProps<FilterFormComponent> {
|
|
15
|
-
currentColumn: AdaptableColumn;
|
|
16
|
-
api: AdaptableApi;
|
|
17
|
-
columns: AdaptableColumn[];
|
|
18
|
-
columnFilters: ColumnFilter[];
|
|
19
|
-
embedColumnMenu: boolean;
|
|
20
|
-
showCloseButton: boolean;
|
|
21
|
-
onClearColumnFilter: (columnfilter: ColumnFilter) => FilterRedux.ColumnFilterClearAction;
|
|
22
|
-
onAddColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterAddAction;
|
|
23
|
-
onEditColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterEditAction;
|
|
24
|
-
onSetColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterSetAction;
|
|
25
|
-
onHideFilterForm: () => FilterRedux.FilterFormHideAction;
|
|
26
|
-
onMenuItemClick: (action: Redux.Action) => Redux.Action;
|
|
27
|
-
onShowPrompt: (prompt: UIPrompt) => PopupRedux.PopupShowPromptAction;
|
|
28
|
-
}
|
|
29
5
|
export interface FilterFormState {
|
|
30
6
|
columnFilters: ColumnFilter[];
|
|
31
7
|
distinctColumnValues: any[];
|
|
8
|
+
isDistinctColumnValuesLoading: boolean;
|
|
32
9
|
showTab: boolean;
|
|
33
10
|
selectedTab: ColumnMenuTab;
|
|
34
11
|
editedColumnFilter: ColumnFilter | undefined;
|
|
35
12
|
currentTab: 'values' | 'predicates';
|
|
13
|
+
suppressClientSideFilter: boolean;
|
|
36
14
|
}
|
|
37
|
-
declare class FilterFormComponent extends React.Component<FilterFormProps, FilterFormState> {
|
|
38
|
-
static createColumnFilterFromProps(props: FilterFormProps): ColumnFilter;
|
|
39
|
-
static getCurrentTab(editedColumnFilter: ColumnFilter | undefined): 'values' | 'predicates';
|
|
40
|
-
static getDerivedStateFromProps(props: FilterFormProps, state: FilterFormState): {
|
|
41
|
-
editedColumnFilter: ColumnFilter;
|
|
42
|
-
columnFilters: ColumnFilter[];
|
|
43
|
-
currentTab: "values" | "predicates";
|
|
44
|
-
};
|
|
45
|
-
constructor(props: FilterFormProps);
|
|
46
|
-
componentDidMount(): void;
|
|
47
|
-
render(): any;
|
|
48
|
-
private renderColumnPredicate;
|
|
49
|
-
renderPredicateInput(predicateDef: AdaptablePredicateDef, filter: ColumnFilter): JSX.Element | JSX.Element[];
|
|
50
|
-
isFilterable(): string;
|
|
51
|
-
onSelectTab(tab: any): any;
|
|
52
|
-
onColumnValuesChange(columnValues: any[]): void;
|
|
53
|
-
persistFilter(): void;
|
|
54
|
-
onClearFilter(): void;
|
|
55
|
-
onFilterApplied(): void;
|
|
56
|
-
onCloseForm(): void;
|
|
57
|
-
onMenuItemClick(menuItem: AdaptableMenuItem): any;
|
|
58
|
-
selectColumnPredicate(predicateDef: AdaptablePredicateDef): void;
|
|
59
|
-
changeColumnPredicateInput(value: string, index: number): void;
|
|
60
|
-
}
|
|
61
|
-
export declare let FilterForm: import("react-redux").ConnectedComponent<typeof FilterFormComponent, any>;
|
|
62
15
|
export declare const FilterFormReact: (FilterContext: ColumnFilterContext) => JSX.Element;
|
|
63
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FilterFormReact =
|
|
3
|
+
exports.FilterFormReact = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
@@ -18,34 +18,56 @@ const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlo
|
|
|
18
18
|
const rebass_1 = require("rebass");
|
|
19
19
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
20
20
|
const Helper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/Helper"));
|
|
21
|
-
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/ArrayExtensions"));
|
|
22
21
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
|
|
23
22
|
const renderWithAdaptableContext_1 = require("../../renderWithAdaptableContext");
|
|
24
23
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
24
|
+
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
25
|
+
const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
|
|
25
26
|
const panelStyle = {
|
|
26
27
|
width: '100%',
|
|
27
28
|
minWidth: 150,
|
|
28
29
|
};
|
|
29
30
|
class FilterFormComponent extends React.Component {
|
|
31
|
+
constructor(props) {
|
|
32
|
+
super(props);
|
|
33
|
+
this._isMounted = false;
|
|
34
|
+
this.handleFilterChange = (filter) => {
|
|
35
|
+
if (this.state.suppressClientSideFilter) {
|
|
36
|
+
this.loadPermittedValues(filter);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this._isMounted = true;
|
|
40
|
+
const existingColumnFilter = FilterFormComponent.createColumnFilterFromProps(this.props);
|
|
41
|
+
this.state = {
|
|
42
|
+
columnFilters: props.columnFilters,
|
|
43
|
+
distinctColumnValues: [],
|
|
44
|
+
isDistinctColumnValuesLoading: false,
|
|
45
|
+
showTab: true,
|
|
46
|
+
selectedTab: Enums_1.ColumnMenuTab.Filter,
|
|
47
|
+
editedColumnFilter: existingColumnFilter,
|
|
48
|
+
currentTab: FilterFormComponent.getCurrentTab(existingColumnFilter),
|
|
49
|
+
suppressClientSideFilter: false,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
30
52
|
static createColumnFilterFromProps(props) {
|
|
31
|
-
let existingColumnFilter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.
|
|
53
|
+
let existingColumnFilter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.columnId);
|
|
32
54
|
if (!existingColumnFilter) {
|
|
33
55
|
const filterOptions = props.api.internalApi.getAdaptableOptions()
|
|
34
56
|
.filterOptions;
|
|
35
57
|
if (filterOptions.defaultFilterFormTab == 'Values') {
|
|
36
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
58
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, 'Values', []);
|
|
37
59
|
}
|
|
38
|
-
if (props.currentColumn.
|
|
39
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
60
|
+
if (props.currentColumn.dataType === 'Number') {
|
|
61
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultNumericColumnFilter), ['']);
|
|
40
62
|
}
|
|
41
|
-
if (props.currentColumn.
|
|
42
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
63
|
+
if (props.currentColumn.dataType === 'String') {
|
|
64
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultStringColumnFilter), ['']);
|
|
43
65
|
}
|
|
44
|
-
if (props.currentColumn.
|
|
45
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
66
|
+
if (props.currentColumn.dataType === 'Date') {
|
|
67
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultDateColumnFilter), ['']);
|
|
46
68
|
}
|
|
47
|
-
if (props.currentColumn.
|
|
48
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
69
|
+
if (props.currentColumn.dataType === 'Boolean') {
|
|
70
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, 'BooleanToggle', [
|
|
49
71
|
'all',
|
|
50
72
|
]);
|
|
51
73
|
}
|
|
@@ -76,25 +98,24 @@ class FilterFormComponent extends React.Component {
|
|
|
76
98
|
: state.currentTab,
|
|
77
99
|
};
|
|
78
100
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let existingColumnFilter = FilterFormComponent.createColumnFilterFromProps(this.props);
|
|
82
|
-
this.state = {
|
|
83
|
-
columnFilters: props.columnFilters,
|
|
84
|
-
distinctColumnValues: [],
|
|
85
|
-
showTab: false,
|
|
86
|
-
selectedTab: Enums_1.ColumnMenuTab.Filter,
|
|
87
|
-
editedColumnFilter: existingColumnFilter,
|
|
88
|
-
currentTab: FilterFormComponent.getCurrentTab(existingColumnFilter),
|
|
89
|
-
};
|
|
101
|
+
componentWillUnmount() {
|
|
102
|
+
this._isMounted = false;
|
|
90
103
|
}
|
|
91
104
|
componentDidMount() {
|
|
92
|
-
if (this.props.currentColumn.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
if (this.props.currentColumn.dataType != Enums_1.DataType.Boolean) {
|
|
106
|
+
this.loadPermittedValues();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async loadPermittedValues(filter = '') {
|
|
110
|
+
const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
|
|
111
|
+
if (!this._isMounted) {
|
|
112
|
+
return;
|
|
97
113
|
}
|
|
114
|
+
this.setState({
|
|
115
|
+
distinctColumnValues,
|
|
116
|
+
isDistinctColumnValuesLoading: false,
|
|
117
|
+
suppressClientSideFilter,
|
|
118
|
+
});
|
|
98
119
|
}
|
|
99
120
|
render() {
|
|
100
121
|
var _a, _b;
|
|
@@ -120,7 +141,7 @@ class FilterFormComponent extends React.Component {
|
|
|
120
141
|
React.createElement(Radio_1.default, { marginLeft: 2, flex: 1, checked: this.state.currentTab == 'predicates', onChange: () => this.setState({ currentTab: 'predicates' }) },
|
|
121
142
|
React.createElement(rebass_1.Flex, { fontSize: 'var( --ab-font-size-2)' }, "Filters")))),
|
|
122
143
|
this.state.currentTab === 'values' && (React.createElement("div", null,
|
|
123
|
-
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { currentColumn: this.props.currentColumn, columns: this.props.columns, columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.
|
|
144
|
+
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: this.props.columns, columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.dataType, uiSelectedColumnValues: uiSelectedColumnValues, useVendorStyle: useVendorStyle, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) }))),
|
|
124
145
|
this.state.currentTab === 'predicates' && (React.createElement("div", null,
|
|
125
146
|
' ',
|
|
126
147
|
this.state.showTab && React.createElement("hr", null),
|
|
@@ -164,7 +185,7 @@ class FilterFormComponent extends React.Component {
|
|
|
164
185
|
} }))));
|
|
165
186
|
}
|
|
166
187
|
isFilterable() {
|
|
167
|
-
if (!this.props.currentColumn.
|
|
188
|
+
if (!this.props.currentColumn.filterable) {
|
|
168
189
|
return 'Column is not filterable';
|
|
169
190
|
}
|
|
170
191
|
return '';
|
|
@@ -258,5 +279,5 @@ function mapDispatchToProps(dispatch) {
|
|
|
258
279
|
onHideFilterForm: () => dispatch(FilterRedux.FilterFormHide()),
|
|
259
280
|
};
|
|
260
281
|
}
|
|
261
|
-
|
|
262
|
-
exports.FilterFormReact = (FilterContext) => renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(
|
|
282
|
+
const FilterForm = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(FilterFormComponent);
|
|
283
|
+
exports.FilterFormReact = (FilterContext) => renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(FilterForm, { api: FilterContext.Adaptable.api, currentColumn: FilterContext.Column, teamSharingActivated: false, embedColumnMenu: FilterContext.Adaptable.embedColumnMenu, showCloseButton: FilterContext.ShowCloseButton }), FilterContext.Adaptable);
|
|
@@ -9,6 +9,9 @@ export interface ListBoxFilterFormProps extends ListGroupProps {
|
|
|
9
9
|
uiSelectedColumnValues: Array<string>;
|
|
10
10
|
onColumnValueSelectedChange: (SelectedValues: Array<any>) => void;
|
|
11
11
|
dataType: 'String' | 'Number' | 'NumberArray' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
suppressClientSideFilter?: boolean;
|
|
14
|
+
onFilterChange?: (filter: string) => void;
|
|
12
15
|
}
|
|
13
16
|
export interface ListBoxFilterFormState extends React.ClassAttributes<any> {
|
|
14
17
|
UiSelectedColumnValues: Array<string>;
|
|
@@ -11,8 +11,13 @@ const join_1 = tslib_1.__importDefault(require("../../../components/utils/join")
|
|
|
11
11
|
const AdaptableFormControlTextClear_1 = require("../Forms/AdaptableFormControlTextClear");
|
|
12
12
|
const GridList_1 = tslib_1.__importDefault(require("../../../components/List/GridList"));
|
|
13
13
|
const react_1 = require("react");
|
|
14
|
+
const Loader_1 = require("../../../components/Loader");
|
|
14
15
|
exports.ListBoxFilterForm = (props) => {
|
|
15
16
|
const [FilterValue, setFilterValue] = react_1.useState('');
|
|
17
|
+
const handleFilterValueChange = React.useCallback((newValue) => {
|
|
18
|
+
setFilterValue(newValue);
|
|
19
|
+
props === null || props === void 0 ? void 0 : props.onFilterChange(newValue);
|
|
20
|
+
}, [props.onFilterChange]);
|
|
16
21
|
const [UiSelectedColumnValues, internalUpdateUISelectedColumnValues] = react_1.useState(props.uiSelectedColumnValues);
|
|
17
22
|
const setUiSelectedColumnValues = (values) => {
|
|
18
23
|
internalUpdateUISelectedColumnValues(values);
|
|
@@ -41,7 +46,8 @@ exports.ListBoxFilterForm = (props) => {
|
|
|
41
46
|
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(columnValue)) {
|
|
42
47
|
return null;
|
|
43
48
|
}
|
|
44
|
-
if (
|
|
49
|
+
if (!props.suppressClientSideFilter &&
|
|
50
|
+
StringExtensions_1.StringExtensions.IsNotNullOrEmpty(FilterValue) &&
|
|
45
51
|
columnValue.toLocaleLowerCase().indexOf(FilterValue.toLocaleLowerCase()) < 0) {
|
|
46
52
|
return null;
|
|
47
53
|
}
|
|
@@ -60,9 +66,12 @@ exports.ListBoxFilterForm = (props) => {
|
|
|
60
66
|
paddingBottom: 'var(--ab-space-1)',
|
|
61
67
|
paddingLeft: 'var(--ab-space-1)',
|
|
62
68
|
borderRadius: 'var(--ab__border-radius)',
|
|
63
|
-
}, OnTextChange:
|
|
64
|
-
|
|
69
|
+
}, OnTextChange: handleFilterValueChange }));
|
|
70
|
+
const baseClassName = 'ab-ListBoxFilterForm';
|
|
71
|
+
return (React.createElement("div", { className: join_1.default(baseClassName, props.useVendorStyle ? `${baseClassName}--vendor-style` : null, props.isLoading && `${baseClassName}--loading`) },
|
|
65
72
|
React.createElement(rebass_1.Box, { px: 2 },
|
|
66
|
-
React.createElement(rebass_1.Box, { mx: props.useVendorStyle ? 0 : '2px', marginBottom: 2 },
|
|
67
|
-
|
|
73
|
+
React.createElement(rebass_1.Box, { mx: props.useVendorStyle ? 0 : '2px', marginBottom: 2 },
|
|
74
|
+
textClear,
|
|
75
|
+
props.isLoading && React.createElement(Loader_1.Loader, null, "Loading"))),
|
|
76
|
+
!props.isLoading && (React.createElement(GridList_1.default, { showZebraRows: false, className: !props.useVendorStyle ? 'ab-padding-horizontal-0' : '' }, columnValuesItemsElements))));
|
|
68
77
|
};
|
|
@@ -1,50 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import * as FilterRedux from '../../../Redux/ActionsReducers/FilterRedux';
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import { ColumnFilterContext } from '../../../Utilities/Interface/ColumnFilterContext';
|
|
4
|
-
import { ModuleViewPopupProps } from '../SharedProps/ModuleViewPopupProps';
|
|
5
|
-
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
|
-
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
7
3
|
import { ColumnFilter } from '../../../PredefinedConfig/FilterState';
|
|
8
|
-
import { AdaptablePredicateDef } from '../../../PredefinedConfig/Common/AdaptablePredicate';
|
|
9
|
-
import { FilterOptions } from '../../../AdaptableOptions/FilterOptions';
|
|
10
|
-
interface QuickFilterFormProps extends ModuleViewPopupProps<QuickFilterFormComponent> {
|
|
11
|
-
api: AdaptableApi;
|
|
12
|
-
currentColumn: AdaptableColumn;
|
|
13
|
-
columnFilters: ColumnFilter[];
|
|
14
|
-
quickFilterTrigger?: FilterOptions['quickFilterTrigger'];
|
|
15
|
-
onAddColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterAddAction;
|
|
16
|
-
onEditColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterEditAction;
|
|
17
|
-
}
|
|
18
4
|
export interface QuickFilterFormState {
|
|
19
5
|
filter: ColumnFilter;
|
|
20
6
|
distinctColumnValues: any[];
|
|
7
|
+
isDistinctColumnValuesLoading: boolean;
|
|
8
|
+
suppressClientSideFilter: boolean;
|
|
21
9
|
}
|
|
22
|
-
declare class QuickFilterFormComponent extends React.Component<QuickFilterFormProps, QuickFilterFormState> {
|
|
23
|
-
private valuesDropdown?;
|
|
24
|
-
constructor(props: QuickFilterFormProps);
|
|
25
|
-
getDistinctValues: (props?: Readonly<QuickFilterFormProps> & Readonly<{
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
}>) => any[];
|
|
28
|
-
updateDistinctValues(props?: Readonly<QuickFilterFormProps> & Readonly<{
|
|
29
|
-
children?: React.ReactNode;
|
|
30
|
-
}>): void;
|
|
31
|
-
UNSAFE_componentWillReceiveProps(nextProps: QuickFilterFormProps): void;
|
|
32
|
-
getFilterFromProps(props: QuickFilterFormProps): ColumnFilter;
|
|
33
|
-
render(): any;
|
|
34
|
-
renderLabel(filter: ColumnFilter, activePredicateDef: AdaptablePredicateDef): JSX.Element;
|
|
35
|
-
renderPredicateIcon(predicateDef: AdaptablePredicateDef): JSX.Element;
|
|
36
|
-
renderPredicateInput(predicateDef: AdaptablePredicateDef, filter: ColumnFilter): JSX.Element | JSX.Element[];
|
|
37
|
-
renderNoValuesDropdown(filter: ColumnFilter): JSX.Element;
|
|
38
|
-
renderValuesDropdown(filter: ColumnFilter): JSX.Element;
|
|
39
|
-
onColumnValuesChange(columnValues: any[]): void;
|
|
40
|
-
selectColumnPredicate(predicateId: string): void;
|
|
41
|
-
debouncedAddFilter: import("lodash").DebouncedFunc<() => FilterRedux.ColumnFilterAddAction>;
|
|
42
|
-
debouncedEditFilter: import("lodash").DebouncedFunc<() => FilterRedux.ColumnFilterEditAction>;
|
|
43
|
-
private updateFilter;
|
|
44
|
-
changeColumnPredicateInput(value: string, index: number): void;
|
|
45
|
-
getPredicateIdForShortcutValue(value: string): string;
|
|
46
|
-
clearFilter(): void;
|
|
47
|
-
}
|
|
48
|
-
export declare const QuickFilterForm: import("react-redux").ConnectedComponent<typeof QuickFilterFormComponent, any>;
|
|
49
10
|
export declare const QuickFilterFormReact: (FilterContext: ColumnFilterContext) => JSX.Element;
|
|
50
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QuickFilterFormReact =
|
|
3
|
+
exports.QuickFilterFormReact = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const debounce_1 = tslib_1.__importDefault(require("lodash-es/debounce"));
|
|
@@ -16,60 +16,87 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Ex
|
|
|
16
16
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
|
|
17
17
|
const renderWithAdaptableContext_1 = require("../../renderWithAdaptableContext");
|
|
18
18
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
19
|
+
const isEqual_1 = tslib_1.__importDefault(require("lodash-es/isEqual"));
|
|
20
|
+
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
21
|
+
const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
|
|
19
22
|
class QuickFilterFormComponent extends React.Component {
|
|
20
23
|
constructor(props) {
|
|
21
24
|
super(props);
|
|
22
|
-
this.
|
|
23
|
-
|
|
25
|
+
this._isMounted = false;
|
|
26
|
+
this.handleFilterChange = (filter) => {
|
|
27
|
+
if (this.state.suppressClientSideFilter) {
|
|
28
|
+
this.loadPermittedValues(filter);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
this.loadPermittedValues = async (filter = '') => {
|
|
32
|
+
const { values, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
|
|
33
|
+
if (!this._isMounted) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.setState({
|
|
37
|
+
distinctColumnValues: values,
|
|
38
|
+
suppressClientSideFilter,
|
|
39
|
+
isDistinctColumnValuesLoading: false,
|
|
40
|
+
});
|
|
24
41
|
};
|
|
25
42
|
this.debouncedAddFilter = debounce_1.default(() => this.props.onAddColumnFilter(this.state.filter), 250);
|
|
26
43
|
this.debouncedEditFilter = debounce_1.default(() => this.props.onEditColumnFilter(this.state.filter), 250);
|
|
27
|
-
const filter = this.getFilterFromProps(
|
|
28
|
-
|
|
44
|
+
const filter = this.getFilterFromProps();
|
|
45
|
+
this._isMounted = true;
|
|
29
46
|
this.state = {
|
|
30
47
|
filter,
|
|
31
|
-
|
|
48
|
+
suppressClientSideFilter: false,
|
|
49
|
+
isDistinctColumnValuesLoading: false,
|
|
50
|
+
distinctColumnValues: [],
|
|
32
51
|
};
|
|
33
52
|
}
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
componentDidMount() {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
if (((_b = (_a = this.state) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.Predicate.PredicateId) === 'Values') {
|
|
56
|
+
this.loadPermittedValues();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
componentWillUnmount() {
|
|
60
|
+
this._isMounted = false;
|
|
36
61
|
}
|
|
37
62
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
38
63
|
const filter = this.getFilterFromProps(nextProps);
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
}
|
|
64
|
+
if (isEqual_1.default(filter, this.state.filter)) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.setState({ filter });
|
|
42
68
|
if ((filter === null || filter === void 0 ? void 0 : filter.Predicate) && filter.Predicate.PredicateId === 'Values') {
|
|
43
|
-
this.
|
|
69
|
+
this.setState({ isDistinctColumnValuesLoading: true });
|
|
70
|
+
this.loadPermittedValues();
|
|
44
71
|
}
|
|
45
72
|
}
|
|
46
|
-
getFilterFromProps(props) {
|
|
47
|
-
const filter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.
|
|
73
|
+
getFilterFromProps(props = this.props) {
|
|
74
|
+
const filter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.columnId);
|
|
48
75
|
const filterOptions = props.api.internalApi.getAdaptableOptions().filterOptions;
|
|
49
76
|
if (filter) {
|
|
50
77
|
return filter;
|
|
51
78
|
}
|
|
52
|
-
if (!filter && props.currentColumn.
|
|
53
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(
|
|
79
|
+
if (!filter && props.currentColumn.dataType === 'Number') {
|
|
80
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultNumericColumnFilter), ['']);
|
|
54
81
|
}
|
|
55
|
-
if (!filter && props.currentColumn.
|
|
56
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(
|
|
82
|
+
if (!filter && props.currentColumn.dataType === 'String') {
|
|
83
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultStringColumnFilter), ['']);
|
|
57
84
|
}
|
|
58
|
-
if (!filter && props.currentColumn.
|
|
59
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(
|
|
85
|
+
if (!filter && props.currentColumn.dataType === 'Date') {
|
|
86
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultDateColumnFilter), ['']);
|
|
60
87
|
}
|
|
61
|
-
if (!filter && props.currentColumn.
|
|
62
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(this.props.currentColumn.
|
|
88
|
+
if (!filter && props.currentColumn.dataType === 'Boolean') {
|
|
89
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(this.props.currentColumn.columnId, 'BooleanToggle', [
|
|
63
90
|
'all',
|
|
64
91
|
]);
|
|
65
92
|
}
|
|
66
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(this.props.currentColumn.
|
|
93
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(this.props.currentColumn.columnId, null, null);
|
|
67
94
|
}
|
|
68
95
|
render() {
|
|
69
96
|
const { filter } = this.state;
|
|
70
97
|
const predicateDefs = this.props.api.filterApi.getFilterPredicateDefsForColumn(this.props.currentColumn);
|
|
71
98
|
const activePredicateDef = this.props.api.predicateApi.getPredicateDefById(filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId);
|
|
72
|
-
if (!this.props.currentColumn || !this.props.currentColumn.
|
|
99
|
+
if (!this.props.currentColumn || !this.props.currentColumn.filterable) {
|
|
73
100
|
return null;
|
|
74
101
|
}
|
|
75
102
|
let showEvent = 'mouseenter';
|
|
@@ -179,11 +206,25 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
179
206
|
} }, 'No Column Values'));
|
|
180
207
|
}
|
|
181
208
|
renderValuesDropdown(filter) {
|
|
182
|
-
|
|
209
|
+
let showEvent = 'mouseenter';
|
|
210
|
+
if (this.props.quickFilterValuesTrigger === 'click') {
|
|
211
|
+
showEvent = 'click';
|
|
212
|
+
}
|
|
213
|
+
return (React.createElement(OverlayTrigger_1.default, { alignHorizontal: "left", showEvent: showEvent,
|
|
214
|
+
// cannot hide on blur, because the form input receives the input when this is opened
|
|
215
|
+
hideEvent: "mouseleave", hideDelay: 300, ref: (api) => {
|
|
183
216
|
this.valuesDropdown = api;
|
|
184
217
|
}, render: () => {
|
|
185
218
|
var _a;
|
|
186
|
-
return (React.createElement(rebass_1.Flex, {
|
|
219
|
+
return (React.createElement(rebass_1.Flex, { onMouseEnter: () => {
|
|
220
|
+
var _a;
|
|
221
|
+
if (showEvent === 'click') {
|
|
222
|
+
// For showEvent=mouseneter this is not needed.
|
|
223
|
+
// When mouseenter is triggered on the overlay, onShowFn is called, the overlay is no longer hidden.
|
|
224
|
+
// But in this case because the trigger is click, another show is not triggered.
|
|
225
|
+
(_a = this.valuesDropdown) === null || _a === void 0 ? void 0 : _a.show();
|
|
226
|
+
}
|
|
227
|
+
}, "data-name": "quick-filter-form", flexDirection: "column", style: {
|
|
187
228
|
fontSize: 'var(--ab-font-size-2)',
|
|
188
229
|
border: '1px solid var(--ab-color-primarydark)',
|
|
189
230
|
background: 'var(--ab-color-defaultbackground)',
|
|
@@ -193,7 +234,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
193
234
|
React.createElement(SimpleButton_1.default, { onClick: () => this.clearFilter() }, "Clear Filter"),
|
|
194
235
|
((_a = this.props.api.internalApi.getAdaptableOptions().filterOptions) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) ==
|
|
195
236
|
false && (React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => this.updateFilter(this.state.filter) }, "Apply Filter"))),
|
|
196
|
-
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { currentColumn: this.props.currentColumn, columns: [], columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.
|
|
237
|
+
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: [], columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.dataType, uiSelectedColumnValues: this.state.filter.Predicate.Inputs, useVendorStyle: true, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) })));
|
|
197
238
|
} },
|
|
198
239
|
React.createElement(SimpleButton_1.default, { style: {
|
|
199
240
|
flex: 1,
|
|
@@ -226,7 +267,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
226
267
|
};
|
|
227
268
|
this.updateFilter(filter);
|
|
228
269
|
if (predicateId === 'Values') {
|
|
229
|
-
this.
|
|
270
|
+
this.loadPermittedValues();
|
|
230
271
|
requestAnimationFrame(() => {
|
|
231
272
|
if (this.valuesDropdown) {
|
|
232
273
|
this.valuesDropdown.show();
|
|
@@ -276,8 +317,8 @@ function mapDispatchToProps(dispatch) {
|
|
|
276
317
|
onEditColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterEdit(columnFilter)),
|
|
277
318
|
};
|
|
278
319
|
}
|
|
279
|
-
|
|
320
|
+
const QuickFilterForm = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(QuickFilterFormComponent);
|
|
280
321
|
exports.QuickFilterFormReact = (FilterContext) => {
|
|
281
|
-
var _a;
|
|
282
|
-
return renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(
|
|
322
|
+
var _a, _b;
|
|
323
|
+
return renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(QuickFilterForm, { api: FilterContext.Adaptable.api, quickFilterTrigger: (_a = FilterContext.Adaptable.adaptableOptions.filterOptions) === null || _a === void 0 ? void 0 : _a.quickFilterTrigger, quickFilterValuesTrigger: (_b = FilterContext.Adaptable.adaptableOptions.filterOptions) === null || _b === void 0 ? void 0 : _b.quickFilterValuesTrigger, currentColumn: FilterContext.Column, teamSharingActivated: false, embedColumnMenu: FilterContext.Adaptable.embedColumnMenu }), FilterContext.Adaptable);
|
|
283
324
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
2
|
+
import { SystemFilterPredicateId } from '../../../PredefinedConfig/FilterState';
|
|
3
|
+
export declare const getDefaultColumnFilterPredicate: (column: AdaptableColumn, defaultColumnFilter: "After" | "Before" | "Blanks" | "NonBlanks" | "Equals" | "NotEquals" | "GreaterThan" | "LessThan" | "Positive" | "Negative" | "Zero" | "Between" | "NotBetween" | "Is" | "IsNot" | "Contains" | "NotContains" | "StartsWith" | "EndsWith" | "Regex" | "Today" | "Yesterday" | "Tomorrow" | "ThisWeek" | "ThisMonth" | "ThisQuarter" | "ThisYear" | "InPast" | "InFuture" | "On" | "NotOn" | "NextWorkDay" | "LastWorkDay" | "True" | "False" | "Values" | "InRange" | "BooleanToggle" | ((column: AdaptableColumn) => SystemFilterPredicateId)) => SystemFilterPredicateId;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultColumnFilterPredicate = void 0;
|
|
4
|
+
exports.getDefaultColumnFilterPredicate = (column, defaultColumnFilter) => {
|
|
5
|
+
return typeof defaultColumnFilter === 'function'
|
|
6
|
+
? defaultColumnFilter(column)
|
|
7
|
+
: defaultColumnFilter;
|
|
8
|
+
};
|
|
@@ -54,7 +54,7 @@ exports.renderScopeSummary = (scope, labels) => {
|
|
|
54
54
|
React.createElement(OnePageAdaptableWizard_1.SummaryText, { mb: 0 }, scopeApi.scopeIsAll(scope) ? labels.scopeWholeRow : null)),
|
|
55
55
|
React.createElement(rebass_1.Box, { style: { overflow: 'hidden' } }, 'ColumnIds' in scope ? (React.createElement(React.Fragment, null,
|
|
56
56
|
React.createElement(OnePageAdaptableWizard_1.SummaryText, { mb: columnsInScope.length ? 2 : 0 }, labels.scopeColumns),
|
|
57
|
-
columnsInScope.length ? (React.createElement(ValueSelector_1.ValueOptionsTags, { options: columnsInScope, value: columnsInScope.map((c) => c.
|
|
57
|
+
columnsInScope.length ? (React.createElement(ValueSelector_1.ValueOptionsTags, { options: columnsInScope, value: columnsInScope.map((c) => c.columnId), toLabel: (c) => c.friendlyName, allowWrap: true, readOnly: true, renderLabel: (c) => React.createElement(OnePageAdaptableWizard_1.SummaryText, { mb: 0 }, c), toIdentifier: (c) => c.columnId })) : null)) : null),
|
|
58
58
|
React.createElement(rebass_1.Box, null, 'DataTypes' in scope ? (React.createElement(React.Fragment, null,
|
|
59
59
|
React.createElement(rebass_1.Text, { fontSize: 2, mb: 2 }, labels.scopeDataTypes),
|
|
60
60
|
React.createElement(ValueSelector_1.ValueOptionsTags, { readOnly: true, options: scope.DataTypes, value: scope.DataTypes, toLabel: (c) => c, allowWrap: true, renderLabel: (c) => React.createElement(rebass_1.Text, { fontSize: 2 }, `DataType: ${c}`), toIdentifier: (c) => c }))) : null)));
|
|
@@ -4,7 +4,7 @@ import { ModuleParams } from '../SharedProps/ModuleViewPopupProps';
|
|
|
4
4
|
import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
|
|
5
5
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
6
6
|
/**
|
|
7
|
-
* This is the main popup that we use - so all
|
|
7
|
+
* This is the main popup that we use - so all Module popups will appear here.
|
|
8
8
|
*/
|
|
9
9
|
export interface AdaptablePopupProps extends React.ClassAttributes<AdaptablePopup> {
|
|
10
10
|
showModal: boolean;
|
|
@@ -20,7 +20,7 @@ class PreviewResultsPanel extends React.Component {
|
|
|
20
20
|
render() {
|
|
21
21
|
let previewHeader = this.props.showHeader && this.props.previewInfo != null
|
|
22
22
|
? 'Preview Results: ' +
|
|
23
|
-
(this.props.selectedColumn ? this.props.selectedColumn.
|
|
23
|
+
(this.props.selectedColumn ? this.props.selectedColumn.friendlyName : '')
|
|
24
24
|
: '';
|
|
25
25
|
let successColor = UIHelper_1.default.getColorByMessageType('Success');
|
|
26
26
|
const dataSource = this.props.previewInfo.previewResults.map((previewResult, index) => {
|
|
@@ -161,7 +161,7 @@ class RangesComponent extends React.Component {
|
|
|
161
161
|
}
|
|
162
162
|
onMinColumnSelectedChanged(columns) {
|
|
163
163
|
const { columnComparison } = this.state;
|
|
164
|
-
columnComparison.MinValue = columns.length > 0 ? columns[0].
|
|
164
|
+
columnComparison.MinValue = columns.length > 0 ? columns[0].columnId : undefined;
|
|
165
165
|
this.props.updateColumnComparison(columnComparison);
|
|
166
166
|
}
|
|
167
167
|
changeColumnComparisonMaxValue(event) {
|
|
@@ -174,7 +174,7 @@ class RangesComponent extends React.Component {
|
|
|
174
174
|
}
|
|
175
175
|
onMaxColumnSelectedChanged(columns) {
|
|
176
176
|
const { columnComparison } = this.state;
|
|
177
|
-
columnComparison.MaxValue = columns.length > 0 ? columns[0].
|
|
177
|
+
columnComparison.MaxValue = columns.length > 0 ? columns[0].columnId : undefined;
|
|
178
178
|
this.props.updateColumnComparison(columnComparison);
|
|
179
179
|
}
|
|
180
180
|
changeColumnComparisonColor(value) {
|
|
@@ -11,7 +11,7 @@ const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/Dr
|
|
|
11
11
|
class ColumnSelector extends React.Component {
|
|
12
12
|
render() {
|
|
13
13
|
var _a;
|
|
14
|
-
const sortedColumns = ArrayExtensions_1.ArrayExtensions.sortArrayWithProperty(Enums_1.SortOrder.Asc, this.props.ColumnList, '
|
|
14
|
+
const sortedColumns = ArrayExtensions_1.ArrayExtensions.sortArrayWithProperty(Enums_1.SortOrder.Asc, this.props.ColumnList, 'friendlyName');
|
|
15
15
|
const selectedColumnIds = this.props.SelectedColumnIds.filter((x) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(x));
|
|
16
16
|
const placeHolder = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.placeHolder)
|
|
17
17
|
? this.props.placeHolder.toString()
|
|
@@ -21,10 +21,10 @@ class ColumnSelector extends React.Component {
|
|
|
21
21
|
const isEmptySelectedColumnIds = this.props.SelectedColumnIds.filter((x) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(x)).length == 0;
|
|
22
22
|
let sortedColumnOptions = sortedColumns.map((column) => {
|
|
23
23
|
return {
|
|
24
|
-
label: column.
|
|
25
|
-
value: column.
|
|
24
|
+
label: column.friendlyName,
|
|
25
|
+
value: column.columnId,
|
|
26
26
|
onClick: () => {
|
|
27
|
-
const selected = sortedColumns.filter((c) => c.
|
|
27
|
+
const selected = sortedColumns.filter((c) => c.columnId === column.columnId);
|
|
28
28
|
if (!selected.length) {
|
|
29
29
|
this.onClearButton();
|
|
30
30
|
}
|
|
@@ -35,7 +35,7 @@ class ColumnSelector extends React.Component {
|
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
37
|
let currentColumnName = selectedColumnIds.length > 0
|
|
38
|
-
? (_a = this.props.ColumnList.find((c) => c.
|
|
38
|
+
? (_a = this.props.ColumnList.find((c) => c.columnId == selectedColumnIds[0])) === null || _a === void 0 ? void 0 : _a.friendlyName : 'Select a column';
|
|
39
39
|
return (React.createElement("div", { "data-name": 'column-selector' },
|
|
40
40
|
React.createElement(FormLayout_1.default, { columns: [1], style: this.props.style },
|
|
41
41
|
React.createElement(FormLayout_1.FormRow, null,
|