UNPKG

@txdfe/at

Version:

一个设计体系组件库

164 lines (133 loc) 6.23 kB
var _excluded = ["expandedRowKeys"], _excluded2 = ["onExpandedChange"], _excluded3 = ["isLoading"], _excluded4 = ["indentSize"], _excluded5 = ["optimization"], _excluded6 = ["getRowClassName", "getRowProps"], _excluded7 = ["getRowProps"], _excluded8 = ["getCellProps"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } import ConfigProvider from '../config-provider'; import Base from './base'; import tree from './tree'; import fixed from './fixed'; import selection from './selection'; import expanded from './expanded'; import virtual from './virtual'; import lock from './lock'; import list from './list'; import sticky from './sticky'; import ListHeader from './list-header'; import ListFooter from './list-footer'; var ORDER_LIST = [fixed, lock, selection, expanded, tree, virtual, list, sticky]; var Table = ORDER_LIST.reduce(function (ret, current) { ret = current(ret); return ret; }, Base); Table.Base = Base; Table.fixed = fixed; Table.lock = lock; Table.selection = selection; Table.expanded = expanded; Table.tree = tree; Table.virtual = virtual; Table.list = list; Table.sticky = sticky; Table.GroupHeader = ListHeader; Table.GroupFooter = ListFooter; export default ConfigProvider.config(Table, { componentName: 'Table', transform: /* istanbul ignore next */ function transform(props, deprecated) { if ('expandedRowKeys' in props) { deprecated('expandedRowKeys', 'openRowKeys', 'Table'); var _props = props, expandedRowKeys = _props.expandedRowKeys, others = _objectWithoutProperties(_props, _excluded); props = _objectSpread({ openRowKeys: expandedRowKeys }, others); } if ('onExpandedChange' in props) { deprecated('onExpandedChange', 'onRowOpen', 'Table'); var _props2 = props, onExpandedChange = _props2.onExpandedChange, _others = _objectWithoutProperties(_props2, _excluded2); props = _objectSpread({ onRowOpen: onExpandedChange }, _others); } if ('isLoading' in props) { deprecated('isLoading', 'loading', 'Table'); var _props3 = props, isLoading = _props3.isLoading, _others2 = _objectWithoutProperties(_props3, _excluded3); props = _objectSpread({ loading: isLoading }, _others2); } if ('indentSize' in props) { deprecated('indentSize', 'indent', 'Table'); var _props4 = props, indentSize = _props4.indentSize, _others3 = _objectWithoutProperties(_props4, _excluded4); props = _objectSpread({ indent: indentSize }, _others3); } if ('optimization' in props) { deprecated('optimization', 'pure', 'Table'); var _props5 = props, optimization = _props5.optimization, _others4 = _objectWithoutProperties(_props5, _excluded5); props = _objectSpread({ pure: optimization }, _others4); } if ('getRowClassName' in props) { deprecated('getRowClassName', 'getRowProps', 'Table'); var _props6 = props, getRowClassName = _props6.getRowClassName, getRowProps = _props6.getRowProps, _others5 = _objectWithoutProperties(_props6, _excluded6); if (getRowClassName) { var newGetRowProps = function newGetRowProps() { return _objectSpread({ className: getRowClassName.apply(void 0, arguments) }, getRowProps ? getRowProps.apply(void 0, arguments) : {}); }; props = _objectSpread({ getRowProps: newGetRowProps }, _others5); } else { props = _objectSpread({ getRowProps: getRowProps }, _others5); } } if ('getRowProps' in props) { deprecated('getRowProps', 'rowProps', 'Table in 1.15.0'); var _props7 = props, _getRowProps = _props7.getRowProps, _others6 = _objectWithoutProperties(_props7, _excluded7); props = _objectSpread({ rowProps: _getRowProps }, _others6); } if ('getCellProps' in props) { deprecated('getCellProps', 'cellProps', 'Table in 1.15.0'); var _props8 = props, getCellProps = _props8.getCellProps, _others7 = _objectWithoutProperties(_props8, _excluded8); props = _objectSpread({ cellProps: getCellProps }, _others7); } return props; } });