🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

dw-neit-rc-input-number

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dw-neit-rc-input-number

React input-number component

latest
npmnpm
Version
9.2.0
Version published
Maintainers
1
Created
Source

dw-neit-rc-input-number

Input number control.

NPM version npm download build status Codecov bundle size dumi

Screenshots

Install

dw-neit-rc-input-number

Usage

import InputNumber from 'dw-neit-rc-input-number';

export default () => <InputNumber defaultValue={10} />;

Development

npm install
npm start

Example

http://127.0.0.1:8000/examples/

online example: https://input-number.vercel.app/

API

props

nametypedefaultdescription
prefixClsstringdw-neit-rc-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
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
controlsBooleantrueWhether to enable the control buttons
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
onBlurFunctionCalled when user leaves an input field
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
wheelBooleantrueAllows changing value with mouse wheel

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

Mouse Wheel

  • When you scroll up or down, the input value will be increased or decreased by step
  • Scrolling with the Shift key, the input value will be changed by 10 * step

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

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

Keywords

react

FAQs

Package last updated on 19 Aug 2024

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