@adaptabletools/adaptable 13.0.0-canary.14 → 13.0.0-canary.16
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/bundle.cjs.js +138 -138
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -5
- package/src/Api/ColumnApi.d.ts +1 -1
- package/src/Api/FormatColumnApi.d.ts +1 -25
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.js +5 -5
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -6
- package/src/Api/Implementation/FormatColumnApiImpl.js +0 -52
- package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
- package/src/Api/Implementation/InternalApiImpl.js +0 -4
- package/src/Api/Implementation/ScopeApiImpl.d.ts +1 -1
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +9 -3
- package/src/Api/Implementation/StyledColumnApiImpl.js +75 -16
- package/src/Api/InternalApi.d.ts +0 -1
- package/src/Api/ScopeApi.d.ts +1 -1
- package/src/Api/StyledColumnApi.d.ts +46 -22
- package/src/PredefinedConfig/FormatColumnState.d.ts +2 -87
- package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
- package/src/Strategy/ConditionalStyleModule.d.ts +0 -2
- package/src/Strategy/ConditionalStyleModule.js +0 -4
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +26 -207
- package/src/Strategy/StyledColumnModule.js +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +1 -16
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +0 -1
- package/src/View/Components/RangesComponent.d.ts +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -2
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +4 -3
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +0 -7
- package/src/agGrid/Adaptable.d.ts +2 -8
- package/src/agGrid/Adaptable.js +38 -134
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/PercentBarRenderer.d.ts +1 -1
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -23,7 +23,6 @@ const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
|
23
23
|
const StringExtensions_1 = require("../Utilities/Extensions/StringExtensions");
|
|
24
24
|
const getScrollbarSize_1 = tslib_1.__importDefault(require("../Utilities/getScrollbarSize"));
|
|
25
25
|
const AdaptableHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/AdaptableHelper"));
|
|
26
|
-
const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
|
|
27
26
|
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
28
27
|
const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
|
|
29
28
|
const ObjectFactory_1 = require("../Utilities/ObjectFactory");
|
|
@@ -86,6 +85,14 @@ const assignColId = (colDef) => {
|
|
|
86
85
|
const RowNodeProto = core_1.RowNode.prototype;
|
|
87
86
|
const RowNode_dispatchLocalEvent = RowNodeProto.dispatchLocalEvent;
|
|
88
87
|
const GridApi_setColumnDefs = core_1.GridApi.prototype.setColumnDefs;
|
|
88
|
+
['addCssClass', 'removeCssClass', 'containsCssClass', 'addOrRemoveCssClass'].forEach((methodName) => {
|
|
89
|
+
// @ts-ignore
|
|
90
|
+
const CssClassManager_originalMethod = core_1.CssClassManager.prototype[methodName];
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
core_1.CssClassManager.prototype[methodName] = function () {
|
|
93
|
+
return this.getGui() ? CssClassManager_originalMethod.apply(this, arguments) : undefined;
|
|
94
|
+
};
|
|
95
|
+
});
|
|
89
96
|
/**
|
|
90
97
|
* AgGrid does not expose Events.EVENT_ROW_DATA_CHANGED
|
|
91
98
|
* so we have to override `dispatchLocalEvent`
|
|
@@ -912,14 +919,11 @@ class Adaptable {
|
|
|
912
919
|
this.updateColumnsIntoStore(); // todo remove this from here!!!
|
|
913
920
|
}
|
|
914
921
|
getStyledColumnStyle(styledColumn, abColumn, params) {
|
|
915
|
-
return this.getSpecialColumnStyle(styledColumn, abColumn, params);
|
|
916
|
-
}
|
|
917
|
-
getSpecialColumnStyle(columnStyle, abColumn, params) {
|
|
918
922
|
let style = {};
|
|
919
|
-
const gradientStyle =
|
|
923
|
+
const gradientStyle = styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.GradientStyle;
|
|
920
924
|
if (gradientStyle) {
|
|
921
|
-
const min = this.api.styledColumnApi.getNumericStyleMinValue(
|
|
922
|
-
const max = this.api.styledColumnApi.getNumericStyleMaxValue(
|
|
925
|
+
const min = this.api.styledColumnApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
926
|
+
const max = this.api.styledColumnApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
923
927
|
const clampedValue = (0, clamp_1.default)(params.value, min, max);
|
|
924
928
|
let cellBackColor;
|
|
925
929
|
let reverseGradient = false;
|
|
@@ -943,16 +947,13 @@ class Adaptable {
|
|
|
943
947
|
const preparedColor = (0, StyleHelper_1.getVariableColor)(cellBackColor);
|
|
944
948
|
style.backgroundColor = tinycolor(preparedColor).setAlpha(alpha).toRgbString();
|
|
945
949
|
}
|
|
946
|
-
if (
|
|
950
|
+
if (styledColumn.PercentBarStyle && styledColumn.PercentBarStyle.CellText) {
|
|
947
951
|
style.paddingTop = 0;
|
|
948
952
|
style.paddingBottom = 0;
|
|
949
953
|
}
|
|
950
954
|
return style;
|
|
951
955
|
}
|
|
952
|
-
|
|
953
|
-
return this.getSpecialColumnStyle(formatColumn.ColumnStyle, abColumn, params);
|
|
954
|
-
}
|
|
955
|
-
getFormatColumnColumnStyle(formatColumns) {
|
|
956
|
+
getFormatColumnAdaptableStyle(formatColumns) {
|
|
956
957
|
// first has more precedence, then they need to be applied in reverse order
|
|
957
958
|
return formatColumns.reduceRight((style, formatColumn) => {
|
|
958
959
|
const formatColumnStyle = this.convertAdaptableStyleToCSS(formatColumn.Style);
|
|
@@ -974,23 +975,14 @@ class Adaptable {
|
|
|
974
975
|
}
|
|
975
976
|
getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params) {
|
|
976
977
|
let style = {};
|
|
977
|
-
|
|
978
|
-
const columnStyle = formatColumn.ColumnStyle;
|
|
979
|
-
if (columnStyle) {
|
|
980
|
-
if (columnStyle &&
|
|
981
|
-
!this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params)) {
|
|
982
|
-
return style;
|
|
983
|
-
}
|
|
984
|
-
style = Object.assign(Object.assign({}, style), this.getFormatColumnSpecialColumnStyle(formatColumn, abColumn, params));
|
|
985
|
-
}
|
|
986
|
-
else if (formatColumn.Style) {
|
|
978
|
+
if (formatColumn.Style) {
|
|
987
979
|
const activeFormatColumnsWithStyle = formatColumnsWithStyle.filter((formatColumn) => {
|
|
988
980
|
return this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params);
|
|
989
981
|
});
|
|
990
982
|
if (!activeFormatColumnsWithStyle.length) {
|
|
991
983
|
return style;
|
|
992
984
|
}
|
|
993
|
-
style = Object.assign(Object.assign({}, style), this.
|
|
985
|
+
style = Object.assign(Object.assign({}, style), this.getFormatColumnAdaptableStyle(activeFormatColumnsWithStyle));
|
|
994
986
|
}
|
|
995
987
|
return style;
|
|
996
988
|
}
|
|
@@ -1166,31 +1158,6 @@ class Adaptable {
|
|
|
1166
1158
|
}
|
|
1167
1159
|
return undefined;
|
|
1168
1160
|
}
|
|
1169
|
-
getConditionalStyleCellStyle(conditionalStyles = [], abColumn, params) {
|
|
1170
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
1171
|
-
const result = conditionalStyles.reduce((result, conditionalStyle) => {
|
|
1172
|
-
if (module.isConditionalStyleActiveForColumn(conditionalStyle, abColumn, params)) {
|
|
1173
|
-
return Object.assign(Object.assign({}, result), conditionalStyle.Style);
|
|
1174
|
-
}
|
|
1175
|
-
else {
|
|
1176
|
-
return result;
|
|
1177
|
-
}
|
|
1178
|
-
}, {});
|
|
1179
|
-
return this.convertAdaptableStyleToCSS(result);
|
|
1180
|
-
}
|
|
1181
|
-
getConditionalStyleCellClass(conditionalStyles = [], abColumn, params) {
|
|
1182
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
1183
|
-
let classNames = conditionalStyles
|
|
1184
|
-
.map((conditionalStyle) => {
|
|
1185
|
-
var _a, _b;
|
|
1186
|
-
if (((_a = conditionalStyle.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
1187
|
-
module.isConditionalStyleActiveForColumn(conditionalStyle, abColumn, params)) {
|
|
1188
|
-
return (_b = conditionalStyle.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
1189
|
-
}
|
|
1190
|
-
})
|
|
1191
|
-
.filter((x) => !!x);
|
|
1192
|
-
return classNames;
|
|
1193
|
-
}
|
|
1194
1161
|
getEditableCellClass(abColumn, params) {
|
|
1195
1162
|
const editableCellStyle = this.api.userInterfaceApi.getEditableCellStyle();
|
|
1196
1163
|
if (!(editableCellStyle === null || editableCellStyle === void 0 ? void 0 : editableCellStyle.ClassName)) {
|
|
@@ -1910,7 +1877,7 @@ class Adaptable {
|
|
|
1910
1877
|
if (colDef && colDef.cellRenderer != null) {
|
|
1911
1878
|
return true;
|
|
1912
1879
|
}
|
|
1913
|
-
if (this.api.columnApi.
|
|
1880
|
+
if (this.api.columnApi.isStyledNumericColumn(column)) {
|
|
1914
1881
|
return true;
|
|
1915
1882
|
}
|
|
1916
1883
|
if (this.api.columnApi.isBooleanColumn(column)) {
|
|
@@ -1965,7 +1932,7 @@ class Adaptable {
|
|
|
1965
1932
|
}
|
|
1966
1933
|
getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
|
|
1967
1934
|
const abColumn = this.api.columnApi.getColumnFromId(columnId);
|
|
1968
|
-
const isRenderedColumn = this.api.columnApi.
|
|
1935
|
+
const isRenderedColumn = this.api.columnApi.isStyledNumericColumn(abColumn);
|
|
1969
1936
|
if (isRenderedColumn) {
|
|
1970
1937
|
const colDef = this.gridOptions.api.getColumnDef(columnId);
|
|
1971
1938
|
if (typeof colDef.valueFormatter == 'function') {
|
|
@@ -3214,7 +3181,6 @@ class Adaptable {
|
|
|
3214
3181
|
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) {
|
|
3215
3182
|
styledColumn = null;
|
|
3216
3183
|
}
|
|
3217
|
-
const conditionalStyles = this.api.conditionalStyleApi.getConditionalStylesForColumn(abColumn);
|
|
3218
3184
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
3219
3185
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3220
3186
|
const cellStyle = (params) => {
|
|
@@ -3222,8 +3188,7 @@ class Adaptable {
|
|
|
3222
3188
|
? this.getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params)
|
|
3223
3189
|
: undefined;
|
|
3224
3190
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3225
|
-
const
|
|
3226
|
-
const result = Object.assign(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), (styledColumn ? this.getStyledColumnStyle(styledColumn, abColumn, params) : {})), conditionalStyleObj), (isQuickSearchActive ? quickSearchStyle : undefined)), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
3191
|
+
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), (styledColumn ? this.getStyledColumnStyle(styledColumn, abColumn, params) : {})), (isQuickSearchActive ? quickSearchStyle : undefined)), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
3227
3192
|
return result;
|
|
3228
3193
|
};
|
|
3229
3194
|
return cellStyle;
|
|
@@ -3232,10 +3197,6 @@ class Adaptable {
|
|
|
3232
3197
|
setupColumnCellClass({ col, colId, abColumn }) {
|
|
3233
3198
|
this.setColDefProperty(col, 'cellClass', (userCellClass) => {
|
|
3234
3199
|
const formatColumns = this.api.formatColumnApi.getFormatColumnWithStyleClassNameForColumn(abColumn);
|
|
3235
|
-
const conditionalStyles = this.api.conditionalStyleApi
|
|
3236
|
-
.getConditionalStylesForColumn(abColumn)
|
|
3237
|
-
.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName));
|
|
3238
|
-
const hasConditionalStylesWithClassNames = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles);
|
|
3239
3200
|
const quickSearchStyleClassName = this.api.quickSearchApi.getQuickSearchStyle().ClassName;
|
|
3240
3201
|
const hasQuickSearchStyleClassName = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(quickSearchStyleClassName);
|
|
3241
3202
|
const cellClass = (params) => {
|
|
@@ -3253,16 +3214,13 @@ class Adaptable {
|
|
|
3253
3214
|
!hasStyledColumn && formatColumns.length
|
|
3254
3215
|
? this.getFormatColumnCellClass(formatColumns, abColumn, params)
|
|
3255
3216
|
: null,
|
|
3256
|
-
hasConditionalStylesWithClassNames
|
|
3257
|
-
? this.getConditionalStyleCellClass(conditionalStyles, abColumn, params)
|
|
3258
|
-
: null,
|
|
3259
3217
|
isQuickSearchActive ? quickSearchStyleClassName : null,
|
|
3260
3218
|
editableClassName,
|
|
3261
3219
|
readonlyClassName,
|
|
3262
3220
|
highlightAlertClassName,
|
|
3263
3221
|
flashingClassName,
|
|
3264
3222
|
]
|
|
3265
|
-
// we flatten the array because some rules ('userCellClass'
|
|
3223
|
+
// we flatten the array because some rules ('userCellClass' etc) might return a string[]
|
|
3266
3224
|
.flat()
|
|
3267
3225
|
.filter((x) => !!x);
|
|
3268
3226
|
const result = returnValue.length ? returnValue : undefined;
|
|
@@ -3284,9 +3242,8 @@ class Adaptable {
|
|
|
3284
3242
|
const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
3285
3243
|
const hasRichSelectCellEditor = this.isAgGridModulePresent(core_1.ModuleNames.RichSelectModule);
|
|
3286
3244
|
this.setColDefProperty(col, 'cellEditor', () => {
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && ((_a = formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle)) {
|
|
3245
|
+
const styledColumn = this.api.styledColumnApi.getActiveStyledColumnForColumn(adaptableColumn);
|
|
3246
|
+
if (styledColumn && !(styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) && styledColumn.CheckBoxStyle) {
|
|
3290
3247
|
return CheckboxRenderer_1.CheckboxEditor;
|
|
3291
3248
|
}
|
|
3292
3249
|
if (editLookUpItem) {
|
|
@@ -3322,43 +3279,23 @@ class Adaptable {
|
|
|
3322
3279
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
3323
3280
|
}
|
|
3324
3281
|
}
|
|
3325
|
-
const formatColumn = this.api.formatColumnApi.getActiveFormatColumnForColumn(abColumn);
|
|
3326
|
-
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn.ColumnStyle) {
|
|
3327
|
-
if (formatColumn.ColumnStyle.PercentBarStyle) {
|
|
3328
|
-
return this.agGridHelper.createPercentBarRendererComp(formatColumn.ColumnStyle, abColumn);
|
|
3329
|
-
}
|
|
3330
|
-
if (formatColumn.ColumnStyle.CheckBoxStyle) {
|
|
3331
|
-
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
3332
|
-
}
|
|
3333
|
-
}
|
|
3334
3282
|
});
|
|
3335
3283
|
}
|
|
3336
3284
|
setupColumnTooltipValueGetter({ col, colId, abColumn }) {
|
|
3337
3285
|
this.setColDefProperty(col, 'tooltipValueGetter', () => {
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
formatColumn.ColumnStyle.PercentBarStyle.ToolTipText) {
|
|
3345
|
-
if ((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle) {
|
|
3286
|
+
const styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3287
|
+
if (styledColumn &&
|
|
3288
|
+
!styledColumn.IsSuspended &&
|
|
3289
|
+
styledColumn.PercentBarStyle &&
|
|
3290
|
+
styledColumn.PercentBarStyle.ToolTipText) {
|
|
3291
|
+
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.PercentBarStyle) {
|
|
3346
3292
|
return (params) => {
|
|
3347
|
-
const min = this.api.styledColumnApi.getNumericStyleMinValue(
|
|
3348
|
-
const max = this.api.styledColumnApi.getNumericStyleMaxValue(
|
|
3349
|
-
const textOptions =
|
|
3293
|
+
const min = this.api.styledColumnApi.getNumericStyleMinValue(styledColumn, abColumn, params.node, params.value);
|
|
3294
|
+
const max = this.api.styledColumnApi.getNumericStyleMaxValue(styledColumn, abColumn, params.node, params.value);
|
|
3295
|
+
const textOptions = styledColumn.PercentBarStyle.ToolTipText;
|
|
3350
3296
|
let returnValue = '';
|
|
3351
3297
|
if (textOptions.includes('CellValue')) {
|
|
3352
|
-
|
|
3353
|
-
const options = formatColumn.DisplayFormat
|
|
3354
|
-
.Options;
|
|
3355
|
-
returnValue = options
|
|
3356
|
-
? FormatHelper_1.default.NumberFormatter(params.value, options)
|
|
3357
|
-
: params.value;
|
|
3358
|
-
}
|
|
3359
|
-
else {
|
|
3360
|
-
returnValue = params.value;
|
|
3361
|
-
}
|
|
3298
|
+
returnValue = params.value;
|
|
3362
3299
|
}
|
|
3363
3300
|
if (textOptions.includes('PercentageValue')) {
|
|
3364
3301
|
const clampedValue = Helper_1.Helper.clamp(params.value, min, max);
|
|
@@ -3753,7 +3690,7 @@ class Adaptable {
|
|
|
3753
3690
|
this.redrawRow(firstInfo.rowNode);
|
|
3754
3691
|
}
|
|
3755
3692
|
else {
|
|
3756
|
-
this.
|
|
3693
|
+
this.getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
|
|
3757
3694
|
if (dataChangedScope.columnIds.size > 0) {
|
|
3758
3695
|
this.refreshCells([firstInfo.rowNode], Array.from(dataChangedScope.columnIds.values()), true);
|
|
3759
3696
|
}
|
|
@@ -3763,7 +3700,6 @@ class Adaptable {
|
|
|
3763
3700
|
}
|
|
3764
3701
|
getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3765
3702
|
const stylesWithExpression = [];
|
|
3766
|
-
stylesWithExpression.push(...this.api.conditionalStyleApi.getConditionalStylesWithExpression());
|
|
3767
3703
|
stylesWithExpression.push(...this.api.formatColumnApi.getFormatColumnsWithExpression());
|
|
3768
3704
|
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(stylesWithExpression)) {
|
|
3769
3705
|
return;
|
|
@@ -3792,20 +3728,15 @@ class Adaptable {
|
|
|
3792
3728
|
}
|
|
3793
3729
|
});
|
|
3794
3730
|
}
|
|
3795
|
-
|
|
3796
|
-
this.api.
|
|
3797
|
-
let columnComparison = this.api.
|
|
3731
|
+
getStyledColumnComparisonChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3732
|
+
this.api.styledColumnApi.getAllStyledColumn().forEach((sc) => {
|
|
3733
|
+
let columnComparison = this.api.styledColumnApi.getColumnComparisonForStyledColumn(sc);
|
|
3798
3734
|
if (columnComparison) {
|
|
3799
|
-
let affectedColumnIds = this.api.
|
|
3735
|
+
let affectedColumnIds = this.api.styledColumnApi.getColumnIdsFromColumnComparison(columnComparison);
|
|
3800
3736
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(affectedColumnIds)) {
|
|
3801
3737
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3802
3738
|
if (affectedColumnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
3803
|
-
|
|
3804
|
-
.getColumnsForScope(fc.Scope)
|
|
3805
|
-
.map((c) => c.columnId)
|
|
3806
|
-
.forEach((colId) => {
|
|
3807
|
-
dataChangedScope.columnIds.add(colId);
|
|
3808
|
-
});
|
|
3739
|
+
dataChangedScope.columnIds.add(sc.ColumnId);
|
|
3809
3740
|
}
|
|
3810
3741
|
});
|
|
3811
3742
|
}
|
|
@@ -4404,12 +4335,10 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4404
4335
|
}
|
|
4405
4336
|
}
|
|
4406
4337
|
setupRowStyling() {
|
|
4407
|
-
// first get the conditional style state
|
|
4408
|
-
const conditionalStyles = this.api.conditionalStyleApi.getRowConditionalStyles();
|
|
4409
4338
|
// Set any Row Styles (i.e. items without a classname)
|
|
4410
4339
|
this.setGridOptionsProperty('getRowStyle', (userGetRowStyle) => {
|
|
4411
4340
|
return (params) => {
|
|
4412
|
-
const result = Object.assign(Object.assign(Object.assign(
|
|
4341
|
+
const result = Object.assign(Object.assign(Object.assign({}, userGetRowStyle === null || userGetRowStyle === void 0 ? void 0 : userGetRowStyle(params)), this.getRowHighlightStyle(params)), this.getAlertRowStyle(params));
|
|
4413
4342
|
return result;
|
|
4414
4343
|
};
|
|
4415
4344
|
});
|
|
@@ -4422,7 +4351,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4422
4351
|
typeof userGetRowClass === 'function' ? userGetRowClass(params) : userGetRowClass,
|
|
4423
4352
|
highlightClassName,
|
|
4424
4353
|
alertHighlightClassName,
|
|
4425
|
-
this.getConditionalStyleRowClass(conditionalStyles.filter((cs) => StringExtensions_1.StringExtensions.IsNotNullOrEmpty(cs.Style.ClassName)), params),
|
|
4426
4354
|
]
|
|
4427
4355
|
// we flatten it because 'userGetRowClass' might return a string[]
|
|
4428
4356
|
.flat()
|
|
@@ -4441,30 +4369,6 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
|
|
|
4441
4369
|
const newValue = this.gridOptions.suppressAggFuncInHeader;
|
|
4442
4370
|
return previousValue !== newValue;
|
|
4443
4371
|
}
|
|
4444
|
-
getConditionalStyleRowClass(conditionalStyles, params) {
|
|
4445
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles)) {
|
|
4446
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
4447
|
-
let classNames = conditionalStyles
|
|
4448
|
-
.map((conditionalStyle) => {
|
|
4449
|
-
var _a;
|
|
4450
|
-
if (module.isConditionalStyleActiveForRow(conditionalStyle, params)) {
|
|
4451
|
-
return (_a = conditionalStyle.Style) === null || _a === void 0 ? void 0 : _a.ClassName;
|
|
4452
|
-
}
|
|
4453
|
-
})
|
|
4454
|
-
.filter((x) => !!x)
|
|
4455
|
-
.join(' ');
|
|
4456
|
-
return classNames;
|
|
4457
|
-
}
|
|
4458
|
-
}
|
|
4459
|
-
getConditionalStyleRowStyle(conditionalStyles, params) {
|
|
4460
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(conditionalStyles)) {
|
|
4461
|
-
const module = this.ModuleService.getModuleById(ModuleConstants.ConditionalStyleModuleId);
|
|
4462
|
-
const cs = conditionalStyles.find((cs) => module.isConditionalStyleActiveForRow(cs, params));
|
|
4463
|
-
if (cs) {
|
|
4464
|
-
return this.convertAdaptableStyleToCSS(cs.Style);
|
|
4465
|
-
}
|
|
4466
|
-
}
|
|
4467
|
-
}
|
|
4468
4372
|
getGridOptionsApi() {
|
|
4469
4373
|
if (!this.gridOptions.api) {
|
|
4470
4374
|
(0, LoggingHelper_1.ConsoleLogError)('There is a problem with your instance of AG Grid - it has no gridApi object. Please contact Support.');
|
|
@@ -30,7 +30,7 @@ const getCheckboxRendererForColumn = (columnId, isColumnReadOnly, api) => {
|
|
|
30
30
|
CheckboxRenderer.prototype.checkedHandler = function (e) {
|
|
31
31
|
let checked = e.target.checked;
|
|
32
32
|
this.params.node.setDataValue(columnId, checked);
|
|
33
|
-
api.
|
|
33
|
+
api.styledColumnApi.fireCheckboxColumnClickedEvent(columnId, this.params.node.data, api.gridApi.getPrimaryKeyValueForRowNode(this.params.node), checked);
|
|
34
34
|
};
|
|
35
35
|
CheckboxRenderer.prototype.suppressEditEvent = function (event) {
|
|
36
36
|
if (event.target === this.eGui) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GradientStyle, PercentBarStyle } from '../PredefinedConfig/
|
|
1
|
+
import { GradientStyle, PercentBarStyle } from '../PredefinedConfig/StyledColumnState';
|
|
2
2
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
3
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
4
|
export declare const getPercentBarRendererForColumn: (columnStyle: {
|
|
@@ -5,7 +5,7 @@ import { AdaptableNodeComparerFunction } from '../PredefinedConfig/Common/Adapta
|
|
|
5
5
|
import { AdaptableColumnType, AdaptableModule } from '../PredefinedConfig/Common/Types';
|
|
6
6
|
import { IModule } from '../Strategy/Interface/IModule';
|
|
7
7
|
import { IPPStyle } from '../Utilities/Interface/IPPStyle';
|
|
8
|
-
import { GradientStyle, PercentBarStyle } from '../PredefinedConfig/
|
|
8
|
+
import { GradientStyle, PercentBarStyle } from '../PredefinedConfig/StyledColumnState';
|
|
9
9
|
/**
|
|
10
10
|
* Adaptable AG Grid implementation is getting really big and unwieldy
|
|
11
11
|
* So lets put some of the more obvious 'Helper' functions here
|