@adaptabletools/adaptable 18.0.0-canary.3 → 18.0.0-canary.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/agGrid.d.ts +4 -21
- package/agGrid.js +9 -26
- package/base.css +4 -1
- package/base.css.map +1 -1
- package/index.css +79 -68
- package/index.css.map +1 -1
- package/package.json +3 -4
- package/src/AdaptableInterfaces/IAdaptable.d.ts +55 -109
- package/src/AdaptableOptions/AdaptableOptions.d.ts +11 -5
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- package/src/AdaptableOptions/{CommentsOptions.d.ts → CommentOptions.d.ts} +5 -5
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.js +1 -5
- package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
- package/src/Api/AdaptableApi.d.ts +5 -0
- package/src/Api/BulkUpdateApi.d.ts +0 -5
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +14 -13
- package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ActionColumnApiImpl.js +33 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
- package/src/Api/Implementation/ApiBase.d.ts +2 -1
- package/src/Api/Implementation/ApiBase.js +4 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
- package/src/Api/Implementation/CommentsApiImpl.js +2 -1
- package/src/Api/Implementation/ConfigApiImpl.js +8 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
- package/src/Api/Implementation/GridApiImpl.js +20 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -0
- package/src/Api/Implementation/LayoutApiImpl.js +14 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +2 -4
- package/src/Api/Implementation/NotesApiImpl.js +4 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +1 -1
- package/src/Api/Implementation/OptionsApiImpl.js +2 -2
- package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
- package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
- package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
- package/src/Api/Internal/ActionRowInternalApi.d.ts +5 -1
- package/src/Api/Internal/ActionRowInternalApi.js +106 -0
- package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
- package/src/Api/Internal/AdaptableInternalApi.js +10 -8
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +70 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +11 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
- package/src/Api/Internal/ColumnInternalApi.js +12 -0
- package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
- package/src/Api/Internal/CustomSortInternalApi.js +32 -1
- package/src/Api/Internal/DataSetInternalApi.js +1 -1
- package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/FreeTextColumnInternalApi.js +59 -0
- package/src/Api/Internal/GridFilterInternalApi.js +1 -1
- package/src/Api/Internal/GridInternalApi.d.ts +21 -3
- package/src/Api/Internal/GridInternalApi.js +126 -7
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +8 -0
- package/src/Api/OptionsApi.d.ts +1 -1
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +4 -0
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +3 -0
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +8 -7
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +22 -50
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +7 -1
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -3
- package/src/Strategy/AdaptableModuleBase.js +4 -7
- package/src/Strategy/AlertModule.d.ts +1 -2
- package/src/Strategy/AlertModule.js +2 -55
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
- package/src/Strategy/CalculatedColumnModule.js +5 -25
- package/src/Strategy/ChartingModule.d.ts +0 -1
- package/src/Strategy/ChartingModule.js +2 -22
- package/src/Strategy/ColumnFilterModule.d.ts +1 -2
- package/src/Strategy/ColumnFilterModule.js +1 -64
- package/src/Strategy/CommentsModule.d.ts +1 -0
- package/src/Strategy/CommentsModule.js +2 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.d.ts +1 -2
- package/src/Strategy/DashboardModule.js +1 -8
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +3 -1
- package/src/Strategy/DataSetModule.d.ts +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -2
- package/src/Strategy/FlashingCellModule.js +2 -15
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +0 -47
- package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
- package/src/Strategy/FreeTextColumnModule.js +0 -30
- package/src/Strategy/GridFilterModule.d.ts +0 -1
- package/src/Strategy/GridFilterModule.js +0 -37
- package/src/Strategy/Interface/IModule.d.ts +0 -1
- package/src/Strategy/LayoutModule.d.ts +1 -3
- package/src/Strategy/LayoutModule.js +6 -50
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/ScheduleModule.d.ts +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/ShortcutModule.d.ts +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/StyledColumnModule.d.ts +0 -1
- package/src/Strategy/StyledColumnModule.js +0 -21
- package/src/Strategy/TeamSharingModule.d.ts +1 -0
- package/src/Strategy/TeamSharingModule.js +5 -5
- package/src/Strategy/ToolPanelModule.d.ts +0 -1
- package/src/Strategy/ToolPanelModule.js +0 -23
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +0 -3
- package/src/Utilities/Helpers/AdaptableHelper.js +0 -58
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +4 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +3 -1
- package/src/Utilities/Services/CellPopupService.js +0 -1
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +10 -3
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/View/AdaptableView.js +0 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +1 -1
- package/src/View/Comments/CommentsPopup.js +12 -8
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +3 -0
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +6 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +193 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/Notes/NotesPopup.js +9 -11
- package/src/View/Theme/ThemeSelector.js +3 -3
- package/src/agGrid/ActionColumnRenderer.js +4 -4
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +8 -5292
- package/src/agGrid/AdaptableAgGrid.d.ts +336 -0
- package/src/agGrid/AdaptableAgGrid.js +3780 -0
- package/src/agGrid/AdaptableLogger.js +77 -11
- package/src/agGrid/AgGridAdapter.d.ts +54 -0
- package/src/agGrid/AgGridAdapter.js +549 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +813 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +271 -0
- package/src/agGrid/AgGridOptionsService.d.ts +11 -0
- package/src/agGrid/AgGridOptionsService.js +50 -0
- package/src/agGrid/BadgeRenderer.js +1 -1
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.d.ts +2 -2
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
- package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
- package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +70 -9
- package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Modal/index.d.ts +1 -0
- package/src/components/Modal/index.js +4 -3
- package/src/components/Select/Select.d.ts +2 -0
- package/src/components/Select/Select.js +2 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +39 -11
- package/src/metamodel/adaptable.metamodel.js +73 -32
- package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
- package/src/migration/AdaptableUpgradeHelper.js +48 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +11 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +342 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +6 -0
- package/src/types.d.ts +7 -3
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
- package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
- package/src/Utilities/Services/Interface/IRowEditService.js +0 -1
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -686
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -668
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -2,13 +2,16 @@ import { GridFilterWindowPopup } from '../../../GridFilter/GridFilterWindowPopup
|
|
|
2
2
|
import { PivotDetailsPopoup } from '../../../Layout/PivotDetailsPopoup';
|
|
3
3
|
import { ExportTablePopup } from '../../../Export/ExportTablePopup';
|
|
4
4
|
import { ThemeEditorWindow } from '../../../Theme/ThemeEditorWindow';
|
|
5
|
+
import { TransposedPopup } from '../../../Layout/TransposedPopup';
|
|
5
6
|
export const WINDOW_GRID_FILTER_EDITOR = 'WINDOW_GRID_FILTER_EDITOR';
|
|
6
7
|
export const SHOW_PIVOT_COLUMN_DETAILS = 'SHOW_PIVOT_COLUMN_DETAILS';
|
|
7
8
|
export const SHOW_EXPORT_TABLE = 'SHOW_EXPORT_TABLE';
|
|
8
9
|
export const SHOW_THEME_EDITOR = 'SHOW_THEME_EDITOR';
|
|
10
|
+
export const WINDOW_SHOW_TRANSPOSED_VIEW = 'WINDOW_SHOW_TRANSPOSED_VIEW';
|
|
9
11
|
export const windowFactory = {
|
|
10
12
|
[WINDOW_GRID_FILTER_EDITOR]: GridFilterWindowPopup,
|
|
11
13
|
[SHOW_PIVOT_COLUMN_DETAILS]: PivotDetailsPopoup,
|
|
12
14
|
[SHOW_EXPORT_TABLE]: ExportTablePopup,
|
|
13
15
|
[SHOW_THEME_EDITOR]: ThemeEditorWindow,
|
|
16
|
+
[WINDOW_SHOW_TRANSPOSED_VIEW]: TransposedPopup,
|
|
14
17
|
};
|
|
@@ -9,7 +9,7 @@ export const PermittedValuesSelector = function (props) {
|
|
|
9
9
|
const [filter, setFilter] = React.useState('');
|
|
10
10
|
const columnType = React.useMemo(() => {
|
|
11
11
|
return adaptable.api.columnApi.getColumnDataTypeForColumnId(props.columnId);
|
|
12
|
-
}, []);
|
|
12
|
+
}, [props.columnId]);
|
|
13
13
|
React.useEffect(() => {
|
|
14
14
|
if (!props.columnId) {
|
|
15
15
|
setIsLoading(false);
|
|
@@ -33,7 +33,7 @@ export class CustomSortSummaryComponent extends React.Component {
|
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
35
|
const customSort = this.props.CustomSorts.find((c) => c.ColumnId == this.props.summarisedColumn.columnId);
|
|
36
|
-
const columnSortComparer = this.props.api.customSortApi.internalApi.getCustomSortComparer(this.props.summarisedColumn);
|
|
36
|
+
const columnSortComparer = this.props.api.customSortApi.internalApi.getCustomSortComparer(this.props.summarisedColumn.columnId);
|
|
37
37
|
let noCustomSort = customSort == null && columnSortComparer == null;
|
|
38
38
|
let customSortRow;
|
|
39
39
|
if (!this.props.summarisedColumn.sortable) {
|
|
@@ -65,7 +65,7 @@ export const DataChangeHistoryGrid = (props) => {
|
|
|
65
65
|
// 2. this UI will be reimplemented with Infinite Table anyway
|
|
66
66
|
const addedRows = mapChangeHistoryRowData(addedChangeHistoryLogs, mainAdaptableInstance);
|
|
67
67
|
const removedRows = mapChangeHistoryRowData(removedChangeHistoryLogs, mainAdaptableInstance);
|
|
68
|
-
adaptableApi.
|
|
68
|
+
adaptableApi.agGridApi.applyTransactionAsync({
|
|
69
69
|
add: addedRows,
|
|
70
70
|
remove: removedRows,
|
|
71
71
|
});
|
|
@@ -23,6 +23,7 @@ const QueryViewPanelComponent = (props) => {
|
|
|
23
23
|
const disabled = isReadOnly || isSuspended || gridFilterAccessLevel === 'ReadOnly';
|
|
24
24
|
const handleEnter = (e) => {
|
|
25
25
|
if (e.key === 'Enter') {
|
|
26
|
+
e.preventDefault();
|
|
26
27
|
runQuery();
|
|
27
28
|
}
|
|
28
29
|
};
|
|
@@ -44,8 +45,9 @@ const QueryViewPanelComponent = (props) => {
|
|
|
44
45
|
fontFamily: 'monospace',
|
|
45
46
|
fontSize: 12,
|
|
46
47
|
maxHeight: 52,
|
|
47
|
-
height:
|
|
48
|
-
paddingTop:
|
|
48
|
+
height: '100%',
|
|
49
|
+
paddingTop: 6,
|
|
50
|
+
overflow: 'hidden',
|
|
49
51
|
zIndex: 100,
|
|
50
52
|
}, placehoder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression })),
|
|
51
53
|
isExpressionValid && (React.createElement(ButtonPlay, { onClick: () => runQuery(), tooltip: '', accessLevel: gridFilterAccessLevel, variant: "text", tone: "neutral", disabled: disabled || expression == '' || expression == (gridFilter === null || gridFilter === void 0 ? void 0 : gridFilter.Expression), marginRight: 1 })),
|
|
@@ -71,6 +73,8 @@ const QueryViewPanelComponent = (props) => {
|
|
|
71
73
|
maxHeight: 60,
|
|
72
74
|
paddingTop: 7,
|
|
73
75
|
zIndex: 100,
|
|
76
|
+
height: '100%',
|
|
77
|
+
overflow: 'hidden',
|
|
74
78
|
}, placehoder: "Grid Filter", onChange: (x) => setExpression(x.target.value), value: expression }))));
|
|
75
79
|
};
|
|
76
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 }));
|
|
@@ -9,8 +9,8 @@ import { AdaptableObjectCollection } from '../../Components/AdaptableObjectColle
|
|
|
9
9
|
import { AdaptableObjectRow } from '../../Components/AdaptableObjectRow';
|
|
10
10
|
import { PopupPanel } from '../../Components/Popups/AdaptablePopup/PopupPanel';
|
|
11
11
|
import { AdaptableObjectsSummary } from './AdaptableObjectsSummary';
|
|
12
|
-
import
|
|
13
|
-
const version =
|
|
12
|
+
import { ADAPTABLE_VERSION } from '../../../EnvVars';
|
|
13
|
+
const version = ADAPTABLE_VERSION;
|
|
14
14
|
export const GridInfoPopup = (props) => {
|
|
15
15
|
const CreateGridSummaries = (colItems) => {
|
|
16
16
|
var _a;
|
|
@@ -39,7 +39,6 @@ export const GridInfoPopup = (props) => {
|
|
|
39
39
|
returnRows.push(createReadOnlyColItem(colItems, 'Column Filters', columnFilterDescription));
|
|
40
40
|
returnRows.push(createReadOnlyColItem(colItems, 'Grid Filter', gridFilterExpression));
|
|
41
41
|
returnRows.push(createReadOnlyColItem(colItems, 'All Rows', props.api.gridApi.getRowCount()));
|
|
42
|
-
returnRows.push(createReadOnlyColItem(colItems, 'Visible Rows', props.api.gridApi.getVisibleRowCount()));
|
|
43
42
|
returnRows.push(createReadOnlyColItem(colItems, 'Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.length));
|
|
44
43
|
returnRows.push(createReadOnlyColItem(colItems, 'Visible Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.filter((gr) => { var _a; return ((_a = gr.rowNode) === null || _a === void 0 ? void 0 : _a.displayed) == true; }).length));
|
|
45
44
|
returnRows.push(createReadOnlyColItem(colItems, 'All Columns', props.api.gridApi.getColumnCount()));
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Box, Flex } from 'rebass';
|
|
3
|
+
import FormLayout, { FormRow } from '../../components/FormLayout';
|
|
4
|
+
import Panel from '../../components/Panel';
|
|
5
|
+
import { useAdaptable } from '../AdaptableContext';
|
|
6
|
+
import { ColumnSelector } from '../Components/Selectors/ColumnSelector';
|
|
7
|
+
export const TransposedPopup = (props) => {
|
|
8
|
+
const adaptable = useAdaptable();
|
|
9
|
+
const rowNodes = React.useMemo(() => {
|
|
10
|
+
return adaptable.api.gridApi.getAllRowNodes();
|
|
11
|
+
}, [
|
|
12
|
+
// can be later triggered by ticking data
|
|
13
|
+
]);
|
|
14
|
+
const { transposedColumnId, hideTransposedColumn = true } = props.popupProps;
|
|
15
|
+
const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
|
|
16
|
+
// Thist must be qunique
|
|
17
|
+
const transposeByColumnId = primaryKey;
|
|
18
|
+
// Only used to show nice values a the top of the grid, istead on the value
|
|
19
|
+
// of the primarykey
|
|
20
|
+
const [synteticTransposedByColumnId, setSynteticTransposedByColumnId] = React.useState(transposedColumnId !== null && transposedColumnId !== void 0 ? transposedColumnId : primaryKey);
|
|
21
|
+
const columns = React.useMemo(() => {
|
|
22
|
+
// customisable
|
|
23
|
+
return adaptable.api.columnApi.getColumns();
|
|
24
|
+
}, []);
|
|
25
|
+
const adaptableContainerId = 'transposed-adaptable-container';
|
|
26
|
+
const agGridContainerId = 'transposed-adaptable-ag-grid-container';
|
|
27
|
+
/**
|
|
28
|
+
* This is used as first field
|
|
29
|
+
*/
|
|
30
|
+
const transposedFirstColumnField = '_transposed_column_value';
|
|
31
|
+
const transposedFirstColumnHeader = '_transposed_column_header';
|
|
32
|
+
const transposedRowsAndColumns = React.useMemo(() => {
|
|
33
|
+
/**
|
|
34
|
+
* transposed column values become primaryKey of the new tarnsposed rows
|
|
35
|
+
* we build row by row, might be easer
|
|
36
|
+
*/
|
|
37
|
+
const transposedColumns = [];
|
|
38
|
+
const transposedRows = [];
|
|
39
|
+
for (const row of rowNodes) {
|
|
40
|
+
// we force the col-ids to be strings, easer to work with
|
|
41
|
+
//row[transposeByColumnId] + '';
|
|
42
|
+
const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId) + '';
|
|
43
|
+
//row[synteticTransposedByColumnId] + '';
|
|
44
|
+
const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, synteticTransposedByColumnId) + '';
|
|
45
|
+
transposedColumns.push({
|
|
46
|
+
colId,
|
|
47
|
+
header,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
for (const column of columns) {
|
|
51
|
+
/**
|
|
52
|
+
* We can hide the transposed column, if we want
|
|
53
|
+
*/
|
|
54
|
+
if (hideTransposedColumn && column.columnId === synteticTransposedByColumnId) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const transposedRow = {
|
|
58
|
+
// [transposed-by-column-id]: [other column id],
|
|
59
|
+
// the value can be set to friendlyname
|
|
60
|
+
[transposedFirstColumnField]: column.columnId,
|
|
61
|
+
[transposedFirstColumnHeader]: column.friendlyName,
|
|
62
|
+
};
|
|
63
|
+
for (let row of rowNodes) {
|
|
64
|
+
// [transposed-by-column-value[n]]: [other column value[n]]
|
|
65
|
+
const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId);
|
|
66
|
+
// row[column.field]
|
|
67
|
+
let value = adaptable.api.gridApi.getDisplayValueFromRowNode(row, column.columnId);
|
|
68
|
+
if (value instanceof Date) {
|
|
69
|
+
value = value.toLocaleString();
|
|
70
|
+
}
|
|
71
|
+
transposedRow[key] = value;
|
|
72
|
+
}
|
|
73
|
+
transposedRows.push(transposedRow);
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
transposedColumns,
|
|
77
|
+
transposedRows,
|
|
78
|
+
};
|
|
79
|
+
}, [rowNodes, primaryKey, synteticTransposedByColumnId]);
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
// Mounting in an effect, so the nodes are rendered/available
|
|
82
|
+
const hostAdaptableOptions = adaptable.adaptableOptions;
|
|
83
|
+
const adaptableOptions = {
|
|
84
|
+
primaryKey: transposedFirstColumnField,
|
|
85
|
+
licenseKey: hostAdaptableOptions.licenseKey,
|
|
86
|
+
userName: `${hostAdaptableOptions.userName}`,
|
|
87
|
+
adaptableId: `${hostAdaptableOptions.adaptableId}::TransposedView`,
|
|
88
|
+
containerOptions: {
|
|
89
|
+
adaptableContainer: adaptableContainerId,
|
|
90
|
+
agGridContainer: agGridContainerId,
|
|
91
|
+
},
|
|
92
|
+
entitlementOptions: {
|
|
93
|
+
defaultAccessLevel: 'Hidden',
|
|
94
|
+
},
|
|
95
|
+
layoutOptions: {
|
|
96
|
+
createDefaultLayout: false,
|
|
97
|
+
autoSizeColumnsInLayout: false,
|
|
98
|
+
},
|
|
99
|
+
predefinedConfig: {
|
|
100
|
+
Layout: {
|
|
101
|
+
Revision: Date.now(),
|
|
102
|
+
CurrentLayout: 'TransposedView',
|
|
103
|
+
Layouts: [
|
|
104
|
+
{
|
|
105
|
+
Name: 'TransposedView',
|
|
106
|
+
Columns: [
|
|
107
|
+
transposedFirstColumnHeader,
|
|
108
|
+
...transposedRowsAndColumns.transposedColumns.map((c) => c.colId),
|
|
109
|
+
],
|
|
110
|
+
PinnedColumnsMap: {
|
|
111
|
+
[transposedFirstColumnHeader]: 'left',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
Theme: {
|
|
117
|
+
CurrentTheme: adaptable.api.themeApi.getCurrentTheme(),
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
const firstColumn = {
|
|
122
|
+
field: transposedFirstColumnHeader,
|
|
123
|
+
headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(synteticTransposedByColumnId),
|
|
124
|
+
};
|
|
125
|
+
const agGridOptions = {
|
|
126
|
+
suppressLoadingOverlay: true,
|
|
127
|
+
defaultColDef: {
|
|
128
|
+
floatingFilter: false,
|
|
129
|
+
filter: false,
|
|
130
|
+
sortable: true,
|
|
131
|
+
resizable: true,
|
|
132
|
+
enableRowGroup: false,
|
|
133
|
+
editable: false,
|
|
134
|
+
enablePivot: false,
|
|
135
|
+
enableValue: false,
|
|
136
|
+
lockPinned: true,
|
|
137
|
+
menuTabs: [],
|
|
138
|
+
width: 120,
|
|
139
|
+
},
|
|
140
|
+
columnDefs: [
|
|
141
|
+
{
|
|
142
|
+
field: transposedFirstColumnField,
|
|
143
|
+
hide: true,
|
|
144
|
+
},
|
|
145
|
+
firstColumn,
|
|
146
|
+
...transposedRowsAndColumns.transposedColumns.map((col) => {
|
|
147
|
+
return {
|
|
148
|
+
field: col.colId,
|
|
149
|
+
type: null,
|
|
150
|
+
headerName: col.header,
|
|
151
|
+
};
|
|
152
|
+
}),
|
|
153
|
+
],
|
|
154
|
+
rowData: transposedRowsAndColumns.transposedRows,
|
|
155
|
+
sideBar: false,
|
|
156
|
+
};
|
|
157
|
+
const modules = adaptable.getAgGridRegisteredModules();
|
|
158
|
+
const adaptableInitFn = Object.getPrototypeOf(adaptable).constructor.init;
|
|
159
|
+
const agGridConfig = {
|
|
160
|
+
gridOptions: agGridOptions,
|
|
161
|
+
modules: modules,
|
|
162
|
+
};
|
|
163
|
+
let transposedAdaptableApi;
|
|
164
|
+
(async () => {
|
|
165
|
+
transposedAdaptableApi = await adaptableInitFn(adaptableOptions, agGridConfig);
|
|
166
|
+
adaptable.api.eventApi.on('ThemeChanged', (event) => {
|
|
167
|
+
transposedAdaptableApi.themeApi.loadTheme(typeof event.theme === 'object' ? event.theme.Name : event.theme);
|
|
168
|
+
});
|
|
169
|
+
})();
|
|
170
|
+
return () => {
|
|
171
|
+
if (transposedAdaptableApi) {
|
|
172
|
+
transposedAdaptableApi.destroy();
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}, [synteticTransposedByColumnId]);
|
|
176
|
+
/**
|
|
177
|
+
* Need to get all data, manualy pivot the grid using the primary key.
|
|
178
|
+
*
|
|
179
|
+
* 1. get the data, and pivot using the primary key
|
|
180
|
+
* 2. create the col definitios, a col definition for each row
|
|
181
|
+
* 3. create the grid
|
|
182
|
+
*/
|
|
183
|
+
return (React.createElement(Flex, { flexDirection: "column", width: "100%", height: "100%" },
|
|
184
|
+
React.createElement(Panel, null,
|
|
185
|
+
React.createElement(FormLayout, null,
|
|
186
|
+
React.createElement(FormRow, { label: "Elevated Column" },
|
|
187
|
+
React.createElement(ColumnSelector, { value: synteticTransposedByColumnId, onChange: (colId) => {
|
|
188
|
+
setSynteticTransposedByColumnId(colId);
|
|
189
|
+
} })))),
|
|
190
|
+
React.createElement(Flex, { height: "100%" },
|
|
191
|
+
React.createElement(Box, { id: "transposed-adaptable-container" }),
|
|
192
|
+
React.createElement(Box, { height: "100%", width: "100%", id: "transposed-adaptable-ag-grid-container" }))));
|
|
193
|
+
};
|
|
@@ -34,7 +34,7 @@ export const LayoutWizard = (props) => {
|
|
|
34
34
|
}
|
|
35
35
|
if (preparedLayout.SuppressAggFuncInHeader === undefined) {
|
|
36
36
|
preparedLayout.SuppressAggFuncInHeader =
|
|
37
|
-
!!adaptable.
|
|
37
|
+
!!adaptable.agGridAdapter.initialGridOptions.suppressAggFuncInHeader;
|
|
38
38
|
}
|
|
39
39
|
return preparedLayout;
|
|
40
40
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import { DataSource, InfiniteTable } from '../../components/InfiniteTable';
|
|
4
|
-
import {
|
|
4
|
+
import { GetAllNotesSelector } from '../../Redux/ActionsReducers/NotesRedux';
|
|
5
5
|
import { useAdaptable } from '../AdaptableContext';
|
|
6
6
|
import { AdaptableButtonComponent } from '../Components/AdaptableButton';
|
|
7
7
|
import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
|
|
@@ -15,7 +15,7 @@ const tableDOMProps = {
|
|
|
15
15
|
export const NotesPopup = (props) => {
|
|
16
16
|
const adaptable = useAdaptable();
|
|
17
17
|
const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
|
|
18
|
-
const allNotes = useSelector((state) =>
|
|
18
|
+
const allNotes = useSelector((state) => GetAllNotesSelector(state.Notes));
|
|
19
19
|
const columnsMap = React.useMemo(() => {
|
|
20
20
|
const columns = {
|
|
21
21
|
primaryKey: {
|
|
@@ -24,13 +24,14 @@ export const NotesPopup = (props) => {
|
|
|
24
24
|
},
|
|
25
25
|
column: {
|
|
26
26
|
field: 'ColumnId',
|
|
27
|
+
header: 'Column',
|
|
27
28
|
valueGetter: (params) => {
|
|
28
29
|
return adaptable.api.columnApi.getFriendlyNameForColumnId(params.data.ColumnId);
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
|
-
|
|
32
|
-
field: '
|
|
33
|
-
header: '
|
|
32
|
+
text: {
|
|
33
|
+
field: 'Text',
|
|
34
|
+
header: 'Text',
|
|
34
35
|
defaultEditable: true,
|
|
35
36
|
defaultFlex: 3,
|
|
36
37
|
},
|
|
@@ -40,10 +41,6 @@ export const NotesPopup = (props) => {
|
|
|
40
41
|
return new Date(params.data.Timestamp).toDateString();
|
|
41
42
|
},
|
|
42
43
|
},
|
|
43
|
-
author: {
|
|
44
|
-
header: 'Author',
|
|
45
|
-
valueGetter: (params) => params.data.Author.UserName,
|
|
46
|
-
},
|
|
47
44
|
delete: {
|
|
48
45
|
defaultWidth: 50,
|
|
49
46
|
render: (params) => {
|
|
@@ -64,8 +61,8 @@ export const NotesPopup = (props) => {
|
|
|
64
61
|
if (change.type === 'update') {
|
|
65
62
|
const data = change.data;
|
|
66
63
|
const prevNote = allNotes.find((x) => x.Uuid === uuid);
|
|
67
|
-
if (prevNote.
|
|
68
|
-
adaptable.api.notesApi.updateNoteText(data.
|
|
64
|
+
if (prevNote.Text !== data.Text) {
|
|
65
|
+
adaptable.api.notesApi.updateNoteText(data.Text, prevNote);
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
68
|
}
|
|
@@ -76,6 +73,7 @@ export const NotesPopup = (props) => {
|
|
|
76
73
|
align: 'start',
|
|
77
74
|
defaultFlex: 1,
|
|
78
75
|
defaultSortable: false,
|
|
76
|
+
style: { fontSize: 'var(--ab-font-size-3)' },
|
|
79
77
|
},
|
|
80
78
|
}, headerOptions: {
|
|
81
79
|
alwaysReserveSpaceForSortIcon: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useDispatch } from 'react-redux';
|
|
2
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
3
3
|
import { Select } from '../../components/Select';
|
|
4
4
|
import * as ThemeRedux from '../../Redux/ActionsReducers/ThemeRedux';
|
|
5
5
|
import { ThemeModuleId } from '../../Utilities/Constants/ModuleConstants';
|
|
@@ -8,6 +8,7 @@ export const ThemeSelector = (props) => {
|
|
|
8
8
|
const adaptable = useAdaptable();
|
|
9
9
|
const dispatch = useDispatch();
|
|
10
10
|
const availableThemes = adaptable.api.themeApi.getThemes();
|
|
11
|
+
const currentTheme = useSelector((state) => state.Theme.CurrentTheme);
|
|
11
12
|
const disabled = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(ThemeModuleId) === 'ReadOnly';
|
|
12
13
|
const optionThemes = availableThemes.map((theme) => {
|
|
13
14
|
if (typeof theme === 'string') {
|
|
@@ -22,8 +23,7 @@ export const ThemeSelector = (props) => {
|
|
|
22
23
|
label: theme.Description,
|
|
23
24
|
};
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
-
return (React.createElement(Select, { "data-name": "select-theme-dropdown", options: optionThemes, value: theme.Name, disabled: disabled, size: props.size, onChange: (themeName) => {
|
|
26
|
+
return (React.createElement(Select, { "data-name": "select-theme-dropdown", searchable: false, options: optionThemes, value: currentTheme, disabled: disabled, size: props.size, onChange: (themeName) => {
|
|
27
27
|
dispatch(ThemeRedux.ThemeSelect(themeName));
|
|
28
28
|
} }));
|
|
29
29
|
};
|
|
@@ -32,7 +32,7 @@ const ActionButtons = (props) => {
|
|
|
32
32
|
};
|
|
33
33
|
export const ReactActionColumnRenderer = (props) => {
|
|
34
34
|
const rerender = useRerender();
|
|
35
|
-
const adaptable = props.
|
|
35
|
+
const adaptable = props.context.__adaptable;
|
|
36
36
|
const { actionButtons, actionColumn } = adaptable.api.internalApi.getActionButtonsAndActionColumn(props.colDef);
|
|
37
37
|
if (!actionColumn || !actionButtons.length) {
|
|
38
38
|
return null;
|
|
@@ -41,7 +41,7 @@ export const ReactActionColumnRenderer = (props) => {
|
|
|
41
41
|
if (adaptable.api.gridApi.isGroupRowNode(props.node) && !actionColumn.includeGroupedRows) {
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
|
-
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node);
|
|
44
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node, props.api);
|
|
45
45
|
const buttonContext = {
|
|
46
46
|
actionColumn,
|
|
47
47
|
primaryKeyValue: pkValue,
|
|
@@ -57,7 +57,7 @@ export const ReactActionColumnRenderer = (props) => {
|
|
|
57
57
|
export class ActionColumnRenderer {
|
|
58
58
|
// gets called once before the renderer is used
|
|
59
59
|
init(params) {
|
|
60
|
-
const adaptable = params.
|
|
60
|
+
const adaptable = params.context.__adaptable;
|
|
61
61
|
const { actionButtons, actionColumn } = adaptable.api.internalApi.getActionButtonsAndActionColumn(params.colDef);
|
|
62
62
|
if (!actionColumn || !actionButtons.length) {
|
|
63
63
|
return;
|
|
@@ -70,7 +70,7 @@ export class ActionColumnRenderer {
|
|
|
70
70
|
this.eGui.innerHTML = '';
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node);
|
|
73
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node, params.api);
|
|
74
74
|
const buttonContext = {
|
|
75
75
|
actionColumn,
|
|
76
76
|
primaryKeyValue: pkValue,
|