mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add color options to choice config UI
Summary: Includes overhauled choice configuration UI for choice and choice list columns based on the TokenField library. Features include rich copy and paste support, keyboard shortcuts for token manipulation, and drag-and-drop support for arrangement. Configured choice colors are visible throughout the application, such as in the autocomplete window for both choice and choice list cells, and in table cells directly. Choice cells in particular are now styled closer to choice list cells, and render their contents as colored tokens. Choice cells now also use the improved autocomplete component that choice lists use, with some room for future improvement (e.g. allowing new choice items to be added inline like in choice list's autocomplete). Also includes a minor fix for choice list cells where right align was not working. Test Plan: Browser tests updated. Reviewers: jarek, dsagal Reviewed By: jarek, dsagal Subscribers: jarek Differential Revision: https://phab.getgrist.com/D2890
This commit is contained in:
@@ -85,7 +85,7 @@ export async function prepTransformColInfo(docModel: DocModel, origCol: ColumnRe
|
||||
case 'Choice': {
|
||||
if (Array.isArray(prevOptions.choices)) {
|
||||
// Use previous choices if they are set, e.g. if converting from ChoiceList
|
||||
widgetOptions = {choices: prevOptions.choices};
|
||||
widgetOptions = {choices: prevOptions.choices, choiceOptions: prevOptions.choiceOptions};
|
||||
} else {
|
||||
// Set suggested choices. Limit to 100, since too many choices is more likely to cause
|
||||
// trouble than desired behavior. For many choices, recommend using a Ref to helper table.
|
||||
@@ -100,7 +100,7 @@ export async function prepTransformColInfo(docModel: DocModel, origCol: ColumnRe
|
||||
case 'ChoiceList': {
|
||||
if (Array.isArray(prevOptions.choices)) {
|
||||
// Use previous choices if they are set, e.g. if converting from ChoiceList
|
||||
widgetOptions = {choices: prevOptions.choices};
|
||||
widgetOptions = {choices: prevOptions.choices, choiceOptions: prevOptions.choiceOptions};
|
||||
} else {
|
||||
// Set suggested choices. This happens before the conversion to ChoiceList, so we do some
|
||||
// light guessing for likely choices to suggest.
|
||||
|
||||
Reference in New Issue
Block a user