@adaptabletools/adaptable 13.0.0-canary.9 → 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/base.css +1231 -733
- package/base.css.map +1 -0
- package/bundle.cjs.js +236 -219
- 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 +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/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 +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 +10 -11
- package/src/agGrid/Adaptable.js +161 -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/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,12 @@ 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;
|
|
899
924
|
if (gradientStyle) {
|
|
900
|
-
const min = this.api.
|
|
901
|
-
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);
|
|
902
927
|
const clampedValue = (0, clamp_1.default)(params.value, min, max);
|
|
903
928
|
let cellBackColor;
|
|
904
929
|
let reverseGradient = false;
|
|
@@ -922,72 +947,49 @@ class Adaptable {
|
|
|
922
947
|
const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
|
|
923
948
|
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
924
949
|
}
|
|
925
|
-
if (
|
|
950
|
+
if (styledColumn.PercentBarStyle && styledColumn.PercentBarStyle.CellText) {
|
|
926
951
|
style.paddingTop = 0;
|
|
927
952
|
style.paddingBottom = 0;
|
|
928
953
|
}
|
|
929
954
|
return style;
|
|
930
955
|
}
|
|
931
|
-
|
|
956
|
+
getFormatColumnAdaptableStyle(formatColumns) {
|
|
932
957
|
// first has more precedence, then they need to be applied in reverse order
|
|
933
958
|
return formatColumns.reduceRight((style, formatColumn) => {
|
|
934
|
-
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
|
+
}
|
|
935
975
|
return Object.assign(Object.assign({}, style), formatColumnStyle);
|
|
936
976
|
}, {});
|
|
937
977
|
}
|
|
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
|
-
}
|
|
978
|
+
getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params) {
|
|
979
|
+
if (!activeFormatColumnsWithStyle.length) {
|
|
980
|
+
return {};
|
|
970
981
|
}
|
|
971
|
-
|
|
982
|
+
const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
|
|
983
|
+
return this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params);
|
|
984
|
+
});
|
|
985
|
+
return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
|
|
972
986
|
}
|
|
973
987
|
getFormatColumnCellClass(formatColumns, abColumn, params) {
|
|
974
988
|
const classNames = formatColumns
|
|
975
989
|
.map((formatColumn) => {
|
|
976
990
|
var _a, _b;
|
|
977
991
|
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)) {
|
|
992
|
+
this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params)) {
|
|
991
993
|
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
992
994
|
}
|
|
993
995
|
})
|
|
@@ -1142,31 +1144,6 @@ class Adaptable {
|
|
|
1142
1144
|
}
|
|
1143
1145
|
return undefined;
|
|
1144
1146
|
}
|
|
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
1147
|
getEditableCellClass(abColumn, params) {
|
|
1171
1148
|
const editableCellStyle = this.api.userInterfaceApi.getEditableCellStyle();
|
|
1172
1149
|
if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
|
|
@@ -1309,7 +1286,7 @@ class Adaptable {
|
|
|
1309
1286
|
const colId = customSort.ColumnId;
|
|
1310
1287
|
if (!layoutColumnsMap[colId]) {
|
|
1311
1288
|
// pivot layouts may have no pivot columns, only aggregation columns
|
|
1312
|
-
if (layout.AggregationColumns[colId] == undefined) {
|
|
1289
|
+
if (!layout.AggregationColumns || layout.AggregationColumns[colId] == undefined) {
|
|
1313
1290
|
return acc;
|
|
1314
1291
|
}
|
|
1315
1292
|
}
|
|
@@ -1577,7 +1554,10 @@ class Adaptable {
|
|
|
1577
1554
|
layout.RowGroupedColumns = groupedColumns;
|
|
1578
1555
|
if (Object.keys(aggregatedColumns).length) {
|
|
1579
1556
|
// ag-grid aggregations are not 1-1 with adaptable column-aggregations
|
|
1580
|
-
layout.AggregationColumns = this.
|
|
1557
|
+
layout.AggregationColumns = this.mapAggregationColumnsFromGrid(aggregatedColumns, currentLayout);
|
|
1558
|
+
}
|
|
1559
|
+
else {
|
|
1560
|
+
layout.AggregationColumns = {};
|
|
1581
1561
|
}
|
|
1582
1562
|
layout.EnablePivot = this.gridOptions.columnApi.isPivotMode();
|
|
1583
1563
|
layout.PivotColumns = pivotColumns;
|
|
@@ -1886,7 +1866,7 @@ class Adaptable {
|
|
|
1886
1866
|
if (colDef && colDef.cellRenderer != null) {
|
|
1887
1867
|
return true;
|
|
1888
1868
|
}
|
|
1889
|
-
if (this.api.columnApi.
|
|
1869
|
+
if (this.api.columnApi.isStyledNumericColumn(column)) {
|
|
1890
1870
|
return true;
|
|
1891
1871
|
}
|
|
1892
1872
|
if (this.api.columnApi.isBooleanColumn(column)) {
|
|
@@ -1941,7 +1921,7 @@ class Adaptable {
|
|
|
1941
1921
|
}
|
|
1942
1922
|
getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
|
|
1943
1923
|
const abColumn = this.api.columnApi.getColumnFromId(columnId);
|
|
1944
|
-
const isRenderedColumn = this.api.columnApi.
|
|
1924
|
+
const isRenderedColumn = this.api.columnApi.isStyledNumericColumn(abColumn);
|
|
1945
1925
|
if (isRenderedColumn) {
|
|
1946
1926
|
const colDef = this.gridOptions.api.getColumnDef(columnId);
|
|
1947
1927
|
if (typeof colDef.valueFormatter == 'function') {
|
|
@@ -2344,7 +2324,7 @@ class Adaptable {
|
|
|
2344
2324
|
pinned: this.adaptableOptions.actionOptions.actionRowButtonsPosition === 'pinnedRight'
|
|
2345
2325
|
? 'right'
|
|
2346
2326
|
: 'left',
|
|
2347
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2327
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2348
2328
|
cellRendererParams: {
|
|
2349
2329
|
actionColumn: rowEditActionColumn,
|
|
2350
2330
|
},
|
|
@@ -2373,7 +2353,7 @@ class Adaptable {
|
|
|
2373
2353
|
filter: false,
|
|
2374
2354
|
sortable: false,
|
|
2375
2355
|
enableRowGroup: false,
|
|
2376
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2356
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2377
2357
|
type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
2378
2358
|
};
|
|
2379
2359
|
(0, LoggingHelper_1.LogAdaptableInfo)('Setting up Action Column: ' + actionColumn.columnId);
|
|
@@ -3184,18 +3164,18 @@ class Adaptable {
|
|
|
3184
3164
|
fontSize: null,
|
|
3185
3165
|
borderColor: null,
|
|
3186
3166
|
};
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3189
|
-
|
|
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
|
+
}
|
|
3190
3172
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
3191
3173
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3192
3174
|
const cellStyle = (params) => {
|
|
3193
|
-
const formatColumnCellStyle = formatColumn
|
|
3194
|
-
? this.getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params)
|
|
3195
|
-
: undefined;
|
|
3196
3175
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3197
|
-
const
|
|
3198
|
-
|
|
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));
|
|
3199
3179
|
return result;
|
|
3200
3180
|
};
|
|
3201
3181
|
return cellStyle;
|
|
@@ -3204,10 +3184,6 @@ class Adaptable {
|
|
|
3204
3184
|
setupColumnCellClass({ col, colId, abColumn }) {
|
|
3205
3185
|
this.setColDefProperty(col, 'cellClass', (userCellClass) => {
|
|
3206
3186
|
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
3187
|
const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
3212
3188
|
const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
3213
3189
|
const cellClass = (params) => {
|
|
@@ -3217,25 +3193,26 @@ class Adaptable {
|
|
|
3217
3193
|
const readonlyClassName = this.getReadonlyCellClass(abColumn, params);
|
|
3218
3194
|
const highlightAlertClassName = this.getAlertCellClass(abColumn, params);
|
|
3219
3195
|
const flashingClassName = this.getFlashingCellClass(abColumn, params);
|
|
3196
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3197
|
+
const hasStyledColumn = !!styledColumn && !styledColumn.IsSuspended;
|
|
3220
3198
|
const returnValue = [
|
|
3221
3199
|
this.getExcelClassNameForCell(colId, primaryKeyValue),
|
|
3222
3200
|
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
3223
|
-
formatColumns.length
|
|
3201
|
+
!hasStyledColumn && formatColumns.length
|
|
3224
3202
|
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
3225
3203
|
: null,
|
|
3226
|
-
hasConditionalStylesWithClassNames
|
|
3227
|
-
? this.getConditionalStyleCellClass(conditionalStyles, abColumn, params)
|
|
3228
|
-
: null,
|
|
3229
3204
|
isQuickSearchActive ? quickSearchStyleClassName : null,
|
|
3230
3205
|
editableClassName,
|
|
3231
3206
|
readonlyClassName,
|
|
3232
3207
|
highlightAlertClassName,
|
|
3233
3208
|
flashingClassName,
|
|
3234
3209
|
]
|
|
3235
|
-
// we flatten the array because some rules ('userCellClass'
|
|
3210
|
+
// we flatten the array because some rules ('userCellClass' etc) might return a string[]
|
|
3236
3211
|
.flat()
|
|
3237
3212
|
.filter((x) => !!x);
|
|
3238
|
-
|
|
3213
|
+
const result = returnValue.length ? returnValue : undefined;
|
|
3214
|
+
// console.log(result);
|
|
3215
|
+
return result;
|
|
3239
3216
|
};
|
|
3240
3217
|
return cellClass;
|
|
3241
3218
|
});
|
|
@@ -3252,9 +3229,8 @@ class Adaptable {
|
|
|
3252
3229
|
const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
3253
3230
|
const hasRichSelectCellEditor = this.isAgGridModulePresent(core_1.ModuleNames.RichSelectModule);
|
|
3254
3231
|
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)) {
|
|
3232
|
+
const styledColumn = this.api.styledColumnApi.getActiveStyledColumnForColumn(adaptableColumn);
|
|
3233
|
+
if (styledColumn && !(styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) && styledColumn.CheckBoxStyle) {
|
|
3258
3234
|
return CheckboxRenderer_1.CheckboxEditor;
|
|
3259
3235
|
}
|
|
3260
3236
|
if (editLookUpItem) {
|
|
@@ -3281,12 +3257,12 @@ class Adaptable {
|
|
|
3281
3257
|
}
|
|
3282
3258
|
setupColumnCellRenderer({ col, colId, abColumn }) {
|
|
3283
3259
|
this.setColDefProperty(col, 'cellRenderer', () => {
|
|
3284
|
-
const
|
|
3285
|
-
if (
|
|
3286
|
-
if (
|
|
3287
|
-
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);
|
|
3288
3264
|
}
|
|
3289
|
-
if (
|
|
3265
|
+
if (styledColumn.CheckBoxStyle) {
|
|
3290
3266
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
3291
3267
|
}
|
|
3292
3268
|
}
|
|
@@ -3294,30 +3270,19 @@ class Adaptable {
|
|
|
3294
3270
|
}
|
|
3295
3271
|
setupColumnTooltipValueGetter({ col, colId, abColumn }) {
|
|
3296
3272
|
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) {
|
|
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) {
|
|
3305
3279
|
return (params) => {
|
|
3306
|
-
const min = this.api.
|
|
3307
|
-
const max = this.api.
|
|
3308
|
-
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;
|
|
3309
3283
|
let returnValue = '';
|
|
3310
3284
|
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
|
-
}
|
|
3285
|
+
returnValue = params.value;
|
|
3321
3286
|
}
|
|
3322
3287
|
if (textOptions.includes('PercentageValue')) {
|
|
3323
3288
|
const clampedValue = Helper_1.Helper.clamp(params.value, min, max);
|
|
@@ -3438,47 +3403,39 @@ class Adaptable {
|
|
|
3438
3403
|
}
|
|
3439
3404
|
setupColumnValueFormatter({ col, abColumn }) {
|
|
3440
3405
|
this.setColDefProperty(col, 'valueFormatter', (params) => {
|
|
3441
|
-
const
|
|
3442
|
-
if (!
|
|
3406
|
+
const activeFormatColumnsWithDisplayFormat = this.api.formatColumnApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
3407
|
+
if (!activeFormatColumnsWithDisplayFormat.length) {
|
|
3443
3408
|
return;
|
|
3444
3409
|
}
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
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') {
|
|
3452
3419
|
// 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
|
-
};
|
|
3420
|
+
if (this.api.scopeApi.isColumnInNumericScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3421
|
+
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3457
3422
|
}
|
|
3458
3423
|
}
|
|
3459
|
-
if (
|
|
3424
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'DateFormatter') {
|
|
3460
3425
|
// 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
|
-
};
|
|
3426
|
+
if (this.api.scopeApi.isColumnInDateScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3427
|
+
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3465
3428
|
}
|
|
3466
3429
|
}
|
|
3467
|
-
if (
|
|
3430
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
3468
3431
|
// 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
|
-
};
|
|
3432
|
+
if (this.api.scopeApi.isColumnInStringsScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3433
|
+
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3473
3434
|
}
|
|
3474
3435
|
}
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
return rulePasses ? valueFormatter(params) : params.value;
|
|
3479
|
-
};
|
|
3480
|
-
}
|
|
3481
|
-
}
|
|
3436
|
+
// should NEVER arrive at this line, but just to be sure
|
|
3437
|
+
return value;
|
|
3438
|
+
};
|
|
3482
3439
|
});
|
|
3483
3440
|
}
|
|
3484
3441
|
setupColumnEditable({ col }) {
|
|
@@ -3697,6 +3654,7 @@ class Adaptable {
|
|
|
3697
3654
|
this.api.freeTextColumnApi.checkFreeTextColumnForDataChange(cellDataChangedInfo);
|
|
3698
3655
|
}
|
|
3699
3656
|
this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
|
|
3657
|
+
this.resetMinMaxCachedValueForColumn(cellDataChangedInfo.column);
|
|
3700
3658
|
});
|
|
3701
3659
|
// if node is visible then check if need to refresh other columns / whole row if the updating column is:
|
|
3702
3660
|
// 1. referenced in Conditional Styles that have Expressions (refreshing whole row if Scope is All)
|
|
@@ -3711,7 +3669,7 @@ class Adaptable {
|
|
|
3711
3669
|
this.redrawRow(firstInfo.rowNode);
|
|
3712
3670
|
}
|
|
3713
3671
|
else {
|
|
3714
|
-
this.
|
|
3672
|
+
this.getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
|
|
3715
3673
|
if (dataChangedScope.columnIds.size > 0) {
|
|
3716
3674
|
this.refreshCells([firstInfo.rowNode], Array.from(dataChangedScope.columnIds.values()), true);
|
|
3717
3675
|
}
|
|
@@ -3720,15 +3678,14 @@ class Adaptable {
|
|
|
3720
3678
|
firstInfo.trigger == 'tick' ? this.filterOnTickingDataChange() : this.filterOnEditDataChange();
|
|
3721
3679
|
}
|
|
3722
3680
|
getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3723
|
-
const
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(stylesWithExpression)) {
|
|
3681
|
+
const formatColumnsWithExpression = [];
|
|
3682
|
+
formatColumnsWithExpression.push(...this.api.formatColumnApi.getFormatColumnsWithExpression());
|
|
3683
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(formatColumnsWithExpression)) {
|
|
3727
3684
|
return;
|
|
3728
3685
|
}
|
|
3729
3686
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3730
3687
|
if (!dataChangedScope.wholeRow) {
|
|
3731
|
-
|
|
3688
|
+
formatColumnsWithExpression.forEach((styleModule) => {
|
|
3732
3689
|
if (!dataChangedScope.wholeRow) {
|
|
3733
3690
|
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(styleModule.Rule.BooleanExpression);
|
|
3734
3691
|
if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
@@ -3750,20 +3707,15 @@ class Adaptable {
|
|
|
3750
3707
|
}
|
|
3751
3708
|
});
|
|
3752
3709
|
}
|
|
3753
|
-
|
|
3754
|
-
this.api.
|
|
3755
|
-
let columnComparison = this.api.
|
|
3710
|
+
getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3711
|
+
this.api.styledColumnApi.getAllStyledColumn().forEach((sc) => {
|
|
3712
|
+
let columnComparison = this.api.styledColumnApi.getColumnComparisonForStyledColumn(sc);
|
|
3756
3713
|
if (columnComparison) {
|
|
3757
|
-
let affectedColumnIds = this.api.
|
|
3714
|
+
let affectedColumnIds = this.api.styledColumnApi.getColumnIdsFromColumnComparison(columnComparison);
|
|
3758
3715
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(affectedColumnIds)) {
|
|
3759
3716
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3760
3717
|
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
|
-
});
|
|
3718
|
+
dataChangedScope.columnIds.add(sc.ColumnId);
|
|
3767
3719
|
}
|
|
3768
3720
|
});
|
|
3769
3721
|
}
|
|
@@ -4362,13 +4314,10 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4362
4314
|
}
|
|
4363
4315
|
}
|
|
4364
4316
|
setupRowStyling() {
|
|
4365
|
-
// first get the conditional style state
|
|
4366
|
-
const conditionalStyles = this.api.conditionalStyleApi.getRowConditionalStyles();
|
|
4367
|
-
const formatColumnsStyles = this.api.formatColumnApi.getRowFormatColumnsWithStyle();
|
|
4368
4317
|
// Set any Row Styles (i.e. items without a classname)
|
|
4369
4318
|
this.setGridOptionsProperty('getRowStyle', (userGetRowStyle) => {
|
|
4370
4319
|
return (params) => {
|
|
4371
|
-
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));
|
|
4372
4321
|
return result;
|
|
4373
4322
|
};
|
|
4374
4323
|
});
|
|
@@ -4381,8 +4330,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4381
4330
|
typeof userGetRowClass === 'function' ? userGetRowClass(params) : userGetRowClass,
|
|
4382
4331
|
highlightClassName,
|
|
4383
4332
|
alertHighlightClassName,
|
|
4384
|
-
this.getConditionalStyleRowClass(conditionalStyles.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName)), params),
|
|
4385
|
-
this.getFormatColumnRowClass(formatColumnsStyles, params),
|
|
4386
4333
|
]
|
|
4387
4334
|
// we flatten it because 'userGetRowClass' might return a string[]
|
|
4388
4335
|
.flat()
|
|
@@ -4401,38 +4348,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4401
4348
|
const newValue = this.gridOptions.suppressAggFuncInHeader;
|
|
4402
4349
|
return previousValue !== newValue;
|
|
4403
4350
|
}
|
|
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
4351
|
getGridOptionsApi() {
|
|
4437
4352
|
if (!this.gridOptions.api) {
|
|
4438
4353
|
(0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
|
|
@@ -4759,8 +4674,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4759
4674
|
/**
|
|
4760
4675
|
* When reading the state from the grid, we have to make sure 'avg' is not overriden with the 'avg' string.
|
|
4761
4676
|
*/
|
|
4762
|
-
|
|
4763
|
-
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
4677
|
+
mapAggregationColumnsFromGrid(aggFuncFromGrid, currentLayout) {
|
|
4764
4678
|
return Object.entries(aggFuncFromGrid).reduce((acc, [colId, agg]) => {
|
|
4765
4679
|
const adaptableAggFunc = this.getActiveAdaptableAggFuncForCol(colId);
|
|
4766
4680
|
if ((adaptableAggFunc === null || adaptableAggFunc === void 0 ? void 0 : adaptableAggFunc.type) === 'weightedAverage' && agg === AggregationColumns_1.WEIGHTED_AVERAGE_AGG_FN_NAME) {
|
|
@@ -4773,6 +4687,31 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4773
4687
|
return acc;
|
|
4774
4688
|
}, {});
|
|
4775
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
|
+
}
|
|
4776
4715
|
}
|
|
4777
4716
|
exports.Adaptable = Adaptable;
|
|
4778
4717
|
class AdaptableNoCodeWizard {
|