@adaptabletools/adaptable 12.0.0-canary.1 → 12.0.0-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.
Files changed (68) hide show
  1. package/bundle.cjs.js +90 -90
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -0
  6. package/src/Api/Implementation/FormatColumnApiImpl.js +2 -2
  7. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +8 -3
  8. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +3 -2
  9. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +9 -2
  10. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.d.ts +18 -0
  11. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +87 -0
  12. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.d.ts +18 -0
  13. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +16 -0
  14. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.d.ts +2 -9
  15. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/index.js +2 -75
  16. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.d.ts +3 -1
  17. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/useSelection.js +9 -4
  18. package/src/View/AdaptableWizardView/Utils.d.ts +1 -0
  19. package/src/View/AdaptableWizardView/Utils.js +24 -0
  20. package/src/View/AdaptableWizardView/Wizard.d.ts +54 -0
  21. package/src/View/AdaptableWizardView/Wizard.js +98 -0
  22. package/src/View/AdaptableWizardView/index.d.ts +1 -22
  23. package/src/View/AdaptableWizardView/index.js +2 -103
  24. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +1 -1
  25. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -2
  26. package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +1 -1
  27. package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +2 -2
  28. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  29. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
  30. package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +1 -1
  31. package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.js +1 -1
  32. package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +1 -1
  33. package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.js +1 -1
  34. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +2 -2
  35. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +1 -1
  36. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +1 -1
  37. package/src/View/Export/Wizard/ReportNameWizardSection.js +1 -1
  38. package/src/View/Export/Wizard/ReportRowsWizardSection.js +1 -1
  39. package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +2 -2
  40. package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +1 -1
  41. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +1 -1
  42. package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +1 -1
  43. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  44. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
  45. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
  46. package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
  47. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
  48. package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +2 -2
  49. package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +1 -1
  50. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +2 -2
  51. package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  52. package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
  53. package/src/View/Schedule/Wizard/ScheduleScheduleSummary.js +1 -1
  54. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +1 -1
  55. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +1 -1
  56. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
  57. package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +1 -1
  58. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +2 -2
  59. package/src/View/Wizard/Interface/IAdaptableWizard.d.ts +2 -2
  60. package/src/View/Wizard/ObjectTagsWizardSection.js +1 -1
  61. package/src/View/Wizard/OnePageAdaptableWizard.d.ts +5 -6
  62. package/src/View/Wizard/OnePageAdaptableWizard.js +35 -169
  63. package/src/View/Wizard/OnePageWizards.d.ts +37 -0
  64. package/src/View/Wizard/OnePageWizards.js +187 -0
  65. package/src/View/Wizard/useKeyboardNavigation.d.ts +1 -1
  66. package/src/components/WindowModal/WindowModal.js +13 -7
  67. package/version.d.ts +1 -1
  68. package/version.js +1 -1
@@ -3,109 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const React = tslib_1.__importStar(require("react"));
5
5
  const styled_components_1 = require("styled-components");
6
- const react_1 = require("react");
7
6
  const theme_1 = tslib_1.__importDefault(require("../../theme"));
