@adaptabletools/adaptable 13.0.0-canary.9 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +1454 -840
- package/base.css.map +1 -0
- package/bundle.cjs.js +238 -220
- package/index.css +1505 -850
- package/index.css.map +1 -0
- package/package.json +6 -6
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +30 -6
- package/src/AdaptableOptions/ExportOptions.d.ts +2 -2
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -5
- 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 -5
- package/src/Api/ExportApi.d.ts +6 -6
- 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/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/QueryLanguageApi.d.ts +3 -2
- package/src/Api/ScopeApi.d.ts +1 -1
- package/src/Api/StyledColumnApi.d.ts +106 -0
- package/src/Api/{ConditionalStyleApi.js → StyledColumnApi.js} +0 -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/FormatColumnState.d.ts +6 -90
- package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
- package/src/PredefinedConfig/StyledColumnState.d.ts +119 -0
- package/src/{Strategy/Interface/IConditionalStyleModule.js → PredefinedConfig/StyledColumnState.js} +0 -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/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/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 +1 -3
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -4
- package/src/Utilities/ObjectFactory.d.ts +5 -2
- package/src/Utilities/ObjectFactory.js +14 -6
- package/src/Utilities/Services/ModuleService.js +2 -2
- package/src/Utilities/Services/QueryLanguageService.js +1 -1
- 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/Dashboard/DashboardPopup.js +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 -6
- 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 +3 -10
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +7 -7
- package/src/View/GridInfo/ColumnInfoComponent.js +26 -18
- package/src/View/GridInfo/GridInfoPopup.js +10 -9
- 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/StatusBar/StatusBarPopup.js +1 -1
- 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 +10 -11
- package/src/agGrid/Adaptable.js +164 -222
- 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/DragAndDropContext/TabList.js +1 -1
- package/src/components/DragAndDropContext/UnusedPanel.js +3 -2
- 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 +113 -57
- 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 +5 -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 -86
- 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();
|
|
@@ -892,13 +918,15 @@ class Adaptable {
|
|
|
892
918
|
this.gridOptions.api.setColumnDefs(colDefs);
|
|
893
919
|
this.updateColumnsIntoStore(); // todo remove this from here!!!
|
|
894
920
|
}
|
|
895
|
-
|
|
896
|
-
const columnStyle = formatColumn.ColumnStyle;
|
|
921
|
+
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
897
922
|
let style = {};
|
|
898
|
-
const gradientStyle =
|
|
923
|
+
const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
|
|
924
|
+
if (params.value === undefined) {
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
899
927
|
if (gradientStyle) {
|
|
900
|
-
const min = this.api.
|
|
901
|
-
const max = this.api.
|
|
928
|
+
const min = this.api.styledColumnApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
929
|
+
const max = this.api.styledColumnApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
902
930
|
const clampedValue = (0, clamp_1.default)(params.value, min, max);
|
|
903
931
|
let cellBackColor;
|
|
904
932
|
let reverseGradient = false;
|
|
@@ -922,72 +950,49 @@ class Adaptable {
|
|
|
922
950
|
const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
|
|
923
951
|
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
924
952
|
}
|
|
925
|
-
if (
|
|
953
|
+
if (styledColumn.PercentBarStyle && styledColumn.PercentBarStyle.CellText) {
|
|
926
954
|
style.paddingTop = 0;
|
|
927
955
|
style.paddingBottom = 0;
|
|
928
956
|
}
|
|
929
957
|
return style;
|
|
930
958
|
}
|
|
931
|
-
|
|
959
|
+
getFormatColumnAdaptableStyle(formatColumns) {
|
|
932
960
|
// first has more precedence, then they need to be applied in reverse order
|
|
933
961
|
return formatColumns.reduceRight((style, formatColumn) => {
|
|
934
|
-
const formatColumnStyle =
|
|
962
|
+
const formatColumnStyle = formatColumn.Style
|
|
963
|
+
? this.convertAdaptableStyleToCSS(formatColumn.Style)
|
|
964
|
+
: {};
|
|
965
|
+
if (formatColumn.CellAlignment) {
|
|
966
|
+
switch (formatColumn.CellAlignment) {
|
|
967
|
+
case 'Left':
|
|
968
|
+
style.textAlign = 'left';
|
|
969
|
+
break;
|
|
970
|
+
case 'Right':
|
|
971
|
+
style.textAlign = 'right';
|
|
972
|
+
break;
|
|
973
|
+
case 'Center':
|
|
974
|
+
style.textAlign = 'center';
|
|
975
|
+
break;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
935
978
|
return Object.assign(Object.assign({}, style), formatColumnStyle);
|
|
936
979
|
}, {});
|
|
937
980
|
}
|
|
938
|
-
getFormatColumnCellStyle(abColumn,
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
const columnStyle = formatColumn.ColumnStyle;
|
|
942
|
-
if (columnStyle) {
|
|
943
|
-
if (columnStyle &&
|
|
944
|
-
!this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params)) {
|
|
945
|
-
return style;
|
|
946
|
-
}
|
|
947
|
-
style = Object.assign(Object.assign({}, style), this.getFormatColumnSpecialColumnStyle(formatColumn, abColumn, params));
|
|
948
|
-
}
|
|
949
|
-
else if (formatColumn.Style) {
|
|
950
|
-
const activeFormatColumnsWithStyle = formatColumnsWithStyle.filter((formatColumn) => {
|
|
951
|
-
return this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params);
|
|
952
|
-
});
|
|
953
|
-
if (!activeFormatColumnsWithStyle.length) {
|
|
954
|
-
return style;
|
|
955
|
-
}
|
|
956
|
-
style = Object.assign(Object.assign({}, style), this.getFormatColumnColumnStyle(activeFormatColumnsWithStyle));
|
|
957
|
-
}
|
|
958
|
-
if (formatColumn.CellAlignment) {
|
|
959
|
-
switch (formatColumn.CellAlignment) {
|
|
960
|
-
case 'Left':
|
|
961
|
-
style.textAlign = 'left';
|
|
962
|
-
break;
|
|
963
|
-
case 'Right':
|
|
964
|
-
style.textAlign = 'right';
|
|
965
|
-
break;
|
|
966
|
-
case 'Center':
|
|
967
|
-
style.textAlign = 'center';
|
|
968
|
-
break;
|
|
969
|
-
}
|
|
981
|
+
getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params) {
|
|
982
|
+
if (!activeFormatColumnsWithStyle.length) {
|
|
983
|
+
return {};
|
|
970
984
|
}
|
|
971
|
-
|
|
985
|
+
const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
|
|
986
|
+
return this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params);
|
|
987
|
+
});
|
|
988
|
+
return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
|
|
972
989
|
}
|
|
973
990
|
getFormatColumnCellClass(formatColumns, abColumn, params) {
|
|
974
991
|
const classNames = formatColumns
|
|
975
992
|
.map((formatColumn) => {
|
|
976
993
|
var _a, _b;
|
|
977
994
|
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
978
|
-
this.api.formatColumnApi.
|
|
979
|
-
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
980
|
-
}
|
|
981
|
-
})
|
|
982
|
-
.filter((x) => !!x);
|
|
983
|
-
return classNames;
|
|
984
|
-
}
|
|
985
|
-
getFormatColumnRowClass(formatColumns, params) {
|
|
986
|
-
const classNames = formatColumns
|
|
987
|
-
.map((formatColumn) => {
|
|
988
|
-
var _a, _b;
|
|
989
|
-
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
990
|
-
this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params)) {
|
|
995
|
+
this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params)) {
|
|
991
996
|
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
992
997
|
}
|
|
993
998
|
})
|
|
@@ -1142,31 +1147,6 @@ class Adaptable {
|
|
|
1142
1147
|
}
|
|
1143
1148
|
return undefined;
|
|
1144
1149
|
}
|
|
1145
|
-
getConditionalStyleCellStyle(conditionalStyles = [], abColumn, params) {
|
|
1146
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
1147
|
-
const result = conditionalStyles.reduce((result, conditionalStyle) => {
|
|
1148
|
-
if (module.isConditionalStyleActiveForColumn(conditionalStyle, abColumn, params)) {
|
|
1149
|
-
return Object.assign(Object.assign({}, result), conditionalStyle.Style);
|
|
1150
|
-
}
|
|
1151
|
-
else {
|
|
1152
|
-
return result;
|
|
1153
|
-
}
|
|
1154
|
-
}, {});
|
|
1155
|
-
return this.convertAdaptableStyleToCSS(result);
|
|
1156
|
-
}
|
|
1157
|
-
getConditionalStyleCellClass(conditionalStyles = [], abColumn, params) {
|
|
1158
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
1159
|
-
let classNames = conditionalStyles
|
|
1160
|
-
.map((conditionalStyle) => {
|
|
1161
|
-
var _a, _b;
|
|
1162
|
-
if (((_a = conditionalStyle.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
1163
|
-
module.isConditionalStyleActiveForColumn(conditionalStyle, abColumn, params)) {
|
|
1164
|
-
return (_b = conditionalStyle.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
1165
|
-
}
|
|
1166
|
-
})
|
|
1167
|
-
.filter((x) => !!x);
|
|
1168
|
-
return classNames;
|
|
1169
|
-
}
|
|
1170
1150
|
getEditableCellClass(abColumn, params) {
|
|
1171
1151
|
const editableCellStyle = this.api.userInterfaceApi.getEditableCellStyle();
|
|
1172
1152
|
if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
|
|
@@ -1309,7 +1289,7 @@ class Adaptable {
|
|
|
1309
1289
|
const colId = customSort.ColumnId;
|
|
1310
1290
|
if (!layoutColumnsMap[colId]) {
|
|
1311
1291
|
// pivot layouts may have no pivot columns, only aggregation columns
|
|
1312
|
-
if (layout.AggregationColumns[colId] == undefined) {
|
|
1292
|
+
if (!layout.AggregationColumns || layout.AggregationColumns[colId] == undefined) {
|
|
1313
1293
|
return acc;
|
|
1314
1294
|
}
|
|
1315
1295
|
}
|
|
@@ -1577,7 +1557,10 @@ class Adaptable {
|
|
|
1577
1557
|
layout.RowGroupedColumns = groupedColumns;
|
|
1578
1558
|
if (Object.keys(aggregatedColumns).length) {
|
|
1579
1559
|
// ag-grid aggregations are not 1-1 with adaptable column-aggregations
|
|
1580
|
-
layout.AggregationColumns = this.
|
|
1560
|
+
layout.AggregationColumns = this.mapAggregationColumnsFromGrid(aggregatedColumns, currentLayout);
|
|
1561
|
+
}
|
|
1562
|
+
else {
|
|
1563
|
+
layout.AggregationColumns = {};
|
|
1581
1564
|
}
|
|
1582
1565
|
layout.EnablePivot = this.gridOptions.columnApi.isPivotMode();
|
|
1583
1566
|
layout.PivotColumns = pivotColumns;
|
|
@@ -1886,7 +1869,7 @@ class Adaptable {
|
|
|
1886
1869
|
if (colDef && colDef.cellRenderer != null) {
|
|
1887
1870
|
return true;
|
|
1888
1871
|
}
|
|
1889
|
-
if (this.api.columnApi.
|
|
1872
|
+
if (this.api.columnApi.isStyledNumericColumn(column)) {
|
|
1890
1873
|
return true;
|
|
1891
1874
|
}
|
|
1892
1875
|
if (this.api.columnApi.isBooleanColumn(column)) {
|
|
@@ -1941,7 +1924,7 @@ class Adaptable {
|
|
|
1941
1924
|
}
|
|
1942
1925
|
getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
|
|
1943
1926
|
const abColumn = this.api.columnApi.getColumnFromId(columnId);
|
|
1944
|
-
const isRenderedColumn = this.api.columnApi.
|
|
1927
|
+
const isRenderedColumn = this.api.columnApi.isStyledNumericColumn(abColumn);
|
|
1945
1928
|
if (isRenderedColumn) {
|
|
1946
1929
|
const colDef = this.gridOptions.api.getColumnDef(columnId);
|
|
1947
1930
|
if (typeof colDef.valueFormatter == 'function') {
|
|
@@ -2344,7 +2327,7 @@ class Adaptable {
|
|
|
2344
2327
|
pinned: this.adaptableOptions.actionOptions.actionRowButtonsPosition === 'pinnedRight'
|
|
2345
2328
|
? 'right'
|
|
2346
2329
|
: 'left',
|
|
2347
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2330
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2348
2331
|
cellRendererParams: {
|
|
2349
2332
|
actionColumn: rowEditActionColumn,
|
|
2350
2333
|
},
|
|
@@ -2373,7 +2356,7 @@ class Adaptable {
|
|
|
2373
2356
|
filter: false,
|
|
2374
2357
|
sortable: false,
|
|
2375
2358
|
enableRowGroup: false,
|
|
2376
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2359
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2377
2360
|
type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
2378
2361
|
};
|
|
2379
2362
|
(0, LoggingHelper_1.LogAdaptableInfo)('Setting up Action Column: ' + actionColumn.columnId);
|
|
@@ -3184,18 +3167,18 @@ class Adaptable {
|
|
|
3184
3167
|
fontSize: null,
|
|
3185
3168
|
borderColor: null,
|
|
3186
3169
|
};
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3189
|
-
|
|
3170
|
+
const activeFormatColumnsWithStyle = this.api.formatColumnApi.getFormatColumnsWithStyleForColumn(abColumn);
|
|
3171
|
+
let styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3172
|
+
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) {
|
|
3173
|
+
styledColumn = null;
|
|
3174
|
+
}
|
|
3190
3175
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
3191
3176
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3192
3177
|
const cellStyle = (params) => {
|
|
3193
|
-
const formatColumnCellStyle = formatColumn
|
|
3194
|
-
? this.getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params)
|
|
3195
|
-
: undefined;
|
|
3196
3178
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3197
|
-
const
|
|
3198
|
-
|
|
3179
|
+
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
|
|
3180
|
+
? this.getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params)
|
|
3181
|
+
: {})), (styledColumn ? this.getStyledColumnStyle(styledColumn, abColumn, params) : {})), (isQuickSearchActive ? quickSearchStyle : {})), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
3199
3182
|
return result;
|
|
3200
3183
|
};
|
|
3201
3184
|
return cellStyle;
|
|
@@ -3204,10 +3187,6 @@ class Adaptable {
|
|
|
3204
3187
|
setupColumnCellClass({ col, colId, abColumn }) {
|
|
3205
3188
|
this.setColDefProperty(col, 'cellClass', (userCellClass) => {
|
|
3206
3189
|
const formatColumns = this.api.formatColumnApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
|
|
3207
|
-
const conditionalStyles = this.api.conditionalStyleApi
|
|
3208
|
-
.getConditionalStylesForColumn(abColumn)
|
|
3209
|
-
.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName));
|
|
3210
|
-
const hasConditionalStylesWithClassNames = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles);
|
|
3211
3190
|
const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
3212
3191
|
const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
3213
3192
|
const cellClass = (params) => {
|
|
@@ -3217,25 +3196,26 @@ class Adaptable {
|
|
|
3217
3196
|
const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
|
|
3218
3197
|
const highlightAlertClassName = this.getAlertCellClass(abColumn, params);
|
|
3219
3198
|
const flashingClassName = this.getFlashingCellClass(abColumn, params);
|
|
3199
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3200
|
+
const hasStyledColumn = !!styledColumn && !styledColumn.IsSuspended;
|
|
3220
3201
|
const returnValue = [
|
|
3221
3202
|
this.getExcelClassNameForCell(colId, primaryKeyValue),
|
|
3222
3203
|
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
3223
|
-
formatColumns.length
|
|
3204
|
+
!hasStyledColumn && formatColumns.length
|
|
3224
3205
|
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
3225
3206
|
: null,
|
|
3226
|
-
hasConditionalStylesWithClassNames
|
|
3227
|
-
? this.getConditionalStyleCellClass(conditionalStyles, abColumn, params)
|
|
3228
|
-
: null,
|
|
3229
3207
|
isQuickSearchActive ? quickSearchStyleClassName : null,
|
|
3230
3208
|
editableClassName,
|
|
3231
3209
|
readonlyClassName,
|
|
3232
3210
|
highlightAlertClassName,
|
|
3233
3211
|
flashingClassName,
|
|
3234
3212
|
]
|
|
3235
|
-
// we flatten the array because some rules ('userCellClass'
|
|
3213
|
+
// we flatten the array because some rules ('userCellClass' etc) might return a string[]
|
|
3236
3214
|
.flat()
|
|
3237
3215
|
.filter((x) => !!x);
|
|
3238
|
-
|
|
3216
|
+
const result = returnValue.length ? returnValue : undefined;
|
|
3217
|
+
// console.log(result);
|
|
3218
|
+
return result;
|
|
3239
3219
|
};
|
|
3240
3220
|
return cellClass;
|
|
3241
3221
|
});
|
|
@@ -3252,9 +3232,8 @@ class Adaptable {
|
|
|
3252
3232
|
const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
3253
3233
|
const hasRichSelectCellEditor = this.isAgGridModulePresent(core_1.ModuleNames.RichSelectModule);
|
|
3254
3234
|
this.setColDefProperty(col, 'cellEditor', () => {
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && ((_a = formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle)) {
|
|
3235
|
+
const styledColumn = this.api.styledColumnApi.getActiveStyledColumnForColumn(adaptableColumn);
|
|
3236
|
+
if (styledColumn && !(styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) && styledColumn.CheckBoxStyle) {
|
|
3258
3237
|
return CheckboxRenderer_1.CheckboxEditor;
|
|
3259
3238
|
}
|
|
3260
3239
|
if (editLookUpItem) {
|
|
@@ -3281,12 +3260,12 @@ class Adaptable {
|
|
|
3281
3260
|
}
|
|
3282
3261
|
setupColumnCellRenderer({ col, colId, abColumn }) {
|
|
3283
3262
|
this.setColDefProperty(col, 'cellRenderer', () => {
|
|
3284
|
-
const
|
|
3285
|
-
if (
|
|
3286
|
-
if (
|
|
3287
|
-
return this.agGridHelper.createPercentBarRendererComp(
|
|
3263
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(abColumn.columnId);
|
|
3264
|
+
if (styledColumn && !styledColumn.IsSuspended) {
|
|
3265
|
+
if (styledColumn.PercentBarStyle) {
|
|
3266
|
+
return this.agGridHelper.createPercentBarRendererComp(styledColumn, abColumn);
|
|
3288
3267
|
}
|
|
3289
|
-
if (
|
|
3268
|
+
if (styledColumn.CheckBoxStyle) {
|
|
3290
3269
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
3291
3270
|
}
|
|
3292
3271
|
}
|
|
@@ -3294,30 +3273,19 @@ class Adaptable {
|
|
|
3294
3273
|
}
|
|
3295
3274
|
setupColumnTooltipValueGetter({ col, colId, abColumn }) {
|
|
3296
3275
|
this.setColDefProperty(col, 'tooltipValueGetter', () => {
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
formatColumn.ColumnStyle.PercentBarStyle.ToolTipText) {
|
|
3304
|
-
if ((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle) {
|
|
3276
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3277
|
+
if (styledColumn &&
|
|
3278
|
+
!styledColumn.IsSuspended &&
|
|
3279
|
+
styledColumn.PercentBarStyle &&
|
|
3280
|
+
styledColumn.PercentBarStyle.ToolTipText) {
|
|
3281
|
+
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.PercentBarStyle) {
|
|
3305
3282
|
return (params) => {
|
|
3306
|
-
const min = this.api.
|
|
3307
|
-
const max = this.api.
|
|
3308
|
-
const textOptions =
|
|
3283
|
+
const min = this.api.styledColumnApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
3284
|
+
const max = this.api.styledColumnApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
3285
|
+
const textOptions = styledColumn.PercentBarStyle.ToolTipText;
|
|
3309
3286
|
let returnValue = '';
|
|
3310
3287
|
if (textOptions.includes('CellValue')) {
|
|
3311
|
-
|
|
3312
|
-
const options = formatColumn.DisplayFormat
|
|
3313
|
-
.Options;
|
|
3314
|
-
returnValue = options
|
|
3315
|
-
? FormatHelper_1.default.NumberFormatter(params.value, options)
|
|
3316
|
-
: params.value;
|
|
3317
|
-
}
|
|
3318
|
-
else {
|
|
3319
|
-
returnValue = params.value;
|
|
3320
|
-
}
|
|
3288
|
+
returnValue = params.value;
|
|
3321
3289
|
}
|
|
3322
3290
|
if (textOptions.includes('PercentageValue')) {
|
|
3323
3291
|
const clampedValue = Helper_1.Helper.clamp(params.value, min, max);
|
|
@@ -3438,47 +3406,39 @@ class Adaptable {
|
|
|
3438
3406
|
}
|
|
3439
3407
|
setupColumnValueFormatter({ col, abColumn }) {
|
|
3440
3408
|
this.setColDefProperty(col, 'valueFormatter', (params) => {
|
|
3441
|
-
const
|
|
3442
|
-
if (!
|
|
3409
|
+
const activeFormatColumnsWithDisplayFormat = this.api.formatColumnApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
3410
|
+
if (!activeFormatColumnsWithDisplayFormat.length) {
|
|
3443
3411
|
return;
|
|
3444
3412
|
}
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3413
|
+
return (params) => {
|
|
3414
|
+
const { node, value } = params;
|
|
3415
|
+
const [mostRelevantFormatColumn] = this.api.formatColumnApi.getFormatColumnsRelevantForColumn(activeFormatColumnsWithDisplayFormat, abColumn, { node, value });
|
|
3416
|
+
if (!mostRelevantFormatColumn) {
|
|
3417
|
+
// ALL FormatColumns are conditional and NONE of them are relevant for this row
|
|
3418
|
+
return value;
|
|
3419
|
+
}
|
|
3420
|
+
const options = mostRelevantFormatColumn.DisplayFormat.Options;
|
|
3421
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'NumberFormatter') {
|
|
3452
3422
|
// change the Number format - if the scope allows it
|
|
3453
|
-
if (this.api.scopeApi.isColumnInNumericScope(abColumn,
|
|
3454
|
-
|
|
3455
|
-
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3456
|
-
};
|
|
3423
|
+
if (this.api.scopeApi.isColumnInNumericScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3424
|
+
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3457
3425
|
}
|
|
3458
3426
|
}
|
|
3459
|
-
if (
|
|
3427
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'DateFormatter') {
|
|
3460
3428
|
// change the Date format - if the scope allows it
|
|
3461
|
-
if (this.api.scopeApi.isColumnInDateScope(abColumn,
|
|
3462
|
-
|
|
3463
|
-
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3464
|
-
};
|
|
3429
|
+
if (this.api.scopeApi.isColumnInDateScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3430
|
+
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3465
3431
|
}
|
|
3466
3432
|
}
|
|
3467
|
-
if (
|
|
3433
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
3468
3434
|
// change the String format - if the scope allows it
|
|
3469
|
-
if (this.api.scopeApi.isColumnInStringsScope(abColumn,
|
|
3470
|
-
|
|
3471
|
-
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3472
|
-
};
|
|
3435
|
+
if (this.api.scopeApi.isColumnInStringsScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3436
|
+
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3473
3437
|
}
|
|
3474
3438
|
}
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
return rulePasses ? valueFormatter(params) : params.value;
|
|
3479
|
-
};
|
|
3480
|
-
}
|
|
3481
|
-
}
|
|
3439
|
+
// should NEVER arrive at this line, but just to be sure
|
|
3440
|
+
return value;
|
|
3441
|
+
};
|
|
3482
3442
|
});
|
|
3483
3443
|
}
|
|
3484
3444
|
setupColumnEditable({ col }) {
|
|
@@ -3697,6 +3657,7 @@ class Adaptable {
|
|
|
3697
3657
|
this.api.freeTextColumnApi.checkFreeTextColumnForDataChange(cellDataChangedInfo);
|
|
3698
3658
|
}
|
|
3699
3659
|
this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
|
|
3660
|
+
this.resetMinMaxCachedValueForColumn(cellDataChangedInfo.column);
|
|
3700
3661
|
});
|
|
3701
3662
|
// if node is visible then check if need to refresh other columns / whole row if the updating column is:
|
|
3702
3663
|
// 1. referenced in Conditional Styles that have Expressions (refreshing whole row if Scope is All)
|
|
@@ -3711,7 +3672,7 @@ class Adaptable {
|
|
|
3711
3672
|
this.redrawRow(firstInfo.rowNode);
|
|
3712
3673
|
}
|
|
3713
3674
|
else {
|
|
3714
|
-
this.
|
|
3675
|
+
this.getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
|
|
3715
3676
|
if (dataChangedScope.columnIds.size > 0) {
|
|
3716
3677
|
this.refreshCells([firstInfo.rowNode], Array.from(dataChangedScope.columnIds.values()), true);
|
|
3717
3678
|
}
|
|
@@ -3720,15 +3681,14 @@ class Adaptable {
|
|
|
3720
3681
|
firstInfo.trigger == 'tick' ? this.filterOnTickingDataChange() : this.filterOnEditDataChange();
|
|
3721
3682
|
}
|
|
3722
3683
|
getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3723
|
-
const
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(stylesWithExpression)) {
|
|
3684
|
+
const formatColumnsWithExpression = [];
|
|
3685
|
+
formatColumnsWithExpression.push(...this.api.formatColumnApi.getFormatColumnsWithExpression());
|
|
3686
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(formatColumnsWithExpression)) {
|
|
3727
3687
|
return;
|
|
3728
3688
|
}
|
|
3729
3689
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3730
3690
|
if (!dataChangedScope.wholeRow) {
|
|
3731
|
-
|
|
3691
|
+
formatColumnsWithExpression.forEach((styleModule) => {
|
|
3732
3692
|
if (!dataChangedScope.wholeRow) {
|
|
3733
3693
|
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(styleModule.Rule.BooleanExpression);
|
|
3734
3694
|
if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
@@ -3750,20 +3710,15 @@ class Adaptable {
|
|
|
3750
3710
|
}
|
|
3751
3711
|
});
|
|
3752
3712
|
}
|
|
3753
|
-
|
|
3754
|
-
this.api.
|
|
3755
|
-
let columnComparison = this.api.
|
|
3713
|
+
getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3714
|
+
this.api.styledColumnApi.getAllStyledColumn().forEach((sc) => {
|
|
3715
|
+
let columnComparison = this.api.styledColumnApi.getColumnComparisonForStyledColumn(sc);
|
|
3756
3716
|
if (columnComparison) {
|
|
3757
|
-
let affectedColumnIds = this.api.
|
|
3717
|
+
let affectedColumnIds = this.api.styledColumnApi.getColumnIdsFromColumnComparison(columnComparison);
|
|
3758
3718
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(affectedColumnIds)) {
|
|
3759
3719
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3760
3720
|
if (affectedColumnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
3761
|
-
|
|
3762
|
-
.getColumnsForScope(fc.Scope)
|
|
3763
|
-
.map((c) => c.columnId)
|
|
3764
|
-
.forEach((colId) => {
|
|
3765
|
-
dataChangedScope.columnIds.add(colId);
|
|
3766
|
-
});
|
|
3721
|
+
dataChangedScope.columnIds.add(sc.ColumnId);
|
|
3767
3722
|
}
|
|
3768
3723
|
});
|
|
3769
3724
|
}
|
|
@@ -4362,13 +4317,10 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4362
4317
|
}
|
|
4363
4318
|
}
|
|
4364
4319
|
setupRowStyling() {
|
|
4365
|
-
// first get the conditional style state
|
|
4366
|
-
const conditionalStyles = this.api.conditionalStyleApi.getRowConditionalStyles();
|
|
4367
|
-
const formatColumnsStyles = this.api.formatColumnApi.getRowFormatColumnsWithStyle();
|
|
4368
4320
|
// Set any Row Styles (i.e. items without a classname)
|
|
4369
4321
|
this.setGridOptionsProperty('getRowStyle', (userGetRowStyle) => {
|
|
4370
4322
|
return (params) => {
|
|
4371
|
-
const result = Object.assign(Object.assign(Object.assign(
|
|
4323
|
+
const result = Object.assign(Object.assign(Object.assign({}, userGetRowStyle === null || userGetRowStyle === void 0 ? void 0 : userGetRowStyle(params)), this.getRowHighlightStyle(params)), this.getAlertRowStyle(params));
|
|
4372
4324
|
return result;
|
|
4373
4325
|
};
|
|
4374
4326
|
});
|
|
@@ -4381,8 +4333,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4381
4333
|
typeof userGetRowClass === 'function' ? userGetRowClass(params) : userGetRowClass,
|
|
4382
4334
|
highlightClassName,
|
|
4383
4335
|
alertHighlightClassName,
|
|
4384
|
-
this.getConditionalStyleRowClass(conditionalStyles.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName)), params),
|
|
4385
|
-
this.getFormatColumnRowClass(formatColumnsStyles, params),
|
|
4386
4336
|
]
|
|
4387
4337
|
// we flatten it because 'userGetRowClass' might return a string[]
|
|
4388
4338
|
.flat()
|
|
@@ -4401,38 +4351,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4401
4351
|
const newValue = this.gridOptions.suppressAggFuncInHeader;
|
|
4402
4352
|
return previousValue !== newValue;
|
|
4403
4353
|
}
|
|
4404
|
-
getConditionalStyleRowClass(conditionalStyles, params) {
|
|
4405
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles)) {
|
|
4406
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
4407
|
-
let classNames = conditionalStyles
|
|
4408
|
-
.map((conditionalStyle) => {
|
|
4409
|
-
var _a;
|
|
4410
|
-
if (module.isConditionalStyleActiveForRow(conditionalStyle, params)) {
|
|
4411
|
-
return (_a = conditionalStyle.Style) === null || _a === void 0 ? void 0 : _a.ClassName;
|
|
4412
|
-
}
|
|
4413
|
-
})
|
|
4414
|
-
.filter((x) => !!x)
|
|
4415
|
-
.join(' ');
|
|
4416
|
-
return classNames;
|
|
4417
|
-
}
|
|
4418
|
-
}
|
|
4419
|
-
getConditionalStyleRowStyle(conditionalStyles, params) {
|
|
4420
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles)) {
|
|
4421
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
4422
|
-
const cs = conditionalStyles.find((cs) => module.isConditionalStyleActiveForRow(cs, params));
|
|
4423
|
-
if (cs) {
|
|
4424
|
-
return this.convertAdaptableStyleToCSS(cs.Style);
|
|
4425
|
-
}
|
|
4426
|
-
}
|
|
4427
|
-
}
|
|
4428
|
-
getFormatColumnRowStyle(formatColumns, params) {
|
|
4429
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(formatColumns)) {
|
|
4430
|
-
const formatColumnWithRowStyle = formatColumns.find((formatColumn) => this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params));
|
|
4431
|
-
if (formatColumnWithRowStyle) {
|
|
4432
|
-
return this.convertAdaptableStyleToCSS(formatColumnWithRowStyle.Style);
|
|
4433
|
-
}
|
|
4434
|
-
}
|
|
4435
|
-
}
|
|
4436
4354
|
getGridOptionsApi() {
|
|
4437
4355
|
if (!this.gridOptions.api) {
|
|
4438
4356
|
(0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
|
|
@@ -4759,8 +4677,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4759
4677
|
/**
|
|
4760
4678
|
* When reading the state from the grid, we have to make sure 'avg' is not overriden with the 'avg' string.
|
|
4761
4679
|
*/
|
|
4762
|
-
|
|
4763
|
-
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
4680
|
+
mapAggregationColumnsFromGrid(aggFuncFromGrid, currentLayout) {
|
|
4764
4681
|
return Object.entries(aggFuncFromGrid).reduce((acc, [colId, agg]) => {
|
|
4765
4682
|
const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(colId);
|
|
4766
4683
|
if ((adaptableAggFunc === null || adaptableAggFunc === void 0 ? void 0 : adaptableAggFunc.type) === 'weightedAverage' && agg === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
@@ -4773,6 +4690,31 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4773
4690
|
return acc;
|
|
4774
4691
|
}, {});
|
|
4775
4692
|
}
|
|
4693
|
+
resetMinMaxCachedValueForColumn(column) {
|
|
4694
|
+
if (!column) {
|
|
4695
|
+
this.columnMinMaxValuesCache[column.columnId] = {};
|
|
4696
|
+
}
|
|
4697
|
+
if (this.columnMinMaxValuesCache[column.columnId]) {
|
|
4698
|
+
this.columnMinMaxValuesCache[column.columnId] = undefined;
|
|
4699
|
+
}
|
|
4700
|
+
}
|
|
4701
|
+
getMinMaxCachedValueForColumn(column, minMax) {
|
|
4702
|
+
var _a;
|
|
4703
|
+
const { columnId, dataType } = column;
|
|
4704
|
+
if (dataType !== 'Number') {
|
|
4705
|
+
return undefined;
|
|
4706
|
+
}
|
|
4707
|
+
let value = (_a = this.columnMinMaxValuesCache[columnId]) === null || _a === void 0 ? void 0 : _a[minMax];
|
|
4708
|
+
if (value !== undefined) {
|
|
4709
|
+
return value;
|
|
4710
|
+
}
|
|
4711
|
+
const distinctRawValues = this.api.columnApi
|
|
4712
|
+
.getUnsortedDistinctRawValuesForColumn(columnId)
|
|
4713
|
+
.map((item) => item.rawValue);
|
|
4714
|
+
value = minMax === 'min' ? Math.min(...distinctRawValues) : Math.max(...distinctRawValues);
|
|
4715
|
+
this.columnMinMaxValuesCache[columnId] = Object.assign(Object.assign({}, this.columnMinMaxValuesCache[columnId]), { [minMax]: value });
|
|
4716
|
+
return value;
|
|
4717
|
+
}
|
|
4776
4718
|
}
|
|
4777
4719
|
exports.Adaptable = Adaptable;
|
|
4778
4720
|
class AdaptableNoCodeWizard {
|