2020-09-07 17:48:39 +08:00

19 lines
489 B
JavaScript

import ConfigProvider from '../config-provider';
import Rating from './rating';
export default ConfigProvider.config(Rating, {
transform: /* istanbul ignore next */ (props, deprecated) => {
if ('type' in props) {
deprecated('type', 'showGrade', 'Rating');
const { type, ...others } = props;
props = { showGrade: type === 'grade', ...others };
}
const { disabled, readOnly } = props;
props.disabled = disabled || readOnly;
return props;
},
});