1.0.2 • Published 4 years ago

input-builderx v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

InputX

Overview

Enhanced html input with validation, data input and output processing.

Installation

yarn add input-builderx

or

npm install input-builderx --save

Demo

Try the demo here.

Usage

Import the React component

import { InputX } from 'input-builderx';
<InputX
  value={this.state.val}
  onChange={(e: any) => this.setState({ val: e.target.value })}
  validator={e => e.target.value % 2 == 0}
  inputProcessor={e => Math.round(e.target.value / 10) * 10}
  outputProcessor={e => Math.round(e.target.value / 10) * 10}
/>

API

EventDescription
validatorfunction. Optional. Checks the validity of the user input. If it returns true then the onChange function is called.
inputProcessorfunction. Optional. Processor function for the value prop.
outputProcessorfunction. Optional. Processor function for the user input values that will be passed to onChange after processing.

License

Licensed under the MIT license.

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago