@semcore/data-table 17.0.1 → 17.0.2-prerelease.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/cjs/components/AccordionRows/AccordionRows.js +50 -50
  3. package/lib/cjs/components/Body/Body.js +51 -51
  4. package/lib/cjs/components/Body/Body.js.map +1 -1
  5. package/lib/cjs/components/Body/Cell.js +50 -50
  6. package/lib/cjs/components/Body/LimitOverlay.js +50 -50
  7. package/lib/cjs/components/Body/Row.js +54 -52
  8. package/lib/cjs/components/Body/Row.js.map +1 -1
  9. package/lib/cjs/components/Body/RowGroup.js +51 -78
  10. package/lib/cjs/components/Body/RowGroup.js.map +1 -1
  11. package/lib/cjs/components/Body/style.shadow.css +1 -1
  12. package/lib/cjs/components/DataTable/DataTable.js +87 -60
  13. package/lib/cjs/components/DataTable/DataTable.js.map +1 -1
  14. package/lib/cjs/components/DataTable/ScrollBars.js +53 -0
  15. package/lib/cjs/components/DataTable/ScrollBars.js.map +1 -0
  16. package/lib/cjs/components/DataTable/dataTable.shadow.css +19 -0
  17. package/lib/cjs/components/Head/Column.js +38 -36
  18. package/lib/cjs/components/Head/Column.js.map +1 -1
  19. package/lib/cjs/components/Head/Group.js +38 -36
  20. package/lib/cjs/components/Head/Group.js.map +1 -1
  21. package/lib/cjs/components/Head/Head.js +39 -37
  22. package/lib/cjs/components/Head/Head.js.map +1 -1
  23. package/lib/cjs/components/Head/Head.types.js.map +1 -1
  24. package/lib/cjs/components/Head/style.shadow.css +22 -5
  25. package/lib/cjs/components/RowSelector/RowsSelector.js +11 -3
  26. package/lib/cjs/components/RowSelector/RowsSelector.js.map +1 -1
  27. package/lib/cjs/enhancers/focusableCell.js +0 -2
  28. package/lib/cjs/enhancers/focusableCell.js.map +1 -1
  29. package/lib/cjs/style/scroll-shadows.shadow.css +2 -0
  30. package/lib/es6/components/AccordionRows/AccordionRows.js +50 -50
  31. package/lib/es6/components/Body/Body.js +51 -51
  32. package/lib/es6/components/Body/Body.js.map +1 -1
  33. package/lib/es6/components/Body/Cell.js +50 -50
  34. package/lib/es6/components/Body/LimitOverlay.js +50 -50
  35. package/lib/es6/components/Body/Row.js +54 -52
  36. package/lib/es6/components/Body/Row.js.map +1 -1
  37. package/lib/es6/components/Body/RowGroup.js +51 -78
  38. package/lib/es6/components/Body/RowGroup.js.map +1 -1
  39. package/lib/es6/components/Body/style.shadow.css +1 -1
  40. package/lib/es6/components/DataTable/DataTable.js +87 -60
  41. package/lib/es6/components/DataTable/DataTable.js.map +1 -1
  42. package/lib/es6/components/DataTable/ScrollBars.js +46 -0
  43. package/lib/es6/components/DataTable/ScrollBars.js.map +1 -0
  44. package/lib/es6/components/DataTable/dataTable.shadow.css +19 -0
  45. package/lib/es6/components/Head/Column.js +38 -36
  46. package/lib/es6/components/Head/Column.js.map +1 -1
  47. package/lib/es6/components/Head/Group.js +38 -36
  48. package/lib/es6/components/Head/Group.js.map +1 -1
  49. package/lib/es6/components/Head/Head.js +39 -37
  50. package/lib/es6/components/Head/Head.js.map +1 -1
  51. package/lib/es6/components/Head/Head.types.js.map +1 -1
  52. package/lib/es6/components/Head/style.shadow.css +22 -5
  53. package/lib/es6/components/RowSelector/RowsSelector.js +11 -3
  54. package/lib/es6/components/RowSelector/RowsSelector.js.map +1 -1
  55. package/lib/es6/enhancers/focusableCell.js +0 -2
  56. package/lib/es6/enhancers/focusableCell.js.map +1 -1
  57. package/lib/es6/style/scroll-shadows.shadow.css +2 -0
  58. package/lib/esm/components/AccordionRows/AccordionRows.mjs +51 -51
  59. package/lib/esm/components/Body/Body.mjs +52 -52
  60. package/lib/esm/components/Body/Cell.mjs +51 -51
  61. package/lib/esm/components/Body/LimitOverlay.mjs +51 -51
  62. package/lib/esm/components/Body/Row.mjs +55 -53
  63. package/lib/esm/components/Body/RowGroup.mjs +52 -71
  64. package/lib/esm/components/Body/style.shadow.css +1 -1
  65. package/lib/esm/components/DataTable/DataTable.mjs +89 -62
  66. package/lib/esm/components/DataTable/ScrollBars.mjs +54 -0
  67. package/lib/esm/components/DataTable/dataTable.shadow.css +19 -0
  68. package/lib/esm/components/Head/Column.mjs +39 -37
  69. package/lib/esm/components/Head/Group.mjs +39 -37
  70. package/lib/esm/components/Head/Head.mjs +40 -38
  71. package/lib/esm/components/Head/style.shadow.css +22 -5
  72. package/lib/esm/components/RowSelector/RowsSelector.mjs +11 -3
  73. package/lib/esm/enhancers/focusableCell.mjs +0 -2
  74. package/lib/esm/style/scroll-shadows.shadow.css +2 -0
  75. package/lib/types/components/DataTable/DataTable.d.ts +1 -1
  76. package/lib/types/components/DataTable/ScrollBars.d.ts +11 -0
  77. package/lib/types/components/Head/Head.types.d.ts +1 -0
  78. package/lib/types/components/RowSelector/RowsSelector.d.ts +1 -0
  79. package/package.json +19 -19
