PromoCursed/node_modules/.cache/babel-loader/b0191dc801fe874ba1308ffcf0090ae1d552e22ffec95c2ffc7492837f4ccbe4.json

1 line
19 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Cell from \"../Cell\";\nimport { responseImmutable } from \"../context/TableContext\";\nimport devRenderTimes from \"../hooks/useRenderTimes\";\nimport useRowInfo from \"../hooks/useRowInfo\";\nimport ExpandedRow from \"./ExpandedRow\";\n// ==================================================================================\n// == getCellProps ==\n// ==================================================================================\nexport function getCellProps(rowInfo, column, colIndex, indent, index) {\n var record = rowInfo.record,\n prefixCls = rowInfo.prefixCls,\n columnsKey = rowInfo.columnsKey,\n fixedInfoList = rowInfo.fixedInfoList,\n expandIconColumnIndex = rowInfo.expandIconColumnIndex,\n nestExpandable = rowInfo.nestExpandable,\n indentSize = rowInfo.indentSize,\n expandIcon = rowInfo.expandIcon,\n expanded = rowInfo.expanded,\n hasNestChildren = rowInfo.hasNestChildren,\n onTriggerExpand = rowInfo.onTriggerExpand;\n var key = columnsKey[colIndex];\n var fixedInfo = fixedInfoList[colIndex];\n\n // ============= Used for nest expandable =============\n var appendCellNode;\n if (colIndex === (expandIconColumnIndex || 0) && nestExpandable) {\n appendCellNode = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"span\", {\n style: {\n paddingLeft: \"\".concat(indentSize * indent, \"px\")\n },\n className: \"\".concat(prefixCls, \"-row-indent indent-level-\").concat(indent)\n }), expandIcon({\n prefixCls: prefixCls,\n expanded: expanded,\n expandable: hasNestChildren,\n record: record,\n onExpand: onTriggerExpand\n }));\n }\n var additionalCellProps;\n if (column.onCell) {\n additionalCellProps = column.onCell(record, index);\n }\n return {\n key: key,\n fixedInfo: fixedInfo,\n appendCellNode: appendCellNode,\n additionalCellProps: additionalCellProps || {}\n };\n}\n\n// ==================================================================================\n// == getCellProps ==\n// ==================================================================================\nfunction BodyRow(props) {\n if (process.env.NODE_ENV !== 'production') {\n devRenderTimes(props);\n }\n var className = props.className,\n style = props.style,\n record = props.record,\n index = props.index,\n renderIndex = props.renderIndex,\n rowKey = props.rowKey,\n _props$indent = props.indent,\n indent = _props$indent === void 0 ? 0 : _props$indent,\n RowComponent = props.rowComponent,\n cellComponent = props.cellComponent,\n scopeCellComponent = props.scopeCellComponent;\n var rowInfo = useRowInfo(record, rowKey, index, indent);\n var prefixCls = rowInfo.prefixCls,\n flattenColumns = rowInfo.flattenColumns,\n expandedRowClassName = rowInfo.expandedRowClassName,\n expandedRowRender = rowInfo.expandedRowRender,\n rowProps = rowInfo.rowProps,\n expanded = rowInfo.expanded,\n rowSupportExpand = rowInfo.rowSupportExpand;\n\n // Force render expand row if expanded before\n var expandedRef = React.useRef(false);\n expandedRef.current || (expandedRef.current = expanded);\n if (process.env.NODE_ENV !== 'production') {\n devRenderTimes(props);\n }\n\n // 若没有 expandedRowRender 参数, 将使用 baseRowNode 渲染 Children\n // 此时如果 level > 1 则说明是 expandedRow, 一样需要附加 computedExpandedRowClassName\n var computedExpandedRowClassName = expandedRowClassName && expandedRowClassName(record, index, indent);\n\n // ======================== Base tr row ========================\n var baseRowNode = /*#__PURE__*/React.createElement(RowComponent, _extends({}, rowProps, {\n