diff --git a/apps/web/src/common/modules/widgets/_widget-field-value-manager/constant/default-value-registry.ts b/apps/web/src/common/modules/widgets/_widget-field-value-manager/constant/default-value-registry.ts index ff6d945e0e..e59d0253b5 100644 --- a/apps/web/src/common/modules/widgets/_widget-field-value-manager/constant/default-value-registry.ts +++ b/apps/web/src/common/modules/widgets/_widget-field-value-manager/constant/default-value-registry.ts @@ -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; }, diff --git a/apps/web/src/common/modules/widgets/_widget-fields/data-field/type.ts b/apps/web/src/common/modules/widgets/_widget-fields/data-field/type.ts index 5b665d1d13..54a5fe5168 100644 --- a/apps/web/src/common/modules/widgets/_widget-fields/data-field/type.ts +++ b/apps/web/src/common/modules/widgets/_widget-fields/data-field/type.ts @@ -1,6 +1,7 @@ export interface DataFieldOptions { multiSelectable?: boolean; + allSelected?: boolean; // if true, all options are selected (use with multiSelectable(true)) } export interface DataFieldValue {