Skip to content

Commit

Permalink
feat(interface/multi-select): add maxSelectedValues (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
northsqrd authored May 7, 2024
1 parent 9649ffa commit 24cedb0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions package/client/resource/interface/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ interface SelectProps extends BaseInput {
default?: string | string[];
clearable?: boolean;
searchable?: boolean;
maxSelectedValues?: number;
}

interface SliderProps extends BaseInput {
Expand Down
1 change: 1 addition & 0 deletions resource/interface/client/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ local input
---@field clearable? boolean
---@field searchable? boolean
---@field description? string
---@field maxSelectedValues? number

---@class InputDialogOptionsProps
---@field allowCancel? boolean
Expand Down
1 change: 1 addition & 0 deletions web/src/features/dialog/components/fields/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const SelectField: React.FC<Props> = (props) => {
withAsterisk={props.row.required}
clearable={props.row.clearable}
searchable={props.row.searchable}
maxSelectedValues={props.row.maxSelectedValues}
icon={props.row.icon && <LibIcon icon={props.row.icon} fixedWidth />}
/>
)}
Expand Down
1 change: 1 addition & 0 deletions web/src/typings/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface ISelect extends BaseField<'select' | 'multi-select', string | s
options: Array<OptionValue>;
clearable?: boolean;
searchable?: boolean;
maxSelectedValues?: number;
}

export interface INumber extends BaseField<'number', number> {
Expand Down

0 comments on commit 24cedb0

Please sign in to comment.