@@ -6,7 +6,6 @@ import { Box, ScrollArea } from '@semcore/base-components';
6
6
  import { Component, createComponent, lastInteraction, Root, sstyled } from '@semcore/core';
7
7
  import canUseDOM from '@semcore/core/lib/utils/canUseDOM';
8
8
  import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
9
- import findComponent from '@semcore/core/lib/utils/findComponent';
10
9
  import { hasParent } from '@semcore/core/lib/utils/hasParent';
11
10
  import trottle from '@semcore/core/lib/utils/rafTrottle';
12
11
  import { forkRef } from '@semcore/core/lib/utils/ref';
@@ -15,39 +14,43 @@ import { isFocusInside, hasFocusableIn } from '@semcore/core/lib/utils/use/useFo
15
14
  import { NoData } from '@semcore/widget-empty';
16
15
  import * as React from 'react';
17
16
  /*!__reshadow-styles__:"./dataTable.shadow.css"*/
18
- const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SDataTable_ldhu1_gg_{display:grid;align-items:start;min-width:-moz-fit-content;min-width:fit-content;grid-auto-rows:min-content}.___SDataTable_ldhu1_gg_.__isDataEmpty_ldhu1_gg_{display:block;align-items:initial;min-width:initial}.___SDataTable_ldhu1_gg_.__gridTemplateColumns_ldhu1_gg_{grid-template-columns:var(--gridTemplateColumns_ldhu1)}.___SDataTable_ldhu1_gg_.__gridTemplateAreas_ldhu1_gg_{grid-template-areas:var(--gridTemplateAreas_ldhu1)}.___SDataTable_ldhu1_gg_.__gridTemplateRows_ldhu1_gg_{grid-template-rows:var(--gridTemplateRows_ldhu1)}", /*__inner_css_end__*/"ldhu1_gg_"),
17
+ const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes moveBarWithScroll_pypp4{0%{transform:translateY(0)}to{transform:translateY(calc(var(--global-scroll-to) - var(--global-header-height)))}}.___SDataTable_pypp4_gg_{display:grid;align-items:start;min-width:-moz-fit-content;min-width:fit-content;grid-auto-rows:min-content;scroll-behavior:smooth}.___SDataTable_pypp4_gg_.__isDataEmpty_pypp4_gg_{display:block;align-items:initial;min-width:initial}.___SDataTable_pypp4_gg_.__gridTemplateColumns_pypp4_gg_{grid-template-columns:var(--gridTemplateColumns_pypp4)}.___SDataTable_pypp4_gg_.__gridTemplateAreas_pypp4_gg_{grid-template-areas:var(--gridTemplateAreas_pypp4)}.___SDataTable_pypp4_gg_.__gridTemplateRows_pypp4_gg_{grid-template-rows:var(--gridTemplateRows_pypp4)}.___SScrollAreaBarInHeader_pypp4_gg_.__withAnimation_pypp4_gg_{animation-name:moveBarWithScroll_pypp4;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}", /*__inner_css_end__*/"pypp4_gg_"),
19
18
  /*__reshadow_css_end__*/
20
19
  {
21
- "__SDataTable": "___SDataTable_ldhu1_gg_",
22
- "_isDataEmpty": "__isDataEmpty_ldhu1_gg_",
23
- "_gridTemplateColumns": "__gridTemplateColumns_ldhu1_gg_",
24
- "--gridTemplateColumns": "--gridTemplateColumns_ldhu1",
25
- "_gridTemplateAreas": "__gridTemplateAreas_ldhu1_gg_",
26
- "--gridTemplateAreas": "--gridTemplateAreas_ldhu1",
27
- "_gridTemplateRows": "__gridTemplateRows_ldhu1_gg_",
28
- "--gridTemplateRows": "--gridTemplateRows_ldhu1"
20
+ "__SDataTable": "___SDataTable_pypp4_gg_",
21
+ "_isDataEmpty": "__isDataEmpty_pypp4_gg_",
22
+ "_gridTemplateColumns": "__gridTemplateColumns_pypp4_gg_",
23
+ "--gridTemplateColumns": "--gridTemplateColumns_pypp4",
24
+ "_gridTemplateAreas": "__gridTemplateAreas_pypp4_gg_",
25
+ "--gridTemplateAreas": "--gridTemplateAreas_pypp4",
26
+ "_gridTemplateRows": "__gridTemplateRows_pypp4_gg_",
27
+ "--gridTemplateRows": "--gridTemplateRows_pypp4",
28
+ "__SScrollAreaBarInHeader": "___SScrollAreaBarInHeader_pypp4_gg_",
29
+ "_withAnimation": "__withAnimation_pypp4_gg_",
30
+ "@moveBarWithScroll": "moveBarWithScroll_pypp4"
29
31
  });
32
+ import { ScrollBars } from './ScrollBars';
30
33
  import { SelectableRows } from '../../store/SelectableRows';
31
34
  /*!__reshadow-styles__:"../../style/scroll-shadows.shadow.css"*/
