@adaptabletools/adaptable-cjs 18.0.0-canary.1 → 18.0.0-canary.11
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 +5 -21
- package/base.css +11 -3
- package/base.css.map +1 -1
- package/index.css +88 -70
- package/index.css.map +1 -1
- package/package.json +4 -5
- package/src/AdaptableInterfaces/IAdaptable.d.ts +61 -108
- package/src/AdaptableOptions/AdaptableOptions.d.ts +12 -6
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +4 -2
- package/src/AdaptableOptions/{CommentsOptions.d.ts → CommentOptions.d.ts} +5 -5
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.js +2 -6
- 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/ConfigApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +18 -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.d.ts +4 -0
- package/src/Api/Implementation/CommentsApiImpl.js +7 -1
- package/src/Api/Implementation/ConfigApiImpl.js +13 -5
- package/src/Api/Implementation/GridApiImpl.d.ts +4 -3
- package/src/Api/Implementation/GridApiImpl.js +33 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +15 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +6 -4
- package/src/Api/Implementation/NotesApiImpl.js +9 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -1
- package/src/Api/Implementation/OptionsApiImpl.js +12 -2
- package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ScopeApiImpl.js +20 -7
- 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 +107 -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 +71 -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/CommentsInternalApi.d.ts +4 -0
- package/src/Api/Internal/CommentsInternalApi.js +18 -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/FormatColumnInternalApi.js +3 -2
- package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/FreeTextColumnInternalApi.js +60 -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/NotesInternalApi.d.ts +4 -0
- package/src/Api/Internal/NotesInternalApi.js +18 -0
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +11 -0
- package/src/Api/OptionsApi.d.ts +5 -1
- package/src/Api/ScopeApi.d.ts +10 -0
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +8 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableScope.d.ts +4 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +8 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +7 -0
- package/src/PredefinedConfig/Common/RowSummary.js +4 -0
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/PredefinedConfig/SystemState.d.ts +7 -0
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +22 -1
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +10 -8
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +16 -3
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +33 -50
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
- 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/CellSummaryModule.d.ts +1 -0
- package/src/Strategy/CellSummaryModule.js +50 -21
- 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 +5 -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 +8 -3
- package/src/Strategy/LayoutModule.js +108 -53
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/NotesModule.js +3 -4
- 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 +3 -2
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +294 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +6 -1
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +20 -60
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +6 -1
- package/src/Utilities/ObjectFactory.js +6 -6
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +3 -2
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +14 -9
- package/src/Utilities/Services/CellPopupService.js +0 -1
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +1 -186
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +2 -1
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/Utilities/Services/SummaryService.d.ts +19 -0
- package/src/Utilities/Services/SummaryService.js +33 -0
- package/src/Utilities/license/decode.js +1 -70
- package/src/Utilities/license/hashing.js +1 -47
- package/src/View/AdaptableView.js +1 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +2 -2
- 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/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/NewScopeComponent.js +34 -1
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/AdaptableToaster.js +1 -1
- 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 +4 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +8 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +7 -3
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +199 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -66
- package/src/View/Notes/NotesPopup.js +8 -10
- package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
- package/src/View/Theme/ThemeSelector.js +2 -2
- package/src/agGrid/ActionColumnRenderer.js +7 -6
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +7 -5291
- package/src/agGrid/AdaptableAgGrid.d.ts +351 -0
- package/src/agGrid/AdaptableAgGrid.js +3941 -0
- package/src/agGrid/AdaptableLogger.js +78 -13
- package/src/agGrid/AgGridAdapter.d.ts +62 -0
- package/src/agGrid/AgGridAdapter.js +582 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +829 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +276 -0
- package/src/agGrid/AgGridOptionsService.d.ts +12 -0
- package/src/agGrid/AgGridOptionsService.js +58 -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} +73 -10
- package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -0
- package/src/components/Modal/index.js +6 -4
- package/src/components/Select/Select.d.ts +2 -0
- package/src/components/Select/Select.js +2 -2
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/rows.d.ts +3 -0
- package/src/components/icons/rows.js +7 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +74 -11
- package/src/metamodel/adaptable.metamodel.js +1 -9316
- package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
- package/src/migration/AdaptableUpgradeHelper.js +52 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +15 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +347 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +10 -0
- package/src/parser/src/types.d.ts +5 -0
- package/src/types.d.ts +7 -3
- package/tsconfig.cjs.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 -2
- package/src/View/Components/ScopeComponent.d.ts +0 -24
- package/src/View/Components/ScopeComponent.js +0 -138
- package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
- package/src/View/Export/Wizard/ReportScopeWizard.js +0 -52
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -691
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -673
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransposedPopup = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../components/FormLayout"));
|
|
8
|
+
const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
|
|
9
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
10
|
+
const ColumnSelector_1 = require("../Components/Selectors/ColumnSelector");
|
|
11
|
+
const AdaptableAgGrid_1 = require("../../agGrid/AdaptableAgGrid");
|
|
12
|
+
const TransposedPopup = (props) => {
|
|
13
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
14
|
+
const rowNodes = React.useMemo(() => {
|
|
15
|
+
return adaptable.api.gridApi.getAllRowNodes();
|
|
16
|
+
}, [
|
|
17
|
+
// can be later triggered by ticking data
|
|
18
|
+
]);
|
|
19
|
+
const { transposedColumnId, hideTransposedColumn = true } = props.popupProps;
|
|
20
|
+
const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
|
|
21
|
+
// Thist must be qunique
|
|
22
|
+
const transposeByColumnId = primaryKey;
|
|
23
|
+
// Only used to show nice values a the top of the grid, istead on the value
|
|
24
|
+
// of the primarykey
|
|
25
|
+
const [synteticTransposedByColumnId, setSynteticTransposedByColumnId] = React.useState(transposedColumnId !== null && transposedColumnId !== void 0 ? transposedColumnId : primaryKey);
|
|
26
|
+
const columns = React.useMemo(() => {
|
|
27
|
+
// customisable
|
|
28
|
+
return adaptable.api.columnApi.getColumns();
|
|
29
|
+
}, []);
|
|
30
|
+
const adaptableContainerId = 'transposed-adaptable-container';
|
|
31
|
+
const agGridContainerId = 'transposed-adaptable-ag-grid-container';
|
|
32
|
+
/**
|
|
33
|
+
* This is used as first field
|
|
34
|
+
*/
|
|
35
|
+
const transposedFirstColumnField = '_transposed_column_value';
|
|
36
|
+
const transposedFirstColumnHeader = '_transposed_column_header';
|
|
37
|
+
const transposedRowsAndColumns = React.useMemo(() => {
|
|
38
|
+
/**
|
|
39
|
+
* transposed column values become primaryKey of the new tarnsposed rows
|
|
40
|
+
* we build row by row, might be easer
|
|
41
|
+
*/
|
|
42
|
+
const transposedColumns = [];
|
|
43
|
+
const transposedRows = [];
|
|
44
|
+
for (const row of rowNodes) {
|
|
45
|
+
// we force the col-ids to be strings, easer to work with
|
|
46
|
+
//row[transposeByColumnId] + '';
|
|
47
|
+
const colId = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId) + '';
|
|
48
|
+
//row[synteticTransposedByColumnId] + '';
|
|
49
|
+
const header = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, synteticTransposedByColumnId) + '';
|
|
50
|
+
transposedColumns.push({
|
|
51
|
+
colId,
|
|
52
|
+
header,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
for (const column of columns) {
|
|
56
|
+
/**
|
|
57
|
+
* We can hide the transposed column, if we want
|
|
58
|
+
*/
|
|
59
|
+
if (hideTransposedColumn && column.columnId === synteticTransposedByColumnId) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const transposedRow = {
|
|
63
|
+
// [transposed-by-column-id]: [other column id],
|
|
64
|
+
// the value can be set to friendlyname
|
|
65
|
+
[transposedFirstColumnField]: column.columnId,
|
|
66
|
+
[transposedFirstColumnHeader]: column.friendlyName,
|
|
67
|
+
};
|
|
68
|
+
for (let row of rowNodes) {
|
|
69
|
+
// [transposed-by-column-value[n]]: [other column value[n]]
|
|
70
|
+
const key = adaptable.api.gridApi.getNormalisedValueFromRowNode(row, transposeByColumnId);
|
|
71
|
+
// row[column.field]
|
|
72
|
+
let value = adaptable.api.gridApi.getDisplayValueFromRowNode(row, column.columnId);
|
|
73
|
+
if (value instanceof Date) {
|
|
74
|
+
value = value.toLocaleString();
|
|
75
|
+
}
|
|
76
|
+
transposedRow[key] = value;
|
|
77
|
+
}
|
|
78
|
+
transposedRows.push(transposedRow);
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
transposedColumns,
|
|
82
|
+
transposedRows,
|
|
83
|
+
};
|
|
84
|
+
}, [rowNodes, primaryKey, synteticTransposedByColumnId]);
|
|
85
|
+
React.useEffect(() => {
|
|
86
|
+
// Mounting in an effect, so the nodes are rendered/available
|
|
87
|
+
const hostAdaptableOptions = adaptable.adaptableOptions;
|
|
88
|
+
const adaptableOptions = {
|
|
89
|
+
primaryKey: transposedFirstColumnField,
|
|
90
|
+
licenseKey: hostAdaptableOptions.licenseKey,
|
|
91
|
+
userName: `${hostAdaptableOptions.userName}`,
|
|
92
|
+
adaptableId: `${hostAdaptableOptions.adaptableId}::TransposedView`,
|
|
93
|
+
containerOptions: {
|
|
94
|
+
adaptableContainer: adaptableContainerId,
|
|
95
|
+
agGridContainer: agGridContainerId,
|
|
96
|
+
},
|
|
97
|
+
entitlementOptions: {
|
|
98
|
+
defaultAccessLevel: 'Hidden',
|
|
99
|
+
},
|
|
100
|
+
layoutOptions: {
|
|
101
|
+
createDefaultLayout: false,
|
|
102
|
+
autoSizeColumnsInLayout: true,
|
|
103
|
+
},
|
|
104
|
+
predefinedConfig: {
|
|
105
|
+
Layout: {
|
|
106
|
+
Revision: Date.now(),
|
|
107
|
+
CurrentLayout: 'TransposedView',
|
|
108
|
+
Layouts: [
|
|
109
|
+
{
|
|
110
|
+
Name: 'TransposedView',
|
|
111
|
+
Columns: [
|
|
112
|
+
transposedFirstColumnHeader,
|
|
113
|
+
...transposedRowsAndColumns.transposedColumns.map((c) => c.colId),
|
|
114
|
+
],
|
|
115
|
+
PinnedColumnsMap: {
|
|
116
|
+
[transposedFirstColumnHeader]: 'left',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
Theme: {
|
|
122
|
+
CurrentTheme: adaptable.api.themeApi.getCurrentTheme(),
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
const firstColumn = {
|
|
127
|
+
field: transposedFirstColumnHeader,
|
|
128
|
+
headerName: adaptable.api.columnApi.getFriendlyNameForColumnId(synteticTransposedByColumnId),
|
|
129
|
+
};
|
|
130
|
+
const agGridOptions = {
|
|
131
|
+
suppressLoadingOverlay: true,
|
|
132
|
+
defaultColDef: {
|
|
133
|
+
floatingFilter: false,
|
|
134
|
+
filter: false,
|
|
135
|
+
sortable: true,
|
|
136
|
+
resizable: true,
|
|
137
|
+
enableRowGroup: false,
|
|
138
|
+
editable: false,
|
|
139
|
+
enablePivot: false,
|
|
140
|
+
enableValue: false,
|
|
141
|
+
lockPinned: true,
|
|
142
|
+
menuTabs: [],
|
|
143
|
+
width: 120,
|
|
144
|
+
},
|
|
145
|
+
columnDefs: [
|
|
146
|
+
{
|
|
147
|
+
field: transposedFirstColumnField,
|
|
148
|
+
hide: true,
|
|
149
|
+
},
|
|
150
|
+
firstColumn,
|
|
151
|
+
...transposedRowsAndColumns.transposedColumns.map((col) => {
|
|
152
|
+
return {
|
|
153
|
+
field: col.colId,
|
|
154
|
+
type: null,
|
|
155
|
+
headerName: col.header,
|
|
156
|
+
};
|
|
157
|
+
}),
|
|
158
|
+
],
|
|
159
|
+
rowData: transposedRowsAndColumns.transposedRows,
|
|
160
|
+
sideBar: false,
|
|
161
|
+
};
|
|
162
|
+
const modules = adaptable.getAgGridRegisteredModules();
|
|
163
|
+
let transposedAdaptableApi;
|
|
164
|
+
(async () => {
|
|
165
|
+
transposedAdaptableApi = await AdaptableAgGrid_1.AdaptableAgGrid._initInternal({
|
|
166
|
+
variant: 'vanilla',
|
|
167
|
+
adaptableOptions,
|
|
168
|
+
gridOptions: agGridOptions,
|
|
169
|
+
modules,
|
|
170
|
+
});
|
|
171
|
+
adaptable.api.eventApi.on('ThemeChanged', (event) => {
|
|
172
|
+
transposedAdaptableApi.themeApi.loadTheme(typeof event.theme === 'object' ? event.theme.Name : event.theme);
|
|
173
|
+
});
|
|
174
|
+
})();
|
|
175
|
+
return () => {
|
|
176
|
+
if (transposedAdaptableApi) {
|
|
177
|
+
transposedAdaptableApi.destroy();
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}, [synteticTransposedByColumnId]);
|
|
181
|
+
/**
|
|
182
|
+
* Need to get all data, manualy pivot the grid using the primary key.
|
|
183
|
+
*
|
|
184
|
+
* 1. get the data, and pivot using the primary key
|
|
185
|
+
* 2. create the col definitios, a col definition for each row
|
|
186
|
+
* 3. create the grid
|
|
187
|
+
*/
|
|
188
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column", width: "100%", height: "100%" },
|
|
189
|
+
React.createElement(Panel_1.default, null,
|
|
190
|
+
React.createElement(FormLayout_1.default, null,
|
|
191
|
+
React.createElement(FormLayout_1.FormRow, { label: "Elevated Column" },
|
|
192
|
+
React.createElement(ColumnSelector_1.ColumnSelector, { value: synteticTransposedByColumnId, onChange: (colId) => {
|
|
193
|
+
setSynteticTransposedByColumnId(colId);
|
|
194
|
+
} })))),
|
|
195
|
+
React.createElement(rebass_1.Flex, { height: "100%" },
|
|
196
|
+
React.createElement(rebass_1.Box, { id: "transposed-adaptable-container" }),
|
|
197
|
+
React.createElement(rebass_1.Box, { height: "100%", width: "100%", id: "transposed-adaptable-ag-grid-container" }))));
|
|
198
|
+
};
|
|
199
|
+
exports.TransposedPopup = TransposedPopup;
|
|
@@ -38,7 +38,7 @@ const LayoutWizard = (props) => {
|
|
|
38
38
|
}
|
|
39
39
|
if (preparedLayout.SuppressAggFuncInHeader === undefined) {
|
|
40
40
|
preparedLayout.SuppressAggFuncInHeader =
|
|
41
|
-
!!adaptable.
|
|
41
|
+
!!adaptable.agGridAdapter.initialGridOptions.suppressAggFuncInHeader;
|
|
42
42
|
}
|
|
43
43
|
return preparedLayout;
|
|
44
44
|
});
|
|
@@ -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;
|
|
@@ -19,7 +19,7 @@ const tableDOMProps = {
|
|
|
19
19
|
const NotesPopup = (props) => {
|
|
20
20
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
21
21
|
const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
|
|
22
|
-
const allNotes = (0, react_redux_1.useSelector)((state) => (0, NotesRedux_1.
|
|
22
|
+
const allNotes = (0, react_redux_1.useSelector)((state) => (0, NotesRedux_1.GetAllNotesSelector)(state.Notes));
|
|
23
23
|
const columnsMap = React.useMemo(() => {
|
|
24
24
|
const columns = {
|
|
25
25
|
primaryKey: {
|
|
@@ -28,13 +28,14 @@ const NotesPopup = (props) => {
|
|
|
28
28
|
},
|
|
29
29
|
column: {
|
|
30
30
|
field: 'ColumnId',
|
|
31
|
+
header: 'Column',
|
|
31
32
|
valueGetter: (params) => {
|
|
32
33
|
return adaptable.api.columnApi.getFriendlyNameForColumnId(params.data.ColumnId);
|
|
33
34
|
},
|
|
34
35
|
},
|
|
35
|
-
|
|
36
|
-
field: '
|
|
37
|
-
header: '
|
|
36
|
+
text: {
|
|
37
|
+
field: 'Text',
|
|
38
|
+
header: 'Text',
|
|
38
39
|
defaultEditable: true,
|
|
39
40
|
defaultFlex: 3,
|
|
40
41
|
},
|
|
@@ -44,10 +45,6 @@ const NotesPopup = (props) => {
|
|
|
44
45
|
return new Date(params.data.Timestamp).toDateString();
|
|
45
46
|
},
|
|
46
47
|
},
|
|
47
|
-
author: {
|
|
48
|
-
header: 'Author',
|
|
49
|
-
valueGetter: (params) => params.data.Author.UserName,
|
|
50
|
-
},
|
|
51
48
|
delete: {
|
|
52
49
|
defaultWidth: 50,
|
|
53
50
|
render: (params) => {
|
|
@@ -68,8 +65,8 @@ const NotesPopup = (props) => {
|
|
|
68
65
|
if (change.type === 'update') {
|
|
69
66
|
const data = change.data;
|
|
70
67
|
const prevNote = allNotes.find((x) => x.Uuid === uuid);
|
|
71
|
-
if (prevNote.
|
|
72
|
-
adaptable.api.notesApi.updateNoteText(data.
|
|
68
|
+
if (prevNote.Text !== data.Text) {
|
|
69
|
+
adaptable.api.notesApi.updateNoteText(data.Text, prevNote);
|
|
73
70
|
}
|
|
74
71
|
}
|
|
75
72
|
}
|
|
@@ -80,6 +77,7 @@ const NotesPopup = (props) => {
|
|
|
80
77
|
align: 'start',
|
|
81
78
|
defaultFlex: 1,
|
|
82
79
|
defaultSortable: false,
|
|
80
|
+
style: { fontSize: 'var(--ab-font-size-3)' },
|
|
83
81
|
},
|
|
84
82
|
}, headerOptions: {
|
|
85
83
|
alwaysReserveSpaceForSortIcon: false,
|
|
@@ -11,10 +11,10 @@ const Tabs_1 = require("../components/Tabs");
|
|
|
11
11
|
const ModuleConstants_1 = require("../Utilities/Constants/ModuleConstants");
|
|
12
12
|
const AdaptableContext_1 = require("./AdaptableContext");
|
|
13
13
|
const SpecialColumnSettingsWizardStep = (props) => {
|
|
14
|
-
var _a, _b;
|
|
14
|
+
var _a, _b, _c;
|
|
15
15
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
16
|
-
const possibleColumnTypes = adaptable.api.optionsApi.
|
|
17
|
-
const { Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = (
|
|
16
|
+
const possibleColumnTypes = (_a = adaptable.api.optionsApi.getColumnTypes()) !== null && _a !== void 0 ? _a : [];
|
|
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;
|
|
20
20
|
const columnTypes = (_b = (_a = props.settings) === null || _a === void 0 ? void 0 : _a.ColumnTypes) !== null && _b !== void 0 ? _b : [];
|
|
@@ -55,7 +55,7 @@ const SpecialColumnSettingsWizardStep = (props) => {
|
|
|
55
55
|
Boolean(possibleColumnTypes === null || possibleColumnTypes === void 0 ? void 0 : possibleColumnTypes.length) && (React.createElement(Tabs_1.Tabs, { marginTop: 2, autoFocus: false },
|
|
56
56
|
React.createElement(Tabs_1.Tabs.Tab, null, "Column Types"),
|
|
57
57
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
58
|
-
React.createElement(FormLayout_1.default, { columns: [{ name: 'first', size: '30%' }, { name: 'second' }] }, (
|
|
58
|
+
React.createElement(FormLayout_1.default, { columns: [{ name: 'first', size: '30%' }, { name: 'second' }] }, (_c = (0, chunk_1.default)(possibleColumnTypes !== null && possibleColumnTypes !== void 0 ? possibleColumnTypes : [], 2)) === null || _c === void 0 ? void 0 : _c.map(([first, second]) => {
|
|
59
59
|
var _a, _b, _c, _d, _e, _f;
|
|
60
60
|
return (React.createElement(FormLayout_1.FormRow, { key: first },
|
|
61
61
|
first && (React.createElement(CheckBox_1.CheckBox, { "data-name": first, onChange: (checked) => handleColumnTypeChange(first, checked), checked: (_c = (_b = (_a = props.settings) === null || _a === void 0 ? void 0 : _a.ColumnTypes) === null || _b === void 0 ? void 0 : _b.includes) === null || _c === void 0 ? void 0 : _c.call(_b, first) }, first)),
|
|
@@ -12,6 +12,7 @@ const ThemeSelector = (props) => {
|
|
|
12
12
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
13
13
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
14
14
|
const availableThemes = adaptable.api.themeApi.getThemes();
|
|
15
|
+
const currentTheme = (0, react_redux_1.useSelector)((state) => state.Theme.CurrentTheme);
|
|
15
16
|
const disabled = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(ModuleConstants_1.ThemeModuleId) === 'ReadOnly';
|
|
16
17
|
const optionThemes = availableThemes.map((theme) => {
|
|
17
18
|
if (typeof theme === 'string') {
|
|
@@ -26,8 +27,7 @@ const ThemeSelector = (props) => {
|
|
|
26
27
|
label: theme.Description,
|
|
27
28
|
};
|
|
28
29
|
});
|
|
29
|
-
|
|
30
|
-
return (React.createElement(Select_1.Select, { "data-name": "select-theme-dropdown", options: optionThemes, value: theme.Name, disabled: disabled, size: props.size, onChange: (themeName) => {
|
|
30
|
+
return (React.createElement(Select_1.Select, { "data-name": "select-theme-dropdown", searchable: false, options: optionThemes, value: currentTheme, disabled: disabled, size: props.size, onChange: (themeName) => {
|
|
31
31
|
dispatch(ThemeRedux.ThemeSelect(themeName));
|
|
32
32
|
} }));
|
|
33
33
|
};
|
|
@@ -9,7 +9,7 @@ const renderWithAdaptableContext_1 = require("../View/renderWithAdaptableContext
|
|
|
9
9
|
const ActionButtons = (props) => {
|
|
10
10
|
const { buttons, adaptableApi, context, rerender } = props;
|
|
11
11
|
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
12
|
-
var _a, _b;
|
|
12
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13
13
|
if (button.hidden && button.hidden(button, context)) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
@@ -31,12 +31,13 @@ const ActionButtons = (props) => {
|
|
|
31
31
|
}, 16);
|
|
32
32
|
};
|
|
33
33
|
const disabled = button.disabled && button.disabled(button, context);
|
|
34
|
-
|
|
34
|
+
const identifier = (_d = (_c = (_a = button.label) !== null && _a !== void 0 ? _a : (_b = button.icon) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : button.tooltip) !== null && _d !== void 0 ? _d : `${index + 1}`;
|
|
35
|
+
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${identifier}`, variant: (_e = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _e !== void 0 ? _e : 'text', disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, tone: (_f = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _f !== void 0 ? _f : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' }, buttonLabel));
|
|
35
36
|
})));
|
|
36
37
|
};
|
|
37
38
|
const ReactActionColumnRenderer = (props) => {
|
|
38
39
|
const rerender = (0, useRerender_1.useRerender)();
|
|
39
|
-
const adaptable = props.
|
|
40
|
+
const adaptable = props.context.__adaptable;
|
|
40
41
|
const { actionButtons, actionColumn } = adaptable.api.internalApi.getActionButtonsAndActionColumn(props.colDef);
|
|
41
42
|
if (!actionColumn || !actionButtons.length) {
|
|
42
43
|
return null;
|
|
@@ -45,7 +46,7 @@ const ReactActionColumnRenderer = (props) => {
|
|
|
45
46
|
if (adaptable.api.gridApi.isGroupRowNode(props.node) && !actionColumn.includeGroupedRows) {
|
|
46
47
|
return null;
|
|
47
48
|
}
|
|
48
|
-
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node);
|
|
49
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node, props.api);
|
|
49
50
|
const buttonContext = {
|
|
50
51
|
actionColumn,
|
|
51
52
|
primaryKeyValue: pkValue,
|
|
@@ -62,7 +63,7 @@ exports.ReactActionColumnRenderer = ReactActionColumnRenderer;
|
|
|
62
63
|
class ActionColumnRenderer {
|
|
63
64
|
// gets called once before the renderer is used
|
|
64
65
|
init(params) {
|
|
65
|
-
const adaptable = params.
|
|
66
|
+
const adaptable = params.context.__adaptable;
|
|
66
67
|
const { actionButtons, actionColumn } = adaptable.api.internalApi.getActionButtonsAndActionColumn(params.colDef);
|
|
67
68
|
if (!actionColumn || !actionButtons.length) {
|
|
68
69
|
return;
|
|
@@ -75,7 +76,7 @@ class ActionColumnRenderer {
|
|
|
75
76
|
this.eGui.innerHTML = '';
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node);
|
|
79
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node, params.api);
|
|
79
80
|
const buttonContext = {
|
|
80
81
|
actionColumn,
|
|
81
82
|
primaryKeyValue: pkValue,
|