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 2.2.10 to 2.3.0

2

dist/Types.d.ts

@@ -17,2 +17,4 @@ export declare type ElementsObject = {

acceptNegative: boolean;
maxValue: number | null;
minValue: number | null;
};

@@ -19,0 +21,0 @@ declare type Paritial<T> = {

29

lib/JBInput.ts

@@ -16,5 +16,4 @@ import HTML from './JBInput.html';

step: 1,
//TODO: add min and max limit on type
// maxValue:20,
// minValue:10,
maxValue:null,
minValue:null,
//how many decimal place we accept

@@ -141,3 +140,3 @@ decimalPrecision: null,

//if our input type is number and user want to set it to new value we do nececcery logic here
const value: number = parseFloat(valueString);
let value: number = parseFloat(valueString);
if (isNaN(value)) {

@@ -147,9 +146,11 @@ //we change nothing

}
//TODO: add max and min checker to prevent bigger value assignment
// if(value> this.numberFieldParameters.maxValue){
// return `${this.numberFieldParameters.maxValue}`;
// }
// if(value< this.numberFieldParameters.minValue){
// return `${this.numberFieldParameters.minValue}`;
// }
//add max and min checker to prevent bigger value assignment
if(this.numberFieldParameters.maxValue && value> this.numberFieldParameters.maxValue){
value = this.numberFieldParameters.maxValue;
valueString = `${this.numberFieldParameters.maxValue}`;
}
if(this.numberFieldParameters.minValue && value< this.numberFieldParameters.minValue){
value = this.numberFieldParameters.minValue;
valueString = `${this.numberFieldParameters.minValue}`;
}
const[integerNums, decimalNums] = valueString.split('.');

@@ -297,2 +298,8 @@

}
if(numberFieldParameters && typeof numberFieldParameters.maxValue == 'number'){
this.numberFieldParameters.maxValue = numberFieldParameters.maxValue;
}
if(numberFieldParameters && typeof numberFieldParameters.minValue == 'number'){
this.numberFieldParameters.minValue = numberFieldParameters.minValue;
}
this.value = `${this.value}`;

@@ -299,0 +306,0 @@ }

@@ -17,2 +17,4 @@ export type ElementsObject = {

acceptNegative:boolean;
maxValue:number | null;
minValue:number | null;
}

@@ -19,0 +21,0 @@ type Paritial<T> = {

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

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

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

@@ -121,2 +121,6 @@ # jb-input

acceptNegative:true,
// max number value user can input. if user input bigger number it will be set to max
maxValue: 1000,
//min number value user can input. if user input smaller number it will be set to this value.
minValue:1
})

@@ -123,0 +127,0 @@ ```

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