Socket
Book a DemoInstallSign in
Socket

afc163-test-package

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

afc163-test-package

React input-number component

latest
Source
npmnpm
Version
4.5.9-beta.0
Version published
Maintainers
1
Created
Source

rc-input-number

input number ui component for react

NPM version build status Test coverage david-dm deps devDependencies Status node version npm download

Screenshots

install

rc-input-number

Usage

var InputNumber = require('rc-input-number');
var React = require('react');
var ReactDOM = require('react-dom');
ReactDOM.render(<InputNumber defaultValue={19}/>, container);

Development

npm install
npm start

Example

http://127.0.0.1:8000/examples/

online example: http://react-component.github.io/input-number/examples/

API

props

nametypedefaultdescription
prefixClsstringrc-input-numberSpecifies the class prefix
minNumberSpecifies the minimum value
onClick
placeholderstring
maxNumberSpecifies the maximum value
stepNumber or String1Specifies the legal number intervals
precisionNumberSpecifies the precision length of value
disabledBooleanfalseSpecifies that an InputNumber should be disabled
focusOnUpDownBooleantruewhether focus input when click up or down button
requiredBooleanfalseSpecifies that an InputNumber is required
autoFocusBooleanfalseSpecifies that an InputNumber should automatically get focus when the page loads
readOnlyBooleanfalseSpecifies that an InputNumber is read only
nameStringSpecifies the name of an InputNumber
idStringSpecifies the id of an InputNumber
valueNumberSpecifies the value of an InputNumber
defaultValueNumberSpecifies the defaultValue of an InputNumber
onChangeFunctionCalled when value of an InputNumber changed
onPressEnterFunctionThe callback function that is triggered when Enter key is pressed.
onFocusFunctionCalled when an element gets focus
styleObjectroot style. such as {width:100}
upHandlerReact.Nodecustom the up step element
downHandlerReact.Nodecustom the down step element
formatter(value: number|string): displayValue: stringSpecifies the format of the value presented
parser(displayValue: string) => value: number`input => input.replace(/[^\w\.-]*/g, '')`Specifies the value extracted from formatter
patternstringSpecifies a regex pattern to be added to the input number element - useful for forcing iOS to open the number pad instead of the normal keyboard (supply a regex of "\d*" to do this) or form validation
decimalSeparatorstringSpecifies the decimal separator
inputModestringSpecifies the inputmode of input

Keyboard Navigation

  • When you hit the or key, the input value will be increased or decreased by step
  • With the Shift key (Shift+⬆, Shift+⬇), the input value will be changed by 10 * step
  • With the Ctrl or key (Ctrl+⬆ or ⌘+⬆ or Ctrl+⬇ or ⌘+⬇ ), the input value will be changed by 0.1 * step

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rc-input-number is released under the MIT license.

Keywords

react

FAQs

Package last updated on 23 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts