mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-02 06:23:15 +00:00
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
import _extends from 'babel-runtime/helpers/extends';
|
|
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
|
import ConfigProvider from '../config-provider';
|
|
import Button from './view/button';
|
|
import ButtonGroup from './view/group';
|
|
|
|
Button.Group = ButtonGroup;
|
|
|
|
export default ConfigProvider.config(Button, {
|
|
transform: /* istanbul ignore next */function transform(props, deprecated) {
|
|
if ('shape' in props) {
|
|
deprecated('shape', 'text | warning | ghost', 'Button');
|
|
|
|
var _props = props,
|
|
shape = _props.shape,
|
|
type = _props.type,
|
|
others = _objectWithoutProperties(_props, ['shape', 'type']);
|
|
|
|
var newType = type;
|
|
if (type === 'light' || type === 'dark' || type === 'secondary' && shape === 'warning') {
|
|
newType = 'normal';
|
|
}
|
|
|
|
var ghost = void 0;
|
|
if (shape === 'ghost') {
|
|
ghost = {
|
|
primary: 'dark',
|
|
secondary: 'dark',
|
|
normal: 'light',
|
|
dark: 'dark',
|
|
light: 'light'
|
|
}[type || Button.defaultProps.type];
|
|
}
|
|
|
|
var text = shape === 'text';
|
|
var warning = shape === 'warning';
|
|
|
|
props = _extends({ type: newType, ghost: ghost, text: text, warning: warning }, others);
|
|
}
|
|
|
|
return props;
|
|
}
|
|
}); |