@adaptabletools/adaptable 13.0.1 → 13.0.3
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/bundle.cjs.js +149 -143
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/ActionOptions.d.ts +15 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +1 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +1 -0
- package/src/AdaptableOptions/FilterOptions.d.ts +6 -0
- package/src/AdaptableOptions/GeneralOptions.d.ts +2 -0
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -0
- package/src/AdaptableOptions/NotificationsOptions.d.ts +2 -1
- package/src/Api/EventApi.d.ts +13 -22
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +17 -0
- package/src/Api/StyledColumnApi.d.ts +5 -0
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/Strategy/FilterModule.js +1 -1
- package/src/Strategy/LayoutModule.js +7 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Extensions/StringExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/StringExtensions.js +21 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +1 -1
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +1 -0
- package/src/Utilities/Services/MetamodelService.js +6 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.d.ts +3 -5
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/AdaptableOptionsForm.js +103 -92
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.d.ts +2 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +4 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +8 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +7 -34
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +7 -7
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +2 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +2 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +2 -2
- package/src/agGrid/ActionColumnRenderer.js +2 -0
- package/src/agGrid/Adaptable.d.ts +2 -0
- package/src/agGrid/Adaptable.js +76 -52
- package/src/metamodel/adaptable.metamodel.d.ts +87 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +2 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,101 +1,112 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdaptableOptionsForm = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const React = tslib_1.__importStar(require("react"));
|
|
5
|
-
const
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
6
7
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
8
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
7
9
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
8
10
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
|
|
12
|
+
const MetamodelService_1 = require("../../../Utilities/Services/MetamodelService");
|
|
13
|
+
const AdaptablePopover_1 = require("../../AdaptablePopover");
|
|
14
|
+
const LABEL_WIDTH = 250;
|
|
15
|
+
const SUPPORTED_PRIMITEVE_TYPES = ['string', 'number', 'boolean'];
|
|
16
|
+
const OptionInput = (props) => {
|
|
17
|
+
const { name, defaultValue, value, description, uiLabel } = props.option;
|
|
18
|
+
const label = uiLabel !== null && uiLabel !== void 0 ? uiLabel : StringExtensions_1.default.Humanize(name);
|
|
19
|
+
let input = React.createElement(React.Fragment, null);
|
|
20
|
+
const info = (React.createElement(rebass_1.Box, { ml: 2 },
|
|
21
|
+
React.createElement(AdaptablePopover_1.AdaptablePopover, { headerText: null, bodyText: [description] })));
|
|
22
|
+
const handleInputChange = (event) => props.onChange(Object.assign(Object.assign({}, props.option), { value: event.currentTarget.value }));
|
|
23
|
+
const handleCheckboxChange = (checked) => props.onChange(Object.assign(Object.assign({}, props.option), { value: checked }));
|
|
24
|
+
// option is mutated to acomodate complex types overrides
|
|
25
|
+
const option = Object.assign({}, props.option);
|
|
26
|
+
const isOptionNonHomogenusUnion = (option) => {
|
|
27
|
+
const isUnion = option.kind.includes('|');
|
|
28
|
+
return isUnion && option.kind.split('|').some((unionEl) => !/['"]/.test(unionEl));
|
|
29
|
+
};
|
|
30
|
+
if (isOptionNonHomogenusUnion(option)) {
|
|
31
|
+
// pick the first type
|
|
32
|
+
const newKind = option.kind
|
|
33
|
+
.split('|')
|
|
34
|
+
.find((unionEl) => SUPPORTED_PRIMITEVE_TYPES.includes(unionEl.trim()))
|
|
35
|
+
.trim();
|
|
36
|
+
if (newKind)
|
|
37
|
+
option.kind = newKind;
|
|
38
|
+
}
|
|
39
|
+
const inputProps = {
|
|
40
|
+
value: value !== null && value !== void 0 ? value : defaultValue,
|
|
41
|
+
minWidth: 200,
|
|
42
|
+
fontSize: 3,
|
|
43
|
+
mr: 2,
|
|
44
|
+
};
|
|
45
|
+
if (option.kind.includes('|')) {
|
|
46
|
+
const options = option.kind
|
|
47
|
+
.split('|')
|
|
48
|
+
.map((str) => str.trim().replace(/['"]/g, ''))
|
|
49
|
+
.map((str) => ({
|
|
50
|
+
label: StringExtensions_1.default.Humanize(str),
|
|
51
|
+
onClick: () => props.onChange(Object.assign(Object.assign({}, option), { value: str })),
|
|
52
|
+
}));
|
|
53
|
+
input = (React.createElement(DropdownButton_1.default, Object.assign({}, inputProps, { columns: ['label'], items: options }), StringExtensions_1.default.Humanize(value)));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
switch (option.kind) {
|
|
57
|
+
case 'number':
|
|
58
|
+
input = React.createElement(Input_1.default, Object.assign({ type: "number", onChange: handleInputChange }, inputProps));
|
|
59
|
+
break;
|
|
60
|
+
case 'string':
|
|
61
|
+
input = React.createElement(Input_1.default, Object.assign({ type: "text", onChange: handleInputChange }, inputProps));
|
|
62
|
+
break;
|
|
63
|
+
case 'boolean':
|
|
64
|
+
input = (React.createElement(CheckBox_1.CheckBox, { onChange: handleCheckboxChange, checked: Boolean(value), type: "date" }, label));
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let content = (React.createElement(React.Fragment, null,
|
|
69
|
+
React.createElement(rebass_1.Flex, { minWidth: LABEL_WIDTH, alignItems: "center" },
|
|
70
|
+
label,
|
|
71
|
+
" ",
|
|
72
|
+
info),
|
|
73
|
+
input));
|
|
74
|
+
if (option.kind === 'boolean') {
|
|
75
|
+
content = (React.createElement(rebass_1.Flex, { alignItems: "center" },
|
|
76
|
+
input,
|
|
77
|
+
" ",
|
|
78
|
+
info));
|
|
79
|
+
}
|
|
80
|
+
return (React.createElement(rebass_1.Flex, { mb: 2, pl: 1 }, content));
|
|
81
|
+
};
|
|
82
|
+
const OptionsSection = (props) => {
|
|
83
|
+
var _a;
|
|
84
|
+
if (!props.options.length) {
|
|
85
|
+
return React.createElement(React.Fragment, null);
|
|
86
|
+
}
|
|
87
|
+
return (React.createElement(rebass_1.Box, { mb: 2 },
|
|
88
|
+
React.createElement(HelpBlock_1.default, { mb: 2 }, (_a = props.name) !== null && _a !== void 0 ? _a : props.id),
|
|
89
|
+
props.options.map((option, index) => (React.createElement(OptionInput, { key: index, option: option, onChange: props.onChange })))));
|
|
90
|
+
};
|
|
11
91
|
const AdaptableOptionsForm = (props) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
abOptions.generalOptions = Object.assign({}, abOptions.generalOptions);
|
|
32
|
-
abOptions.generalOptions.showMissingPrimaryKeyAlert = showMissingPrimaryKeyWarning;
|
|
33
|
-
props.onChangeadAptableOptions(abOptions);
|
|
34
|
-
} }))),
|
|
35
|
-
React.createElement(HelpBlock_1.default, null, "Layout Options"),
|
|
36
|
-
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
37
|
-
React.createElement(FormLayout_1.FormRow, { label: "Auto Save Layouts" },
|
|
38
|
-
React.createElement(CheckBox_1.CheckBox, { checked: layoutOptions.autoSaveLayouts, onChange: (autoSaveLayouts) => {
|
|
39
|
-
abOptions = Object.assign({}, abOptions);
|
|
40
|
-
abOptions.layoutOptions = Object.assign({}, abOptions.layoutOptions);
|
|
41
|
-
abOptions.layoutOptions.autoSaveLayouts = autoSaveLayouts;
|
|
42
|
-
props.onChangeadAptableOptions(abOptions);
|
|
43
|
-
} }))),
|
|
44
|
-
React.createElement(HelpBlock_1.default, null, "Search Options"),
|
|
45
|
-
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
46
|
-
React.createElement(FormLayout_1.FormRow, { label: "Case Sensitive Text Comparison" },
|
|
47
|
-
React.createElement(CheckBox_1.CheckBox, { checked: adaptableQLOptions.caseSensitiveTextComparisons, onChange: (caseSensitiveTextComparisons) => {
|
|
48
|
-
abOptions = Object.assign({}, abOptions);
|
|
49
|
-
abOptions.adaptableQLOptions = Object.assign({}, abOptions.adaptableQLOptions);
|
|
50
|
-
abOptions.adaptableQLOptions.caseSensitiveTextComparisons =
|
|
51
|
-
caseSensitiveTextComparisons;
|
|
52
|
-
props.onChangeadAptableOptions(abOptions);
|
|
53
|
-
} })),
|
|
54
|
-
React.createElement(FormLayout_1.FormRow, { label: "Use AG Grid Filter Form Style" },
|
|
55
|
-
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.useAgGridFilterFormStyle, onChange: (useAgGridFilterFormStyle) => {
|
|
56
|
-
abOptions = Object.assign({}, abOptions);
|
|
57
|
-
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
58
|
-
abOptions.filterOptions.useAgGridFilterFormStyle = useAgGridFilterFormStyle;
|
|
59
|
-
props.onChangeadAptableOptions(abOptions);
|
|
60
|
-
} })),
|
|
61
|
-
React.createElement(FormLayout_1.FormRow, { label: "Use Adaptable Quick Filter" },
|
|
62
|
-
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.useAdaptableQuickFilter == true, onChange: (useAdaptableQuickFilter) => {
|
|
63
|
-
abOptions = Object.assign({}, abOptions);
|
|
64
|
-
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
65
|
-
abOptions.filterOptions.useAdaptableQuickFilter = useAdaptableQuickFilter;
|
|
66
|
-
props.onChangeadAptableOptions(abOptions);
|
|
67
|
-
} })),
|
|
68
|
-
React.createElement(FormLayout_1.FormRow, { label: "Use Adaptable Filter Form" },
|
|
69
|
-
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.useAdaptableFilterForm == true, onChange: (useAdaptableFilterForm) => {
|
|
70
|
-
abOptions = Object.assign({}, abOptions);
|
|
71
|
-
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
72
|
-
abOptions.filterOptions.useAdaptableFilterForm = useAdaptableFilterForm;
|
|
73
|
-
props.onChangeadAptableOptions(abOptions);
|
|
74
|
-
} })),
|
|
75
|
-
React.createElement(FormLayout_1.FormRow, { label: "Indicate Filtered Columns" },
|
|
76
|
-
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.indicateFilteredColumns, onChange: (indicateFilteredColumns) => {
|
|
77
|
-
abOptions = Object.assign({}, abOptions);
|
|
78
|
-
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
79
|
-
abOptions.filterOptions.indicateFilteredColumns = indicateFilteredColumns;
|
|
80
|
-
props.onChangeadAptableOptions(abOptions);
|
|
81
|
-
} })),
|
|
82
|
-
React.createElement(FormLayout_1.FormRow, { label: "Auto Apply Filter" },
|
|
83
|
-
React.createElement(CheckBox_1.CheckBox, { checked: filterOptions.autoApplyFilter, onChange: (autoApplyFilter) => {
|
|
84
|
-
abOptions = Object.assign({}, abOptions);
|
|
85
|
-
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
86
|
-
abOptions.filterOptions.autoApplyFilter = autoApplyFilter;
|
|
87
|
-
props.onChangeadAptableOptions(abOptions);
|
|
88
|
-
} }))),
|
|
89
|
-
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", margin: 2 },
|
|
90
|
-
React.createElement(rebass_1.Text, { style: { flex: 3 }, marginRight: 2 }, "Max Column Value Items To Display"),
|
|
91
|
-
React.createElement(rebass_1.Flex, { flex: 7, flexDirection: "row", alignItems: "center" },
|
|
92
|
-
React.createElement(Input_1.default, { style: { flex: 1 }, type: "number", placeholder: "Enter Number", onChange: (event) => {
|
|
93
|
-
let e = event.target;
|
|
94
|
-
let maxColumnValueItemsDisplayed = parseInt(e.value);
|
|
95
|
-
abOptions = Object.assign({}, abOptions);
|
|
96
|
-
abOptions.filterOptions = Object.assign({}, abOptions.filterOptions);
|
|
97
|
-
abOptions.filterOptions.maxFilterValuesToDisplay = maxColumnValueItemsDisplayed;
|
|
98
|
-
props.onChangeadAptableOptions(abOptions);
|
|
99
|
-
}, value: filterOptions.maxFilterValuesToDisplay, marginRight: 3 })))));
|
|
92
|
+
const nocodeOptions = React.useMemo(() => {
|
|
93
|
+
const metamodelService = new MetamodelService_1.MetamodelService(() => props.adaptableOptions);
|
|
94
|
+
return [...metamodelService.getGridInfoNoCodeOptions()];
|
|
95
|
+
}, [props.adaptableOptions]);
|
|
96
|
+
const handleOptionChange = (sectionName) => (option) => {
|
|
97
|
+
const adaptableOptions = Object.assign({}, props.adaptableOptions);
|
|
98
|
+
if (sectionName === 'baseOptions') {
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
adaptableOptions[option.name] = option.value;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
adaptableOptions[sectionName] = Object.assign(Object.assign({}, adaptableOptions[sectionName]), { [option.name]: option.value });
|
|
105
|
+
}
|
|
106
|
+
props.onChangeadAptableOptions(adaptableOptions);
|
|
107
|
+
};
|
|
108
|
+
return (React.createElement(rebass_1.Box, { p: 2 }, nocodeOptions.map(([sectionName, { containerLabel, items }]) => {
|
|
109
|
+
return (React.createElement(OptionsSection, { onChange: handleOptionChange(sectionName), key: sectionName, id: sectionName, name: containerLabel, options: items }));
|
|
110
|
+
})));
|
|
100
111
|
};
|
|
101
|
-
exports.
|
|
112
|
+
exports.AdaptableOptionsForm = AdaptableOptionsForm;
|
|
@@ -5,10 +5,11 @@ export interface NocodeColumn extends Partial<ColDef> {
|
|
|
5
5
|
type?: string | string[];
|
|
6
6
|
caption?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, }: {
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, theme, }: {
|
|
9
9
|
onValidityChange: (valid: boolean) => any;
|
|
10
10
|
handle: React.MutableRefObject<any>;
|
|
11
11
|
columns: NocodeColumn[];
|
|
12
|
+
theme?: string;
|
|
12
13
|
onChange?: (columns: NocodeColumn[]) => void;
|
|
13
14
|
onSelectionChange?: (column: any, flag: boolean) => void;
|
|
14
15
|
selectedColumns?: {
|
|
@@ -58,7 +58,7 @@ const tableDOMProps = {
|
|
|
58
58
|
minHeight: 600,
|
|
59
59
|
},
|
|
60
60
|
};
|
|
61
|
-
const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, }) => {
|
|
61
|
+
const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, theme, }) => {
|
|
62
62
|
const rerender = useForceRender();
|
|
63
63
|
const columnsRef = (0, react_1.useRef)(cols);
|
|
64
64
|
const silentSetColumns = (columns) => {
|
|
@@ -316,7 +316,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
|
|
|
316
316
|
},
|
|
317
317
|
},
|
|
318
318
|
};
|
|
319
|
-
return (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' }, className:
|
|
319
|
+
return (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' }, className: theme },
|
|
320
320
|
React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: "colId" },
|
|
321
321
|
React.createElement(InfiniteTable_1.InfiniteTable, { columnTypes: {
|
|
322
322
|
default: {
|
|
@@ -8,10 +8,11 @@ const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/E
|
|
|
8
8
|
const OnePageWizards_1 = require("../../Wizard/OnePageWizards");
|
|
9
9
|
const ConfigurationWizardColumnsStep_1 = require("./ConfigurationWizardColumnsStep");
|
|
10
10
|
const GridOptionsForm_1 = tslib_1.__importDefault(require("./GridOptionsForm"));
|
|
11
|
-
const AdaptableOptionsForm_1 = tslib_1.__importDefault(require("./AdaptableOptionsForm"));
|
|
12
11
|
const EntitlementsForm_1 = tslib_1.__importDefault(require("./EntitlementsForm"));
|
|
13
12
|
const UiOptionsForm_1 = require("./UIOptions/UiOptionsForm");
|
|
14
13
|
const FinanceForm_1 = require("./FinanceForm");
|
|
14
|
+
const DefaultAdaptableOptions_1 = require("../../../Utilities/Defaults/DefaultAdaptableOptions");
|
|
15
|
+
const AdaptableOptionsForm_1 = require("./AdaptableOptionsForm");
|
|
15
16
|
const ConfigurationWizard = (props) => {
|
|
16
17
|
var _a, _b;
|
|
17
18
|
const [isPrimaryKeySelected, setIsValid] = React.useState(true);
|
|
@@ -22,7 +23,7 @@ const ConfigurationWizard = (props) => {
|
|
|
22
23
|
toolPanels: ['columns', 'filters', 'adaptable'],
|
|
23
24
|
},
|
|
24
25
|
};
|
|
25
|
-
return Object.assign(Object.assign({}, props.adaptableOptions), { gridOptions: Object.assign(Object.assign({}, gridOptionDefaults), (_a = props === null || props === void 0 ? void 0 : props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.gridOptions) });
|
|
26
|
+
return Object.assign(Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions), props.adaptableOptions), { gridOptions: Object.assign(Object.assign({}, gridOptionDefaults), (_a = props === null || props === void 0 ? void 0 : props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.gridOptions) });
|
|
26
27
|
});
|
|
27
28
|
const [selectedColumns, setSelectedColumns] = (0, react_1.useState)(() => {
|
|
28
29
|
return props.adaptableOptions.gridOptions.columnDefs.reduce((acc, col) => {
|
|
@@ -77,7 +78,7 @@ const ConfigurationWizard = (props) => {
|
|
|
77
78
|
title: 'Adaptable Options',
|
|
78
79
|
details: 'Configure Adaptable Options',
|
|
79
80
|
isValid: () => (adaptableOptions.adaptableId ? true : 'Adaptable ID is required'),
|
|
80
|
-
render: () => (React.createElement(AdaptableOptionsForm_1.
|
|
81
|
+
render: () => (React.createElement(AdaptableOptionsForm_1.AdaptableOptionsForm, { adaptableOptions: adaptableOptions, onChangeadAptableOptions: setAdaptableOptions })),
|
|
81
82
|
},
|
|
82
83
|
{
|
|
83
84
|
title: 'Grid Options',
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js
CHANGED
|
@@ -5,9 +5,14 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const ColumnsList_1 = tslib_1.__importDefault(require("./ColumnsList"));
|
|
7
7
|
const ConfigurationWizardColumnsStep = (props) => {
|
|
8
|
-
var _a, _b;
|
|
9
|
-
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
let theme = 'light';
|
|
10
|
+
if (typeof props.adaptableOptions.predefinedConfig === 'object' &&
|
|
11
|
+
((_a = props.adaptableOptions.predefinedConfig.Theme) === null || _a === void 0 ? void 0 : _a.CurrentTheme)) {
|
|
12
|
+
theme = props.adaptableOptions.predefinedConfig.Theme.CurrentTheme;
|
|
13
|
+
}
|
|
14
|
+
return (React.createElement(ColumnsList_1.default, { theme: theme, handle: props.columnsHandle, onValidityChange: (valid) => {
|
|
10
15
|
props.setPrimaryKeyIsNotSelected(valid);
|
|
11
|
-
}, selectedColumns: props.selectedColumns, onChange: props.onColumnChange, onSelectionChange: props.onSelectionChange, columns: (
|
|
16
|
+
}, selectedColumns: props.selectedColumns, onChange: props.onColumnChange, onSelectionChange: props.onSelectionChange, columns: (_c = (_b = props.adaptableOptions) === null || _b === void 0 ? void 0 : _b.gridOptions) === null || _c === void 0 ? void 0 : _c.columnDefs }));
|
|
12
17
|
};
|
|
13
18
|
exports.ConfigurationWizardColumnsStep = ConfigurationWizardColumnsStep;
|
|
@@ -4,7 +4,6 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const React = tslib_1.__importStar(require("react"));
|
|
5
5
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
6
6
|
const Types_1 = require("../../../PredefinedConfig/Common/Types");
|
|
7
|
-
const AdaptableObjectRow_1 = require("../../Components/AdaptableObjectRow");
|
|
8
7
|
const rebass_1 = require("rebass");
|
|
9
8
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
10
9
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
@@ -19,7 +18,7 @@ const tableDOMProps = {
|
|
|
19
18
|
},
|
|
20
19
|
};
|
|
21
20
|
const EntitlementsListForm = (props) => {
|
|
22
|
-
var _a, _b;
|
|
21
|
+
var _a, _b, _c;
|
|
23
22
|
let abOptions = props.adaptableOptions;
|
|
24
23
|
const entitlements = (_b = (_a = abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions) === null || _a === void 0 ? void 0 : _a.moduleEntitlements) !== null && _b !== void 0 ? _b : [];
|
|
25
24
|
if (typeof entitlements === 'function') {
|
|
@@ -31,28 +30,6 @@ const EntitlementsListForm = (props) => {
|
|
|
31
30
|
return acc;
|
|
32
31
|
}, {});
|
|
33
32
|
}, [abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions]);
|
|
34
|
-
const colItems = [
|
|
35
|
-
{
|
|
36
|
-
Content: React.createElement(rebass_1.Box, { style: { textAlign: 'left' } }, "Entitlement"),
|
|
37
|
-
Size: 3,
|
|
38
|
-
key: 'name',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
Content: 'Visible',
|
|
42
|
-
Size: 3,
|
|
43
|
-
key: 'Visible',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
Content: 'Read Only',
|
|
47
|
-
Size: 3,
|
|
48
|
-
key: 'ReadOnly',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
Content: 'Hidden',
|
|
52
|
-
Size: 3,
|
|
53
|
-
key: 'Hidden',
|
|
54
|
-
},
|
|
55
|
-
];
|
|
56
33
|
const handleOnChange = React.useCallback((module, accessLevel) => {
|
|
57
34
|
let newEntitlements = entitlements;
|
|
58
35
|
// change
|
|
@@ -73,15 +50,6 @@ const EntitlementsListForm = (props) => {
|
|
|
73
50
|
}
|
|
74
51
|
props.onChangeadAptableOptions(Object.assign(Object.assign({}, abOptions), { entitlementOptions: Object.assign(Object.assign({}, abOptions.entitlementOptions), { moduleEntitlements: newEntitlements }) }));
|
|
75
52
|
}, [abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions]);
|
|
76
|
-
const items = ALL_ENTITLEMENTS_MODULES.map((module) => {
|
|
77
|
-
const cItems = colItems.map((item) => (Object.assign({}, item)));
|
|
78
|
-
const accessLevel = entitlementsMap[module];
|
|
79
|
-
cItems[0].Content = React.createElement(rebass_1.Box, { style: { textAlign: 'left' } }, ModuleConstants_1.ADAPTABLE_MODULE_MAP[module]);
|
|
80
|
-
cItems[1].Content = (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'Full'), checked: accessLevel === 'Full' }));
|
|
81
|
-
cItems[2].Content = (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'ReadOnly'), checked: accessLevel === 'ReadOnly' }));
|
|
82
|
-
cItems[3].Content = (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'Hidden'), checked: accessLevel === 'Hidden' }));
|
|
83
|
-
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: module, colItems: cItems, style: { cursor: 'pointer' } });
|
|
84
|
-
});
|
|
85
53
|
if (typeof entitlements === 'function') {
|
|
86
54
|
return (React.createElement(HelpBlock_1.default, { mb: 2 }, "Entitlements cannot be customized, they are handled by a custom function."));
|
|
87
55
|
}
|
|
@@ -119,7 +87,12 @@ const EntitlementsListForm = (props) => {
|
|
|
119
87
|
},
|
|
120
88
|
};
|
|
121
89
|
const data = ALL_ENTITLEMENTS_MODULES.map((module) => ({ name: ModuleConstants_1.ADAPTABLE_MODULE_MAP[module] }));
|
|
122
|
-
|
|
90
|
+
let theme = 'light';
|
|
91
|
+
if (typeof props.adaptableOptions.predefinedConfig === 'object' &&
|
|
92
|
+
((_c = props.adaptableOptions.predefinedConfig.Theme) === null || _c === void 0 ? void 0 : _c.CurrentTheme)) {
|
|
93
|
+
theme = props.adaptableOptions.predefinedConfig.Theme.CurrentTheme;
|
|
94
|
+
}
|
|
95
|
+
return (React.createElement(rebass_1.Box, { flex: 1, height: "100%", className: theme },
|
|
123
96
|
React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: "name" },
|
|
124
97
|
React.createElement(InfiniteTable_1.InfiniteTable, { columnTypes: {
|
|
125
98
|
default: {
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js
CHANGED
|
@@ -71,11 +71,11 @@ const FDC3InstrumentColumnBuilder = (props) => {
|
|
|
71
71
|
return (React.createElement(rebass_1.Flex, null,
|
|
72
72
|
React.createElement(FormLayout_1.default, { mr: 2 }, fields.slice(0, 4).map((field) => {
|
|
73
73
|
var _a;
|
|
74
|
-
return (React.createElement(FDC3ColumnSelector, Object.assign({}, field, { value: (_a = props.column[field.id]) !== null && _a !== void 0 ? _a : 'Select Column', onChange: (columnId) => props.onColumnFieldChange(field.id, columnId), columnOptions: props.columnOptions })));
|
|
74
|
+
return (React.createElement(FDC3ColumnSelector, Object.assign({}, field, { key: field.id, value: (_a = props.column[field.id]) !== null && _a !== void 0 ? _a : 'Select Column', onChange: (columnId) => props.onColumnFieldChange(field.id, columnId), columnOptions: props.columnOptions })));
|
|
75
75
|
})),
|
|
76
76
|
React.createElement(FormLayout_1.default, null, fields.slice(4).map((field) => {
|
|
77
77
|
var _a;
|
|
78
|
-
return (React.createElement(FDC3ColumnSelector, Object.assign({}, field, { value: (_a = props.column[field.id]) !== null && _a !== void 0 ? _a : 'Select Column', onChange: (columnId) => props.onColumnFieldChange(field.id, columnId), columnOptions: props.columnOptions })));
|
|
78
|
+
return (React.createElement(FDC3ColumnSelector, Object.assign({}, field, { key: field.id, value: (_a = props.column[field.id]) !== null && _a !== void 0 ? _a : 'Select Column', onChange: (columnId) => props.onColumnFieldChange(field.id, columnId), columnOptions: props.columnOptions })));
|
|
79
79
|
})),
|
|
80
80
|
React.createElement(rebass_1.Flex, { ml: 3, flexDirection: "column" }, fdc3ColumnDefinitions.instrumentColumns.intents.map((intent) => {
|
|
81
81
|
var _a, _b;
|
|
@@ -89,7 +89,7 @@ const FDC3BaseColumnBuilder = (props) => {
|
|
|
89
89
|
React.createElement(FormLayout_1.default, null,
|
|
90
90
|
fields.map((field) => {
|
|
91
91
|
var _a, _b;
|
|
92
|
-
return (React.createElement(FDC3ColumnSelector, Object.assign({}, field, { columnOptions: props.columnOptions, onChange: (columnId) => props.onColumnFieldChange(field.id, columnId), value: (_b = (_a = props.column) === null || _a === void 0 ? void 0 : _a[field.id]) !== null && _b !== void 0 ? _b : '' })));
|
|
92
|
+
return (React.createElement(FDC3ColumnSelector, Object.assign({}, field, { key: field.id, columnOptions: props.columnOptions, onChange: (columnId) => props.onColumnFieldChange(field.id, columnId), value: (_b = (_a = props.column) === null || _a === void 0 ? void 0 : _a[field.id]) !== null && _b !== void 0 ? _b : '' })));
|
|
93
93
|
}),
|
|
94
94
|
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
95
95
|
React.createElement(rebass_1.Flex, { flexDirection: "column" }, intents.map((intent) => {
|
|
@@ -132,7 +132,7 @@ const FDC3ColumnBuilder = (props) => {
|
|
|
132
132
|
props.onChange(Object.assign(Object.assign({}, props.fdc3Column), { broadcastContextMenuLabel: (_a = event.target.value) !== null && _a !== void 0 ? _a : '' }));
|
|
133
133
|
}, [props.fdc3Column]);
|
|
134
134
|
return (React.createElement(FormBox_1.NocodeWizardFormBox, null,
|
|
135
|
-
React.createElement(rebass_1.Flex,
|
|
135
|
+
React.createElement(rebass_1.Flex, { flexWrap: "wrap" },
|
|
136
136
|
React.createElement(FormLayout_1.default, { mr: 3, mb: 3 },
|
|
137
137
|
props.beforeContent,
|
|
138
138
|
React.createElement(FormLayout_1.FormRow, { label: React.createElement(React.Fragment, null,
|
|
@@ -210,7 +210,7 @@ const FDC3ColumnCreator = (props) => {
|
|
|
210
210
|
}
|
|
211
211
|
return (React.createElement(FDC3ColumnBuilder, { disabled: fieldsDisabled, columnOptions: props.columnOptions, fdc3Column: fdc3Column, fdc3ColumnType: fdc3ColumnType, onChange: (newFDC3Column) => setFDC3Column(newFDC3Column), beforeContent: typeSelector, footer: React.createElement(rebass_1.Flex, null,
|
|
212
212
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
213
|
-
React.createElement(rebass_1.Flex, { alignItems: "center", mr: 3 }, errors.slice(0, 1).map((error) => (React.createElement(AlertMessage, { ml: 2 }, error)))),
|
|
213
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", mr: 3 }, errors.slice(0, 1).map((error) => (React.createElement(AlertMessage, { key: error, ml: 2 }, error)))),
|
|
214
214
|
React.createElement(SimpleButton_1.default, { disabled: fieldsDisabled || !fdc3Column.columnId, onClick: handleOnNew, icon: "plus", variant: "raised" }, "Add FDC3 Column")) }));
|
|
215
215
|
};
|
|
216
216
|
const FinanceFormSectionTitle = (props) => (React.createElement(rebass_1.Box, Object.assign({}, props, { mb: 2 }),
|
|
@@ -238,8 +238,8 @@ const FinanceForm = (props) => {
|
|
|
238
238
|
props.onChangeadAptableOptions(Object.assign(Object.assign({}, props.adaptableOptions), { plugins: [...props.adaptableOptions.plugins] }));
|
|
239
239
|
};
|
|
240
240
|
const renderEditor = (fdc3ColumnType, fdc3ColumnsItems) => {
|
|
241
|
-
return fdc3ColumnsItems.map((fdc3Column, currentFDCColumnId) => (React.createElement(rebass_1.Box, { mb: 3 },
|
|
242
|
-
React.createElement(FDC3ColumnEditor, {
|
|
241
|
+
return fdc3ColumnsItems.map((fdc3Column, currentFDCColumnId) => (React.createElement(rebass_1.Box, { key: currentFDCColumnId, mb: 3 },
|
|
242
|
+
React.createElement(FDC3ColumnEditor, { columnOptions: columnOptions, fdc3Column: fdc3Column, fdc3ColumnType: fdc3ColumnType, onChange: (editedFDC3Column) => {
|
|
243
243
|
const newFDC3Columns = fdc3ColumnsItems.map((fdc3Column, index) => {
|
|
244
244
|
if (index === currentFDCColumnId) {
|
|
245
245
|
return editedFDC3Column;
|
|
@@ -6,11 +6,12 @@ const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayou
|
|
|
6
6
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
7
7
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
8
8
|
const DefaultAdaptableOptions_1 = require("../../../Utilities/Defaults/DefaultAdaptableOptions");
|
|
9
|
+
const rebass_1 = require("rebass");
|
|
9
10
|
const GridOptionsForm = (props) => {
|
|
10
11
|
var _a;
|
|
11
12
|
let abOptions = props.adaptableOptions;
|
|
12
13
|
const gridOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.gridOptions), abOptions.gridOptions);
|
|
13
|
-
return (React.createElement(
|
|
14
|
+
return (React.createElement(rebass_1.Box, { p: 2 },
|
|
14
15
|
React.createElement(HelpBlock_1.default, null, "Grid Options"),
|
|
15
16
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
16
17
|
React.createElement(FormLayout_1.FormRow, { label: "Enable Range Selection" },
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js
CHANGED
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UIElementsForm = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
6
7
|
const UIOptionsActionColumnsForm_1 = require("./UIOptionsActionColumnsForm");
|
|
7
8
|
const UIOptionsSidebarForm_1 = require("./UIOptionsSidebarForm");
|
|
8
9
|
const UIOptionsStatusbarForm_1 = require("./UIOptionsStatusbarForm");
|
|
9
10
|
const UIElementsForm = (props) => {
|
|
10
11
|
let abOptions = props.adaptableOptions;
|
|
11
|
-
return (React.createElement(
|
|
12
|
+
return (React.createElement(rebass_1.Box, { p: 2 },
|
|
12
13
|
React.createElement(UIOptionsActionColumnsForm_1.UIOptionsActionColumnsForm, { abOptions: abOptions, onChange: props.onChangeadAptableOptions }),
|
|
13
14
|
React.createElement(UIOptionsSidebarForm_1.UIOptionsSidebarForm, { abOptions: abOptions, onChange: props.onChangeadAptableOptions }),
|
|
14
15
|
React.createElement(UIOptionsStatusbarForm_1.UIOptionsStatusbarForm, { abOptions: abOptions, onChange: props.onChangeadAptableOptions })));
|
|
@@ -210,8 +210,8 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
210
210
|
e.nativeEvent.stopPropagation();
|
|
211
211
|
this.clearFilter();
|
|
212
212
|
}
|
|
213
|
-
},
|
|
214
|
-
|
|
213
|
+
}, style: {
|
|
214
|
+
width: '100%',
|
|
215
215
|
padding: 'var(--ab-space-1)',
|
|
216
216
|
borderRadius: 0,
|
|
217
217
|
borderLeftWidth: 0,
|
|
@@ -70,6 +70,7 @@ const ReactActionColumnRenderer = (props) => {
|
|
|
70
70
|
primaryKeyValue: pkValue,
|
|
71
71
|
rowNode: props.node,
|
|
72
72
|
adaptableApi: adaptable.api,
|
|
73
|
+
data: props.data,
|
|
73
74
|
};
|
|
74
75
|
return (React.createElement("div", { className: "ab-ActionColumn" }, renderActionButtons(actionButtons, adaptable.api, buttonContext, rerender)));
|
|
75
76
|
};
|
|
@@ -96,6 +97,7 @@ class ActionColumnRenderer {
|
|
|
96
97
|
primaryKeyValue: pkValue,
|
|
97
98
|
rowNode: params.node,
|
|
98
99
|
adaptableApi: adaptable.api,
|
|
100
|
+
data: params.data,
|
|
99
101
|
};
|
|
100
102
|
const eGui = this.eGui;
|
|
101
103
|
const doRender = () => {
|
|
@@ -233,6 +233,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
233
233
|
redrawRow(rowNode: RowNode): void;
|
|
234
234
|
redrawRows(rowNodes: RowNode[]): void;
|
|
235
235
|
refreshCells(rowNodes: RowNode[], columns: (string | Column)[], forceUpdate: boolean, suppressFlash?: boolean): void;
|
|
236
|
+
refreshColumns(columns: (string | Column)[], forceUpdate: boolean, suppressFlash?: boolean): void;
|
|
236
237
|
jumpToRow(rowNode: RowNode): void;
|
|
237
238
|
jumpToColumn(columnId: string): void;
|
|
238
239
|
jumpToCell(columnId: string, rowNode: RowNode): void;
|
|
@@ -305,6 +306,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
305
306
|
private getExpressionStylesChanges;
|
|
306
307
|
private getStyledColumnComparisonChanges;
|
|
307
308
|
private checkChangedCellCurrentlySelected;
|
|
309
|
+
refreshColumnForRelativeRangeStyledColumns(cellDataChangedInfos: CellDataChangedInfo[]): void;
|
|
308
310
|
private getColumnSorts;
|
|
309
311
|
private onSortChanged;
|
|
310
312
|
expandAllRowGroups(): void;
|