@adaptabletools/adaptable-cjs 18.1.6 → 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 +2 -2
- package/src/AdaptableOptions/AdaptableFrameworkComponent.d.ts +3 -4
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +3 -0
- package/src/AdaptableOptions/ExpressionOptions.d.ts +3 -0
- package/src/AdaptableOptions/GridFilterOptions.d.ts +4 -1
- package/src/AdaptableOptions/StateOptions.d.ts +1 -1
- package/src/Api/AdaptableApi.d.ts +1 -4
- package/src/Api/ColumnScopeApi.d.ts +1 -1
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +1 -1
- package/src/Api/Implementation/GridApiImpl.js +1 -1
- package/src/Api/Internal/AlertInternalApi.d.ts +0 -3
- package/src/Api/Internal/AlertInternalApi.js +12 -39
- package/src/Api/Internal/CommentsInternalApi.js +0 -4
- 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/Api/Internal/NoteInternalApi.js +0 -4
- package/src/Api/StatusBarApi.d.ts +5 -5
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Menu.d.ts +6 -0
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/ColumnFilterModule.js +13 -11
- package/src/Strategy/CommentModule.js +3 -0
- package/src/Strategy/NoteModule.js +3 -0
- package/src/Utilities/Helpers/FormatHelper.d.ts +23 -4
- package/src/Utilities/Helpers/FormatHelper.js +75 -16
- package/src/Utilities/Helpers/Helper.d.ts +6 -0
- package/src/Utilities/Helpers/Helper.js +35 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +5 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -2
- package/src/agGrid/AdaptableAgGrid.js +17 -24
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -0
- package/src/components/Select/Select.d.ts +1 -0
- package/src/components/Select/Select.js +8 -2
- package/src/components/icons/index.js +1 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +149 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +25 -4
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
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;
|
|
@@ -247,7 +247,7 @@ export interface IAdaptable {
|
|
|
247
247
|
getAllGridColumns(): Column<any>[];
|
|
248
248
|
clearRowGroupColumns(): void;
|
|
249
249
|
expandAllRowGroups(): void;
|
|
250
|
-
|
|
250
|
+
collapseAllRowGroups(): void;
|
|
251
251
|
expandRowGroupsForValues(columnValues: any[]): void;
|
|
252
252
|
getExpandRowGroupsKeys(): any[];
|
|
253
253
|
getAdaptableContainerElement(): HTMLElement | null;
|
|
@@ -23,14 +23,13 @@ export type AngularFrameworkComponent<T = unknown> = {
|
|
|
23
23
|
/**
|
|
24
24
|
*
|
|
25
25
|
* A function that returns a ReactNode
|
|
26
|
-
* @example
|
|
27
|
-
* ```
|
|
28
|
-
* () => <MyCustomToolbar />
|
|
29
|
-
* ```
|
|
30
26
|
*/
|
|
31
27
|
export type ReactFrameworkComponent = ({ adaptableApi, }: {
|
|
32
28
|
adaptableApi: AdaptableApi;
|
|
33
29
|
}) => ReactElement;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a Vue Component to be used in AdapTable UI controls
|
|
32
|
+
*/
|
|
34
33
|
export type VueFrameworkComponent<Component extends unknown = unknown> = ({ adaptableApi, }: {
|
|
35
34
|
adaptableApi: AdaptableApi;
|
|
36
35
|
}) => Component;
|
|
@@ -301,4 +301,7 @@ export interface ValuesFilterPredicateContext<TData = any> extends BaseContext {
|
|
|
301
301
|
*/
|
|
302
302
|
predicate: ColumnValuesFilterPredicate;
|
|
303
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Predicate used in Column Values Filter
|
|
306
|
+
*/
|
|
304
307
|
export type ColumnValuesFilterPredicate = TypeHint<string, SystemFilterPredicateIds>;
|
|
@@ -197,6 +197,9 @@ export interface ModuleExpressionFunctions {
|
|
|
197
197
|
*/
|
|
198
198
|
systemAggregatedScalarFunctions?: AggregatedScalarFunctionName[] | ((context: GlobalExpressionFunctionsContext<AggregatedScalarFunctionName>) => AggregatedScalarFunctionName[]);
|
|
199
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Context used when providing Fields programatically
|
|
202
|
+
*/
|
|
200
203
|
export interface AdaptableFieldContext extends BaseContext {
|
|
201
204
|
}
|
|
202
205
|
/**
|
|
@@ -16,8 +16,11 @@ export interface GridFilterOptions<TData = any> {
|
|
|
16
16
|
*/
|
|
17
17
|
clearGridFilterOnStartUp?: boolean;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* List of Editors that can create a Grid Filter
|
|
21
|
+
*/
|
|
19
22
|
export type GridFilterEditors = GridFilterEditor[];
|
|
20
23
|
/**
|
|
21
|
-
*
|
|
24
|
+
* Editor to use for Grid Filter: 'ExpressionEditor' or 'QueryBuilder'
|
|
22
25
|
*/
|
|
23
26
|
export type GridFilterEditor = 'ExpressionEditor' | 'QueryBuilder';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdaptableState } from '../PredefinedConfig/AdaptableState';
|
|
2
2
|
/**
|
|
3
|
-
* Options related to Adaptable State hydration/dehydration
|
|
3
|
+
* Options related to Adaptable State hydration / dehydration; allows users to intercept state persistence and loading with custom functionality
|
|
4
4
|
*/
|
|
5
5
|
export interface StateOptions {
|
|
6
6
|
/**
|
|
@@ -50,10 +50,7 @@ import { CommentApi } from './CommentApi';
|
|
|
50
50
|
import { ColumnMenuApi } from './ColumnMenuApi';
|
|
51
51
|
import { ContextMenuApi } from './ContextMenuApi';
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
* The `AdaptableApi` provides developers with run-time access to AdapTable.
|
|
55
|
-
*
|
|
56
|
-
* Has a huge number of classes each dedicated to a specific AdapTable Module or functionality
|
|
53
|
+
* Provides developers with run-time access to AdapTable. Contains many classes each dedicated to a specific AdapTable Module or functionality
|
|
57
54
|
*/
|
|
58
55
|
export interface AdaptableApi {
|
|
59
56
|
/**
|
|
@@ -37,7 +37,7 @@ export interface ColumnScopeApi {
|
|
|
37
37
|
*/
|
|
38
38
|
scopeHasColumnType(scope: ColumnScope): boolean;
|
|
39
39
|
/**
|
|
40
|
-
* True if
|
|
40
|
+
* True if Scope is DataTypes and contains just 'Boolean'
|
|
41
41
|
* @param scope Scope to check
|
|
42
42
|
*/
|
|
43
43
|
scopeHasOnlyBooleanDataType(scope: ColumnScope): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SystemStatusMessageInfo } from '../../PredefinedConfig/Common/SystemStatusMessageInfo';
|
|
2
2
|
import { BaseEventInfo } from './BaseEventInfo';
|
|
3
3
|
/**
|
|
4
|
-
* Object returned by
|
|
4
|
+
* Object returned by SystemStatusMessageDisplayed Event
|
|
5
5
|
*/
|
|
6
6
|
export interface SystemStatusMessageDisplayedInfo extends BaseEventInfo {
|
|
7
7
|
/**
|
|
@@ -346,7 +346,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
346
346
|
this.adaptable.expandAllRowGroups();
|
|
347
347
|
}
|
|
348
348
|
collapseAllRowGroups() {
|
|
349
|
-
this.adaptable.
|
|
349
|
+
this.adaptable.collapseAllRowGroups();
|
|
350
350
|
}
|
|
351
351
|
getExpandRowGroupsKeys() {
|
|
352
352
|
return this.adaptable.getExpandRowGroupsKeys();
|
|
@@ -9,6 +9,7 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Exten
|
|
|
9
9
|
const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
|
|
10
10
|
const IAlertService_1 = require("../../Utilities/Services/Interface/IAlertService");
|
|
11
11
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
|
|
12
|
+
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
12
13
|
class AlertInternalApi extends ApiBase_1.ApiBase {
|
|
13
14
|
getExpressionForAlertRule(alertRule) {
|
|
14
15
|
var expression;
|
|
@@ -635,19 +636,19 @@ class AlertInternalApi extends ApiBase_1.ApiBase {
|
|
|
635
636
|
return text;
|
|
636
637
|
}
|
|
637
638
|
if (context === null || context === void 0 ? void 0 : context.newValue) {
|
|
638
|
-
text =
|
|
639
|
+
text = Helper_1.default.replaceAll(text, '[newValue]', context.newValue);
|
|
639
640
|
}
|
|
640
641
|
if (context === null || context === void 0 ? void 0 : context.oldValue) {
|
|
641
|
-
text =
|
|
642
|
+
text = Helper_1.default.replaceAll(text, '[oldValue]', context.oldValue);
|
|
642
643
|
}
|
|
643
644
|
if (context === null || context === void 0 ? void 0 : context.primaryKeyValue) {
|
|
644
|
-
text =
|
|
645
|
+
text = Helper_1.default.replaceAll(text, '[primaryKeyValue]', context.primaryKeyValue);
|
|
645
646
|
}
|
|
646
647
|
if (context === null || context === void 0 ? void 0 : context.timestamp) {
|
|
647
|
-
text =
|
|
648
|
+
text = Helper_1.default.replaceAll(text, '[timestamp]', context.timestamp + '');
|
|
648
649
|
}
|
|
649
650
|
if (context === null || context === void 0 ? void 0 : context.numberOfRows) {
|
|
650
|
-
text =
|
|
651
|
+
text = Helper_1.default.replaceAll(text, '[numberOfRows]', context.numberOfRows + '');
|
|
651
652
|
}
|
|
652
653
|
if (context === null || context === void 0 ? void 0 : context.trigger) {
|
|
653
654
|
const dataChangeTriggerMap = {
|
|
@@ -665,57 +666,29 @@ class AlertInternalApi extends ApiBase_1.ApiBase {
|
|
|
665
666
|
const mappedTrigger =
|
|
666
667
|
// @ts-ignore
|
|
667
668
|
(_a = (dataChangeTriggerMap[context.trigger] || rowChangeTriggerMap[context.trigger])) !== null && _a !== void 0 ? _a : context.trigger;
|
|
668
|
-
text =
|
|
669
|
+
text = Helper_1.default.replaceAll(text, '[trigger]', mappedTrigger);
|
|
669
670
|
}
|
|
670
671
|
if (context === null || context === void 0 ? void 0 : context.column) {
|
|
671
|
-
text =
|
|
672
|
+
text = Helper_1.default.replaceAll(text, '[column]', this.getColumnApi().getFriendlyNameForColumnId(context.column.columnId));
|
|
672
673
|
}
|
|
673
674
|
if (context === null || context === void 0 ? void 0 : context.rowNode) {
|
|
674
|
-
const columns =
|
|
675
|
+
const columns = Helper_1.default.extractColsFromText(text);
|
|
675
676
|
for (const column of columns) {
|
|
676
677
|
if (this.getColumnApi().getColumnWithColumnId(column)) {
|
|
677
|
-
text =
|
|
678
|
+
text = Helper_1.default.replaceAll(text, `[rowData.${column}]`, this.getGridApi().getRawValueFromRowNode(context.rowNode, column));
|
|
678
679
|
}
|
|
679
680
|
}
|
|
680
681
|
}
|
|
681
682
|
if (text.indexOf('[context') !== -1) {
|
|
682
683
|
const agGridContext = (_c = (_b = this.adaptable.agGridAdapter).getGridOption) === null || _c === void 0 ? void 0 : _c.call(_b, 'context');
|
|
683
|
-
const agGridContextKeys =
|
|
684
|
+
const agGridContextKeys = Helper_1.default.extractContextKeysFromText(text);
|
|
684
685
|
for (const key of agGridContextKeys) {
|
|
685
686
|
if (agGridContext[key]) {
|
|
686
|
-
text =
|
|
687
|
+
text = Helper_1.default.replaceAll(text, `[context.${key}]`, agGridContext[key]);
|
|
687
688
|
}
|
|
688
689
|
}
|
|
689
690
|
}
|
|
690
691
|
return text;
|
|
691
692
|
}
|
|
692
|
-
replaceAll(text, toReplace, replaceWith) {
|
|
693
|
-
if (!text) {
|
|
694
|
-
return text;
|
|
695
|
-
}
|
|
696
|
-
// fails for []
|
|
697
|
-
toReplace = toReplace.replace('[', '\\[').replace(']', '\\]');
|
|
698
|
-
return text.replace(new RegExp(toReplace, 'g'), replaceWith);
|
|
699
|
-
}
|
|
700
|
-
extractColsFromText(text) {
|
|
701
|
-
// rowData.columnName => columnName
|
|
702
|
-
const regex = /\[rowData\.(.*?)\]/g;
|
|
703
|
-
let m;
|
|
704
|
-
const cols = [];
|
|
705
|
-
while ((m = regex.exec(text)) !== null) {
|
|
706
|
-
cols.push(m[1]);
|
|
707
|
-
}
|
|
708
|
-
return cols;
|
|
709
|
-
}
|
|
710
|
-
extractContextKeysFromText(text) {
|
|
711
|
-
// context.columnName => columnName
|
|
712
|
-
const regex = /\[context\.(.*?)\]/g;
|
|
713
|
-
let m;
|
|
714
|
-
const contextKeys = [];
|
|
715
|
-
while ((m = regex.exec(text)) !== null) {
|
|
716
|
-
contextKeys.push(m[1]);
|
|
717
|
-
}
|
|
718
|
-
return contextKeys;
|
|
719
|
-
}
|
|
720
693
|
}
|
|
721
694
|
exports.AlertInternalApi = AlertInternalApi;
|
|
@@ -4,14 +4,10 @@ exports.CommentsInternalApi = void 0;
|
|
|
4
4
|
const ApiBase_1 = require("../Implementation/ApiBase");
|
|
5
5
|
class CommentsInternalApi extends ApiBase_1.ApiBase {
|
|
6
6
|
areCommentsSupported() {
|
|
7
|
-
var _a;
|
|
8
7
|
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
9
8
|
if (currentLayout.EnablePivot) {
|
|
10
9
|
return false;
|
|
11
10
|
}
|
|
12
|
-
if ((_a = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
11
|
return true;
|
|
16
12
|
}
|
|
17
13
|
}
|
|
@@ -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
|
*
|
|
@@ -95,9 +95,9 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
95
95
|
* @param customDisplayFormatterContext context that includes value to format
|
|
96
96
|
* @param options formatter options
|
|
97
97
|
*/
|
|
98
|
-
getNumberFormattedValue(value, node,
|
|
99
|
-
const preparedValue = this.applyCustomFormatters(value, node,
|
|
100
|
-
return FormatHelper_1.default.NumberFormatter(preparedValue, options);
|
|
98
|
+
getNumberFormattedValue(value, node, column, options) {
|
|
99
|
+
const preparedValue = this.applyCustomFormatters(value, node, column, options);
|
|
100
|
+
return FormatHelper_1.default.NumberFormatter(preparedValue, options, node, column, this.getAdaptableApi());
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Format value according to format options.
|
|
@@ -105,9 +105,9 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
105
105
|
* @param value context that includes value to format
|
|
106
106
|
* @param options formatter options
|
|
107
107
|
*/
|
|
108
|
-
getStringFormattedValue(value, node,
|
|
109
|
-
const preparedValue = this.applyCustomFormatters(value, node,
|
|
110
|
-
return FormatHelper_1.default.StringFormatter(preparedValue, options);
|
|
108
|
+
getStringFormattedValue(value, node, column, options) {
|
|
109
|
+
const preparedValue = this.applyCustomFormatters(value, node, column, options);
|
|
110
|
+
return FormatHelper_1.default.StringFormatter(preparedValue, options, node, column, this.getAdaptableApi());
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Format value according to format options.
|
|
@@ -88,7 +88,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
88
88
|
const shouldShowValuesCount = this.shouldShowValuesCount(abColumn);
|
|
89
89
|
let valueOptions = [];
|
|
90
90
|
if (shouldShowValuesCount) {
|
|
91
|
-
const allGridCells = this.adaptable.getGridCellsForColumn(columnId,
|
|
91
|
+
const allGridCells = this.adaptable.getGridCellsForColumn(columnId, this.getColumnFilterOptions().valuesFilterOptions.showCurrentlyFilteredValuesCount);
|
|
92
92
|
const allGridValues = allGridCells.map((gc) => gc.displayValue);
|
|
93
93
|
const newsortedDistinctValues = sortedDistinctValues.filter((gc) => gc.displayValue != undefined && gc.displayValue != '' && gc.displayValue != null);
|
|
94
94
|
valueOptions = newsortedDistinctValues.map((cv) => {
|
|
@@ -148,7 +148,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
|
|
|
148
148
|
addPredicateValues(params) {
|
|
149
149
|
var _a, _b, _c, _d;
|
|
150
150
|
const { valueOptions, column, shouldShowValuesCount, visibleRowsOnly } = params;
|
|
151
|
-
const allGridCells = this.adaptable.getGridCellsForColumn(column.columnId,
|
|
151
|
+
const allGridCells = this.adaptable.getGridCellsForColumn(column.columnId, visibleRowsOnly);
|
|
152
152
|
const adaptableApi = this.getAdaptableApi();
|
|
153
153
|
const predicateIds = adaptableApi.columnFilterApi.internalApi.getValuesFitlerPredicateIds(column);
|
|
154
154
|
if (ArrayExtensions_1.default.IsNullOrEmpty(predicateIds)) {
|
|
@@ -4,14 +4,10 @@ exports.NoteInternalApi = void 0;
|
|
|
4
4
|
const ApiBase_1 = require("../Implementation/ApiBase");
|
|
5
5
|
class NoteInternalApi extends ApiBase_1.ApiBase {
|
|
6
6
|
areNotesSupported() {
|
|
7
|
-
var _a;
|
|
8
7
|
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
9
8
|
if (currentLayout.EnablePivot) {
|
|
10
9
|
return false;
|
|
11
10
|
}
|
|
12
|
-
if ((_a = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.RowGroupedColumns) === null || _a === void 0 ? void 0 : _a.length) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
11
|
return true;
|
|
16
12
|
}
|
|
17
13
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { StatusPanelDef } from '@ag-grid-community/core';
|
|
2
2
|
import { AdaptableStatusBar } from '../PredefinedConfig/StatusBarState';
|
|
3
3
|
/**
|
|
4
|
-
* Methods for
|
|
4
|
+
* Methods for managing the AdapTable Status Bar
|
|
5
5
|
*/
|
|
6
6
|
export interface StatusBarApi {
|
|
7
7
|
/**
|
|
8
|
-
* Retrieves
|
|
8
|
+
* Retrieves current AG Grid Status Bar Panels
|
|
9
9
|
*/
|
|
10
10
|
getAgGridStatusPanels(): StatusPanelDef[];
|
|
11
11
|
/**
|
|
12
|
-
* Retrieves
|
|
12
|
+
* Retrieves current AdapTable Status Bar Panels
|
|
13
13
|
*/
|
|
14
14
|
getAdaptableStatusBars: () => AdaptableStatusBar[];
|
|
15
15
|
/**
|
|
16
|
-
* Sets
|
|
17
|
-
* @param statusPanels
|
|
16
|
+
* Sets Adaptable Status Bar Panels
|
|
17
|
+
* @param statusPanels Adaptable Status Bar Panels
|
|
18
18
|
*/
|
|
19
19
|
setStatusBarPanels: (statusPanels: AdaptableStatusBar[]) => void;
|
|
20
20
|
}
|
|
@@ -54,4 +54,4 @@ export interface AdaptableBaseIcon {
|
|
|
54
54
|
/**
|
|
55
55
|
* All AdapTable System Icon names
|
|
56
56
|
*/
|
|
57
|
-
export type AdaptableSystemIconName = 'add' | 'alert' | 'building' | 'laptop' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'arrow-up-long' | 'arrow-down-long' | 'arrow-expand' | 'paperclip' | 'unfilled-circle' | 'boolean-list' | 'broadcast' | 'brush' | 'spanner' | 'edit-table' | '
|
|
57
|
+
export type AdaptableSystemIconName = 'add' | 'alert' | 'building' | 'laptop' | 'arrow-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'arrow-up-long' | 'arrow-down-long' | 'arrow-expand' | 'paperclip' | 'unfilled-circle' | 'boolean-list' | 'broadcast' | 'brush' | 'spanner' | 'edit-table' | 'calculated-column' | 'calendar' | 'call' | 'cells' | 'fdc3' | 'flag' | 'chart' | 'chat' | 'check' | 'check-circle' | 'checked' | 'clone' | 'close' | 'cloud-upload' | 'collapse' | 'column-add' | 'columns' | 'filter-list' | 'copy' | 'comment' | 'comments' | 'contains' | 'dashboard' | 'json' | 'data-set' | 'date-range' | 'delete' | 'division' | 'dock' | 'dollar' | 'drag' | 'edit' | 'ends-with' | 'equals' | 'equation' | 'error' | 'excel' | 'expand' | 'exponent' | 'export' | 'export-data' | 'fast-backward' | 'fast-forward' | 'filter' | 'filter-off' | 'lightning' | 'folder' | 'folder-open' | 'folder-shared' | 'color-palette' | 'horizontal-lines' | 'function' | 'greater-than' | 'greater-than-or-equal' | 'history' | 'home' | 'import-export' | 'info' | 'brain' | 'download' | 'grid' | 'interactions' | 'less-than' | 'less-than-or-equal' | 'list' | 'logout' | 'mail' | 'menu' | 'minus' | 'multiplication' | 'money' | 'newpage' | 'news' | 'filled-circle' | 'not-contains' | 'not-equal' | 'open-in-new' | 'order' | 'organisation' | 'pause' | 'percent' | 'percent-tag' | 'person' | 'contact' | 'pie-chart' | 'play' | 'plus' | 'add-circle' | 'search' | 'search-table' | 'select-all' | 'select-off' | 'select-fwd' | 'sync' | 'quote' | 'refresh' | 'regex' | 'reminder' | 'save' | 'schedule' | 'science' | 'settings' | 'link' | 'sort-asc' | 'sort-desc' | 'spark-line' | 'resume' | 'starts-with' | 'assignment' | 'statusbar' | 'stop' | 'traffic-lights' | 'tab-unselected' | 'theme' | 'clipboard' | 'target' | 'triangle-down' | 'triangle-up' | 'unchecked' | 'undo' | 'downloaded' | 'upload' | 'warning' | 'gradient' | 'badge' | 'italic' | 'bold' | 'align-left' | 'align-right' | 'align-center' | 'align-justify' | 'underline' | 'strikethrough' | 'overline' | 'case-upper' | 'case-lower' | 'case-sentence' | 'visibility-on' | 'visibility-off' | 'visibility-off-bold' | 'visibility-on-bold' | 'note' | 'import' | 'grid-filter' | 'grid-info' | 'csv' | 'rows' | 'expand-all' | 'collapse-all' | 'column-outline';
|
|
@@ -5,7 +5,13 @@ import { SelectedCellInfo } from '../Selection/SelectedCellInfo';
|
|
|
5
5
|
import { SelectedRowInfo } from '../Selection/SelectedRowInfo';
|
|
6
6
|
import { Column, IRowNode } from '@ag-grid-community/core';
|
|
7
7
|
import { AdaptableIcon, BaseContext } from '../../types';
|
|
8
|
+
/**
|
|
9
|
+
* Name of Column Menu Item provided by AdapTable
|
|
10
|
+
*/
|
|
8
11
|
export type AdaptableColumnMenuItemName = (typeof ADAPTABLE_COLUMN_MENU_ITEMS)[number];
|
|
12
|
+
/**
|
|
13
|
+
* Name of Context Menu Item provided by AdapTable
|
|
14
|
+
*/
|
|
9
15
|
export type AdaptableContextMenuItemName = (typeof ADAPTABLE_CONTEXT_MENU_ITEMS)[number];
|
|
10
16
|
/**
|
|
11
17
|
* List of Shipped Adaptable Column Menu Items
|
|
@@ -13,7 +13,7 @@ const getCalculatedColumnSettingsTags_1 = require("../View/CalculatedColumn/Util
|
|
|
13
13
|
const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
|
|
14
14
|
class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
15
15
|
constructor(api) {
|
|
16
|
-
super(ModuleConstants.CalculatedColumnModuleId, ModuleConstants.CalculatedColumnFriendlyName, '
|
|
16
|
+
super(ModuleConstants.CalculatedColumnModuleId, ModuleConstants.CalculatedColumnFriendlyName, 'calculated-column', 'CalculatedColumnPopup', 'Create bespoke columns whose cell value is derived dynamically from an Expression', api);
|
|
17
17
|
}
|
|
18
18
|
onAdaptableReady() {
|
|
19
19
|
this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
@@ -75,17 +75,19 @@ class ColumnFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
75
75
|
this.api.optionsApi.getColumnFilterOptions().useAdaptableColumnFiltering) {
|
|
76
76
|
const existingColumnFilter = this.getExistingColumnFilter(menuContext.adaptableColumn);
|
|
77
77
|
if (!existingColumnFilter) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
if (!menuContext.isRowGroupColumn && !menuContext.isGroupedNode) {
|
|
79
|
+
let isMultiple = menuContext.selectedCellInfo.gridCells.length > 1;
|
|
80
|
+
let clickFunction = isMultiple
|
|
81
|
+
? () => {
|
|
82
|
+
this.api.columnFilterApi.internalApi.createValuesColumnFilterForCells(menuContext.selectedCellInfo.gridCells);
|
|
83
|
+
}
|
|
84
|
+
: () => {
|
|
85
|
+
this.api.columnFilterApi.internalApi.createEqualityColumnFilterForCell(menuContext.selectedCellInfo.gridCells[0]);
|
|
86
|
+
};
|
|
87
|
+
return [
|
|
88
|
+
this.createMenuItemClickFunction('column-filter-on-cell-value', isMultiple ? 'Filter on Cell Values' : 'Filter on Cell Value', this.moduleInfo.Glyph, clickFunction),
|
|
89
|
+
];
|
|
90
|
+
}
|
|
89
91
|
}
|
|
90
92
|
else {
|
|
91
93
|
return [
|
|
@@ -36,6 +36,9 @@ class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
36
36
|
if (!this.api.commentApi.internalApi.areCommentsSupported()) {
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
+
if (menuContext.isRowGroupColumn || menuContext.isGroupedNode) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
39
42
|
const items = [];
|
|
40
43
|
const isCellCommentable = typeof ((_b = (_a = this.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getCommentOptions()) === null || _b === void 0 ? void 0 : _b.isCellCommentable) === 'function'
|
|
41
44
|
? (_d = (_c = this.api.optionsApi) === null || _c === void 0 ? void 0 : _c.getCommentOptions()) === null || _d === void 0 ? void 0 : _d.isCellCommentable(Object.assign({ gridCell: menuContext.gridCell }, (0, ObjectFactory_1.createBaseContext)(this.api)))
|
|
@@ -22,6 +22,9 @@ class NoteModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
22
22
|
if (!this.api.noteApi.internalApi.areNotesSupported()) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
+
if (menuContext.isRowGroupColumn || menuContext.isGroupedNode) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
25
28
|
const isReadOnly = this.adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName) === 'ReadOnly';
|
|
26
29
|
if (isReadOnly) {
|
|
27
30
|
return undefined;
|
|
@@ -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;
|
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FormatContentHelper = exports.resolvePlaceholders = 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 Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
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 = exports.FormatContentHelper.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 = exports.FormatContentHelper.resolvePlaceholders(options.Content, context);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
preparedInput = input;
|
|
144
|
+
}
|
|
119
145
|
if (preparedInput == null || preparedInput == undefined) {
|
|
120
146
|
return undefined;
|
|
121
147
|
}
|
|
@@ -146,4 +172,37 @@ function StringFormatter(input, options = {}) {
|
|
|
146
172
|
return s;
|
|
147
173
|
}
|
|
148
174
|
exports.StringFormatter = StringFormatter;
|
|
149
|
-
|
|
175
|
+
/**
|
|
176
|
+
* Supported tokens:
|
|
177
|
+
* - column -> [column]
|
|
178
|
+
* - input -> [value]
|
|
179
|
+
* - rowData.colId -> [rowData.colId]
|
|
180
|
+
*/
|
|
181
|
+
function resolvePlaceholders(text, context) {
|
|
182
|
+
if (!text) {
|
|
183
|
+
return text;
|
|
184
|
+
}
|
|
185
|
+
if (!context) {
|
|
186
|
+
return text;
|
|
187
|
+
}
|
|
188
|
+
if (context === null || context === void 0 ? void 0 : context.input) {
|
|
189
|
+
text = Helper_1.default.replaceAll(text, '[value]', context.input);
|
|
190
|
+
}
|
|
191
|
+
if (context === null || context === void 0 ? void 0 : context.column) {
|
|
192
|
+
text = Helper_1.default.replaceAll(text, '[column]', context.api.columnApi.getFriendlyNameForColumnId(context.column.columnId));
|
|
193
|
+
}
|
|
194
|
+
if (context === null || context === void 0 ? void 0 : context.rowNode) {
|
|
195
|
+
const columns = Helper_1.default.extractColsFromText(text);
|
|
196
|
+
for (const column of columns) {
|
|
197
|
+
if (context.api.columnApi.getColumnWithColumnId(column)) {
|
|
198
|
+
text = Helper_1.default.replaceAll(text, `[rowData.${column}]`, context.api.gridApi.getRawValueFromRowNode(context.rowNode, column));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return text;
|
|
203
|
+
}
|
|
204
|
+
exports.resolvePlaceholders = resolvePlaceholders;
|
|
205
|
+
exports.FormatContentHelper = {
|
|
206
|
+
resolvePlaceholders,
|
|
207
|
+
};
|
|
208
|
+
exports.default = { NumberFormatter, DateFormatter, StringFormatter, FormatContentHelper: exports.FormatContentHelper };
|