MCPcopy
hub / github.com/s-yadav/react-number-format

github.com/s-yadav/react-number-format @v5.4.5 sqlite

repository ↗ · DeepWiki ↗ · release v5.4.5 ↗
144 symbols 340 edges 88 files 1 documented · 1%
README

react-number-format

React Number Format is an input-formatter library with a sophisticated and light weight caret engine. It ensures that a user can only enter text that meets specific numeric or string patterns, and formats the input value for display.

Features

  1. Prefix, suffix and thousands separator.
  2. Input Masking.
  3. Format number in an input or format as a simple text.
  4. Custom pattern formatting.
  5. Custom formatting handler.
  6. Fully customizable

Demos

See the many DEMO sections in the documentation.

Install

npm

Using npm

npm install react-number-format

Using yarn

yarn add react-number-format

Documentation

Read the full documentation here https://s-yadav.github.io/react-number-format/docs/intro

ES6

Numeric Format

import { NumericFormat } from 'react-number-format';

NumericFormat Props: https://s-yadav.github.io/react-number-format/docs/numeric_format

Pattern Format

import { PatternFormat } from 'react-number-format';

PatternFormat Props: https://s-yadav.github.io/react-number-format/docs/pattern_format

Migrate from v4 to v5

https://s-yadav.github.io/react-number-format/docs/migration

v4 doc

v4 Docs

Development

  • Clone the repository or download the zip
  • npm i -g yarn to download Yarn
  • yarn to install dependencies
  • yarn start to run example server (http://localhost:8084/)
  • yarn test to test changes
  • yarn build to bundle files

Testing

Test cases are written in jasmine and run by karma

Test files : /test/**/*.spec.js

To run test : yarn test

Extension points exported contracts — how you extend this code

NumberFormatState (Interface)
(no doc)
src/types.ts
NumberFormatValues (Interface)
(no doc)
src/types.ts
SourceInfo (Interface)
(no doc)
src/types.ts
SyntheticInputEvent (Interface)
(no doc)
src/types.ts

Core symbols most depended-on inside this repo

simulateKeyInput
called by 176
test/test_util.js
render
called by 162
test/test_util.js
getCaretBoundary
called by 13
src/numeric_format.tsx
simulateBlurEvent
called by 12
test/test_util.js
toNumericString
called by 12
src/utils.tsx
simulateMouseUpEvent
called by 11
test/test_util.js
cardExpiry
called by 10
custom_formatters/card_expiry.js
isNil
called by 9
src/utils.tsx

Shape

Function 117
Class 16
Method 6
Interface 4
Enum 1

Languages

TypeScript100%

Modules by API surface

src/utils.tsx29 symbols
src/numeric_format.tsx19 symbols
src/number_format_base.tsx17 symbols
src/pattern_format.tsx13 symbols
test/test_util.js12 symbols
example/src/index.js12 symbols
test/types/number_format.spec.tsx7 symbols
flow-typed/npm/enzyme_v3.x.x.js6 symbols
test/library/keypress_and_caret.spec.jsx5 symbols
test/library/input_numeric_format.spec.jsx5 symbols
test/library/input.spec.jsx5 symbols
src/types.ts5 symbols

Dependencies from manifests, versioned

@babel/cli7.6.2 · 1×
@babel/core7.6.2 · 1×
@babel/plugin-proposal-class-properties7.5.5 · 1×
@babel/plugin-proposal-object-rest-spread7.6.2 · 1×
@babel/plugin-transform-flow-strip-types7.4.4 · 1×
@babel/preset-env7.6.2 · 1×
@babel/preset-react7.0.0 · 1×
@babel/register7.6.2 · 1×
@cmfcmf/docusaurus-search-local0.11.0 · 1×
@docusaurus/core2.0.0-beta.18 · 1×
@docusaurus/preset-classic2.0.0-beta.18 · 1×
@mdx-js/react1.6.22 · 1×

For agents

$ claude mcp add react-number-format \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact