(leaf, changedGroupedSelectedCells, selectedRowId, forceRemove)
| 3475 | ); |
| 3476 | const tree = mapNew(); |
| 3477 | const writeGroupRow = (leaf, changedGroupedSelectedCells, selectedRowId, forceRemove) => ifNotUndefined( |
| 3478 | leaf, |
| 3479 | ([selectedCells, selectedRowIds, groupRowId, groupRow]) => { |
| 3480 | mapForEach( |
| 3481 | changedGroupedSelectedCells, |
| 3482 | (selectedCellId, [newCell]) => { |
| 3483 | const selectedCell = mapEnsure( |
| 3484 | selectedCells, |
| 3485 | selectedCellId, |
| 3486 | mapNew |
| 3487 | ); |
| 3488 | const oldLeafCell = mapGet(selectedCell, selectedRowId); |
| 3489 | const newLeafCell = forceRemove ? void 0 : newCell; |
| 3490 | if (oldLeafCell !== newLeafCell) { |
| 3491 | const oldNewSet = setNew([[oldLeafCell, newLeafCell]]); |
| 3492 | const oldLength = collSize(selectedCell); |
| 3493 | mapSet(selectedCell, selectedRowId, newLeafCell); |
| 3494 | collForEach( |
| 3495 | mapGet(groupedSelectedCellIds, selectedCellId), |
| 3496 | ([groupedCellId, aggregators]) => { |
| 3497 | const aggregateValue = getAggregateValue( |
| 3498 | groupRow[groupedCellId], |
| 3499 | oldLength, |
| 3500 | selectedCell, |
| 3501 | oldNewSet, |
| 3502 | aggregators |
| 3503 | ); |
| 3504 | groupRow[groupedCellId] = isUndefined( |
| 3505 | getCellOrValueType(aggregateValue) |
| 3506 | ) ? void 0 : aggregateValue; |
| 3507 | } |
| 3508 | ); |
| 3509 | } |
| 3510 | } |
| 3511 | ); |
| 3512 | if (collIsEmpty(selectedRowIds) || !arrayEvery( |
| 3513 | havings, |
| 3514 | (having2) => having2((cellId) => groupRow[cellId]) |
| 3515 | )) { |
| 3516 | resultStore2.delRow(queryId, groupRowId); |
| 3517 | } else if (isUndefined(groupRowId)) { |
| 3518 | leaf[2] = resultStore2.addRow(queryId, groupRow); |
| 3519 | } else { |
| 3520 | resultStore2.setRow(queryId, groupRowId, groupRow); |
| 3521 | } |
| 3522 | } |
| 3523 | ); |
| 3524 | addPreStoreListener( |
| 3525 | selectJoinWhereStore, |
| 3526 | queryId, |
no test coverage detected
searching dependent graphs…