@adaptabletools/adaptable 11.0.2 → 11.0.5
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 +75 -72
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -0
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/FilterOptions.d.ts +4 -1
- package/src/Api/CellSummaryApi.d.ts +4 -0
- package/src/Api/GridApi.d.ts +4 -0
- package/src/Api/Implementation/CellSummaryApiImpl.d.ts +2 -0
- package/src/Api/Implementation/CellSummaryApiImpl.js +4 -0
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +7 -0
- package/src/PredefinedConfig/Common/AdaptableMessageType.d.ts +2 -2
- package/src/PredefinedConfig/Selection/GridCell.d.ts +1 -1
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +4 -0
- package/src/Strategy/ConditionalStyleModule.js +1 -1
- package/src/Strategy/FlashingCellModule.js +1 -1
- package/src/Strategy/FormatColumnModule.js +4 -4
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/Utilities/getExportColumnsViewItems.js +0 -13
- package/src/Strategy/Utilities/getScopeViewItems.d.ts +2 -2
- package/src/Strategy/Utilities/getScopeViewItems.js +3 -2
- package/src/Utilities/Services/LicenseService.js +1 -159
- package/src/Utilities/license/decode.js +1 -67
- package/src/Utilities/license/hashing.js +1 -47
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -0
- package/src/View/License/LicenseWatermark.js +1 -65
- package/src/agGrid/Adaptable.d.ts +2 -0
- package/src/agGrid/Adaptable.js +24 -3
- package/src/agGrid/CheckboxRenderer.d.ts +2 -0
- package/src/agGrid/CheckboxRenderer.js +37 -4
- package/src/agGrid/PercentBarRenderer.d.ts +3 -0
- package/src/agGrid/PercentBarRenderer.js +83 -0
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +3 -74
- package/src/metamodel/adaptable.metamodel.d.ts +5 -9
- package/src/metamodel/adaptable.metamodel.js +22 -3
- package/src/types.d.ts +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,65 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LicenseWatermark = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const Logo_1 = require("../../components/Logo");
|
|
7
|
-
const rebass_1 = require("rebass");
|
|
8
|
-
const style = {
|
|
9
|
-
border: '1px solid var(--ab-color-error)',
|
|
10
|
-
padding: '5px',
|
|
11
|
-
fontWeight: 600,
|
|
12
|
-
margin: '5px',
|
|
13
|
-
fontSize: '14px',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
color: 'var(--ab-color-text-on-defaultbackground)',
|
|
16
|
-
background: 'var(--ab-color-defaultbackground)',
|
|
17
|
-
};
|
|
18
|
-
const isStyleValid = (element) => {
|
|
19
|
-
const notAllowedProperties = [
|
|
20
|
-
['display', 'none'],
|
|
21
|
-
['opacity', '0'],
|
|
22
|
-
['position', 'absolute'],
|
|
23
|
-
['position', 'fixed'],
|
|
24
|
-
['position', 'relative'],
|
|
25
|
-
['visibility', 'hidden'],
|
|
26
|
-
];
|
|
27
|
-
for (const [prop, value] of notAllowedProperties) {
|
|
28
|
-
if (element.style[prop] === value) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return true;
|
|
33
|
-
};
|
|
34
|
-
exports.LicenseWatermark = (props) => {
|
|
35
|
-
const ref = React.useRef(null);
|
|
36
|
-
React.useEffect(() => {
|
|
37
|
-
const checkWatermark = () => {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
if (!((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isConnected)) {
|
|
40
|
-
alert('It is not allowed to remove the Adaptable watermark.');
|
|
41
|
-
}
|
|
42
|
-
if (!isStyleValid(ref.current)) {
|
|
43
|
-
alert('It is not allowed to modify the Adaptable watermark.');
|
|
44
|
-
}
|
|
45
|
-
if ((_b = ref === null || ref === void 0 ? void 0 : ref.current) === null || _b === void 0 ? void 0 : _b.style) {
|
|
46
|
-
ref.current.style.border = style.border;
|
|
47
|
-
ref.current.style.padding = style.padding;
|
|
48
|
-
ref.current.style.fontWeight = `${style.fontWeight}`;
|
|
49
|
-
ref.current.style.margin = style.margin;
|
|
50
|
-
ref.current.style.fontSize = style.fontSize;
|
|
51
|
-
ref.current.style.color = style.color;
|
|
52
|
-
ref.current.style.background = style.background;
|
|
53
|
-
ref.current.style.display = 'flex';
|
|
54
|
-
ref.current.style.position = 'static';
|
|
55
|
-
ref.current.style.opacity = '1';
|
|
56
|
-
ref.current.style.visibility = 'visible';
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const timerId = setInterval(checkWatermark, 5000);
|
|
60
|
-
return () => clearTimeout(timerId);
|
|
61
|
-
}, []);
|
|
62
|
-
return (React.createElement(rebass_1.Flex, { style: style, ref: ref },
|
|
63
|
-
React.createElement(Logo_1.Logo, { style: { marginRight: 10 } }),
|
|
64
|
-
React.createElement("div", null, props.children)));
|
|
65
|
-
};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseWatermark=void 0;const e=require("tslib"),t=e.__importStar(require("react")),r=require("../../components/Logo"),o=require("rebass"),n={border:"1px solid var(--ab-color-error)",padding:"5px",fontWeight:600,margin:"5px",fontSize:"14px",alignItems:"center",color:"var(--ab-color-text-on-defaultbackground)",background:"var(--ab-color-defaultbackground)"},i=e=>{const t=[["display","none"],["opacity","0"],["position","absolute"],["position","fixed"],["position","relative"],["visibility","hidden"]];for(const[r,o]of t)if(e.style[r]===o)return!1;return!0};exports.LicenseWatermark=e=>{const l=t.useRef(null);return t.useEffect((()=>{const e=setInterval((()=>{var e,t;(null===(e=l.current)||void 0===e?void 0:e.isConnected)||alert("It is not allowed to remove the Adaptable watermark."),i(l.current)||alert("It is not allowed to modify the Adaptable watermark."),(null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.style)&&(l.current.style.border=n.border,l.current.style.padding=n.padding,l.current.style.fontWeight=`${n.fontWeight}`,l.current.style.margin=n.margin,l.current.style.fontSize=n.fontSize,l.current.style.color=n.color,l.current.style.background=n.background,l.current.style.display="flex",l.current.style.position="static",l.current.style.opacity="1",l.current.style.visibility="visible")}),5e3);return()=>clearTimeout(e)}),[]),t.createElement(o.Flex,{style:n,ref:l},t.createElement(r.Logo,{style:{marginRight:10}}),t.createElement("div",null,e.children))};
|
|
@@ -231,6 +231,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
231
231
|
getGroupedColDefs(): ColDef[];
|
|
232
232
|
getColumnDefsWithCorrectVisibility: () => ColDef[];
|
|
233
233
|
getFirstRowNode(): RowNode;
|
|
234
|
+
getFirstDisplayedRowNode(): RowNode;
|
|
234
235
|
destroy(config?: {
|
|
235
236
|
unmount: boolean;
|
|
236
237
|
destroyApi?: boolean;
|
|
@@ -312,6 +313,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
312
313
|
deleteRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<RowNode[]>;
|
|
313
314
|
getFirstGroupedColumn(): AdaptableColumn | undefined;
|
|
314
315
|
private checkColumnsDataTypeSet;
|
|
316
|
+
private updateColumnDataTypeIfRowDataIsEmpty;
|
|
315
317
|
private runAdaptableComparerFunction;
|
|
316
318
|
isGridSelectable(): boolean;
|
|
317
319
|
isGridGroupable(): boolean;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -2217,11 +2217,16 @@ class Adaptable {
|
|
|
2217
2217
|
if (!foundNode) {
|
|
2218
2218
|
if (!node.group) {
|
|
2219
2219
|
rowNode = node;
|
|
2220
|
+
foundNode = true;
|
|
2220
2221
|
}
|
|
2221
2222
|
}
|
|
2222
2223
|
});
|
|
2223
2224
|
return rowNode;
|
|
2224
2225
|
}
|
|
2226
|
+
getFirstDisplayedRowNode() {
|
|
2227
|
+
const firstDisplayedRowIndex = this.gridOptions.api.getFirstDisplayedRow();
|
|
2228
|
+
return this.gridOptions.api.getDisplayedRowAtIndex(firstDisplayedRowIndex);
|
|
2229
|
+
}
|
|
2225
2230
|
destroy(config) {
|
|
2226
2231
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
2227
2232
|
if (this.gridOptions && this.gridOptions.api) {
|
|
@@ -2892,7 +2897,7 @@ class Adaptable {
|
|
|
2892
2897
|
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(abColumn);
|
|
2893
2898
|
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn.ColumnStyle) {
|
|
2894
2899
|
if (formatColumn.ColumnStyle.PercentBarStyle) {
|
|
2895
|
-
return this.agGridHelper.
|
|
2900
|
+
return this.agGridHelper.createPercentBarRendererComp(formatColumn);
|
|
2896
2901
|
}
|
|
2897
2902
|
if (formatColumn.ColumnStyle.CheckBoxStyle) {
|
|
2898
2903
|
return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
|
|
@@ -3556,6 +3561,7 @@ class Adaptable {
|
|
|
3556
3561
|
this.addSyntheticPrimaryKey(dataSource);
|
|
3557
3562
|
}
|
|
3558
3563
|
this.gridOptions.api.setRowData(dataSource);
|
|
3564
|
+
this.updateColumnDataTypeIfRowDataIsEmpty();
|
|
3559
3565
|
}
|
|
3560
3566
|
getGridData() {
|
|
3561
3567
|
var _a;
|
|
@@ -3621,11 +3627,13 @@ class Adaptable {
|
|
|
3621
3627
|
dataUpdateConfig.callback(transaction);
|
|
3622
3628
|
}
|
|
3623
3629
|
resolve(transaction === null || transaction === void 0 ? void 0 : transaction.add);
|
|
3630
|
+
this.updateColumnDataTypeIfRowDataIsEmpty();
|
|
3624
3631
|
});
|
|
3625
3632
|
});
|
|
3626
3633
|
}
|
|
3627
3634
|
else {
|
|
3628
3635
|
const transaction = this.gridOptions.api.applyTransaction(newData);
|
|
3636
|
+
this.updateColumnDataTypeIfRowDataIsEmpty();
|
|
3629
3637
|
return Promise.resolve(transaction === null || transaction === void 0 ? void 0 : transaction.add);
|
|
3630
3638
|
}
|
|
3631
3639
|
}
|
|
@@ -3657,11 +3665,24 @@ class Adaptable {
|
|
|
3657
3665
|
}
|
|
3658
3666
|
checkColumnsDataTypeSet() {
|
|
3659
3667
|
// check that we have no unknown columns - if we do then ok
|
|
3660
|
-
const
|
|
3661
|
-
if (
|
|
3668
|
+
const colDefs = this.api.columnApi.getColumns();
|
|
3669
|
+
if (colDefs.some((colDef) => colDef.dataType === Enums_1.DataType.Unknown)) {
|
|
3662
3670
|
this.updateColumnsIntoStore();
|
|
3663
3671
|
}
|
|
3664
3672
|
}
|
|
3673
|
+
updateColumnDataTypeIfRowDataIsEmpty() {
|
|
3674
|
+
var _a, _b;
|
|
3675
|
+
// gridOptions?.rowData is not updated when setting data via the api
|
|
3676
|
+
if (!((_b = (_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.rowData) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
3677
|
+
// the columns dataType is based on the rawData, when type is not set on the column
|
|
3678
|
+
// when data is loaded async, the dataType initially is dataType=unknown
|
|
3679
|
+
// to fix this, we need to update the columnDefs when we data is loaded
|
|
3680
|
+
this.checkColumnsDataTypeSet();
|
|
3681
|
+
// this influences the floating filter
|
|
3682
|
+
// need to trigger header redraw, if not, the columnDef update is not picked-up
|
|
3683
|
+
this.redrawHeader();
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3665
3686
|
runAdaptableComparerFunction(columnId, columnValues) {
|
|
3666
3687
|
let adaptable = this;
|
|
3667
3688
|
return function compareItemsOfCustomSort(valueA, valueB, nodeA, nodeB) {
|
|
@@ -3,6 +3,8 @@ import { AdaptableApi } from '../Api/AdaptableApi';
|
|
|
3
3
|
import { ICellEditorComp, ICellEditorParams } from '@ag-grid-community/core/dist/cjs/es5/interfaces/iCellEditor';
|
|
4
4
|
export declare const getCheckboxRendererForColumn: (columnId: string, isColumnReadOnly: boolean, api: AdaptableApi) => ICellRendererFunc;
|
|
5
5
|
export declare class CheckboxEditor implements ICellEditorComp {
|
|
6
|
+
private eGui;
|
|
7
|
+
private value;
|
|
6
8
|
isCancelBeforeStart(): boolean;
|
|
7
9
|
init(params: ICellEditorParams): void;
|
|
8
10
|
getGui(): HTMLElement;
|
|
@@ -21,12 +21,23 @@ exports.getCheckboxRendererForColumn = (columnId, isColumnReadOnly, api) => {
|
|
|
21
21
|
align-items: center;
|
|
22
22
|
justify-content: center;`;
|
|
23
23
|
this.eGui.appendChild(inputElement);
|
|
24
|
+
if (!inputElement.disabled) {
|
|
25
|
+
this.suppressEditEvent = this.suppressEditEvent.bind(this);
|
|
26
|
+
this.eGui.addEventListener('click', this.suppressEditEvent);
|
|
27
|
+
this.eGui.addEventListener('dblclick', this.suppressEditEvent);
|
|
28
|
+
}
|
|
24
29
|
};
|
|
25
30
|
CheckboxRenderer.prototype.checkedHandler = function (e) {
|
|
26
31
|
let checked = e.target.checked;
|
|
27
32
|
this.params.node.setDataValue(columnId, checked);
|
|
28
33
|
api.formatColumnApi.fireCheckboxColumnClickedEvent(columnId, this.params.node.data, api.gridApi.getPrimaryKeyValueForRowNode(this.params.node), checked);
|
|
29
34
|
};
|
|
35
|
+
CheckboxRenderer.prototype.suppressEditEvent = function (event) {
|
|
36
|
+
if (event.target === this.eGui) {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
event.stopPropagation();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
30
41
|
CheckboxRenderer.prototype.getGui = function () {
|
|
31
42
|
return this.eGui;
|
|
32
43
|
};
|
|
@@ -36,8 +47,10 @@ exports.getCheckboxRendererForColumn = (columnId, isColumnReadOnly, api) => {
|
|
|
36
47
|
return false;
|
|
37
48
|
};
|
|
38
49
|
CheckboxRenderer.prototype.destroy = function () {
|
|
39
|
-
var _a, _b;
|
|
50
|
+
var _a, _b, _c, _d;
|
|
40
51
|
(_b = (_a = this.eGui) === null || _a === void 0 ? void 0 : _a.firstChild) === null || _b === void 0 ? void 0 : _b.removeEventListener('click', this.checkedHandler);
|
|
52
|
+
(_c = this.eGui) === null || _c === void 0 ? void 0 : _c.removeEventListener('click', this.suppressEditEvent);
|
|
53
|
+
(_d = this.eGui) === null || _d === void 0 ? void 0 : _d.removeEventListener('dblclick', this.suppressEditEvent);
|
|
41
54
|
};
|
|
42
55
|
return CheckboxRenderer;
|
|
43
56
|
};
|
|
@@ -47,10 +60,30 @@ class CheckboxEditor {
|
|
|
47
60
|
// never show the editor, we edit it via the checkbox input element
|
|
48
61
|
return true;
|
|
49
62
|
}
|
|
50
|
-
|
|
63
|
+
// the initialisation below is not required in 99% of cases, as the editor is never shown
|
|
64
|
+
// however, using ReactUI makes some race conditions possible, in which cases the editor will be displayed for a few milliseconds
|
|
65
|
+
// we provide this logic for those few cases (to avoid a flicker effect)
|
|
66
|
+
init(params) {
|
|
67
|
+
const adaptable = params.api.__adaptable;
|
|
68
|
+
const inputElement = document.createElement('input');
|
|
69
|
+
inputElement.type = 'checkbox';
|
|
70
|
+
inputElement.checked = params.value;
|
|
71
|
+
inputElement.disabled = adaptable.api.internalApi
|
|
72
|
+
.getAdaptableInstance()
|
|
73
|
+
.isCellEditable(params.node, params.column);
|
|
74
|
+
this.eGui = document.createElement('div');
|
|
75
|
+
this.eGui.style.cssText = `display: flex;
|
|
76
|
+
height: 100%;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;`;
|
|
79
|
+
this.eGui.appendChild(inputElement);
|
|
80
|
+
this.value = params.value;
|
|
81
|
+
}
|
|
51
82
|
getGui() {
|
|
52
|
-
return
|
|
83
|
+
return this.eGui;
|
|
84
|
+
}
|
|
85
|
+
getValue() {
|
|
86
|
+
return this.value;
|
|
53
87
|
}
|
|
54
|
-
getValue() { }
|
|
55
88
|
}
|
|
56
89
|
exports.CheckboxEditor = CheckboxEditor;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPercentBarRendererForColumn = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
|
|
6
|
+
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
7
|
+
const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
|
|
8
|
+
exports.getPercentBarRendererForColumn = (formatColumn, api) => {
|
|
9
|
+
var _a;
|
|
10
|
+
if (!((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
return class PercentBarRenderer {
|
|
14
|
+
init(params) {
|
|
15
|
+
if (!formatColumn.IncludeGroupedRows && api.gridApi.isGroupRowNode(params.node)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const min = api.formatColumnApi.getNumericStyleMinValue(formatColumn.ColumnStyle, params.node, params.value);
|
|
19
|
+
const max = api.formatColumnApi.getNumericStyleMaxValue(formatColumn.ColumnStyle, params.node, params.value);
|
|
20
|
+
let value = params.value;
|
|
21
|
+
if (Helper_1.default.objectNotExists(value)) {
|
|
22
|
+
value = 0;
|
|
23
|
+
}
|
|
24
|
+
const clampedValue = clamp_1.default(value, min, max);
|
|
25
|
+
const percentageValue = ((clampedValue - min) / (max - min)) * 100;
|
|
26
|
+
let cellBackColor;
|
|
27
|
+
const percentBarStyle = formatColumn.ColumnStyle.PercentBarStyle;
|
|
28
|
+
if (percentBarStyle.ColumnComparison) {
|
|
29
|
+
cellBackColor = percentBarStyle.ColumnComparison.Color;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const matchingRange = percentBarStyle.CellRanges.find((r) => r.Min <= clampedValue && r.Max >= clampedValue);
|
|
33
|
+
if (matchingRange) {
|
|
34
|
+
cellBackColor = matchingRange.Color;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (cellBackColor) {
|
|
38
|
+
this.eGui = document.createElement('div');
|
|
39
|
+
this.eGui.className = 'ab-PercentBar__wrapper';
|
|
40
|
+
this.eGui.style.height = percentBarStyle.CellText ? '80%' : '100%';
|
|
41
|
+
this.eGui.style.display = 'flex';
|
|
42
|
+
this.eGui.style.flexDirection = 'column';
|
|
43
|
+
this.eGui.style.justifyContent = 'center';
|
|
44
|
+
const barEl = document.createElement('div');
|
|
45
|
+
barEl.className = 'ab-PercentBar__bar';
|
|
46
|
+
barEl.style.background = percentBarStyle.BackColor;
|
|
47
|
+
barEl.style.flex = '1';
|
|
48
|
+
const barInsideEl = document.createElement('div');
|
|
49
|
+
barInsideEl.className = 'ab-PercentBar__barInside';
|
|
50
|
+
barInsideEl.style.background = cellBackColor;
|
|
51
|
+
barInsideEl.style.height = '100%';
|
|
52
|
+
barInsideEl.style.width = `${percentageValue.toFixed(0)}%`;
|
|
53
|
+
barEl.append(barInsideEl);
|
|
54
|
+
this.eGui.append(barEl);
|
|
55
|
+
if (percentBarStyle.CellText) {
|
|
56
|
+
const textEl = document.createElement('div');
|
|
57
|
+
textEl.className = 'ab-PercentBar__text';
|
|
58
|
+
textEl.style.lineHeight = '1.2';
|
|
59
|
+
if (percentBarStyle.CellText.includes('CellValue')) {
|
|
60
|
+
if (formatColumn.DisplayFormat) {
|
|
61
|
+
const options = formatColumn.DisplayFormat
|
|
62
|
+
.Options;
|
|
63
|
+
if (options) {
|
|
64
|
+
value = FormatHelper_1.default.NumberFormatter(params.value, options);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
textEl.innerText = value;
|
|
68
|
+
}
|
|
69
|
+
if (percentBarStyle.CellText.includes('PercentageValue')) {
|
|
70
|
+
textEl.innerText += ' ' + `(${percentageValue.toFixed(0)}%)`;
|
|
71
|
+
}
|
|
72
|
+
this.eGui.append(textEl);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
getGui() {
|
|
77
|
+
return this.eGui;
|
|
78
|
+
}
|
|
79
|
+
refresh(params) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -22,7 +22,7 @@ export declare class agGridHelper {
|
|
|
22
22
|
setUpModules(): Map<AdaptableModule, IModule>;
|
|
23
23
|
TrySetUpNodeIds(): boolean;
|
|
24
24
|
createCheckboxRendererComp(columnId: string, isColumnReadOnly: boolean): ICellRendererFunc | undefined;
|
|
25
|
-
|
|
25
|
+
createPercentBarRendererComp(formatColumn: FormatColumn): ICellRendererFunc;
|
|
26
26
|
getCleanValue(value: string): string | undefined;
|
|
27
27
|
getRenderedValue(colDef: ColDef, valueToRender: any): any;
|
|
28
28
|
createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.agGridHelper = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
6
5
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
7
6
|
const Uuid_1 = require("../PredefinedConfig/Uuid");
|
|
8
7
|
const AlertModule_1 = require("../Strategy/AlertModule");
|
|
@@ -33,14 +32,13 @@ const ToolPanelModule_1 = require("../Strategy/ToolPanelModule");
|
|
|
33
32
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
34
33
|
const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
35
34
|
const StringExtensions_1 = require("../Utilities/Extensions/StringExtensions");
|
|
36
|
-
const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
|
|
37
35
|
const LoggingHelper_1 = require("../Utilities/Helpers/LoggingHelper");
|
|
38
|
-
const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
|
|
39
36
|
const CheckboxRenderer_1 = require("./CheckboxRenderer");
|
|
40
37
|
const DataChangeHistoryModule_1 = require("../Strategy/DataChangeHistoryModule");
|
|
41
38
|
const FlashingCellModule_1 = require("../Strategy/FlashingCellModule");
|
|
42
39
|
const SettingsPanelModule_1 = require("../Strategy/SettingsPanelModule");
|
|
43
40
|
const ChartingModule_1 = require("../Strategy/ChartingModule");
|
|
41
|
+
const PercentBarRenderer_1 = require("./PercentBarRenderer");
|
|
44
42
|
const tinycolor = require('tinycolor2');
|
|
45
43
|
/**
|
|
46
44
|
* Adaptable AG Grid implementation is getting really big and unwieldy
|
|
@@ -121,77 +119,8 @@ class agGridHelper {
|
|
|
121
119
|
createCheckboxRendererComp(columnId, isColumnReadOnly) {
|
|
122
120
|
return CheckboxRenderer_1.getCheckboxRendererForColumn(columnId, isColumnReadOnly, this.adaptable.api);
|
|
123
121
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (!numericStyle || numericStyle.CheckBoxStyle) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const cellRendererFunc = (params) => {
|
|
130
|
-
if (!formatColumn.IncludeGroupedRows && this.adaptable.isGroupRowNode(params.node)) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const min = this.adaptable.api.formatColumnApi.getNumericStyleMinValue(numericStyle, params.node, params.value);
|
|
134
|
-
const max = this.adaptable.api.formatColumnApi.getNumericStyleMaxValue(numericStyle, params.node, params.value);
|
|
135
|
-
let value = params.value;
|
|
136
|
-
if (Helper_1.default.objectNotExists(value)) {
|
|
137
|
-
value = 0;
|
|
138
|
-
}
|
|
139
|
-
const percentBarStyle = numericStyle.PercentBarStyle;
|
|
140
|
-
if (percentBarStyle) {
|
|
141
|
-
const clampedValue = clamp_1.default(value, min, max);
|
|
142
|
-
const percentageValue = ((clampedValue - min) / (max - min)) * 100;
|
|
143
|
-
let cellBackColor;
|
|
144
|
-
if (percentBarStyle.ColumnComparison) {
|
|
145
|
-
cellBackColor = percentBarStyle.ColumnComparison.Color;
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
const matchingRange = percentBarStyle.CellRanges.find((r) => r.Min <= clampedValue && r.Max >= clampedValue);
|
|
149
|
-
if (matchingRange) {
|
|
150
|
-
cellBackColor = matchingRange.Color;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
if (cellBackColor) {
|
|
154
|
-
const wrapperEl = document.createElement('div');
|
|
155
|
-
wrapperEl.className = 'ab-PercentBar__wrapper';
|
|
156
|
-
wrapperEl.style.height = percentBarStyle.CellText ? '80%' : '100%';
|
|
157
|
-
wrapperEl.style.display = 'flex';
|
|
158
|
-
wrapperEl.style.flexDirection = 'column';
|
|
159
|
-
wrapperEl.style.justifyContent = 'center';
|
|
160
|
-
const barEl = document.createElement('div');
|
|
161
|
-
barEl.className = 'ab-PercentBar__bar';
|
|
162
|
-
barEl.style.background = percentBarStyle.BackColor;
|
|
163
|
-
barEl.style.flex = '1';
|
|
164
|
-
const barInsideEl = document.createElement('div');
|
|
165
|
-
barInsideEl.className = 'ab-PercentBar__barInside';
|
|
166
|
-
barInsideEl.style.background = cellBackColor;
|
|
167
|
-
barInsideEl.style.height = '100%';
|
|
168
|
-
barInsideEl.style.width = `${percentageValue.toFixed(0)}%`;
|
|
169
|
-
barEl.append(barInsideEl);
|
|
170
|
-
wrapperEl.append(barEl);
|
|
171
|
-
if (percentBarStyle.CellText) {
|
|
172
|
-
const textEl = document.createElement('div');
|
|
173
|
-
textEl.className = 'ab-PercentBar__text';
|
|
174
|
-
textEl.style.lineHeight = '1.2';
|
|
175
|
-
if (percentBarStyle.CellText.includes('CellValue')) {
|
|
176
|
-
if (formatColumn.DisplayFormat) {
|
|
177
|
-
const options = formatColumn.DisplayFormat
|
|
178
|
-
.Options;
|
|
179
|
-
if (options) {
|
|
180
|
-
value = FormatHelper_1.default.NumberFormatter(params.value, options);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
textEl.innerText = value;
|
|
184
|
-
}
|
|
185
|
-
if (percentBarStyle.CellText.includes('PercentageValue')) {
|
|
186
|
-
textEl.innerText += ' ' + `(${percentageValue.toFixed(0)}%)`;
|
|
187
|
-
}
|
|
188
|
-
wrapperEl.append(textEl);
|
|
189
|
-
}
|
|
190
|
-
return wrapperEl;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
return cellRendererFunc;
|
|
122
|
+
createPercentBarRendererComp(formatColumn) {
|
|
123
|
+
return PercentBarRenderer_1.getPercentBarRendererForColumn(formatColumn, this.adaptable.api);
|
|
195
124
|
}
|
|
196
125
|
getCleanValue(value) {
|
|
197
126
|
if (value == null || value == 'null' || value == undefined || value == 'undefined') {
|
|
@@ -497,6 +497,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
497
497
|
reference: string;
|
|
498
498
|
})[];
|
|
499
499
|
};
|
|
500
|
+
AdaptableQuery: {
|
|
501
|
+
name: string;
|
|
502
|
+
kind: string;
|
|
503
|
+
description: string;
|
|
504
|
+
};
|
|
500
505
|
AdaptableReadyInfo: {
|
|
501
506
|
name: string;
|
|
502
507
|
kind: string;
|
|
@@ -1998,15 +2003,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1998
2003
|
defaultValue: string;
|
|
1999
2004
|
gridInfo?: undefined;
|
|
2000
2005
|
reference?: undefined;
|
|
2001
|
-
} | {
|
|
2002
|
-
name: string;
|
|
2003
|
-
kind: string;
|
|
2004
|
-
description: string;
|
|
2005
|
-
uiLabel: string;
|
|
2006
|
-
isOptional: boolean;
|
|
2007
|
-
gridInfo?: undefined;
|
|
2008
|
-
defaultValue?: undefined;
|
|
2009
|
-
reference?: undefined;
|
|
2010
2006
|
} | {
|
|
2011
2007
|
name: string;
|
|
2012
2008
|
kind: string;
|
|
@@ -1328,6 +1328,11 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
]
|
|
1330
1330
|
},
|
|
1331
|
+
"AdaptableQuery": {
|
|
1332
|
+
"name": "AdaptableQuery",
|
|
1333
|
+
"kind": "TypeAlias",
|
|
1334
|
+
"description": "An AdaptableQuery can be either a Boolean, Scalar, Observable, AggregatedBoolean, or AggregatedScalar expression"
|
|
1335
|
+
},
|
|
1331
1336
|
"AdaptableReadyInfo": {
|
|
1332
1337
|
"name": "AdaptableReadyInfo",
|
|
1333
1338
|
"kind": "Interface",
|
|
@@ -2433,6 +2438,12 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
2433
2438
|
"description": "Retrieves currently selected Cell Summary Operation",
|
|
2434
2439
|
"uiLabel": "Get Current Cell Summary Operation"
|
|
2435
2440
|
},
|
|
2441
|
+
{
|
|
2442
|
+
"name": "setCurrentCellSummaryOperation",
|
|
2443
|
+
"kind": "function",
|
|
2444
|
+
"description": "Sets the currently selected Cell Summary Operation",
|
|
2445
|
+
"uiLabel": "Set Current Cell Summary Operation"
|
|
2446
|
+
},
|
|
2436
2447
|
{
|
|
2437
2448
|
"name": "showCellSummaryPopup",
|
|
2438
2449
|
"kind": "function",
|
|
@@ -5685,9 +5696,11 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
5685
5696
|
{
|
|
5686
5697
|
"name": "quickFilterHeight",
|
|
5687
5698
|
"kind": "number",
|
|
5688
|
-
"description": "
|
|
5699
|
+
"description": "Sets a height for Quick Filter Bar (if not provided AG Grid's default is used)",
|
|
5689
5700
|
"uiLabel": "Quick Filter Height",
|
|
5690
|
-
"isOptional": true
|
|
5701
|
+
"isOptional": true,
|
|
5702
|
+
"gridInfo": "item",
|
|
5703
|
+
"defaultValue": "null"
|
|
5691
5704
|
},
|
|
5692
5705
|
{
|
|
5693
5706
|
"name": "quickFilterTrigger",
|
|
@@ -7033,6 +7046,12 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
7033
7046
|
"description": "Retrieves filtered data from the grid",
|
|
7034
7047
|
"uiLabel": "Get Filtered Data"
|
|
7035
7048
|
},
|
|
7049
|
+
{
|
|
7050
|
+
"name": "getFirstDisplayedRowNode",
|
|
7051
|
+
"kind": "function",
|
|
7052
|
+
"description": "Retrieves the first Displayed Row Node in AdapTable",
|
|
7053
|
+
"uiLabel": "Get First Displayed Row Node"
|
|
7054
|
+
},
|
|
7036
7055
|
{
|
|
7037
7056
|
"name": "getFirstRowNode",
|
|
7038
7057
|
"kind": "function",
|
|
@@ -7373,7 +7392,7 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
7373
7392
|
{
|
|
7374
7393
|
"name": "column",
|
|
7375
7394
|
"kind": "REFERENCE",
|
|
7376
|
-
"description": "Column in which cell is
|
|
7395
|
+
"description": "Column in which cell is situated",
|
|
7377
7396
|
"uiLabel": "Column",
|
|
7378
7397
|
"reference": "AdaptableColumn"
|
|
7379
7398
|
},
|
package/src/types.d.ts
CHANGED
|
@@ -104,6 +104,7 @@ export type { AdaptableFormat, DateFormatterOptions, NumberFormatterOptions, Str
|
|
|
104
104
|
export type { AdaptableMessageType } from './PredefinedConfig/Common/AdaptableMessageType';
|
|
105
105
|
export type { AdaptableObject } from './PredefinedConfig/Common/AdaptableObject';
|
|
106
106
|
export type { SuspendableObject } from './PredefinedConfig/Common/SuspendableObject';
|
|
107
|
+
export type { AdaptableQuery, AdaptableAggregatedBooleanQuery, AdaptableAggregatedScalarQuery, AdaptableBooleanQuery, AdaptableObservableQuery, AdaptableScalarQuery, } from './PredefinedConfig/Common/AdaptableQuery';
|
|
107
108
|
export type { AdaptablePredicate, AdaptablePredicateDef, ModuleScope, PredicateDefHandlerParams, PredicateDefInput, PredicateDefToStringParams, } from './PredefinedConfig/Common/AdaptablePredicate';
|
|
108
109
|
export type { FDC3Context, InstrumentContext } from './PredefinedConfig/Common/FDC3Context';
|
|
109
110
|
export type { AdaptableScope } from './PredefinedConfig/Common/AdaptableScope';
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "11.0.
|
|
1
|
+
declare const _default: "11.0.5";
|
|
2
2
|
export default _default;
|
package/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = '11.0.
|
|
3
|
+
exports.default = '11.0.5'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
|