You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

nextalys-js-helpers

Package Overview
Dependencies
Maintainers
1
Versions
450
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextalys-js-helpers - npm Package Compare versions

Comparing version

to
0.2.132

2

dist/browser-helpers/browser-helpers.d.ts

@@ -8,3 +8,3 @@ export declare class BrowserHelpers {

static stripHtml(html: string, returnOriginalIfNoDocument?: boolean): string;
static bindIntegerInputEvent(elem: HTMLInputElement, acceptKeys?: number[]): void;
static bindIntegerInputEvent(elem: HTMLInputElement, acceptKeys?: (number[] | null), acceptDecimals?: boolean): void;
static bindPhoneInputEvent(elem: HTMLInputElement, acceptKeys?: number[]): void;

@@ -11,0 +11,0 @@ static bindPriceInputEvent(elem: HTMLInputElement, acceptKeys?: (number[] | null), acceptDotAndCommas?: boolean): void;

@@ -96,10 +96,23 @@ "use strict";

};
BrowserHelpers.bindIntegerInputEvent = function (elem, acceptKeys) {
if (acceptKeys === void 0) { acceptKeys = []; }
BrowserHelpers.bindIntegerInputEvent = function (elem, acceptKeys, acceptDecimals) {
if (acceptKeys === void 0) { acceptKeys = [13]; }
if (!elem)
return;
if (acceptKeys == null) {
acceptKeys = [13];
}
if (acceptDecimals) {
if (!acceptKeys) {
acceptKeys = [];
}
acceptKeys.push(46, 110, 44);
}
elem.addEventListener('keypress', function (evt) {
var charCode = evt.charCode || evt.which || evt.keyCode;
if ((!(acceptKeys === null || acceptKeys === void 0 ? void 0 : acceptKeys.length) || acceptKeys.indexOf(charCode) == -1) && !main_helpers_1.MainHelpers.isIntegerCharCode(charCode) && !main_helpers_1.MainHelpers.isSpecialCharCode(charCode))
if ((!(acceptKeys === null || acceptKeys === void 0 ? void 0 : acceptKeys.length) || acceptKeys.indexOf(charCode) == -1) && !main_helpers_1.MainHelpers.isIntegerCharCode(charCode) && !main_helpers_1.MainHelpers.isSpecialCharCode(charCode)) {
evt.preventDefault();
}
if (acceptDecimals && elem.value.indexOf(',') > -1) {
elem.value = main_helpers_1.MainHelpers.replaceAll(elem.value, ',', '.');
}
});

@@ -106,0 +119,0 @@ };

{
"name": "nextalys-js-helpers",
"version": "0.2.131",
"version": "0.2.132",
"description": "Nextalys Javascript Helpers",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet