fui-material 2.6.1 → 2.6.3

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.
@@ -843,15 +843,19 @@ const FTable = ({
843
843
  // По умолчанию горизонтальное переполнение автоматическое
844
844
  overflowY = "auto",
845
845
  // По умолчанию вертикальное переполнение автоматическое
846
+ isSticky = true,
847
+ // По умолчанию заголовок не "липкий"
848
+ layout = "auto",
849
+ // Добавляем новый пропс с дефолтным значением 'auto'
846
850
  ...props
847
851
  }) => {
848
852
  const tableWrapperRef = useRef(null);
849
- const [isSticky, setIsSticky] = useState(false);
853
+ const [isStickyState, setIsStickyState] = useState(false);
850
854
  useEffect(() => {
851
855
  const handleScroll = () => {
852
- if (tableWrapperRef.current) {
856
+ if (tableWrapperRef.current && isSticky) {
853
857
  const isScrolled = tableWrapperRef.current.scrollTop > 0;
854
- setIsSticky(isScrolled);
858
+ setIsStickyState(isScrolled);
855
859
  }
856
860
  };
857
861
  const wrapper = tableWrapperRef.current;
@@ -873,7 +877,7 @@ const FTable = ({
873
877
  children: /* @__PURE__ */ jsx(
874
878
  "table",
875
879
  {
876
- style: st,
880
+ style: { ...st, tableLayout: layout },
877
881
  ...props,
878
882
  className: `table ${styles$s["f-table-component__table"]} ${styles$s["bordered"]} ${styles$s["bordered-half"]} ${props.className || ""}`,
879
883
  children: React.Children.map(children, (child) => {
@@ -883,7 +887,7 @@ const FTable = ({
883
887
  child,
884
888
  {
885
889
  ...headProps,
886
- isSticky
890
+ isSticky: isStickyState
887
891
  }
888
892
  );
889
893
  }