1 | 'use strict';
|
2 |
|
3 | exports.__esModule = true;
|
4 |
|
5 | var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
|
6 |
|
7 | var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
|
8 |
|
9 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10 |
|
11 |
|
12 |
|
13 | var transform = function transform(props, deprecated) {
|
14 | var listType = props.listType,
|
15 | defaultFileList = props.defaultFileList,
|
16 | fileList = props.fileList,
|
17 | others = (0, _objectWithoutProperties3.default)(props, ['listType', 'defaultFileList', 'fileList']);
|
18 |
|
19 | var newprops = others;
|
20 |
|
21 | if (listType === 'text-image') {
|
22 | deprecated('listType=text-image', 'listType=image', 'Upload');
|
23 | newprops.listType = 'image';
|
24 | } else if (listType === 'picture-card') {
|
25 | deprecated('listType=picture-card', 'listType=card', 'Upload');
|
26 | newprops.listType = 'card';
|
27 | } else {
|
28 | newprops.listType = listType;
|
29 | }
|
30 |
|
31 | if ('defaultFileList' in props) {
|
32 | deprecated('defaultFileList', 'defaultValue', 'Upload');
|
33 | newprops.defaultValue = defaultFileList;
|
34 | }
|
35 |
|
36 | if ('fileList' in props) {
|
37 | deprecated('fileList', 'value', 'Upload');
|
38 | newprops.value = fileList;
|
39 | }
|
40 |
|
41 | return newprops;
|
42 | };
|
43 |
|
44 | exports.default = transform;
|
45 | module.exports = exports['default']; |
\ | No newline at end of file |