mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
ecb30eebb8
Summary: Added a new object type code `l` (for lookup) which can be used in user actions as a temporary cell value in ref[list] columns and is immediately converted to a row ID in the data engine. The value contains the original raw string (to be used as alt text), the column ID to lookup (typically the visible column) and one or more values to lookup. For reflists, valueParser now tries parsing the string first as JSON, then as a CSV row, and applies the visible column parsed to each item. Both ref and reflists columns no longer format the parsed value when there's no matching reference, the original unparsed string is used as alttext instead. Test Plan: Added another table "Multi-References" to CopyPaste test. Made that table and the References table test with and without table data loaded in the browser. Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D3118
24 lines
589 B
TypeScript
24 lines
589 B
TypeScript
// Letter codes for CellValue types encoded as [code, args...] tuples.
|
|
export const enum GristObjCode {
|
|
List = 'L',
|
|
LookUp = 'l',
|
|
Dict = 'O',
|
|
DateTime = 'D',
|
|
Date = 'd',
|
|
Skip = 'S',
|
|
Censored = 'C',
|
|
Reference = 'R',
|
|
ReferenceList = 'r',
|
|
Exception = 'E',
|
|
Pending = 'P',
|
|
Unmarshallable = 'U',
|
|
Versions = 'V',
|
|
}
|
|
|
|
export type CellValue = number|string|boolean|null|[GristObjCode, ...unknown[]];
|
|
|
|
export interface RowRecord {
|
|
id: number;
|
|
[colId: string]: CellValue;
|
|
}
|