(core) Convert a few widgets to typescript and grainjs.

Summary:
No behavior changes.
Diff includes an intermediate commit with only renames, for easier review.

Test Plan: Existing tests should pass.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2669
This commit is contained in:
Dmitry S
2020-10-07 17:58:43 -04:00
parent f24a82e8d4
commit 4539521dff
13 changed files with 298 additions and 387 deletions

View File

@@ -10,7 +10,7 @@ import {cssLabel, cssRow} from 'app/client/ui/RightPanel';
import {colorSelect} from 'app/client/ui2018/buttonSelect';
import {colors, testId} from 'app/client/ui2018/cssVars';
import {BaseFormatter, createFormatter} from 'app/common/ValueFormatter';
import {Disposable, fromKo, Observable, styled} from 'grainjs';
import {Disposable, DomContents, fromKo, Observable, styled} from 'grainjs';
import * as ko from 'knockout';
@@ -43,13 +43,13 @@ export abstract class NewAbstractWidget extends Disposable {
/**
* Builds the DOM showing configuration buttons and fields in the sidebar.
*/
public buildConfigDom(): Element|null { return null; }
public buildConfigDom(): DomContents { return null; }
/**
* Builds the transform prompt config DOM in the few cases where it is necessary.
* Child classes need not override this function if they do not require transform config options.
*/
public buildTransformConfigDom(): Element|null { return null; }
public buildTransformConfigDom(): DomContents { return null; }
public buildColorConfigDom(): Element[] {
return [