@adaptabletools/adaptable-cjs 18.1.7 → 18.1.9
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 +2 -1
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +4 -0
- package/src/Api/DataChangeHistoryApi.d.ts +6 -0
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +2 -0
- package/src/Api/Implementation/DataChangeHistoryApiImpl.js +23 -2
- 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 +13 -7
- package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +9 -9
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +9 -8
- package/src/Redux/ActionsReducers/SystemRedux.js +11 -11
- package/src/Strategy/DataChangeHistoryModule.js +1 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -1
- package/src/Utilities/Helpers/FormatContentHelper.d.ts +22 -0
- package/src/Utilities/Helpers/FormatContentHelper.js +39 -0
- package/src/Utilities/Helpers/FormatHelper.d.ts +5 -4
- package/src/Utilities/Helpers/FormatHelper.js +41 -15
- package/src/Utilities/Helpers/Helper.d.ts +6 -0
- package/src/Utilities/Helpers/Helper.js +35 -1
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +4 -3
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +33 -10
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -1
- package/src/agGrid/AdaptableAgGrid.js +29 -8
- package/src/agGrid/AgGridMenuAdapter.js +15 -1
- package/src/agGrid/defaultAdaptableOptions.js +1 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +8 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StringFormatter = exports.DateFormatter = exports.NumberFormatter =
|
|
3
|
+
exports.StringFormatter = exports.DateFormatter = exports.NumberFormatter = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
// TODO inspect why the following is erroring on angular build
|
|
6
6
|
// import dateFnsFormat from 'date-fns/format';
|
|
7
7
|
const format_1 = tslib_1.__importDefault(require("date-fns/format"));
|
|
8
8
|
const sentence_case_1 = require("sentence-case");
|
|
9
9
|
const GeneralConstants_1 = require("../Constants/GeneralConstants");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const FormatContentHelper_1 = tslib_1.__importDefault(require("./FormatContentHelper"));
|
|
11
|
+
/*
|
|
12
|
+
export function Format(input: any, format: AdaptableFormat) {
|
|
13
|
+
if (format.Formatter === 'NumberFormatter') {
|
|
14
|
+
return NumberFormatter(input, format.Options);
|
|
15
|
+
}
|
|
16
|
+
if (format.Formatter === 'DateFormatter') {
|
|
17
|
+
return DateFormatter(input, format.Options);
|
|
18
|
+
}
|
|
19
|
+
throw new Error('Unknown formatter');
|
|
20
|
+
}
|
|
21
|
+
*/
|
|
22
|
+
function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
23
|
+
var _a;
|
|
24
|
+
let preparedInput;
|
|
25
|
+
if (options.Content) {
|
|
26
|
+
const context = {
|
|
27
|
+
column,
|
|
28
|
+
rowNode,
|
|
29
|
+
input,
|
|
30
|
+
api,
|
|
31
|
+
};
|
|
32
|
+
preparedInput = FormatContentHelper_1.default.resolvePlaceholders(options.Content.toString(), context);
|
|
13
33
|
}
|
|
14
|
-
|
|
15
|
-
|
|
34
|
+
else {
|
|
35
|
+
preparedInput = input;
|
|
16
36
|
}
|
|
17
|
-
throw new Error('Unknown formatter');
|
|
18
|
-
}
|
|
19
|
-
exports.Format = Format;
|
|
20
|
-
function NumberFormatter(input, options = {}) {
|
|
21
|
-
var _a, _b;
|
|
22
|
-
let preparedInput = (_a = options.Content) !== null && _a !== void 0 ? _a : input;
|
|
23
37
|
if (preparedInput == null || preparedInput == undefined) {
|
|
24
38
|
return undefined;
|
|
25
39
|
}
|
|
@@ -71,7 +85,7 @@ function NumberFormatter(input, options = {}) {
|
|
|
71
85
|
digitsToUse = options.FractionDigits;
|
|
72
86
|
}
|
|
73
87
|
else {
|
|
74
|
-
let decimalCount = Math.floor(n) === n ? 0 : ((
|
|
88
|
+
let decimalCount = Math.floor(n) === n ? 0 : ((_a = n.toString().split(fractionsSepatator)[1]) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
75
89
|
digitsToUse = decimalCount;
|
|
76
90
|
}
|
|
77
91
|
s = n.toLocaleString('en-US', {
|
|
@@ -114,8 +128,20 @@ function DateFormatter(input, options, strictFormatting = false) {
|
|
|
114
128
|
}
|
|
115
129
|
}
|
|
116
130
|
exports.DateFormatter = DateFormatter;
|
|
117
|
-
function StringFormatter(input, options = {}) {
|
|
118
|
-
let preparedInput
|
|
131
|
+
function StringFormatter(input, options = {}, rowNode, column, api) {
|
|
132
|
+
let preparedInput;
|
|
133
|
+
if (options.Content) {
|
|
134
|
+
const context = {
|
|
135
|
+
column,
|
|
136
|
+
rowNode,
|
|
137
|
+
input,
|
|
138
|
+
api,
|
|
139
|
+
};
|
|
140
|
+
preparedInput = FormatContentHelper_1.default.resolvePlaceholders(options.Content, context);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
preparedInput = input;
|
|
144
|
+
}
|
|
119
145
|
if (preparedInput == null || preparedInput == undefined) {
|
|
120
146
|
return undefined;
|
|
121
147
|
}
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Helper = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectHasKeys = exports.objectNotExists = exports.objectExists = void 0;
|
|
3
|
+
exports.Helper = exports.extractContextKeysFromText = exports.replaceAll = exports.extractColsFromText = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectHasKeys = exports.objectNotExists = exports.objectExists = void 0;
|
|
4
4
|
const StringExtensions_1 = require("../Extensions/StringExtensions");
|
|
5
5
|
const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
|
|
6
6
|
function objectExists(item) {
|
|
@@ -250,6 +250,37 @@ function clamp(value, boundOne, boundTwo) {
|
|
|
250
250
|
return value;
|
|
251
251
|
}
|
|
252
252
|
exports.clamp = clamp;
|
|
253
|
+
function extractColsFromText(text) {
|
|
254
|
+
// rowData.columnName => columnName
|
|
255
|
+
const regex = /\[rowData\.(.*?)\]/g;
|
|
256
|
+
let m;
|
|
257
|
+
const cols = [];
|
|
258
|
+
while ((m = regex.exec(text)) !== null) {
|
|
259
|
+
cols.push(m[1]);
|
|
260
|
+
}
|
|
261
|
+
return cols;
|
|
262
|
+
}
|
|
263
|
+
exports.extractColsFromText = extractColsFromText;
|
|
264
|
+
function replaceAll(text, toReplace, replaceWith) {
|
|
265
|
+
if (!text) {
|
|
266
|
+
return text;
|
|
267
|
+
}
|
|
268
|
+
// fails for []
|
|
269
|
+
toReplace = toReplace.replace('[', '\\[').replace(']', '\\]');
|
|
270
|
+
return text.replace(new RegExp(toReplace, 'g'), replaceWith);
|
|
271
|
+
}
|
|
272
|
+
exports.replaceAll = replaceAll;
|
|
273
|
+
function extractContextKeysFromText(text) {
|
|
274
|
+
// context.columnName => columnName
|
|
275
|
+
const regex = /\[context\.(.*?)\]/g;
|
|
276
|
+
let m;
|
|
277
|
+
const contextKeys = [];
|
|
278
|
+
while ((m = regex.exec(text)) !== null) {
|
|
279
|
+
contextKeys.push(m[1]);
|
|
280
|
+
}
|
|
281
|
+
return contextKeys;
|
|
282
|
+
}
|
|
283
|
+
exports.extractContextKeysFromText = extractContextKeysFromText;
|
|
253
284
|
exports.Helper = {
|
|
254
285
|
objectExists,
|
|
255
286
|
objectNotExists,
|
|
@@ -270,5 +301,8 @@ exports.Helper = {
|
|
|
270
301
|
medianNumberArray,
|
|
271
302
|
modeNumberArray,
|
|
272
303
|
clamp,
|
|
304
|
+
extractColsFromText,
|
|
305
|
+
replaceAll,
|
|
306
|
+
extractContextKeysFromText,
|
|
273
307
|
};
|
|
274
308
|
exports.default = exports.Helper;
|
|
@@ -25,6 +25,7 @@ const AlertMessageWizardSection = (props) => {
|
|
|
25
25
|
const messageType = data.MessageType;
|
|
26
26
|
const messageText = api.alertApi.internalApi.getAlertDescriptionForDataChange(data);
|
|
27
27
|
const messageHeader = data.MessageHeader;
|
|
28
|
+
const showDocumentationLinks = api.internalApi.isDocumentationLinksDisplayed();
|
|
28
29
|
const onMessageTextChange = (e) => {
|
|
29
30
|
const { value } = e.target;
|
|
30
31
|
props.onChange(Object.assign(Object.assign({}, data), { MessageText: value }));
|
|
@@ -47,7 +48,7 @@ const AlertMessageWizardSection = (props) => {
|
|
|
47
48
|
React.createElement(Tabs_1.Tabs, { "data-name": "message-text", mt: 2, mb: 3, autoFocus: false },
|
|
48
49
|
React.createElement(Tabs_1.Tabs.Tab, null, "Message Text"),
|
|
49
50
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
50
|
-
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "
|
|
51
|
+
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "Text to display as the Alert Message (leave blank to show automated Message based on Alert Type)"),
|
|
51
52
|
' ',
|
|
52
53
|
React.createElement(FormLayout_1.default, null,
|
|
53
54
|
React.createElement(FormLayout_1.FormRow, { label: "Header" },
|
|
@@ -56,11 +57,11 @@ const AlertMessageWizardSection = (props) => {
|
|
|
56
57
|
onChange: (e) => onMessageHeaderChange(e) })),
|
|
57
58
|
React.createElement(FormLayout_1.FormRow, { label: "Message" },
|
|
58
59
|
React.createElement(Textarea_1.default, { minWidth: 300, rows: 3, marginTop: 2, type: 'text', autoFocus: false, value: messageText !== null && messageText !== void 0 ? messageText : '', onChange: (e) => onMessageTextChange(e) }))),
|
|
59
|
-
React.createElement(HelpBlock_1.default, { "data-name": "alert-message-documentation", mt: 3, mb: 2, style: {
|
|
60
|
+
showDocumentationLinks && (React.createElement(HelpBlock_1.default, { "data-name": "alert-message-documentation", mt: 3, mb: 2, style: {
|
|
60
61
|
fontSize: 'var(--ab-font-size-3)',
|
|
61
62
|
padding: 0,
|
|
62
63
|
} },
|
|
63
64
|
React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2, onClick: () => window.open(DocumentationLinkConstants_1.AlertMessageDocsLink, '_blank') }),
|
|
64
|
-
"See
|
|
65
|
+
"See how to create dynamic Alert Messages using placeholders"))))));
|
|
65
66
|
};
|
|
66
67
|
exports.AlertMessageWizardSection = AlertMessageWizardSection;
|
|
@@ -21,6 +21,9 @@ const AdaptableContext_1 = require("../../AdaptableContext");
|
|
|
21
21
|
const FormatHelper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/FormatHelper"));
|
|
22
22
|
const Toggle_1 = require("../../../components/Toggle");
|
|
23
23
|
const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
|
|
24
|
+
const Textarea_1 = tslib_1.__importDefault(require("../../../components/Textarea"));
|
|
25
|
+
const ButtonInfo_1 = require("../../Components/Buttons/ButtonInfo");
|
|
26
|
+
const DocumentationLinkConstants_1 = require("../../../Utilities/Constants/DocumentationLinkConstants");
|
|
24
27
|
const DOLLAR_OPTIONS = {
|
|
25
28
|
FractionDigits: 2,
|
|
26
29
|
FractionSeparator: '.',
|
|
@@ -208,8 +211,8 @@ const renderDateFormat = (data, _onChange, setFormatOption, scopedCustomFormatte
|
|
|
208
211
|
},
|
|
209
212
|
] })))))));
|
|
210
213
|
};
|
|
211
|
-
const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatters,
|
|
212
|
-
var _a, _b, _c, _d, _e;
|
|
214
|
+
const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatters, api) => {
|
|
215
|
+
var _a, _b, _c, _d, _e, _f;
|
|
213
216
|
if (data.DisplayFormat.Formatter !== 'NumberFormatter') {
|
|
214
217
|
return null;
|
|
215
218
|
}
|
|
@@ -261,6 +264,7 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
261
264
|
data.DisplayFormat.Options.Multiplier === MILLION_OPTIONS.Multiplier; //isEqual(data.DisplayFormat.Options, MILLION_OPTIONS);
|
|
262
265
|
const IS_DOLLAR = data.DisplayFormat.Options.Prefix === '$'; //isEqual(data.DisplayFormat.Options, DOLLAR_OPTIONS);
|
|
263
266
|
const IS_STERLING = data.DisplayFormat.Options.Prefix === '£'; //isEqual(data.DisplayFormat, STERLING_OPTIONS);
|
|
267
|
+
const showDocumentationLinks = api.internalApi.isDocumentationLinksDisplayed();
|
|
264
268
|
return (React.createElement(rebass_1.Box, { "data-name": 'format-column-display-format', padding: 2 },
|
|
265
269
|
React.createElement(Tabs_1.Tabs, null,
|
|
266
270
|
React.createElement(Tabs_1.Tabs.Tab, null, "Format"),
|
|
@@ -268,7 +272,8 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
268
272
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
269
273
|
React.createElement(FormLayout_1.default, { mr: 3 },
|
|
270
274
|
React.createElement(FormLayout_1.FormRow, { label: "Fraction Separator" },
|
|
271
|
-
React.createElement(Input_1.default, { "data-name": "fraction-separator", value: (_a = data.DisplayFormat.Options.FractionSeparator) !== null && _a !== void 0 ? _a : '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) })
|
|
275
|
+
React.createElement(Input_1.default, { "data-name": "fraction-separator", value: (_a = data.DisplayFormat.Options.FractionSeparator) !== null && _a !== void 0 ? _a : '', onChange: (e) => setFormatOption('FractionSeparator', e.currentTarget.value) }),
|
|
276
|
+
' '),
|
|
272
277
|
React.createElement(FormLayout_1.FormRow, { label: "Integer Separator" },
|
|
273
278
|
React.createElement(Input_1.default, { "data-name": "integer-separator", value: (_b = data.DisplayFormat.Options.IntegerSeparator) !== null && _b !== void 0 ? _b : '', onChange: (e) => setFormatOption('IntegerSeparator', e.currentTarget.value) })),
|
|
274
279
|
React.createElement(FormLayout_1.FormRow, { label: "Prefix" },
|
|
@@ -298,9 +303,6 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
298
303
|
React.createElement(FormLayout_1.FormRow, { label: "Multiplier" },
|
|
299
304
|
React.createElement(Input_1.default, { "data-name": "multiplier", type: "number", value: data.DisplayFormat.Options.Multiplier, onChange: (e) => setFormatOption('Multiplier', Number(e.currentTarget.value)) })),
|
|
300
305
|
' ',
|
|
301
|
-
React.createElement(FormLayout_1.FormRow, { label: "Content" },
|
|
302
|
-
React.createElement(Input_1.default, { "data-name": "content", value: (_e = data.DisplayFormat.Options.Content) !== null && _e !== void 0 ? _e : '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) })),
|
|
303
|
-
' ',
|
|
304
306
|
React.createElement(FormLayout_1.FormRow, { label: "Parentheses" },
|
|
305
307
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "parentheses-checkbox", checked: data.DisplayFormat.Options.Parentheses, onChange: (checked) => setFormatOption('Parentheses', checked) })),
|
|
306
308
|
React.createElement(FormLayout_1.FormRow, { label: "Floor" },
|
|
@@ -324,6 +326,20 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
324
326
|
React.createElement(Radio_1.default, { "data-name": "preset-million", marginLeft: 3, checked: IS_MILLION, onChange: () => setDivideMillionPreset() }, "M (Million)"),
|
|
325
327
|
React.createElement(Radio_1.default, { "data-name": "preset-dollar", marginLeft: 3, checked: IS_DOLLAR, onChange: () => setDollarPreset() }, "Dollar"),
|
|
326
328
|
React.createElement(Radio_1.default, { "data-name": "preset-sterling", marginLeft: 3, checked: IS_STERLING, onChange: () => setSterlingPreset() }, "Sterling")))))),
|
|
329
|
+
React.createElement(Tabs_1.Tabs, { marginTop: 2, autoFocus: false, keyboardNavigation: false },
|
|
330
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Dynamic Content"),
|
|
331
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
332
|
+
React.createElement(rebass_1.Text, { padding: 2, fontSize: 2 }, "Provide dynamic content through the use of Placeholders"),
|
|
333
|
+
React.createElement(FormLayout_1.default, { margin: 2 },
|
|
334
|
+
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
335
|
+
React.createElement(Textarea_1.default, { minWidth: 300, rows: 3, placeholder: "", marginTop: 2, type: 'text', autoFocus: false, value: (_f = (_e = data.DisplayFormat.Options.Content) === null || _e === void 0 ? void 0 : _e.toString()) !== null && _f !== void 0 ? _f : '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) }),
|
|
336
|
+
showDocumentationLinks && (React.createElement(HelpBlock_1.default, { "data-name": "query-documentation", mt: 3, mb: 2, style: {
|
|
337
|
+
fontSize: 'var(--ab-font-size-3)',
|
|
338
|
+
padding: 0,
|
|
339
|
+
} },
|
|
340
|
+
React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2, onClick: () => window.open(DocumentationLinkConstants_1.FormatColumnPlaceholderDocsLink, '_blank') }),
|
|
341
|
+
"Learn more about using placeholders"))),
|
|
342
|
+
' '))),
|
|
327
343
|
React.createElement(Tabs_1.Tabs, { marginTop: 2, autoFocus: false, keyboardNavigation: false },
|
|
328
344
|
React.createElement(Tabs_1.Tabs.Tab, null, "Examples"),
|
|
329
345
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -353,11 +369,12 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
|
|
|
353
369
|
},
|
|
354
370
|
] })))));
|
|
355
371
|
};
|
|
356
|
-
const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormatters,
|
|
372
|
+
const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormatters, api) => {
|
|
357
373
|
var _a, _b, _c;
|
|
358
374
|
if (data.DisplayFormat.Formatter !== 'StringFormatter') {
|
|
359
375
|
return null;
|
|
360
376
|
}
|
|
377
|
+
const showDocumentationLinks = api.internalApi.isDocumentationLinksDisplayed();
|
|
361
378
|
return (React.createElement(rebass_1.Box, { "data-name": 'format-column-display-format', padding: 2 },
|
|
362
379
|
React.createElement(Tabs_1.Tabs, null,
|
|
363
380
|
React.createElement(Tabs_1.Tabs.Tab, null, "Format"),
|
|
@@ -376,7 +393,13 @@ const renderStringFormat = (data, _onChange, setFormatOption, scopedCustomFormat
|
|
|
376
393
|
React.createElement(FormLayout_1.FormRow, { label: "Suffix" },
|
|
377
394
|
React.createElement(Input_1.default, { "data-name": "suffix", value: (_b = data.DisplayFormat.Options.Suffix) !== null && _b !== void 0 ? _b : '', onChange: (e) => setFormatOption('Suffix', e.currentTarget.value) })),
|
|
378
395
|
React.createElement(FormLayout_1.FormRow, { label: "Content" },
|
|
379
|
-
React.createElement(
|
|
396
|
+
React.createElement(Textarea_1.default, { minWidth: 300, rows: 3, placeholder: "", marginTop: 2, type: 'text', autoFocus: false, value: (_c = data.DisplayFormat.Options.Content) !== null && _c !== void 0 ? _c : '', onChange: (e) => setFormatOption('Content', e.currentTarget.value) }),
|
|
397
|
+
showDocumentationLinks && (React.createElement(HelpBlock_1.default, { "data-name": "query-documentation", mt: 3, mb: 2, style: {
|
|
398
|
+
fontSize: 'var(--ab-font-size-3)',
|
|
399
|
+
padding: 0,
|
|
400
|
+
} },
|
|
401
|
+
React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2, onClick: () => window.open(DocumentationLinkConstants_1.FormatColumnPlaceholderDocsLink, '_blank') }),
|
|
402
|
+
"See how to create dynamic Display Format using placeholders"))),
|
|
380
403
|
React.createElement(FormLayout_1.FormRow, { label: "Empty" },
|
|
381
404
|
React.createElement(CheckBox_1.CheckBox, { "data-name": "empty-checkbox", checked: data.DisplayFormat.Options.Empty, onChange: (checked) => setFormatOption('Empty', checked) })))))),
|
|
382
405
|
scopedCustomFormatters.length > 0 && (React.createElement(Tabs_1.Tabs, { marginTop: 2, keyboardNavigation: false },
|
|
@@ -419,13 +442,13 @@ const FormatColumnFormatWizardSection = (props) => {
|
|
|
419
442
|
const Type = data.DisplayFormat && data.DisplayFormat.Formatter;
|
|
420
443
|
const customScopedFormatters = customDisplayFormatters.filter((displayFormatter) => adaptable.api.columnScopeApi.isScopeInScope(data.Scope, displayFormatter.scope));
|
|
421
444
|
if (Type === 'NumberFormatter') {
|
|
422
|
-
return renderNumberFormat(data, update, setFormatOption, customScopedFormatters,
|
|
445
|
+
return renderNumberFormat(data, update, setFormatOption, customScopedFormatters, adaptable.api);
|
|
423
446
|
}
|
|
424
447
|
if (Type === 'DateFormatter') {
|
|
425
448
|
return renderDateFormat(data, update, setFormatOption, customScopedFormatters);
|
|
426
449
|
}
|
|
427
450
|
if (Type === 'StringFormatter') {
|
|
428
|
-
return renderStringFormat(data, update, setFormatOption, customScopedFormatters,
|
|
451
|
+
return renderStringFormat(data, update, setFormatOption, customScopedFormatters, adaptable.api);
|
|
429
452
|
}
|
|
430
453
|
return (React.createElement(HelpBlock_1.default, { margin: 3 },
|
|
431
454
|
"Setting a Display Format is only possible if ",
|
|
@@ -243,7 +243,8 @@ 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
|
+
getGridCellsForColumnTemp(columnId: string, onlyVisibleRows: boolean): GridCell[] | undefined;
|
|
247
248
|
getRowNodesForPrimaryKeys(primaryKeyValues: any[]): any[];
|
|
248
249
|
getRowNodeByIndex(index: number): IRowNode;
|
|
249
250
|
getAgGridStatusPanels(): import("@ag-grid-community/core").StatusPanelDef[];
|
|
@@ -280,6 +280,7 @@ class AdaptableAgGrid {
|
|
|
280
280
|
this.adaptableOptions = this.normalizeAdaptableOptions(this.adaptableOptions);
|
|
281
281
|
const { showLoadingScreen, loadingScreenDelay, loadingScreenText, loadingScreenTitle } = this.adaptableOptions.userInterfaceOptions;
|
|
282
282
|
if (showLoadingScreen) {
|
|
283
|
+
this.logger.info(`Show Loading Screen`);
|
|
283
284
|
const portalElement = (0, Modal_1.ensurePortalElement)();
|
|
284
285
|
if (portalElement) {
|
|
285
286
|
this.unmountLoadingScreen = this.renderReactRoot((0, react_1.createElement)(AdaptableLoadingScreen_1.AdaptableLoadingScreen, {
|
|
@@ -289,6 +290,9 @@ class AdaptableAgGrid {
|
|
|
289
290
|
loadingScreenTitle,
|
|
290
291
|
}), portalElement);
|
|
291
292
|
}
|
|
293
|
+
else {
|
|
294
|
+
this.logger.consoleError(`Adaptable failed to show the loading screen!`);
|
|
295
|
+
}
|
|
292
296
|
}
|
|
293
297
|
this.forPlugins((plugin) => plugin.afterInitOptions(this, this.adaptableOptions));
|
|
294
298
|
this.api = new AdaptableApiImpl_1.AdaptableApiImpl(this);
|
|
@@ -354,6 +358,7 @@ class AdaptableAgGrid {
|
|
|
354
358
|
this.logger.consoleError(`Adaptable failed to initialize AG Grid!`);
|
|
355
359
|
return Promise.reject('Adaptable failed to initialize AG Grid!');
|
|
356
360
|
}
|
|
361
|
+
this.logger.info(`Hide Loading Screen`);
|
|
357
362
|
(_b = this.unmountLoadingScreen) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
358
363
|
perfInitAgGrid.end();
|
|
359
364
|
// we need to intercept several AG Grid Api methods and trigger Adaptale state changes
|
|
@@ -2360,17 +2365,33 @@ class AdaptableAgGrid {
|
|
|
2360
2365
|
}
|
|
2361
2366
|
return uniqueVals.slice(0, this.api.columnFilterApi.internalApi.getFilterValuesMaxNumberOfItems(column));
|
|
2362
2367
|
}
|
|
2363
|
-
getGridCellsForColumn(columnId,
|
|
2368
|
+
getGridCellsForColumn(columnId, onlyVisibleRows = false) {
|
|
2364
2369
|
let returnValues = [];
|
|
2365
2370
|
const handler = (rowNode) => {
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
if (gridCell.rawValue
|
|
2369
|
-
|
|
2370
|
-
returnValues.push(gridCell);
|
|
2371
|
-
}
|
|
2371
|
+
if (!this.isGroupRowNode(rowNode)) {
|
|
2372
|
+
const gridCell = this.getGridCellFromRowNode(rowNode, columnId);
|
|
2373
|
+
if (gridCell && gridCell.rawValue !== undefined && gridCell.rawValue !== null) {
|
|
2374
|
+
returnValues.push(gridCell);
|
|
2372
2375
|
}
|
|
2373
|
-
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
if (onlyVisibleRows) {
|
|
2379
|
+
this.agGridAdapter.getAgGridApi().forEachNodeAfterFilter(handler);
|
|
2380
|
+
}
|
|
2381
|
+
else {
|
|
2382
|
+
this.agGridAdapter.getAgGridApi().forEachNode(handler);
|
|
2383
|
+
}
|
|
2384
|
+
return returnValues;
|
|
2385
|
+
}
|
|
2386
|
+
// This horrible method is temporary until we can get rid of having predicates inside values which is coming soon
|
|
2387
|
+
// We need it in case Blanks is requested
|
|
2388
|
+
// once we go to the new multi predicate screen then we wont show blanks any more - which we should never have done
|
|
2389
|
+
getGridCellsForColumnTemp(columnId, onlyVisibleRows) {
|
|
2390
|
+
let returnValues = [];
|
|
2391
|
+
const handler = (rowNode) => {
|
|
2392
|
+
if (!this.isGroupRowNode(rowNode)) {
|
|
2393
|
+
const gridCell = this.getGridCellFromRowNode(rowNode, columnId);
|
|
2394
|
+
if (gridCell) {
|
|
2374
2395
|
returnValues.push(gridCell);
|
|
2375
2396
|
}
|
|
2376
2397
|
}
|
|
@@ -474,6 +474,20 @@ class AgGridMenuAdapter {
|
|
|
474
474
|
...gridInfoMenuItems,
|
|
475
475
|
],
|
|
476
476
|
};
|
|
477
|
+
/*
|
|
478
|
+
const calculatedColumnMenuItem: AdaptableMenuItem = {
|
|
479
|
+
name: 'calculated-column-group',
|
|
480
|
+
label: 'Calculated Column',
|
|
481
|
+
module: 'CalculatedColumn',
|
|
482
|
+
isVisible: true,
|
|
483
|
+
icon: {
|
|
484
|
+
name: 'columns',
|
|
485
|
+
},
|
|
486
|
+
subItems: [
|
|
487
|
+
...calculatedColumnMenuItems,
|
|
488
|
+
],
|
|
489
|
+
};
|
|
490
|
+
*/
|
|
477
491
|
const columnMenuItem = {
|
|
478
492
|
name: 'column-group',
|
|
479
493
|
label: 'Column',
|
|
@@ -484,7 +498,6 @@ class AgGridMenuAdapter {
|
|
|
484
498
|
},
|
|
485
499
|
subItems: [
|
|
486
500
|
...columnActionGroup,
|
|
487
|
-
...calculatedColumnMenuItems,
|
|
488
501
|
...freeTextColumnMenuItems,
|
|
489
502
|
...customSortMenuItems,
|
|
490
503
|
...plusMinusMenuItems,
|
|
@@ -503,6 +516,7 @@ class AgGridMenuAdapter {
|
|
|
503
516
|
subItems: [...formatColumnMenuItems, ...styledColumnMenuItems, ...flashingCellMenuItems],
|
|
504
517
|
};
|
|
505
518
|
return this.removeConsecutiveSeparators([
|
|
519
|
+
...calculatedColumnMenuItems,
|
|
506
520
|
...settingsPanelMenuItems,
|
|
507
521
|
...dashboardMenuItems,
|
|
508
522
|
...columnFilterGroup,
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
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" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "18.1.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1721129487775 || Date.now(),
|
|
6
|
+
VERSION: "18.1.9" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -2751,6 +2751,14 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
2751
2751
|
gridInfo: string;
|
|
2752
2752
|
defVal: string;
|
|
2753
2753
|
noCode?: undefined;
|
|
2754
|
+
} | {
|
|
2755
|
+
name: string;
|
|
2756
|
+
kind: string;
|
|
2757
|
+
desc: string;
|
|
2758
|
+
isOpt: boolean;
|
|
2759
|
+
gridInfo?: undefined;
|
|
2760
|
+
noCode?: undefined;
|
|
2761
|
+
defVal?: undefined;
|
|
2754
2762
|
})[];
|
|
2755
2763
|
};
|
|
2756
2764
|
DataFormatDataType: {
|