@adaptabletools/adaptable-cjs 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} +6 -6
- 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 +3 -3
- 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 +3 -9
- 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 -198
- package/src/Utilities/Services/ReportService.d.ts +7 -5
- package/src/Utilities/Services/ReportService.js +238 -22
- package/src/Utilities/license/decode.js +1 -70
- package/src/Utilities/license/hashing.js +1 -47
- 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 -66
- 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 -9429
- package/src/types.d.ts +22 -20
- package/tsconfig.cjs.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 -5
- /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
|
@@ -37,7 +37,7 @@ const CalculatedColumnWizard = (props) => {
|
|
|
37
37
|
if ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.column) {
|
|
38
38
|
const calculatedColumn = allCalculatedColumns.find((calculatedColumn) => calculatedColumn.ColumnId === props.popupParams.column.columnId);
|
|
39
39
|
if (calculatedColumn) {
|
|
40
|
-
return calculatedColumn;
|
|
40
|
+
return (0, Helper_1.cloneObject)(calculatedColumn);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
return ObjectFactory_1.default.CreateEmptyCalculatedColumn();
|
|
@@ -55,7 +55,7 @@ const CalculatedColumnWizard = (props) => {
|
|
|
55
55
|
};
|
|
56
56
|
const [expressionType, setExpressionType] = (0, react_1.useState)(() => {
|
|
57
57
|
var _a;
|
|
58
|
-
return (_a = (0, utils_1.getExpressionType)(
|
|
58
|
+
return (_a = (0, utils_1.getExpressionType)(calculatedColumn, adaptable.api)) !== null && _a !== void 0 ? _a : 'ScalarExpression';
|
|
59
59
|
});
|
|
60
60
|
const handleExpressionTypeChange = (type) => {
|
|
61
61
|
setExpressionType(type);
|
|
@@ -145,7 +145,7 @@ const NewScopeComponent = (props) => {
|
|
|
145
145
|
}
|
|
146
146
|
const hasColumnTypes = React.useMemo(() => {
|
|
147
147
|
var _a;
|
|
148
|
-
return ((_a = api.
|
|
148
|
+
return ((_a = api.columnApi.getColumnTypes()) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
149
149
|
}, []);
|
|
150
150
|
return (React.createElement(Tabs_1.Tabs, { "data-name": 'scope-component', className: "ab-ScopeComponent", value: scopeChoice, style: Object.assign({ height: '100%' }, props.style), onValueChange: onScopeSelectChanged },
|
|
151
151
|
props.hideWholeRow ? null : (React.createElement(Tabs_1.Tabs.Tab, { value: "Row" },
|
|
@@ -171,7 +171,7 @@ const NewScopeComponent = (props) => {
|
|
|
171
171
|
React.createElement(rebass_1.Flex, { flexDirection: "column" }, dataTypeOptions.map((dataTypeOption) => (React.createElement(CheckBox_1.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))))))),
|
|
172
172
|
hasColumnTypes && (React.createElement(Tabs_1.Tabs.Content, { value: "ColumnType", style: { flex: 'none' }, "data-name": "column-type-scope" },
|
|
173
173
|
React.createElement(rebass_1.Box, null,
|
|
174
|
-
React.createElement(rebass_1.Flex, { flexDirection: "column" }, (_b = (_a = api.
|
|
174
|
+
React.createElement(rebass_1.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) => {
|
|
175
175
|
var _a;
|
|
176
176
|
return (React.createElement(CheckBox_1.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) => {
|
|
177
177
|
let columnTypes = [].concat(props.scope.ColumnTypes);
|
|
@@ -24,7 +24,7 @@ const ConnectedNoteEditor = ({ enableEditMode }) => {
|
|
|
24
24
|
return cellAddress ? (0, NotesRedux_1.GetNotesSelector)(state.Notes, cellAddress) : [];
|
|
25
25
|
});
|
|
26
26
|
const handleNoteChange = React.useCallback((value) => {
|
|
27
|
-
api.
|
|
27
|
+
api.noteApi.updateNoteText(value, note);
|
|
28
28
|
}, [note]);
|
|
29
29
|
return (React.createElement(rebass_1.Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-NotesPopup" },
|
|
30
30
|
React.createElement(NoteEditor_1.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) })));
|
|
@@ -83,7 +83,7 @@ const QueryViewPanelComponent = (props) => {
|
|
|
83
83
|
};
|
|
84
84
|
const saveButton = (React.createElement(ButtonSave_1.ButtonSave, { onClick: () => saveQuery(), tooltip: "Save as Named Query", accessLevel: namedQueryModuleAccessLevel, disabled: disabled || !isExpressionValid || isExpressionNamedQuery || expression == '', variant: "text", tone: "neutral", marginRight: 1 }));
|
|
85
85
|
const suspendButton = (React.createElement(ButtonPause_1.ButtonPause, { onClick: () => suspendGridFilter(), tooltip: "Suspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: disabled || !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
86
|
-
const unSuspendButton = (React.createElement(ButtonUnsuspend_1.ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled:
|
|
86
|
+
const unSuspendButton = (React.createElement(ButtonUnsuspend_1.ButtonUnsuspend, { onClick: () => unSuspendGridFilter(), tooltip: "Unsuspend Grid Filter", accessLevel: gridFilterAccessLevel, disabled: !isExpressionValid, variant: "text", tone: "neutral", marginRight: 1 }));
|
|
87
87
|
const namedQuerySelector = (React.createElement(NamedQuerySelector_1.NamedQuerySelector, { namedQueries: namedQueries, cachedQueries: cachedQueries, currentQuery: gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression, onSelect: (query) => runQuery(query), setGridFilterExpression: (query) => setGridFilterExpression(query) }));
|
|
88
88
|
const columnsDropdown = (React.createElement(DropdownButton_1.default, { disabled: disabled, accessLevel: gridFilterAccessLevel, variant: "text", items: availableColumns, marginRight: 1, tooltip: "Pick Columns" },
|
|
89
89
|
React.createElement(icons_1.Icon, { name: 'list' })));
|
|
@@ -29,8 +29,9 @@ class LayoutViewPanelComponent extends React.Component {
|
|
|
29
29
|
return Object.assign(Object.assign({}, layout), { label: layout.Name, value: layout.Name, onClick: () => this.props.onSelectLayout(layout.Name) });
|
|
30
30
|
});
|
|
31
31
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
32
|
+
let layoutSelectStyle = elementType === 'ToolPanel' ? { minWidth: '100%' } : {};
|
|
32
33
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Layout__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
33
|
-
React.createElement(rebass_1.Flex, { flex: 1 },
|
|
34
|
+
React.createElement(rebass_1.Flex, { style: layoutSelectStyle, flex: 1 },
|
|
34
35
|
React.createElement(Select_1.Select, { style: { width: '100%' }, options: availableLayoutOptions, className: `ab-${elementType}__Layout__select`, value: layoutEntity ? layoutEntity.Name : null, onChange: (layout) => this.props.onSelectLayout(layout) })),
|
|
35
36
|
React.createElement(rebass_1.Flex, { flexDirection: "row", className: (0, join_1.default)(this.props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Layout__wrap`) },
|
|
36
37
|
isManualSaveLayout && (React.createElement(ButtonSave_1.ButtonSave, { className: `ab-${elementType}__Layout__save`, onClick: () => this.onSaveLayout(), tooltip: "Save Changes to Current Layout", disabled: !this.props.CanSave, accessLevel: accessLevel })),
|
|
@@ -37,8 +37,9 @@ const LayoutWizard = (props) => {
|
|
|
37
37
|
preparedLayout = ObjectFactory_1.default.CreateEmptyLayout({ Name: '' });
|
|
38
38
|
}
|
|
39
39
|
if (preparedLayout.SuppressAggFuncInHeader === undefined) {
|
|
40
|
-
preparedLayout.SuppressAggFuncInHeader =
|
|
41
|
-
|
|
40
|
+
preparedLayout.SuppressAggFuncInHeader = !!adaptable.agGridAdapter
|
|
41
|
+
.getAgGridApi()
|
|
42
|
+
.getGridOption('suppressAggFuncInHeader');
|
|
42
43
|
}
|
|
43
44
|
return preparedLayout;
|
|
44
45
|
});
|
|
@@ -1,66 +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
|
-
const 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
|
-
};
|
|
66
|
-
exports.LicenseWatermark = LicenseWatermark;
|
|
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},l=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))};exports.LicenseWatermark=l;
|
|
@@ -49,8 +49,8 @@ const NotesPopup = (props) => {
|
|
|
49
49
|
defaultWidth: 50,
|
|
50
50
|
render: (params) => {
|
|
51
51
|
return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { variant: "text", icon: "delete", onClick: () => {
|
|
52
|
-
const note = adaptable.api.
|
|
53
|
-
adaptable.api.
|
|
52
|
+
const note = adaptable.api.noteApi.getNoteByUuid(params.data.Uuid);
|
|
53
|
+
adaptable.api.noteApi.deleteNote(note);
|
|
54
54
|
} }));
|
|
55
55
|
},
|
|
56
56
|
},
|
|
@@ -66,7 +66,7 @@ const NotesPopup = (props) => {
|
|
|
66
66
|
const data = change.data;
|
|
67
67
|
const prevNote = allNotes.find((x) => x.Uuid === uuid);
|
|
68
68
|
if (prevNote.Text !== data.Text) {
|
|
69
|
-
adaptable.api.
|
|
69
|
+
adaptable.api.noteApi.updateNoteText(data.Text, prevNote);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -13,7 +13,7 @@ const AdaptableContext_1 = require("./AdaptableContext");
|
|
|
13
13
|
const SpecialColumnSettingsWizardStep = (props) => {
|
|
14
14
|
var _a, _b, _c;
|
|
15
15
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
16
|
-
const possibleColumnTypes = (_a = adaptable.api.
|
|
16
|
+
const possibleColumnTypes = (_a = adaptable.api.columnApi.getColumnTypes()) !== null && _a !== void 0 ? _a : [];
|
|
17
17
|
const { Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = (_b = props.settings) !== null && _b !== void 0 ? _b : {};
|
|
18
18
|
const handleColumnTypeChange = (columnType, checked) => {
|
|
19
19
|
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;
|
|
@@ -364,7 +364,7 @@ class AdaptableAgGrid {
|
|
|
364
364
|
this.api.themeApi.applyCurrentTheme();
|
|
365
365
|
this.validatePrimaryKey();
|
|
366
366
|
this.embedColumnMenu = this.agGridAdapter.isModulePresent(core_1.ModuleNames.MenuModule);
|
|
367
|
-
this.api.internalApi.setTreeMode(this.agGridAdapter.
|
|
367
|
+
this.api.internalApi.setTreeMode(!!this.agGridAdapter.getAgGridApi().getGridOption('treeData'));
|
|
368
368
|
// TODO AFL MIG: we could just patch the defautl Layout on init? instead
|
|
369
369
|
this.checkShouldClearExistingFiltersOrSearches();
|
|
370
370
|
this.applyColumnFiltering();
|
|
@@ -890,6 +890,13 @@ class AdaptableAgGrid {
|
|
|
890
890
|
}
|
|
891
891
|
return original_floatingFiltersHeight;
|
|
892
892
|
});
|
|
893
|
+
/**
|
|
894
|
+
* `excelStyles`
|
|
895
|
+
*/
|
|
896
|
+
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'excelStyles', (original_excelStyles) => {
|
|
897
|
+
// we need this here just to register the original excelStyles in the service
|
|
898
|
+
return original_excelStyles;
|
|
899
|
+
});
|
|
893
900
|
/**
|
|
894
901
|
* `columnTypes`
|
|
895
902
|
*/
|
|
@@ -1062,7 +1069,7 @@ class AdaptableAgGrid {
|
|
|
1062
1069
|
return resultColDefs;
|
|
1063
1070
|
}
|
|
1064
1071
|
useRowNodeLookUp() {
|
|
1065
|
-
return this.agGridAdapter.
|
|
1072
|
+
return this.agGridAdapter.getAgGridApi().getGridOption('getRowId') != undefined;
|
|
1066
1073
|
}
|
|
1067
1074
|
getAgGridContainerElement() {
|
|
1068
1075
|
if (!this.DANGER_USE_GETTER_agGridContainerElement) {
|
|
@@ -1109,8 +1116,8 @@ class AdaptableAgGrid {
|
|
|
1109
1116
|
return selectedRowInfo;
|
|
1110
1117
|
}
|
|
1111
1118
|
isGridSelectable() {
|
|
1112
|
-
|
|
1113
|
-
|
|
1119
|
+
const rowSelection = this.agGridAdapter.getAgGridApi().getGridOption('rowSelection');
|
|
1120
|
+
return rowSelection === 'single' || rowSelection === 'multiple';
|
|
1114
1121
|
}
|
|
1115
1122
|
initAdaptableStore() {
|
|
1116
1123
|
const perfNewAdaptableStore = this.logger.beginPerf(`initAdaptableStore()`);
|
|
@@ -1618,7 +1625,9 @@ class AdaptableAgGrid {
|
|
|
1618
1625
|
this.api.eventApi.on('AdaptableReady', () => {
|
|
1619
1626
|
var _a, _b;
|
|
1620
1627
|
// update status bar state
|
|
1621
|
-
const adaptableStatusPanels = (_b = (_a = this.agGridAdapter
|
|
1628
|
+
const adaptableStatusPanels = (_b = (_a = this.agGridAdapter
|
|
1629
|
+
.getAgGridApi()
|
|
1630
|
+
.getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) === null || _b === void 0 ? void 0 : _b.filter((statusPanel) => this.adaptableStatusPanelKeys.includes(statusPanel.key));
|
|
1622
1631
|
const statusBarModule = this.ModuleService.getModuleById(ModuleConstants.StatusBarModuleId);
|
|
1623
1632
|
// need to add only the adaptable panels
|
|
1624
1633
|
statusBarModule.syncStateWithOptions(adaptableStatusPanels);
|
|
@@ -2411,10 +2420,10 @@ class AdaptableAgGrid {
|
|
|
2411
2420
|
});
|
|
2412
2421
|
}
|
|
2413
2422
|
getAgGridRowModelType() {
|
|
2414
|
-
var _a
|
|
2423
|
+
var _a;
|
|
2415
2424
|
// it seems that this can be null so we need explicitly to return "clientSide" in this case
|
|
2416
2425
|
// need to check that for ServerSideRowModel it is ALWAYS returned...
|
|
2417
|
-
return (
|
|
2426
|
+
return (_a = this.agGridAdapter.getAgGridApi().getGridOption('rowModelType')) !== null && _a !== void 0 ? _a : 'clientSide';
|
|
2418
2427
|
}
|
|
2419
2428
|
getAllRowNodes(config) {
|
|
2420
2429
|
let rowNodes = [];
|
|
@@ -2537,7 +2546,7 @@ class AdaptableAgGrid {
|
|
|
2537
2546
|
}
|
|
2538
2547
|
canGenerateCharts() {
|
|
2539
2548
|
return (this.agGridAdapter.isModulePresent(core_1.ModuleNames.GridChartsModule) &&
|
|
2540
|
-
this.agGridAdapter.
|
|
2549
|
+
this.agGridAdapter.getAgGridApi().getGridOption('enableCharts'));
|
|
2541
2550
|
}
|
|
2542
2551
|
canDisplaySparklines() {
|
|
2543
2552
|
return this.agGridAdapter.isModulePresent(core_1.ModuleNames.SparklinesModule);
|
|
@@ -3052,52 +3061,82 @@ class AdaptableAgGrid {
|
|
|
3052
3061
|
ephemeralGridApi.destroy();
|
|
3053
3062
|
}
|
|
3054
3063
|
exportVisualDataToExcel() {
|
|
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
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3064
|
+
try {
|
|
3065
|
+
const exportExcelStyles = this.ReportService.buildExcelStylesForVisualReports();
|
|
3066
|
+
this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
|
|
3067
|
+
this.agGridAdapter.getAgGridApi().exportDataAsExcel({
|
|
3068
|
+
sheetName: 'Sheet 1',
|
|
3069
|
+
fileName: this.ReportService.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
|
|
3070
|
+
// delegate the cell value processing to Adaptable
|
|
3071
|
+
processCellCallback: ({ node, column, value }) => {
|
|
3072
|
+
var _a;
|
|
3073
|
+
const columnId = column.getColId();
|
|
3074
|
+
if ((node === null || node === void 0 ? void 0 : node.group) &&
|
|
3075
|
+
(this.api.columnApi.isAutoRowGroupColumn(columnId) ||
|
|
3076
|
+
// we would still need to process the cell if this is a group row with an aggregated value
|
|
3077
|
+
((_a = node === null || node === void 0 ? void 0 : node.aggData) === null || _a === void 0 ? void 0 : _a[columnId]) == undefined)) {
|
|
3078
|
+
// skip processing of row groups, this was already handled in processRowGroupCallback()
|
|
3079
|
+
return value;
|
|
3080
|
+
}
|
|
3081
|
+
return this.processCellForExcelExport(node, columnId);
|
|
3082
|
+
},
|
|
3083
|
+
processRowGroupCallback: (params) => {
|
|
3084
|
+
var _a;
|
|
3085
|
+
// recreating the standard AG Grid styling for row groups: 'Parent -> Child'
|
|
3086
|
+
// additionally the values are formatted
|
|
3087
|
+
let rowGroupNode = params.node;
|
|
3088
|
+
const isFooterRow = rowGroupNode.footer;
|
|
3089
|
+
const rowGroupSummary = [(_a = this.processRowGroupForExcelExport(rowGroupNode)) !== null && _a !== void 0 ? _a : ''];
|
|
3090
|
+
while (rowGroupNode.parent) {
|
|
3091
|
+
rowGroupNode = rowGroupNode.parent;
|
|
3092
|
+
const formattedParentNode = this.processRowGroupForExcelExport(rowGroupNode);
|
|
3093
|
+
if (formattedParentNode) {
|
|
3094
|
+
rowGroupSummary.push(formattedParentNode);
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
let summary = rowGroupSummary.reverse().join(' -> ');
|
|
3098
|
+
if (isFooterRow) {
|
|
3099
|
+
summary = `Total: ${summary}`;
|
|
3100
|
+
}
|
|
3101
|
+
return summary;
|
|
3102
|
+
},
|
|
3103
|
+
});
|
|
3104
|
+
this.agGridOptionsService.revertGridOptionsPropertyToUserValue('excelStyles');
|
|
3105
|
+
}
|
|
3106
|
+
catch (error) {
|
|
3107
|
+
this.logger.consoleError('Error exporting visual data to Excel', error);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
processRowGroupForExcelExport(rowNode) {
|
|
3111
|
+
var _a, _b, _c, _d, _e;
|
|
3112
|
+
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;
|
|
3113
|
+
if (!columnId || !rowNode.key) {
|
|
3114
|
+
return;
|
|
3115
|
+
}
|
|
3116
|
+
let rawValue = rowNode.key;
|
|
3117
|
+
if (this.api.columnApi.getColumnDataTypeForColumnId(columnId) === 'Date' &&
|
|
3118
|
+
typeof rawValue === 'string' &&
|
|
3119
|
+
// rawValue is composed only of digits
|
|
3120
|
+
/^\d+$/.test(rawValue)) {
|
|
3121
|
+
// AG-Grid converts the value to string, we have to reconvert it back
|
|
3122
|
+
const dateRawValue = parseInt(rawValue);
|
|
3123
|
+
if (dateRawValue != undefined) {
|
|
3124
|
+
// @ts-ignore
|
|
3125
|
+
rawValue = dateRawValue;
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
return this.ReportService.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
|
|
3129
|
+
}
|
|
3130
|
+
processCellForExcelExport(rowNode, columnId) {
|
|
3131
|
+
if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
|
|
3132
|
+
const cellKey = this.agGridColumnAdapter.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
|
|
3133
|
+
const isoFormattedDate = this.ReportService.getExcelStyleWithFormattedDate(cellKey);
|
|
3134
|
+
if (isoFormattedDate) {
|
|
3135
|
+
// this is a Date cell which will be formatted by Excel
|
|
3136
|
+
return isoFormattedDate;
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
return this.ReportService.getCellExportValueFromRowNode(rowNode, columnId);
|
|
3101
3140
|
}
|
|
3102
3141
|
isQuickFilterAvailable() {
|
|
3103
3142
|
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;
|
|
@@ -68,6 +68,9 @@ class AgGridAdapter {
|
|
|
68
68
|
var _a;
|
|
69
69
|
(_a = this.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.setGridOption(key, value);
|
|
70
70
|
}
|
|
71
|
+
getUserGridOptionsProperty(propertyName) {
|
|
72
|
+
return this.adaptableInstance.agGridOptionsService.getUserGridOptionsProperty(propertyName);
|
|
73
|
+
}
|
|
71
74
|
updateColumnFilterActiveState() {
|
|
72
75
|
var _a;
|
|
73
76
|
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;
|
|
@@ -610,14 +610,14 @@ class AgGridColumnAdapter {
|
|
|
610
610
|
if (!this.adaptableApi.internalApi.getModuleService().isModuleAvailable('Notes')) {
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
|
-
if (!this.adaptableApi.
|
|
613
|
+
if (!this.adaptableApi.noteApi.internalApi.areNotesAvailable()) {
|
|
614
614
|
return;
|
|
615
615
|
}
|
|
616
616
|
const cellPosition = {
|
|
617
617
|
PrimaryKeyValue: gridCell.primaryKeyValue,
|
|
618
618
|
ColumnId: gridCell.column.columnId,
|
|
619
619
|
};
|
|
620
|
-
const cellNotes = this.adaptableApi.
|
|
620
|
+
const cellNotes = this.adaptableApi.noteApi.getCellNotes(cellPosition);
|
|
621
621
|
if (!(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
|
|
622
622
|
return undefined;
|
|
623
623
|
}
|
|
@@ -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
|
}
|
|
@@ -43,6 +43,28 @@ class AgGridOptionsService {
|
|
|
43
43
|
gridOptions[propertyName] = adaptableValue !== null && adaptableValue !== void 0 ? adaptableValue : userValue;
|
|
44
44
|
return gridOptions;
|
|
45
45
|
}
|
|
46
|
+
getUserGridOptionsProperty(propertyName) {
|
|
47
|
+
const userKey = `user.${propertyName}`;
|
|
48
|
+
return this.gridOptionsPropertyCache.get(userKey);
|
|
49
|
+
}
|
|
50
|
+
revertGridOptionsPropertyToUserValue(propertyName) {
|
|
51
|
+
const userKey = `user.${propertyName}`;
|
|
52
|
+
const userValue = this.gridOptionsPropertyCache.get(userKey);
|
|
53
|
+
this.agGridAdapter.setGridOption(propertyName, userValue);
|
|
54
|
+
}
|
|
55
|
+
CAREFUL_patchGridOptionsProperty(propertyName, value) {
|
|
56
|
+
var _a;
|
|
57
|
+
// @ts-ignore this is required to set gridOptions peroperties which are marked as initial (writable once, before grid is initialised)
|
|
58
|
+
const gos = (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.gos;
|
|
59
|
+
if (gos) {
|
|
60
|
+
gos.updateGridOptions({
|
|
61
|
+
options: {
|
|
62
|
+
[propertyName]: value,
|
|
63
|
+
},
|
|
64
|
+
source: 'api',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
46
68
|
revertGridOptionsPropertiesToUserValue(gridOptions, propertyNames) {
|
|
47
69
|
for (const propertyName of propertyNames) {
|
|
48
70
|
// see this.setGridOptionsProperty(...)
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "18.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1711034351652 || Date.now(),
|
|
6
|
+
VERSION: "18.0.0-canary.12" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -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;
|