lesca-click
Advanced tools
Comparing version 4.2.2 to 4.3.0
export declare let dataset: any; | ||
export declare let enabled: boolean; | ||
export declare const add: (query: string, callback: Function) => void; | ||
@@ -9,2 +8,3 @@ export declare const remove: (query: string) => void; | ||
export declare const setPreventDefault: (value: boolean) => void; | ||
export declare const setEnabled: (value: boolean) => void; | ||
declare const Click: { | ||
@@ -18,4 +18,4 @@ install: (app?: string) => void; | ||
remove: (query: string) => void; | ||
enabled: boolean; | ||
setEnabled: (value: boolean) => void; | ||
}; | ||
export default Click; |
@@ -24,3 +24,3 @@ var __assign = (this && this.__assign) || function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.setPreventDefault = exports.addPreventExcept = exports.clear = exports.install = exports.remove = exports.add = exports.enabled = exports.dataset = void 0; | ||
exports.setEnabled = exports.setPreventDefault = exports.addPreventExcept = exports.clear = exports.install = exports.remove = exports.add = exports.dataset = void 0; | ||
exports.dataset = {}; | ||
@@ -35,7 +35,6 @@ var mousePropertyDown = { x: 0, y: 0 }; | ||
}; | ||
var state = { device: '', isPress: false, deviation: 30, preventDefault: true }; | ||
var state = { device: '', isPress: false, deviation: 30, preventDefault: true, enabled: true }; | ||
var eventProperty = { passive: false, capture: false }; | ||
var exceptParentClassIDDataset = []; | ||
var rootElement = ''; | ||
exports.enabled = true; | ||
var checkDataset = function (e) { | ||
@@ -111,3 +110,3 @@ var target = e.target; | ||
return; | ||
if (exports.enabled) | ||
if (state.enabled) | ||
areWePreventDefault(e); | ||
@@ -194,2 +193,6 @@ var dx = mousePropertyDown.x, dy = mousePropertyDown.y; | ||
exports.setPreventDefault = setPreventDefault; | ||
var setEnabled = function (value) { | ||
state.enabled = value; | ||
}; | ||
exports.setEnabled = setEnabled; | ||
var Click = { | ||
@@ -203,5 +206,5 @@ install: exports.install, | ||
remove: exports.remove, | ||
enabled: exports.enabled, | ||
setEnabled: exports.setEnabled, | ||
}; | ||
exports.default = Click; | ||
}); |
{ | ||
"name": "lesca-click", | ||
"version": "4.2.2", | ||
"version": "4.3.0", | ||
"description": "use for prevent browser default behavior. usually used in web without scroll app.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -26,7 +26,6 @@ import { GET_DEVICE, CHECK_PARENT_HAS_CLASS, FIND_ROOT } from './constants'; | ||
}; | ||
const state = { device: '', isPress: false, deviation: 30, preventDefault: true }; | ||
const state = { device: '', isPress: false, deviation: 30, preventDefault: true, enabled: true }; | ||
const eventProperty = { passive: false, capture: false }; | ||
let exceptParentClassIDDataset: string[] = []; | ||
let rootElement = ''; | ||
export let enabled = true; | ||
@@ -108,3 +107,3 @@ const checkDataset = (e: TouchEvent | MouseEvent) => { | ||
if (enabled) areWePreventDefault(e); | ||
if (state.enabled) areWePreventDefault(e); | ||
@@ -194,2 +193,6 @@ const { x: dx, y: dy } = mousePropertyDown; | ||
export const setEnabled = (value: boolean) => { | ||
state.enabled = value; | ||
}; | ||
const Click = { | ||
@@ -203,5 +206,5 @@ install, | ||
remove, | ||
enabled, | ||
setEnabled, | ||
}; | ||
export default Click; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
356489
1989