1234567891011121314151617181920212223242526272829303132 |
- import * as React from 'react';
- import ResizeObserver from 'rc-resize-observer';
- import useLayoutEffect from "rc-util/es/hooks/useLayoutEffect";
- export default function MeasureCell(_ref) {
- var columnKey = _ref.columnKey,
- onColumnResize = _ref.onColumnResize,
- column = _ref.column;
- var cellRef = React.useRef();
- useLayoutEffect(function () {
- if (cellRef.current) {
- onColumnResize(columnKey, cellRef.current.offsetWidth);
- }
- }, []);
- return /*#__PURE__*/React.createElement(ResizeObserver, {
- data: columnKey
- }, /*#__PURE__*/React.createElement("td", {
- ref: cellRef,
- style: {
- paddingTop: 0,
- paddingBottom: 0,
- borderTop: 0,
- borderBottom: 0,
- height: 0
- }
- }, /*#__PURE__*/React.createElement("div", {
- style: {
- height: 0,
- overflow: 'hidden',
- fontWeight: 'bold'
- }
- }, (column === null || column === void 0 ? void 0 : column.title) || '\xa0')));
- }
|