@adaptabletools/adaptable 16.0.9 → 16.0.10-canary.0
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 +14 -14
- package/base.css.map +1 -1
- package/bundle.cjs.js +169 -169
- package/index.css +14 -14
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +2 -2
- package/src/AdaptableOptions/ChartingOptions.d.ts +40 -0
- package/src/AdaptableOptions/ColumnOptions.d.ts +17 -0
- package/src/AdaptableOptions/NotesOptions.d.ts +23 -0
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +8 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -0
- package/src/Api/AdaptableApi.d.ts +3 -3
- package/src/Api/ChartingApi.d.ts +30 -0
- package/src/Api/ColumnApi.d.ts +5 -0
- package/src/Api/ConfigApi.d.ts +4 -3
- 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 +2 -2
- package/src/Api/Implementation/ChartingApiImpl.d.ts +8 -2
- package/src/Api/Implementation/ChartingApiImpl.js +64 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +4 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ConfigApiImpl.js +9 -9
- package/src/Api/Implementation/NotesApiImpl.d.ts +20 -0
- package/src/Api/Implementation/NotesApiImpl.js +58 -0
- package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -2
- package/src/Api/Implementation/OptionsApiImpl.js +2 -2
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +2 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.js +8 -0
- package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
- package/src/Api/Internal/AdaptableInternalApi.js +0 -6
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +12 -0
- package/src/Api/Internal/ChartingInternalApi.d.ts +7 -0
- package/src/Api/Internal/ChartingInternalApi.js +45 -0
- package/src/Api/Internal/ColumnInternalApi.d.ts +3 -0
- package/src/Api/Internal/ColumnInternalApi.js +3 -0
- package/src/Api/NotesAPi.d.ts +50 -0
- package/src/Api/OptionsApi.d.ts +3 -3
- package/src/Api/UserInterfaceApi.d.ts +8 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
- package/src/PredefinedConfig/ChartingState.d.ts +22 -0
- package/src/PredefinedConfig/ChartingState.js +9 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +12 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Menu.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +2 -2
- package/src/PredefinedConfig/Common/Types.js +1 -1
- package/src/PredefinedConfig/NotesState.d.ts +59 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +2 -2
- package/src/PredefinedConfig/SystemState.d.ts +5 -3
- package/src/Redux/ActionsReducers/ChartingRedux.d.ts +28 -3
- package/src/Redux/ActionsReducers/ChartingRedux.js +52 -5
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +39 -0
- package/src/Redux/ActionsReducers/NotesRedux.js +88 -0
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +10 -10
- package/src/Redux/ActionsReducers/SystemRedux.js +23 -22
- package/src/Redux/Store/AdaptableStore.js +19 -11
- package/src/Strategy/ChartingModule.d.ts +5 -2
- package/src/Strategy/ChartingModule.js +28 -7
- package/src/Strategy/ColumnInfoModule.d.ts +11 -0
- package/src/Strategy/ColumnInfoModule.js +47 -0
- package/src/Strategy/DataSetModule.js +1 -0
- package/src/Strategy/FilterModule.js +5 -0
- package/src/Strategy/GridInfoModule.js +13 -82
- package/src/Strategy/Interface/IModule.d.ts +2 -0
- package/src/Strategy/{CommentsModule.d.ts → NotesModule.d.ts} +6 -6
- package/src/Strategy/{CommentsModule.js → NotesModule.js} +41 -41
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.d.ts +2 -0
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +20 -18
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
- package/src/Utilities/Constants/DocumentationLinkConstants.js +2 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -3
- package/src/Utilities/Constants/ModuleConstants.js +8 -5
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +2 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +36 -10
- package/src/Utilities/Extensions/ObjectExtensions.d.ts +1 -0
- package/src/Utilities/Extensions/ObjectExtensions.js +5 -1
- package/src/Utilities/ObjectFactory.d.ts +2 -1
- package/src/Utilities/ObjectFactory.js +10 -2
- package/src/Utilities/Services/Interface/IEntitlementService.d.ts +4 -0
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -2
- package/src/Utilities/Services/QueryLanguageService.js +1 -6
- package/src/Utilities/Services/ValidationService.js +15 -5
- package/src/View/AdaptableView.js +2 -2
- package/src/View/AdaptableViewFactory.js +5 -3
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +20 -4
- package/src/View/Alert/Wizard/AlertWizard.js +14 -7
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.d.ts +2 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +25 -46
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.d.ts +8 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +19 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +2 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +44 -3
- package/src/View/CalculatedColumn/utils.d.ts +2 -0
- package/src/View/CalculatedColumn/utils.js +14 -0
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.d.ts +6 -0
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +47 -0
- package/src/View/Charting/ChartingWizard/{PreviewChartSection.d.ts → AgChargingWizard/PreviewChartSection.d.ts} +1 -1
- package/src/View/Charting/ChartingWizard/{PreviewChartSection.js → AgChargingWizard/PreviewChartSection.js} +2 -2
- package/src/View/Charting/ChartingWizard/{SettingsSection.d.ts → AgChargingWizard/SettingsSection.d.ts} +1 -1
- package/src/View/Charting/ChartingWizard/{SettingsSection.js → AgChargingWizard/SettingsSection.js} +4 -4
- package/src/View/Charting/ChartingWizard/AgChargingWizard/index.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/AgChargingWizard/index.js +4 -0
- package/src/View/Charting/ChartingWizard/ChartingWizard.d.ts +4 -3
- package/src/View/Charting/ChartingWizard/ChartingWizard.js +12 -39
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.d.ts +6 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +59 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +9 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +25 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/index.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/index.js +4 -0
- package/src/View/Charting/ChartingWizard/index.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/index.js +4 -0
- package/src/View/Charting/DeleteChartButton.d.ts +2 -1
- package/src/View/Charting/DeleteChartButton.js +4 -2
- package/src/View/Charting/EditChartButton.d.ts +2 -1
- package/src/View/Charting/ShowChartButton.js +47 -16
- package/src/View/Charting/{useChartState.d.ts → useAgChartState.d.ts} +1 -1
- package/src/View/Charting/{useChartState.js → useAgChartState.js} +7 -7
- package/src/View/Charting/useChartingElements.d.ts +2 -1
- package/src/View/Charting/useChartingElements.js +36 -26
- package/src/View/Charting/useExternalChartState.d.ts +7 -0
- package/src/View/Charting/useExternalChartState.js +56 -0
- package/src/View/ColumnInfo/ColumnInfo.d.ts +5 -0
- package/src/View/ColumnInfo/ColumnInfo.js +185 -0
- package/src/View/ColumnInfo/ColumnInfoPopup.d.ts +3 -0
- package/src/View/ColumnInfo/ColumnInfoPopup.js +15 -0
- package/src/View/Components/AdaptableIconSelector/index.d.ts +1 -1
- package/src/View/Components/Selectors/ColumnSelector.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +6 -1
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +9 -0
- package/src/View/GridInfo/{AdaptableObjectsSummary.js → GridInfoPopup/AdaptableObjectsSummary.js} +2 -2
- package/src/View/GridInfo/{AdaptableOptionsComponent.d.ts → GridInfoPopup/AdaptableOptionsComponent.d.ts} +1 -1
- package/src/View/GridInfo/{AdaptableOptionsComponent.js → GridInfoPopup/AdaptableOptionsComponent.js} +6 -6
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.d.ts +6 -0
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +82 -0
- package/src/View/GridInfo/GridInfoPopup/index.d.ts +1 -0
- package/src/View/GridInfo/GridInfoPopup/index.js +4 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Notes/NotesListing.d.ts +2 -0
- package/src/View/{Comments/CommentListing.js → Notes/NotesListing.js} +13 -14
- package/src/View/Notes/NotesPopup.d.ts +2 -0
- package/src/View/{Comments/CommentPopup.js → Notes/NotesPopup.js} +21 -21
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +6 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +14 -0
- package/src/agGrid/Adaptable.d.ts +1 -1
- package/src/agGrid/Adaptable.js +28 -16
- package/src/agGrid/agGridHelper.d.ts +3 -3
- package/src/agGrid/agGridHelper.js +56 -30
- package/src/agGrid/agGridMenuHelper.js +4 -2
- package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +15 -6
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -10
- package/src/components/ExpressionEditor/editorButtonsCumulativeAggregatedScalar.js +5 -5
- package/src/components/ExpressionEditor/editorButtonsQuantileAggregatedScalar.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsQuantileAggregatedScalar.js +25 -0
- package/src/components/ExpressionEditor/index.d.ts +1 -1
- package/src/components/ExpressionEditor/index.js +2 -1
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/note.d.ts +3 -0
- package/src/components/icons/note.js +7 -0
- package/src/metamodel/adaptable.metamodel.d.ts +72 -59
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableOptions/CommentsOptions.d.ts +0 -23
- package/src/Api/CommentsApi.d.ts +0 -50
- package/src/Api/Implementation/CommentsApiImpl.d.ts +0 -20
- package/src/Api/Implementation/CommentsApiImpl.js +0 -58
- package/src/PredefinedConfig/CommentsState.d.ts +0 -59
- package/src/Redux/ActionsReducers/CommentsRedux.d.ts +0 -39
- package/src/Redux/ActionsReducers/CommentsRedux.js +0 -92
- package/src/View/Comments/CommentListing.d.ts +0 -2
- package/src/View/Comments/CommentPopup.d.ts +0 -2
- package/src/View/GridInfo/ColumnInfoComponent.d.ts +0 -20
- package/src/View/GridInfo/ColumnInfoComponent.js +0 -176
- package/src/View/GridInfo/GridInfoPopup.d.ts +0 -16
- package/src/View/GridInfo/GridInfoPopup.js +0 -117
- package/src/View/GridInfo/GridOptionsComponent.d.ts +0 -16
- package/src/View/GridInfo/GridOptionsComponent.js +0 -36
- /package/src/AdaptableOptions/{CommentsOptions.js → NotesOptions.js} +0 -0
- /package/src/Api/{CommentsApi.js → NotesAPi.js} +0 -0
- /package/src/PredefinedConfig/{CommentsState.js → NotesState.js} +0 -0
- /package/src/View/GridInfo/{AdaptableObjectsSummary.d.ts → GridInfoPopup/AdaptableObjectsSummary.d.ts} +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColumnInfo = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_redux_1 = require("react-redux");
|
|
7
|
+
const rebass_1 = require("rebass");
|
|
8
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../components/FormLayout"));
|
|
9
|
+
const InfiniteTable_1 = require("../../components/InfiniteTable");
|
|
10
|
+
const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
|
|
11
|
+
const Tabs_1 = require("../../components/Tabs");
|
|
12
|
+
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
13
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
14
|
+
const AdaptableObjectList_1 = require("../Components/AdaptableObjectList");
|
|
15
|
+
const ButtonNew_1 = require("../Components/Buttons/ButtonNew");
|
|
16
|
+
const ColumnSelector_1 = require("../Components/Selectors/ColumnSelector");
|
|
17
|
+
const BASE_CLASS_NAME = 'ab-AdaptableColumns';
|
|
18
|
+
// TODOS:
|
|
19
|
+
// - use column from props as initial value
|
|
20
|
+
// - table summary
|
|
21
|
+
// - access level for edit/new buttons
|
|
22
|
+
const MODULES_WITH_COLUMN = [
|
|
23
|
+
'Alert',
|
|
24
|
+
'CalculatedColumn',
|
|
25
|
+
'CustomSort',
|
|
26
|
+
'Filter',
|
|
27
|
+
'FormatColumn',
|
|
28
|
+
'FlashingCell',
|
|
29
|
+
'PlusMinus',
|
|
30
|
+
'Shortcut',
|
|
31
|
+
'StyledColumn', // Scope
|
|
32
|
+
];
|
|
33
|
+
const MODULES_WITH_SCOPE = [
|
|
34
|
+
'Alert',
|
|
35
|
+
'FormatColumn',
|
|
36
|
+
'PlusMinus',
|
|
37
|
+
'Shortcut',
|
|
38
|
+
'StyledColumn',
|
|
39
|
+
];
|
|
40
|
+
// These modules are shown only if they have objects defiend
|
|
41
|
+
const MODULES_WITH_VIEW_ONLY = ['CalculatedColumn', 'Filter'];
|
|
42
|
+
const MODULES_WITHOUT_NEW = ['CalculatedColumn', 'Filter'];
|
|
43
|
+
const ColumnDefPreview = (props) => {
|
|
44
|
+
const keyValuePairs = [
|
|
45
|
+
{
|
|
46
|
+
Key: 'Column Id',
|
|
47
|
+
Value: props.column ? props.column.columnId : null,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
Key: 'Header',
|
|
51
|
+
Value: props.column ? props.column.friendlyName : null,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
Key: 'Aggregatable',
|
|
55
|
+
Value: props.column ? props.column.aggregatable : null,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
Key: 'DataType',
|
|
59
|
+
Value: props.column ? props.column.dataType : null,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
Key: 'Groupable',
|
|
63
|
+
Value: props.column ? props.column.groupable : null,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
Key: 'Filterable',
|
|
67
|
+
Value: props.column ? props.column.filterable : null,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
Key: 'Hideable',
|
|
71
|
+
Value: props.column ? props.column.hideable : null,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
Key: 'Editable',
|
|
75
|
+
Value: props.column ? !props.column.IsReadOnly : null,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
Key: 'Moveable',
|
|
79
|
+
Value: props.column ? props.column.moveable : null,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
Key: 'Pivotable',
|
|
83
|
+
Value: props.column ? props.column.pivotable : null,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
Key: 'Queryable',
|
|
87
|
+
Value: props.column ? props.column.queryable : null,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
Key: 'Sortable',
|
|
91
|
+
Value: props.column ? props.column.sortable : null,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
Key: 'Visible',
|
|
95
|
+
Value: props.column ? props.column.visible : null,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
Key: 'Grouped',
|
|
99
|
+
Value: props.column ? props.column.isGrouped : null,
|
|
100
|
+
},
|
|
101
|
+
]
|
|
102
|
+
.map((keyValuePair) => {
|
|
103
|
+
return {
|
|
104
|
+
Key: keyValuePair.Key,
|
|
105
|
+
Value: keyValuePair.Value === true ? 'Yes' : keyValuePair.Value,
|
|
106
|
+
};
|
|
107
|
+
})
|
|
108
|
+
.filter((x) => x.Value);
|
|
109
|
+
const columnsMap = {
|
|
110
|
+
Key: { field: 'Key', header: 'Property', defaultFlex: 1 },
|
|
111
|
+
Value: { field: 'Value', header: 'Value', defaultFlex: 3 },
|
|
112
|
+
};
|
|
113
|
+
return (React.createElement(InfiniteTable_1.DataSource, { data: keyValuePairs, primaryKey: "Key" },
|
|
114
|
+
React.createElement(InfiniteTable_1.InfiniteTable, { domProps: {
|
|
115
|
+
style: {
|
|
116
|
+
height: '460px',
|
|
117
|
+
width: '100%',
|
|
118
|
+
},
|
|
119
|
+
}, columns: columnsMap })));
|
|
120
|
+
};
|
|
121
|
+
const ModuleView = (props) => {
|
|
122
|
+
var _a, _b, _c, _d;
|
|
123
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
124
|
+
const module = adaptable.ModuleService.getModuleById(props.moduleName);
|
|
125
|
+
if (!module.isModuleAvailable()) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const moduleInfo = module.moduleInfo;
|
|
129
|
+
const [isWizardOpen, setIsWizardOpen] = React.useState(false);
|
|
130
|
+
const EditWizard = (_c = (_b = (_a = module === null || module === void 0 ? void 0 : module.getViewProperties) === null || _a === void 0 ? void 0 : _a.call(module)) === null || _b === void 0 ? void 0 : _b.getEditWizard) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
131
|
+
const column = adaptable.api.columnApi.getColumnWithColumnId(props.selectedColumnId);
|
|
132
|
+
const allItems = (_d = module === null || module === void 0 ? void 0 : module.toViewAll) === null || _d === void 0 ? void 0 : _d.call(module);
|
|
133
|
+
if (MODULES_WITH_VIEW_ONLY.includes(props.moduleName) && !(allItems === null || allItems === void 0 ? void 0 : allItems.length)) {
|
|
134
|
+
return React.createElement(React.Fragment, null);
|
|
135
|
+
}
|
|
136
|
+
const itemsInScope = allItems.filter((item) => {
|
|
137
|
+
var _a;
|
|
138
|
+
if ('Scope' in item.abObject) {
|
|
139
|
+
const abColumn = adaptable.api.columnApi.getColumnWithColumnId(props.selectedColumnId);
|
|
140
|
+
return adaptable.api.scopeApi.isColumnInScope(abColumn, item.abObject.Scope);
|
|
141
|
+
}
|
|
142
|
+
if ('ColumnId' in item.abObject) {
|
|
143
|
+
return ((_a = item.abObject) === null || _a === void 0 ? void 0 : _a.ColumnId) === props.selectedColumnId;
|
|
144
|
+
}
|
|
145
|
+
return false;
|
|
146
|
+
});
|
|
147
|
+
if (!itemsInScope) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
const handleWizardClose = React.useCallback(() => {
|
|
151
|
+
setIsWizardOpen(false);
|
|
152
|
+
}, []);
|
|
153
|
+
// filter out items with scope
|
|
154
|
+
return (React.createElement(rebass_1.Box, { "data-name": module.moduleInfo.ModuleName, className: `${BASE_CLASS_NAME}__module-list`, key: module.moduleInfo.ModuleName, mb: 4 },
|
|
155
|
+
React.createElement(rebass_1.Flex, null,
|
|
156
|
+
React.createElement("b", { className: `${BASE_CLASS_NAME}__header` }, module.moduleInfo.FriendlyName),
|
|
157
|
+
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
158
|
+
!MODULES_WITHOUT_NEW.includes(props.moduleName) && (React.createElement(ButtonNew_1.ButtonNew, { onClick: () => setIsWizardOpen(true) }, "New"))),
|
|
159
|
+
(itemsInScope === null || itemsInScope === void 0 ? void 0 : itemsInScope.length) ? React.createElement(AdaptableObjectList_1.AdaptableObjectList, { items: itemsInScope, module: module }) : null,
|
|
160
|
+
isWizardOpen && EditWizard && (React.createElement(EditWizard, { popupParams: {
|
|
161
|
+
column,
|
|
162
|
+
action: 'New',
|
|
163
|
+
source: 'ModuleButton',
|
|
164
|
+
}, moduleInfo: moduleInfo, data: null, configEntities: null, onCloseWizard: handleWizardClose, onFinishWizard: handleWizardClose }))));
|
|
165
|
+
};
|
|
166
|
+
const ColumnInfo = (props) => {
|
|
167
|
+
const state = (0, react_redux_1.useSelector)((state) => state);
|
|
168
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
169
|
+
const [selectedColumnId, setSelectedColumnId] = React.useState(props.selectedColumnId);
|
|
170
|
+
const column = adaptable.api.columnApi.getColumnWithColumnId(selectedColumnId);
|
|
171
|
+
return (React.createElement(Panel_1.default, { flex: 1 },
|
|
172
|
+
React.createElement(rebass_1.Box, { mb: 3 },
|
|
173
|
+
React.createElement(FormLayout_1.default, null,
|
|
174
|
+
React.createElement(FormLayout_1.FormRow, { label: "Select Column" },
|
|
175
|
+
React.createElement(ColumnSelector_1.ColumnSelector, { SelectedColumnIds: [selectedColumnId], ColumnList: adaptable.api.columnApi.getColumns(), onColumnChange: (columns) => { var _a, _b; return setSelectedColumnId((_b = (_a = columns === null || columns === void 0 ? void 0 : columns[0]) === null || _a === void 0 ? void 0 : _a.columnId) !== null && _b !== void 0 ? _b : undefined); }, SelectionMode: Enums_1.SelectionMode.Single })))),
|
|
176
|
+
selectedColumnId && (React.createElement(Tabs_1.Tabs, { mb: 3 },
|
|
177
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Config"),
|
|
178
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Info"),
|
|
179
|
+
React.createElement(Tabs_1.Tabs.Content, null, selectedColumnId && (React.createElement(rebass_1.Box, { className: BASE_CLASS_NAME }, MODULES_WITH_COLUMN.map((moduleName) => {
|
|
180
|
+
return (React.createElement(ModuleView, { key: moduleName, moduleName: moduleName, selectedColumnId: selectedColumnId }));
|
|
181
|
+
})))),
|
|
182
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
183
|
+
React.createElement(rebass_1.Flex, { flex: 1 }, selectedColumnId && React.createElement(ColumnDefPreview, { column: column })))))));
|
|
184
|
+
};
|
|
185
|
+
exports.ColumnInfo = ColumnInfo;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColumnInfoPopup = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
|
|
8
|
+
const ColumnInfo_1 = require("./ColumnInfo");
|
|
9
|
+
const ColumnInfoPopup = (props) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: 'Column Info', glyphicon: 'info' },
|
|
12
|
+
React.createElement(rebass_1.Flex, { flexDirection: "column", flex: 1, height: "100%" },
|
|
13
|
+
React.createElement(ColumnInfo_1.ColumnInfo, { selectedColumnId: (_b = (_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.column) === null || _b === void 0 ? void 0 : _b.columnId }))));
|
|
14
|
+
};
|
|
15
|
+
exports.ColumnInfoPopup = ColumnInfoPopup;
|
|
@@ -3,4 +3,4 @@ import { IconSelectorProps } from '../../../components/IconSelector';
|
|
|
3
3
|
/**
|
|
4
4
|
* This component connects to adaptable to retrieve custom icons
|
|
5
5
|
*/
|
|
6
|
-
export declare const AdaptableIconSelector: React.FunctionComponent<IconSelectorProps
|
|
6
|
+
export declare const AdaptableIconSelector: React.FunctionComponent<Omit<IconSelectorProps, 'customIcons'>>;
|
|
@@ -41,7 +41,7 @@ class ColumnSelector extends React.Component {
|
|
|
41
41
|
return (React.createElement("div", { "data-name": 'column-selector' },
|
|
42
42
|
React.createElement(FormLayout_1.default, { columns: [{ name: 'columnSelector', style: { display: 'flex' } }], style: this.props.style },
|
|
43
43
|
React.createElement(FormLayout_1.FormRow, null,
|
|
44
|
-
React.createElement(DropdownButton_1.default, { marginRight: 2, columns: ['label'], showClearButton: currentColumnName != 'Select a column', onClear: () => this.onClearButton(), style: { width: '100%', fontSize: 'small' },
|
|
44
|
+
React.createElement(DropdownButton_1.default, { marginRight: 2, columns: ['label'], showClearButton: currentColumnName != 'Select a column', onClear: () => this.onClearButton(), style: { width: '100%', fontSize: 'small' }, items: sortedColumnOptions, disabled: this.props.disabled || sortedColumnOptions.length == 0 }, currentColumnName)))));
|
|
45
45
|
}
|
|
46
46
|
onClearButton() {
|
|
47
47
|
this.props.onColumnChange([]);
|
|
@@ -22,7 +22,7 @@ const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection"
|
|
|
22
22
|
const FlashingCellWizard = (props) => {
|
|
23
23
|
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
24
24
|
const [flashingCell, setFlashingCell] = (0, react_1.useState)(() => {
|
|
25
|
-
var _a, _b;
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
26
|
let flashingCell = props.data
|
|
27
27
|
? (0, Helper_1.cloneObject)(props.data)
|
|
28
28
|
: ObjectFactory_1.default.CreateEmptyFlashingCellDefinition();
|
|
@@ -31,6 +31,11 @@ const FlashingCellWizard = (props) => {
|
|
|
31
31
|
if (!flashingCell.Rule.BooleanExpression && !((_b = (_a = flashingCell.Rule) === null || _a === void 0 ? void 0 : _a.Predicates) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
32
32
|
flashingCell.Rule.BooleanExpression = '';
|
|
33
33
|
}
|
|
34
|
+
if (((_c = props.popupParams) === null || _c === void 0 ? void 0 : _c.column) && ((_d = props.popupParams) === null || _d === void 0 ? void 0 : _d.action) === 'New') {
|
|
35
|
+
flashingCell.Scope = {
|
|
36
|
+
ColumnIds: [props.popupParams.column.columnId],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
34
39
|
return flashingCell;
|
|
35
40
|
});
|
|
36
41
|
const updateProperty = (propName) => {
|
|
@@ -20,6 +20,7 @@ const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection"
|
|
|
20
20
|
const Utilities_1 = require("../../Components/EntityRulesEditor/Utilities");
|
|
21
21
|
const FormatColumnRuleWizardSection_1 = require("./FormatColumnRuleWizardSection");
|
|
22
22
|
const constants_1 = require("./constants");
|
|
23
|
+
const ObjectExtensions_1 = require("../../../Utilities/Extensions/ObjectExtensions");
|
|
23
24
|
const adjustDisplayFormat = (formatColumn, api) => {
|
|
24
25
|
formatColumn = Object.assign({}, formatColumn);
|
|
25
26
|
const formatDataType = (0, FormatColumnFormatWizardSection_1.getFormatDisplayTypeForScope)(formatColumn.Scope, api);
|
|
@@ -76,6 +77,14 @@ function FormatColumnWizard(props) {
|
|
|
76
77
|
}, []);
|
|
77
78
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
78
79
|
const handleFinish = () => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
if (((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.DisplayFormat) === null || _a === void 0 ? void 0 : _a.Options) &&
|
|
82
|
+
(0, ObjectExtensions_1.isObjectEmpty)((_b = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.DisplayFormat) === null || _b === void 0 ? void 0 : _b.Options)) {
|
|
83
|
+
delete formatColumn.DisplayFormat;
|
|
84
|
+
}
|
|
85
|
+
if (formatColumn.Style && (0, ObjectExtensions_1.isObjectEmpty)(formatColumn.Style)) {
|
|
86
|
+
delete formatColumn.Style;
|
|
87
|
+
}
|
|
79
88
|
if (data) {
|
|
80
89
|
dispatch(FormatColumnRedux.FormatColumnEdit(formatColumn));
|
|
81
90
|
}
|
package/src/View/GridInfo/{AdaptableObjectsSummary.js → GridInfoPopup/AdaptableObjectsSummary.js}
RENAMED
|
@@ -5,8 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
|
-
const AdaptableContext_1 = require("
|
|
9
|
-
const AdaptableObjectList_1 = require("
|
|
8
|
+
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
9
|
+
const AdaptableObjectList_1 = require("../../Components/AdaptableObjectList");
|
|
10
10
|
const AdaptableObjectsSummary = () => {
|
|
11
11
|
const state = (0, react_redux_1.useSelector)((state) => state);
|
|
12
12
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
@@ -4,12 +4,12 @@ exports.AdaptableOptionsComponent = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
const PanelWithButton_1 = require("
|
|
8
|
-
const ButtonMinimise_1 = require("
|
|
9
|
-
const ButtonMaximise_1 = require("
|
|
10
|
-
const AdaptableObjectCollection_1 = require("
|
|
11
|
-
const AdaptableObjectRow_1 = require("
|
|
12
|
-
const AdaptablePopover_1 = require("
|
|
7
|
+
const PanelWithButton_1 = require("../../Components/Panels/PanelWithButton");
|
|
8
|
+
const ButtonMinimise_1 = require("../../Components/Buttons/ButtonMinimise");
|
|
9
|
+
const ButtonMaximise_1 = require("../../Components/Buttons/ButtonMaximise");
|
|
10
|
+
const AdaptableObjectCollection_1 = require("../../Components/AdaptableObjectCollection");
|
|
11
|
+
const AdaptableObjectRow_1 = require("../../Components/AdaptableObjectRow");
|
|
12
|
+
const AdaptablePopover_1 = require("../../AdaptablePopover");
|
|
13
13
|
const rebass_1 = require("rebass");
|
|
14
14
|
const AdaptableOptionsComponent = (props) => {
|
|
15
15
|
const { api } = props;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ModuleViewPopupProps } from '../../Components/SharedProps/ModuleViewPopupProps';
|
|
3
|
+
interface GridInfoPopupProps extends ModuleViewPopupProps<any> {
|
|
4
|
+
}
|
|
5
|
+
export declare const GridInfoPopup: (props: GridInfoPopupProps) => JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GridInfoPopup = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const version_1 = tslib_1.__importDefault(require("../../../../version"));
|
|
8
|
+
const Panel_1 = tslib_1.__importDefault(require("../../../components/Panel"));
|
|
9
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
10
|
+
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/ArrayExtensions"));
|
|
11
|
+
const Helper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/Helper"));
|
|
12
|
+
const AdaptablePopover_1 = require("../../AdaptablePopover");
|
|
13
|
+
const AdaptableObjectCollection_1 = require("../../Components/AdaptableObjectCollection");
|
|
14
|
+
const AdaptableObjectRow_1 = require("../../Components/AdaptableObjectRow");
|
|
15
|
+
const PopupPanel_1 = require("../../Components/Popups/AdaptablePopup/PopupPanel");
|
|
16
|
+
const AdaptableObjectsSummary_1 = require("./AdaptableObjectsSummary");
|
|
17
|
+
const GridInfoPopup = (props) => {
|
|
18
|
+
const CreateGridSummaries = (colItems) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const returnRows = [];
|
|
21
|
+
const calcColumns = props.api.calculatedColumnApi
|
|
22
|
+
.getCalculatedColumns()
|
|
23
|
+
.map((c) => c.ColumnId);
|
|
24
|
+
const actionColumns = props.api.actionColumnApi
|
|
25
|
+
.getActionColumns()
|
|
26
|
+
.map((ac) => ac.columnId);
|
|
27
|
+
const freeTextColumns = props.api.freeTextColumnApi
|
|
28
|
+
.getFreeTextColumns()
|
|
29
|
+
.map((c) => c.ColumnId);
|
|
30
|
+
const columnFilterDescription = props.api.filterApi.internalApi.columnFiltersToString(props.api.filterApi.getColumnFilters());
|
|
31
|
+
const sorts = ArrayExtensions_1.default.IsNotNullOrEmpty(props.api.gridApi.getColumnSorts())
|
|
32
|
+
? props.api.gridApi.getColumnSorts().map((gs) => {
|
|
33
|
+
return props.api.columnApi.getFriendlyNameForColumnId(gs.ColumnId) + ': ' + gs.SortOrder;
|
|
34
|
+
})
|
|
35
|
+
: null;
|
|
36
|
+
const selectedRowInfo = props.api.gridApi.getSelectedRowInfo();
|
|
37
|
+
if ((_a = props.api.optionsApi.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.showAdapTableVersion) {
|
|
38
|
+
returnRows.push(createReadOnlyColItem(colItems, 'AdapTable Version', version_1.default));
|
|
39
|
+
}
|
|
40
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Sorted Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(sorts) ? sorts.join('; ') : 'None'));
|
|
41
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Column Filters', columnFilterDescription));
|
|
42
|
+
returnRows.push(createReadOnlyColItem(colItems, 'All Rows', props.api.gridApi.getRowCount()));
|
|
43
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Visible Rows', props.api.gridApi.getVisibleRowCount()));
|
|
44
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.length));
|
|
45
|
+
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));
|
|
46
|
+
returnRows.push(createReadOnlyColItem(colItems, 'All Columns', props.api.gridApi.getColumnCount()));
|
|
47
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Visible Columns', props.api.gridApi.getVisibleColumnCount()));
|
|
48
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Calculated Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(calcColumns) ? calcColumns : 'None'));
|
|
49
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Free Text Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(freeTextColumns) ? freeTextColumns : 'None'));
|
|
50
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Action Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(actionColumns) ? actionColumns : 'None'));
|
|
51
|
+
return returnRows;
|
|
52
|
+
};
|
|
53
|
+
const createReadOnlyColItem = (colItems, item1, item2, item3) => {
|
|
54
|
+
let rowColItems = Helper_1.default.cloneObject(colItems);
|
|
55
|
+
rowColItems[0].Content = item1;
|
|
56
|
+
rowColItems[1].Content = item2;
|
|
57
|
+
if (item3) {
|
|
58
|
+
let infoButton = React.createElement(AdaptablePopover_1.AdaptablePopover, { headerText: null, bodyText: [item3] });
|
|
59
|
+
rowColItems[2].Content = infoButton;
|
|
60
|
+
}
|
|
61
|
+
return rowColItems;
|
|
62
|
+
};
|
|
63
|
+
let propValueColItems = [
|
|
64
|
+
{ Content: 'Property', Size: 5 },
|
|
65
|
+
{ Content: 'Value', Size: 7 },
|
|
66
|
+
];
|
|
67
|
+
let gridSummaries = CreateGridSummaries(propValueColItems).map((x, index) => {
|
|
68
|
+
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: index, colItems: x });
|
|
69
|
+
});
|
|
70
|
+
const baseClassName = 'ab-GridInfo';
|
|
71
|
+
return (React.createElement(PopupPanel_1.PopupPanel, { className: baseClassName, headerText: 'Grid Info', glyphicon: 'info' },
|
|
72
|
+
React.createElement(rebass_1.Flex, { flexDirection: "column", flex: 1, height: "100%" },
|
|
73
|
+
React.createElement(Panel_1.default, { flex: 1 },
|
|
74
|
+
React.createElement(Tabs_1.Tabs, null,
|
|
75
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Info"),
|
|
76
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Objects"),
|
|
77
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
78
|
+
React.createElement(AdaptableObjectCollection_1.AdaptableObjectCollection, { margin: 2, colItems: propValueColItems, items: gridSummaries })),
|
|
79
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
80
|
+
React.createElement(AdaptableObjectsSummary_1.AdaptableObjectsSummary, null)))))));
|
|
81
|
+
};
|
|
82
|
+
exports.GridInfoPopup = GridInfoPopup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GridInfoPopup';
|
|
@@ -151,7 +151,7 @@ const AggregationsSection = (props) => {
|
|
|
151
151
|
props.onChange(Object.assign(Object.assign({}, layout), { SuppressAggFuncInHeader: checked }));
|
|
152
152
|
};
|
|
153
153
|
return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
|
|
154
|
-
React.createElement(Tabs_1.Tabs.Tab, null, "
|
|
154
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Column Aggregations"),
|
|
155
155
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
156
156
|
React.createElement(rebass_1.Flex, null,
|
|
157
157
|
React.createElement(FormLayout_1.default, null,
|
|
@@ -163,7 +163,7 @@ const ColumnRow = (props) => {
|
|
|
163
163
|
React.createElement(rebass_1.Flex, { className: "ab-Layout-Wizard__ColumnRow__Header", mt: 1, mb: 1, onClick: () => setIsExpanded(!isExpanded) },
|
|
164
164
|
React.createElement(rebass_1.Flex, { mr: 2, alignItems: "center" }, initialHeader),
|
|
165
165
|
props.column.columnGroup && props.column.columnGroup.groupCount > 1 ? (React.createElement(rebass_1.Box, { className: "ab-Layout-Wizard__ColumnRow__Title", ml: 2, mr: 2, padding: 1 },
|
|
166
|
-
"Group: ",
|
|
166
|
+
"Column Group: ",
|
|
167
167
|
props.column.columnGroup.friendlyName)) : null,
|
|
168
168
|
React.createElement(rebass_1.Flex, { mr: 2 },
|
|
169
169
|
React.createElement(ColumnLabels_1.ColumnLabels, { showTitle: false, sortable: props.column.sortable, filterable: props.column.filterable, pivotable: props.column.pivotable, moveable: props.column.moveable, groupable: props.column.groupable, aggregatable: props.column.aggregatable })),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NotesListing = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
8
|
const InfiniteTable_1 = require("../../components/InfiniteTable");
|
|
9
|
-
const
|
|
9
|
+
const NotesRedux_1 = require("../../Redux/ActionsReducers/NotesRedux");
|
|
10
10
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
11
11
|
const AdaptableButton_1 = require("../Components/AdaptableButton");
|
|
12
12
|
const tableDOMProps = {
|
|
@@ -16,11 +16,10 @@ const tableDOMProps = {
|
|
|
16
16
|
minHeight: 600,
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
|
-
const
|
|
19
|
+
const NotesListing = () => {
|
|
20
20
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
21
21
|
const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
|
|
22
|
-
const
|
|
23
|
-
const allComments = (0, react_redux_1.useSelector)((state) => (0, CommentsRedux_1.GetCommentsSelector)(state.Comments));
|
|
22
|
+
const allNotes = (0, react_redux_1.useSelector)((state) => (0, NotesRedux_1.GetNotesSelector)(state.Notes));
|
|
24
23
|
const columnsMap = React.useMemo(() => {
|
|
25
24
|
const columns = {
|
|
26
25
|
primaryKey: {
|
|
@@ -33,9 +32,9 @@ const CommentsListing = () => {
|
|
|
33
32
|
return adaptable.api.columnApi.getFriendlyNameForColumnId(params.data.ColumnId);
|
|
34
33
|
},
|
|
35
34
|
},
|
|
36
|
-
|
|
35
|
+
note: {
|
|
37
36
|
field: 'Value',
|
|
38
|
-
header: '
|
|
37
|
+
header: 'Note',
|
|
39
38
|
defaultEditable: true,
|
|
40
39
|
defaultFlex: 3,
|
|
41
40
|
},
|
|
@@ -53,8 +52,8 @@ const CommentsListing = () => {
|
|
|
53
52
|
defaultWidth: 50,
|
|
54
53
|
render: (params) => {
|
|
55
54
|
return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { variant: "text", icon: "delete", onClick: () => {
|
|
56
|
-
const
|
|
57
|
-
adaptable.api.
|
|
55
|
+
const note = adaptable.api.notesApi.getNoteByUuid(params.data.Uuid);
|
|
56
|
+
adaptable.api.notesApi.deleteNote(note);
|
|
58
57
|
} }));
|
|
59
58
|
},
|
|
60
59
|
},
|
|
@@ -62,15 +61,15 @@ const CommentsListing = () => {
|
|
|
62
61
|
return columns;
|
|
63
62
|
}, []);
|
|
64
63
|
return (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%', width: '100%' } },
|
|
65
|
-
React.createElement(InfiniteTable_1.DataSource, { data:
|
|
64
|
+
React.createElement(InfiniteTable_1.DataSource, { data: allNotes, primaryKey: "Uuid", onDataMutations: (params) => {
|
|
66
65
|
for (const mutation of params.mutations) {
|
|
67
66
|
const [uuid, changes] = mutation;
|
|
68
67
|
for (const change of changes) {
|
|
69
68
|
if (change.type === 'update') {
|
|
70
69
|
const data = change.data;
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
adaptable.api.
|
|
70
|
+
const prevNote = allNotes.find((x) => x.Uuid === uuid);
|
|
71
|
+
if (prevNote.Value !== data.Value) {
|
|
72
|
+
adaptable.api.notesApi.updateNoteText(data.Value, prevNote);
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
}
|
|
@@ -86,4 +85,4 @@ const CommentsListing = () => {
|
|
|
86
85
|
alwaysReserveSpaceForSortIcon: false,
|
|
87
86
|
}, rowHeight: 40, columnHeaderHeight: 65, domProps: tableDOMProps, columns: columnsMap }))));
|
|
88
87
|
};
|
|
89
|
-
exports.
|
|
88
|
+
exports.NotesListing = NotesListing;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.NotePopup = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const lodash_1 = require("lodash");
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const react_redux_1 = require("react-redux");
|
|
8
8
|
const rebass_1 = require("rebass");
|
|
9
9
|
const Textarea_1 = tslib_1.__importDefault(require("../../components/Textarea"));
|
|
10
|
-
const
|
|
10
|
+
const NotesRedux_1 = require("../../Redux/ActionsReducers/NotesRedux");
|
|
11
11
|
const SystemRedux_1 = require("../../Redux/ActionsReducers/SystemRedux");
|
|
12
12
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
13
13
|
const CellPopup_1 = require("../Components/CellPopup");
|
|
14
|
-
const
|
|
14
|
+
const NoteEditor = ({ note, onNoteChange, onClose, editMode, isReadonly }) => {
|
|
15
15
|
const textAreaRef = React.useRef(null);
|
|
16
|
-
const [liveValue, setLiveValue] = React.useState(
|
|
16
|
+
const [liveValue, setLiveValue] = React.useState(note || '');
|
|
17
17
|
const throttledOnChange = React.useMemo(() => {
|
|
18
|
-
const throttled = (0, lodash_1.throttle)((value) =>
|
|
18
|
+
const throttled = (0, lodash_1.throttle)((value) => onNoteChange(value), 300);
|
|
19
19
|
return (value) => {
|
|
20
20
|
setLiveValue(value);
|
|
21
21
|
throttled(value);
|
|
@@ -33,33 +33,33 @@ const CommentEditor = ({ comment, onCommentChange, onClose, editMode, isReadonly
|
|
|
33
33
|
}
|
|
34
34
|
}, onChange: (event) => throttledOnChange(event.target.value) }));
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const NotePopup = () => {
|
|
37
37
|
var _a;
|
|
38
38
|
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
39
39
|
const cellPopupRef = React.useRef(null);
|
|
40
|
-
const editMode = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.
|
|
41
|
-
const
|
|
40
|
+
const editMode = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemNotesEditModeSelector)(state.System));
|
|
41
|
+
const noteGridCell = (0, react_redux_1.useSelector)((state) => (0, SystemRedux_1.SystemNotesSelector)(state.System));
|
|
42
42
|
const [
|
|
43
|
-
// Only handle first
|
|
44
|
-
// Later we can handle multiple
|
|
45
|
-
|
|
46
|
-
return
|
|
43
|
+
// Only handle first note for now
|
|
44
|
+
// Later we can handle multiple notes
|
|
45
|
+
note,] = (0, react_redux_1.useSelector)((state) => {
|
|
46
|
+
return noteGridCell ? (0, NotesRedux_1.GetNotesSelector)(state.Notes, noteGridCell) : [];
|
|
47
47
|
});
|
|
48
|
-
const
|
|
49
|
-
api.
|
|
48
|
+
const handleNoteChange = (value) => {
|
|
49
|
+
api.notesApi.updateNoteText(value, note);
|
|
50
50
|
};
|
|
51
|
-
const isReadonly = api.entitlementApi.isModuleReadOnlyEntitlement('
|
|
51
|
+
const isReadonly = api.entitlementApi.isModuleReadOnlyEntitlement('Notes');
|
|
52
52
|
const enableEditMode = () => {
|
|
53
53
|
if (!editMode) {
|
|
54
|
-
api.
|
|
54
|
+
api.notesApi.showNotes(noteGridCell, true);
|
|
55
55
|
cellPopupRef === null || cellPopupRef === void 0 ? void 0 : cellPopupRef.current.refreshContent();
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
if (!
|
|
58
|
+
if (!noteGridCell) {
|
|
59
59
|
return React.createElement(React.Fragment, null);
|
|
60
60
|
}
|
|
61
|
-
return (React.createElement(CellPopup_1.CellPopup, { ref: cellPopupRef, key: `${
|
|
62
|
-
React.createElement(rebass_1.Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-
|
|
63
|
-
React.createElement(
|
|
61
|
+
return (React.createElement(CellPopup_1.CellPopup, { ref: cellPopupRef, key: `${noteGridCell.PrimaryKeyValue}-${noteGridCell.ColumnId}`, isOpen: true, primaryKeyValue: noteGridCell.PrimaryKeyValue, columnId: noteGridCell.ColumnId },
|
|
62
|
+
React.createElement(rebass_1.Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-NotesPopup" },
|
|
63
|
+
React.createElement(NoteEditor, { isReadonly: isReadonly, editMode: editMode, key: note === null || note === void 0 ? void 0 : note.Uuid, onClose: () => api.notesApi.hideNote(), note: (_a = note === null || note === void 0 ? void 0 : note.Value) !== null && _a !== void 0 ? _a : '', onNoteChange: (value) => handleNoteChange(value) }))));
|
|
64
64
|
};
|
|
65
|
-
exports.
|
|
65
|
+
exports.NotePopup = NotePopup;
|
|
@@ -17,9 +17,14 @@ const AdaptableContext_1 = require("../../AdaptableContext");
|
|
|
17
17
|
const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
|
|
18
18
|
const ShortcutWizard = (props) => {
|
|
19
19
|
const [shortcut, setShortcut] = React.useState(() => {
|
|
20
|
-
var _a;
|
|
20
|
+
var _a, _b, _c;
|
|
21
21
|
const shortcut = props.data ? (0, Helper_1.cloneObject)(props.data) : ObjectFactory_1.default.CreateEmptyShortcut();
|
|
22
22
|
shortcut.Scope = (_a = shortcut.Scope) !== null && _a !== void 0 ? _a : { All: true };
|
|
23
|
+
if (((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column) && ((_c = props.popupParams) === null || _c === void 0 ? void 0 : _c.action) === 'New') {
|
|
24
|
+
shortcut.Scope = {
|
|
25
|
+
ColumnIds: [props.popupParams.column.columnId],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
23
28
|
return shortcut;
|
|
24
29
|
});
|
|
25
30
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|