Socket
Socket
Sign inDemoInstall

@chasi/ui

Package Overview
Dependencies
3
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.21 to 0.1.22

5

dist/CDraggableList/draggable-api.d.ts
export declare function createScroller(el: Element, initialX: number, initialY: number): {
updateCursor(dx: number, dy: number): void;
dispose: () => void;
deltaScroll(): number;
updateCursor(dx: number, currentY: number): void;
dispose(): void;
};

@@ -5,0 +6,0 @@ export declare function runOnFrames(callback: () => void, fps?: number): () => void;

33

dist/CDraggableList/draggable-api.js
export function createScroller(el, initialX, initialY) {
const scroller = getScrollParent(el);
const offset = window.innerHeight / 2 - initialY;
const totalH = window.innerHeight;
const min = totalH * 0.1;
const max = totalH - min;
// let x = 0
let y = 0;
let y = initialY;
scroller.style.scrollBehavior = 'auto';
const stepX = 0;
const stepY = 20;
let deltaScroll = 0;
const dispose = runOnFrames(() => {
const delta = y - offset;
const stepX = 0;
const stepY = Math.pow(delta * 0.003, 9);
scroller.scrollBy(stepX, stepY);
if (y < min) {
deltaScroll -= stepY;
scroller.scrollBy(stepX, -stepY);
}
else if (y > max) {
deltaScroll += stepY;
scroller.scrollBy(stepX, stepY);
}
}, 60);
return {
updateCursor(dx, dy) {
deltaScroll() {
return deltaScroll;
},
updateCursor(dx, currentY) {
// x += dx
y += dy;
y = currentY;
},
dispose
dispose() {
scroller.style.scrollBehavior = '';
dispose();
}
};

@@ -20,0 +35,0 @@ }

{
"name": "@chasi/ui",
"version": "0.1.21",
"version": "0.1.22",
"type": "module",

@@ -5,0 +5,0 @@ "main": "./dist/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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc