Socket
Socket
Sign inDemoInstall

focus-lock

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

focus-lock - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

.size-limit

17

dist/cjs/focusMerge.js

@@ -109,13 +109,20 @@ 'use strict';

});
if (!innerElements[0]) {
return undefined;
innerElements = (0, _DOMutils.getAllTabbableNodes)(entries).filter(function (_ref2) {
var node = _ref2.node;
return notAGuard(node);
});
if (!innerElements[0]) {
return undefined;
}
}
var innerNodes = innerElements.map(function (_ref2) {
var node = _ref2.node;
var innerNodes = innerElements.map(function (_ref3) {
var node = _ref3.node;
return node;
});
var outerNodes = (0, _DOMutils.getTabbableNodes)([commonParent]).map(function (_ref3) {
var node = _ref3.node;
var outerNodes = (0, _DOMutils.getTabbableNodes)([commonParent]).map(function (_ref4) {
var node = _ref4.node;
return node;

@@ -122,0 +129,0 @@ });

@@ -6,3 +6,3 @@ 'use strict';

});
exports.parentAutofocusables = exports.getTabbableNodes = exports.filterFocusable = exports.getCommonParent = exports.notHiddenInput = exports.isVisible = undefined;
exports.parentAutofocusables = exports.getAllTabbableNodes = exports.getTabbableNodes = exports.filterFocusable = exports.getCommonParent = exports.notHiddenInput = exports.isVisible = undefined;

@@ -62,7 +62,11 @@ var _tabOrder = require('./tabOrder');

var getTabbableNodes = exports.getTabbableNodes = function getTabbableNodes(topNodes) {
return (0, _tabOrder.orderByTabIndex)(filterFocusable((0, _tabUtils.getFocusables)(topNodes)));
return (0, _tabOrder.orderByTabIndex)(filterFocusable((0, _tabUtils.getFocusables)(topNodes)), true);
};
var getAllTabbableNodes = exports.getAllTabbableNodes = function getAllTabbableNodes(topNodes) {
return (0, _tabOrder.orderByTabIndex)(filterFocusable((0, _tabUtils.getFocusables)(topNodes)), false);
};
var parentAutofocusables = exports.parentAutofocusables = function parentAutofocusables(topNode) {
return filterFocusable((0, _tabUtils.getParentAutofocusables)(topNode));
};

@@ -22,3 +22,3 @@ 'use strict';

var orderByTabIndex = exports.orderByTabIndex = function orderByTabIndex(nodes) {
var orderByTabIndex = exports.orderByTabIndex = function orderByTabIndex(nodes, filterNegative) {
return (0, _array.toArray)(nodes).map(function (node, index) {

@@ -31,4 +31,4 @@ return {

}).filter(function (data) {
return data.tabIndex >= 0;
return !filterNegative || data.tabIndex >= 0;
}).sort(tabSort);
};

@@ -1,2 +0,2 @@

import { getCommonParent, getTabbableNodes, parentAutofocusables } from './utils/DOMutils';
import { getCommonParent, getTabbableNodes, getAllTabbableNodes, parentAutofocusables } from './utils/DOMutils';
import pickFirstFocus from './utils/firstFocus';

@@ -94,13 +94,20 @@ import getAllAffectedNodes from './utils/all-affected';

});
if (!innerElements[0]) {
return undefined;
innerElements = getAllTabbableNodes(entries).filter(function (_ref2) {
var node = _ref2.node;
return notAGuard(node);
});
if (!innerElements[0]) {
return undefined;
}
}
var innerNodes = innerElements.map(function (_ref2) {
var node = _ref2.node;
var innerNodes = innerElements.map(function (_ref3) {
var node = _ref3.node;
return node;
});
var outerNodes = getTabbableNodes([commonParent]).map(function (_ref3) {
var node = _ref3.node;
var outerNodes = getTabbableNodes([commonParent]).map(function (_ref4) {
var node = _ref4.node;
return node;

@@ -107,0 +114,0 @@ });

@@ -52,7 +52,11 @@ import { orderByTabIndex } from './tabOrder';

export var getTabbableNodes = function getTabbableNodes(topNodes) {
return orderByTabIndex(filterFocusable(getFocusables(topNodes)));
return orderByTabIndex(filterFocusable(getFocusables(topNodes)), true);
};
export var getAllTabbableNodes = function getAllTabbableNodes(topNodes) {
return orderByTabIndex(filterFocusable(getFocusables(topNodes)), false);
};
export var parentAutofocusables = function parentAutofocusables(topNode) {
return filterFocusable(getParentAutofocusables(topNode));
};

@@ -15,3 +15,3 @@ import { toArray } from './array';

export var orderByTabIndex = function orderByTabIndex(nodes) {
export var orderByTabIndex = function orderByTabIndex(nodes, filterNegative) {
return toArray(nodes).map(function (node, index) {

@@ -24,4 +24,4 @@ return {

}).filter(function (data) {
return data.tabIndex >= 0;
return !filterNegative || data.tabIndex >= 0;
}).sort(tabSort);
};
{
"name": "focus-lock",
"version": "0.5.3",
"version": "0.5.4",
"description": "DOM trap for a focus",

@@ -16,3 +16,4 @@ "main": "dist/cjs/index.js",

"lint": "eslint src tests",
"lint:fix": "eslint src tests --fix"
"lint:fix": "eslint src tests --fix",
"size": "yarn size-limit"
},

@@ -51,4 +52,5 @@ "repository": {

"mocha": "^3.4.2",
"sinon": "3.2.1"
"sinon": "3.2.1",
"size-limit": "^0.21.1"
}
}

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