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

rc-drawer

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-drawer - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

1

es/DrawerChild.js

@@ -429,3 +429,2 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

getOpenCount = _this$props7.getOpenCount,
getContainer = _this$props7.getContainer,
open = _this$props7.open;

@@ -432,0 +431,0 @@ delete currentDrawer[this.drawerId];

23

es/utils.js

@@ -70,20 +70,9 @@ export function dataToArray(vars) {

var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth;
/**
* <div style="height: 300px">
* <div style="height: 900px"></div>
* </div>
* 在没设定 overflow: auto 或 scroll 时,currentTarget 里获取不到 scrollTop 或 scrollLeft,
* 预先用 scrollTo 来滚动,如果取出的值跟滚动前取出不同,则 currnetTarget 被设定了 overflow; 否则就是上面这种。
*/
var style = document.defaultView.getComputedStyle(currentTarget);
var overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll';
var overflowX = style.overflowX === 'auto' || style.overflowX === 'scroll';
var y = scrollY && overflowY;
var x = scrollX && overflowX;
var t = currentTarget.scrollTop;
var l = currentTarget.scrollLeft;
currentTarget.scrollTop += 1;
currentTarget.scrollLeft += 1;
var currentT = currentTarget.scrollTop;
var currentL = currentTarget.scrollLeft;
currentTarget.scrollTop -= 1;
currentTarget.scrollLeft -= 1;
if (isY && (!scrollY || !(currentT - t) || scrollY && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!scrollX || !(currentL - l) || scrollX && (currentTarget.scrollLeft >= scrollX && differX < 0 || currentTarget.scrollLeft <= 0 && differX > 0))) {
if (isY && (!y || y && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!x || x && (currentTarget.scrollLeft >= scrollX && scrollX < 0 || currentTarget.scrollLeft <= 0 && scrollX > 0))) {
return getTouchParentScroll(root, currentTarget.parentNode, differX, differY);

@@ -90,0 +79,0 @@ }

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

getOpenCount = _this$props7.getOpenCount,
getContainer = _this$props7.getContainer,
open = _this$props7.open;

@@ -450,0 +449,0 @@ delete currentDrawer[this.drawerId];

@@ -92,20 +92,9 @@ "use strict";

var scrollX = currentTarget.scrollWidth - currentTarget.clientWidth;
/**
* <div style="height: 300px">
* <div style="height: 900px"></div>
* </div>
* 在没设定 overflow: auto 或 scroll 时,currentTarget 里获取不到 scrollTop 或 scrollLeft,
* 预先用 scrollTo 来滚动,如果取出的值跟滚动前取出不同,则 currnetTarget 被设定了 overflow; 否则就是上面这种。
*/
var style = document.defaultView.getComputedStyle(currentTarget);
var overflowY = style.overflowY === 'auto' || style.overflowY === 'scroll';
var overflowX = style.overflowX === 'auto' || style.overflowX === 'scroll';
var y = scrollY && overflowY;
var x = scrollX && overflowX;
var t = currentTarget.scrollTop;
var l = currentTarget.scrollLeft;
currentTarget.scrollTop += 1;
currentTarget.scrollLeft += 1;
var currentT = currentTarget.scrollTop;
var currentL = currentTarget.scrollLeft;
currentTarget.scrollTop -= 1;
currentTarget.scrollLeft -= 1;
if (isY && (!scrollY || !(currentT - t) || scrollY && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!scrollX || !(currentL - l) || scrollX && (currentTarget.scrollLeft >= scrollX && differX < 0 || currentTarget.scrollLeft <= 0 && differX > 0))) {
if (isY && (!y || y && (currentTarget.scrollTop >= scrollY && differY < 0 || currentTarget.scrollTop <= 0 && differY > 0)) || isX && (!x || x && (currentTarget.scrollLeft >= scrollX && scrollX < 0 || currentTarget.scrollLeft <= 0 && scrollX > 0))) {
return getTouchParentScroll(root, currentTarget.parentNode, differX, differY);

@@ -112,0 +101,0 @@ }

{
"name": "rc-drawer",
"version": "2.0.1",
"version": "2.0.2",
"description": "drawer component for react",

@@ -35,3 +35,3 @@ "keywords": [

"scripts": {
"start": "father doc dev --storybook",
"start": "rm -rf .storybook lib es && father doc dev --storybook",
"build": "father doc build --storybook",

@@ -64,3 +64,2 @@ "compile": "father build && lessc assets/index.less assets/index.css",

"querystring": "^0.2.0",
"rc-dialog": "7.4.1",
"rc-test": "^6.0.1",

@@ -67,0 +66,0 @@ "react": "^16.0.0",

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