UNPKG

847 BJavaScriptView Raw
1import _extends from 'babel-runtime/helpers/extends';
2import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3import ConfigProvider from '../config-provider';
4import Rating from './rating';
5
6export default ConfigProvider.config(Rating, {
7 transform: /* istanbul ignore next */function transform(props, deprecated) {
8 if ('type' in props) {
9 deprecated('type', 'showGrade', 'Rating');
10
11 var _props = props,
12 type = _props.type,
13 others = _objectWithoutProperties(_props, ['type']);
14
15 props = _extends({ showGrade: type === 'grade' }, others);
16 }
17
18 var _props2 = props,
19 disabled = _props2.disabled,
20 readOnly = _props2.readOnly;
21
22 props.disabled = disabled || readOnly;
23
24 return props;
25 }
26});
\No newline at end of file