UNPKG

@txdfe/at

Version:

一个设计体系组件库

37 lines (36 loc) 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _excluded = ["listType", "defaultFileList", "fileList"]; function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; } // compatible with 0.x version /* istanbul ignore next */ var transform = function transform(props, deprecated) { var listType = props.listType, defaultFileList = props.defaultFileList, fileList = props.fileList, others = _objectWithoutProperties(props, _excluded); var newprops = others; if (listType === 'text-image') { deprecated('listType=text-image', 'listType=image', 'Upload'); newprops.listType = 'image'; } else if (listType === 'picture-card') { deprecated('listType=picture-card', 'listType=card', 'Upload'); newprops.listType = 'card'; } else { newprops.listType = listType; } if ('defaultFileList' in props) { deprecated('defaultFileList', 'defaultValue', 'Upload'); newprops.defaultValue = defaultFileList; } if ('fileList' in props) { deprecated('fileList', 'value', 'Upload'); newprops.value = fileList; } return newprops; }; var _default = exports["default"] = transform;