Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@clayui/shared

Package Overview
Dependencies
Maintainers
12
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clayui/shared - npm Package Compare versions

Comparing version 3.95.0 to 3.95.2

47

lib/useOverlayPositon.js

@@ -91,27 +91,24 @@ "use strict";

var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [isOpen];
useIsomorphicLayoutEffect(function () {
function alignElement() {
if (triggerRef.current) {
var _points = alignmentPosition;
var alignElement = (0, _react.useCallback)(function () {
if (triggerRef.current && ref.current) {
var _points = alignmentPosition;
if (typeof _points === 'number') {
_points = getAlignPoints(_points);
}
if (typeof _points === 'number') {
_points = getAlignPoints(_points);
}
if (ref.current) {
(0, _doAlign.doAlign)({
offset: getOffset(_points),
overflow: {
adjustX: autoBestAlign,
adjustY: autoBestAlign,
alwaysByViewport: alignmentByViewport
},
points: _points,
sourceElement: ref.current,
targetElement: triggerRef.current
});
}
}
(0, _doAlign.doAlign)({
offset: getOffset(_points),
overflow: {
adjustX: autoBestAlign,
adjustY: autoBestAlign,
alwaysByViewport: alignmentByViewport
},
points: _points,
sourceElement: ref.current,
targetElement: triggerRef.current
});
}
}, []);
useIsomorphicLayoutEffect(function () {
if (isOpen && triggerRef.current) {

@@ -122,2 +119,8 @@ alignElement();

}, deps);
useIsomorphicLayoutEffect(function () {
if (isOpen && ref.current) {
alignElement();
return (0, _observeRect.observeRect)(ref.current, alignElement);
}
}, deps);
}
{
"name": "@clayui/shared",
"version": "3.95.0",
"version": "3.95.2",
"description": "ClayShared component",

@@ -45,3 +45,3 @@ "license": "BSD-3-Clause",

],
"gitHead": "dd76267f73294196857e7ac7f70e70cd8f649cd1"
"gitHead": "68ebdcf79dab1ba0af5846b23f64fb8776156df7"
}

@@ -6,3 +6,3 @@ /**

import React, {useEffect, useLayoutEffect} from 'react';
import React, {useCallback, useEffect, useLayoutEffect} from 'react';

@@ -99,29 +99,25 @@ import {doAlign} from './doAlign';

) {
useIsomorphicLayoutEffect(() => {
function alignElement() {
if (triggerRef.current) {
let points = alignmentPosition;
const alignElement = useCallback(() => {
if (triggerRef.current && ref.current) {
let points = alignmentPosition;
if (typeof points === 'number') {
points = getAlignPoints(
points as keyof typeof ALIGN_INVERSE
);
}
if (typeof points === 'number') {
points = getAlignPoints(points as keyof typeof ALIGN_INVERSE);
}
if (ref.current) {
doAlign({
offset: getOffset(points),
overflow: {
adjustX: autoBestAlign,
adjustY: autoBestAlign,
alwaysByViewport: alignmentByViewport,
},
points,
sourceElement: ref.current,
targetElement: triggerRef.current,
});
}
}
doAlign({
offset: getOffset(points),
overflow: {
adjustX: autoBestAlign,
adjustY: autoBestAlign,
alwaysByViewport: alignmentByViewport,
},
points,
sourceElement: ref.current,
targetElement: triggerRef.current,
});
}
}, []);
useIsomorphicLayoutEffect(() => {
if (isOpen && triggerRef.current) {

@@ -133,2 +129,10 @@ alignElement();

}, deps);
useIsomorphicLayoutEffect(() => {
if (isOpen && ref.current) {
alignElement();
return observeRect(ref.current, alignElement);
}
}, deps);
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc