(core) Add ValueParser, use when pasting

Summary:
Add ValueParser file, base class, and subclasses for column types. Only NumericParser is used for now.

Add valueParser field to ViewFieldRec.

Use valueParser when parsing pasted text data in Grid and Detail views.

Test Plan: Add test to nbrowser CopyPaste suite, copying into a numeric column with different currency and locale settings.

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D3082
This commit is contained in:
Alex Hall
2021-10-21 20:50:49 +02:00
parent 5b16dd2e86
commit 99878c08ed
6 changed files with 116 additions and 24 deletions

View File

@@ -111,7 +111,7 @@ class IntFormatter extends NumericFormatter {
}
}
interface DateFormatOptions {
export interface DateFormatOptions {
dateFormat?: string;
}
@@ -132,7 +132,7 @@ class DateFormatter extends BaseFormatter {
}
}
interface DateTimeFormatOptions extends DateFormatOptions {
export interface DateTimeFormatOptions extends DateFormatOptions {
timeFormat?: string;
}