32
- const scrollStyles = (/*__reshadow_css_start__*/_sstyled2.insert(/*__inner_css_start__*/".___SScrollArea_15e3j_gg_{width:-moz-fit-content;width:fit-content}.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_{overflow:visible;overflow:initial}.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_._scrollDirection_both_15e3j_gg_{overflow:auto}.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_._scrollDirection_both_15e3j_gg_.__loading_15e3j_gg_,.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_._scrollDirection_horizontal_15e3j_gg_.__loading_15e3j_gg_,.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_._scrollDirection_vertical_15e3j_gg_.__loading_15e3j_gg_{overflow:hidden}.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_._scrollDirection_horizontal_15e3j_gg_{overflow-x:auto;overflow-y:initial}.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_._scrollDirection_vertical_15e3j_gg_{overflow-x:initial;overflow-y:auto}.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_.__headerHeight_15e3j_gg_{scroll-padding-top:var(--headerHeight_15e3j)}.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_.__leftScrollPadding_15e3j_gg_{scroll-padding-left:var(--leftScrollPadding_15e3j)}.___SScrollArea_15e3j_gg_ .___SContainer_15e3j_gg_.__rightScrollPadding_15e3j_gg_{scroll-padding-right:var(--rightScrollPadding_15e3j)}.___SScrollArea_15e3j_gg_ .___SShadowHorizontal_15e3j_gg_::before,.___SScrollArea_15e3j_gg_ .___SShadowHorizontal_15e3j_gg_:after,.___SScrollArea_15e3j_gg_ .___SShadowVertical_15e3j_gg_::after{z-index:20}.___SScrollArea_15e3j_gg_ .___SShadowHorizontal_15e3j_gg_.__leftOffset_15e3j_gg_::before,.___SScrollArea_15e3j_gg_ .___SShadowHorizontal_15e3j_gg_.__rightOffset_15e3j_gg_::after,.___SScrollArea_15e3j_gg_ .___SShadowVertical_15e3j_gg_::before{display:none}", /*__inner_css_end__*/"15e3j_gg_"),
35
+ const scrollStyles = (/*__reshadow_css_start__*/_sstyled2.insert(/*__inner_css_start__*/".___SScrollArea_1aftg_gg_{width:-moz-fit-content;width:fit-content;view-timeline:--table-sticky-timeline block}.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_{overflow:visible;overflow:initial}.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_._scrollDirection_both_1aftg_gg_{overflow:auto}.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_._scrollDirection_both_1aftg_gg_.__loading_1aftg_gg_,.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_._scrollDirection_horizontal_1aftg_gg_.__loading_1aftg_gg_,.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_._scrollDirection_vertical_1aftg_gg_.__loading_1aftg_gg_{overflow:hidden}.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_._scrollDirection_horizontal_1aftg_gg_{overflow-x:auto;overflow-y:initial}.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_._scrollDirection_vertical_1aftg_gg_{overflow-x:initial;overflow-y:auto}.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_.__headerHeight_1aftg_gg_{scroll-padding-top:var(--headerHeight_1aftg)}.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_.__leftScrollPadding_1aftg_gg_{scroll-padding-left:var(--leftScrollPadding_1aftg)}.___SScrollArea_1aftg_gg_ .___SContainer_1aftg_gg_.__rightScrollPadding_1aftg_gg_{scroll-padding-right:var(--rightScrollPadding_1aftg)}.___SScrollArea_1aftg_gg_ .___SShadowHorizontal_1aftg_gg_::before,.___SScrollArea_1aftg_gg_ .___SShadowHorizontal_1aftg_gg_:after,.___SScrollArea_1aftg_gg_ .___SShadowVertical_1aftg_gg_::after{z-index:20}.___SScrollArea_1aftg_gg_ .___SShadowHorizontal_1aftg_gg_.__leftOffset_1aftg_gg_::before,.___SScrollArea_1aftg_gg_ .___SShadowHorizontal_1aftg_gg_.__rightOffset_1aftg_gg_::after,.___SScrollArea_1aftg_gg_ .___SShadowVertical_1aftg_gg_::before{display:none}", /*__inner_css_end__*/"1aftg_gg_"),
33
36
  /*__reshadow_css_end__*/
34
37
  {
35
- "__SScrollArea": "___SScrollArea_15e3j_gg_",
36
- "__SContainer": "___SContainer_15e3j_gg_",
37
- "_scrollDirection_both": "_scrollDirection_both_15e3j_gg_",
38
- "_loading": "__loading_15e3j_gg_",
39
- "_scrollDirection_horizontal": "_scrollDirection_horizontal_15e3j_gg_",
40
- "_scrollDirection_vertical": "_scrollDirection_vertical_15e3j_gg_",
41
- "_headerHeight": "__headerHeight_15e3j_gg_",
42
- "--headerHeight": "--headerHeight_15e3j",
43
- "_leftScrollPadding": "__leftScrollPadding_15e3j_gg_",
44
- "--leftScrollPadding": "--leftScrollPadding_15e3j",
45
- "_rightScrollPadding": "__rightScrollPadding_15e3j_gg_",
46
- "--rightScrollPadding": "--rightScrollPadding_15e3j",
47
- "__SShadowVertical": "___SShadowVertical_15e3j_gg_",
48
- "__SShadowHorizontal": "___SShadowHorizontal_15e3j_gg_",
49
- "_leftOffset": "__leftOffset_15e3j_gg_",
50
- "_rightOffset": "__rightOffset_15e3j_gg_"
38
+ "__SScrollArea": "___SScrollArea_1aftg_gg_",
39
+ "__SContainer": "___SContainer_1aftg_gg_",
40
+ "_scrollDirection_both": "_scrollDirection_both_1aftg_gg_",
41
+ "_loading": "__loading_1aftg_gg_",
42
+ "_scrollDirection_horizontal": "_scrollDirection_horizontal_1aftg_gg_",
43
+ "_scrollDirection_vertical": "_scrollDirection_vertical_1aftg_gg_",
44
+ "_headerHeight": "__headerHeight_1aftg_gg_",
45
+ "--headerHeight": "--headerHeight_1aftg",
46
+ "_leftScrollPadding": "__leftScrollPadding_1aftg_gg_",
47
+ "--leftScrollPadding": "--leftScrollPadding_1aftg",
48
+ "_rightScrollPadding": "__rightScrollPadding_1aftg_gg_",
49
+ "--rightScrollPadding": "--rightScrollPadding_1aftg",
50
+ "__SShadowVertical": "___SShadowVertical_1aftg_gg_",
51
+ "__SShadowHorizontal": "___SShadowHorizontal_1aftg_gg_",
52
+ "_leftOffset": "__leftOffset_1aftg_gg_",
53
+ "_rightOffset": "__rightOffset_1aftg_gg_"
51
54
  });
52
55
  import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
53
56
  import { Body } from '../Body/Body';
@@ -59,10 +62,9 @@ export const ACCORDION = Symbol('accordion');
59
62
  export const ROW_GROUP = Symbol('ROW_GROUP');
60
63
  export const UNIQ_ROW_KEY = Symbol('UNIQ_ROW_KEY');
61
64
  export const IS_EMPTY_DATA_ROW = Symbol('IS_EMPTY_DATA_ROW');
62
- export const SELECT_ALL = Symbol('SELECT_ALL');
65
+ export const SELECT_ALL = 'SELECT_ALL_ROWS';
63
66
  export const ROW_INDEX = Symbol('ROW_INDEX');
64
67
  export const GRID_ROW_INDEX = Symbol('GRID_ROW_INDEX');
65
- const SCROLL_BAR_HEIGHT = 12;
66
68
  class DataTableRoot extends Component {
67
69
  static getDerivedStateFromProps(props, state) {
68
70
  if (props.expandedRows === state.expandedRows || props.expandedRows === undefined) {
@@ -107,30 +109,29 @@ class DataTableRoot extends Component {
107
109
  _defineProperty(this, "handleDocumentScroll", trottle(() => {
108
110
  const tableContainer = this.tableContainerRef.current;
109
111
  if (!tableContainer) return;
110
- const tableContainerTop = tableContainer.getBoundingClientRect().top;
112
+ const tableRect = tableContainer.getBoundingClientRect();
113
+ const tableContainerTop = tableRect.top;
111
114
  const {
112
115
  headerProps
113
116
  } = this.asProps;
114
117
  const headerContainer = this.headerRef.current;
115
- const elements = headerContainer?.querySelectorAll('[role="columnheader"], [data-ui-name="Head.Group"]');
116
118
  const top = tableContainerTop - (headerProps?.top ?? 0);
117
119
  const headerScrollBar = headerProps?.withScrollBar ? this.scrollAreaRef.current?.querySelector(`[role=scrollbar][aria-orientation=horizontal]`) : undefined;
118
- if (top && top < 0) {
119
- const translate = `translateY(${Math.abs(top)}px)`;
120
- elements?.forEach(column => {
121
- if (column instanceof HTMLElement) {
122
- column.style.setProperty('transform', translate);
123
- }
124
- });
120
+ if (top && top < 0 && Math.abs(top) <= tableContainer.clientHeight) {
121
+ let translate = `translateY(${Math.abs(top)}px)`;
122
+ if (tableRect.bottom <= this.getHeaderHeight()) {
123
+ translate = `translateY(${Math.abs(top) - this.getHeaderHeight() - tableRect.bottom}px)`;
124
+ }
125
+ if (headerContainer instanceof HTMLElement) {
126
+ headerContainer.style.setProperty('--global-scroll-translate', `${Math.abs(top)}px`);
127
+ }
125
128
  if (headerScrollBar instanceof HTMLElement) {
126
129
  headerScrollBar.style.setProperty('transform', translate);
127
130
  }
128
131
  } else {
129
- elements?.forEach(column => {
130
- if (column instanceof HTMLElement) {
131
- column.style.removeProperty('transform');
132
- }
133
- });
132
+ if (headerContainer instanceof HTMLElement) {
133
+ headerContainer.style.removeProperty('--global-scroll-translate');
134
+ }
134
135
  if (headerScrollBar instanceof HTMLElement) {
135
136
  headerScrollBar.style.removeProperty('transform');
136
137
  }
@@ -467,7 +468,10 @@ class DataTableRoot extends Component {
467
468
  if (this.containerResizeEndTimeoutId) {
468
469
  clearTimeout(this.containerResizeEndTimeoutId);
469
470
  }
470
- this.containerResizeEndTimeoutId = setTimeout(this.calculateVerticalShadow, 0);
471
+ this.containerResizeEndTimeoutId = setTimeout(() => {
472
+ this.calculateVerticalShadow();
473
+ this.calculateStickyHeaderAnimation();
474
+ }, 0);
471
475
  this.asProps.onResize?.(entries, observer);
472
476
  });
473
477
  _defineProperty(this, "getScrollOffsetValue", () => {
@@ -553,7 +557,13 @@ class DataTableRoot extends Component {
553
557
  });
554
558
  }
555
559
  if (headerProps?.sticky && canUseDOM() && this.scrollDirection === 'horizontal') {
556
- document.addEventListener('scroll', this.handleDocumentScroll);
560
+ if (!this.withAnimation) {
561
+ document.addEventListener('scroll', this.handleDocumentScroll, {
562
+ passive: true
563
+ });
564
+ } else {
565
+ this.calculateStickyHeaderAnimation();
566
+ }
557
567
  }
558
568
  }
559
569
  componentDidUpdate(prevProps) {
@@ -583,6 +593,29 @@ class DataTableRoot extends Component {
583
593
  }
584
594
  this.state.expandedRows?.clear();
585
595
  }
596
+ calculateStickyHeaderAnimation() {
597
+ const {
598
+ headerProps
599
+ } = this.asProps;
600
+ const scrollArea = this.scrollAreaRef.current;
601
+ const table = this.tableContainerRef.current;
602
+ if (scrollArea && table) {
603
+ const currentHeaderHeight = scrollArea.style.getPropertyValue('--global-header-height');
604
+ const newHeaderHeight = `${this.getHeaderHeight()}px`;
605
+ scrollArea.style.setProperty('--global-scroll-to', `${table.offsetHeight}px`);
606
+ scrollArea.style.setProperty('--global-header-top', `${headerProps?.top ?? 0}px`);
607
+ scrollArea.style.setProperty('--global-header-height', newHeaderHeight);
608
+ if (currentHeaderHeight && currentHeaderHeight !== newHeaderHeight) {
609
+ this.forceUpdate();
610
+ }
611
+ }
612
+ }
613
+ get withAnimation() {
614
+ if (canUseDOM()) {
615
+ return CSS.supports('(animation-timeline: view()) and (animation-range: normal)');
616
+ }
617
+ return false;
618
+ }
586
619
  get totalRows() {
587
620
  const {
588
621
  totalRows
@@ -681,7 +714,8 @@ class DataTableRoot extends Component {
681
714
  onCellClick: this.handleCellClick,
682
715
  shadowVertical,
683
716
  scrollDirection: this.scrollDirection,
684
- isDataEmpty: this.isDataEmpty
717
+ isDataEmpty: this.isDataEmpty,
718
+ withAnimation: this.withAnimation && this.scrollDirection === 'horizontal' && !this.isDataEmpty
685
719
  };
686
720
  }
687
721
  getBodyProps() {
@@ -803,10 +837,8 @@ class DataTableRoot extends Component {
803
837
  gridTemplateColumns,
804
838
  gridTemplateAreas
805
839
  } = this.gridSettings;
806
- const Head = findComponent(Children, ['DataTable.Head']);
807
- const headerPropsToCheck = headerProps ?? Head?.props;
808
840
  const headerHeight = headerProps?.h || this.getHeaderHeight();
809
- const topOffset = headerPropsToCheck?.sticky || headerPropsToCheck?.withScrollBar ? headerHeight : undefined;
841
+ const topOffset = headerProps?.sticky || headerProps?.withScrollBar ? headerHeight : undefined;
810
842
  const width = w ?? (this.columns.some(c => c.gtcWidth === 'auto' || c.gtcWidth === '1fr') ? '100%' : undefined);
811
843
  let gridTemplateRows = undefined;
812
844
  if (virtualScroll && typeof virtualScroll !== 'boolean' && 'rowHeight' in virtualScroll) {
@@ -865,16 +897,11 @@ class DataTableRoot extends Component {
865
897
  "use:hMax": undefined,
866
898
  "use:hMin": undefined
867
899
  }, _ref)
868
- }), children ? /*#__PURE__*/React.createElement(Children, _ref2.cn("Children", {})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DataTable.Head, null), /*#__PURE__*/React.createElement(DataTable.Body, null)))), headerPropsToCheck?.withScrollBar && topOffset && !loading && /*#__PURE__*/React.createElement(ScrollArea.Bar, {
869
- orientation: "horizontal",
870
- top: topOffset - SCROLL_BAR_HEIGHT,
871
- zIndex: 20
872
- }), !loading && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScrollArea.Bar, {
873
- orientation: "horizontal",
874
- zIndex: 20
875
- }), /*#__PURE__*/React.createElement(ScrollArea.Bar, {
876
- orientation: "vertical",
877
- zIndex: 20
900
+ }), children ? /*#__PURE__*/React.createElement(Children, _ref2.cn("Children", {})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DataTable.Head, null), /*#__PURE__*/React.createElement(DataTable.Body, null)))), /*#__PURE__*/React.createElement(ScrollBars, _ref2.cn("ScrollBars", {
901
+ "loading": loading,
902
+ "topOffset": topOffset,
903
+ "withHeaderScrollBar": headerProps?.withScrollBar,
904
+ "withAnimation": this.withAnimation
878
905
  })), selectedRows !== undefined && !Array.isArray(selectedRows) && /*#__PURE__*/React.createElement(SRReactiveAnnouncer, _ref2.cn("SRReactiveAnnouncer", {
879
906
  "selectedRows": selectedRows,
880
907
  "getI18nText": getI18nText
@@ -903,7 +930,7 @@ class DataTableRoot extends Component {
903
930
  const treeColumns = [];
904
931
  if (selectedRows) {
905
932
  const column = {
906
- name: SELECT_ALL.toString(),
933
+ name: SELECT_ALL,
907
934
  gtcWidth: 'min-content',
908
935
  alignItems: 'flex-start',
909
936
  children: ''