@astral/ui 1.0.0-test.1670578243 → 1.0.0-test.1670579338

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.
@@ -10,7 +10,13 @@ const useOverflowed = (forwardedRef) => {
10
10
  : localRef;
11
11
  const [isOverflowed, setOverflow] = (0, react_1.useState)(false);
12
12
  const handleResize = (0, react_1.useCallback)((0, lodash_es_1.debounce)(([{ target, contentRect }]) => {
13
+ /**
14
+ * @description сверка высоты дом ноды и высоты скролл контейнера, если скролл больше, то значит компонент переполнен контентом
15
+ */
13
16
  const isScrollHeightBigger = contentRect.height < target.scrollHeight;
17
+ /**
18
+ * @description сверка ширины дом ноды и ширины скролл контейнера, если скролл больше, то значит компонент переполнен контентом
19
+ */
14
20
  const isScrollWidthBigger = target.scrollWidth > contentRect.width;
15
21
  setOverflow(isScrollHeightBigger || isScrollWidthBigger);
16
22
  }, 500), []);
@@ -7,7 +7,13 @@ export const useOverflowed = (forwardedRef) => {
7
7
  : localRef;
8
8
  const [isOverflowed, setOverflow] = useState(false);
9
9
  const handleResize = useCallback(debounce(([{ target, contentRect }]) => {
10
+ /**
11
+ * @description сверка высоты дом ноды и высоты скролл контейнера, если скролл больше, то значит компонент переполнен контентом
12
+ */
10
13
  const isScrollHeightBigger = contentRect.height < target.scrollHeight;
14
+ /**
15
+ * @description сверка ширины дом ноды и ширины скролл контейнера, если скролл больше, то значит компонент переполнен контентом
16
+ */
11
17
  const isScrollWidthBigger = target.scrollWidth > contentRect.width;
12
18
  setOverflow(isScrollHeightBigger || isScrollWidthBigger);
13
19
  }, 500), []);
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "1.0.0-test.1670578243",
3
+ "version": "1.0.0-test.1670579338",
4
4
  "browser": "./esm/index.js",
5
5
  "main": "./index.js",
6
6
  "dependencies": {
7
- "@astral/icons": "^1.0.0-test.1670578243",
7
+ "@astral/icons": "^1.0.0-test.1670579338",
8
8
  "@emotion/cache": "11.7.1",
9
9
  "@emotion/react": "11.9.0",
10
10
  "@emotion/server": "11.4.0",