feat:PickerContainer支持隐藏footer&export VariableList and PickerContainer (#4466)

This commit is contained in:
hsm-lv 2022-05-26 23:07:52 +08:00 committed by GitHub
parent 023c61e524
commit d2b097c86a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 8 deletions

View File

@ -11,6 +11,7 @@ import Button from './Button';
export interface PickerContainerProps extends ThemeProps, LocaleProps {
title?: string;
showTitle?: boolean;
showFooter?: boolean;
headerClassName?: string;
children: (props: {
onClick: (e: React.MouseEvent) => void;
@ -131,7 +132,8 @@ export class PickerContainer extends React.Component<
showTitle,
headerClassName,
translate: __,
size
size,
showFooter
} = this.props;
return (
<>
@ -158,15 +160,18 @@ export class PickerContainer extends React.Component<
ref: this.bodyRef,
setState: this.updateState,
onClose: this.close,
onChange: this.handleChange
onChange: this.handleChange,
onConfirm: this.confirm
})}
</Modal.Body>
{showFooter ?? true ? (
<Modal.Footer>
<Button onClick={this.close}>{__('cancel')}</Button>
<Button onClick={this.confirm} level="primary">
{__('confirm')}
</Button>
</Modal.Footer>
) : null}
</Modal>
</>
);

View File

@ -61,7 +61,9 @@ import PullRefresh from './PullRefresh';
import Table from './table';
import SchemaVariableListPicker from './schema-editor/SchemaVariableListPicker';
import SchemaVariableList from './schema-editor/SchemaVariableList';
import VariableList from './formula/VariableList';
import FormulaPicker from './formula/Picker';
import PickerContainer from './PickerContainer';
import InputJSONSchema from './json-schema';
export {
@ -128,6 +130,8 @@ export {
Table,
SchemaVariableListPicker,
SchemaVariableList,
VariableList,
PickerContainer,
FormulaPicker,
InputJSONSchema
};