@adaptabletools/adaptable 11.3.0 → 12.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +22 -4
- package/bundle.cjs.js +108 -108
- package/index.css +26 -4
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -1
- package/src/AdaptableOptions/ActionOptions.d.ts +1 -0
- package/src/AdaptableOptions/{FormatColumnOptions.js → ActionOptions.js} +0 -0
- package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +5 -0
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -10
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +5 -0
- package/src/AdaptableOptions/AlertOptions.d.ts +14 -1
- package/src/AdaptableOptions/ColumnOptions.d.ts +49 -0
- package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.js → ColumnOptions.js} +0 -0
- package/src/AdaptableOptions/DashboardOptions.d.ts +2 -7
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +19 -0
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/EntitlementOptions.d.ts +7 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +5 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +6 -1
- package/src/AdaptableOptions/GeneralOptions.d.ts +22 -23
- package/src/AdaptableOptions/{MasterDetailAgGridPluginOptions.d.ts → MasterDetailPluginOptions.d.ts} +2 -4
- package/src/{Api/DataSourceApi.js → AdaptableOptions/MasterDetailPluginOptions.js} +0 -0
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +3 -6
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -49
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +75 -62
- package/src/Api/AdaptableApi.d.ts +6 -3
- package/src/Api/ColumnApi.d.ts +2 -2
- package/src/Api/ConditionalStyleApi.d.ts +10 -0
- package/src/Api/ConfigApi.d.ts +0 -12
- package/src/Api/DashboardApi.d.ts +6 -19
- package/src/Api/DataSetApi.d.ts +40 -0
- package/src/{PredefinedConfig/DataSourceState.js → Api/DataSetApi.js} +0 -0
- package/src/Api/EventApi.d.ts +15 -1
- package/src/Api/Events/DataSetChanged.d.ts +5 -0
- package/src/{PredefinedConfig/FilterState.js → Api/Events/DataSetChanged.js} +0 -0
- package/src/Api/Events/SearchChanged.d.ts +3 -4
- package/src/Api/FilterApi.d.ts +1 -77
- package/src/Api/GridApi.d.ts +1 -1
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -3
- package/src/Api/Implementation/AlertApiImpl.js +5 -1
- package/src/Api/Implementation/ApiBase.d.ts +3 -0
- package/src/Api/Implementation/ApiBase.js +6 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ColumnApiImpl.js +2 -2
- package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ConditionalStyleApiImpl.js +8 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -4
- package/src/Api/Implementation/ConfigApiImpl.js +2 -24
- package/src/Api/Implementation/DashboardApiImpl.d.ts +3 -6
- package/src/Api/Implementation/DashboardApiImpl.js +5 -29
- package/src/Api/Implementation/DataSetApiImpl.d.ts +12 -0
- package/src/Api/Implementation/DataSetApiImpl.js +42 -0
- package/src/Api/Implementation/EventApiImpl.js +1 -0
- package/src/Api/Implementation/FilterApiImpl.d.ts +1 -16
- package/src/Api/Implementation/FilterApiImpl.js +5 -159
- package/src/Api/Implementation/FormatColumnApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
- package/src/Api/Implementation/GridApiImpl.js +1 -1
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -2
- package/src/Api/Implementation/InternalApiImpl.js +14 -3
- package/src/Api/Implementation/LayoutApiImpl.d.ts +18 -1
- package/src/Api/Implementation/LayoutApiImpl.js +172 -0
- package/src/Api/Implementation/PredicateApiImpl.js +1 -1
- package/src/Api/Implementation/SmartEditApiImpl.d.ts +3 -1
- package/src/Api/Implementation/SmartEditApiImpl.js +6 -0
- package/src/Api/Implementation/TeamSharingApiImpl.d.ts +5 -3
- package/src/Api/Implementation/TeamSharingApiImpl.js +28 -10
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -4
- package/src/Api/InternalApi.d.ts +3 -2
- package/src/Api/LayoutApi.d.ts +88 -1
- package/src/Api/SmartEditApi.d.ts +8 -2
- package/src/Api/TeamSharingApi.d.ts +18 -5
- package/src/Api/UserInterfaceApi.d.ts +4 -4
- package/src/PredefinedConfig/AdaptableState.d.ts +0 -4
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +3 -3
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +5 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +18 -1
- package/src/PredefinedConfig/{FilterState.d.ts → Common/ColumnFilter.d.ts} +2 -33
- package/src/PredefinedConfig/Common/ColumnFilter.js +2 -0
- package/src/PredefinedConfig/Common/Enums.d.ts +2 -2
- package/src/PredefinedConfig/Common/Enums.js +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +6 -5
- package/src/PredefinedConfig/Common/Types.js +2 -3
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -10
- package/src/PredefinedConfig/StatusBarState.d.ts +1 -2
- package/src/PredefinedConfig/SystemState.d.ts +3 -0
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +47 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +135 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +22 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +39 -1
- package/src/Redux/Store/AdaptableStore.js +37 -39
- package/src/Strategy/AlertModule.d.ts +11 -0
- package/src/Strategy/AlertModule.js +14 -0
- package/src/Strategy/CellSummaryModule.d.ts +3 -0
- package/src/Strategy/CellSummaryModule.js +28 -14
- package/src/Strategy/DataSetModule.d.ts +25 -0
- package/src/Strategy/DataSetModule.js +65 -0
- package/src/Strategy/ExportModule.js +6 -1
- package/src/Strategy/FilterModule.d.ts +7 -11
- package/src/Strategy/FilterModule.js +24 -15
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/FlashingCellModule.js +2 -2
- package/src/Strategy/Interface/IModule.d.ts +3 -1
- package/src/Strategy/LayoutModule.js +24 -2
- package/src/Strategy/SmartEditModule.js +1 -1
- package/src/Strategy/StatusBarModule.js +1 -3
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/ToolPanelModule.js +1 -4
- package/src/Utilities/Constants/GeneralConstants.d.ts +6 -2
- package/src/Utilities/Constants/GeneralConstants.js +6 -2
- package/src/Utilities/Constants/ModuleConstants.d.ts +1 -1
- package/src/Utilities/Constants/ModuleConstants.js +2 -2
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +15 -15
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +3 -1
- package/src/Utilities/ObjectFactory.d.ts +3 -6
- package/src/Utilities/ObjectFactory.js +3 -7
- package/src/Utilities/Services/EntitlementService.js +7 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/ReportService.js +2 -3
- package/src/Utilities/Services/TeamSharingService.js +4 -4
- package/src/View/AdaptablePopover/index.d.ts +1 -0
- package/src/View/AdaptablePopover/index.js +5 -6
- package/src/View/AdaptableView.js +1 -1
- package/src/View/AdaptableViewFactory.js +2 -2
- package/src/View/Alert/ActiveAlertsPanel.d.ts +2 -0
- package/src/View/Alert/ActiveAlertsPanel.js +15 -0
- package/src/View/Alert/AlertStatusSubPanel.js +3 -8
- package/src/View/Alert/AlertViewPanel.js +2 -2
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -1
- package/src/View/CellSummary/CellSummaryDetails.js +2 -2
- package/src/View/CellSummary/CellSummaryPopover.d.ts +2 -4
- package/src/View/CellSummary/CellSummaryPopover.js +3 -6
- package/src/View/CellSummary/CellSummaryPopup.js +8 -0
- package/src/View/CellSummary/CellSummaryStatusBarSubPanelPopover.js +1 -1
- package/src/View/CellSummary/CellSummaryStatusPanel.js +2 -2
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +18 -8
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -2
- package/src/View/Components/ExternalRenderer.d.ts +3 -6
- package/src/View/Components/ExternalRenderer.js +5 -5
- package/src/View/Components/FilterForm/FilterForm.d.ts +1 -1
- package/src/View/Components/FilterForm/FilterForm.js +9 -7
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +1 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +6 -5
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +0 -2
- package/src/View/Components/Popups/AdaptablePopupAlert.js +13 -11
- package/src/View/Components/Popups/AdaptableToaster.js +29 -9
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -2
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +11 -9
- package/src/View/Dashboard/CustomDashboardButton.d.ts +11 -0
- package/src/View/Dashboard/CustomDashboardButton.js +47 -0
- package/src/View/Dashboard/CustomToolbarWrapper.d.ts +1 -0
- package/src/View/Dashboard/CustomToolbarWrapper.js +30 -11
- package/src/View/Dashboard/Dashboard.d.ts +1 -0
- package/src/View/Dashboard/Dashboard.js +8 -34
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +19 -36
- package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +3 -0
- package/src/View/DataChangeHistory/buildActionColumnButton.js +70 -0
- package/src/View/DataSet/DataSetSelector.d.ts +7 -0
- package/src/View/DataSet/DataSetSelector.js +18 -0
- package/src/View/DataSet/DataSetStatusPanelPopover.d.ts +2 -0
- package/src/View/DataSet/DataSetStatusPanelPopover.js +19 -0
- package/src/View/DataSet/DataSetViewPanel.d.ts +19 -0
- package/src/View/DataSet/DataSetViewPanel.js +58 -0
- package/src/View/Filter/ActiveFiltersPanel.js +1 -1
- package/src/View/Filter/FilterSummary.d.ts +5 -5
- package/src/View/Filter/FilterSummary.js +6 -5
- package/src/View/Filter/FilterViewPanel.d.ts +4 -4
- package/src/View/Filter/FilterViewPanel.js +11 -14
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +1 -1
- package/src/View/Layout/LayoutStatusBarSubPanelPopover.js +6 -24
- package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
- package/src/View/SmartEdit/SmartEditPopup.js +2 -2
- package/src/View/SmartEdit/SmartEditViewPanel.js +2 -2
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/View/StatusBar/AdaptableStatusBar.js +1 -1
- package/src/View/StatusBar/StatusBarPanel.d.ts +1 -0
- package/src/View/StatusBar/StatusBarPanel.js +5 -4
- package/src/View/Theme/ThemeStatusPanelPopover.js +5 -25
- package/src/View/UIHelper.d.ts +4 -4
- package/src/View/UIHelper.js +4 -4
- package/src/agGrid/ActionColumnRenderer.js +3 -2
- package/src/agGrid/Adaptable.d.ts +4 -2
- package/src/agGrid/Adaptable.js +79 -52
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/agGridHelper.d.ts +6 -6
- package/src/agGrid/agGridHelper.js +34 -56
- package/src/agGrid/agGridMenuHelper.js +4 -1
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -2
- package/src/components/Dashboard/DashboardToolbar.js +2 -2
- package/src/components/SelectList.d.ts +10 -0
- package/src/components/SelectList.js +9 -0
- package/src/components/icons/{data-source.d.ts → data-set.d.ts} +0 -0
- package/src/components/icons/{data-source.js → data-set.js} +0 -0
- package/src/components/icons/index.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +162 -77
- package/src/metamodel/adaptable.metamodel.js +422 -375
- package/src/types.d.ts +15 -12
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableOptions/FormatColumnOptions.d.ts +0 -10
- package/src/Api/DataSourceApi.d.ts +0 -58
- package/src/Api/Implementation/DataSourceApiImpl.d.ts +0 -15
- package/src/Api/Implementation/DataSourceApiImpl.js +0 -51
- package/src/PredefinedConfig/DataSourceState.d.ts +0 -34
- package/src/Redux/ActionsReducers/DataSourceRedux.d.ts +0 -42
- package/src/Redux/ActionsReducers/DataSourceRedux.js +0 -76
- package/src/Redux/ActionsReducers/FilterRedux.d.ts +0 -70
- package/src/Redux/ActionsReducers/FilterRedux.js +0 -126
- package/src/Strategy/DataSourceModule.d.ts +0 -20
- package/src/Strategy/DataSourceModule.js +0 -56
- package/src/View/DataSource/DataSourceViewPanel.d.ts +0 -19
- package/src/View/DataSource/DataSourceViewPanel.js +0 -69
- package/src/View/DataSource/Wizard/DataSourceSettingsSummary.d.ts +0 -2
- package/src/View/DataSource/Wizard/DataSourceSettingsSummary.js +0 -17
- package/src/View/DataSource/Wizard/DataSourceSettingsWizard.d.ts +0 -8
- package/src/View/DataSource/Wizard/DataSourceSettingsWizard.js +0 -42
- package/src/View/DataSource/Wizard/DataSourceWizard.d.ts +0 -8
- package/src/View/DataSource/Wizard/DataSourceWizard.js +0 -53
|
@@ -12,29 +12,40 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
12
12
|
let buttonsDivId = 'ab-CustomToolbar__' + props.customToolbar.name + '__buttons';
|
|
13
13
|
const [contentsHTML, setContentsHTML] = react_1.useState('');
|
|
14
14
|
// dummy object which is used to force a re-render of the toolbar
|
|
15
|
-
const [
|
|
15
|
+
const [componentRevision, setComponentRevision] = react_1.useState(1);
|
|
16
16
|
const contentsDivRef = react_1.useRef(null);
|
|
17
17
|
const { api } = AdaptableContext_1.useAdaptable();
|
|
18
18
|
react_1.useLayoutEffect(() => {
|
|
19
|
-
const
|
|
19
|
+
const element = contentsDivRef.current;
|
|
20
20
|
const adaptableApi = api;
|
|
21
21
|
if (props.customToolbar.render) {
|
|
22
22
|
const html = props.customToolbar.render({
|
|
23
23
|
visible: true,
|
|
24
|
-
|
|
24
|
+
element,
|
|
25
25
|
adaptableApi,
|
|
26
26
|
});
|
|
27
27
|
setContentsHTML(html);
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
}, [componentRevision, props.dashboardRevision]);
|
|
30
|
+
react_1.useLayoutEffect(() => {
|
|
31
|
+
const element = contentsDivRef.current;
|
|
32
|
+
const adaptableApi = api;
|
|
33
|
+
// cleanup runs in a separate effect, this way it's executed only once on unmount
|
|
32
34
|
return () => {
|
|
33
35
|
if (props.customToolbar.render) {
|
|
34
|
-
props.customToolbar.render({ visible: false,
|
|
36
|
+
props.customToolbar.render({ visible: false, element, adaptableApi });
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
react_1.useLayoutEffect(() => {
|
|
41
|
+
const element = contentsDivRef.current;
|
|
42
|
+
const adaptableApi = api;
|
|
43
|
+
if (props.customToolbar.frameworkComponent) {
|
|
44
|
+
adaptableApi.internalApi.createFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
|
|
45
|
+
}
|
|
46
|
+
return () => {
|
|
47
|
+
if (props.customToolbar.frameworkComponent) {
|
|
48
|
+
adaptableApi.internalApi.destroyFrameworkComponent(element, props.customToolbar.frameworkComponent, 'toolbar');
|
|
38
49
|
}
|
|
39
50
|
};
|
|
40
51
|
}, []);
|
|
@@ -58,6 +69,14 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
58
69
|
adaptableApi: api,
|
|
59
70
|
dashboardState: api.dashboardApi.getDashboardState(),
|
|
60
71
|
};
|
|
72
|
+
const defaultIconProps = {
|
|
73
|
+
style: {
|
|
74
|
+
height: 'var(--ab-cmp-simple-button__height)',
|
|
75
|
+
width: 'var(--ab-cmp-simple-button__width)',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
const buttonIcon = api.internalApi.getIconForButton(button, dashboardContext);
|
|
79
|
+
const iconProps = buttonIcon && Object.assign({}, defaultIconProps, buttonIcon);
|
|
61
80
|
let buttonStyle = api.internalApi.getStyleForButton(button, dashboardContext);
|
|
62
81
|
let buttonLabel = api.internalApi.getLabelForButton(button, dashboardContext);
|
|
63
82
|
let buttonTooltip = api.internalApi.getTooltipForButton(button, dashboardContext);
|
|
@@ -71,10 +90,10 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
71
90
|
button.onClick ? button.onClick(button, dashboardContext) : null;
|
|
72
91
|
setTimeout(() => {
|
|
73
92
|
// mutate state to force a re-rendering
|
|
74
|
-
|
|
93
|
+
setComponentRevision(componentRevision + 1);
|
|
75
94
|
}, 16);
|
|
76
95
|
} },
|
|
77
|
-
|
|
96
|
+
buttonIcon ? React.createElement("img", Object.assign({}, iconProps)) : null,
|
|
78
97
|
buttonLabel));
|
|
79
98
|
}))));
|
|
80
99
|
};
|
|
@@ -8,6 +8,7 @@ import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
|
|
|
8
8
|
import * as QuickSearchRedux from '../../Redux/ActionsReducers/QuickSearchRedux';
|
|
9
9
|
import { SystemStatusMessageInfo } from '../../PredefinedConfig/Common/SystemStatusMessageInfo';
|
|
10
10
|
interface DashboardComponentProps extends ModuleViewPopupProps<any> {
|
|
11
|
+
DashboardRevision: number;
|
|
11
12
|
DashboardState: DashboardState;
|
|
12
13
|
GridState: GridState;
|
|
13
14
|
SystemStatusMessageInfos: SystemStatusMessageInfo[];
|
|
@@ -21,6 +21,7 @@ const ModuleToolbarWrapper_1 = require("./ModuleToolbarWrapper");
|
|
|
21
21
|
const CustomToolbarWrapper_1 = require("./CustomToolbarWrapper");
|
|
22
22
|
const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
|
|
23
23
|
const ApplicationIcon_1 = require("../../components/ApplicationIcon");
|
|
24
|
+
const CustomDashboardButton_1 = require("./CustomDashboardButton");
|
|
24
25
|
const DashboardComponent = (props) => {
|
|
25
26
|
const [searchText, search] = useQuickSearchDebounced_1.useQuickSearchDebounced(props);
|
|
26
27
|
const dashboardAccessLevel = props.api.internalApi
|
|
@@ -35,7 +36,7 @@ const DashboardComponent = (props) => {
|
|
|
35
36
|
if (customToolbar) {
|
|
36
37
|
if (dashboardAccessLevel != 'Hidden') {
|
|
37
38
|
return (React.createElement(rebass_1.Box, { key: customToolbar.name, className: `ab-Dashboard__container ab-Dashboard__container--customToolbar` },
|
|
38
|
-
React.createElement(CustomToolbarWrapper_1.CustomToolbarWrapper, { customToolbar: customToolbar })));
|
|
39
|
+
React.createElement(CustomToolbarWrapper_1.CustomToolbarWrapper, { customToolbar: customToolbar, dashboardRevision: props.DashboardRevision })));
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
@@ -88,40 +89,12 @@ const DashboardComponent = (props) => {
|
|
|
88
89
|
return shortcuts;
|
|
89
90
|
};
|
|
90
91
|
const renderDashboardButtons = () => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
.
|
|
92
|
+
let dashboardButtonsArray = props.api.dashboardApi
|
|
93
|
+
.getCustomDashboardButtons()
|
|
94
|
+
.filter(Boolean);
|
|
94
95
|
let customDashboardButtons = null;
|
|
95
|
-
if (dashboardButtonsArray) {
|
|
96
|
-
customDashboardButtons = dashboardButtonsArray.map((button) => {
|
|
97
|
-
// TODO: variants of this mapping are present in several places (just search for api.internalApi.getStyleForButton() usages)
|
|
98
|
-
// with the next opportunity we should abstract it
|
|
99
|
-
const defaultIconProps = {
|
|
100
|
-
style: {
|
|
101
|
-
height: 'var(--ab-cmp-simple-button__height)',
|
|
102
|
-
width: 'var(--ab-cmp-simple-button__width)',
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
|
|
106
|
-
// const iconProps: any = button.icon ? { ...button.icon } : null;
|
|
107
|
-
// if (iconProps) {
|
|
108
|
-
// delete iconProps.Uuid;
|
|
109
|
-
// }
|
|
110
|
-
const dashboardContext = {
|
|
111
|
-
adaptableApi: props.api,
|
|
112
|
-
dashboardState: props.api.dashboardApi.getDashboardState(),
|
|
113
|
-
};
|
|
114
|
-
let buttonStyle = props.api.internalApi.getStyleForButton(button, dashboardContext);
|
|
115
|
-
let buttonLabel = props.api.internalApi.getLabelForButton(button, dashboardContext);
|
|
116
|
-
let buttonTooltip = props.api.internalApi.getTooltipForButton(button, dashboardContext);
|
|
117
|
-
if (button.hidden && button.hidden(button, dashboardContext)) {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
const disabled = button.disabled && button.disabled(button, dashboardContext);
|
|
121
|
-
return (React.createElement(SimpleButton_1.default, { key: buttonLabel, variant: buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text', tone: buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none', className: `ab-DashboardToolbar__Home__${kebabCase_1.default(buttonLabel)} ${(buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className) || ''}`, tooltip: buttonTooltip, disabled: disabled || props.accessLevel == 'ReadOnly', onClick: () => button.onClick(button, dashboardContext), accessLevel: 'Full' },
|
|
122
|
-
button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
|
|
123
|
-
buttonLabel));
|
|
124
|
-
});
|
|
96
|
+
if (dashboardButtonsArray === null || dashboardButtonsArray === void 0 ? void 0 : dashboardButtonsArray.length) {
|
|
97
|
+
customDashboardButtons = dashboardButtonsArray.map((button, index) => (React.createElement(CustomDashboardButton_1.CustomDashboardButton, { key: `${button.label}-${index}`, button: button, api: props.api, accessLevel: props.accessLevel })));
|
|
125
98
|
}
|
|
126
99
|
return customDashboardButtons;
|
|
127
100
|
};
|
|
@@ -159,6 +132,7 @@ const DashboardComponent = (props) => {
|
|
|
159
132
|
};
|
|
160
133
|
function mapStateToProps(state, ownProps) {
|
|
161
134
|
return {
|
|
135
|
+
DashboardRevision: state.System.DashboardRevision,
|
|
162
136
|
DashboardState: state.Dashboard,
|
|
163
137
|
GridState: state.Grid,
|
|
164
138
|
SystemStatusMessageInfos: state.System.SystemStatusMessages,
|
|
@@ -8,6 +8,7 @@ const all_modules_1 = require("@ag-grid-community/all-modules");
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const usePrevious_1 = tslib_1.__importDefault(require("../../components/utils/usePrevious"));
|
|
10
10
|
const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
|
|
11
|
+
const buildActionColumnButton_1 = require("./buildActionColumnButton");
|
|
11
12
|
exports.DataChangeHistoryGrid = (props) => {
|
|
12
13
|
const { changeHistoryLog, adaptableContainerId, agGridContainerId, onUndoChange } = props;
|
|
13
14
|
const mainAdaptableInstance = AdaptableContext_1.useAdaptable();
|
|
@@ -72,7 +73,7 @@ exports.DataChangeHistoryGrid = (props) => {
|
|
|
72
73
|
return React.createElement(React.Fragment, null);
|
|
73
74
|
};
|
|
74
75
|
const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange) => {
|
|
75
|
-
var _a, _b;
|
|
76
|
+
var _a, _b, _c;
|
|
76
77
|
const mainAdaptableOptions = mainAdaptableInstance.adaptableOptions;
|
|
77
78
|
const mainAdaptableTheme = mainAdaptableInstance.api.themeApi.getCurrentTheme();
|
|
78
79
|
const undoRowNode = (rowNode) => {
|
|
@@ -80,6 +81,21 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
80
81
|
const changeKey = (_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.data) === null || _a === void 0 ? void 0 : _a['changeKey'];
|
|
81
82
|
changeKey && onUndoChange(changeKey);
|
|
82
83
|
};
|
|
84
|
+
const actionColumnButton = buildActionColumnButton_1.buildActionColumnButton((_a = mainAdaptableInstance.adaptableOptions) === null || _a === void 0 ? void 0 : _a.dataChangeHistoryOptions, undoRowNode);
|
|
85
|
+
let actionOptions = undefined;
|
|
86
|
+
if (actionColumnButton) {
|
|
87
|
+
actionOptions = {
|
|
88
|
+
actionColumns: [
|
|
89
|
+
{
|
|
90
|
+
columnId: 'undoActionColumn',
|
|
91
|
+
friendlyName: ' ',
|
|
92
|
+
includeGroupedRows: true,
|
|
93
|
+
actionColumnSettings: { suppressMenu: true, suppressMovable: true },
|
|
94
|
+
actionColumnButton,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
83
99
|
const options = {
|
|
84
100
|
gridOptions: gridOptions,
|
|
85
101
|
modules: [...all_modules_1.AllCommunityModules],
|
|
@@ -98,40 +114,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
98
114
|
createDefaultLayout: false,
|
|
99
115
|
},
|
|
100
116
|
userInterfaceOptions: {
|
|
101
|
-
|
|
102
|
-
{
|
|
103
|
-
columnId: 'undoActionColumn',
|
|
104
|
-
friendlyName: ' ',
|
|
105
|
-
includeGroupedRows: true,
|
|
106
|
-
actionColumnSettings: { suppressMenu: true, suppressMovable: true },
|
|
107
|
-
actionColumnButton: {
|
|
108
|
-
label: (button, context) => {
|
|
109
|
-
if (context.adaptableApi.gridApi.isGroupRowNode(context.rowNode)) {
|
|
110
|
-
return 'Undo Group';
|
|
111
|
-
}
|
|
112
|
-
return 'Undo Change';
|
|
113
|
-
},
|
|
114
|
-
onClick: (button, context) => {
|
|
115
|
-
var _a;
|
|
116
|
-
const rowNode = context.rowNode;
|
|
117
|
-
if (context.adaptableApi.gridApi.isGroupRowNode(rowNode)) {
|
|
118
|
-
// undo all children
|
|
119
|
-
const childrenNodes = (_a = context.rowNode) === null || _a === void 0 ? void 0 : _a.childrenAfterFilter;
|
|
120
|
-
if (childrenNodes) {
|
|
121
|
-
childrenNodes.forEach((childNode) => undoRowNode(childNode));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
undoRowNode(rowNode);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
buttonStyle: {
|
|
129
|
-
variant: 'raised',
|
|
130
|
-
tone: 'accent',
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
],
|
|
117
|
+
actionOptions: actionOptions,
|
|
135
118
|
},
|
|
136
119
|
predefinedConfig: {
|
|
137
120
|
Layout: {
|
|
@@ -174,7 +157,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
174
157
|
DisplayFormat: {
|
|
175
158
|
Formatter: 'DateFormatter',
|
|
176
159
|
Options: {
|
|
177
|
-
Pattern: `${(
|
|
160
|
+
Pattern: `${(_c = (_b = mainAdaptableOptions.userInterfaceOptions) === null || _b === void 0 ? void 0 : _b.dateInputOptions) === null || _c === void 0 ? void 0 : _c.dateFormat} HH:mm:ss`,
|
|
178
161
|
},
|
|
179
162
|
},
|
|
180
163
|
},
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RowNode } from '@ag-grid-community/all-modules';
|
|
2
|
+
import { ActionColumnButtonContext, AdaptableButton, DataChangeHistoryOptions } from '../../types';
|
|
3
|
+
export declare const buildActionColumnButton: (options: DataChangeHistoryOptions, undoRowNode: (rowNode: RowNode) => void) => AdaptableButton<ActionColumnButtonContext>[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildActionColumnButton = void 0;
|
|
4
|
+
exports.buildActionColumnButton = (options, undoRowNode) => {
|
|
5
|
+
let actionColumnButtonsOptions = options.actionColumnButton;
|
|
6
|
+
if (!actionColumnButtonsOptions ||
|
|
7
|
+
(Array.isArray(actionColumnButtonsOptions) && actionColumnButtonsOptions.length === 0)) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (!Array.isArray(actionColumnButtonsOptions)) {
|
|
11
|
+
actionColumnButtonsOptions = [actionColumnButtonsOptions];
|
|
12
|
+
}
|
|
13
|
+
const isGroupNode = (context) => context.adaptableApi.gridApi.isGroupRowNode(context.rowNode);
|
|
14
|
+
const onUndo = (context) => {
|
|
15
|
+
var _a;
|
|
16
|
+
const rowNode = context.rowNode;
|
|
17
|
+
if (context.adaptableApi.gridApi.isGroupRowNode(rowNode)) {
|
|
18
|
+
// undo all children
|
|
19
|
+
const childrenNodes = (_a = context.rowNode) === null || _a === void 0 ? void 0 : _a.childrenAfterFilter;
|
|
20
|
+
if (childrenNodes) {
|
|
21
|
+
childrenNodes.forEach((childNode) => undoRowNode(childNode));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
undoRowNode(rowNode);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const buildContext = (context) => (Object.assign(Object.assign({}, context), { isGroupNode: isGroupNode(context), undoDataChange: () => onUndo(context) }));
|
|
29
|
+
return actionColumnButtonsOptions.map((actionColumnOption) => ({
|
|
30
|
+
label: (button, context) => {
|
|
31
|
+
if (typeof actionColumnOption.label !== 'function') {
|
|
32
|
+
return actionColumnOption.label;
|
|
33
|
+
}
|
|
34
|
+
return actionColumnOption.label(button, buildContext(context));
|
|
35
|
+
},
|
|
36
|
+
buttonStyle: (button, context) => {
|
|
37
|
+
if (typeof actionColumnOption.buttonStyle !== 'function') {
|
|
38
|
+
return actionColumnOption.buttonStyle;
|
|
39
|
+
}
|
|
40
|
+
return actionColumnOption.buttonStyle(button, buildContext(context));
|
|
41
|
+
},
|
|
42
|
+
tooltip: (button, context) => {
|
|
43
|
+
if (typeof actionColumnOption.tooltip !== 'function') {
|
|
44
|
+
return actionColumnOption.tooltip;
|
|
45
|
+
}
|
|
46
|
+
return actionColumnOption.tooltip(button, buildContext(context));
|
|
47
|
+
},
|
|
48
|
+
disabled: (button, context) => {
|
|
49
|
+
if (typeof actionColumnOption.disabled !== 'function') {
|
|
50
|
+
return actionColumnOption.disabled;
|
|
51
|
+
}
|
|
52
|
+
return actionColumnOption.disabled(button, buildContext(context));
|
|
53
|
+
},
|
|
54
|
+
onClick: (button, context) => {
|
|
55
|
+
if (actionColumnOption.Action === 'undo') {
|
|
56
|
+
onUndo(buildContext(context));
|
|
57
|
+
}
|
|
58
|
+
if (typeof actionColumnOption.onClick === 'function') {
|
|
59
|
+
actionColumnOption.onClick(button, buildContext(context));
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
hidden: (button, context) => {
|
|
63
|
+
if (typeof actionColumnOption.hidden !== 'function') {
|
|
64
|
+
return actionColumnOption.hidden;
|
|
65
|
+
}
|
|
66
|
+
return actionColumnOption.hidden(button, buildContext(context));
|
|
67
|
+
},
|
|
68
|
+
icon: actionColumnOption.icon,
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSetSelector = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const Radio_1 = tslib_1.__importDefault(require("../../components/Radio"));
|
|
7
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
8
|
+
exports.DataSetSelector = ({ data }) => {
|
|
9
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
10
|
+
const dataSets = adaptable.api.dataSetApi.getAllDataSets();
|
|
11
|
+
const selectedDataSet = adaptable.api.dataSetApi.getCurrentDataSet();
|
|
12
|
+
const isDisabled = (dataSets === null || dataSets === void 0 ? void 0 : dataSets.length) === 1;
|
|
13
|
+
const isSelected = (selectedDataSet === null || selectedDataSet === void 0 ? void 0 : selectedDataSet.name) === (data === null || data === void 0 ? void 0 : data.name);
|
|
14
|
+
const handleToggle = React.useCallback(() => {
|
|
15
|
+
adaptable.api.dataSetApi.setDataSet(data.name);
|
|
16
|
+
}, [isSelected]);
|
|
17
|
+
return React.createElement(Radio_1.default, { id: data.name, disabled: isDisabled, checked: isSelected, onClick: handleToggle });
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSetStatusPanelPopover = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const SelectList_1 = require("../../components/SelectList");
|
|
7
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
8
|
+
exports.DataSetStatusPanelPopover = () => {
|
|
9
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
10
|
+
const dataSets = adaptable.api.dataSetApi.getAllDataSets();
|
|
11
|
+
const handleDataSetChange = React.useCallback((option) => {
|
|
12
|
+
adaptable.api.dataSetApi.setDataSet(option.label);
|
|
13
|
+
}, []);
|
|
14
|
+
const options = dataSets.map((dataSet) => ({
|
|
15
|
+
label: dataSet.name,
|
|
16
|
+
value: dataSet.name,
|
|
17
|
+
}));
|
|
18
|
+
return React.createElement(SelectList_1.SelectList, { options: options, onChange: handleDataSetChange });
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as Redux from 'redux';
|
|
4
|
+
import { DataSet } from '../../types';
|
|
5
|
+
export interface DataSetViewPanelComponentProps extends ViewPanelProps {
|
|
6
|
+
CurrentDataSetName: string;
|
|
7
|
+
onSelectDataSet: (dataSet: DataSet) => Redux.Action;
|
|
8
|
+
}
|
|
9
|
+
interface DataSetViewPanelComponentState {
|
|
10
|
+
CurrentDataSet: DataSet;
|
|
11
|
+
}
|
|
12
|
+
declare class DataSetViewPanelComponent extends React.Component<DataSetViewPanelComponentProps, DataSetViewPanelComponentState> {
|
|
13
|
+
getCurrentDataSet(): DataSet;
|
|
14
|
+
getDataSets(): DataSet[];
|
|
15
|
+
render(): JSX.Element;
|
|
16
|
+
onSelectedDataSetChanged(dataSetName: string): void;
|
|
17
|
+
}
|
|
18
|
+
export declare let DataSetViewPanelControl: import("react-redux").ConnectedComponent<typeof DataSetViewPanelComponent, Pick<React.ClassAttributes<DataSetViewPanelComponent> & DataSetViewPanelComponentProps, "ref" | "key">>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSetViewPanelControl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
|
|
6
|
+
const React = tslib_1.__importStar(require("react"));
|
|
7
|
+
const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
|
|
8
|
+
const rebass_1 = require("rebass");
|
|
9
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../components/DropdownButton"));
|
|
10
|
+
const react_redux_1 = require("react-redux");
|
|
11
|
+
class DataSetViewPanelComponent extends React.Component {
|
|
12
|
+
getCurrentDataSet() {
|
|
13
|
+
return StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.CurrentDataSetName)
|
|
14
|
+
? null
|
|
15
|
+
: this.getDataSets().find((ds) => ds.name == this.props.CurrentDataSetName);
|
|
16
|
+
}
|
|
17
|
+
getDataSets() {
|
|
18
|
+
return this.props.api.dataSetApi.getAllDataSets();
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
const selectDataSetString = 'Select Data Set';
|
|
23
|
+
let currentDataSetName = (_b = (_a = this.getCurrentDataSet()) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : selectDataSetString;
|
|
24
|
+
let availableDataSets = this.getDataSets().map((dataSet) => {
|
|
25
|
+
return {
|
|
26
|
+
value: dataSet.name,
|
|
27
|
+
label: dataSet.name,
|
|
28
|
+
onClick: () => this.onSelectedDataSetChanged(dataSet.name),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
32
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__DataSet__wrap` },
|
|
33
|
+
React.createElement(DropdownButton_1.default, { marginRight: 2, columns: ['label'], style: { minWidth: 160, fontSize: 'small' }, className: `ab-${elementType}__DataSet__select`, items: availableDataSets, variant: "outlined", tone: 'neutral' }, currentDataSetName)));
|
|
34
|
+
}
|
|
35
|
+
onSelectedDataSetChanged(dataSetName) {
|
|
36
|
+
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(dataSetName)) {
|
|
37
|
+
this.setState({ CurrentDataSet: null });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
let newDataSet = this.getDataSets().find((ds) => ds.name == dataSetName);
|
|
41
|
+
this.setState({ CurrentDataSet: newDataSet });
|
|
42
|
+
this.props.onSelectDataSet(newDataSet);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function mapStateToProps(state) {
|
|
47
|
+
return {
|
|
48
|
+
CurrentDataSetName: state.System.CurrentDataSet,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function mapDispatchToProps(dispatch) {
|
|
52
|
+
return {
|
|
53
|
+
onSelectDataSet: (dataSet) => {
|
|
54
|
+
return dispatch(SystemRedux.SystemDataSetSelect(dataSet));
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
exports.DataSetViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(DataSetViewPanelComponent);
|
|
@@ -9,6 +9,6 @@ const AdaptableObjectCompactList_1 = require("../Components/AdaptableObjectList/
|
|
|
9
9
|
exports.ActiveFiltersPanel = () => {
|
|
10
10
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
11
11
|
const filterModule = adaptable.ModuleService.getModuleById(ModuleConstants.FilterModuleId);
|
|
12
|
-
const columnFilters = adaptable.api.
|
|
12
|
+
const columnFilters = adaptable.api.layoutApi.getAllColumnFilter();
|
|
13
13
|
return React.createElement(AdaptableObjectCompactList_1.AdaptableObjectCompactList, { abObjects: columnFilters, module: filterModule });
|
|
14
14
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ModuleSummaryProps } from '../Components/SharedProps/ModuleSummaryProps';
|
|
3
3
|
import { EditableConfigEntityState } from '../Components/SharedProps/EditableConfigEntityState';
|
|
4
|
-
import * as
|
|
5
|
-
import { ColumnFilter } from '../../
|
|
6
|
-
export interface FilterSummaryProps extends ModuleSummaryProps<FilterSummaryComponent> {
|
|
4
|
+
import * as LayoutRedux from '../../Redux/ActionsReducers/LayoutRedux';
|
|
5
|
+
import { ColumnFilter } from '../../types';
|
|
6
|
+
export interface FilterSummaryProps extends Omit<ModuleSummaryProps<FilterSummaryComponent>, 'onClosePopup' | 'modalContainer'> {
|
|
7
7
|
ColumnFilters: ColumnFilter[];
|
|
8
|
-
onClearFilter: (
|
|
8
|
+
onClearFilter: (columnFilter: ColumnFilter) => LayoutRedux.LayoutFilterClearAction;
|
|
9
9
|
}
|
|
10
10
|
export declare class FilterSummaryComponent extends React.Component<FilterSummaryProps, EditableConfigEntityState> {
|
|
11
11
|
constructor(props: FilterSummaryProps);
|
|
12
12
|
render(): any;
|
|
13
13
|
getDescription(columnFilter: ColumnFilter): string;
|
|
14
14
|
}
|
|
15
|
-
export declare let FilterSummary: import("react-redux").ConnectedComponent<typeof FilterSummaryComponent,
|
|
15
|
+
export declare let FilterSummary: import("react-redux").ConnectedComponent<typeof FilterSummaryComponent, Pick<React.ClassAttributes<FilterSummaryComponent> & FilterSummaryProps, "ref" | "key" | "api" | "onSuspend" | "accessLevel" | "popupParams" | "teamSharingActivated" | "moduleInfo" | "onUnSuspend" | "summarisedColumn">>;
|
|
@@ -7,11 +7,12 @@ const react_redux_1 = require("react-redux");
|
|
|
7
7
|
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
8
8
|
const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
|
|
9
9
|
const TeamSharingRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/TeamSharingRedux"));
|
|
10
|
-
const
|
|
10
|
+
const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
|
|
11
11
|
const SummaryRowItem_1 = require("../Components/ModuleSummary/SummaryRowItem");
|
|
12
12
|
const ModuleProfile_1 = require("../Components/ModuleProfile");
|
|
13
13
|
const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
|
|
14
14
|
const UIHelper_1 = require("../UIHelper");
|
|
15
|
+
const LayoutRedux_1 = require("../../Redux/ActionsReducers/LayoutRedux");
|
|
15
16
|
class FilterSummaryComponent extends React.Component {
|
|
16
17
|
constructor(props) {
|
|
17
18
|
super(props);
|
|
@@ -33,18 +34,18 @@ class FilterSummaryComponent extends React.Component {
|
|
|
33
34
|
if (columnFilter == null) {
|
|
34
35
|
return 'No Column Filter Active';
|
|
35
36
|
}
|
|
36
|
-
return this.props.api.
|
|
37
|
+
return this.props.api.layoutApi.columnFilterToString(columnFilter);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
exports.FilterSummaryComponent = FilterSummaryComponent;
|
|
40
|
-
function mapStateToProps(state
|
|
41
|
+
function mapStateToProps(state) {
|
|
41
42
|
return {
|
|
42
|
-
ColumnFilters: state
|
|
43
|
+
ColumnFilters: LayoutRedux_1.getColumnFilterSelector(state),
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
function mapDispatchToProps(dispatch) {
|
|
46
47
|
return {
|
|
47
|
-
onClearFilter: (columnFilter) => dispatch(
|
|
48
|
+
onClearFilter: (columnFilter) => dispatch(LayoutRedux.LayoutColumnFilterClear(columnFilter)),
|
|
48
49
|
onClearPopupParams: () => dispatch(PopupRedux.PopupClearParam()),
|
|
49
50
|
onShare: (entity, config) => dispatch(TeamSharingRedux.TeamSharingShare(entity, ModuleConstants.FilterModuleId, config)),
|
|
50
51
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ViewPanelProps } from '../Components/SharedProps/ViewPanelProps';
|
|
2
|
-
import * as
|
|
3
|
-
import { ColumnFilter } from '../../PredefinedConfig/FilterState';
|
|
2
|
+
import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
4
3
|
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
5
4
|
import { Entitlement } from '../../PredefinedConfig/Common/Entitlement';
|
|
6
5
|
import * as React from 'react';
|
|
6
|
+
import { ColumnFilter } from '../../types';
|
|
7
7
|
export interface FilterViewPanelComponentProps extends ViewPanelProps {
|
|
8
|
-
onHideQuickFilterBar: () =>
|
|
9
|
-
onShowQuickFilterBar: () =>
|
|
8
|
+
onHideQuickFilterBar: () => SystemRedux.SystemQuickFilterBarHideAction;
|
|
9
|
+
onShowQuickFilterBar: () => SystemRedux.SystemQuickFilterBarShowAction;
|
|
10
10
|
ColumnFilters: ColumnFilter[];
|
|
11
11
|
Columns: AdaptableColumn[];
|
|
12
12
|
Entitlements: Entitlement[];
|
|
@@ -2,50 +2,47 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FilterViewPanelControl = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const ActiveFiltersPanel_1 = require("./ActiveFiltersPanel");
|
|
8
8
|
const rebass_1 = require("rebass");
|
|
9
9
|
const ArrayExtensions_1 = require("../../Utilities/Extensions/ArrayExtensions");
|
|
10
10
|
const AdaptablePopover_1 = require("../AdaptablePopover");
|
|
11
|
-
const ButtonClear_1 = require("../Components/Buttons/ButtonClear");
|
|
12
11
|
const CheckBox_1 = require("../../components/CheckBox");
|
|
13
12
|
const react_redux_1 = require("react-redux");
|
|
13
|
+
const LayoutRedux_1 = require("../../Redux/ActionsReducers/LayoutRedux");
|
|
14
14
|
class FilterViewPanelComponent extends React.Component {
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
const activeFiltersPanel = React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, null);
|
|
20
19
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
21
20
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Filter__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
22
|
-
React.createElement(rebass_1.Flex, null, ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(React.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 }),
|
|
26
|
-
React.createElement(ButtonClear_1.ButtonClear, { marginLeft: 1, marginBottom: 0, marginRight: 1, className: `ab-${elementType}__Filter__clear`, onClick: () => this.onClearFilters(), tooltip: "Clear Filters", disabled: this.props.ColumnFilters.length == 0, showText: this.props.viewType === 'ToolPanel' }, this.props.viewType === 'ToolPanel' && 'Clear')))),
|
|
21
|
+
React.createElement(rebass_1.Flex, null, ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(AdaptablePopover_1.AdaptablePopover, { popupPadding: 0, className: `ab-${elementType}__Filter__info`, headerText: "", bodyText: [React.createElement(ActiveFiltersPanel_1.ActiveFiltersPanel, null)],
|
|
22
|
+
// tooltipText={'Show Filter Details'}
|
|
23
|
+
useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 }))),
|
|
27
24
|
React.createElement(rebass_1.Flex, { alignItems: "center" }, this.props.api.filterApi.isQuickFilterAvailable() && (React.createElement(CheckBox_1.CheckBox, { className: `ab-${elementType}__Filter__active-check`, disabled: this.props.accessLevel === 'ReadOnly' ||
|
|
28
25
|
this.props.api.internalApi.isGridInPivotMode(), marginTop: 0, marginBottom: 0, fontSize: 2, padding: 1, checked: this.props.IsQuickFilterVisible, onChange: (checked) => {
|
|
29
26
|
checked ? this.props.onShowQuickFilterBar() : this.props.onHideQuickFilterBar();
|
|
30
27
|
} }, "Show Quick Filter")))));
|
|
31
28
|
}
|
|
32
29
|
onClearFilters() {
|
|
33
|
-
this.props.api.
|
|
30
|
+
this.props.api.layoutApi.clearAllColumnFilter();
|
|
34
31
|
}
|
|
35
32
|
onClearColumnFilter(columnFilter) {
|
|
36
|
-
this.props.api.
|
|
33
|
+
this.props.api.layoutApi.clearColumnFilterByColumn(columnFilter.ColumnId);
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
function mapStateToProps(state) {
|
|
40
37
|
return {
|
|
41
|
-
ColumnFilters: state
|
|
42
|
-
IsQuickFilterVisible: state.
|
|
38
|
+
ColumnFilters: LayoutRedux_1.getColumnFilterSelector(state),
|
|
39
|
+
IsQuickFilterVisible: state.System.IsQuickFilterVisible,
|
|
43
40
|
};
|
|
44
41
|
}
|
|
45
42
|
function mapDispatchToProps(dispatch) {
|
|
46
43
|
return {
|
|
47
|
-
onHideQuickFilterBar: () => dispatch(
|
|
48
|
-
onShowQuickFilterBar: () => dispatch(
|
|
44
|
+
onHideQuickFilterBar: () => dispatch(SystemRedux.SystemQuickFilterBarHide()),
|
|
45
|
+
onShowQuickFilterBar: () => dispatch(SystemRedux.SystemQuickFilterBarShow()),
|
|
49
46
|
};
|
|
50
47
|
}
|
|
51
48
|
exports.FilterViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(FilterViewPanelComponent);
|
|
@@ -358,7 +358,7 @@ exports.FormatColumnFormatWizardSection = (props) => {
|
|
|
358
358
|
const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
359
359
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
360
360
|
const formatColumnApi = adaptable.api.formatColumnApi;
|
|
361
|
-
const customDisplayFormatters = (_c = (_b = (_a = adaptable.adaptableOptions) === null || _a === void 0 ? void 0 : _a.
|
|
361
|
+
const customDisplayFormatters = (_c = (_b = (_a = adaptable.adaptableOptions) === null || _a === void 0 ? void 0 : _a.userInterfaceOptions) === null || _b === void 0 ? void 0 : _b.customDisplayFormatters) !== null && _c !== void 0 ? _c : [];
|
|
362
362
|
const update = (updated) => {
|
|
363
363
|
props.onChange(Object.assign(Object.assign({}, data), updated));
|
|
364
364
|
};
|
|
@@ -57,7 +57,7 @@ exports.GridInfoPopup = (props) => {
|
|
|
57
57
|
const freeTextColumns = props.api.freeTextColumnApi
|
|
58
58
|
.getAllFreeTextColumn()
|
|
59
59
|
.map((c) => c.ColumnId);
|
|
60
|
-
const columnFilterDescription = props.api.
|
|
60
|
+
const columnFilterDescription = props.api.layoutApi.columnFiltersToString(props.api.layoutApi.getAllColumnFilter());
|
|
61
61
|
const sorts = ArrayExtensions_1.default.IsNotNullOrEmpty(props.api.gridApi.getColumnSorts())
|
|
62
62
|
? props.api.gridApi.getColumnSorts().map((gs) => {
|
|
63
63
|
return props.api.columnApi.getFriendlyNameFromColumnId(gs.ColumnId) + ': ' + gs.SortOrder;
|