@adaptabletools/adaptable 12.1.4 → 12.1.7
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 +116 -143
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +11 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +2 -4
- package/src/AdaptableOptions/FilterOptions.d.ts +7 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +31 -24
- package/src/Api/ColumnApi.d.ts +1 -1
- package/src/Api/FilterApi.d.ts +6 -0
- package/src/Api/FlashingCellApi.d.ts +8 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.js +2 -2
- package/src/Api/Implementation/DataSetApiImpl.js +1 -1
- package/src/Api/Implementation/FilterApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FilterApiImpl.js +20 -2
- package/src/Api/Implementation/FlashingCellApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FlashingCellApiImpl.js +4 -0
- package/src/Api/Implementation/GridApiImpl.js +4 -4
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -1
- package/src/Api/Implementation/LayoutApiImpl.js +4 -3
- package/src/Api/Implementation/QueryApiImpl.js +1 -1
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -1
- package/src/Api/LayoutApi.d.ts +1 -1
- package/src/Api/SystemStatusApi.d.ts +1 -1
- package/src/Api/ToolPanelApi.d.ts +1 -1
- package/src/PredefinedConfig/AlertState.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableColumn.js +3 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +23 -7
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +6 -6
- package/src/PredefinedConfig/Common/Types.d.ts +1 -0
- package/src/PredefinedConfig/Common/Types.js +38 -1
- package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -2
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -2
- package/src/Redux/Store/AdaptableStore.js +15 -10
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/BulkUpdateModule.js +1 -1
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +1 -1
- package/src/Strategy/ChartingModule.js +1 -1
- package/src/Strategy/ConditionalStyleModule.js +1 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/ExportModule.js +1 -1
- package/src/Strategy/FilterModule.js +1 -1
- package/src/Strategy/FlashingCellModule.js +3 -3
- package/src/Strategy/FormatColumnModule.js +1 -1
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.js +1 -1
- package/src/Strategy/LayoutModule.js +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/QueryModule.js +1 -1
- package/src/Strategy/QuickSearchModule.js +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/SmartEditModule.js +1 -1
- package/src/Strategy/StateManagementModule.js +1 -1
- package/src/Strategy/StatusBarModule.js +1 -1
- package/src/Strategy/SystemStatusModule.js +1 -1
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/ThemeModule.js +1 -1
- package/src/Strategy/ToolPanelModule.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +68 -0
- package/src/Utilities/Constants/ModuleConstants.js +70 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -1
- package/src/Utilities/Extensions/ArrayExtensions.js +6 -0
- package/src/Utilities/Helpers/CalendarHelper.js +10 -7
- package/src/Utilities/Helpers/DateHelper.d.ts +0 -26
- package/src/Utilities/Helpers/DateHelper.js +2 -32
- package/src/Utilities/ObjectFactory.d.ts +2 -2
- package/src/Utilities/ObjectFactory.js +14 -14
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +5 -0
- package/src/Utilities/Services/MetamodelService.d.ts +4 -4
- package/src/Utilities/Services/MetamodelService.js +19 -12
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +193 -135
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +23 -15
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +3 -7
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +148 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +0 -7
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.js +33 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +82 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +109 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +8 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +16 -0
- package/src/View/AdaptableWizardView/Wizard.js +2 -1
- package/src/View/AdaptableWizardView/helper.d.ts +1 -1
- package/src/View/AdaptableWizardView/helper.js +3 -10
- package/src/View/CalculatedColumn/Utilities/getCalculatedColumnSettingTags.js +2 -0
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +10 -10
- package/src/View/Components/AdaptableDateInput/index.js +1 -1
- package/src/View/Components/FilterForm/FilterForm.js +4 -2
- package/src/View/Components/FilterForm/QuickFilterForm.js +2 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -2
- package/src/agGrid/Adaptable.d.ts +2 -0
- package/src/agGrid/Adaptable.js +18 -11
- package/src/components/ProgressIndicator/ProgressIndicator.js +10 -12
- package/src/metamodel/adaptable.metamodel.d.ts +74 -6
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +1 -1
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -13,13 +13,6 @@ const GridOptionsForm = (props) => {
|
|
|
13
13
|
return (React.createElement(React.Fragment, null,
|
|
14
14
|
React.createElement(HelpBlock_1.default, null, "Grid Options"),
|
|
15
15
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
16
|
-
React.createElement(FormLayout_1.FormRow, { label: "Show ToolPanel" },
|
|
17
|
-
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.sideBar == true, onChange: (addSideBar) => {
|
|
18
|
-
abOptions = Object.assign({}, abOptions);
|
|
19
|
-
abOptions.gridOptions = Object.assign({}, abOptions.gridOptions);
|
|
20
|
-
abOptions.gridOptions.sideBar = addSideBar;
|
|
21
|
-
props.onChangeadaptableOptions(abOptions);
|
|
22
|
-
} })),
|
|
23
16
|
React.createElement(FormLayout_1.FormRow, { label: "Enable Range Selection" },
|
|
24
17
|
React.createElement(CheckBox_1.CheckBox, { checked: gridOptions.enableRangeSelection, onChange: (enableRangeSelection) => {
|
|
25
18
|
abOptions = Object.assign({}, abOptions);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIOptionsActionColumnsForm = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const CheckBox_1 = require("../../../../components/CheckBox");
|
|
8
|
+
const HelpBlock_1 = tslib_1.__importDefault(require("../../../../components/HelpBlock"));
|
|
9
|
+
const UIOptionsActionColumnsForm = (props) => {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
const options = [
|
|
12
|
+
{ value: 'clone', label: 'Clone' },
|
|
13
|
+
{ value: 'create', label: 'Create' },
|
|
14
|
+
{ value: 'edit', label: 'Edit' },
|
|
15
|
+
{ value: 'delete', label: 'Delete' },
|
|
16
|
+
];
|
|
17
|
+
const actionRowButtons = (_c = (_b = (_a = props.abOptions) === null || _a === void 0 ? void 0 : _a.actionOptions) === null || _b === void 0 ? void 0 : _b.actionRowButtons) !== null && _c !== void 0 ? _c : [];
|
|
18
|
+
const handleCheckChange = (type, checked) => {
|
|
19
|
+
var _a;
|
|
20
|
+
let newActionRowButtons = actionRowButtons;
|
|
21
|
+
if (checked) {
|
|
22
|
+
newActionRowButtons = [...newActionRowButtons, type];
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
newActionRowButtons = newActionRowButtons.filter((item) => item !== type);
|
|
26
|
+
}
|
|
27
|
+
props.onChange(Object.assign(Object.assign({}, props.abOptions), { actionOptions: Object.assign(Object.assign({}, (_a = props.abOptions) === null || _a === void 0 ? void 0 : _a.actionOptions), { actionRowButtons: newActionRowButtons }) }));
|
|
28
|
+
};
|
|
29
|
+
return (React.createElement(rebass_1.Box, null,
|
|
30
|
+
React.createElement(HelpBlock_1.default, null, "Row Action Buttons"),
|
|
31
|
+
React.createElement(rebass_1.Flex, { width: "100%", m: 2 }, options.map((option) => (React.createElement(CheckBox_1.CheckBox, { mr: 3, key: option.value, checked: actionRowButtons.some((buttonName) => buttonName === option.value), onChange: (check) => handleCheckChange(option.value, check) }, option.label))))));
|
|
32
|
+
};
|
|
33
|
+
exports.UIOptionsActionColumnsForm = UIOptionsActionColumnsForm;
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIOptionsSidebarForm = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const CheckBox_1 = require("../../../../components/CheckBox");
|
|
8
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
|
|
9
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
|
|
10
|
+
const HelpBlock_1 = tslib_1.__importDefault(require("../../../../components/HelpBlock"));
|
|
11
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../../../../Utilities/Extensions/StringExtensions"));
|
|
12
|
+
const ALL_SIDEBAR_OPTIONS = ['columns', 'filters', 'adaptable'];
|
|
13
|
+
const prepareSidebarDef = (sideBar) => {
|
|
14
|
+
sideBar = sideBar;
|
|
15
|
+
if (typeof sideBar === 'boolean') {
|
|
16
|
+
sideBar = {
|
|
17
|
+
toolPanels: ALL_SIDEBAR_OPTIONS,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (typeof sideBar === 'string') {
|
|
21
|
+
sideBar = {
|
|
22
|
+
toolPanels: [sideBar],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(sideBar)) {
|
|
26
|
+
sideBar = {
|
|
27
|
+
toolPanels: sideBar,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return sideBar !== null && sideBar !== void 0 ? sideBar : { toolPanels: [] };
|
|
31
|
+
};
|
|
32
|
+
const isSidebarChecked = (sideBar, panelName) => {
|
|
33
|
+
var _a;
|
|
34
|
+
return ((_a = sideBar === null || sideBar === void 0 ? void 0 : sideBar.toolPanels) !== null && _a !== void 0 ? _a : []).some((panel) => {
|
|
35
|
+
const panelId = typeof panel === 'string' ? panel : panel.id;
|
|
36
|
+
return panelId === panelName;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
const UIOptionsSidebarForm = (props) => {
|
|
40
|
+
var _a;
|
|
41
|
+
const { abOptions, onChange } = props;
|
|
42
|
+
const { gridOptions } = props.abOptions;
|
|
43
|
+
const sideBar = prepareSidebarDef(gridOptions.sideBar);
|
|
44
|
+
const renderSidebarCheckbox = (sidebarName) => {
|
|
45
|
+
return (React.createElement(CheckBox_1.CheckBox, { mr: 3, key: sidebarName, checked: isSidebarChecked(sideBar, sidebarName), onChange: (check) => handleToolpanelsChange(sidebarName, check) }, StringExtensions_1.default.Humanize(sidebarName)));
|
|
46
|
+
};
|
|
47
|
+
const handleToolpanelsChange = (panelName, check) => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
let newPanels = (_a = sideBar === null || sideBar === void 0 ? void 0 : sideBar.toolPanels) !== null && _a !== void 0 ? _a : [];
|
|
50
|
+
if (check) {
|
|
51
|
+
newPanels = [...newPanels, panelName];
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
newPanels = newPanels.filter((panel) => {
|
|
55
|
+
const panelId = typeof panel === 'string' ? panel : panel.id;
|
|
56
|
+
return panelId !== panelName;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
let hiddenByDefault = (_b = sideBar.hiddenByDefault) !== null && _b !== void 0 ? _b : false;
|
|
60
|
+
if (newPanels.length === 0) {
|
|
61
|
+
hiddenByDefault = true;
|
|
62
|
+
}
|
|
63
|
+
const newAbOptions = Object.assign(Object.assign({}, abOptions), { gridOptions: Object.assign(Object.assign({}, abOptions.gridOptions), { sideBar: Object.assign(Object.assign({}, sideBar), { toolPanels: newPanels, hiddenByDefault }) }) });
|
|
64
|
+
props.onChange(newAbOptions);
|
|
65
|
+
};
|
|
66
|
+
let sidebarPosition = (_a = sideBar === null || sideBar === void 0 ? void 0 : sideBar.position) !== null && _a !== void 0 ? _a : 'right';
|
|
67
|
+
const handleSidebarPositionChange = (position) => {
|
|
68
|
+
const newAbOptions = Object.assign(Object.assign({}, abOptions), { gridOptions: Object.assign(Object.assign({}, abOptions.gridOptions), { sideBar: Object.assign(Object.assign({}, sideBar), { position }) }) });
|
|
69
|
+
props.onChange(newAbOptions);
|
|
70
|
+
};
|
|
71
|
+
return (React.createElement(rebass_1.Box, null,
|
|
72
|
+
React.createElement(HelpBlock_1.default, null, "Tool Panels"),
|
|
73
|
+
React.createElement(rebass_1.Box, { m: 2 },
|
|
74
|
+
React.createElement(rebass_1.Flex, { mb: 2 }, ALL_SIDEBAR_OPTIONS.map(renderSidebarCheckbox)),
|
|
75
|
+
React.createElement(FormLayout_1.default, { columns: [{ name: 'label' }, { name: 'children' }] },
|
|
76
|
+
React.createElement(FormLayout_1.FormRow, { label: "Position" },
|
|
77
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: [
|
|
78
|
+
{ label: 'Left', onClick: () => handleSidebarPositionChange('left') },
|
|
79
|
+
{ label: 'Right', onClick: () => handleSidebarPositionChange('right') },
|
|
80
|
+
] }, sidebarPosition === 'left' ? 'Left' : 'Right'))))));
|
|
81
|
+
};
|
|
82
|
+
exports.UIOptionsSidebarForm = UIOptionsSidebarForm;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIOptionsStatusbarForm = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const ModuleManager_1 = require("../../../../components/DragAndDropContext/ModuleManager");
|
|
8
|
+
const HelpBlock_1 = tslib_1.__importDefault(require("../../../../components/HelpBlock"));
|
|
9
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
|
|
10
|
+
const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
|
|
11
|
+
const SimpleButton_1 = tslib_1.__importDefault(require("../../../../components/SimpleButton"));
|
|
12
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
|
|
13
|
+
const UIOptionsStatusbarForm = (props) => {
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
|
+
const allPanels = (_c = (_b = (_a = props.abOptions.gridOptions) === null || _a === void 0 ? void 0 : _a.statusBar) === null || _b === void 0 ? void 0 : _b.statusPanels) !== null && _c !== void 0 ? _c : [];
|
|
16
|
+
const panelIdtoPanel = (panelsIds, align) => panelsIds.map((panelId) => {
|
|
17
|
+
const previousItem = allPanels.find((panel) => panel.key === panelId || panel.statusPanel === panelId);
|
|
18
|
+
if (previousItem) {
|
|
19
|
+
return Object.assign(Object.assign({}, previousItem), { align });
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const newPanel = {
|
|
23
|
+
statusPanel: panelId,
|
|
24
|
+
align,
|
|
25
|
+
};
|
|
26
|
+
return newPanel;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const leftPanels = allPanels.filter((panel) => !(panel === null || panel === void 0 ? void 0 : panel.align) || panel.align === 'left');
|
|
30
|
+
const centerPanels = allPanels.filter((panel) => panel.align === 'center');
|
|
31
|
+
const rightPanels = allPanels.filter((panel) => panel.align === 'right');
|
|
32
|
+
const handleTabChange = (tabs) => {
|
|
33
|
+
const leftPanels = panelIdtoPanel(tabs[0].Items, 'left');
|
|
34
|
+
const centerPanels = panelIdtoPanel(tabs[1].Items, 'center');
|
|
35
|
+
const rightPanels = panelIdtoPanel(tabs[2].Items, 'right');
|
|
36
|
+
const newStatusbarPanels = [...leftPanels, ...centerPanels, ...rightPanels];
|
|
37
|
+
props.onChange(Object.assign(Object.assign({}, props.abOptions), { gridOptions: Object.assign(Object.assign({}, props.abOptions.gridOptions), { statusBar: Object.assign(Object.assign({}, props.abOptions.gridOptions.statusBar), { statusPanels: newStatusbarPanels }) }) }));
|
|
38
|
+
};
|
|
39
|
+
const disabled = false;
|
|
40
|
+
const panelToTabItemId = (panel) => { var _a; return (_a = panel.key) !== null && _a !== void 0 ? _a : panel.statusPanel; };
|
|
41
|
+
const tabs = [
|
|
42
|
+
{
|
|
43
|
+
Name: 'Left',
|
|
44
|
+
Items: leftPanels.map(panelToTabItemId),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
Name: 'Center',
|
|
48
|
+
Items: centerPanels.map(panelToTabItemId),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
Name: 'Right',
|
|
52
|
+
Items: rightPanels.map(panelToTabItemId),
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
const allOptions = [
|
|
56
|
+
{ Id: 'agTotalRowCountComponent', Title: 'Row Count' },
|
|
57
|
+
{ Id: 'agTotalAndFilteredRowCountComponent', Title: 'Totals and Filtered Row Count' },
|
|
58
|
+
{ Id: 'agFilteredRowCountComponent', Title: 'Filtered Row Count' },
|
|
59
|
+
{ Id: 'agSelectedRowCountComponent', Title: 'Selected Row Count' },
|
|
60
|
+
{ Id: 'agAggregationComponent', Title: 'Aggregation' },
|
|
61
|
+
];
|
|
62
|
+
const availableItems = allOptions;
|
|
63
|
+
const [adaptablePanelTitle, setAdaptablePanelTitle] = React.useState('');
|
|
64
|
+
const [adaptablePanelAlign, setAdaptablePanelAlign] = React.useState('left');
|
|
65
|
+
const isAdaptablePanelTitleAvailable = !allPanels.some((panel) => panel.key === adaptablePanelTitle);
|
|
66
|
+
const alignOptions = [
|
|
67
|
+
{ onClick: () => setAdaptablePanelAlign('left'), value: 'left', label: 'Left' },
|
|
68
|
+
{ onClick: () => setAdaptablePanelAlign('center'), value: 'center', label: 'Center' },
|
|
69
|
+
{ onClick: () => setAdaptablePanelAlign('right'), value: 'right', label: 'Right' },
|
|
70
|
+
];
|
|
71
|
+
const handleNewAdaptablePanel = () => {
|
|
72
|
+
const newAdaptablePanel = {
|
|
73
|
+
statusPanel: 'AdaptableStatusPanel',
|
|
74
|
+
align: adaptablePanelAlign,
|
|
75
|
+
key: adaptablePanelTitle,
|
|
76
|
+
};
|
|
77
|
+
const newStatusbarPanels = [...allPanels, newAdaptablePanel];
|
|
78
|
+
setAdaptablePanelTitle('');
|
|
79
|
+
setAdaptablePanelAlign('left');
|
|
80
|
+
props.onChange(Object.assign(Object.assign({}, props.abOptions), { gridOptions: Object.assign(Object.assign({}, props.abOptions.gridOptions), { statusBar: Object.assign(Object.assign({}, props.abOptions.gridOptions.statusBar), { statusPanels: newStatusbarPanels }) }) }));
|
|
81
|
+
};
|
|
82
|
+
return (React.createElement(rebass_1.Box, null,
|
|
83
|
+
React.createElement(HelpBlock_1.default, null, "Status Bar"),
|
|
84
|
+
React.createElement(rebass_1.Box, { p: 2 },
|
|
85
|
+
React.createElement(rebass_1.Box, { style: {
|
|
86
|
+
border: '1px solid var(--ab-color-primarydark)',
|
|
87
|
+
borderRadius: 'var(--ab__border-radius)',
|
|
88
|
+
marginBottom: 'var(--ab-space-2)',
|
|
89
|
+
paddingBottom: 'var(--ab-space-1)',
|
|
90
|
+
backgroundColor: 'var(--ab-color-defaultbackground)',
|
|
91
|
+
padding: 'var(--ab-space-2)',
|
|
92
|
+
} },
|
|
93
|
+
React.createElement(rebass_1.Box, { as: "b" }, "Create Adaptable Statusbar Panel"),
|
|
94
|
+
React.createElement(FormLayout_1.default, { mt: 2 },
|
|
95
|
+
React.createElement(FormLayout_1.FormRow, { label: "Panel Name" },
|
|
96
|
+
React.createElement(Input_1.default, { value: adaptablePanelTitle, placehoder: 'Adaptable Panel Name', onChange: (event) => setAdaptablePanelTitle(event.target.value) })),
|
|
97
|
+
React.createElement(FormLayout_1.FormRow, { label: "Align" },
|
|
98
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: alignOptions }, (_d = alignOptions.find((option) => option.value === adaptablePanelAlign)) === null || _d === void 0 ? void 0 : _d.label)),
|
|
99
|
+
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
100
|
+
React.createElement(SimpleButton_1.default, { disabled: !isAdaptablePanelTitleAvailable, onClick: handleNewAdaptablePanel, icon: "plus", variant: "raised" }, "Add"),
|
|
101
|
+
!isAdaptablePanelTitleAvailable && (React.createElement(rebass_1.Box, { mt: 2, color: "var(--ab-color-error)" }, "Adaptable panel name must be unique."))))),
|
|
102
|
+
React.createElement(ModuleManager_1.ModuleManager, { permittedActions: {
|
|
103
|
+
createTab: false,
|
|
104
|
+
dragAndDropTab: false,
|
|
105
|
+
deleteTab: false,
|
|
106
|
+
editTabName: false,
|
|
107
|
+
}, onTabsChange: handleTabChange, disabled: disabled, tabs: tabs, availableItems: availableItems, tabsTitle: 'Status Bar Panels', unusedPanelTitle: "Ag Grid Status Bar Panels", dragItemText: "Drag into a Status Bar Panel below" }))));
|
|
108
|
+
};
|
|
109
|
+
exports.UIOptionsStatusbarForm = UIOptionsStatusbarForm;
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AdaptableOptions } from '../../../../types';
|
|
3
|
+
interface UIElementsOptionsProps {
|
|
4
|
+
adaptableOptions: AdaptableOptions;
|
|
5
|
+
onChangeadaptableOptions: (adaptableOptions: AdaptableOptions) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const UIElementsForm: React.FunctionComponent<UIElementsOptionsProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIElementsForm = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const UIOptionsActionColumnsForm_1 = require("./UIOptionsActionColumnsForm");
|
|
7
|
+
const UIOptionsSidebarForm_1 = require("./UIOptionsSidebarForm");
|
|
8
|
+
const UIOptionsStatusbarForm_1 = require("./UIOptionsStatusbarForm");
|
|
9
|
+
const UIElementsForm = (props) => {
|
|
10
|
+
let abOptions = props.adaptableOptions;
|
|
11
|
+
return (React.createElement(React.Fragment, null,
|
|
12
|
+
React.createElement(UIOptionsActionColumnsForm_1.UIOptionsActionColumnsForm, { abOptions: abOptions, onChange: props.onChangeadaptableOptions }),
|
|
13
|
+
React.createElement(UIOptionsSidebarForm_1.UIOptionsSidebarForm, { abOptions: abOptions, onChange: props.onChangeadaptableOptions }),
|
|
14
|
+
React.createElement(UIOptionsStatusbarForm_1.UIOptionsStatusbarForm, { abOptions: abOptions, onChange: props.onChangeadaptableOptions })));
|
|
15
|
+
};
|
|
16
|
+
exports.UIElementsForm = UIElementsForm;
|
|
@@ -41,6 +41,7 @@ const Wizard = (props) => {
|
|
|
41
41
|
const [droppableKey, setDroppableKey] = react_1.useState(Date.now());
|
|
42
42
|
const [isDataLoading, setIsDataLoading] = react_1.useState(false);
|
|
43
43
|
const handleDataSource = (array, file) => {
|
|
44
|
+
var _a;
|
|
44
45
|
const dataSourceInfo = (props.prepareData || helper_1.prepareDataSource)(array, file);
|
|
45
46
|
try {
|
|
46
47
|
Utils_1.validDataSource(dataSourceInfo);
|
|
@@ -51,7 +52,7 @@ const Wizard = (props) => {
|
|
|
51
52
|
payload: `Invalid adaptable configuration - ${err}`,
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
|
-
const gridOptions = helper_1.prepareGridOptions(dataSourceInfo);
|
|
55
|
+
const gridOptions = helper_1.prepareGridOptions(dataSourceInfo, (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.gridOptions);
|
|
55
56
|
const adaptableOptions = Object.assign({}, props.adaptableOptions);
|
|
56
57
|
adaptableOptions.adaptableId = adaptableOptions.adaptableId || (file ? file.name : '');
|
|
57
58
|
adaptableOptions.gridOptions = gridOptions;
|
|
@@ -16,4 +16,4 @@ export interface WizardDataSourceInfo {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const prepareDataSource: (json: any, _file?: File) => WizardDataSourceInfo;
|
|
18
18
|
export declare const getColTypeFromValue: (value: any) => string;
|
|
19
|
-
export declare const prepareGridOptions: (dataSourceInfo: WizardDataSourceInfo) => GridOptions;
|
|
19
|
+
export declare const prepareGridOptions: (dataSourceInfo: WizardDataSourceInfo, defaultGridOptions: Partial<GridOptions>) => GridOptions;
|
|
@@ -65,7 +65,7 @@ const getColTypeFromValue = (value) => {
|
|
|
65
65
|
return columnType;
|
|
66
66
|
};
|
|
67
67
|
exports.getColTypeFromValue = getColTypeFromValue;
|
|
68
|
-
const prepareGridOptions = (dataSourceInfo) => {
|
|
68
|
+
const prepareGridOptions = (dataSourceInfo, defaultGridOptions) => {
|
|
69
69
|
const firstItem = dataSourceInfo.data[0];
|
|
70
70
|
const columnDefs = dataSourceInfo.columns.map((columnName) => {
|
|
71
71
|
const firstItemValue = firstItem[columnName];
|
|
@@ -81,16 +81,9 @@ const prepareGridOptions = (dataSourceInfo) => {
|
|
|
81
81
|
editable: true,
|
|
82
82
|
};
|
|
83
83
|
});
|
|
84
|
-
const gridOptions = {
|
|
85
|
-
defaultColDef: {
|
|
84
|
+
const gridOptions = Object.assign(Object.assign({}, defaultGridOptions), { defaultColDef: {
|
|
86
85
|
floatingFilter: true,
|
|
87
|
-
},
|
|
88
|
-
rowData: dataSourceInfo.data,
|
|
89
|
-
columnDefs,
|
|
90
|
-
enableRangeSelection: true,
|
|
91
|
-
rowSelection: 'multiple',
|
|
92
|
-
rowHeight: 30,
|
|
93
|
-
};
|
|
86
|
+
}, rowData: dataSourceInfo.data, columnDefs, enableRangeSelection: true, rowSelection: 'multiple', rowHeight: 30 });
|
|
94
87
|
return gridOptions;
|
|
95
88
|
};
|
|
96
89
|
exports.prepareGridOptions = prepareGridOptions;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getCalculatedColumnSettingTags = void 0;
|
|
4
4
|
const getCalculatedColumnSettingTags = (settings) => {
|
|
5
5
|
const { DataType, Width, Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable } = settings !== null && settings !== void 0 ? settings : {};
|
|
6
|
+
const colTypes = (settings === null || settings === void 0 ? void 0 : settings.ColumnTypes) ? settings.ColumnTypes.join(', ') : '';
|
|
6
7
|
return [
|
|
7
8
|
DataType ? `DataType: ${DataType}` : null,
|
|
8
9
|
Width ? `Width: ${Width}px` : null,
|
|
@@ -12,6 +13,7 @@ const getCalculatedColumnSettingTags = (settings) => {
|
|
|
12
13
|
Groupable ? 'Groupable' : null,
|
|
13
14
|
Sortable ? 'Sortable' : null,
|
|
14
15
|
Aggregatable ? 'Aggregatable' : null,
|
|
16
|
+
colTypes ? `Column Types: ${colTypes}` : null,
|
|
15
17
|
].filter(Boolean);
|
|
16
18
|
};
|
|
17
19
|
exports.getCalculatedColumnSettingTags = getCalculatedColumnSettingTags;
|
|
@@ -66,10 +66,7 @@ const CalculatedColumnExpressionWizardSection = (props) => {
|
|
|
66
66
|
const setCalculatedColumnExpression = (calculatedColumnQuery) => {
|
|
67
67
|
const calculatedColumnExpressionService = api.internalApi.getCalculatedColumnExpressionService();
|
|
68
68
|
const dataType = calculatedColumnExpressionService.getCalculatedColumnDataType(calculatedColumnQuery);
|
|
69
|
-
|
|
70
|
-
const Aggregatable = dataType == 'Number';
|
|
71
|
-
props.onChange(Object.assign(Object.assign({}, data), { Query: calculatedColumnQuery, CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType, Pivotable,
|
|
72
|
-
Aggregatable }) }));
|
|
69
|
+
props.onChange(Object.assign(Object.assign({}, data), { Query: calculatedColumnQuery, CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType }) }));
|
|
73
70
|
};
|
|
74
71
|
return (React.createElement(Tabs_1.Tabs, { onValueChange: setType, value: selectedTab, p: 2, style: { height: '100%', flex: 1, overflow: 'auto' } },
|
|
75
72
|
React.createElement(QueryTab, { value: "ScalarExpression", type: type, label: "Scalar" }),
|
|
@@ -37,7 +37,7 @@ const isValidCalculatedColumnSettings = (data, api) => {
|
|
|
37
37
|
return 'Column Id cannot be empty';
|
|
38
38
|
}
|
|
39
39
|
if (!((_a = data.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.DataType)) {
|
|
40
|
-
return 'No data type specified
|
|
40
|
+
return 'No data type is specified and it could not be inferred from the defined expression';
|
|
41
41
|
}
|
|
42
42
|
const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
|
|
43
43
|
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
@@ -29,7 +29,7 @@ const CalculatedColumnWizard = (props) => {
|
|
|
29
29
|
return calculatedColumn;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
return ObjectFactory_1.default.CreateEmptyCalculatedColumn(
|
|
32
|
+
return ObjectFactory_1.default.CreateEmptyCalculatedColumn();
|
|
33
33
|
});
|
|
34
34
|
const dispatch = react_redux_1.useDispatch();
|
|
35
35
|
const isEdit = Boolean(props.data) || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
|
|
@@ -43,15 +43,6 @@ const CalculatedColumnWizard = (props) => {
|
|
|
43
43
|
props.onCloseWizard();
|
|
44
44
|
};
|
|
45
45
|
return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: calculatedColumn, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
|
|
46
|
-
{
|
|
47
|
-
title: 'Expression',
|
|
48
|
-
details: 'Specify the Calculated Column Expression',
|
|
49
|
-
isValid: CalculatedColumnExpressionWizardSection_1.isValidCalculatedColumnExpression,
|
|
50
|
-
renderSummary: CalculatedColumnExpressionWizardSection_1.renderCalculatedColumnExpressionSummary,
|
|
51
|
-
render: () => {
|
|
52
|
-
return React.createElement(CalculatedColumnExpressionWizardSection_1.CalculatedColumnExpressionWizardSection, { onChange: setCalculatedColumn });
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
46
|
{
|
|
56
47
|
title: 'Settings',
|
|
57
48
|
details: 'Specify Column details and properties',
|
|
@@ -62,6 +53,15 @@ const CalculatedColumnWizard = (props) => {
|
|
|
62
53
|
React.createElement(CalculatedColumnSettingsWizardSection_1.CalculatedColumnSettingsWizardSection, { isEdit: isEdit, onChange: setCalculatedColumn })));
|
|
63
54
|
},
|
|
64
55
|
},
|
|
56
|
+
{
|
|
57
|
+
title: 'Expression',
|
|
58
|
+
details: 'Specify the Calculated Column Expression',
|
|
59
|
+
isValid: CalculatedColumnExpressionWizardSection_1.isValidCalculatedColumnExpression,
|
|
60
|
+
renderSummary: CalculatedColumnExpressionWizardSection_1.renderCalculatedColumnExpressionSummary,
|
|
61
|
+
render: () => {
|
|
62
|
+
return React.createElement(CalculatedColumnExpressionWizardSection_1.CalculatedColumnExpressionWizardSection, { onChange: setCalculatedColumn });
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
65
|
{
|
|
66
66
|
details: 'Select Calculated Column tags',
|
|
67
67
|
title: 'Tags',
|
|
@@ -21,7 +21,7 @@ const AdaptableDateInput = React.forwardRef((props, ref) => {
|
|
|
21
21
|
});
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
|
-
const dateValue = DateHelper_1.
|
|
24
|
+
const dateValue = value ? DateHelper_1.parseDateValue(value) : null;
|
|
25
25
|
const datepickerProps = Object.assign({
|
|
26
26
|
// this is OK as long as we do not support range datepicker
|
|
27
27
|
value: dateValue, onChange: (dateValue) => { var _a;
|
|
@@ -110,7 +110,8 @@ class FilterFormComponent extends React.Component {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
async loadPermittedValues(filter = '') {
|
|
113
|
-
const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter
|
|
113
|
+
const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter, this.props.api.internalApi.getAdaptableOptions().filterOptions
|
|
114
|
+
.showDistinctFilteredValuesOnly), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
|
|
114
115
|
if (!this._isMounted) {
|
|
115
116
|
return;
|
|
116
117
|
}
|
|
@@ -210,7 +211,8 @@ class FilterFormComponent extends React.Component {
|
|
|
210
211
|
if (editedColumnFilter.Predicate === undefined ||
|
|
211
212
|
(editedColumnFilter.Predicate.PredicateId === 'Values' &&
|
|
212
213
|
editedColumnFilter.Predicate.Inputs.length === 0)) {
|
|
213
|
-
this.props.
|
|
214
|
+
this.props.api.filterApi.clearColumnFilterByColumn(editedColumnFilter.ColumnId);
|
|
215
|
+
this.onCloseForm();
|
|
214
216
|
}
|
|
215
217
|
else {
|
|
216
218
|
if (this.props.api.internalApi.getAdaptableOptions().filterOptions.autoApplyFilter) {
|
|
@@ -32,7 +32,8 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
this.loadPermittedValues = async (filter = '') => {
|
|
35
|
-
const { values, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter
|
|
35
|
+
const { values, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.columnId, filter, this.props.api.internalApi.getAdaptableOptions().filterOptions
|
|
36
|
+
.showDistinctFilteredValuesOnly), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
|
|
36
37
|
if (!this._isMounted) {
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
@@ -49,8 +49,7 @@ class FreeTextColumnSummaryComponent extends React.Component {
|
|
|
49
49
|
this.state.editedAdaptableObject && (React.createElement(FreeTextColumnWizard_1.FreeTextColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FreeTextColumns, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard }))));
|
|
50
50
|
}
|
|
51
51
|
onNew() {
|
|
52
|
-
|
|
53
|
-
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(specialColumnsAreFilterable);
|
|
52
|
+
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn();
|
|
54
53
|
configEntity.ColumnId = this.props.summarisedColumn.columnId;
|
|
55
54
|
this.setState({
|
|
56
55
|
editedAdaptableObject: configEntity,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { FreeTextColumn } from '../../../PredefinedConfig/FreeTextColumnState';
|
|
3
3
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
4
4
|
export declare const renderFreeTextColumnSummary: (data: FreeTextColumn) => JSX.Element;
|
|
5
|
-
export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "Column Id cannot be empty" | "
|
|
5
|
+
export declare const isValidFreeTextColumn: (data: FreeTextColumn, api: AdaptableApi) => true | "Column Id cannot be empty" | "A Column already exists with that id" | "No data type specified for column";
|
|
6
6
|
export declare type FreeTextColumnSettingsWizardSectionProps = {
|
|
7
7
|
onChange: (data: FreeTextColumn) => void;
|
|
8
8
|
isEdit: boolean;
|
|
@@ -23,7 +23,7 @@ const FreeTextColumnWizard = (props) => {
|
|
|
23
23
|
if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
|
|
24
24
|
return allFreeTextColumns.find((column) => column.ColumnId === props.popupParams.column.columnId);
|
|
25
25
|
}
|
|
26
|
-
return ObjectFactory_1.default.CreateEmptyFreeTextColumn(
|
|
26
|
+
return ObjectFactory_1.default.CreateEmptyFreeTextColumn();
|
|
27
27
|
});
|
|
28
28
|
const dispatch = react_redux_1.useDispatch();
|
|
29
29
|
const isEdit = props.data || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
|
|
@@ -18,16 +18,16 @@ const ValueSelector_1 = require("../../../Components/ValueSelector");
|
|
|
18
18
|
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
|
|
19
19
|
const ColumnLabels_1 = require("../LayoutEditor/ColumnLabels");
|
|
20
20
|
const Utilities_1 = require("./Utilities");
|
|
21
|
-
const lodash_1 = require("lodash");
|
|
22
21
|
const icons_1 = require("../../../../components/icons");
|
|
23
22
|
const CheckBox_1 = require("../../../../components/CheckBox");
|
|
23
|
+
const Helper_1 = require("../../../../Utilities/Helpers/Helper");
|
|
24
24
|
const PropertyOrderText = (props) => (React.createElement(rebass_1.Text, { fontWeight: 600, fontSize: 2 }, props.children));
|
|
25
25
|
const ColumnsSectionSummary = () => {
|
|
26
26
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
27
27
|
const { data: layout } = OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext();
|
|
28
28
|
const rowHeight = 40;
|
|
29
29
|
const headerHeight = 40;
|
|
30
|
-
const tableHeight = headerHeight +
|
|
30
|
+
const tableHeight = headerHeight + Helper_1.clamp(rowHeight * layout.Columns.length, 100, 360);
|
|
31
31
|
const data = React.useMemo(() => {
|
|
32
32
|
return layout.Columns.map((columnId) => {
|
|
33
33
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
@@ -76,6 +76,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
76
76
|
private currentColumnDefs?;
|
|
77
77
|
private rowListeners;
|
|
78
78
|
private isCheckedColumnDataType;
|
|
79
|
+
get isLive(): boolean;
|
|
79
80
|
_on: (eventName: string, callback: EmitterCallback) => (() => void);
|
|
80
81
|
_onIncludeFired: (eventName: string, callback: EmitterCallback) => (() => void);
|
|
81
82
|
_emit: (eventName: string, data?: any) => Promise<any>;
|
|
@@ -209,6 +210,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
209
210
|
selectCells(columnIds: string[], startNode: RowNode, endNode: RowNode): void;
|
|
210
211
|
isRowNodeVisible(rowNode: RowNode): boolean;
|
|
211
212
|
redrawBody(): void;
|
|
213
|
+
redrawRenderedRows(): void;
|
|
212
214
|
redrawHeader(): void;
|
|
213
215
|
redrawRow(rowNode: RowNode): void;
|
|
214
216
|
redrawRows(rowNodes: RowNode[]): void;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -266,6 +266,9 @@ class Adaptable {
|
|
|
266
266
|
};
|
|
267
267
|
// (global as any).adaptable = this;
|
|
268
268
|
}
|
|
269
|
+
get isLive() {
|
|
270
|
+
return this.isInitialised && !this.isDestroyed;
|
|
271
|
+
}
|
|
269
272
|
static init(adaptableOptions) {
|
|
270
273
|
return Adaptable.initInternal(adaptableOptions);
|
|
271
274
|
}
|
|
@@ -392,7 +395,7 @@ class Adaptable {
|
|
|
392
395
|
this.AlertService = new AlertService_1.AlertService(this.api);
|
|
393
396
|
this.TeamSharingService = new TeamSharingService_1.TeamSharingService(this.api);
|
|
394
397
|
this.RowEditService = new RowEditService_1.RowEditService(this.api);
|
|
395
|
-
this.MetamodelService = new MetamodelService_1.MetamodelService(this.api);
|
|
398
|
+
this.MetamodelService = new MetamodelService_1.MetamodelService(() => this.api.internalApi.getAdaptableOptions());
|
|
396
399
|
this.forPlugins((plugin) => plugin.afterInitServices(this));
|
|
397
400
|
// Set up Modules - we set up all the Modules suitable for AG Grid
|
|
398
401
|
// But users can make some hidden or readonly in their entitlements
|
|
@@ -542,7 +545,7 @@ class Adaptable {
|
|
|
542
545
|
});
|
|
543
546
|
}
|
|
544
547
|
performAudit(action, oldState, newState) {
|
|
545
|
-
if (this.
|
|
548
|
+
if (this.isLive) {
|
|
546
549
|
const adaptableStateChangedInfo = {
|
|
547
550
|
adaptableApi: this.api,
|
|
548
551
|
actionName: action.type,
|
|
@@ -1395,6 +1398,9 @@ class Adaptable {
|
|
|
1395
1398
|
shouldUpdateHeaders = this.setupColumnHeader(colSetupInfo) || shouldUpdateHeaders;
|
|
1396
1399
|
});
|
|
1397
1400
|
isChanged = isChanged || shouldUpdateHeaders;
|
|
1401
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(layout.ColumnFilters)) {
|
|
1402
|
+
this.gridOptions.api.onFilterChanged();
|
|
1403
|
+
}
|
|
1398
1404
|
if (isChanged) {
|
|
1399
1405
|
// it's important we set pivot mode
|
|
1400
1406
|
// before we set column state
|
|
@@ -1717,7 +1723,7 @@ class Adaptable {
|
|
|
1717
1723
|
const filterPermittedValuesParams = {
|
|
1718
1724
|
adaptableApi: this.api,
|
|
1719
1725
|
column: column,
|
|
1720
|
-
|
|
1726
|
+
searchFilter: filter,
|
|
1721
1727
|
};
|
|
1722
1728
|
preparedPermittedValues = await (permittedValues === null || permittedValues === void 0 ? void 0 : permittedValues.values(filterPermittedValuesParams));
|
|
1723
1729
|
}
|
|
@@ -1942,7 +1948,10 @@ class Adaptable {
|
|
|
1942
1948
|
return typeof rawValue !== 'string' ? String(rawValue) : rawValue;
|
|
1943
1949
|
}
|
|
1944
1950
|
if (dataType === 'Number') {
|
|
1945
|
-
|
|
1951
|
+
// empty string or space should not be converted to 0
|
|
1952
|
+
return typeof rawValue !== 'number' && StringExtensions_1.StringExtensions.IsNumeric(rawValue)
|
|
1953
|
+
? Number(rawValue)
|
|
1954
|
+
: rawValue;
|
|
1946
1955
|
}
|
|
1947
1956
|
if (dataType === 'Boolean') {
|
|
1948
1957
|
return typeof rawValue !== 'boolean' ? Boolean(rawValue) : rawValue;
|
|
@@ -2074,6 +2083,9 @@ class Adaptable {
|
|
|
2074
2083
|
this.gridOptions.api.redrawRows();
|
|
2075
2084
|
this._emit('GridRefreshed');
|
|
2076
2085
|
}
|
|
2086
|
+
redrawRenderedRows() {
|
|
2087
|
+
this.redrawRows(this.gridOptions.api.getRenderedNodes());
|
|
2088
|
+
}
|
|
2077
2089
|
redrawHeader() {
|
|
2078
2090
|
this.gridOptions.api.refreshHeader();
|
|
2079
2091
|
}
|
|
@@ -2124,8 +2136,7 @@ class Adaptable {
|
|
|
2124
2136
|
];
|
|
2125
2137
|
}
|
|
2126
2138
|
getColDefsForFreeTextColumns() {
|
|
2127
|
-
const
|
|
2128
|
-
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable).FreeTextColumnSettings;
|
|
2139
|
+
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn().FreeTextColumnSettings;
|
|
2129
2140
|
return this.api.freeTextColumnApi.getAllFreeTextColumn().map((freeTextColumn) => {
|
|
2130
2141
|
var _a;
|
|
2131
2142
|
const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
|
|
@@ -2400,11 +2411,7 @@ class Adaptable {
|
|
|
2400
2411
|
// !! it is important to NOT set the columns visible again as this is already taken care of in the next performed method (this.updateColDefsForSpecialColumns())
|
|
2401
2412
|
}
|
|
2402
2413
|
getColDefsForCalculatedColumns() {
|
|
2403
|
-
const
|
|
2404
|
-
.enableFilterOnSpecialColumns
|
|
2405
|
-
? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
|
|
2406
|
-
: true;
|
|
2407
|
-
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable).CalculatedColumnSettings;
|
|
2414
|
+
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn().CalculatedColumnSettings;
|
|
2408
2415
|
const isExternalEvaluation = !this.api.internalApi.runModuleInAdaptableQL('CalculatedColumn');
|
|
2409
2416
|
return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
|
|
2410
2417
|
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|