Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions semcore/data-table/src/components/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ class DataTableRoot<
shadowVertical,
scrollDirection: this.scrollDirection,
isDataEmpty: this.isDataEmpty,
withAnimation: this.withAnimation && this.scrollDirection === 'horizontal' && !this.isDataEmpty,
withAnimation: this.scrollDirection === 'horizontal' && !this.isDataEmpty,
headerNodesMap: this.headerNodesMap,
};
}
Expand Down Expand Up @@ -1044,7 +1044,6 @@ class DataTableRoot<
loading={loading}
topOffset={topOffset}
withHeaderScrollBar={headerProps?.withScrollBar}
withAnimation={this.withAnimation}
scrollBarInstanceRef={this.scrollBarInstanceRef}
/>

Expand Down
5 changes: 1 addition & 4 deletions semcore/data-table/src/components/DataTable/ScrollBars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type Props = {
loading?: boolean;
withHeaderScrollBar?: boolean;
topOffset?: number;
withAnimation: boolean;
scrollBarInstanceRef: React.RefObject<NSScrollArea.Bar.Instance>;
};

Expand All @@ -18,7 +17,7 @@ const SCROLL_BAR_HEIGHT = 12;
export class ScrollBars extends React.PureComponent<Props> {
render() {
const SScrollAreaBarInHeader = ScrollArea.Bar;
const { loading, topOffset, withHeaderScrollBar, withAnimation, scrollBarInstanceRef } = this.props;
const { loading, topOffset, withHeaderScrollBar, scrollBarInstanceRef } = this.props;

return sstyled(styles)(
<>
Expand All @@ -27,8 +26,6 @@ export class ScrollBars extends React.PureComponent<Props> {
orientation='horizontal'
top={topOffset - SCROLL_BAR_HEIGHT}
zIndex={20}
// @ts-ignore
withAnimation={withAnimation}
/>
)}

Expand Down
28 changes: 15 additions & 13 deletions semcore/data-table/src/components/DataTable/dataTable.shadow.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ SDataTable[gridTemplateRows] {
grid-template-rows: var(--gridTemplateRows);
}

SScrollAreaBarInHeader[withAnimation] {
animation-name: moveBarWithScroll;
animation-timeline: --table-sticky-timeline;
animation-range-start: exit-crossing calc(-1 * var(--global-header-top));
animation-range-end: exit-crossing calc(100% - var(--global-header-top) - var(--global-header-height));
animation-timing-function: linear;
animation-fill-mode: both;
}
@keyframes moveBarWithScroll {
from {
transform: translateY(0);
@supports ((animation-timeline: view()) and (animation-range: normal)) {
SScrollAreaBarInHeader {
animation-name: moveBarWithScroll;
animation-timeline: --table-sticky-timeline;
animation-range-start: exit-crossing calc(-1 * var(--global-header-top));
animation-range-end: exit-crossing calc(100% - var(--global-header-top) - var(--global-header-height));
animation-timing-function: linear;
animation-fill-mode: both;
}
to {
transform: translateY(calc(var(--global-scroll-to) - var(--global-header-height)));
@keyframes moveBarWithScroll {
from {
transform: translateY(0);
}
to {
transform: translateY(calc(var(--global-scroll-to) - var(--global-header-height)));
}
}
}
32 changes: 17 additions & 15 deletions semcore/data-table/src/components/Head/style.shadow.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,26 @@ SHead[animationDuration] > SColumn {
transition: top var(--animationDuration) ease-out;
}

@keyframes moveWithScroll {
from {
transform: translateY(0);
}
to {
transform: translateY(var(--global-scroll-to));
@supports ((animation-timeline: view()) and (animation-range: normal)) {
@keyframes moveWithScroll {
from {
transform: translateY(0);
}
to {
transform: translateY(var(--global-scroll-to));
}
}
}

SHead[withAnimation][sticky] SColumn, SHead[withAnimation][sticky] SGroup {
animation-name: moveWithScroll;
animation-timeline: --table-sticky-timeline;
animation-range-start: exit-crossing calc(-1 * var(--global-header-top));
animation-range-end: exit-crossing calc(100% - var(--global-header-top));
animation-timing-function: linear;
animation-fill-mode: both;
SHead[withAnimation][sticky] SColumn, SHead[withAnimation][sticky] SGroup {
animation-name: moveWithScroll;
animation-timeline: --table-sticky-timeline;
animation-range-start: exit-crossing calc(-1 * var(--global-header-top));
animation-range-end: exit-crossing calc(100% - var(--global-header-top));
animation-timing-function: linear;
animation-fill-mode: both;

transform: none;
transform: none;
}
}

SHead[sticky] SColumn, SHead[sticky] SGroup {
Expand Down
Loading