/
NumberFilterDialog.ts
29 lines (23 loc) · 1.06 KB
/
NumberFilterDialog.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import {IMapAbleColumn} from '../../model';
import {ISummaryRenderer} from '../../renderer/interfaces';
import {IRankingHeaderContext} from '../interfaces';
import ADialog, {IDialogContext} from './ADialog';
/** @internal */
export default class NumberFilterDialog extends ADialog {
private readonly summary: ISummaryRenderer;
constructor(private readonly column: IMapAbleColumn, dialog: IDialogContext, private readonly ctx: IRankingHeaderContext) {
super(dialog);
this.summary = ctx.summaryRenderer(this.column, true);
}
build(node: HTMLElement) {
node.classList.add('lu-dialog-mapper');
// patch in lu-summary and renderer
node.insertAdjacentHTML('beforeend', this.summary.template);
const summary = <HTMLElement>node.lastElementChild!;
summary.classList.add('lu-summary', 'lu-renderer');
summary.dataset.renderer = this.column.getSummaryRenderer();
summary.dataset.interactive = '';
node.appendChild(summary);
this.summary.update(<HTMLElement>this.node.querySelector('.lu-summary')!, this.ctx.statsOf(this.column));
}
}