nextalys-js-helpers
Advanced tools
Comparing version
@@ -10,3 +10,3 @@ export declare class BrowserHelpers { | ||
static bindPhoneInputEvent(elem: HTMLInputElement, acceptKeys?: number[]): void; | ||
static bindPriceInputEvent(elem: HTMLInputElement, acceptKeys?: number[]): void; | ||
static bindPriceInputEvent(elem: HTMLInputElement, acceptKeys?: (number[] | null), acceptDotAndCommas?: boolean): void; | ||
static isMobileUserAgent(): boolean; | ||
@@ -13,0 +13,0 @@ static openFullscreen(element?: HTMLElement): void; |
@@ -119,4 +119,5 @@ "use strict"; | ||
}; | ||
BrowserHelpers.bindPriceInputEvent = function (elem, acceptKeys) { | ||
BrowserHelpers.bindPriceInputEvent = function (elem, acceptKeys, acceptDotAndCommas) { | ||
if (acceptKeys === void 0) { acceptKeys = [13]; } | ||
if (acceptDotAndCommas === void 0) { acceptDotAndCommas = false; } | ||
if (!elem) | ||
@@ -128,2 +129,12 @@ return; | ||
} | ||
if (acceptKeys == null) { | ||
acceptKeys = [13]; | ||
} | ||
if (acceptDotAndCommas) { | ||
if (!acceptKeys) { | ||
acceptKeys = []; | ||
} | ||
acceptKeys.push(46, 110, 44); | ||
} | ||
// console.log("Log ~ BrowserHelpers ~ bindPriceInputEvent ~ acceptKeys:", acceptKeys); | ||
elem.addEventListener('keyup', function (evt) { | ||
@@ -136,2 +147,5 @@ var charCode = evt.charCode || evt.which || evt.keyCode; | ||
|| charCode === 8)) { | ||
if (acceptDotAndCommas && elem.value.indexOf(',') > -1) { | ||
elem.value = main_helpers_1.MainHelpers.replaceAll(elem.value, ',', '.'); | ||
} | ||
elem.value = main_helpers_1.MainHelpers.formatFrenchPrice(elem.value); | ||
@@ -138,0 +152,0 @@ } |
{ | ||
"name": "nextalys-js-helpers", | ||
"version": "0.2.129", | ||
"version": "0.2.130", | ||
"description": "Nextalys Javascript Helpers", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"scripts": { | ||
@@ -11,4 +12,6 @@ "build": "tsc", | ||
"build:test": "tsc --p tsconfig.test.json", | ||
"browserify": "npm run build:test && browserify dist-test/test.js -o bundle.js", | ||
"build-and-open-test-page": "npm run browserify && open-cli ./test.html" | ||
"build-and-open-test-page": "vite", | ||
"dev": "vite", | ||
"build-two": "tsc && vite build", | ||
"preview": "vite preview" | ||
}, | ||
@@ -38,2 +41,3 @@ "author": "Nextalys", | ||
"vcard-creator": "0.5.0", | ||
"vite": "^5.2.11", | ||
"xlsx": "0.16.9", | ||
@@ -40,0 +44,0 @@ "xmlhttprequest": "^1.8.0" |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1218648
0.1%195
0.52%18838
0.1%Yes
NaN23
4.55%