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

@chakra-ui/dom-utils

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/dom-utils - npm Package Compare versions

Comparing version 2.0.6 to 2.1.0

dist/chunk-4WEUWBTD.mjs

1

dist/index.d.ts
export { FocusableElement, hasDisplayNone, hasFocusWithin, hasNegativeTabIndex, hasTabIndex, isActiveElement, isContentEditable, isDisabled, isFocusable, isHidden, isInputElement, isTabbable } from './tabbable.js';
export { contains, getActiveElement, getEventWindow, getOwnerDocument, getOwnerWindow, isBrowser, isElement, isHTMLElement } from './dom.js';
export { getScrollParent } from './scroll.js';

@@ -4,0 +5,0 @@ declare function getAllFocusable<T extends HTMLElement>(container: T): T[];

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

getPreviousTabbable: () => getPreviousTabbable,
getScrollParent: () => getScrollParent,
hasDisplayNone: () => hasDisplayNone,

@@ -141,2 +142,23 @@ hasFocusWithin: () => hasFocusWithin,

// src/scroll.ts
function isScrollParent(el) {
const win = el.ownerDocument.defaultView || window;
const { overflow, overflowX, overflowY } = win.getComputedStyle(el);
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
function getParent(el) {
if (el.localName === "html")
return el;
return el.assignedSlot || el.parentElement || el.ownerDocument.documentElement;
}
function getScrollParent(el) {
if (["html", "body", "#document"].includes(el.localName)) {
return el.ownerDocument.body;
}
if (isHTMLElement(el) && isScrollParent(el)) {
return el;
}
return getScrollParent(getParent(el));
}
// src/index.ts

@@ -219,2 +241,3 @@ var focusableElList = [

getPreviousTabbable,
getScrollParent,
hasDisplayNone,

@@ -221,0 +244,0 @@ hasFocusWithin,

4

package.json
{
"name": "@chakra-ui/dom-utils",
"version": "2.0.6",
"version": "2.1.0",
"description": "",

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

"devDependencies": {
"clean-package": "2.1.1"
"clean-package": "2.2.0"
},

@@ -31,0 +31,0 @@ "clean-package": "../../../clean-package.config.json",

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