@adaptabletools/adaptable 13.0.0-canary.1 → 13.0.0-canary.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agGrid.d.ts +23 -1
- package/agGrid.js +23 -1
- package/base.css +1 -0
- package/bundle.cjs.js +169 -169
- package/index.css +1 -0
- package/package.json +3 -3
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +8 -3
- package/src/AdaptableOptions/AdaptableOptions.d.ts +0 -2
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +118 -26
- package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +32 -0
- package/src/AdaptableOptions/FinsemblePluginOptions.js +2 -0
- package/src/AdaptableOptions/GeneralOptions.d.ts +5 -0
- package/src/Api/ConditionalStyleApi.d.ts +20 -42
- package/src/Api/ConfigApi.d.ts +1 -2
- package/src/Api/FinsembleApi.d.ts +10 -0
- package/src/Api/FinsembleApi.js +2 -0
- package/src/Api/FormatColumnApi.d.ts +47 -3
- package/src/Api/Implementation/ColumnApiImpl.js +5 -7
- package/src/Api/Implementation/DashboardApiImpl.js +2 -3
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +18 -1
- package/src/Api/Implementation/FormatColumnApiImpl.js +98 -15
- package/src/Api/Implementation/InternalApiImpl.d.ts +1 -0
- package/src/Api/Implementation/InternalApiImpl.js +4 -0
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -0
- package/src/Api/Implementation/PluginsApiImpl.js +6 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -3
- package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -18
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -2
- package/src/Api/Implementation/ToolPanelApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ToolPanelApiImpl.js +8 -0
- package/src/Api/InternalApi.d.ts +1 -0
- package/src/Api/PluginsApi.d.ts +5 -0
- package/src/Api/QueryLanguageApi.d.ts +3 -7
- package/src/Api/ToolPanelApi.d.ts +10 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +37 -37
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +10 -19
- package/src/PredefinedConfig/FormatColumnState.d.ts +19 -6
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -0
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +14 -0
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +43 -1
- package/src/Redux/Store/AdaptableStore.js +2 -0
- package/src/Strategy/ConditionalStyleModule.d.ts +2 -0
- package/src/Strategy/ConditionalStyleModule.js +6 -0
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +12 -0
- package/src/Strategy/FormatColumnModule.d.ts +4 -9
- package/src/Strategy/FormatColumnModule.js +52 -2
- package/src/Strategy/Interface/IModule.d.ts +11 -10
- package/src/Strategy/Utilities/Alert/getAlertBehaviourViewItems.d.ts +2 -2
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.d.ts +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +3 -4
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +6 -11
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +3 -1
- package/src/Utilities/Extensions/TypeExtensions.d.ts +1 -0
- package/src/Utilities/Extensions/TypeExtensions.js +5 -0
- package/src/Utilities/ObjectFactory.js +0 -1
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +14 -4
- package/src/Utilities/Services/{LicenseService.d.ts → LicenseService/index.d.ts} +3 -3
- package/src/Utilities/Services/LicenseService/index.js +1 -0
- package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.d.ts +1 -0
- package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.js +15 -0
- package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/QueryLanguageService.js +88 -39
- package/src/Utilities/license/LicenseDetails.d.ts +1 -1
- package/src/Utilities/license/decode.d.ts +1 -0
- package/src/Utilities/license/decode.js +1 -1
- package/src/View/AdaptablePopover/index.d.ts +2 -2
- package/src/View/AdaptableView.d.ts +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/index.d.ts +1 -1
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +3 -3
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +3 -3
- package/src/View/ColorPicker.d.ts +1 -5
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonEdit.d.ts +1 -1
- package/src/View/Components/EntityRulesEditor/index.d.ts +2 -1
- package/src/View/Components/EntityRulesEditor/index.js +29 -19
- package/src/View/Components/NewScopeComponent.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -0
- package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/TopBar.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupPrompt.d.ts +1 -1
- package/src/View/Components/RangesComponent.d.ts +6 -0
- package/src/View/Components/RangesComponent.js +54 -18
- package/src/View/Components/ScopeComponent.js +2 -2
- package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +4 -0
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +5 -2
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +2 -0
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +18 -0
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +3 -3
- package/src/View/FormatColumn/MoveFormatColumn.d.ts +7 -0
- package/src/View/FormatColumn/MoveFormatColumn.js +27 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +8 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +29 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +21 -3
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -22
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +18 -4
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +15 -2
- package/src/View/FormatColumn/Wizard/constants.d.ts +1 -0
- package/src/View/FormatColumn/Wizard/constants.js +4 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/SettingsSection.d.ts +2 -2
- package/src/View/License/LicenseWatermark.d.ts +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +1 -1
- package/src/View/StateManagement/components/ClearButton.d.ts +1 -1
- package/src/View/StateManagement/components/LoadButton.d.ts +1 -1
- package/src/View/StatusBar/StatusBarPanel.d.ts +4 -4
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +3 -3
- package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
- package/src/View/Wizard/OnePageWizards.d.ts +3 -3
- package/src/View/Wizard/OnePageWizards.js +2 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +1 -0
- package/src/agGrid/ActionColumnRenderer.js +5 -5
- package/src/agGrid/Adaptable.d.ts +16 -2
- package/src/agGrid/Adaptable.js +167 -85
- package/src/agGrid/FilterWrapper.js +5 -5
- package/src/agGrid/FloatingFilterWrapper.js +3 -4
- package/src/agGrid/agGridHelper.js +12 -13
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -0
- package/src/agGrid/createAgStatusPanelComponent.js +3 -3
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.js +3 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +3 -3
- package/src/components/CheckBox/index.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/Dialog/index.d.ts +4 -2
- package/src/components/Dialog/index.js +2 -2
- package/src/components/DropdownButton/index.d.ts +21 -4
- package/src/components/DropdownButton/index.js +5 -6
- package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +1 -1
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +1 -1
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +4 -2
- package/src/components/Loader/Loader.d.ts +2 -2
- package/src/components/Logo/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -1
- package/src/components/PopupWithFooter.d.ts +2 -2
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/src/components/SelectList.d.ts +1 -1
- package/src/components/SimpleButton/index.d.ts +4 -5
- package/src/components/SimpleButton/index.js +3 -2
- package/src/components/StylePreview.d.ts +1 -1
- package/src/components/Tag/Tag.d.ts +1 -1
- package/src/components/Textarea/index.d.ts +6 -4
- package/src/components/ToggleButton/index.d.ts +1 -1
- package/src/components/WindowModal/WindowModal.d.ts +1 -1
- package/src/components/icons/index.d.ts +3 -2
- package/src/components/icons/layout.d.ts +2 -1
- package/src/components/utils/useContainerScrollObserver/index.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +112 -64
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +6 -3
- package/src/renderReactRoot.d.ts +3 -0
- package/src/renderReactRoot.js +54 -0
- package/src/types.d.ts +4 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Utilities/Services/LicenseService.js +0 -1
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -8,7 +8,6 @@ const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
|
8
8
|
const throttle_1 = tslib_1.__importDefault(require("lodash/throttle"));
|
|
9
9
|
const uniqBy_1 = tslib_1.__importDefault(require("lodash/uniqBy"));
|
|
10
10
|
const React = tslib_1.__importStar(require("react"));
|
|
11
|
-
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
12
11
|
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
13
12
|
const AdaptableApiImpl_1 = require("../Api/Implementation/AdaptableApiImpl");
|
|
14
13
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
@@ -64,6 +63,7 @@ const AdaptableStatusBar_1 = require("../View/StatusBar/AdaptableStatusBar");
|
|
|
64
63
|
const RowEditService_1 = require("../Utilities/Services/RowEditService");
|
|
65
64
|
const weightedAverage_1 = require("./weightedAverage");
|
|
66
65
|
const AggregationColumns_1 = require("../PredefinedConfig/Common/AggregationColumns");
|
|
66
|
+
const renderReactRoot_1 = require("../renderReactRoot");
|
|
67
67
|
const tinycolor = require('tinycolor2');
|
|
68
68
|
const GROUP_PATH_SEPARATOR = '/';
|
|
69
69
|
// IMPORTANT - we need colId to be set in order for safeSetColDefs to work correctly
|
|
@@ -142,6 +142,7 @@ class Adaptable {
|
|
|
142
142
|
constructor() {
|
|
143
143
|
this.colDefPropertyCache = new Map();
|
|
144
144
|
this.gridOptionsPropertyCache = new Map();
|
|
145
|
+
this.columnMinMaxValuesCache = {};
|
|
145
146
|
this.isCheckedColumnDataType = false;
|
|
146
147
|
// only for our private / internal events used within Adaptable
|
|
147
148
|
// public events are emitted through the EventApi
|
|
@@ -169,6 +170,8 @@ class Adaptable {
|
|
|
169
170
|
};
|
|
170
171
|
this._adaptableReady = false;
|
|
171
172
|
this.isDestroyed = false;
|
|
173
|
+
this.supressReact18RenderWarning = false;
|
|
174
|
+
this.renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container, this.supressReact18RenderWarning);
|
|
172
175
|
this.isPluginLoaded = (pluginId) => {
|
|
173
176
|
const plugins = this.adaptableOptions.plugins || [];
|
|
174
177
|
for (let i = 0, len = plugins.length; i < len; i++) {
|
|
@@ -274,7 +277,9 @@ class Adaptable {
|
|
|
274
277
|
else {
|
|
275
278
|
core_1.ModuleRegistry.registerModules(runtimeConfig.agGridModules);
|
|
276
279
|
}
|
|
277
|
-
return Adaptable.initInternal(adaptableOptions
|
|
280
|
+
return Adaptable.initInternal(adaptableOptions, {
|
|
281
|
+
supressReact18RenderWarning: true,
|
|
282
|
+
});
|
|
278
283
|
}
|
|
279
284
|
/**
|
|
280
285
|
* Lazy static constructor for Adaptable
|
|
@@ -337,6 +342,12 @@ class Adaptable {
|
|
|
337
342
|
// this is still used internally but should not be used externally as a preference
|
|
338
343
|
async init(adaptableOptions, runtimeConfig, _staticInit) {
|
|
339
344
|
var _a, _b, _c, _d, _e, _f;
|
|
345
|
+
if (runtimeConfig) {
|
|
346
|
+
this.supressReact18RenderWarning = !!runtimeConfig.supressReact18RenderWarning;
|
|
347
|
+
if (runtimeConfig.renderReactRoot) {
|
|
348
|
+
this.renderReactRoot = runtimeConfig.renderReactRoot;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
340
351
|
if (!_staticInit) {
|
|
341
352
|
(0, LoggingHelper_1.ConsoleLogWarning)(`
|
|
342
353
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
@@ -456,26 +467,20 @@ class Adaptable {
|
|
|
456
467
|
AdaptableHelper_1.default.checkValidPrimaryKey(this);
|
|
457
468
|
}, (e) => {
|
|
458
469
|
(0, LoggingHelper_1.ConsoleLogError)('Failed to Init Modules : ', e);
|
|
459
|
-
// for now we
|
|
470
|
+
// for now we initialize the grid even if initialising Modules has failed (perhaps revisit this?)
|
|
460
471
|
this.initInternalGridLogic();
|
|
461
472
|
this.api.internalApi.hideLoadingScreen(); // doesnt really help but at least clears the screen
|
|
462
473
|
}).then(async () => {
|
|
463
474
|
this.api.internalApi.hideLoadingScreen();
|
|
464
475
|
this.isInitialised = true;
|
|
465
476
|
this._adaptableReady = true;
|
|
466
|
-
// setTimeout(() => {
|
|
467
|
-
// this.api.eventApi.emit('AdaptableReady', {
|
|
468
|
-
// adaptableApi: this.api,
|
|
469
|
-
// gridOptions: this.adaptableOptions.gridOptions,
|
|
470
|
-
// });
|
|
471
|
-
// }, 0);
|
|
472
477
|
});
|
|
473
478
|
if (this.abContainerElement == null) {
|
|
474
479
|
this.abContainerElement = this.getAdaptableContainerElement();
|
|
475
480
|
}
|
|
476
481
|
if (this.abContainerElement != null) {
|
|
477
482
|
this.abContainerElement.innerHTML = '';
|
|
478
|
-
|
|
483
|
+
this.unmountReactRoot = this.renderReactRoot((0, AdaptableView_1.AdaptableApp)({ Adaptable: this }), this.abContainerElement);
|
|
479
484
|
}
|
|
480
485
|
// create debounce methods that take a time based on user settings
|
|
481
486
|
this.throttleFilterOnEditDataChange = (0, throttle_1.default)(
|
|
@@ -888,51 +893,68 @@ class Adaptable {
|
|
|
888
893
|
this.gridOptions.api.setColumnDefs(colDefs);
|
|
889
894
|
this.updateColumnsIntoStore(); // todo remove this from here!!!
|
|
890
895
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
896
|
+
getFormatColumnSpecialColumnStyle(formatColumn, abColumn, params) {
|
|
897
|
+
const columnStyle = formatColumn.ColumnStyle;
|
|
898
|
+
let style = {};
|
|
899
|
+
const gradientStyle = columnStyle === null || columnStyle === void 0 ? void 0 : columnStyle.GradientStyle;
|
|
900
|
+
if (gradientStyle) {
|
|
901
|
+
const min = this.api.formatColumnApi.getNumericStyleMinValue(columnStyle, abColumn, params.node, params.value);
|
|
902
|
+
const max = this.api.formatColumnApi.getNumericStyleMaxValue(columnStyle, abColumn, params.node, params.value);
|
|
903
|
+
const clampedValue = (0, clamp_1.default)(params.value, min, max);
|
|
904
|
+
let cellBackColor;
|
|
905
|
+
let reverseGradient = false;
|
|
906
|
+
if (gradientStyle.ColumnComparison) {
|
|
907
|
+
cellBackColor = gradientStyle.ColumnComparison.Color;
|
|
908
|
+
}
|
|
909
|
+
else {
|
|
910
|
+
const matchingRange = gradientStyle.CellRanges.find((r) => (r.Min == 'Col-Min' || r.Min <= clampedValue) &&
|
|
911
|
+
(r.Max == 'Col-Max' || r.Max >= clampedValue));
|
|
912
|
+
if (matchingRange) {
|
|
913
|
+
cellBackColor = matchingRange.Color;
|
|
914
|
+
reverseGradient = matchingRange.ReverseGradient;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
const increase = Math.abs(max - min);
|
|
918
|
+
const percentage = ((params.value - min) / increase) * 100;
|
|
919
|
+
let alpha = Number((percentage / 100).toPrecision(2));
|
|
920
|
+
if (reverseGradient) {
|
|
921
|
+
alpha = 1 - alpha;
|
|
922
|
+
}
|
|
923
|
+
const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
|
|
924
|
+
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
894
925
|
}
|
|
895
|
-
if (
|
|
896
|
-
|
|
926
|
+
if (columnStyle.PercentBarStyle && columnStyle.PercentBarStyle.CellText) {
|
|
927
|
+
style.paddingTop = 0;
|
|
928
|
+
style.paddingBottom = 0;
|
|
897
929
|
}
|
|
930
|
+
return style;
|
|
931
|
+
}
|
|
932
|
+
getFormatColumnColumnStyle(formatColumns) {
|
|
933
|
+
// first has more precedence, then they need to be applied in reverse order
|
|
934
|
+
return formatColumns.reduceRight((style, formatColumn) => {
|
|
935
|
+
const formatColumnStyle = this.convertAdaptableStyleToCSS(formatColumn.Style);
|
|
936
|
+
return Object.assign(Object.assign({}, style), formatColumnStyle);
|
|
937
|
+
}, {});
|
|
938
|
+
}
|
|
939
|
+
getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params) {
|
|
898
940
|
let style = {};
|
|
899
941
|
// percent bar && do we show text
|
|
900
942
|
const columnStyle = formatColumn.ColumnStyle;
|
|
901
943
|
if (columnStyle) {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
const max = this.api.formatColumnApi.getNumericStyleMaxValue(columnStyle, abColumn, params.node, params.value);
|
|
906
|
-
const clampedValue = (0, clamp_1.default)(params.value, min, max);
|
|
907
|
-
let cellBackColor;
|
|
908
|
-
let reverseGradient = false;
|
|
909
|
-
if (gradientStyle.ColumnComparison) {
|
|
910
|
-
cellBackColor = gradientStyle.ColumnComparison.Color;
|
|
911
|
-
}
|
|
912
|
-
else {
|
|
913
|
-
const matchingRange = gradientStyle.CellRanges.find((r) => (r.Min == 'Col-Min' || r.Min <= clampedValue) &&
|
|
914
|
-
(r.Max == 'Col-Max' || r.Max >= clampedValue));
|
|
915
|
-
if (matchingRange) {
|
|
916
|
-
cellBackColor = matchingRange.Color;
|
|
917
|
-
reverseGradient = matchingRange.ReverseGradient;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
const increase = Math.abs(max - min);
|
|
921
|
-
const percentage = ((params.value - min) / increase) * 100;
|
|
922
|
-
let alpha = Number((percentage / 100).toPrecision(2));
|
|
923
|
-
if (reverseGradient) {
|
|
924
|
-
alpha = 1 - alpha;
|
|
925
|
-
}
|
|
926
|
-
const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
|
|
927
|
-
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
928
|
-
}
|
|
929
|
-
if (columnStyle.PercentBarStyle && columnStyle.PercentBarStyle.CellText) {
|
|
930
|
-
style.paddingTop = 0;
|
|
931
|
-
style.paddingBottom = 0;
|
|
944
|
+
if (columnStyle &&
|
|
945
|
+
!this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params)) {
|
|
946
|
+
return style;
|
|
932
947
|
}
|
|
948
|
+
style = Object.assign(Object.assign({}, style), this.getFormatColumnSpecialColumnStyle(formatColumn, abColumn, params));
|
|
933
949
|
}
|
|
934
950
|
else if (formatColumn.Style) {
|
|
935
|
-
|
|
951
|
+
const activeFormatColumnsWithStyle = formatColumnsWithStyle.filter((formatColumn) => {
|
|
952
|
+
return this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params);
|
|
953
|
+
});
|
|
954
|
+
if (!activeFormatColumnsWithStyle.length) {
|
|
955
|
+
return style;
|
|
956
|
+
}
|
|
957
|
+
style = Object.assign(Object.assign({}, style), this.getFormatColumnColumnStyle(activeFormatColumnsWithStyle));
|
|
936
958
|
}
|
|
937
959
|
if (formatColumn.CellAlignment) {
|
|
938
960
|
switch (formatColumn.CellAlignment) {
|
|
@@ -949,6 +971,30 @@ class Adaptable {
|
|
|
949
971
|
}
|
|
950
972
|
return style;
|
|
951
973
|
}
|
|
974
|
+
getFormatColumnCellClass(formatColumns, abColumn, params) {
|
|
975
|
+
const classNames = formatColumns
|
|
976
|
+
.map((formatColumn) => {
|
|
977
|
+
var _a, _b;
|
|
978
|
+
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
979
|
+
this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params)) {
|
|
980
|
+
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
981
|
+
}
|
|
982
|
+
})
|
|
983
|
+
.filter((x) => !!x);
|
|
984
|
+
return classNames;
|
|
985
|
+
}
|
|
986
|
+
getFormatColumnRowClass(formatColumns, params) {
|
|
987
|
+
const classNames = formatColumns
|
|
988
|
+
.map((formatColumn) => {
|
|
989
|
+
var _a, _b;
|
|
990
|
+
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
991
|
+
this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params)) {
|
|
992
|
+
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
993
|
+
}
|
|
994
|
+
})
|
|
995
|
+
.filter((x) => !!x);
|
|
996
|
+
return classNames;
|
|
997
|
+
}
|
|
952
998
|
getActiveAlertWithHighlightCell(col, params) {
|
|
953
999
|
return this.api.internalApi.getAdaptableAlertWithHighlightCell(col.columnId, params.node);
|
|
954
1000
|
}
|
|
@@ -2489,7 +2535,7 @@ class Adaptable {
|
|
|
2489
2535
|
return this.gridOptions.api.getDisplayedRowAtIndex(firstDisplayedRowIndex);
|
|
2490
2536
|
}
|
|
2491
2537
|
destroy(config) {
|
|
2492
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
2538
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
2493
2539
|
if (this.gridOptions && this.gridOptions.api) {
|
|
2494
2540
|
this.gridOptions.api.removeEventListener(core_1.Events.EVENT_FIRST_DATA_RENDERED, this.listenerFirstDataRendered);
|
|
2495
2541
|
this.gridOptions.api.removeEventListener(core_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.listenerPivotModeChanged);
|
|
@@ -2563,37 +2609,37 @@ class Adaptable {
|
|
|
2563
2609
|
return;
|
|
2564
2610
|
}
|
|
2565
2611
|
if (abContainerElement != null) {
|
|
2566
|
-
|
|
2612
|
+
(_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
2567
2613
|
}
|
|
2568
2614
|
this.gridContainerElement = null;
|
|
2569
2615
|
this.abContainerElement = null;
|
|
2570
|
-
(
|
|
2616
|
+
(_b = this.adaptableStore) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
2571
2617
|
this.adaptableStore = null;
|
|
2572
2618
|
this.gridOptions = null;
|
|
2573
2619
|
this.adaptableOptions = null;
|
|
2574
|
-
(
|
|
2620
|
+
(_d = (_c = this.CalculatedColumnExpressionService) === null || _c === void 0 ? void 0 : _c.destroy) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
2575
2621
|
this.CalculatedColumnExpressionService = null;
|
|
2576
|
-
(
|
|
2622
|
+
(_f = (_e = this.DataService) === null || _e === void 0 ? void 0 : _e.destroy) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
2577
2623
|
this.DataService = null;
|
|
2578
|
-
(
|
|
2624
|
+
(_h = (_g = this.EntitlementService) === null || _g === void 0 ? void 0 : _g.destroy) === null || _h === void 0 ? void 0 : _h.call(_g);
|
|
2579
2625
|
this.EntitlementService = null;
|
|
2580
|
-
(
|
|
2626
|
+
(_k = (_j = this.ReportService) === null || _j === void 0 ? void 0 : _j.destroy) === null || _k === void 0 ? void 0 : _k.call(_j);
|
|
2581
2627
|
this.ReportService = null;
|
|
2582
|
-
(
|
|
2628
|
+
(_m = (_l = this.ModuleService) === null || _l === void 0 ? void 0 : _l.destroy) === null || _m === void 0 ? void 0 : _m.call(_l);
|
|
2583
2629
|
this.ModuleService = null;
|
|
2584
|
-
(
|
|
2630
|
+
(_p = (_o = this.ValidationService) === null || _o === void 0 ? void 0 : _o.destroy) === null || _p === void 0 ? void 0 : _p.call(_o);
|
|
2585
2631
|
this.ValidationService = null;
|
|
2586
|
-
(
|
|
2632
|
+
(_r = (_q = this.QueryLanguageService) === null || _q === void 0 ? void 0 : _q.destroy) === null || _r === void 0 ? void 0 : _r.call(_q);
|
|
2587
2633
|
this.QueryLanguageService = null;
|
|
2588
|
-
(
|
|
2634
|
+
(_t = (_s = this.AlertService) === null || _s === void 0 ? void 0 : _s.destroy) === null || _t === void 0 ? void 0 : _t.call(_s);
|
|
2589
2635
|
this.AlertService = null;
|
|
2590
|
-
(
|
|
2636
|
+
(_v = (_u = this.TeamSharingService) === null || _u === void 0 ? void 0 : _u.destroy) === null || _v === void 0 ? void 0 : _v.call(_u);
|
|
2591
2637
|
this.TeamSharingService = null;
|
|
2592
|
-
(
|
|
2638
|
+
(_x = (_w = this.RowEditService) === null || _w === void 0 ? void 0 : _w.destroy) === null || _x === void 0 ? void 0 : _x.call(_w);
|
|
2593
2639
|
this.RowEditService = null;
|
|
2594
|
-
(
|
|
2640
|
+
(_z = (_y = this.MetamodelService) === null || _y === void 0 ? void 0 : _y.destroy) === null || _z === void 0 ? void 0 : _z.call(_y);
|
|
2595
2641
|
this.MetamodelService = null;
|
|
2596
|
-
(
|
|
2642
|
+
(_1 = (_0 = this.LicenseService) === null || _0 === void 0 ? void 0 : _0.destroy) === null || _1 === void 0 ? void 0 : _1.call(_0);
|
|
2597
2643
|
this.LicenseService = null;
|
|
2598
2644
|
this.isDestroyed = true;
|
|
2599
2645
|
}
|
|
@@ -3140,15 +3186,17 @@ class Adaptable {
|
|
|
3140
3186
|
borderColor: null,
|
|
3141
3187
|
};
|
|
3142
3188
|
const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
|
|
3189
|
+
const formatColumnsWithStyle = this.api.formatColumnApi.getColumnFormatColumnsWithStyle(abColumn);
|
|
3143
3190
|
const conditionalStyles = this.api.conditionalStyleApi.getConditionalStylesForColumn(abColumn);
|
|
3144
3191
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
3145
3192
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3146
3193
|
const cellStyle = (params) => {
|
|
3147
3194
|
const formatColumnCellStyle = formatColumn
|
|
3148
|
-
? this.getFormatColumnCellStyle(abColumn, formatColumn, params)
|
|
3195
|
+
? this.getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params)
|
|
3149
3196
|
: undefined;
|
|
3150
3197
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3151
|
-
const
|
|
3198
|
+
const conditionalStyleObj = this.getConditionalStyleCellStyle(conditionalStyles, abColumn, params);
|
|
3199
|
+
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)), formatColumnCellStyle), conditionalStyleObj), (isQuickSearchActive ? quickSearchStyle : undefined)), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
3152
3200
|
return result;
|
|
3153
3201
|
};
|
|
3154
3202
|
return cellStyle;
|
|
@@ -3156,9 +3204,7 @@ class Adaptable {
|
|
|
3156
3204
|
}
|
|
3157
3205
|
setupColumnCellClass({ col, colId, abColumn }) {
|
|
3158
3206
|
this.setColDefProperty(col, 'cellClass', (userCellClass) => {
|
|
3159
|
-
|
|
3160
|
-
const formatColumn = this.api.formatColumnApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
|
|
3161
|
-
const formatColumnStyleClassName = formatColumn && !formatColumn.IsSuspended ? (_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName : null;
|
|
3207
|
+
const formatColumns = this.api.formatColumnApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
|
|
3162
3208
|
const conditionalStyles = this.api.conditionalStyleApi
|
|
3163
3209
|
.getConditionalStylesForColumn(abColumn)
|
|
3164
3210
|
.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName));
|
|
@@ -3175,7 +3221,9 @@ class Adaptable {
|
|
|
3175
3221
|
const returnValue = [
|
|
3176
3222
|
this.getExcelClassNameForCell(colId, primaryKeyValue),
|
|
3177
3223
|
typeof userCellClass === 'function' ? userCellClass(params) : userCellClass,
|
|
3178
|
-
|
|
3224
|
+
formatColumns.length
|
|
3225
|
+
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
3226
|
+
: null,
|
|
3179
3227
|
hasConditionalStylesWithClassNames
|
|
3180
3228
|
? this.getConditionalStyleCellClass(conditionalStyles, abColumn, params)
|
|
3181
3229
|
: null,
|
|
@@ -3353,13 +3401,6 @@ class Adaptable {
|
|
|
3353
3401
|
if (layoutCustomHeader) {
|
|
3354
3402
|
resultHeaderName = layoutCustomHeader;
|
|
3355
3403
|
}
|
|
3356
|
-
// check if the deprecated formatColumn header is used
|
|
3357
|
-
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumnId(abColumn.columnId);
|
|
3358
|
-
if (!layoutCustomHeader && (formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.HeaderName) && !formatColumn.IsSuspended) {
|
|
3359
|
-
// fallback to the formatColumn property if no Layout custom header is provided
|
|
3360
|
-
resultHeaderName = formatColumn.HeaderName;
|
|
3361
|
-
(0, LoggingHelper_1.ConsoleLogWarning)(`DEPRECATED: 'FormatColumn.HeaderName' is deprecated: use 'Layout.ColumnHeadersMap' instead`);
|
|
3362
|
-
}
|
|
3363
3404
|
// required here for the initial layout rendering
|
|
3364
3405
|
abColumn.friendlyName = resultHeaderName;
|
|
3365
3406
|
return resultHeaderName;
|
|
@@ -3397,7 +3438,7 @@ class Adaptable {
|
|
|
3397
3438
|
});
|
|
3398
3439
|
}
|
|
3399
3440
|
setupColumnValueFormatter({ col, abColumn }) {
|
|
3400
|
-
this.setColDefProperty(col, 'valueFormatter', () => {
|
|
3441
|
+
this.setColDefProperty(col, 'valueFormatter', (params) => {
|
|
3401
3442
|
const formatColumn = this.api.formatColumnApi.getFormatColumnWithDisplayFormatForColumn(abColumn);
|
|
3402
3443
|
if (!formatColumn) {
|
|
3403
3444
|
return;
|
|
@@ -3432,7 +3473,12 @@ class Adaptable {
|
|
|
3432
3473
|
};
|
|
3433
3474
|
}
|
|
3434
3475
|
}
|
|
3435
|
-
|
|
3476
|
+
if (valueFormatter) {
|
|
3477
|
+
return (params) => {
|
|
3478
|
+
const rulePasses = this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params);
|
|
3479
|
+
return rulePasses ? valueFormatter(params) : params.value;
|
|
3480
|
+
};
|
|
3481
|
+
}
|
|
3436
3482
|
}
|
|
3437
3483
|
});
|
|
3438
3484
|
}
|
|
@@ -3652,6 +3698,7 @@ class Adaptable {
|
|
|
3652
3698
|
this.api.freeTextColumnApi.checkFreeTextColumnForDataChange(cellDataChangedInfo);
|
|
3653
3699
|
}
|
|
3654
3700
|
this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
|
|
3701
|
+
this.resetMinMaxCachedValueForColumn(cellDataChangedInfo.column);
|
|
3655
3702
|
});
|
|
3656
3703
|
// if node is visible then check if need to refresh other columns / whole row if the updating column is:
|
|
3657
3704
|
// 1. referenced in Conditional Styles that have Expressions (refreshing whole row if Scope is All)
|
|
@@ -3675,23 +3722,25 @@ class Adaptable {
|
|
|
3675
3722
|
firstInfo.trigger == 'tick' ? this.filterOnTickingDataChange() : this.filterOnEditDataChange();
|
|
3676
3723
|
}
|
|
3677
3724
|
getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3678
|
-
const stylesWithExpression =
|
|
3725
|
+
const stylesWithExpression = [];
|
|
3726
|
+
stylesWithExpression.push(...this.api.conditionalStyleApi.getConditionalStylesWithExpression());
|
|
3727
|
+
stylesWithExpression.push(...this.api.formatColumnApi.getFormatColumnsWithExpression());
|
|
3679
3728
|
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(stylesWithExpression)) {
|
|
3680
3729
|
return;
|
|
3681
3730
|
}
|
|
3682
3731
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3683
3732
|
if (!dataChangedScope.wholeRow) {
|
|
3684
|
-
stylesWithExpression.forEach((
|
|
3733
|
+
stylesWithExpression.forEach((styleModule) => {
|
|
3685
3734
|
if (!dataChangedScope.wholeRow) {
|
|
3686
|
-
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(
|
|
3735
|
+
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(styleModule.Rule.BooleanExpression);
|
|
3687
3736
|
if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
3688
|
-
if (this.api.scopeApi.scopeIsAll(
|
|
3737
|
+
if (this.api.scopeApi.scopeIsAll(styleModule.Scope)) {
|
|
3689
3738
|
dataChangedScope.wholeRow = true;
|
|
3690
3739
|
return;
|
|
3691
3740
|
}
|
|
3692
3741
|
else {
|
|
3693
3742
|
this.api.scopeApi
|
|
3694
|
-
.getColumnsForScope(
|
|
3743
|
+
.getColumnsForScope(styleModule.Scope)
|
|
3695
3744
|
.map((c) => c.columnId)
|
|
3696
3745
|
.forEach((colId) => {
|
|
3697
3746
|
dataChangedScope.columnIds.add(colId);
|
|
@@ -4317,10 +4366,11 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4317
4366
|
setupRowStyling() {
|
|
4318
4367
|
// first get the conditional style state
|
|
4319
4368
|
const conditionalStyles = this.api.conditionalStyleApi.getRowConditionalStyles();
|
|
4369
|
+
const formatColumnsStyles = this.api.formatColumnApi.getRowFormatColumnsWithStyle();
|
|
4320
4370
|
// Set any Row Styles (i.e. items without a classname)
|
|
4321
4371
|
this.setGridOptionsProperty('getRowStyle', (userGetRowStyle) => {
|
|
4322
4372
|
return (params) => {
|
|
4323
|
-
const result = Object.assign(Object.assign(Object.assign(Object.assign({}, userGetRowStyle === null || userGetRowStyle === void 0 ? void 0 : userGetRowStyle(params)), this.getRowHighlightStyle(params)), this.getAlertRowStyle(params)), this.getConditionalStyleRowStyle(conditionalStyles, params));
|
|
4373
|
+
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, userGetRowStyle === null || userGetRowStyle === void 0 ? void 0 : userGetRowStyle(params)), this.getRowHighlightStyle(params)), this.getAlertRowStyle(params)), this.getConditionalStyleRowStyle(conditionalStyles, params)), this.getFormatColumnRowStyle(formatColumnsStyles, params));
|
|
4324
4374
|
return result;
|
|
4325
4375
|
};
|
|
4326
4376
|
});
|
|
@@ -4334,6 +4384,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4334
4384
|
highlightClassName,
|
|
4335
4385
|
alertHighlightClassName,
|
|
4336
4386
|
this.getConditionalStyleRowClass(conditionalStyles.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName)), params),
|
|
4387
|
+
this.getFormatColumnRowClass(formatColumnsStyles, params),
|
|
4337
4388
|
]
|
|
4338
4389
|
// we flatten it because 'userGetRowClass' might return a string[]
|
|
4339
4390
|
.flat()
|
|
@@ -4376,6 +4427,14 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4376
4427
|
}
|
|
4377
4428
|
}
|
|
4378
4429
|
}
|
|
4430
|
+
getFormatColumnRowStyle(formatColumns, params) {
|
|
4431
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(formatColumns)) {
|
|
4432
|
+
const formatColumnWithRowStyle = formatColumns.find((formatColumn) => this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params));
|
|
4433
|
+
if (formatColumnWithRowStyle) {
|
|
4434
|
+
return this.convertAdaptableStyleToCSS(formatColumnWithRowStyle.Style);
|
|
4435
|
+
}
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4379
4438
|
getGridOptionsApi() {
|
|
4380
4439
|
if (!this.gridOptions.api) {
|
|
4381
4440
|
(0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
|
|
@@ -4716,6 +4775,29 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4716
4775
|
return acc;
|
|
4717
4776
|
}, {});
|
|
4718
4777
|
}
|
|
4778
|
+
resetMinMaxCachedValueForColumn(column) {
|
|
4779
|
+
if (!column) {
|
|
4780
|
+
this.columnMinMaxValuesCache[column.columnId] = {};
|
|
4781
|
+
}
|
|
4782
|
+
if (this.columnMinMaxValuesCache[column.columnId]) {
|
|
4783
|
+
this.columnMinMaxValuesCache[column.columnId] = undefined;
|
|
4784
|
+
}
|
|
4785
|
+
}
|
|
4786
|
+
getMinMaxCachedValueForColumn(column, minMax) {
|
|
4787
|
+
var _a;
|
|
4788
|
+
const { columnId, dataType } = column;
|
|
4789
|
+
if (dataType !== 'Number') {
|
|
4790
|
+
return undefined;
|
|
4791
|
+
}
|
|
4792
|
+
let value = (_a = this.columnMinMaxValuesCache[columnId]) === null || _a === void 0 ? void 0 : _a[minMax];
|
|
4793
|
+
if (value !== undefined) {
|
|
4794
|
+
return value;
|
|
4795
|
+
}
|
|
4796
|
+
const distinctRawValues = this.api.columnApi.getDistinctRawValuesForColumn(columnId);
|
|
4797
|
+
value = minMax === 'min' ? Math.min(...distinctRawValues) : Math.max(...distinctRawValues);
|
|
4798
|
+
this.columnMinMaxValuesCache[columnId] = Object.assign(Object.assign({}, this.columnMinMaxValuesCache[columnId]), { [minMax]: value });
|
|
4799
|
+
return value;
|
|
4800
|
+
}
|
|
4719
4801
|
}
|
|
4720
4802
|
exports.Adaptable = Adaptable;
|
|
4721
4803
|
class AdaptableNoCodeWizard {
|
|
@@ -4754,15 +4836,15 @@ class AdaptableNoCodeWizard {
|
|
|
4754
4836
|
// this allows people to customize the wizard dimensions & styling
|
|
4755
4837
|
// when it's visible
|
|
4756
4838
|
container.classList.add('adaptable--in-wizard');
|
|
4757
|
-
|
|
4839
|
+
const unmount = (0, renderReactRoot_1.renderReactRoot)(React.createElement(AdaptableWizardView_1.default, Object.assign(Object.assign({ adaptableOptions: this.adaptableOptions }, this.extraOptions), { onInit: (adaptableOptions) => {
|
|
4758
4840
|
container.classList.remove('adaptable--in-wizard');
|
|
4759
|
-
|
|
4841
|
+
unmount();
|
|
4760
4842
|
this.init({
|
|
4761
4843
|
adaptableOptions,
|
|
4762
4844
|
gridOptions: adaptableOptions.gridOptions,
|
|
4763
4845
|
agGridModules: [...this.agGridModules],
|
|
4764
4846
|
});
|
|
4765
|
-
} })), container);
|
|
4847
|
+
} })), container, true);
|
|
4766
4848
|
}
|
|
4767
4849
|
}
|
|
4768
4850
|
exports.AdaptableNoCodeWizard = AdaptableNoCodeWizard;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FilterWrapperFactory = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
6
4
|
const FilterForm_1 = require("../View/Components/FilterForm/FilterForm");
|
|
7
5
|
let FilterWrapperFactory = (adaptable) => {
|
|
8
6
|
return class FilterWrapper {
|
|
@@ -33,8 +31,9 @@ let FilterWrapperFactory = (adaptable) => {
|
|
|
33
31
|
return this.filterContainer;
|
|
34
32
|
}
|
|
35
33
|
afterGuiAttached(params) {
|
|
34
|
+
var _a;
|
|
36
35
|
//we always unmount first so the autofocus from the form works... in other grids we unmount when hidden
|
|
37
|
-
|
|
36
|
+
(_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
38
37
|
let column = adaptable.api.columnApi.getColumnFromId(this.column.getColId());
|
|
39
38
|
if (column) {
|
|
40
39
|
let filterContext = {
|
|
@@ -43,11 +42,12 @@ let FilterWrapperFactory = (adaptable) => {
|
|
|
43
42
|
ShowCloseButton: params != null && params.hidePopup != null,
|
|
44
43
|
};
|
|
45
44
|
adaptable.hideFilterFormPopup = params ? params.hidePopup : null;
|
|
46
|
-
|
|
45
|
+
this.unmountReactRoot = adaptable.renderReactRoot((0, FilterForm_1.FilterFormReact)(filterContext), this.filterContainer);
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
destroy() {
|
|
50
|
-
|
|
49
|
+
var _a;
|
|
50
|
+
(_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
51
51
|
this.filterContainer = null;
|
|
52
52
|
}
|
|
53
53
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FloatingFilterWrapperFactory = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
6
4
|
const QuickFilterForm_1 = require("../View/Components/FilterForm/QuickFilterForm");
|
|
7
5
|
const FloatingFilterWrapperFactory = (adaptable) => class FloatingFilterWrapper {
|
|
8
6
|
onParentModelChanged(parentModel, filterChangedEvent) {
|
|
@@ -30,14 +28,15 @@ const FloatingFilterWrapperFactory = (adaptable) => class FloatingFilterWrapper
|
|
|
30
28
|
Adaptable: adaptable,
|
|
31
29
|
ShowCloseButton: false,
|
|
32
30
|
};
|
|
33
|
-
|
|
31
|
+
this.unmountReactRoot = adaptable.renderReactRoot((0, QuickFilterForm_1.QuickFilterFormReact)(filterContext), this.filterContainer);
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
34
|
getGui() {
|
|
37
35
|
return this.filterContainer;
|
|
38
36
|
}
|
|
39
37
|
destroy() {
|
|
40
|
-
|
|
38
|
+
var _a;
|
|
39
|
+
(_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
41
40
|
this.filterContainer = null;
|
|
42
41
|
}
|
|
43
42
|
};
|
|
@@ -174,7 +174,7 @@ class agGridHelper {
|
|
|
174
174
|
const customFriendlyName = typeof columnFriendlyName === 'function'
|
|
175
175
|
? columnFriendlyName({ colId: colId, agColumn: agGridColumn })
|
|
176
176
|
: null;
|
|
177
|
-
const
|
|
177
|
+
const friendlyName = customFriendlyName !== null && customFriendlyName !== void 0 ? customFriendlyName : (isActionRowButtonColumn
|
|
178
178
|
? GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME
|
|
179
179
|
: this.gridOptions.columnApi.getDisplayNameForColumn(agGridColumn, 'header'));
|
|
180
180
|
if (!this.initialAgGridColDefs[colId]) {
|
|
@@ -183,13 +183,14 @@ class agGridHelper {
|
|
|
183
183
|
const ColumnId = colId;
|
|
184
184
|
const pkColumn = this.adaptable.adaptableOptions.primaryKey;
|
|
185
185
|
let ColumnGroup = colsToGroups === null || colsToGroups === void 0 ? void 0 : colsToGroups[ColumnId];
|
|
186
|
+
const dataType = this.getColumnDataType(agGridColumn, false);
|
|
186
187
|
const abColumn = {
|
|
187
188
|
Uuid: (0, Uuid_1.createUuid)(),
|
|
188
189
|
columnId: ColumnId,
|
|
189
190
|
field: colDef.field,
|
|
190
|
-
friendlyName:
|
|
191
|
+
friendlyName: friendlyName,
|
|
191
192
|
isPrimaryKey: ColumnId === pkColumn,
|
|
192
|
-
dataType:
|
|
193
|
+
dataType: dataType,
|
|
193
194
|
visible: agGridColumn.isVisible(),
|
|
194
195
|
readOnly: this.isColumnReadonly(colDef),
|
|
195
196
|
columnGroup: ColumnGroup,
|
|
@@ -202,7 +203,7 @@ class agGridHelper {
|
|
|
202
203
|
aggregationFunction: null,
|
|
203
204
|
moveable: this.isColumnMoveable(colDef),
|
|
204
205
|
hideable: this.isColumnHideable(colDef),
|
|
205
|
-
queryable: this.isColumnQueryable(colDef, ColumnId),
|
|
206
|
+
queryable: this.isColumnQueryable(colDef, ColumnId, friendlyName, dataType),
|
|
206
207
|
isGrouped: this.isColumnGrouped(colDef),
|
|
207
208
|
isFixed: this.isColumnFixed(colDef),
|
|
208
209
|
pinned: this.getColumnPinnedPosition(colDef),
|
|
@@ -316,21 +317,19 @@ class agGridHelper {
|
|
|
316
317
|
}
|
|
317
318
|
return true;
|
|
318
319
|
}
|
|
319
|
-
isColumnQueryable(colDef, columnId) {
|
|
320
|
+
isColumnQueryable(colDef, columnId, friendlyName, datatype) {
|
|
320
321
|
if (!colDef) {
|
|
321
322
|
return false;
|
|
322
323
|
}
|
|
323
324
|
if (colDef.colId === GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS) {
|
|
324
325
|
return false;
|
|
325
326
|
}
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
return queryableColumns.find((qc) => qc == columnId) != null;
|
|
327
|
+
const abColumnBase = {
|
|
328
|
+
columnId: columnId,
|
|
329
|
+
friendlyName: friendlyName,
|
|
330
|
+
dataType: datatype,
|
|
331
|
+
};
|
|
332
|
+
return this.adaptable.api.queryLanguageApi.isColumnQueryable(abColumnBase);
|
|
334
333
|
}
|
|
335
334
|
isColumnHideable(colDef) {
|
|
336
335
|
if (!colDef) {
|
|
@@ -13,6 +13,7 @@ export declare const createAgStatusPanelComponent: (component: React.FunctionCom
|
|
|
13
13
|
new (): {
|
|
14
14
|
params: IStatusPanelParams;
|
|
15
15
|
eGui: HTMLElement;
|
|
16
|
+
unmountReactRoot?: VoidFunction;
|
|
16
17
|
init(params: IStatusPanelParams): void;
|
|
17
18
|
render(): void;
|
|
18
19
|
getGui(): HTMLElement;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createAgStatusPanelComponent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
7
6
|
const renderWithAdaptableContext_1 = require("../View/renderWithAdaptableContext");
|
|
8
7
|
const createAgStatusPanelComponent = (component, adaptable, context) => {
|
|
9
8
|
return class StatusBarRenderer {
|
|
@@ -20,13 +19,14 @@ const createAgStatusPanelComponent = (component, adaptable, context) => {
|
|
|
20
19
|
context,
|
|
21
20
|
};
|
|
22
21
|
const children = (0, renderWithAdaptableContext_1.renderWithAdaptableContext)(React.createElement(component, props), adaptable);
|
|
23
|
-
|
|
22
|
+
this.unmountReactRoot = adaptable.renderReactRoot(children, this.eGui);
|
|
24
23
|
}
|
|
25
24
|
getGui() {
|
|
26
25
|
return this.eGui;
|
|
27
26
|
}
|
|
28
27
|
destroy() {
|
|
29
|
-
|
|
28
|
+
var _a;
|
|
29
|
+
(_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
};
|