Socket
Socket
Sign inDemoInstall

@bity/preact-base-components

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bity/preact-base-components - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

2

package.json
{
"name": "@bity/preact-base-components",
"version": "1.2.0",
"version": "1.3.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "scripts": {

@@ -10,4 +10,3 @@ import { h, Component } from 'preact';

this.state = {
isDirty: false,
value
isDirty: false
};

@@ -20,20 +19,10 @@ this.onInput = this.onInput.bind(this);

const {
onInput = () => {}
} = this.props;
const {
value = ''
} = event.target;
this.processInputValue(value);
onInput(value, undefined, USER_TYPING);
}
processInputValue(value) {
const {
onInput = () => {},
validators = []
} = this.props;
const isValid = validators.reduce((result, validator) => result && validator.checker(value), true);
onInput(value, isValid);
this.setState({
value,
isValid
});
}
onBlur(e) {

@@ -45,26 +34,16 @@ const {

isDirty: true
}, () => {
onBlur(e);
});
onBlur(e);
}
componentDidMount() {
const {
value = ''
} = this.state;
const {
onInput = () => {}
} = this.props;
if (value) {
this.processInputValue(value);
} else {
// mark freshly rendered field as invalid
onInput('', false);
componentDidUpdate(prevProps, prevState) {
if (this.props.value != prevProps.value) {
const {
onInput = () => {}
} = this.props;
onInput(this.props.value);
}
}
componentWillReceiveProps(nextProps, nextState) {
this.state.value = nextProps.value;
}
render() {

@@ -79,7 +58,7 @@ const {

validators = [],
onKeyPress
onKeyPress,
value = ''
} = this.props;
const {
isDirty,
value
isDirty
} = this.state;

@@ -86,0 +65,0 @@ return h("div", null, !rows && h("input", {

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