mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(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:
@@ -167,10 +167,10 @@ DetailView.prototype.deleteRow = function(index) {
|
||||
*/
|
||||
DetailView.prototype.paste = function(data, cutCallback) {
|
||||
let pasteData = data[0][0];
|
||||
let col = this.currentColumn();
|
||||
let field = this.viewSection.viewFields().at(this.cursor.fieldIndex());
|
||||
let isCompletePaste = (data.length === 1 && data[0].length === 1);
|
||||
|
||||
let richData = this._parsePasteForView([[pasteData]], [col]);
|
||||
let richData = this._parsePasteForView([[pasteData]], [field]);
|
||||
if (_.isEmpty(richData)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user