@adaptabletools/adaptable 10.0.2 → 10.0.4-canary.2
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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/base.css +84 -32
- package/bundle.cjs.js +350 -0
- package/index.css +100 -34
- package/package.json +1 -5
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +24 -12
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -3
- package/src/AdaptableOptions/ContainerOptions.d.ts +4 -5
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +1 -1
- package/src/AdaptableOptions/DateInputOptions.d.ts +5 -1
- package/src/AdaptableOptions/EditOptions.d.ts +2 -3
- package/src/AdaptableOptions/FilterOptions.d.ts +22 -15
- package/src/AdaptableOptions/GeneralOptions.d.ts +3 -2
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.d.ts +11 -11
- package/src/AdaptableOptions/NotificationsOptions.d.ts +11 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +108 -6
- package/src/Api/AdaptableApi.d.ts +12 -12
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +49 -5
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +5 -8
- package/src/Api/Events/AdaptableStateChanged.d.ts +2 -1
- package/src/Api/Events/AlertFired.d.ts +2 -1
- package/src/Api/Events/BaseEventInfo.d.ts +10 -0
- package/src/{Utilities/Interface/ProgressIndicator.js → Api/Events/BaseEventInfo.js} +0 -0
- package/src/Api/Events/CellChanged.d.ts +2 -1
- package/src/Api/Events/ChexboxColumnClicked.d.ts +2 -1
- package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -1
- package/src/Api/Events/DashboardChanged.d.ts +2 -1
- package/src/Api/Events/FlashingAlertFired.d.ts +2 -1
- package/src/Api/Events/GridDataChanged.d.ts +2 -1
- package/src/Api/Events/LayoutChanged.d.ts +2 -1
- package/src/Api/Events/LiveDataChanged.d.ts +2 -1
- package/src/Api/Events/SearchChanged.d.ts +2 -1
- package/src/Api/Events/SelectionChanged.d.ts +2 -1
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -1
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -1
- package/src/Api/Events/ThemeChanged.d.ts +2 -1
- package/src/Api/GridApi.d.ts +44 -18
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +22 -15
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +12 -3
- package/src/Api/Implementation/ColumnApiImpl.js +79 -44
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -41
- package/src/Api/Implementation/DashboardApiImpl.js +2 -1
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +11 -2
- package/src/Api/Implementation/GridApiImpl.js +30 -13
- package/src/Api/Implementation/InternalApiImpl.d.ts +4 -2
- package/src/Api/Implementation/InternalApiImpl.js +21 -5
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +19 -3
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -2
- package/src/Api/Implementation/PluginsApiImpl.js +1 -1
- package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -0
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +1 -0
- package/src/Api/Implementation/ToolPanelApiImpl.js +1 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +15 -11
- package/src/Api/Implementation/UserInterfaceApiImpl.js +73 -91
- package/src/Api/InternalApi.d.ts +4 -2
- package/src/Api/LayoutApi.d.ts +7 -0
- package/src/Api/PluginsApi.d.ts +1 -7
- package/src/Api/TeamSharingApi.d.ts +1 -1
- package/src/Api/ThemeApi.d.ts +2 -2
- package/src/Api/UserInterfaceApi.d.ts +19 -9
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -10
- package/src/PredefinedConfig/AlertState.d.ts +5 -1
- package/src/PredefinedConfig/ApplicationState.d.ts +1 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +5 -38
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +36 -36
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +4 -4
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +19 -18
- package/src/PredefinedConfig/Common/AdaptableStyle.d.ts +7 -7
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +4 -3
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/Menu.d.ts +40 -17
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/PredefinedConfig/Common/SpecialColumnSettings.js +2 -0
- package/src/PredefinedConfig/Common/Types.d.ts +5 -5
- package/src/PredefinedConfig/Common/Types.js +9 -7
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +1 -1
- package/src/PredefinedConfig/CustomSortState.d.ts +1 -1
- package/src/PredefinedConfig/DataSourceState.d.ts +1 -1
- package/src/PredefinedConfig/ExportState.d.ts +3 -3
- package/src/PredefinedConfig/FilterState.d.ts +3 -3
- package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +11 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -40
- package/src/PredefinedConfig/QuickSearchState.d.ts +3 -3
- package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/PredefinedConfig/ThemeState.d.ts +5 -1
- package/src/Redux/ActionsReducers/DashboardRedux.js +2 -1
- package/src/Redux/ActionsReducers/GridRedux.d.ts +3 -2
- package/src/Redux/ActionsReducers/GridRedux.js +2 -2
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +12 -2
- package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/DeadRedux.d.ts +4 -8
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +6 -1
- package/src/Redux/Store/AdaptableStore.d.ts +3 -3
- package/src/Redux/Store/AdaptableStore.js +25 -16
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -2
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.d.ts +2 -2
- package/src/Strategy/AlertModule.js +13 -105
- package/src/Strategy/BulkUpdateModule.d.ts +2 -2
- package/src/Strategy/BulkUpdateModule.js +7 -7
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.d.ts +2 -2
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/DashboardModule.d.ts +2 -2
- package/src/Strategy/DataChangeHistoryModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +2 -4
- package/src/Strategy/ExportModule.js +59 -62
- package/src/Strategy/FilterModule.d.ts +2 -2
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +6 -6
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.d.ts +2 -2
- package/src/Strategy/Interface/IModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.d.ts +2 -2
- package/src/Strategy/LayoutModule.js +22 -9
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.js +8 -9
- package/src/Strategy/SystemStatusModule.d.ts +2 -2
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +2 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
- package/src/Utilities/Constants/ModuleConstants.js +7 -7
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +9 -7
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
- package/src/Utilities/Helpers/DateHelper.js +30 -20
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/Interface/Preview.d.ts +2 -1
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +14 -2
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/LicenseService.js +16 -2
- package/src/Utilities/Services/ReportService.js +13 -12
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
- package/src/Utilities/runIfNotResolvedIn.js +23 -0
- package/src/View/AdaptableView.js +1 -1
- package/src/View/AdaptableViewFactory.d.ts +2 -1
- package/src/View/AdaptableViewFactory.js +2 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +7 -7
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +6 -4
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +2 -2
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +57 -38
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +4 -1
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +18 -9
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
- package/src/View/Components/FilterForm/QuickFilterForm.js +74 -35
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Panels/FilterFormPanel.d.ts +1 -1
- package/src/View/Components/Panels/PanelWithImage.d.ts +423 -1
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +23 -10
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +47 -15
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +10 -11
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +2 -3
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.d.ts +3 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +3 -3
- package/src/View/CustomSort/CustomSortPopup.js +2 -2
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +4 -4
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/Dashboard/CustomToolbarWrapper.js +2 -1
- package/src/View/Dashboard/Dashboard.js +2 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +11 -10
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +6 -6
- package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
- package/src/View/Export/ExportViewPanel.js +6 -6
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +4 -2
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +5 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/GridInfo/GridOptionsComponent.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +3 -3
- package/src/View/QuickSearch/useQuickSearchDebounced.js +2 -3
- package/src/View/Schedule/SchedulePopup.js +3 -3
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
- package/src/View/SmartEdit/SmartEditPopup.js +1 -1
- package/src/View/StateManagement/StateManagementPopup.d.ts +2 -12
- package/src/View/StateManagement/StateManagementPopup.js +21 -114
- package/src/View/StateManagement/StateManagementViewPanel.d.ts +5 -0
- package/src/View/StateManagement/StateManagementViewPanel.js +22 -0
- package/src/View/StateManagement/components/ClearButton.d.ts +6 -0
- package/src/View/StateManagement/components/ClearButton.js +9 -0
- package/src/View/StateManagement/components/ExportDropdown.d.ts +8 -0
- package/src/View/StateManagement/components/ExportDropdown.js +43 -0
- package/src/View/StateManagement/components/LoadButton.d.ts +7 -0
- package/src/View/StateManagement/components/LoadButton.js +38 -0
- package/src/View/StateManagement/handleExportState.d.ts +1 -0
- package/src/View/StateManagement/handleExportState.js +22 -0
- package/src/View/Theme/ThemeViewPanel.js +1 -1
- package/src/View/UIHelper.d.ts +2 -0
- package/src/View/UIHelper.js +10 -1
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
- package/src/agGrid/ActionColumnRenderer.js +21 -4
- package/src/agGrid/Adaptable.d.ts +28 -11
- package/src/agGrid/Adaptable.js +326 -168
- package/src/agGrid/agGridHelper.d.ts +4 -4
- package/src/agGrid/agGridHelper.js +46 -46
- package/src/agGrid/agGridMenuHelper.d.ts +15 -13
- package/src/agGrid/agGridMenuHelper.js +55 -47
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +1 -1
- package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +11 -6
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -2
- package/src/agGrid/editors/AdaptableDateEditor/index.js +16 -6
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +7 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/Datepicker/DatepickerContext.d.ts +2 -2
- package/src/components/Datepicker/index.js +9 -5
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/components/Loader/Loader.d.ts +7 -0
- package/src/components/Loader/Loader.js +13 -0
- package/src/components/Loader/index.d.ts +2 -0
- package/src/components/Loader/index.js +7 -0
- package/src/components/Modal/index.d.ts +1 -1
- package/src/components/OverlayTrigger/index.js +3 -3
- package/src/components/OverlayTrigger/useAgGridClassName.d.ts +2 -0
- package/src/components/OverlayTrigger/{useVendorClassName.js → useAgGridClassName.js} +3 -3
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
- package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
- package/src/components/icons/index.js +2 -0
- package/src/components/icons/upload.d.ts +3 -0
- package/src/components/icons/upload.js +8 -0
- package/src/metamodel/adaptable.metamodel.d.ts +176 -52
- package/src/metamodel/adaptable.metamodel.js +659 -366
- package/src/types.d.ts +5 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/PredefinedConfig/DeprecatedState.d.ts +0 -82
- package/src/PredefinedConfig/DeprecatedState.js +0 -5
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
- package/src/components/OverlayTrigger/useVendorClassName.d.ts +0 -2
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
3
3
|
import { DropdownButtonProps } from '../../../components/DropdownButton';
|
|
4
4
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
5
|
+
import { GridCell } from '../../../types';
|
|
5
6
|
export interface ColumnValueSelectorProps extends React.HTMLProps<ColumnValueSelector> {
|
|
6
7
|
selectedColumn: AdaptableColumn;
|
|
7
8
|
selectedColumnValue: string;
|
|
@@ -12,19 +13,26 @@ export interface ColumnValueSelectorProps extends React.HTMLProps<ColumnValueSel
|
|
|
12
13
|
newLabel?: string;
|
|
13
14
|
existingLabel?: string;
|
|
14
15
|
dropdownButtonProps?: DropdownButtonProps;
|
|
16
|
+
selectedGridCells: GridCell[];
|
|
15
17
|
}
|
|
16
18
|
declare enum NEW_OR_EXISTING {
|
|
17
19
|
existing = "Existing value",
|
|
18
20
|
new = "New value"
|
|
19
21
|
}
|
|
20
|
-
|
|
22
|
+
interface ColumnValueSelectorState {
|
|
21
23
|
newOrExisting: NEW_OR_EXISTING;
|
|
22
|
-
|
|
24
|
+
distinctColumnValues: any[];
|
|
25
|
+
isDistinctColumnValuesLoading: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare class ColumnValueSelector extends React.Component<ColumnValueSelectorProps, ColumnValueSelectorState> {
|
|
23
28
|
static defaultProps: {
|
|
24
29
|
newLabel: string;
|
|
25
30
|
existingLabel: string;
|
|
26
31
|
};
|
|
27
32
|
constructor(props: ColumnValueSelectorProps);
|
|
33
|
+
componentDidUpdate(prevProps: ColumnValueSelectorProps): void;
|
|
34
|
+
loadPermittedValues: () => Promise<void>;
|
|
35
|
+
handleSelectedValueExpand: () => void;
|
|
28
36
|
render(): JSX.Element;
|
|
29
37
|
onSelectedValueChange(selected: any[]): void;
|
|
30
38
|
}
|
|
@@ -10,6 +10,8 @@ const FieldWrap_1 = tslib_1.__importDefault(require("../../../components/FieldWr
|
|
|
10
10
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
11
11
|
const UIHelper_1 = tslib_1.__importDefault(require("../../UIHelper"));
|
|
12
12
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
|
|
13
|
+
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
14
|
+
const join_1 = tslib_1.__importDefault(require("../../../components/utils/join"));
|
|
13
15
|
var NEW_OR_EXISTING;
|
|
14
16
|
(function (NEW_OR_EXISTING) {
|
|
15
17
|
NEW_OR_EXISTING["existing"] = "Existing value";
|
|
@@ -18,35 +20,65 @@ var NEW_OR_EXISTING;
|
|
|
18
20
|
class ColumnValueSelector extends React.Component {
|
|
19
21
|
constructor(props) {
|
|
20
22
|
super(props);
|
|
23
|
+
this.loadPermittedValues = async () => {
|
|
24
|
+
var _a;
|
|
25
|
+
if (!((_a = this.props.selectedColumn) === null || _a === void 0 ? void 0 : _a.columnId)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// JW "fixed" this by replacing display values with raw values but really we should do it nicer in some way
|
|
29
|
+
// so that you we show the display value but we work on the raw value
|
|
30
|
+
const columnDisplayValuePairs = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctBulkUpdateDisplayValuesForColumn(this.props.selectedColumn.columnId, this.props.selectedGridCells), () => this.setState({ isDistinctColumnValuesLoading: true }));
|
|
31
|
+
this.setState({ isDistinctColumnValuesLoading: false });
|
|
32
|
+
const newSortedColumnValues = ArrayExtensions_1.ArrayExtensions.sortArray(columnDisplayValuePairs, Enums_1.SortOrder.Asc).map((v) => ({
|
|
33
|
+
label: v,
|
|
34
|
+
value: v,
|
|
35
|
+
onClick: () => this.onSelectedValueChange([{ DisplayValue: v }]),
|
|
36
|
+
}));
|
|
37
|
+
this.setState({
|
|
38
|
+
distinctColumnValues: newSortedColumnValues,
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
this.handleSelectedValueExpand = () => {
|
|
42
|
+
// load only if not loaded
|
|
43
|
+
if (!this.state.distinctColumnValues.length) {
|
|
44
|
+
this.loadPermittedValues();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
21
47
|
this.state = {
|
|
22
48
|
newOrExisting: NEW_OR_EXISTING.existing,
|
|
49
|
+
distinctColumnValues: [],
|
|
50
|
+
isDistinctColumnValuesLoading: false,
|
|
23
51
|
};
|
|
24
52
|
}
|
|
53
|
+
componentDidUpdate(prevProps) {
|
|
54
|
+
if (this.props.selectedColumn !== prevProps.selectedColumn ||
|
|
55
|
+
this.props.selectedGridCells !== prevProps.selectedGridCells) {
|
|
56
|
+
this.loadPermittedValues();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
25
59
|
render() {
|
|
26
60
|
let placeholderText = 'Select';
|
|
27
|
-
let sortedColumnValues = [];
|
|
28
61
|
let allowNew = this.props.allowNew != null ? this.props.allowNew : true;
|
|
29
62
|
if (allowNew) {
|
|
30
63
|
// placeholderText += ' or enter free text';
|
|
31
64
|
}
|
|
65
|
+
const baseClassName = 'ab-column-value-selector';
|
|
66
|
+
const className = join_1.default('ab-column-value-selector', this.state.isDistinctColumnValuesLoading && `${baseClassName}--loading`);
|
|
32
67
|
const fieldWidth = 150;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onClick: () => this.onSelectedValueChange([{ DisplayValue: v }]),
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
68
|
+
const items = this.state.isDistinctColumnValuesLoading
|
|
69
|
+
? [
|
|
70
|
+
{
|
|
71
|
+
label: 'Loading',
|
|
72
|
+
disabled: true,
|
|
73
|
+
},
|
|
74
|
+
]
|
|
75
|
+
: this.state.distinctColumnValues;
|
|
44
76
|
const dd = (React.createElement("div", null,
|
|
45
|
-
React.createElement(DropdownButton_1.default, { className:
|
|
77
|
+
React.createElement(DropdownButton_1.default, { className: className, columns: ['label'], variant: "text", showClearButton: true, onClear: () => this.onSelectedValueChange([]), style: { fontSize: 'small' }, disabled: this.props.disabled, items: items, onExpand: this.handleSelectedValueExpand }, this.props.selectedColumnValue ? this.props.selectedColumnValue : placeholderText)));
|
|
46
78
|
const input = (React.createElement(AdaptableInput_1.default, { type: this.props.selectedColumn
|
|
47
|
-
? UIHelper_1.default.getDescriptionForDataType(this.props.selectedColumn.
|
|
79
|
+
? UIHelper_1.default.getDescriptionForDataType(this.props.selectedColumn.dataType)
|
|
48
80
|
: 'text', placeholder: this.props.selectedColumn
|
|
49
|
-
? UIHelper_1.default.getPlaceHolderforDataType(this.props.selectedColumn.
|
|
81
|
+
? UIHelper_1.default.getPlaceHolderforDataType(this.props.selectedColumn.dataType)
|
|
50
82
|
: 'Enter Value', autoFocus: true, disabled: this.props.disabled, style: { width: fieldWidth }, value: this.props.selectedColumnValue, onChange: (e) => {
|
|
51
83
|
this.onSelectedValueChange([
|
|
52
84
|
{ customOption: true, DisplayValue: e.target.value },
|
|
@@ -41,7 +41,7 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
41
41
|
if (!entitlementService.isModuleHiddenEntitlement('Dashboard')) {
|
|
42
42
|
availableModules.push('Dashboard');
|
|
43
43
|
}
|
|
44
|
-
if (props.api.pluginsApi.
|
|
44
|
+
if (props.api.pluginsApi.getipushpullPluginApi() &&
|
|
45
45
|
!entitlementService.isModuleHiddenEntitlement('IPushPull')) {
|
|
46
46
|
availableModules.push('IPushPull');
|
|
47
47
|
}
|
|
@@ -154,11 +154,11 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
154
154
|
];
|
|
155
155
|
props.Columns.forEach((col, index) => {
|
|
156
156
|
colItems.push({
|
|
157
|
-
id: col.
|
|
157
|
+
id: col.columnId,
|
|
158
158
|
onClick: () => {
|
|
159
|
-
onSetColumnVisibility(col.
|
|
159
|
+
onSetColumnVisibility(col.columnId);
|
|
160
160
|
},
|
|
161
|
-
label: (React.createElement(CheckBox_1.CheckBox, { as: "div", className: "ab-dd-checkbox", variant: "agGrid", my: 0, value: col.
|
|
161
|
+
label: (React.createElement(CheckBox_1.CheckBox, { as: "div", className: "ab-dd-checkbox", variant: "agGrid", my: 0, value: col.columnId, key: col.columnId, checked: col.visible, onMouseDown: preventDefault }, col.friendlyName)),
|
|
162
162
|
});
|
|
163
163
|
});
|
|
164
164
|
return (React.createElement(DropdownButton_1.default, { listMinWidth: 150, variant: "text", tone: "none", collapseOnItemClick: false, items: colItems, columns: ['label'], className: "ab-Toolpanel__columns", key: 'dropdown-cols', id: 'dropdown-cols', tooltip: "Select Columns" }, colsGlyph));
|
|
@@ -180,7 +180,7 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
180
180
|
};
|
|
181
181
|
const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
|
|
182
182
|
const toolPanelContext = {
|
|
183
|
-
|
|
183
|
+
adaptableApi: props.api,
|
|
184
184
|
toolPanelState: props.api.toolPanelApi.getToolPanelState(),
|
|
185
185
|
};
|
|
186
186
|
let buttonStyle = props.api.internalApi.getStyleForButton(button, toolPanelContext);
|
|
@@ -213,11 +213,11 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
213
213
|
let changedColumn = props.api.columnApi.getColumnFromId(name);
|
|
214
214
|
let columns = [].concat(props.Columns);
|
|
215
215
|
changedColumn = Object.assign({}, changedColumn, {
|
|
216
|
-
Visible: !changedColumn.
|
|
216
|
+
Visible: !changedColumn.visible,
|
|
217
217
|
});
|
|
218
|
-
let index = columns.findIndex((x) => x.
|
|
218
|
+
let index = columns.findIndex((x) => x.columnId == name);
|
|
219
219
|
columns[index] = changedColumn;
|
|
220
|
-
props.onNewColumnListOrder(columns.filter((c) => c.
|
|
220
|
+
props.onNewColumnListOrder(columns.filter((c) => c.visible).map((c) => c.columnId));
|
|
221
221
|
};
|
|
222
222
|
const onSetToolPanelVisibility = (name, checked) => {
|
|
223
223
|
if (checked) {
|
|
@@ -238,7 +238,6 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
238
238
|
const toolPanelButtons = renderToolPanelButtons();
|
|
239
239
|
return (React.createElement(rebass_1.Flex, { className: "ab-ToolPanel", "data-name": "adaptable-tool-panel", flexDirection: "column", justifyContent: "center", padding: 2, style: {
|
|
240
240
|
width: '100%',
|
|
241
|
-
minWidth: 'var(--ab-cmp-toolpanel__width)',
|
|
242
241
|
} },
|
|
243
242
|
React.createElement(rebass_1.Flex, { className: "ab-ToolPanel__header", flexDirection: "row", justifyContent: "left", padding: 1, style: { width: '100%' } },
|
|
244
243
|
renderModuleDropdowns(),
|
|
@@ -271,8 +270,8 @@ exports.ConnectedAdaptableToolPanel = react_redux_1.connect(mapStateToProps, map
|
|
|
271
270
|
exports.getAdaptableToolPanelAgGridComponent = (adaptable) => {
|
|
272
271
|
return class AdaptableToolPanelAgGridComponent {
|
|
273
272
|
init(params) {
|
|
274
|
-
const
|
|
275
|
-
const Adaptable =
|
|
273
|
+
const agGridApi = params.api;
|
|
274
|
+
const Adaptable = agGridApi.__adaptable || adaptable;
|
|
276
275
|
const api = Adaptable.api;
|
|
277
276
|
this.gui = document.createElement('div');
|
|
278
277
|
this.gui.id = 'adaptable-tool-panel_' + Adaptable.adaptableOptions.adaptableId;
|
|
@@ -48,7 +48,7 @@ exports.CustomToolPanelContent = (props) => {
|
|
|
48
48
|
};
|
|
49
49
|
const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
|
|
50
50
|
const toolPanelContext = {
|
|
51
|
-
api,
|
|
51
|
+
adaptableApi: api,
|
|
52
52
|
toolPanelState: api.toolPanelApi.getToolPanelState(),
|
|
53
53
|
customToolPanel: customToolPanel,
|
|
54
54
|
};
|
|
@@ -45,7 +45,7 @@ class ToolPanelPopupComponent extends React.Component {
|
|
|
45
45
|
if (!entitlementService.isModuleHiddenEntitlement('Dashboard')) {
|
|
46
46
|
availableModules.push('Dashboard');
|
|
47
47
|
}
|
|
48
|
-
if (this.props.api.pluginsApi.
|
|
48
|
+
if (this.props.api.pluginsApi.getipushpullPluginApi() &&
|
|
49
49
|
!entitlementService.isModuleHiddenEntitlement('IPushPull')) {
|
|
50
50
|
availableModules.push('IPushPull');
|
|
51
51
|
}
|
|
@@ -81,8 +81,7 @@ class ToolPanelPopupComponent extends React.Component {
|
|
|
81
81
|
this.setState({ ToolPanelConfigView: ToolPanelConfigView });
|
|
82
82
|
}
|
|
83
83
|
onToolPanelToolPanelsChanged(selectedValues) {
|
|
84
|
-
const currentSelectedToolPanelDefinitions = this.props
|
|
85
|
-
.ToolPanelState.ToolPanels;
|
|
84
|
+
const currentSelectedToolPanelDefinitions = this.props.ToolPanelState.ToolPanels;
|
|
86
85
|
// try to return the pre-existing definition (to maintain the previous collapsed state)
|
|
87
86
|
// otherwise select the new toolPanel with the default 'collapsed' state
|
|
88
87
|
let newSelectedToolPanelDefinitions = selectedValues.map((selectedToolPanel) => {
|
|
@@ -61,7 +61,7 @@ class ConditionalStylePopupComponent extends React.Component {
|
|
|
61
61
|
if (this.props.popupParams.action == 'New') {
|
|
62
62
|
_editedConditionalStyle = ObjectFactory_1.ObjectFactory.CreateEmptyConditionalStyle();
|
|
63
63
|
_editedConditionalStyle.Scope = {
|
|
64
|
-
ColumnIds: [column.
|
|
64
|
+
ColumnIds: [column.columnId],
|
|
65
65
|
};
|
|
66
66
|
this.setState({
|
|
67
67
|
editedAdaptableObject: _editedConditionalStyle,
|
|
@@ -57,7 +57,7 @@ class ConditionalStyleSummaryComponent extends React.Component {
|
|
|
57
57
|
onNew() {
|
|
58
58
|
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyConditionalStyle();
|
|
59
59
|
configEntity.Scope = {
|
|
60
|
-
ColumnIds: [this.props.summarisedColumn.
|
|
60
|
+
ColumnIds: [this.props.summarisedColumn.columnId],
|
|
61
61
|
};
|
|
62
62
|
this.setState({
|
|
63
63
|
editedAdaptableObject: configEntity,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SharedEntityRowProps } from '../Components/SharedProps/ConfigEntityRowProps';
|
|
3
3
|
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
4
|
+
import { AdaptableScope } from '../../../types';
|
|
4
5
|
export interface CustomSortEntityRowProps extends SharedEntityRowProps<CustomSortEntityRow> {
|
|
5
|
-
column
|
|
6
|
+
column?: AdaptableColumn;
|
|
7
|
+
scope?: AdaptableScope;
|
|
6
8
|
}
|
|
7
9
|
export declare class CustomSortEntityRow extends React.Component<CustomSortEntityRowProps, {}> {
|
|
8
10
|
render(): any;
|
|
@@ -11,13 +11,13 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Exten
|
|
|
11
11
|
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
12
12
|
class CustomSortEntityRow extends React.Component {
|
|
13
13
|
render() {
|
|
14
|
+
var _a;
|
|
14
15
|
let customSort = this.props.adaptableObject;
|
|
15
16
|
const columnSortComparer = this.props.api.internalApi.getCustomSortComparer(this.props.column);
|
|
16
17
|
let colItems = Helper_1.cloneObject(this.props.colItems);
|
|
17
|
-
colItems[0].Content = React.createElement(EntityRowItem_1.EntityRowItem, { Content: this.props.column.
|
|
18
|
+
colItems[0].Content = this.props.column ? (React.createElement(EntityRowItem_1.EntityRowItem, { Content: this.props.column.friendlyName })) : this.props.scope ? (React.createElement(EntityRowItem_1.EntityRowItem, { Content: this.props.api.scopeApi.getScopeToString(this.props.scope) })) : (React.createElement("p", null, "Nothing"));
|
|
18
19
|
colItems[1].Content = (React.createElement(EntityRowItem_1.EntityRowItem, { Content: customSort ? this.getCustomSortedValues(customSort) : 'Custom Sort Function' }));
|
|
19
|
-
colItems[2].Content = (React.createElement(EntityListActionButtons_1.EntityListActionButtons, { showSuspend: true, suspendableObject: customSort, confirmDeleteAction: this.props.onDeleteConfirm, editClick: () => this.props.onEdit(customSort), shareClick: (config) => this.props.onShare(config), showShare: this.props.teamSharingActivated, overrideDisableEdit: columnSortComparer != undefined ||
|
|
20
|
-
this.props.column.FriendlyName.includes(GeneralConstants.MISSING_COLUMN), entityType: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend }));
|
|
20
|
+
colItems[2].Content = (React.createElement(EntityListActionButtons_1.EntityListActionButtons, { showSuspend: true, suspendableObject: customSort, confirmDeleteAction: this.props.onDeleteConfirm, editClick: () => this.props.onEdit(customSort), shareClick: (config) => this.props.onShare(config), showShare: this.props.teamSharingActivated, overrideDisableEdit: columnSortComparer != undefined || ((_a = this.props.column) === null || _a === void 0 ? void 0 : _a.friendlyName.includes(GeneralConstants.MISSING_COLUMN)), entityType: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend }));
|
|
21
21
|
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { isSuspended: customSort.IsSuspended, colItems: colItems });
|
|
22
22
|
}
|
|
23
23
|
getCustomSortedValues(customSort) {
|
|
@@ -53,7 +53,7 @@ class CustomSortPopupComponent extends React.Component {
|
|
|
53
53
|
componentDidMount() {
|
|
54
54
|
if (this.props.popupParams) {
|
|
55
55
|
if (this.props.popupParams.action && this.props.popupParams.column) {
|
|
56
|
-
let columnId = this.props.popupParams.column.
|
|
56
|
+
let columnId = this.props.popupParams.column.columnId;
|
|
57
57
|
if (this.props.popupParams.action == 'New') {
|
|
58
58
|
let newCustomSort = ObjectFactory_1.ObjectFactory.CreateEmptyCustomSort();
|
|
59
59
|
newCustomSort.ColumnId = columnId;
|
|
@@ -82,7 +82,7 @@ class CustomSortPopupComponent extends React.Component {
|
|
|
82
82
|
const columnSortComparers = (_a = this.props.api.internalApi
|
|
83
83
|
.getAdaptableOptions()
|
|
84
84
|
.generalOptions.customSortComparers) === null || _a === void 0 ? void 0 : _a.map((comparer, index) => {
|
|
85
|
-
return (React.createElement(CustomSortEntityRow_1.CustomSortEntityRow, { colItems: colItems, api: this.props.api, adaptableObject: comparer, moduleInfo: this.props.moduleInfo, key:
|
|
85
|
+
return (React.createElement(CustomSortEntityRow_1.CustomSortEntityRow, { colItems: colItems, api: this.props.api, adaptableObject: comparer, moduleInfo: this.props.moduleInfo, key: 'columnValuesComparer' + index, teamSharingActivated: this.props.teamSharingActivated, onShare: null, onEdit: null, onDeleteConfirm: null, scope: comparer.scope, accessLevel: 'ReadOnly' }));
|
|
86
86
|
});
|
|
87
87
|
let newButton = (React.createElement(ButtonNew_1.ButtonNew, { onClick: () => this.onNew(), tooltip: "Create Custom Sort", accessLevel: this.props.accessLevel, style: {
|
|
88
88
|
color: 'var(--ab-color-text-on-add)',
|
|
@@ -36,11 +36,11 @@ class CustomSortSummaryComponent extends React.Component {
|
|
|
36
36
|
this.state = UIHelper_1.UIHelper.getEmptyConfigState();
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
const customSort = this.props.CustomSorts.find((c) => c.ColumnId == this.props.summarisedColumn.
|
|
39
|
+
const customSort = this.props.CustomSorts.find((c) => c.ColumnId == this.props.summarisedColumn.columnId);
|
|
40
40
|
const columnSortComparer = this.props.api.internalApi.getCustomSortComparer(this.props.summarisedColumn);
|
|
41
41
|
let noCustomSort = customSort == null && columnSortComparer == null;
|
|
42
42
|
let customSortRow;
|
|
43
|
-
if (!this.props.summarisedColumn.
|
|
43
|
+
if (!this.props.summarisedColumn.sortable) {
|
|
44
44
|
customSortRow = (React.createElement(ModuleHeader_1.ModuleHeader, { key: this.props.moduleInfo.FriendlyName, moduleInfo: this.props.moduleInfo, moduleSummary: 'Column is not sortable', newButtonDisabled: true, onNew: () => this.onNew(), newButtonTooltip: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel }));
|
|
45
45
|
}
|
|
46
46
|
else if (noCustomSort) {
|
|
@@ -59,7 +59,7 @@ class CustomSortSummaryComponent extends React.Component {
|
|
|
59
59
|
}
|
|
60
60
|
onNew() {
|
|
61
61
|
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyCustomSort();
|
|
62
|
-
configEntity.ColumnId = this.props.summarisedColumn.
|
|
62
|
+
configEntity.ColumnId = this.props.summarisedColumn.columnId;
|
|
63
63
|
this.setState({
|
|
64
64
|
editedAdaptableObject: configEntity,
|
|
65
65
|
wizardStartIndex: 1,
|
|
@@ -29,16 +29,16 @@ exports.CustomSortColumnWizardSection = (props) => {
|
|
|
29
29
|
const customSorts = api.customSortApi.getAllCustomSort();
|
|
30
30
|
const columnSortComparers = ((_b = (_a = api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.generalOptions) === null || _b === void 0 ? void 0 : _b.customSortComparers) || [];
|
|
31
31
|
const usedColumnIds = [
|
|
32
|
-
...customSorts.map((
|
|
33
|
-
...columnSortComparers.map((comparer) => comparer.
|
|
32
|
+
...customSorts.map((customSort) => customSort.ColumnId),
|
|
33
|
+
...columnSortComparers.map((comparer) => api.scopeApi.getColumnIdsInScope(comparer.scope)),
|
|
34
34
|
];
|
|
35
35
|
// filter out used colum ids, but include the current one
|
|
36
36
|
return sortableColumns.filter((column) => {
|
|
37
|
-
if (!props.isNew && column.
|
|
37
|
+
if (!props.isNew && column.columnId === (data === null || data === void 0 ? void 0 : data.ColumnId)) {
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
40
|
return usedColumnIds.every((usedColumnId) => {
|
|
41
|
-
return column.
|
|
41
|
+
return column.columnId !== usedColumnId;
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
}, []);
|
|
@@ -5,7 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
|
+
const Loader_1 = require("../../../components/Loader");
|
|
8
9
|
const Tabs_1 = require("../../../components/Tabs");
|
|
10
|
+
const join_1 = tslib_1.__importDefault(require("../../../components/utils/join"));
|
|
11
|
+
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
9
12
|
const sortWithOrder_1 = require("../../../Utilities/sortWithOrder");
|
|
10
13
|
const ValueSelector_1 = require("../../Components/ValueSelector");
|
|
11
14
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
@@ -21,8 +24,23 @@ exports.renderCustomSortValuesSummary = (data) => {
|
|
|
21
24
|
};
|
|
22
25
|
exports.CustomSortValuesWizardSection = (props) => {
|
|
23
26
|
const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
24
|
-
const distinctValues = react_1.
|
|
25
|
-
|
|
27
|
+
const [distinctValues, setDistinctValues] = react_1.useState([]);
|
|
28
|
+
const [isDistinctValuesLoading, setIsDistinctValuesLoading] = react_1.useState(false);
|
|
29
|
+
react_1.useEffect(() => {
|
|
30
|
+
let isMounted = true;
|
|
31
|
+
(async () => {
|
|
32
|
+
// for sync and very fast resolving promises does not make sense to show a loader
|
|
33
|
+
setDistinctValues([]);
|
|
34
|
+
const newValues = await runIfNotResolvedIn_1.runIfNotResolvedIn(api.columnApi.getDistinctCustomSortDisplayValuesForColumn(data.ColumnId), () => isMounted && setIsDistinctValuesLoading(true));
|
|
35
|
+
if (!isMounted) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setIsDistinctValuesLoading(false);
|
|
39
|
+
setDistinctValues(newValues);
|
|
40
|
+
})();
|
|
41
|
+
return () => {
|
|
42
|
+
isMounted = false;
|
|
43
|
+
};
|
|
26
44
|
}, [data.ColumnId]);
|
|
27
45
|
const sortedValuesMap = react_1.useMemo(() => {
|
|
28
46
|
if (!data.SortedValues || !data.SortedValues.length) {
|
|
@@ -37,14 +55,14 @@ exports.CustomSortValuesWizardSection = (props) => {
|
|
|
37
55
|
return sortedValuesMap.has(option);
|
|
38
56
|
}, [sortedValuesMap]);
|
|
39
57
|
const options = react_1.useMemo(() => {
|
|
40
|
-
// if (!allowReorder) {
|
|
41
|
-
// return distinctValues;
|
|
42
|
-
// }
|
|
43
58
|
return sortWithOrder_1.sortWithOrderArray(distinctValues, data.SortedValues, { sortUnorderedItems: false });
|
|
44
59
|
}, [allowReorder, distinctValues, data.SortedValues]);
|
|
45
|
-
|
|
60
|
+
const baseClassName = 'ab-CustomSortWizard__SortOrder';
|
|
61
|
+
const className = join_1.default(baseClassName, isDistinctValuesLoading && `${baseClassName}--loading`);
|
|
62
|
+
return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' }, className: className },
|
|
46
63
|
React.createElement(Tabs_1.Tabs.Tab, null, "Sort Order"),
|
|
47
64
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
65
|
+
isDistinctValuesLoading && React.createElement(Loader_1.Loader, null, "Loading"),
|
|
48
66
|
React.createElement(ValueSelector_1.ValueSelector, { toIdentifier: (x) => `${x}`, toLabel: (x) => `${x}`, options: options, value: data.SortedValues, allowReorder: allowReorder, xSelectedLabel: () => {
|
|
49
67
|
return `Your Sort Order:`;
|
|
50
68
|
}, onChange: (SortedValues) => {
|
|
@@ -35,6 +35,7 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
35
35
|
return (React.createElement(PanelDashboard_1.PanelDashboard, { className: `ab-CustomToolbar ab-DashboardToolbar__${props.customToolbar.name}`, "data-name": `ab-CustomToolbar ab-DashboardToolbar__${props.customToolbar.name}`, headerText: props.customToolbar.title ? props.customToolbar.title : '', showConfigureButton: props.customToolbar.showConfigureButton != null &&
|
|
36
36
|
props.customToolbar.showConfigureButton == true, showCloseButton: props.customToolbar.showCloseButton != null && props.customToolbar.showCloseButton == true, onConfigure: () => {
|
|
37
37
|
const customToolbarConfiguredInfo = {
|
|
38
|
+
adaptableApi: api,
|
|
38
39
|
customToolbar: props.customToolbar,
|
|
39
40
|
};
|
|
40
41
|
api.eventApi.emit('CustomToolbarConfigured', customToolbarConfiguredInfo);
|
|
@@ -48,7 +49,7 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
48
49
|
// with the next opportunity we should abstract it
|
|
49
50
|
const dashboardContext = {
|
|
50
51
|
customToolbar: props.customToolbar,
|
|
51
|
-
api,
|
|
52
|
+
adaptableApi: api,
|
|
52
53
|
dashboardState: api.dashboardApi.getDashboardState(),
|
|
53
54
|
};
|
|
54
55
|
let buttonStyle = api.internalApi.getStyleForButton(button, dashboardContext);
|
|
@@ -103,7 +103,7 @@ const DashboardComponent = (props) => {
|
|
|
103
103
|
// delete iconProps.Uuid;
|
|
104
104
|
// }
|
|
105
105
|
const dashboardContext = {
|
|
106
|
-
|
|
106
|
+
adaptableApi: props.api,
|
|
107
107
|
dashboardState: props.api.dashboardApi.getDashboardState(),
|
|
108
108
|
};
|
|
109
109
|
let buttonStyle = props.api.internalApi.getStyleForButton(button, dashboardContext);
|
|
@@ -141,8 +141,7 @@ const DashboardComponent = (props) => {
|
|
|
141
141
|
label: menuItem.label,
|
|
142
142
|
};
|
|
143
143
|
});
|
|
144
|
-
let dashboardOptions = props.api.internalApi.getAdaptableOptions()
|
|
145
|
-
.dashboardOptions;
|
|
144
|
+
let dashboardOptions = props.api.internalApi.getAdaptableOptions().dashboardOptions;
|
|
146
145
|
if (dashboardAccessLevel == 'Full' || dashboardAccessLevel == 'ReadOnly') {
|
|
147
146
|
menuItems.unshift(dashboardAccessLevel == 'Full'
|
|
148
147
|
? {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DataChangedInfo } from '../../PredefinedConfig/Common/DataChangedInfo';
|
|
3
3
|
export interface DataChangeHistoryGridProps {
|
|
4
4
|
adaptableContainerId: string;
|
|
5
|
-
|
|
5
|
+
agGridContainerId: string;
|
|
6
6
|
changeHistoryLog: Record<string, DataChangedInfo>;
|
|
7
7
|
onUndoChange: (changeKey: string) => void;
|
|
8
8
|
}
|
|
@@ -9,7 +9,7 @@ const react_1 = require("react");
|
|
|
9
9
|
const usePrevious_1 = tslib_1.__importDefault(require("../../components/utils/usePrevious"));
|
|
10
10
|
const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
|
|
11
11
|
exports.DataChangeHistoryGrid = (props) => {
|
|
12
|
-
const { changeHistoryLog, adaptableContainerId,
|
|
12
|
+
const { changeHistoryLog, adaptableContainerId, agGridContainerId, onUndoChange } = props;
|
|
13
13
|
const mainAdaptableInstance = AdaptableContext_1.useAdaptable();
|
|
14
14
|
const [_adaptableApi, setAdaptableApi] = react_1.useState(null);
|
|
15
15
|
const adaptableApiRef = react_1.useRef(null);
|
|
@@ -22,7 +22,7 @@ exports.DataChangeHistoryGrid = (props) => {
|
|
|
22
22
|
react_1.useEffect(() => {
|
|
23
23
|
const initializeAdaptableGrid = async () => {
|
|
24
24
|
const gridOptions = buildGridOptions(mainAdaptableInstance, changeHistoryLog);
|
|
25
|
-
const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, gridOptions, adaptableContainerId,
|
|
25
|
+
const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange);
|
|
26
26
|
// to avoid direct dependency to Adaptable.ts and thus creating a circular dependency;
|
|
27
27
|
const adaptableInitFn = Object.getPrototypeOf(mainAdaptableInstance).constructor.init;
|
|
28
28
|
const dataChangeHistoryAdaptableApi = await adaptableInitFn(adaptableOptions);
|
|
@@ -71,7 +71,7 @@ exports.DataChangeHistoryGrid = (props) => {
|
|
|
71
71
|
}, [changeHistoryLog]);
|
|
72
72
|
return React.createElement(React.Fragment, null);
|
|
73
73
|
};
|
|
74
|
-
const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId,
|
|
74
|
+
const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId, agGridContainerId, undoChangeEnabled, onUndoChange) => {
|
|
75
75
|
var _a, _b;
|
|
76
76
|
const mainAdaptableOptions = mainAdaptableInstance.adaptableOptions;
|
|
77
77
|
const mainAdaptableTheme = mainAdaptableInstance.api.themeApi.getCurrentTheme();
|
|
@@ -88,7 +88,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
88
88
|
adaptableId: `${mainAdaptableOptions.adaptableId}::DataChangeHistory`,
|
|
89
89
|
containerOptions: {
|
|
90
90
|
adaptableContainer: adaptableContainerId,
|
|
91
|
-
|
|
91
|
+
agGridContainer: agGridContainerId,
|
|
92
92
|
},
|
|
93
93
|
entitlementOptions: {
|
|
94
94
|
defaultAccessLevel: 'Hidden',
|
|
@@ -104,7 +104,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
104
104
|
includeGroupedRows: true,
|
|
105
105
|
actionColumnButton: {
|
|
106
106
|
label: (button, context) => {
|
|
107
|
-
if (context.
|
|
107
|
+
if (context.adaptableApi.gridApi.isGroupRowNode(context.rowNode)) {
|
|
108
108
|
return 'Undo Group';
|
|
109
109
|
}
|
|
110
110
|
return 'Undo Change';
|
|
@@ -112,7 +112,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
112
112
|
onClick: (button, context) => {
|
|
113
113
|
var _a;
|
|
114
114
|
const rowNode = context.rowNode;
|
|
115
|
-
if (context.
|
|
115
|
+
if (context.adaptableApi.gridApi.isGroupRowNode(rowNode)) {
|
|
116
116
|
// undo all children
|
|
117
117
|
const childrenNodes = (_a = context.rowNode) === null || _a === void 0 ? void 0 : _a.childrenAfterFilter;
|
|
118
118
|
if (childrenNodes) {
|
|
@@ -188,14 +188,15 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
188
188
|
const layoutColumns = options.predefinedConfig.Layout.Layouts[0].Columns;
|
|
189
189
|
if (layoutColumns.includes('undoActionColumn')) {
|
|
190
190
|
// remove action column from layout
|
|
191
|
-
options.predefinedConfig.Layout.Layouts[0].Columns =
|
|
191
|
+
options.predefinedConfig.Layout.Layouts[0].Columns =
|
|
192
|
+
layoutColumns.filter((columnId) => columnId !== 'undoActionColumn');
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
return options;
|
|
195
196
|
};
|
|
196
197
|
const buildGridOptions = (mainAdaptableInstance, changeHistoryLog) => {
|
|
197
198
|
var _a, _b;
|
|
198
|
-
const mainPrimaryKeyColumnHeader = (_b = (_a = mainAdaptableInstance.api.columnApi.getPrimaryKeyColumn()) === null || _a === void 0 ? void 0 : _a.
|
|
199
|
+
const mainPrimaryKeyColumnHeader = (_b = (_a = mainAdaptableInstance.api.columnApi.getPrimaryKeyColumn()) === null || _a === void 0 ? void 0 : _a.friendlyName) !== null && _b !== void 0 ? _b : 'Row ID';
|
|
199
200
|
const options = {
|
|
200
201
|
suppressLoadingOverlay: true,
|
|
201
202
|
overlayNoRowsTemplate: '<div style="font-size: var(--ab-font-size-2);color: var(--ab-color-text-on-primary);">No Data Changes</div>',
|
|
@@ -295,7 +296,7 @@ const mapChangeHistoryRowData = (changeHistoryLog = {}, mainAdaptableInstance) =
|
|
|
295
296
|
primaryKey: `${changeKey}::${changeInfo.changedAt}`,
|
|
296
297
|
changeKey,
|
|
297
298
|
changeTriggerLabel: getChangeTriggerLabel(changeInfo),
|
|
298
|
-
changedColumnLabel: getColumnHeaderLabel(changeInfo.columnId, mainAdaptableInstance),
|
|
299
|
+
changedColumnLabel: getColumnHeaderLabel(changeInfo.column.columnId, mainAdaptableInstance),
|
|
299
300
|
changeInfo,
|
|
300
301
|
};
|
|
301
302
|
});
|
|
@@ -305,7 +306,7 @@ const headerMap = new Map();
|
|
|
305
306
|
const getColumnHeaderLabel = (columnId, mainAdaptableInstance) => {
|
|
306
307
|
var _a, _b;
|
|
307
308
|
if (!headerMap.has(columnId)) {
|
|
308
|
-
headerMap.set(columnId, (_b = (_a = mainAdaptableInstance.api.columnApi.getColumnFromId(columnId)) === null || _a === void 0 ? void 0 : _a.
|
|
309
|
+
headerMap.set(columnId, (_b = (_a = mainAdaptableInstance.api.columnApi.getColumnFromId(columnId)) === null || _a === void 0 ? void 0 : _a.friendlyName) !== null && _b !== void 0 ? _b : columnId);
|
|
309
310
|
}
|
|
310
311
|
return headerMap.get(columnId);
|
|
311
312
|
};
|
|
@@ -21,8 +21,8 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
23
|
const { changeHistoryMode, activationTime, suspensionTime, onChangeHistoryEnable, onChangeHistoryDisable, onChangeHistorySuspend, onChangeHistoryResume, } = this.props;
|
|
24
|
-
const adaptableContainerId = '
|
|
25
|
-
const
|
|
24
|
+
const adaptableContainerId = 'dataChangeHistoryAdaptableContainer';
|
|
25
|
+
const agGridContainerId = 'dataChangeHistoryAgGridContainer';
|
|
26
26
|
const enabled = changeHistoryMode === 'ACTIVE';
|
|
27
27
|
const disabled = changeHistoryMode === 'INACTIVE';
|
|
28
28
|
const suspended = changeHistoryMode === 'SUSPENDED';
|
|
@@ -53,9 +53,9 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
53
53
|
this.props.api.dataChangeHistoryApi.undoDataChangeHistoryEntry(changeToBeUndone);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
const
|
|
56
|
+
const currentAgGridTheme = this.props.api.internalApi
|
|
57
57
|
.getAdaptableInstance()
|
|
58
|
-
.
|
|
58
|
+
.getAgGridCurrentThemeName();
|
|
59
59
|
return (React.createElement(PanelWithButton_1.PanelWithButton, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), border: "none", bodyProps: { padding: 0 } },
|
|
60
60
|
React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup", flexDirection: "column", style: { height: '100%' } },
|
|
61
61
|
React.createElement(rebass_1.Flex, { style: {
|
|
@@ -67,8 +67,8 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
67
67
|
statusPanel)),
|
|
68
68
|
React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup--grid", "data-name": 'data-change-history--grid', flex: 1, alignSelf: 'stretch', flexDirection: 'column' },
|
|
69
69
|
React.createElement("div", { id: adaptableContainerId }),
|
|
70
|
-
React.createElement("div", { id:
|
|
71
|
-
React.createElement(DataChangeHistoryGrid_1.DataChangeHistoryGrid, { adaptableContainerId: adaptableContainerId,
|
|
70
|
+
React.createElement("div", { id: agGridContainerId, className: currentAgGridTheme, style: { height: '100%', width: '1000px' } }),
|
|
71
|
+
React.createElement(DataChangeHistoryGrid_1.DataChangeHistoryGrid, { adaptableContainerId: adaptableContainerId, agGridContainerId: agGridContainerId, changeHistoryLog: this.props.changeHistoryLog, onUndoChange: handleChangeUndo })))));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
function mapStateToProps(state, ownProps) {
|
|
@@ -92,12 +92,12 @@ class ExportViewPanelComponent extends React.Component {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
95
|
-
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Export__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
96
|
-
React.createElement(rebass_1.Flex,
|
|
97
|
-
React.createElement(DropdownButton_1.default, { disabled: allReportNames.length == 0, style: {
|
|
98
|
-
React.createElement(rebass_1.Flex,
|
|
99
|
-
React.createElement(DropdownButton_1.default, { disabled: currentReportId === SELECT_REPORT_STRING, style: {
|
|
100
|
-
React.createElement(rebass_1.Flex, { className: join_1.default(accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Export__controls`), style: {
|
|
95
|
+
return (React.createElement(rebass_1.Flex, { style: { gap: 5 }, flexDirection: "row", className: `ab-${elementType}__Export__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
96
|
+
React.createElement(rebass_1.Flex, { flex: 1 },
|
|
97
|
+
React.createElement(DropdownButton_1.default, { disabled: allReportNames.length == 0, style: { width: '100%', fontSize: 'small' }, items: reportItems, columns: ['label'], className: `ab-${elementType}__Export__select`, onClear: () => this.onSelectedReportChanged(null), showClearButton: !!currentReport, variant: "outlined", marginRight: 2 }, currentReportId)),
|
|
98
|
+
React.createElement(rebass_1.Flex, { flex: 1 },
|
|
99
|
+
React.createElement(DropdownButton_1.default, { disabled: currentReportId === SELECT_REPORT_STRING, style: { width: '100%', fontSize: 'small' }, items: destinationItems, columns: ['label'], className: `ab-${elementType}__Export__export`, onClear: () => this.onSelectedDestinationChanged(null), showClearButton: !!currentDestination, variant: "outlined", marginRight: 2 }, currentDestinationId)),
|
|
100
|
+
React.createElement(rebass_1.Flex, { className: join_1.default(accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Export__controls`), style: { width: '100%' } },
|
|
101
101
|
React.createElement(ButtonExport_1.ButtonExport, { onClick: () => onApplyExport(), tooltip: "Export Report", className: `ab-${elementType}__Export__export`, disabled: currentReport == null || currentDestination == null }),
|
|
102
102
|
React.createElement(ButtonEdit_1.ButtonEdit, { onClick: () => this.props.onEditReport(this.props.moduleInfo.Popup), tooltip: "Edit Report", className: `ab-${elementType}__Export__edit`, disabled: currentReport == null || currentReport.ReportColumnScope == 'CustomColumns', accessLevel: accessLevel }),
|
|
103
103
|
React.createElement(ButtonNew_1.ButtonNew, { variant: "text", className: `ab-${elementType}__Export__new`, tone: "neutral", children: null, onClick: () => this.props.onNewReport(this.props.moduleInfo.Popup), tooltip: "Create New Report", accessLevel: accessLevel }),
|