@adaptabletools/adaptable 12.0.0-canary.0 → 12.0.0-canary.1
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/base.css +546 -269
- package/bundle.cjs.js +102 -102
- package/index.css +616 -266
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/EditOptions.d.ts +4 -5
- package/src/AdaptableOptions/ExportOptions.d.ts +4 -7
- package/src/AdaptableOptions/GeneralOptions.d.ts +5 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +19 -1
- package/src/Api/ColumnApi.d.ts +7 -2
- package/src/Api/EventApi.d.ts +11 -0
- package/src/Api/Events/SearchChanged.d.ts +1 -1
- package/src/Api/ExportApi.d.ts +2 -2
- package/src/Api/FilterApi.d.ts +69 -1
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ColumnApiImpl.js +15 -14
- package/src/Api/Implementation/ConfigApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
- package/src/Api/Implementation/FilterApiImpl.d.ts +16 -1
- package/src/Api/Implementation/FilterApiImpl.js +141 -0
- package/src/Api/Implementation/GridApiImpl.js +7 -3
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -15
- package/src/Api/Implementation/LayoutApiImpl.js +0 -152
- package/src/Api/Implementation/PredicateApiImpl.d.ts +2 -0
- package/src/Api/Implementation/PredicateApiImpl.js +18 -0
- package/src/Api/LayoutApi.d.ts +1 -72
- package/src/Api/PredicateApi.d.ts +7 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +1 -1
- package/src/PredefinedConfig/Common/FormContext.d.ts +8 -0
- package/src/PredefinedConfig/Common/FormContext.js +2 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +0 -1
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +3 -2
- package/src/Strategy/AdaptableModuleBase.js +1 -2
- package/src/Strategy/BulkUpdateModule.js +3 -4
- package/src/Strategy/CellSummaryModule.js +1 -2
- package/src/Strategy/FilterModule.js +15 -18
- package/src/Strategy/LayoutModule.js +1 -0
- package/src/Strategy/PlusMinusModule.js +1 -4
- package/src/Strategy/SmartEditModule.js +2 -2
- package/src/Utilities/Constants/GeneralConstants.d.ts +2 -0
- package/src/Utilities/Constants/GeneralConstants.js +3 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +6 -7
- package/src/Utilities/Services/RowEditService.d.ts +1 -0
- package/src/Utilities/Services/RowEditService.js +34 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +2 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +2 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +4 -5
- package/src/View/CellSummary/CellSummaryDetails.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.js +1 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +1 -1
- package/src/View/Components/PreviewResultsPanel.js +3 -3
- package/src/View/Components/WizardSummaryPage.js +2 -2
- package/src/View/Filter/ActiveFiltersPanel.js +1 -1
- package/src/View/Filter/FilterSummary.js +1 -1
- package/src/View/Filter/FilterViewPanel.js +2 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +4 -5
- package/src/View/GridInfo/ColumnInfoComponent.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +1 -1
- package/src/View/UIHelper.js +6 -6
- package/src/agGrid/Adaptable.js +25 -11
- package/src/agGrid/FilterWrapper.js +2 -2
- package/src/agGrid/agGridHelper.d.ts +2 -3
- package/src/agGrid/agGridHelper.js +37 -33
- package/src/agGrid/rowEditIcons.d.ts +1 -0
- package/src/agGrid/rowEditIcons.js +2 -1
- package/src/components/InfiniteTable/index.js +1 -0
- package/src/components/List/GridList/index.js +1 -1
- package/src/components/icons/add-row.d.ts +3 -0
- package/src/components/icons/add-row.js +7 -0
- package/src/components/icons/index.js +2 -0
- package/src/metamodel/adaptable.metamodel.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.js +122 -89
- package/src/types.d.ts +3 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CalculatedColumnExpressionService = void 0;
|
|
4
|
-
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
5
4
|
const LoggingHelper_1 = require("../Helpers/LoggingHelper");
|
|
6
5
|
const ModuleConstants_1 = require("../Constants/ModuleConstants");
|
|
7
6
|
const scalarAggregationHelper_1 = require("../ExpressionFunctions/scalarAggregationHelper");
|
|
@@ -42,28 +41,28 @@ class CalculatedColumnExpressionService {
|
|
|
42
41
|
// currently AggregatedScalarExpression support only numerical values
|
|
43
42
|
// TODO AFL try to derive the type from the aggregatedColumn?
|
|
44
43
|
// we definitely don't want to aggregate everything only to get the data type
|
|
45
|
-
return
|
|
44
|
+
return 'Number';
|
|
46
45
|
}
|
|
47
46
|
let firstRowNode = this.adaptableApi.gridApi.getFirstRowNode();
|
|
48
47
|
let firstRowValue = this.adaptableApi.internalApi
|
|
49
48
|
.getQueryLanguageService()
|
|
50
49
|
.evaluateScalarExpression(calculatedColumnQuery.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
|
|
51
50
|
if (firstRowValue instanceof Date) {
|
|
52
|
-
return
|
|
51
|
+
return 'Date';
|
|
53
52
|
}
|
|
54
53
|
if (typeof firstRowValue === 'boolean') {
|
|
55
|
-
return
|
|
54
|
+
return 'Boolean';
|
|
56
55
|
}
|
|
57
56
|
if (typeof firstRowValue === 'string') {
|
|
58
|
-
return
|
|
57
|
+
return 'String';
|
|
59
58
|
}
|
|
60
59
|
if (typeof firstRowValue === 'number') {
|
|
61
|
-
return
|
|
60
|
+
return 'Number';
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
catch (e) {
|
|
65
64
|
LoggingHelper_1.LogAdaptableWarning(`Invalid CalculatedColumn expression ${this.adaptableApi.queryLanguageApi.getAdaptableQueryExpression(calculatedColumnQuery)} :: ${e}`);
|
|
66
|
-
return
|
|
65
|
+
return 'Number';
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
isCalculatedColumnQueryValid(calculatedColumnQuery) {
|
|
@@ -7,6 +7,10 @@ class RowEditService {
|
|
|
7
7
|
this.adaptableInstance = this.adaptableApi.internalApi.getAdaptableInstance();
|
|
8
8
|
this.rowEditFormOptions =
|
|
9
9
|
this.adaptableApi.internalApi.getAdaptableInstance().adaptableOptions.editOptions.rowFormOptions;
|
|
10
|
+
if (this.adaptableInstance.adaptableOptions.userInterfaceOptions.actionOptions
|
|
11
|
+
.autoHandleActionRowButtons) {
|
|
12
|
+
this.adaptableInstance.api.eventApi.on('RowFormSubmitted', (eventInfo) => this.autoHandleActionRowButtons(eventInfo));
|
|
13
|
+
}
|
|
10
14
|
}
|
|
11
15
|
buildRowEditForm(rowNode) {
|
|
12
16
|
return this.buildRowForm('rowEdited', rowNode);
|
|
@@ -48,10 +52,13 @@ class RowEditService {
|
|
|
48
52
|
};
|
|
49
53
|
}
|
|
50
54
|
buildRowFormFields(type, rowNode) {
|
|
51
|
-
const relevantColumns = this.adaptableApi.columnApi
|
|
55
|
+
const relevantColumns = this.adaptableApi.columnApi
|
|
56
|
+
.getColumns()
|
|
57
|
+
.filter((column) => {
|
|
52
58
|
// if there is NO rowNode, do NOT display the non-editable fields as they will be empty
|
|
53
59
|
return !!rowNode || this.isColumnEditable(column, rowNode);
|
|
54
|
-
})
|
|
60
|
+
})
|
|
61
|
+
.filter((column) => !this.adaptableApi.columnApi.isActionRowButtonColumn(column.columnId));
|
|
55
62
|
return relevantColumns.map((column) => this.buildFormField(type, column, rowNode));
|
|
56
63
|
}
|
|
57
64
|
buildRowFormButtons(type, rowNode) {
|
|
@@ -161,5 +168,30 @@ class RowEditService {
|
|
|
161
168
|
label: value,
|
|
162
169
|
}));
|
|
163
170
|
}
|
|
171
|
+
autoHandleActionRowButtons(rowEditedFormInfo) {
|
|
172
|
+
const { adaptableApi } = rowEditedFormInfo;
|
|
173
|
+
if (rowEditedFormInfo.type === 'rowEdited') {
|
|
174
|
+
const { rowNode, formData } = rowEditedFormInfo;
|
|
175
|
+
const newRowData = Object.assign(Object.assign({}, rowNode.data), formData);
|
|
176
|
+
adaptableApi.gridApi.updateGridData([newRowData]);
|
|
177
|
+
}
|
|
178
|
+
if (rowEditedFormInfo.type === 'rowDeleted') {
|
|
179
|
+
const { rowNode } = rowEditedFormInfo;
|
|
180
|
+
const deletedRowData = rowNode.data;
|
|
181
|
+
adaptableApi.gridApi.deleteGridData([deletedRowData]);
|
|
182
|
+
}
|
|
183
|
+
if (rowEditedFormInfo.type === 'rowCreated') {
|
|
184
|
+
const { formData } = rowEditedFormInfo;
|
|
185
|
+
const setPrimaryKeyValueFunction = adaptableApi.internalApi.getAdaptableInstance().adaptableOptions.userInterfaceOptions
|
|
186
|
+
.actionOptions.setPrimaryKeyValue;
|
|
187
|
+
const newRowData = typeof setPrimaryKeyValueFunction === 'function'
|
|
188
|
+
? setPrimaryKeyValueFunction({
|
|
189
|
+
rowData: formData,
|
|
190
|
+
adaptableApi,
|
|
191
|
+
})
|
|
192
|
+
: Object.assign({}, formData);
|
|
193
|
+
adaptableApi.gridApi.addGridData([newRowData], { addIndex: 0 });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
164
196
|
}
|
|
165
197
|
exports.RowEditService = RowEditService;
|
|
@@ -6,7 +6,6 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
7
|
const BulkUpdateRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/BulkUpdateRedux"));
|
|
8
8
|
const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
|
|
9
|
-
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
10
9
|
const PanelWithImage_1 = require("../Components/Panels/PanelWithImage");
|
|
11
10
|
const AdaptablePopover_1 = require("../AdaptablePopover");
|
|
12
11
|
const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
|
|
@@ -34,7 +33,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
34
33
|
let dataTypeErrorMessage = '';
|
|
35
34
|
if (col && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue)) {
|
|
36
35
|
// check that the update value is a number for a numeric column. not issue for dates as we dont allow free text
|
|
37
|
-
if (col.dataType ==
|
|
36
|
+
if (col.dataType == 'Number') {
|
|
38
37
|
if (isNaN(Number(this.props.BulkUpdateValue))) {
|
|
39
38
|
hasDataTypeError = true;
|
|
40
39
|
dataTypeErrorMessage = 'This column only accepts numbers';
|
|
@@ -50,7 +49,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
50
49
|
return null;
|
|
51
50
|
}
|
|
52
51
|
return (React.createElement(PanelWithImage_1.PanelWithImage, { bodyProps: { padding: 2 }, flex: 1, glyphicon: this.props.moduleInfo.Glyph, header: this.props.moduleInfo.FriendlyName, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), variant: "primary" },
|
|
53
|
-
col.dataType ==
|
|
52
|
+
col.dataType == 'Date' ? (React.createElement(React.Fragment, null,
|
|
54
53
|
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, "Enter a date value. Alternatively, tick the checkbox and select from an existing column value."),
|
|
55
54
|
React.createElement(rebass_1.Box, null,
|
|
56
55
|
React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, onChange: (checked) => this.onUseColumnValuesSelectorChanged(checked), checked: this.state.useSelector },
|
|
@@ -6,7 +6,6 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
8
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
|
-
const Enums_1 = require("../../../PredefinedConfig/Common/Enums");
|
|
10
9
|
const ExpressionEditor_1 = require("../../../components/ExpressionEditor");
|
|
11
10
|
const Tabs_1 = require("../../../components/Tabs");
|
|
12
11
|
const CodeBlock_1 = require("../../../components/CodeBlock");
|
|
@@ -65,8 +64,8 @@ exports.CalculatedColumnExpressionWizardSection = (props) => {
|
|
|
65
64
|
const setCalculatedColumnExpression = (calculatedColumnQuery) => {
|
|
66
65
|
const calculatedColumnExpressionService = api.internalApi.getCalculatedColumnExpressionService();
|
|
67
66
|
const dataType = calculatedColumnExpressionService.getCalculatedColumnDataType(calculatedColumnQuery);
|
|
68
|
-
const Pivotable = dataType ==
|
|
69
|
-
const Aggregatable = dataType ==
|
|
67
|
+
const Pivotable = dataType == 'String';
|
|
68
|
+
const Aggregatable = dataType == 'Number';
|
|
70
69
|
props.onChange(Object.assign(Object.assign({}, data), { Query: calculatedColumnQuery, CalculatedColumnSettings: Object.assign(Object.assign({}, data.CalculatedColumnSettings), { DataType: dataType, Pivotable,
|
|
71
70
|
Aggregatable }) }));
|
|
72
71
|
};
|
|
@@ -4,7 +4,6 @@ exports.CalculatedColumnSettingsWizardSection = exports.isValidCalculatedColumnS
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
-
const Enums_1 = require("../../../PredefinedConfig/Common/Enums");
|
|
8
7
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
8
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
10
9
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
@@ -64,10 +63,10 @@ exports.CalculatedColumnSettingsWizardSection = (props) => {
|
|
|
64
63
|
const validCheck = exports.isValidCalculatedColumnSettings(data, api);
|
|
65
64
|
const ErrorMessage = validCheck === true ? null : validCheck;
|
|
66
65
|
let options = [
|
|
67
|
-
{ value:
|
|
68
|
-
{ value:
|
|
69
|
-
{ value:
|
|
70
|
-
{ value:
|
|
66
|
+
{ value: 'Number', label: 'Number' },
|
|
67
|
+
{ value: 'String', label: 'String' },
|
|
68
|
+
{ value: 'Date', label: 'Date' },
|
|
69
|
+
{ value: 'Boolean', label: 'Boolean' },
|
|
71
70
|
];
|
|
72
71
|
const [ColumnNameFocused, setColumnNameFocused] = react_1.useState(false);
|
|
73
72
|
const ColumnName = data.FriendlyName;
|
|
@@ -6,8 +6,8 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const EmptyContent_1 = tslib_1.__importDefault(require("../../components/EmptyContent"));
|
|
7
7
|
const InfiniteTable_1 = require("../../components/InfiniteTable");
|
|
8
8
|
const columnsMap = new Map([
|
|
9
|
-
['Operation', { field: 'Operation',
|
|
10
|
-
['Value', { field: 'Value',
|
|
9
|
+
['Operation', { field: 'Operation', defaultFlex: 1 }],
|
|
10
|
+
['Value', { field: 'Value', defaultFlex: 1 }],
|
|
11
11
|
]);
|
|
12
12
|
const tableDOMProps = {
|
|
13
13
|
style: {
|
|
@@ -105,7 +105,7 @@ class FilterFormComponent extends React.Component {
|
|
|
105
105
|
this._isMounted = false;
|
|
106
106
|
}
|
|
107
107
|
componentDidMount() {
|
|
108
|
-
if (this.props.currentColumn.dataType !=
|
|
108
|
+
if (this.props.currentColumn.dataType != 'Boolean') {
|
|
109
109
|
this.loadPermittedValues();
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -321,7 +321,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
321
321
|
}
|
|
322
322
|
clearFilter() {
|
|
323
323
|
const { filter } = this.state;
|
|
324
|
-
this.props.api.
|
|
324
|
+
this.props.api.filterApi.clearColumnFilterByColumn(filter.ColumnId);
|
|
325
325
|
}
|
|
326
326
|
hasValuesPredicate(predicate) {
|
|
327
327
|
return (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'Values' || (predicate === null || predicate === void 0 ? void 0 : predicate.PredicateId) === 'ExcludeValues';
|
|
@@ -9,9 +9,9 @@ const check_1 = tslib_1.__importDefault(require("../../components/icons/check"))
|
|
|
9
9
|
const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
|
|
10
10
|
const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
|
|
11
11
|
const columnsMap = new Map([
|
|
12
|
-
['InitialValue', { field: 'InitialValue',
|
|
13
|
-
['ComputedValue', { field: 'ComputedValue',
|
|
14
|
-
['ValidInfo', { field: 'ValidInfo',
|
|
12
|
+
['InitialValue', { field: 'InitialValue', defaultFlex: 1, header: 'Current', align: 'center' }],
|
|
13
|
+
['ComputedValue', { field: 'ComputedValue', defaultFlex: 1, header: 'New', align: 'center' }],
|
|
14
|
+
['ValidInfo', { field: 'ValidInfo', defaultWidth: 80, header: 'Valid', align: 'center' }],
|
|
15
15
|
]);
|
|
16
16
|
const tableDOMProps = {
|
|
17
17
|
style: { flex: 1 },
|
|
@@ -6,8 +6,8 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const WizardPanel_1 = tslib_1.__importDefault(require("../../components/WizardPanel"));
|
|
7
7
|
const InfiniteTable_1 = require("../../components/InfiniteTable");
|
|
8
8
|
const columnsMap = new Map([
|
|
9
|
-
['Key', { field: 'Key', header: 'Property',
|
|
10
|
-
['Value', { field: 'Value', header: 'Value',
|
|
9
|
+
['Key', { field: 'Key', header: 'Property', defaultFlex: 1 }],
|
|
10
|
+
['Value', { field: 'Value', header: 'Value', defaultFlex: 3 }],
|
|
11
11
|
]);
|
|
12
12
|
const tableDOMProps = {
|
|
13
13
|
className: 'ab-WizardSummary__list',
|
|
@@ -9,6 +9,6 @@ const AdaptableObjectCompactList_1 = require("../Components/AdaptableObjectList/
|
|
|
9
9
|
exports.ActiveFiltersPanel = () => {
|
|
10
10
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
11
11
|
const filterModule = adaptable.ModuleService.getModuleById(ModuleConstants.FilterModuleId);
|
|
12
|
-
const columnFilters = adaptable.api.
|
|
12
|
+
const columnFilters = adaptable.api.filterApi.getColumnFilters();
|
|
13
13
|
return React.createElement(AdaptableObjectCompactList_1.AdaptableObjectCompactList, { abObjects: columnFilters, module: filterModule });
|
|
14
14
|
};
|
|
@@ -34,7 +34,7 @@ class FilterSummaryComponent extends React.Component {
|
|
|
34
34
|
if (columnFilter == null) {
|
|
35
35
|
return 'No Column Filter Active';
|
|
36
36
|
}
|
|
37
|
-
return this.props.api.
|
|
37
|
+
return this.props.api.filterApi.columnFilterToString(columnFilter);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
exports.FilterSummaryComponent = FilterSummaryComponent;
|
|
@@ -27,10 +27,10 @@ class FilterViewPanelComponent extends React.Component {
|
|
|
27
27
|
} }, "Show Quick Filter")))));
|
|
28
28
|
}
|
|
29
29
|
onClearFilters() {
|
|
30
|
-
this.props.api.
|
|
30
|
+
this.props.api.filterApi.clearColumnFilters();
|
|
31
31
|
}
|
|
32
32
|
onClearColumnFilter(columnFilter) {
|
|
33
|
-
this.props.api.
|
|
33
|
+
this.props.api.filterApi.clearColumnFilterByColumn(columnFilter.ColumnId);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
function mapStateToProps(state) {
|
|
@@ -8,7 +8,6 @@ const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
|
8
8
|
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
9
9
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
10
10
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
11
|
-
const Enums_1 = require("../../../PredefinedConfig/Common/Enums");
|
|
12
11
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
13
12
|
const react_1 = require("react");
|
|
14
13
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
@@ -19,10 +18,10 @@ const DateHelper_1 = require("../../../Utilities/Helpers/DateHelper");
|
|
|
19
18
|
const Tag_1 = require("../../../components/Tag");
|
|
20
19
|
const SpecialColumnSettingsWizardStep_1 = require("../../SpecialColumnSettingsWizardStep");
|
|
21
20
|
const options = [
|
|
22
|
-
{ value:
|
|
23
|
-
{ value:
|
|
24
|
-
{ value:
|
|
25
|
-
{ value:
|
|
21
|
+
{ value: 'Number', label: 'Number' },
|
|
22
|
+
{ value: 'String', label: 'String' },
|
|
23
|
+
{ value: 'Date', label: 'Date' },
|
|
24
|
+
{ value: 'Boolean', label: 'Boolean' },
|
|
26
25
|
];
|
|
27
26
|
exports.renderFreeTextColumnSummary = (data) => {
|
|
28
27
|
var _a;
|
|
@@ -125,7 +125,7 @@ class ColumnInfoComponent extends React.Component {
|
|
|
125
125
|
React.createElement(FreeTextColumnSummary_1.FreeTextColumnSummary, { key: ModuleConstants.FreeTextColumnModuleId, summarisedColumn: this.state.SelectedColumn, teamSharingActivated: this.props.teamSharingActivated, accessLevel: this.getAccessLevel(ModuleConstants.FreeTextColumnModuleId), api: this.props.api, moduleInfo: moduleService.getModuleInfoByModule(ModuleConstants.FreeTextColumnModuleId) })));
|
|
126
126
|
}
|
|
127
127
|
if (this.isModuleAvailable(ModuleConstants.PlusMinusModuleId) &&
|
|
128
|
-
this.state.SelectedColumn.dataType ==
|
|
128
|
+
this.state.SelectedColumn.dataType == 'Number') {
|
|
129
129
|
summaries.push(React.createElement("div", { key: ModuleConstants.PlusMinusModuleId, className: this.isModuleReadOnly(ModuleConstants.PlusMinusModuleId)
|
|
130
130
|
? GeneralConstants.READ_ONLY_STYLE
|
|
131
131
|
: '' },
|
|
@@ -57,7 +57,7 @@ exports.GridInfoPopup = (props) => {
|
|
|
57
57
|
const freeTextColumns = props.api.freeTextColumnApi
|
|
58
58
|
.getAllFreeTextColumn()
|
|
59
59
|
.map((c) => c.ColumnId);
|
|
60
|
-
const columnFilterDescription = props.api.
|
|
60
|
+
const columnFilterDescription = props.api.filterApi.columnFiltersToString(props.api.filterApi.getColumnFilters());
|
|
61
61
|
const sorts = ArrayExtensions_1.default.IsNotNullOrEmpty(props.api.gridApi.getColumnSorts())
|
|
62
62
|
? props.api.gridApi.getColumnSorts().map((gs) => {
|
|
63
63
|
return props.api.columnApi.getFriendlyNameFromColumnId(gs.ColumnId) + ': ' + gs.SortOrder;
|
package/src/View/UIHelper.js
CHANGED
|
@@ -109,22 +109,22 @@ function getEmptyConfigState() {
|
|
|
109
109
|
exports.getEmptyConfigState = getEmptyConfigState;
|
|
110
110
|
function getDescriptionForDataType(dataType) {
|
|
111
111
|
switch (dataType) {
|
|
112
|
-
case
|
|
112
|
+
case 'String':
|
|
113
113
|
return 'string';
|
|
114
|
-
case
|
|
114
|
+
case 'Number':
|
|
115
115
|
return 'number';
|
|
116
|
-
case
|
|
116
|
+
case 'Date':
|
|
117
117
|
return 'date';
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
exports.getDescriptionForDataType = getDescriptionForDataType;
|
|
121
121
|
function getPlaceholderForDataType(dataType) {
|
|
122
122
|
switch (dataType) {
|
|
123
|
-
case
|
|
123
|
+
case 'String':
|
|
124
124
|
return 'Enter Value';
|
|
125
|
-
case
|
|
125
|
+
case 'Number':
|
|
126
126
|
return 'Enter Number';
|
|
127
|
-
case
|
|
127
|
+
case 'Date':
|
|
128
128
|
return 'Enter Date';
|
|
129
129
|
}
|
|
130
130
|
}
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -1625,7 +1625,7 @@ class Adaptable {
|
|
|
1625
1625
|
// see https://www.ag-grid.com/javascript-data-grid/change-detection/#triggering-value-change-detection
|
|
1626
1626
|
let newValue;
|
|
1627
1627
|
let dataType = column.dataType;
|
|
1628
|
-
newValue = dataType ==
|
|
1628
|
+
newValue = dataType == 'Number' ? Number(value) : value;
|
|
1629
1629
|
if (dataType == undefined) {
|
|
1630
1630
|
return; // no point continuing as probably a wrong column
|
|
1631
1631
|
}
|
|
@@ -2190,6 +2190,17 @@ class Adaptable {
|
|
|
2190
2190
|
}
|
|
2191
2191
|
const editButtons = actionRowButtons
|
|
2192
2192
|
.map((buttonName) => {
|
|
2193
|
+
if (buttonName === 'create') {
|
|
2194
|
+
// we need this dirty hack until ActionColumn support for custom icons is improved
|
|
2195
|
+
const label = rowEditIcons_1.rowAddIcon;
|
|
2196
|
+
return {
|
|
2197
|
+
label,
|
|
2198
|
+
tooltip: 'Create',
|
|
2199
|
+
onClick: () => {
|
|
2200
|
+
this.api.gridApi.openCreateRowForm();
|
|
2201
|
+
},
|
|
2202
|
+
};
|
|
2203
|
+
}
|
|
2193
2204
|
if (buttonName === 'edit') {
|
|
2194
2205
|
// we need this dirty hack until ActionColumn support for custom icons is improved
|
|
2195
2206
|
const label = rowEditIcons_1.rowEditIcon;
|
|
@@ -2236,17 +2247,20 @@ class Adaptable {
|
|
|
2236
2247
|
return [];
|
|
2237
2248
|
}
|
|
2238
2249
|
const rowEditActionColumn = {
|
|
2239
|
-
columnId:
|
|
2250
|
+
columnId: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
2240
2251
|
actionColumnButton: editButtons,
|
|
2241
2252
|
};
|
|
2242
2253
|
return [
|
|
2243
2254
|
{
|
|
2244
2255
|
headerName: '',
|
|
2245
|
-
colId:
|
|
2256
|
+
colId: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
2246
2257
|
hide: false,
|
|
2247
2258
|
editable: false,
|
|
2248
2259
|
width: editButtons.length * 42,
|
|
2249
2260
|
resizable: false,
|
|
2261
|
+
lockVisible: true,
|
|
2262
|
+
suppressColumnsToolPanel: true,
|
|
2263
|
+
suppressFiltersToolPanel: true,
|
|
2250
2264
|
suppressMenu: true,
|
|
2251
2265
|
suppressMovable: true,
|
|
2252
2266
|
filter: false,
|
|
@@ -2260,7 +2274,7 @@ class Adaptable {
|
|
|
2260
2274
|
cellRendererParams: {
|
|
2261
2275
|
actionColumn: rowEditActionColumn,
|
|
2262
2276
|
},
|
|
2263
|
-
cellClass:
|
|
2277
|
+
cellClass: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
|
|
2264
2278
|
type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
2265
2279
|
},
|
|
2266
2280
|
];
|
|
@@ -2857,7 +2871,7 @@ class Adaptable {
|
|
|
2857
2871
|
if (this.isDestroyed) {
|
|
2858
2872
|
return true;
|
|
2859
2873
|
}
|
|
2860
|
-
const columnFilters = this.api.
|
|
2874
|
+
const columnFilters = this.api.filterApi.getColumnFilters();
|
|
2861
2875
|
const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(columnFilters);
|
|
2862
2876
|
const isQueryActive = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.api.queryApi.getCurrentQuery());
|
|
2863
2877
|
return (isFilterActive ||
|
|
@@ -2888,10 +2902,10 @@ class Adaptable {
|
|
|
2888
2902
|
try {
|
|
2889
2903
|
// we then assess filters (if running locally)
|
|
2890
2904
|
if (evaluateFilterOnClient) {
|
|
2891
|
-
const columnFilters = this.api.
|
|
2905
|
+
const columnFilters = this.api.filterApi.getColumnFilters();
|
|
2892
2906
|
if (columnFilters.length > 0) {
|
|
2893
2907
|
for (const columnFilter of columnFilters) {
|
|
2894
|
-
if (!this.api.
|
|
2908
|
+
if (!this.api.filterApi.evaluateColumnFilter(columnFilter, node)) {
|
|
2895
2909
|
return false;
|
|
2896
2910
|
}
|
|
2897
2911
|
}
|
|
@@ -2918,7 +2932,7 @@ class Adaptable {
|
|
|
2918
2932
|
this.prepareGrid();
|
|
2919
2933
|
}
|
|
2920
2934
|
updateColumnFilterActiveState() {
|
|
2921
|
-
const columnFilters = this.api.
|
|
2935
|
+
const columnFilters = this.api.filterApi.getColumnFilters();
|
|
2922
2936
|
const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(columnFilters);
|
|
2923
2937
|
const columnsWithActiveFilters = {};
|
|
2924
2938
|
if (isFilterActive) {
|
|
@@ -3947,7 +3961,7 @@ class Adaptable {
|
|
|
3947
3961
|
checkColumnsDataTypeSet() {
|
|
3948
3962
|
// check that we have no unknown columns - if we do then ok
|
|
3949
3963
|
const colDefs = this.api.columnApi.getColumns();
|
|
3950
|
-
if (colDefs.some((colDef) => colDef.dataType ===
|
|
3964
|
+
if (colDefs.some((colDef) => colDef.dataType === 'Unknown')) {
|
|
3951
3965
|
this.updateColumnsIntoStore();
|
|
3952
3966
|
}
|
|
3953
3967
|
}
|
|
@@ -4126,7 +4140,7 @@ class Adaptable {
|
|
|
4126
4140
|
themeClassNamesToRemove.forEach((cssClassName) => el.classList.remove(cssClassName));
|
|
4127
4141
|
// remove infinite table classnames
|
|
4128
4142
|
themesToRemove.forEach((theme) => {
|
|
4129
|
-
el.classList.remove(`
|
|
4143
|
+
el.classList.remove(`infinite-${theme.Name}`);
|
|
4130
4144
|
});
|
|
4131
4145
|
if (this.adaptableOptions.userInterfaceOptions &&
|
|
4132
4146
|
this.adaptableOptions.userInterfaceOptions.useCustomMacLikeScrollbars &&
|
|
@@ -4140,7 +4154,7 @@ class Adaptable {
|
|
|
4140
4154
|
const newThemeClassName = GeneralConstants.THEME_STYLE + themeName;
|
|
4141
4155
|
el.classList.add(newThemeClassName);
|
|
4142
4156
|
// add infinite table classname for theme
|
|
4143
|
-
el.classList.add(`
|
|
4157
|
+
el.classList.add(`infinite-${themeName}`);
|
|
4144
4158
|
const computedDocumentStyle = getComputedStyle(el);
|
|
4145
4159
|
const [abLoaded, abThemeLoaded] = ['--ab-loaded', '--ab-theme-loaded'].map((variable) => {
|
|
4146
4160
|
let val = computedDocumentStyle.getPropertyValue(variable);
|
|
@@ -15,8 +15,8 @@ exports.FilterWrapperFactory = (adaptable) => {
|
|
|
15
15
|
}
|
|
16
16
|
isFilterActive() {
|
|
17
17
|
//make the small filter icon to appear when there is a filter
|
|
18
|
-
return (adaptable.api.
|
|
19
|
-
.
|
|
18
|
+
return (adaptable.api.filterApi
|
|
19
|
+
.getColumnFilters()
|
|
20
20
|
.findIndex((x) => x.ColumnId == this.params.column.getColId()) > -1);
|
|
21
21
|
}
|
|
22
22
|
doesFilterPass(params) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ColDef, Column, GridOptions, ICellRendererFunc, SideBarDef, ToolPanelDef } from '@ag-grid-community/all-modules';
|
|
2
2
|
import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
|
|
3
|
-
import { AdaptableColumn, AdaptableColumnGroup } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
3
|
+
import { AdaptableColumn, AdaptableColumnDataType, AdaptableColumnGroup } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
4
|
import { AdaptableNodeComparerFunction } from '../PredefinedConfig/Common/AdaptableComparerFunction';
|
|
5
|
-
import { DataType } from '../PredefinedConfig/Common/Enums';
|
|
6
5
|
import { AdaptableColumnType, AdaptableModule } from '../PredefinedConfig/Common/Types';
|
|
7
6
|
import { IModule } from '../Strategy/Interface/IModule';
|
|
8
7
|
import { IPPStyle } from '../Utilities/Interface/IPPStyle';
|
|
@@ -47,7 +46,7 @@ export declare class agGridHelper {
|
|
|
47
46
|
private isColumnSparkline;
|
|
48
47
|
private getColumnDataType;
|
|
49
48
|
private getAbColDefValue;
|
|
50
|
-
getAgGridDataType(dataType:
|
|
49
|
+
getAgGridDataType(dataType: AdaptableColumnDataType): AdaptableColumnType;
|
|
51
50
|
checkShouldClearExistingFiltersOrSearches(): void;
|
|
52
51
|
runAdaptableGroupComparerFunction(): AdaptableNodeComparerFunction;
|
|
53
52
|
getCurrentIPPStyle(): IPPStyle;
|