@adaptabletools/adaptable 18.1.7 → 18.1.8
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/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -1
- package/src/Api/Internal/AlertInternalApi.d.ts +0 -3
- package/src/Api/Internal/AlertInternalApi.js +12 -39
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +2 -2
- package/src/Api/Internal/FormatColumnInternalApi.js +6 -6
- package/src/Api/Internal/GridInternalApi.js +2 -2
- package/src/Utilities/Helpers/FormatHelper.d.ts +23 -4
- package/src/Utilities/Helpers/FormatHelper.js +73 -14
- package/src/Utilities/Helpers/Helper.d.ts +6 -0
- package/src/Utilities/Helpers/Helper.js +31 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +5 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +9 -9
- package/src/env.js +2 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.8",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -177,7 +177,7 @@ export interface IAdaptable {
|
|
|
177
177
|
getDisplayValueFromRowNode(rowNode: IRowNode, columnId: string): string | undefined;
|
|
178
178
|
getDisplayValueFromRawValue(rowNode: IRowNode, columnId: string, rawValue: any): string | undefined;
|
|
179
179
|
getNormalisedValueFromRawValue(rawValue: any, column: AdaptableColumn): string | number | boolean | Date | unknown;
|
|
180
|
-
getGridCellsForColumn(columnId: string,
|
|
180
|
+
getGridCellsForColumn(columnId: string, onlyVisibleRows?: boolean): GridCell[] | undefined;
|
|
181
181
|
getRowNodesForPrimaryKeys(primaryKeyValues: any[]): IRowNode[];
|
|
182
182
|
getRowNodeForPrimaryKey(primaryKeyValue: any): IRowNode;
|
|
183
183
|
getRowNodeByIndex(index: number): IRowNode;
|
|
@@ -5,6 +5,7 @@ import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
|
|
|
5
5
|
import { AlertModuleId } from '../../Utilities/Constants/ModuleConstants';
|
|
6
6
|
import { isCellDataChangedInfo } from '../../Utilities/Services/Interface/IAlertService';
|
|
7
7
|
import ObjectFactory from '../../Utilities/ObjectFactory';
|
|
8
|
+
import Helper from '../../Utilities/Helpers/Helper';
|
|
8
9
|
export class AlertInternalApi extends ApiBase {
|
|
9
10
|
getExpressionForAlertRule(alertRule) {
|
|
10
11
|
var expression;
|
|
@@ -631,19 +632,19 @@ export class AlertInternalApi extends ApiBase {
|
|
|
631
632
|
return text;
|
|
632
633
|
}
|
|
633
634
|
if (context === null || context === void 0 ? void 0 : context.newValue) {
|
|
634
|
-
text =
|
|
635
|
+
text = Helper.replaceAll(text, '[newValue]', context.newValue);
|
|
635
636
|
}
|
|
636
637
|
if (context === null || context === void 0 ? void 0 : context.oldValue) {
|
|
637
|
-
text =
|
|
638
|
+
text = Helper.replaceAll(text, '[oldValue]', context.oldValue);
|
|
638
639
|
}
|
|
639
640
|
if (context === null || context === void 0 ? void 0 : context.primaryKeyValue) {
|
|
640
|
-
text =
|
|
641
|
+
text = Helper.replaceAll(text, '[primaryKeyValue]', context.primaryKeyValue);
|
|
641
642
|
}
|
|
642
643
|
if (context === null || context === void 0 ? void 0 : context.timestamp) {
|
|
643
|
-
text =
|
|
644
|
+
text = Helper.replaceAll(text, '[timestamp]', context.timestamp + '');
|
|
644
645
|
}
|
|
645
646
|
if (context === null || context === void 0 ? void 0 : context.numberOfRows) {
|
|
646
|
-
text =
|
|
647
|
+
text = Helper.replaceAll(text, '[numberOfRows]', context.numberOfRows + '');
|
|
647
648
|
}
|
|
648
649
|
if (context === null || context === void 0 ? void 0 : context.trigger) {
|
|
649
650
|
const dataChangeTriggerMap = {
|
|
@@ -661,56 +662,28 @@ export class AlertInternalApi extends ApiBase {
|
|
|
661
662
|
const mappedTrigger =
|
|
662
663
|
// @ts-ignore
|
|
663
664
|
(_a = (dataChangeTriggerMap[context.trigger] || rowChangeTriggerMap[context.trigger])) !== null && _a !== void 0 ? _a : context.trigger;
|
|
664
|
-
text =
|
|
665
|
+
text = Helper.replaceAll(text, '[trigger]', mappedTrigger);
|
|
665
666
|
}
|
|
666
667
|
if (context === null || context === void 0 ? void 0 : context.column) {
|
|
667
|
-
text =
|
|
668
|
+
text = Helper.replaceAll(text, '[column]', this.getColumnApi().getFriendlyNameForColumnId(context.column.columnId));
|
|
668
669
|
}
|
|
669
670
|
if (context === null || context === void 0 ? void 0 : context.rowNode) {
|
|
670
|
-
const columns =
|
|
671
|
+
const columns = Helper.extractColsFromText(text);
|
|
671
672
|
for (const column of columns) {
|
|
672
673
|
if (this.getColumnApi().getColumnWithColumnId(column)) {
|
|
673
|
-
text =
|
|
674
|
+
text = Helper.replaceAll(text, `[rowData.${column}]`, this.getGridApi().getRawValueFromRowNode(context.rowNode, column));
|
|
674
675
|
}
|
|
675
676
|
}
|
|
676
677
|
}
|
|
677
678
|
if (text.indexOf('[context') !== -1) {
|
|
678
679
|
const agGridContext = (_c = (_b = this.adaptable.agGridAdapter).getGridOption) === null || _c === void 0 ? void 0 : _c.call(_b, 'context');
|
|
679
|
-
const agGridContextKeys =
|
|
680
|
+
const agGridContextKeys = Helper.extractContextKeysFromText(text);
|
|
680
681
|
for (const key of agGridContextKeys) {
|
|
681
682
|
if (agGridContext[key]) {
|
|
682
|
-
text =
|
|
683
|
+
text = Helper.replaceAll(text, `[context.${key}]`, agGridContext[key]);
|
|
683
684
|
}
|
|
684
685
|
}
|
|
685
686
|
}
|
|
686
687
|
return text;
|
|
687
688
|
}
|
|
688
|
-
replaceAll(text, toReplace, replaceWith) {
|
|
689
|
-
if (!text) {
|
|
690
|
-
return text;
|
|
691
|
-
}
|
|
692
|
-
// fails for []
|
|
693
|
-
toReplace = toReplace.replace('[', '\\[').replace(']', '\\]');
|
|
694
|
-
return text.replace(new RegExp(toReplace, 'g'), replaceWith);
|
|
695
|
-
}
|
|
696
|
-
extractColsFromText(text) {
|
|
697
|
-
// rowData.columnName => columnName
|
|
698
|
-
const regex = /\[rowData\.(.*?)\]/g;
|
|
699
|
-
let m;
|
|
700
|
-
const cols = [];
|
|
701
|
-
while ((m = regex.exec(text)) !== null) {
|
|
702
|
-
cols.push(m[1]);
|
|
703
|
-
}
|
|
704
|
-
return cols;
|
|
705
|
-
}
|
|
706
|
-
extractContextKeysFromText(text) {
|
|
707
|
-
// context.columnName => columnName
|
|
708
|
-
const regex = /\[context\.(.*?)\]/g;
|
|
709
|
-
let m;
|
|
710
|
-
const contextKeys = [];
|
|
711
|
-
while ((m = regex.exec(text)) !== null) {
|
|
712
|
-
contextKeys.push(m[1]);
|
|
713
|
-
}
|
|
714
|
-
return contextKeys;
|
|
715
|
-
}
|
|
716
689
|
}
|
|
@@ -56,14 +56,14 @@ export declare class FormatColumnInternalApi extends ApiBase {
|
|
|
56
56
|
* @param customDisplayFormatterContext context that includes value to format
|
|
57
57
|
* @param options formatter options
|
|
58
58
|
*/
|
|
59
|
-
getNumberFormattedValue(value: any, node: IRowNode,
|
|
59
|
+
getNumberFormattedValue(value: any, node: IRowNode, column: AdaptableColumn, options: AdaptableFormat['Options']): any;
|
|
60
60
|
/**
|
|
61
61
|
* Format value according to format options.
|
|
62
62
|
*
|
|
63
63
|
* @param value context that includes value to format
|
|
64
64
|
* @param options formatter options
|
|
65
65
|
*/
|
|
66
|
-
getStringFormattedValue(value: any, node: IRowNode,
|
|
66
|
+
getStringFormattedValue(value: any, node: IRowNode, column: AdaptableColumn, options: StringFormatterOptions): string;
|
|
67
67
|
/**
|
|
68
68
|
* Format value according to format options.
|
|
69
69
|
*
|
|
@@ -91,9 +91,9 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
91
91
|
* @param customDisplayFormatterContext context that includes value to format
|
|
92
92
|
* @param options formatter options
|
|
93
93
|
*/
|
|
94
|
-
getNumberFormattedValue(value, node,
|
|
95
|
-
const preparedValue = this.applyCustomFormatters(value, node,
|
|
96
|
-
return FormatHelper.NumberFormatter(preparedValue, options);
|
|
94
|
+
getNumberFormattedValue(value, node, column, options) {
|
|
95
|
+
const preparedValue = this.applyCustomFormatters(value, node, column, options);
|
|
96
|
+
return FormatHelper.NumberFormatter(preparedValue, options, node, column, this.getAdaptableApi());
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Format value according to format options.
|
|
@@ -101,9 +101,9 @@ export class FormatColumnInternalApi extends ApiBase {
|
|
|
101
101
|
* @param value context that includes value to format
|
|
102
102
|
* @param options formatter options
|
|
103
103
|
*/
|
|
104
|
-
getStringFormattedValue(value, node,
|
|
105
|
-
const preparedValue = this.applyCustomFormatters(value, node,
|
|
106
|
-
return FormatHelper.StringFormatter(preparedValue, options);
|
|
104
|
+
getStringFormattedValue(value, node, column, options) {
|
|
105
|
+
const preparedValue = this.applyCustomFormatters(value, node, column, options);
|
|
106
|
+
return FormatHelper.StringFormatter(preparedValue, options, node, column, this.getAdaptableApi());
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Format value according to format options.
|
|
@@ -84,7 +84,7 @@ export class GridInternalApi extends ApiBase {
|
|
|
84
84
|
const shouldShowValuesCount = this.shouldShowValuesCount(abColumn);
|
|
85
85
|
let valueOptions = [];
|
|
86
86
|
if (shouldShowValuesCount) {
|
|
87
|
-
const allGridCells = this.adaptable.getGridCellsForColumn(columnId,
|
|
87
|
+
const allGridCells = this.adaptable.getGridCellsForColumn(columnId, this.getColumnFilterOptions().valuesFilterOptions.showCurrentlyFilteredValuesCount);
|
|
88
88
|
const allGridValues = allGridCells.map((gc) => gc.displayValue);
|
|
89
89
|
const newsortedDistinctValues = sortedDistinctValues.filter((gc) => gc.displayValue != undefined && gc.displayValue != '' && gc.displayValue != null);
|
|
90
90
|
valueOptions = newsortedDistinctValues.map((cv) => {
|
|
@@ -144,7 +144,7 @@ export class GridInternalApi extends ApiBase {
|
|
|
144
144
|
addPredicateValues(params) {
|
|
145
145
|
var _a, _b, _c, _d;
|
|
146
146
|
const { valueOptions, column, shouldShowValuesCount, visibleRowsOnly } = params;
|
|
147
|
-
const allGridCells = this.adaptable.getGridCellsForColumn(column.columnId,
|
|
147
|
+
const allGridCells = this.adaptable.getGridCellsForColumn(column.columnId, visibleRowsOnly);
|
|
148
148
|
const adaptableApi = this.getAdaptableApi();
|
|
149
149
|
const predicateIds = adaptableApi.columnFilterApi.internalApi.getValuesFitlerPredicateIds(column);
|
|
150
150
|
if (ArrayExtensions.IsNullOrEmpty(predicateIds)) {
|
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
import { NumberFormatterOptions, DateFormatterOptions,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { NumberFormatterOptions, DateFormatterOptions, StringFormatterOptions } from '../../PredefinedConfig/Common/AdaptableFormat';
|
|
2
|
+
import { IRowNode } from '@ag-grid-community/core';
|
|
3
|
+
import { AdaptableApi, AdaptableColumn } from '../../types';
|
|
4
|
+
export declare function NumberFormatter(input: number, options?: NumberFormatterOptions, rowNode?: IRowNode, column?: AdaptableColumn, api?: AdaptableApi): string;
|
|
4
5
|
export declare function DateFormatter(input: number | Date | string, options: DateFormatterOptions, strictFormatting?: boolean): string | undefined;
|
|
5
|
-
export declare function StringFormatter(input: string, options?: StringFormatterOptions): string;
|
|
6
|
+
export declare function StringFormatter(input: string, options?: StringFormatterOptions, rowNode?: IRowNode, column?: AdaptableColumn, api?: AdaptableApi): string;
|
|
7
|
+
/**
|
|
8
|
+
* Supported tokens:
|
|
9
|
+
* - column -> [column]
|
|
10
|
+
* - input -> [value]
|
|
11
|
+
* - rowData.colId -> [rowData.colId]
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolvePlaceholders(text: string, context: {
|
|
14
|
+
rowNode: IRowNode;
|
|
15
|
+
input: any;
|
|
16
|
+
column: AdaptableColumn<any>;
|
|
17
|
+
api: AdaptableApi;
|
|
18
|
+
}): string;
|
|
19
|
+
export declare const FormatContentHelper: {
|
|
20
|
+
resolvePlaceholders: typeof resolvePlaceholders;
|
|
21
|
+
};
|
|
6
22
|
declare const _default: {
|
|
7
23
|
NumberFormatter: typeof NumberFormatter;
|
|
8
24
|
DateFormatter: typeof DateFormatter;
|
|
9
25
|
StringFormatter: typeof StringFormatter;
|
|
26
|
+
FormatContentHelper: {
|
|
27
|
+
resolvePlaceholders: typeof resolvePlaceholders;
|
|
28
|
+
};
|
|
10
29
|
};
|
|
11
30
|
export default _default;
|
|
@@ -3,18 +3,33 @@
|
|
|
3
3
|
import dateFnsFormat from 'date-fns/format';
|
|
4
4
|
import { sentenceCase } from 'sentence-case';
|
|
5
5
|
import { DEFAULT_DATE_FORMAT_PATTERN } from '../Constants/GeneralConstants';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import Helper from '../../Utilities/Helpers/Helper';
|
|
7
|
+
/*
|
|
8
|
+
export function Format(input: any, format: AdaptableFormat) {
|
|
9
|
+
if (format.Formatter === 'NumberFormatter') {
|
|
10
|
+
return NumberFormatter(input, format.Options);
|
|
11
|
+
}
|
|
12
|
+
if (format.Formatter === 'DateFormatter') {
|
|
13
|
+
return DateFormatter(input, format.Options);
|
|
14
|
+
}
|
|
15
|
+
throw new Error('Unknown formatter');
|
|
16
|
+
}
|
|
17
|
+
*/
|
|
18
|
+
export function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
19
|
+
var _a;
|
|
20
|
+
let preparedInput;
|
|
21
|
+
if (options.Content) {
|
|
22
|
+
const context = {
|
|
23
|
+
column,
|
|
24
|
+
rowNode,
|
|
25
|
+
input,
|
|
26
|
+
api,
|
|
27
|
+
};
|
|
28
|
+
preparedInput = FormatContentHelper.resolvePlaceholders(options.Content.toString(), context);
|
|
9
29
|
}
|
|
10
|
-
|
|
11
|
-
|
|
30
|
+
else {
|
|
31
|
+
preparedInput = input;
|
|
12
32
|
}
|
|
13
|
-
throw new Error('Unknown formatter');
|
|
14
|
-
}
|
|
15
|
-
export function NumberFormatter(input, options = {}) {
|
|
16
|
-
var _a, _b;
|
|
17
|
-
let preparedInput = (_a = options.Content) !== null && _a !== void 0 ? _a : input;
|
|
18
33
|
if (preparedInput == null || preparedInput == undefined) {
|
|
19
34
|
return undefined;
|
|
20
35
|
}
|
|
@@ -66,7 +81,7 @@ export function NumberFormatter(input, options = {}) {
|
|
|
66
81
|
digitsToUse = options.FractionDigits;
|
|
67
82
|
}
|
|
68
83
|
else {
|
|
69
|
-
let decimalCount = Math.floor(n) === n ? 0 : ((
|
|
84
|
+
let decimalCount = Math.floor(n) === n ? 0 : ((_a = n.toString().split(fractionsSepatator)[1]) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
70
85
|
digitsToUse = decimalCount;
|
|
71
86
|
}
|
|
72
87
|
s = n.toLocaleString('en-US', {
|
|
@@ -107,8 +122,20 @@ export function DateFormatter(input, options, strictFormatting = false) {
|
|
|
107
122
|
return input;
|
|
108
123
|
}
|
|
109
124
|
}
|
|
110
|
-
export function StringFormatter(input, options = {}) {
|
|
111
|
-
let preparedInput
|
|
125
|
+
export function StringFormatter(input, options = {}, rowNode, column, api) {
|
|
126
|
+
let preparedInput;
|
|
127
|
+
if (options.Content) {
|
|
128
|
+
const context = {
|
|
129
|
+
column,
|
|
130
|
+
rowNode,
|
|
131
|
+
input,
|
|
132
|
+
api,
|
|
133
|
+
};
|
|
134
|
+
preparedInput = FormatContentHelper.resolvePlaceholders(options.Content, context);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
preparedInput = input;
|
|
138
|
+
}
|
|
112
139
|
if (preparedInput == null || preparedInput == undefined) {
|
|
113
140
|
return undefined;
|
|
114
141
|
}
|
|
@@ -138,4 +165,36 @@ export function StringFormatter(input, options = {}) {
|
|
|
138
165
|
}
|
|
139
166
|
return s;
|
|
140
167
|
}
|
|
141
|
-
|
|
168
|
+
/**
|
|
169
|
+
* Supported tokens:
|
|
170
|
+
* - column -> [column]
|
|
171
|
+
* - input -> [value]
|
|
172
|
+
* - rowData.colId -> [rowData.colId]
|
|
173
|
+
*/
|
|
174
|
+
export function resolvePlaceholders(text, context) {
|
|
175
|
+
if (!text) {
|
|
176
|
+
return text;
|
|
177
|
+
}
|
|
178
|
+
if (!context) {
|
|
179
|
+
return text;
|
|
180
|
+
}
|
|
181
|
+
if (context === null || context === void 0 ? void 0 : context.input) {
|
|
182
|
+
text = Helper.replaceAll(text, '[value]', context.input);
|
|
183
|
+
}
|
|
184
|
+
if (context === null || context === void 0 ? void 0 : context.column) {
|
|
185
|
+
text = Helper.replaceAll(text, '[column]', context.api.columnApi.getFriendlyNameForColumnId(context.column.columnId));
|
|
186
|
+
}
|
|
187
|
+
if (context === null || context === void 0 ? void 0 : context.rowNode) {
|
|
188
|
+
const columns = Helper.extractColsFromText(text);
|
|
189
|
+
for (const column of columns) {
|
|
190
|
+
if (context.api.columnApi.getColumnWithColumnId(column)) {
|
|
191
|
+
text = Helper.replaceAll(text, `[rowData.${column}]`, context.api.gridApi.getRawValueFromRowNode(context.rowNode, column));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return text;
|
|
196
|
+
}
|
|
197
|
+
export const FormatContentHelper = {
|
|
198
|
+
resolvePlaceholders,
|
|
199
|
+
};
|
|
200
|
+
export default { NumberFormatter, DateFormatter, StringFormatter, FormatContentHelper };
|
|
@@ -18,6 +18,9 @@ export declare function meanNumberArray(numericValues: number[]): number;
|
|
|
18
18
|
export declare function medianNumberArray(numericValues: number[]): number;
|
|
19
19
|
export declare function modeNumberArray(numbers: number[]): number;
|
|
20
20
|
export declare function clamp(value: any, boundOne: number, boundTwo: number): number;
|
|
21
|
+
export declare function extractColsFromText(text: string): string[];
|
|
22
|
+
export declare function replaceAll(text: string, toReplace: string, replaceWith: string): string;
|
|
23
|
+
export declare function extractContextKeysFromText(text: string): string[];
|
|
21
24
|
export declare const Helper: {
|
|
22
25
|
objectExists: typeof objectExists;
|
|
23
26
|
objectNotExists: typeof objectNotExists;
|
|
@@ -38,5 +41,8 @@ export declare const Helper: {
|
|
|
38
41
|
medianNumberArray: typeof medianNumberArray;
|
|
39
42
|
modeNumberArray: typeof modeNumberArray;
|
|
40
43
|
clamp: typeof clamp;
|
|
44
|
+
extractColsFromText: typeof extractColsFromText;
|
|
45
|
+
replaceAll: typeof replaceAll;
|
|
46
|
+
extractContextKeysFromText: typeof extractContextKeysFromText;
|
|
41
47
|
};
|
|
42
48
|
export default Helper;
|
|
@@ -227,6 +227,34 @@ export function clamp(value, boundOne, boundTwo) {
|
|
|
227
227
|
}
|
|
228
228
|
return value;
|
|
229
229
|
}
|
|
230
|
+
export function extractColsFromText(text) {
|
|
231
|
+
// rowData.columnName => columnName
|
|
232
|
+
const regex = /\[rowData\.(.*?)\]/g;
|
|
233
|
+
let m;
|
|
234
|
+
const cols = [];
|
|
235
|
+
while ((m = regex.exec(text)) !== null) {
|
|
236
|
+
cols.push(m[1]);
|
|
237
|
+
}
|
|
238
|
+
return cols;
|
|
239
|
+
}
|
|
240
|
+
export function replaceAll(text, toReplace, replaceWith) {
|
|
241
|
+
if (!text) {
|
|
242
|
+
return text;
|
|
243
|
+
}
|
|
244
|
+
// fails for []
|
|
245
|
+
toReplace = toReplace.replace('[', '\\[').replace(']', '\\]');
|
|
246
|
+
return text.replace(new RegExp(toReplace, 'g'), replaceWith);
|
|
247
|
+
}
|
|
248
|
+
export function extractContextKeysFromText(text) {
|
|
249
|
+
// context.columnName => columnName
|
|
250
|
+
const regex = /\[context\.(.*?)\]/g;
|
|
251
|
+
let m;
|
|
252
|
+
const contextKeys = [];
|
|
253
|
+
while ((m = regex.exec(text)) !== null) {
|
|
254
|
+
contextKeys.push(m[1]);
|
|
255
|
+
}
|
|
256
|
+
return contextKeys;
|
|
257
|
+
}
|
|
230
258
|
export const Helper = {
|
|
231
259
|
objectExists,
|
|
232
260
|
objectNotExists,
|
|
@@ -247,5 +275,8 @@ export const Helper = {
|
|
|
247
275
|
medianNumberArray,
|
|
248
276
|
modeNumberArray,
|
|
249
277
|
clamp,
|
|
278
|
+
extractColsFromText,
|
|
279
|
+
replaceAll,
|
|
280
|
+
extractContextKeysFromText,
|
|
250
281
|
};
|
|
251
282
|
export default Helper;
|
|
@@ -17,6 +17,7 @@ import { useAdaptable } from '../../AdaptableContext';
|
|
|
17
17
|
import FormatHelper from '../../../Utilities/Helpers/FormatHelper';
|
|
18
18
|
import { Toggle, ToggleGroup } from '../../../components/Toggle';
|
|
19
19
|
import { DEFAULT_DOUBLE_DISPLAY_VALUE, DEFAULT_STRING_DISPLAY_VALUE, } from '../../../Utilities/Constants/GeneralConstants';
|
|
20
|
+
import Textarea from '../../../components/Textarea';
|
|
20
21
|
const DOLLAR_OPTIONS = {
|
|
21
22
|
FractionDigits: 2,
|
|
22
23
|
FractionSeparator: '.',
|
|
@@ -369,7 +370,10 @@ const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormat
|
|
|
369
370
|
React.createElement(FormRow, { label: "Suffix" },
|
|
370
371
|
React.createElement(Input, { "data-name": "suffix", value: (_b = data.DisplayFormat.Options.Suffix) !== null && _b !== void 0 ? _b : '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
|
|
371
372
|
React.createElement(FormRow, { label: "Content" },
|
|
372
|
-
React.createElement(
|
|
373
|
+
React.createElement(Textarea, { minWidth: 300, rows: 3, placeholder: "use defaults", marginTop: 2, type: 'text', autoFocus: false, value: (_c = data.DisplayFormat.Options.Content) !== null && _c !== void 0 ? _c : '',
|
|
374
|
+
// placeholder="defaults to column name"
|
|
375
|
+
// onChange={(e: any) => onMessageHeaderChange(e)}
|
|
376
|
+
onChange: (e) => setFormatOption('Content', e.currentTarget.value) })),
|
|
373
377
|
React.createElement(FormRow, { label: "Empty" },
|
|
374
378
|
React.createElement(CheckBox, { "data-name": "empty-checkbox", checked: data.DisplayFormat.Options.Empty, onChange: (checked) => setFormatOption('Empty', checked) })))))),
|
|
375
379
|
scopedCustomFormatters.length > 0 && (React.createElement(Tabs, { marginTop: 2, keyboardNavigation: false },
|
|
@@ -243,7 +243,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
243
243
|
private getDistinctGridCellsForColumn;
|
|
244
244
|
private addDistinctColumnValue;
|
|
245
245
|
private getUniqueGridCells;
|
|
246
|
-
getGridCellsForColumn(columnId: string,
|
|
246
|
+
getGridCellsForColumn(columnId: string, onlyVisibleRows?: boolean): GridCell[] | undefined;
|
|
247
247
|
getRowNodesForPrimaryKeys(primaryKeyValues: any[]): any[];
|
|
248
248
|
getRowNodeByIndex(index: number): IRowNode;
|
|
249
249
|
getAgGridStatusPanels(): import("@ag-grid-community/core").StatusPanelDef[];
|
|
@@ -276,6 +276,7 @@ export class AdaptableAgGrid {
|
|
|
276
276
|
this.adaptableOptions = this.normalizeAdaptableOptions(this.adaptableOptions);
|
|
277
277
|
const { showLoadingScreen, loadingScreenDelay, loadingScreenText, loadingScreenTitle } = this.adaptableOptions.userInterfaceOptions;
|
|
278
278
|
if (showLoadingScreen) {
|
|
279
|
+
this.logger.info(`Show Loading Screen`);
|
|
279
280
|
const portalElement = ensurePortalElement();
|
|
280
281
|
if (portalElement) {
|
|
281
282
|
this.unmountLoadingScreen = this.renderReactRoot(createElement(AdaptableLoadingScreen, {
|
|
@@ -285,6 +286,9 @@ export class AdaptableAgGrid {
|
|
|
285
286
|
loadingScreenTitle,
|
|
286
287
|
}), portalElement);
|
|
287
288
|
}
|
|
289
|
+
else {
|
|
290
|
+
this.logger.consoleError(`Adaptable failed to show the loading screen!`);
|
|
291
|
+
}
|
|
288
292
|
}
|
|
289
293
|
this.forPlugins((plugin) => plugin.afterInitOptions(this, this.adaptableOptions));
|
|
290
294
|
this.api = new AdaptableApiImpl(this);
|
|
@@ -350,6 +354,7 @@ export class AdaptableAgGrid {
|
|
|
350
354
|
this.logger.consoleError(`Adaptable failed to initialize AG Grid!`);
|
|
351
355
|
return Promise.reject('Adaptable failed to initialize AG Grid!');
|
|
352
356
|
}
|
|
357
|
+
this.logger.info(`Hide Loading Screen`);
|
|
353
358
|
(_b = this.unmountLoadingScreen) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
354
359
|
perfInitAgGrid.end();
|
|
355
360
|
// we need to intercept several AG Grid Api methods and trigger Adaptale state changes
|
|
@@ -2356,17 +2361,12 @@ export class AdaptableAgGrid {
|
|
|
2356
2361
|
}
|
|
2357
2362
|
return uniqueVals.slice(0, this.api.columnFilterApi.internalApi.getFilterValuesMaxNumberOfItems(column));
|
|
2358
2363
|
}
|
|
2359
|
-
getGridCellsForColumn(columnId,
|
|
2364
|
+
getGridCellsForColumn(columnId, onlyVisibleRows = false) {
|
|
2360
2365
|
let returnValues = [];
|
|
2361
2366
|
const handler = (rowNode) => {
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
if (gridCell.rawValue
|
|
2365
|
-
if (includeBlanks) {
|
|
2366
|
-
returnValues.push(gridCell);
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
|
-
else {
|
|
2367
|
+
if (!this.isGroupRowNode(rowNode)) {
|
|
2368
|
+
const gridCell = this.getGridCellFromRowNode(rowNode, columnId);
|
|
2369
|
+
if (gridCell && gridCell.rawValue !== undefined && gridCell.rawValue !== null) {
|
|
2370
2370
|
returnValues.push(gridCell);
|
|
2371
2371
|
}
|
|
2372
2372
|
}
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "18.1.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1720529546809 || Date.now(),
|
|
4
|
+
VERSION: "18.1.8" || '--current-version--',
|
|
5
5
|
};
|