feat(interface/multi-select): add maxSelectedValues (#563)

This commit is contained in:
northsqrd
2024-05-07 20:28:52 +02:00
committed by GitHub
parent 9649ffaf67
commit 24cedb07ae
4 changed files with 4 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ interface SelectProps extends BaseInput {
default?: string | string[]; default?: string | string[];
clearable?: boolean; clearable?: boolean;
searchable?: boolean; searchable?: boolean;
maxSelectedValues?: number;
} }
interface SliderProps extends BaseInput { interface SliderProps extends BaseInput {

View File

@@ -21,6 +21,7 @@ local input
---@field clearable? boolean ---@field clearable? boolean
---@field searchable? boolean ---@field searchable? boolean
---@field description? string ---@field description? string
---@field maxSelectedValues? number
---@class InputDialogOptionsProps ---@class InputDialogOptionsProps
---@field allowCancel? boolean ---@field allowCancel? boolean

View File

@@ -51,6 +51,7 @@ const SelectField: React.FC<Props> = (props) => {
withAsterisk={props.row.required} withAsterisk={props.row.required}
clearable={props.row.clearable} clearable={props.row.clearable}
searchable={props.row.searchable} searchable={props.row.searchable}
maxSelectedValues={props.row.maxSelectedValues}
icon={props.row.icon && <LibIcon icon={props.row.icon} fixedWidth />} icon={props.row.icon && <LibIcon icon={props.row.icon} fixedWidth />}
/> />
)} )}

View File

@@ -38,6 +38,7 @@ export interface ISelect extends BaseField<'select' | 'multi-select', string | s
options: Array<OptionValue>; options: Array<OptionValue>;
clearable?: boolean; clearable?: boolean;
searchable?: boolean; searchable?: boolean;
maxSelectedValues?: number;
} }
export interface INumber extends BaseField<'number', number> { export interface INumber extends BaseField<'number', number> {