@adaptabletools/adaptable 18.0.0-canary.10 → 18.0.0-canary.12
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/base.css +4 -0
- package/base.css.map +1 -1
- package/index.css +6 -0
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +2 -2
- package/src/AdaptableOptions/ColumnOptions.d.ts +7 -4
- package/src/AdaptableOptions/CommentOptions.d.ts +9 -7
- package/src/AdaptableOptions/NoteOptions.d.ts +4 -1
- package/src/Api/AdaptableApi.d.ts +2 -2
- package/src/Api/ColumnApi.d.ts +4 -0
- package/src/Api/CommentApi.d.ts +11 -12
- package/src/Api/ConfigApi.d.ts +2 -2
- package/src/Api/EventApi.d.ts +7 -9
- package/src/Api/Events/CommentChanged.d.ts +11 -0
- package/src/Api/GridApi.d.ts +4 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -2
- package/src/Api/Implementation/ApiBase.d.ts +2 -2
- package/src/Api/Implementation/ApiBase.js +1 -1
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +10 -0
- package/src/Api/Implementation/CommentsApiImpl.d.ts +1 -2
- package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ConfigApiImpl.js +2 -2
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +9 -0
- package/src/Api/Implementation/{NotesApiImpl.d.ts → NoteApiImpl.d.ts} +7 -7
- package/src/Api/Implementation/{NotesApiImpl.js → NoteApiImpl.js} +5 -5
- package/src/Api/Implementation/OptionsApiImpl.d.ts +4 -5
- package/src/Api/Implementation/OptionsApiImpl.js +2 -12
- package/src/Api/Internal/AdaptableInternalApi.d.ts +1 -1
- package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
- package/src/Api/Internal/ExportInternalApi.js +4 -1
- package/src/Api/Internal/NotesInternalApi.d.ts +1 -1
- package/src/Api/Internal/NotesInternalApi.js +1 -1
- package/src/Api/{NotesApi.d.ts → NoteApi.d.ts} +14 -14
- package/src/Api/OptionsApi.d.ts +8 -12
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
- package/src/PredefinedConfig/CommentState.d.ts +13 -13
- package/src/PredefinedConfig/Common/RowSummary.d.ts +6 -0
- package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +2 -2
- package/src/PredefinedConfig/PredefinedConfig.d.ts +2 -2
- package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
- package/src/PredefinedConfig/SystemState.d.ts +2 -3
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +6 -6
- package/src/Redux/ActionsReducers/NotesRedux.js +1 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +3 -3
- package/src/Redux/Store/AdaptableStore.js +4 -10
- package/src/Strategy/CommentsModule.js +4 -4
- package/src/Strategy/NotesModule.js +5 -5
- package/src/Utilities/Services/CellPopupService.js +2 -2
- package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
- package/src/Utilities/Services/LicenseService/index.js +1 -193
- package/src/Utilities/Services/ReportService.d.ts +7 -5
- package/src/Utilities/Services/ReportService.js +238 -22
- package/src/Utilities/license/decode.js +1 -65
- package/src/Utilities/license/hashing.js +1 -43
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +2 -2
- package/src/View/Components/NewScopeComponent.js +2 -2
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +1 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +2 -1
- package/src/View/Layout/Wizard/LayoutWizard.js +3 -2
- package/src/View/License/LicenseWatermark.js +1 -61
- package/src/View/Notes/NotesPopup.js +3 -3
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -0
- package/src/agGrid/AdaptableAgGrid.js +93 -54
- package/src/agGrid/AgGridAdapter.d.ts +1 -0
- package/src/agGrid/AgGridAdapter.js +3 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +1 -1
- package/src/agGrid/AgGridColumnAdapter.js +2 -2
- package/src/agGrid/AgGridOptionsService.d.ts +4 -1
- package/src/agGrid/AgGridOptionsService.js +22 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +41 -3
- package/src/metamodel/adaptable.metamodel.js +1 -9426
- package/src/types.d.ts +22 -20
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
- package/src/PredefinedConfig/CellAddress.d.ts +0 -13
- package/src/PredefinedConfig/CellAddress.js +0 -4
- /package/src/Api/Events/{CommentsChangedInfo.js → CommentChanged.js} +0 -0
- /package/src/Api/{NotesApi.js → NoteApi.js} +0 -0
- /package/src/PredefinedConfig/{NotesState.js → NoteState.js} +0 -0
|
@@ -139,7 +139,7 @@ export const NewScopeComponent = (props) => {
|
|
|
139
139
|
}
|
|
140
140
|
const hasColumnTypes = React.useMemo(() => {
|
|
141
141
|
var _a;
|
|
142
|
-
return ((_a = api.
|
|
142
|
+
return ((_a = api.columnApi.getColumnTypes()) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
143
143
|
}, []);
|
|
144
144
|
return (React.createElement(Tabs, { "data-name": 'scope-component', className: "ab-ScopeComponent", value: scopeChoice, style: Object.assign({ height: '100%' }, props.style), onValueChange: onScopeSelectChanged },
|
|
145
145
|
props.hideWholeRow ? null : (React.createElement(Tabs.Tab, { value: "Row" },
|
|
@@ -165,7 +165,7 @@ export const NewScopeComponent = (props) => {
|
|
|
165
165
|
React.createElement(Flex, { flexDirection: "column" }, dataTypeOptions.map((dataTypeOption) => (React.createElement(CheckBox, { "data-name": "scope", "data-value": dataTypeOption.value, key: dataTypeOption.value, checked: dataTypesInScope && dataTypesInScope.includes(dataTypeOption.value), onChange: (checked) => onCheckBoxDataTypeChecked(checked, dataTypeOption.value) }, dataTypeOption.label))))))),
|
|
166
166
|
hasColumnTypes && (React.createElement(Tabs.Content, { value: "ColumnType", style: { flex: 'none' }, "data-name": "column-type-scope" },
|
|
167
167
|
React.createElement(Box, null,
|
|
168
|
-
React.createElement(Flex, { flexDirection: "column" }, (_b = (_a = api.
|
|
168
|
+
React.createElement(Flex, { flexDirection: "column" }, (_b = (_a = api.columnApi.getColumnTypes()) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (columnType) => {
|
|
169
169
|
var _a;
|
|
170
170
|
return (React.createElement(CheckBox, { "data-name": "scope", "data-value": columnType, key: columnType, checked: 'ColumnTypes' in props.scope && ((_a = props.scope.ColumnTypes) === null || _a === void 0 ? void 0 : _a.includes(columnType)), onChange: (checked) => {
|
|
171
171
|
let columnTypes = [].concat(props.scope.ColumnTypes);
|
|
@@ -20,7 +20,7 @@ const ConnectedNoteEditor = ({ enableEditMode }) => {
|
|
|
20
20
|
return cellAddress ? GetNotesSelector(state.Notes, cellAddress) : [];
|
|
21
21
|
});
|
|
22
22
|
const handleNoteChange = React.useCallback((value) => {
|
|
23
|
-
api.
|
|
23
|
+
api.noteApi.updateNoteText(value, note);
|
|
24
24
|
}, [note]);
|
|
25
25
|
return (React.createElement(Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-NotesPopup" },
|
|
26
26
|
React.createElement(NoteEditor, { isReadonly: isReadonly, editMode: editMode, key: note === null || note === void 0 ? void 0 : note.Uuid, onClose: () => cellPopupService.hidePopup(), note: note === null || note === void 0 ? void 0 : note.Text, onNoteChange: (value) => handleNoteChange(value) })));
|
|
@@ -79,7 +79,7 @@ const QueryViewPanelComponent = (props) => {
|
|
|
79
79
|
};
|
|
80
80
|
const saveButton = (React.createElement(ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled: disabled || !isExpressionValid || isExpressionNamedQuery || expression == '', variant: "text", tone: "neutral", marginRight: 1 }));
|
|
81
81
|
const suspendButton = (React.createElement(ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
82
|
-
const unSuspendButton = (React.createElement(ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled:
|
|
82
|
+
const unSuspendButton = (React.createElement(ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
83
83
|
const namedQuerySelector = (React.createElement(NamedQuerySelector, { namedQueries: namedQueries, cachedQueries: cachedQueries, currentQuery: gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression, onSelect: (query) => runQuery(query), setGridFilterExpression: (query) => setGridFilterExpression(query) }));
|
|
84
84
|
const columnsDropdown = (React.createElement(DropdownButton, { disabled: disabled, accessLevel: gridFilterAccessLevel, variant: "text", items: availableColumns, marginRight: 1, tooltip: "Pick Columns" },
|
|
85
85
|
React.createElement(Icon, { name: 'list' })));
|
|
@@ -25,8 +25,9 @@ class LayoutViewPanelComponent extends React.Component {
|
|
|
25
25
|
return Object.assign(Object.assign({}, layout), { label: layout.Name, value: layout.Name, onClick: () => this.props.onSelectLayout(layout.Name) });
|
|
26
26
|
});
|
|
27
27
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
28
|
+
let layoutSelectStyle = elementType === 'ToolPanel' ? { minWidth: '100%' } : {};
|
|
28
29
|
return (React.createElement(Flex, { flexDirection: "row", className: `ab-${elementType}__Layout__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
29
|
-
React.createElement(Flex, { flex: 1 },
|
|
30
|
+
React.createElement(Flex, { style: layoutSelectStyle, flex: 1 },
|
|
30
31
|
React.createElement(Select, { style: { width: '100%' }, options: availableLayoutOptions, className: `ab-${elementType}__Layout__select`, value: layoutEntity ? layoutEntity.Name : null, onChange: (layout) => this.props.onSelectLayout(layout) })),
|
|
31
32
|
React.createElement(Flex, { flexDirection: "row", className: join(this.props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Layout__wrap`) },
|
|
32
33
|
isManualSaveLayout && (React.createElement(ButtonSave, { className: `ab-${elementType}__Layout__save`, onClick: () => this.onSaveLayout(), tooltip: "Save Changes to Current Layout", disabled: !this.props.CanSave, accessLevel: accessLevel })),
|
|
@@ -33,8 +33,9 @@ export const LayoutWizard = (props) => {
|
|
|
33
33
|
preparedLayout = ObjectFactory.CreateEmptyLayout({ Name: '' });
|
|
34
34
|
}
|
|
35
35
|
if (preparedLayout.SuppressAggFuncInHeader === undefined) {
|
|
36
|
-
preparedLayout.SuppressAggFuncInHeader =
|
|
37
|
-
|
|
36
|
+
preparedLayout.SuppressAggFuncInHeader = !!adaptable.agGridAdapter
|
|
37
|
+
.getAgGridApi()
|
|
38
|
+
.getGridOption('suppressAggFuncInHeader');
|
|
38
39
|
}
|
|
39
40
|
return preparedLayout;
|
|
40
41
|
});
|
|
@@ -1,61 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Logo } from '../../components/Logo';
|
|
3
|
-
import { Flex } from 'rebass';
|
|
4
|
-
const style = {
|
|
5
|
-
border: '1px solid var(--ab-color-error)',
|
|
6
|
-
padding: '5px',
|
|
7
|
-
fontWeight: 600,
|
|
8
|
-
margin: '5px',
|
|
9
|
-
fontSize: '14px',
|
|
10
|
-
alignItems: 'center',
|
|
11
|
-
color: 'var(--ab-color-text-on-defaultbackground)',
|
|
12
|
-
background: 'var(--ab-color-defaultbackground)',
|
|
13
|
-
};
|
|
14
|
-
const isStyleValid = (element) => {
|
|
15
|
-
const notAllowedProperties = [
|
|
16
|
-
['display', 'none'],
|
|
17
|
-
['opacity', '0'],
|
|
18
|
-
['position', 'absolute'],
|
|
19
|
-
['position', 'fixed'],
|
|
20
|
-
['position', 'relative'],
|
|
21
|
-
['visibility', 'hidden'],
|
|
22
|
-
];
|
|
23
|
-
for (const [prop, value] of notAllowedProperties) {
|
|
24
|
-
if (element.style[prop] === value) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
};
|
|
30
|
-
export const LicenseWatermark = (props) => {
|
|
31
|
-
const ref = React.useRef(null);
|
|
32
|
-
React.useEffect(() => {
|
|
33
|
-
const checkWatermark = () => {
|
|
34
|
-
var _a, _b;
|
|
35
|
-
if (!((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isConnected)) {
|
|
36
|
-
alert('It is not allowed to remove the Adaptable watermark.');
|
|
37
|
-
}
|
|
38
|
-
if (!isStyleValid(ref.current)) {
|
|
39
|
-
alert('It is not allowed to modify the Adaptable watermark.');
|
|
40
|
-
}
|
|
41
|
-
if ((_b = ref === null || ref === void 0 ? void 0 : ref.current) === null || _b === void 0 ? void 0 : _b.style) {
|
|
42
|
-
ref.current.style.border = style.border;
|
|
43
|
-
ref.current.style.padding = style.padding;
|
|
44
|
-
ref.current.style.fontWeight = `${style.fontWeight}`;
|
|
45
|
-
ref.current.style.margin = style.margin;
|
|
46
|
-
ref.current.style.fontSize = style.fontSize;
|
|
47
|
-
ref.current.style.color = style.color;
|
|
48
|
-
ref.current.style.background = style.background;
|
|
49
|
-
ref.current.style.display = 'flex';
|
|
50
|
-
ref.current.style.position = 'static';
|
|
51
|
-
ref.current.style.opacity = '1';
|
|
52
|
-
ref.current.style.visibility = 'visible';
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const timerId = setInterval(checkWatermark, 5000);
|
|
56
|
-
return () => clearTimeout(timerId);
|
|
57
|
-
}, []);
|
|
58
|
-
return (React.createElement(Flex, { style: style, ref: ref },
|
|
59
|
-
React.createElement(Logo, { style: { marginRight: 10 } }),
|
|
60
|
-
React.createElement("div", null, props.children)));
|
|
61
|
-
};
|
|
1
|
+
import*as e from"react";import{Logo as t}from"../../components/Logo";import{Flex as r}from"rebass";const o={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)"},n=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};export const LicenseWatermark=i=>{const l=e.useRef(null);return e.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."),n(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=o.border,l.current.style.padding=o.padding,l.current.style.fontWeight=`${o.fontWeight}`,l.current.style.margin=o.margin,l.current.style.fontSize=o.fontSize,l.current.style.color=o.color,l.current.style.background=o.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)}),[]),e.createElement(r,{style:o,ref:l},e.createElement(t,{style:{marginRight:10}}),e.createElement("div",null,i.children))};
|
|
@@ -45,8 +45,8 @@ export const NotesPopup = (props) => {
|
|
|
45
45
|
defaultWidth: 50,
|
|
46
46
|
render: (params) => {
|
|
47
47
|
return (React.createElement(AdaptableButtonComponent, { variant: "text", icon: "delete", onClick: () => {
|
|
48
|
-
const note = adaptable.api.
|
|
49
|
-
adaptable.api.
|
|
48
|
+
const note = adaptable.api.noteApi.getNoteByUuid(params.data.Uuid);
|
|
49
|
+
adaptable.api.noteApi.deleteNote(note);
|
|
50
50
|
} }));
|
|
51
51
|
},
|
|
52
52
|
},
|
|
@@ -62,7 +62,7 @@ export const NotesPopup = (props) => {
|
|
|
62
62
|
const data = change.data;
|
|
63
63
|
const prevNote = allNotes.find((x) => x.Uuid === uuid);
|
|
64
64
|
if (prevNote.Text !== data.Text) {
|
|
65
|
-
adaptable.api.
|
|
65
|
+
adaptable.api.noteApi.updateNoteText(data.Text, prevNote);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -9,7 +9,7 @@ import { useAdaptable } from './AdaptableContext';
|
|
|
9
9
|
export const SpecialColumnSettingsWizardStep = (props) => {
|
|
10
10
|
var _a, _b, _c;
|
|
11
11
|
const adaptable = useAdaptable();
|
|
12
|
-
const possibleColumnTypes = (_a = adaptable.api.
|
|
12
|
+
const possibleColumnTypes = (_a = adaptable.api.columnApi.getColumnTypes()) !== null && _a !== void 0 ? _a : [];
|
|
13
13
|
const { Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = (_b = props.settings) !== null && _b !== void 0 ? _b : {};
|
|
14
14
|
const handleColumnTypeChange = (columnType, checked) => {
|
|
15
15
|
var _a, _b, _c;
|
|
@@ -300,6 +300,8 @@ export declare class AdaptableAgGrid implements IAdaptable {
|
|
|
300
300
|
canExportToExcel(): boolean;
|
|
301
301
|
exportToExcel(reportData: ReportData, fileName: string): void;
|
|
302
302
|
exportVisualDataToExcel(): void;
|
|
303
|
+
private processRowGroupForExcelExport;
|
|
304
|
+
private processCellForExcelExport;
|
|
303
305
|
isQuickFilterAvailable(): boolean;
|
|
304
306
|
private hasFloatingFilterOnAtLeastOneColumn;
|
|
305
307
|
getChartRef(chartId: string): ChartRef;
|
|
@@ -360,7 +360,7 @@ export class AdaptableAgGrid {
|
|
|
360
360
|
this.api.themeApi.applyCurrentTheme();
|
|
361
361
|
this.validatePrimaryKey();
|
|
362
362
|
this.embedColumnMenu = this.agGridAdapter.isModulePresent(ModuleNames.MenuModule);
|
|
363
|
-
this.api.internalApi.setTreeMode(this.agGridAdapter.
|
|
363
|
+
this.api.internalApi.setTreeMode(!!this.agGridAdapter.getAgGridApi().getGridOption('treeData'));
|
|
364
364
|
// TODO AFL MIG: we could just patch the defautl Layout on init? instead
|
|
365
365
|
this.checkShouldClearExistingFiltersOrSearches();
|
|
366
366
|
this.applyColumnFiltering();
|
|
@@ -886,6 +886,13 @@ export class AdaptableAgGrid {
|
|
|
886
886
|
}
|
|
887
887
|
return original_floatingFiltersHeight;
|
|
888
888
|
});
|
|
889
|
+
/**
|
|
890
|
+
* `excelStyles`
|
|
891
|
+
*/
|
|
892
|
+
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'excelStyles', (original_excelStyles) => {
|
|
893
|
+
// we need this here just to register the original excelStyles in the service
|
|
894
|
+
return original_excelStyles;
|
|
895
|
+
});
|
|
889
896
|
/**
|
|
890
897
|
* `columnTypes`
|
|
891
898
|
*/
|
|
@@ -1058,7 +1065,7 @@ export class AdaptableAgGrid {
|
|
|
1058
1065
|
return resultColDefs;
|
|
1059
1066
|
}
|
|
1060
1067
|
useRowNodeLookUp() {
|
|
1061
|
-
return this.agGridAdapter.
|
|
1068
|
+
return this.agGridAdapter.getAgGridApi().getGridOption('getRowId') != undefined;
|
|
1062
1069
|
}
|
|
1063
1070
|
getAgGridContainerElement() {
|
|
1064
1071
|
if (!this.DANGER_USE_GETTER_agGridContainerElement) {
|
|
@@ -1105,8 +1112,8 @@ export class AdaptableAgGrid {
|
|
|
1105
1112
|
return selectedRowInfo;
|
|
1106
1113
|
}
|
|
1107
1114
|
isGridSelectable() {
|
|
1108
|
-
|
|
1109
|
-
|
|
1115
|
+
const rowSelection = this.agGridAdapter.getAgGridApi().getGridOption('rowSelection');
|
|
1116
|
+
return rowSelection === 'single' || rowSelection === 'multiple';
|
|
1110
1117
|
}
|
|
1111
1118
|
initAdaptableStore() {
|
|
1112
1119
|
const perfNewAdaptableStore = this.logger.beginPerf(`initAdaptableStore()`);
|
|
@@ -1614,7 +1621,9 @@ export class AdaptableAgGrid {
|
|
|
1614
1621
|
this.api.eventApi.on('AdaptableReady', () => {
|
|
1615
1622
|
var _a, _b;
|
|
1616
1623
|
// update status bar state
|
|
1617
|
-
const adaptableStatusPanels = (_b = (_a = this.agGridAdapter
|
|
1624
|
+
const adaptableStatusPanels = (_b = (_a = this.agGridAdapter
|
|
1625
|
+
.getAgGridApi()
|
|
1626
|
+
.getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) === null || _b === void 0 ? void 0 : _b.filter((statusPanel) => this.adaptableStatusPanelKeys.includes(statusPanel.key));
|
|
1618
1627
|
const statusBarModule = this.ModuleService.getModuleById(ModuleConstants.StatusBarModuleId);
|
|
1619
1628
|
// need to add only the adaptable panels
|
|
1620
1629
|
statusBarModule.syncStateWithOptions(adaptableStatusPanels);
|
|
@@ -2407,10 +2416,10 @@ export class AdaptableAgGrid {
|
|
|
2407
2416
|
});
|
|
2408
2417
|
}
|
|
2409
2418
|
getAgGridRowModelType() {
|
|
2410
|
-
var _a
|
|
2419
|
+
var _a;
|
|
2411
2420
|
// it seems that this can be null so we need explicitly to return "clientSide" in this case
|
|
2412
2421
|
// need to check that for ServerSideRowModel it is ALWAYS returned...
|
|
2413
|
-
return (
|
|
2422
|
+
return (_a = this.agGridAdapter.getAgGridApi().getGridOption('rowModelType')) !== null && _a !== void 0 ? _a : 'clientSide';
|
|
2414
2423
|
}
|
|
2415
2424
|
getAllRowNodes(config) {
|
|
2416
2425
|
let rowNodes = [];
|
|
@@ -2533,7 +2542,7 @@ export class AdaptableAgGrid {
|
|
|
2533
2542
|
}
|
|
2534
2543
|
canGenerateCharts() {
|
|
2535
2544
|
return (this.agGridAdapter.isModulePresent(ModuleNames.GridChartsModule) &&
|
|
2536
|
-
this.agGridAdapter.
|
|
2545
|
+
this.agGridAdapter.getAgGridApi().getGridOption('enableCharts'));
|
|
2537
2546
|
}
|
|
2538
2547
|
canDisplaySparklines() {
|
|
2539
2548
|
return this.agGridAdapter.isModulePresent(ModuleNames.SparklinesModule);
|
|
@@ -3048,52 +3057,82 @@ export class AdaptableAgGrid {
|
|
|
3048
3057
|
ephemeralGridApi.destroy();
|
|
3049
3058
|
}
|
|
3050
3059
|
exportVisualDataToExcel() {
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3060
|
+
try {
|
|
3061
|
+
const exportExcelStyles = this.ReportService.buildExcelStylesForVisualReports();
|
|
3062
|
+
this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
|
|
3063
|
+
this.agGridAdapter.getAgGridApi().exportDataAsExcel({
|
|
3064
|
+
sheetName: 'Sheet 1',
|
|
3065
|
+
fileName: this.ReportService.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
|
|
3066
|
+
// delegate the cell value processing to Adaptable
|
|
3067
|
+
processCellCallback: ({ node, column, value }) => {
|
|
3068
|
+
var _a;
|
|
3069
|
+
const columnId = column.getColId();
|
|
3070
|
+
if ((node === null || node === void 0 ? void 0 : node.group) &&
|
|
3071
|
+
(this.api.columnApi.isAutoRowGroupColumn(columnId) ||
|
|
3072
|
+
// we would still need to process the cell if this is a group row with an aggregated value
|
|
3073
|
+
((_a = node === null || node === void 0 ? void 0 : node.aggData) === null || _a === void 0 ? void 0 : _a[columnId]) == undefined)) {
|
|
3074
|
+
// skip processing of row groups, this was already handled in processRowGroupCallback()
|
|
3075
|
+
return value;
|
|
3076
|
+
}
|
|
3077
|
+
return this.processCellForExcelExport(node, columnId);
|
|
3078
|
+
},
|
|
3079
|
+
processRowGroupCallback: (params) => {
|
|
3080
|
+
var _a;
|
|
3081
|
+
// recreating the standard AG Grid styling for row groups: 'Parent -> Child'
|
|
3082
|
+
// additionally the values are formatted
|
|
3083
|
+
let rowGroupNode = params.node;
|
|
3084
|
+
const isFooterRow = rowGroupNode.footer;
|
|
3085
|
+
const rowGroupSummary = [(_a = this.processRowGroupForExcelExport(rowGroupNode)) !== null && _a !== void 0 ? _a : ''];
|
|
3086
|
+
while (rowGroupNode.parent) {
|
|
3087
|
+
rowGroupNode = rowGroupNode.parent;
|
|
3088
|
+
const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode);
|
|
3089
|
+
if (formattedParentNode) {
|
|
3090
|
+
rowGroupSummary.push(formattedParentNode);
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
let summary = rowGroupSummary.reverse().join(' -> ');
|
|
3094
|
+
if (isFooterRow) {
|
|
3095
|
+
summary = `Total: ${summary}`;
|
|
3096
|
+
}
|
|
3097
|
+
return summary;
|
|
3098
|
+
},
|
|
3099
|
+
});
|
|
3100
|
+
this.agGridOptionsService.revertGridOptionsPropertyToUserValue('excelStyles');
|
|
3101
|
+
}
|
|
3102
|
+
catch (error) {
|
|
3103
|
+
this.logger.consoleError('Error exporting visual data to Excel', error);
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
processRowGroupForExcelExport(rowNode) {
|
|
3107
|
+
var _a, _b, _c, _d, _e;
|
|
3108
|
+
const columnId = (_c = (_a = rowNode.field) !== null && _a !== void 0 ? _a : (_b = rowNode.rowGroupColumn) === null || _b === void 0 ? void 0 : _b.getColId()) !== null && _c !== void 0 ? _c : (_e = (_d = rowNode.rowGroupColumn) === null || _d === void 0 ? void 0 : _d.getColDef()) === null || _e === void 0 ? void 0 : _e.field;
|
|
3109
|
+
if (!columnId || !rowNode.key) {
|
|
3110
|
+
return;
|
|
3111
|
+
}
|
|
3112
|
+
let rawValue = rowNode.key;
|
|
3113
|
+
if (this.api.columnApi.getColumnDataTypeForColumnId(columnId) === 'Date' &&
|
|
3114
|
+
typeof rawValue === 'string' &&
|
|
3115
|
+
// rawValue is composed only of digits
|
|
3116
|
+
/^\d+$/.test(rawValue)) {
|
|
3117
|
+
// AG-Grid converts the value to string, we have to reconvert it back
|
|
3118
|
+
const dateRawValue = parseInt(rawValue);
|
|
3119
|
+
if (dateRawValue != undefined) {
|
|
3120
|
+
// @ts-ignore
|
|
3121
|
+
rawValue = dateRawValue;
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
return this.ReportService.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
|
|
3125
|
+
}
|
|
3126
|
+
processCellForExcelExport(rowNode, columnId) {
|
|
3127
|
+
if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
|
|
3128
|
+
const cellKey = this.agGridColumnAdapter.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
|
|
3129
|
+
const isoFormattedDate = this.ReportService.getExcelStyleWithFormattedDate(cellKey);
|
|
3130
|
+
if (isoFormattedDate) {
|
|
3131
|
+
// this is a Date cell which will be formatted by Excel
|
|
3132
|
+
return isoFormattedDate;
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
return this.ReportService.getCellExportValueFromRowNode(rowNode, columnId);
|
|
3097
3136
|
}
|
|
3098
3137
|
isQuickFilterAvailable() {
|
|
3099
3138
|
if (this.api.layoutApi.getCurrentLayout().EnablePivot) {
|
|
@@ -25,6 +25,7 @@ export declare class AgGridAdapter {
|
|
|
25
25
|
getLiveGridOptions(): GridOptions | undefined;
|
|
26
26
|
updateGridOptions(options: ManagedGridOptions): void;
|
|
27
27
|
setGridOption<Key extends ManagedGridOptionKey>(key: Key, value: GridOptions[Key]): void;
|
|
28
|
+
getUserGridOptionsProperty<T extends keyof GridOptions>(propertyName: T): GridOptions[T];
|
|
28
29
|
updateColumnFilterActiveState(): void;
|
|
29
30
|
deriveSelectedCellInfoFromAgGrid(): SelectedCellInfo;
|
|
30
31
|
deriveSelectedRowInfoFromAgGrid(): SelectedRowInfo;
|
|
@@ -64,6 +64,9 @@ export class AgGridAdapter {
|
|
|
64
64
|
var _a;
|
|
65
65
|
(_a = this.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.setGridOption(key, value);
|
|
66
66
|
}
|
|
67
|
+
getUserGridOptionsProperty(propertyName) {
|
|
68
|
+
return this.adaptableInstance.agGridOptionsService.getUserGridOptionsProperty(propertyName);
|
|
69
|
+
}
|
|
67
70
|
updateColumnFilterActiveState() {
|
|
68
71
|
var _a;
|
|
69
72
|
const columnFilters = this.adaptableApi.columnFilterApi.getActiveColumnFilters();
|
|
@@ -30,7 +30,7 @@ export declare class AgGridColumnAdapter {
|
|
|
30
30
|
private setupColumnEditable;
|
|
31
31
|
private setupColumnValueSetter;
|
|
32
32
|
private setupColumnComparator;
|
|
33
|
-
|
|
33
|
+
getExcelClassNameForCell(colId: string, primaryKeyValue: any, userDefinedCellClass?: string | string[]): string;
|
|
34
34
|
private isQuickSearchActive;
|
|
35
35
|
private getEditableCellClass;
|
|
36
36
|
private getReadonlyCellClass;
|
|
@@ -606,14 +606,14 @@ export class AgGridColumnAdapter {
|
|
|
606
606
|
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Notes')) {
|
|
607
607
|
return;
|
|
608
608
|
}
|
|
609
|
-
if (!this.adaptableApi.
|
|
609
|
+
if (!this.adaptableApi.noteApi.internalApi.areNotesAvailable()) {
|
|
610
610
|
return;
|
|
611
611
|
}
|
|
612
612
|
const cellPosition = {
|
|
613
613
|
PrimaryKeyValue: gridCell.primaryKeyValue,
|
|
614
614
|
ColumnId: gridCell.column.columnId,
|
|
615
615
|
};
|
|
616
|
-
const cellNotes = this.adaptableApi.
|
|
616
|
+
const cellNotes = this.adaptableApi.noteApi.getCellNotes(cellPosition);
|
|
617
617
|
if (!(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
|
|
618
618
|
return undefined;
|
|
619
619
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdaptableAgGrid } from './AdaptableAgGrid';
|
|
2
|
-
import { GridOptions } from '@ag-grid-community/core';
|
|
2
|
+
import { GridOptions, ManagedGridOptionKey } from '@ag-grid-community/core';
|
|
3
3
|
export declare class AgGridOptionsService {
|
|
4
4
|
private adaptableInstance;
|
|
5
5
|
private gridOptionsPropertyCache;
|
|
@@ -7,6 +7,9 @@ export declare class AgGridOptionsService {
|
|
|
7
7
|
constructor(adaptableInstance: AdaptableAgGrid);
|
|
8
8
|
destroy(): void;
|
|
9
9
|
setGridOptionsProperty<T extends keyof GridOptions>(gridOptions: GridOptions, propertyName: T, propertyGetter: (userPropertyValue: GridOptions[T]) => GridOptions[T] | undefined): GridOptions;
|
|
10
|
+
getUserGridOptionsProperty<T extends keyof GridOptions>(propertyName: T): GridOptions[T];
|
|
11
|
+
revertGridOptionsPropertyToUserValue(propertyName: ManagedGridOptionKey): void;
|
|
12
|
+
CAREFUL_patchGridOptionsProperty<T extends keyof GridOptions>(propertyName: T, value: GridOptions[T]): void;
|
|
10
13
|
revertGridOptionsPropertiesToUserValue<T extends keyof GridOptions>(gridOptions: GridOptions, propertyNames: T[]): void;
|
|
11
14
|
private get agGridAdapter();
|
|
12
15
|
}
|
|
@@ -40,6 +40,28 @@ export class AgGridOptionsService {
|
|
|
40
40
|
gridOptions[propertyName] = adaptableValue !== null && adaptableValue !== void 0 ? adaptableValue : userValue;
|
|
41
41
|
return gridOptions;
|
|
42
42
|
}
|
|
43
|
+
getUserGridOptionsProperty(propertyName) {
|
|
44
|
+
const userKey = `user.${propertyName}`;
|
|
45
|
+
return this.gridOptionsPropertyCache.get(userKey);
|
|
46
|
+
}
|
|
47
|
+
revertGridOptionsPropertyToUserValue(propertyName) {
|
|
48
|
+
const userKey = `user.${propertyName}`;
|
|
49
|
+
const userValue = this.gridOptionsPropertyCache.get(userKey);
|
|
50
|
+
this.agGridAdapter.setGridOption(propertyName, userValue);
|
|
51
|
+
}
|
|
52
|
+
CAREFUL_patchGridOptionsProperty(propertyName, value) {
|
|
53
|
+
var _a;
|
|
54
|
+
// @ts-ignore this is required to set gridOptions peroperties which are marked as initial (writable once, before grid is initialised)
|
|
55
|
+
const gos = (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.gos;
|
|
56
|
+
if (gos) {
|
|
57
|
+
gos.updateGridOptions({
|
|
58
|
+
options: {
|
|
59
|
+
[propertyName]: value,
|
|
60
|
+
},
|
|
61
|
+
source: 'api',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
43
65
|
revertGridOptionsPropertiesToUserValue(gridOptions, propertyNames) {
|
|
44
66
|
for (const propertyName of propertyNames) {
|
|
45
67
|
// see this.setGridOptionsProperty(...)
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "18.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1711034314862 || Date.now(),
|
|
4
|
+
VERSION: "18.0.0-canary.12" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -1919,6 +1919,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1919
1919
|
desc: string;
|
|
1920
1920
|
}[];
|
|
1921
1921
|
};
|
|
1922
|
+
ColumnTypesContext: {
|
|
1923
|
+
name: string;
|
|
1924
|
+
kind: string;
|
|
1925
|
+
desc: string;
|
|
1926
|
+
};
|
|
1922
1927
|
ColumnValuesComparer: {
|
|
1923
1928
|
name: string;
|
|
1924
1929
|
kind: string;
|
|
@@ -1939,8 +1944,25 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1939
1944
|
name: string;
|
|
1940
1945
|
kind: string;
|
|
1941
1946
|
desc: string;
|
|
1947
|
+
props: {
|
|
1948
|
+
name: string;
|
|
1949
|
+
kind: string;
|
|
1950
|
+
desc: string;
|
|
1951
|
+
ref: string;
|
|
1952
|
+
}[];
|
|
1953
|
+
};
|
|
1954
|
+
CommentOptions: {
|
|
1955
|
+
name: string;
|
|
1956
|
+
kind: string;
|
|
1957
|
+
desc: string;
|
|
1958
|
+
props: {
|
|
1959
|
+
name: string;
|
|
1960
|
+
kind: string;
|
|
1961
|
+
desc: string;
|
|
1962
|
+
isOpt: boolean;
|
|
1963
|
+
}[];
|
|
1942
1964
|
};
|
|
1943
|
-
|
|
1965
|
+
CommentState: {
|
|
1944
1966
|
name: string;
|
|
1945
1967
|
kind: string;
|
|
1946
1968
|
desc: string;
|
|
@@ -3979,8 +4001,14 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3979
4001
|
name: string;
|
|
3980
4002
|
kind: string;
|
|
3981
4003
|
desc: string;
|
|
4004
|
+
props: {
|
|
4005
|
+
name: string;
|
|
4006
|
+
kind: string;
|
|
4007
|
+
desc: string;
|
|
4008
|
+
ref: string;
|
|
4009
|
+
}[];
|
|
3982
4010
|
};
|
|
3983
|
-
|
|
4011
|
+
NoteOptions: {
|
|
3984
4012
|
name: string;
|
|
3985
4013
|
kind: string;
|
|
3986
4014
|
desc: string;
|
|
@@ -3991,7 +4019,7 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3991
4019
|
isOpt: boolean;
|
|
3992
4020
|
}[];
|
|
3993
4021
|
};
|
|
3994
|
-
|
|
4022
|
+
NoteState: {
|
|
3995
4023
|
name: string;
|
|
3996
4024
|
kind: string;
|
|
3997
4025
|
desc: string;
|
|
@@ -4714,6 +4742,16 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4714
4742
|
ref?: undefined;
|
|
4715
4743
|
})[];
|
|
4716
4744
|
};
|
|
4745
|
+
RowSummary: {
|
|
4746
|
+
name: string;
|
|
4747
|
+
kind: string;
|
|
4748
|
+
desc: string;
|
|
4749
|
+
};
|
|
4750
|
+
RowSummaryPosition: {
|
|
4751
|
+
name: string;
|
|
4752
|
+
kind: string;
|
|
4753
|
+
desc: string;
|
|
4754
|
+
};
|
|
4717
4755
|
Schedule: {
|
|
4718
4756
|
name: string;
|
|
4719
4757
|
kind: string;
|