1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 | Object.defineProperty(exports, "__esModule", {
|
5 | value: true
|
6 | });
|
7 | exports.default = useFixedInfo;
|
8 | var _useMemo = _interopRequireDefault(require("rc-util/lib/hooks/useMemo"));
|
9 | var _isEqual = _interopRequireDefault(require("rc-util/lib/isEqual"));
|
10 | var _fixUtil = require("../utils/fixUtil");
|
11 | function useFixedInfo(flattenColumns, stickyOffsets, direction) {
|
12 | var fixedInfoList = flattenColumns.map(function (_, colIndex) {
|
13 | return (0, _fixUtil.getCellFixedInfo)(colIndex, colIndex, flattenColumns, stickyOffsets, direction);
|
14 | });
|
15 | return (0, _useMemo.default)(function () {
|
16 | return fixedInfoList;
|
17 | }, [fixedInfoList], function (prev, next) {
|
18 | return !(0, _isEqual.default)(prev, next);
|
19 | });
|
20 | } |
\ | No newline at end of file |