8
- const FileDroppable_1 = tslib_1.__importDefault(require("../../components/FileDroppable"));
9
- const helper_1 = require("./helper");
10
- const rebass_1 = require("rebass");
11
- const AdaptableConfigurationDialog_1 = tslib_1.__importDefault(require("./AdaptableConfigurationDialog"));
7
+ const Wizard_1 = require("./Wizard");
12
8
  const AdaptableWizardView = (props) => (React.createElement(styled_components_1.ThemeProvider, { theme: theme_1.default },
13
- React.createElement(Wizard, Object.assign({}, props))));
14
- const initialState = {
15
- dropped: false,
16
- };
17
- const reducer = (state, action) => {
18
- if (action.type === 'DROPPED') {
19
- return Object.assign(Object.assign({}, state), { adaptableOptions: action.payload, dropped: true, error: null });
20
- }
21
- if (action.type === 'ERROR') {
22
- return Object.assign(Object.assign({}, state), { dropped: false, error: action.payload });
23
- }
24
- if (action.type === 'CANCEL') {
25
- return Object.assign(Object.assign({}, state), { error: null, dropped: false });
26
- }
27
- return state;
28
- };
29
- const validDataSource = (dataSourceInfo) => {
30
- if (!dataSourceInfo || !Array.isArray(dataSourceInfo.columns)) {
31
- throw `We can't find any columns in your configuration`;
32
- }
33
- if (!dataSourceInfo.columns.length) {
34
- throw 'You should have at least one column';
35
- }
36
- const allStringColumns = dataSourceInfo.columns.reduce((acc, col) => {
37
- if (!col || typeof col !== 'string') {
38
- return false;
39
- }
40
- return acc;
41
- }, true);
42
- if (!allStringColumns) {
43
- throw `Some of your columns are not strings`;
44
- }
45
- if (!Array.isArray(dataSourceInfo.data)) {
46
- throw `We can't find the data array in your configuration`;
47
- }
48
- return true;
49
- };
50
- const Wizard = (props) => {
51
- const [state, dispatch] = react_1.useReducer(reducer, Object.assign(Object.assign({}, initialState), { adaptableOptions: props.adaptableOptions }));
52
- const [droppableKey, setDroppableKey] = react_1.useState(Date.now());
53
- const [isDataLoading, setIsDataLoading] = react_1.useState(false);
54
- const handleDataSource = (array, file) => {
55
- const dataSourceInfo = (props.prepareData || helper_1.prepareDataSource)(array, file);
56
- try {
57
- validDataSource(dataSourceInfo);
58
- }
59
- catch (err) {
60
- return dispatch({
61
- type: 'ERROR',
62
- payload: `Invalid adaptable configuration - ${err}`,
63
- });
64
- }
65
- const gridOptions = helper_1.prepareGridOptions(dataSourceInfo);
66
- const adaptableOptions = Object.assign({}, props.adaptableOptions);
67
- adaptableOptions.adaptableId = adaptableOptions.adaptableId || (file ? file.name : '');
68
- adaptableOptions.gridOptions = gridOptions;
69
- if (dataSourceInfo.primaryKey) {
70
- adaptableOptions.primaryKey = dataSourceInfo.primaryKey;
71
- }
72
- const shouldShowWizard = props.fetchData ? Boolean(props.showFetchDataWizard) : true;
73
- if (shouldShowWizard) {
74
- dispatch({
75
- type: 'DROPPED',
76
- payload: adaptableOptions,
77
- });
78
- }
79
- else {
80
- props.onInit(adaptableOptions);
81
- }
82
- };
83
- let wizard;
84
- if (state.dropped) {
85
- wizard = (React.createElement(AdaptableConfigurationDialog_1.default, { adaptableOptions: state.adaptableOptions, onCancel: () => {
86
- // change the file droppable component key
87
- // so it's remounted and it's in the initial state
88
- setDroppableKey(Date.now());
89
- dispatch({
90
- type: 'CANCEL',
91
- });
92
- }, onFinish: (adaptableOptions) => {
93
- props.onInit(adaptableOptions);
94
- } }));
95
- }
96
- react_1.useEffect(() => {
97
- if (props.fetchData) {
98
- setIsDataLoading(true);
99
- props.fetchData().then((data) => {
100
- handleDataSource(data);
101
- setIsDataLoading(false);
102
- });
103
- }
104
- }, []);
105
- const ddEnabled = !props.fetchData;
106
- return (React.createElement(React.Fragment, null,
107
- ddEnabled && (React.createElement(FileDroppable_1.default, { key: droppableKey, className: 'ab-nocode-wizard', 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 })),
108
- isDataLoading && (React.createElement(rebass_1.Flex, { className: 'ab-nocode-wizard', alignItems: "center", justifyContent: "center", flexDirection: "column" }, props.loadingMessage || 'Loading ...')),
109
- wizard));
110
- };
9
+ React.createElement(Wizard_1.Wizard, Object.assign({}, props))));
111
10
  exports.default = AdaptableWizardView;
@@ -83,7 +83,7 @@ exports.renderAlertBehaviourSummary = (alert, api, allowWrap = false) => {
83
83
  } }));
84
84
  };
