@adaptabletools/adaptable 10.0.2 → 10.0.4-canary.2
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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/base.css +84 -32
- package/bundle.cjs.js +350 -0
- package/index.css +100 -34
- package/package.json +1 -5
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +24 -12
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -3
- package/src/AdaptableOptions/ContainerOptions.d.ts +4 -5
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +1 -1
- package/src/AdaptableOptions/DateInputOptions.d.ts +5 -1
- package/src/AdaptableOptions/EditOptions.d.ts +2 -3
- package/src/AdaptableOptions/FilterOptions.d.ts +22 -15
- package/src/AdaptableOptions/GeneralOptions.d.ts +3 -2
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.d.ts +11 -11
- package/src/AdaptableOptions/NotificationsOptions.d.ts +11 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +108 -6
- package/src/Api/AdaptableApi.d.ts +12 -12
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +49 -5
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +5 -8
- 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 +44 -18
- 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 +12 -3
- package/src/Api/Implementation/ColumnApiImpl.js +79 -44
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -41
- 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 +11 -2
- package/src/Api/Implementation/GridApiImpl.js +30 -13
- package/src/Api/Implementation/InternalApiImpl.d.ts +4 -2
- package/src/Api/Implementation/InternalApiImpl.js +21 -5
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +19 -3
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -2
- package/src/Api/Implementation/PluginsApiImpl.js +1 -1
- package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
- 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/ToolPanelApiImpl.js +1 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +15 -11
- package/src/Api/Implementation/UserInterfaceApiImpl.js +73 -91
- package/src/Api/InternalApi.d.ts +4 -2
- package/src/Api/LayoutApi.d.ts +7 -0
- package/src/Api/PluginsApi.d.ts +1 -7
- package/src/Api/TeamSharingApi.d.ts +1 -1
- package/src/Api/ThemeApi.d.ts +2 -2
- package/src/Api/UserInterfaceApi.d.ts +19 -9
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -10
- package/src/PredefinedConfig/AlertState.d.ts +5 -1
- package/src/PredefinedConfig/ApplicationState.d.ts +1 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +5 -38
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +36 -36
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +4 -4
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +19 -18
- package/src/PredefinedConfig/Common/AdaptableStyle.d.ts +7 -7
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +4 -3
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/Menu.d.ts +40 -17
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/PredefinedConfig/Common/SpecialColumnSettings.js +2 -0
- package/src/PredefinedConfig/Common/Types.d.ts +5 -5
- package/src/PredefinedConfig/Common/Types.js +9 -7
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +1 -1
- package/src/PredefinedConfig/CustomSortState.d.ts +1 -1
- package/src/PredefinedConfig/DataSourceState.d.ts +1 -1
- package/src/PredefinedConfig/ExportState.d.ts +3 -3
- package/src/PredefinedConfig/FilterState.d.ts +3 -3
- package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +11 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -40
- package/src/PredefinedConfig/QuickSearchState.d.ts +3 -3
- package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
- 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/PredefinedConfig/ThemeState.d.ts +5 -1
- package/src/Redux/ActionsReducers/DashboardRedux.js +2 -1
- package/src/Redux/ActionsReducers/GridRedux.d.ts +3 -2
- package/src/Redux/ActionsReducers/GridRedux.js +2 -2
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +12 -2
- package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/DeadRedux.d.ts +4 -8
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +6 -1
- package/src/Redux/Store/AdaptableStore.d.ts +3 -3
- package/src/Redux/Store/AdaptableStore.js +25 -16
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -2
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.d.ts +2 -2
- package/src/Strategy/AlertModule.js +13 -105
- package/src/Strategy/BulkUpdateModule.d.ts +2 -2
- package/src/Strategy/BulkUpdateModule.js +7 -7
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.d.ts +2 -2
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/DashboardModule.d.ts +2 -2
- package/src/Strategy/DataChangeHistoryModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +2 -4
- package/src/Strategy/ExportModule.js +59 -62
- package/src/Strategy/FilterModule.d.ts +2 -2
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +6 -6
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/Interface/IModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.js +22 -9
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.js +8 -9
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +2 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
- package/src/Utilities/Constants/ModuleConstants.js +7 -7
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +9 -7
- 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/Interface/Preview.d.ts +2 -1
- 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/LicenseService.js +16 -2
- 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/AdaptableViewFactory.d.ts +2 -1
- package/src/View/AdaptableViewFactory.js +2 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +7 -7
- 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/CellSummary/CellSummaryViewPanel.js +2 -2
- 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 +57 -38
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +4 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +18 -9
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
- package/src/View/Components/FilterForm/QuickFilterForm.js +74 -35
- 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/Panels/FilterFormPanel.d.ts +1 -1
- package/src/View/Components/Panels/PanelWithImage.d.ts +423 -1
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +23 -10
- 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 +10 -11
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +2 -3
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.d.ts +3 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +3 -3
- package/src/View/CustomSort/CustomSortPopup.js +2 -2
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +4 -4
- 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.d.ts +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +11 -10
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +6 -6
- package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
- package/src/View/Export/ExportViewPanel.js +6 -6
- 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/GridInfo/GridOptionsComponent.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +2 -2
- 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 +3 -3
- package/src/View/QuickSearch/useQuickSearchDebounced.js +2 -3
- package/src/View/Schedule/SchedulePopup.js +3 -3
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
- package/src/View/SmartEdit/SmartEditPopup.js +1 -1
- package/src/View/StateManagement/StateManagementPopup.d.ts +2 -12
- package/src/View/StateManagement/StateManagementPopup.js +21 -114
- package/src/View/StateManagement/StateManagementViewPanel.d.ts +5 -0
- package/src/View/StateManagement/StateManagementViewPanel.js +22 -0
- package/src/View/StateManagement/components/ClearButton.d.ts +6 -0
- package/src/View/StateManagement/components/ClearButton.js +9 -0
- package/src/View/StateManagement/components/ExportDropdown.d.ts +8 -0
- package/src/View/StateManagement/components/ExportDropdown.js +43 -0
- package/src/View/StateManagement/components/LoadButton.d.ts +7 -0
- package/src/View/StateManagement/components/LoadButton.js +38 -0
- package/src/View/StateManagement/handleExportState.d.ts +1 -0
- package/src/View/StateManagement/handleExportState.js +22 -0
- package/src/View/Theme/ThemeViewPanel.js +1 -1
- 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 +28 -11
- package/src/agGrid/Adaptable.js +326 -168
- package/src/agGrid/agGridHelper.d.ts +4 -4
- package/src/agGrid/agGridHelper.js +46 -46
- package/src/agGrid/agGridMenuHelper.d.ts +15 -13
- package/src/agGrid/agGridMenuHelper.js +55 -47
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +1 -1
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +11 -6
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -2
- package/src/agGrid/editors/AdaptableDateEditor/index.js +16 -6
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +7 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/Datepicker/DatepickerContext.d.ts +2 -2
- package/src/components/Datepicker/index.js +9 -5
- 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/Modal/index.d.ts +1 -1
- package/src/components/OverlayTrigger/index.js +3 -3
- package/src/components/OverlayTrigger/useAgGridClassName.d.ts +2 -0
- package/src/components/OverlayTrigger/{useVendorClassName.js → useAgGridClassName.js} +3 -3
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
- package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/upload.d.ts +3 -0
- package/src/components/icons/upload.js +8 -0
- package/src/metamodel/adaptable.metamodel.d.ts +176 -52
- package/src/metamodel/adaptable.metamodel.js +659 -366
- package/src/types.d.ts +5 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/PredefinedConfig/DeprecatedState.d.ts +0 -82
- package/src/PredefinedConfig/DeprecatedState.js +0 -5
- 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
- package/src/components/OverlayTrigger/useVendorClassName.d.ts +0 -2
|
@@ -16,7 +16,7 @@ const ConfigurationForm = (props) => {
|
|
|
16
16
|
const searchOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.searchOptions), abOptions.searchOptions);
|
|
17
17
|
const filterOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.filterOptions), abOptions.filterOptions);
|
|
18
18
|
// we are 'hard-coding' this to use AG Grid but so does helper so ok for now and we can refactor when Adaptable Grid is ready
|
|
19
|
-
const
|
|
19
|
+
const gridOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.vendorGrid), abOptions.vendorGrid);
|
|
20
20
|
return (React.createElement(React.Fragment, null,
|
|
21
21
|
React.createElement(HelpBlock_1.default, null, "General Options"),
|
|
22
22
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
@@ -30,28 +30,28 @@ const ConfigurationForm = (props) => {
|
|
|
30
30
|
React.createElement(HelpBlock_1.default, null, "Grid Options"),
|
|
31
31
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
32
32
|
React.createElement(FormLayout_1.FormRow, { label: "Enable Range Selection" },
|
|
33
|
-
React.createElement(CheckBox_1.CheckBox, { checked:
|
|
33
|
+
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.enableRangeSelection, onChange: (enableRangeSelection) => {
|
|
34
34
|
abOptions = Object.assign({}, abOptions);
|
|
35
35
|
abOptions.vendorGrid = Object.assign({}, abOptions.vendorGrid);
|
|
36
36
|
abOptions.vendorGrid.enableRangeSelection = enableRangeSelection;
|
|
37
37
|
props.onChangeadaptableOptions(abOptions);
|
|
38
38
|
} })),
|
|
39
39
|
React.createElement(FormLayout_1.FormRow, { label: "Show Quick Filter" },
|
|
40
|
-
React.createElement(CheckBox_1.CheckBox, { checked:
|
|
40
|
+
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.floatingFilter, onChange: (floatingFilter) => {
|
|
41
41
|
abOptions = Object.assign({}, abOptions);
|
|
42
42
|
abOptions.vendorGrid = Object.assign({}, abOptions.vendorGrid);
|
|
43
43
|
abOptions.vendorGrid.floatingFilter = floatingFilter;
|
|
44
44
|
props.onChangeadaptableOptions(abOptions);
|
|
45
45
|
} })),
|
|
46
46
|
React.createElement(FormLayout_1.FormRow, { label: "Suppress Column Virtualisation" },
|
|
47
|
-
React.createElement(CheckBox_1.CheckBox, { checked:
|
|
47
|
+
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.suppressColumnVirtualisation, onChange: (suppressColumnVirtualisation) => {
|
|
48
48
|
abOptions = Object.assign({}, abOptions);
|
|
49
49
|
abOptions.vendorGrid = Object.assign({}, abOptions.vendorGrid);
|
|
50
50
|
abOptions.vendorGrid.suppressColumnVirtualisation = suppressColumnVirtualisation;
|
|
51
51
|
props.onChangeadaptableOptions(abOptions);
|
|
52
52
|
} })),
|
|
53
53
|
React.createElement(FormLayout_1.FormRow, { label: "Show Column Menu Button" },
|
|
54
|
-
React.createElement(CheckBox_1.CheckBox, { checked:
|
|
54
|
+
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.suppressMenuHide, onChange: (suppressMenuHide) => {
|
|
55
55
|
abOptions = Object.assign({}, abOptions);
|
|
56
56
|
abOptions.vendorGrid = Object.assign({}, abOptions.vendorGrid);
|
|
57
57
|
abOptions.vendorGrid.suppressMenuHide = suppressMenuHide;
|
|
@@ -76,10 +76,10 @@ const ConfigurationForm = (props) => {
|
|
|
76
76
|
props.onChangeadaptableOptions(abOptions);
|
|
77
77
|
} })),
|
|
78
78
|
React.createElement(FormLayout_1.FormRow, { label: "Use Vendor Filter Form Style" },
|
|
79
|
-
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.
|
|
79
|
+
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.useAgGridFilterFormStyle, onChange: (useAgGridFilterFormStyle) => {
|
|
80
80
|
abOptions = Object.assign({}, abOptions);
|
|
81
81
|
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
82
|
-
abOptions.filterOptions.
|
|
82
|
+
abOptions.filterOptions.useAgGridFilterFormStyle = useAgGridFilterFormStyle;
|
|
83
83
|
props.onChangeadaptableOptions(abOptions);
|
|
84
84
|
} })),
|
|
85
85
|
React.createElement(FormLayout_1.FormRow, { label: "Use Adaptable Quick Filter" },
|
|
@@ -64,7 +64,7 @@ class AlertPopupComponent extends React.Component {
|
|
|
64
64
|
if (this.props.popupParams.action == 'New') {
|
|
65
65
|
let alertDefinition = ObjectFactory_1.ObjectFactory.CreateEmptyAlertDefinition();
|
|
66
66
|
alertDefinition.Scope = {
|
|
67
|
-
ColumnIds: [this.props.popupParams.column.
|
|
67
|
+
ColumnIds: [this.props.popupParams.column.columnId],
|
|
68
68
|
};
|
|
69
69
|
this.setState({
|
|
70
70
|
editedAdaptableObject: alertDefinition,
|
|
@@ -11,6 +11,7 @@ const rebass_1 = require("rebass");
|
|
|
11
11
|
const AdaptablePopupAlert_1 = require("../../Components/Popups/AdaptablePopupAlert");
|
|
12
12
|
const AlertButtonsEditor_1 = require("./AlertButtonsEditor");
|
|
13
13
|
const CodeBlock_1 = require("../../../components/CodeBlock");
|
|
14
|
+
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
14
15
|
const DEFAULT_BUTTONS = [
|
|
15
16
|
{
|
|
16
17
|
Label: 'OK',
|
|
@@ -58,22 +59,35 @@ exports.AlertDisplayWizardSection = (props) => {
|
|
|
58
59
|
var _a, _b, _c, _d;
|
|
59
60
|
const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
60
61
|
const messageType = data.MessageType;
|
|
62
|
+
const messageText = api.alertApi.getAlertDescription(data);
|
|
61
63
|
const adaptableAlert = {
|
|
62
64
|
header: data.MessageType,
|
|
63
65
|
message: '',
|
|
64
66
|
alertDefinition: data,
|
|
65
67
|
};
|
|
68
|
+
const onMessageTextChange = (e) => {
|
|
69
|
+
const { value } = e.target;
|
|
70
|
+
props.onChange(Object.assign(Object.assign({}, data), { MessageText: value }));
|
|
71
|
+
};
|
|
66
72
|
return (React.createElement(React.Fragment, null,
|
|
67
73
|
React.createElement(Tabs_1.Tabs, null,
|
|
68
74
|
React.createElement(Tabs_1.Tabs.Tab, null, "Message Type"),
|
|
69
75
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
70
|
-
React.createElement(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "
|
|
76
|
+
React.createElement(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "horizontal", onRadioChange: (MessageType) => {
|
|
71
77
|
props.onChange(Object.assign(Object.assign({}, data), { MessageType }));
|
|
72
78
|
} },
|
|
73
|
-
React.createElement(Radio_1.default, { value: "Info" }, "Info"),
|
|
74
|
-
React.createElement(Radio_1.default, { value: "Success" }, "Success"),
|
|
75
|
-
React.createElement(Radio_1.default, { value: "Warning" }, "Warning"),
|
|
76
|
-
React.createElement(Radio_1.default, { value: "Error" }, "Error")))),
|
|
79
|
+
React.createElement(Radio_1.default, { marginLeft: 1, value: "Info" }, "Info"),
|
|
80
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Success" }, "Success"),
|
|
81
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Warning" }, "Warning"),
|
|
82
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Error" }, "Error")))),
|
|
83
|
+
React.createElement(Tabs_1.Tabs, { mt: 2, mb: 3, autoFocus: false },
|
|
84
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Message Text"),
|
|
85
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
86
|
+
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "The text to display as the Alert Message (leave blank to show automated Message based on Trigger and Condition)"),
|
|
87
|
+
' ',
|
|
88
|
+
React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageText,
|
|
89
|
+
// onChange={(e: any) => onPredicateInputChange(e, index)}
|
|
90
|
+
onChange: (e) => onMessageTextChange(e) }))),
|
|
77
91
|
React.createElement(Tabs_1.Tabs, { mt: 2, mb: 3, autoFocus: false },
|
|
78
92
|
React.createElement(Tabs_1.Tabs.Tab, null, "Display options"),
|
|
79
93
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -49,7 +49,7 @@ exports.renderBaseAlertScopeSummary = (data) => {
|
|
|
49
49
|
: null)),
|
|
50
50
|
React.createElement(rebass_1.Box, { style: { overflow: 'hidden' } }, 'ColumnIds' in data.Scope ? (React.createElement(React.Fragment, null,
|
|
51
51
|
React.createElement(rebass_1.Text, { fontSize: 2, mb: columnsInScope.length ? 2 : 0 }, "Changes in selected columns will trigger an alert"),
|
|
52
|
-
columnsInScope.length ? (React.createElement(ValueSelector_1.ValueOptionsTags, { options: columnsInScope, value: columnsInScope.map((c) => c.
|
|
52
|
+
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(rebass_1.Text, { fontSize: 2 }, c), toIdentifier: (c) => c.columnId })) : null)) : null),
|
|
53
53
|
React.createElement(rebass_1.Box, null, 'DataTypes' in data.Scope ? (React.createElement(React.Fragment, null,
|
|
54
54
|
React.createElement(rebass_1.Text, { fontSize: 2, mb: 2 }, "Changes in columns of the selected data-types trigger an alert"),
|
|
55
55
|
React.createElement(ValueSelector_1.ValueOptionsTags, { readOnly: true, options: data.Scope.DataTypes, value: data.Scope.DataTypes, toLabel: (c) => c, allowWrap: true, renderLabel: (c) => React.createElement(rebass_1.Text, { fontSize: 2 }, `DataType: ${c}`), toIdentifier: (c) => c }))) : null)));
|
|
@@ -4,6 +4,7 @@ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
|
4
4
|
import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
|
|
5
5
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
6
6
|
import { BulkUpdateValidationResult } from '../../Strategy/Interface/IBulkUpdateModule';
|
|
7
|
+
import { GridCell } from '../../types';
|
|
7
8
|
interface BulkUpdatePopupProps extends ModuleViewPopupProps<BulkUpdatePopupComponent> {
|
|
8
9
|
BulkUpdateValue: string;
|
|
9
10
|
BulkUpdateValidationResult: BulkUpdateValidationResult;
|
|
@@ -11,6 +12,7 @@ interface BulkUpdatePopupProps extends ModuleViewPopupProps<BulkUpdatePopupCompo
|
|
|
11
12
|
onBulkUpdateValueChange: (value: string) => SystemRedux.BulkUpdateChangeValueAction;
|
|
12
13
|
onBulkUpdateCheckSelectedCells: () => SystemRedux.BulkUpdateCheckCellSelectionAction;
|
|
13
14
|
onRunBulkUpdate: () => BulkUpdateRedux.BulkUpdateCompleteAction;
|
|
15
|
+
SelectedGridCells: GridCell[];
|
|
14
16
|
}
|
|
15
17
|
export interface BulkUpdatePopupState {
|
|
16
18
|
isShowingError: boolean;
|
|
@@ -34,7 +34,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
34
34
|
let dataTypeErrorMessage = '';
|
|
35
35
|
if (col && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue)) {
|
|
36
36
|
// check that the update value is a number for a numeric column. not issue for dates as we dont allow free text
|
|
37
|
-
if (col.
|
|
37
|
+
if (col.dataType == Enums_1.DataType.Number) {
|
|
38
38
|
if (isNaN(Number(this.props.BulkUpdateValue))) {
|
|
39
39
|
hasDataTypeError = true;
|
|
40
40
|
dataTypeErrorMessage = 'This column only accepts numbers';
|
|
@@ -50,14 +50,14 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
return (React.createElement(PanelWithImage_1.PanelWithImage, { header: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), variant: "primary", bodyProps: { padding: 2 }, style: { height: '100%' } },
|
|
53
|
-
col.
|
|
53
|
+
col.dataType == Enums_1.DataType.Date ? (React.createElement(React.Fragment, null,
|
|
54
54
|
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, "Enter a date value. Alternatively, tick the checkbox and select from an existing column value."),
|
|
55
55
|
React.createElement(rebass_1.Box, null,
|
|
56
56
|
React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, onChange: (checked) => this.onUseColumnValuesSelectorChanged(checked), checked: this.state.useSelector },
|
|
57
57
|
' ',
|
|
58
58
|
"Select from existing column values")),
|
|
59
59
|
React.createElement(rebass_1.Flex, { padding: 2, flexDirection: "row", alignItems: "center" },
|
|
60
|
-
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 }, this.state.useSelector ? (React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (values) => this.onColumnValueSelectedChanged(values), allowNew: false, style: { width: '100%', maxWidth: 'inherit' } })) : (React.createElement(AdaptableInput_1.default, { style: { width: '100%' }, value: String(this.props.BulkUpdateValue), type: UIHelper_1.UIHelper.getDescriptionForDataType(col.
|
|
60
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 }, this.state.useSelector ? (React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (values) => this.onColumnValueSelectedChanged(values), allowNew: false, style: { width: '100%', maxWidth: 'inherit' } })) : (React.createElement(AdaptableInput_1.default, { style: { width: '100%' }, value: String(this.props.BulkUpdateValue), type: UIHelper_1.UIHelper.getDescriptionForDataType(col.dataType), placeholder: UIHelper_1.UIHelper.getPlaceHolderforDataType(col.dataType), onChange: (e) => this.onBulkUpdateValueChange(e) }))),
|
|
61
61
|
React.createElement(SimpleButton_1.default, { disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
|
|
62
62
|
this.props.PreviewInfo.previewValidationSummary.validationResult == 'All', onClick: () => {
|
|
63
63
|
this.onApplyClick();
|
|
@@ -65,7 +65,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
65
65
|
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, "Select an existing column value from the dropdown, or enter a new value"),
|
|
66
66
|
React.createElement(rebass_1.Flex, { marginTop: 2, flexDirection: "row", alignItems: "center" },
|
|
67
67
|
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 },
|
|
68
|
-
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns), style: { width: '100%', maxWidth: 'inherit' } })),
|
|
68
|
+
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns), style: { width: '100%', maxWidth: 'inherit' } })),
|
|
69
69
|
React.createElement(SimpleButton_1.default, { disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
|
|
70
70
|
this.props.PreviewInfo.previewValidationSummary.validationResult == 'All' ||
|
|
71
71
|
hasDataTypeError, variant: "raised", tone: "accent", marginRight: 2, onClick: () => {
|
|
@@ -96,10 +96,12 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
function mapStateToProps(state, ownProps) {
|
|
99
|
+
var _a;
|
|
99
100
|
return {
|
|
100
101
|
BulkUpdateValue: state.System.BulkUpdateValue,
|
|
101
102
|
PreviewInfo: state.System.BulkUpdatePreviewInfo,
|
|
102
103
|
BulkUpdateValidationResult: state.System.BulkUpdateValidationResult,
|
|
104
|
+
SelectedGridCells: (_a = state.Grid.SelectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells,
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
function mapDispatchToProps(dispatch) {
|
|
@@ -4,6 +4,7 @@ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
|
4
4
|
import * as BulkUpdateRedux from '../../Redux/ActionsReducers/BulkUpdateRedux';
|
|
5
5
|
import { BulkUpdateValidationResult } from '../../Strategy/Interface/IBulkUpdateModule';
|
|
6
6
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
7
|
+
import { GridCell } from '../../types';
|
|
7
8
|
export interface BulkUpdateViewPanelComponentProps extends ViewPanelProps {
|
|
8
9
|
BulkUpdateValue: string;
|
|
9
10
|
BulkUpdateValidationResult: BulkUpdateValidationResult;
|
|
@@ -12,6 +13,7 @@ export interface BulkUpdateViewPanelComponentProps extends ViewPanelProps {
|
|
|
12
13
|
onBulkUpdateValueChange: (value: string) => SystemRedux.BulkUpdateChangeValueAction;
|
|
13
14
|
onBulkUpdateCheckSelectedCells: () => SystemRedux.BulkUpdateCheckCellSelectionAction;
|
|
14
15
|
onRunBulkUpdate: () => BulkUpdateRedux.BulkUpdateCompleteAction;
|
|
16
|
+
SelectedGridCells: GridCell[];
|
|
15
17
|
}
|
|
16
18
|
declare class BulkUpdateViewPanelComponent extends React.Component<BulkUpdateViewPanelComponentProps, {}> {
|
|
17
19
|
private cleanupEvent?;
|
|
@@ -52,7 +52,7 @@ class BulkUpdateViewPanelComponent extends React.Component {
|
|
|
52
52
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
53
53
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: join_1.default(shouldDisable ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__BulkUpdate__wrap`), flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
54
54
|
React.createElement(rebass_1.Flex, null,
|
|
55
|
-
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { newLabel: "New", existingLabel: "Existing", dropdownButtonProps: {
|
|
55
|
+
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, newLabel: "New", existingLabel: "Existing", dropdownButtonProps: {
|
|
56
56
|
listMinWidth: 160,
|
|
57
57
|
}, className: `ab-${elementType}__BulkUpdate__select`, disabled: shouldDisable, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: selectedColumn, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns) })),
|
|
58
58
|
React.createElement(rebass_1.Flex, null,
|
|
@@ -90,7 +90,9 @@ class BulkUpdateViewPanelComponent extends React.Component {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
function mapStateToProps(state, ownProps) {
|
|
93
|
+
var _a;
|
|
93
94
|
return {
|
|
95
|
+
SelectedGridCells: (_a = state.Grid.SelectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells,
|
|
94
96
|
BulkUpdateValue: state.System.BulkUpdateValue,
|
|
95
97
|
BulkUpdateValidationResult: state.System.BulkUpdateValidationResult,
|
|
96
98
|
PreviewInfo: state.System.BulkUpdatePreviewInfo,
|
|
@@ -46,7 +46,7 @@ class CalculatedColumnPopupComponent extends React.Component {
|
|
|
46
46
|
if (this.props.popupParams.action && this.props.popupParams.column) {
|
|
47
47
|
if (this.props.popupParams.action == 'Edit') {
|
|
48
48
|
// only editing is possible - you cannot create a new calc column from the column menu
|
|
49
|
-
let calculatedColumn = this.props.CalculatedColumns.find((x) => x.ColumnId == this.props.popupParams.column.
|
|
49
|
+
let calculatedColumn = this.props.CalculatedColumns.find((x) => x.ColumnId == this.props.popupParams.column.columnId);
|
|
50
50
|
this.onEdit(calculatedColumn);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -29,7 +29,7 @@ class CalculatedColumnSummaryComponent extends React.Component {
|
|
|
29
29
|
let sharing = this.props.teamSharingActivated;
|
|
30
30
|
this.props.CalculatedColumns.map((item, index) => {
|
|
31
31
|
var _a;
|
|
32
|
-
if (item.ColumnId == this.props.summarisedColumn.
|
|
32
|
+
if (item.ColumnId == this.props.summarisedColumn.columnId) {
|
|
33
33
|
detailRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: 'UF' + index, item1: this.props.moduleInfo.FriendlyName, item2: (_a = item.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression, configEnity: item, showShare: this.props.teamSharingActivated, moduleInfo: this.props.moduleInfo, onEdit: () => this.onEdit(item), onShare: (config) => this.props.onShare(item, config), onDelete: CalculatedColumnRedux.CalculatedColumnDelete(item), showBold: true, accessLevel: this.props.accessLevel }));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
@@ -48,7 +48,7 @@ exports.isValidCalculatedColumnSettings = (data, api) => {
|
|
|
48
48
|
if (!((_a = data.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.DataType)) {
|
|
49
49
|
return 'No data type specified for column';
|
|
50
50
|
}
|
|
51
|
-
const columnsWithSameIdCount = columns.filter((c) => c.
|
|
51
|
+
const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
|
|
52
52
|
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
53
53
|
return hasAlreadyExistingId ? 'A Column already exists with that id' : true;
|
|
54
54
|
};
|
|
@@ -64,8 +64,8 @@ class CellSummaryViewPanelComponent extends React.Component {
|
|
|
64
64
|
};
|
|
65
65
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
66
66
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: shouldDisable ? GeneralConstants.READ_ONLY_STYLE : `ab-${elementType}__CellSummary__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
67
|
-
React.createElement(rebass_1.Flex,
|
|
68
|
-
React.createElement(DropdownButton_1.default, { style: { fontSize: 'small' }, marginRight: 2, columns: ['label'], className: `ab-${elementType}__CellSummary__select`, items: [...operationMenuItems, ...operationDefinitions], disabled: shouldDisable, variant: "outlined", tone: 'neutral' }, this.props.CellSummaryOperation)),
|
|
67
|
+
React.createElement(rebass_1.Flex, { flex: 1 },
|
|
68
|
+
React.createElement(DropdownButton_1.default, { style: { fontSize: 'small', width: '100%' }, marginRight: 2, columns: ['label'], className: `ab-${elementType}__CellSummary__select`, items: [...operationMenuItems, ...operationDefinitions], disabled: shouldDisable, variant: "outlined", tone: 'neutral' }, this.props.CellSummaryOperation)),
|
|
69
69
|
React.createElement(rebass_1.Flex, { alignItems: "center" }, React.createElement(React.Fragment, null,
|
|
70
70
|
renderOperationValue(),
|
|
71
71
|
this.props.CellSummary != null && this.props.CellSummary.Count > 0 && (React.createElement(AdaptablePopover_1.AdaptablePopover, { className: "ab-ToolPanel__CellSummary__info", bodyText: [cellSummaryPopover], useButton: true, showEvent: 'focus', hideEvent: "blur" }))))));
|
|
@@ -9,7 +9,7 @@ exports.NewColumnSelector = (props) => {
|
|
|
9
9
|
const { columnFilterText, availableColumns, selected, onChange, singleSelect } = props;
|
|
10
10
|
const filterFn = react_1.useMemo(() => {
|
|
11
11
|
return columnFilterText
|
|
12
|
-
? (c) => c.
|
|
12
|
+
? (c) => c.friendlyName.toLowerCase().indexOf(columnFilterText.toLowerCase()) != -1
|
|
13
13
|
: null;
|
|
14
14
|
}, [columnFilterText]);
|
|
15
15
|
return (React.createElement(ValueSelector_1.ValueSelector, { value: selected, options: availableColumns, filter: filterFn, singleSelect: singleSelect, allowReorder: false, onChange: (colIds) => {
|
|
@@ -19,7 +19,7 @@ exports.NewColumnSelector = (props) => {
|
|
|
19
19
|
else {
|
|
20
20
|
onChange(colIds);
|
|
21
21
|
}
|
|
22
|
-
}, toIdentifier: (c) => c.
|
|
22
|
+
}, toIdentifier: (c) => c.columnId, toLabel: (c) => c.friendlyName, noSelectionLabel: singleSelect ? 'Please select a column' : 'You have not selected any columns.', xSelectedLabel: singleSelect
|
|
23
23
|
? () => null
|
|
24
24
|
: (count) => (count > 1 ? `You selected ${count} columns.` : 'You selected one column.') }));
|
|
25
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,55 @@ 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
|
-
const filterOptions = props.api.internalApi.getAdaptableOptions()
|
|
34
|
-
.filterOptions;
|
|
55
|
+
const filterOptions = props.api.internalApi.getAdaptableOptions().filterOptions;
|
|
35
56
|
if (filterOptions.defaultFilterFormTab == 'Values') {
|
|
36
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
57
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, 'Values', []);
|
|
37
58
|
}
|
|
38
|
-
if (props.currentColumn.
|
|
39
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
59
|
+
if (props.currentColumn.dataType === 'Number') {
|
|
60
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultNumericColumnFilter), ['']);
|
|
40
61
|
}
|
|
41
|
-
if (props.currentColumn.
|
|
42
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
62
|
+
if (props.currentColumn.dataType === 'String') {
|
|
63
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultStringColumnFilter), ['']);
|
|
43
64
|
}
|
|
44
|
-
if (props.currentColumn.
|
|
45
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
65
|
+
if (props.currentColumn.dataType === 'Date') {
|
|
66
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultDateColumnFilter), ['']);
|
|
46
67
|
}
|
|
47
|
-
if (props.currentColumn.
|
|
48
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.
|
|
68
|
+
if (props.currentColumn.dataType === 'Boolean') {
|
|
69
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.columnId, 'BooleanToggle', [
|
|
49
70
|
'all',
|
|
50
71
|
]);
|
|
51
72
|
}
|
|
@@ -76,31 +97,29 @@ class FilterFormComponent extends React.Component {
|
|
|
76
97
|
: state.currentTab,
|
|
77
98
|
};
|
|
78
99
|
}
|
|
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
|
-
};
|
|
100
|
+
componentWillUnmount() {
|
|
101
|
+
this._isMounted = false;
|
|
90
102
|
}
|
|
91
103
|
componentDidMount() {
|
|
92
|
-
if (this.props.currentColumn.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
if (this.props.currentColumn.dataType != Enums_1.DataType.Boolean) {
|
|
105
|
+
this.loadPermittedValues();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async loadPermittedValues(filter = '') {
|
|
109
|
+
const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
|
|
110
|
+
if (!this._isMounted) {
|
|
111
|
+
return;
|
|
97
112
|
}
|
|
113
|
+
this.setState({
|
|
114
|
+
distinctColumnValues,
|
|
115
|
+
isDistinctColumnValuesLoading: false,
|
|
116
|
+
suppressClientSideFilter,
|
|
117
|
+
});
|
|
98
118
|
}
|
|
99
119
|
render() {
|
|
100
120
|
var _a, _b;
|
|
101
121
|
let isFilterable = this.isFilterable();
|
|
102
|
-
const filterOptions = this.props.api.internalApi.getAdaptableOptions()
|
|
103
|
-
.filterOptions;
|
|
122
|
+
const filterOptions = this.props.api.internalApi.getAdaptableOptions().filterOptions;
|
|
104
123
|
const predicateDefs = this.props.api.filterApi
|
|
105
124
|
.getFilterPredicateDefsForColumn(this.props.currentColumn)
|
|
106
125
|
.filter((predicate) => !predicate.onlyQuickFilter);
|
|
@@ -112,15 +131,15 @@ class FilterFormComponent extends React.Component {
|
|
|
112
131
|
Helper_1.default.objectNotExists(this.state.editedColumnFilter.Predicate.PredicateId);
|
|
113
132
|
let closeButton = (React.createElement(ButtonClose_1.ButtonClose, { onClick: () => this.onCloseForm(), tooltip: null, accessLevel: 'Full' }));
|
|
114
133
|
let clearFilterButton = (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.onClearFilter(), disabled: isEmptyFilter, tooltip: null, accessLevel: 'Full', showText: true, showIcon: false }));
|
|
115
|
-
const
|
|
116
|
-
return (React.createElement("div", { "data-name": "filter-form" }, StringExtensions_1.StringExtensions.IsNullOrEmpty(isFilterable) ? (React.createElement(FilterFormPanel_1.FilterFormPanel, { style: panelStyle, ColumnMenuTab: this.state.selectedTab, ColumnMenuTabChanged: (e) => this.onSelectTab(e), IsAlwaysFilter: this.props.embedColumnMenu, clearFilterButton: clearFilterButton, closeButton: closeButton, showCloseButton: this.props.showCloseButton, autoApplyFilter: filterOptions.autoApplyFilter ? true : false,
|
|
134
|
+
const useAgGridStyle = !!filterOptions.useAgGridFilterFormStyle;
|
|
135
|
+
return (React.createElement("div", { "data-name": "filter-form" }, StringExtensions_1.StringExtensions.IsNullOrEmpty(isFilterable) ? (React.createElement(FilterFormPanel_1.FilterFormPanel, { style: panelStyle, ColumnMenuTab: this.state.selectedTab, ColumnMenuTabChanged: (e) => this.onSelectTab(e), IsAlwaysFilter: this.props.embedColumnMenu, clearFilterButton: clearFilterButton, closeButton: closeButton, showCloseButton: this.props.showCloseButton, autoApplyFilter: filterOptions.autoApplyFilter ? true : false, useAgGridStyle: useAgGridStyle, applyFilterButtonDisabled: isEmptyFilter, onFilterApplied: () => this.onFilterApplied() }, this.state.selectedTab == Enums_1.ColumnMenuTab.Menu ? (React.createElement(ListBoxMenu_1.ListBoxMenu, { MenuItems: this.props.api.internalApi.buildStandaloneColumnHeader(this.props.currentColumn), onMenuItemClick: (menuItem) => this.onMenuItemClick(menuItem) })) : (React.createElement("div", null,
|
|
117
136
|
this.state.showTab && (React.createElement("div", null,
|
|
118
137
|
React.createElement(Radio_1.default, { marginLeft: 1, flex: 1, checked: this.state.currentTab == 'values', onChange: () => this.setState({ currentTab: 'values' }) },
|
|
119
138
|
React.createElement(rebass_1.Flex, { fontSize: 'var( --ab-font-size-2)' }, "Column Values")),
|
|
120
139
|
React.createElement(Radio_1.default, { marginLeft: 2, flex: 1, checked: this.state.currentTab == 'predicates', onChange: () => this.setState({ currentTab: 'predicates' }) },
|
|
121
140
|
React.createElement(rebass_1.Flex, { fontSize: 'var( --ab-font-size-2)' }, "Filters")))),
|
|
122
141
|
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.
|
|
142
|
+
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, useAgGridStyle: useAgGridStyle, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) }))),
|
|
124
143
|
this.state.currentTab === 'predicates' && (React.createElement("div", null,
|
|
125
144
|
' ',
|
|
126
145
|
this.state.showTab && React.createElement("hr", null),
|
|
@@ -164,7 +183,7 @@ class FilterFormComponent extends React.Component {
|
|
|
164
183
|
} }))));
|
|
165
184
|
}
|
|
166
185
|
isFilterable() {
|
|
167
|
-
if (!this.props.currentColumn.
|
|
186
|
+
if (!this.props.currentColumn.filterable) {
|
|
168
187
|
return 'Column is not filterable';
|
|
169
188
|
}
|
|
170
189
|
return '';
|
|
@@ -258,5 +277,5 @@ function mapDispatchToProps(dispatch) {
|
|
|
258
277
|
onHideFilterForm: () => dispatch(FilterRedux.FilterFormHide()),
|
|
259
278
|
};
|
|
260
279
|
}
|
|
261
|
-
|
|
262
|
-
exports.FilterFormReact = (FilterContext) => renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(
|
|
280
|
+
const FilterForm = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(FilterFormComponent);
|
|
281
|
+
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);
|
|
@@ -4,11 +4,14 @@ import { ListGroupProps } from '../../../components/List/ListGroup';
|
|
|
4
4
|
export interface ListBoxFilterFormProps extends ListGroupProps {
|
|
5
5
|
currentColumn: AdaptableColumn;
|
|
6
6
|
columns: AdaptableColumn[];
|
|
7
|
-
|
|
7
|
+
useAgGridStyle?: boolean;
|
|
8
8
|
columnDistinctValues: any[];
|
|
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);
|
|
@@ -21,7 +26,7 @@ exports.ListBoxFilterForm = (props) => {
|
|
|
21
26
|
react_1.useEffect(() => {
|
|
22
27
|
internalUpdateUISelectedColumnValues(props.uiSelectedColumnValues);
|
|
23
28
|
}, [props.uiSelectedColumnValues]);
|
|
24
|
-
const
|
|
29
|
+
const renderItemForAgGridStyle = (props) => {
|
|
25
30
|
return (React.createElement(CheckBox_1.CheckBox, Object.assign({}, props, { variant: "agGrid", fontSize: 2, marginTop: 1, marginBottom: 1, marginLeft: 1, marginRight: 1 })));
|
|
26
31
|
};
|
|
27
32
|
const onClickItemColumnValue = (item) => {
|
|
@@ -41,28 +46,32 @@ 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
|
}
|
|
48
|
-
if (props.
|
|
49
|
-
return
|
|
54
|
+
if (props.useAgGridStyle) {
|
|
55
|
+
return renderItemForAgGridStyle({
|
|
50
56
|
key: 'columnValue' + y,
|
|
51
57
|
children: columnValue,
|
|
52
58
|
checked: isActive,
|
|
53
59
|
onChange: () => onClickItemColumnValue(x),
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
|
-
return (React.createElement(ListGroupItem_1.default, { noZebra: props.
|
|
62
|
+
return (React.createElement(ListGroupItem_1.default, { noZebra: props.useAgGridStyle, key: 'columnValue' + y, onClick: () => onClickItemColumnValue(x), active: isActive, value: columnValue }, columnValue));
|
|
57
63
|
});
|
|
58
64
|
const textClear = (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { autoFocus: true, type: "text", placeholder: "Search Column Values", value: FilterValue, style: {
|
|
59
65
|
paddingTop: 'var(--ab-space-1)',
|
|
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.useAgGridStyle ? `${baseClassName}--aggrid-style` : null, props.isLoading && `${baseClassName}--loading`) },
|
|
65
72
|
React.createElement(rebass_1.Box, { px: 2 },
|
|
66
|
-
React.createElement(rebass_1.Box, { mx: props.
|
|
67
|
-
|
|
73
|
+
React.createElement(rebass_1.Box, { mx: props.useAgGridStyle ? 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.useAgGridStyle ? 'ab-padding-horizontal-0' : '' }, columnValuesItemsElements))));
|
|
68
77
|
};
|