@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
|
@@ -7,7 +7,6 @@ const ApiBase_1 = require("./ApiBase");
|
|
|
7
7
|
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
8
8
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
9
9
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
10
|
-
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
11
10
|
const FormatHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/FormatHelper"));
|
|
12
11
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
|
|
13
12
|
class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
@@ -28,41 +27,16 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
28
27
|
return this.getAllFormatColumn().filter((formatColumn) => formatColumn.IsSuspended);
|
|
29
28
|
}
|
|
30
29
|
getAllFormatColumnWithStyle() {
|
|
31
|
-
return this.getAllFormatColumn().filter((fc) => fc.Style
|
|
30
|
+
return this.getAllFormatColumn().filter((fc) => fc.Style);
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (formatColumn.ColumnStyle) {
|
|
36
|
-
if ((_a = formatColumn.ColumnStyle.GradientStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison) {
|
|
37
|
-
return formatColumn.ColumnStyle.GradientStyle.ColumnComparison;
|
|
38
|
-
}
|
|
39
|
-
if ((_b = formatColumn.ColumnStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.ColumnComparison) {
|
|
40
|
-
return formatColumn.ColumnStyle.PercentBarStyle.ColumnComparison;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
getColumnIdsFromColumnComparison(columnComparison) {
|
|
46
|
-
let returnValues = [];
|
|
47
|
-
if (typeof columnComparison.MinValue === 'string') {
|
|
48
|
-
let minIds = this.adaptable.api.columnApi.getColumnIdsFromId(columnComparison.MinValue, false);
|
|
49
|
-
if (ArrayExtensions_1.default.IsNotNullOrEmpty(minIds)) {
|
|
50
|
-
returnValues.push(...minIds);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (typeof columnComparison.MaxValue === 'string') {
|
|
54
|
-
let maxIds = this.adaptable.api.columnApi.getColumnIdsFromId(columnComparison.MaxValue, false);
|
|
55
|
-
if (ArrayExtensions_1.default.IsNotNullOrEmpty(maxIds)) {
|
|
56
|
-
returnValues.push(...maxIds);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return returnValues;
|
|
32
|
+
getAllFormatColumnWithStyleAndCellAlignment() {
|
|
33
|
+
return this.getAllFormatColumn().filter((fc) => fc.Style || fc.CellAlignment);
|
|
60
34
|
}
|
|
61
35
|
getAllFormatColumnWithDisplayFormat() {
|
|
62
|
-
return this.getAllFormatColumn().filter((fc) => fc.DisplayFormat
|
|
36
|
+
return this.getAllFormatColumn().filter((fc) => fc.DisplayFormat);
|
|
63
37
|
}
|
|
64
38
|
getAllFormatColumnWithCellAlignment() {
|
|
65
|
-
return this.getAllFormatColumn().filter((fc) => fc.CellAlignment
|
|
39
|
+
return this.getAllFormatColumn().filter((fc) => fc.CellAlignment);
|
|
66
40
|
}
|
|
67
41
|
addFormatColumn(formatColumn) {
|
|
68
42
|
this.addUidToAdaptableObject(formatColumn);
|
|
@@ -106,43 +80,27 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
106
80
|
applyFormatColumnDisplayFormats() {
|
|
107
81
|
throw 'This API method is deprecated - it is not needed anymore.';
|
|
108
82
|
}
|
|
109
|
-
|
|
110
|
-
const formatColumns = this.
|
|
111
|
-
return this.
|
|
112
|
-
}
|
|
113
|
-
getColumnFormatColumnsWithStyle(column) {
|
|
114
|
-
const formatColumns = this.getAllFormatColumnWithStyle();
|
|
115
|
-
return this.getFormatColumnInColumnScope(formatColumns, column).filter((scopedFormatColumn) => {
|
|
116
|
-
return (!this.adaptable.api.scopeApi.scopeIsAll(scopedFormatColumn.Scope) &&
|
|
117
|
-
this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
getRowFormatColumnsWithStyle() {
|
|
121
|
-
return this.getAllFormatColumnWithStyle().filter((formatColumn) => {
|
|
122
|
-
return this.adaptable.api.scopeApi.scopeIsAll(formatColumn.Scope);
|
|
123
|
-
});
|
|
83
|
+
getFormatColumnsForColumn(column, config) {
|
|
84
|
+
const formatColumns = this.getAllFormatColumn().filter((formatColumn) => (config === null || config === void 0 ? void 0 : config.includeSuspended) || !formatColumn.IsSuspended);
|
|
85
|
+
return this.getFormatColumnWithColumnInScope(formatColumns, column);
|
|
124
86
|
}
|
|
125
|
-
|
|
126
|
-
const formatColumns = this.
|
|
127
|
-
return this.
|
|
87
|
+
getFormatColumnsWithStyleForColumn(column, config) {
|
|
88
|
+
const formatColumns = this.getAllFormatColumnWithStyleAndCellAlignment().filter((formatColumn) => (config === null || config === void 0 ? void 0 : config.includeSuspended) || !formatColumn.IsSuspended);
|
|
89
|
+
return this.getFormatColumnWithColumnInScope(formatColumns, column);
|
|
128
90
|
}
|
|
129
|
-
|
|
91
|
+
getFormatColumnsForColumnId(columnId, config) {
|
|
130
92
|
const abColumn = this.adaptable.api.columnApi.getColumnFromId(columnId);
|
|
131
93
|
if (!abColumn) {
|
|
132
94
|
return undefined;
|
|
133
95
|
}
|
|
134
|
-
return this.
|
|
135
|
-
}
|
|
136
|
-
getFormatColumnWithStyleForColumn(column) {
|
|
137
|
-
const formatColumns = this.getAllFormatColumnWithStyle();
|
|
138
|
-
return this.getAppropriateFormatColumn(formatColumns, column);
|
|
96
|
+
return this.getFormatColumnsForColumn(abColumn, config);
|
|
139
97
|
}
|
|
140
|
-
getFormatColumnWithStyleClassNameForColumn(column) {
|
|
141
|
-
return this.
|
|
98
|
+
getFormatColumnWithStyleClassNameForColumn(column, config) {
|
|
99
|
+
return this.getFormatColumnsWithStyleForColumn(column, config).filter((formatColumn) => { var _a; return StringExtensions_1.default.IsNotNullOrEmpty((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName); });
|
|
142
100
|
}
|
|
143
|
-
|
|
144
|
-
const formatColumns = this.getAllFormatColumnWithDisplayFormat().
|
|
145
|
-
return this.
|
|
101
|
+
getFormatColumnsWithDisplayFormatForColumn(column, config) {
|
|
102
|
+
const formatColumns = this.getAllFormatColumnWithDisplayFormat().filter((formatColumn) => (config === null || config === void 0 ? void 0 : config.includeSuspended) || !formatColumn.IsSuspended);
|
|
103
|
+
return this.getFormatColumnWithColumnInScope(formatColumns, column);
|
|
146
104
|
}
|
|
147
105
|
getFormatColumnWithSingleColumnScope(columnId) {
|
|
148
106
|
const abColumn = this.adaptable.api.columnApi.getColumnFromId(columnId);
|
|
@@ -161,14 +119,21 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
161
119
|
});
|
|
162
120
|
return returnFormatColumn;
|
|
163
121
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
122
|
+
// TODO is this really needed, I don't think it achieves anything
|
|
123
|
+
getFormatColumnInColumnScope(formatColumns) {
|
|
124
|
+
// we need to maintain the format columns order, therefore we will extract all 3 scope types in a single iteration
|
|
125
|
+
return formatColumns.filter((fc) => {
|
|
126
|
+
return (
|
|
127
|
+
// this.getFormatColumnsWithColumnScope(formatColumns)
|
|
128
|
+
this.adaptable.api.scopeApi.scopeHasColumns(fc.Scope) ||
|
|
129
|
+
// this.getFormatColumnsWithDataTypeScope(formatColumns)
|
|
130
|
+
this.adaptable.api.scopeApi.scopeHasDataType(fc.Scope) ||
|
|
131
|
+
// this.getFormatColumnsWithAllScope(formatColumns)
|
|
132
|
+
this.adaptable.api.scopeApi.scopeIsAll(fc.Scope));
|
|
133
|
+
});
|
|
168
134
|
}
|
|
169
|
-
|
|
170
|
-
return this.getFormatColumnInColumnScope(formatColumns
|
|
171
|
-
this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
|
|
135
|
+
getFormatColumnWithColumnInScope(formatColumns, column) {
|
|
136
|
+
return this.getFormatColumnInColumnScope(formatColumns).filter((scopedFormatColumn) => this.adaptable.api.scopeApi.isColumnInScope(column, scopedFormatColumn.Scope));
|
|
172
137
|
}
|
|
173
138
|
hasStyleFormatColumns() {
|
|
174
139
|
return ArrayExtensions_1.default.IsNotNullOrEmpty(this.getAllFormatColumnWithStyle());
|
|
@@ -185,129 +150,6 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
185
150
|
getFormatColumnsWithColumnScope(formatColumns) {
|
|
186
151
|
return formatColumns.filter((fc) => this.adaptable.api.scopeApi.scopeHasColumns(fc.Scope));
|
|
187
152
|
}
|
|
188
|
-
getNumericStyleMinValue(numericStyle, column, rowNode, cellValue) {
|
|
189
|
-
var _a, _b;
|
|
190
|
-
const columnComparison = numericStyle.GradientStyle
|
|
191
|
-
? numericStyle.GradientStyle.ColumnComparison
|
|
192
|
-
: (_a = numericStyle.PercentBarStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison;
|
|
193
|
-
if (columnComparison) {
|
|
194
|
-
if (!isNaN(Number(columnComparison.MinValue))) {
|
|
195
|
-
return Number(columnComparison.MinValue);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
let columnId = columnComparison.MinValue;
|
|
199
|
-
if (!this.adaptable.api.columnApi.doesColumnExist(columnId)) {
|
|
200
|
-
return 0;
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
return this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
// for Gradient Column we want just the range that contains cell value
|
|
208
|
-
if (numericStyle.GradientStyle) {
|
|
209
|
-
let range;
|
|
210
|
-
numericStyle.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
211
|
-
if (!range) {
|
|
212
|
-
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
213
|
-
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
214
|
-
range = cellRange;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
return this.getCellColorRangeMinValue(range, column);
|
|
219
|
-
}
|
|
220
|
-
// for percentbar we want to get the whole Ranges
|
|
221
|
-
if (numericStyle.PercentBarStyle) {
|
|
222
|
-
const ranges = (_b = numericStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
223
|
-
if (ranges) {
|
|
224
|
-
return this.getCellColorRangeMinValue(ranges[0], column);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
getNumericStyleMaxValue(numericStyle, column, rowNode, cellValue) {
|
|
229
|
-
var _a, _b;
|
|
230
|
-
const columnComparison = numericStyle.GradientStyle
|
|
231
|
-
? numericStyle.GradientStyle.ColumnComparison
|
|
232
|
-
: (_a = numericStyle.PercentBarStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison;
|
|
233
|
-
if (columnComparison) {
|
|
234
|
-
if (!isNaN(Number(columnComparison.MaxValue))) {
|
|
235
|
-
return Number(columnComparison.MaxValue);
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
let columnId = columnComparison.MaxValue;
|
|
239
|
-
if (!this.adaptable.api.columnApi.doesColumnExist(columnId)) {
|
|
240
|
-
return 0;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
return this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
if (numericStyle.GradientStyle) {
|
|
248
|
-
let range;
|
|
249
|
-
numericStyle.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
250
|
-
if (!range) {
|
|
251
|
-
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
252
|
-
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
253
|
-
range = cellRange;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
return this.getCellColorRangeMaxValue(range, column);
|
|
258
|
-
}
|
|
259
|
-
if (numericStyle.PercentBarStyle) {
|
|
260
|
-
const ranges = (_b = numericStyle.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
261
|
-
if (ranges) {
|
|
262
|
-
return this.getCellColorRangeMaxValue(ranges[ranges.length - 1], column);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
getCellColorRangeMinValue(range, column) {
|
|
267
|
-
if (!range) {
|
|
268
|
-
return undefined;
|
|
269
|
-
}
|
|
270
|
-
if (range.Min == undefined) {
|
|
271
|
-
return undefined;
|
|
272
|
-
}
|
|
273
|
-
return range.Min == 'Col-Min'
|
|
274
|
-
? this.getAdaptableApi().columnApi.getMinValueForNumericColumn(column)
|
|
275
|
-
: range.Min;
|
|
276
|
-
}
|
|
277
|
-
getCellColorRangeMaxValue(range, column) {
|
|
278
|
-
if (!range) {
|
|
279
|
-
return undefined;
|
|
280
|
-
}
|
|
281
|
-
if (range.Max == undefined) {
|
|
282
|
-
return undefined;
|
|
283
|
-
}
|
|
284
|
-
return range.Max == 'Col-Max'
|
|
285
|
-
? this.getAdaptableApi().columnApi.getMaxValueForNumericColumn(column)
|
|
286
|
-
: range.Max;
|
|
287
|
-
}
|
|
288
|
-
getCheckBoxStyleFormatColumn(column) {
|
|
289
|
-
var _a;
|
|
290
|
-
if (column.dataType != 'Boolean') {
|
|
291
|
-
return undefined;
|
|
292
|
-
}
|
|
293
|
-
const checkBoxFormatColumns = (_a = this.getFormatColumnState().FormatColumns) === null || _a === void 0 ? void 0 : _a.filter((fc) => { var _a; return (_a = fc.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle; });
|
|
294
|
-
const formatColumn = checkBoxFormatColumns.find((fc) => this.adaptable.api.scopeApi.isColumnInScope(column, fc.Scope));
|
|
295
|
-
return formatColumn;
|
|
296
|
-
}
|
|
297
|
-
isCheckBoxStyleFormatColumn(column) {
|
|
298
|
-
const formatColumn = this.getCheckBoxStyleFormatColumn(column);
|
|
299
|
-
return Helper_1.default.objectExists(formatColumn);
|
|
300
|
-
}
|
|
301
|
-
fireCheckboxColumnClickedEvent(columnId, rowData, primaryKeyValue, isChecked) {
|
|
302
|
-
let checkboxColumnClickedInfo = {
|
|
303
|
-
adaptableApi: this.adaptable.api,
|
|
304
|
-
column: this.adaptable.api.columnApi.getColumnFromId(columnId),
|
|
305
|
-
rowData: rowData,
|
|
306
|
-
primaryKeyValue: primaryKeyValue,
|
|
307
|
-
isChecked: isChecked,
|
|
308
|
-
};
|
|
309
|
-
this.adaptable.api.eventApi.emit('CheckboxColumnClicked', checkboxColumnClickedInfo);
|
|
310
|
-
}
|
|
311
153
|
applyCustomFormatters(value, node, abColumn, options) {
|
|
312
154
|
var _a, _b, _c;
|
|
313
155
|
const columnCustomFormatters = (_a = options === null || options === void 0 ? void 0 : options.CustomDisplayFormats) !== null && _a !== void 0 ? _a : [];
|
|
@@ -366,50 +208,35 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
366
208
|
getFormatColumnDefsForScope(scope) {
|
|
367
209
|
return this.getFormatColumnPredicateDefs().filter((predicateDef) => this.adaptable.api.scopeApi.isScopeInScope(scope, predicateDef.columnScope));
|
|
368
210
|
}
|
|
369
|
-
|
|
370
|
-
|
|
211
|
+
getFormatColumnsRelevantForColumn(formatColumns, column, params) {
|
|
212
|
+
return formatColumns.filter((formatColumn) => this.isFormatColumnRelevantForColumn(formatColumn, column, params));
|
|
213
|
+
}
|
|
214
|
+
isFormatColumnRelevantForColumn(formatColumn, column, params) {
|
|
215
|
+
// suspended is important to be first
|
|
371
216
|
if (formatColumn.IsSuspended) {
|
|
372
217
|
return false;
|
|
373
218
|
}
|
|
374
219
|
if (!formatColumn.Rule) {
|
|
375
220
|
return true;
|
|
376
221
|
}
|
|
377
|
-
if (
|
|
378
|
-
|
|
379
|
-
this.evaluateExpression(formatColumn, params.node)) {
|
|
380
|
-
return true;
|
|
381
|
-
}
|
|
382
|
-
// nothing has passed then return false
|
|
383
|
-
return false;
|
|
384
|
-
}
|
|
385
|
-
isFormatColumnActiveForColumn(formatColumn, column, params) {
|
|
386
|
-
// suspedned is important to be first
|
|
387
|
-
if (formatColumn.IsSuspended) {
|
|
222
|
+
if (!formatColumn.IncludeGroupedRows &&
|
|
223
|
+
this.adaptable.api.gridApi.isGroupRowNode(params.node)) {
|
|
388
224
|
return false;
|
|
389
225
|
}
|
|
390
|
-
|
|
391
|
-
|
|
226
|
+
// first run the predicate
|
|
227
|
+
if (formatColumn.Rule.Predicate && formatColumn.Rule.Predicate.PredicateId) {
|
|
228
|
+
return this.evaluatePredicate({
|
|
229
|
+
formatColumn,
|
|
230
|
+
column,
|
|
231
|
+
value: params.value,
|
|
232
|
+
node: params.node,
|
|
233
|
+
});
|
|
392
234
|
}
|
|
393
|
-
if (
|
|
394
|
-
|
|
395
|
-
if (formatColumn.Rule.Predicate && formatColumn.Rule.Predicate.PredicateId) {
|
|
396
|
-
if (this.evaluatePredicate({
|
|
397
|
-
formatColumn,
|
|
398
|
-
column,
|
|
399
|
-
value: params.value,
|
|
400
|
-
node: params.node,
|
|
401
|
-
})) {
|
|
402
|
-
return true;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
else if (formatColumn.Rule.BooleanExpression) {
|
|
406
|
-
if (this.evaluateExpression(formatColumn, params.node)) {
|
|
407
|
-
return true;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
// nothing has passed then return false
|
|
411
|
-
return false;
|
|
235
|
+
else if (formatColumn.Rule.BooleanExpression) {
|
|
236
|
+
return this.evaluateExpression(formatColumn, params.node);
|
|
412
237
|
}
|
|
238
|
+
// nothing has passed then return false
|
|
239
|
+
return false;
|
|
413
240
|
}
|
|
414
241
|
evaluatePredicate({ formatColumn, column, value, node, }) {
|
|
415
242
|
const params = {
|
|
@@ -438,5 +265,11 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
438
265
|
getFormatColumnsWithExpression() {
|
|
439
266
|
return this.getAllFormatColumn().filter((fc) => { var _a; return !!((_a = fc.Rule) === null || _a === void 0 ? void 0 : _a.BooleanExpression); });
|
|
440
267
|
}
|
|
268
|
+
incrementFormatColumnPrecedence(formatColumn) {
|
|
269
|
+
this.dispatchAction(FormatColumnRedux.FormatColumnMoveUp(formatColumn));
|
|
270
|
+
}
|
|
271
|
+
decrementFormatColumnPrecedence(formatColumn) {
|
|
272
|
+
this.dispatchAction(FormatColumnRedux.FormatColumnMoveDown(formatColumn));
|
|
273
|
+
}
|
|
441
274
|
}
|
|
442
275
|
exports.FormatColumnApiImpl = FormatColumnApiImpl;
|
|
@@ -142,5 +142,5 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
|
|
|
142
142
|
getValueForTag(adaptableObjectTag: AdaptableObjectTag): string | number;
|
|
143
143
|
getEditLookUpValuesForColumn(editLookUpItem: EditLookUpPermittedValues, column: AdaptableColumn, gridCell?: GridCell): any[] | undefined;
|
|
144
144
|
getAdaptableQueryExpressionText(query: Partial<AdaptableQuery>): string;
|
|
145
|
-
|
|
145
|
+
deleteConditionalStyles(conditionalStyles: any[]): void;
|
|
146
146
|
}
|
|
@@ -650,9 +650,10 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
650
650
|
? this.adaptable.api.queryLanguageApi.getAdaptableQueryExpressionWithColumnFriendlyNames(query)
|
|
651
651
|
: this.adaptable.api.queryLanguageApi.getAdaptableQueryExpression(query);
|
|
652
652
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
653
|
+
deleteConditionalStyles(conditionalStyles) {
|
|
654
|
+
conditionalStyles.forEach((cs) => {
|
|
655
|
+
this.dispatchAction(DeadRedux.ConditionalStyleDelete(cs));
|
|
656
|
+
});
|
|
656
657
|
}
|
|
657
658
|
}
|
|
658
659
|
exports.InternalApiImpl = InternalApiImpl;
|
|
@@ -2,6 +2,7 @@ import { ApiBase } from './ApiBase';
|
|
|
2
2
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
3
3
|
import { QueryLanguageApi } from '../QueryLanguageApi';
|
|
4
4
|
import { AdaptableQuery } from '../../PredefinedConfig/Common/AdaptableQuery';
|
|
5
|
+
import { AdaptableColumnBase } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
5
6
|
export declare class QueryLanguageApiImpl extends ApiBase implements QueryLanguageApi {
|
|
6
7
|
isValidBooleanExpression(query: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
|
|
7
8
|
isValidObservableExpression(expression: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
|
|
@@ -9,7 +10,7 @@ export declare class QueryLanguageApiImpl extends ApiBase implements QueryLangua
|
|
|
9
10
|
isValidAggregatedScalarExpression(expression: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
|
|
10
11
|
getASTForExpression(query: string): any;
|
|
11
12
|
getColumnsFromExpression(expression: string): string[];
|
|
12
|
-
|
|
13
|
+
isColumnQueryable(adaptableColumnBase: AdaptableColumnBase): boolean;
|
|
13
14
|
getAdaptableQueryExpression(query: Partial<AdaptableQuery>): string | undefined;
|
|
14
15
|
getAdaptableQueryExpressionWithColumnFriendlyNames(query: Partial<AdaptableQuery>): string | undefined;
|
|
15
16
|
}
|
|
@@ -4,7 +4,6 @@ exports.QueryLanguageApiImpl = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ApiBase_1 = require("./ApiBase");
|
|
6
6
|
const parser = tslib_1.__importStar(require("../../parser/src"));
|
|
7
|
-
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
8
7
|
const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
|
|
9
8
|
class QueryLanguageApiImpl extends ApiBase_1.ApiBase {
|
|
10
9
|
isValidBooleanExpression(query, module, validationErrorMessage) {
|
|
@@ -67,21 +66,16 @@ class QueryLanguageApiImpl extends ApiBase_1.ApiBase {
|
|
|
67
66
|
return [];
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
let arr = queryableColumns;
|
|
81
|
-
if (arr && ArrayExtensions_1.default.IsNotNullOrEmpty(arr)) {
|
|
82
|
-
return arr;
|
|
83
|
-
}
|
|
69
|
+
isColumnQueryable(adaptableColumnBase) {
|
|
70
|
+
let queryableColumnFn = this.getExpressionOptions().isColumnQueryable;
|
|
71
|
+
if (queryableColumnFn) {
|
|
72
|
+
const queryableColumnContext = {
|
|
73
|
+
adaptableColumn: adaptableColumnBase,
|
|
74
|
+
adaptableApi: this.getAdaptableApi(),
|
|
75
|
+
};
|
|
76
|
+
return queryableColumnFn(queryableColumnContext);
|
|
84
77
|
}
|
|
78
|
+
return true;
|
|
85
79
|
}
|
|
86
80
|
getAdaptableQueryExpression(query) {
|
|
87
81
|
var _a, _b, _c, _d;
|
|
@@ -2,7 +2,7 @@ import { ApiBase } from './ApiBase';
|
|
|
2
2
|
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
3
3
|
import { AdaptableScope, ScopeDataType } from '../../PredefinedConfig/Common/AdaptableScope';
|
|
4
4
|
import { ScopeApi } from '../ScopeApi';
|
|
5
|
-
import { CellColorRange } from '../../PredefinedConfig/
|
|
5
|
+
import { CellColorRange } from '../../PredefinedConfig/StyledColumnState';
|
|
6
6
|
export declare class ScopeApiImpl extends ApiBase implements ScopeApi {
|
|
7
7
|
isColumnInScope(column: AdaptableColumn | undefined, scope: AdaptableScope | undefined): boolean;
|
|
8
8
|
getColumnsForScope(scope: AdaptableScope): AdaptableColumn[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApiBase, LayoutAssociatedObjectLoadConfig } from './ApiBase';
|
|
2
|
+
import { StyledColumnApi } from '../StyledColumnApi';
|
|
3
|
+
import { StyledColumnState, StyledColumn } from '../../PredefinedConfig/StyledColumnState';
|
|
4
|
+
import { AdaptableColumn, CellColorRange, ColumnComparison } from '../../types';
|
|
5
|
+
import { RowNode } from '@ag-grid-community/core';
|
|
6
|
+
export declare class StyledColumnApiImpl extends ApiBase implements StyledColumnApi {
|
|
7
|
+
getStyledColumnState(): StyledColumnState;
|
|
8
|
+
getAllStyledColumn(config?: LayoutAssociatedObjectLoadConfig): StyledColumn[];
|
|
9
|
+
getStyledColumnById(id: StyledColumn['Uuid']): StyledColumn;
|
|
10
|
+
getStyledColumnByColumnId(id: StyledColumn['Uuid']): StyledColumn;
|
|
11
|
+
getAllActiveStyledColumn(): StyledColumn[];
|
|
12
|
+
getAllSuspendedStyledColumn(): StyledColumn[];
|
|
13
|
+
deleteStyledColumn(styledColumn: StyledColumn): void;
|
|
14
|
+
addStyledColumn(styledColumn: StyledColumn): void;
|
|
15
|
+
getNumericStyleMinValue(styledColumn: Omit<StyledColumn, 'ColumnId'>, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number;
|
|
16
|
+
getNumericStyleMaxValue(styledColumn: Omit<StyledColumn, 'ColumnId'>, column: AdaptableColumn, rowNode: RowNode, cellValue: any): number | undefined;
|
|
17
|
+
getCellColorRangeMinValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
18
|
+
getCellColorRangeMaxValue(range: CellColorRange, column: AdaptableColumn): number | undefined;
|
|
19
|
+
getColumnComparisonForStyledColumn(styledColumn: StyledColumn): ColumnComparison | undefined;
|
|
20
|
+
getColumnIdsFromColumnComparison(columnComparison: ColumnComparison): string[];
|
|
21
|
+
getCheckBoxStyleStyledColumn(column: AdaptableColumn): StyledColumn | undefined;
|
|
22
|
+
isCheckBoxStyleStyledColumn(column: AdaptableColumn): boolean;
|
|
23
|
+
fireCheckboxColumnClickedEvent(columnId: string, rowData: any, primaryKeyValue: any, isChecked: boolean): void;
|
|
24
|
+
getActiveStyledColumnForColumn(column: AdaptableColumn): StyledColumn | undefined;
|
|
25
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnApiImpl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ApiBase_1 = require("./ApiBase");
|
|
6
|
+
const StyledColumnRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/StyledColumnRedux"));
|
|
7
|
+
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
8
|
+
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
9
|
+
class StyledColumnApiImpl extends ApiBase_1.ApiBase {
|
|
10
|
+
getStyledColumnState() {
|
|
11
|
+
return this.getAdaptableState().StyledColumn;
|
|
12
|
+
}
|
|
13
|
+
getAllStyledColumn(config) {
|
|
14
|
+
var _a;
|
|
15
|
+
return ((_a = this.handleLayoutAssociatedObjects(this.getStyledColumnState().StyledColumns, 'StyledColumn', config)) !== null && _a !== void 0 ? _a : []);
|
|
16
|
+
}
|
|
17
|
+
getStyledColumnById(id) {
|
|
18
|
+
return this.getAllStyledColumn().find((styledcolumn) => styledcolumn.Uuid === id);
|
|
19
|
+
}
|
|
20
|
+
getStyledColumnByColumnId(id) {
|
|
21
|
+
return this.getAllStyledColumn().find((styledcolumn) => styledcolumn.ColumnId === id);
|
|
22
|
+
}
|
|
23
|
+
getAllActiveStyledColumn() {
|
|
24
|
+
return this.getAllStyledColumn().filter((styledcolumn) => !styledcolumn.IsSuspended);
|
|
25
|
+
}
|
|
26
|
+
getAllSuspendedStyledColumn() {
|
|
27
|
+
return this.getAllStyledColumn().filter((styledcolumn) => styledcolumn.IsSuspended);
|
|
28
|
+
}
|
|
29
|
+
deleteStyledColumn(styledColumn) {
|
|
30
|
+
this.dispatchAction(StyledColumnRedux.StyledColumnDelete(styledColumn));
|
|
31
|
+
}
|
|
32
|
+
addStyledColumn(styledColumn) {
|
|
33
|
+
this.dispatchAction(StyledColumnRedux.StyledColumnAdd(styledColumn));
|
|
34
|
+
}
|
|
35
|
+
getNumericStyleMinValue(styledColumn, column, rowNode, cellValue) {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
const columnComparison = styledColumn.GradientStyle
|
|
38
|
+
? styledColumn.GradientStyle.ColumnComparison
|
|
39
|
+
: (_a = styledColumn.PercentBarStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison;
|
|
40
|
+
if (columnComparison) {
|
|
41
|
+
if (!isNaN(Number(columnComparison.MinValue))) {
|
|
42
|
+
return Number(columnComparison.MinValue);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
let columnId = columnComparison.MinValue;
|
|
46
|
+
if (!this.adaptable.api.columnApi.doesColumnExist(columnId)) {
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// for Gradient Column we want just the range that contains cell value
|
|
55
|
+
if (styledColumn.GradientStyle) {
|
|
56
|
+
let range;
|
|
57
|
+
styledColumn.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
58
|
+
if (!range) {
|
|
59
|
+
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
60
|
+
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
61
|
+
range = cellRange;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return this.getCellColorRangeMinValue(range, column);
|
|
66
|
+
}
|
|
67
|
+
// for percentbar we want to get the whole Ranges
|
|
68
|
+
if (styledColumn.PercentBarStyle) {
|
|
69
|
+
const ranges = (_b = styledColumn.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
70
|
+
if (ranges) {
|
|
71
|
+
return this.getCellColorRangeMinValue(ranges[0], column);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
getNumericStyleMaxValue(styledColumn, column, rowNode, cellValue) {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
const columnComparison = styledColumn.GradientStyle
|
|
78
|
+
? styledColumn.GradientStyle.ColumnComparison
|
|
79
|
+
: (_a = styledColumn.PercentBarStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison;
|
|
80
|
+
if (columnComparison) {
|
|
81
|
+
if (!isNaN(Number(columnComparison.MaxValue))) {
|
|
82
|
+
return Number(columnComparison.MaxValue);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
let columnId = columnComparison.MaxValue;
|
|
86
|
+
if (!this.adaptable.api.columnApi.doesColumnExist(columnId)) {
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
return this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, columnId);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (styledColumn.GradientStyle) {
|
|
95
|
+
let range;
|
|
96
|
+
styledColumn.GradientStyle.CellRanges.forEach((cellRange) => {
|
|
97
|
+
if (!range) {
|
|
98
|
+
if ((cellRange.Min == 'Col-Min' || cellValue >= cellRange.Min) &&
|
|
99
|
+
(cellRange.Max == 'Col-Max' || cellValue <= cellRange.Max)) {
|
|
100
|
+
range = cellRange;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return this.getCellColorRangeMaxValue(range, column);
|
|
105
|
+
}
|
|
106
|
+
if (styledColumn.PercentBarStyle) {
|
|
107
|
+
const ranges = (_b = styledColumn.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.CellRanges;
|
|
108
|
+
if (ranges) {
|
|
109
|
+
return this.getCellColorRangeMaxValue(ranges[ranges.length - 1], column);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
getCellColorRangeMinValue(range, column) {
|
|
114
|
+
if (!range) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
if (range.Min == undefined) {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
return range.Min == 'Col-Min'
|
|
121
|
+
? this.getAdaptableApi().columnApi.getMinValueForNumericColumn(column)
|
|
122
|
+
: range.Min;
|
|
123
|
+
}
|
|
124
|
+
getCellColorRangeMaxValue(range, column) {
|
|
125
|
+
if (!range) {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
if (range.Max == undefined) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
return range.Max == 'Col-Max'
|
|
132
|
+
? this.getAdaptableApi().columnApi.getMaxValueForNumericColumn(column)
|
|
133
|
+
: range.Max;
|
|
134
|
+
}
|
|
135
|
+
getColumnComparisonForStyledColumn(styledColumn) {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
if (styledColumn.GradientStyle) {
|
|
138
|
+
if ((_a = styledColumn.GradientStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison) {
|
|
139
|
+
return styledColumn.GradientStyle.ColumnComparison;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (styledColumn.PercentBarStyle) {
|
|
143
|
+
if ((_b = styledColumn.PercentBarStyle) === null || _b === void 0 ? void 0 : _b.ColumnComparison) {
|
|
144
|
+
return styledColumn.PercentBarStyle.ColumnComparison;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
getColumnIdsFromColumnComparison(columnComparison) {
|
|
150
|
+
let returnValues = [];
|
|
151
|
+
if (typeof columnComparison.MinValue === 'string') {
|
|
152
|
+
let minIds = this.adaptable.api.columnApi.getColumnIdsFromId(columnComparison.MinValue, false);
|
|
153
|
+
if (ArrayExtensions_1.default.IsNotNullOrEmpty(minIds)) {
|
|
154
|
+
returnValues.push(...minIds);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (typeof columnComparison.MaxValue === 'string') {
|
|
158
|
+
let maxIds = this.adaptable.api.columnApi.getColumnIdsFromId(columnComparison.MaxValue, false);
|
|
159
|
+
if (ArrayExtensions_1.default.IsNotNullOrEmpty(maxIds)) {
|
|
160
|
+
returnValues.push(...maxIds);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return returnValues;
|
|
164
|
+
}
|
|
165
|
+
getCheckBoxStyleStyledColumn(column) {
|
|
166
|
+
var _a;
|
|
167
|
+
if (column.dataType != 'Boolean') {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
const checkBoxFormatColumns = (_a = this.getStyledColumnState().StyledColumns) === null || _a === void 0 ? void 0 : _a.filter((sc) => sc === null || sc === void 0 ? void 0 : sc.CheckBoxStyle);
|
|
171
|
+
const styledColumn = checkBoxFormatColumns.find((sc) => sc.ColumnId == column.columnId);
|
|
172
|
+
return styledColumn;
|
|
173
|
+
}
|
|
174
|
+
isCheckBoxStyleStyledColumn(column) {
|
|
175
|
+
const styledColumn = this.getCheckBoxStyleStyledColumn(column);
|
|
176
|
+
return Helper_1.default.objectExists(styledColumn);
|
|
177
|
+
}
|
|
178
|
+
fireCheckboxColumnClickedEvent(columnId, rowData, primaryKeyValue, isChecked) {
|
|
179
|
+
let checkboxColumnClickedInfo = {
|
|
180
|
+
adaptableApi: this.adaptable.api,
|
|
181
|
+
column: this.adaptable.api.columnApi.getColumnFromId(columnId),
|
|
182
|
+
rowData: rowData,
|
|
183
|
+
primaryKeyValue: primaryKeyValue,
|
|
184
|
+
isChecked: isChecked,
|
|
185
|
+
};
|
|
186
|
+
this.adaptable.api.eventApi.emit('CheckboxColumnClicked', checkboxColumnClickedInfo);
|
|
187
|
+
}
|
|
188
|
+
getActiveStyledColumnForColumn(column) {
|
|
189
|
+
const styledColumns = this.getAllActiveStyledColumn();
|
|
190
|
+
return styledColumns.find((sc) => sc.ColumnId == column.columnId);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
exports.StyledColumnApiImpl = StyledColumnApiImpl;
|