diff --git a/assets/index.less b/assets/index.less index bfa245b03..37c130df4 100644 --- a/assets/index.less +++ b/assets/index.less @@ -56,76 +56,37 @@ } // ================== Cell ================== - &-fixed-column-gapped { - .@{tablePrefixCls}-cell-fix-left-last::after, - .@{tablePrefixCls}-cell-fix-right-first::after { - display: none !important; - } - } - &-cell { background: #f4f4f4; - &-fix-left, - &-fix-right { - z-index: 2; + &-fix { + position: sticky !important; + z-index: calc(2 + var(--z-offset)); } - &-fix-right:last-child:not(&-fix-sticky) { - border-right-color: transparent; - } - - .@{tablePrefixCls}-rtl & { - &-fix-right:last-child { - border-right-color: @border-color; - } - &-fix-left:last-child { - border-left-color: transparent; + &-fix-start-shadow, + &-fix-end-shadow { + &::after { + position: absolute; + top: 0; + bottom: 0; + width: 5px; + background: rgba(0, 0, 0, 0.5); + opacity: 0; + content: ''; + transition: opacity 0.3s; } - } - &-fix-left-first { - .@{tablePrefixCls}-rtl & { - box-shadow: 1px 0 0 @border-color; + &-show::after { + opacity: 1; } } - &-fix-left-first::after, - &-fix-left-last::after { - position: absolute; - top: 0; - right: -1px; - bottom: -1px; - width: 20px; - transform: translateX(100%); - transition: box-shadow 0.3s; - content: ''; - pointer-events: none; - } - - &-fix-left-all::after { - display: none; + &-fix-start-shadow::after { + inset-inline-start: 100%; } - - &-fix-right-first, - &-fix-right-last { - box-shadow: -1px 0 0 @border-color; - - .@{tablePrefixCls}-rtl & { - box-shadow: none; - } - - &::after { - position: absolute; - top: 0; - bottom: -1px; - left: -1px; - width: 20px; - transform: translateX(-100%); - transition: box-shadow 0.3s; - content: ''; - pointer-events: none; - } + &-fix-end-shadow::after { + inset-inline-end: 100%; } &&-ellipsis { @@ -134,9 +95,8 @@ text-overflow: ellipsis; // Fixed first or last should special process - &.@{tablePrefixCls}-cell-fix-left-first, - &.@{tablePrefixCls}-cell-fix-left-last, - &.@{tablePrefixCls}-cell-fix-right-first &.@{tablePrefixCls}-cell-fix-right-last { + &.@{tablePrefixCls}-cell-fix-start-shadow, + &.@{tablePrefixCls}-cell-fix-end-shadow { overflow: visible; .@{tablePrefixCls}-cell-content { diff --git a/docs/examples/fixedColumns.tsx b/docs/examples/fixedColumns.tsx index d175f1bdd..705c919ae 100644 --- a/docs/examples/fixedColumns.tsx +++ b/docs/examples/fixedColumns.tsx @@ -34,7 +34,7 @@ const columns: ColumnType[] = [ { title: 'title8', dataIndex: 'b', key: 'h' }, { title: 'title9', dataIndex: 'b', key: 'i' }, { title: 'title10', dataIndex: 'b', key: 'j' }, - { title: 'title11', dataIndex: 'b', key: 'k', width: 50 }, + { title: 'title11', dataIndex: 'b', key: 'k', width: 50, fixed: 'right' }, { title: 'title12', dataIndex: 'b', key: 'l', width: 100, fixed: 'right' }, ]; diff --git a/docs/examples/scrollXY.tsx b/docs/examples/scrollXY.tsx index a2228a19e..5a7d48677 100644 --- a/docs/examples/scrollXY.tsx +++ b/docs/examples/scrollXY.tsx @@ -4,18 +4,18 @@ import Table from 'rc-table'; import '../../assets/index.less'; const columns: TableProps['columns'] = [ - { title: 'title1', dataIndex: 'a', key: 'a', width: 100 }, + { title: 'title1', dataIndex: 'a', key: 'a', width: 100, fixed: 'start' }, { title: 'title2', dataIndex: 'b', key: 'b', width: 100 }, - { title: 'title3', dataIndex: 'c', key: 'c', width: 100 }, + { title: 'title3', dataIndex: 'c', key: 'c', width: 100, fixed: 'start' }, { title: 'title4', dataIndex: 'b', key: 'd', width: 100 }, { title: 'title5', dataIndex: 'b', key: 'e', width: 100 }, { title: 'title6', dataIndex: 'b', key: 'f', width: 100 }, { title: 'title7', dataIndex: 'b', key: 'g', width: 100 }, { title: 'title8', dataIndex: 'b', key: 'h', width: 100 }, { title: 'title9', dataIndex: 'b', key: 'i', width: 100 }, - { title: 'title10', dataIndex: 'b', key: 'j', width: 100 }, + { title: 'title10', dataIndex: 'b', key: 'j', width: 100, fixed: 'end' }, { title: 'title11', dataIndex: 'b', key: 'k', width: 100 }, - { title: 'title12', dataIndex: 'b', key: 'l', width: 100 }, + { title: 'title12', dataIndex: 'b', key: 'l', width: 100, fixed: 'end' }, ]; const data = [ @@ -32,6 +32,8 @@ const data = [ const Demo = () => { const [visible, setVisible] = React.useState(true); + const [rtl, setRtl] = React.useState(true); + return (

Scroll X/Y

