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

stylable-components

Package Overview
Dependencies
Maintainers
4
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylable-components - npm Package Compare versions

Comparing version 0.5.9 to 0.5.10

dist/src/utils/get-scroll.d.ts

37

dist/src/components/popup/popup.js

@@ -120,4 +120,3 @@ "use strict";

];
var scrollX = window.pageXOffset || document.documentElement.scrollLeft;
var scrollY = window.pageYOffset || document.documentElement.scrollTop;
var _a = utils_1.getScroll(), scrollX = _a.scrollX, scrollY = _a.scrollY;
var winWidth = window.innerWidth;

@@ -160,4 +159,18 @@ var winHeight = window.innerHeight;

offsetWidth;
newStyle.top = getVerticalReference(anchorRect, props.anchorPosition.vertical);
newStyle.left = getHorizontalReference(anchorRect, props.anchorPosition.horizontal);
var _d = utils_1.getScroll(), scrollX_1 = _d.scrollX, scrollY_1 = _d.scrollY;
var _e = props.anchorPosition, vertical = _e.vertical, horizontal = _e.horizontal;
newStyle.left = scrollX_1;
newStyle.top = scrollY_1;
if (vertical === 'center') {
newStyle.top += anchorRect.top + (anchorRect.height / 2);
}
else {
newStyle.top += anchorRect[vertical];
}
if (horizontal === 'center') {
newStyle.left += anchorRect.left + (anchorRect.width / 2);
}
else {
newStyle.left += anchorRect[horizontal];
}
}

@@ -196,18 +209,2 @@ switch (props.popupPosition.vertical) {

exports.Popup = Popup;
function getVerticalReference(rect, anchorPosition) {
if (anchorPosition === 'center') {
return window.pageYOffset + rect.top + (rect.height / 2);
}
else {
return window.pageYOffset + rect[anchorPosition];
}
}
function getHorizontalReference(rect, anchorPosition) {
if (anchorPosition === 'center') {
return window.pageXOffset + rect.left + (rect.width / 2);
}
else {
return window.pageXOffset + rect[anchorPosition];
}
}
function isPoint(elem) {

@@ -214,0 +211,0 @@ return elem.hasOwnProperty('x') && elem.hasOwnProperty('y');

@@ -185,4 +185,3 @@ "use strict";

var rect = this.target.getBoundingClientRect();
var scrollY = window.pageYOffset || document.documentElement.scrollTop;
var scrollX = window.pageXOffset || document.documentElement.scrollLeft;
var _a = utils_1.getScroll(), scrollX = _a.scrollX, scrollY = _a.scrollY;
var rectTop = rect.top + scrollY;

@@ -189,0 +188,0 @@ var rectLeft = rect.left + scrollX;

@@ -15,1 +15,2 @@ export * from './clamp';

export * from './is-rtl-context';
export * from './get-scroll';

@@ -20,2 +20,3 @@ "use strict";

__export(require("./is-rtl-context"));
__export(require("./get-scroll"));
//# sourceMappingURL=index.js.map
{
"name": "stylable-components",
"version": "0.5.9",
"version": "0.5.10",
"description": "Fully-tested & strictly-typed component library based on React, using optional Wix styling.",

@@ -5,0 +5,0 @@ "main": "./dist/src/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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