2023-02-14 23:25:05 +00:00
|
|
|
type SelectItem<
|
2024-01-20 01:20:29 +00:00
|
|
|
Value = string,
|
|
|
|
Display extends React.ReactNode = React.ReactNode,
|
2023-02-14 23:25:05 +00:00
|
|
|
> = {
|
2024-01-20 01:20:29 +00:00
|
|
|
displayValue?: Display;
|
|
|
|
value: Value;
|
2023-02-14 23:25:05 +00:00
|
|
|
};
|
2023-02-17 05:28:21 +00:00
|
|
|
|
2024-01-20 01:20:29 +00:00
|
|
|
type OperateSelectItemFunction<Value = string> = (value: Value) => boolean;
|
2023-02-17 05:28:21 +00:00
|
|
|
|
2024-01-20 01:20:29 +00:00
|
|
|
type SelectWithLabelOptionalProps<Value = string> = {
|
|
|
|
checkItem?: OperateSelectItemFunction<Value>;
|
|
|
|
disableItem?: OperateSelectItemFunction<Value>;
|
2023-02-23 03:17:55 +00:00
|
|
|
formControlProps?: import('@mui/material').FormControlProps;
|
2024-01-20 01:20:29 +00:00
|
|
|
hideItem?: OperateSelectItemFunction<Value>;
|
2023-02-17 05:28:21 +00:00
|
|
|
isCheckableItems?: boolean;
|
|
|
|
isReadOnly?: boolean;
|
|
|
|
inputLabelProps?: Partial<
|
|
|
|
import('../components/OutlinedInputLabel').OutlinedInputLabelProps
|
|
|
|
>;
|
|
|
|
label?: string;
|
|
|
|
messageBoxProps?: Partial<import('../components/MessageBox').MessageBoxProps>;
|
2023-03-02 21:25:58 +00:00
|
|
|
required?: boolean;
|
2024-01-20 01:20:29 +00:00
|
|
|
selectProps?: Partial<SelectProps<Value>>;
|
2023-02-17 05:28:21 +00:00
|
|
|
};
|
|
|
|
|
2024-01-20 01:20:29 +00:00
|
|
|
type SelectWithLabelProps<
|
|
|
|
Value = string,
|
|
|
|
Display extends React.ReactNode = React.ReactNode,
|
|
|
|
> = SelectWithLabelOptionalProps<Value> &
|
|
|
|
Pick<
|
|
|
|
SelectProps<Value>,
|
|
|
|
'name' | 'onBlur' | 'onChange' | 'onFocus' | 'value'
|
|
|
|
> & {
|
2023-02-17 05:28:21 +00:00
|
|
|
id: string;
|
2024-01-20 01:20:29 +00:00
|
|
|
selectItems: Array<SelectItem<Value, Display> | string>;
|
2023-02-17 05:28:21 +00:00
|
|
|
};
|