{"_id":"@darlonhenrique/react-native-mask-text","_rev":"2-fd84485ca47f92e675747611045213da","name":"@darlonhenrique/react-native-mask-text","description":"A React Native and Expo library to mask text","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.0":{"name":"@darlonhenrique/react-native-mask-text","version":"0.0.0","keywords":["react","react-native","input","mask","expo","text-input"],"author":{"url":"https://github.com/darlonhenrique","name":"Darlon Henrique","email":"darlonhenrisouza@gmail.com"},"license":"MIT","_id":"@darlonhenrique/react-native-mask-text@0.0.0","maintainers":[{"name":"darlonhenrique","email":"darlonhenrisouza@gmail.com"}],"homepage":"https://github.com/DarlonHenrique/react-native-mask-text#readme","bugs":{"url":"https://github.com/DarlonHenrique/react-native-mask-text/issues"},"dist":{"shasum":"e817d5e17d183c7abb477f80fc321f878260cb20","tarball":"https://registry.npmjs.org/@darlonhenrique/react-native-mask-text/-/react-native-mask-text-0.0.0.tgz","fileCount":88,"integrity":"sha512-nnDqc4YUQKWg1fcY2Y+iLp0407iNmjtdtVrpxw4juVNrcun3DiNssE+P2RvS6dA+v6MiNGpyB4TOPsTbkC/Adw==","signatures":[{"sig":"MEYCIQD65eq2uOeL6GNQujIm5VODH3hATpB9gKhpaYVKa2RZIgIhAKcqeSLffeKVQI14HQ3qNBVSa40yhNTCnyOM6ennMuIv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146058},"main":"lib/commonjs/index","types":"lib/typescript/src/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"8895e7524337857ebfde48127c91bd1d9bb7a993","scripts":{"lint":"eslint src/**/*.{ts,tsx}","test":"jest --maxWorkers=4","prepare":"bob build","lint:fix":"eslint src/**/*.{ts,tsx} --fix"},"_npmUser":{"name":"darlonhenrique","email":"darlonhenrisouza@gmail.com"},"repository":{"url":"git+https://github.com/DarlonHenrique/react-native-mask-text.git","type":"git"},"_npmVersion":"10.2.3","description":"A React Native and Expo library to mask text","directories":{},"resolutions":{"react-native/@jest/create-cache-key-function":"^27.0.2"},"_nodeVersion":"20.9.0","dependencies":{"bignumber.js":"^9.0.1"},"react-native":"lib/commonjs/index","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","react":"17.0.2","eslint":"^7.30.0","ts-jest":"^27.0.3","prettier":"^2.3.2","react-dom":"17.0.2","babel-jest":"^27.0.2","dotenv-cli":"^4.0.0","typescript":"^4.2.3","@types/jest":"^26.0.23","react-native":"0.64.2","@types/react-native":"^0.64.5","eslint-plugin-react":"^7.24.0","react-test-renderer":"^17.0.2","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.23.4","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.4.0","react-native-builder-bob":"^0.18.1","@typescript-eslint/parser":"^4.28.1","eslint-plugin-react-hooks":"^4.2.0","@testing-library/jest-native":"^4.0.1","@testing-library/react-native":"^7.2.0","@typescript-eslint/eslint-plugin":"^4.28.1","@babel/plugin-transform-object-assign":"^7.14.5","@babel/plugin-transform-react-jsx-source":"^7.14.5"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-mask-text_0.0.0_1699462012517_0.3140203783865432","host":"s3://npm-registry-packages"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"0.0.1":{"name":"@darlonhenrique/react-native-mask-text","version":"0.0.1","keywords":["react","react-native","input","mask","expo","text-input"],"author":{"url":"https://github.com/darlonhenrique","name":"Darlon Henrique","email":"darlonhenrisouza@gmail.com"},"license":"MIT","_id":"@darlonhenrique/react-native-mask-text@0.0.1","maintainers":[{"name":"darlonhenrique","email":"darlonhenrisouza@gmail.com"}],"homepage":"https://github.com/DarlonHenrique/react-native-mask-text#readme","bugs":{"url":"https://github.com/DarlonHenrique/react-native-mask-text/issues"},"dist":{"shasum":"163f4c4f312423400766a3cf4a304d32195f1146","tarball":"https://registry.npmjs.org/@darlonhenrique/react-native-mask-text/-/react-native-mask-text-0.0.1.tgz","fileCount":88,"integrity":"sha512-24HXENwjzFiJwhZJNpBvTKGwOKtd0W4DK6Oyn0uojLBA7VZ0jUDRU3tuQb99ntR4T3taIZ0+CymtHZDS2b/bWQ==","signatures":[{"sig":"MEUCIAYhUo2FlcGbIRcg0ZAq/LTO4wrw6+FIJw8XuivLZLqSAiEAu/ayMenryZWbl5z8Dqy+xMkUhPKf2B2f4mBCYJh8jms=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":146099},"main":"lib/commonjs/index","types":"lib/typescript/src/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"a630605b1890343038741f5051abf7f2aa0b9c3b","scripts":{"lint":"eslint src/**/*.{ts,tsx}","test":"jest --maxWorkers=4","prepare":"bob build","lint:fix":"eslint src/**/*.{ts,tsx} --fix"},"_npmUser":{"name":"darlonhenrique","email":"darlonhenrisouza@gmail.com"},"repository":{"url":"git+https://github.com/DarlonHenrique/react-native-mask-text.git","type":"git"},"_npmVersion":"10.2.3","description":"A React Native and Expo library to mask text","directories":{},"resolutions":{"react-native/@jest/create-cache-key-function":"^27.0.2"},"_nodeVersion":"20.9.0","dependencies":{"bignumber.js":"^9.0.1"},"react-native":"lib/commonjs/index","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.0.4","react":"17.0.2","eslint":"^7.30.0","ts-jest":"^27.0.3","prettier":"^2.3.2","react-dom":"17.0.2","babel-jest":"^27.0.2","dotenv-cli":"^4.0.0","typescript":"^4.2.3","@types/jest":"^26.0.23","react-native":"0.64.2","@types/react-native":"^0.64.5","eslint-plugin-react":"^7.24.0","react-test-renderer":"^17.0.2","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.23.4","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.4.0","react-native-builder-bob":"^0.18.1","@typescript-eslint/parser":"^4.28.1","eslint-plugin-react-hooks":"^4.2.0","@testing-library/jest-native":"^4.0.1","@testing-library/react-native":"^7.2.0","@typescript-eslint/eslint-plugin":"^4.28.1","@babel/plugin-transform-object-assign":"^7.14.5","@babel/plugin-transform-react-jsx-source":"^7.14.5"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-mask-text_0.0.1_1699462391739_0.39168836001664986","host":"s3://npm-registry-packages"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"0.0.2":{"name":"@darlonhenrique/react-native-mask-text","version":"0.0.2","description":"A React Native and Expo library to mask text","keywords":["react","react-native","input","mask","expo","text-input"],"main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/src/index.d.ts","react-native":"lib/commonjs/index","source":"src/index","repository":{"type":"git","url":"git+https://github.com/DarlonHenrique/react-native-mask-text.git"},"author":{"name":"Darlon Henrique","email":"darlonhenrisouza@gmail.com","url":"https://github.com/darlonhenrique"},"license":"MIT","bugs":{"url":"https://github.com/DarlonHenrique/react-native-mask-text/issues"},"homepage":"https://github.com/DarlonHenrique/react-native-mask-text#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"scripts":{"lint":"eslint src/**/*.{ts,tsx}","lint:fix":"eslint src/**/*.{ts,tsx} --fix","test":"jest --maxWorkers=4","prepare":"bob build"},"dependencies":{"bignumber.js":"^9.0.1"},"devDependencies":{"@babel/plugin-transform-object-assign":"^7.14.5","@babel/plugin-transform-react-jsx-source":"^7.14.5","@testing-library/jest-native":"^4.0.1","@testing-library/react-native":"^7.2.0","@types/jest":"^26.0.23","@types/react-native":"^0.64.5","@typescript-eslint/eslint-plugin":"^4.28.1","@typescript-eslint/parser":"^4.28.1","babel-jest":"^27.0.2","dotenv-cli":"^4.0.0","eslint":"^7.30.0","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.23.4","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.4.0","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","jest":"^27.0.4","prettier":"^2.3.2","react":"17.0.2","react-dom":"17.0.2","react-native":"0.64.2","react-native-builder-bob":"^0.18.1","react-test-renderer":"^17.0.2","ts-jest":"^27.0.3","typescript":"^4.2.3"},"peerDependencies":{"react":"*","react-native":"*"},"resolutions":{"react-native/@jest/create-cache-key-function":"^27.0.2"},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"_id":"@darlonhenrique/react-native-mask-text@0.0.2","gitHead":"c307b261599ad773bffb548e7246bec9b838a41d","_nodeVersion":"22.2.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-kOD0a7VAO1Wj8g+i3ToFNBSfMdZXu4MUVhjO/NlK/1kqjGDd6R5xk6qQ4J+ZylDZFzqF9LY0/XIIPn/fCCIodA==","shasum":"fa522851c5bffeb96a737d301676593b985c0440","tarball":"https://registry.npmjs.org/@darlonhenrique/react-native-mask-text/-/react-native-mask-text-0.0.2.tgz","fileCount":88,"unpackedSize":142320,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvR4rj4NPjmZ836NWyA0VwlAMcY9SvSRFA39WCFxxUQAiEAykngPz/+Oxws/ghu09OLe3KuoOUWd8zLGC1oGsTFdZw="}]},"_npmUser":{"name":"darlonhenrique","email":"darlonhenrisouza@gmail.com"},"directories":{},"maintainers":[{"name":"darlonhenrique","email":"darlonhenrisouza@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-mask-text_0.0.2_1717348194140_0.21558421988704524"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-08T16:46:52.447Z","modified":"2024-06-02T17:09:54.467Z","0.0.0":"2023-11-08T16:46:52.751Z","0.0.1":"2023-11-08T16:53:11.861Z","0.0.2":"2024-06-02T17:09:54.306Z"},"maintainers":[{"name":"darlonhenrique","email":"darlonhenrisouza@gmail.com"}],"author":{"name":"Darlon Henrique","email":"darlonhenrisouza@gmail.com","url":"https://github.com/darlonhenrique"},"repository":{"type":"git","url":"git+https://github.com/DarlonHenrique/react-native-mask-text.git"},"keywords":["react","react-native","input","mask","expo","text-input"],"license":"MIT","homepage":"https://github.com/DarlonHenrique/react-native-mask-text#readme","bugs":{"url":"https://github.com/DarlonHenrique/react-native-mask-text/issues"},"readme":"# fork of react-native-mask-text (with modifications)\n\nThis is a library to mask Text and Input components in React Native and Expo (Android, iOS and Web).\n\n## Motivation\n\nThat package is a fork of [react-native-mask-text (fork)](https://github.com/Eduardo-lunardi/react-native-mask-text) which is fork of [react-native-mask-text (orignal)](https://github.com/akinncar/react-native-mask-text)\n\nThe original package appears to no longer be maintained, this fork is a way to continue the project by adding features and fixes\n\n## Install\n\n```shell\nyarn add @darlonhenrique/react-native-mask-text\n```\n\n## Custom Mask\n\nPattern used in masked components:\n\n- `9` - accept digit.\n- `A` - accept alpha.\n- `S` - accept alphanumeric.\n\nEx: AAA-9999\n\n### Usage MaskedTextInput (custom)\n\nComponent similar with `<TextInput />` but with custom mask option.\n\n```jsx\nimport { StyleSheet } from 'react-native'\nimport { MaskedTextInput } from 'react-native-mask-text'\n\n//...\n\n;<MaskedTextInput\n  mask=\"AAA-9999\"\n  onChangeText={(text, rawText) => {\n    console.log(text)\n    console.log(rawText)\n  }}\n  style={styles.input}\n/>\n\n//...\n\nconst styles = StyleSheet.create({\n  input: {\n    height: 40,\n    margin: 12,\n    borderWidth: 1,\n  },\n})\n```\n\n### Usage MaskedText (custom)\n\nComponent similar with `<Text />` but with custom mask option.\n\n```jsx\nimport { MaskedText } from 'react-native-mask-text'\n\n//...\n\n;<MaskedText mask=\"99/99/9999\">30081990</MaskedText>\n```\n\n## Date Mask\n\nThese options only are used if you use prop `type=\"date\"` in your component:\n\n| Option     | Type   | Mandatory | Default Value | Description |\n| ---------- | ------ | --------- | ------------- | ----------- |\n| dateFormat | string | No        | yyyy/mm/dd    | Date Format |\n\n### Usage MaskedTextInput (date)\n\nComponent similar with `<TextInput />` but with date mask option.\n\n```jsx\nimport { StyleSheet } from 'react-native'\nimport { MaskedTextInput } from 'react-native-mask-text'\n\n//...\n\n;<MaskedTextInput\n  type=\"date\"\n  options={{\n    dateFormat: 'YYYY/DD/MM',\n  }}\n  onChangeText={(text, rawText) => {\n    console.log(text)\n    console.log(rawText)\n  }}\n  style={styles.input}\n  keyboardType=\"numeric\"\n/>\n\n//...\n\nconst styles = StyleSheet.create({\n  input: {\n    height: 40,\n    margin: 12,\n    borderWidth: 1,\n  },\n})\n```\n\n## Time Mask\n\nThese options only are used if you use prop `type=\"time\"` in your component:\n\n| Option     | Type   | Mandatory | Default Value | Description |\n| ---------- | ------ | --------- | ------------- | ----------- |\n| timeFormat | string | No        | HH:mm:ss      | Time Format |\n\n### Usage MaskedTextInput (time)\n\nComponent similar with `<TextInput />` but with time mask option.\n\n```jsx\nimport { StyleSheet } from 'react-native'\nimport { MaskedTextInput } from 'react-native-mask-text'\n\n//...\n\n;<MaskedTextInput\n  type=\"time\"\n  options={{\n    timeFormat: 'HH:mm:ss', // or 'HH:mm'\n  }}\n  onChangeText={(text, rawText) => {\n    setMaskedValue(text)\n    setUnmaskedValue(rawText)\n  }}\n  style={styles.input}\n  keyboardType=\"numeric\"\n/>\n\n//...\n\nconst styles = StyleSheet.create({\n  input: {\n    height: 40,\n    margin: 12,\n    borderWidth: 1,\n  },\n})\n```\n\n## Currency Mask\n\nThese options only are used if you use prop `type=\"currency\"` in your component:\n\n| Option                 | Type   | Mandatory | Default Value | Description                                 |\n| ---------------------- | ------ | --------- | ------------- | ------------------------------------------- |\n| prefix                 | string | No        | null          | String to prepend                           |\n| decimalSeparator       | string | No        | null          | Separation for decimals                     |\n| groupSeparator         | string | No        | null          | Grouping separator of the integer part      |\n| precision              | number | No        | 0             | Precision for fraction part (cents)         |\n| groupSize              | number | No        | 3             | Primary grouping size of the integer part   |\n| secondaryGroupSize     | number | No        | null          | Secondary grouping size of the integer part |\n| fractionGroupSeparator | string | No        | null          | Grouping separator of the fraction part     |\n| fractionGroupSize      | number | No        | null          | Grouping size of the fraction part          |\n| suffix                 | string | No        | null          | String to append                            |\n\n### Usage MaskedTextInput (currency)\n\nComponent similar with `<TextInput />` but with currency mask option.\n\n```jsx\nimport { StyleSheet } from 'react-native'\nimport { MaskedTextInput } from 'react-native-mask-text'\n\n//...\n\n;<MaskedTextInput\n  type=\"currency\"\n  options={{\n    prefix: '$',\n    decimalSeparator: '.',\n    groupSeparator: ',',\n    precision: 2,\n  }}\n  onChangeText={(text, rawText) => {\n    console.log(text)\n    console.log(rawText)\n  }}\n  style={styles.input}\n  keyboardType=\"numeric\"\n/>\n\n//...\n\nconst styles = StyleSheet.create({\n  input: {\n    height: 40,\n    margin: 12,\n    borderWidth: 1,\n  },\n})\n```\n\n### Usage MaskedText (currency)\n\nComponent similar with `<Text />` but with currency mask option.\n\n```jsx\nimport { MaskedText } from 'react-native-mask-text'\n\n//...\n\n;<MaskedText\n  type=\"currency\"\n  options={{\n    prefix: '$',\n    decimalSeparator: '.',\n    groupSeparator: ',',\n    precision: 2,\n  }}\n>\n  5999\n</MaskedText>\n```\n\n## Usage `mask` function\n\nFunction used to mask text.\n\n```js\nimport { mask } from 'react-native-mask-text'\n\nconst code = mask('ABC1234', 'AAA-9999') // return ABC-1234\n```\n\n## Usage `unMask` function\n\nFunction used to remove text mask.\n\n```js\nimport { unMask } from 'react-native-mask-text'\n\nconst code = unMask('ABC-1234') // return ABC1234\n```\n\n## Example\n\nYou can see an example app with Expo CLI [here](example/App.js).\n\nYou can see a SignUp example on Expo Snack working with iOS, Mobile, and Web [here](https://snack.expo.dev/@brenont/react-native-mask-text-example).\n\n## Contributing\n\nSee [Contributing.md](CONTRIBUTING.md)\n\n## License\n\nThe app's source code is made available under the [MIT license](LICENSE). Some of the dependencies are licensed differently, with the BSD license, for example.\n\n## Contact\n\nDarlon Henrique - [Github](https://github.com/darlonhenrique) - **[darlonhenrisouza@gmail.com](mailto:darlonhenrisouza@gmail.com)**\n\n## tributes\n\n- https://github.com/akinncar (the original creator)\n- https://github.com/Eduardo-lunardi (the fork i used)\n","readmeFilename":"README.md"}