Comparing version 7.40.0 to 7.41.0
@@ -22,7 +22,6 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
stickyOffsets = _React$useContext.stickyOffsets, | ||
flattenColumns = _React$useContext.flattenColumns, | ||
columns = _React$useContext.columns; | ||
flattenColumns = _React$useContext.flattenColumns; | ||
var lastIndex = index + colSpan - 1; | ||
var mergedColSpan = lastIndex + 1 === scrollColumnIndex ? colSpan + 1 : colSpan; | ||
var fixedInfo = getCellFixedInfo(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets, direction, columns === null || columns === void 0 ? void 0 : columns[index]); | ||
var fixedInfo = getCellFixedInfo(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets, direction); | ||
return /*#__PURE__*/React.createElement(Cell, _extends({ | ||
@@ -29,0 +28,0 @@ className: className, |
import * as React from 'react'; | ||
import type { ColumnsType, ColumnType, StickyOffsets } from '../interface'; | ||
import type { ColumnType, StickyOffsets } from '../interface'; | ||
import Summary from './Summary'; | ||
@@ -11,3 +11,2 @@ type FlattenColumns<RecordType> = readonly (ColumnType<RecordType> & { | ||
flattenColumns: FlattenColumns<RecordType>; | ||
columns: ColumnsType<RecordType>; | ||
} | ||
@@ -14,0 +13,0 @@ declare function Footer<RecordType>(props: FooterProps<RecordType>): React.JSX.Element; |
@@ -13,4 +13,3 @@ import { useContext } from '@rc-component/context'; | ||
stickyOffsets = props.stickyOffsets, | ||
flattenColumns = props.flattenColumns, | ||
columns = props.columns; | ||
flattenColumns = props.flattenColumns; | ||
var prefixCls = useContext(TableContext, 'prefixCls'); | ||
@@ -23,6 +22,5 @@ var lastColumnIndex = flattenColumns.length - 1; | ||
flattenColumns: flattenColumns, | ||
scrollColumnIndex: scrollColumn !== null && scrollColumn !== void 0 && scrollColumn.scrollbar ? lastColumnIndex : null, | ||
columns: columns | ||
scrollColumnIndex: scrollColumn !== null && scrollColumn !== void 0 && scrollColumn.scrollbar ? lastColumnIndex : null | ||
}; | ||
}, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets, columns]); | ||
}, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets]); | ||
return /*#__PURE__*/React.createElement(SummaryContext.Provider, { | ||
@@ -29,0 +27,0 @@ value: summaryContext |
import * as React from 'react'; | ||
import type { ColumnsType, ColumnType, StickyOffsets } from '../interface'; | ||
import type { ColumnType, StickyOffsets } from '../interface'; | ||
type FlattenColumns<RecordType> = readonly (ColumnType<RecordType> & { | ||
@@ -10,4 +10,3 @@ scrollbar?: boolean; | ||
flattenColumns?: FlattenColumns<any>; | ||
columns?: ColumnsType<any>; | ||
}>; | ||
export default SummaryContext; |
@@ -30,3 +30,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var column = cell.column; | ||
var fixedInfo = getCellFixedInfo(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction, column); | ||
var fixedInfo = getCellFixedInfo(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction); | ||
var additionalProps; | ||
@@ -33,0 +33,0 @@ if (column && column.onHeaderCell) { |
@@ -1,2 +0,2 @@ | ||
import type { ColumnsType, ColumnType, Direction, StickyOffsets } from '../interface'; | ||
export default function useFixedInfo<RecordType>(flattenColumns: readonly ColumnType<RecordType>[], stickyOffsets: StickyOffsets, direction: Direction, columns: ColumnsType<RecordType>): import("../utils/fixUtil").FixedInfo[]; | ||
import type { ColumnType, Direction, StickyOffsets } from '../interface'; | ||
export default function useFixedInfo<RecordType>(flattenColumns: readonly ColumnType<RecordType>[], stickyOffsets: StickyOffsets, direction: Direction): import("../utils/fixUtil").FixedInfo[]; |
import useMemo from "rc-util/es/hooks/useMemo"; | ||
import isEqual from "rc-util/es/isEqual"; | ||
import { getCellFixedInfo } from "../utils/fixUtil"; | ||
export default function useFixedInfo(flattenColumns, stickyOffsets, direction, columns) { | ||
export default function useFixedInfo(flattenColumns, stickyOffsets, direction) { | ||
var fixedInfoList = flattenColumns.map(function (_, colIndex) { | ||
return getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets, direction, columns === null || columns === void 0 ? void 0 : columns[colIndex]); | ||
return getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets, direction); | ||
}); | ||
@@ -8,0 +8,0 @@ return useMemo(function () { |
@@ -528,4 +528,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
stickyOffsets: stickyOffsets, | ||
flattenColumns: flattenColumns, | ||
columns: columns | ||
flattenColumns: flattenColumns | ||
}, summaryNode))); | ||
@@ -572,4 +571,3 @@ } | ||
stickyOffsets: stickyOffsets, | ||
flattenColumns: flattenColumns, | ||
columns: columns | ||
flattenColumns: flattenColumns | ||
}, summaryNode))); | ||
@@ -595,3 +593,3 @@ } | ||
} | ||
var fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets, direction, columns); | ||
var fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets, direction); | ||
var TableContextValue = React.useMemo(function () { | ||
@@ -598,0 +596,0 @@ return { |
@@ -1,2 +0,2 @@ | ||
import type { ColumnGroupType, ColumnType, Direction, FixedType, StickyOffsets } from '../interface'; | ||
import type { Direction, FixedType, StickyOffsets } from '../interface'; | ||
export interface FixedInfo { | ||
@@ -11,4 +11,4 @@ fixLeft: number | false; | ||
} | ||
export declare function getCellFixedInfo<RecordType = any>(colStart: number, colEnd: number, columns: readonly { | ||
export declare function getCellFixedInfo(colStart: number, colEnd: number, columns: readonly { | ||
fixed?: FixedType; | ||
}[], stickyOffsets: StickyOffsets, direction: Direction, curColumns?: ColumnType<RecordType> | ColumnGroupType<RecordType>): FixedInfo; | ||
}[], stickyOffsets: StickyOffsets, direction: Direction): FixedInfo; |
@@ -1,2 +0,2 @@ | ||
export function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction, curColumns) { | ||
export function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction) { | ||
var startColumn = columns[colStart] || {}; | ||
@@ -18,4 +18,6 @@ var endColumn = columns[colEnd] || {}; | ||
// no children only | ||
var canLastFix = !(curColumns !== null && curColumns !== void 0 && curColumns.children); | ||
// need show shadow only when canLastFix is true | ||
var canLastFix = nextColumn && nextColumn.fixed === undefined || prevColumn && prevColumn.fixed === undefined || columns.every(function (col) { | ||
return col.fixed === 'left'; | ||
}); | ||
if (direction === 'rtl') { | ||
@@ -22,0 +24,0 @@ if (fixLeft !== undefined) { |
@@ -32,7 +32,6 @@ "use strict"; | ||
stickyOffsets = _React$useContext.stickyOffsets, | ||
flattenColumns = _React$useContext.flattenColumns, | ||
columns = _React$useContext.columns; | ||
flattenColumns = _React$useContext.flattenColumns; | ||
var lastIndex = index + colSpan - 1; | ||
var mergedColSpan = lastIndex + 1 === scrollColumnIndex ? colSpan + 1 : colSpan; | ||
var fixedInfo = (0, _fixUtil.getCellFixedInfo)(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets, direction, columns === null || columns === void 0 ? void 0 : columns[index]); | ||
var fixedInfo = (0, _fixUtil.getCellFixedInfo)(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets, direction); | ||
return /*#__PURE__*/React.createElement(_Cell.default, (0, _extends2.default)({ | ||
@@ -39,0 +38,0 @@ className: className, |
import * as React from 'react'; | ||
import type { ColumnsType, ColumnType, StickyOffsets } from '../interface'; | ||
import type { ColumnType, StickyOffsets } from '../interface'; | ||
import Summary from './Summary'; | ||
@@ -11,3 +11,2 @@ type FlattenColumns<RecordType> = readonly (ColumnType<RecordType> & { | ||
flattenColumns: FlattenColumns<RecordType>; | ||
columns: ColumnsType<RecordType>; | ||
} | ||
@@ -14,0 +13,0 @@ declare function Footer<RecordType>(props: FooterProps<RecordType>): React.JSX.Element; |
@@ -23,4 +23,3 @@ "use strict"; | ||
stickyOffsets = props.stickyOffsets, | ||
flattenColumns = props.flattenColumns, | ||
columns = props.columns; | ||
flattenColumns = props.flattenColumns; | ||
var prefixCls = (0, _context.useContext)(_TableContext.default, 'prefixCls'); | ||
@@ -33,6 +32,5 @@ var lastColumnIndex = flattenColumns.length - 1; | ||
flattenColumns: flattenColumns, | ||
scrollColumnIndex: scrollColumn !== null && scrollColumn !== void 0 && scrollColumn.scrollbar ? lastColumnIndex : null, | ||
columns: columns | ||
scrollColumnIndex: scrollColumn !== null && scrollColumn !== void 0 && scrollColumn.scrollbar ? lastColumnIndex : null | ||
}; | ||
}, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets, columns]); | ||
}, [scrollColumn, flattenColumns, lastColumnIndex, stickyOffsets]); | ||
return /*#__PURE__*/React.createElement(_SummaryContext.default.Provider, { | ||
@@ -39,0 +37,0 @@ value: summaryContext |
import * as React from 'react'; | ||
import type { ColumnsType, ColumnType, StickyOffsets } from '../interface'; | ||
import type { ColumnType, StickyOffsets } from '../interface'; | ||
type FlattenColumns<RecordType> = readonly (ColumnType<RecordType> & { | ||
@@ -10,4 +10,3 @@ scrollbar?: boolean; | ||
flattenColumns?: FlattenColumns<any>; | ||
columns?: ColumnsType<any>; | ||
}>; | ||
export default SummaryContext; |
@@ -40,3 +40,3 @@ "use strict"; | ||
var column = cell.column; | ||
var fixedInfo = (0, _fixUtil.getCellFixedInfo)(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction, column); | ||
var fixedInfo = (0, _fixUtil.getCellFixedInfo)(cell.colStart, cell.colEnd, flattenColumns, stickyOffsets, direction); | ||
var additionalProps; | ||
@@ -43,0 +43,0 @@ if (column && column.onHeaderCell) { |
@@ -1,2 +0,2 @@ | ||
import type { ColumnsType, ColumnType, Direction, StickyOffsets } from '../interface'; | ||
export default function useFixedInfo<RecordType>(flattenColumns: readonly ColumnType<RecordType>[], stickyOffsets: StickyOffsets, direction: Direction, columns: ColumnsType<RecordType>): import("../utils/fixUtil").FixedInfo[]; | ||
import type { ColumnType, Direction, StickyOffsets } from '../interface'; | ||
export default function useFixedInfo<RecordType>(flattenColumns: readonly ColumnType<RecordType>[], stickyOffsets: StickyOffsets, direction: Direction): import("../utils/fixUtil").FixedInfo[]; |
@@ -11,5 +11,5 @@ "use strict"; | ||
var _fixUtil = require("../utils/fixUtil"); | ||
function useFixedInfo(flattenColumns, stickyOffsets, direction, columns) { | ||
function useFixedInfo(flattenColumns, stickyOffsets, direction) { | ||
var fixedInfoList = flattenColumns.map(function (_, colIndex) { | ||
return (0, _fixUtil.getCellFixedInfo)(colIndex, colIndex, flattenColumns, stickyOffsets, direction, columns === null || columns === void 0 ? void 0 : columns[colIndex]); | ||
return (0, _fixUtil.getCellFixedInfo)(colIndex, colIndex, flattenColumns, stickyOffsets, direction); | ||
}); | ||
@@ -16,0 +16,0 @@ return (0, _useMemo.default)(function () { |
@@ -539,4 +539,3 @@ "use strict"; | ||
stickyOffsets: stickyOffsets, | ||
flattenColumns: flattenColumns, | ||
columns: columns | ||
flattenColumns: flattenColumns | ||
}, summaryNode))); | ||
@@ -583,4 +582,3 @@ } | ||
stickyOffsets: stickyOffsets, | ||
flattenColumns: flattenColumns, | ||
columns: columns | ||
flattenColumns: flattenColumns | ||
}, summaryNode))); | ||
@@ -606,3 +604,3 @@ } | ||
} | ||
var fixedInfoList = (0, _useFixedInfo.default)(flattenColumns, stickyOffsets, direction, columns); | ||
var fixedInfoList = (0, _useFixedInfo.default)(flattenColumns, stickyOffsets, direction); | ||
var TableContextValue = React.useMemo(function () { | ||
@@ -609,0 +607,0 @@ return { |
@@ -1,2 +0,2 @@ | ||
import type { ColumnGroupType, ColumnType, Direction, FixedType, StickyOffsets } from '../interface'; | ||
import type { Direction, FixedType, StickyOffsets } from '../interface'; | ||
export interface FixedInfo { | ||
@@ -11,4 +11,4 @@ fixLeft: number | false; | ||
} | ||
export declare function getCellFixedInfo<RecordType = any>(colStart: number, colEnd: number, columns: readonly { | ||
export declare function getCellFixedInfo(colStart: number, colEnd: number, columns: readonly { | ||
fixed?: FixedType; | ||
}[], stickyOffsets: StickyOffsets, direction: Direction, curColumns?: ColumnType<RecordType> | ColumnGroupType<RecordType>): FixedInfo; | ||
}[], stickyOffsets: StickyOffsets, direction: Direction): FixedInfo; |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.getCellFixedInfo = getCellFixedInfo; | ||
function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction, curColumns) { | ||
function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets, direction) { | ||
var startColumn = columns[colStart] || {}; | ||
@@ -25,4 +25,6 @@ var endColumn = columns[colEnd] || {}; | ||
// no children only | ||
var canLastFix = !(curColumns !== null && curColumns !== void 0 && curColumns.children); | ||
// need show shadow only when canLastFix is true | ||
var canLastFix = nextColumn && nextColumn.fixed === undefined || prevColumn && prevColumn.fixed === undefined || columns.every(function (col) { | ||
return col.fixed === 'left'; | ||
}); | ||
if (direction === 'rtl') { | ||
@@ -29,0 +31,0 @@ if (fixLeft !== undefined) { |
{ | ||
"name": "rc-table", | ||
"version": "7.40.0", | ||
"version": "7.41.0", | ||
"description": "table ui component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
394505
8748