(core) Add cell selection summary

Summary:
Adds a cell selection summary to grid view that shows either a count or
sum of all the selected values. Implementation was done by Dmitry.

Test Plan: Browser tests.

Reviewers: jarek

Reviewed By: jarek

Subscribers: paulfitz, dsagal, jarek

Differential Revision: https://phab.getgrist.com/D3630
This commit is contained in:
George Gevoian
2022-09-29 09:32:54 -07:00
parent 433e1ecfc2
commit 364610c69d
12 changed files with 814 additions and 371 deletions

View File

@@ -30,6 +30,12 @@ export function mouseDrag(onStart: MouseDragStart): DomElementMethod {
return (elem) => { mouseDragElem(elem, onStart); };
}
// Same as mouseDragElem, but listens for mousedown on descendants of elem that match selector.
export function mouseDragMatchElem(elem: HTMLElement, selector: string, onStart: MouseDragStart): IDisposable {
return dom.onMatchElem(elem, selector, 'mousedown',
(ev, el) => _startDragging(ev as MouseEvent, el as HTMLElement, onStart));
}
function _startDragging(startEv: MouseEvent, elem: HTMLElement, onStart: MouseDragStart) {
const dragHandler = onStart(startEv, elem);
if (dragHandler) {