@adaptabletools/adaptable 16.0.9 → 16.1.0-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/agGrid.d.ts +4 -0
- package/agGrid.js +4 -0
- package/base.css +16 -14
- package/base.css.map +1 -1
- package/bundle.cjs.js +171 -170
- package/index.css +18 -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/AdaptableFrameworkComponent.d.ts +12 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -2
- package/src/AdaptableOptions/ChartingOptions.d.ts +48 -3
- package/src/AdaptableOptions/ColumnOptions.d.ts +17 -0
- package/src/AdaptableOptions/DataImportOptions.d.ts +57 -0
- package/src/AdaptableOptions/MenuOptions.d.ts +147 -8
- package/src/AdaptableOptions/MenuOptions.js +75 -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 +8 -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/DataImportApi.d.ts +9 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +4 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +4 -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/DataImportApiImpl.d.ts +10 -0
- package/src/Api/Implementation/DataImportApiImpl.js +14 -0
- package/src/Api/Implementation/ExpressionApiImpl.js +1 -1
- package/src/Api/Implementation/NotesApiImpl.d.ts +20 -0
- package/src/Api/Implementation/NotesApiImpl.js +58 -0
- package/src/Api/Implementation/OptionsApiImpl.d.ts +3 -2
- package/src/Api/Implementation/OptionsApiImpl.js +5 -2
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +7 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +30 -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/Internal/DataImportInternalApi.d.ts +4 -0
- package/src/Api/Internal/DataImportInternalApi.js +49 -0
- package/src/Api/NotesAPi.d.ts +50 -0
- package/src/Api/NotesAPi.js +2 -0
- package/src/Api/OptionsApi.d.ts +8 -3
- package/src/Api/UserInterfaceApi.d.ts +22 -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 +2 -7
- package/src/PredefinedConfig/Common/Types.d.ts +4 -4
- package/src/PredefinedConfig/Common/Types.js +3 -1
- package/src/PredefinedConfig/NotesState.d.ts +59 -0
- package/src/PredefinedConfig/NotesState.js +2 -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/DataImportModule.d.ts +11 -0
- package/src/Strategy/DataImportModule.js +36 -0
- package/src/Strategy/DataSetModule.js +1 -0
- package/src/Strategy/Fdc3Module.js +3 -2
- 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/LayoutModule.js +1 -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 +9 -3
- package/src/Utilities/Constants/ModuleConstants.js +11 -5
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +5 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +3 -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/Helpers/AdaptableHelper.js +2 -0
- package/src/Utilities/Interface/MessagePopups.d.ts +2 -2
- 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/ModuleService.js +2 -0
- 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 +7 -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/ExternalRenderer.d.ts +1 -0
- package/src/View/Components/ExternalRenderer.js +2 -1
- package/src/View/Components/Panels/PanelWithImage.js +3 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +4 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +12 -2
- package/src/View/Components/Selectors/ColumnSelector.js +1 -1
- package/src/View/DataImport/DataImportPopup.d.ts +6 -0
- package/src/View/DataImport/DataImportPopup.js +32 -0
- package/src/View/DataImport/DataImportWizard/DataImportWizard.d.ts +8 -0
- package/src/View/DataImport/DataImportWizard/DataImportWizard.js +176 -0
- package/src/View/DataImport/DataImportWizard/index.d.ts +1 -0
- package/src/View/DataImport/DataImportWizard/index.js +4 -0
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.d.ts +10 -0
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +154 -0
- package/src/View/DataImport/DataImportWizard/sections/ImportSection.d.ts +9 -0
- package/src/View/DataImport/DataImportWizard/sections/ImportSection.js +24 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadFileSection.d.ts +8 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadFileSection.js +11 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.d.ts +13 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +23 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.d.ts +8 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +13 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/index.d.ts +1 -0
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/index.js +4 -0
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.d.ts +11 -0
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +35 -0
- package/src/View/DataImport/systemFileHandlers.d.ts +3 -0
- package/src/View/DataImport/systemFileHandlers.js +44 -0
- 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/View/Wizard/OnePageAdaptableWizard.d.ts +1 -0
- package/src/View/Wizard/OnePageWizards.d.ts +1 -0
- package/src/View/Wizard/OnePageWizards.js +2 -2
- 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 +58 -30
- package/src/agGrid/agGridMenuHelper.d.ts +20 -9
- package/src/agGrid/agGridMenuHelper.js +292 -135
- 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/FileDroppable/index.d.ts +2 -1
- package/src/components/FileDroppable/index.js +8 -7
- package/src/components/icons/import.d.ts +3 -0
- package/src/components/icons/import.js +7 -0
- package/src/components/icons/index.js +4 -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 +243 -61
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/index.d.ts +2 -2
- package/src/parser/src/index.js +4 -4
- package/src/parser/src/tokenizer.d.ts +1 -1
- package/src/parser/src/tokenizer.js +14 -6
- package/src/parser/src/types.d.ts +2 -2
- package/src/types.d.ts +9 -8
- 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 → DataImportOptions.js} +0 -0
- /package/src/{Api/CommentsApi.js → AdaptableOptions/NotesOptions.js} +0 -0
- /package/src/{PredefinedConfig/CommentsState.js → Api/DataImportApi.js} +0 -0
- /package/src/View/GridInfo/{AdaptableObjectsSummary.d.ts → GridInfoPopup/AdaptableObjectsSummary.d.ts} +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataPreview = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const React = tslib_1.__importStar(require("react"));
|
|
7
|
+
const HelpBlock_1 = tslib_1.__importDefault(require("../../../../components/HelpBlock"));
|
|
8
|
+
const icons_1 = require("../../../../components/icons");
|
|
9
|
+
const InfiniteTable_1 = require("../../../../components/InfiniteTable");
|
|
10
|
+
const Tag_1 = require("../../../../components/Tag");
|
|
11
|
+
const AdaptableContext_1 = require("../../../AdaptableContext");
|
|
12
|
+
const AdaptablePopover_1 = require("../../../AdaptablePopover");
|
|
13
|
+
const UIHelper_1 = tslib_1.__importDefault(require("../../../UIHelper"));
|
|
14
|
+
const tableDOMProps = {
|
|
15
|
+
style: {
|
|
16
|
+
height: '100%',
|
|
17
|
+
minWidth: '10rem',
|
|
18
|
+
minHeight: 300,
|
|
19
|
+
flex: 1,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const getRowErrors = (errors, primaryKeyValue) => {
|
|
23
|
+
if (!errors) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (!errors[primaryKeyValue]) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return errors[primaryKeyValue];
|
|
30
|
+
};
|
|
31
|
+
const getCellError = (errors, primaryKeyValue, columnId) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
return (_b = (_a = getRowErrors(errors, primaryKeyValue)) === null || _a === void 0 ? void 0 : _a.find((e) => e.columnId === columnId)) !== null && _b !== void 0 ? _b : null;
|
|
34
|
+
};
|
|
35
|
+
const DataPreview = (props) => {
|
|
36
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
37
|
+
if (!props.data) {
|
|
38
|
+
return (React.createElement(HelpBlock_1.default, { color: 'var(--ab-color-error)' },
|
|
39
|
+
"No Data has been Imported. Go to ",
|
|
40
|
+
React.createElement(Tag_1.Tag, null, "Upload"),
|
|
41
|
+
" step and provide Data"));
|
|
42
|
+
}
|
|
43
|
+
const primaryKey = adaptable.api.optionsApi.getPrimaryKey();
|
|
44
|
+
const dataSample = props.data[0];
|
|
45
|
+
const columns = React.useMemo(() => {
|
|
46
|
+
if (!dataSample) {
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
const adaptableColumnsInData = adaptable.api.columnApi.getColumns().filter((c) => {
|
|
50
|
+
var _a;
|
|
51
|
+
return dataSample && ((_a = c.field) !== null && _a !== void 0 ? _a : c.columnId) in dataSample;
|
|
52
|
+
});
|
|
53
|
+
const mapDataType = (dataType) => {
|
|
54
|
+
switch (dataType) {
|
|
55
|
+
case 'Boolean':
|
|
56
|
+
return 'boolean';
|
|
57
|
+
case 'Date':
|
|
58
|
+
return 'date';
|
|
59
|
+
case 'String':
|
|
60
|
+
return 'number';
|
|
61
|
+
}
|
|
62
|
+
return dataType;
|
|
63
|
+
};
|
|
64
|
+
const infiniteColumns = adaptableColumnsInData.reduce((acc, column) => {
|
|
65
|
+
const isPrimaryKey = column.columnId === primaryKey;
|
|
66
|
+
let editable = !isPrimaryKey;
|
|
67
|
+
if (props.editable !== undefined && !isPrimaryKey) {
|
|
68
|
+
editable = props.editable;
|
|
69
|
+
}
|
|
70
|
+
acc[column.columnId] = {
|
|
71
|
+
field: column.field,
|
|
72
|
+
header: adaptable.api.columnApi.getFriendlyNameForColumnId(column.columnId),
|
|
73
|
+
dataType: mapDataType(column.dataType),
|
|
74
|
+
defaultEditable: editable,
|
|
75
|
+
valueGetter: (params) => {
|
|
76
|
+
if (column.dataType === 'Boolean') {
|
|
77
|
+
return params.data[column.columnId] ? 'True' : 'False';
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return params.data[params.field];
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
return acc;
|
|
85
|
+
}, {});
|
|
86
|
+
infiniteColumns['valid'] = {
|
|
87
|
+
header: 'Valid',
|
|
88
|
+
maxWidth: 100,
|
|
89
|
+
minWidth: 90,
|
|
90
|
+
align: 'center',
|
|
91
|
+
renderValue: (params) => {
|
|
92
|
+
const cellErrors = getRowErrors(props.errors, params.data[primaryKey]);
|
|
93
|
+
const successColor = UIHelper_1.default.getColorByMessageType('Success');
|
|
94
|
+
if (!cellErrors || cellErrors.length === 0) {
|
|
95
|
+
return React.createElement(icons_1.Icon, { name: "check", style: { color: successColor, fill: 'currentColor' } });
|
|
96
|
+
}
|
|
97
|
+
const errorsStr = cellErrors.map((e) => e.error).join(', ');
|
|
98
|
+
return (React.createElement(AdaptablePopover_1.AdaptablePopover, { popoverMinWidth: 200, showEvent: "mouseenter", hideEvent: "mouseleave", headerText: 'Validation Error', bodyText: [errorsStr], MessageType: 'Error' }));
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
infiniteColumns['type'] = {
|
|
102
|
+
header: 'Type',
|
|
103
|
+
maxWidth: 100,
|
|
104
|
+
minWidth: 90,
|
|
105
|
+
renderValue: (params) => {
|
|
106
|
+
try {
|
|
107
|
+
const isExistingRow = adaptable.api.gridApi.getRowNodeForPrimaryKey(params.data[primaryKey]);
|
|
108
|
+
return isExistingRow ? 'Update' : 'New';
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
// empty
|
|
112
|
+
}
|
|
113
|
+
return React.createElement(React.Fragment, null);
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
return infiniteColumns;
|
|
117
|
+
}, [props.data]);
|
|
118
|
+
const getCellErrorStyle = (columnId, primaryKeyValue) => {
|
|
119
|
+
const cellError = getCellError(props.errors, primaryKeyValue, columnId);
|
|
120
|
+
if (!cellError) {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
border: 'var(--ab-Dataimport-validation-error__border)',
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
return (React.createElement(InfiniteTable_1.DataSource, { data: props.data, primaryKey: primaryKey, onDataMutations: (params) => {
|
|
128
|
+
const newRowData = [...props.data];
|
|
129
|
+
const mutationsList = (0, lodash_1.flatten)(Array.from(params.mutations.values()));
|
|
130
|
+
if (!mutationsList.length) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
mutationsList.forEach((mutation) => {
|
|
134
|
+
const index = newRowData.findIndex((row) => row[primaryKey] === mutation.primaryKey);
|
|
135
|
+
if (index !== -1) {
|
|
136
|
+
newRowData[index] = Object.assign(Object.assign({}, newRowData[index]), mutation.data);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
props.onDataChange(newRowData);
|
|
140
|
+
} },
|
|
141
|
+
React.createElement(InfiniteTable_1.InfiniteTable, { columnPinning: {
|
|
142
|
+
valid: 'end',
|
|
143
|
+
type: 'end',
|
|
144
|
+
}, columnTypes: {
|
|
145
|
+
default: {
|
|
146
|
+
style: (params) => {
|
|
147
|
+
return getCellErrorStyle(params.column.id, params.rowInfo.id);
|
|
148
|
+
},
|
|
149
|
+
minWidth: 100,
|
|
150
|
+
defaultFlex: 1,
|
|
151
|
+
},
|
|
152
|
+
}, domProps: tableDOMProps, columns: columns })));
|
|
153
|
+
};
|
|
154
|
+
exports.DataPreview = DataPreview;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ValidationErrorsMap } from '../DataImportWizard';
|
|
3
|
+
interface ImportSectionProps {
|
|
4
|
+
data?: Record<string, unknown>[];
|
|
5
|
+
onDataChange?: (data: Record<string, unknown>[]) => void;
|
|
6
|
+
errors: ValidationErrorsMap | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const ImportSection: React.FunctionComponent<ImportSectionProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImportSection = 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 check_box_1 = tslib_1.__importDefault(require("../../../../components/icons/check-box"));
|
|
9
|
+
const Tabs_1 = require("../../../../components/Tabs");
|
|
10
|
+
const DataPreview_1 = require("./DataPreview");
|
|
11
|
+
const ImportSection = (props) => {
|
|
12
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column", p: 2, height: "100%" },
|
|
13
|
+
React.createElement(Tabs_1.Tabs, { mb: 2 },
|
|
14
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Import Options"),
|
|
15
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
16
|
+
React.createElement(FormLayout_1.default, null,
|
|
17
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Invalid Rows" },
|
|
18
|
+
React.createElement(check_box_1.default, null))))),
|
|
19
|
+
React.createElement(Tabs_1.Tabs, { flex: 1 },
|
|
20
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Preview"),
|
|
21
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
22
|
+
React.createElement(DataPreview_1.DataPreview, { onDataChange: props.onDataChange, data: props.data, errors: props.errors, editable: false })))));
|
|
23
|
+
};
|
|
24
|
+
exports.ImportSection = ImportSection;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ImportFileSectionProps {
|
|
3
|
+
readFile: (data: File) => Promise<Record<string, unknown>[]>;
|
|
4
|
+
supportedFileFormats: string;
|
|
5
|
+
message: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const ImportFileSection: React.FunctionComponent<ImportFileSectionProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImportFileSection = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const index_1 = tslib_1.__importDefault(require("../../../../../components/FileDroppable/index"));
|
|
7
|
+
const index_2 = tslib_1.__importDefault(require("../../../../../components/HelpBlock/index"));
|
|
8
|
+
const ImportFileSection = (props) => {
|
|
9
|
+
return (React.createElement(index_1.default, { loadingText: React.createElement(index_2.default, { mb: 2 }, "File loaded , file ready to be imported."), message: props.message, helpText: "Data Import", defaultText: "Click here to select a file to load, or drag it here", dragOverText: "Drop file here to start Data Import", height: "100%", fileAccept: props.supportedFileFormats, readFile: props.readFile }));
|
|
10
|
+
};
|
|
11
|
+
exports.ImportFileSection = ImportFileSection;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
declare type UploadSectionProps = {
|
|
3
|
+
readFile: (data: File) => Promise<Record<string, unknown>[]>;
|
|
4
|
+
supportedFileFormats: string;
|
|
5
|
+
fileMessage: ReactNode;
|
|
6
|
+
onTextChange: (text: string) => void;
|
|
7
|
+
text?: string;
|
|
8
|
+
textMessage?: string;
|
|
9
|
+
importType: 'file' | 'text';
|
|
10
|
+
onImportTypeChange: (importType: 'file' | 'text') => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const UploadSection: React.FC<UploadSectionProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadSection = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const index_1 = tslib_1.__importDefault(require("../../../../../components/Radio/index"));
|
|
8
|
+
const index_2 = require("../../../../../components/Tabs/index");
|
|
9
|
+
const UploadFileSection_1 = require("./UploadFileSection");
|
|
10
|
+
const UploadTextSection_1 = require("./UploadTextSection");
|
|
11
|
+
const UploadSection = (props) => {
|
|
12
|
+
return (react_1.default.createElement(rebass_1.Flex, { p: 2, height: "100%", flexDirection: "column" },
|
|
13
|
+
react_1.default.createElement(index_2.Tabs, { mb: 2 },
|
|
14
|
+
react_1.default.createElement(index_2.Tabs.Tab, null, "Import Type"),
|
|
15
|
+
react_1.default.createElement(index_2.Tabs.Content, null,
|
|
16
|
+
react_1.default.createElement(rebass_1.Flex, { flexDirection: "column" },
|
|
17
|
+
react_1.default.createElement(index_1.default, { onClick: () => props.onImportTypeChange('file'), checked: props.importType === 'file' }, "File"),
|
|
18
|
+
react_1.default.createElement(index_1.default, { onClick: () => props.onImportTypeChange('text'), checked: props.importType === 'text' }, "Text")))),
|
|
19
|
+
react_1.default.createElement(index_2.Tabs, { flex: 1 },
|
|
20
|
+
react_1.default.createElement(index_2.Tabs.Tab, null, props.importType === 'file' ? 'File Upload' : 'Text'),
|
|
21
|
+
react_1.default.createElement(index_2.Tabs.Content, null, props.importType === 'file' ? (react_1.default.createElement(UploadFileSection_1.ImportFileSection, { readFile: props.readFile, supportedFileFormats: props.supportedFileFormats, message: props.fileMessage })) : (react_1.default.createElement(UploadTextSection_1.ImportTextSection, { message: props.textMessage, text: props.text, onTextChange: props.onTextChange }))))));
|
|
22
|
+
};
|
|
23
|
+
exports.UploadSection = UploadSection;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImportTextSection = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const index_1 = tslib_1.__importDefault(require("../../../../../components/HelpBlock/index"));
|
|
7
|
+
const index_2 = tslib_1.__importDefault(require("../../../../../components/Textarea/index"));
|
|
8
|
+
const ImportTextSection = (props) => {
|
|
9
|
+
return (React.createElement(React.Fragment, null,
|
|
10
|
+
React.createElement(index_2.default, { value: props.text, onChange: (event) => props.onTextChange(event.target.value), height: "100%" }),
|
|
11
|
+
props.message && React.createElement(index_1.default, null, props.message)));
|
|
12
|
+
};
|
|
13
|
+
exports.ImportTextSection = ImportTextSection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UploadSection';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ValidationErrorsMap } from '../DataImportWizard';
|
|
3
|
+
interface ValidationSectionProps {
|
|
4
|
+
data?: Record<string, unknown>[];
|
|
5
|
+
onDataChange?: (data: Record<string, unknown>[]) => void;
|
|
6
|
+
errors: ValidationErrorsMap | null;
|
|
7
|
+
skipInvalidRows: boolean;
|
|
8
|
+
onSkipInvalidRowsChange: (skipInvalidRows: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const ValidationSection: React.FunctionComponent<ValidationSectionProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidationSection = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const CheckBox_1 = require("../../../../components/CheckBox");
|
|
8
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
|
|
9
|
+
const Tabs_1 = require("../../../../components/Tabs");
|
|
10
|
+
const DataPreview_1 = require("./DataPreview");
|
|
11
|
+
const getRowErrors = (errors, primaryKeyValue) => {
|
|
12
|
+
if (!errors) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (!errors[primaryKeyValue]) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return errors[primaryKeyValue];
|
|
19
|
+
};
|
|
20
|
+
const ValidationSection = (props) => {
|
|
21
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column", p: 2, height: "100%" },
|
|
22
|
+
React.createElement(Tabs_1.Tabs, { mb: 2 },
|
|
23
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Import Options"),
|
|
24
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
25
|
+
React.createElement(FormLayout_1.default, null,
|
|
26
|
+
React.createElement(FormLayout_1.FormRow, { label: "Exclude Invalid Rows" },
|
|
27
|
+
React.createElement(CheckBox_1.CheckBox, { onChange: () => {
|
|
28
|
+
props.onSkipInvalidRowsChange(!props.skipInvalidRows);
|
|
29
|
+
}, checked: props.skipInvalidRows }))))),
|
|
30
|
+
React.createElement(Tabs_1.Tabs, { flex: 1 },
|
|
31
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Preview"),
|
|
32
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
33
|
+
React.createElement(DataPreview_1.DataPreview, { data: props.data, errors: props.errors, editable: true, onDataChange: props.onDataChange })))));
|
|
34
|
+
};
|
|
35
|
+
exports.ValidationSection = ValidationSection;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.systemFileHandlers = exports.parseCSV = void 0;
|
|
4
|
+
const FileDroppable_1 = require("../../components/FileDroppable");
|
|
5
|
+
const jsonHandler = {
|
|
6
|
+
fileExtension: '.json',
|
|
7
|
+
handleFile: (file) => (0, FileDroppable_1.readJSONFile)(file),
|
|
8
|
+
};
|
|
9
|
+
const parseCSV = (content) => {
|
|
10
|
+
const lines = content.split('\n');
|
|
11
|
+
const headers = lines[0].split(',');
|
|
12
|
+
const data = [];
|
|
13
|
+
if (lines.length <= 1) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
for (let i = 1; i < lines.length; i++) {
|
|
17
|
+
const values = lines[i].split(',');
|
|
18
|
+
if (values.length === headers.length) {
|
|
19
|
+
const item = {};
|
|
20
|
+
for (let j = 0; j < headers.length; j++) {
|
|
21
|
+
const value = values[j];
|
|
22
|
+
item[headers[j]] = isNaN(Number(value)) ? value : Number(value);
|
|
23
|
+
}
|
|
24
|
+
data.push(item);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
exports.parseCSV = parseCSV;
|
|
30
|
+
const csvFileHandler = {
|
|
31
|
+
fileExtension: '.csv',
|
|
32
|
+
handleFile: (file) => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
const reader = new FileReader();
|
|
35
|
+
reader.onload = (event) => {
|
|
36
|
+
var _a;
|
|
37
|
+
const content = (_a = event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
38
|
+
resolve((0, exports.parseCSV)(content));
|
|
39
|
+
};
|
|
40
|
+
reader.readAsText(file);
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
exports.systemFileHandlers = [jsonHandler, csvFileHandler];
|
|
@@ -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 })),
|