@@ -43,8 +45,23 @@ const Demo = () => { > Trigger Visible + +
- +
); diff --git a/package.json b/package.json index d2f0ff7c9..62cf2ee6d 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "@types/styled-components": "^5.1.32", "@umijs/fabric": "^4.0.1", "@vitest/coverage-v8": "^2.0.5", - "cheerio": "1.0.0-rc.12", "cross-env": "^7.0.0", "dumi": "^2.1.3", "eslint": "^8.54.0", diff --git a/src/Cell/index.tsx b/src/Cell/index.tsx index 8dd562016..65e262aa9 100644 --- a/src/Cell/index.tsx +++ b/src/Cell/index.tsx @@ -37,12 +37,11 @@ export interface CellProps { shouldCellUpdate?: (record: RecordType, prevRecord: RecordType) => boolean; // Fixed - fixLeft?: number | false; - fixRight?: number | false; - firstFixLeft?: boolean; - lastFixLeft?: boolean; - firstFixRight?: boolean; - lastFixRight?: boolean; + fixStart?: number | false; + fixEnd?: number | false; + fixedStartShadow?: boolean; + fixedEndShadow?: boolean; + zIndex?: number; allColsFixedLeft?: boolean; // ====================== Private Props ====================== @@ -104,12 +103,11 @@ function Cell(props: CellProps) { rowSpan, // Fixed - fixLeft, - fixRight, - firstFixLeft, - lastFixLeft, - firstFixRight, - lastFixRight, + fixStart, + fixEnd, + fixedStartShadow, + fixedEndShadow, + zIndex, // Private appendNode, @@ -118,8 +116,7 @@ function Cell(props: CellProps) { } = props; const cellPrefixCls = `${prefixCls}-cell`; - const { supportSticky, allColumnsFixedLeft, rowHoverable } = useContext(TableContext, [ - 'supportSticky', + const { allColumnsFixedLeft, rowHoverable } = useContext(TableContext, [ 'allColumnsFixedLeft', 'rowHoverable', ]); @@ -136,16 +133,31 @@ function Cell(props: CellProps) { // ====================== Fixed ======================= const fixedStyle: React.CSSProperties = {}; - const isFixLeft = typeof fixLeft === 'number' && supportSticky; - const isFixRight = typeof fixRight === 'number' && supportSticky; + const isFixStart = typeof fixStart === 'number' && !allColumnsFixedLeft; + const isFixEnd = typeof fixEnd === 'number' && !allColumnsFixedLeft; - if (isFixLeft) { - fixedStyle.position = 'sticky'; - fixedStyle.left = fixLeft as number; + const [showFixStartShadow, showFixEndShadow] = useContext(TableContext, ({ scrollInfo }) => { + if (!isFixStart && !isFixEnd) { + return [false, false]; + } + + const [scroll, scrollWidth] = scrollInfo; + + const absScroll = Math.abs(scroll); + + const showStartShadow = isFixStart && fixedStartShadow && absScroll > fixStart; + const showEndShadow = isFixEnd && fixedEndShadow && scrollWidth - absScroll > fixEnd; + + return [showStartShadow, showEndShadow]; + }); + + if (isFixStart) { + fixedStyle.insetInlineStart = fixStart as number; + fixedStyle['--z-offset'] = zIndex; } - if (isFixRight) { - fixedStyle.position = 'sticky'; - fixedStyle.right = fixRight as number; + if (isFixEnd) { + fixedStyle.insetInlineEnd = fixEnd as number; + fixedStyle['--z-offset'] = zIndex; } // ================ RowSpan & ColSpan ================= @@ -190,16 +202,20 @@ function Cell(props: CellProps) { cellPrefixCls, className, { - [`${cellPrefixCls}-fix-left`]: isFixLeft && supportSticky, - [`${cellPrefixCls}-fix-left-first`]: firstFixLeft && supportSticky, - [`${cellPrefixCls}-fix-left-last`]: lastFixLeft && supportSticky, - [`${cellPrefixCls}-fix-left-all`]: lastFixLeft && allColumnsFixedLeft && supportSticky, - [`${cellPrefixCls}-fix-right`]: isFixRight && supportSticky, - [`${cellPrefixCls}-fix-right-first`]: firstFixRight && supportSticky, - [`${cellPrefixCls}-fix-right-last`]: lastFixRight && supportSticky, + // Fixed + [`${cellPrefixCls}-fix`]: isFixStart || isFixEnd, + [`${cellPrefixCls}-fix-start`]: isFixStart, + [`${cellPrefixCls}-fix-end`]: isFixEnd, + + // Fixed shadow + [`${cellPrefixCls}-fix-start-shadow`]: fixedStartShadow, + [`${cellPrefixCls}-fix-start-shadow-show`]: fixedStartShadow && showFixStartShadow, + [`${cellPrefixCls}-fix-end-shadow`]: fixedEndShadow, + [`${cellPrefixCls}-fix-end-shadow-show`]: fixedEndShadow && showFixEndShadow, + [`${cellPrefixCls}-ellipsis`]: ellipsis, [`${cellPrefixCls}-with-append`]: appendNode, - [`${cellPrefixCls}-fix-sticky`]: (isFixLeft || isFixRight) && isSticky && supportSticky, + [`${cellPrefixCls}-fix-sticky`]: (isFixStart || isFixEnd) && isSticky, [`${cellPrefixCls}-row-hover`]: !legacyCellProps && hovering, }, additionalProps.className, @@ -233,7 +249,7 @@ function Cell(props: CellProps) { mergedChildNode = null; } - if (ellipsis && (lastFixLeft || firstFixRight)) { + if (ellipsis && (fixedStartShadow || fixedEndShadow)) { mergedChildNode = {mergedChildNode}; } diff --git a/src/FixedHolder/index.tsx b/src/FixedHolder/index.tsx index fb450cefe..f2a4a6331 100644 --- a/src/FixedHolder/index.tsx +++ b/src/FixedHolder/index.tsx @@ -85,7 +85,22 @@ const FixedHolder = React.forwardRef>((pro function onWheel(e: WheelEvent) { const { currentTarget, deltaX } = e as unknown as React.WheelEvent; if (deltaX) { - onScroll({ currentTarget, scrollLeft: currentTarget.scrollLeft + deltaX }); + const { scrollLeft, scrollWidth, clientWidth } = currentTarget; + const maxScrollWidth = scrollWidth - clientWidth; + let nextScroll = scrollLeft + deltaX; + + if (direction === 'rtl') { + nextScroll = Math.max(-maxScrollWidth, nextScroll); + nextScroll = Math.min(0, nextScroll); + } else { + nextScroll = Math.min(maxScrollWidth, nextScroll); + nextScroll = Math.max(0, nextScroll); + } + + onScroll({ + currentTarget, + scrollLeft: nextScroll, + }); e.preventDefault(); } } @@ -124,13 +139,15 @@ const FixedHolder = React.forwardRef>((pro // Calculate the sticky offsets const headerStickyOffsets = useMemo(() => { - const { right, left } = stickyOffsets; + const { start, end } = stickyOffsets; return { ...stickyOffsets, - left: - direction === 'rtl' ? [...left.map(width => width + combinationScrollBarSize), 0] : left, - right: - direction === 'rtl' ? right : [...right.map(width => width + combinationScrollBarSize), 0], + // left: + // direction === 'rtl' ? [...left.map(width => width + combinationScrollBarSize), 0] : left, + // right: + // direction === 'rtl' ? right : [...right.map(width => width + combinationScrollBarSize), 0], + start: start, + end: [...end.map(width => width + combinationScrollBarSize), 0], isSticky, }; }, [combinationScrollBarSize, stickyOffsets, isSticky]); diff --git a/src/Footer/Cell.tsx b/src/Footer/Cell.tsx index 2ecbd407a..c146c3316 100644 --- a/src/Footer/Cell.tsx +++ b/src/Footer/Cell.tsx @@ -23,17 +23,14 @@ export default function SummaryCell({ rowSpan, align, }: SummaryCellProps) { - const { prefixCls, direction } = useContext(TableContext, ['prefixCls', 'direction']); + const { prefixCls } = useContext(TableContext, ['prefixCls']); const { scrollColumnIndex, stickyOffsets, flattenColumns } = React.useContext(SummaryContext); const lastIndex = index + colSpan - 1; const mergedColSpan = lastIndex + 1 === scrollColumnIndex ? colSpan + 1 : colSpan; - const fixedInfo = getCellFixedInfo( - index, - index + mergedColSpan - 1, - flattenColumns, - stickyOffsets, - direction, + const fixedInfo = React.useMemo( + () => getCellFixedInfo(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets), + [index, mergedColSpan, flattenColumns, stickyOffsets], ); return ( diff --git a/src/Header/HeaderRow.tsx b/src/Header/HeaderRow.tsx index fe7629c64..fe83ac5ed 100644 --- a/src/Header/HeaderRow.tsx +++ b/src/Header/HeaderRow.tsx @@ -32,7 +32,7 @@ const HeaderRow = (props: RowProps) => { onHeaderRow, index, } = props; - const { prefixCls, direction } = useContext(TableContext, ['prefixCls', 'direction']); + const { prefixCls } = useContext(TableContext, ['prefixCls']); let rowProps: React.HTMLAttributes; if (onHeaderRow) { rowProps = onHeaderRow( @@ -52,7 +52,6 @@ const HeaderRow = (props: RowProps) => { cell.colEnd, flattenColumns, stickyOffsets, - direction, ); let additionalProps: React.HTMLAttributes; diff --git a/src/Table.tsx b/src/Table.tsx index 52d4d772e..9ecd81120 100644 --- a/src/Table.tsx +++ b/src/Table.tsx @@ -28,7 +28,6 @@ import type { CompareProps } from '@rc-component/context/lib/Immutable'; import classNames from 'classnames'; import ResizeObserver from '@rc-component/resize-observer'; import isVisible from '@rc-component/util/lib/Dom/isVisible'; -import { isStyleSupport } from '@rc-component/util/lib/Dom/styleChecker'; import { getTargetScrollBarSize } from '@rc-component/util/lib/getScrollBarSize'; import useEvent from '@rc-component/util/lib/hooks/useEvent'; import pickAttrs from '@rc-component/util/lib/pickAttrs'; @@ -38,7 +37,7 @@ import * as React from 'react'; import Body from './Body'; import ColGroup from './ColGroup'; import { EXPAND_COLUMN, INTERNAL_HOOKS } from './constant'; -import TableContext, { makeImmutable } from './context/TableContext'; +import TableContext, { makeImmutable, type ScrollInfoType } from './context/TableContext'; import type { FixedHeaderProps } from './FixedHolder'; import FixedHolder from './FixedHolder'; import Footer, { FooterComponents } from './Footer'; @@ -76,6 +75,7 @@ import Column from './sugar/Column'; import ColumnGroup from './sugar/ColumnGroup'; import { getColumnsKey, validateValue, validNumberValue } from './utils/valueUtil'; import { getDOM } from '@rc-component/util/lib/Dom/findDOMNode'; +import isEqual from '@rc-component/util/lib/isEqual'; export const DEFAULT_PREFIX = 'rc-table'; @@ -290,7 +290,7 @@ function Table( const scrollX = scroll?.x; const [componentWidth, setComponentWidth] = React.useState(0); - const [columns, flattenColumns, flattenScrollX, hasGapFixed] = useColumns( + const [columns, flattenColumns, flattenScrollX] = useColumns( { ...props, ...expandableConfig, @@ -355,7 +355,7 @@ function Table( const colsKeys = getColumnsKey(flattenColumns); const pureColWidths = colsKeys.map(columnKey => colsWidths.get(columnKey)); const colWidths = React.useMemo(() => pureColWidths, [pureColWidths.join('_')]); - const stickyOffsets = useStickyOffsets(colWidths, flattenColumns, direction); + const stickyOffsets = useStickyOffsets(colWidths, flattenColumns); const fixHeader = scroll && validateValue(scroll.y); const horizonScroll = (scroll && validateValue(mergedScrollX)) || Boolean(expandableConfig.fixed); const fixColumn = horizonScroll && flattenColumns.some(({ fixed }) => fixed); @@ -436,6 +436,8 @@ function Table( } } + const [scrollInfo, setScrollInfo] = React.useState([0, 0]); + const onInternalScroll = useEvent( ({ currentTarget, scrollLeft }: { currentTarget: HTMLElement; scrollLeft?: number }) => { const isRTL = direction === 'rtl'; @@ -460,6 +462,12 @@ function Table( ? mergedScrollX : measureTarget.scrollWidth; const clientWidth = measureTarget.clientWidth; + + setScrollInfo(ori => { + const nextScrollInfo: ScrollInfoType = [mergedScrollLeft, scrollWidth - clientWidth]; + return isEqual(ori, nextScrollInfo) ? ori : nextScrollInfo; + }); + // There is no space to scroll if (scrollWidth === clientWidth) { setPingedLeft(false); @@ -522,7 +530,6 @@ function Table( // ===================== Effects ====================== const [scrollbarSize, setScrollbarSize] = React.useState(0); - const [supportSticky, setSupportSticky] = React.useState(true); // Only IE not support, we mark as support first React.useEffect(() => { if (!tailor || !useInternalHooks) { @@ -532,7 +539,6 @@ function Table( setScrollbarSize(getTargetScrollBarSize(scrollBodyContainerRef.current).width); } } - setSupportSticky(isStyleSupport('position', 'sticky')); }, []); // ================== INTERNAL HOOKS ================== @@ -771,7 +777,6 @@ function Table( [`${prefixCls}-fixed-header`]: fixHeader, /** No used but for compatible */ [`${prefixCls}-fixed-column`]: fixColumn, - [`${prefixCls}-fixed-column-gapped`]: fixColumn && hasGapFixed, [`${prefixCls}-scroll-horizontal`]: horizonScroll, [`${prefixCls}-has-fix-left`]: flattenColumns[0] && flattenColumns[0].fixed, [`${prefixCls}-has-fix-right`]: @@ -795,12 +800,13 @@ function Table( fullTable = {fullTable}; } - const fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets, direction); + const fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets); const TableContextValue = React.useMemo( () => ({ // Scroll scrollX: mergedScrollX, + scrollInfo, // Table prefixCls, @@ -809,7 +815,6 @@ function Table( direction, fixedInfoList, isSticky, - supportSticky, componentWidth, fixHeader, @@ -851,6 +856,7 @@ function Table( [ // Scroll mergedScrollX, + scrollInfo, // Table prefixCls, @@ -859,7 +865,6 @@ function Table( direction, fixedInfoList, isSticky, - supportSticky, componentWidth, fixHeader, diff --git a/src/context/TableContext.tsx b/src/context/TableContext.tsx index f566c84f0..cce41f90b 100644 --- a/src/context/TableContext.tsx +++ b/src/context/TableContext.tsx @@ -18,6 +18,8 @@ import type { FixedInfo } from '../utils/fixUtil'; const { makeImmutable, responseImmutable, useImmutableMark } = createImmutable(); export { makeImmutable, responseImmutable, useImmutableMark }; +export type ScrollInfoType = [scrollLeft: number, scrollRange: number]; + export interface TableContextProps { // Scroll scrollX: number | string | true; @@ -29,11 +31,11 @@ export interface TableContextProps { direction: Direction; fixedInfoList: readonly FixedInfo[]; isSticky: boolean; - supportSticky: boolean; componentWidth: number; fixHeader: boolean; fixColumn: boolean; horizonScroll: boolean; + scrollInfo: ScrollInfoType; // Body rowClassName: string | RowClassName; diff --git a/src/hooks/useColumns/index.tsx b/src/hooks/useColumns/index.tsx index c387157c4..c6792b9a4 100644 --- a/src/hooks/useColumns/index.tsx +++ b/src/hooks/useColumns/index.tsx @@ -152,7 +152,6 @@ function useColumns( columns: ColumnsType, flattenColumns: readonly ColumnType[], realScrollWidth: undefined | number, - hasGapFixed: boolean, ] { const baseColumns = React.useMemo>(() => { const newColumns = columns || convertChildrenToColumns(children) || []; @@ -275,41 +274,6 @@ function useColumns( // eslint-disable-next-line react-hooks/exhaustive-deps }, [mergedColumns, direction, scrollWidth]); - // ========================= Gap Fixed ======================== - const hasGapFixed = React.useMemo(() => { - // Fixed: left, since old browser not support `findLastIndex`, we should use reverse loop - let lastLeftIndex = -1; - for (let i = flattenColumns.length - 1; i >= 0; i -= 1) { - const colFixed = flattenColumns[i].fixed; - if (colFixed === 'left' || colFixed === true) { - lastLeftIndex = i; - break; - } - } - - if (lastLeftIndex >= 0) { - for (let i = 0; i <= lastLeftIndex; i += 1) { - const colFixed = flattenColumns[i].fixed; - if (colFixed !== 'left' && colFixed !== true) { - return true; - } - } - } - - // Fixed: right - const firstRightIndex = flattenColumns.findIndex(({ fixed: colFixed }) => colFixed === 'right'); - if (firstRightIndex >= 0) { - for (let i = firstRightIndex; i < flattenColumns.length; i += 1) { - const colFixed = flattenColumns[i].fixed; - if (colFixed !== 'right') { - return true; - } - } - } - - return false; - }, [flattenColumns]); - // ========================= FillWidth ======================== const [filledColumns, realScrollWidth] = useWidthColumns( flattenColumns, @@ -317,7 +281,7 @@ function useColumns( clientWidth, ); - return [mergedColumns, filledColumns, realScrollWidth, hasGapFixed]; + return [mergedColumns, filledColumns, realScrollWidth]; } export default useColumns; diff --git a/src/hooks/useFixedInfo.ts b/src/hooks/useFixedInfo.ts index 799fc27fb..535fccf62 100644 --- a/src/hooks/useFixedInfo.ts +++ b/src/hooks/useFixedInfo.ts @@ -1,15 +1,19 @@ import useMemo from '@rc-component/util/lib/hooks/useMemo'; import isEqual from '@rc-component/util/lib/isEqual'; -import type { ColumnType, Direction, StickyOffsets } from '../interface'; +import type { ColumnType, StickyOffsets } from '../interface'; import { getCellFixedInfo } from '../utils/fixUtil'; +import * as React from 'react'; export default function useFixedInfo( flattenColumns: readonly ColumnType[], stickyOffsets: StickyOffsets, - direction: Direction, ) { - const fixedInfoList = flattenColumns.map((_, colIndex) => - getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets, direction), + const fixedInfoList = React.useMemo( + () => + flattenColumns.map((_, colIndex) => + getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets), + ), + [flattenColumns, stickyOffsets], ); return useMemo( diff --git a/src/hooks/useStickyOffsets.ts b/src/hooks/useStickyOffsets.ts index 220f66667..bb0d92a2b 100644 --- a/src/hooks/useStickyOffsets.ts +++ b/src/hooks/useStickyOffsets.ts @@ -1,5 +1,5 @@ import { useMemo } from 'react'; -import type { ColumnType, Direction, StickyOffsets } from '../interface'; +import type { ColumnType, StickyOffsets } from '../interface'; /** * Get sticky column offset width @@ -7,7 +7,6 @@ import type { ColumnType, Direction, StickyOffsets } from '../interface'; function useStickyOffsets( colWidths: number[], flattenColumns: readonly ColumnType[], - direction: Direction, ) { const stickyOffsets: StickyOffsets = useMemo(() => { const columnCount = flattenColumns.length; @@ -30,16 +29,11 @@ function useStickyOffsets( const startOffsets = getOffsets(0, columnCount, 1); const endOffsets = getOffsets(columnCount - 1, -1, -1).reverse(); - return direction === 'rtl' - ? { - left: endOffsets, - right: startOffsets, - } - : { - left: startOffsets, - right: endOffsets, - }; - }, [colWidths, flattenColumns, direction]); + return { + start: startOffsets, + end: endOffsets, + }; + }, [colWidths, flattenColumns]); return stickyOffsets; } diff --git a/src/interface.ts b/src/interface.ts index e645b2145..1b754733f 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -20,7 +20,10 @@ import type { DeepNamePath } from './namePathType'; export type Key = React.Key; -export type FixedType = 'left' | 'right' | boolean; +/** + * Use `start` or `end` instead. `left` or `right` is deprecated. + */ +export type FixedType = 'start' | 'end' | 'left' | 'right' | boolean; export type DefaultRecordType = Record; @@ -128,8 +131,8 @@ export type GetRowKey = (record: RecordType, index?: number) => Key; // ================= Fix Column ================= export interface StickyOffsets { - left: readonly number[]; - right: readonly number[]; + start: readonly number[]; + end: readonly number[]; isSticky?: boolean; } diff --git a/src/utils/fixUtil.ts b/src/utils/fixUtil.ts index e1540f395..74d4062c1 100644 --- a/src/utils/fixUtil.ts +++ b/src/utils/fixUtil.ts @@ -1,16 +1,25 @@ -import type { Direction, FixedType, StickyOffsets } from '../interface'; +import type { FixedType, StickyOffsets } from '../interface'; export interface FixedInfo { - fixLeft: number | false; - fixRight: number | false; - lastFixLeft: boolean; - firstFixRight: boolean; - - // For Rtl Direction - lastFixRight: boolean; - firstFixLeft: boolean; + fixStart: number | false; + fixEnd: number | false; isSticky: boolean; + + // Position info(for shadow usage) + /** `fixed: start` with shadow */ + fixedStartShadow?: boolean; + /** `fixed: end` with shadow */ + fixedEndShadow?: boolean; + + zIndex?: number; +} + +function isFixedStart(column: { fixed?: FixedType }) { + return column.fixed === 'left' || column.fixed === 'start'; +} +function isFixedEnd(column: { fixed?: FixedType }) { + return column.fixed === 'right' || column.fixed === 'end'; } export function getCellFixedInfo( @@ -18,58 +27,43 @@ export function getCellFixedInfo( colEnd: number, columns: readonly { fixed?: FixedType }[], stickyOffsets: StickyOffsets, - direction: Direction, ): FixedInfo { const startColumn = columns[colStart] || {}; const endColumn = columns[colEnd] || {}; - let fixLeft: number; - let fixRight: number; + let fixStart: number = null; + let fixEnd: number = null; - if (startColumn.fixed === 'left') { - fixLeft = stickyOffsets.left[direction === 'rtl' ? colEnd : colStart]; - } else if (endColumn.fixed === 'right') { - fixRight = stickyOffsets.right[direction === 'rtl' ? colStart : colEnd]; + if (isFixedStart(startColumn) && isFixedStart(endColumn)) { + fixStart = stickyOffsets.start[colStart]; + } else if (isFixedEnd(endColumn) && isFixedEnd(startColumn)) { + fixEnd = stickyOffsets.end[colEnd]; } - let lastFixLeft: boolean = false; - let firstFixRight: boolean = false; - - let lastFixRight: boolean = false; - let firstFixLeft: boolean = false; + // check if need to add shadow + let fixedStartShadow: boolean; + let fixedEndShadow: boolean; - const nextColumn = columns[colEnd + 1]; - const prevColumn = columns[colStart - 1]; + // Calc `zIndex`. + // first fixed start (start -> end) column `zIndex` should be greater than next column. + // first fixed end (end -> start) column `zIndex` should be greater than next column. + let zIndex = 0; - // need show shadow only when canLastFix is true - const canLastFix = - (nextColumn && !nextColumn.fixed) || - (prevColumn && !prevColumn.fixed) || - columns.every(col => col.fixed === 'left'); - - if (direction === 'rtl') { - if (fixLeft !== undefined) { - const prevFixLeft = prevColumn && prevColumn.fixed === 'left'; - firstFixLeft = !prevFixLeft && canLastFix; - } else if (fixRight !== undefined) { - const nextFixRight = nextColumn && nextColumn.fixed === 'right'; - lastFixRight = !nextFixRight && canLastFix; - } - } else if (fixLeft !== undefined) { - const nextFixLeft = nextColumn && nextColumn.fixed === 'left'; - lastFixLeft = !nextFixLeft && canLastFix; - } else if (fixRight !== undefined) { - const prevFixRight = prevColumn && prevColumn.fixed === 'right'; - firstFixRight = !prevFixRight && canLastFix; + if (fixStart !== null) { + fixedStartShadow = !columns[colEnd + 1] || !isFixedStart(columns[colEnd + 1]); + zIndex = columns.length * 2 - colStart; // Fix start always overlay fix end + } + if (fixEnd !== null) { + fixedEndShadow = !columns[colStart - 1] || !isFixedEnd(columns[colStart - 1]); + zIndex = colEnd; } return { - fixLeft, - fixRight, - lastFixLeft, - firstFixRight, - lastFixRight, - firstFixLeft, + fixStart, + fixEnd, + fixedStartShadow, + fixedEndShadow, isSticky: stickyOffsets.isSticky, + zIndex, }; } diff --git a/tests/FixedColumn.spec.tsx b/tests/FixedColumn.spec.tsx index e5803fe25..f8ba6904b 100644 --- a/tests/FixedColumn.spec.tsx +++ b/tests/FixedColumn.spec.tsx @@ -208,22 +208,6 @@ describe('Table.FixedColumn', () => { expect(container.firstChild).toMatchSnapshot(); }); - it('has correct scroll classNames when table direction is RTL', () => { - const { container } = render(
); - - expect(container.querySelector('.rc-table')?.classList.contains('rc-table-rtl')).toBeTruthy(); - - expect(container.querySelector('.rc-table-row')?.querySelector('.rc-table-cell')).toHaveClass( - 'rc-table-cell-fix-right', - ); - - expect( - container.querySelector('.rc-table-row')?.querySelectorAll('.rc-table-cell')[ - container.querySelector('.rc-table-row')?.querySelectorAll('.rc-table-cell').length - 1 - ], - ).toHaveClass('rc-table-cell-fix-left'); - }); - it('not break measure count', async () => { const { container, rerender } = render(
, @@ -240,17 +224,15 @@ describe('Table.FixedColumn', () => { expect(container.querySelectorAll('.rc-table-measure-row td')).toHaveLength(4); }); - it('when all columns fixed left,cell should has classname rc-table-cell-fix-left-all', async () => { + it('when all columns fixed left, should not add fixed className', async () => { const { container } = render(
, ); - await act(async () => { vi.runAllTimers(); await Promise.resolve(); }); - - expect(container.querySelectorAll('.rc-table-cell-fix-left-all')).toHaveLength(10); + expect(container.querySelector('.rc-table-cell-fix')).toBeFalsy(); }); describe('cross fixed support', () => { @@ -274,9 +256,13 @@ describe('Table.FixedColumn', () => { await Promise.resolve(); }); - expect(container.querySelectorAll('tbody .rc-table-cell-fix-left')).toHaveLength(2); - expect(container.querySelectorAll('thead th')[1]).toHaveStyle({ left: '0px' }); - expect(container.querySelectorAll('thead th')[2]).toHaveStyle({ left: '1000px' }); + expect(container.querySelectorAll('tbody .rc-table-cell-fix-start')).toHaveLength(2); + expect(container.querySelectorAll('thead th')[1]).toHaveStyle({ + 'inset-inline-start': '0', + }); + expect(container.querySelectorAll('thead th')[2]).toHaveStyle({ + 'inset-inline-start': '1000px', + }); }); }); describe('components.table by sticky', () => { @@ -295,13 +281,11 @@ describe('Table.FixedColumn', () => { }); it('shadow should display correctly', async () => { const { container, rerender } = render(); - expect(container.querySelectorAll('.rc-table-cell-fix-left-last').length).toBe(104); - expect(container.querySelectorAll('.rc-table-cell-fix-right-first').length).toBe(101); - expect(container).toMatchSnapshot(); + expect(container.querySelectorAll('.rc-table-cell-fix-start-shadow').length).toBe(104); + expect(container.querySelectorAll('.rc-table-cell-fix-end-shadow').length).toBe(101); rerender(); - expect(container.querySelectorAll('.rc-table-cell-fix-left-last').length).toBe(4); - expect(container.querySelectorAll('.rc-table-cell-fix-right-first').length).toBe(4); - expect(container).toMatchSnapshot(); + expect(container.querySelectorAll('.rc-table-cell-fix-start-shadow').length).toBe(4); + expect(container.querySelectorAll('.rc-table-cell-fix-end-shadow').length).toBe(4); }); it('shadow should be shown when there are columns where fixed is false', async () => { @@ -331,9 +315,9 @@ describe('Table.FixedColumn', () => { ]} />, ); - expect(container.querySelectorAll('.rc-table-cell-fix-left-last').length).toBe(101); - expect(container.querySelectorAll('.rc-table-cell-fix-right-first').length).toBe(101); - expect(container).toMatchSnapshot(); + + expect(container.querySelectorAll('.rc-table-cell-fix-end-shadow')).toHaveLength(101); + expect(container.querySelectorAll('.rc-table-cell-fix-start-shadow')).toHaveLength(101); }); it('right shadow should be shown when scrollX is less than the sum of the widths of all columns', async () => { diff --git a/tests/FixedHeader.spec.jsx b/tests/FixedHeader.spec.jsx index 61db69e4f..4d3e29c35 100644 --- a/tests/FixedHeader.spec.jsx +++ b/tests/FixedHeader.spec.jsx @@ -154,7 +154,7 @@ describe('Table.FixedHeader', () => { vi.useRealTimers(); }); - it('do not mask as ant-table-cell-fix-left-last in nested table parent cell', async () => { + it('do not mask as fixed in nested table parent cell', async () => { const columns = [ { title: '父表头右侧的阴影导致整个表格最右侧有空隙', @@ -201,8 +201,11 @@ describe('Table.FixedHeader', () => { }, ]; const { container } = render(
); - await safeAct(container); - expect(container.querySelectorAll('td')[9].className).toContain('rc-table-cell-fix-left-last'); - expect(container.querySelector('th').className).not.toContain('rc-table-cell-fix-left-last'); + await act(async () => { + vi.runAllTimers(); + await Promise.resolve(); + }); + expect(container.querySelectorAll('th.rc-table-cell-fix-start')).toHaveLength(2); + expect(container.querySelectorAll('th.rc-table-cell-fix-end')).toHaveLength(1); }); }); diff --git a/tests/Sticky.spec.jsx b/tests/Sticky.spec.jsx index 18955068b..1c22e62b6 100644 --- a/tests/Sticky.spec.jsx +++ b/tests/Sticky.spec.jsx @@ -237,15 +237,10 @@ describe('Table.Sticky', () => { await act(async () => { vi.runAllTimers(); }); - const fixedCell = container.querySelector( - '.rc-table-cell-fix-right-first.rc-table-cell-fix-sticky', - ); - expect(fixedCell.style).toEqual( - expect.objectContaining({ - position: 'sticky', - right: '0px', - }), - ); + const fixedCell = container.querySelector('.rc-table-cell-fix-end.rc-table-cell-fix-sticky'); + expect(fixedCell).toHaveStyle({ + 'inset-inline-end': '0', + }); expect(container.querySelector('.rc-table-cell-fix-sticky')).not.toBeNull(); vi.useRealTimers(); @@ -284,15 +279,10 @@ describe('Table.Sticky', () => { await act(async () => { vi.runAllTimers(); }); - const fixedCell = container.querySelector( - '.rc-table-cell-fix-right-first.rc-table-cell-fix-sticky', - ); - expect(fixedCell.style).toEqual( - expect.objectContaining({ - position: 'sticky', - right: '15px', - }), - ); + const fixedCell = container.querySelector('.rc-table-cell-fix-end.rc-table-cell-fix-sticky'); + expect(fixedCell).toHaveStyle({ + 'inset-inline-end': '15px', + }); vi.useRealTimers(); }); diff --git a/tests/__snapshots__/ExpandRow.spec.jsx.snap b/tests/__snapshots__/ExpandRow.spec.jsx.snap index 0aa2b5cf9..a62669dc8 100644 --- a/tests/__snapshots__/ExpandRow.spec.jsx.snap +++ b/tests/__snapshots__/ExpandRow.spec.jsx.snap @@ -460,13 +460,13 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = ` > @@ -477,9 +477,9 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = ` Age @@ -535,16 +535,16 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = ` data-row-key="0" > @@ -554,8 +554,8 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = ` 27 @@ -582,16 +582,16 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = ` data-row-key="1" > @@ -601,8 +601,8 @@ exports[`Table.Expand > renders fixed column correctly > work 1`] = ` 28 @@ -1028,7 +1028,7 @@ exports[`Table.Expand > work in expandable fix 1`] = ` exports[`Table.Expand > work in expandable fix 2`] = `
work in expandable fix 2`] = ` Gender
@@ -1141,8 +1141,8 @@ exports[`Table.Expand > work in expandable fix 2`] = ` F - - - , - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} -`; - -exports[`Table.FixedColumn > renders correctly > scrollX - with data 1`] = ` -LoadedCheerio { - "0":
-
-
-
Name Gender Lucy F Jack M
work in expandable fix 2`] = ` M fixed column renders correctly RTL 1`] = ` -LoadedCheerio { - "0":
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- title1 - - title2 - - title3 - - title4 - - title5 - - title6 - - title7 - - title8 - - title9 - - title10 - - title11 - - title12 -
- 123 - - - 1111 - - - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx -
- cdd - - - 1111 - - - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 -
- 133 - - - 1111 - - - edd12221 - - - - - - - - - -
- 133 - - - 1111 - - - edd12221 - - - - - - - - - -
- 133 - - - 1111 - - - edd12221 - - - - - - - - - -
- 133 - - - 1111 - - - edd12221 - - - - - - - - - -
- 133 - - - 1111 - - - edd12221 - - - - - - - - - -
- 133 - - - 1111 - - - edd12221 - - - - - - - - - -
- 133 - - - 1111 - - - edd12221 - - - - - - - - - -
-
-
-
, - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} -`; - -exports[`Table.FixedColumn > renders correctly > all column has width should use it 1`] = ` -LoadedCheerio { - "0":
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- title1 - - - title2 - - - title3 - - title4 - - title5 - - title6 - - title7 - - title8 - - title9 - - title10 - - title11 - - title12 -
- 123 - - - - 1111 - - - - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx -
- cdd - - - - 1111 - - - - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
-
-
- , - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} -`; - -exports[`Table.FixedColumn > renders correctly > scrollX - without data 1`] = ` -LoadedCheerio { - "0":
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- title1 - - - title2 - - - title3 - - title4 - - title5 - - title6 - - title7 - - title8 - - title9 - - title10 - - title11 - - title12 -
-
- No Data -
-
-
-
-
, - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} -`; - -exports[`Table.FixedColumn > renders correctly > scrollXY - with data 1`] = ` -LoadedCheerio { - "0":
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- title1 - - - title2 - - - title3 - - title4 - - title5 - - title6 - - title7 - - title8 - - title9 - - title10 - - title11 - - title12 - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 123 - - - - 1111 - - - - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx - - xxxxxxxx -
- cdd - - - - 1111 - - - - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 - - edd12221 -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
- 133 - - - - 1111 - - - - edd12221 - - - - - - - - - -
-
-
-
, - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} -`; - -exports[`Table.FixedColumn > renders correctly > scrollXY - without data 1`] = ` -LoadedCheerio { - "0":
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- title1 - - - title2 - - - title3 - - title4 - - title5 - - title6 - - title7 - - title8 - - title9 - - title10 - - title11 - - title12 - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- No Data -
-
-
-
-
, - "_root": LoadedCheerio { - "0": Document { - "children": [ - - - - , - ], - "endIndex": null, - "next": null, - "parent": null, - "prev": null, - "startIndex": null, - "type": "root", - "x-mode": "quirks", - }, - "_root": [Circular], - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, - }, - "length": 1, - "options": { - "decodeEntities": true, - "xml": false, - }, -} -`; diff --git a/tests/__snapshots__/FixedColumn.spec.tsx.snap b/tests/__snapshots__/FixedColumn.spec.tsx.snap index 7cef08e2d..fe1e10d9f 100644 --- a/tests/__snapshots__/FixedColumn.spec.tsx.snap +++ b/tests/__snapshots__/FixedColumn.spec.tsx.snap @@ -2,7 +2,7 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = `
fixed column renders correctly RTL 1`] = ` > title1 title2 @@ -108,9 +108,9 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` title11 title12 @@ -238,14 +238,14 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` data-row-key="1" > 123 @@ -296,8 +296,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` xxxxxxxx xxxxxxxx @@ -307,14 +307,14 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` data-row-key="2" > cdd @@ -365,8 +365,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` edd12221 edd12221 @@ -376,14 +376,14 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` data-row-key="3" > 133 @@ -420,8 +420,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` class="rc-table-cell" /> fixed column renders correctly RTL 1`] = ` data-row-key="4" > 133 @@ -473,8 +473,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` class="rc-table-cell" /> fixed column renders correctly RTL 1`] = ` data-row-key="5" > 133 @@ -526,8 +526,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` class="rc-table-cell" /> fixed column renders correctly RTL 1`] = ` data-row-key="6" > 133 @@ -579,8 +579,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` class="rc-table-cell" /> fixed column renders correctly RTL 1`] = ` data-row-key="7" > 133 @@ -632,8 +632,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` class="rc-table-cell" /> fixed column renders correctly RTL 1`] = ` data-row-key="8" > 133 @@ -685,8 +685,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` class="rc-table-cell" /> fixed column renders correctly RTL 1`] = ` data-row-key="9" > 133 @@ -738,8 +738,8 @@ exports[`Table.FixedColumn > fixed column renders correctly RTL 1`] = ` class="rc-table-cell" /> @@ -790,16 +790,16 @@ exports[`Table.FixedColumn > renders correctly > scrollX - with data 1`] = ` > title1 renders correctly > scrollX - with data 1`] = ` title11 title12 @@ -993,14 +993,14 @@ exports[`Table.FixedColumn > renders correctly > scrollX - with data 1`] = ` data-row-key="1" > 123 renders correctly > scrollX - with data 1`] = ` xxxxxxxx xxxxxxxx @@ -1066,14 +1066,14 @@ exports[`Table.FixedColumn > renders correctly > scrollX - with data 1`] = ` data-row-key="2" > cdd renders correctly > scrollX - with data 1`] = ` edd12221 edd12221 @@ -1139,14 +1139,14 @@ exports[`Table.FixedColumn > renders correctly > scrollX - with data 1`] = ` data-row-key="3" > 133 renders correctly > scrollX - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollX - with data 1`] = ` data-row-key="4" > 133 renders correctly > scrollX - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollX - with data 1`] = ` data-row-key="5" > 133 renders correctly > scrollX - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollX - with data 1`] = ` data-row-key="6" > 133 renders correctly > scrollX - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollX - with data 1`] = ` data-row-key="7" > 133 renders correctly > scrollX - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollX - with data 1`] = ` data-row-key="8" > 133 renders correctly > scrollX - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollX - with data 1`] = ` data-row-key="9" > 133 renders correctly > scrollX - with data 1`] = ` class="rc-table-cell" /> @@ -1579,16 +1579,16 @@ exports[`Table.FixedColumn > renders correctly > scrollX - without data 1`] = ` > title1 renders correctly > scrollX - without data 1`] = ` title11 title12 @@ -1859,16 +1859,16 @@ exports[`Table.FixedColumn > renders correctly > scrollXY - with data 1`] = ` > title1 renders correctly > scrollXY - with data 1`] = ` title11 title12 @@ -2095,14 +2095,14 @@ exports[`Table.FixedColumn > renders correctly > scrollXY - with data 1`] = ` data-row-key="1" > 123 renders correctly > scrollXY - with data 1`] = ` xxxxxxxx xxxxxxxx @@ -2168,14 +2168,14 @@ exports[`Table.FixedColumn > renders correctly > scrollXY - with data 1`] = ` data-row-key="2" > cdd renders correctly > scrollXY - with data 1`] = ` edd12221 edd12221 @@ -2241,14 +2241,14 @@ exports[`Table.FixedColumn > renders correctly > scrollXY - with data 1`] = ` data-row-key="3" > 133 renders correctly > scrollXY - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollXY - with data 1`] = ` data-row-key="4" > 133 renders correctly > scrollXY - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollXY - with data 1`] = ` data-row-key="5" > 133 renders correctly > scrollXY - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollXY - with data 1`] = ` data-row-key="6" > 133 renders correctly > scrollXY - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollXY - with data 1`] = ` data-row-key="7" > 133 renders correctly > scrollXY - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollXY - with data 1`] = ` data-row-key="8" > 133 renders correctly > scrollXY - with data 1`] = ` class="rc-table-cell" /> renders correctly > scrollXY - with data 1`] = ` data-row-key="9" > 133 renders correctly > scrollXY - with data 1`] = ` class="rc-table-cell" /> @@ -2702,16 +2702,16 @@ exports[`Table.FixedColumn > renders correctly > scrollXY - without data 1`] = ` > title1 renders correctly > scrollXY - without data 1`] = ` title11 title12 @@ -2954,8676 +2954,3 @@ exports[`Table.FixedColumn > renders correctly > scrollXY - without data 1`] = `
`; - -exports[`Table.FixedColumn > shadow should be shown when there are columns where fixed is false 1`] = ` -
-
-
-
- - - - - - - - - - -
- Other - - Name - - Company - - Gender - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
- - John Brown - - - M -
-
-
-
-
-`; - -exports[`Table.FixedColumn > shadow should display correctly 1`] = ` -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - Other - - - Name - - Company - - Gender - -
- Age - - Address - - Company Address - - Company Name -
- Street - - Block -
- Door No. - - - Building - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 1 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 2 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 3 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 4 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 5 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 6 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 7 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 8 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 9 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 10 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 11 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 12 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 13 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 14 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 15 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 16 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 17 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 18 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 19 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 20 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 21 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 22 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 23 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 24 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 25 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 26 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 27 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 28 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 29 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 30 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 31 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 32 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 33 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 34 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 35 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 36 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 37 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 38 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 39 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 40 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 41 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 42 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 43 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 44 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 45 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 46 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 47 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 48 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 49 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 50 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 51 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 52 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 53 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 54 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 55 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 56 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 57 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 58 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 59 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 60 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 61 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 62 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 63 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 64 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 65 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 66 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 67 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 68 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 69 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 70 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 71 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 72 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 73 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 74 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 75 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 76 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 77 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 78 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 79 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 80 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 81 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 82 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 83 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 84 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 85 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 86 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 87 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 88 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 89 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 90 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 91 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 92 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 93 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 94 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 95 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 96 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 97 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 98 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 99 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
- 100 - - Lake Park - - 2035 - - - C - - - John Brown - - Lake Street 42 - - SoftLake Co - - M -
-
-
-
-
-`; - -exports[`Table.FixedColumn > shadow should display correctly 2`] = ` -
-
-
-
- - - - - - - - - - - - - -
- 父表头右侧的阴影导致整个表格最右侧有空隙 - -
- Name0 - - Name1 - - Name2 - - Name3 -
-
-
- - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
-
-
-
-
-`; diff --git a/tests/__snapshots__/Summary.spec.tsx.snap b/tests/__snapshots__/Summary.spec.tsx.snap index 434a2a845..a49082978 100644 --- a/tests/__snapshots__/Summary.spec.tsx.snap +++ b/tests/__snapshots__/Summary.spec.tsx.snap @@ -6,9 +6,9 @@ exports[`Table.Summary > support data type 1`] = ` > Light diff --git a/tests/__snapshots__/Table.spec.jsx.snap b/tests/__snapshots__/Table.spec.jsx.snap index deca883ec..1a2206424 100644 --- a/tests/__snapshots__/Table.spec.jsx.snap +++ b/tests/__snapshots__/Table.spec.jsx.snap @@ -97,10 +97,10 @@ exports[`Table.Basic > custom components > renders fixed column and header corre name="my-header-row" > Name @@ -112,17 +112,17 @@ exports[`Table.Basic > custom components > renders fixed column and header corre Age Gender @@ -180,9 +180,9 @@ exports[`Table.Basic > custom components > renders fixed column and header corre name="my-body-row" > Lucy @@ -193,9 +193,9 @@ exports[`Table.Basic > custom components > renders fixed column and header corre 27 F diff --git a/tsconfig.json b/tsconfig.json index 9031b9677..d40b7759b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,10 +10,10 @@ "paths": { "@/*": ["src/*"], "@@/*": [".dumi/tmp/*"], - "rc-table": ["src/index.ts"], + "rc-table": ["src/index.ts"] }, - "types": ["vitest/globals", "@testing-library/jest-dom"], + "types": ["vitest/globals", "@testing-library/jest-dom"] }, "include": [".dumirc.ts", "**/*.ts", "**/*.tsx", "tests/__mocks__/shadowTest.tsx"], - "exclude": ["./vitest.config.ts"], + "exclude": ["./vitest.config.ts"] }