Skip to content

Commit

Permalink
fix(widget-field): add allSelected options spec to dataField (#5258)
Browse files Browse the repository at this point in the history
* chore(widget-field): add allSelected options spec to dataField

Signed-off-by: samuel.park <[email protected]>

* chore: add annotation

Signed-off-by: samuel.park <[email protected]>

---------

Signed-off-by: samuel.park <[email protected]>
  • Loading branch information
piggggggggy authored Dec 19, 2024
1 parent fe9e524 commit 0457310
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ export const widgetFieldDefaultValueSetterRegistry: WidgetFieldDefaultValueSette

const fieldKeys = sortWidgetTableFields(Object.keys(dataTable?.data_info ?? {}));

result.data = dataFieldOptions.multiSelectable ? [fieldKeys?.[0]] : fieldKeys?.[0];
if (dataFieldOptions.multiSelectable) {
result.data = dataFieldOptions.allSelected ? fieldKeys : [fieldKeys?.[0]];
} else {
result.data = fieldKeys?.[0];
}


return result;
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

export interface DataFieldOptions {
multiSelectable?: boolean;
allSelected?: boolean; // if true, all options are selected (use with multiSelectable(true))
}

export interface DataFieldValue {
Expand Down

0 comments on commit 0457310

Please sign in to comment.