New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-global-events

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-global-events - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

24

dist/index.d.ts

@@ -17,3 +17,3 @@ import * as vue from 'vue';

filter: {
type: PropType<EventFilter<Event>>;
type: PropType<EventFilter<Event> | EventFilter<Event>[]>;
default: () => () => true;

@@ -29,3 +29,3 @@ };

filter: {
type: PropType<EventFilter<Event>>;
type: PropType<EventFilter<Event> | EventFilter<Event>[]>;
default: () => () => true;

@@ -37,3 +37,3 @@ };

stop: boolean;
filter: EventFilter<Event>;
filter: EventFilter<Event> | EventFilter<Event>[];
target: string;

@@ -49,4 +49,18 @@ prevent: boolean;

declare function excludeElements(): void;
/**
* Creates a filter than can be passed to `<GlobalEvents />` to exclude events from elements with the given tag names.
*
* @param tagNames - array of tag names to exclude
*/
declare function excludeElements(tagNames: Array<Uppercase<_HTMLElementNames>>): (event: Event) => boolean;
/**
* Creates a filter than can be passed to `<GlobalEvents />` to include events from elements with the given tag names.
*
* @see excludeElements
*
* @param tagNames - array of tag names to include
*/
declare function includeElements(tagNames: Array<Uppercase<_HTMLElementNames>>): (event: Event) => boolean;
type _HTMLElementNames = keyof HTMLElementTagNameMap;
export { EventFilter, GlobalEvents, GlobalEventsImpl, GlobalEventsProps, excludeElements };
export { EventFilter, GlobalEvents, GlobalEventsImpl, GlobalEventsProps, _HTMLElementNames, excludeElements, includeElements };
/*!
* vue-global-events v3.0.0
* vue-global-events v3.0.1
* (c) 2019-2023 Eduardo San Martin Morote, Damian Dulisz

@@ -36,3 +36,3 @@ * Released under the MIT License.

filter: {
type: Function,
type: [Function, Array],
default: () => () => true

@@ -72,3 +72,4 @@ },

(listener2) => (event) => {
if (isActive.value && props.filter(event, listener2, eventName)) {
const filters = Array.isArray(props.filter) ? props.filter : [props.filter];
if (isActive.value && filters.every((filter) => filter(event, listener2, eventName))) {
if (props.stop)

@@ -111,7 +112,18 @@ event.stopPropagation();

function excludeElements() {
function excludeElements(tagNames) {
return (event) => {
const target = event.target;
return !tagNames.includes(target.tagName);
};
}
function includeElements(tagNames) {
return (event) => {
const target = event.target;
return tagNames.includes(target.tagName);
};
}
exports.GlobalEvents = GlobalEvents;
exports.excludeElements = excludeElements;
exports.includeElements = includeElements;

@@ -118,0 +130,0 @@ return exports;

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

"packageManager": "pnpm@8.6.5",
"version": "3.0.0",
"version": "3.0.1",
"description": "Register global events using vue template shortcuts",

@@ -11,4 +11,4 @@ "main": "./dist/index.mjs",

"types": "./dist/index.d.ts",
"unpkg": "./dist/index.global.js",
"jsdelivr": "./dist/index.global.js",
"unpkg": "./dist/index.js",
"jsdelivr": "./dist/index.js",
"exports": {

@@ -15,0 +15,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

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