{"id":22382462,"url":"https://github.com/jcoreio/redux-form-numeric-field","last_synced_at":"2025-03-26T19:41:03.110Z","repository":{"id":29239564,"uuid":"117291880","full_name":"jcoreio/redux-form-numeric-field","owner":"jcoreio","description":"a customized redux-form Field for entering numbers","archived":false,"fork":false,"pushed_at":"2024-03-05T23:49:03.000Z","size":4576,"stargazers_count":0,"open_issues_count":27,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T01:41:37.902Z","etag":null,"topics":["form-validation","formatted-input","input-validation","numeric-input","redux-form"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcoreio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-12T21:59:10.000Z","updated_at":"2024-03-05T23:48:10.000Z","dependencies_parsed_at":"2023-01-14T14:27:32.147Z","dependency_job_id":null,"html_url":"https://github.com/jcoreio/redux-form-numeric-field","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fredux-form-numeric-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fredux-form-numeric-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fredux-form-numeric-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fredux-form-numeric-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcoreio","download_url":"https://codeload.github.com/jcoreio/redux-form-numeric-field/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245726847,"owners_count":20662545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["form-validation","formatted-input","input-validation","numeric-input","redux-form"],"created_at":"2024-12-05T00:13:06.581Z","updated_at":"2025-03-26T19:41:03.086Z","avatar_url":"https://github.com/jcoreio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-form-numeric-field\n\n[![Build Status](https://travis-ci.org/jcoreio/redux-form-numeric-field.svg?branch=master)](https://travis-ci.org/jcoreio/redux-form-numeric-field)\n[![Coverage Status](https://codecov.io/gh/jcoreio/redux-form-numeric-field/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/redux-form-numeric-field)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![npm version](https://badge.fury.io/js/redux-form-numeric-field.svg)](https://badge.fury.io/js/redux-form-numeric-field)\n\nA customized `redux-form` `Field` for entering numbers. It isn't contrary; it won't stop you from typing, pasting, or cutting\nany characters, though it will produce a \"must be a number\" validation error immediately if the current input is invalid.\nWhen it loses focus it will normalize its value to a number, if valid; otherwise it will trim its value but leave it as a string.\n\n## Usage\n\n```sh\nnpm install --save redux-form-numeric-field\n```\n\n```js\nconst { NumericField } = require('redux-form-numeric-field')\n```\n\nor\n\n```js\nconst { NumericField } = require('redux-form-numeric-field/immutable')\n```\n\n## Example\n\nThe following field will normalize its value to a number when it loses focus\n(unless the text is not a valid number, in which case it will just trim the text when it loses focus).\n\n```js\n\u003cNumericField name=\"value\" component={YourInputComponent} /\u003e\n```\n\n## API\n\n### `NumericField`\n\nHas the same API as `redux-form`'s `Field`, but normalizes its value to a number when it loses focus\n(unless the text is not a valid number, in which case it will just trim the text when it loses focus).\n\n#### `normalizeNumber?: (value: ?(string | number)) =\u003e ?(string | number)`\n\nAllows you to override the default implementation which is called on blur. If `value` is a `number` or\ncorrectly-formatted `string`, return a `number`; otherwise, return a `string` or `null`.\n\n#### `normalizeOnBlur?: (value: ?(string | number)) =\u003e ?(string | number)`\n\nIf you provide this, it will be called with the output of `normalizeNumber` when the field loses focus.\n\n#### `validate?: Validator | Array\u003cValidator\u003e`\n\nUnlike a normal `Field`, `NumericField` will call your validators with the normalized value from\n`normalizeNumber`. If its value is an invalid number but not whitespace, it will produce a\n\"must be a number\" validation error without calling your own validators.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcoreio%2Fredux-form-numeric-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcoreio%2Fredux-form-numeric-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcoreio%2Fredux-form-numeric-field/lists"}