This commit is contained in:
2026-05-25 17:08:18 +08:00
parent df501f6151
commit f1259b71b5
9178 changed files with 1626125 additions and 0 deletions
@@ -0,0 +1,35 @@
import * as React from 'react';
import ResizeObserver from '@rc-component/resize-observer';
import useLayoutEffect from "@rc-component/util/es/hooks/useLayoutEffect";
const MeasureCell = props => {
const {
columnKey,
onColumnResize,
title
} = props;
const cellRef = React.useRef(null);
useLayoutEffect(() => {
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'
}
}, title || '\xa0')));
};
export default MeasureCell;