Socket
Socket
Sign inDemoInstall

carbon-components

Package Overview
Dependencies
Maintainers
5
Versions
1107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carbon-components - npm Package Compare versions

Comparing version 7.14.1 to 7.15.0

9

es/components/floating-menu/floating-menu.js

@@ -69,10 +69,3 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

value: function _getContainer() {
var element = this.element;
var body = element.ownerDocument.body;
for (var traverse = element; traverse && traverse !== body; traverse = traverse.parentNode) {
if (traverse.matches(this.options.selectorContainer)) {
return traverse;
}
}
return body;
return this.element.closest(this.options.selectorContainer) || this.element.ownerDocument.body;
}

@@ -79,0 +72,0 @@

15

es/globals/js/misc/event-matches.js

@@ -0,1 +1,7 @@

/**
* @param {Event} event The event.
* @param {string} selector The selector.
* @returns {Element}
* The closest ancestor of the event target (or the event target itself) which matches the selectors given in parameter.
*/
export default function eventMatches(event, selector) {

@@ -10,8 +16,5 @@ // <svg> in IE does not have `Element#msMatchesSelector()` (that should be copied to `Element#matches()` by a polyfill).

} else if (event.target.matches(selector + ' *')) {
// If event target is a child node of a DOM element that matches the given selector,
// find the DOM element by going up the DOM tree
for (var traverse = event.target; traverse && traverse !== event.currentTarget; traverse = traverse.parentNode) {
if (traverse.matches(selector)) {
return traverse;
}
var closest = event.target.closest(selector);
if (event.currentTarget.contains(closest)) {
return closest;
}

@@ -18,0 +21,0 @@ }

@@ -5,3 +5,3 @@ {

"homepage": "http://carbondesignsystem.com/",
"version": "7.14.1",
"version": "7.15.0",
"module": "es/index.js",

@@ -8,0 +8,0 @@ "main": "umd/index.js",

@@ -49,10 +49,3 @@ import mixin from '../../globals/js/misc/mixin';

_getContainer() {
const element = this.element;
const body = element.ownerDocument.body;
for (let traverse = element; traverse && traverse !== body; traverse = traverse.parentNode) {
if (traverse.matches(this.options.selectorContainer)) {
return traverse;
}
}
return body;
return this.element.closest(this.options.selectorContainer) || this.element.ownerDocument.body;
}

@@ -59,0 +52,0 @@

@@ -0,1 +1,7 @@

/**
* @param {Event} event The event.
* @param {string} selector The selector.
* @returns {Element}
* The closest ancestor of the event target (or the event target itself) which matches the selectors given in parameter.
*/
export default function eventMatches(event, selector) {

@@ -10,8 +16,5 @@ // <svg> in IE does not have `Element#msMatchesSelector()` (that should be copied to `Element#matches()` by a polyfill).

} else if (event.target.matches(`${selector} *`)) {
// If event target is a child node of a DOM element that matches the given selector,
// find the DOM element by going up the DOM tree
for (let traverse = event.target; traverse && traverse !== event.currentTarget; traverse = traverse.parentNode) {
if (traverse.matches(selector)) {
return traverse;
}
const closest = event.target.closest(selector);
if (event.currentTarget.contains(closest)) {
return closest;
}

@@ -18,0 +21,0 @@ }

@@ -160,10 +160,3 @@ (function (global, factory) {

value: function _getContainer() {
var element = this.element;
var body = element.ownerDocument.body;
for (var traverse = element; traverse && traverse !== body; traverse = traverse.parentNode) {
if (traverse.matches(this.options.selectorContainer)) {
return traverse;
}
}
return body;
return this.element.closest(this.options.selectorContainer) || this.element.ownerDocument.body;
}

@@ -170,0 +163,0 @@ }, {

@@ -20,2 +20,8 @@ (function (global, factory) {

exports.default = eventMatches;
/**
* @param {Event} event The event.
* @param {string} selector The selector.
* @returns {Element}
* The closest ancestor of the event target (or the event target itself) which matches the selectors given in parameter.
*/
function eventMatches(event, selector) {

@@ -30,8 +36,5 @@ // <svg> in IE does not have `Element#msMatchesSelector()` (that should be copied to `Element#matches()` by a polyfill).

} else if (event.target.matches(selector + ' *')) {
// If event target is a child node of a DOM element that matches the given selector,
// find the DOM element by going up the DOM tree
for (var traverse = event.target; traverse && traverse !== event.currentTarget; traverse = traverse.parentNode) {
if (traverse.matches(selector)) {
return traverse;
}
var closest = event.target.closest(selector);
if (event.currentTarget.contains(closest)) {
return closest;
}

@@ -38,0 +41,0 @@ }

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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