@adaptabletools/adaptable 14.0.0-canary.1 → 14.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/bundle.cjs.js +149 -149
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/Api/AdaptableApi.d.ts +17 -9
- package/src/Api/ColumnApi.d.ts +2 -10
- package/src/Api/ConfigApi.d.ts +1 -5
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -1
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
- package/src/Api/Implementation/ApiBase.d.ts +6 -1
- package/src/Api/Implementation/ApiBase.js +15 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +0 -2
- package/src/Api/Implementation/ColumnApiImpl.js +0 -8
- package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ConfigApiImpl.js +3 -0
- package/src/Api/Implementation/OptionsApiImpl.d.ts +36 -0
- package/src/Api/Implementation/OptionsApiImpl.js +100 -0
- package/src/Api/Internal/AdaptableInternalApi.d.ts +7 -1
- package/src/Api/Internal/AdaptableInternalApi.js +8 -1
- package/src/Api/Internal/ExportInternalApi.d.ts +8 -0
- package/src/Api/Internal/ExportInternalApi.js +51 -0
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +11 -0
- package/src/Api/Internal/FormatColumnInternalApi.js +10 -0
- package/src/Api/OptionsApi.d.ts +131 -0
- package/src/Api/OptionsApi.js +2 -0
- package/src/PredefinedConfig/Common/FDC3Context.d.ts +4 -0
- package/src/PredefinedConfig/SystemState.d.ts +3 -0
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +8 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +26 -2
- package/src/Redux/Store/AdaptableStore.js +6 -0
- package/src/Strategy/AdaptableModuleBase.js +1 -1
- package/src/Strategy/AlertModule.js +1 -2
- package/src/Strategy/DashboardModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +2 -4
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/ExportModule.js +8 -1
- package/src/Strategy/FilterModule.js +1 -1
- package/src/Strategy/FlashingCellModule.js +1 -2
- package/src/Strategy/FreeTextColumnModule.js +1 -2
- package/src/Strategy/LayoutModule.js +6 -6
- package/src/Strategy/SettingsPanelModule.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -2
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +2 -4
- package/src/Utilities/Services/ChartingService.js +1 -1
- package/src/Utilities/Services/EntitlementService.js +4 -4
- package/src/Utilities/Services/Interface/IReportService.d.ts +7 -1
- package/src/Utilities/Services/QueryLanguageService.js +3 -3
- package/src/Utilities/Services/ReportService.d.ts +10 -2
- package/src/Utilities/Services/ReportService.js +40 -31
- package/src/Utilities/Services/TeamSharingService.js +3 -3
- package/src/Utilities/Services/ValidationService.js +6 -6
- package/src/View/AdaptableView.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +11 -2
- package/src/View/Alert/Wizard/isValidAlertRules.js +6 -27
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/EntityRulesEditor/Utilities.d.ts +2 -2
- package/src/View/Components/EntityRulesEditor/Utilities.js +19 -12
- package/src/View/Components/FilterForm/FilterForm.js +6 -7
- package/src/View/Components/FilterForm/QuickFilterForm.js +7 -9
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/TopBar.js +1 -1
- package/src/View/Components/Popups/AdaptableToaster.js +1 -1
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +1 -2
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -2
- package/src/View/Dashboard/Dashboard.js +5 -5
- package/src/View/Dashboard/DashboardPopup.js +2 -3
- package/src/View/Dashboard/DashboardViewPanel.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +1 -2
- package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +1 -1
- package/src/View/Filter/FilterViewPanel.js +3 -3
- package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +5 -14
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +4 -2
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +4 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +1 -1
- package/src/View/Layout/PivotDetailsPopoup.js +3 -3
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -2
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +9 -3
- 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/SpecialColumnSettingsWizardStep.js +2 -3
- package/src/agGrid/Adaptable.d.ts +1 -1
- package/src/agGrid/Adaptable.js +119 -38
- package/src/agGrid/PercentBarRenderer.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +18 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -70,7 +70,7 @@ const DashboardComponent = (props) => {
|
|
|
70
70
|
const renderModuleButtons = () => {
|
|
71
71
|
let shortcutsArray = props.DashboardState.ModuleButtons;
|
|
72
72
|
let shortcuts = null;
|
|
73
|
-
const alwaysShowInDashboard = props.api.
|
|
73
|
+
const alwaysShowInDashboard = props.api.optionsApi.getSettingsPanelOptions().alwaysShowInDashboard;
|
|
74
74
|
const shouldAddSettingsPanel = alwaysShowInDashboard &&
|
|
75
75
|
!props.api.internalApi.getEntitlementService().isModuleHiddenEntitlement('SettingsPanel');
|
|
76
76
|
if (shouldAddSettingsPanel && !shortcutsArray.includes('SettingsPanel')) {
|
|
@@ -100,14 +100,14 @@ const DashboardComponent = (props) => {
|
|
|
100
100
|
};
|
|
101
101
|
const renderQuickSearch = () => {
|
|
102
102
|
return (React.createElement(rebass_1.Box, { ml: 2 },
|
|
103
|
-
React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { type: "text", placeholder: props.api.
|
|
103
|
+
React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { type: "text", placeholder: props.api.optionsApi.getSearchOptions().quickSearchPlaceholder, className: "ab-DashboardToolbar__QuickSearch__text", value: searchText, OnTextChange: search, style: { width: 'auto' }, inputStyle: { width: '7rem' } })));
|
|
104
104
|
};
|
|
105
105
|
let instanceName = props.api.internalApi.getToolbarTitle();
|
|
106
|
-
let dashboardOptions = props.api.
|
|
106
|
+
let dashboardOptions = props.api.optionsApi.getDashboardOptions();
|
|
107
107
|
const shouldRenderQuickSearchHeader = dashboardOptions.showQuickSearchInHeader &&
|
|
108
108
|
props.api.internalApi.getModuleService().getModuleById(ModuleConstants_1.QuickSearchModuleId).isModuleAvailable();
|
|
109
|
-
const applicationIcon = props.api.
|
|
110
|
-
return props.DashboardState.IsHidden ? (React.createElement("div", null)) : (React.createElement(Dashboard_1.Dashboard, { title: instanceName, canFloat: props.api.
|
|
109
|
+
const applicationIcon = props.api.optionsApi.getUserInterfaceOptions().applicationIcon;
|
|
110
|
+
return props.DashboardState.IsHidden ? (React.createElement("div", null)) : (React.createElement(Dashboard_1.Dashboard, { title: instanceName, canFloat: props.api.optionsApi.getDashboardOptions().canFloat, activeTabIndex: props.DashboardState.ActiveTabIndex, onActiveTabIndexChange: (ActiveTabIndex) => {
|
|
111
111
|
props.onSetActiveTabIndex(ActiveTabIndex);
|
|
112
112
|
}, collapsed: props.DashboardState.IsCollapsed, onCollapsedChange: (IsCollapsed) => {
|
|
113
113
|
props.onSetIsCollapsed(IsCollapsed);
|
|
@@ -65,8 +65,7 @@ class DashboardPopupComponent extends React.Component {
|
|
|
65
65
|
const isDashboardDisabled = dashboardAccessLevel === 'ReadOnly';
|
|
66
66
|
const isModuleCheckboxDisabled = (module) => {
|
|
67
67
|
if (module === 'SettingsPanel') {
|
|
68
|
-
return this.props.api.
|
|
69
|
-
.alwaysShowInDashboard;
|
|
68
|
+
return this.props.api.optionsApi.getSettingsPanelOptions().alwaysShowInDashboard;
|
|
70
69
|
}
|
|
71
70
|
return false;
|
|
72
71
|
};
|
|
@@ -75,7 +74,7 @@ class DashboardPopupComponent extends React.Component {
|
|
|
75
74
|
areDashboardSettingsVisible && (React.createElement(Panel_1.default, { header: 'Dashboard Modes', style: { height: 'auto', overflow: 'visible' }, variant: "default", borderRadius: "none" },
|
|
76
75
|
React.createElement(CheckBox_1.CheckBox, { mr: 3, "data-name": "collapse", className: `${baseClassName}__settings-option`, checked: this.props.IsCollapsed, onChange: (checked) => this.props.onSetDashboardCollapsed(checked) }, "Collapse"),
|
|
77
76
|
' ',
|
|
78
|
-
this.props.api.
|
|
77
|
+
this.props.api.optionsApi.getDashboardOptions().canFloat && (React.createElement(CheckBox_1.CheckBox, { mr: 3, "data-name": "floating", className: `${baseClassName}__settings-option`, checked: this.props.IsFloating, onChange: (checked) => this.props.onSetDashboardFloating(checked) }, "Float")),
|
|
79
78
|
' ',
|
|
80
79
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "hidden", className: `${baseClassName}__settings-option`, checked: this.props.IsHidden, onChange: (checked) => this.props.onSetDashboardHidden(checked) }, "Hidden"))),
|
|
81
80
|
React.createElement(Panel_1.default, { header: 'Dashboard Contents', style: { borderBottom: '1px solid var(--ab-color-primary)' }, variant: "default", borderRadius: "none", marginTop: 4 },
|
|
@@ -17,7 +17,7 @@ class DashboardViewPanelComponent extends React.Component {
|
|
|
17
17
|
' ',
|
|
18
18
|
React.createElement(CheckBox_1.CheckBox, { className: `ab-${elementType}__Dashboard__collapsed-check`, marginTop: 0, fontSize: 2, padding: 1, checked: this.props.IsCollapsed, onChange: (checked) => this.props.onSetDashboardCollapsed(checked) }, "Collapse"),
|
|
19
19
|
'',
|
|
20
|
-
this.props.api.
|
|
20
|
+
this.props.api.optionsApi.getDashboardOptions().canFloat && (React.createElement(CheckBox_1.CheckBox, { className: `ab-${elementType}__Dashboard__collapsed-check`, marginTop: 0, fontSize: 2, padding: 1, checked: this.props.IsFloating, onChange: (checked) => this.props.onSetDashboardFloating(checked) }, "Float")),
|
|
21
21
|
' ',
|
|
22
22
|
React.createElement(CheckBox_1.CheckBox, { className: `ab-${elementType}__Dashboard__hidden-check`, marginTop: 0, fontSize: 2, padding: 1, checked: this.props.IsHidden, onChange: (checked) => this.props.onSetDashboardHidden(checked) }, "Hidden")));
|
|
23
23
|
}
|
|
@@ -64,7 +64,7 @@ const DataChangeHistoryGrid = (props) => {
|
|
|
64
64
|
// 2. this UI will be reimplemented with Infinite Table anyway
|
|
65
65
|
const addedRows = mapChangeHistoryRowData(addedChangeHistoryLogs, mainAdaptableInstance);
|
|
66
66
|
const removedRows = mapChangeHistoryRowData(removedChangeHistoryLogs, mainAdaptableInstance);
|
|
67
|
-
adaptableApi.
|
|
67
|
+
adaptableApi.optionsApi.getAgGridOptions().api.applyTransactionAsync({
|
|
68
68
|
add: addedRows,
|
|
69
69
|
remove: removedRows,
|
|
70
70
|
});
|
|
@@ -31,8 +31,7 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
31
31
|
suspended && (React.createElement(ButtonPlay_1.ButtonPlay, { className: "ab-DataChangeHistoryPopup--button-resume", "data-name": 'data-change-history--button-resume', variant: 'outlined', tooltip: 'Resume tracking data changes', onClick: () => onChangeHistoryResume() }, "Resume")),
|
|
32
32
|
enabled && (React.createElement(ButtonPause_1.ButtonPause, { className: "ab-DataChangeHistoryPopup--button-suspend", "data-name": 'data-change-history--button-suspend', variant: 'outlined', tooltip: 'Suspend tracking data changes', onClick: () => onChangeHistorySuspend() }, "Suspend")),
|
|
33
33
|
(enabled || suspended) && (React.createElement(ButtonStop_1.ButtonStop, { className: "ab-DataChangeHistoryPopup--button-deactivate", "data-name": 'data-change-history--button-deactivate', variant: 'outlined', tooltip: 'Deactivate data change tracking', onClick: () => onChangeHistoryDisable() }, "Deactivate"))));
|
|
34
|
-
const dateFormat = `${this.props.api.
|
|
35
|
-
.dateFormat} HH:mm:ss`;
|
|
34
|
+
const dateFormat = `${this.props.api.optionsApi.getUserInterfaceOptions().dateInputOptions.dateFormat} HH:mm:ss`;
|
|
36
35
|
const statusPanel = (React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup--status-panel", alignItems: 'center', style: { gap: 'var(--ab-space-1)' } },
|
|
37
36
|
enabled && (React.createElement(React.Fragment, null,
|
|
38
37
|
React.createElement(rebass_1.Text, { className: "ab-DataChangeHistoryPanel--status-active", style: { color: 'var(--ab-color-success)', fontWeight: 'bold' } }, "Active"),
|
|
@@ -40,7 +40,7 @@ const DataChangeHistoryViewPanelControl = (props) => {
|
|
|
40
40
|
suspended && (React.createElement(ButtonPlay_1.ButtonPlay, { className: "ab-DataChangeHistoryPanel--button-resume", "data-name": 'data-change-history--button-resume', tooltip: 'Resume tracking data changes', onClick: () => onChangeHistoryResume() })),
|
|
41
41
|
enabled && (React.createElement(ButtonPause_1.ButtonPause, { className: "ab-DataChangeHistoryPanel--button-suspend", "data-name": 'data-change-history--button-suspend', tooltip: 'Suspend tracking data changes', onClick: () => onChangeHistorySuspend() })),
|
|
42
42
|
(enabled || suspended) && (React.createElement(ButtonStop_1.ButtonStop, { className: "ab-DataChangeHistoryPanel--button-deactivate", "data-name": 'data-change-history--button-deactivate', tooltip: 'Deactivate data change tracking', onClick: () => onChangeHistoryDisable() }))));
|
|
43
|
-
const dateFormat = `${adaptable.api.
|
|
43
|
+
const dateFormat = `${adaptable.api.optionsApi.getUserInterfaceOptions().dateInputOptions.dateFormat} HH:mm:ss`;
|
|
44
44
|
const statusPanel = (React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPanel--status-panel", alignItems: 'center', style: { gap: gap } },
|
|
45
45
|
enabled && (React.createElement(Tooltip_1.default, { label: !!activationTime && `since ${(0, FormatHelper_1.DateFormatter)(activationTime, { Pattern: dateFormat })}` },
|
|
46
46
|
React.createElement(rebass_1.Text, { className: "ab-DataChangeHistoryPanel--status-active", fontSize: 2, style: { color: 'var(--ab-color-success)' } }, "Active"))),
|
|
@@ -19,10 +19,10 @@ class FilterViewPanelComponent extends React.Component {
|
|
|
19
19
|
super(props);
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
var _a, _b
|
|
22
|
+
var _a, _b;
|
|
23
23
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
24
|
-
const showClearButton = (
|
|
25
|
-
const showSuspendFilterButton = (
|
|
24
|
+
const showClearButton = (_a = this.props.api.optionsApi.getFilterOptions()) === null || _a === void 0 ? void 0 : _a.showClearFilterButton;
|
|
25
|
+
const showSuspendFilterButton = (_b = this.props.api.optionsApi.getFilterOptions()) === null || _b === void 0 ? void 0 : _b.showSuspendFilterButton;
|
|
26
26
|
const isAtLeastOneFilterActive = this.props.api.filterApi.getActiveColumnFilters().length > 0;
|
|
27
27
|
const isAtLeastOneFilter = this.props.api.filterApi.getColumnFilters().length > 0;
|
|
28
28
|
const handleSuspendUnsuspendAll = () => {
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isValidFlashingCellRules = void 0;
|
|
4
|
-
const
|
|
4
|
+
const Utilities_1 = require("../../Components/EntityRulesEditor/Utilities");
|
|
5
5
|
const isValidFlashingCellRules = (flashingCell, api, context) => {
|
|
6
|
-
var _a, _b
|
|
7
|
-
let valid = true;
|
|
6
|
+
var _a, _b;
|
|
8
7
|
if (!((_b = (_a = flashingCell.Rule) === null || _a === void 0 ? void 0 : _a.Predicates) === null || _b === void 0 ? void 0 : _b.length) && !flashingCell.Rule.BooleanExpression) {
|
|
9
8
|
return 'No Rule defined for Flashing Cell';
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return 'Predicate is not valid';
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
if (valid && flashingCell.Rule.BooleanExpression) {
|
|
18
|
-
valid = api.queryLanguageApi.isValidBooleanExpression(flashingCell.Rule.BooleanExpression, ModuleConstants_1.FlashingCellModuleId);
|
|
19
|
-
if (!valid) {
|
|
20
|
-
return 'The Expression is not a valid Boolean Expression';
|
|
21
|
-
}
|
|
10
|
+
const isRuleValid = (0, Utilities_1.isAdaptableRuleValid)(flashingCell, api, context);
|
|
11
|
+
if (typeof isRuleValid === 'string') {
|
|
12
|
+
return isRuleValid;
|
|
22
13
|
}
|
|
23
14
|
// boolean expressions may also be saved as named queries
|
|
24
15
|
if (context.namedQuery != false) {
|
|
@@ -151,6 +151,7 @@ const getFormatDisplayTypeForScope = (scope, api) => {
|
|
|
151
151
|
};
|
|
152
152
|
exports.getFormatDisplayTypeForScope = getFormatDisplayTypeForScope;
|
|
153
153
|
const renderDateFormat = (data, _onChange, setFormatOption, scopedCustomFormatters) => {
|
|
154
|
+
var _a;
|
|
154
155
|
if (data.DisplayFormat.Formatter !== 'DateFormatter') {
|
|
155
156
|
return null;
|
|
156
157
|
}
|
|
@@ -165,8 +166,9 @@ const renderDateFormat = (data, _onChange, setFormatOption, scopedCustomFormatte
|
|
|
165
166
|
")."),
|
|
166
167
|
React.createElement(FormLayout_1.default, null,
|
|
167
168
|
React.createElement(FormLayout_1.FormRow, { label: "Pattern" },
|
|
168
|
-
React.createElement(Input_1.default, { "data-name": "pattern", value: data.DisplayFormat.Options.Pattern, onChange: (e) => setFormatOption('Pattern', e.currentTarget.value), mr: 2 }),
|
|
169
|
-
React.createElement("span", null,
|
|
169
|
+
React.createElement(Input_1.default, { "data-name": "pattern", value: (_a = data.DisplayFormat.Options.Pattern) !== null && _a !== void 0 ? _a : '', onChange: (e) => setFormatOption('Pattern', e.currentTarget.value), mr: 2 }),
|
|
170
|
+
React.createElement("span", null, data.DisplayFormat.Options.Pattern &&
|
|
171
|
+
FormatHelper_1.default.DateFormatter(new Date(), data.DisplayFormat.Options, true)))))),
|
|
170
172
|
scopedCustomFormatters.length > 0 && (React.createElement(Tabs_1.Tabs, { marginTop: 2, keyboardNavigation: false },
|
|
171
173
|
React.createElement(Tabs_1.Tabs.Tab, null, "Custom Formats"),
|
|
172
174
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -97,7 +97,10 @@ function FormatColumnWizard(props) {
|
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
isValid: (abObject, api, context) => {
|
|
100
|
-
|
|
100
|
+
if (!abObject.Rule) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
return (0, Utilities_1.isAdaptableRuleValid)(abObject, api, context);
|
|
101
104
|
},
|
|
102
105
|
title: 'Condition',
|
|
103
106
|
details: 'Build a Rule when the Format Column should be applied',
|
|
@@ -62,7 +62,7 @@ exports.isValidFreeTextColumn = isValidFreeTextColumn;
|
|
|
62
62
|
const FreeTextColumnSettingsWizardSection = (props) => {
|
|
63
63
|
var _a;
|
|
64
64
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
65
|
-
const Pattern = api.
|
|
65
|
+
const Pattern = api.optionsApi.getUserInterfaceOptions().dateInputOptions.dateFormat;
|
|
66
66
|
const [ColumnNameFocused, setColumnNameFocused] = (0, react_1.useState)(false);
|
|
67
67
|
const inEdit = props.isEdit;
|
|
68
68
|
const validCheck = (0, exports.isValidFreeTextColumn)(data, api);
|
|
@@ -65,7 +65,7 @@ const GridInfoPopup = (props) => {
|
|
|
65
65
|
})
|
|
66
66
|
: null;
|
|
67
67
|
const selectedRowInfo = props.api.gridApi.getSelectedRowInfo();
|
|
68
|
-
if ((_a = props.api.
|
|
68
|
+
if ((_a = props.api.optionsApi.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.showAdapTableVersion) {
|
|
69
69
|
returnRows.push(createReadOnlyColItem(colItems, 'AdapTable Version', version_1.default));
|
|
70
70
|
}
|
|
71
71
|
returnRows.push(createReadOnlyColItem(colItems, 'Sorted Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(sorts) ? sorts.join('; ') : 'None'));
|
|
@@ -15,13 +15,13 @@ const tableDOMProps = {
|
|
|
15
15
|
const PivotDetailsPopoup = (props) => {
|
|
16
16
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
17
17
|
const adaptableApi = adaptable.api;
|
|
18
|
-
const primaryKey = adaptableApi.
|
|
18
|
+
const primaryKey = adaptableApi.optionsApi.getPrimaryKey();
|
|
19
19
|
const { hasPivotValue, rows, rowGroups, columnId, layout, aggColumn, pivotValue, pivotColumnId, } = props.popupProps;
|
|
20
20
|
let data = rows;
|
|
21
21
|
const columns = React.useMemo(() => {
|
|
22
|
-
var _a
|
|
22
|
+
var _a;
|
|
23
23
|
const getFriendlyName = (columnId) => adaptableApi.columnApi.getFriendlyNameForColumnId(columnId);
|
|
24
|
-
const pivotPreviewOptionColumn = (
|
|
24
|
+
const pivotPreviewOptionColumn = (_a = adaptableApi.optionsApi.getLayoutOptions()) === null || _a === void 0 ? void 0 : _a.pivotPreviewColumns;
|
|
25
25
|
let pivotPreviewExtraColumns = [];
|
|
26
26
|
if (typeof pivotPreviewOptionColumn === 'function') {
|
|
27
27
|
const pivotPreviewColumnsContext = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OnePageAdaptableWizardContextType } from '../../Wizard/OnePageAdaptableWizard';
|
|
3
|
-
import {
|
|
3
|
+
import { AdaptableApi, PlusMinusNudge } from '../../../types';
|
|
4
4
|
export declare const PlusMinusSettingsSummary: React.FunctionComponent<{
|
|
5
5
|
hasCondition: boolean;
|
|
6
6
|
}>;
|
|
7
|
-
export declare const isSettingsValid: (hasCondition: boolean) => (data: PlusMinusNudge, api: AdaptableApi, context: OnePageAdaptableWizardContextType<PlusMinusNudge>) =>
|
|
7
|
+
export declare const isSettingsValid: (hasCondition: boolean) => (data: PlusMinusNudge, api: AdaptableApi, context: OnePageAdaptableWizardContextType<PlusMinusNudge>) => string | true;
|
|
8
8
|
interface PlusMinusSettingsWizardSectionProps {
|
|
9
9
|
onChange: (plusMinusNudge: PlusMinusNudge) => void;
|
|
10
10
|
hasCondition: boolean;
|
|
@@ -24,9 +24,15 @@ const PlusMinusSettingsSummary = (props) => {
|
|
|
24
24
|
};
|
|
25
25
|
exports.PlusMinusSettingsSummary = PlusMinusSettingsSummary;
|
|
26
26
|
const isSettingsValid = (hasCondition) => (data, api, context) => {
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
27
|
+
var _a;
|
|
28
|
+
if (hasCondition) {
|
|
29
|
+
if (!((_a = data === null || data === void 0 ? void 0 : data.Rule) === null || _a === void 0 ? void 0 : _a.BooleanExpression)) {
|
|
30
|
+
return 'No valid Rule is specified';
|
|
31
|
+
}
|
|
32
|
+
const ruleValidation = (0, Utilities_1.isAdaptableRuleValid)(data, api, context);
|
|
33
|
+
if (typeof ruleValidation === 'string') {
|
|
34
|
+
return ruleValidation;
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
if (typeof data.NudgeValue !== 'number') {
|
|
32
38
|
return 'Nudge value is not specified';
|
|
@@ -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.
|
|
21
|
+
RunQueryAfterQuickSearch: props.api.optionsApi.getSearchOptions().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.
|
|
30
|
+
props.api.optionsApi.getAdaptableOptions().searchOptions.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.
|
|
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.getSearchOptions().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.
|
|
15
|
+
return (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { onClick: (event) => event.stopPropagation(), type: "text", inputStyle: { padding: '2px 3px', width: 90 }, placeholder: adaptable.api.optionsApi.getSearchOptions().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.
|
|
13
|
+
return (React.createElement(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { type: "text", placeholder: props.api.optionsApi.getSearchOptions().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 {
|
|
@@ -12,7 +12,7 @@ const AdaptableContext_1 = require("./AdaptableContext");
|
|
|
12
12
|
const SpecialColumnSettingsWizardStep = (props) => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
15
|
-
const possibleColumnTypes = adaptable.api.
|
|
15
|
+
const possibleColumnTypes = adaptable.api.optionsApi.getColumnOptions().columnTypes;
|
|
16
16
|
const { Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = (_a = props.settings) !== null && _a !== void 0 ? _a : {};
|
|
17
17
|
const handleColumnTypeChange = (columnType, checked) => {
|
|
18
18
|
var _a, _b, _c;
|
|
@@ -38,8 +38,7 @@ const SpecialColumnSettingsWizardStep = (props) => {
|
|
|
38
38
|
{ size: '30%', name: 'third' },
|
|
39
39
|
] },
|
|
40
40
|
React.createElement(FormLayout_1.FormRow, null,
|
|
41
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "filterable", checked: Filterable, onChange: (Filterable) => onSettingsChange({ Filterable }), disabled: !adaptable.api.
|
|
42
|
-
.enableFilterOnSpecialColumns }, "Filterable"),
|
|
41
|
+
React.createElement(CheckBox_1.CheckBox, { "data-name": "filterable", checked: Filterable, onChange: (Filterable) => onSettingsChange({ Filterable }), disabled: !adaptable.api.optionsApi.getFilterOptions().enableFilterOnSpecialColumns }, "Filterable"),
|
|
43
42
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "resizable", checked: Resizable, onChange: (Resizable) => onSettingsChange({ Resizable }) }, "Resizable"),
|
|
44
43
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "groupable", checked: Groupable, onChange: (Groupable) => onSettingsChange({ Groupable }) }, "Groupable")),
|
|
45
44
|
React.createElement(FormLayout_1.FormRow, null,
|
|
@@ -282,7 +282,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
282
282
|
private getUserColDefProperty;
|
|
283
283
|
setupColumnCellStyle({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
284
284
|
setupColumnCellClass({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
285
|
-
getExcelClassNameForCell(colId: string, primaryKeyValue: any): string;
|
|
285
|
+
getExcelClassNameForCell(colId: string, primaryKeyValue: any, userDefinedCellClass?: string | string[]): string;
|
|
286
286
|
setupColumnCellEditor({ colId, col }: ColumnSetupInfo): void;
|
|
287
287
|
setupColumnCellRenderer({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
288
288
|
setupColumnTooltipValueGetter({ col, colId, abColumn }: ColumnSetupInfo): void;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -436,7 +436,7 @@ class Adaptable {
|
|
|
436
436
|
this.TeamSharingService = new TeamSharingService_1.TeamSharingService(this.api);
|
|
437
437
|
// @ts-ignore
|
|
438
438
|
this.RowEditService = new RowEditService_1.RowEditService(this.api);
|
|
439
|
-
this.MetamodelService = new MetamodelService_1.MetamodelService(() => this.api.
|
|
439
|
+
this.MetamodelService = new MetamodelService_1.MetamodelService(() => this.api.optionsApi.getAdaptableOptions());
|
|
440
440
|
this.forPlugins((plugin) => plugin.afterInitServices(this));
|
|
441
441
|
// Set up Modules - we set up all the Modules suitable for AG Grid
|
|
442
442
|
// But users can make some hidden or readonly in their entitlements
|
|
@@ -3226,8 +3226,16 @@ class Adaptable {
|
|
|
3226
3226
|
const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
3227
3227
|
const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
3228
3228
|
const cellClass = (params) => {
|
|
3229
|
-
const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(abColumn, params);
|
|
3230
3229
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
3230
|
+
// if a Visual Data export is in progress, we are interested only in the Excel Style Class
|
|
3231
|
+
if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
|
|
3232
|
+
const userDefinedCellClass = typeof userCellClass === 'function' ? userCellClass(params) : userCellClass;
|
|
3233
|
+
const cellClassKey = this.getExcelClassNameForCell(colId, primaryKeyValue, userDefinedCellClass);
|
|
3234
|
+
return this.api.internalApi
|
|
3235
|
+
.getReportService()
|
|
3236
|
+
.getExcelStyleIdForCellClassKey(cellClassKey);
|
|
3237
|
+
}
|
|
3238
|
+
const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(abColumn, params);
|
|
3231
3239
|
const editableClassName = this.getEditableCellClass(abColumn, params);
|
|
3232
3240
|
const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
|
|
3233
3241
|
const highlightAlertClassName = this.getAlertCellClass(abColumn, params);
|
|
@@ -3235,7 +3243,6 @@ class Adaptable {
|
|
|
3235
3243
|
const styledColumn = this.api.styledColumnApi.getStyledColumnForColumnId(colId);
|
|
3236
3244
|
const hasStyledColumn = !!styledColumn && !styledColumn.IsSuspended;
|
|
3237
3245
|
const returnValue = [
|
|
3238
|
-
this.getExcelClassNameForCell(colId, primaryKeyValue),
|
|
3239
3246
|
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
3240
3247
|
!hasStyledColumn && formatColumns.length
|
|
3241
3248
|
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
@@ -3256,12 +3263,16 @@ class Adaptable {
|
|
|
3256
3263
|
return cellClass;
|
|
3257
3264
|
});
|
|
3258
3265
|
}
|
|
3259
|
-
getExcelClassNameForCell(colId, primaryKeyValue) {
|
|
3266
|
+
getExcelClassNameForCell(colId, primaryKeyValue, userDefinedCellClass) {
|
|
3260
3267
|
let excelClassName = `--excel-cell-${colId}-${primaryKeyValue}`;
|
|
3261
3268
|
if (excelClassName.indexOf(' ') > 0) {
|
|
3262
3269
|
excelClassName = excelClassName.replace(/\s/g, '_');
|
|
3263
3270
|
}
|
|
3264
|
-
return
|
|
3271
|
+
return userDefinedCellClass != null
|
|
3272
|
+
? `${excelClassName}-${Array.isArray(userDefinedCellClass)
|
|
3273
|
+
? userDefinedCellClass.join('-')
|
|
3274
|
+
: userDefinedCellClass}`
|
|
3275
|
+
: excelClassName;
|
|
3265
3276
|
}
|
|
3266
3277
|
setupColumnCellEditor({ colId, col }) {
|
|
3267
3278
|
const adaptableColumn = this.api.columnApi.getColumnWithColumnId(colId);
|
|
@@ -3461,7 +3472,7 @@ class Adaptable {
|
|
|
3461
3472
|
}
|
|
3462
3473
|
return (params) => {
|
|
3463
3474
|
const { node, value } = params;
|
|
3464
|
-
const
|
|
3475
|
+
const mostRelevantFormatColumn = this.api.formatColumnApi.internalApi.getMostRelevantFormatColumnForColumn(activeFormatColumnsWithDisplayFormat, abColumn, { node, value });
|
|
3465
3476
|
if (!mostRelevantFormatColumn) {
|
|
3466
3477
|
// ALL FormatColumns are conditional and NONE of them are relevant for this row
|
|
3467
3478
|
return value;
|
|
@@ -4226,7 +4237,7 @@ class Adaptable {
|
|
|
4226
4237
|
return false;
|
|
4227
4238
|
}
|
|
4228
4239
|
showQuickFilter() {
|
|
4229
|
-
const height = this.api.
|
|
4240
|
+
const height = this.api.optionsApi.getFilterOptions().quickFilterHeight;
|
|
4230
4241
|
this.gridOptions.api.setFloatingFiltersHeight(height);
|
|
4231
4242
|
}
|
|
4232
4243
|
hideQuickFilter() {
|
|
@@ -4479,8 +4490,30 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4479
4490
|
grid.destroy();
|
|
4480
4491
|
}
|
|
4481
4492
|
setExcelStylesForExport() {
|
|
4493
|
+
// we memoize as much as possible, as this is called quite A LOT
|
|
4494
|
+
const adaptableColumnMap = {};
|
|
4495
|
+
const getAdaptableColumnWithColumnId = (columnId) => {
|
|
4496
|
+
const memoizedColumn = adaptableColumnMap[columnId];
|
|
4497
|
+
if (memoizedColumn) {
|
|
4498
|
+
return memoizedColumn;
|
|
4499
|
+
}
|
|
4500
|
+
const abColumn = this.api.columnApi.getColumnWithColumnId(columnId);
|
|
4501
|
+
adaptableColumnMap[columnId] = abColumn;
|
|
4502
|
+
return abColumn;
|
|
4503
|
+
};
|
|
4504
|
+
const formatColumnsWithDisplayFormatForColumn = {};
|
|
4505
|
+
const getFormatColumnsWithDisplayFormatForColumn = (columnId) => {
|
|
4506
|
+
const memoizedFormatColumns = formatColumnsWithDisplayFormatForColumn[columnId];
|
|
4507
|
+
if (memoizedFormatColumns) {
|
|
4508
|
+
return memoizedFormatColumns;
|
|
4509
|
+
}
|
|
4510
|
+
const abColumn = getAdaptableColumnWithColumnId(columnId);
|
|
4511
|
+
const formatColumns = this.api.formatColumnApi.internalApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
4512
|
+
formatColumnsWithDisplayFormatForColumn[columnId] = formatColumns;
|
|
4513
|
+
return formatColumns;
|
|
4514
|
+
};
|
|
4515
|
+
const isDateCellExportedAsFormattedValue = this.api.exportApi.internalApi.isDateCellExportedAsFormattedValue();
|
|
4482
4516
|
this.setGridOptionsProperty('excelStyles', (userExcelStyles = []) => {
|
|
4483
|
-
const adaptableExcelStyles = [];
|
|
4484
4517
|
const displayedColumns = this.gridOptions.columnApi.getAllDisplayedColumns();
|
|
4485
4518
|
const colDefs = displayedColumns.map((column) => {
|
|
4486
4519
|
return column.getColDef();
|
|
@@ -4497,24 +4530,33 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4497
4530
|
};
|
|
4498
4531
|
const rowStyle = this.gridOptions.getRowStyle(rowParams);
|
|
4499
4532
|
displayedColumns.forEach((column, columnIndex) => {
|
|
4533
|
+
var _a, _b, _c;
|
|
4500
4534
|
const colDef = colDefs[columnIndex];
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4535
|
+
let cellClassParams;
|
|
4536
|
+
const getLazyCellClassParams = () => {
|
|
4537
|
+
if (!cellClassParams) {
|
|
4538
|
+
cellClassParams = {
|
|
4539
|
+
colDef,
|
|
4540
|
+
node,
|
|
4541
|
+
column,
|
|
4542
|
+
data: node.data,
|
|
4543
|
+
value: this.getRawValueFromRowNode(node, column.getId()),
|
|
4544
|
+
rowIndex,
|
|
4545
|
+
api: this.gridOptions.api,
|
|
4546
|
+
columnApi: this.gridOptions.columnApi,
|
|
4547
|
+
context: {},
|
|
4548
|
+
};
|
|
4549
|
+
}
|
|
4550
|
+
return cellClassParams;
|
|
4511
4551
|
};
|
|
4512
|
-
const cellStyle = typeof colDef.cellStyle === 'function'
|
|
4552
|
+
const cellStyle = typeof colDef.cellStyle === 'function'
|
|
4553
|
+
? colDef.cellStyle(getLazyCellClassParams())
|
|
4554
|
+
: {};
|
|
4513
4555
|
const excelStyles = [];
|
|
4514
4556
|
// add user defined excel styles
|
|
4515
4557
|
let userColDefCellClass = this.getUserColDefProperty(column.getColId(), 'cellClass');
|
|
4516
4558
|
const userDefinedCellClass = typeof userColDefCellClass === 'function'
|
|
4517
|
-
? userColDefCellClass(
|
|
4559
|
+
? userColDefCellClass(getLazyCellClassParams())
|
|
4518
4560
|
: userColDefCellClass;
|
|
4519
4561
|
const userDefinedExcelStyle = userDefinedCellClass &&
|
|
4520
4562
|
userExcelStyles.find((excelStyle) => {
|
|
@@ -4536,21 +4578,48 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4536
4578
|
if (Object.values(adaptableStyle).some((style) => style != null)) {
|
|
4537
4579
|
excelStyles.push(this.convertCSSToExcelStyle(adaptableStyle));
|
|
4538
4580
|
}
|
|
4581
|
+
const excelDataType = this.api.exportApi.internalApi.getExcelDataType(colDef === null || colDef === void 0 ? void 0 : colDef.type);
|
|
4539
4582
|
// don't add the cell style if it has no adaptable custom styles or user defined styles
|
|
4540
|
-
if (!excelStyles.length
|
|
4583
|
+
if (!excelStyles.length &&
|
|
4584
|
+
// if this is a formatted Date value, we still need to add the AG GRID specific type & numberFormat below
|
|
4585
|
+
!(excelDataType === 'DateTime' && isDateCellExportedAsFormattedValue)) {
|
|
4541
4586
|
return;
|
|
4542
4587
|
}
|
|
4543
|
-
const
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4588
|
+
const cellClassId = this.getExcelClassNameForCell(column.getId(), this.getPrimaryKeyValueFromRowNode(node), userDefinedCellClass);
|
|
4589
|
+
const finalCellExcelStyle = Object.assign({}, ...excelStyles);
|
|
4590
|
+
if (excelDataType === 'DateTime' && isDateCellExportedAsFormattedValue) {
|
|
4591
|
+
let dateFormatPattern = this.api.optionsApi.getExportOptions().exportDateFormat;
|
|
4592
|
+
const rawValue = this.getRawValueFromRowNode(node, column.getId());
|
|
4593
|
+
const abColumn = getAdaptableColumnWithColumnId(column.getColId());
|
|
4594
|
+
if (!dateFormatPattern) {
|
|
4595
|
+
const mostRelevantFormatColumn = this.api.formatColumnApi.internalApi.getMostRelevantFormatColumnForColumn(getFormatColumnsWithDisplayFormatForColumn(column.getColId()), abColumn, { node, value: rawValue });
|
|
4596
|
+
dateFormatPattern =
|
|
4597
|
+
((_a = mostRelevantFormatColumn === null || mostRelevantFormatColumn === void 0 ? void 0 : mostRelevantFormatColumn.DisplayFormat) === null || _a === void 0 ? void 0 : _a.Formatter) === 'DateFormatter' &&
|
|
4598
|
+
((_c = (_b = mostRelevantFormatColumn === null || mostRelevantFormatColumn === void 0 ? void 0 : mostRelevantFormatColumn.DisplayFormat) === null || _b === void 0 ? void 0 : _b.Options) === null || _c === void 0 ? void 0 : _c.Pattern);
|
|
4599
|
+
}
|
|
4600
|
+
if (dateFormatPattern) {
|
|
4601
|
+
const normalisedValue = this.getNormalisedValueFromRawValue(rawValue, abColumn);
|
|
4602
|
+
// we have to pass the date in the ISO format to Excel
|
|
4603
|
+
// see https://www.ag-grid.com/javascript-data-grid/excel-export-data-types/#dates
|
|
4604
|
+
const isoFormattedValue = normalisedValue === null || normalisedValue === void 0 ? void 0 : normalisedValue.toISOString();
|
|
4605
|
+
if (isoFormattedValue) {
|
|
4606
|
+
finalCellExcelStyle.dataType = 'DateTime';
|
|
4607
|
+
finalCellExcelStyle.numberFormat = { format: dateFormatPattern };
|
|
4608
|
+
// create a new cell key to ensure any user provided className does not interfere
|
|
4609
|
+
const cellKey = this.getExcelClassNameForCell(column.getColId(), this.getPrimaryKeyValueFromRowNode(node));
|
|
4610
|
+
// we need to register so that later the cellProcessor will put the isoFormattedValue through (thus giving the formatting responsability to Excel)
|
|
4611
|
+
this.api.internalApi
|
|
4612
|
+
.getReportService()
|
|
4613
|
+
.registerExcelStyleWithFormattedDate(cellKey, isoFormattedValue);
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4617
|
+
this.api.internalApi
|
|
4618
|
+
.getReportService()
|
|
4619
|
+
.registerExcelStyle(finalCellExcelStyle, cellClassId);
|
|
4551
4620
|
});
|
|
4552
4621
|
});
|
|
4553
|
-
return
|
|
4622
|
+
return this.api.internalApi.getReportService().getRegisteredExcelStyles();
|
|
4554
4623
|
});
|
|
4555
4624
|
}
|
|
4556
4625
|
exportVisualDataToExcel() {
|
|
@@ -4560,13 +4629,17 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4560
4629
|
sheetName: 'Sheet 1',
|
|
4561
4630
|
fileName: this.ReportService.getReportFileName(this.adaptableOptions.adaptableId),
|
|
4562
4631
|
// delegate the cell value processing to Adaptable
|
|
4563
|
-
processCellCallback: (
|
|
4632
|
+
processCellCallback: ({ node, column, value }) => {
|
|
4564
4633
|
var _a;
|
|
4565
|
-
|
|
4634
|
+
const columnId = column.getColId();
|
|
4635
|
+
if ((node === null || node === void 0 ? void 0 : node.group) &&
|
|
4636
|
+
(this.api.columnApi.isAutoRowGroupColumn(columnId) ||
|
|
4637
|
+
// we would still need to process the cell if this is a group row with an aggregated value
|
|
4638
|
+
((_a = node === null || node === void 0 ? void 0 : node.aggData) === null || _a === void 0 ? void 0 : _a[columnId]) == undefined)) {
|
|
4566
4639
|
// skip processing of row groups, this was already handled in processRowGroupCallback()
|
|
4567
|
-
return
|
|
4640
|
+
return value;
|
|
4568
4641
|
}
|
|
4569
|
-
return this.processCellForExcelExport(
|
|
4642
|
+
return this.processCellForExcelExport(node, columnId);
|
|
4570
4643
|
},
|
|
4571
4644
|
processRowGroupCallback: (params) => {
|
|
4572
4645
|
var _a;
|
|
@@ -4654,6 +4727,14 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4654
4727
|
return result;
|
|
4655
4728
|
}
|
|
4656
4729
|
processCellForExcelExport(rowNode, columnId) {
|
|
4730
|
+
if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
|
|
4731
|
+
const cellKey = this.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
|
|
4732
|
+
const isoFormattedDate = this.ReportService.getExcelStyleWithFormattedDate(cellKey);
|
|
4733
|
+
if (isoFormattedDate) {
|
|
4734
|
+
// this is a Date cell which will be formatted by Excel
|
|
4735
|
+
return isoFormattedDate;
|
|
4736
|
+
}
|
|
4737
|
+
}
|
|
4657
4738
|
return this.ReportService.getCellExportValueFromRowNode(rowNode, columnId);
|
|
4658
4739
|
}
|
|
4659
4740
|
processRowGroupForExcelExport(rowNode) {
|
|
@@ -4664,9 +4745,10 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4664
4745
|
}
|
|
4665
4746
|
let rawValue = rowNode.key;
|
|
4666
4747
|
if (this.api.columnApi.getColumnDataTypeForColumnId(columnId) === 'Date' &&
|
|
4667
|
-
typeof rawValue === 'string'
|
|
4748
|
+
typeof rawValue === 'string' &&
|
|
4749
|
+
!Number.isNaN(rawValue)) {
|
|
4668
4750
|
// AG-Grid converts the value to string, we have to reconvert it back
|
|
4669
|
-
const dateRawValue = (
|
|
4751
|
+
const dateRawValue = parseInt(rawValue);
|
|
4670
4752
|
if (dateRawValue != undefined) {
|
|
4671
4753
|
// @ts-ignore
|
|
4672
4754
|
rawValue = dateRawValue;
|
|
@@ -4693,8 +4775,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4693
4775
|
}
|
|
4694
4776
|
initLicenseService() {
|
|
4695
4777
|
const globalObject = typeof globalThis !== 'undefined' ? globalThis : window;
|
|
4696
|
-
const licenseKey = globalObject.ADAPTABLE_LICENSE_KEY ||
|
|
4697
|
-
this.api.internalApi.getAdaptableOptions().licenseKey;
|
|
4778
|
+
const licenseKey = globalObject.ADAPTABLE_LICENSE_KEY || this.api.optionsApi.getLicenseKey();
|
|
4698
4779
|
return new LicenseService_1.LicenseService(this, licenseKey, {
|
|
4699
4780
|
publishedAt: publishTimestamp_1.default,
|
|
4700
4781
|
});
|