UNPKG

@txdfe/at

Version:

一个设计体系组件库

134 lines 6.43 kB
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["expandedRowKeys"], _excluded2 = ["onExpandedChange"], _excluded3 = ["isLoading"], _excluded4 = ["indentSize"], _excluded5 = ["optimization"], _excluded6 = ["getRowClassName", "getRowProps"], _excluded7 = ["getRowProps"], _excluded8 = ["getCellProps"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 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; } 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; } });