85
85
  exports.AlertBehaviourWizardSection = (props) => {
86
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
86
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
87
87
  const { AlertProperties = {} } = data;
88
88
  const rowAddedAlert = api.internalApi.isAlertDefinitionForAddedRowChangeEvent(data);
89
89
  const rowRemovedAlert = api.internalApi.isAlertDefinitionForRemovedRowChangeEvent(data);
@@ -22,7 +22,7 @@ const DEFAULT_BUTTONS = [
22
22
  ];
23
23
  exports.renderAlertDisplaySummary = () => {
24
24
  var _a;
25
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
25
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
26
26
  if (!((_a = data.AlertProperties) === null || _a === void 0 ? void 0 : _a.DisplayNotification)) {
27
27
  return (React.createElement(rebass_1.Text, { fontSize: 2 },
28
28
  "Alert type ",
@@ -57,7 +57,7 @@ exports.AlertPreview = (_a) => {
57
57
  };
58
58
  exports.AlertDisplayWizardSection = (props) => {
59
59
  var _a, _b, _c, _d;
60
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
60
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
61
61
  const messageType = data.MessageType;
62
62
  const messageText = api.alertApi.getAlertDescription(data);
63
63
  const adaptableAlert = {
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
7
7
  const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
8
8
  exports.BaseAlertRulesWizardSection = (props) => {
9
- const { data, api, moduleInfo } = OnePageAdaptableWizard_1.useOnePageWizardContext();
9
+ const { data, api, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
10
10
  const wholeRowScope = props.wholeRowScope != null ? props.wholeRowScope : api.scopeApi.scopeIsAll(data.Scope);
11
11
  const predicateDefs = api.alertApi.getAlertPredicateDefsForScope(data.Scope);
12
12
  return (React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: "Any", data: data, predicateDefs: predicateDefs, onChange: props.onChange, showAggregation: !wholeRowScope ? false : true, showObservable: !wholeRowScope ? false : true, showBoolean: true, showPredicate: true, descriptions: {
@@ -8,7 +8,7 @@ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
8
8
  const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
9
9
  const ValueSelector_1 = require("../../Components/ValueSelector");
10
10
  exports.BaseAlertScopeWizardSection = (props) => {
11
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
11
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
12
12
  return (React.createElement(rebass_1.Flex, { flexDirection: "column", style: { height: '100%' }, padding: 2 },
13
13
  React.createElement(NewScopeComponent_1.NewScopeComponent, { descriptions: {
14
14
  rowScope: 'Changes anywhere in the row will trigger an alert',
@@ -41,7 +41,7 @@ exports.BaseAlertScopeWizardSection = (props) => {
41
41
  } })));
42
42
  };
43
43
  exports.renderBaseAlertScopeSummary = (data) => {
44
- const { api: { scopeApi }, } = OnePageAdaptableWizard_1.useOnePageWizardContext();
44
+ const { api: { scopeApi }, } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
45
45
  const columnsInScope = scopeApi.getColumnsForScope(data.Scope);
46
46
  return (React.createElement(React.Fragment, null,
47
47
  React.createElement(rebass_1.Box, null,
@@ -42,7 +42,7 @@ QueryTab.defaultProps = {
42
42
  isTabsTab: true,
43
43
  };
44
44
  exports.CalculatedColumnExpressionWizardSection = (props) => {
45
- const { api, data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageWizardContext();
45
+ const { api, data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
46
46
  const initialData = react_1.useMemo(() => api.internalApi.getQueryPreviewData(), []);
47
47
  const type = data.Query.AggregatedScalarExpression != undefined
48
48
  ? 'AggregatedScalarExpression'
@@ -44,7 +44,7 @@ exports.isValidCalculatedColumnSettings = (data, api) => {
44
44
  };
45
45
  exports.CalculatedColumnSettingsWizardSection = (props) => {
46
46
  var _a, _b;
47
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
47
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
48
48
  const calculatedColumnExpressionService = react_1.useMemo(() => api.internalApi.getCalculatedColumnExpressionService(), []);
49
49
  const handleColumnIdChange = (event) => {
50
50
  let e = event.target;
@@ -21,7 +21,7 @@ function renderConditionalStyleRuleSummary(data) {
21
21
  }
22
22
  exports.renderConditionalStyleRuleSummary = renderConditionalStyleRuleSummary;
23
23
  function ConditionalStyleRuleWizardSection(props) {
24
- const { data, api, moduleInfo } = OnePageAdaptableWizard_1.useOnePageWizardContext();
24
+ const { data, api, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
25
25
  return (React.createElement(React.Fragment, null,
26
26
  React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: props.defaultPredicateId, predicateDefs: api.conditionalStyleApi.getCondStylePredicateDefsForScope(data.Scope), showAggregation: false, showObservable: false, showPredicate: !api.scopeApi.scopeIsAll(data.Scope), data: data, onChange: props.onChange, descriptions: {
27
27
  selectPredicate: 'Select a Conditional Style Rule - to be applied when data changes',
@@ -14,7 +14,7 @@ exports.renderConditionalStyleScopeSummary = (data) => {
14
14
  });
15
15
  };
16
16
  function ConditionalStyleScopeWizardSection(props) {
17
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
17
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
18
18
  return (React.createElement(React.Fragment, null,
19
19
  React.createElement(NewScopeComponent_1.NewScopeComponent, { scope: data.Scope, descriptions: {
20
20
  rowScope: 'Matching Rows will have the Conditional Style applied',
@@ -12,7 +12,7 @@ exports.renderConditionalStyleSettingsSummary = (data) => (React.createElement(r
12
12
  React.createElement(rebass_1.Text, null, "Include grouped rows"),
13
13
  React.createElement(rebass_1.Text, { mt: 3 }, data.IncludeGroupedRows ? 'Yes' : 'No')));
14
14
  exports.ConditionalStyleSettingsWizardSettings = (props) => {
15
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
15
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
16
16
  const onIncludeGroupedRowsChanged = (checked) => {
17
17
  props.onChange(Object.assign(Object.assign({}, data), { IncludeGroupedRows: checked }));
18
18
  };
@@ -14,7 +14,7 @@ exports.renderConditionalStyleStyleSummary = (data) => {
14
14
  return (React.createElement(rebass_1.Text, { padding: 2, style: toStyle(data.Style) }, "Preview result"));
15
15
  };
16
16
  function ConditionalStyleStyleWizardSection(props) {
17
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
17
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
18
18
  return (React.createElement(StyleComponent_1.StyleComponent, { headless: true, api: api, Style: data.Style, UpdateStyle: (Style) => {
19
19
  props.onChange(Object.assign(Object.assign({}, data), { Style }));
20
20
  } }));
@@ -9,7 +9,7 @@ const Tag_1 = require("../../../components/Tag");
9
9
  const ColumnSelector_1 = require("../../Components/ColumnSelector");
10
10
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
11
11
  exports.renderCustomSortColumn = (data) => {
12
- const { api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
12
+ const { api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
13
13
  return (React.createElement(rebass_1.Text, { pr: 2, py: 2, fontSize: 2 },
14
14
  "Custom sort column: ",
15
15
  React.createElement(Tag_1.Tag, null, api.columnApi.getFriendlyNameFromColumnId(data.ColumnId))));
@@ -21,7 +21,7 @@ exports.isValidCustomSortColumn = (data) => {
21
21
  return true;
22
22
  };
23
23
  exports.CustomSortColumnWizardSection = (props) => {
24
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
24
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
25
25
  const sortableCols = React.useMemo(() => {
26
26
  var _a, _b;
27
27
  const sortableColumns = api.columnApi.getSortableColumns();
@@ -23,7 +23,7 @@ exports.renderCustomSortValuesSummary = (data) => {
23
23
  React.createElement(ValueSelector_1.ValueOptionsTags, { options: data.SortedValues, value: data.SortedValues, toIdentifier: (x) => `${x}`, toLabel: (x) => `${x}`, allowWrap: true, readOnly: true }))) : null;
24
24
  };
25
25
  exports.CustomSortValuesWizardSection = (props) => {
26
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
26
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
27
27
  const [distinctValues, setDistinctValues] = react_1.useState([]);
28
28
  const [isDistinctValuesLoading, setIsDistinctValuesLoading] = react_1.useState(false);
29
29
  react_1.useEffect(() => {
@@ -31,7 +31,7 @@ exports.renderReportColumnsSummary = (report) => {
31
31
  }))) : null));
32
32
  };
33
33
  exports.ReportColumnsWizardSection = (props) => {
34
- const { api, data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
34
+ const { api, data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
35
35
  return (React.createElement(rebass_1.Flex, { flexDirection: "column", style: { height: '100%' }, padding: 2 },
36
36
  React.createElement(Tabs_1.Tabs, { m: 2, value: data.ReportColumnScope, onValueChange: (ReportColumnScope) => {
37
37
  const report = Object.assign(Object.assign({}, data), { ReportColumnScope });
@@ -28,7 +28,7 @@ exports.isValidReportName = (report, api) => {
28
28
  return hasAlreadyExistingName ? 'A Report already exists with that name' : true;
29
29
  };
30
30
  exports.ReportNameWizardSection = (props) => {
31
- const { api, data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
31
+ const { api, data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
32
32
  const validCheck = exports.isValidReportName(data, api);
33
33
  const ErrorMessage = validCheck === true ? null : validCheck;
34
34
  return (React.createElement(React.Fragment, null,
@@ -34,7 +34,7 @@ exports.renderReportRowsSummary = (report) => {
34
34
  };
35
35
  exports.ReportRowsWizardSection = (props) => {
36
36
  var _a, _b;
37
- const { api, data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageWizardContext();
37
+ const { api, data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
38
38
  const initialData = react_1.useMemo(() => api.internalApi.getQueryPreviewData(), []);
39
39
  return (React.createElement(React.Fragment, null,
40
40
  React.createElement(Tabs_1.Tabs, { m: 2, value: data.ReportRowScope, onValueChange: (ReportRowScope) => {
@@ -8,7 +8,7 @@ const CodeBlock_1 = require("../../../components/CodeBlock");
8
8
  const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
9
9
  exports.renderFlashingAlertRulesSummary = (flashingAlert) => {
10
10
  var _a;
11
- const { api: { flashingCellApi }, } = OnePageAdaptableWizard_1.useOnePageWizardContext();
11
+ const { api: { flashingCellApi }, } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
12
12
  const FlashTarget = (_a = flashingAlert.FlashTarget) !== null && _a !== void 0 ? _a : flashingCellApi.getFlashingCellFlashTarget(flashingAlert);
13
13
  return (React.createElement(EntityRulesEditor_1.EntityRulesSummary, { data: flashingAlert, renderPredicate: (content) => {
14
14
  return (React.createElement(React.Fragment, null,
@@ -28,7 +28,7 @@ exports.renderFlashingAlertRulesSummary = (flashingAlert) => {
28
28
  } }));
29
29
  };
30
30
  exports.FlashingAlertRulesWizardSection = (props) => {
31
- const { data, api, moduleInfo } = OnePageAdaptableWizard_1.useOnePageWizardContext();
31
+ const { data, api, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
32
32
  const predicateDefs = api.flashingCellApi.getFlashingCellPredicateDefsForScope(data.Scope);
33
33
  return (React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: "Any", data: data, predicateDefs: predicateDefs, onChange: props.onChange, showAggregation: false, showObservable: false, showBoolean: true, showPredicate: true, descriptions: {
34
34
  selectPredicate: 'Select an Flashing Cell Rule - to be applied when data changes',
@@ -7,7 +7,7 @@ const rebass_1 = require("rebass");
7
7
  const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
8
8
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
9
9
  exports.FlashingAlertScopeWizardSection = (props) => {
10
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
10
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
11
11
  return (React.createElement(rebass_1.Flex, { flexDirection: "column", style: { height: '100%' }, padding: 2 },
12
12
  React.createElement(NewScopeComponent_1.NewScopeComponent, { descriptions: {
13
13
  rowScope: 'Changes anywhere in the row will trigger an Flashing Cell',
@@ -23,7 +23,7 @@ exports.renderFlashingAlertSettingsSummary = (flashingAlert) => {
23
23
  };
24
24
  exports.FlashingAlertSettingsWizardSection = (props) => {
25
25
  var _a, _b, _c, _d, _e, _f, _g;
26
- let { data: flashingCell } = OnePageAdaptableWizard_1.useOnePageWizardContext();
26
+ let { data: flashingCell } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
27
27
  flashingCell = flashingCell !== null && flashingCell !== void 0 ? flashingCell : props.flashingCell;
28
28
  const setDuration = (FlashDuration) => {
29
29
  props.onChange(Object.assign(Object.assign({}, flashingCell), { FlashDuration: FlashDuration }));
@@ -11,7 +11,7 @@ const StylePreview_1 = require("../../../components/StylePreview");
11
11
  const changeStyle = (React.createElement(rebass_1.Text, { fontSize: 2, style: { display: 'inline-block' } }, "Change style"));
12
12
  exports.FlashingAlertStyleWizardSection = (props) => {
13
13
  var _a, _b, _c;
14
- let { data: flashingAlert, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
14
+ let { data: flashingAlert, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
15
15
  flashingAlert = flashingAlert !== null && flashingAlert !== void 0 ? flashingAlert : props.flashingAlert;
16
16
  return (React.createElement(React.Fragment, null,
17
17
  React.createElement(Tabs_1.Tabs, { defaultValue: "up" },
@@ -355,7 +355,7 @@ const renderStringFormat = (data, _onChange, setFormatOption, customFormatters,
355
355
  };
356
356
  exports.FormatColumnFormatWizardSection = (props) => {
357
357
  var _a, _b, _c;
358
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
358
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
359
359
  const adaptable = AdaptableContext_1.useAdaptable();
360
360
  const formatColumnApi = adaptable.api.formatColumnApi;
361
361
  const customDisplayFormatters = (_c = (_b = (_a = adaptable.adaptableOptions) === null || _a === void 0 ? void 0 : _a.userInterfaceOptions) === null || _b === void 0 ? void 0 : _b.customDisplayFormatters) !== null && _c !== void 0 ? _c : [];
@@ -13,7 +13,7 @@ exports.renderFormatColumnScopeSummary = (data) => {
13
13
  });
14
14
  };
15
15
  exports.FormatColumnScopeWizardSection = (props) => {
16
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
16
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
17
17
  return (React.createElement(NewScopeComponent_1.NewScopeComponent, { descriptions: {
18
18
  rowScope: 'Apply a style to an entire row',
19
19
  columnScope: 'Select columns to format',
@@ -33,7 +33,7 @@ exports.renderFormatColumnSettingsSummary = (data) => {
33
33
  React.createElement(Tag_1.Tag, null, data.IncludeGroupedRows ? 'yes' : 'no'))));
34
34
  };
35
35
  exports.FormatColumnSettingsWizardSection = (props) => {
36
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
36
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
37
37
  const onCellAlignmentSelectChanged = (CellAlignment) => {
38
38
  props.onChange(Object.assign(Object.assign({}, data), { CellAlignment }));
39
39
  };
@@ -105,7 +105,7 @@ exports.renderFormatColumnStyleSummary = (data, api) => {
105
105
  };
106
106
  function FormatColumnStyleWizardSection(props) {
107
107
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
108
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
108
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
109
109
  const singleNumericColumn = api.scopeApi.isSingleNumericColumnScope(data.Scope);
110
110
  const onlyBooleanColumnsInScope = api.scopeApi.areAllBooleanColumnsInScope(data.Scope) ||
111
111
  api.scopeApi.scopeHasOnlyBooleanDataType(data.Scope);
@@ -58,7 +58,7 @@ exports.isValidFreeTextColumn = (data, api) => {
58
58
  return true;
59
59
  };
60
60
  exports.FreeTextColumnSettingsWizardSection = (props) => {
61
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
61
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
62
62
  const Pattern = api.internalApi.getAdaptableOptions().userInterfaceOptions.dateInputOptions.dateFormat;
63
63
  const [ColumnNameFocused, setColumnNameFocused] = react_1.useState(false);
64
64
  const inEdit = props.isEdit;
@@ -7,7 +7,7 @@ const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
7
7
  const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
8
8
  const CodeBlock_1 = require("../../../components/CodeBlock");
9
9
  function PlusMinusRuleSummary() {
10
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
10
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
11
11
  return (React.createElement(EntityRulesEditor_1.EntityRulesSummary, { data: data, renderPredicate: (contents) => {
12
12
  return (React.createElement(React.Fragment, null,
13
13
  "Apply Plus Minus on ",
@@ -23,7 +23,7 @@ function PlusMinusRuleSummary() {
23
23
  exports.PlusMinusRuleSummary = PlusMinusRuleSummary;
24
24
  function PlusMinusRuleWizardSection(props) {
25
25
  var _a;
26
- const { data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageWizardContext();
26
+ const { data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
27
27
  const plusMinusNudge = Object.assign(Object.assign({}, data), { Rule: (_a = data === null || data === void 0 ? void 0 : data.Rule) !== null && _a !== void 0 ? _a : { BooleanExpression: '' } });
28
28
  return (React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName,
29
29
  // min-height 0 so the container does not min-size from it's children
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
7
7
  const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
8
8
  exports.PlusMinusScopeWizardSection = (props) => {
9
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
9
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
10
10
  const availableColumns = React.useMemo(() => api.columnApi.getNumericColumns(), []);
11
11
  return (React.createElement(NewScopeComponent_1.NewScopeComponent, { availableDataTypes: ['Number'], scopeColumns: availableColumns, scope: data.Scope, descriptions: {
12
12
  rowScope: 'Matching rows will have the plus/minus applied',
@@ -15,7 +15,7 @@ const OnePageAdaptableWizard_2 = require("../../../View/Wizard/OnePageAdaptableW
15
15
  const Tag_1 = require("../../../components/Tag");
16
16
  exports.PlusMinusSettingsSummary = (props) => {
17
17
  var _a;
18
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
18
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
19
19
  return (React.createElement(React.Fragment, null,
20
20
  React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
21
21
  "Nudge Value ",
@@ -37,7 +37,7 @@ exports.isSettingsValid = (hasCondition) => (data, api, context) => {
37
37
  };
38
38
  exports.PlusMinusSettingsWizardSection = (props) => {
39
39
  var _a;
40
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
40
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
41
41
  const handleNudgeValueChange = (event) => {
42
42
  const newValue = parseFloat(event.target.value);
43
43
  props.onChange(Object.assign(Object.assign({}, data), { NudgeValue: isNaN(newValue) ? '' : newValue }));
@@ -27,7 +27,7 @@ exports.renderNamedQueryExpressionSummary = (data) => {
27
27
  };
28
28
  exports.NamedQueryExpressionWizardSection = (props) => {
29
29
  const { api } = AdaptableContext_1.useAdaptable();
30
- const { data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageWizardContext();
30
+ const { data, moduleInfo } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
31
31
  const initialData = react_1.useMemo(() => api.internalApi.getQueryPreviewData(), []);
32
32
  return (React.createElement(ExpressionEditor_1.ExpressionEditor, { allowSaveNamedQuery: false, type: 'boolean', module: moduleInfo.ModuleName, value: data.BooleanExpression, onChange: (BooleanExpression) => {
33
33
  props.onChange(Object.assign(Object.assign({}, data), { BooleanExpression }));
@@ -24,7 +24,7 @@ exports.renderNamedQuerySettingsSummary = (data) => {
24
24
  React.createElement(Tag_1.Tag, null, data.Name)));
25
25
  };
26
26
  exports.NamedQuerySettingsWizardSection = (props) => {
27
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
27
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
28
28
  const valid = exports.isValidNamedQuerySettings(data, api);
29
29
  const errorMessage = valid === true ? null : valid;
30
30
  const handleColumnNameChange = (event) => {
@@ -7,7 +7,7 @@ const Tag_1 = require("../../../components/Tag");
7
7
  const UIHelper_1 = require("../../UIHelper");
8
8
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
9
9
  exports.ScheduleScheduleSummary = () => {
10
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
10
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
11
11
  return (React.createElement(OnePageAdaptableWizard_1.SummaryText, null,
12
12
  "Schedule: ",
13
13
  React.createElement(Tag_1.Tag, null, UIHelper_1.UIHelper.getScheduleDescription(data.Schedule))));
@@ -59,7 +59,7 @@ const daysMap = [
59
59
  ];
60
60
  exports.ScheduleScheduleWizard = (props) => {
61
61
  var _a, _b, _c, _d, _e;
62
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
62
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
63
63
  const handleIsOneOfChange = (isOneOffNew) => {
64
64
  var _a, _b;
65
65
  props.onSetIsOneOff(isOneOffNew);
@@ -83,7 +83,7 @@ exports.getScheduleSettingsValues = (data) => {
83
83
  return [];
84
84
  };
85
85
  exports.ScheduleSettingsSummary = () => {
86
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
86
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
87
87
  return (React.createElement(React.Fragment, null, exports.getScheduleSettingsValues(data).map((description, index) => (React.createElement(OnePageAdaptableWizard_1.SummaryText, { key: index },
88
88
  description.label,
89
89
  ": ",
@@ -11,7 +11,7 @@ const ScheduleSettingsIPushPull_1 = require("./ScheduleSettingsIPushPull");
11
11
  const ScheduleSettingsOpenFin_1 = require("./ScheduleSettingsOpenFin");
12
12
  const ScheduleSettingsGlue42_1 = require("./ScheduleSettingsGlue42");
13
13
  exports.ScheduleSettingsWizard = (props) => {
14
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
14
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
15
15
  const allReports = api.exportApi.getAllReports();
16
16
  if ((data === null || data === void 0 ? void 0 : data.ScheduleType) === Enums_1.ScheduleType.Reminder) {
17
17
  return (React.createElement(ScheduleSettingsReminder_1.ScheduleSettingsReminder, { reminderSchedule: data, onChange: props.onChange }));
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
7
7
  const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
8
8
  exports.ShortcutScopeWizardSection = (props) => {
9
- const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
9
+ const { data, api } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
10
10
  const availableColumns = React.useMemo(() => api.columnApi.getNumericColumns(), []);
11
11
  return (React.createElement(NewScopeComponent_1.NewScopeComponent, { availableDataTypes: ['Number'], scopeColumns: availableColumns, scope: data.Scope, descriptions: {
12
12
  rowScope: 'Matching rows will have the shortcut applied',
@@ -24,7 +24,7 @@ exports.isSettingsValid = (data) => {
24
24
  };
25
25
  exports.ShortcutSettingsSummary = () => {
26
26
  var _a, _b;
27
- const { data: shortcut } = OnePageAdaptableWizard_1.useOnePageWizardContext();
27
+ const { data: shortcut } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
28
28
  return (React.createElement(React.Fragment, null,
29
29
  React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
30
30
  "Shortcut Key ",
@@ -38,7 +38,7 @@ exports.ShortcutSettingsSummary = () => {
38
38
  };
39
39
  exports.ShortcutSettingsWizard = (props) => {
40
40
  var _a;
41
- const { data: shortcut } = OnePageAdaptableWizard_1.useOnePageWizardContext();
41
+ const { data: shortcut } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
42
42
  const handleKeyChange = React.useCallback((ShortcutKey) => {
43
43
  props.onChange(Object.assign(Object.assign({}, shortcut), { ShortcutKey }));
44
44
  }, [shortcut]);
@@ -34,9 +34,9 @@ export interface AdaptableObjectAdaptableWizardProps<View> extends AdaptableWiza
34
34
  api: AdaptableApi;
35
35
  }
36
36
  export interface AdaptableOnePageWizardProps<T extends AdaptableObject> {
37
- moduleInfo: ModuleInfo;
37
+ moduleInfo?: ModuleInfo;
38
38
  data: T;
39
- configEntities: T[];
39
+ configEntities?: T[];
40
40
  wizardStartIndex?: number;
41
41
  onCloseWizard: VoidFunction;
42
42
  onFinishWizard: (data: T) => void;
@@ -9,7 +9,7 @@ const OnePageAdaptableWizard_1 = require("./OnePageAdaptableWizard");
9
9
  const rebass_1 = require("rebass");
10
10
  exports.ObjectTagsWizardSection = (props) => {
11
11
  const { onChange } = props;
12
- const { data } = OnePageAdaptableWizard_1.useOnePageWizardContext();
12
+ const { data } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
13
13
  return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
14
14
  React.createElement(Tabs_1.Tabs.Tab, null, "Tags"),
15
15
  React.createElement(Tabs_1.Tabs.Content, null,
@@ -6,29 +6,28 @@ import { ModuleInfo } from '../../Strategy/Interface/IModule';
6
6
  import { ExpressionEditorNamedQuery } from '../../components/ExpressionEditor/NamedQueryContext';
7
7
  export declare type OnePageAdaptableWizardContextType<T> = {
8
8
  data: T;
9
- sections: (OnePageWizardSection<T> | '-')[];
9
+ sections: (OnePageAdaptableWizardSection<T> | '-')[];
10
10
  moduleInfo: ModuleInfo;
11
11
  api: AdaptableApi;
12
- setCurrentSection: (index: number) => void;
13
12
  namedQuery: ExpressionEditorNamedQuery;
14
13
  };
15
14
  export declare const SummaryTag: React.FunctionComponent<TextProps>;
16
15
  export declare const SummaryText: React.FunctionComponent<TextProps>;
17
16
  export declare const FormDescriptionText: React.FunctionComponent<TextProps>;
18
17
  export declare const OnePageAdaptableWizardContext: React.Context<OnePageAdaptableWizardContextType<any>>;
19
- export declare function useOnePageWizardContext<ENTITY>(): OnePageAdaptableWizardContextType<ENTITY>;
20
- export declare type OnePageWizardSection<ENTITY> = {
18
+ export declare function useOnePageAdaptableWizardContext<ENTITY>(): OnePageAdaptableWizardContextType<ENTITY>;
19
+ export interface OnePageAdaptableWizardSection<ENTITY> {
21
20
  title: string;
22
21
  details?: React.ReactNode;
23
22
  isValid?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => true | string;
24
23
  isVisible?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => boolean;
25
24
  render: (data: ENTITY, index: number) => React.ReactNode;
26
25
  renderSummary?: (data: ENTITY, api: AdaptableApi) => React.ReactNode;
27
- };
26
+ }
28
27
  export interface OnePageAdaptableWizardProps<ENTITY> {
29
28
  moduleInfo: ModuleInfo;
30
29
  data: ENTITY;
31
- sections: (OnePageWizardSection<ENTITY> | '-')[];
30
+ sections: (OnePageAdaptableWizardSection<ENTITY> | '-')[];
32
31
  currentIndex?: number;
33
32
  defaultCurrentIndex?: number;
34
33
  defaultCurrentSectionName?: string;