@adaptabletools/adaptable 11.0.9 → 11.1.1-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 +19 -11
- package/bundle.cjs.js +125 -125
- package/index.css +23 -11
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -2
- package/src/AdaptableOptions/AlertOptions.d.ts +2 -2
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +2 -2
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
- package/src/Api/AlertApi.d.ts +5 -6
- package/src/Api/BulkUpdateApi.d.ts +5 -0
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/DataChangeHistoryApi.d.ts +3 -3
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/CellChanged.d.ts +2 -2
- package/src/Api/Events/GridDataChanged.d.ts +5 -1
- package/src/Api/ExportApi.d.ts +3 -3
- package/src/Api/FreeTextColumnApi.d.ts +3 -3
- package/src/Api/GridApi.d.ts +27 -6
- package/src/Api/Implementation/AlertApiImpl.d.ts +7 -4
- package/src/Api/Implementation/AlertApiImpl.js +86 -59
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +1 -0
- package/src/Api/Implementation/BulkUpdateApiImpl.js +4 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +7 -2
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +3 -3
- package/src/Api/Implementation/EventApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ExportApiImpl.js +7 -8
- package/src/Api/Implementation/FreeTextColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +7 -7
- package/src/Api/Implementation/GridApiImpl.d.ts +11 -3
- package/src/Api/Implementation/GridApiImpl.js +29 -8
- package/src/Api/Implementation/InternalApiImpl.d.ts +11 -4
- package/src/Api/Implementation/InternalApiImpl.js +41 -5
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -1
- package/src/Api/Implementation/LayoutApiImpl.js +19 -4
- package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
- package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
- package/src/Api/InternalApi.d.ts +10 -3
- package/src/Api/LayoutApi.d.ts +14 -3
- package/src/PredefinedConfig/AlertState.d.ts +7 -3
- package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +35 -6
- package/src/PredefinedConfig/Common/AdaptableAlert.js +7 -0
- package/src/PredefinedConfig/Common/AdaptableFlashingCell.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +20 -0
- package/src/PredefinedConfig/Common/{DataChangedInfo.d.ts → CellDataChangedInfo.d.ts} +2 -6
- package/src/PredefinedConfig/Common/{DataChangedInfo.js → CellDataChangedInfo.js} +0 -0
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/DataChangedScope.d.ts +4 -0
- package/src/PredefinedConfig/Common/DataChangedScope.js +2 -0
- package/src/PredefinedConfig/Common/Entitlement.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +3 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.js +2 -0
- package/src/PredefinedConfig/ConfigState.d.ts +4 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PopupState.d.ts +2 -1
- package/src/PredefinedConfig/SystemState.d.ts +2 -2
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
- package/src/Redux/ActionsReducers/GridRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
- package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +16 -5
- package/src/Redux/ActionsReducers/SystemRedux.js +37 -6
- package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
- package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
- package/src/Redux/Store/AdaptableStore.js +76 -34
- package/src/Strategy/AlertModule.d.ts +5 -3
- package/src/Strategy/AlertModule.js +68 -22
- package/src/Strategy/BulkUpdateModule.js +7 -2
- package/src/Strategy/DataChangeHistoryModule.js +8 -6
- package/src/Strategy/ExportModule.js +1 -0
- package/src/Strategy/FlashingCellModule.d.ts +2 -2
- package/src/Strategy/FlashingCellModule.js +21 -15
- package/src/Strategy/FormatColumnModule.js +4 -2
- package/src/Strategy/SmartEditModule.js +6 -0
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +6 -2
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +6 -3
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/Interface/MessagePopups.d.ts +13 -0
- package/src/Utilities/ObjectFactory.d.ts +9 -7
- package/src/Utilities/ObjectFactory.js +26 -12
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +3 -3
- package/src/Utilities/Services/DataService.d.ts +5 -5
- package/src/Utilities/Services/DataService.js +12 -10
- package/src/Utilities/Services/Interface/IAlertService.d.ts +2 -2
- package/src/Utilities/Services/Interface/IDataService.d.ts +6 -6
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/Interface/IValidationService.d.ts +4 -4
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/ValidationService.d.ts +4 -4
- package/src/Utilities/Services/ValidationService.js +18 -17
- package/src/View/AdaptableView.js +2 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +16 -9
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +13 -3
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -0
- package/src/View/Alert/Wizard/AlertWizard.js +83 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -2
- package/src/View/Components/FilterForm/FilterForm.js +2 -2
- package/src/View/Components/Panels/PanelFooter.d.ts +10 -0
- package/src/View/Components/Panels/PanelFooter.js +14 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +12 -7
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -1
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.d.ts → Utilities.d.ts} +4 -0
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.js → Utilities.js} +5 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +6 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +32 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +4 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +8 -0
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +2 -2
- package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +3 -0
- package/src/View/Layout/LayoutEditorStandalonePopup.js +76 -0
- package/src/View/Layout/LayoutPopup.js +3 -24
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -4
- package/src/View/Layout/LayoutViewPanel.js +5 -18
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.d.ts +9 -0
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +55 -0
- package/src/View/Layout/Wizard/LayoutEditor/index.js +3 -68
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +35 -7
- package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
- package/src/agGrid/Adaptable.d.ts +6 -4
- package/src/agGrid/Adaptable.js +115 -117
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +23 -8
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
- package/src/components/Dialog/index.js +1 -1
- package/src/components/Modal/index.js +1 -1
- package/src/components/WindowModal/WindowModal.d.ts +10 -8
- package/src/components/WindowModal/WindowModal.js +4 -2
- package/src/components/WindowModal/useStacking.d.ts +9 -0
- package/src/components/WindowModal/useStacking.js +45 -0
- package/src/env.js +3 -3
- package/src/metamodel/adaptable.metamodel.d.ts +85 -45
- package/src/metamodel/adaptable.metamodel.js +185 -84
- package/src/types.d.ts +5 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AdaptableNoCodeWizard = exports.Adaptable = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const all_modules_1 = require("@ag-grid-community/all-modules");
|
|
6
6
|
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
@@ -316,13 +316,6 @@ class Adaptable {
|
|
|
316
316
|
this.runtimeConfig = runtimeConfig || {};
|
|
317
317
|
this.agGridModules = this.runtimeConfig.modules || [];
|
|
318
318
|
this.gridOptions = this.adaptableOptions.gridOptions;
|
|
319
|
-
if (this.hasAutogeneratedPrimaryKey() && !this.gridOptions.getRowNodeId) {
|
|
320
|
-
this.gridOptions.getRowNodeId = (rowData) => {
|
|
321
|
-
var _a;
|
|
322
|
-
rowData[GeneralConstants_1.AUTOGENERATED_PK_COLUMN] = (_a = rowData[GeneralConstants_1.AUTOGENERATED_PK_COLUMN]) !== null && _a !== void 0 ? _a : Uuid_1.createUuid();
|
|
323
|
-
return rowData[GeneralConstants_1.AUTOGENERATED_PK_COLUMN];
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
319
|
if (this.gridOptions.allowContextMenuWithControlKey === undefined) {
|
|
327
320
|
this.gridOptions.allowContextMenuWithControlKey = true;
|
|
328
321
|
}
|
|
@@ -517,7 +510,7 @@ class Adaptable {
|
|
|
517
510
|
LoggingHelper_1.LogAdaptableInfo(`Initializing AgGrid...`);
|
|
518
511
|
// set up whether we use the getRowNode method or loop when finding a rowNode (former is preferable)
|
|
519
512
|
// can only do that here as the gridOptions not yet set up
|
|
520
|
-
this.useRowNodeLookUp = this.agGridHelper.TrySetUpNodeIds();
|
|
513
|
+
this.useRowNodeLookUp = this.agGridHelper.TrySetUpNodeIds(this.hasAutogeneratedPrimaryKey());
|
|
521
514
|
if (Array.isArray(this.gridOptions.columnDefs)) {
|
|
522
515
|
this.gridOptions.columnDefs.forEach(assignColId);
|
|
523
516
|
}
|
|
@@ -850,32 +843,10 @@ class Adaptable {
|
|
|
850
843
|
return style;
|
|
851
844
|
}
|
|
852
845
|
getActiveAlertWithHighlightCell(col, params) {
|
|
853
|
-
|
|
854
|
-
.getAdaptableAlerts()
|
|
855
|
-
.filter((alert) => {
|
|
856
|
-
var _a;
|
|
857
|
-
return ((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightCell) &&
|
|
858
|
-
alert.dataChangedInfo &&
|
|
859
|
-
alert.dataChangedInfo.column &&
|
|
860
|
-
alert.dataChangedInfo.column.columnId === col.columnId &&
|
|
861
|
-
alert.dataChangedInfo.rowNode === params.node;
|
|
862
|
-
});
|
|
863
|
-
if (!activeAlerts.length) {
|
|
864
|
-
return null;
|
|
865
|
-
}
|
|
866
|
-
return activeAlerts === null || activeAlerts === void 0 ? void 0 : activeAlerts[0];
|
|
846
|
+
return this.api.internalApi.getAdaptableAlertWithHighlightCell(col.columnId, params.node);
|
|
867
847
|
}
|
|
868
848
|
getActiveAlertWithHighlightRow(params) {
|
|
869
|
-
|
|
870
|
-
return (_a = this.api.internalApi
|
|
871
|
-
.getAdaptableAlerts()
|
|
872
|
-
.filter((alert) => {
|
|
873
|
-
var _a;
|
|
874
|
-
return ((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightRow) &&
|
|
875
|
-
alert.dataChangedInfo &&
|
|
876
|
-
alert.dataChangedInfo.column &&
|
|
877
|
-
alert.dataChangedInfo.rowNode === params.node;
|
|
878
|
-
})) === null || _a === void 0 ? void 0 : _a[0];
|
|
849
|
+
return this.api.internalApi.getAdaptableAlertWithHighlightRow(params.node);
|
|
879
850
|
}
|
|
880
851
|
getAlertCellStyle(col, params) {
|
|
881
852
|
const alert = this.getActiveAlertWithHighlightCell(col, params);
|
|
@@ -1062,12 +1033,15 @@ class Adaptable {
|
|
|
1062
1033
|
}
|
|
1063
1034
|
getPrimaryKeyValueFromRowNode(rowNode) {
|
|
1064
1035
|
var _a;
|
|
1036
|
+
if (!rowNode) {
|
|
1037
|
+
return null;
|
|
1038
|
+
}
|
|
1065
1039
|
let gridApi = this.getGridOptionsApi();
|
|
1066
1040
|
let result;
|
|
1067
1041
|
if (gridApi && !this.hasAutogeneratedPrimaryKey()) {
|
|
1068
1042
|
result = gridApi.getValue(this.adaptableOptions.primaryKey, rowNode);
|
|
1069
1043
|
}
|
|
1070
|
-
if ((result === null || result == undefined) && rowNode
|
|
1044
|
+
if ((result === null || result == undefined) && rowNode.data) {
|
|
1071
1045
|
result = (_a = rowNode.data[this.adaptableOptions.primaryKey]) !== null && _a !== void 0 ? _a : null;
|
|
1072
1046
|
}
|
|
1073
1047
|
return result;
|
|
@@ -1282,10 +1256,13 @@ class Adaptable {
|
|
|
1282
1256
|
shouldUpdateHeaders = this.setupColumnHeader(colSetupInfo) || shouldUpdateHeaders;
|
|
1283
1257
|
});
|
|
1284
1258
|
isChanged = isChanged || shouldUpdateHeaders;
|
|
1285
|
-
if (
|
|
1286
|
-
|
|
1259
|
+
if (this.api.layoutApi.areExpandedRowGroupsSavedInLayouts() &&
|
|
1260
|
+
ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(layout.ExpandedRowGroupValues)) {
|
|
1287
1261
|
this.expandRowGroupsForValues(layout.ExpandedRowGroupValues);
|
|
1288
1262
|
}
|
|
1263
|
+
if (this.adaptableOptions.layoutOptions.displayRowGroups === 'expanded') {
|
|
1264
|
+
this.expandAllRowGroups();
|
|
1265
|
+
}
|
|
1289
1266
|
if (isChanged) {
|
|
1290
1267
|
// it's important we set pivot mode
|
|
1291
1268
|
// before we set column state
|
|
@@ -1404,7 +1381,7 @@ class Adaptable {
|
|
|
1404
1381
|
}
|
|
1405
1382
|
layout.EnablePivot = this.gridOptions.columnApi.isPivotMode();
|
|
1406
1383
|
layout.PivotColumns = pivotColumns;
|
|
1407
|
-
if (this.
|
|
1384
|
+
if (this.api.layoutApi.areExpandedRowGroupsSavedInLayouts()) {
|
|
1408
1385
|
layout.ExpandedRowGroupValues = this.getExpandRowGroupsKeys();
|
|
1409
1386
|
}
|
|
1410
1387
|
// this.api.layoutApi.fireLayoutUpdatedEvent(layout, 'UpdatedLayout');
|
|
@@ -1506,25 +1483,27 @@ class Adaptable {
|
|
|
1506
1483
|
this.agGridHelper.fireSelectionChangedEvent();
|
|
1507
1484
|
return selectedRowInfo;
|
|
1508
1485
|
}
|
|
1509
|
-
setValue(
|
|
1486
|
+
setValue(cellDataChangedInfo) {
|
|
1510
1487
|
// note: because we use RowNode.setDataValue() this will cause Validation to fire
|
|
1511
1488
|
// see https://www.ag-grid.com/javascript-data-grid/change-detection/#triggering-value-change-detection
|
|
1512
1489
|
let newValue;
|
|
1513
|
-
let dataType =
|
|
1490
|
+
let dataType = cellDataChangedInfo.column.dataType;
|
|
1514
1491
|
newValue =
|
|
1515
|
-
dataType == Enums_1.DataType.Number
|
|
1492
|
+
dataType == Enums_1.DataType.Number
|
|
1493
|
+
? Number(cellDataChangedInfo.newValue)
|
|
1494
|
+
: cellDataChangedInfo.newValue;
|
|
1516
1495
|
if (dataType == undefined) {
|
|
1517
1496
|
return; // no point continuing as probably a wrong column
|
|
1518
1497
|
}
|
|
1519
|
-
if (
|
|
1520
|
-
|
|
1498
|
+
if (cellDataChangedInfo.rowNode) {
|
|
1499
|
+
cellDataChangedInfo.rowNode.setDataValue(cellDataChangedInfo.column.columnId, newValue);
|
|
1521
1500
|
}
|
|
1522
1501
|
else {
|
|
1523
1502
|
if (this.useRowNodeLookUp) {
|
|
1524
|
-
const rowNode = this.gridOptions.api.getRowNode(
|
|
1503
|
+
const rowNode = this.gridOptions.api.getRowNode(cellDataChangedInfo.primaryKeyValue);
|
|
1525
1504
|
if (rowNode != null) {
|
|
1526
|
-
rowNode.setDataValue(
|
|
1527
|
-
|
|
1505
|
+
rowNode.setDataValue(cellDataChangedInfo.column.columnId, newValue);
|
|
1506
|
+
cellDataChangedInfo.rowNode = rowNode;
|
|
1528
1507
|
}
|
|
1529
1508
|
}
|
|
1530
1509
|
else {
|
|
@@ -1532,9 +1511,9 @@ class Adaptable {
|
|
|
1532
1511
|
// prefer not to use this method but if we do then at least we can prevent further lookups once we find
|
|
1533
1512
|
this.gridOptions.api.getModel().forEachNode((rowNode) => {
|
|
1534
1513
|
if (!isUpdated) {
|
|
1535
|
-
if (
|
|
1536
|
-
rowNode.setDataValue(
|
|
1537
|
-
|
|
1514
|
+
if (cellDataChangedInfo.primaryKeyValue == this.getPrimaryKeyValueFromRowNode(rowNode)) {
|
|
1515
|
+
rowNode.setDataValue(cellDataChangedInfo.column.columnId, newValue);
|
|
1516
|
+
cellDataChangedInfo.rowNode = rowNode;
|
|
1538
1517
|
isUpdated = true;
|
|
1539
1518
|
}
|
|
1540
1519
|
}
|
|
@@ -1895,6 +1874,9 @@ class Adaptable {
|
|
|
1895
1874
|
});
|
|
1896
1875
|
return rowNodes;
|
|
1897
1876
|
}
|
|
1877
|
+
getRowsInViewport() {
|
|
1878
|
+
return this.gridOptions.api.getRenderedNodes();
|
|
1879
|
+
}
|
|
1898
1880
|
selectNodes(rowNodes, clearSelection) {
|
|
1899
1881
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(rowNodes)) {
|
|
1900
1882
|
rowNodes.forEach((node) => this.selectNode(node, clearSelection));
|
|
@@ -1945,19 +1927,17 @@ class Adaptable {
|
|
|
1945
1927
|
this.gridOptions.api.refreshHeader();
|
|
1946
1928
|
}
|
|
1947
1929
|
redrawRow(rowNode) {
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
// return;
|
|
1952
|
-
// }
|
|
1930
|
+
this.redrawRows([rowNode]);
|
|
1931
|
+
}
|
|
1932
|
+
redrawRows(rowNodes) {
|
|
1953
1933
|
const redrawRowsParams = {
|
|
1954
|
-
rowNodes
|
|
1934
|
+
rowNodes,
|
|
1955
1935
|
};
|
|
1956
1936
|
try {
|
|
1957
1937
|
this.gridOptions.api.redrawRows(redrawRowsParams);
|
|
1958
1938
|
}
|
|
1959
1939
|
catch (ex) {
|
|
1960
|
-
LoggingHelper_1.ConsoleLogError('ag-grid redrawRows was unable to find some row nodes. Tried to redraw row
|
|
1940
|
+
LoggingHelper_1.ConsoleLogError('ag-grid redrawRows was unable to find some row nodes. Tried to redraw row nodes: ', rowNodes, ex);
|
|
1961
1941
|
}
|
|
1962
1942
|
}
|
|
1963
1943
|
refreshCells(rowNodes, columns, forceUpdate, suppressFlash = false) {
|
|
@@ -2589,26 +2569,22 @@ class Adaptable {
|
|
|
2589
2569
|
this.gridOptions.isExternalFilterPresent = () => {
|
|
2590
2570
|
const columnFilters = this.api.filterApi.getAllColumnFilter();
|
|
2591
2571
|
const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(columnFilters);
|
|
2592
|
-
if (isFilterActive) {
|
|
2593
|
-
// used in particular at init time to show the filter icon correctly
|
|
2594
|
-
for (const colFilter of columnFilters) {
|
|
2595
|
-
const agGridCol = this.gridOptions.columnApi.getColumn(colFilter.ColumnId);
|
|
2596
|
-
if (agGridCol && !agGridCol.isFilterActive()) {
|
|
2597
|
-
agGridCol.setFilterActive(true);
|
|
2598
|
-
}
|
|
2599
|
-
}
|
|
2600
|
-
}
|
|
2601
|
-
else {
|
|
2602
|
-
(this.gridOptions.columnApi.getAllColumns() || []).forEach((col) => {
|
|
2603
|
-
if (col.isFilterActive()) {
|
|
2604
|
-
col.setFilterActive(false);
|
|
2605
|
-
}
|
|
2606
|
-
});
|
|
2607
|
-
}
|
|
2608
2572
|
const isQueryActive = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.api.queryApi.getCurrentQuery());
|
|
2609
|
-
|
|
2573
|
+
/**
|
|
2574
|
+
* Changing the column filterState sync breaks the rendering of the custom filter component.
|
|
2575
|
+
* I think that changing the column definition while ag-grid determines if a column is filtered
|
|
2576
|
+
* breaks the logic of the custom component.
|
|
2577
|
+
*
|
|
2578
|
+
* Result:
|
|
2579
|
+
* - custom filters in sate
|
|
2580
|
+
* - refresh page, the ag-grid filter is rendered instead of adaptable custom-filter-component.
|
|
2581
|
+
*/
|
|
2582
|
+
requestAnimationFrame(() => {
|
|
2583
|
+
this.updateColumnFilterActiveState();
|
|
2584
|
+
});
|
|
2610
2585
|
return (isFilterActive ||
|
|
2611
2586
|
isQueryActive ||
|
|
2587
|
+
// it means that originaldoesExternalFilterPass will be called so we reinit that collection
|
|
2612
2588
|
(originalisExternalFilterPresent ? originalisExternalFilterPresent() : false));
|
|
2613
2589
|
};
|
|
2614
2590
|
const originaldoesExternalFilterPass = this.gridOptions.doesExternalFilterPass;
|
|
@@ -2660,6 +2636,26 @@ class Adaptable {
|
|
|
2660
2636
|
};
|
|
2661
2637
|
this.prepareGrid();
|
|
2662
2638
|
}
|
|
2639
|
+
updateColumnFilterActiveState() {
|
|
2640
|
+
const columnFilters = this.api.filterApi.getAllColumnFilter();
|
|
2641
|
+
const isFilterActive = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(columnFilters);
|
|
2642
|
+
if (isFilterActive) {
|
|
2643
|
+
// used in particular at init time to show the filter icon correctly
|
|
2644
|
+
for (const colFilter of columnFilters) {
|
|
2645
|
+
const agGridCol = this.gridOptions.columnApi.getColumn(colFilter.ColumnId);
|
|
2646
|
+
if (agGridCol && !agGridCol.isFilterActive()) {
|
|
2647
|
+
agGridCol.setFilterActive(true);
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
else {
|
|
2652
|
+
(this.gridOptions.columnApi.getAllColumns() || []).forEach((col) => {
|
|
2653
|
+
if (col.isFilterActive()) {
|
|
2654
|
+
col.setFilterActive(false);
|
|
2655
|
+
}
|
|
2656
|
+
});
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2663
2659
|
buildStandaloneColumnHeader(adaptableColumn) {
|
|
2664
2660
|
return this.agGridMenuHelper.buildStandaloneColumnHeader(adaptableColumn);
|
|
2665
2661
|
}
|
|
@@ -2869,6 +2865,7 @@ class Adaptable {
|
|
|
2869
2865
|
setupColumnCellEditor({ colId, col }) {
|
|
2870
2866
|
const adaptableColumn = this.api.columnApi.getColumnFromId(colId);
|
|
2871
2867
|
const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
2868
|
+
const hasRichSelectCellEditor = this.isModulePresent('rich-select');
|
|
2872
2869
|
this.setColDefProperty(col, 'cellEditor', () => {
|
|
2873
2870
|
var _a;
|
|
2874
2871
|
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(adaptableColumn);
|
|
@@ -2876,9 +2873,14 @@ class Adaptable {
|
|
|
2876
2873
|
return CheckboxRenderer_1.CheckboxEditor;
|
|
2877
2874
|
}
|
|
2878
2875
|
if (editLookUpItem) {
|
|
2879
|
-
return
|
|
2880
|
-
|
|
2881
|
-
|
|
2876
|
+
return hasRichSelectCellEditor ? 'agRichSelectCellEditor' : 'agSelectCellEditor';
|
|
2877
|
+
}
|
|
2878
|
+
});
|
|
2879
|
+
this.setColDefProperty(col, 'cellEditorPopup', () => {
|
|
2880
|
+
// as specified in https://www.ag-grid.com/react-data-grid/provided-cell-editors/#rich-select-cell-editor
|
|
2881
|
+
// agRichSelectCellEditor should always set cellEditorPopup=true. Otherwise the editor will be clipped to the cell contents
|
|
2882
|
+
if (editLookUpItem && hasRichSelectCellEditor) {
|
|
2883
|
+
return true;
|
|
2882
2884
|
}
|
|
2883
2885
|
});
|
|
2884
2886
|
this.setColDefProperty(col, 'cellEditorParams', (params) => {
|
|
@@ -3091,7 +3093,7 @@ class Adaptable {
|
|
|
3091
3093
|
}
|
|
3092
3094
|
return true;
|
|
3093
3095
|
}
|
|
3094
|
-
const
|
|
3096
|
+
const cellDataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3095
3097
|
oldValue: params.oldValue,
|
|
3096
3098
|
newValue: params.newValue,
|
|
3097
3099
|
column: this.api.columnApi.getColumnFromId(params.column.getColId()),
|
|
@@ -3099,15 +3101,15 @@ class Adaptable {
|
|
|
3099
3101
|
rowNode: params.node,
|
|
3100
3102
|
trigger: 'edit',
|
|
3101
3103
|
});
|
|
3102
|
-
if (
|
|
3104
|
+
if (cellDataChangedInfo.oldValue === cellDataChangedInfo.newValue) {
|
|
3103
3105
|
return true;
|
|
3104
3106
|
}
|
|
3105
|
-
if (!this.ValidationService.performValidation(
|
|
3107
|
+
if (!this.ValidationService.performValidation(cellDataChangedInfo)) {
|
|
3106
3108
|
return false;
|
|
3107
3109
|
}
|
|
3108
3110
|
const onServerValidationCompleted = () => { };
|
|
3109
3111
|
if ((_a = this.adaptableOptions.editOptions) === null || _a === void 0 ? void 0 : _a.validateOnServer) {
|
|
3110
|
-
this.ValidationService.performServerValidation(
|
|
3112
|
+
this.ValidationService.performServerValidation(cellDataChangedInfo, {
|
|
3111
3113
|
onServerValidationCompleted,
|
|
3112
3114
|
})();
|
|
3113
3115
|
}
|
|
@@ -3176,13 +3178,13 @@ class Adaptable {
|
|
|
3176
3178
|
return;
|
|
3177
3179
|
}
|
|
3178
3180
|
// rowNode = this.getRowNodeForPrimaryKey(primaryKeyValue);
|
|
3179
|
-
let
|
|
3181
|
+
let cellDataChangedInfos = [];
|
|
3180
3182
|
Object.keys(oldData).forEach((key) => {
|
|
3181
3183
|
if (this.api.columnApi.doesColumnExist(key)) {
|
|
3182
3184
|
const oldValue = oldData[key];
|
|
3183
3185
|
const newValue = newData[key];
|
|
3184
3186
|
if (oldValue != newValue) {
|
|
3185
|
-
const
|
|
3187
|
+
const cellDataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3186
3188
|
oldValue: oldValue,
|
|
3187
3189
|
newValue: newValue,
|
|
3188
3190
|
column: this.api.columnApi.getColumnFromId(key),
|
|
@@ -3190,14 +3192,14 @@ class Adaptable {
|
|
|
3190
3192
|
rowNode: rowNode,
|
|
3191
3193
|
trigger: 'tick',
|
|
3192
3194
|
});
|
|
3193
|
-
if (this.isUndoChange(
|
|
3194
|
-
|
|
3195
|
+
if (this.isUndoChange(cellDataChangedInfo)) {
|
|
3196
|
+
cellDataChangedInfo.trigger = 'undo';
|
|
3195
3197
|
}
|
|
3196
|
-
|
|
3198
|
+
cellDataChangedInfos.push(cellDataChangedInfo);
|
|
3197
3199
|
}
|
|
3198
3200
|
}
|
|
3199
3201
|
});
|
|
3200
|
-
this.performPostEditChecks(
|
|
3202
|
+
this.performPostEditChecks(cellDataChangedInfos);
|
|
3201
3203
|
}
|
|
3202
3204
|
onCellDataChanged({ rowNode, oldValue, newValue, colId, }) {
|
|
3203
3205
|
if (oldValue == newValue) {
|
|
@@ -3208,7 +3210,7 @@ class Adaptable {
|
|
|
3208
3210
|
return;
|
|
3209
3211
|
}
|
|
3210
3212
|
if (this.isGroupRowNode(rowNode)) {
|
|
3211
|
-
const
|
|
3213
|
+
const cellDataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3212
3214
|
oldValue: oldValue,
|
|
3213
3215
|
newValue: newValue,
|
|
3214
3216
|
column: abColumn,
|
|
@@ -3220,14 +3222,14 @@ class Adaptable {
|
|
|
3220
3222
|
rowNode: rowNode,
|
|
3221
3223
|
trigger: 'aggChange',
|
|
3222
3224
|
});
|
|
3223
|
-
this.DataService.CreateDataChangedEvent(
|
|
3225
|
+
this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
|
|
3224
3226
|
return;
|
|
3225
3227
|
}
|
|
3226
3228
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(rowNode);
|
|
3227
3229
|
if (!primaryKeyValue) {
|
|
3228
3230
|
return;
|
|
3229
3231
|
}
|
|
3230
|
-
const
|
|
3232
|
+
const cellDataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3231
3233
|
oldValue: oldValue,
|
|
3232
3234
|
newValue: newValue,
|
|
3233
3235
|
column: abColumn,
|
|
@@ -3235,10 +3237,10 @@ class Adaptable {
|
|
|
3235
3237
|
rowNode: rowNode,
|
|
3236
3238
|
trigger: 'edit',
|
|
3237
3239
|
});
|
|
3238
|
-
if (this.isUndoChange(
|
|
3239
|
-
|
|
3240
|
+
if (this.isUndoChange(cellDataChangedInfo)) {
|
|
3241
|
+
cellDataChangedInfo.trigger = 'undo';
|
|
3240
3242
|
}
|
|
3241
|
-
this.performPostEditChecks([
|
|
3243
|
+
this.performPostEditChecks([cellDataChangedInfo]);
|
|
3242
3244
|
}
|
|
3243
3245
|
isUndoChange(dataChange) {
|
|
3244
3246
|
// check if this is not a reverted change
|
|
@@ -3248,20 +3250,20 @@ class Adaptable {
|
|
|
3248
3250
|
/**
|
|
3249
3251
|
* There are a few things that we need to do AFTER we edit a cell and it makes sense to put them in one place
|
|
3250
3252
|
*/
|
|
3251
|
-
performPostEditChecks(
|
|
3252
|
-
const firstInfo =
|
|
3253
|
+
performPostEditChecks(cellDataChangedInfos) {
|
|
3254
|
+
const firstInfo = cellDataChangedInfos[0];
|
|
3253
3255
|
if (!firstInfo || !firstInfo.rowNode) {
|
|
3254
3256
|
return;
|
|
3255
3257
|
}
|
|
3256
|
-
|
|
3257
|
-
if (
|
|
3258
|
-
LoggingHelper_1.LogAdaptableInfo(`Undo data change: PK(${
|
|
3258
|
+
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3259
|
+
if (cellDataChangedInfo.trigger === 'undo') {
|
|
3260
|
+
LoggingHelper_1.LogAdaptableInfo(`Undo data change: PK(${cellDataChangedInfo.primaryKeyValue}) Col(${cellDataChangedInfo.column}) RevertedValue(${cellDataChangedInfo.oldValue}) OriginalValue(${cellDataChangedInfo.newValue})`);
|
|
3259
3261
|
}
|
|
3260
|
-
if (
|
|
3261
|
-
this.checkChangedCellCurrentlySelected(
|
|
3262
|
-
this.api.freeTextColumnApi.checkFreeTextColumnForDataChange(
|
|
3262
|
+
if (cellDataChangedInfo.trigger === 'edit' || cellDataChangedInfo.trigger === 'undo') {
|
|
3263
|
+
this.checkChangedCellCurrentlySelected(cellDataChangedInfo);
|
|
3264
|
+
this.api.freeTextColumnApi.checkFreeTextColumnForDataChange(cellDataChangedInfo);
|
|
3263
3265
|
}
|
|
3264
|
-
this.DataService.CreateDataChangedEvent(
|
|
3266
|
+
this.DataService.CreateDataChangedEvent(cellDataChangedInfo);
|
|
3265
3267
|
});
|
|
3266
3268
|
// if node is visible then check if need to refresh other columns / whole row if the updating column is:
|
|
3267
3269
|
// 1. referenced in Conditional Styles that have Expressions (refreshing whole row if Scope is All)
|
|
@@ -3271,12 +3273,12 @@ class Adaptable {
|
|
|
3271
3273
|
wholeRow: false,
|
|
3272
3274
|
columnIds: new Set(),
|
|
3273
3275
|
};
|
|
3274
|
-
this.getExpressionStylesChanges(dataChangedScope,
|
|
3276
|
+
this.getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos);
|
|
3275
3277
|
if (dataChangedScope.wholeRow) {
|
|
3276
3278
|
this.redrawRow(firstInfo.rowNode);
|
|
3277
3279
|
}
|
|
3278
3280
|
else {
|
|
3279
|
-
this.getFormatColumnComparisonChanges(dataChangedScope,
|
|
3281
|
+
this.getFormatColumnComparisonChanges(dataChangedScope, cellDataChangedInfos);
|
|
3280
3282
|
if (dataChangedScope.columnIds.size > 0) {
|
|
3281
3283
|
this.refreshCells([firstInfo.rowNode], Array.from(dataChangedScope.columnIds.values()), true);
|
|
3282
3284
|
}
|
|
@@ -3284,17 +3286,17 @@ class Adaptable {
|
|
|
3284
3286
|
}
|
|
3285
3287
|
firstInfo.trigger == 'tick' ? this.filterOnTickingDataChange() : this.filterOnEditDataChange();
|
|
3286
3288
|
}
|
|
3287
|
-
getExpressionStylesChanges(dataChangedScope,
|
|
3289
|
+
getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3288
3290
|
const stylesWithExpression = this.api.conditionalStyleApi.getConditionalStylesWithExpression();
|
|
3289
3291
|
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(stylesWithExpression)) {
|
|
3290
3292
|
return;
|
|
3291
3293
|
}
|
|
3292
|
-
|
|
3294
|
+
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3293
3295
|
if (!dataChangedScope.wholeRow) {
|
|
3294
3296
|
stylesWithExpression.forEach((conditionalStyle) => {
|
|
3295
3297
|
if (!dataChangedScope.wholeRow) {
|
|
3296
3298
|
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(conditionalStyle.Rule.BooleanExpression);
|
|
3297
|
-
if (columnIds.includes(
|
|
3299
|
+
if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
3298
3300
|
if (this.api.scopeApi.scopeIsAll(conditionalStyle.Scope)) {
|
|
3299
3301
|
dataChangedScope.wholeRow = true;
|
|
3300
3302
|
return;
|
|
@@ -3313,14 +3315,14 @@ class Adaptable {
|
|
|
3313
3315
|
}
|
|
3314
3316
|
});
|
|
3315
3317
|
}
|
|
3316
|
-
getFormatColumnComparisonChanges(dataChangedScope,
|
|
3318
|
+
getFormatColumnComparisonChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3317
3319
|
this.api.formatColumnApi.getAllFormatColumn().forEach((fc) => {
|
|
3318
3320
|
let columnComparision = this.api.formatColumnApi.getColumnComparisonForFormatColumn(fc);
|
|
3319
3321
|
if (columnComparision) {
|
|
3320
3322
|
let affectedColumnIds = this.api.formatColumnApi.getColumnIdsFromColumnComparison(columnComparision);
|
|
3321
3323
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(affectedColumnIds)) {
|
|
3322
|
-
|
|
3323
|
-
if (affectedColumnIds.includes(
|
|
3324
|
+
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3325
|
+
if (affectedColumnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
3324
3326
|
this.api.scopeApi
|
|
3325
3327
|
.getColumnsForScope(fc.Scope)
|
|
3326
3328
|
.map((c) => c.columnId)
|
|
@@ -3333,18 +3335,18 @@ class Adaptable {
|
|
|
3333
3335
|
}
|
|
3334
3336
|
});
|
|
3335
3337
|
}
|
|
3336
|
-
checkChangedCellCurrentlySelected(
|
|
3338
|
+
checkChangedCellCurrentlySelected(cellDataChangedInfo) {
|
|
3337
3339
|
let selectedCellInfo = this.api.gridApi.getSelectedCellInfo();
|
|
3338
3340
|
if (selectedCellInfo && ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(selectedCellInfo.gridCells)) {
|
|
3339
|
-
let matchingCell = selectedCellInfo.gridCells.find((gc) => gc.primaryKeyValue ==
|
|
3340
|
-
gc.column ==
|
|
3341
|
+
let matchingCell = selectedCellInfo.gridCells.find((gc) => gc.primaryKeyValue == cellDataChangedInfo.primaryKeyValue &&
|
|
3342
|
+
gc.column == cellDataChangedInfo.column);
|
|
3341
3343
|
if (matchingCell) {
|
|
3342
3344
|
this.setSelectedCells();
|
|
3343
3345
|
}
|
|
3344
3346
|
}
|
|
3345
3347
|
let selectedRowInfo = this.api.gridApi.getSelectedRowInfo();
|
|
3346
3348
|
if (selectedRowInfo && ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(selectedRowInfo.gridRows)) {
|
|
3347
|
-
let matchingRow = selectedRowInfo.gridRows.find((gr) => gr.primaryKeyValue ==
|
|
3349
|
+
let matchingRow = selectedRowInfo.gridRows.find((gr) => gr.primaryKeyValue == cellDataChangedInfo.primaryKeyValue);
|
|
3348
3350
|
if (matchingRow) {
|
|
3349
3351
|
this.setSelectedRows();
|
|
3350
3352
|
}
|
|
@@ -3429,7 +3431,7 @@ class Adaptable {
|
|
|
3429
3431
|
}
|
|
3430
3432
|
getExpandRowGroupsKeys() {
|
|
3431
3433
|
let returnValues = [];
|
|
3432
|
-
if (this.
|
|
3434
|
+
if (this.api.layoutApi.areExpandedRowGroupsSavedInLayouts()) {
|
|
3433
3435
|
this.gridOptions.api.forEachNode((node) => {
|
|
3434
3436
|
if (node.group && node.expanded) {
|
|
3435
3437
|
let current = node;
|
|
@@ -4307,7 +4309,3 @@ class AdaptableNoCodeWizard {
|
|
|
4307
4309
|
}
|
|
4308
4310
|
}
|
|
4309
4311
|
exports.AdaptableNoCodeWizard = AdaptableNoCodeWizard;
|
|
4310
|
-
exports.bindAdaptableAgGrid = (gridReadyEvent, gridOptions) => {
|
|
4311
|
-
gridOptions.api = gridReadyEvent.api;
|
|
4312
|
-
gridOptions.columnApi = gridReadyEvent.columnApi;
|
|
4313
|
-
};
|
|
@@ -20,7 +20,7 @@ export declare class agGridHelper {
|
|
|
20
20
|
getAgGridLightThemeName(): string;
|
|
21
21
|
getAgGridDarkThemeName(): string;
|
|
22
22
|
setUpModules(): Map<AdaptableModule, IModule>;
|
|
23
|
-
TrySetUpNodeIds(): boolean;
|
|
23
|
+
TrySetUpNodeIds(hasAutogeneratedPrimaryKey: boolean): boolean;
|
|
24
24
|
createCheckboxRendererComp(columnId: string, isColumnReadOnly: boolean): ICellRendererFunc | undefined;
|
|
25
25
|
createPercentBarRendererComp(formatColumn: FormatColumn): ICellRendererFunc;
|
|
26
26
|
getCleanValue(value: string): string | undefined;
|
|
@@ -39,6 +39,7 @@ const FlashingCellModule_1 = require("../Strategy/FlashingCellModule");
|
|
|
39
39
|
const SettingsPanelModule_1 = require("../Strategy/SettingsPanelModule");
|
|
40
40
|
const ChartingModule_1 = require("../Strategy/ChartingModule");
|
|
41
41
|
const PercentBarRenderer_1 = require("./PercentBarRenderer");
|
|
42
|
+
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
42
43
|
const tinycolor = require('tinycolor2');
|
|
43
44
|
/**
|
|
44
45
|
* Adaptable AG Grid implementation is getting really big and unwieldy
|
|
@@ -99,21 +100,35 @@ class agGridHelper {
|
|
|
99
100
|
modules.set(ModuleConstants.ChartingModuleId, new ChartingModule_1.ChartingModule(api));
|
|
100
101
|
return modules;
|
|
101
102
|
}
|
|
102
|
-
TrySetUpNodeIds() {
|
|
103
|
+
TrySetUpNodeIds(hasAutogeneratedPrimaryKey) {
|
|
103
104
|
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(this.adaptable.adaptableOptions.primaryKey)) {
|
|
104
105
|
// if no valid pk then always false
|
|
105
106
|
return false;
|
|
106
107
|
}
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
if (Helper_1.Helper.objectExists(this.gridOptions.getRowNodeId) ||
|
|
109
|
+
Helper_1.Helper.objectExists(this.gridOptions.getRowId)) {
|
|
110
|
+
// if the user provided a getRowNodeId/getRowId then we don't need to do anything
|
|
111
|
+
// Note: starting with 27.1.0 'getRowNodeId' method is deprecated and will be removed in future versions
|
|
109
112
|
return true;
|
|
110
113
|
}
|
|
111
|
-
// also we can check if they have done it
|
|
112
114
|
const primaryKey = this.adaptable.adaptableOptions.primaryKey;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
if (hasAutogeneratedPrimaryKey) {
|
|
116
|
+
this.gridOptions.getRowId = (params) => {
|
|
117
|
+
// if the PK value is autogenerated, we need to make sure that the rowData has a valid PK value
|
|
118
|
+
// this should be taken care of in the Adaptable.[loadDataSource/setDataSource/updateRows]() methods, but the users will always make silly decisions
|
|
119
|
+
// so just to be safe we'll check here and add a PK value is missing
|
|
120
|
+
// thus adding a side-effect in a getter, but what can we do against it?! :)
|
|
121
|
+
if (Helper_1.Helper.objectNotExists(params.data[primaryKey])) {
|
|
122
|
+
params.data[primaryKey] = Uuid_1.createUuid();
|
|
123
|
+
}
|
|
124
|
+
return params.data[primaryKey];
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.gridOptions.getRowId = (params) => {
|
|
129
|
+
return params.data[primaryKey];
|
|
130
|
+
};
|
|
131
|
+
}
|
|
117
132
|
return true;
|
|
118
133
|
}
|
|
119
134
|
createCheckboxRendererComp(columnId, isColumnReadOnly) {
|
|
@@ -117,7 +117,7 @@ class AdaptableDateEditor {
|
|
|
117
117
|
react_dom_1.unmountComponentAtNode(this.el);
|
|
118
118
|
}
|
|
119
119
|
shouldClearExistingValue(params) {
|
|
120
|
-
return params.
|
|
120
|
+
return params.eventKey === all_modules_1.KeyCode.BACKSPACE || params.eventKey === all_modules_1.KeyCode.DELETE;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
exports.AdaptableDateEditor = AdaptableDateEditor;
|
|
@@ -93,7 +93,7 @@ class AdaptableNumberEditor {
|
|
|
93
93
|
react_dom_1.unmountComponentAtNode(this.el);
|
|
94
94
|
}
|
|
95
95
|
shouldClearExistingValue(params) {
|
|
96
|
-
return params.
|
|
96
|
+
return params.eventKey === all_modules_1.KeyCode.BACKSPACE || params.eventKey === all_modules_1.KeyCode.DELETE;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
exports.AdaptableNumberEditor = AdaptableNumberEditor;
|
|
@@ -105,7 +105,7 @@ exports.Dialog = React.forwardRef((props, ref) => {
|
|
|
105
105
|
e.nativeEvent.preventDialogDismiss = true;
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
const box = (React.createElement(rebass_1.Box, Object.assign({
|
|
108
|
+
const box = (React.createElement(rebass_1.Box, Object.assign({}, boxProps, { onClick: (e) => {
|
|
109
109
|
setPreventDismissFlag(e);
|
|
110
110
|
if (boxProps && boxProps.onClick) {
|
|
111
111
|
boxProps.onClick(e);
|
|
@@ -32,7 +32,7 @@ exports.Modal = (props) => {
|
|
|
32
32
|
const counter = react_1.useMemo(() => globalCounter++, [isOpen]);
|
|
33
33
|
const openTimestamp = counter;
|
|
34
34
|
const backdropZIndexOffset = props.backdropZIndexOffset || 1;
|
|
35
|
-
const zIndex = (props.baseZIndex ||
|
|
35
|
+
const zIndex = (props.baseZIndex || 2000) + counter;
|
|
36
36
|
return react_dom_1.createPortal(isOpen ? (React.createElement(React.Fragment, null,
|
|
37
37
|
React.createElement(Backdrop_1.default, { timestamp: openTimestamp, uuid: uuid, zIndex: zIndex - backdropZIndexOffset, onBringToFront: onBringToFront }),
|
|
38
38
|
React.createElement(react_remove_scroll_1.RemoveScroll, null,
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
export declare type WindowModalSize = {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
export declare type WindowModalPosition = {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
2
10
|
export interface WindowModalProps {
|
|
3
11
|
handleSelector: string;
|
|
4
|
-
size:
|
|
5
|
-
|
|
6
|
-
height: number;
|
|
7
|
-
};
|
|
8
|
-
position?: {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
};
|
|
12
|
+
size: WindowModalSize;
|
|
13
|
+
position?: WindowModalPosition;
|
|
12
14
|
onChange: (settings: {
|
|
13
15
|
size: {
|
|
14
16
|
width: number;
|