1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 | Object.defineProperty(exports, "__esModule", {
|
5 | value: true
|
6 | });
|
7 | exports.INTERNAL_COL_DEFINE = void 0;
|
8 | exports.getExpandableProps = getExpandableProps;
|
9 | var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
10 | var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
11 | var _warning = _interopRequireDefault(require("rc-util/lib/warning"));
|
12 | var _excluded = ["expandable"];
|
13 | var INTERNAL_COL_DEFINE = exports.INTERNAL_COL_DEFINE = 'RC_TABLE_INTERNAL_COL_DEFINE';
|
14 | function getExpandableProps(props) {
|
15 | var expandable = props.expandable,
|
16 | legacyExpandableConfig = (0, _objectWithoutProperties2.default)(props, _excluded);
|
17 | var config;
|
18 | if ('expandable' in props) {
|
19 | config = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, legacyExpandableConfig), expandable);
|
20 | } else {
|
21 | if (process.env.NODE_ENV !== 'production' && ['indentSize', 'expandedRowKeys', 'defaultExpandedRowKeys', 'defaultExpandAllRows', 'expandedRowRender', 'expandRowByClick', 'expandIcon', 'onExpand', 'onExpandedRowsChange', 'expandedRowClassName', 'expandIconColumnIndex', 'showExpandColumn', 'title'].some(function (prop) {
|
22 | return prop in props;
|
23 | })) {
|
24 | (0, _warning.default)(false, 'expanded related props have been moved into `expandable`.');
|
25 | }
|
26 | config = legacyExpandableConfig;
|
27 | }
|
28 | if (config.showExpandColumn === false) {
|
29 | config.expandIconColumnIndex = -1;
|
30 | }
|
31 | return config;
|
32 | } |
\ | No newline at end of file |