@adaptabletools/adaptable 24.0.0-canary.7 → 24.0.0-canary.9
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 +2 -3
- package/agGrid.js +2 -3
- package/aql.d.ts +29 -1
- package/aql.js +49 -1
- package/devtools.d.ts +55 -1
- package/index.css +7 -19
- package/index.d.ts +2 -3
- package/index.js +2 -3
- package/package.json +1 -1
- package/src/AdaptableOptions/ActionColumnOptions.d.ts +24 -0
- package/src/AdaptableOptions/AdaptableOptions.d.ts +97 -69
- package/src/AdaptableOptions/AdaptablePlugin.d.ts +113 -1
- package/src/AdaptableOptions/AlertOptions.d.ts +0 -2
- package/src/AdaptableOptions/ChartingOptions.d.ts +11 -5
- package/src/AdaptableOptions/ColumnMenuOptions.d.ts +30 -0
- package/src/AdaptableOptions/ColumnOptions.d.ts +0 -2
- package/src/AdaptableOptions/CommentOptions.d.ts +12 -4
- package/src/AdaptableOptions/ContextMenuOptions.d.ts +31 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +0 -3
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +3 -2
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +6 -0
- package/src/AdaptableOptions/EditOptions.d.ts +18 -2
- package/src/AdaptableOptions/ExportOptions.d.ts +23 -0
- package/src/AdaptableOptions/ExpressionOptions.d.ts +0 -3
- package/src/AdaptableOptions/Fdc3Options.d.ts +77 -3
- package/src/AdaptableOptions/FilterOptions.d.ts +13 -8
- package/src/AdaptableOptions/LayoutOptions.d.ts +16 -3
- package/src/AdaptableOptions/NotificationsOptions.d.ts +0 -1
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +0 -2
- package/src/AdaptableOptions/RowFormOptions.d.ts +9 -0
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +10 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +87 -2
- package/src/AdaptableState/AdaptableState.d.ts +98 -4
- package/src/AdaptableState/AlertState.d.ts +20 -21
- package/src/AdaptableState/ApplicationState.d.ts +5 -3
- package/src/AdaptableState/BaseState.d.ts +9 -2
- package/src/AdaptableState/CalculatedColumnState.d.ts +10 -8
- package/src/AdaptableState/ChartingState.d.ts +10 -5
- package/src/AdaptableState/CommentState.d.ts +10 -4
- package/src/AdaptableState/Common/AdaptableAlert.d.ts +6 -2
- package/src/AdaptableState/Common/AdaptableButton.d.ts +3 -1
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +38 -1
- package/src/AdaptableState/Common/AdaptableFilterState.d.ts +3 -1
- package/src/AdaptableState/Common/AdaptableFlashingCell.d.ts +3 -1
- package/src/AdaptableState/Common/AdaptableForm.d.ts +9 -0
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +27 -1
- package/src/AdaptableState/Common/AdaptableIcon.d.ts +4 -2
- package/src/AdaptableState/Common/AdaptableObject.d.ts +9 -1
- package/src/AdaptableState/Common/AdaptableQuery.d.ts +9 -0
- package/src/AdaptableState/Common/AdaptableStyle.d.ts +6 -8
- package/src/AdaptableState/Common/AggregationColumns.d.ts +15 -6
- package/src/AdaptableState/Common/ButtonStyle.d.ts +3 -1
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +6 -2
- package/src/AdaptableState/Common/CellHighlightInfo.d.ts +4 -2
- package/src/AdaptableState/Common/CellSummary.d.ts +33 -0
- package/src/AdaptableState/Common/ColumnFilter.d.ts +3 -1
- package/src/AdaptableState/Common/ColumnHighlightInfo.d.ts +4 -2
- package/src/AdaptableState/Common/ColumnScope.d.ts +32 -1
- package/src/AdaptableState/Common/ColumnSetupInfo.d.ts +17 -0
- package/src/AdaptableState/Common/ColumnSort.d.ts +3 -1
- package/src/AdaptableState/Common/CompactCalculatedColumnEditorInfo.d.ts +3 -0
- package/src/AdaptableState/Common/DataChangedScope.d.ts +3 -1
- package/src/AdaptableState/Common/DataUpdateConfig.d.ts +3 -1
- package/src/AdaptableState/Common/Entitlement.d.ts +4 -2
- package/src/AdaptableState/Common/Enums.d.ts +21 -0
- package/src/AdaptableState/Common/ExtendedLayout.d.ts +3 -1
- package/src/AdaptableState/Common/Fdc3Context.d.ts +9 -0
- package/src/AdaptableState/Common/Fdc3Intent.d.ts +6 -0
- package/src/AdaptableState/Common/GridFilter.d.ts +3 -1
- package/src/AdaptableState/Common/MenuItem.d.ts +9 -0
- package/src/AdaptableState/Common/RowHighlightInfo.d.ts +4 -2
- package/src/AdaptableState/Common/RowScope.d.ts +3 -1
- package/src/AdaptableState/Common/RowSummary.d.ts +14 -4
- package/src/AdaptableState/Common/RowsHighlightInfo.d.ts +5 -3
- package/src/AdaptableState/Common/Schedule.d.ts +10 -2
- package/src/AdaptableState/Common/SpecialColumnSettings.d.ts +3 -1
- package/src/AdaptableState/Common/SystemStatusMessageInfo.d.ts +4 -2
- package/src/AdaptableState/Common/TransposeConfig.d.ts +1 -1
- package/src/AdaptableState/Common/Types.d.ts +9 -0
- package/src/AdaptableState/CustomSortState.d.ts +8 -5
- package/src/AdaptableState/DashboardState.d.ts +14 -10
- package/src/AdaptableState/ExportState.d.ts +12 -4
- package/src/AdaptableState/FlashingCellState.d.ts +8 -5
- package/src/AdaptableState/FormatColumnState.d.ts +28 -8
- package/src/AdaptableState/FreeTextColumnState.d.ts +14 -8
- package/src/AdaptableState/IPushPullState.d.ts +39 -3
- package/src/AdaptableState/InitialState.d.ts +9 -9
- package/src/AdaptableState/InternalState.d.ts +183 -3
- package/src/AdaptableState/LayoutState.d.ts +64 -21
- package/src/AdaptableState/NamedQueryState.d.ts +16 -4
- package/src/AdaptableState/NoteState.d.ts +7 -3
- package/src/AdaptableState/OpenFinState.d.ts +12 -2
- package/src/AdaptableState/PlusMinusState.d.ts +8 -4
- package/src/AdaptableState/PopupState.d.ts +29 -1
- package/src/AdaptableState/QuickSearchState.d.ts +5 -3
- package/src/AdaptableState/Selection/GridCell.d.ts +5 -3
- package/src/AdaptableState/Selection/GridCellRange.d.ts +8 -7
- package/src/AdaptableState/Selection/SelectedCellInfo.d.ts +1 -1
- package/src/AdaptableState/ShortcutState.d.ts +7 -3
- package/src/AdaptableState/StatusBarState.d.ts +7 -6
- package/src/AdaptableState/StyledColumnState.d.ts +46 -14
- package/src/AdaptableState/TeamSharingState.d.ts +46 -2
- package/src/AdaptableState/ThemeState.d.ts +24 -2
- package/src/AdaptableState/ToolPanelState.d.ts +10 -5
- package/src/AdaptableState/UserInterfaceState.d.ts +2 -2
- package/src/AdaptableState/Uuid.d.ts +6 -0
- package/src/Api/ActionColumnApi.d.ts +3 -1
- package/src/Api/AdaptableApi.d.ts +54 -50
- package/src/Api/AlertApi.d.ts +20 -12
- package/src/Api/ApplicationApi.d.ts +6 -2
- package/src/Api/BulkUpdateApi.d.ts +2 -1
- package/src/Api/CalculatedColumnApi.d.ts +4 -1
- package/src/Api/CalendarApi.d.ts +10 -0
- package/src/Api/CellSummaryApi.d.ts +9 -3
- package/src/Api/ChartingApi.d.ts +22 -7
- package/src/Api/ColumnApi.d.ts +71 -4
- package/src/Api/ColumnFilterApi.d.ts +13 -3
- package/src/Api/ColumnMenuApi.d.ts +13 -2
- package/src/Api/ColumnScopeApi.d.ts +27 -1
- package/src/Api/CommentApi.d.ts +10 -7
- package/src/Api/ContextMenuApi.d.ts +11 -1
- package/src/Api/CustomSortApi.d.ts +6 -2
- package/src/Api/DashboardApi.d.ts +30 -9
- package/src/Api/DataChangeHistoryApi.d.ts +9 -3
- package/src/Api/DataImportApi.d.ts +1 -1
- package/src/Api/EntitlementApi.d.ts +6 -1
- package/src/Api/EventApi.d.ts +67 -19
- package/src/Api/Events/AdaptableReady.d.ts +6 -2
- package/src/Api/Events/AdaptableStateChanged.d.ts +9 -5
- package/src/Api/Events/AdaptableStateReloaded.d.ts +7 -3
- package/src/Api/Events/AlertFired.d.ts +8 -2
- package/src/Api/Events/BeforeAdaptableStateChange.d.ts +6 -2
- package/src/Api/Events/CalculatedColumnChanged.d.ts +7 -3
- package/src/Api/Events/CellChanged.d.ts +6 -2
- package/src/Api/Events/CellSelectionChanged.d.ts +6 -2
- package/src/Api/Events/ChartChanged.d.ts +16 -8
- package/src/Api/Events/CommentChanged.d.ts +8 -2
- package/src/Api/Events/CustomToolbarConfigured.d.ts +6 -2
- package/src/Api/Events/DashboardChanged.d.ts +27 -6
- package/src/Api/Events/DataImported.d.ts +8 -4
- package/src/Api/Events/DataSetSelected.d.ts +6 -2
- package/src/Api/Events/Fdc3MessageInfo.d.ts +14 -4
- package/src/Api/Events/FlashingCellDisplayed.d.ts +6 -2
- package/src/Api/Events/GridFilterApplied.d.ts +11 -3
- package/src/Api/Events/GridSorted.d.ts +6 -2
- package/src/Api/Events/LayoutChanged.d.ts +36 -5
- package/src/Api/Events/LiveDataChanged.d.ts +21 -5
- package/src/Api/Events/NoteChanged.d.ts +5 -1
- package/src/Api/Events/ReportScheduleRan.d.ts +7 -3
- package/src/Api/Events/RowChanged.d.ts +6 -2
- package/src/Api/Events/RowFormSubmitted.d.ts +28 -12
- package/src/Api/Events/RowSelectionChanged.d.ts +6 -2
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +6 -2
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +6 -2
- package/src/Api/Events/ThemeSelected.d.ts +6 -2
- package/src/Api/ExportApi.d.ts +59 -32
- package/src/Api/ExpressionApi.d.ts +24 -1
- package/src/Api/Fdc3Api.d.ts +16 -3
- package/src/Api/FlashingCellApi.d.ts +6 -1
- package/src/Api/FormatColumnApi.d.ts +18 -11
- package/src/Api/FreeTextColumnApi.d.ts +4 -2
- package/src/Api/GridApi.d.ts +92 -19
- package/src/Api/IPushPullApi.d.ts +19 -2
- package/src/Api/Internal/EventInternalApi.d.ts +2 -1
- package/src/Api/Internal/EventInternalApi.js +7 -0
- package/src/Api/InteropioPluginApi.d.ts +2 -1
- package/src/Api/LayoutApi.d.ts +29 -15
- package/src/Api/NamedQueryApi.d.ts +10 -6
- package/src/Api/NoteApi.d.ts +15 -11
- package/src/Api/OpenFinApi.d.ts +8 -2
- package/src/Api/OptionsApi.d.ts +43 -1
- package/src/Api/PluginsApi.d.ts +6 -1
- package/src/Api/PlusMinusApi.d.ts +2 -1
- package/src/Api/QuickSearchApi.d.ts +6 -1
- package/src/Api/RowFormApi.d.ts +8 -7
- package/src/Api/ShortcutApi.d.ts +3 -1
- package/src/Api/SmartEditApi.d.ts +4 -1
- package/src/Api/StateApi.d.ts +30 -2
- package/src/Api/StatusBarApi.d.ts +2 -0
- package/src/Api/StyledColumnApi.d.ts +23 -12
- package/src/Api/SystemStatusApi.d.ts +18 -6
- package/src/Api/TeamSharingApi.d.ts +8 -1
- package/src/Api/ThemeApi.d.ts +17 -8
- package/src/Api/ToolPanelApi.d.ts +12 -7
- package/src/Api/UserInterfaceApi.d.ts +10 -1
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/View/Filter/ColumnFilter/ColumnFilterNew.js +14 -9
- package/src/agGrid/Adaptable.d.ts +0 -12
- package/src/agGrid/Adaptable.js +0 -52
- package/src/agGrid/AdaptableFrameworkComponent.d.ts +12 -0
- package/src/agGrid/AdaptableLogger.d.ts +74 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +3 -0
- package/src/agGrid/index.d.ts +1 -6
- package/src/agGrid/index.js +1 -3
- package/src/aql/ExpressionEvaluation.d.ts +27 -0
- package/src/aql/types.d.ts +22 -0
- package/src/components/ColorField/index.d.ts +2 -3
- package/src/components/ColorField/index.js +22 -2
- package/src/components/aql/QueryBuilder/GroupEditor.js +1 -1
- package/src/components/aql/QueryBuilder/QueryBuilder.d.ts +5 -0
- package/src/components/aql/QueryBuilder/QueryBuilder.js +1 -1
- package/src/components/aql/QueryBuilder/context.d.ts +7 -0
- package/src/components/aql/QueryBuilder/context.js +3 -1
- package/src/env.js +2 -2
- package/src/migration/legacyAdaptableQuery.d.ts +29 -4
- package/src/setupDevTools.js +223 -0
- package/src/types.d.ts +1 -3
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/vendor/components/ColorField/index.d.ts +12 -2
- package/vendor/components/ColorField/index.d.ts.map +1 -1
- package/vendor/components/ColorField/index.js +3 -4
- package/vendor/components/ColorField/index.js.map +1 -1
- package/vendor/components/ColorPicker/index.d.ts +50 -11
- package/vendor/components/ColorPicker/index.d.ts.map +1 -1
- package/vendor/components/ColorPicker/index.js +172 -54
- package/vendor/components/ColorPicker/index.js.map +1 -1
- package/vendor/components/ColorPicker/themeColors.d.ts +42 -1
- package/vendor/components/ColorPicker/themeColors.d.ts.map +1 -1
- package/vendor/components/ColorPicker/themeColors.js +131 -1
- package/vendor/components/ColorPicker/themeColors.js.map +1 -1
- package/vendor/components/index.css +6 -0
- package/vendor/components/index.d.ts +2 -2
- package/vendor/components/index.d.ts.map +1 -1
- package/vendor/components/index.js +1 -1
- package/vendor/components/index.js.map +1 -1
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +0 -99
- package/src/AdaptableInterfaces/AdaptableNoCodeWizard.js +0 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.d.ts +0 -15
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableConfig.js +0 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +0 -19
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +0 -337
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +0 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.js +0 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.d.ts +0 -30
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +0 -162
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.d.ts +0 -18
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +0 -12
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +0 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +0 -131
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.d.ts +0 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +0 -30
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.d.ts +0 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +0 -80
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.d.ts +0 -6
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +0 -100
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +0 -11
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +0 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.d.ts +0 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +0 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.d.ts +0 -21
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.js +0 -63
- package/src/View/AdaptableWizardView/Utilities/Utils.d.ts +0 -1
- package/src/View/AdaptableWizardView/Utilities/Utils.js +0 -21
- package/src/View/AdaptableWizardView/Utilities/helper.d.ts +0 -19
- package/src/View/AdaptableWizardView/Utilities/helper.js +0 -81
- package/src/View/AdaptableWizardView/Wizard.d.ts +0 -57
- package/src/View/AdaptableWizardView/Wizard.js +0 -98
- package/src/View/AdaptableWizardView/index.d.ts +0 -4
- package/src/View/AdaptableWizardView/index.js +0 -4
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Reducer, ReactNode } from 'react';
|
|
3
|
-
import { GridOptions } from 'ag-grid-enterprise';
|
|
4
|
-
import { AdaptableOptions } from '../../types';
|
|
5
|
-
import { ConfigurationWizardProps } from './AdaptableConfigurationDialog/ConfigurationWizard';
|
|
6
|
-
export interface AdaptableWizardViewProps {
|
|
7
|
-
adaptableOptions?: Omit<AdaptableOptions, 'primaryKey'> & {
|
|
8
|
-
primaryKey?: string;
|
|
9
|
-
};
|
|
10
|
-
gridOptions?: GridOptions;
|
|
11
|
-
/**
|
|
12
|
-
* Default true.
|
|
13
|
-
*/
|
|
14
|
-
ddEnabled?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* When true the the configuration wizard will be shown.
|
|
17
|
-
* It will use the available information in adaptableOptions & gridOptions.
|
|
18
|
-
* This mode skips over interpreting data to figure-out columns.
|
|
19
|
-
*/
|
|
20
|
-
skipToWizard?: boolean;
|
|
21
|
-
onInit: (adaptableOptions: AdaptableOptions, gridOptions: GridOptions) => any;
|
|
22
|
-
fileContentsToJSON?: (str: string) => Promise<any> | any;
|
|
23
|
-
readFile?: (file: File) => Promise<any>;
|
|
24
|
-
fileAccept?: string;
|
|
25
|
-
helpText?: React.ReactNode;
|
|
26
|
-
loadingMessage?: ReactNode;
|
|
27
|
-
defaultActionMessage?: ReactNode;
|
|
28
|
-
dragOverActionMessage?: ReactNode;
|
|
29
|
-
fetchData?: () => Promise<Record<string, any>[]>;
|
|
30
|
-
showFetchDataWizard?: boolean;
|
|
31
|
-
startSections?: ConfigurationWizardProps['startSections'];
|
|
32
|
-
prepareData?: (data: any, file?: File) => {
|
|
33
|
-
columns: string[];
|
|
34
|
-
data: any[];
|
|
35
|
-
primaryKey?: string;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
export declare const initialState: Partial<WizardState>;
|
|
39
|
-
export declare const reducer: Reducer<WizardState, any>;
|
|
40
|
-
interface WizardState {
|
|
41
|
-
dropped: boolean;
|
|
42
|
-
error: any;
|
|
43
|
-
adaptableOptions: AdaptableOptions;
|
|
44
|
-
gridOptions: GridOptions;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The wizard in a few modes:
|
|
48
|
-
*
|
|
49
|
-
* 1. Based on data:
|
|
50
|
-
* 1.1 Drag and drop a file
|
|
51
|
-
* 1.2 Fetch data from a url
|
|
52
|
-
*
|
|
53
|
-
* 2. Based on configuration:
|
|
54
|
-
* Provide a schema, on how the data looks like.
|
|
55
|
-
*/
|
|
56
|
-
export declare const Wizard: (props: AdaptableWizardViewProps) => React.JSX.Element;
|
|
57
|
-
export {};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useReducer, useState, useEffect } from 'react';
|
|
3
|
-
import { prepareDataSource, prepareGridOptions } from './Utilities/helper';
|
|
4
|
-
import ConfigurationDialog from './AdaptableConfigurationDialog';
|
|
5
|
-
import FileDroppable from '../../components/FileDroppable';
|
|
6
|
-
import { validDataSource } from './Utilities/Utils';
|
|
7
|
-
import { Flex } from '../../components/Flex';
|
|
8
|
-
export const initialState = {
|
|
9
|
-
dropped: false,
|
|
10
|
-
};
|
|
11
|
-
export const reducer = (state, action) => {
|
|
12
|
-
if (action.type === 'DROPPED') {
|
|
13
|
-
return {
|
|
14
|
-
...state,
|
|
15
|
-
adaptableOptions: action.payload.adaptableOptions,
|
|
16
|
-
gridOptions: action.payload.gridOptions,
|
|
17
|
-
dropped: true,
|
|
18
|
-
error: null,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
if (action.type === 'ERROR') {
|
|
22
|
-
return {
|
|
23
|
-
...state,
|
|
24
|
-
dropped: false,
|
|
25
|
-
error: action.payload,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
if (action.type === 'CANCEL') {
|
|
29
|
-
return {
|
|
30
|
-
...state,
|
|
31
|
-
error: null,
|
|
32
|
-
dropped: false,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return state;
|
|
36
|
-
};
|
|
37
|
-
export const Wizard = (props) => {
|
|
38
|
-
const [state, dispatch] = useReducer(reducer, {
|
|
39
|
-
...initialState,
|
|
40
|
-
adaptableOptions: props.adaptableOptions,
|
|
41
|
-
gridOptions: props.gridOptions,
|
|
42
|
-
});
|
|
43
|
-
const [droppableKey, setDroppableKey] = useState(Date.now());
|
|
44
|
-
const [isDataLoading, setIsDataLoading] = useState(false);
|
|
45
|
-
const handleDataSource = (array, file) => {
|
|
46
|
-
const dataSourceInfo = (props.prepareData || prepareDataSource)(array, file);
|
|
47
|
-
try {
|
|
48
|
-
validDataSource(dataSourceInfo);
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
return dispatch({
|
|
52
|
-
type: 'ERROR',
|
|
53
|
-
payload: `Invalid adaptable configuration - ${err}`,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
const gridOptions = prepareGridOptions(dataSourceInfo, props.gridOptions);
|
|
57
|
-
const adaptableOptions = { ...props.adaptableOptions };
|
|
58
|
-
adaptableOptions.adaptableId = adaptableOptions.adaptableId || (file ? file.name : '');
|
|
59
|
-
if (dataSourceInfo.primaryKey) {
|
|
60
|
-
adaptableOptions.primaryKey = dataSourceInfo.primaryKey;
|
|
61
|
-
}
|
|
62
|
-
const shouldShowWizard = props.fetchData ? Boolean(props.showFetchDataWizard) : true;
|
|
63
|
-
if (shouldShowWizard) {
|
|
64
|
-
dispatch({
|
|
65
|
-
type: 'DROPPED',
|
|
66
|
-
payload: { adaptableOptions, gridOptions },
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
props.onInit(adaptableOptions, gridOptions);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
let wizard;
|
|
74
|
-
if (props.skipToWizard || state.dropped) {
|
|
75
|
-
wizard = (_jsx(ConfigurationDialog, { startSections: props.startSections, adaptableConfig: {
|
|
76
|
-
adaptableOptions: state.adaptableOptions,
|
|
77
|
-
gridOptions: state.gridOptions,
|
|
78
|
-
}, onCancel: () => {
|
|
79
|
-
setDroppableKey(Date.now());
|
|
80
|
-
dispatch({
|
|
81
|
-
type: 'CANCEL',
|
|
82
|
-
});
|
|
83
|
-
}, onFinish: (adaptableConfig) => {
|
|
84
|
-
props.onInit(adaptableConfig.adaptableOptions, adaptableConfig.gridOptions);
|
|
85
|
-
} }));
|
|
86
|
-
}
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
if (props.fetchData) {
|
|
89
|
-
setIsDataLoading(true);
|
|
90
|
-
props.fetchData().then((data) => {
|
|
91
|
-
handleDataSource(data);
|
|
92
|
-
setIsDataLoading(false);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}, []);
|
|
96
|
-
const ddEnabled = props.ddEnabled ?? !props.fetchData;
|
|
97
|
-
return (_jsxs(_Fragment, { children: [ddEnabled && (_jsx(FileDroppable, { className: 'ab-NocodeWizard', toJSON: props.fileContentsToJSON, readFile: props.readFile, fileAccept: props.fileAccept, helpText: props.helpText, message: state.error, defaultText: props.defaultActionMessage, dragOverText: props.dragOverActionMessage, loadingText: props.loadingMessage, onDropSuccess: handleDataSource }, droppableKey)), isDataLoading && (_jsx(Flex, { className: 'ab-NocodeWizard', alignItems: "center", justifyContent: "center", flexDirection: "column", children: props.loadingMessage || 'Loading ...' })), wizard] }));
|
|
98
|
-
};
|