@adaptabletools/adaptable 13.0.0-canary.8 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agGrid.d.ts +10 -10
- package/agGrid.js +10 -10
- package/base.css +1231 -733
- package/base.css.map +1 -0
- package/bundle.cjs.js +237 -220
- package/index.css +1249 -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 +116 -35
- package/src/AdaptableOptions/ExportOptions.d.ts +2 -2
- package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +32 -0
- package/src/{Api/ConditionalStyleApi.js → AdaptableOptions/FinsemblePluginOptions.js} +0 -0
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -6
- package/src/AdaptableOptions/LayoutOptions.d.ts +2 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
- package/src/Api/AdaptableApi.d.ts +2 -5
- package/src/Api/ColumnApi.d.ts +8 -2
- package/src/Api/ConfigApi.d.ts +0 -6
- package/src/Api/ExportApi.d.ts +6 -6
- package/src/Api/FinsembleApi.d.ts +10 -0
- package/src/{Strategy/Interface/IConditionalStyleModule.js → Api/FinsembleApi.js} +0 -0
- package/src/Api/FormatColumnApi.d.ts +46 -73
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -3
- package/src/Api/Implementation/AlertApiImpl.js +9 -4
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ColumnApiImpl.js +15 -11
- package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -2
- package/src/Api/Implementation/ConfigApiImpl.js +0 -11
- package/src/Api/Implementation/ExportApiImpl.d.ts +4 -4
- package/src/Api/Implementation/ExportApiImpl.js +14 -14
- package/src/Api/Implementation/FlashingCellApiImpl.js +4 -1
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +24 -22
- package/src/Api/Implementation/FormatColumnApiImpl.js +57 -224
- package/src/Api/Implementation/InternalApiImpl.d.ts +1 -1
- package/src/Api/Implementation/InternalApiImpl.js +4 -3
- 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 -1
- package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -15
- 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/InternalApi.d.ts +1 -1
- package/src/Api/PluginsApi.d.ts +5 -0
- package/src/Api/QueryLanguageApi.d.ts +3 -2
- 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/PredefinedConfig/AdaptableState.d.ts +2 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- 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 +6 -96
- package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
- package/src/PredefinedConfig/StyledColumnState.d.ts +119 -0
- package/src/PredefinedConfig/StyledColumnState.js +2 -0
- 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/DeadRedux.d.ts +6 -0
- package/src/Redux/DeadRedux.js +19 -1
- package/src/Redux/Store/AdaptableStore.js +9 -8
- package/src/Strategy/ConditionalStyleModule.d.ts +2 -27
- package/src/Strategy/ConditionalStyleModule.js +0 -219
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +12 -0
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +30 -221
- package/src/Strategy/LayoutModule.js +0 -4
- 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 -13
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +3 -4
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +3 -4
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -4
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +2 -5
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -4
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +3 -4
- package/src/Utilities/ObjectFactory.d.ts +5 -2
- package/src/Utilities/ObjectFactory.js +14 -7
- package/src/Utilities/Services/ModuleService.js +2 -2
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -3
- package/src/Utilities/Services/QueryLanguageService.js +49 -53
- package/src/Utilities/Services/ReportService.js +6 -6
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +15 -14
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +24 -1
- 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/Alert/Wizard/isValidAlertRules.js +1 -1
- 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.js +8 -17
- 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/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 +1 -11
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +21 -9
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +1 -1
- 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/Wizard/FormatColumnFormatWizardSection.js +27 -27
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +4 -5
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
- 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 -301
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -10
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +7 -7
- package/src/View/GridInfo/ColumnInfoComponent.js +0 -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 +2 -0
- package/src/agGrid/ActionColumnRenderer.js +94 -62
- package/src/agGrid/Adaptable.d.ts +12 -13
- package/src/agGrid/Adaptable.js +162 -236
- 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 +17 -17
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -1
- package/src/agGrid/createAgStatusPanelComponent.js +17 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +4 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +84 -17
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +78 -27
- 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.js +13 -32
- 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 +178 -104
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/renderReactRoot.d.ts +2 -0
- package/src/renderReactRoot.js +11 -9
- package/src/types.d.ts +7 -5
- 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/Api/ConditionalStyleApi.d.ts +0 -128
- package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +0 -29
- package/src/Api/Implementation/ConditionalStyleApiImpl.js +0 -98
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +0 -49
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +0 -95
- package/src/Strategy/Interface/IConditionalStyleModule.d.ts +0 -6
- package/src/Strategy/Utilities/getStyleViewItems.d.ts +0 -2
- package/src/Strategy/Utilities/getStyleViewItems.js +0 -16
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +0 -2
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +0 -18
- package/src/View/ConditionalStyle/ConditionalStyleSummary.d.ts +0 -25
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +0 -108
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.d.ts +0 -9
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +0 -42
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.js +0 -43
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +0 -29
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.js +0 -23
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.d.ts +0 -6
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +0 -114
- package/src/View/ConditionalStyle/Wizard/DEFAULT_PREDICATE_ID_FOR_CONDITIONAL_STYLE.d.ts +0 -1
- package/src/View/ConditionalStyle/Wizard/DEFAULT_PREDICATE_ID_FOR_CONDITIONAL_STYLE.js +0 -4
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,13 +918,12 @@ class Adaptable {
|
|
|
898
918
|
this.gridOptions.api.setColumnDefs(colDefs);
|
|
899
919
|
this.updateColumnsIntoStore(); // todo remove this from here!!!
|
|
900
920
|
}
|
|
901
|
-
|
|
902
|
-
const columnStyle = formatColumn.ColumnStyle;
|
|
921
|
+
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
903
922
|
let style = {};
|
|
904
|
-
const gradientStyle =
|
|
923
|
+
const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
|
|
905
924
|
if (gradientStyle) {
|
|
906
|
-
const min = this.api.
|
|
907
|
-
const max = this.api.
|
|
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);
|
|
908
927
|
const clampedValue = (0, clamp_1.default)(params.value, min, max);
|
|
909
928
|
let cellBackColor;
|
|
910
929
|
let reverseGradient = false;
|
|
@@ -928,72 +947,49 @@ class Adaptable {
|
|
|
928
947
|
const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
|
|
929
948
|
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
930
949
|
}
|
|
931
|
-
if (
|
|
950
|
+
if (styledColumn.PercentBarStyle && styledColumn.PercentBarStyle.CellText) {
|
|
932
951
|
style.paddingTop = 0;
|
|
933
952
|
style.paddingBottom = 0;
|
|
934
953
|
}
|
|
935
954
|
return style;
|
|
936
955
|
}
|
|
937
|
-
|
|
956
|
+
getFormatColumnAdaptableStyle(formatColumns) {
|
|
938
957
|
// first has more precedence, then they need to be applied in reverse order
|
|
939
958
|
return formatColumns.reduceRight((style, formatColumn) => {
|
|
940
|
-
const formatColumnStyle =
|
|
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
|
+
}
|
|
974
|
+
}
|
|
941
975
|
return Object.assign(Object.assign({}, style), formatColumnStyle);
|
|
942
976
|
}, {});
|
|
943
977
|
}
|
|
944
|
-
getFormatColumnCellStyle(abColumn,
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
const columnStyle = formatColumn.ColumnStyle;
|
|
948
|
-
if (columnStyle) {
|
|
949
|
-
if (columnStyle &&
|
|
950
|
-
!this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params)) {
|
|
951
|
-
return style;
|
|
952
|
-
}
|
|
953
|
-
style = Object.assign(Object.assign({}, style), this.getFormatColumnSpecialColumnStyle(formatColumn, abColumn, params));
|
|
954
|
-
}
|
|
955
|
-
else if (formatColumn.Style) {
|
|
956
|
-
const activeFormatColumnsWithStyle = formatColumnsWithStyle.filter((formatColumn) => {
|
|
957
|
-
return this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params);
|
|
958
|
-
});
|
|
959
|
-
if (!activeFormatColumnsWithStyle.length) {
|
|
960
|
-
return style;
|
|
961
|
-
}
|
|
962
|
-
style = Object.assign(Object.assign({}, style), this.getFormatColumnColumnStyle(activeFormatColumnsWithStyle));
|
|
963
|
-
}
|
|
964
|
-
if (formatColumn.CellAlignment) {
|
|
965
|
-
switch (formatColumn.CellAlignment) {
|
|
966
|
-
case 'Left':
|
|
967
|
-
style.textAlign = 'left';
|
|
968
|
-
break;
|
|
969
|
-
case 'Right':
|
|
970
|
-
style.textAlign = 'right';
|
|
971
|
-
break;
|
|
972
|
-
case 'Center':
|
|
973
|
-
style.textAlign = 'center';
|
|
974
|
-
break;
|
|
975
|
-
}
|
|
978
|
+
getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params) {
|
|
979
|
+
if (!activeFormatColumnsWithStyle.length) {
|
|
980
|
+
return {};
|
|
976
981
|
}
|
|
977
|
-
|
|
982
|
+
const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
|
|
983
|
+
return this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params);
|
|
984
|
+
});
|
|
985
|
+
return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
|
|
978
986
|
}
|
|
979
987
|
getFormatColumnCellClass(formatColumns, abColumn, params) {
|
|
980
988
|
const classNames = formatColumns
|
|
981
989
|
.map((formatColumn) => {
|
|
982
990
|
var _a, _b;
|
|
983
991
|
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
984
|
-
this.api.formatColumnApi.
|
|
985
|
-
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
986
|
-
}
|
|
987
|
-
})
|
|
988
|
-
.filter((x) => !!x);
|
|
989
|
-
return classNames;
|
|
990
|
-
}
|
|
991
|
-
getFormatColumnRowClass(formatColumns, params) {
|
|
992
|
-
const classNames = formatColumns
|
|
993
|
-
.map((formatColumn) => {
|
|
994
|
-
var _a, _b;
|
|
995
|
-
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
996
|
-
this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params)) {
|
|
992
|
+
this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params)) {
|
|
997
993
|
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
998
994
|
}
|
|
999
995
|
})
|
|
@@ -1148,31 +1144,6 @@ class Adaptable {
|
|
|
1148
1144
|
}
|
|
1149
1145
|
return undefined;
|
|
1150
1146
|
}
|
|
1151
|
-
getConditionalStyleCellStyle(conditionalStyles = [], abColumn, params) {
|
|
1152
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
1153
|
-
const result = conditionalStyles.reduce((result, conditionalStyle) => {
|
|
1154
|
-
if (module.isConditionalStyleActiveForColumn(conditionalStyle, abColumn, params)) {
|
|
1155
|
-
return Object.assign(Object.assign({}, result), conditionalStyle.Style);
|
|
1156
|
-
}
|
|
1157
|
-
else {
|
|
1158
|
-
return result;
|
|
1159
|
-
}
|
|
1160
|
-
}, {});
|
|
1161
|
-
return this.convertAdaptableStyleToCSS(result);
|
|
1162
|
-
}
|
|
1163
|
-
getConditionalStyleCellClass(conditionalStyles = [], abColumn, params) {
|
|
1164
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
1165
|
-
let classNames = conditionalStyles
|
|
1166
|
-
.map((conditionalStyle) => {
|
|
1167
|
-
var _a, _b;
|
|
1168
|
-
if (((_a = conditionalStyle.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
1169
|
-
module.isConditionalStyleActiveForColumn(conditionalStyle, abColumn, params)) {
|
|
1170
|
-
return (_b = conditionalStyle.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
1171
|
-
}
|
|
1172
|
-
})
|
|
1173
|
-
.filter((x) => !!x);
|
|
1174
|
-
return classNames;
|
|
1175
|
-
}
|
|
1176
1147
|
getEditableCellClass(abColumn, params) {
|
|
1177
1148
|
const editableCellStyle = this.api.userInterfaceApi.getEditableCellStyle();
|
|
1178
1149
|
if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
|
|
@@ -1315,7 +1286,7 @@ class Adaptable {
|
|
|
1315
1286
|
const colId = customSort.ColumnId;
|
|
1316
1287
|
if (!layoutColumnsMap[colId]) {
|
|
1317
1288
|
// pivot layouts may have no pivot columns, only aggregation columns
|
|
1318
|
-
if (layout.AggregationColumns[colId] == undefined) {
|
|
1289
|
+
if (!layout.AggregationColumns || layout.AggregationColumns[colId] == undefined) {
|
|
1319
1290
|
return acc;
|
|
1320
1291
|
}
|
|
1321
1292
|
}
|
|
@@ -1583,7 +1554,10 @@ class Adaptable {
|
|
|
1583
1554
|
layout.RowGroupedColumns = groupedColumns;
|
|
1584
1555
|
if (Object.keys(aggregatedColumns).length) {
|
|
1585
1556
|
// ag-grid aggregations are not 1-1 with adaptable column-aggregations
|
|
1586
|
-
layout.AggregationColumns = this.
|
|
1557
|
+
layout.AggregationColumns = this.mapAggregationColumnsFromGrid(aggregatedColumns, currentLayout);
|
|
1558
|
+
}
|
|
1559
|
+
else {
|
|
1560
|
+
layout.AggregationColumns = {};
|
|
1587
1561
|
}
|
|
1588
1562
|
layout.EnablePivot = this.gridOptions.columnApi.isPivotMode();
|
|
1589
1563
|
layout.PivotColumns = pivotColumns;
|
|
@@ -1892,7 +1866,7 @@ class Adaptable {
|
|
|
1892
1866
|
if (colDef && colDef.cellRenderer != null) {
|
|
1893
1867
|
return true;
|
|
1894
1868
|
}
|
|
1895
|
-
if (this.api.columnApi.
|
|
1869
|
+
if (this.api.columnApi.isStyledNumericColumn(column)) {
|
|
1896
1870
|
return true;
|
|
1897
1871
|
}
|
|
1898
1872
|
if (this.api.columnApi.isBooleanColumn(column)) {
|
|
@@ -1947,7 +1921,7 @@ class Adaptable {
|
|
|
1947
1921
|
}
|
|
1948
1922
|
getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
|
|
1949
1923
|
const abColumn = this.api.columnApi.getColumnFromId(columnId);
|
|
1950
|
-
const isRenderedColumn = this.api.columnApi.
|
|
1924
|
+
const isRenderedColumn = this.api.columnApi.isStyledNumericColumn(abColumn);
|
|
1951
1925
|
if (isRenderedColumn) {
|
|
1952
1926
|
const colDef = this.gridOptions.api.getColumnDef(columnId);
|
|
1953
1927
|
if (typeof colDef.valueFormatter == 'function') {
|
|
@@ -2350,7 +2324,7 @@ class Adaptable {
|
|
|
2350
2324
|
pinned: this.adaptableOptions.actionOptions.actionRowButtonsPosition === 'pinnedRight'
|
|
2351
2325
|
? 'right'
|
|
2352
2326
|
: 'left',
|
|
2353
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2327
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2354
2328
|
cellRendererParams: {
|
|
2355
2329
|
actionColumn: rowEditActionColumn,
|
|
2356
2330
|
},
|
|
@@ -2379,7 +2353,7 @@ class Adaptable {
|
|
|
2379
2353
|
filter: false,
|
|
2380
2354
|
sortable: false,
|
|
2381
2355
|
enableRowGroup: false,
|
|
2382
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2356
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2383
2357
|
type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
2384
2358
|
};
|
|
2385
2359
|
(0, LoggingHelper_1.LogAdaptableInfo)('Setting up Action Column: ' + actionColumn.columnId);
|
|
@@ -3190,18 +3164,18 @@ class Adaptable {
|
|
|
3190
3164
|
fontSize: null,
|
|
3191
3165
|
borderColor: null,
|
|
3192
3166
|
};
|
|
3193
|
-
const
|
|
3194
|
-
|
|
3195
|
-
|
|
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
|
+
}
|
|
3196
3172
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
3197
3173
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3198
3174
|
const cellStyle = (params) => {
|
|
3199
|
-
const formatColumnCellStyle = formatColumn
|
|
3200
|
-
? this.getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params)
|
|
3201
|
-
: undefined;
|
|
3202
3175
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3203
|
-
const
|
|
3204
|
-
|
|
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));
|
|
3205
3179
|
return result;
|
|
3206
3180
|
};
|
|
3207
3181
|
return cellStyle;
|
|
@@ -3210,10 +3184,6 @@ class Adaptable {
|
|
|
3210
3184
|
setupColumnCellClass({ col, colId, abColumn }) {
|
|
3211
3185
|
this.setColDefProperty(col, 'cellClass', (userCellClass) => {
|
|
3212
3186
|
const formatColumns = this.api.formatColumnApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
|
|
3213
|
-
const conditionalStyles = this.api.conditionalStyleApi
|
|
3214
|
-
.getConditionalStylesForColumn(abColumn)
|
|
3215
|
-
.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName));
|
|
3216
|
-
const hasConditionalStylesWithClassNames = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles);
|
|
3217
3187
|
const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
3218
3188
|
const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
3219
3189
|
const cellClass = (params) => {
|
|
@@ -3223,25 +3193,26 @@ class Adaptable {
|
|
|
3223
3193
|
const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
|
|
3224
3194
|
const highlightAlertClassName = this.getAlertCellClass(abColumn, params);
|
|
3225
3195
|
const flashingClassName = this.getFlashingCellClass(abColumn, params);
|
|
3196
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3197
|
+
const hasStyledColumn = !!styledColumn && !styledColumn.IsSuspended;
|
|
3226
3198
|
const returnValue = [
|
|
3227
3199
|
this.getExcelClassNameForCell(colId, primaryKeyValue),
|
|
3228
3200
|
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
3229
|
-
formatColumns.length
|
|
3201
|
+
!hasStyledColumn && formatColumns.length
|
|
3230
3202
|
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
3231
3203
|
: null,
|
|
3232
|
-
hasConditionalStylesWithClassNames
|
|
3233
|
-
? this.getConditionalStyleCellClass(conditionalStyles, abColumn, params)
|
|
3234
|
-
: null,
|
|
3235
3204
|
isQuickSearchActive ? quickSearchStyleClassName : null,
|
|
3236
3205
|
editableClassName,
|
|
3237
3206
|
readonlyClassName,
|
|
3238
3207
|
highlightAlertClassName,
|
|
3239
3208
|
flashingClassName,
|
|
3240
3209
|
]
|
|
3241
|
-
// we flatten the array because some rules ('userCellClass'
|
|
3210
|
+
// we flatten the array because some rules ('userCellClass' etc) might return a string[]
|
|
3242
3211
|
.flat()
|
|
3243
3212
|
.filter((x) => !!x);
|
|
3244
|
-
|
|
3213
|
+
const result = returnValue.length ? returnValue : undefined;
|
|
3214
|
+
// console.log(result);
|
|
3215
|
+
return result;
|
|
3245
3216
|
};
|
|
3246
3217
|
return cellClass;
|
|
3247
3218
|
});
|
|
@@ -3258,9 +3229,8 @@ class Adaptable {
|
|
|
3258
3229
|
const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
3259
3230
|
const hasRichSelectCellEditor = this.isAgGridModulePresent(core_1.ModuleNames.RichSelectModule);
|
|
3260
3231
|
this.setColDefProperty(col, 'cellEditor', () => {
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
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) {
|
|
3264
3234
|
return CheckboxRenderer_1.CheckboxEditor;
|
|
3265
3235
|
}
|
|
3266
3236
|
if (editLookUpItem) {
|
|
@@ -3287,12 +3257,12 @@ class Adaptable {
|
|
|
3287
3257
|
}
|
|
3288
3258
|
setupColumnCellRenderer({ col, colId, abColumn }) {
|
|
3289
3259
|
this.setColDefProperty(col, 'cellRenderer', () => {
|
|
3290
|
-
const
|
|
3291
|
-
if (
|
|
3292
|
-
if (
|
|
3293
|
-
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);
|
|
3294
3264
|
}
|
|
3295
|
-
if (
|
|
3265
|
+
if (styledColumn.CheckBoxStyle) {
|
|
3296
3266
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
3297
3267
|
}
|
|
3298
3268
|
}
|
|
@@ -3300,30 +3270,19 @@ class Adaptable {
|
|
|
3300
3270
|
}
|
|
3301
3271
|
setupColumnTooltipValueGetter({ col, colId, abColumn }) {
|
|
3302
3272
|
this.setColDefProperty(col, 'tooltipValueGetter', () => {
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
formatColumn.ColumnStyle.PercentBarStyle.ToolTipText) {
|
|
3310
|
-
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) {
|
|
3311
3279
|
return (params) => {
|
|
3312
|
-
const min = this.api.
|
|
3313
|
-
const max = this.api.
|
|
3314
|
-
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;
|
|
3315
3283
|
let returnValue = '';
|
|
3316
3284
|
if (textOptions.includes('CellValue')) {
|
|
3317
|
-
|
|
3318
|
-
const options = formatColumn.DisplayFormat
|
|
3319
|
-
.Options;
|
|
3320
|
-
returnValue = options
|
|
3321
|
-
? FormatHelper_1.default.NumberFormatter(params.value, options)
|
|
3322
|
-
: params.value;
|
|
3323
|
-
}
|
|
3324
|
-
else {
|
|
3325
|
-
returnValue = params.value;
|
|
3326
|
-
}
|
|
3285
|
+
returnValue = params.value;
|
|
3327
3286
|
}
|
|
3328
3287
|
if (textOptions.includes('PercentageValue')) {
|
|
3329
3288
|
const clampedValue = Helper_1.Helper.clamp(params.value, min, max);
|
|
@@ -3406,13 +3365,6 @@ class Adaptable {
|
|
|
3406
3365
|
if (layoutCustomHeader) {
|
|
3407
3366
|
resultHeaderName = layoutCustomHeader;
|
|
3408
3367
|
}
|
|
3409
|
-
// check if the deprecated formatColumn header is used
|
|
3410
|
-
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(abColumn.columnId);
|
|
3411
|
-
if (!layoutCustomHeader && (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.HeaderName) && !formatColumn.IsSuspended) {
|
|
3412
|
-
// fallback to the formatColumn property if no Layout custom header is provided
|
|
3413
|
-
resultHeaderName = formatColumn.HeaderName;
|
|
3414
|
-
(0, LoggingHelper_1.ConsoleLogWarning)(`DEPRECATED: 'FormatColumn.HeaderName' is deprecated: use 'Layout.ColumnHeadersMap' instead`);
|
|
3415
|
-
}
|
|
3416
3368
|
// required here for the initial layout rendering
|
|
3417
3369
|
abColumn.friendlyName = resultHeaderName;
|
|
3418
3370
|
return resultHeaderName;
|
|
@@ -3451,47 +3403,39 @@ class Adaptable {
|
|
|
3451
3403
|
}
|
|
3452
3404
|
setupColumnValueFormatter({ col, abColumn }) {
|
|
3453
3405
|
this.setColDefProperty(col, 'valueFormatter', (params) => {
|
|
3454
|
-
const
|
|
3455
|
-
if (!
|
|
3456
|
-
return;
|
|
3457
|
-
}
|
|
3458
|
-
if (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) {
|
|
3406
|
+
const activeFormatColumnsWithDisplayFormat = this.api.formatColumnApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
3407
|
+
if (!activeFormatColumnsWithDisplayFormat.length) {
|
|
3459
3408
|
return;
|
|
3460
3409
|
}
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
const
|
|
3464
|
-
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') {
|
|
3465
3419
|
// change the Number format - if the scope allows it
|
|
3466
|
-
if (this.api.scopeApi.isColumnInNumericScope(abColumn,
|
|
3467
|
-
|
|
3468
|
-
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3469
|
-
};
|
|
3420
|
+
if (this.api.scopeApi.isColumnInNumericScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3421
|
+
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3470
3422
|
}
|
|
3471
3423
|
}
|
|
3472
|
-
if (
|
|
3424
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'DateFormatter') {
|
|
3473
3425
|
// change the Date format - if the scope allows it
|
|
3474
|
-
if (this.api.scopeApi.isColumnInDateScope(abColumn,
|
|
3475
|
-
|
|
3476
|
-
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3477
|
-
};
|
|
3426
|
+
if (this.api.scopeApi.isColumnInDateScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3427
|
+
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3478
3428
|
}
|
|
3479
3429
|
}
|
|
3480
|
-
if (
|
|
3430
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
3481
3431
|
// change the String format - if the scope allows it
|
|
3482
|
-
if (this.api.scopeApi.isColumnInStringsScope(abColumn,
|
|
3483
|
-
|
|
3484
|
-
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3485
|
-
};
|
|
3432
|
+
if (this.api.scopeApi.isColumnInStringsScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3433
|
+
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3486
3434
|
}
|
|
3487
3435
|
}
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
return rulePasses ? valueFormatter(params) : params.value;
|
|
3492
|
-
};
|
|
3493
|
-
}
|
|
3494
|
-
}
|
|
3436
|
+
// should NEVER arrive at this line, but just to be sure
|
|
3437
|
+
return value;
|
|
3438
|
+
};
|
|
3495
3439
|
});
|
|
3496
3440
|
}
|
|
3497
3441
|
setupColumnEditable({ col }) {
|
|
@@ -3710,6 +3654,7 @@ class Adaptable {
|
|
|
3710
3654
|
this.api.freeTextColumnApi.checkFreeTextColumnForDataChange(cellDataChangedInfo);
|
|
3711
3655
|
}
|
|
3712
3656
|
this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
|
|
3657
|
+
this.resetMinMaxCachedValueForColumn(cellDataChangedInfo.column);
|
|
3713
3658
|
});
|
|
3714
3659
|
// if node is visible then check if need to refresh other columns / whole row if the updating column is:
|
|
3715
3660
|
// 1. referenced in Conditional Styles that have Expressions (refreshing whole row if Scope is All)
|
|
@@ -3724,7 +3669,7 @@ class Adaptable {
|
|
|
3724
3669
|
this.redrawRow(firstInfo.rowNode);
|
|
3725
3670
|
}
|
|
3726
3671
|
else {
|
|
3727
|
-
this.
|
|
3672
|
+
this.getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
|
|
3728
3673
|
if (dataChangedScope.columnIds.size > 0) {
|
|
3729
3674
|
this.refreshCells([firstInfo.rowNode], Array.from(dataChangedScope.columnIds.values()), true);
|
|
3730
3675
|
}
|
|
@@ -3733,15 +3678,14 @@ class Adaptable {
|
|
|
3733
3678
|
firstInfo.trigger == 'tick' ? this.filterOnTickingDataChange() : this.filterOnEditDataChange();
|
|
3734
3679
|
}
|
|
3735
3680
|
getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3736
|
-
const
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(stylesWithExpression)) {
|
|
3681
|
+
const formatColumnsWithExpression = [];
|
|
3682
|
+
formatColumnsWithExpression.push(...this.api.formatColumnApi.getFormatColumnsWithExpression());
|
|
3683
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(formatColumnsWithExpression)) {
|
|
3740
3684
|
return;
|
|
3741
3685
|
}
|
|
3742
3686
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3743
3687
|
if (!dataChangedScope.wholeRow) {
|
|
3744
|
-
|
|
3688
|
+
formatColumnsWithExpression.forEach((styleModule) => {
|
|
3745
3689
|
if (!dataChangedScope.wholeRow) {
|
|
3746
3690
|
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(styleModule.Rule.BooleanExpression);
|
|
3747
3691
|
if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
@@ -3763,20 +3707,15 @@ class Adaptable {
|
|
|
3763
3707
|
}
|
|
3764
3708
|
});
|
|
3765
3709
|
}
|
|
3766
|
-
|
|
3767
|
-
this.api.
|
|
3768
|
-
let columnComparison = this.api.
|
|
3710
|
+
getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3711
|
+
this.api.styledColumnApi.getAllStyledColumn().forEach((sc) => {
|
|
3712
|
+
let columnComparison = this.api.styledColumnApi.getColumnComparisonForStyledColumn(sc);
|
|
3769
3713
|
if (columnComparison) {
|
|
3770
|
-
let affectedColumnIds = this.api.
|
|
3714
|
+
let affectedColumnIds = this.api.styledColumnApi.getColumnIdsFromColumnComparison(columnComparison);
|
|
3771
3715
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(affectedColumnIds)) {
|
|
3772
3716
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3773
3717
|
if (affectedColumnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
3774
|
-
|
|
3775
|
-
.getColumnsForScope(fc.Scope)
|
|
3776
|
-
.map((c) => c.columnId)
|
|
3777
|
-
.forEach((colId) => {
|
|
3778
|
-
dataChangedScope.columnIds.add(colId);
|
|
3779
|
-
});
|
|
3718
|
+
dataChangedScope.columnIds.add(sc.ColumnId);
|
|
3780
3719
|
}
|
|
3781
3720
|
});
|
|
3782
3721
|
}
|
|
@@ -4375,13 +4314,10 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4375
4314
|
}
|
|
4376
4315
|
}
|
|
4377
4316
|
setupRowStyling() {
|
|
4378
|
-
// first get the conditional style state
|
|
4379
|
-
const conditionalStyles = this.api.conditionalStyleApi.getRowConditionalStyles();
|
|
4380
|
-
const formatColumnsStyles = this.api.formatColumnApi.getRowFormatColumnsWithStyle();
|
|
4381
4317
|
// Set any Row Styles (i.e. items without a classname)
|
|
4382
4318
|
this.setGridOptionsProperty('getRowStyle', (userGetRowStyle) => {
|
|
4383
4319
|
return (params) => {
|
|
4384
|
-
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));
|
|
4385
4321
|
return result;
|
|
4386
4322
|
};
|
|
4387
4323
|
});
|
|
@@ -4394,8 +4330,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4394
4330
|
typeof userGetRowClass === 'function' ? userGetRowClass(params) : userGetRowClass,
|
|
4395
4331
|
highlightClassName,
|
|
4396
4332
|
alertHighlightClassName,
|
|
4397
|
-
this.getConditionalStyleRowClass(conditionalStyles.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName)), params),
|
|
4398
|
-
this.getFormatColumnRowClass(formatColumnsStyles, params),
|
|
4399
4333
|
]
|
|
4400
4334
|
// we flatten it because 'userGetRowClass' might return a string[]
|
|
4401
4335
|
.flat()
|
|
@@ -4414,38 +4348,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4414
4348
|
const newValue = this.gridOptions.suppressAggFuncInHeader;
|
|
4415
4349
|
return previousValue !== newValue;
|
|
4416
4350
|
}
|
|
4417
|
-
getConditionalStyleRowClass(conditionalStyles, params) {
|
|
4418
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles)) {
|
|
4419
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
4420
|
-
let classNames = conditionalStyles
|
|
4421
|
-
.map((conditionalStyle) => {
|
|
4422
|
-
var _a;
|
|
4423
|
-
if (module.isConditionalStyleActiveForRow(conditionalStyle, params)) {
|
|
4424
|
-
return (_a = conditionalStyle.Style) === null || _a === void 0 ? void 0 : _a.ClassName;
|
|
4425
|
-
}
|
|
4426
|
-
})
|
|
4427
|
-
.filter((x) => !!x)
|
|
4428
|
-
.join(' ');
|
|
4429
|
-
return classNames;
|
|
4430
|
-
}
|
|
4431
|
-
}
|
|
4432
|
-
getConditionalStyleRowStyle(conditionalStyles, params) {
|
|
4433
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles)) {
|
|
4434
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
4435
|
-
const cs = conditionalStyles.find((cs) => module.isConditionalStyleActiveForRow(cs, params));
|
|
4436
|
-
if (cs) {
|
|
4437
|
-
return this.convertAdaptableStyleToCSS(cs.Style);
|
|
4438
|
-
}
|
|
4439
|
-
}
|
|
4440
|
-
}
|
|
4441
|
-
getFormatColumnRowStyle(formatColumns, params) {
|
|
4442
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(formatColumns)) {
|
|
4443
|
-
const formatColumnWithRowStyle = formatColumns.find((formatColumn) => this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params));
|
|
4444
|
-
if (formatColumnWithRowStyle) {
|
|
4445
|
-
return this.convertAdaptableStyleToCSS(formatColumnWithRowStyle.Style);
|
|
4446
|
-
}
|
|
4447
|
-
}
|
|
4448
|
-
}
|
|
4449
4351
|
getGridOptionsApi() {
|
|
4450
4352
|
if (!this.gridOptions.api) {
|
|
4451
4353
|
(0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
|
|
@@ -4772,8 +4674,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4772
4674
|
/**
|
|
4773
4675
|
* When reading the state from the grid, we have to make sure 'avg' is not overriden with the 'avg' string.
|
|
4774
4676
|
*/
|
|
4775
|
-
|
|
4776
|
-
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
4677
|
+
mapAggregationColumnsFromGrid(aggFuncFromGrid, currentLayout) {
|
|
4777
4678
|
return Object.entries(aggFuncFromGrid).reduce((acc, [colId, agg]) => {
|
|
4778
4679
|
const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(colId);
|
|
4779
4680
|
if ((adaptableAggFunc === null || adaptableAggFunc === void 0 ? void 0 : adaptableAggFunc.type) === 'weightedAverage' && agg === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
@@ -4786,6 +4687,31 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4786
4687
|
return acc;
|
|
4787
4688
|
}, {});
|
|
4788
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
|
+
}
|
|
4789
4715
|
}
|
|
4790
4716
|
exports.Adaptable = Adaptable;
|
|
4791
4717
|
class AdaptableNoCodeWizard {
|