New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wx-lib-dom

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wx-lib-dom - npm Package Compare versions

Comparing version 0.7.1 to 0.8.0

10

dist/dom.es.js

@@ -170,7 +170,7 @@ function locate(el, attr = "data-id") {

let x, y, width, pos;
const noPosition = { x: 0, y: 0, z: 0, width: "auto" };
function calculatePosition(self, parent, at = "bottom", left = 0, top = 0) {
if (!self) return noPosition;
if (!self) return null;
x = left;
y = top;
width = "auto";
let z = 0;

@@ -180,3 +180,3 @@ let fixLeft = 0;

const cont = isOverlap(at) ? env.getTopNode() : body;
if (!body) return noPosition;
if (!body) return null;
const bodyRect = body.getBoundingClientRect();

@@ -191,3 +191,3 @@ const selfRect = self.getBoundingClientRect();

pos = parent.getBoundingClientRect();
width = isFit(at) ? pos.width + "px" : "auto";
if (isFit(at)) width = pos.width + "px";
if (at !== "point") {

@@ -221,3 +221,3 @@ if (isCenter(at)) {

if (!isRight(at)) {
x = pos.right - selfRect.width;
x = contRect.right - selfRect.width;
} else {

@@ -224,0 +224,0 @@ fixLeft = 2;

@@ -174,7 +174,7 @@ (function(global, factory) {

let x, y, width, pos;
const noPosition = { x: 0, y: 0, z: 0, width: "auto" };
function calculatePosition(self2, parent, at = "bottom", left = 0, top = 0) {
if (!self2) return noPosition;
if (!self2) return null;
x = left;
y = top;
width = "auto";
let z = 0;

@@ -184,3 +184,3 @@ let fixLeft = 0;

const cont = isOverlap(at) ? env.getTopNode() : body;
if (!body) return noPosition;
if (!body) return null;
const bodyRect = body.getBoundingClientRect();

@@ -195,3 +195,3 @@ const selfRect = self2.getBoundingClientRect();

pos = parent.getBoundingClientRect();
width = isFit(at) ? pos.width + "px" : "auto";
if (isFit(at)) width = pos.width + "px";
if (at !== "point") {

@@ -225,3 +225,3 @@ if (isCenter(at)) {

if (!isRight(at)) {
x = pos.right - selfRect.width;
x = contRect.right - selfRect.width;
} else {

@@ -228,0 +228,0 @@ fixLeft = 2;

{
"name": "wx-lib-dom",
"version": "0.7.1",
"version": "0.8.0",
"main": "./dist/dom.umd.js",

@@ -5,0 +5,0 @@ "module": "./dist/dom.es.js",

@@ -1,3 +0,8 @@

### 0.7.1
### 0.8.0
- [update] calculatePosition returns null when element is not in DOM
- [fix] auto-fit logic of calculatePosition: actual width is returned, shift to left is done relative to the container not to the original menu position
### 0.7.0
- [add] env, setEnv

@@ -4,0 +9,0 @@

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