@adaptabletools/adaptable 13.0.0-canary.2 → 13.0.0-canary.20
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/agGrid.d.ts +23 -1
- package/agGrid.js +23 -1
- package/base.css +1232 -733
- package/base.css.map +1 -0
- package/bundle.cjs.js +191 -174
- package/index.css +1250 -734
- package/index.css.map +1 -0
- package/package.json +5 -5
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +7 -3
- package/src/AdaptableOptions/AdaptableOptions.d.ts +0 -2
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +136 -27
- package/src/AdaptableOptions/ExportOptions.d.ts +2 -2
- package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +32 -0
- package/src/AdaptableOptions/FinsemblePluginOptions.js +2 -0
- package/src/AdaptableOptions/LayoutOptions.d.ts +2 -1
- package/src/Api/AdaptableApi.d.ts +2 -0
- package/src/Api/ColumnApi.d.ts +8 -2
- package/src/Api/ConditionalStyleApi.d.ts +20 -42
- package/src/Api/ConfigApi.d.ts +1 -2
- package/src/Api/ExportApi.d.ts +6 -6
- package/src/Api/FinsembleApi.d.ts +10 -0
- package/src/Api/FinsembleApi.js +2 -0
- package/src/Api/FormatColumnApi.d.ts +76 -59
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ColumnApiImpl.js +18 -14
- package/src/Api/Implementation/ExportApiImpl.d.ts +4 -4
- package/src/Api/Implementation/ExportApiImpl.js +14 -14
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +36 -17
- package/src/Api/Implementation/FormatColumnApiImpl.js +101 -185
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -0
- package/src/Api/Implementation/PluginsApiImpl.js +6 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -3
- package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -18
- package/src/Api/Implementation/ScopeApiImpl.d.ts +1 -1
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +25 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +193 -0
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -2
- package/src/Api/Implementation/ToolPanelApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ToolPanelApiImpl.js +8 -0
- package/src/Api/PluginsApi.d.ts +5 -0
- package/src/Api/QueryLanguageApi.d.ts +3 -7
- package/src/Api/ScopeApi.d.ts +1 -1
- package/src/Api/StyledColumnApi.d.ts +106 -0
- package/src/Api/StyledColumnApi.js +2 -0
- package/src/Api/ToolPanelApi.d.ts +10 -1
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +37 -37
- package/src/PredefinedConfig/Common/Types.d.ts +3 -3
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +10 -19
- package/src/PredefinedConfig/FormatColumnState.d.ts +21 -92
- package/src/PredefinedConfig/PredefinedConfig.d.ts +6 -0
- package/src/PredefinedConfig/StyledColumnState.d.ts +119 -0
- package/src/PredefinedConfig/StyledColumnState.js +2 -0
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +0 -18
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +0 -18
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +14 -0
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +43 -1
- package/src/Redux/ActionsReducers/PluginsRedux.d.ts +4 -4
- package/src/Redux/ActionsReducers/PluginsRedux.js +5 -5
- package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +49 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +92 -0
- package/src/Redux/Store/AdaptableStore.js +9 -0
- package/src/Strategy/ConditionalStyleModule.d.ts +0 -2
- package/src/Strategy/ConditionalStyleModule.js +3 -27
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +12 -0
- package/src/Strategy/FormatColumnModule.d.ts +3 -10
- package/src/Strategy/FormatColumnModule.js +42 -183
- package/src/Strategy/Interface/IModule.d.ts +1 -0
- package/src/Strategy/StyledColumnModule.d.ts +24 -0
- package/src/Strategy/StyledColumnModule.js +165 -0
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.d.ts +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +3 -4
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +1 -16
- package/src/Strategy/Utilities/getScopeViewItems.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
- package/src/Utilities/Constants/ModuleConstants.js +4 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +6 -12
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +2 -4
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +3 -1
- package/src/Utilities/Extensions/TypeExtensions.d.ts +1 -0
- package/src/Utilities/Extensions/TypeExtensions.js +5 -0
- package/src/Utilities/ObjectFactory.d.ts +5 -2
- package/src/Utilities/ObjectFactory.js +14 -7
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +14 -4
- package/src/Utilities/Services/{LicenseService.d.ts → LicenseService/index.d.ts} +3 -3
- package/src/Utilities/Services/LicenseService/index.js +1 -0
- package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.d.ts +1 -0
- package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.js +15 -0
- package/src/Utilities/Services/ModuleService.js +2 -0
- package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/QueryLanguageService.js +88 -39
- package/src/Utilities/Services/ReportService.js +6 -6
- package/src/Utilities/license/LicenseDetails.d.ts +1 -1
- package/src/Utilities/license/decode.d.ts +1 -0
- package/src/Utilities/license/decode.js +1 -1
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +9 -9
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +6 -5
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +3 -3
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +3 -3
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/AdaptableObjectRow/index.js +1 -6
- package/src/View/Components/Buttons/ButtonInfo.d.ts +1 -3
- package/src/View/Components/Buttons/ButtonInfo.js +3 -5
- package/src/View/Components/EntityRulesEditor/index.d.ts +2 -1
- package/src/View/Components/EntityRulesEditor/index.js +36 -35
- package/src/View/Components/FilterForm/FilterForm.js +11 -16
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +2 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +7 -13
- package/src/View/Components/NewScopeComponent.js +3 -3
- package/src/View/Components/Panels/PanelWithButton.js +1 -5
- package/src/View/Components/Panels/PanelWithImage.js +1 -5
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +1 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +3 -16
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -0
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +1 -1
- package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +5 -5
- package/src/View/Components/RangesComponent.d.ts +8 -1
- package/src/View/Components/RangesComponent.js +60 -24
- package/src/View/Components/ScopeComponent.js +6 -6
- package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
- package/src/View/Components/Selectors/ColumnSelector.js +2 -1
- package/src/View/Components/Selectors/ColumnValueSelector.js +2 -2
- package/src/View/Components/StyleComponent.js +14 -19
- package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +3 -9
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +25 -10
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +1 -1
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +2 -0
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +18 -0
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +3 -3
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +1 -1
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +1 -11
- package/src/View/DataSet/DataSetSelector.js +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
- package/src/View/Export/ExportViewPanel.d.ts +1 -1
- package/src/View/Export/ExportViewPanel.js +4 -4
- package/src/View/Export/ReportExportDropdown.js +1 -1
- package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -11
- package/src/View/Filter/FilterSummary.d.ts +1 -1
- package/src/View/Filter/FilterViewPanel.d.ts +1 -1
- package/src/View/FlashingCell/FlashingCellStyle.js +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +6 -6
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/MoveFormatColumn.d.ts +7 -0
- package/src/View/FormatColumn/MoveFormatColumn.js +27 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +28 -28
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +8 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +28 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +21 -3
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +2 -28
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -3
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +6 -300
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +15 -9
- package/src/View/FormatColumn/Wizard/constants.d.ts +1 -0
- package/src/View/FormatColumn/Wizard/constants.js +4 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +7 -7
- package/src/View/Layout/LayoutRadioSelector.js +1 -1
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
- package/src/View/Layout/Wizard/Components/ColumnLabels.js +1 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +7 -6
- package/src/View/Layout/Wizard/sections/SettingsSection.js +2 -2
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +3 -3
- package/src/View/Query/QueryViewPanel.d.ts +1 -1
- package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
- package/src/View/QuickSearch/QuickSearchViewPanel.d.ts +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsGlue42.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +3 -3
- package/src/View/SmartEdit/SmartEditPopup.js +3 -3
- package/src/View/SpecialColumnSettingsWizardStep.js +10 -10
- package/src/View/StateManagement/StateManagementPopup.js +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +77 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +65 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.js +234 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +59 -0
- package/src/View/SystemStatus/SystemStatusEntityRow.js +4 -6
- package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
- package/src/View/TeamSharing/SharedEntityObjectView.js +1 -1
- package/src/View/TeamSharing/TeamSharingApplyButton.js +1 -1
- package/src/View/Theme/ThemePopup.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +3 -0
- package/src/agGrid/ActionColumnRenderer.js +96 -64
- package/src/agGrid/Adaptable.d.ts +13 -9
- package/src/agGrid/Adaptable.js +207 -221
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.js +60 -16
- package/src/agGrid/FloatingFilterWrapper.d.ts +2 -2
- package/src/agGrid/FloatingFilterWrapper.js +71 -32
- package/src/agGrid/PercentBarRenderer.d.ts +6 -2
- package/src/agGrid/PercentBarRenderer.js +19 -17
- package/src/agGrid/agGridHelper.d.ts +6 -2
- package/src/agGrid/agGridHelper.js +16 -15
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -1
- package/src/agGrid/createAgStatusPanelComponent.js +17 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +5 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +87 -20
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +3 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +81 -30
- package/src/agGrid/weightedAverage.js +19 -11
- package/src/components/CheckBox/index.js +7 -2
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +13 -32
- package/src/components/ExpressionEditor/EditorInput.js +1 -1
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +1 -1
- package/src/components/ExpressionEditor/index.js +9 -17
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/StylePreview.js +2 -1
- package/src/components/icons/brush.d.ts +3 -0
- package/src/components/icons/brush.js +7 -0
- package/src/components/icons/index.js +2 -0
- package/src/metamodel/adaptable.metamodel.d.ts +191 -95
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +6 -3
- package/src/renderReactRoot.d.ts +2 -0
- package/src/renderReactRoot.js +11 -9
- package/src/types.d.ts +8 -4
- package/themes/dark.css +8 -4
- package/themes/dark.css.map +1 -0
- package/themes/light.css +4 -1
- package/themes/light.css.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableComponents.d.ts +0 -1
- package/src/AdaptableComponents.js +0 -5
- package/src/Utilities/Services/LicenseService.js +0 -1
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -23,7 +23,6 @@ const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
|
23
23
|
const StringExtensions_1 = require("../Utilities/Extensions/StringExtensions");
|
|
24
24
|
const getScrollbarSize_1 = tslib_1.__importDefault(require("../Utilities/getScrollbarSize"));
|
|
25
25
|
const AdaptableHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/AdaptableHelper"));
|
|
26
|
-
const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
|
|
27
26
|
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
28
27
|
const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
|
|
29
28
|
const ObjectFactory_1 = require("../Utilities/ObjectFactory");
|
|
@@ -86,6 +85,14 @@ const assignColId = (colDef) => {
|
|
|
86
85
|
const RowNodeProto = core_1.RowNode.prototype;
|
|
87
86
|
const RowNode_dispatchLocalEvent = RowNodeProto.dispatchLocalEvent;
|
|
88
87
|
const GridApi_setColumnDefs = core_1.GridApi.prototype.setColumnDefs;
|
|
88
|
+
['addCssClass', 'removeCssClass', 'containsCssClass', 'addOrRemoveCssClass'].forEach((methodName) => {
|
|
89
|
+
// @ts-ignore
|
|
90
|
+
const CssClassManager_originalMethod = core_1.CssClassManager.prototype[methodName];
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
core_1.CssClassManager.prototype[methodName] = function () {
|
|
93
|
+
return this.getGui() ? CssClassManager_originalMethod.apply(this, arguments) : undefined;
|
|
94
|
+
};
|
|
95
|
+
});
|
|
89
96
|
/**
|
|
90
97
|
* AgGrid does not expose Events.EVENT_ROW_DATA_CHANGED
|
|
91
98
|
* so we have to override `dispatchLocalEvent`
|
|
@@ -140,8 +147,10 @@ const forEachColumn = (cols, fn, parentColGroup) => {
|
|
|
140
147
|
const adaptableInstances = {};
|
|
141
148
|
class Adaptable {
|
|
142
149
|
constructor() {
|
|
150
|
+
this.variant = 'vanilla';
|
|
143
151
|
this.colDefPropertyCache = new Map();
|
|
144
152
|
this.gridOptionsPropertyCache = new Map();
|
|
153
|
+
this.columnMinMaxValuesCache = {};
|
|
145
154
|
this.isCheckedColumnDataType = false;
|
|
146
155
|
// only for our private / internal events used within Adaptable
|
|
147
156
|
// public events are emitted through the EventApi
|
|
@@ -344,7 +353,22 @@ class Adaptable {
|
|
|
344
353
|
if (runtimeConfig) {
|
|
345
354
|
this.supressReact18RenderWarning = !!runtimeConfig.supressReact18RenderWarning;
|
|
346
355
|
if (runtimeConfig.renderReactRoot) {
|
|
347
|
-
this.renderReactRoot =
|
|
356
|
+
this.renderReactRoot = (el, container) => {
|
|
357
|
+
const unmount = runtimeConfig.renderReactRoot(el, container);
|
|
358
|
+
return () => {
|
|
359
|
+
// we used to capture here because of FloatingFilters/Filters - see FloatingFilterWrapper and FilterWrapper
|
|
360
|
+
// as we didn't have a native React implementation for our React wrapper
|
|
361
|
+
// but we might need to do this again in the future for some other components that are not native React
|
|
362
|
+
// captureReactWarnings();
|
|
363
|
+
if (typeof unmount === 'function') {
|
|
364
|
+
unmount();
|
|
365
|
+
}
|
|
366
|
+
// releaseReactWarnings();
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
if (runtimeConfig.variant) {
|
|
371
|
+
this.variant = runtimeConfig.variant;
|
|
348
372
|
}
|
|
349
373
|
}
|
|
350
374
|
if (!_staticInit) {
|
|
@@ -429,10 +453,12 @@ class Adaptable {
|
|
|
429
453
|
abColDefCustom: (_f = this.gridOptions.columnTypes.abColDefCustom) !== null && _f !== void 0 ? _f : {},
|
|
430
454
|
});
|
|
431
455
|
if (this.gridOptions.columnTypes.abColDefNumber.cellEditor === undefined) {
|
|
432
|
-
this.gridOptions.columnTypes.abColDefNumber.cellEditor =
|
|
456
|
+
this.gridOptions.columnTypes.abColDefNumber.cellEditor =
|
|
457
|
+
this.variant === 'react' ? AdaptableNumberEditor_1.ReactAdaptableNumberEditor : AdaptableNumberEditor_1.AdaptableNumberEditor;
|
|
433
458
|
}
|
|
434
459
|
if (this.gridOptions.columnTypes.abColDefDate.cellEditor === undefined) {
|
|
435
|
-
this.gridOptions.columnTypes.abColDefDate.cellEditor =
|
|
460
|
+
this.gridOptions.columnTypes.abColDefDate.cellEditor =
|
|
461
|
+
this.variant === 'react' ? AdaptableDateEditor_1.ReactAdaptableDateEditor : AdaptableDateEditor_1.AdaptableDateEditor;
|
|
436
462
|
}
|
|
437
463
|
// validate the provided AdaptableOptions
|
|
438
464
|
this.MetamodelService.validateAdaptableOptionsValues();
|
|
@@ -466,19 +492,13 @@ class Adaptable {
|
|
|
466
492
|
AdaptableHelper_1.default.checkValidPrimaryKey(this);
|
|
467
493
|
}, (e) => {
|
|
468
494
|
(0, LoggingHelper_1.ConsoleLogError)('Failed to Init Modules : ', e);
|
|
469
|
-
// for now we
|
|
495
|
+
// for now we initialize the grid even if initialising Modules has failed (perhaps revisit this?)
|
|
470
496
|
this.initInternalGridLogic();
|
|
471
497
|
this.api.internalApi.hideLoadingScreen(); // doesnt really help but at least clears the screen
|
|
472
498
|
}).then(async () => {
|
|
473
499
|
this.api.internalApi.hideLoadingScreen();
|
|
474
500
|
this.isInitialised = true;
|
|
475
501
|
this._adaptableReady = true;
|
|
476
|
-
// setTimeout(() => {
|
|
477
|
-
// this.api.eventApi.emit('AdaptableReady', {
|
|
478
|
-
// adaptableApi: this.api,
|
|
479
|
-
// gridOptions: this.adaptableOptions.gridOptions,
|
|
480
|
-
// });
|
|
481
|
-
// }, 0);
|
|
482
502
|
});
|
|
483
503
|
if (this.abContainerElement == null) {
|
|
484
504
|
this.abContainerElement = this.getAdaptableContainerElement();
|
|
@@ -898,66 +918,83 @@ class Adaptable {
|
|
|
898
918
|
this.gridOptions.api.setColumnDefs(colDefs);
|
|
899
919
|
this.updateColumnsIntoStore(); // todo remove this from here!!!
|
|
900
920
|
}
|
|
901
|
-
|
|
902
|
-
if (!formatColumn.IncludeGroupedRows && this.isGroupRowNode(params.node)) {
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
if (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) {
|
|
906
|
-
return;
|
|
907
|
-
}
|
|
921
|
+
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
908
922
|
let style = {};
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
if (matchingRange) {
|
|
926
|
-
cellBackColor = matchingRange.Color;
|
|
927
|
-
reverseGradient = matchingRange.ReverseGradient;
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
const increase = Math.abs(max - min);
|
|
931
|
-
const percentage = ((params.value - min) / increase) * 100;
|
|
932
|
-
let alpha = Number((percentage / 100).toPrecision(2));
|
|
933
|
-
if (reverseGradient) {
|
|
934
|
-
alpha = 1 - alpha;
|
|
923
|
+
const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
|
|
924
|
+
if (gradientStyle) {
|
|
925
|
+
const min = this.api.styledColumnApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
926
|
+
const max = this.api.styledColumnApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
927
|
+
const clampedValue = (0, clamp_1.default)(params.value, min, max);
|
|
928
|
+
let cellBackColor;
|
|
929
|
+
let reverseGradient = false;
|
|
930
|
+
if (gradientStyle.ColumnComparison) {
|
|
931
|
+
cellBackColor = gradientStyle.ColumnComparison.Color;
|
|
932
|
+
}
|
|
933
|
+
else {
|
|
934
|
+
const matchingRange = gradientStyle.CellRanges.find((r) => (r.Min == 'Col-Min' || r.Min <= clampedValue) &&
|
|
935
|
+
(r.Max == 'Col-Max' || r.Max >= clampedValue));
|
|
936
|
+
if (matchingRange) {
|
|
937
|
+
cellBackColor = matchingRange.Color;
|
|
938
|
+
reverseGradient = matchingRange.ReverseGradient;
|
|
935
939
|
}
|
|
936
|
-
const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
|
|
937
|
-
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
938
940
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
941
|
+
const increase = Math.abs(max - min);
|
|
942
|
+
const percentage = ((params.value - min) / increase) * 100;
|
|
943
|
+
let alpha = Number((percentage / 100).toPrecision(2));
|
|
944
|
+
if (reverseGradient) {
|
|
945
|
+
alpha = 1 - alpha;
|
|
942
946
|
}
|
|
947
|
+
const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
|
|
948
|
+
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
943
949
|
}
|
|
944
|
-
|
|
945
|
-
style =
|
|
950
|
+
if (styledColumn.PercentBarStyle && styledColumn.PercentBarStyle.CellText) {
|
|
951
|
+
style.paddingTop = 0;
|
|
952
|
+
style.paddingBottom = 0;
|
|
946
953
|
}
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
954
|
+
return style;
|
|
955
|
+
}
|
|
956
|
+
getFormatColumnAdaptableStyle(formatColumns) {
|
|
957
|
+
// first has more precedence, then they need to be applied in reverse order
|
|
958
|
+
return formatColumns.reduceRight((style, formatColumn) => {
|
|
959
|
+
const formatColumnStyle = formatColumn.Style
|
|
960
|
+
? this.convertAdaptableStyleToCSS(formatColumn.Style)
|
|
961
|
+
: {};
|
|
962
|
+
if (formatColumn.CellAlignment) {
|
|
963
|
+
switch (formatColumn.CellAlignment) {
|
|
964
|
+
case 'Left':
|
|
965
|
+
style.textAlign = 'left';
|
|
966
|
+
break;
|
|
967
|
+
case 'Right':
|
|
968
|
+
style.textAlign = 'right';
|
|
969
|
+
break;
|
|
970
|
+
case 'Center':
|
|
971
|
+
style.textAlign = 'center';
|
|
972
|
+
break;
|
|
973
|
+
}
|
|
958
974
|
}
|
|
975
|
+
return Object.assign(Object.assign({}, style), formatColumnStyle);
|
|
976
|
+
}, {});
|
|
977
|
+
}
|
|
978
|
+
getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params) {
|
|
979
|
+
if (!activeFormatColumnsWithStyle.length) {
|
|
980
|
+
return {};
|
|
959
981
|
}
|
|
960
|
-
|
|
982
|
+
const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
|
|
983
|
+
return this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params);
|
|
984
|
+
});
|
|
985
|
+
return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
|
|
986
|
+
}
|
|
987
|
+
getFormatColumnCellClass(formatColumns, abColumn, params) {
|
|
988
|
+
const classNames = formatColumns
|
|
989
|
+
.map((formatColumn) => {
|
|
990
|
+
var _a, _b;
|
|
991
|
+
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
992
|
+
this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params)) {
|
|
993
|
+
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
994
|
+
}
|
|
995
|
+
})
|
|
996
|
+
.filter((x) => !!x);
|
|
997
|
+
return classNames;
|
|
961
998
|
}
|
|
962
999
|
getActiveAlertWithHighlightCell(col, params) {
|
|
963
1000
|
return this.api.internalApi.getAdaptableAlertWithHighlightCell(col.columnId, params.node);
|
|
@@ -1107,31 +1144,6 @@ class Adaptable {
|
|
|
1107
1144
|
}
|
|
1108
1145
|
return undefined;
|
|
1109
1146
|
}
|
|
1110
|
-
getConditionalStyleCellStyle(conditionalStyles = [], abColumn, params) {
|
|
1111
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
1112
|
-
const result = conditionalStyles.reduce((result, conditionalStyle) => {
|
|
1113
|
-
if (module.isConditionalStyleActiveForColumn(conditionalStyle, abColumn, params)) {
|
|
1114
|
-
return Object.assign(Object.assign({}, result), conditionalStyle.Style);
|
|
1115
|
-
}
|
|
1116
|
-
else {
|
|
1117
|
-
return result;
|
|
1118
|
-
}
|
|
1119
|
-
}, {});
|
|
1120
|
-
return this.convertAdaptableStyleToCSS(result);
|
|
1121
|
-
}
|
|
1122
|
-
getConditionalStyleCellClass(conditionalStyles = [], abColumn, params) {
|
|
1123
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
1124
|
-
let classNames = conditionalStyles
|
|
1125
|
-
.map((conditionalStyle) => {
|
|
1126
|
-
var _a, _b;
|
|
1127
|
-
if (((_a = conditionalStyle.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
1128
|
-
module.isConditionalStyleActiveForColumn(conditionalStyle, abColumn, params)) {
|
|
1129
|
-
return (_b = conditionalStyle.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
1130
|
-
}
|
|
1131
|
-
})
|
|
1132
|
-
.filter((x) => !!x);
|
|
1133
|
-
return classNames;
|
|
1134
|
-
}
|
|
1135
1147
|
getEditableCellClass(abColumn, params) {
|
|
1136
1148
|
const editableCellStyle = this.api.userInterfaceApi.getEditableCellStyle();
|
|
1137
1149
|
if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
|
|
@@ -1274,7 +1286,7 @@ class Adaptable {
|
|
|
1274
1286
|
const colId = customSort.ColumnId;
|
|
1275
1287
|
if (!layoutColumnsMap[colId]) {
|
|
1276
1288
|
// pivot layouts may have no pivot columns, only aggregation columns
|
|
1277
|
-
if (layout.AggregationColumns[colId] == undefined) {
|
|
1289
|
+
if (!layout.AggregationColumns || layout.AggregationColumns[colId] == undefined) {
|
|
1278
1290
|
return acc;
|
|
1279
1291
|
}
|
|
1280
1292
|
}
|
|
@@ -1542,7 +1554,10 @@ class Adaptable {
|
|
|
1542
1554
|
layout.RowGroupedColumns = groupedColumns;
|
|
1543
1555
|
if (Object.keys(aggregatedColumns).length) {
|
|
1544
1556
|
// ag-grid aggregations are not 1-1 with adaptable column-aggregations
|
|
1545
|
-
layout.AggregationColumns = this.
|
|
1557
|
+
layout.AggregationColumns = this.mapAggregationColumnsFromGrid(aggregatedColumns, currentLayout);
|
|
1558
|
+
}
|
|
1559
|
+
else {
|
|
1560
|
+
layout.AggregationColumns = {};
|
|
1546
1561
|
}
|
|
1547
1562
|
layout.EnablePivot = this.gridOptions.columnApi.isPivotMode();
|
|
1548
1563
|
layout.PivotColumns = pivotColumns;
|
|
@@ -1851,7 +1866,7 @@ class Adaptable {
|
|
|
1851
1866
|
if (colDef && colDef.cellRenderer != null) {
|
|
1852
1867
|
return true;
|
|
1853
1868
|
}
|
|
1854
|
-
if (this.api.columnApi.
|
|
1869
|
+
if (this.api.columnApi.isStyledNumericColumn(column)) {
|
|
1855
1870
|
return true;
|
|
1856
1871
|
}
|
|
1857
1872
|
if (this.api.columnApi.isBooleanColumn(column)) {
|
|
@@ -1906,7 +1921,7 @@ class Adaptable {
|
|
|
1906
1921
|
}
|
|
1907
1922
|
getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
|
|
1908
1923
|
const abColumn = this.api.columnApi.getColumnFromId(columnId);
|
|
1909
|
-
const isRenderedColumn = this.api.columnApi.
|
|
1924
|
+
const isRenderedColumn = this.api.columnApi.isStyledNumericColumn(abColumn);
|
|
1910
1925
|
if (isRenderedColumn) {
|
|
1911
1926
|
const colDef = this.gridOptions.api.getColumnDef(columnId);
|
|
1912
1927
|
if (typeof colDef.valueFormatter == 'function') {
|
|
@@ -2309,7 +2324,7 @@ class Adaptable {
|
|
|
2309
2324
|
pinned: this.adaptableOptions.actionOptions.actionRowButtonsPosition === 'pinnedRight'
|
|
2310
2325
|
? 'right'
|
|
2311
2326
|
: 'left',
|
|
2312
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2327
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2313
2328
|
cellRendererParams: {
|
|
2314
2329
|
actionColumn: rowEditActionColumn,
|
|
2315
2330
|
},
|
|
@@ -2338,7 +2353,7 @@ class Adaptable {
|
|
|
2338
2353
|
filter: false,
|
|
2339
2354
|
sortable: false,
|
|
2340
2355
|
enableRowGroup: false,
|
|
2341
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2356
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2342
2357
|
type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
2343
2358
|
};
|
|
2344
2359
|
(0, LoggingHelper_1.LogAdaptableInfo)('Setting up Action Column: ' + actionColumn.columnId);
|
|
@@ -3149,16 +3164,18 @@ class Adaptable {
|
|
|
3149
3164
|
fontSize: null,
|
|
3150
3165
|
borderColor: null,
|
|
3151
3166
|
};
|
|
3152
|
-
const
|
|
3153
|
-
|
|
3167
|
+
const activeFormatColumnsWithStyle = this.api.formatColumnApi.getFormatColumnsWithStyleForColumn(abColumn);
|
|
3168
|
+
let styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3169
|
+
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) {
|
|
3170
|
+
styledColumn = null;
|
|
3171
|
+
}
|
|
3154
3172
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
3155
3173
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3156
3174
|
const cellStyle = (params) => {
|
|
3157
|
-
const formatColumnCellStyle = formatColumn
|
|
3158
|
-
? this.getFormatColumnCellStyle(abColumn, formatColumn, params)
|
|
3159
|
-
: undefined;
|
|
3160
3175
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3161
|
-
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)),
|
|
3176
|
+
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)), (!styledColumn
|
|
3177
|
+
? this.getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params)
|
|
3178
|
+
: {})), (styledColumn ? this.getStyledColumnStyle(styledColumn, abColumn, params) : {})), (isQuickSearchActive ? quickSearchStyle : {})), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
3162
3179
|
return result;
|
|
3163
3180
|
};
|
|
3164
3181
|
return cellStyle;
|
|
@@ -3166,13 +3183,7 @@ class Adaptable {
|
|
|
3166
3183
|
}
|
|
3167
3184
|
setupColumnCellClass({ col, colId, abColumn }) {
|
|
3168
3185
|
this.setColDefProperty(col, 'cellClass', (userCellClass) => {
|
|
3169
|
-
|
|
3170
|
-
const formatColumn = this.api.formatColumnApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
|
|
3171
|
-
const formatColumnStyleClassName = formatColumn && !formatColumn.IsSuspended ? (_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName : null;
|
|
3172
|
-
const conditionalStyles = this.api.conditionalStyleApi
|
|
3173
|
-
.getConditionalStylesForColumn(abColumn)
|
|
3174
|
-
.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName));
|
|
3175
|
-
const hasConditionalStylesWithClassNames = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles);
|
|
3186
|
+
const formatColumns = this.api.formatColumnApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
|
|
3176
3187
|
const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
3177
3188
|
const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
3178
3189
|
const cellClass = (params) => {
|
|
@@ -3182,12 +3193,13 @@ class Adaptable {
|
|
|
3182
3193
|
const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
|
|
3183
3194
|
const highlightAlertClassName = this.getAlertCellClass(abColumn, params);
|
|
3184
3195
|
const flashingClassName = this.getFlashingCellClass(abColumn, params);
|
|
3196
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3197
|
+
const hasStyledColumn = !!styledColumn && !styledColumn.IsSuspended;
|
|
3185
3198
|
const returnValue = [
|
|
3186
3199
|
this.getExcelClassNameForCell(colId, primaryKeyValue),
|
|
3187
3200
|
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
? this.getConditionalStyleCellClass(conditionalStyles, abColumn, params)
|
|
3201
|
+
!hasStyledColumn && formatColumns.length
|
|
3202
|
+
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
3191
3203
|
: null,
|
|
3192
3204
|
isQuickSearchActive ? quickSearchStyleClassName : null,
|
|
3193
3205
|
editableClassName,
|
|
@@ -3195,10 +3207,12 @@ class Adaptable {
|
|
|
3195
3207
|
highlightAlertClassName,
|
|
3196
3208
|
flashingClassName,
|
|
3197
3209
|
]
|
|
3198
|
-
// we flatten the array because some rules ('userCellClass'
|
|
3210
|
+
// we flatten the array because some rules ('userCellClass' etc) might return a string[]
|
|
3199
3211
|
.flat()
|
|
3200
3212
|
.filter((x) => !!x);
|
|
3201
|
-
|
|
3213
|
+
const result = returnValue.length ? returnValue : undefined;
|
|
3214
|
+
// console.log(result);
|
|
3215
|
+
return result;
|
|
3202
3216
|
};
|
|
3203
3217
|
return cellClass;
|
|
3204
3218
|
});
|
|
@@ -3215,9 +3229,8 @@ class Adaptable {
|
|
|
3215
3229
|
const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
3216
3230
|
const hasRichSelectCellEditor = this.isAgGridModulePresent(core_1.ModuleNames.RichSelectModule);
|
|
3217
3231
|
this.setColDefProperty(col, 'cellEditor', () => {
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && ((_a = formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle)) {
|
|
3232
|
+
const styledColumn = this.api.styledColumnApi.getActiveStyledColumnForColumn(adaptableColumn);
|
|
3233
|
+
if (styledColumn && !(styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) && styledColumn.CheckBoxStyle) {
|
|
3221
3234
|
return CheckboxRenderer_1.CheckboxEditor;
|
|
3222
3235
|
}
|
|
3223
3236
|
if (editLookUpItem) {
|
|
@@ -3244,12 +3257,12 @@ class Adaptable {
|
|
|
3244
3257
|
}
|
|
3245
3258
|
setupColumnCellRenderer({ col, colId, abColumn }) {
|
|
3246
3259
|
this.setColDefProperty(col, 'cellRenderer', () => {
|
|
3247
|
-
const
|
|
3248
|
-
if (
|
|
3249
|
-
if (
|
|
3250
|
-
return this.agGridHelper.createPercentBarRendererComp(
|
|
3260
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(abColumn.columnId);
|
|
3261
|
+
if (styledColumn && !styledColumn.IsSuspended) {
|
|
3262
|
+
if (styledColumn.PercentBarStyle) {
|
|
3263
|
+
return this.agGridHelper.createPercentBarRendererComp(styledColumn, abColumn);
|
|
3251
3264
|
}
|
|
3252
|
-
if (
|
|
3265
|
+
if (styledColumn.CheckBoxStyle) {
|
|
3253
3266
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
3254
3267
|
}
|
|
3255
3268
|
}
|
|
@@ -3257,30 +3270,19 @@ class Adaptable {
|
|
|
3257
3270
|
}
|
|
3258
3271
|
setupColumnTooltipValueGetter({ col, colId, abColumn }) {
|
|
3259
3272
|
this.setColDefProperty(col, 'tooltipValueGetter', () => {
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
formatColumn.ColumnStyle.PercentBarStyle.ToolTipText) {
|
|
3267
|
-
if ((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle) {
|
|
3273
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3274
|
+
if (styledColumn &&
|
|
3275
|
+
!styledColumn.IsSuspended &&
|
|
3276
|
+
styledColumn.PercentBarStyle &&
|
|
3277
|
+
styledColumn.PercentBarStyle.ToolTipText) {
|
|
3278
|
+
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.PercentBarStyle) {
|
|
3268
3279
|
return (params) => {
|
|
3269
|
-
const min = this.api.
|
|
3270
|
-
const max = this.api.
|
|
3271
|
-
const textOptions =
|
|
3280
|
+
const min = this.api.styledColumnApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
3281
|
+
const max = this.api.styledColumnApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
3282
|
+
const textOptions = styledColumn.PercentBarStyle.ToolTipText;
|
|
3272
3283
|
let returnValue = '';
|
|
3273
3284
|
if (textOptions.includes('CellValue')) {
|
|
3274
|
-
|
|
3275
|
-
const options = formatColumn.DisplayFormat
|
|
3276
|
-
.Options;
|
|
3277
|
-
returnValue = options
|
|
3278
|
-
? FormatHelper_1.default.NumberFormatter(params.value, options)
|
|
3279
|
-
: params.value;
|
|
3280
|
-
}
|
|
3281
|
-
else {
|
|
3282
|
-
returnValue = params.value;
|
|
3283
|
-
}
|
|
3285
|
+
returnValue = params.value;
|
|
3284
3286
|
}
|
|
3285
3287
|
if (textOptions.includes('PercentageValue')) {
|
|
3286
3288
|
const clampedValue = Helper_1.Helper.clamp(params.value, min, max);
|
|
@@ -3363,13 +3365,6 @@ class Adaptable {
|
|
|
3363
3365
|
if (layoutCustomHeader) {
|
|
3364
3366
|
resultHeaderName = layoutCustomHeader;
|
|
3365
3367
|
}
|
|
3366
|
-
// check if the deprecated formatColumn header is used
|
|
3367
|
-
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(abColumn.columnId);
|
|
3368
|
-
if (!layoutCustomHeader && (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.HeaderName) && !formatColumn.IsSuspended) {
|
|
3369
|
-
// fallback to the formatColumn property if no Layout custom header is provided
|
|
3370
|
-
resultHeaderName = formatColumn.HeaderName;
|
|
3371
|
-
(0, LoggingHelper_1.ConsoleLogWarning)(`DEPRECATED: 'FormatColumn.HeaderName' is deprecated: use 'Layout.ColumnHeadersMap' instead`);
|
|
3372
|
-
}
|
|
3373
3368
|
// required here for the initial layout rendering
|
|
3374
3369
|
abColumn.friendlyName = resultHeaderName;
|
|
3375
3370
|
return resultHeaderName;
|
|
@@ -3407,43 +3402,40 @@ class Adaptable {
|
|
|
3407
3402
|
});
|
|
3408
3403
|
}
|
|
3409
3404
|
setupColumnValueFormatter({ col, abColumn }) {
|
|
3410
|
-
this.setColDefProperty(col, 'valueFormatter', () => {
|
|
3411
|
-
const
|
|
3412
|
-
if (!
|
|
3413
|
-
return;
|
|
3414
|
-
}
|
|
3415
|
-
if (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) {
|
|
3405
|
+
this.setColDefProperty(col, 'valueFormatter', (params) => {
|
|
3406
|
+
const activeFormatColumnsWithDisplayFormat = this.api.formatColumnApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
3407
|
+
if (!activeFormatColumnsWithDisplayFormat.length) {
|
|
3416
3408
|
return;
|
|
3417
3409
|
}
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
const
|
|
3421
|
-
if (
|
|
3410
|
+
return (params) => {
|
|
3411
|
+
const { node, value } = params;
|
|
3412
|
+
const [mostRelevantFormatColumn] = this.api.formatColumnApi.getFormatColumnsRelevantForColumn(activeFormatColumnsWithDisplayFormat, abColumn, { node, value });
|
|
3413
|
+
if (!mostRelevantFormatColumn) {
|
|
3414
|
+
// ALL FormatColumns are conditional and NONE of them are relevant for this row
|
|
3415
|
+
return value;
|
|
3416
|
+
}
|
|
3417
|
+
const options = mostRelevantFormatColumn.DisplayFormat.Options;
|
|
3418
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'NumberFormatter') {
|
|
3422
3419
|
// change the Number format - if the scope allows it
|
|
3423
|
-
if (this.api.scopeApi.isColumnInNumericScope(abColumn,
|
|
3424
|
-
|
|
3425
|
-
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3426
|
-
};
|
|
3420
|
+
if (this.api.scopeApi.isColumnInNumericScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3421
|
+
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3427
3422
|
}
|
|
3428
3423
|
}
|
|
3429
|
-
if (
|
|
3424
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'DateFormatter') {
|
|
3430
3425
|
// change the Date format - if the scope allows it
|
|
3431
|
-
if (this.api.scopeApi.isColumnInDateScope(abColumn,
|
|
3432
|
-
|
|
3433
|
-
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3434
|
-
};
|
|
3426
|
+
if (this.api.scopeApi.isColumnInDateScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3427
|
+
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3435
3428
|
}
|
|
3436
3429
|
}
|
|
3437
|
-
if (
|
|
3430
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
3438
3431
|
// change the String format - if the scope allows it
|
|
3439
|
-
if (this.api.scopeApi.isColumnInStringsScope(abColumn,
|
|
3440
|
-
|
|
3441
|
-
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3442
|
-
};
|
|
3432
|
+
if (this.api.scopeApi.isColumnInStringsScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3433
|
+
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3443
3434
|
}
|
|
3444
3435
|
}
|
|
3445
|
-
|
|
3446
|
-
|
|
3436
|
+
// should NEVER arrive at this line, but just to be sure
|
|
3437
|
+
return value;
|
|
3438
|
+
};
|
|
3447
3439
|
});
|
|
3448
3440
|
}
|
|
3449
3441
|
setupColumnEditable({ col }) {
|
|
@@ -3662,6 +3654,7 @@ class Adaptable {
|
|
|
3662
3654
|
this.api.freeTextColumnApi.checkFreeTextColumnForDataChange(cellDataChangedInfo);
|
|
3663
3655
|
}
|
|
3664
3656
|
this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
|
|
3657
|
+
this.resetMinMaxCachedValueForColumn(cellDataChangedInfo.column);
|
|
3665
3658
|
});
|
|
3666
3659
|
// if node is visible then check if need to refresh other columns / whole row if the updating column is:
|
|
3667
3660
|
// 1. referenced in Conditional Styles that have Expressions (refreshing whole row if Scope is All)
|
|
@@ -3676,7 +3669,7 @@ class Adaptable {
|
|
|
3676
3669
|
this.redrawRow(firstInfo.rowNode);
|
|
3677
3670
|
}
|
|
3678
3671
|
else {
|
|
3679
|
-
this.
|
|
3672
|
+
this.getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
|
|
3680
3673
|
if (dataChangedScope.columnIds.size > 0) {
|
|
3681
3674
|
this.refreshCells([firstInfo.rowNode], Array.from(dataChangedScope.columnIds.values()), true);
|
|
3682
3675
|
}
|
|
@@ -3685,23 +3678,24 @@ class Adaptable {
|
|
|
3685
3678
|
firstInfo.trigger == 'tick' ? this.filterOnTickingDataChange() : this.filterOnEditDataChange();
|
|
3686
3679
|
}
|
|
3687
3680
|
getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3688
|
-
const
|
|
3689
|
-
|
|
3681
|
+
const formatColumnsWithExpression = [];
|
|
3682
|
+
formatColumnsWithExpression.push(...this.api.formatColumnApi.getFormatColumnsWithExpression());
|
|
3683
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(formatColumnsWithExpression)) {
|
|
3690
3684
|
return;
|
|
3691
3685
|
}
|
|
3692
3686
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3693
3687
|
if (!dataChangedScope.wholeRow) {
|
|
3694
|
-
|
|
3688
|
+
formatColumnsWithExpression.forEach((styleModule) => {
|
|
3695
3689
|
if (!dataChangedScope.wholeRow) {
|
|
3696
|
-
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(
|
|
3690
|
+
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(styleModule.Rule.BooleanExpression);
|
|
3697
3691
|
if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
3698
|
-
if (this.api.scopeApi.scopeIsAll(
|
|
3692
|
+
if (this.api.scopeApi.scopeIsAll(styleModule.Scope)) {
|
|
3699
3693
|
dataChangedScope.wholeRow = true;
|
|
3700
3694
|
return;
|
|
3701
3695
|
}
|
|
3702
3696
|
else {
|
|
3703
3697
|
this.api.scopeApi
|
|
3704
|
-
.getColumnsForScope(
|
|
3698
|
+
.getColumnsForScope(styleModule.Scope)
|
|
3705
3699
|
.map((c) => c.columnId)
|
|
3706
3700
|
.forEach((colId) => {
|
|
3707
3701
|
dataChangedScope.columnIds.add(colId);
|
|
@@ -3713,20 +3707,15 @@ class Adaptable {
|
|
|
3713
3707
|
}
|
|
3714
3708
|
});
|
|
3715
3709
|
}
|
|
3716
|
-
|
|
3717
|
-
this.api.
|
|
3718
|
-
let columnComparison = this.api.
|
|
3710
|
+
getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3711
|
+
this.api.styledColumnApi.getAllStyledColumn().forEach((sc) => {
|
|
3712
|
+
let columnComparison = this.api.styledColumnApi.getColumnComparisonForStyledColumn(sc);
|
|
3719
3713
|
if (columnComparison) {
|
|
3720
|
-
let affectedColumnIds = this.api.
|
|
3714
|
+
let affectedColumnIds = this.api.styledColumnApi.getColumnIdsFromColumnComparison(columnComparison);
|
|
3721
3715
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(affectedColumnIds)) {
|
|
3722
3716
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3723
3717
|
if (affectedColumnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
3724
|
-
|
|
3725
|
-
.getColumnsForScope(fc.Scope)
|
|
3726
|
-
.map((c) => c.columnId)
|
|
3727
|
-
.forEach((colId) => {
|
|
3728
|
-
dataChangedScope.columnIds.add(colId);
|
|
3729
|
-
});
|
|
3718
|
+
dataChangedScope.columnIds.add(sc.ColumnId);
|
|
3730
3719
|
}
|
|
3731
3720
|
});
|
|
3732
3721
|
}
|
|
@@ -4325,12 +4314,10 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4325
4314
|
}
|
|
4326
4315
|
}
|
|
4327
4316
|
setupRowStyling() {
|
|
4328
|
-
// first get the conditional style state
|
|
4329
|
-
const conditionalStyles = this.api.conditionalStyleApi.getRowConditionalStyles();
|
|
4330
4317
|
// Set any Row Styles (i.e. items without a classname)
|
|
4331
4318
|
this.setGridOptionsProperty('getRowStyle', (userGetRowStyle) => {
|
|
4332
4319
|
return (params) => {
|
|
4333
|
-
const result = Object.assign(Object.assign(Object.assign(
|
|
4320
|
+
const result = Object.assign(Object.assign(Object.assign({}, userGetRowStyle === null || userGetRowStyle === void 0 ? void 0 : userGetRowStyle(params)), this.getRowHighlightStyle(params)), this.getAlertRowStyle(params));
|
|
4334
4321
|
return result;
|
|
4335
4322
|
};
|
|
4336
4323
|
});
|
|
@@ -4343,7 +4330,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4343
4330
|
typeof userGetRowClass === 'function' ? userGetRowClass(params) : userGetRowClass,
|
|
4344
4331
|
highlightClassName,
|
|
4345
4332
|
alertHighlightClassName,
|
|
4346
|
-
this.getConditionalStyleRowClass(conditionalStyles.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName)), params),
|
|
4347
4333
|
]
|
|
4348
4334
|
// we flatten it because 'userGetRowClass' might return a string[]
|
|
4349
4335
|
.flat()
|
|
@@ -4362,30 +4348,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4362
4348
|
const newValue = this.gridOptions.suppressAggFuncInHeader;
|
|
4363
4349
|
return previousValue !== newValue;
|
|
4364
4350
|
}
|
|
4365
|
-
getConditionalStyleRowClass(conditionalStyles, params) {
|
|
4366
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles)) {
|
|
4367
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
4368
|
-
let classNames = conditionalStyles
|
|
4369
|
-
.map((conditionalStyle) => {
|
|
4370
|
-
var _a;
|
|
4371
|
-
if (module.isConditionalStyleActiveForRow(conditionalStyle, params)) {
|
|
4372
|
-
return (_a = conditionalStyle.Style) === null || _a === void 0 ? void 0 : _a.ClassName;
|
|
4373
|
-
}
|
|
4374
|
-
})
|
|
4375
|
-
.filter((x) => !!x)
|
|
4376
|
-
.join(' ');
|
|
4377
|
-
return classNames;
|
|
4378
|
-
}
|
|
4379
|
-
}
|
|
4380
|
-
getConditionalStyleRowStyle(conditionalStyles, params) {
|
|
4381
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles)) {
|
|
4382
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
4383
|
-
const cs = conditionalStyles.find((cs) => module.isConditionalStyleActiveForRow(cs, params));
|
|
4384
|
-
if (cs) {
|
|
4385
|
-
return this.convertAdaptableStyleToCSS(cs.Style);
|
|
4386
|
-
}
|
|
4387
|
-
}
|
|
4388
|
-
}
|
|
4389
4351
|
getGridOptionsApi() {
|
|
4390
4352
|
if (!this.gridOptions.api) {
|
|
4391
4353
|
(0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
|
|
@@ -4712,8 +4674,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4712
4674
|
/**
|
|
4713
4675
|
* When reading the state from the grid, we have to make sure 'avg' is not overriden with the 'avg' string.
|
|
4714
4676
|
*/
|
|
4715
|
-
|
|
4716
|
-
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
4677
|
+
mapAggregationColumnsFromGrid(aggFuncFromGrid, currentLayout) {
|
|
4717
4678
|
return Object.entries(aggFuncFromGrid).reduce((acc, [colId, agg]) => {
|
|
4718
4679
|
const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(colId);
|
|
4719
4680
|
if ((adaptableAggFunc === null || adaptableAggFunc === void 0 ? void 0 : adaptableAggFunc.type) === 'weightedAverage' && agg === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
@@ -4726,6 +4687,31 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4726
4687
|
return acc;
|
|
4727
4688
|
}, {});
|
|
4728
4689
|
}
|
|
4690
|
+
resetMinMaxCachedValueForColumn(column) {
|
|
4691
|
+
if (!column) {
|
|
4692
|
+
this.columnMinMaxValuesCache[column.columnId] = {};
|
|
4693
|
+
}
|
|
4694
|
+
if (this.columnMinMaxValuesCache[column.columnId]) {
|
|
4695
|
+
this.columnMinMaxValuesCache[column.columnId] = undefined;
|
|
4696
|
+
}
|
|
4697
|
+
}
|
|
4698
|
+
getMinMaxCachedValueForColumn(column, minMax) {
|
|
4699
|
+
var _a;
|
|
4700
|
+
const { columnId, dataType } = column;
|
|
4701
|
+
if (dataType !== 'Number') {
|
|
4702
|
+
return undefined;
|
|
4703
|
+
}
|
|
4704
|
+
let value = (_a = this.columnMinMaxValuesCache[columnId]) === null || _a === void 0 ? void 0 : _a[minMax];
|
|
4705
|
+
if (value !== undefined) {
|
|
4706
|
+
return value;
|
|
4707
|
+
}
|
|
4708
|
+
const distinctRawValues = this.api.columnApi
|
|
4709
|
+
.getUnsortedDistinctRawValuesForColumn(columnId)
|
|
4710
|
+
.map((item) => item.rawValue);
|
|
4711
|
+
value = minMax === 'min' ? Math.min(...distinctRawValues) : Math.max(...distinctRawValues);
|
|
4712
|
+
this.columnMinMaxValuesCache[columnId] = Object.assign(Object.assign({}, this.columnMinMaxValuesCache[columnId]), { [minMax]: value });
|
|
4713
|
+
return value;
|
|
4714
|
+
}
|
|
4729
4715
|
}
|
|
4730
4716
|
exports.Adaptable = Adaptable;
|
|
4731
4717
|
class AdaptableNoCodeWizard {
|