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

jb-input

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jb-input - npm Package Compare versions

Comparing version 1.2.19 to 1.3.19

34

lib/JBInput.js

@@ -53,3 +53,3 @@ import { number } from 'prop-types';

mode: 'open',
delegatesFocus:true,
delegatesFocus: true,
});

@@ -102,3 +102,3 @@ const html = `<style>${CSS}</style>` + '\n' + HTML;

// truncate extra decimal
const checkRegex = new RegExp(`^-?\\d+(?:\\.\\d{0,${this.numberFieldParameters.decimalPrecision}})?`) ;
const checkRegex = new RegExp(`^-?\\d+(?:\\.\\d{0,${this.numberFieldParameters.decimalPrecision}})?`);
valueString = valueString.match(checkRegex)[0];

@@ -132,7 +132,7 @@ }

//if user type or paste something not a number, this char will be filled the replacement in most cases will be '0'
invalidNumberReplacement:''
invalidNumberReplacement: ''
};
}
static get observedAttributes() {
return ['label', 'type', 'message', 'value', 'name', 'autocomplete', 'placeholder', 'disabled'];
return ['label', 'type', 'message', 'value', 'name', 'autocomplete', 'placeholder', 'disabled', 'inputmode'];
}

@@ -179,9 +179,13 @@ attributeChangedCallback(name, oldValue, newValue) {

case 'disabled':
if(value == '' || value ==="true"){
if (value == '' || value === "true") {
this.#disabled = true;
this.elements.input.setAttribute('disabled','true');
}else if(value=="false"){
this.elements.input.setAttribute('disabled', 'true');
} else if (value == "false") {
this.#disabled = false;
this.elements.input.removeAttribute('disabled');
}
break;
case 'inputmode':
this.elements.input.setAttribute("inputmode",value);
}

@@ -200,10 +204,10 @@

*/
setNumberFieldParameter({step,decimalPrecision,invalidNumberReplacement}){
if(step && !isNaN(step)){
setNumberFieldParameter({ step, decimalPrecision, invalidNumberReplacement }) {
if (step && !isNaN(step)) {
this.numberFieldParameters.step = step;
}
if(decimalPrecision && !isNaN(decimalPrecision)){
if (decimalPrecision && !isNaN(decimalPrecision)) {
this.numberFieldParameters.decimalPrecision = decimalPrecision;
}
if(invalidNumberReplacement){
if (invalidNumberReplacement) {
this.numberFieldParameters.invalidNumberReplacement = invalidNumberReplacement;

@@ -229,9 +233,9 @@ }

//handle up and down on number key
if(this.getAttribute('type') == "number"){
if (this.getAttribute('type') == "number") {
const key = e.key;
if(key == "ArrowUp"){
if (key == "ArrowUp") {
this.increaseNumber();
e.preventDefault();
}
if(key == "ArrowDown"){
if (key == "ArrowDown") {
this.decreaseNumber();

@@ -292,3 +296,3 @@ e.preventDefault();

}
dispatchOnChangeEvent(){
dispatchOnChangeEvent() {
const validationObject = this.checkInputValidation(this.value);

@@ -295,0 +299,0 @@ const event = new CustomEvent('change', {

@@ -17,3 +17,3 @@ {

],
"version": "1.2.19",
"version": "1.3.19",
"bugs": "https://github.com/javadbat/jb-input/issues",

@@ -20,0 +20,0 @@ "license": "MIT",

@@ -122,3 +122,4 @@ # jb-input

| direction | set web-component direction defualt set is rtl but if you need ltr use `<jb-input direction="ltr"></jb-input>` |
| disabled | disable the input |
| disabled | disable the input |
| inputmode | set input mode help mobile device to open proper keyboard for your input like `url`, `search` and `numeric` |

@@ -125,0 +126,0 @@ ### set custome style

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

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