@infomaximum/ui-kit 0.16.7 → 0.16.8

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.
@@ -1,10 +1,10 @@
1
1
  import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useState } from "react";
3
3
  import { BodyCell } from "../BodyCell/BodyCell.js";
4
- import { useSubscribe } from "../../../../features/typedEventBus/hooks.js";
5
4
  import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
6
5
  import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
7
6
  import { getRefValue } from "../../../../utils/ref/ref.js";
7
+ import { useSubscribe } from "../../../../features/typedEventBus/hooks.js";
8
8
  const BodyRowComponent = (props) => {
9
9
  const {
10
10
  record,
@@ -3,10 +3,10 @@ import { useMemo, useCallback, useLayoutEffect, useRef } from "react";
3
3
  import { MeasureCell } from "../MeasureCell/MeasureCell.js";
4
4
  import ResizeObserver from "rc-resize-observer";
5
5
  import { useEvent } from "../../../../../../hooks/useEvent/useEvent.js";
6
- import { useEmitter } from "../../../../features/typedEventBus/hooks.js";
7
6
  import { getColumnsKeys } from "./MeasureRow.utils.js";
8
7
  import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
9
8
  import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
9
+ import { useEmitter } from "../../../../features/typedEventBus/hooks.js";
10
10
  import { getRefValue, updateRefValue } from "../../../../utils/ref/ref.js";
11
11
  const MeasureRowComponent = () => {
12
12
  const {
@@ -1,6 +1,5 @@
1
1
  import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useContext, useState, useMemo } from "react";
3
- import { useSubscribe } from "../../features/typedEventBus/hooks.js";
4
3
  import { isUndefined, isObject, isNumber } from "lodash-es";
5
4
  import { getCellStyle, getBorderedCellStyle, emptyWrapperStyle } from "./EmptyDataRow.styles.js";
6
5
  import { getEndRangeInfo } from "./EmptyDataRow.utils.js";
@@ -8,6 +7,7 @@ import { ConfigContext } from "../../../ConfigProvider/contexts/ConfigContext.js
8
7
  import { useTableContext } from "../../contexts/tableContext/useTableContext/useTableContext.js";
9
8
  import { useTableStaticContext } from "../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
10
9
  import { getRefValue } from "../../utils/ref/ref.js";
10
+ import { useSubscribe } from "../../features/typedEventBus/hooks.js";
11
11
  import { Empty } from "../../../Empty/Empty.js";
12
12
  const EmptyDataRowComponent = () => {
13
13
  const {
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { useState } from "react";
3
- import { useSubscribe } from "../../../../features/typedEventBus/hooks.js";
4
3
  import { isNumber } from "lodash-es";
5
4
  import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
6
5
  import { getRefValue } from "../../../../utils/ref/ref.js";
6
+ import { useSubscribe } from "../../../../features/typedEventBus/hooks.js";
7
7
  const FixedHeaderColGroupComponent = () => {
8
8
  const staticContextRef = useTableStaticContext();
9
9
  const [widths, setWidths] = useState(() => getRefValue(staticContextRef, "measureCellsInfo.widths"));
@@ -1,11 +1,11 @@
1
1
  import { useMemo, useCallback } from "react";
2
- import { useEmitter } from "../../../typedEventBus/hooks.js";
3
2
  import { useEvent } from "../../../../../../hooks/useEvent/useEvent.js";
4
3
  import { compact } from "lodash-es";
5
4
  import { useMultipleSelect } from "../useMultipleSelect/useMultipleSelect.js";
6
5
  import { flattenData } from "./useTableRowSelection.utils.js";
7
6
  import { useControlledState } from "../../../../../../hooks/useControlledState/useControlledState.js";
8
7
  import { getRowKey } from "../../../../utils/getRowKey/getRowKey.js";
8
+ import { useEmitter } from "../../../typedEventBus/hooks.js";
9
9
  import { useFirstMountLayoutEffect } from "../../../../../../hooks/useFirstMountLayoutEffect/useFirstMountLayoutEffect.js";
10
10
  const useTableRowSelection = (options) => {
11
11
  const {
@@ -1,8 +1,8 @@
1
1
  import { useState } from "react";
2
- import { useSubscribe } from "../../../typedEventBus/hooks.js";
3
2
  import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
4
3
  import { useTableStaticContext } from "../../../tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
5
4
  import { getRefValue } from "../../../../utils/ref/ref.js";
5
+ import { useSubscribe } from "../../../typedEventBus/hooks.js";
6
6
  const useSortState = (options) => {
7
7
  const {
8
8
  column
@@ -1,8 +1,8 @@
1
1
  import { useState, useMemo } from "react";
2
- import { useEmitter } from "../../../typedEventBus/hooks.js";
3
2
  import { useEvent } from "../../../../../../hooks/useEvent/useEvent.js";
4
3
  import { useTableStaticContext } from "../../../tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
5
4
  import { getRefValue } from "../../../../utils/ref/ref.js";
5
+ import { useEmitter } from "../../../typedEventBus/hooks.js";
6
6
  import { useFirstMountLayoutEffect } from "../../../../../../hooks/useFirstMountLayoutEffect/useFirstMountLayoutEffect.js";
7
7
  import { getSortedData } from "../../utils/getSortedData/getSortedData.js";
8
8
  const useTableSort = (options) => {
@@ -1,8 +1,8 @@
1
1
  import { useState, useRef } from "react";
2
2
  import { isNumber } from "lodash-es";
3
- import { useSubscribe } from "../../features/typedEventBus/hooks.js";
4
3
  import { getCellFixedMinimalInfo, getCellFixedInfo } from "./useCellFixedInfo.utils.js";
5
4
  import { useTableContext } from "../../contexts/tableContext/useTableContext/useTableContext.js";
5
+ import { useSubscribe } from "../../features/typedEventBus/hooks.js";
6
6
  import { updateRefValue, getRefValue } from "../../utils/ref/ref.js";
7
7
  const useCellFixedInfo = (options) => {
8
8
  const {
@@ -1,6 +1,6 @@
1
1
  import { useRef, useState } from "react";
2
- import { useSubscribe, useEmitter } from "../../features/typedEventBus/hooks.js";
3
2
  import { isInHoverRange } from "./useCellHover.utils.js";
3
+ import { useSubscribe, useEmitter } from "../../features/typedEventBus/hooks.js";
4
4
  const useCellHover = (options) => {
5
5
  const {
6
6
  index,
@@ -1,9 +1,9 @@
1
1
  import { useRef, useLayoutEffect, useCallback } from "react";
2
2
  import { useEvent } from "../../../../hooks/useEvent/useEvent.js";
3
- import { useEmitter } from "../../features/typedEventBus/hooks.js";
4
3
  import "rc-resize-observer";
5
4
  import { getVerticalScrollBarWidth, forceScroll, getHorizontalScrollPositionRange } from "./utils.js";
6
5
  import { useTableStaticContext } from "../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
6
+ import { useEmitter } from "../../features/typedEventBus/hooks.js";
7
7
  import { updateRefValue, getRefValue } from "../../utils/ref/ref.js";
8
8
  const useTableVisualParamsChange = (options) => {
9
9
  const {
@@ -45,6 +45,7 @@ const useTableVisualParamsChange = (options) => {
45
45
  } = e.currentTarget;
46
46
  forceScroll(scrollLeft, scrollableTableSectionRef.current);
47
47
  }, []);
48
+ const prevScrollLeftRef = useRef(0);
48
49
  const prevScrollTopRef = useRef(0);
49
50
  const handleTableContentScroll = (e) => {
50
51
  const {
@@ -58,8 +59,10 @@ const useTableVisualParamsChange = (options) => {
58
59
  scrollLeft,
59
60
  scrollTop
60
61
  } = currentTarget;
61
- if (prevScrollTopRef.current !== scrollTop) {
62
- prevScrollTopRef.current = scrollTop;
62
+ const isVerticalOnlyScroll = scrollTop !== prevScrollTopRef.current && scrollLeft === prevScrollLeftRef.current;
63
+ prevScrollTopRef.current = scrollTop;
64
+ prevScrollLeftRef.current = scrollLeft;
65
+ if (isVerticalOnlyScroll) {
63
66
  return;
64
67
  }
65
68
  forceScroll(scrollLeft, tableHeaderRef.current);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infomaximum/ui-kit",
3
3
  "license": "Apache-2.0",
4
- "version": "0.16.7",
4
+ "version": "0.16.8",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",