@adaptabletools/adaptable 16.0.0-canary.1 → 16.0.0-canary.3
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 +31 -31
- package/base.css.map +1 -1
- package/bundle.cjs.js +155 -155
- package/index.css +39 -39
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -1
- package/src/AdaptableOptions/ActionRowOptions.d.ts +8 -5
- package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -2
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +6 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +1 -0
- package/src/AdaptableOptions/FormatColumnOptions.d.ts +51 -0
- package/src/AdaptableOptions/GroupingOptions.d.ts +0 -13
- package/src/AdaptableOptions/{SearchOptions.d.ts → QuickSearchOptions.d.ts} +3 -3
- package/src/AdaptableOptions/QuickSearchOptions.js +2 -0
- package/src/AdaptableOptions/TeamSharingOptions.d.ts +5 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +8 -41
- package/src/Api/ColumnApi.d.ts +18 -7
- package/src/Api/DataChangeHistoryApi.d.ts +6 -0
- package/src/Api/EventApi.d.ts +19 -6
- package/src/Api/Events/ChexboxColumnClicked.d.ts +1 -0
- package/src/Api/Events/ScheduleTriggered.d.ts +11 -0
- package/src/Api/Events/ScheduleTriggered.js +2 -0
- package/src/Api/Implementation/ActionRowApiImpl.js +7 -5
- package/src/Api/Implementation/ApiBase.d.ts +3 -2
- package/src/Api/Implementation/ApiBase.js +5 -2
- package/src/Api/Implementation/ChartingApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ChartingApiImpl.js +4 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +4 -1
- package/src/Api/Implementation/ColumnApiImpl.js +22 -3
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +1 -0
- package/src/Api/Implementation/DataChangeHistoryApiImpl.js +3 -0
- package/src/Api/Implementation/OptionsApiImpl.d.ts +3 -2
- package/src/Api/Implementation/OptionsApiImpl.js +5 -2
- package/src/Api/Implementation/PredicateApiImpl.d.ts +5 -5
- package/src/Api/Implementation/PredicateApiImpl.js +8 -8
- package/src/Api/Implementation/ScheduleApiImpl.d.ts +4 -0
- package/src/Api/Implementation/ScheduleApiImpl.js +5 -0
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +0 -3
- package/src/Api/Implementation/StyledColumnApiImpl.js +0 -26
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +5 -4
- package/src/Api/Implementation/UserInterfaceApiImpl.js +5 -0
- package/src/Api/Internal/AdaptableInternalApi.js +2 -2
- package/src/Api/Internal/AlertInternalApi.js +7 -2
- package/src/Api/Internal/FilterInternalApi.js +8 -4
- package/src/Api/Internal/FormatColumnInternalApi.js +12 -14
- package/src/Api/Internal/ScheduleInternalApi.d.ts +8 -0
- package/src/Api/Internal/ScheduleInternalApi.js +20 -0
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +5 -2
- package/src/Api/Internal/StyledColumnInternalApi.js +29 -2
- package/src/Api/Internal/UserInterfaceInternalApi.d.ts +5 -0
- package/src/Api/Internal/UserInterfaceInternalApi.js +18 -0
- package/src/Api/OptionsApi.d.ts +7 -3
- package/src/Api/PredicateApi.d.ts +5 -5
- package/src/Api/StyledColumnApi.d.ts +0 -14
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +7 -7
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +8 -15
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +65 -41
- package/src/PredefinedConfig/Common/Types.d.ts +1 -1
- package/src/PredefinedConfig/StyledColumnState.d.ts +3 -2
- package/src/PredefinedConfig/TeamSharingState.d.ts +1 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +17 -3
- package/src/Redux/Store/AdaptableStore.js +2 -3
- package/src/Strategy/AdaptableModuleBase.d.ts +6 -6
- package/src/Strategy/FlashingCellModule.js +6 -2
- package/src/Strategy/Interface/IModule.d.ts +2 -2
- package/src/Strategy/ScheduleModule.js +3 -2
- package/src/Strategy/StyledColumnModule.js +24 -15
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +7 -3
- package/src/Utilities/Helpers/AdaptableHelper.js +1 -1
- package/src/Utilities/MenuItem.d.ts +4 -4
- package/src/Utilities/Services/MetamodelService.js +5 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +1 -1
- package/src/Utilities/Services/RowEditService.js +1 -1
- package/src/Utilities/Services/TeamSharingService.d.ts +2 -0
- package/src/Utilities/Services/TeamSharingService.js +60 -3
- package/src/Utilities/Services/ValidationService.js +6 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.js +2 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.d.ts +6 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +32 -23
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.d.ts +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +5 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +11 -11
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.d.ts +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +11 -21
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.d.ts +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +6 -7
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.d.ts +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +4 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +3 -4
- package/src/View/AdaptableWizardView/Wizard.d.ts +4 -1
- package/src/View/AdaptableWizardView/Wizard.js +11 -10
- package/src/View/Charting/useChartingElements.js +1 -1
- package/src/View/Components/AdaptableButton/index.d.ts +3 -0
- package/src/View/Components/AdaptableButton/index.js +18 -0
- package/src/View/Components/AdaptableIconComponent/index.d.ts +7 -0
- package/src/View/Components/AdaptableIconComponent/index.js +16 -0
- package/src/View/Components/AdaptableIconComponent/useCustomIcon.d.ts +2 -0
- package/src/View/Components/AdaptableIconComponent/useCustomIcon.js +12 -0
- package/src/{components → View/Components}/Badge/index.d.ts +1 -1
- package/src/{components → View/Components}/Badge/index.js +1 -1
- package/src/View/Components/FilterForm/FilterForm.js +1 -1
- package/src/View/Components/FilterForm/ListBoxMenu.js +2 -2
- package/src/View/Components/FilterForm/QuickFilterForm.js +3 -2
- package/src/View/Components/Panels/PanelWithButton.d.ts +2 -2
- package/src/View/Components/Panels/PanelWithImage.d.ts +3 -3
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/TopBar.js +2 -3
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/PredicateEditor/PredicateEditor.js +4 -4
- package/src/View/Dashboard/CustomToolbarWrapper.js +2 -2
- package/src/View/Dashboard/Dashboard.js +4 -4
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +1 -0
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +13 -7
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +7 -1
- package/src/View/DataChangeHistory/buildActionColumnButton.d.ts +1 -1
- package/src/View/DataChangeHistory/buildActionColumnButton.js +9 -2
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +3 -3
- package/src/View/QuickSearch/QuickSearchStatusBarContent.js +1 -1
- package/src/View/QuickSearch/QuickSearchViewPanel.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +1 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +2 -9
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +0 -1
- package/src/View/UIHelper.d.ts +2 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +0 -2
- package/src/agGrid/ActionColumnRenderer.js +20 -5
- package/src/agGrid/Adaptable.d.ts +5 -2
- package/src/agGrid/Adaptable.js +61 -25
- package/src/agGrid/BadgeRenderer.js +19 -20
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/agGridHelper.js +4 -2
- package/src/agGrid/agGridMenuHelper.js +11 -4
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +1 -0
- package/src/agGrid/attachAddaptableColumnTypes.js +5 -4
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
- package/src/components/Icon/index.d.ts +11 -0
- package/src/components/{AdaptableIconComponent → Icon}/index.js +10 -10
- package/src/components/IconSelector/IconSelector.js +3 -3
- package/src/components/SimpleButton/index.js +10 -10
- package/src/components/Toggle/Toggle.d.ts +2 -2
- package/src/components/Toggle/Toggle.js +2 -2
- package/src/components/icons/index.d.ts +4 -4
- package/src/components/icons/index.js +6 -6
- package/src/metamodel/adaptable.metamodel.d.ts +125 -57
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +9 -6
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/Components/AdaptableViewIcon/index.d.ts +0 -10
- package/src/View/Components/AdaptableViewIcon/index.js +0 -18
- package/src/components/AdaptableIconComponent/index.d.ts +0 -11
- /package/src/AdaptableOptions/{SearchOptions.js → FormatColumnOptions.js} +0 -0
|
@@ -9,7 +9,7 @@ const usePrevious_1 = tslib_1.__importDefault(require("../../components/utils/us
|
|
|
9
9
|
const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
|
|
10
10
|
const buildActionColumnButton_1 = require("./buildActionColumnButton");
|
|
11
11
|
const DataChangeHistoryGrid = (props) => {
|
|
12
|
-
const { changeHistoryLog, adaptableContainerId, agGridContainerId, onUndoChange } = props;
|
|
12
|
+
const { changeHistoryLog, adaptableContainerId, agGridContainerId, onUndoChange, onClearRow } = props;
|
|
13
13
|
const mainAdaptableInstance = (0, AdaptableContext_1.useAdaptable)();
|
|
14
14
|
const [_adaptableApi, setAdaptableApi] = (0, react_1.useState)(null);
|
|
15
15
|
const adaptableApiRef = (0, react_1.useRef)(null);
|
|
@@ -22,14 +22,15 @@ const DataChangeHistoryGrid = (props) => {
|
|
|
22
22
|
(0, react_1.useEffect)(() => {
|
|
23
23
|
const initializeAdaptableGrid = async () => {
|
|
24
24
|
const gridOptions = buildGridOptions(mainAdaptableInstance, changeHistoryLog);
|
|
25
|
-
const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange);
|
|
26
|
-
const
|
|
25
|
+
const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange, onClearRow);
|
|
26
|
+
const modules = mainAdaptableInstance.getAgGridRegisteredModules();
|
|
27
|
+
const agGridConfig = {
|
|
27
28
|
gridOptions,
|
|
28
|
-
modules:
|
|
29
|
+
modules: modules,
|
|
29
30
|
};
|
|
30
31
|
// to avoid direct dependency to Adaptable.ts and thus creating a circular dependency;
|
|
31
32
|
const adaptableInitFn = Object.getPrototypeOf(mainAdaptableInstance).constructor.init;
|
|
32
|
-
const dataChangeHistoryAdaptableApi = await adaptableInitFn(adaptableOptions,
|
|
33
|
+
const dataChangeHistoryAdaptableApi = await adaptableInitFn(adaptableOptions, agGridConfig);
|
|
33
34
|
setAdaptableApi(dataChangeHistoryAdaptableApi);
|
|
34
35
|
};
|
|
35
36
|
initializeAdaptableGrid();
|
|
@@ -76,7 +77,7 @@ const DataChangeHistoryGrid = (props) => {
|
|
|
76
77
|
return React.createElement(React.Fragment, null);
|
|
77
78
|
};
|
|
78
79
|
exports.DataChangeHistoryGrid = DataChangeHistoryGrid;
|
|
79
|
-
const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange) => {
|
|
80
|
+
const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange, onClearRow) => {
|
|
80
81
|
var _a, _b, _c;
|
|
81
82
|
const mainAdaptableOptions = mainAdaptableInstance.adaptableOptions;
|
|
82
83
|
const mainAdaptableTheme = mainAdaptableInstance.api.themeApi.getCurrentTheme();
|
|
@@ -85,7 +86,12 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
85
86
|
const changeKey = rowData === null || rowData === void 0 ? void 0 : rowData['changeKey'];
|
|
86
87
|
changeKey && onUndoChange(changeKey);
|
|
87
88
|
};
|
|
88
|
-
const
|
|
89
|
+
const clearRow = (rowNode) => {
|
|
90
|
+
const rowData = rowNode === null || rowNode === void 0 ? void 0 : rowNode.data;
|
|
91
|
+
const changeKey = rowData === null || rowData === void 0 ? void 0 : rowData['changeKey'];
|
|
92
|
+
changeKey && onClearRow(changeKey);
|
|
93
|
+
};
|
|
94
|
+
const actionColumnButton = (0, buildActionColumnButton_1.buildActionColumnButton)((_a = mainAdaptableInstance.adaptableOptions) === null || _a === void 0 ? void 0 : _a.dataChangeHistoryOptions, mainAdaptableInstance.api, undoRowNode, clearRow);
|
|
89
95
|
let actionColumnOptions = undefined;
|
|
90
96
|
if (actionColumnButton) {
|
|
91
97
|
actionColumnOptions = {
|
|
@@ -52,6 +52,12 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
52
52
|
this.props.api.dataChangeHistoryApi.undoDataChangeHistoryEntry(changeToBeUndone);
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
+
const handleClearRow = (changeKey) => {
|
|
56
|
+
const changeToBeUndone = this.props.changeHistoryLog[changeKey];
|
|
57
|
+
if (changeToBeUndone) {
|
|
58
|
+
this.props.api.dataChangeHistoryApi.clearDataChangeHistoryEntry(changeToBeUndone);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
55
61
|
const currentAgGridTheme = this.props.api.themeApi.getAgGridCurrentThemeName();
|
|
56
62
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed() },
|
|
57
63
|
React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup", flexDirection: "column", style: { height: '100%' } },
|
|
@@ -65,7 +71,7 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
65
71
|
React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup--grid", "data-name": 'data-change-history--grid', flex: 1, alignSelf: 'stretch', flexDirection: 'column' },
|
|
66
72
|
React.createElement("div", { id: adaptableContainerId }),
|
|
67
73
|
React.createElement("div", { id: agGridContainerId, className: currentAgGridTheme, style: { height: '100%' } }),
|
|
68
|
-
React.createElement(DataChangeHistoryGrid_1.DataChangeHistoryGrid, { adaptableContainerId: adaptableContainerId, agGridContainerId: agGridContainerId, changeHistoryLog: this.props.changeHistoryLog, onUndoChange: handleChangeUndo })))));
|
|
74
|
+
React.createElement(DataChangeHistoryGrid_1.DataChangeHistoryGrid, { adaptableContainerId: adaptableContainerId, agGridContainerId: agGridContainerId, changeHistoryLog: this.props.changeHistoryLog, onUndoChange: handleChangeUndo, onClearRow: handleClearRow })))));
|
|
69
75
|
}
|
|
70
76
|
}
|
|
71
77
|
function mapStateToProps(state, ownProps) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IRowNode } from '@ag-grid-community/core';
|
|
2
2
|
import { ActionColumnContext, AdaptableApi, AdaptableButton, DataChangeHistoryOptions } from '../../types';
|
|
3
|
-
export declare const buildActionColumnButton: (options: DataChangeHistoryOptions, parentAdapTableApi: AdaptableApi, undoRowNode: (rowNode: IRowNode) => void) => AdaptableButton<ActionColumnContext<any>>[];
|
|
3
|
+
export declare const buildActionColumnButton: (options: DataChangeHistoryOptions, parentAdapTableApi: AdaptableApi, undoRowNode: (rowNode: IRowNode) => void, clearRow: (rowNode: IRowNode) => void) => AdaptableButton<ActionColumnContext<any>>[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildActionColumnButton = void 0;
|
|
4
|
-
const buildActionColumnButton = (options, parentAdapTableApi, undoRowNode) => {
|
|
4
|
+
const buildActionColumnButton = (options, parentAdapTableApi, undoRowNode, clearRow) => {
|
|
5
5
|
let changeHistoryButtons = options.changeHistoryButton;
|
|
6
6
|
if (!changeHistoryButtons ||
|
|
7
7
|
(Array.isArray(changeHistoryButtons) && changeHistoryButtons.length === 0)) {
|
|
@@ -25,9 +25,13 @@ const buildActionColumnButton = (options, parentAdapTableApi, undoRowNode) => {
|
|
|
25
25
|
undoRowNode(rowNode);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
const onClearRow = (context) => {
|
|
29
|
+
const rowNode = context.rowNode;
|
|
30
|
+
clearRow(rowNode);
|
|
31
|
+
};
|
|
28
32
|
const buildContext = (context) => {
|
|
29
33
|
const dataChangedInfo = context.rowNode.data.changeInfo;
|
|
30
|
-
return Object.assign(Object.assign({}, context), { isGroupNode: isGroupNode(context), undoDataChange: () => onUndo(context), dataChangedInfo,
|
|
34
|
+
return Object.assign(Object.assign({}, context), { isGroupNode: isGroupNode(context), undoDataChange: () => onUndo(context), clearRow: () => onClearRow(context), dataChangedInfo,
|
|
31
35
|
parentAdapTableApi });
|
|
32
36
|
};
|
|
33
37
|
return changeHistoryButtons.map((actionColumnOption) => ({
|
|
@@ -59,6 +63,9 @@ const buildActionColumnButton = (options, parentAdapTableApi, undoRowNode) => {
|
|
|
59
63
|
if (actionColumnOption.action === 'undo') {
|
|
60
64
|
onUndo(buildContext(context));
|
|
61
65
|
}
|
|
66
|
+
if (actionColumnOption.action === 'clear') {
|
|
67
|
+
onClearRow(buildContext(context));
|
|
68
|
+
}
|
|
62
69
|
if (typeof actionColumnOption.onClick === 'function') {
|
|
63
70
|
actionColumnOption.onClick(button, buildContext(context));
|
|
64
71
|
}
|
|
@@ -388,11 +388,11 @@ const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormat
|
|
|
388
388
|
] })))));
|
|
389
389
|
};
|
|
390
390
|
const FormatColumnFormatWizardSection = (props) => {
|
|
391
|
-
var _a
|
|
391
|
+
var _a;
|
|
392
392
|
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
393
393
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
394
394
|
const formatColumnApi = adaptable.api.formatColumnApi;
|
|
395
|
-
const customDisplayFormatters = (
|
|
395
|
+
const customDisplayFormatters = (_a = adaptable.api.optionsApi.getFormatColumnOptions().customDisplayFormatters) !== null && _a !== void 0 ? _a : [];
|
|
396
396
|
const update = (updated) => {
|
|
397
397
|
props.onChange(Object.assign(Object.assign({}, data), updated));
|
|
398
398
|
};
|
|
@@ -40,7 +40,7 @@ const FormatColumnSettingsWizardSection = (props) => {
|
|
|
40
40
|
props.onChange(Object.assign(Object.assign({}, data), { IncludeGroupedRows }));
|
|
41
41
|
};
|
|
42
42
|
return (React.createElement(Tabs_1.Tabs, null,
|
|
43
|
-
React.createElement(Tabs_1.Tabs.Tab, null, "
|
|
43
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
|
|
44
44
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
45
45
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
46
46
|
React.createElement(FormLayout_1.default, null,
|
|
@@ -18,7 +18,7 @@ const useQuickSearchDebounced_1 = require("./useQuickSearchDebounced");
|
|
|
18
18
|
const QuickSearchPopupComponent = (props) => {
|
|
19
19
|
const [searchText, search] = (0, useQuickSearchDebounced_1.useQuickSearchDebounced)(props);
|
|
20
20
|
const [state, setState] = (0, react_1.useState)({
|
|
21
|
-
RunQueryAfterQuickSearch: props.api.optionsApi.
|
|
21
|
+
RunQueryAfterQuickSearch: props.api.optionsApi.getQuickSearchOptions().filterResultsAfterQuickSearch,
|
|
22
22
|
EditedStyle: props.QuickSearchStyle,
|
|
23
23
|
});
|
|
24
24
|
const onUpdateStyle = (style) => {
|
|
@@ -27,14 +27,14 @@ const QuickSearchPopupComponent = (props) => {
|
|
|
27
27
|
};
|
|
28
28
|
const onQuickSearchBehaviourChange = (checked) => {
|
|
29
29
|
setState(Object.assign(Object.assign({}, state), { RunQueryAfterQuickSearch: checked }));
|
|
30
|
-
props.api.optionsApi.getAdaptableOptions().
|
|
30
|
+
props.api.optionsApi.getAdaptableOptions().quickSearchOptions.filterResultsAfterQuickSearch =
|
|
31
31
|
checked;
|
|
32
32
|
};
|
|
33
33
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: props.moduleInfo.FriendlyName, glyphicon: props.moduleInfo.Glyph, infoLink: props.moduleInfo.HelpPage, infoLinkDisabled: !props.api.internalApi.isDocumentationLinksDisplayed() },
|
|
34
34
|
React.createElement(Panel_1.default, { header: props.moduleInfo.FriendlyName + ' Text', style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginLeft: 2, marginRight: 2 },
|
|
35
35
|
' ',
|
|
36
36
|
React.createElement(FormLayout_1.default, null,
|
|
37
|
-
React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { "data-name": "quick-search-text", type: "text", marginLeft: 2, marginRight: 5, padding: 20, style: { height: '100%' }, placeholder: props.api.optionsApi.
|
|
37
|
+
React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { "data-name": "quick-search-text", type: "text", marginLeft: 2, marginRight: 5, padding: 20, style: { height: '100%' }, placeholder: props.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, value: searchText, OnTextChange: search }))),
|
|
38
38
|
React.createElement(Panel_1.default, { header: props.api.internalApi.getCorrectEnglishVariant('Behaviour'), style: { height: 'auto' }, variant: "default", borderRadius: "none", marginTop: 3, marginLeft: 2, marginRight: 2 },
|
|
39
39
|
' ',
|
|
40
40
|
React.createElement(rebass_1.Flex, { flexDirection: "column" },
|
|
@@ -12,6 +12,6 @@ const QuickSearchStatusBarContent = () => {
|
|
|
12
12
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
13
13
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
14
14
|
const handleTextChange = React.useCallback((text) => dispatch(QuickSearchRedux.QuickSearchRun(text)), []);
|
|
15
|
-
return (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { onClick: (event) => event.stopPropagation(), type: "text", inputStyle: { padding: '2px 3px', width: 90 }, placeholder: adaptable.api.optionsApi.
|
|
15
|
+
return (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { onClick: (event) => event.stopPropagation(), type: "text", inputStyle: { padding: '2px 3px', width: 90 }, placeholder: adaptable.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, value: text, OnTextChange: handleTextChange }));
|
|
16
16
|
};
|
|
17
17
|
exports.QuickSearchStatusBarContent = QuickSearchStatusBarContent;
|
|
@@ -10,7 +10,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
10
10
|
const QuickSearchViewPanelComponent = (props) => {
|
|
11
11
|
const [searchText, search] = (0, useQuickSearchDebounced_1.useQuickSearchDebounced)(props);
|
|
12
12
|
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
13
|
-
return (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { type: "text", placeholder: props.api.optionsApi.
|
|
13
|
+
return (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { type: "text", placeholder: props.api.optionsApi.getQuickSearchOptions().quickSearchPlaceholder, className: `ab-${elementType}__QuickSearch__text`, value: searchText, OnTextChange: search, style: { height: '100%' }, inputStyle: { width: '7rem' } }));
|
|
14
14
|
};
|
|
15
15
|
function mapStateToProps(state) {
|
|
16
16
|
return {
|
|
@@ -39,13 +39,13 @@ const ScheduleSettingsReminder = (props) => {
|
|
|
39
39
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
40
40
|
React.createElement(FormLayout_1.default, null,
|
|
41
41
|
React.createElement(FormLayout_1.FormRow, { label: "Header" },
|
|
42
|
-
React.createElement(Input_1.default, { "data-name": "header", width: 300, onChange: handleHeaderChange, placeholder: "Enter Reminder Header
|
|
42
|
+
React.createElement(Input_1.default, { "data-name": "header", width: 300, onChange: handleHeaderChange, placeholder: "Enter Reminder Header", type: "string", value: (_a = props.reminderSchedule) === null || _a === void 0 ? void 0 : _a.Header })),
|
|
43
43
|
React.createElement(FormLayout_1.FormRow, { label: "Message" },
|
|
44
44
|
React.createElement(Input_1.default, { "data-name": "message", width: 300, onChange: handleMessageChange, placeholder: "Enter Reminder Message", type: "string", value: (_b = props.reminderSchedule) === null || _b === void 0 ? void 0 : _b.Message })),
|
|
45
45
|
React.createElement(FormLayout_1.FormRow, { label: "Type" },
|
|
46
46
|
React.createElement(DropdownButton_1.default, { "data-name": "message-type", style: { width: 300 }, columns: ['label'], placeholder: "Select Option", items: messageTypes }, ((_c = props.reminderSchedule) === null || _c === void 0 ? void 0 : _c.MessageType) || 'Select Option')),
|
|
47
47
|
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
48
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "display-notification", checked: (_d = props.reminderSchedule) === null || _d === void 0 ? void 0 : _d.DisplayNotification, onChange: handleDisplayNotificationChange }, "Show the Reminder as
|
|
48
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "display-notification", checked: (_d = props.reminderSchedule) === null || _d === void 0 ? void 0 : _d.DisplayNotification, onChange: handleDisplayNotificationChange }, "Show the Reminder as a Notification")),
|
|
49
49
|
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
50
50
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "display-system-status", checked: (_e = props.reminderSchedule) === null || _e === void 0 ? void 0 : _e.DisplaySystemStatusMessage, onChange: handleDisplaySystemStatusChange }, "Display a System Status Message")))))));
|
|
51
51
|
};
|
|
@@ -4,8 +4,6 @@ exports.StyledColumnBadgeSection = exports.renderBadgeSummary = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
-
const AdaptableIconComponent_1 = require("../../../components/AdaptableIconComponent");
|
|
8
|
-
const Badge_1 = require("../../../components/Badge");
|
|
9
7
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
10
8
|
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
11
9
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
@@ -19,6 +17,8 @@ const PredicateEditor_1 = require("../../Components/PredicateEditor/PredicateEdi
|
|
|
19
17
|
const StyleComponent_1 = require("../../Components/StyleComponent");
|
|
20
18
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
21
19
|
const StyledColumnBadgePreview_1 = require("./StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview");
|
|
20
|
+
const Badge_1 = require("../../Components/Badge");
|
|
21
|
+
const AdaptableIconComponent_1 = require("../../Components/AdaptableIconComponent");
|
|
22
22
|
const BadgeEditor = (props) => {
|
|
23
23
|
var _a, _b;
|
|
24
24
|
const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
@@ -33,11 +33,7 @@ const StyledColumnWizardColumnSection = (props) => {
|
|
|
33
33
|
sortableColumns = api.columnApi.getBooleanColumns();
|
|
34
34
|
}
|
|
35
35
|
else if (data.SparkLineStyle) {
|
|
36
|
-
sortableColumns =
|
|
37
|
-
...api.columnApi.getNumberArrayColumns(),
|
|
38
|
-
...api.columnApi.getTupleNumberArrayColumns(),
|
|
39
|
-
...api.columnApi.getObjectNumberArrayColumns(),
|
|
40
|
-
];
|
|
36
|
+
sortableColumns = api.columnApi.getNumericArrayColumns();
|
|
41
37
|
}
|
|
42
38
|
else if (data.BadgeStyle) {
|
|
43
39
|
sortableColumns = [...api.columnApi.getNumericColumns(), ...api.columnApi.getStringColumns()];
|
|
@@ -4,9 +4,9 @@ exports.StyledColumnBadgePreview = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
-
const Badge_1 = require("../../../../../components/Badge");
|
|
8
7
|
const Tag_1 = require("../../../../../components/Tag");
|
|
9
8
|
const AdaptableContext_1 = require("../../../../AdaptableContext");
|
|
9
|
+
const Badge_1 = require("../../../../Components/Badge");
|
|
10
10
|
const StyledColumnBadgePreview = ({ data }) => {
|
|
11
11
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
12
12
|
const badgeStyle = data.BadgeStyle;
|
|
@@ -21,15 +21,8 @@ const StyledColumnBadgePreview = ({ data }) => {
|
|
|
21
21
|
const predicateStr = badge.Predicate
|
|
22
22
|
? adaptable.api.predicateApi.predicateToString(badge.Predicate)
|
|
23
23
|
: 'No Predicate';
|
|
24
|
-
let icon = badge.Icon;
|
|
25
|
-
const customIcon = badge.Icon &&
|
|
26
|
-
'name' in badge.Icon &&
|
|
27
|
-
adaptable.api.userInterfaceApi.getCustomIconDefinition(badge.Icon.name);
|
|
28
|
-
if (customIcon) {
|
|
29
|
-
icon = customIcon;
|
|
30
|
-
}
|
|
31
24
|
return (React.createElement(rebass_1.Box, { mb: 1, key: index },
|
|
32
|
-
React.createElement(Badge_1.Badge, { icon:
|
|
25
|
+
React.createElement(Badge_1.Badge, { icon: badge.Icon, adaptableStyle: badge.Style, iconPosition: badge.IconPosition }, value),
|
|
33
26
|
React.createElement(Tag_1.Tag, { ml: 2 }, predicateStr)));
|
|
34
27
|
})));
|
|
35
28
|
};
|
|
@@ -74,7 +74,6 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
74
74
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
75
75
|
React.createElement(TypeRadio_1.TypeRadio, { text: "Gradient", description: "Colour each cell in the column using a gradient value (Numeric Columns)", checked: Boolean(data.GradientStyle), onClick: () => handleTypeChange('gradient') }),
|
|
76
76
|
React.createElement(TypeRadio_1.TypeRadio, { text: "Percent Bar", description: "Display a coloured bar where the width is based on the cell (Numeric Columns)", checked: Boolean(data.PercentBarStyle), onClick: () => handleTypeChange('percent') }),
|
|
77
|
-
React.createElement(TypeRadio_1.TypeRadio, { text: "Check Box", description: "Display a checkbox (Boolean Columns)", checked: Boolean(data.CheckBoxStyle), onClick: () => handleTypeChange('checkbox') }),
|
|
78
77
|
adaptable.api.styledColumnApi.canDisplaySparklines() && (React.createElement(TypeRadio_1.TypeRadio, { text: "Sparkline", description: "Render the column as a Sparkline (Numeric Array Columns)", checked: Boolean(data.SparkLineStyle), onClick: () => handleTypeChange('sparkline') })),
|
|
79
78
|
React.createElement(TypeRadio_1.TypeRadio, { text: "Badge", description: "Display the column's values as Badges (All Columns)", checked: Boolean(data.BadgeStyle), onClick: () => handleTypeChange('badge') })))));
|
|
80
79
|
};
|
package/src/View/UIHelper.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { EditableConfigEntityState } from './Components/SharedProps/EditableConf
|
|
|
3
3
|
import { StatusColour } from '../PredefinedConfig/Common/Enums';
|
|
4
4
|
import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
|
|
5
5
|
import { Schedule, Weekday } from '../PredefinedConfig/Common/Schedule';
|
|
6
|
-
import { AdaptableColumnDataType,
|
|
6
|
+
import { AdaptableColumnDataType, AdaptableSystemIconName, AdaptableOptions } from '../types';
|
|
7
7
|
import { AdaptableAlert } from '../PredefinedConfig/Common/AdaptableAlert';
|
|
8
8
|
import { AdaptableMessageType } from '../PredefinedConfig/Common/AdaptableMessageType';
|
|
9
9
|
export declare const BLACK: string;
|
|
@@ -36,7 +36,7 @@ export declare function IsEmptyStyle(style: AdaptableStyle): boolean;
|
|
|
36
36
|
export declare function IsNotEmptyStyle(style: AdaptableStyle): boolean;
|
|
37
37
|
export declare function getMessageTypeByStatusColour(statusColour: StatusColour): AdaptableMessageType;
|
|
38
38
|
export declare function getButtonToneByMessageType(messageType: AdaptableMessageType): 'success' | 'error' | 'neutral' | 'none' | 'warning' | 'info' | 'accent';
|
|
39
|
-
export declare function getGlyphByMessageType(messageType: AdaptableMessageType):
|
|
39
|
+
export declare function getGlyphByMessageType(messageType: AdaptableMessageType): AdaptableSystemIconName;
|
|
40
40
|
export declare function getColorByMessageType(messageType: AdaptableMessageType): string;
|
|
41
41
|
export declare function getStyleForStatusColour(statusColour: StatusColour): CSSProperties;
|
|
42
42
|
export declare function getStyleForMessageType(messageType: AdaptableMessageType): CSSProperties;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ICellRendererComp, ICellRendererParams } from '@ag-grid-community/core';
|
|
3
|
-
import { ActionColumn } from '../types';
|
|
4
3
|
interface ActionColumnCellRendererParams extends ICellRendererParams {
|
|
5
|
-
actionColumn?: ActionColumn;
|
|
6
4
|
}
|
|
7
5
|
export declare const ReactActionColumnRenderer: (props: ActionColumnCellRendererParams) => JSX.Element;
|
|
8
6
|
export declare class ActionColumnRenderer implements ICellRendererComp {
|
|
@@ -6,6 +6,8 @@ const SimpleButton_1 = tslib_1.__importDefault(require("../components/SimpleButt
|
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const uuid_1 = require("../components/utils/uuid");
|
|
8
8
|
const useRerender_1 = require("../components/utils/useRerender");
|
|
9
|
+
const GeneralConstants_1 = require("../Utilities/Constants/GeneralConstants");
|
|
10
|
+
const renderWithAdaptableContext_1 = require("../View/renderWithAdaptableContext");
|
|
9
11
|
function getActionButtonsAndActionColumn(adaptable, actionColumn, colId) {
|
|
10
12
|
var _a;
|
|
11
13
|
const actionCol = actionColumn
|
|
@@ -27,7 +29,8 @@ function getActionButtonsAndActionColumn(adaptable, actionColumn, colId) {
|
|
|
27
29
|
actionColumn: actionCol,
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
|
-
const
|
|
32
|
+
const ActionButtons = (props) => {
|
|
33
|
+
const { buttons, adaptableApi, context, rerender } = props;
|
|
31
34
|
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
32
35
|
var _a, _b;
|
|
33
36
|
if (button.hidden && button.hidden(button, context)) {
|
|
@@ -57,7 +60,10 @@ const renderActionButtons = (buttons, adaptableApi, context, rerender) => {
|
|
|
57
60
|
const ReactActionColumnRenderer = (props) => {
|
|
58
61
|
const rerender = (0, useRerender_1.useRerender)();
|
|
59
62
|
const adaptable = props.api.__adaptable;
|
|
60
|
-
const { actionButtons, actionColumn } = getActionButtonsAndActionColumn(adaptable,
|
|
63
|
+
const { actionButtons, actionColumn } = getActionButtonsAndActionColumn(adaptable, {
|
|
64
|
+
columnId: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
65
|
+
actionColumnButton: adaptable.getActionRowButtonDefs(),
|
|
66
|
+
}, props.colDef.colId);
|
|
61
67
|
if (!actionColumn || !actionButtons.length) {
|
|
62
68
|
return null;
|
|
63
69
|
}
|
|
@@ -75,14 +81,18 @@ const ReactActionColumnRenderer = (props) => {
|
|
|
75
81
|
adaptableId: adaptable.adaptableOptions.adaptableId,
|
|
76
82
|
data: props.data,
|
|
77
83
|
};
|
|
78
|
-
return (React.createElement("div", { className: "ab-ActionColumn" },
|
|
84
|
+
return (React.createElement("div", { className: "ab-ActionColumn" },
|
|
85
|
+
React.createElement(ActionButtons, { buttons: actionButtons, adaptableApi: adaptable.api, context: buttonContext, rerender: rerender })));
|
|
79
86
|
};
|
|
80
87
|
exports.ReactActionColumnRenderer = ReactActionColumnRenderer;
|
|
81
88
|
class ActionColumnRenderer {
|
|
82
89
|
// gets called once before the renderer is used
|
|
83
90
|
init(params) {
|
|
84
91
|
const adaptable = params.api.__adaptable;
|
|
85
|
-
const { actionButtons, actionColumn } = getActionButtonsAndActionColumn(adaptable,
|
|
92
|
+
const { actionButtons, actionColumn } = getActionButtonsAndActionColumn(adaptable, {
|
|
93
|
+
columnId: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
94
|
+
actionColumnButton: adaptable.getActionRowButtonDefs(),
|
|
95
|
+
}, params.colDef.colId);
|
|
86
96
|
if (!actionColumn || !actionButtons.length) {
|
|
87
97
|
return;
|
|
88
98
|
}
|
|
@@ -106,7 +116,12 @@ class ActionColumnRenderer {
|
|
|
106
116
|
};
|
|
107
117
|
const eGui = this.eGui;
|
|
108
118
|
const doRender = () => {
|
|
109
|
-
this.unmountReactRoot = adaptable.renderReactRoot(
|
|
119
|
+
this.unmountReactRoot = adaptable.renderReactRoot((0, renderWithAdaptableContext_1.renderWithAdaptableContext)(ActionButtons({
|
|
120
|
+
buttons: actionButtons,
|
|
121
|
+
context: buttonContext,
|
|
122
|
+
rerender: doRender,
|
|
123
|
+
adaptableApi: adaptable.api,
|
|
124
|
+
}), adaptable), eGui);
|
|
110
125
|
};
|
|
111
126
|
this.render = doRender;
|
|
112
127
|
doRender();
|
|
@@ -18,7 +18,7 @@ import { SelectedRowInfo } from '../PredefinedConfig/Selection/SelectedRowInfo';
|
|
|
18
18
|
import { AdaptableTheme } from '../PredefinedConfig/ThemeState';
|
|
19
19
|
import { IAdaptableStore } from '../Redux/Store/Interface/IAdaptableStore';
|
|
20
20
|
import { IModuleCollection } from '../Strategy/Interface/IModule';
|
|
21
|
-
import { ChartDefinition } from '../types';
|
|
21
|
+
import { ActionColumnContext, AdaptableButton, ChartDefinition } from '../types';
|
|
22
22
|
import { EmitterCallback } from '../Utilities/Emitter';
|
|
23
23
|
import { IPPStyle } from '../Utilities/Interface/IPPStyle';
|
|
24
24
|
import { LicenseService } from '../Utilities/Services/LicenseService';
|
|
@@ -277,7 +277,8 @@ export declare class Adaptable implements IAdaptable {
|
|
|
277
277
|
private getColDefsForSpecialColumns;
|
|
278
278
|
getColDefsForFreeTextColumns(): ColDef<any, any>[];
|
|
279
279
|
setupColumnValueGetter({ col }: ColumnSetupInfo): void;
|
|
280
|
-
|
|
280
|
+
getActionRowButtonDefs(): AdaptableButton<ActionColumnContext<any>>[];
|
|
281
|
+
private getColDefsForActionRowColumns;
|
|
281
282
|
getColDefsForActionColumns(): ColDef<any, any>[];
|
|
282
283
|
updateColDefsForSpecialColumns(): void;
|
|
283
284
|
private getColDefsForCalculatedColumns;
|
|
@@ -327,6 +328,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
327
328
|
private applyCurrentTheme;
|
|
328
329
|
private applyFinalRendering;
|
|
329
330
|
isAgGridModulePresent(moduleName: ModuleNames): boolean;
|
|
331
|
+
private getAllAgGridRegisteredModules;
|
|
330
332
|
getAgGridRegisteredModules(): Module[];
|
|
331
333
|
private getAgGridRegisteredModuleNames;
|
|
332
334
|
private onRowDataChanged;
|
|
@@ -416,6 +418,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
416
418
|
initLicenseService(): LicenseService;
|
|
417
419
|
showCharts(chartsDefinitions: ChartDefinition[], chartContainer?: HTMLElement): ChartRef[];
|
|
418
420
|
showChart(chartDefinition: ChartDefinition, container?: HTMLElement): ChartRef;
|
|
421
|
+
updateChart(chart: ChartDefinition): void;
|
|
419
422
|
getChartRef(chartId: string): ChartRef;
|
|
420
423
|
getChartModels(): import("@ag-grid-community/core").ChartModel[];
|
|
421
424
|
getRowModelType(): import("@ag-grid-community/core").RowModelType;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -1256,7 +1256,8 @@ class Adaptable {
|
|
|
1256
1256
|
if (!params.node) {
|
|
1257
1257
|
return false;
|
|
1258
1258
|
}
|
|
1259
|
-
if (!this.api.optionsApi.
|
|
1259
|
+
if (!this.api.optionsApi.getQuickSearchOptions().runQuickSearchOnRowGroups &&
|
|
1260
|
+
params.node.group) {
|
|
1260
1261
|
return false;
|
|
1261
1262
|
}
|
|
1262
1263
|
let quickSearchValue = this.api.quickSearchApi.getQuickSearchValue();
|
|
@@ -1352,11 +1353,11 @@ class Adaptable {
|
|
|
1352
1353
|
}
|
|
1353
1354
|
const perfSetLayout = this.logger.beginPerf(`setLayout(${layout.Name})`);
|
|
1354
1355
|
layout.Columns = layout.Columns || [];
|
|
1355
|
-
const
|
|
1356
|
-
if (
|
|
1357
|
-
layout.Columns.push(
|
|
1356
|
+
const actionRowColumn = this.getColDefsForActionRowColumns()[0];
|
|
1357
|
+
if (actionRowColumn) {
|
|
1358
|
+
layout.Columns.push(actionRowColumn.colId);
|
|
1358
1359
|
layout.PinnedColumnsMap = layout.PinnedColumnsMap || {};
|
|
1359
|
-
layout.PinnedColumnsMap[
|
|
1360
|
+
layout.PinnedColumnsMap[actionRowColumn.colId] = actionRowColumn.pinned;
|
|
1360
1361
|
}
|
|
1361
1362
|
const layoutColumnsMap = layout.Columns.reduce((acc, colId) => {
|
|
1362
1363
|
acc[colId] = true;
|
|
@@ -1409,6 +1410,9 @@ class Adaptable {
|
|
|
1409
1410
|
// autosize only the columns which are part of the selected layout
|
|
1410
1411
|
colsToAutoSize[colId] = true;
|
|
1411
1412
|
}
|
|
1413
|
+
if (actionRowColumn && actionRowColumn.colId === colId) {
|
|
1414
|
+
newColState.width = actionRowColumn.width;
|
|
1415
|
+
}
|
|
1412
1416
|
newColState.rowGroupIndex =
|
|
1413
1417
|
groupedColumnsIndexesMap[colId] != null ? groupedColumnsIndexesMap[colId] : null;
|
|
1414
1418
|
const previousRowGroup = newColState.rowGroup;
|
|
@@ -1700,7 +1704,10 @@ class Adaptable {
|
|
|
1700
1704
|
}
|
|
1701
1705
|
layout.EnablePivot = this.gridOptions.columnApi.isPivotMode();
|
|
1702
1706
|
layout.PivotColumns = pivotColumns;
|
|
1703
|
-
if (
|
|
1707
|
+
if (
|
|
1708
|
+
// check first row node for presence of data without iterating over whole grid
|
|
1709
|
+
this.api.layoutApi.internalApi.areExpandedRowGroupsSavedInLayouts() &&
|
|
1710
|
+
this.api.gridApi.getFirstRowNode()) {
|
|
1704
1711
|
layout.ExpandedRowGroupValues = this.getExpandRowGroupsKeys();
|
|
1705
1712
|
}
|
|
1706
1713
|
this.persistLayout(layout);
|
|
@@ -1887,13 +1894,16 @@ class Adaptable {
|
|
|
1887
1894
|
});
|
|
1888
1895
|
}
|
|
1889
1896
|
}
|
|
1890
|
-
|
|
1897
|
+
let uniqueVals = (0, uniqBy_1.default)(returnValues, (dataItem) => {
|
|
1891
1898
|
const value = dataItem.rawValue;
|
|
1892
1899
|
if (value instanceof Date) {
|
|
1893
1900
|
return value.toISOString();
|
|
1894
1901
|
}
|
|
1895
1902
|
return value;
|
|
1896
1903
|
});
|
|
1904
|
+
if (column.dataType == 'String' && this.api.internalApi.isTextComparisonCaseSensitive()) {
|
|
1905
|
+
uniqueVals = (0, uniqBy_1.default)(uniqueVals, (d) => d.displayValue.toLowerCase());
|
|
1906
|
+
}
|
|
1897
1907
|
return uniqueVals.slice(0, this.adaptableOptions.filterOptions.maxFilterValuesToDisplay);
|
|
1898
1908
|
}
|
|
1899
1909
|
async getDistinctFilterValuesForColumn(column, visibleRowsOnly, filter, skipRowNode) {
|
|
@@ -2326,7 +2336,7 @@ class Adaptable {
|
|
|
2326
2336
|
...this.getColDefsForCalculatedColumns(),
|
|
2327
2337
|
...this.getColDefsForActionColumns(),
|
|
2328
2338
|
...this.getColDefsForFreeTextColumns(),
|
|
2329
|
-
...this.
|
|
2339
|
+
...this.getColDefsForActionRowColumns(),
|
|
2330
2340
|
];
|
|
2331
2341
|
}
|
|
2332
2342
|
getColDefsForFreeTextColumns() {
|
|
@@ -2386,12 +2396,12 @@ class Adaptable {
|
|
|
2386
2396
|
return userValue;
|
|
2387
2397
|
});
|
|
2388
2398
|
}
|
|
2389
|
-
|
|
2399
|
+
getActionRowButtonDefs() {
|
|
2390
2400
|
const actionRowButtons = this.api.actionRowApi.getActionRowButtons();
|
|
2391
2401
|
if (!(actionRowButtons === null || actionRowButtons === void 0 ? void 0 : actionRowButtons.length)) {
|
|
2392
2402
|
return [];
|
|
2393
2403
|
}
|
|
2394
|
-
const
|
|
2404
|
+
const defaultActionRowButtonConfiguration = {
|
|
2395
2405
|
create: {
|
|
2396
2406
|
icon: {
|
|
2397
2407
|
name: 'add',
|
|
@@ -2438,10 +2448,10 @@ class Adaptable {
|
|
|
2438
2448
|
},
|
|
2439
2449
|
},
|
|
2440
2450
|
};
|
|
2441
|
-
const
|
|
2451
|
+
const actionButtons = actionRowButtons
|
|
2442
2452
|
.map((actionRowButtonType) => {
|
|
2443
2453
|
var _a, _b;
|
|
2444
|
-
const defaultButtonConfig =
|
|
2454
|
+
const defaultButtonConfig = defaultActionRowButtonConfiguration[actionRowButtonType];
|
|
2445
2455
|
if (!defaultButtonConfig) {
|
|
2446
2456
|
// should NOT happen unless the user sent some invalid button type in the predefined config
|
|
2447
2457
|
return;
|
|
@@ -2458,12 +2468,20 @@ class Adaptable {
|
|
|
2458
2468
|
return Object.assign(Object.assign({}, defaultButtonConfig), customButtonConfig);
|
|
2459
2469
|
})
|
|
2460
2470
|
.filter(Boolean);
|
|
2461
|
-
|
|
2471
|
+
return actionButtons;
|
|
2472
|
+
}
|
|
2473
|
+
getColDefsForActionRowColumns() {
|
|
2474
|
+
const actionRowButtons = this.api.actionRowApi.getActionRowButtons();
|
|
2475
|
+
if (!(actionRowButtons === null || actionRowButtons === void 0 ? void 0 : actionRowButtons.length)) {
|
|
2462
2476
|
return [];
|
|
2463
2477
|
}
|
|
2464
|
-
const
|
|
2478
|
+
const actionButtons = this.getActionRowButtonDefs();
|
|
2479
|
+
if (!actionButtons.length) {
|
|
2480
|
+
return [];
|
|
2481
|
+
}
|
|
2482
|
+
const actionRowColumn = {
|
|
2465
2483
|
columnId: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
2466
|
-
actionColumnButton:
|
|
2484
|
+
actionColumnButton: actionButtons,
|
|
2467
2485
|
};
|
|
2468
2486
|
return [
|
|
2469
2487
|
{
|
|
@@ -2472,7 +2490,7 @@ class Adaptable {
|
|
|
2472
2490
|
hide: false,
|
|
2473
2491
|
editable: false,
|
|
2474
2492
|
// 15px is the icon width + left&right padding + left&right border
|
|
2475
|
-
width:
|
|
2493
|
+
width: actionButtons.length * (UIHelper_1.default.getSimpleButtonPaddingWidth() * 2 + 15) + 2,
|
|
2476
2494
|
resizable: false,
|
|
2477
2495
|
lockVisible: true,
|
|
2478
2496
|
suppressColumnsToolPanel: true,
|
|
@@ -2486,9 +2504,6 @@ class Adaptable {
|
|
|
2486
2504
|
? 'right'
|
|
2487
2505
|
: 'left',
|
|
2488
2506
|
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2489
|
-
cellRendererParams: {
|
|
2490
|
-
actionColumn: rowEditActionColumn,
|
|
2491
|
-
},
|
|
2492
2507
|
cellClass: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
2493
2508
|
type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
2494
2509
|
},
|
|
@@ -2873,7 +2888,10 @@ class Adaptable {
|
|
|
2873
2888
|
}
|
|
2874
2889
|
const gridContainerElement = this.getAgGridContainerElement();
|
|
2875
2890
|
if (gridContainerElement) {
|
|
2876
|
-
gridContainerElement.addEventListener('keydown', (this.listenerKeydown = (event) => this._emit('KeyDown', event))
|
|
2891
|
+
gridContainerElement.addEventListener('keydown', (this.listenerKeydown = (event) => this._emit('KeyDown', event)),
|
|
2892
|
+
// This is needed to be able to prevent the editor to be opened
|
|
2893
|
+
// in bubling phase the opening is not prevented with ag-grid v30
|
|
2894
|
+
true);
|
|
2877
2895
|
}
|
|
2878
2896
|
/*********************
|
|
2879
2897
|
* AG Grid EVENTS
|
|
@@ -3769,22 +3787,28 @@ class Adaptable {
|
|
|
3769
3787
|
if (standardAgGridRegistrationCheck) {
|
|
3770
3788
|
return true;
|
|
3771
3789
|
}
|
|
3790
|
+
const allAgGridRegisteredModules = this.getAllAgGridRegisteredModules();
|
|
3791
|
+
return !!allAgGridRegisteredModules[moduleName];
|
|
3792
|
+
}
|
|
3793
|
+
getAllAgGridRegisteredModules() {
|
|
3772
3794
|
// as of AG Grid 30.0.3 the ModuleRegistry gets an dynamic grid ID for the framework versions
|
|
3773
3795
|
// because of that we have to check ALL grid IDs to see if the module is registered
|
|
3774
3796
|
// TODO AFL: we should recheck this later, it seems AG Grid is already refactoring this faulty registration process
|
|
3775
3797
|
// @ts-ignore
|
|
3776
3798
|
const gridModulesMap = core_1.ModuleRegistry.gridModulesMap;
|
|
3777
|
-
let
|
|
3799
|
+
let allModulesMap = {};
|
|
3778
3800
|
Object.keys(gridModulesMap).forEach((gridId) => {
|
|
3779
|
-
|
|
3801
|
+
allModulesMap = Object.assign(Object.assign({}, allModulesMap), gridModulesMap[gridId]);
|
|
3780
3802
|
});
|
|
3781
|
-
return
|
|
3803
|
+
return allModulesMap;
|
|
3782
3804
|
}
|
|
3783
3805
|
getAgGridRegisteredModules() {
|
|
3784
|
-
|
|
3806
|
+
// see comment from getAllAgGridRegisteredModules()
|
|
3807
|
+
// return ModuleRegistry.__getRegisteredModules(this.gridOptions.gridId);
|
|
3808
|
+
return Object.values(this.getAllAgGridRegisteredModules());
|
|
3785
3809
|
}
|
|
3786
3810
|
getAgGridRegisteredModuleNames() {
|
|
3787
|
-
return
|
|
3811
|
+
return this.getAgGridRegisteredModules().map((module) => module.moduleName);
|
|
3788
3812
|
}
|
|
3789
3813
|
onRowDataChanged({ rowNode, oldData, newData, }) {
|
|
3790
3814
|
if (oldData == null || oldData == undefined) {
|
|
@@ -4983,6 +5007,18 @@ class Adaptable {
|
|
|
4983
5007
|
this.api.chartingApi.editChartDefinition(Object.assign(Object.assign({}, chartDefinition), { Model: chartModel }));
|
|
4984
5008
|
return chartRef;
|
|
4985
5009
|
}
|
|
5010
|
+
updateChart(chart) {
|
|
5011
|
+
const upgradableProperties = {
|
|
5012
|
+
// Only Range charts are supported to be created at run time
|
|
5013
|
+
// the other two are pivot & cross-filter
|
|
5014
|
+
type: 'rangeChartUpdate',
|
|
5015
|
+
chartId: chart.Model.chartId,
|
|
5016
|
+
unlinkChart: Boolean(chart.Model.unlinkChart),
|
|
5017
|
+
suppressChartRanges: Boolean(chart.Model.suppressChartRanges),
|
|
5018
|
+
aggFunc: chart.Model.aggFunc,
|
|
5019
|
+
};
|
|
5020
|
+
this.gridOptions.api.updateChart(upgradableProperties);
|
|
5021
|
+
}
|
|
4986
5022
|
getChartRef(chartId) {
|
|
4987
5023
|
return this.gridOptions.api.getChartRef(chartId);
|
|
4988
5024
|
}
|